@undp/data-viz 1.2.8 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (496) hide show
  1. package/dist/AreaChart.d.ts +224 -0
  2. package/dist/AreaChart.js +2 -0
  3. package/dist/AreaChart.js.map +1 -0
  4. package/dist/Axis-BlyBRMNw.cjs +2 -0
  5. package/dist/Axis-BlyBRMNw.cjs.map +1 -0
  6. package/dist/Axis-CvK-w3E2.js +44 -0
  7. package/dist/Axis-CvK-w3E2.js.map +1 -0
  8. package/dist/AxisTitle-BY8MI9jC.cjs +2 -0
  9. package/dist/AxisTitle-BY8MI9jC.cjs.map +1 -0
  10. package/dist/AxisTitle-BeMxcw5I.js +21 -0
  11. package/dist/AxisTitle-BeMxcw5I.js.map +1 -0
  12. package/dist/BarGraph.d.ts +460 -0
  13. package/dist/BarGraph.js +2 -0
  14. package/dist/BarGraph.js.map +1 -0
  15. package/dist/BasicStatCard.d.ts +106 -0
  16. package/dist/BasicStatCard.js +2 -0
  17. package/dist/BasicStatCard.js.map +1 -0
  18. package/dist/BeeSwarmChart.d.ts +189 -0
  19. package/dist/BeeSwarmChart.js +2 -0
  20. package/dist/BeeSwarmChart.js.map +1 -0
  21. package/dist/BiVariateChoroplethMap.d.ts +189 -0
  22. package/dist/BiVariateChoroplethMap.js +2 -0
  23. package/dist/BiVariateChoroplethMap.js.map +1 -0
  24. package/dist/BulletChart.d.ts +219 -0
  25. package/dist/BulletChart.js +2 -0
  26. package/dist/BulletChart.js.map +1 -0
  27. package/dist/ButterflyChart.d.ts +201 -0
  28. package/dist/ButterflyChart.js +2 -0
  29. package/dist/ButterflyChart.js.map +1 -0
  30. package/dist/ChoroplethMap.d.ts +190 -0
  31. package/dist/ChoroplethMap.js +2 -0
  32. package/dist/ChoroplethMap.js.map +1 -0
  33. package/dist/CirclePackingGraph.d.ts +161 -0
  34. package/dist/CirclePackingGraph.js +2 -0
  35. package/dist/CirclePackingGraph.js.map +1 -0
  36. package/dist/ColorLegend.d.ts +17 -0
  37. package/dist/ColorLegend.js +2 -0
  38. package/dist/ColorLegend.js.map +1 -0
  39. package/dist/ColorLegendWithMouseOver.d.ts +16 -0
  40. package/dist/ColorLegendWithMouseOver.js +2 -0
  41. package/dist/ColorLegendWithMouseOver.js.map +1 -0
  42. package/dist/Colors.d.ts +174 -0
  43. package/dist/Colors.js +2 -0
  44. package/dist/Colors.js.map +1 -0
  45. package/dist/CopyTextButton.d.ts +13 -0
  46. package/dist/CopyTextButton.js +17 -0
  47. package/dist/CopyTextButton.js.map +1 -0
  48. package/dist/CsvDownloadButton.d.ts +22 -0
  49. package/dist/CsvDownloadButton.js +23 -0
  50. package/dist/CsvDownloadButton.js.map +1 -0
  51. package/dist/DataCards.d.ts +131 -0
  52. package/dist/DataCards.js +2 -0
  53. package/dist/DataCards.js.map +1 -0
  54. package/dist/DataTable.d.ts +122 -0
  55. package/dist/DataTable.js +2 -0
  56. package/dist/DataTable.js.map +1 -0
  57. package/dist/DifferenceLineChart.d.ts +237 -0
  58. package/dist/DifferenceLineChart.js +2 -0
  59. package/dist/DifferenceLineChart.js.map +1 -0
  60. package/dist/DonutChart.d.ts +148 -0
  61. package/dist/DonutChart.js +2 -0
  62. package/dist/DonutChart.js.map +1 -0
  63. package/dist/DotDensityMap.d.ts +191 -0
  64. package/dist/DotDensityMap.js +2 -0
  65. package/dist/DotDensityMap.js.map +1 -0
  66. package/dist/DropdownSelect-CuzV7gdj.cjs +29 -0
  67. package/dist/DropdownSelect-CuzV7gdj.cjs.map +1 -0
  68. package/dist/DropdownSelect-DmZsXrhY.js +2698 -0
  69. package/dist/DropdownSelect-DmZsXrhY.js.map +1 -0
  70. package/dist/DualAxisLineChart.d.ts +180 -0
  71. package/dist/DualAxisLineChart.js +2 -0
  72. package/dist/DualAxisLineChart.js.map +1 -0
  73. package/dist/DumbbellChart.d.ts +224 -0
  74. package/dist/DumbbellChart.js +2 -0
  75. package/dist/DumbbellChart.js.map +1 -0
  76. package/dist/EmptyState-BQguKAp5.cjs +2 -0
  77. package/dist/EmptyState-BQguKAp5.cjs.map +1 -0
  78. package/dist/EmptyState-b2Ln487i.js +22 -0
  79. package/dist/EmptyState-b2Ln487i.js.map +1 -0
  80. package/dist/ExcelDownloadButton.d.ts +22 -0
  81. package/dist/ExcelDownloadButton.js +2 -0
  82. package/dist/ExcelDownloadButton.js.map +1 -0
  83. package/dist/FootNote.d.ts +12 -0
  84. package/dist/FootNote.js +2 -0
  85. package/dist/FootNote.js.map +1 -0
  86. package/dist/GeoHubCompareMaps.d.ts +103 -0
  87. package/dist/GeoHubCompareMaps.js +2 -0
  88. package/dist/GeoHubCompareMaps.js.map +1 -0
  89. package/dist/GeoHubMap.d.ts +118 -0
  90. package/dist/GeoHubMap.js +2 -0
  91. package/dist/GeoHubMap.js.map +1 -0
  92. package/dist/GeoHubMapWithLayerSelection.d.ts +117 -0
  93. package/dist/GeoHubMapWithLayerSelection.js +2 -0
  94. package/dist/GeoHubMapWithLayerSelection.js.map +1 -0
  95. package/dist/GraphDescription.d.ts +12 -0
  96. package/dist/GraphDescription.js +2 -0
  97. package/dist/GraphDescription.js.map +1 -0
  98. package/dist/GraphFooter.d.ts +24 -0
  99. package/dist/GraphFooter.js +2 -0
  100. package/dist/GraphFooter.js.map +1 -0
  101. package/dist/GraphHeader.d.ts +22 -0
  102. package/dist/GraphHeader.js +2 -0
  103. package/dist/GraphHeader.js.map +1 -0
  104. package/dist/GraphTitle.d.ts +13 -0
  105. package/dist/GraphTitle.js +2 -0
  106. package/dist/GraphTitle.js.map +1 -0
  107. package/dist/GriddedGraphs.d.ts +540 -0
  108. package/dist/GriddedGraphs.js +2 -0
  109. package/dist/GriddedGraphs.js.map +1 -0
  110. package/dist/GriddedGraphsFromConfig.d.ts +543 -0
  111. package/dist/GriddedGraphsFromConfig.js +2 -0
  112. package/dist/GriddedGraphsFromConfig.js.map +1 -0
  113. package/dist/HeatMap.d.ts +166 -0
  114. package/dist/HeatMap.js +2 -0
  115. package/dist/HeatMap.js.map +1 -0
  116. package/dist/Histogram.d.ts +165 -0
  117. package/dist/Histogram.js +2 -0
  118. package/dist/Histogram.js.map +1 -0
  119. package/dist/ImageDownloadButton.d.ts +15 -0
  120. package/dist/ImageDownloadButton.js +2 -0
  121. package/dist/ImageDownloadButton.js.map +1 -0
  122. package/dist/LineChartWithConfidenceInterval.d.ts +250 -0
  123. package/dist/LineChartWithConfidenceInterval.js +2 -0
  124. package/dist/LineChartWithConfidenceInterval.js.map +1 -0
  125. package/dist/LinearColorLegend.d.ts +13 -0
  126. package/dist/LinearColorLegend.js +2 -0
  127. package/dist/LinearColorLegend.js.map +1 -0
  128. package/dist/Modal-C9txyGOk.js +723 -0
  129. package/dist/Modal-C9txyGOk.js.map +1 -0
  130. package/dist/Modal-cQF2UQIa.cjs +46 -0
  131. package/dist/Modal-cQF2UQIa.cjs.map +1 -0
  132. package/dist/MultiGraphDashboard.d.ts +558 -0
  133. package/dist/MultiGraphDashboard.js +2 -0
  134. package/dist/MultiGraphDashboard.js.map +1 -0
  135. package/dist/MultiGraphDashboardFromConfig.d.ts +562 -0
  136. package/dist/MultiGraphDashboardFromConfig.js +2 -0
  137. package/dist/MultiGraphDashboardFromConfig.js.map +1 -0
  138. package/dist/MultiGraphDashboardWideToLongFormat.d.ts +128 -0
  139. package/dist/MultiGraphDashboardWideToLongFormat.js +2 -0
  140. package/dist/MultiGraphDashboardWideToLongFormat.js.map +1 -0
  141. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.d.ts +133 -0
  142. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -0
  143. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js.map +1 -0
  144. package/dist/MultiLineAltChart.d.ts +244 -0
  145. package/dist/MultiLineAltChart.js +2 -0
  146. package/dist/MultiLineAltChart.js.map +1 -0
  147. package/dist/MultiLineChart.d.ts +246 -0
  148. package/dist/MultiLineChart.js +2 -0
  149. package/dist/MultiLineChart.js.map +1 -0
  150. package/dist/ParetoChart.d.ts +178 -0
  151. package/dist/ParetoChart.js +2 -0
  152. package/dist/ParetoChart.js.map +1 -0
  153. package/dist/RadarChart.d.ts +176 -0
  154. package/dist/RadarChart.js +2 -0
  155. package/dist/RadarChart.js.map +1 -0
  156. package/dist/ReferenceLine-BgDdQbDI.js +129 -0
  157. package/dist/ReferenceLine-BgDdQbDI.js.map +1 -0
  158. package/dist/ReferenceLine-Bsb5jeE4.cjs +2 -0
  159. package/dist/ReferenceLine-Bsb5jeE4.cjs.map +1 -0
  160. package/dist/RegressionLine-BfpCuD7B.cjs +2 -0
  161. package/dist/RegressionLine-BfpCuD7B.cjs.map +1 -0
  162. package/dist/RegressionLine-cSljpHaE.js +49 -0
  163. package/dist/RegressionLine-cSljpHaE.js.map +1 -0
  164. package/dist/SVGDownloadButton.d.ts +15 -0
  165. package/dist/SVGDownloadButton.js +2 -0
  166. package/dist/SVGDownloadButton.js.map +1 -0
  167. package/dist/SankeyChart.d.ts +178 -0
  168. package/dist/SankeyChart.js +2 -0
  169. package/dist/SankeyChart.js.map +1 -0
  170. package/dist/ScatterPlot.d.ts +266 -0
  171. package/dist/ScatterPlot.js +2 -0
  172. package/dist/ScatterPlot.js.map +1 -0
  173. package/dist/ScrollStory.d.ts +491 -0
  174. package/dist/ScrollStory.js +2 -0
  175. package/dist/ScrollStory.js.map +1 -0
  176. package/dist/SimpleLineChart.d.ts +230 -0
  177. package/dist/SimpleLineChart.js +2 -0
  178. package/dist/SimpleLineChart.js.map +1 -0
  179. package/dist/SingleGraphDashboard.d.ts +545 -0
  180. package/dist/SingleGraphDashboard.js +2 -0
  181. package/dist/SingleGraphDashboard.js.map +1 -0
  182. package/dist/SingleGraphDashboardFromConfig.d.ts +547 -0
  183. package/dist/SingleGraphDashboardFromConfig.js +2 -0
  184. package/dist/SingleGraphDashboardFromConfig.js.map +1 -0
  185. package/dist/SlopeChart.d.ts +167 -0
  186. package/dist/SlopeChart.js +2 -0
  187. package/dist/SlopeChart.js.map +1 -0
  188. package/dist/Source.d.ts +16 -0
  189. package/dist/Source.js +2 -0
  190. package/dist/Source.js.map +1 -0
  191. package/dist/SparkLine.d.ts +139 -0
  192. package/dist/SparkLine.js +2 -0
  193. package/dist/SparkLine.js.map +1 -0
  194. package/dist/Spinner-DN3s4S0H.js +17 -0
  195. package/dist/Spinner-DN3s4S0H.js.map +1 -0
  196. package/dist/Spinner-UmN-KPe9.cjs +2 -0
  197. package/dist/Spinner-UmN-KPe9.cjs.map +1 -0
  198. package/dist/StatCardFromData.d.ts +115 -0
  199. package/dist/StatCardFromData.js +2 -0
  200. package/dist/StatCardFromData.js.map +1 -0
  201. package/dist/StripChart.d.ts +178 -0
  202. package/dist/StripChart.js +2 -0
  203. package/dist/StripChart.js.map +1 -0
  204. package/dist/ThreeDGlobe.d.ts +158 -0
  205. package/dist/ThreeDGlobe.js +2 -0
  206. package/dist/ThreeDGlobe.js.map +1 -0
  207. package/dist/ThresholdColorLegendWithMouseOver.d.ts +16 -0
  208. package/dist/ThresholdColorLegendWithMouseOver.js +2 -0
  209. package/dist/ThresholdColorLegendWithMouseOver.js.map +1 -0
  210. package/dist/Tooltip-BM18N_3l.cjs +2 -0
  211. package/dist/Tooltip-BM18N_3l.cjs.map +1 -0
  212. package/dist/Tooltip-CzZ1wFyF.js +47 -0
  213. package/dist/Tooltip-CzZ1wFyF.js.map +1 -0
  214. package/dist/TreeMapGraph.d.ts +158 -0
  215. package/dist/TreeMapGraph.js +2 -0
  216. package/dist/TreeMapGraph.js.map +1 -0
  217. package/dist/Types.d.ts +883 -0
  218. package/dist/Types.js +2 -0
  219. package/dist/Types.js.map +1 -0
  220. package/dist/Typography-CDR-DAHH.cjs +2 -0
  221. package/dist/Typography-CDR-DAHH.cjs.map +1 -0
  222. package/dist/Typography-XJoSE-By.js +58 -0
  223. package/dist/Typography-XJoSE-By.js.map +1 -0
  224. package/dist/UnitChart.d.ts +132 -0
  225. package/dist/UnitChart.js +2 -0
  226. package/dist/UnitChart.js.map +1 -0
  227. package/dist/XAxesLabels-C9REbQQs.cjs +2 -0
  228. package/dist/XAxesLabels-C9REbQQs.cjs.map +1 -0
  229. package/dist/XAxesLabels-DVw7Lvuz.js +58 -0
  230. package/dist/XAxesLabels-DVw7Lvuz.js.map +1 -0
  231. package/dist/XTicksAndGridLines-CUefTINd.js +57 -0
  232. package/dist/XTicksAndGridLines-CUefTINd.js.map +1 -0
  233. package/dist/XTicksAndGridLines-DuK35ROS.cjs +2 -0
  234. package/dist/XTicksAndGridLines-DuK35ROS.cjs.map +1 -0
  235. package/dist/YAxesLabels-CYVY053X.js +53 -0
  236. package/dist/YAxesLabels-CYVY053X.js.map +1 -0
  237. package/dist/YAxesLabels-DhBdLk3Z.cjs +2 -0
  238. package/dist/YAxesLabels-DhBdLk3Z.cjs.map +1 -0
  239. package/dist/YTicksAndGridLines-BJRXuBdC.js +57 -0
  240. package/dist/YTicksAndGridLines-BJRXuBdC.js.map +1 -0
  241. package/dist/YTicksAndGridLines-CtLvzExe.cjs +2 -0
  242. package/dist/YTicksAndGridLines-CtLvzExe.cjs.map +1 -0
  243. package/dist/_commonjsHelpers-DKOUU3wS.cjs +2 -0
  244. package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +1 -0
  245. package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
  246. package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
  247. package/dist/area-BE2wo7fv.js +53 -0
  248. package/dist/area-BE2wo7fv.js.map +1 -0
  249. package/dist/area-D3Qx7k7K.cjs +2 -0
  250. package/dist/area-D3Qx7k7K.cjs.map +1 -0
  251. package/dist/array-B7TkkRH0.js +89 -0
  252. package/dist/array-B7TkkRH0.js.map +1 -0
  253. package/dist/array-DKbXV8lR.cjs +2 -0
  254. package/dist/array-DKbXV8lR.cjs.map +1 -0
  255. package/dist/band-BEjh2CHI.js +47 -0
  256. package/dist/band-BEjh2CHI.js.map +1 -0
  257. package/dist/band-CAApY4Pd.cjs +2 -0
  258. package/dist/band-CAApY4Pd.cjs.map +1 -0
  259. package/dist/checkIfMultiple-CaefP4X2.js +2264 -0
  260. package/dist/checkIfMultiple-CaefP4X2.js.map +1 -0
  261. package/dist/checkIfMultiple-D3h8to1T.cjs +12 -0
  262. package/dist/checkIfMultiple-D3h8to1T.cjs.map +1 -0
  263. package/dist/checkIfNullOrUndefined.d.ts +15 -0
  264. package/dist/checkIfNullOrUndefined.js +2 -0
  265. package/dist/checkIfNullOrUndefined.js.map +1 -0
  266. package/dist/customArea-B47Ew5cT.cjs +2 -0
  267. package/dist/customArea-B47Ew5cT.cjs.map +1 -0
  268. package/dist/customArea-I3MsoqIl.js +176 -0
  269. package/dist/customArea-I3MsoqIl.js.map +1 -0
  270. package/dist/defaultLocale-BEa-49Qz.js +172 -0
  271. package/dist/defaultLocale-BEa-49Qz.js.map +1 -0
  272. package/dist/defaultLocale-DIVzfLaQ.cjs +2 -0
  273. package/dist/defaultLocale-DIVzfLaQ.cjs.map +1 -0
  274. package/dist/delaunay-C1uAf38t.js +684 -0
  275. package/dist/delaunay-C1uAf38t.js.map +1 -0
  276. package/dist/delaunay-rcy0HhZi.cjs +2 -0
  277. package/dist/delaunay-rcy0HhZi.cjs.map +1 -0
  278. package/dist/ensureCompleteData-BBDZbDCE.js +102 -0
  279. package/dist/ensureCompleteData-BBDZbDCE.js.map +1 -0
  280. package/dist/ensureCompleteData-DqWQ2Zbi.cjs +2 -0
  281. package/dist/ensureCompleteData-DqWQ2Zbi.cjs.map +1 -0
  282. package/dist/excelDownload.d.ts +31 -0
  283. package/dist/excelDownload.js +2 -0
  284. package/dist/excelDownload.js.map +1 -0
  285. package/dist/fetchAndParseData.d.ts +84 -0
  286. package/dist/fetchAndParseData.js +16 -0
  287. package/dist/fetchAndParseData.js.map +1 -0
  288. package/dist/filterData-B8ocT57s.js +14 -0
  289. package/dist/filterData-B8ocT57s.js.map +1 -0
  290. package/dist/filterData-DN6py7y_.cjs +2 -0
  291. package/dist/filterData-DN6py7y_.cjs.map +1 -0
  292. package/dist/generateCodes.d.ts +25 -0
  293. package/dist/generateCodes.js +2 -0
  294. package/dist/generateCodes.js.map +1 -0
  295. package/dist/generateRandomString-B5zBiJzS.cjs +2 -0
  296. package/dist/generateRandomString-B5zBiJzS.cjs.map +1 -0
  297. package/dist/generateRandomString-za3IQGfQ.js +11 -0
  298. package/dist/generateRandomString-za3IQGfQ.js.map +1 -0
  299. package/dist/getJenks.d.ts +17 -0
  300. package/dist/getJenks.js +2 -0
  301. package/dist/getJenks.js.map +1 -0
  302. package/dist/getPercentileValue.d.ts +13 -0
  303. package/dist/getPercentileValue.js +2 -0
  304. package/dist/getPercentileValue.js.map +1 -0
  305. package/dist/getQueryParamsFromLink.d.ts +18 -0
  306. package/dist/getQueryParamsFromLink.js +2 -0
  307. package/dist/getQueryParamsFromLink.js.map +1 -0
  308. package/dist/getSchema.d.ts +3256 -0
  309. package/dist/getSchema.js +2 -0
  310. package/dist/getSchema.js.map +1 -0
  311. package/dist/getSliderMarks-CWajGCGq.js +719 -0
  312. package/dist/getSliderMarks-CWajGCGq.js.map +1 -0
  313. package/dist/getSliderMarks-DDJ1CdhL.cjs +6 -0
  314. package/dist/getSliderMarks-DDJ1CdhL.cjs.map +1 -0
  315. package/dist/getTextColorBasedOnBgColor.d.ts +13 -0
  316. package/dist/getTextColorBasedOnBgColor.js +2 -0
  317. package/dist/getTextColorBasedOnBgColor.js.map +1 -0
  318. package/dist/getUniqValue.d.ts +18 -0
  319. package/dist/getUniqValue.js +2 -0
  320. package/dist/getUniqValue.js.map +1 -0
  321. package/dist/graphList.d.ts +9 -0
  322. package/dist/graphList.js +2 -0
  323. package/dist/graphList.js.map +1 -0
  324. package/dist/imageDownload.d.ts +16 -0
  325. package/dist/imageDownload.js +3 -0
  326. package/dist/imageDownload.js.map +1 -0
  327. package/dist/index-01r5X3Gr-9jE0ObrK.cjs +2 -0
  328. package/dist/index-01r5X3Gr-9jE0ObrK.cjs.map +1 -0
  329. package/dist/index-01r5X3Gr-kH7FxQ7P.js +451 -0
  330. package/dist/index-01r5X3Gr-kH7FxQ7P.js.map +1 -0
  331. package/dist/index-27yTRcko.js +35 -0
  332. package/dist/index-27yTRcko.js.map +1 -0
  333. package/dist/index-B0rbzOoC.cjs +2 -0
  334. package/dist/index-B0rbzOoC.cjs.map +1 -0
  335. package/dist/index-BGMGC-HN.cjs +22 -0
  336. package/dist/index-BGMGC-HN.cjs.map +1 -0
  337. package/dist/index-BHm2KTjD-2e-Fu8L-.js +702 -0
  338. package/dist/index-BHm2KTjD-2e-Fu8L-.js.map +1 -0
  339. package/dist/index-BHm2KTjD-D8FylaKc.cjs +44 -0
  340. package/dist/index-BHm2KTjD-D8FylaKc.cjs.map +1 -0
  341. package/dist/index-BIPNFFja.js +506 -0
  342. package/dist/index-BIPNFFja.js.map +1 -0
  343. package/dist/index-BLizQDlg.js +658 -0
  344. package/dist/index-BLizQDlg.js.map +1 -0
  345. package/dist/index-BXns0-ng.cjs +2 -0
  346. package/dist/index-BXns0-ng.cjs.map +1 -0
  347. package/dist/index-BYroABPm.cjs +2 -0
  348. package/dist/index-BYroABPm.cjs.map +1 -0
  349. package/dist/index-BczVvEBZ.cjs +2 -0
  350. package/dist/index-BczVvEBZ.cjs.map +1 -0
  351. package/dist/index-BzeLQvXk.cjs +2 -0
  352. package/dist/index-BzeLQvXk.cjs.map +1 -0
  353. package/dist/index-C1rRk_50.js +273 -0
  354. package/dist/index-C1rRk_50.js.map +1 -0
  355. package/dist/index-C21TvELx.cjs +2 -0
  356. package/dist/index-C21TvELx.cjs.map +1 -0
  357. package/dist/index-CEc_9zWy.cjs +2 -0
  358. package/dist/index-CEc_9zWy.cjs.map +1 -0
  359. package/dist/index-CZbIGs8q.cjs +2 -0
  360. package/dist/index-CZbIGs8q.cjs.map +1 -0
  361. package/dist/index-CaAIPGZo.js +631 -0
  362. package/dist/index-CaAIPGZo.js.map +1 -0
  363. package/dist/index-CbVeVrla.cjs +2 -0
  364. package/dist/index-CbVeVrla.cjs.map +1 -0
  365. package/dist/index-CqzhBPuO-CfQywbdq.js +41 -0
  366. package/dist/index-CqzhBPuO-CfQywbdq.js.map +1 -0
  367. package/dist/index-CqzhBPuO-raKZqS7l.cjs +2 -0
  368. package/dist/index-CqzhBPuO-raKZqS7l.cjs.map +1 -0
  369. package/dist/index-D7ltPi18.js +26 -0
  370. package/dist/index-D7ltPi18.js.map +1 -0
  371. package/dist/index-DSnvdkHZ.js +495 -0
  372. package/dist/index-DSnvdkHZ.js.map +1 -0
  373. package/dist/index-DXmF_0ez.js +308 -0
  374. package/dist/index-DXmF_0ez.js.map +1 -0
  375. package/dist/index-Db-Yg_Ud.js +120 -0
  376. package/dist/index-Db-Yg_Ud.js.map +1 -0
  377. package/dist/index-Ds0uHjK9.cjs +2 -0
  378. package/dist/index-Ds0uHjK9.cjs.map +1 -0
  379. package/dist/index-DxagiOHo.js +707 -0
  380. package/dist/index-DxagiOHo.js.map +1 -0
  381. package/dist/index-DzdwZ2OA.js +77 -0
  382. package/dist/index-DzdwZ2OA.js.map +1 -0
  383. package/dist/index-UV9hjG_S.js +53 -0
  384. package/dist/index-UV9hjG_S.js.map +1 -0
  385. package/dist/index-a2C2Bqn2.cjs +10 -0
  386. package/dist/index-a2C2Bqn2.cjs.map +1 -0
  387. package/dist/index.js +1 -52488
  388. package/dist/index.js.map +1 -1
  389. package/dist/init-BhZylTFx.js +63 -0
  390. package/dist/init-BhZylTFx.js.map +1 -0
  391. package/dist/init-DU0ybBc_.cjs +2 -0
  392. package/dist/init-DU0ybBc_.cjs.map +1 -0
  393. package/dist/line-CPfhohvF.js +68 -0
  394. package/dist/line-CPfhohvF.js.map +1 -0
  395. package/dist/line-DHV4JwCR.cjs +2 -0
  396. package/dist/line-DHV4JwCR.cjs.map +1 -0
  397. package/dist/linear-BVckp9RD.cjs +2 -0
  398. package/dist/linear-BVckp9RD.cjs.map +1 -0
  399. package/dist/linear-DUdu7l2G.js +221 -0
  400. package/dist/linear-DUdu7l2G.js.map +1 -0
  401. package/dist/numberFormattingFunction.d.ts +22 -0
  402. package/dist/numberFormattingFunction.js +2 -0
  403. package/dist/numberFormattingFunction.js.map +1 -0
  404. package/dist/ordinal-BOeNbyae.cjs +2 -0
  405. package/dist/ordinal-BOeNbyae.cjs.map +1 -0
  406. package/dist/ordinal-w9Lu4Stb.js +62 -0
  407. package/dist/ordinal-w9Lu4Stb.js.map +1 -0
  408. package/dist/parse-DlCRUFh_.js +2768 -0
  409. package/dist/parse-DlCRUFh_.js.map +1 -0
  410. package/dist/parse-hMnG_lRV.cjs +2 -0
  411. package/dist/parse-hMnG_lRV.cjs.map +1 -0
  412. package/dist/pointer-CWRWOsrb.js +23 -0
  413. package/dist/pointer-CWRWOsrb.js.map +1 -0
  414. package/dist/pointer-Dkq5NV1q.cjs +2 -0
  415. package/dist/pointer-Dkq5NV1q.cjs.map +1 -0
  416. package/dist/pow-B5-jkdHU.cjs +2 -0
  417. package/dist/pow-B5-jkdHU.cjs.map +1 -0
  418. package/dist/pow-e8zx3AQJ.js +35 -0
  419. package/dist/pow-e8zx3AQJ.js.map +1 -0
  420. package/dist/removeOutliers.d.ts +16 -0
  421. package/dist/removeOutliers.js +2 -0
  422. package/dist/removeOutliers.js.map +1 -0
  423. package/dist/select-Bnfk0lJx.cjs +2 -0
  424. package/dist/select-Bnfk0lJx.cjs.map +1 -0
  425. package/dist/select-DKy99ogv.js +584 -0
  426. package/dist/select-DKy99ogv.js.map +1 -0
  427. package/dist/simple-statistics-flVzqVtt.js +65 -0
  428. package/dist/simple-statistics-flVzqVtt.js.map +1 -0
  429. package/dist/simple-statistics-xm8c0LQQ.cjs +2 -0
  430. package/dist/simple-statistics-xm8c0LQQ.cjs.map +1 -0
  431. package/dist/step-BZ3C8QFW.cjs +2 -0
  432. package/dist/step-BZ3C8QFW.cjs.map +1 -0
  433. package/dist/step-BrDul-H4.js +119 -0
  434. package/dist/step-BrDul-H4.js.map +1 -0
  435. package/dist/string-B8KlVSPX.js +364 -0
  436. package/dist/string-B8KlVSPX.js.map +1 -0
  437. package/dist/string-CRoCZCYa.cjs +2 -0
  438. package/dist/string-CRoCZCYa.cjs.map +1 -0
  439. package/dist/string2HTML-BX0oNw83.js +758 -0
  440. package/dist/string2HTML-BX0oNw83.js.map +1 -0
  441. package/dist/string2HTML-X4ZYX5jI.cjs +3 -0
  442. package/dist/string2HTML-X4ZYX5jI.cjs.map +1 -0
  443. package/dist/style.css +1 -1
  444. package/dist/svgDownload.d.ts +16 -0
  445. package/dist/svgDownload.js +2 -0
  446. package/dist/svgDownload.js.map +1 -0
  447. package/dist/threshold-DFfqcDMa.js +23 -0
  448. package/dist/threshold-DFfqcDMa.js.map +1 -0
  449. package/dist/threshold-DNsSUf8Q.cjs +2 -0
  450. package/dist/threshold-DNsSUf8Q.cjs.map +1 -0
  451. package/dist/time-Byw_jYQ7.cjs +2 -0
  452. package/dist/time-Byw_jYQ7.cjs.map +1 -0
  453. package/dist/time-BzJP5SPC.js +715 -0
  454. package/dist/time-BzJP5SPC.js.map +1 -0
  455. package/dist/timer-B39XOBYL.js +124 -0
  456. package/dist/timer-B39XOBYL.js.map +1 -0
  457. package/dist/timer-CKyBCVzT.cjs +2 -0
  458. package/dist/timer-CKyBCVzT.cjs.map +1 -0
  459. package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js +139 -0
  460. package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js.map +1 -0
  461. package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs +4 -0
  462. package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs.map +1 -0
  463. package/dist/transformColumnsToArray.d.ts +38 -0
  464. package/dist/transformColumnsToArray.js +2 -0
  465. package/dist/transformColumnsToArray.js.map +1 -0
  466. package/dist/transformDataForAggregation.d.ts +38 -0
  467. package/dist/transformDataForAggregation.js +2 -0
  468. package/dist/transformDataForAggregation.js.map +1 -0
  469. package/dist/transformDataForGraph.d.ts +47 -0
  470. package/dist/transformDataForGraph.js +2 -0
  471. package/dist/transformDataForGraph.js.map +1 -0
  472. package/dist/transformDataForGraphFromFile.d.ts +66 -0
  473. package/dist/transformDataForGraphFromFile.js +2 -0
  474. package/dist/transformDataForGraphFromFile.js.map +1 -0
  475. package/dist/use-in-view-CZPXmTZM.js +4645 -0
  476. package/dist/use-in-view-CZPXmTZM.js.map +1 -0
  477. package/dist/use-in-view-Dl1CsAIo.cjs +2 -0
  478. package/dist/use-in-view-Dl1CsAIo.cjs.map +1 -0
  479. package/dist/validateSchema.d.ts +68 -0
  480. package/dist/validateSchema.js +2 -0
  481. package/dist/validateSchema.js.map +1 -0
  482. package/dist/x-Dft9NVe_-DcB7wtv5.js +61 -0
  483. package/dist/x-Dft9NVe_-DcB7wtv5.js.map +1 -0
  484. package/dist/x-Dft9NVe_-LeyJu02C.cjs +27 -0
  485. package/dist/x-Dft9NVe_-LeyJu02C.cjs.map +1 -0
  486. package/dist/y-D0sAaVii.js +421 -0
  487. package/dist/y-D0sAaVii.js.map +1 -0
  488. package/dist/y-QcCbqrzx.cjs +2 -0
  489. package/dist/y-QcCbqrzx.cjs.map +1 -0
  490. package/dist/zoom-Lo7IAUfC.cjs +2 -0
  491. package/dist/zoom-Lo7IAUfC.cjs.map +1 -0
  492. package/dist/zoom-_lqdiGoI.js +1983 -0
  493. package/dist/zoom-_lqdiGoI.js.map +1 -0
  494. package/package.json +415 -4
  495. package/dist/index.cjs +0 -68
  496. package/dist/index.cjs.map +0 -1
@@ -0,0 +1,4645 @@
1
+ import { j as ge } from "./index-BHm2KTjD-2e-Fu8L-.js";
2
+ import { createContext as pt, useRef as Ut, useLayoutEffect as ur, useEffect as qt, useContext as O, useId as cr, useCallback as Rs, useMemo as Zt, useInsertionEffect as hr, forwardRef as fr, Fragment as Ls, createElement as dr, Component as mr, useState as pr } from "react";
3
+ const ks = pt({});
4
+ function gr(t) {
5
+ const e = Ut(null);
6
+ return e.current === null && (e.current = t()), e.current;
7
+ }
8
+ const Ie = typeof window < "u", yr = Ie ? ur : qt, je = /* @__PURE__ */ pt(null), Bs = pt({
9
+ transformPagePoint: (t) => t,
10
+ isStatic: !1,
11
+ reducedMotion: "never"
12
+ });
13
+ function vr(t = !0) {
14
+ const e = O(je);
15
+ if (e === null)
16
+ return [!0, null];
17
+ const { isPresent: n, onExitComplete: s, register: i } = e, o = cr();
18
+ qt(() => {
19
+ if (t)
20
+ return i(o);
21
+ }, [t]);
22
+ const r = Rs(() => t && s && s(o), [o, s, t]);
23
+ return !n && s ? [!1, r] : [!0];
24
+ }
25
+ const It = [
26
+ "setup",
27
+ // Compute
28
+ "read",
29
+ // Read
30
+ "resolveKeyframes",
31
+ // Write/Read/Write/Read
32
+ "preUpdate",
33
+ // Compute
34
+ "update",
35
+ // Compute
36
+ "preRender",
37
+ // Compute
38
+ "render",
39
+ // Write
40
+ "postRender"
41
+ // Compute
42
+ ], vn = {
43
+ value: null
44
+ };
45
+ function Tr(t, e) {
46
+ let n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), i = !1, o = !1;
47
+ const r = /* @__PURE__ */ new WeakSet();
48
+ let a = {
49
+ delta: 0,
50
+ timestamp: 0,
51
+ isProcessing: !1
52
+ }, l = 0;
53
+ function c(h) {
54
+ r.has(h) && (u.schedule(h), t()), l++, h(a);
55
+ }
56
+ const u = {
57
+ /**
58
+ * Schedule a process to run on the next frame.
59
+ */
60
+ schedule: (h, f = !1, d = !1) => {
61
+ const y = d && i ? n : s;
62
+ return f && r.add(h), y.has(h) || y.add(h), h;
63
+ },
64
+ /**
65
+ * Cancel the provided callback from running on the next frame.
66
+ */
67
+ cancel: (h) => {
68
+ s.delete(h), r.delete(h);
69
+ },
70
+ /**
71
+ * Execute all schedule callbacks.
72
+ */
73
+ process: (h) => {
74
+ if (a = h, i) {
75
+ o = !0;
76
+ return;
77
+ }
78
+ i = !0, [n, s] = [s, n], n.forEach(c), e && vn.value && vn.value.frameloop[e].push(l), l = 0, n.clear(), i = !1, o && (o = !1, u.process(h));
79
+ }
80
+ };
81
+ return u;
82
+ }
83
+ const z = {}, xr = 40;
84
+ function Fs(t, e) {
85
+ let n = !1, s = !0;
86
+ const i = {
87
+ delta: 0,
88
+ timestamp: 0,
89
+ isProcessing: !1
90
+ }, o = () => n = !0, r = It.reduce((p, b) => (p[b] = Tr(o, e ? b : void 0), p), {}), { setup: a, read: l, resolveKeyframes: c, preUpdate: u, update: h, preRender: f, render: d, postRender: m } = r, y = () => {
91
+ const p = z.useManualTiming ? i.timestamp : performance.now();
92
+ n = !1, z.useManualTiming || (i.delta = s ? 1e3 / 60 : Math.max(Math.min(p - i.timestamp, xr), 1)), i.timestamp = p, i.isProcessing = !0, a.process(i), l.process(i), c.process(i), u.process(i), h.process(i), f.process(i), d.process(i), m.process(i), i.isProcessing = !1, n && e && (s = !1, t(y));
93
+ }, v = () => {
94
+ n = !0, s = !0, i.isProcessing || t(y);
95
+ };
96
+ return { schedule: It.reduce((p, b) => {
97
+ const x = r[b];
98
+ return p[b] = (w, C = !1, S = !1) => (n || v(), x.schedule(w, C, S)), p;
99
+ }, {}), cancel: (p) => {
100
+ for (let b = 0; b < It.length; b++)
101
+ r[It[b]].cancel(p);
102
+ }, state: i, steps: r };
103
+ }
104
+ const K = /* @__NO_SIDE_EFFECTS__ */ (t) => t, { schedule: M, cancel: Z, state: E, steps: se } = /* @__PURE__ */ Fs(typeof requestAnimationFrame < "u" ? requestAnimationFrame : K, !0), Os = pt({ strict: !1 }), Tn = {
105
+ animation: [
106
+ "animate",
107
+ "variants",
108
+ "whileHover",
109
+ "whileTap",
110
+ "exit",
111
+ "whileInView",
112
+ "whileFocus",
113
+ "whileDrag"
114
+ ],
115
+ exit: ["exit"],
116
+ drag: ["drag", "dragControls"],
117
+ focus: ["whileFocus"],
118
+ hover: ["whileHover", "onHoverStart", "onHoverEnd"],
119
+ tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
120
+ pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
121
+ inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
122
+ layout: ["layout", "layoutId"]
123
+ }, dt = {};
124
+ for (const t in Tn)
125
+ dt[t] = {
126
+ isEnabled: (e) => Tn[t].some((n) => !!e[n])
127
+ };
128
+ function Pr(t) {
129
+ for (const e in t)
130
+ dt[e] = {
131
+ ...dt[e],
132
+ ...t[e]
133
+ };
134
+ }
135
+ const Sr = /* @__PURE__ */ new Set([
136
+ "animate",
137
+ "exit",
138
+ "variants",
139
+ "initial",
140
+ "style",
141
+ "values",
142
+ "variants",
143
+ "transition",
144
+ "transformTemplate",
145
+ "custom",
146
+ "inherit",
147
+ "onBeforeLayoutMeasure",
148
+ "onAnimationStart",
149
+ "onAnimationComplete",
150
+ "onUpdate",
151
+ "onDragStart",
152
+ "onDrag",
153
+ "onDragEnd",
154
+ "onMeasureDragConstraints",
155
+ "onDirectionLock",
156
+ "onDragTransitionEnd",
157
+ "_dragX",
158
+ "_dragY",
159
+ "onHoverStart",
160
+ "onHoverEnd",
161
+ "onViewportEnter",
162
+ "onViewportLeave",
163
+ "globalTapTarget",
164
+ "ignoreStrict",
165
+ "viewport"
166
+ ]);
167
+ function Gt(t) {
168
+ return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || Sr.has(t);
169
+ }
170
+ let Is = (t) => !Gt(t);
171
+ function br(t) {
172
+ t && (Is = (e) => e.startsWith("on") ? !Gt(e) : t(e));
173
+ }
174
+ try {
175
+ br(require("@emotion/is-prop-valid").default);
176
+ } catch {
177
+ }
178
+ function wr(t, e, n) {
179
+ const s = {};
180
+ for (const i in t)
181
+ i === "values" && typeof t.values == "object" || (Is(i) || n === !0 && Gt(i) || !e && !Gt(i) || // If trying to use native HTML drag events, forward drag listeners
182
+ t.draggable && i.startsWith("onDrag")) && (s[i] = t[i]);
183
+ return s;
184
+ }
185
+ const xn = /* @__PURE__ */ new Set();
186
+ function Ne(t, e, n) {
187
+ t || xn.has(e) || (console.warn(e), xn.add(e));
188
+ }
189
+ function Ar(t) {
190
+ if (typeof Proxy > "u")
191
+ return t;
192
+ const e = /* @__PURE__ */ new Map(), n = (...s) => (process.env.NODE_ENV !== "production" && Ne(!1, "motion() is deprecated. Use motion.create() instead."), t(...s));
193
+ return new Proxy(n, {
194
+ /**
195
+ * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
196
+ * The prop name is passed through as `key` and we can use that to generate a `motion`
197
+ * DOM component with that name.
198
+ */
199
+ get: (s, i) => i === "create" ? t : (e.has(i) || e.set(i, t(i)), e.get(i))
200
+ });
201
+ }
202
+ const Jt = /* @__PURE__ */ pt({});
203
+ function Qt(t) {
204
+ return t !== null && typeof t == "object" && typeof t.start == "function";
205
+ }
206
+ function Vt(t) {
207
+ return typeof t == "string" || Array.isArray(t);
208
+ }
209
+ const Ue = [
210
+ "animate",
211
+ "whileInView",
212
+ "whileFocus",
213
+ "whileHover",
214
+ "whileTap",
215
+ "whileDrag",
216
+ "exit"
217
+ ], Ke = ["initial", ...Ue];
218
+ function te(t) {
219
+ return Qt(t.animate) || Ke.some((e) => Vt(t[e]));
220
+ }
221
+ function js(t) {
222
+ return !!(te(t) || t.variants);
223
+ }
224
+ function Vr(t, e) {
225
+ if (te(t)) {
226
+ const { initial: n, animate: s } = t;
227
+ return {
228
+ initial: n === !1 || Vt(n) ? n : void 0,
229
+ animate: Vt(s) ? s : void 0
230
+ };
231
+ }
232
+ return t.inherit !== !1 ? e : {};
233
+ }
234
+ function Mr(t) {
235
+ const { initial: e, animate: n } = Vr(t, O(Jt));
236
+ return Zt(() => ({ initial: e, animate: n }), [Pn(e), Pn(n)]);
237
+ }
238
+ function Pn(t) {
239
+ return Array.isArray(t) ? t.join(" ") : t;
240
+ }
241
+ const Dr = Symbol.for("motionComponentSymbol");
242
+ function at(t) {
243
+ return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
244
+ }
245
+ function Cr(t, e, n) {
246
+ return Rs(
247
+ (s) => {
248
+ s && t.onMount && t.onMount(s), e && (s ? e.mount(s) : e.unmount()), n && (typeof n == "function" ? n(s) : at(n) && (n.current = s));
249
+ },
250
+ /**
251
+ * Only pass a new ref callback to React if we've received a visual element
252
+ * factory. Otherwise we'll be mounting/remounting every time externalRef
253
+ * or other dependencies change.
254
+ */
255
+ [e]
256
+ );
257
+ }
258
+ const We = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Er = "framerAppearId", Ns = "data-" + We(Er), Us = pt({}), { schedule: $e } = /* @__PURE__ */ Fs(queueMicrotask, !1);
259
+ function Rr(t, e, n, s, i) {
260
+ const { visualElement: o } = O(Jt), r = O(Os), a = O(je), l = O(Bs).reducedMotion, c = Ut(null);
261
+ s = s || r.renderer, !c.current && s && (c.current = s(t, {
262
+ visualState: e,
263
+ parent: o,
264
+ props: n,
265
+ presenceContext: a,
266
+ blockInitialAnimation: a ? a.initial === !1 : !1,
267
+ reducedMotionConfig: l
268
+ }));
269
+ const u = c.current, h = O(Us);
270
+ u && !u.projection && i && (u.type === "html" || u.type === "svg") && Lr(c.current, n, i, h);
271
+ const f = Ut(!1);
272
+ hr(() => {
273
+ u && f.current && u.update(n, a);
274
+ });
275
+ const d = n[Ns], m = Ut(!!d && !window.MotionHandoffIsComplete?.(d) && window.MotionHasOptimisedAnimation?.(d));
276
+ return yr(() => {
277
+ u && (f.current = !0, window.MotionIsMounted = !0, u.updateFeatures(), $e.render(u.render), m.current && u.animationState && u.animationState.animateChanges());
278
+ }), qt(() => {
279
+ u && (!m.current && u.animationState && u.animationState.animateChanges(), m.current && (queueMicrotask(() => {
280
+ window.MotionHandoffMarkAsComplete?.(d);
281
+ }), m.current = !1));
282
+ }), u;
283
+ }
284
+ function Lr(t, e, n, s) {
285
+ const { layoutId: i, layout: o, drag: r, dragConstraints: a, layoutScroll: l, layoutRoot: c, layoutCrossfade: u } = e;
286
+ t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : Ks(t.parent)), t.projection.setOptions({
287
+ layoutId: i,
288
+ layout: o,
289
+ alwaysMeasureLayout: !!r || a && at(a),
290
+ visualElement: t,
291
+ /**
292
+ * TODO: Update options in an effect. This could be tricky as it'll be too late
293
+ * to update by the time layout animations run.
294
+ * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
295
+ * ensuring it gets called if there's no potential layout animations.
296
+ *
297
+ */
298
+ animationType: typeof o == "string" ? o : "both",
299
+ initialPromotionConfig: s,
300
+ crossfade: u,
301
+ layoutScroll: l,
302
+ layoutRoot: c
303
+ });
304
+ }
305
+ function Ks(t) {
306
+ if (t)
307
+ return t.options.allowProjection !== !1 ? t.projection : Ks(t.parent);
308
+ }
309
+ let gt = () => {
310
+ }, Y = () => {
311
+ };
312
+ process.env.NODE_ENV !== "production" && (gt = (t, e) => {
313
+ !t && typeof console < "u" && console.warn(e);
314
+ }, Y = (t, e) => {
315
+ if (!t)
316
+ throw new Error(e);
317
+ });
318
+ function kr({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: s, Component: i }) {
319
+ t && Pr(t);
320
+ function o(a, l) {
321
+ let c;
322
+ const u = {
323
+ ...O(Bs),
324
+ ...a,
325
+ layoutId: Br(a)
326
+ }, { isStatic: h } = u, f = Mr(a), d = s(a, h);
327
+ if (!h && Ie) {
328
+ Fr(u, t);
329
+ const m = Or(u);
330
+ c = m.MeasureLayout, f.visualElement = Rr(i, d, u, e, m.ProjectionNode);
331
+ }
332
+ return ge.jsxs(Jt.Provider, { value: f, children: [c && f.visualElement ? ge.jsx(c, { visualElement: f.visualElement, ...u }) : null, n(i, a, Cr(d, f.visualElement, l), d, h, f.visualElement)] });
333
+ }
334
+ o.displayName = `motion.${typeof i == "string" ? i : `create(${i.displayName ?? i.name ?? ""})`}`;
335
+ const r = fr(o);
336
+ return r[Dr] = i, r;
337
+ }
338
+ function Br({ layoutId: t }) {
339
+ const e = O(ks).id;
340
+ return e && t !== void 0 ? e + "-" + t : t;
341
+ }
342
+ function Fr(t, e) {
343
+ const n = O(Os).strict;
344
+ if (process.env.NODE_ENV !== "production" && e && n) {
345
+ const s = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
346
+ t.ignoreStrict ? gt(!1, s) : Y(!1, s);
347
+ }
348
+ }
349
+ function Or(t) {
350
+ const { drag: e, layout: n } = dt;
351
+ if (!e && !n)
352
+ return {};
353
+ const s = { ...e, ...n };
354
+ return {
355
+ MeasureLayout: e?.isEnabled(t) || n?.isEnabled(t) ? s.MeasureLayout : void 0,
356
+ ProjectionNode: s.ProjectionNode
357
+ };
358
+ }
359
+ const Ws = (t) => (e) => typeof e == "string" && e.startsWith(t), _e = /* @__PURE__ */ Ws("--"), Ir = /* @__PURE__ */ Ws("var(--"), Ge = (t) => Ir(t) ? jr.test(t.split("/*")[0].trim()) : !1, jr = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, Mt = {};
360
+ function Nr(t) {
361
+ for (const e in t)
362
+ Mt[e] = t[e], _e(e) && (Mt[e].isCSSVariable = !0);
363
+ }
364
+ const yt = [
365
+ "transformPerspective",
366
+ "x",
367
+ "y",
368
+ "z",
369
+ "translateX",
370
+ "translateY",
371
+ "translateZ",
372
+ "scale",
373
+ "scaleX",
374
+ "scaleY",
375
+ "rotate",
376
+ "rotateX",
377
+ "rotateY",
378
+ "rotateZ",
379
+ "skew",
380
+ "skewX",
381
+ "skewY"
382
+ ], vt = new Set(yt);
383
+ function $s(t, { layout: e, layoutId: n }) {
384
+ return vt.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!Mt[t] || t === "opacity");
385
+ }
386
+ const _s = (t, e) => e && typeof t == "number" ? e.transform(t) : t, X = (t, e, n) => n > e ? e : n < t ? t : n, Tt = {
387
+ test: (t) => typeof t == "number",
388
+ parse: parseFloat,
389
+ transform: (t) => t
390
+ }, Dt = {
391
+ ...Tt,
392
+ transform: (t) => X(0, 1, t)
393
+ }, jt = {
394
+ ...Tt,
395
+ default: 1
396
+ }, Sn = {
397
+ ...Tt,
398
+ transform: Math.round
399
+ }, kt = /* @__NO_SIDE_EFFECTS__ */ (t) => ({
400
+ test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
401
+ parse: parseFloat,
402
+ transform: (e) => `${e}${t}`
403
+ }), q = /* @__PURE__ */ kt("deg"), _ = /* @__PURE__ */ kt("%"), T = /* @__PURE__ */ kt("px"), Ur = /* @__PURE__ */ kt("vh"), Kr = /* @__PURE__ */ kt("vw"), bn = {
404
+ ..._,
405
+ parse: (t) => _.parse(t) / 100,
406
+ transform: (t) => _.transform(t * 100)
407
+ }, Wr = {
408
+ rotate: q,
409
+ rotateX: q,
410
+ rotateY: q,
411
+ rotateZ: q,
412
+ scale: jt,
413
+ scaleX: jt,
414
+ scaleY: jt,
415
+ scaleZ: jt,
416
+ skew: q,
417
+ skewX: q,
418
+ skewY: q,
419
+ distance: T,
420
+ translateX: T,
421
+ translateY: T,
422
+ translateZ: T,
423
+ x: T,
424
+ y: T,
425
+ z: T,
426
+ perspective: T,
427
+ transformPerspective: T,
428
+ opacity: Dt,
429
+ originX: bn,
430
+ originY: bn,
431
+ originZ: T
432
+ }, He = {
433
+ // Border props
434
+ borderWidth: T,
435
+ borderTopWidth: T,
436
+ borderRightWidth: T,
437
+ borderBottomWidth: T,
438
+ borderLeftWidth: T,
439
+ borderRadius: T,
440
+ radius: T,
441
+ borderTopLeftRadius: T,
442
+ borderTopRightRadius: T,
443
+ borderBottomRightRadius: T,
444
+ borderBottomLeftRadius: T,
445
+ // Positioning props
446
+ width: T,
447
+ maxWidth: T,
448
+ height: T,
449
+ maxHeight: T,
450
+ top: T,
451
+ right: T,
452
+ bottom: T,
453
+ left: T,
454
+ // Spacing props
455
+ padding: T,
456
+ paddingTop: T,
457
+ paddingRight: T,
458
+ paddingBottom: T,
459
+ paddingLeft: T,
460
+ margin: T,
461
+ marginTop: T,
462
+ marginRight: T,
463
+ marginBottom: T,
464
+ marginLeft: T,
465
+ // Misc
466
+ backgroundPositionX: T,
467
+ backgroundPositionY: T,
468
+ ...Wr,
469
+ zIndex: Sn,
470
+ // SVG
471
+ fillOpacity: Dt,
472
+ strokeOpacity: Dt,
473
+ numOctaves: Sn
474
+ }, $r = {
475
+ x: "translateX",
476
+ y: "translateY",
477
+ z: "translateZ",
478
+ transformPerspective: "perspective"
479
+ }, _r = yt.length;
480
+ function Gr(t, e, n) {
481
+ let s = "", i = !0;
482
+ for (let o = 0; o < _r; o++) {
483
+ const r = yt[o], a = t[r];
484
+ if (a === void 0)
485
+ continue;
486
+ let l = !0;
487
+ if (typeof a == "number" ? l = a === (r.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) {
488
+ const c = _s(a, He[r]);
489
+ if (!l) {
490
+ i = !1;
491
+ const u = $r[r] || r;
492
+ s += `${u}(${c}) `;
493
+ }
494
+ n && (e[r] = c);
495
+ }
496
+ }
497
+ return s = s.trim(), n ? s = n(e, i ? "" : s) : i && (s = "none"), s;
498
+ }
499
+ function ze(t, e, n) {
500
+ const { style: s, vars: i, transformOrigin: o } = t;
501
+ let r = !1, a = !1;
502
+ for (const l in e) {
503
+ const c = e[l];
504
+ if (vt.has(l)) {
505
+ r = !0;
506
+ continue;
507
+ } else if (_e(l)) {
508
+ i[l] = c;
509
+ continue;
510
+ } else {
511
+ const u = _s(c, He[l]);
512
+ l.startsWith("origin") ? (a = !0, o[l] = u) : s[l] = u;
513
+ }
514
+ }
515
+ if (e.transform || (r || n ? s.transform = Gr(e, t.transform, n) : s.transform && (s.transform = "none")), a) {
516
+ const { originX: l = "50%", originY: c = "50%", originZ: u = 0 } = o;
517
+ s.transformOrigin = `${l} ${c} ${u}`;
518
+ }
519
+ }
520
+ const Ye = () => ({
521
+ style: {},
522
+ transform: {},
523
+ transformOrigin: {},
524
+ vars: {}
525
+ }), L = (t) => !!(t && t.getVelocity);
526
+ function Gs(t, e, n) {
527
+ for (const s in e)
528
+ !L(e[s]) && !$s(s, n) && (t[s] = e[s]);
529
+ }
530
+ function Hr({ transformTemplate: t }, e) {
531
+ return Zt(() => {
532
+ const n = Ye();
533
+ return ze(n, e, t), Object.assign({}, n.vars, n.style);
534
+ }, [e]);
535
+ }
536
+ function zr(t, e) {
537
+ const n = t.style || {}, s = {};
538
+ return Gs(s, n, t), Object.assign(s, Hr(t, e)), s;
539
+ }
540
+ function Yr(t, e) {
541
+ const n = {}, s = zr(t, e);
542
+ return t.drag && t.dragListener !== !1 && (n.draggable = !1, s.userSelect = s.WebkitUserSelect = s.WebkitTouchCallout = "none", s.touchAction = t.drag === !0 ? "none" : `pan-${t.drag === "x" ? "y" : "x"}`), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = s, n;
543
+ }
544
+ const Xr = {
545
+ offset: "stroke-dashoffset",
546
+ array: "stroke-dasharray"
547
+ }, qr = {
548
+ offset: "strokeDashoffset",
549
+ array: "strokeDasharray"
550
+ };
551
+ function Zr(t, e, n = 1, s = 0, i = !0) {
552
+ t.pathLength = 1;
553
+ const o = i ? Xr : qr;
554
+ t[o.offset] = T.transform(-s);
555
+ const r = T.transform(e), a = T.transform(n);
556
+ t[o.array] = `${r} ${a}`;
557
+ }
558
+ function Hs(t, {
559
+ attrX: e,
560
+ attrY: n,
561
+ attrScale: s,
562
+ pathLength: i,
563
+ pathSpacing: o = 1,
564
+ pathOffset: r = 0,
565
+ // This is object creation, which we try to avoid per-frame.
566
+ ...a
567
+ }, l, c, u) {
568
+ if (ze(t, a, c), l) {
569
+ t.style.viewBox && (t.attrs.viewBox = t.style.viewBox);
570
+ return;
571
+ }
572
+ t.attrs = t.style, t.style = {};
573
+ const { attrs: h, style: f } = t;
574
+ h.transform && (f.transform = h.transform, delete h.transform), (f.transform || h.transformOrigin) && (f.transformOrigin = h.transformOrigin ?? "50% 50%", delete h.transformOrigin), f.transform && (f.transformBox = u?.transformBox ?? "fill-box", delete h.transformBox), e !== void 0 && (h.x = e), n !== void 0 && (h.y = n), s !== void 0 && (h.scale = s), i !== void 0 && Zr(h, i, o, r, !1);
575
+ }
576
+ const zs = () => ({
577
+ ...Ye(),
578
+ attrs: {}
579
+ }), Ys = (t) => typeof t == "string" && t.toLowerCase() === "svg";
580
+ function Jr(t, e, n, s) {
581
+ const i = Zt(() => {
582
+ const o = zs();
583
+ return Hs(o, e, Ys(s), t.transformTemplate, t.style), {
584
+ ...o.attrs,
585
+ style: { ...o.style }
586
+ };
587
+ }, [e]);
588
+ if (t.style) {
589
+ const o = {};
590
+ Gs(o, t.style, t), i.style = { ...o, ...i.style };
591
+ }
592
+ return i;
593
+ }
594
+ const Qr = [
595
+ "animate",
596
+ "circle",
597
+ "defs",
598
+ "desc",
599
+ "ellipse",
600
+ "g",
601
+ "image",
602
+ "line",
603
+ "filter",
604
+ "marker",
605
+ "mask",
606
+ "metadata",
607
+ "path",
608
+ "pattern",
609
+ "polygon",
610
+ "polyline",
611
+ "rect",
612
+ "stop",
613
+ "switch",
614
+ "symbol",
615
+ "svg",
616
+ "text",
617
+ "tspan",
618
+ "use",
619
+ "view"
620
+ ];
621
+ function Xe(t) {
622
+ return (
623
+ /**
624
+ * If it's not a string, it's a custom React component. Currently we only support
625
+ * HTML custom React components.
626
+ */
627
+ typeof t != "string" || /**
628
+ * If it contains a dash, the element is a custom HTML webcomponent.
629
+ */
630
+ t.includes("-") ? !1 : (
631
+ /**
632
+ * If it's in our list of lowercase SVG tags, it's an SVG component
633
+ */
634
+ !!(Qr.indexOf(t) > -1 || /**
635
+ * If it contains a capital letter, it's an SVG component
636
+ */
637
+ /[A-Z]/u.test(t))
638
+ )
639
+ );
640
+ }
641
+ function to(t = !1) {
642
+ return (n, s, i, { latestValues: o }, r) => {
643
+ const l = (Xe(n) ? Jr : Yr)(s, o, r, n), c = wr(s, typeof n == "string", t), u = n !== Ls ? { ...c, ...l, ref: i } : {}, { children: h } = s, f = Zt(() => L(h) ? h.get() : h, [h]);
644
+ return dr(n, {
645
+ ...u,
646
+ children: f
647
+ });
648
+ };
649
+ }
650
+ function wn(t) {
651
+ const e = [{}, {}];
652
+ return t?.values.forEach((n, s) => {
653
+ e[0][s] = n.get(), e[1][s] = n.getVelocity();
654
+ }), e;
655
+ }
656
+ function qe(t, e, n, s) {
657
+ if (typeof e == "function") {
658
+ const [i, o] = wn(s);
659
+ e = e(n !== void 0 ? n : t.custom, i, o);
660
+ }
661
+ if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") {
662
+ const [i, o] = wn(s);
663
+ e = e(n !== void 0 ? n : t.custom, i, o);
664
+ }
665
+ return e;
666
+ }
667
+ function Kt(t) {
668
+ return L(t) ? t.get() : t;
669
+ }
670
+ function eo({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, s, i) {
671
+ return {
672
+ latestValues: no(n, s, i, t),
673
+ renderState: e()
674
+ };
675
+ }
676
+ const Xs = (t) => (e, n) => {
677
+ const s = O(Jt), i = O(je), o = () => eo(t, e, s, i);
678
+ return n ? o() : gr(o);
679
+ };
680
+ function no(t, e, n, s) {
681
+ const i = {}, o = s(t, {});
682
+ for (const f in o)
683
+ i[f] = Kt(o[f]);
684
+ let { initial: r, animate: a } = t;
685
+ const l = te(t), c = js(t);
686
+ e && c && !l && t.inherit !== !1 && (r === void 0 && (r = e.initial), a === void 0 && (a = e.animate));
687
+ let u = n ? n.initial === !1 : !1;
688
+ u = u || r === !1;
689
+ const h = u ? a : r;
690
+ if (h && typeof h != "boolean" && !Qt(h)) {
691
+ const f = Array.isArray(h) ? h : [h];
692
+ for (let d = 0; d < f.length; d++) {
693
+ const m = qe(t, f[d]);
694
+ if (m) {
695
+ const { transitionEnd: y, transition: v, ...g } = m;
696
+ for (const P in g) {
697
+ let p = g[P];
698
+ if (Array.isArray(p)) {
699
+ const b = u ? p.length - 1 : 0;
700
+ p = p[b];
701
+ }
702
+ p !== null && (i[P] = p);
703
+ }
704
+ for (const P in y)
705
+ i[P] = y[P];
706
+ }
707
+ }
708
+ }
709
+ return i;
710
+ }
711
+ function Ze(t, e, n) {
712
+ const { style: s } = t, i = {};
713
+ for (const o in s)
714
+ (L(s[o]) || e.style && L(e.style[o]) || $s(o, t) || n?.getValue(o)?.liveStyle !== void 0) && (i[o] = s[o]);
715
+ return i;
716
+ }
717
+ const so = {
718
+ useVisualState: Xs({
719
+ scrapeMotionValuesFromProps: Ze,
720
+ createRenderState: Ye
721
+ })
722
+ };
723
+ function qs(t, e, n) {
724
+ const s = Ze(t, e, n);
725
+ for (const i in t)
726
+ if (L(t[i]) || L(e[i])) {
727
+ const o = yt.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
728
+ s[o] = t[i];
729
+ }
730
+ return s;
731
+ }
732
+ const io = {
733
+ useVisualState: Xs({
734
+ scrapeMotionValuesFromProps: qs,
735
+ createRenderState: zs
736
+ })
737
+ };
738
+ function ro(t, e) {
739
+ return function(s, { forwardMotionProps: i } = { forwardMotionProps: !1 }) {
740
+ const r = {
741
+ ...Xe(s) ? io : so,
742
+ preloadedFeatures: t,
743
+ useRender: to(i),
744
+ createVisualElement: e,
745
+ Component: s
746
+ };
747
+ return kr(r);
748
+ };
749
+ }
750
+ function Ct(t, e, n) {
751
+ const s = t.getProps();
752
+ return qe(s, e, n !== void 0 ? n : s.custom, t);
753
+ }
754
+ const ye = (t) => Array.isArray(t);
755
+ let Wt;
756
+ function oo() {
757
+ Wt = void 0;
758
+ }
759
+ const I = {
760
+ now: () => (Wt === void 0 && I.set(E.isProcessing || z.useManualTiming ? E.timestamp : performance.now()), Wt),
761
+ set: (t) => {
762
+ Wt = t, queueMicrotask(oo);
763
+ }
764
+ };
765
+ function Je(t, e) {
766
+ t.indexOf(e) === -1 && t.push(e);
767
+ }
768
+ function Qe(t, e) {
769
+ const n = t.indexOf(e);
770
+ n > -1 && t.splice(n, 1);
771
+ }
772
+ class tn {
773
+ constructor() {
774
+ this.subscriptions = [];
775
+ }
776
+ add(e) {
777
+ return Je(this.subscriptions, e), () => Qe(this.subscriptions, e);
778
+ }
779
+ notify(e, n, s) {
780
+ const i = this.subscriptions.length;
781
+ if (i)
782
+ if (i === 1)
783
+ this.subscriptions[0](e, n, s);
784
+ else
785
+ for (let o = 0; o < i; o++) {
786
+ const r = this.subscriptions[o];
787
+ r && r(e, n, s);
788
+ }
789
+ }
790
+ getSize() {
791
+ return this.subscriptions.length;
792
+ }
793
+ clear() {
794
+ this.subscriptions.length = 0;
795
+ }
796
+ }
797
+ function Zs(t, e) {
798
+ return e ? t * (1e3 / e) : 0;
799
+ }
800
+ const An = 30, ao = (t) => !isNaN(parseFloat(t));
801
+ class lo {
802
+ /**
803
+ * @param init - The initiating value
804
+ * @param config - Optional configuration options
805
+ *
806
+ * - `transformer`: A function to transform incoming values with.
807
+ */
808
+ constructor(e, n = {}) {
809
+ this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s, i = !0) => {
810
+ const o = I.now();
811
+ if (this.updatedAt !== o && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && (this.events.change?.notify(this.current), this.dependents))
812
+ for (const r of this.dependents)
813
+ r.dirty();
814
+ i && this.events.renderRequest?.notify(this.current);
815
+ }, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
816
+ }
817
+ setCurrent(e) {
818
+ this.current = e, this.updatedAt = I.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = ao(this.current));
819
+ }
820
+ setPrevFrameValue(e = this.current) {
821
+ this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
822
+ }
823
+ /**
824
+ * Adds a function that will be notified when the `MotionValue` is updated.
825
+ *
826
+ * It returns a function that, when called, will cancel the subscription.
827
+ *
828
+ * When calling `onChange` inside a React component, it should be wrapped with the
829
+ * `useEffect` hook. As it returns an unsubscribe function, this should be returned
830
+ * from the `useEffect` function to ensure you don't add duplicate subscribers..
831
+ *
832
+ * ```jsx
833
+ * export const MyComponent = () => {
834
+ * const x = useMotionValue(0)
835
+ * const y = useMotionValue(0)
836
+ * const opacity = useMotionValue(1)
837
+ *
838
+ * useEffect(() => {
839
+ * function updateOpacity() {
840
+ * const maxXY = Math.max(x.get(), y.get())
841
+ * const newOpacity = transform(maxXY, [0, 100], [1, 0])
842
+ * opacity.set(newOpacity)
843
+ * }
844
+ *
845
+ * const unsubscribeX = x.on("change", updateOpacity)
846
+ * const unsubscribeY = y.on("change", updateOpacity)
847
+ *
848
+ * return () => {
849
+ * unsubscribeX()
850
+ * unsubscribeY()
851
+ * }
852
+ * }, [])
853
+ *
854
+ * return <motion.div style={{ x }} />
855
+ * }
856
+ * ```
857
+ *
858
+ * @param subscriber - A function that receives the latest value.
859
+ * @returns A function that, when called, will cancel this subscription.
860
+ *
861
+ * @deprecated
862
+ */
863
+ onChange(e) {
864
+ return process.env.NODE_ENV !== "production" && Ne(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
865
+ }
866
+ on(e, n) {
867
+ this.events[e] || (this.events[e] = new tn());
868
+ const s = this.events[e].add(n);
869
+ return e === "change" ? () => {
870
+ s(), M.read(() => {
871
+ this.events.change.getSize() || this.stop();
872
+ });
873
+ } : s;
874
+ }
875
+ clearListeners() {
876
+ for (const e in this.events)
877
+ this.events[e].clear();
878
+ }
879
+ /**
880
+ * Attaches a passive effect to the `MotionValue`.
881
+ */
882
+ attach(e, n) {
883
+ this.passiveEffect = e, this.stopPassiveEffect = n;
884
+ }
885
+ /**
886
+ * Sets the state of the `MotionValue`.
887
+ *
888
+ * @remarks
889
+ *
890
+ * ```jsx
891
+ * const x = useMotionValue(0)
892
+ * x.set(10)
893
+ * ```
894
+ *
895
+ * @param latest - Latest value to set.
896
+ * @param render - Whether to notify render subscribers. Defaults to `true`
897
+ *
898
+ * @public
899
+ */
900
+ set(e, n = !0) {
901
+ !n || !this.passiveEffect ? this.updateAndNotify(e, n) : this.passiveEffect(e, this.updateAndNotify);
902
+ }
903
+ setWithVelocity(e, n, s) {
904
+ this.set(n), this.prev = void 0, this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt - s;
905
+ }
906
+ /**
907
+ * Set the state of the `MotionValue`, stopping any active animations,
908
+ * effects, and resets velocity to `0`.
909
+ */
910
+ jump(e, n = !0) {
911
+ this.updateAndNotify(e), this.prev = e, this.prevUpdatedAt = this.prevFrameValue = void 0, n && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
912
+ }
913
+ dirty() {
914
+ this.events.change?.notify(this.current);
915
+ }
916
+ addDependent(e) {
917
+ this.dependents || (this.dependents = /* @__PURE__ */ new Set()), this.dependents.add(e);
918
+ }
919
+ removeDependent(e) {
920
+ this.dependents && this.dependents.delete(e);
921
+ }
922
+ /**
923
+ * Returns the latest state of `MotionValue`
924
+ *
925
+ * @returns - The latest state of `MotionValue`
926
+ *
927
+ * @public
928
+ */
929
+ get() {
930
+ return this.current;
931
+ }
932
+ /**
933
+ * @public
934
+ */
935
+ getPrevious() {
936
+ return this.prev;
937
+ }
938
+ /**
939
+ * Returns the latest velocity of `MotionValue`
940
+ *
941
+ * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
942
+ *
943
+ * @public
944
+ */
945
+ getVelocity() {
946
+ const e = I.now();
947
+ if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > An)
948
+ return 0;
949
+ const n = Math.min(this.updatedAt - this.prevUpdatedAt, An);
950
+ return Zs(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
951
+ }
952
+ /**
953
+ * Registers a new animation to control this `MotionValue`. Only one
954
+ * animation can drive a `MotionValue` at one time.
955
+ *
956
+ * ```jsx
957
+ * value.start()
958
+ * ```
959
+ *
960
+ * @param animation - A function that starts the provided animation
961
+ */
962
+ start(e) {
963
+ return this.stop(), new Promise((n) => {
964
+ this.hasAnimated = !0, this.animation = e(n), this.events.animationStart && this.events.animationStart.notify();
965
+ }).then(() => {
966
+ this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation();
967
+ });
968
+ }
969
+ /**
970
+ * Stop the currently active animation.
971
+ *
972
+ * @public
973
+ */
974
+ stop() {
975
+ this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation();
976
+ }
977
+ /**
978
+ * Returns `true` if this value is currently animating.
979
+ *
980
+ * @public
981
+ */
982
+ isAnimating() {
983
+ return !!this.animation;
984
+ }
985
+ clearAnimation() {
986
+ delete this.animation;
987
+ }
988
+ /**
989
+ * Destroy and clean up subscribers to this `MotionValue`.
990
+ *
991
+ * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
992
+ * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
993
+ * created a `MotionValue` via the `motionValue` function.
994
+ *
995
+ * @public
996
+ */
997
+ destroy() {
998
+ this.dependents?.clear(), this.events.destroy?.notify(), this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
999
+ }
1000
+ }
1001
+ function mt(t, e) {
1002
+ return new lo(t, e);
1003
+ }
1004
+ function uo(t, e, n) {
1005
+ t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, mt(n));
1006
+ }
1007
+ function co(t) {
1008
+ return ye(t) ? t[t.length - 1] || 0 : t;
1009
+ }
1010
+ function ho(t, e) {
1011
+ const n = Ct(t, e);
1012
+ let { transitionEnd: s = {}, transition: i = {}, ...o } = n || {};
1013
+ o = { ...o, ...s };
1014
+ for (const r in o) {
1015
+ const a = co(o[r]);
1016
+ uo(t, r, a);
1017
+ }
1018
+ }
1019
+ function fo(t) {
1020
+ return !!(L(t) && t.add);
1021
+ }
1022
+ function ve(t, e) {
1023
+ const n = t.getValue("willChange");
1024
+ if (fo(n))
1025
+ return n.add(e);
1026
+ if (!n && z.WillChange) {
1027
+ const s = new z.WillChange("auto");
1028
+ t.addValue("willChange", s), s.add(e);
1029
+ }
1030
+ }
1031
+ function Js(t) {
1032
+ return t.props[Ns];
1033
+ }
1034
+ const mo = (t) => t !== null;
1035
+ function po(t, { repeat: e, repeatType: n = "loop" }, s) {
1036
+ const i = t.filter(mo), o = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
1037
+ return i[o];
1038
+ }
1039
+ const go = {
1040
+ type: "spring",
1041
+ stiffness: 500,
1042
+ damping: 25,
1043
+ restSpeed: 10
1044
+ }, yo = (t) => ({
1045
+ type: "spring",
1046
+ stiffness: 550,
1047
+ damping: t === 0 ? 2 * Math.sqrt(550) : 30,
1048
+ restSpeed: 10
1049
+ }), vo = {
1050
+ type: "keyframes",
1051
+ duration: 0.8
1052
+ }, To = {
1053
+ type: "keyframes",
1054
+ ease: [0.25, 0.1, 0.35, 1],
1055
+ duration: 0.3
1056
+ }, xo = (t, { keyframes: e }) => e.length > 2 ? vo : vt.has(t) ? t.startsWith("scale") ? yo(e[1]) : go : To;
1057
+ function Po({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: o, repeatType: r, repeatDelay: a, from: l, elapsed: c, ...u }) {
1058
+ return !!Object.keys(u).length;
1059
+ }
1060
+ function en(t, e) {
1061
+ return t?.[e] ?? t?.default ?? t;
1062
+ }
1063
+ const $ = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, G = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3, St = (t) => Math.round(t * 1e5) / 1e5, nn = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
1064
+ function So(t) {
1065
+ return t == null;
1066
+ }
1067
+ const bo = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, sn = (t, e) => (n) => !!(typeof n == "string" && bo.test(n) && n.startsWith(t) || e && !So(n) && Object.prototype.hasOwnProperty.call(n, e)), Qs = (t, e, n) => (s) => {
1068
+ if (typeof s != "string")
1069
+ return s;
1070
+ const [i, o, r, a] = s.match(nn);
1071
+ return {
1072
+ [t]: parseFloat(i),
1073
+ [e]: parseFloat(o),
1074
+ [n]: parseFloat(r),
1075
+ alpha: a !== void 0 ? parseFloat(a) : 1
1076
+ };
1077
+ }, wo = (t) => X(0, 255, t), ie = {
1078
+ ...Tt,
1079
+ transform: (t) => Math.round(wo(t))
1080
+ }, nt = {
1081
+ test: /* @__PURE__ */ sn("rgb", "red"),
1082
+ parse: /* @__PURE__ */ Qs("red", "green", "blue"),
1083
+ transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + ie.transform(t) + ", " + ie.transform(e) + ", " + ie.transform(n) + ", " + St(Dt.transform(s)) + ")"
1084
+ };
1085
+ function Ao(t) {
1086
+ let e = "", n = "", s = "", i = "";
1087
+ return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, s += s, i += i), {
1088
+ red: parseInt(e, 16),
1089
+ green: parseInt(n, 16),
1090
+ blue: parseInt(s, 16),
1091
+ alpha: i ? parseInt(i, 16) / 255 : 1
1092
+ };
1093
+ }
1094
+ const Te = {
1095
+ test: /* @__PURE__ */ sn("#"),
1096
+ parse: Ao,
1097
+ transform: nt.transform
1098
+ }, lt = {
1099
+ test: /* @__PURE__ */ sn("hsl", "hue"),
1100
+ parse: /* @__PURE__ */ Qs("hue", "saturation", "lightness"),
1101
+ transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + _.transform(St(e)) + ", " + _.transform(St(n)) + ", " + St(Dt.transform(s)) + ")"
1102
+ }, R = {
1103
+ test: (t) => nt.test(t) || Te.test(t) || lt.test(t),
1104
+ parse: (t) => nt.test(t) ? nt.parse(t) : lt.test(t) ? lt.parse(t) : Te.parse(t),
1105
+ transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? nt.transform(t) : lt.transform(t)
1106
+ }, Vo = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
1107
+ function Mo(t) {
1108
+ return isNaN(t) && typeof t == "string" && (t.match(nn)?.length || 0) + (t.match(Vo)?.length || 0) > 0;
1109
+ }
1110
+ const ti = "number", ei = "color", Do = "var", Co = "var(", Vn = "${}", Eo = /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;
1111
+ function Et(t) {
1112
+ const e = t.toString(), n = [], s = {
1113
+ color: [],
1114
+ number: [],
1115
+ var: []
1116
+ }, i = [];
1117
+ let o = 0;
1118
+ const a = e.replace(Eo, (l) => (R.test(l) ? (s.color.push(o), i.push(ei), n.push(R.parse(l))) : l.startsWith(Co) ? (s.var.push(o), i.push(Do), n.push(l)) : (s.number.push(o), i.push(ti), n.push(parseFloat(l))), ++o, Vn)).split(Vn);
1119
+ return { values: n, split: a, indexes: s, types: i };
1120
+ }
1121
+ function ni(t) {
1122
+ return Et(t).values;
1123
+ }
1124
+ function si(t) {
1125
+ const { split: e, types: n } = Et(t), s = e.length;
1126
+ return (i) => {
1127
+ let o = "";
1128
+ for (let r = 0; r < s; r++)
1129
+ if (o += e[r], i[r] !== void 0) {
1130
+ const a = n[r];
1131
+ a === ti ? o += St(i[r]) : a === ei ? o += R.transform(i[r]) : o += i[r];
1132
+ }
1133
+ return o;
1134
+ };
1135
+ }
1136
+ const Ro = (t) => typeof t == "number" ? 0 : t;
1137
+ function Lo(t) {
1138
+ const e = ni(t);
1139
+ return si(t)(e.map(Ro));
1140
+ }
1141
+ const J = {
1142
+ test: Mo,
1143
+ parse: ni,
1144
+ createTransformer: si,
1145
+ getAnimatableNone: Lo
1146
+ };
1147
+ function re(t, e, n) {
1148
+ return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
1149
+ }
1150
+ function ko({ hue: t, saturation: e, lightness: n, alpha: s }) {
1151
+ t /= 360, e /= 100, n /= 100;
1152
+ let i = 0, o = 0, r = 0;
1153
+ if (!e)
1154
+ i = o = r = n;
1155
+ else {
1156
+ const a = n < 0.5 ? n * (1 + e) : n + e - n * e, l = 2 * n - a;
1157
+ i = re(l, a, t + 1 / 3), o = re(l, a, t), r = re(l, a, t - 1 / 3);
1158
+ }
1159
+ return {
1160
+ red: Math.round(i * 255),
1161
+ green: Math.round(o * 255),
1162
+ blue: Math.round(r * 255),
1163
+ alpha: s
1164
+ };
1165
+ }
1166
+ function Ht(t, e) {
1167
+ return (n) => n > 0 ? e : t;
1168
+ }
1169
+ const V = (t, e, n) => t + (e - t) * n, oe = (t, e, n) => {
1170
+ const s = t * t, i = n * (e * e - s) + s;
1171
+ return i < 0 ? 0 : Math.sqrt(i);
1172
+ }, Bo = [Te, nt, lt], Fo = (t) => Bo.find((e) => e.test(t));
1173
+ function Mn(t) {
1174
+ const e = Fo(t);
1175
+ if (gt(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
1176
+ return !1;
1177
+ let n = e.parse(t);
1178
+ return e === lt && (n = ko(n)), n;
1179
+ }
1180
+ const Dn = (t, e) => {
1181
+ const n = Mn(t), s = Mn(e);
1182
+ if (!n || !s)
1183
+ return Ht(t, e);
1184
+ const i = { ...n };
1185
+ return (o) => (i.red = oe(n.red, s.red, o), i.green = oe(n.green, s.green, o), i.blue = oe(n.blue, s.blue, o), i.alpha = V(n.alpha, s.alpha, o), nt.transform(i));
1186
+ }, xe = /* @__PURE__ */ new Set(["none", "hidden"]);
1187
+ function Oo(t, e) {
1188
+ return xe.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
1189
+ }
1190
+ const Io = (t, e) => (n) => e(t(n)), Bt = (...t) => t.reduce(Io);
1191
+ function jo(t, e) {
1192
+ return (n) => V(t, e, n);
1193
+ }
1194
+ function rn(t) {
1195
+ return typeof t == "number" ? jo : typeof t == "string" ? Ge(t) ? Ht : R.test(t) ? Dn : Ko : Array.isArray(t) ? ii : typeof t == "object" ? R.test(t) ? Dn : No : Ht;
1196
+ }
1197
+ function ii(t, e) {
1198
+ const n = [...t], s = n.length, i = t.map((o, r) => rn(o)(o, e[r]));
1199
+ return (o) => {
1200
+ for (let r = 0; r < s; r++)
1201
+ n[r] = i[r](o);
1202
+ return n;
1203
+ };
1204
+ }
1205
+ function No(t, e) {
1206
+ const n = { ...t, ...e }, s = {};
1207
+ for (const i in n)
1208
+ t[i] !== void 0 && e[i] !== void 0 && (s[i] = rn(t[i])(t[i], e[i]));
1209
+ return (i) => {
1210
+ for (const o in s)
1211
+ n[o] = s[o](i);
1212
+ return n;
1213
+ };
1214
+ }
1215
+ function Uo(t, e) {
1216
+ const n = [], s = { color: 0, var: 0, number: 0 };
1217
+ for (let i = 0; i < e.values.length; i++) {
1218
+ const o = e.types[i], r = t.indexes[o][s[o]], a = t.values[r] ?? 0;
1219
+ n[i] = a, s[o]++;
1220
+ }
1221
+ return n;
1222
+ }
1223
+ const Ko = (t, e) => {
1224
+ const n = J.createTransformer(e), s = Et(t), i = Et(e);
1225
+ return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? xe.has(t) && !i.values.length || xe.has(e) && !s.values.length ? Oo(t, e) : Bt(ii(Uo(s, i), i.values), n) : (gt(!0, `Complex values '${t}' and '${e}' 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.`), Ht(t, e));
1226
+ };
1227
+ function ri(t, e, n) {
1228
+ return typeof t == "number" && typeof e == "number" && typeof n == "number" ? V(t, e, n) : rn(t)(t, e);
1229
+ }
1230
+ const Wo = (t) => {
1231
+ const e = ({ timestamp: n }) => t(n);
1232
+ return {
1233
+ start: (n = !0) => M.update(e, n),
1234
+ stop: () => Z(e),
1235
+ /**
1236
+ * If we're processing this frame we can use the
1237
+ * framelocked timestamp to keep things in sync.
1238
+ */
1239
+ now: () => E.isProcessing ? E.timestamp : I.now()
1240
+ };
1241
+ }, oi = (t, e, n = 10) => {
1242
+ let s = "";
1243
+ const i = Math.max(Math.round(e / n), 2);
1244
+ for (let o = 0; o < i; o++)
1245
+ s += t(o / (i - 1)) + ", ";
1246
+ return `linear(${s.substring(0, s.length - 2)})`;
1247
+ }, zt = 2e4;
1248
+ function on(t) {
1249
+ let e = 0;
1250
+ const n = 50;
1251
+ let s = t.next(e);
1252
+ for (; !s.done && e < zt; )
1253
+ e += n, s = t.next(e);
1254
+ return e >= zt ? 1 / 0 : e;
1255
+ }
1256
+ function $o(t, e = 100, n) {
1257
+ const s = n({ ...t, keyframes: [0, e] }), i = Math.min(on(s), zt);
1258
+ return {
1259
+ type: "keyframes",
1260
+ ease: (o) => s.next(i * o).value / e,
1261
+ duration: /* @__PURE__ */ G(i)
1262
+ };
1263
+ }
1264
+ const _o = 5;
1265
+ function ai(t, e, n) {
1266
+ const s = Math.max(e - _o, 0);
1267
+ return Zs(n - t(s), e - s);
1268
+ }
1269
+ const A = {
1270
+ // Default spring physics
1271
+ stiffness: 100,
1272
+ damping: 10,
1273
+ mass: 1,
1274
+ velocity: 0,
1275
+ // Default duration/bounce-based options
1276
+ duration: 800,
1277
+ // in ms
1278
+ bounce: 0.3,
1279
+ visualDuration: 0.3,
1280
+ // in seconds
1281
+ // Rest thresholds
1282
+ restSpeed: {
1283
+ granular: 0.01,
1284
+ default: 2
1285
+ },
1286
+ restDelta: {
1287
+ granular: 5e-3,
1288
+ default: 0.5
1289
+ },
1290
+ // Limits
1291
+ minDuration: 0.01,
1292
+ // in seconds
1293
+ maxDuration: 10,
1294
+ // in seconds
1295
+ minDamping: 0.05,
1296
+ maxDamping: 1
1297
+ }, ae = 1e-3;
1298
+ function Go({ duration: t = A.duration, bounce: e = A.bounce, velocity: n = A.velocity, mass: s = A.mass }) {
1299
+ let i, o;
1300
+ gt(t <= /* @__PURE__ */ $(A.maxDuration), "Spring duration must be 10 seconds or less");
1301
+ let r = 1 - e;
1302
+ r = X(A.minDamping, A.maxDamping, r), t = X(A.minDuration, A.maxDuration, /* @__PURE__ */ G(t)), r < 1 ? (i = (c) => {
1303
+ const u = c * r, h = u * t, f = u - n, d = Pe(c, r), m = Math.exp(-h);
1304
+ return ae - f / d * m;
1305
+ }, o = (c) => {
1306
+ const h = c * r * t, f = h * n + n, d = Math.pow(r, 2) * Math.pow(c, 2) * t, m = Math.exp(-h), y = Pe(Math.pow(c, 2), r);
1307
+ return (-i(c) + ae > 0 ? -1 : 1) * ((f - d) * m) / y;
1308
+ }) : (i = (c) => {
1309
+ const u = Math.exp(-c * t), h = (c - n) * t + 1;
1310
+ return -ae + u * h;
1311
+ }, o = (c) => {
1312
+ const u = Math.exp(-c * t), h = (n - c) * (t * t);
1313
+ return u * h;
1314
+ });
1315
+ const a = 5 / t, l = zo(i, o, a);
1316
+ if (t = /* @__PURE__ */ $(t), isNaN(l))
1317
+ return {
1318
+ stiffness: A.stiffness,
1319
+ damping: A.damping,
1320
+ duration: t
1321
+ };
1322
+ {
1323
+ const c = Math.pow(l, 2) * s;
1324
+ return {
1325
+ stiffness: c,
1326
+ damping: r * 2 * Math.sqrt(s * c),
1327
+ duration: t
1328
+ };
1329
+ }
1330
+ }
1331
+ const Ho = 12;
1332
+ function zo(t, e, n) {
1333
+ let s = n;
1334
+ for (let i = 1; i < Ho; i++)
1335
+ s = s - t(s) / e(s);
1336
+ return s;
1337
+ }
1338
+ function Pe(t, e) {
1339
+ return t * Math.sqrt(1 - e * e);
1340
+ }
1341
+ const Yo = ["duration", "bounce"], Xo = ["stiffness", "damping", "mass"];
1342
+ function Cn(t, e) {
1343
+ return e.some((n) => t[n] !== void 0);
1344
+ }
1345
+ function qo(t) {
1346
+ let e = {
1347
+ velocity: A.velocity,
1348
+ stiffness: A.stiffness,
1349
+ damping: A.damping,
1350
+ mass: A.mass,
1351
+ isResolvedFromDuration: !1,
1352
+ ...t
1353
+ };
1354
+ if (!Cn(t, Xo) && Cn(t, Yo))
1355
+ if (t.visualDuration) {
1356
+ const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, o = 2 * X(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(i);
1357
+ e = {
1358
+ ...e,
1359
+ mass: A.mass,
1360
+ stiffness: i,
1361
+ damping: o
1362
+ };
1363
+ } else {
1364
+ const n = Go(t);
1365
+ e = {
1366
+ ...e,
1367
+ ...n,
1368
+ mass: A.mass
1369
+ }, e.isResolvedFromDuration = !0;
1370
+ }
1371
+ return e;
1372
+ }
1373
+ function Yt(t = A.visualDuration, e = A.bounce) {
1374
+ const n = typeof t != "object" ? {
1375
+ visualDuration: t,
1376
+ keyframes: [0, 1],
1377
+ bounce: e
1378
+ } : t;
1379
+ let { restSpeed: s, restDelta: i } = n;
1380
+ const o = n.keyframes[0], r = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: o }, { stiffness: l, damping: c, mass: u, duration: h, velocity: f, isResolvedFromDuration: d } = qo({
1381
+ ...n,
1382
+ velocity: -/* @__PURE__ */ G(n.velocity || 0)
1383
+ }), m = f || 0, y = c / (2 * Math.sqrt(l * u)), v = r - o, g = /* @__PURE__ */ G(Math.sqrt(l / u)), P = Math.abs(v) < 5;
1384
+ s || (s = P ? A.restSpeed.granular : A.restSpeed.default), i || (i = P ? A.restDelta.granular : A.restDelta.default);
1385
+ let p;
1386
+ if (y < 1) {
1387
+ const x = Pe(g, y);
1388
+ p = (w) => {
1389
+ const C = Math.exp(-y * g * w);
1390
+ return r - C * ((m + y * g * v) / x * Math.sin(x * w) + v * Math.cos(x * w));
1391
+ };
1392
+ } else if (y === 1)
1393
+ p = (x) => r - Math.exp(-g * x) * (v + (m + g * v) * x);
1394
+ else {
1395
+ const x = g * Math.sqrt(y * y - 1);
1396
+ p = (w) => {
1397
+ const C = Math.exp(-y * g * w), S = Math.min(x * w, 300);
1398
+ return r - C * ((m + y * g * v) * Math.sinh(S) + x * v * Math.cosh(S)) / x;
1399
+ };
1400
+ }
1401
+ const b = {
1402
+ calculatedDuration: d && h || null,
1403
+ next: (x) => {
1404
+ const w = p(x);
1405
+ if (d)
1406
+ a.done = x >= h;
1407
+ else {
1408
+ let C = x === 0 ? m : 0;
1409
+ y < 1 && (C = x === 0 ? /* @__PURE__ */ $(m) : ai(p, x, w));
1410
+ const S = Math.abs(C) <= s, F = Math.abs(r - w) <= i;
1411
+ a.done = S && F;
1412
+ }
1413
+ return a.value = a.done ? r : w, a;
1414
+ },
1415
+ toString: () => {
1416
+ const x = Math.min(on(b), zt), w = oi((C) => b.next(x * C).value, x, 30);
1417
+ return x + "ms " + w;
1418
+ },
1419
+ toTransition: () => {
1420
+ }
1421
+ };
1422
+ return b;
1423
+ }
1424
+ Yt.applyToOptions = (t) => {
1425
+ const e = $o(t, 100, Yt);
1426
+ return t.ease = e.ease, t.duration = /* @__PURE__ */ $(e.duration), t.type = "keyframes", t;
1427
+ };
1428
+ function Se({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: o = 500, modifyTarget: r, min: a, max: l, restDelta: c = 0.5, restSpeed: u }) {
1429
+ const h = t[0], f = {
1430
+ done: !1,
1431
+ value: h
1432
+ }, d = (S) => a !== void 0 && S < a || l !== void 0 && S > l, m = (S) => a === void 0 ? l : l === void 0 || Math.abs(a - S) < Math.abs(l - S) ? a : l;
1433
+ let y = n * e;
1434
+ const v = h + y, g = r === void 0 ? v : r(v);
1435
+ g !== v && (y = g - h);
1436
+ const P = (S) => -y * Math.exp(-S / s), p = (S) => g + P(S), b = (S) => {
1437
+ const F = P(S), j = p(S);
1438
+ f.done = Math.abs(F) <= c, f.value = f.done ? g : j;
1439
+ };
1440
+ let x, w;
1441
+ const C = (S) => {
1442
+ d(f.value) && (x = S, w = Yt({
1443
+ keyframes: [f.value, m(f.value)],
1444
+ velocity: ai(p, S, f.value),
1445
+ // TODO: This should be passing * 1000
1446
+ damping: i,
1447
+ stiffness: o,
1448
+ restDelta: c,
1449
+ restSpeed: u
1450
+ }));
1451
+ };
1452
+ return C(0), {
1453
+ calculatedDuration: null,
1454
+ next: (S) => {
1455
+ let F = !1;
1456
+ return !w && x === void 0 && (F = !0, b(S), C(S)), x !== void 0 && S >= x ? w.next(S - x) : (!F && b(S), f);
1457
+ }
1458
+ };
1459
+ }
1460
+ const Rt = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
1461
+ const s = e - t;
1462
+ return s === 0 ? 1 : (n - t) / s;
1463
+ };
1464
+ function Zo(t, e, n) {
1465
+ const s = [], i = n || z.mix || ri, o = t.length - 1;
1466
+ for (let r = 0; r < o; r++) {
1467
+ let a = i(t[r], t[r + 1]);
1468
+ if (e) {
1469
+ const l = Array.isArray(e) ? e[r] || K : e;
1470
+ a = Bt(l, a);
1471
+ }
1472
+ s.push(a);
1473
+ }
1474
+ return s;
1475
+ }
1476
+ function Jo(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
1477
+ const o = t.length;
1478
+ if (Y(o === e.length, "Both input and output ranges must be the same length"), o === 1)
1479
+ return () => e[0];
1480
+ if (o === 2 && e[0] === e[1])
1481
+ return () => e[1];
1482
+ const r = t[0] === t[1];
1483
+ t[0] > t[o - 1] && (t = [...t].reverse(), e = [...e].reverse());
1484
+ const a = Zo(e, s, i), l = a.length, c = (u) => {
1485
+ if (r && u < t[0])
1486
+ return e[0];
1487
+ let h = 0;
1488
+ if (l > 1)
1489
+ for (; h < t.length - 2 && !(u < t[h + 1]); h++)
1490
+ ;
1491
+ const f = /* @__PURE__ */ Rt(t[h], t[h + 1], u);
1492
+ return a[h](f);
1493
+ };
1494
+ return n ? (u) => c(X(t[0], t[o - 1], u)) : c;
1495
+ }
1496
+ function Qo(t, e) {
1497
+ const n = t[t.length - 1];
1498
+ for (let s = 1; s <= e; s++) {
1499
+ const i = /* @__PURE__ */ Rt(0, e, s);
1500
+ t.push(V(n, 1, i));
1501
+ }
1502
+ }
1503
+ function ta(t) {
1504
+ const e = [0];
1505
+ return Qo(e, t.length - 1), e;
1506
+ }
1507
+ function ea(t, e) {
1508
+ return t.map((n) => n * e);
1509
+ }
1510
+ const li = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, na = 1e-7, sa = 12;
1511
+ function ia(t, e, n, s, i) {
1512
+ let o, r, a = 0;
1513
+ do
1514
+ r = e + (n - e) / 2, o = li(r, s, i) - t, o > 0 ? n = r : e = r;
1515
+ while (Math.abs(o) > na && ++a < sa);
1516
+ return r;
1517
+ }
1518
+ function Ft(t, e, n, s) {
1519
+ if (t === e && n === s)
1520
+ return K;
1521
+ const i = (o) => ia(o, 0, 1, t, n);
1522
+ return (o) => o === 0 || o === 1 ? o : li(i(o), e, s);
1523
+ }
1524
+ const ra = /* @__PURE__ */ Ft(0.42, 0, 1, 1), oa = /* @__PURE__ */ Ft(0, 0, 0.58, 1), ui = /* @__PURE__ */ Ft(0.42, 0, 0.58, 1), aa = (t) => Array.isArray(t) && typeof t[0] != "number", ci = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, hi = (t) => (e) => 1 - t(1 - e), fi = /* @__PURE__ */ Ft(0.33, 1.53, 0.69, 0.99), an = /* @__PURE__ */ hi(fi), di = /* @__PURE__ */ ci(an), mi = (t) => (t *= 2) < 1 ? 0.5 * an(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), ln = (t) => 1 - Math.sin(Math.acos(t)), pi = hi(ln), gi = ci(ln), yi = (t) => Array.isArray(t) && typeof t[0] == "number", En = {
1525
+ linear: K,
1526
+ easeIn: ra,
1527
+ easeInOut: ui,
1528
+ easeOut: oa,
1529
+ circIn: ln,
1530
+ circInOut: gi,
1531
+ circOut: pi,
1532
+ backIn: an,
1533
+ backInOut: di,
1534
+ backOut: fi,
1535
+ anticipate: mi
1536
+ }, la = (t) => typeof t == "string", Rn = (t) => {
1537
+ if (yi(t)) {
1538
+ Y(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
1539
+ const [e, n, s, i] = t;
1540
+ return Ft(e, n, s, i);
1541
+ } else if (la(t))
1542
+ return Y(En[t] !== void 0, `Invalid easing type '${t}'`), En[t];
1543
+ return t;
1544
+ };
1545
+ function ua(t, e) {
1546
+ return t.map(() => e || ui).splice(0, t.length - 1);
1547
+ }
1548
+ function ut({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" }) {
1549
+ const i = aa(s) ? s.map(Rn) : Rn(s), o = {
1550
+ done: !1,
1551
+ value: e[0]
1552
+ }, r = ea(
1553
+ // Only use the provided offsets if they're the correct length
1554
+ // TODO Maybe we should warn here if there's a length mismatch
1555
+ n && n.length === e.length ? n : ta(e),
1556
+ t
1557
+ ), a = Jo(r, e, {
1558
+ ease: Array.isArray(i) ? i : ua(e, i)
1559
+ });
1560
+ return {
1561
+ calculatedDuration: t,
1562
+ next: (l) => (o.value = a(l), o.done = l >= t, o)
1563
+ };
1564
+ }
1565
+ const ca = (t) => t !== null;
1566
+ function un(t, { repeat: e, repeatType: n = "loop" }, s, i = 1) {
1567
+ const o = t.filter(ca), a = i < 0 || e && n !== "loop" && e % 2 === 1 ? 0 : o.length - 1;
1568
+ return !a || s === void 0 ? o[a] : s;
1569
+ }
1570
+ const ha = {
1571
+ decay: Se,
1572
+ inertia: Se,
1573
+ tween: ut,
1574
+ keyframes: ut,
1575
+ spring: Yt
1576
+ };
1577
+ function vi(t) {
1578
+ typeof t.type == "string" && (t.type = ha[t.type]);
1579
+ }
1580
+ class cn {
1581
+ constructor() {
1582
+ this.updateFinished();
1583
+ }
1584
+ get finished() {
1585
+ return this._finished;
1586
+ }
1587
+ updateFinished() {
1588
+ this._finished = new Promise((e) => {
1589
+ this.resolve = e;
1590
+ });
1591
+ }
1592
+ notifyFinished() {
1593
+ this.resolve();
1594
+ }
1595
+ /**
1596
+ * Allows the animation to be awaited.
1597
+ *
1598
+ * @deprecated Use `finished` instead.
1599
+ */
1600
+ then(e, n) {
1601
+ return this.finished.then(e, n);
1602
+ }
1603
+ }
1604
+ const fa = (t) => t / 100;
1605
+ class hn extends cn {
1606
+ constructor(e) {
1607
+ super(), this.state = "idle", this.startTime = null, this.isStopped = !1, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.stop = (n = !0) => {
1608
+ if (n) {
1609
+ const { motionValue: s } = this.options;
1610
+ s && s.updatedAt !== I.now() && this.tick(I.now());
1611
+ }
1612
+ this.isStopped = !0, this.state !== "idle" && (this.teardown(), this.options.onStop?.());
1613
+ }, this.options = e, this.initAnimation(), this.play(), e.autoplay === !1 && this.pause();
1614
+ }
1615
+ initAnimation() {
1616
+ const { options: e } = this;
1617
+ vi(e);
1618
+ const { type: n = ut, repeat: s = 0, repeatDelay: i = 0, repeatType: o, velocity: r = 0 } = e;
1619
+ let { keyframes: a } = e;
1620
+ const l = n || ut;
1621
+ process.env.NODE_ENV !== "production" && l !== ut && Y(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`), l !== ut && typeof a[0] != "number" && (this.mixKeyframes = Bt(fa, ri(a[0], a[1])), a = [0, 100]);
1622
+ const c = l({ ...e, keyframes: a });
1623
+ o === "mirror" && (this.mirroredGenerator = l({
1624
+ ...e,
1625
+ keyframes: [...a].reverse(),
1626
+ velocity: -r
1627
+ })), c.calculatedDuration === null && (c.calculatedDuration = on(c));
1628
+ const { calculatedDuration: u } = c;
1629
+ this.calculatedDuration = u, this.resolvedDuration = u + i, this.totalDuration = this.resolvedDuration * (s + 1) - i, this.generator = c;
1630
+ }
1631
+ updateTime(e) {
1632
+ const n = Math.round(e - this.startTime) * this.playbackSpeed;
1633
+ this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = n;
1634
+ }
1635
+ tick(e, n = !1) {
1636
+ const { generator: s, totalDuration: i, mixKeyframes: o, mirroredGenerator: r, resolvedDuration: a, calculatedDuration: l } = this;
1637
+ if (this.startTime === null)
1638
+ return s.next(0);
1639
+ const { delay: c = 0, keyframes: u, repeat: h, repeatType: f, repeatDelay: d, type: m, onUpdate: y, finalKeyframe: v } = this.options;
1640
+ this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - i / this.speed, this.startTime)), n ? this.currentTime = e : this.updateTime(e);
1641
+ const g = this.currentTime - c * (this.playbackSpeed >= 0 ? 1 : -1), P = this.playbackSpeed >= 0 ? g < 0 : g > i;
1642
+ this.currentTime = Math.max(g, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = i);
1643
+ let p = this.currentTime, b = s;
1644
+ if (h) {
1645
+ const S = Math.min(this.currentTime, i) / a;
1646
+ let F = Math.floor(S), j = S % 1;
1647
+ !j && S >= 1 && (j = 1), j === 1 && F--, F = Math.min(F, h + 1), !!(F % 2) && (f === "reverse" ? (j = 1 - j, d && (j -= d / a)) : f === "mirror" && (b = r)), p = X(0, 1, j) * a;
1648
+ }
1649
+ const x = P ? { done: !1, value: u[0] } : b.next(p);
1650
+ o && (x.value = o(x.value));
1651
+ let { done: w } = x;
1652
+ !P && l !== null && (w = this.playbackSpeed >= 0 ? this.currentTime >= i : this.currentTime <= 0);
1653
+ const C = this.holdTime === null && (this.state === "finished" || this.state === "running" && w);
1654
+ return C && m !== Se && (x.value = un(u, this.options, v, this.speed)), y && y(x.value), C && this.finish(), x;
1655
+ }
1656
+ /**
1657
+ * Allows the returned animation to be awaited or promise-chained. Currently
1658
+ * resolves when the animation finishes at all but in a future update could/should
1659
+ * reject if its cancels.
1660
+ */
1661
+ then(e, n) {
1662
+ return this.finished.then(e, n);
1663
+ }
1664
+ get duration() {
1665
+ return /* @__PURE__ */ G(this.calculatedDuration);
1666
+ }
1667
+ get time() {
1668
+ return /* @__PURE__ */ G(this.currentTime);
1669
+ }
1670
+ set time(e) {
1671
+ e = /* @__PURE__ */ $(e), this.currentTime = e, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.playbackSpeed), this.driver?.start(!1);
1672
+ }
1673
+ get speed() {
1674
+ return this.playbackSpeed;
1675
+ }
1676
+ set speed(e) {
1677
+ this.updateTime(I.now());
1678
+ const n = this.playbackSpeed !== e;
1679
+ this.playbackSpeed = e, n && (this.time = /* @__PURE__ */ G(this.currentTime));
1680
+ }
1681
+ play() {
1682
+ if (this.isStopped)
1683
+ return;
1684
+ const { driver: e = Wo, startTime: n } = this.options;
1685
+ this.driver || (this.driver = e((i) => this.tick(i))), this.options.onPlay?.();
1686
+ const s = this.driver.now();
1687
+ this.state === "finished" ? (this.updateFinished(), this.startTime = s) : this.holdTime !== null ? this.startTime = s - this.holdTime : this.startTime || (this.startTime = n ?? s), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
1688
+ }
1689
+ pause() {
1690
+ this.state = "paused", this.updateTime(I.now()), this.holdTime = this.currentTime;
1691
+ }
1692
+ complete() {
1693
+ this.state !== "running" && this.play(), this.state = "finished", this.holdTime = null;
1694
+ }
1695
+ finish() {
1696
+ this.notifyFinished(), this.teardown(), this.state = "finished", this.options.onComplete?.();
1697
+ }
1698
+ cancel() {
1699
+ this.holdTime = null, this.startTime = 0, this.tick(0), this.teardown(), this.options.onCancel?.();
1700
+ }
1701
+ teardown() {
1702
+ this.state = "idle", this.stopDriver(), this.startTime = this.holdTime = null;
1703
+ }
1704
+ stopDriver() {
1705
+ this.driver && (this.driver.stop(), this.driver = void 0);
1706
+ }
1707
+ sample(e) {
1708
+ return this.startTime = 0, this.tick(e, !0);
1709
+ }
1710
+ attachTimeline(e) {
1711
+ return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), this.driver?.stop(), e.observe(this);
1712
+ }
1713
+ }
1714
+ function da(t) {
1715
+ for (let e = 1; e < t.length; e++)
1716
+ t[e] ?? (t[e] = t[e - 1]);
1717
+ }
1718
+ const st = (t) => t * 180 / Math.PI, be = (t) => {
1719
+ const e = st(Math.atan2(t[1], t[0]));
1720
+ return we(e);
1721
+ }, ma = {
1722
+ x: 4,
1723
+ y: 5,
1724
+ translateX: 4,
1725
+ translateY: 5,
1726
+ scaleX: 0,
1727
+ scaleY: 3,
1728
+ scale: (t) => (Math.abs(t[0]) + Math.abs(t[3])) / 2,
1729
+ rotate: be,
1730
+ rotateZ: be,
1731
+ skewX: (t) => st(Math.atan(t[1])),
1732
+ skewY: (t) => st(Math.atan(t[2])),
1733
+ skew: (t) => (Math.abs(t[1]) + Math.abs(t[2])) / 2
1734
+ }, we = (t) => (t = t % 360, t < 0 && (t += 360), t), Ln = be, kn = (t) => Math.sqrt(t[0] * t[0] + t[1] * t[1]), Bn = (t) => Math.sqrt(t[4] * t[4] + t[5] * t[5]), pa = {
1735
+ x: 12,
1736
+ y: 13,
1737
+ z: 14,
1738
+ translateX: 12,
1739
+ translateY: 13,
1740
+ translateZ: 14,
1741
+ scaleX: kn,
1742
+ scaleY: Bn,
1743
+ scale: (t) => (kn(t) + Bn(t)) / 2,
1744
+ rotateX: (t) => we(st(Math.atan2(t[6], t[5]))),
1745
+ rotateY: (t) => we(st(Math.atan2(-t[2], t[0]))),
1746
+ rotateZ: Ln,
1747
+ rotate: Ln,
1748
+ skewX: (t) => st(Math.atan(t[4])),
1749
+ skewY: (t) => st(Math.atan(t[1])),
1750
+ skew: (t) => (Math.abs(t[1]) + Math.abs(t[4])) / 2
1751
+ };
1752
+ function Ae(t) {
1753
+ return t.includes("scale") ? 1 : 0;
1754
+ }
1755
+ function Ve(t, e) {
1756
+ if (!t || t === "none")
1757
+ return Ae(e);
1758
+ const n = t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
1759
+ let s, i;
1760
+ if (n)
1761
+ s = pa, i = n;
1762
+ else {
1763
+ const a = t.match(/^matrix\(([-\d.e\s,]+)\)$/u);
1764
+ s = ma, i = a;
1765
+ }
1766
+ if (!i)
1767
+ return Ae(e);
1768
+ const o = s[e], r = i[1].split(",").map(ya);
1769
+ return typeof o == "function" ? o(r) : r[o];
1770
+ }
1771
+ const ga = (t, e) => {
1772
+ const { transform: n = "none" } = getComputedStyle(t);
1773
+ return Ve(n, e);
1774
+ };
1775
+ function ya(t) {
1776
+ return parseFloat(t.trim());
1777
+ }
1778
+ const Fn = (t) => t === Tt || t === T, va = /* @__PURE__ */ new Set(["x", "y", "z"]), Ta = yt.filter((t) => !va.has(t));
1779
+ function xa(t) {
1780
+ const e = [];
1781
+ return Ta.forEach((n) => {
1782
+ const s = t.getValue(n);
1783
+ s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
1784
+ }), e;
1785
+ }
1786
+ const it = {
1787
+ // Dimensions
1788
+ width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
1789
+ height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
1790
+ top: (t, { top: e }) => parseFloat(e),
1791
+ left: (t, { left: e }) => parseFloat(e),
1792
+ bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
1793
+ right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
1794
+ // Transform
1795
+ x: (t, { transform: e }) => Ve(e, "x"),
1796
+ y: (t, { transform: e }) => Ve(e, "y")
1797
+ };
1798
+ it.translateX = it.x;
1799
+ it.translateY = it.y;
1800
+ const rt = /* @__PURE__ */ new Set();
1801
+ let Me = !1, De = !1, Ce = !1;
1802
+ function Ti() {
1803
+ if (De) {
1804
+ const t = Array.from(rt).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
1805
+ e.forEach((s) => {
1806
+ const i = xa(s);
1807
+ i.length && (n.set(s, i), s.render());
1808
+ }), t.forEach((s) => s.measureInitialState()), e.forEach((s) => {
1809
+ s.render();
1810
+ const i = n.get(s);
1811
+ i && i.forEach(([o, r]) => {
1812
+ s.getValue(o)?.set(r);
1813
+ });
1814
+ }), t.forEach((s) => s.measureEndState()), t.forEach((s) => {
1815
+ s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
1816
+ });
1817
+ }
1818
+ De = !1, Me = !1, rt.forEach((t) => t.complete(Ce)), rt.clear();
1819
+ }
1820
+ function xi() {
1821
+ rt.forEach((t) => {
1822
+ t.readKeyframes(), t.needsMeasurement && (De = !0);
1823
+ });
1824
+ }
1825
+ function Pa() {
1826
+ Ce = !0, xi(), Ti(), Ce = !1;
1827
+ }
1828
+ class fn {
1829
+ constructor(e, n, s, i, o, r = !1) {
1830
+ this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = o, this.isAsync = r;
1831
+ }
1832
+ scheduleResolve() {
1833
+ this.state = "scheduled", this.isAsync ? (rt.add(this), Me || (Me = !0, M.read(xi), M.resolveKeyframes(Ti))) : (this.readKeyframes(), this.complete());
1834
+ }
1835
+ readKeyframes() {
1836
+ const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
1837
+ if (e[0] === null) {
1838
+ const o = i?.get(), r = e[e.length - 1];
1839
+ if (o !== void 0)
1840
+ e[0] = o;
1841
+ else if (s && n) {
1842
+ const a = s.readValue(n, r);
1843
+ a != null && (e[0] = a);
1844
+ }
1845
+ e[0] === void 0 && (e[0] = r), i && o === void 0 && i.set(e[0]);
1846
+ }
1847
+ da(e);
1848
+ }
1849
+ setFinalKeyframe() {
1850
+ }
1851
+ measureInitialState() {
1852
+ }
1853
+ renderEndStyles() {
1854
+ }
1855
+ measureEndState() {
1856
+ }
1857
+ complete(e = !1) {
1858
+ this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e), rt.delete(this);
1859
+ }
1860
+ cancel() {
1861
+ this.state === "scheduled" && (rt.delete(this), this.state = "pending");
1862
+ }
1863
+ resume() {
1864
+ this.state === "pending" && this.scheduleResolve();
1865
+ }
1866
+ }
1867
+ const Sa = (t) => t.startsWith("--");
1868
+ function ba(t, e, n) {
1869
+ Sa(e) ? t.style.setProperty(e, n) : t.style[e] = n;
1870
+ }
1871
+ // @__NO_SIDE_EFFECTS__
1872
+ function dn(t) {
1873
+ let e;
1874
+ return () => (e === void 0 && (e = t()), e);
1875
+ }
1876
+ const wa = /* @__PURE__ */ dn(() => window.ScrollTimeline !== void 0), Aa = {};
1877
+ function Va(t, e) {
1878
+ const n = /* @__PURE__ */ dn(t);
1879
+ return () => Aa[e] ?? n();
1880
+ }
1881
+ const Pi = /* @__PURE__ */ Va(() => {
1882
+ try {
1883
+ document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
1884
+ } catch {
1885
+ return !1;
1886
+ }
1887
+ return !0;
1888
+ }, "linearEasing"), Pt = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, On = {
1889
+ linear: "linear",
1890
+ ease: "ease",
1891
+ easeIn: "ease-in",
1892
+ easeOut: "ease-out",
1893
+ easeInOut: "ease-in-out",
1894
+ circIn: /* @__PURE__ */ Pt([0, 0.65, 0.55, 1]),
1895
+ circOut: /* @__PURE__ */ Pt([0.55, 0, 1, 0.45]),
1896
+ backIn: /* @__PURE__ */ Pt([0.31, 0.01, 0.66, -0.59]),
1897
+ backOut: /* @__PURE__ */ Pt([0.33, 1.53, 0.69, 0.99])
1898
+ };
1899
+ function Si(t, e) {
1900
+ if (t)
1901
+ return typeof t == "function" ? Pi() ? oi(t, e) : "ease-out" : yi(t) ? Pt(t) : Array.isArray(t) ? t.map((n) => Si(n, e) || On.easeOut) : On[t];
1902
+ }
1903
+ function Ma(t, e, n, { delay: s = 0, duration: i = 300, repeat: o = 0, repeatType: r = "loop", ease: a = "easeOut", times: l } = {}, c = void 0) {
1904
+ const u = {
1905
+ [e]: n
1906
+ };
1907
+ l && (u.offset = l);
1908
+ const h = Si(a, i);
1909
+ Array.isArray(h) && (u.easing = h);
1910
+ const f = {
1911
+ delay: s,
1912
+ duration: i,
1913
+ easing: Array.isArray(h) ? "linear" : h,
1914
+ fill: "both",
1915
+ iterations: o + 1,
1916
+ direction: r === "reverse" ? "alternate" : "normal"
1917
+ };
1918
+ return c && (f.pseudoElement = c), t.animate(u, f);
1919
+ }
1920
+ function bi(t) {
1921
+ return typeof t == "function" && "applyToOptions" in t;
1922
+ }
1923
+ function Da({ type: t, ...e }) {
1924
+ return bi(t) && Pi() ? t.applyToOptions(e) : (e.duration ?? (e.duration = 300), e.ease ?? (e.ease = "easeOut"), e);
1925
+ }
1926
+ class Ca extends cn {
1927
+ constructor(e) {
1928
+ if (super(), this.finishedTime = null, this.isStopped = !1, !e)
1929
+ return;
1930
+ const { element: n, name: s, keyframes: i, pseudoElement: o, allowFlatten: r = !1, finalKeyframe: a, onComplete: l } = e;
1931
+ this.isPseudoElement = !!o, this.allowFlatten = r, this.options = e, Y(typeof e.type != "string", `animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);
1932
+ const c = Da(e);
1933
+ this.animation = Ma(n, s, i, c, o), c.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
1934
+ if (this.finishedTime = this.time, !o) {
1935
+ const u = un(i, this.options, a, this.speed);
1936
+ this.updateMotionValue ? this.updateMotionValue(u) : ba(n, s, u), this.animation.cancel();
1937
+ }
1938
+ l?.(), this.notifyFinished();
1939
+ };
1940
+ }
1941
+ play() {
1942
+ this.isStopped || (this.animation.play(), this.state === "finished" && this.updateFinished());
1943
+ }
1944
+ pause() {
1945
+ this.animation.pause();
1946
+ }
1947
+ complete() {
1948
+ this.animation.finish?.();
1949
+ }
1950
+ cancel() {
1951
+ try {
1952
+ this.animation.cancel();
1953
+ } catch {
1954
+ }
1955
+ }
1956
+ stop() {
1957
+ if (this.isStopped)
1958
+ return;
1959
+ this.isStopped = !0;
1960
+ const { state: e } = this;
1961
+ e === "idle" || e === "finished" || (this.updateMotionValue ? this.updateMotionValue() : this.commitStyles(), this.isPseudoElement || this.cancel());
1962
+ }
1963
+ /**
1964
+ * WAAPI doesn't natively have any interruption capabilities.
1965
+ *
1966
+ * In this method, we commit styles back to the DOM before cancelling
1967
+ * the animation.
1968
+ *
1969
+ * This is designed to be overridden by NativeAnimationExtended, which
1970
+ * will create a renderless JS animation and sample it twice to calculate
1971
+ * its current value, "previous" value, and therefore allow
1972
+ * Motion to also correctly calculate velocity for any subsequent animation
1973
+ * while deferring the commit until the next animation frame.
1974
+ */
1975
+ commitStyles() {
1976
+ this.isPseudoElement || this.animation.commitStyles?.();
1977
+ }
1978
+ get duration() {
1979
+ const e = this.animation.effect?.getComputedTiming?.().duration || 0;
1980
+ return /* @__PURE__ */ G(Number(e));
1981
+ }
1982
+ get time() {
1983
+ return /* @__PURE__ */ G(Number(this.animation.currentTime) || 0);
1984
+ }
1985
+ set time(e) {
1986
+ this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ $(e);
1987
+ }
1988
+ /**
1989
+ * The playback speed of the animation.
1990
+ * 1 = normal speed, 2 = double speed, 0.5 = half speed.
1991
+ */
1992
+ get speed() {
1993
+ return this.animation.playbackRate;
1994
+ }
1995
+ set speed(e) {
1996
+ e < 0 && (this.finishedTime = null), this.animation.playbackRate = e;
1997
+ }
1998
+ get state() {
1999
+ return this.finishedTime !== null ? "finished" : this.animation.playState;
2000
+ }
2001
+ get startTime() {
2002
+ return Number(this.animation.startTime);
2003
+ }
2004
+ set startTime(e) {
2005
+ this.animation.startTime = e;
2006
+ }
2007
+ /**
2008
+ * Attaches a timeline to the animation, for instance the `ScrollTimeline`.
2009
+ */
2010
+ attachTimeline({ timeline: e, observe: n }) {
2011
+ return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, e && wa() ? (this.animation.timeline = e, K) : n(this);
2012
+ }
2013
+ }
2014
+ const wi = {
2015
+ anticipate: mi,
2016
+ backInOut: di,
2017
+ circInOut: gi
2018
+ };
2019
+ function Ea(t) {
2020
+ return t in wi;
2021
+ }
2022
+ function Ra(t) {
2023
+ typeof t.ease == "string" && Ea(t.ease) && (t.ease = wi[t.ease]);
2024
+ }
2025
+ const In = 10;
2026
+ class La extends Ca {
2027
+ constructor(e) {
2028
+ Ra(e), vi(e), super(e), e.startTime && (this.startTime = e.startTime), this.options = e;
2029
+ }
2030
+ /**
2031
+ * WAAPI doesn't natively have any interruption capabilities.
2032
+ *
2033
+ * Rather than read commited styles back out of the DOM, we can
2034
+ * create a renderless JS animation and sample it twice to calculate
2035
+ * its current value, "previous" value, and therefore allow
2036
+ * Motion to calculate velocity for any subsequent animation.
2037
+ */
2038
+ updateMotionValue(e) {
2039
+ const { motionValue: n, onUpdate: s, onComplete: i, element: o, ...r } = this.options;
2040
+ if (!n)
2041
+ return;
2042
+ if (e !== void 0) {
2043
+ n.set(e);
2044
+ return;
2045
+ }
2046
+ const a = new hn({
2047
+ ...r,
2048
+ autoplay: !1
2049
+ }), l = /* @__PURE__ */ $(this.finishedTime ?? this.time);
2050
+ n.setWithVelocity(a.sample(l - In).value, a.sample(l).value, In), a.stop();
2051
+ }
2052
+ }
2053
+ const jn = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
2054
+ (J.test(t) || t === "0") && // And it contains numbers and/or colors
2055
+ !t.startsWith("url("));
2056
+ function ka(t) {
2057
+ const e = t[0];
2058
+ if (t.length === 1)
2059
+ return !0;
2060
+ for (let n = 0; n < t.length; n++)
2061
+ if (t[n] !== e)
2062
+ return !0;
2063
+ }
2064
+ function Ba(t, e, n, s) {
2065
+ const i = t[0];
2066
+ if (i === null)
2067
+ return !1;
2068
+ if (e === "display" || e === "visibility")
2069
+ return !0;
2070
+ const o = t[t.length - 1], r = jn(i, e), a = jn(o, e);
2071
+ return gt(r === a, `You are trying to animate ${e} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`), !r || !a ? !1 : ka(t) || (n === "spring" || bi(n)) && s;
2072
+ }
2073
+ const Fa = /* @__PURE__ */ new Set([
2074
+ "opacity",
2075
+ "clipPath",
2076
+ "filter",
2077
+ "transform"
2078
+ // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
2079
+ // or until we implement support for linear() easing.
2080
+ // "background-color"
2081
+ ]), Oa = /* @__PURE__ */ dn(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
2082
+ function Ia(t) {
2083
+ const { motionValue: e, name: n, repeatDelay: s, repeatType: i, damping: o, type: r } = t;
2084
+ if (!e || !e.owner || !(e.owner.current instanceof HTMLElement))
2085
+ return !1;
2086
+ const { onUpdate: a, transformTemplate: l } = e.owner.getProps();
2087
+ return Oa() && n && Fa.has(n) && (n !== "transform" || !l) && /**
2088
+ * If we're outputting values to onUpdate then we can't use WAAPI as there's
2089
+ * no way to read the value from WAAPI every frame.
2090
+ */
2091
+ !a && !s && i !== "mirror" && o !== 0 && r !== "inertia";
2092
+ }
2093
+ const ja = 40;
2094
+ class Na extends cn {
2095
+ constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: o = 0, repeatType: r = "loop", keyframes: a, name: l, motionValue: c, element: u, ...h }) {
2096
+ super(), this.stop = () => {
2097
+ this._animation && (this._animation.stop(), this.stopTimeline?.()), this.keyframeResolver?.cancel();
2098
+ }, this.createdAt = I.now();
2099
+ const f = {
2100
+ autoplay: e,
2101
+ delay: n,
2102
+ type: s,
2103
+ repeat: i,
2104
+ repeatDelay: o,
2105
+ repeatType: r,
2106
+ name: l,
2107
+ motionValue: c,
2108
+ element: u,
2109
+ ...h
2110
+ }, d = u?.KeyframeResolver || fn;
2111
+ this.keyframeResolver = new d(a, (m, y, v) => this.onKeyframesResolved(m, y, f, !v), l, c, u), this.keyframeResolver?.scheduleResolve();
2112
+ }
2113
+ onKeyframesResolved(e, n, s, i) {
2114
+ this.keyframeResolver = void 0;
2115
+ const { name: o, type: r, velocity: a, delay: l, isHandoff: c, onUpdate: u } = s;
2116
+ this.resolvedAt = I.now(), Ba(e, o, r, a) || ((z.instantAnimations || !l) && u?.(un(e, s, n)), e[0] = e[e.length - 1], s.duration = 0, s.repeat = 0);
2117
+ const f = {
2118
+ startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt > ja ? this.resolvedAt : this.createdAt : this.createdAt : void 0,
2119
+ finalKeyframe: n,
2120
+ ...s,
2121
+ keyframes: e
2122
+ }, d = !c && Ia(f) ? new La({
2123
+ ...f,
2124
+ element: f.motionValue.owner.current
2125
+ }) : new hn(f);
2126
+ d.finished.then(() => this.notifyFinished()).catch(K), this.pendingTimeline && (this.stopTimeline = d.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = d;
2127
+ }
2128
+ get finished() {
2129
+ return this._animation ? this.animation.finished : this._finished;
2130
+ }
2131
+ then(e, n) {
2132
+ return this.finished.finally(e).then(() => {
2133
+ });
2134
+ }
2135
+ get animation() {
2136
+ return this._animation || (this.keyframeResolver?.resume(), Pa()), this._animation;
2137
+ }
2138
+ get duration() {
2139
+ return this.animation.duration;
2140
+ }
2141
+ get time() {
2142
+ return this.animation.time;
2143
+ }
2144
+ set time(e) {
2145
+ this.animation.time = e;
2146
+ }
2147
+ get speed() {
2148
+ return this.animation.speed;
2149
+ }
2150
+ get state() {
2151
+ return this.animation.state;
2152
+ }
2153
+ set speed(e) {
2154
+ this.animation.speed = e;
2155
+ }
2156
+ get startTime() {
2157
+ return this.animation.startTime;
2158
+ }
2159
+ attachTimeline(e) {
2160
+ return this._animation ? this.stopTimeline = this.animation.attachTimeline(e) : this.pendingTimeline = e, () => this.stop();
2161
+ }
2162
+ play() {
2163
+ this.animation.play();
2164
+ }
2165
+ pause() {
2166
+ this.animation.pause();
2167
+ }
2168
+ complete() {
2169
+ this.animation.complete();
2170
+ }
2171
+ cancel() {
2172
+ this._animation && this.animation.cancel(), this.keyframeResolver?.cancel();
2173
+ }
2174
+ }
2175
+ const mn = (t, e, n, s = {}, i, o) => (r) => {
2176
+ const a = en(s, t) || {}, l = a.delay || s.delay || 0;
2177
+ let { elapsed: c = 0 } = s;
2178
+ c = c - /* @__PURE__ */ $(l);
2179
+ const u = {
2180
+ keyframes: Array.isArray(n) ? n : [null, n],
2181
+ ease: "easeOut",
2182
+ velocity: e.getVelocity(),
2183
+ ...a,
2184
+ delay: -c,
2185
+ onUpdate: (f) => {
2186
+ e.set(f), a.onUpdate && a.onUpdate(f);
2187
+ },
2188
+ onComplete: () => {
2189
+ r(), a.onComplete && a.onComplete();
2190
+ },
2191
+ name: t,
2192
+ motionValue: e,
2193
+ element: o ? void 0 : i
2194
+ };
2195
+ Po(a) || Object.assign(u, xo(t, u)), u.duration && (u.duration = /* @__PURE__ */ $(u.duration)), u.repeatDelay && (u.repeatDelay = /* @__PURE__ */ $(u.repeatDelay)), u.from !== void 0 && (u.keyframes[0] = u.from);
2196
+ let h = !1;
2197
+ if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (u.duration = 0, u.delay === 0 && (h = !0)), (z.instantAnimations || z.skipAnimations) && (h = !0, u.duration = 0, u.delay = 0), u.allowFlatten = !a.type && !a.ease, h && !o && e.get() !== void 0) {
2198
+ const f = po(u.keyframes, a);
2199
+ if (f !== void 0) {
2200
+ M.update(() => {
2201
+ u.onUpdate(f), u.onComplete();
2202
+ });
2203
+ return;
2204
+ }
2205
+ }
2206
+ return a.isSync ? new hn(u) : new Na(u);
2207
+ }, Ai = /* @__PURE__ */ new Set([
2208
+ "width",
2209
+ "height",
2210
+ "top",
2211
+ "left",
2212
+ "right",
2213
+ "bottom",
2214
+ ...yt
2215
+ ]);
2216
+ function Ua({ protectedKeys: t, needsAnimating: e }, n) {
2217
+ const s = t.hasOwnProperty(n) && e[n] !== !0;
2218
+ return e[n] = !1, s;
2219
+ }
2220
+ function Vi(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
2221
+ let { transition: o = t.getDefaultTransition(), transitionEnd: r, ...a } = e;
2222
+ s && (o = s);
2223
+ const l = [], c = i && t.animationState && t.animationState.getState()[i];
2224
+ for (const u in a) {
2225
+ const h = t.getValue(u, t.latestValues[u] ?? null), f = a[u];
2226
+ if (f === void 0 || c && Ua(c, u))
2227
+ continue;
2228
+ const d = {
2229
+ delay: n,
2230
+ ...en(o || {}, u)
2231
+ }, m = h.get();
2232
+ if (m !== void 0 && !h.isAnimating && !Array.isArray(f) && f === m && !d.velocity)
2233
+ continue;
2234
+ let y = !1;
2235
+ if (window.MotionHandoffAnimation) {
2236
+ const g = Js(t);
2237
+ if (g) {
2238
+ const P = window.MotionHandoffAnimation(g, u, M);
2239
+ P !== null && (d.startTime = P, y = !0);
2240
+ }
2241
+ }
2242
+ ve(t, u), h.start(mn(u, h, f, t.shouldReduceMotion && Ai.has(u) ? { type: !1 } : d, t, y));
2243
+ const v = h.animation;
2244
+ v && l.push(v);
2245
+ }
2246
+ return r && Promise.all(l).then(() => {
2247
+ M.update(() => {
2248
+ r && ho(t, r);
2249
+ });
2250
+ }), l;
2251
+ }
2252
+ function Ee(t, e, n = {}) {
2253
+ const s = Ct(t, e, n.type === "exit" ? t.presenceContext?.custom : void 0);
2254
+ let { transition: i = t.getDefaultTransition() || {} } = s || {};
2255
+ n.transitionOverride && (i = n.transitionOverride);
2256
+ const o = s ? () => Promise.all(Vi(t, s, n)) : () => Promise.resolve(), r = t.variantChildren && t.variantChildren.size ? (l = 0) => {
2257
+ const { delayChildren: c = 0, staggerChildren: u, staggerDirection: h } = i;
2258
+ return Ka(t, e, c + l, u, h, n);
2259
+ } : () => Promise.resolve(), { when: a } = i;
2260
+ if (a) {
2261
+ const [l, c] = a === "beforeChildren" ? [o, r] : [r, o];
2262
+ return l().then(() => c());
2263
+ } else
2264
+ return Promise.all([o(), r(n.delay)]);
2265
+ }
2266
+ function Ka(t, e, n = 0, s = 0, i = 1, o) {
2267
+ const r = [], a = (t.variantChildren.size - 1) * s, l = i === 1 ? (c = 0) => c * s : (c = 0) => a - c * s;
2268
+ return Array.from(t.variantChildren).sort(Wa).forEach((c, u) => {
2269
+ c.notify("AnimationStart", e), r.push(Ee(c, e, {
2270
+ ...o,
2271
+ delay: n + l(u)
2272
+ }).then(() => c.notify("AnimationComplete", e)));
2273
+ }), Promise.all(r);
2274
+ }
2275
+ function Wa(t, e) {
2276
+ return t.sortNodePosition(e);
2277
+ }
2278
+ function $a(t, e, n = {}) {
2279
+ t.notify("AnimationStart", e);
2280
+ let s;
2281
+ if (Array.isArray(e)) {
2282
+ const i = e.map((o) => Ee(t, o, n));
2283
+ s = Promise.all(i);
2284
+ } else if (typeof e == "string")
2285
+ s = Ee(t, e, n);
2286
+ else {
2287
+ const i = typeof e == "function" ? Ct(t, e, n.custom) : e;
2288
+ s = Promise.all(Vi(t, i, n));
2289
+ }
2290
+ return s.then(() => {
2291
+ t.notify("AnimationComplete", e);
2292
+ });
2293
+ }
2294
+ function Mi(t, e) {
2295
+ if (!Array.isArray(e))
2296
+ return !1;
2297
+ const n = e.length;
2298
+ if (n !== t.length)
2299
+ return !1;
2300
+ for (let s = 0; s < n; s++)
2301
+ if (e[s] !== t[s])
2302
+ return !1;
2303
+ return !0;
2304
+ }
2305
+ const _a = Ke.length;
2306
+ function Di(t) {
2307
+ if (!t)
2308
+ return;
2309
+ if (!t.isControllingVariants) {
2310
+ const n = t.parent ? Di(t.parent) || {} : {};
2311
+ return t.props.initial !== void 0 && (n.initial = t.props.initial), n;
2312
+ }
2313
+ const e = {};
2314
+ for (let n = 0; n < _a; n++) {
2315
+ const s = Ke[n], i = t.props[s];
2316
+ (Vt(i) || i === !1) && (e[s] = i);
2317
+ }
2318
+ return e;
2319
+ }
2320
+ const Ga = [...Ue].reverse(), Ha = Ue.length;
2321
+ function za(t) {
2322
+ return (e) => Promise.all(e.map(({ animation: n, options: s }) => $a(t, n, s)));
2323
+ }
2324
+ function Ya(t) {
2325
+ let e = za(t), n = Nn(), s = !0;
2326
+ const i = (l) => (c, u) => {
2327
+ const h = Ct(t, u, l === "exit" ? t.presenceContext?.custom : void 0);
2328
+ if (h) {
2329
+ const { transition: f, transitionEnd: d, ...m } = h;
2330
+ c = { ...c, ...m, ...d };
2331
+ }
2332
+ return c;
2333
+ };
2334
+ function o(l) {
2335
+ e = l(t);
2336
+ }
2337
+ function r(l) {
2338
+ const { props: c } = t, u = Di(t.parent) || {}, h = [], f = /* @__PURE__ */ new Set();
2339
+ let d = {}, m = 1 / 0;
2340
+ for (let v = 0; v < Ha; v++) {
2341
+ const g = Ga[v], P = n[g], p = c[g] !== void 0 ? c[g] : u[g], b = Vt(p), x = g === l ? P.isActive : null;
2342
+ x === !1 && (m = v);
2343
+ let w = p === u[g] && p !== c[g] && b;
2344
+ if (w && s && t.manuallyAnimateOnMount && (w = !1), P.protectedKeys = { ...d }, // If it isn't active and hasn't *just* been set as inactive
2345
+ !P.isActive && x === null || // If we didn't and don't have any defined prop for this animation type
2346
+ !p && !P.prevProp || // Or if the prop doesn't define an animation
2347
+ Qt(p) || typeof p == "boolean")
2348
+ continue;
2349
+ const C = Xa(P.prevProp, p);
2350
+ let S = C || // If we're making this variant active, we want to always make it active
2351
+ g === l && P.isActive && !w && b || // If we removed a higher-priority variant (i is in reverse order)
2352
+ v > m && b, F = !1;
2353
+ const j = Array.isArray(p) ? p : [p];
2354
+ let ot = j.reduce(i(g), {});
2355
+ x === !1 && (ot = {});
2356
+ const { prevResolvedValues: gn = {} } = P, lr = {
2357
+ ...gn,
2358
+ ...ot
2359
+ }, yn = (k) => {
2360
+ S = !0, f.has(k) && (F = !0, f.delete(k)), P.needsAnimating[k] = !0;
2361
+ const H = t.getValue(k);
2362
+ H && (H.liveStyle = !1);
2363
+ };
2364
+ for (const k in lr) {
2365
+ const H = ot[k], ee = gn[k];
2366
+ if (d.hasOwnProperty(k))
2367
+ continue;
2368
+ let ne = !1;
2369
+ ye(H) && ye(ee) ? ne = !Mi(H, ee) : ne = H !== ee, ne ? H != null ? yn(k) : f.add(k) : H !== void 0 && f.has(k) ? yn(k) : P.protectedKeys[k] = !0;
2370
+ }
2371
+ P.prevProp = p, P.prevResolvedValues = ot, P.isActive && (d = { ...d, ...ot }), s && t.blockInitialAnimation && (S = !1), S && (!(w && C) || F) && h.push(...j.map((k) => ({
2372
+ animation: k,
2373
+ options: { type: g }
2374
+ })));
2375
+ }
2376
+ if (f.size) {
2377
+ const v = {};
2378
+ if (typeof c.initial != "boolean") {
2379
+ const g = Ct(t, Array.isArray(c.initial) ? c.initial[0] : c.initial);
2380
+ g && g.transition && (v.transition = g.transition);
2381
+ }
2382
+ f.forEach((g) => {
2383
+ const P = t.getBaseTarget(g), p = t.getValue(g);
2384
+ p && (p.liveStyle = !0), v[g] = P ?? null;
2385
+ }), h.push({ animation: v });
2386
+ }
2387
+ let y = !!h.length;
2388
+ return s && (c.initial === !1 || c.initial === c.animate) && !t.manuallyAnimateOnMount && (y = !1), s = !1, y ? e(h) : Promise.resolve();
2389
+ }
2390
+ function a(l, c) {
2391
+ if (n[l].isActive === c)
2392
+ return Promise.resolve();
2393
+ t.variantChildren?.forEach((h) => h.animationState?.setActive(l, c)), n[l].isActive = c;
2394
+ const u = r(l);
2395
+ for (const h in n)
2396
+ n[h].protectedKeys = {};
2397
+ return u;
2398
+ }
2399
+ return {
2400
+ animateChanges: r,
2401
+ setActive: a,
2402
+ setAnimateFunction: o,
2403
+ getState: () => n,
2404
+ reset: () => {
2405
+ n = Nn(), s = !0;
2406
+ }
2407
+ };
2408
+ }
2409
+ function Xa(t, e) {
2410
+ return typeof e == "string" ? e !== t : Array.isArray(e) ? !Mi(e, t) : !1;
2411
+ }
2412
+ function tt(t = !1) {
2413
+ return {
2414
+ isActive: t,
2415
+ protectedKeys: {},
2416
+ needsAnimating: {},
2417
+ prevResolvedValues: {}
2418
+ };
2419
+ }
2420
+ function Nn() {
2421
+ return {
2422
+ animate: tt(!0),
2423
+ whileInView: tt(),
2424
+ whileHover: tt(),
2425
+ whileTap: tt(),
2426
+ whileDrag: tt(),
2427
+ whileFocus: tt(),
2428
+ exit: tt()
2429
+ };
2430
+ }
2431
+ class Q {
2432
+ constructor(e) {
2433
+ this.isMounted = !1, this.node = e;
2434
+ }
2435
+ update() {
2436
+ }
2437
+ }
2438
+ class qa extends Q {
2439
+ /**
2440
+ * We dynamically generate the AnimationState manager as it contains a reference
2441
+ * to the underlying animation library. We only want to load that if we load this,
2442
+ * so people can optionally code split it out using the `m` component.
2443
+ */
2444
+ constructor(e) {
2445
+ super(e), e.animationState || (e.animationState = Ya(e));
2446
+ }
2447
+ updateAnimationControlsSubscription() {
2448
+ const { animate: e } = this.node.getProps();
2449
+ Qt(e) && (this.unmountControls = e.subscribe(this.node));
2450
+ }
2451
+ /**
2452
+ * Subscribe any provided AnimationControls to the component's VisualElement
2453
+ */
2454
+ mount() {
2455
+ this.updateAnimationControlsSubscription();
2456
+ }
2457
+ update() {
2458
+ const { animate: e } = this.node.getProps(), { animate: n } = this.node.prevProps || {};
2459
+ e !== n && this.updateAnimationControlsSubscription();
2460
+ }
2461
+ unmount() {
2462
+ this.node.animationState.reset(), this.unmountControls?.();
2463
+ }
2464
+ }
2465
+ let Za = 0;
2466
+ class Ja extends Q {
2467
+ constructor() {
2468
+ super(...arguments), this.id = Za++;
2469
+ }
2470
+ update() {
2471
+ if (!this.node.presenceContext)
2472
+ return;
2473
+ const { isPresent: e, onExitComplete: n } = this.node.presenceContext, { isPresent: s } = this.node.prevPresenceContext || {};
2474
+ if (!this.node.animationState || e === s)
2475
+ return;
2476
+ const i = this.node.animationState.setActive("exit", !e);
2477
+ n && !e && i.then(() => {
2478
+ n(this.id);
2479
+ });
2480
+ }
2481
+ mount() {
2482
+ const { register: e, onExitComplete: n } = this.node.presenceContext || {};
2483
+ n && n(this.id), e && (this.unmount = e(this.id));
2484
+ }
2485
+ unmount() {
2486
+ }
2487
+ }
2488
+ const Qa = {
2489
+ animation: {
2490
+ Feature: qa
2491
+ },
2492
+ exit: {
2493
+ Feature: Ja
2494
+ }
2495
+ };
2496
+ function Lt(t, e, n, s = { passive: !0 }) {
2497
+ return t.addEventListener(e, n, s), () => t.removeEventListener(e, n);
2498
+ }
2499
+ const pn = (t) => t.pointerType === "mouse" ? typeof t.button != "number" || t.button <= 0 : t.isPrimary !== !1;
2500
+ function Ot(t) {
2501
+ return {
2502
+ point: {
2503
+ x: t.pageX,
2504
+ y: t.pageY
2505
+ }
2506
+ };
2507
+ }
2508
+ const tl = (t) => (e) => pn(e) && t(e, Ot(e));
2509
+ function bt(t, e, n, s) {
2510
+ return Lt(t, e, tl(n), s);
2511
+ }
2512
+ function Ci({ top: t, left: e, right: n, bottom: s }) {
2513
+ return {
2514
+ x: { min: e, max: n },
2515
+ y: { min: t, max: s }
2516
+ };
2517
+ }
2518
+ function el({ x: t, y: e }) {
2519
+ return { top: e.min, right: t.max, bottom: e.max, left: t.min };
2520
+ }
2521
+ function nl(t, e) {
2522
+ if (!e)
2523
+ return t;
2524
+ const n = e({ x: t.left, y: t.top }), s = e({ x: t.right, y: t.bottom });
2525
+ return {
2526
+ top: n.y,
2527
+ left: n.x,
2528
+ bottom: s.y,
2529
+ right: s.x
2530
+ };
2531
+ }
2532
+ const Ei = 1e-4, sl = 1 - Ei, il = 1 + Ei, Ri = 0.01, rl = 0 - Ri, ol = 0 + Ri;
2533
+ function B(t) {
2534
+ return t.max - t.min;
2535
+ }
2536
+ function al(t, e, n) {
2537
+ return Math.abs(t - e) <= n;
2538
+ }
2539
+ function Un(t, e, n, s = 0.5) {
2540
+ t.origin = s, t.originPoint = V(e.min, e.max, t.origin), t.scale = B(n) / B(e), t.translate = V(n.min, n.max, t.origin) - t.originPoint, (t.scale >= sl && t.scale <= il || isNaN(t.scale)) && (t.scale = 1), (t.translate >= rl && t.translate <= ol || isNaN(t.translate)) && (t.translate = 0);
2541
+ }
2542
+ function wt(t, e, n, s) {
2543
+ Un(t.x, e.x, n.x, s ? s.originX : void 0), Un(t.y, e.y, n.y, s ? s.originY : void 0);
2544
+ }
2545
+ function Kn(t, e, n) {
2546
+ t.min = n.min + e.min, t.max = t.min + B(e);
2547
+ }
2548
+ function ll(t, e, n) {
2549
+ Kn(t.x, e.x, n.x), Kn(t.y, e.y, n.y);
2550
+ }
2551
+ function Wn(t, e, n) {
2552
+ t.min = e.min - n.min, t.max = t.min + B(e);
2553
+ }
2554
+ function At(t, e, n) {
2555
+ Wn(t.x, e.x, n.x), Wn(t.y, e.y, n.y);
2556
+ }
2557
+ const $n = () => ({
2558
+ translate: 0,
2559
+ scale: 1,
2560
+ origin: 0,
2561
+ originPoint: 0
2562
+ }), ct = () => ({
2563
+ x: $n(),
2564
+ y: $n()
2565
+ }), _n = () => ({ min: 0, max: 0 }), D = () => ({
2566
+ x: _n(),
2567
+ y: _n()
2568
+ });
2569
+ function U(t) {
2570
+ return [t("x"), t("y")];
2571
+ }
2572
+ function le(t) {
2573
+ return t === void 0 || t === 1;
2574
+ }
2575
+ function Re({ scale: t, scaleX: e, scaleY: n }) {
2576
+ return !le(t) || !le(e) || !le(n);
2577
+ }
2578
+ function et(t) {
2579
+ return Re(t) || Li(t) || t.z || t.rotate || t.rotateX || t.rotateY || t.skewX || t.skewY;
2580
+ }
2581
+ function Li(t) {
2582
+ return Gn(t.x) || Gn(t.y);
2583
+ }
2584
+ function Gn(t) {
2585
+ return t && t !== "0%";
2586
+ }
2587
+ function Xt(t, e, n) {
2588
+ const s = t - n, i = e * s;
2589
+ return n + i;
2590
+ }
2591
+ function Hn(t, e, n, s, i) {
2592
+ return i !== void 0 && (t = Xt(t, i, s)), Xt(t, n, s) + e;
2593
+ }
2594
+ function Le(t, e = 0, n = 1, s, i) {
2595
+ t.min = Hn(t.min, e, n, s, i), t.max = Hn(t.max, e, n, s, i);
2596
+ }
2597
+ function ki(t, { x: e, y: n }) {
2598
+ Le(t.x, e.translate, e.scale, e.originPoint), Le(t.y, n.translate, n.scale, n.originPoint);
2599
+ }
2600
+ const zn = 0.999999999999, Yn = 1.0000000000001;
2601
+ function ul(t, e, n, s = !1) {
2602
+ const i = n.length;
2603
+ if (!i)
2604
+ return;
2605
+ e.x = e.y = 1;
2606
+ let o, r;
2607
+ for (let a = 0; a < i; a++) {
2608
+ o = n[a], r = o.projectionDelta;
2609
+ const { visualElement: l } = o.options;
2610
+ l && l.props.style && l.props.style.display === "contents" || (s && o.options.layoutScroll && o.scroll && o !== o.root && ft(t, {
2611
+ x: -o.scroll.offset.x,
2612
+ y: -o.scroll.offset.y
2613
+ }), r && (e.x *= r.x.scale, e.y *= r.y.scale, ki(t, r)), s && et(o.latestValues) && ft(t, o.latestValues));
2614
+ }
2615
+ e.x < Yn && e.x > zn && (e.x = 1), e.y < Yn && e.y > zn && (e.y = 1);
2616
+ }
2617
+ function ht(t, e) {
2618
+ t.min = t.min + e, t.max = t.max + e;
2619
+ }
2620
+ function Xn(t, e, n, s, i = 0.5) {
2621
+ const o = V(t.min, t.max, i);
2622
+ Le(t, e, n, o, s);
2623
+ }
2624
+ function ft(t, e) {
2625
+ Xn(t.x, e.x, e.scaleX, e.scale, e.originX), Xn(t.y, e.y, e.scaleY, e.scale, e.originY);
2626
+ }
2627
+ function Bi(t, e) {
2628
+ return Ci(nl(t.getBoundingClientRect(), e));
2629
+ }
2630
+ function cl(t, e, n) {
2631
+ const s = Bi(t, n), { scroll: i } = e;
2632
+ return i && (ht(s.x, i.offset.x), ht(s.y, i.offset.y)), s;
2633
+ }
2634
+ const Fi = ({ current: t }) => t ? t.ownerDocument.defaultView : null, qn = (t, e) => Math.abs(t - e);
2635
+ function hl(t, e) {
2636
+ const n = qn(t.x, e.x), s = qn(t.y, e.y);
2637
+ return Math.sqrt(n ** 2 + s ** 2);
2638
+ }
2639
+ class Oi {
2640
+ constructor(e, n, { transformPagePoint: s, contextWindow: i, dragSnapToOrigin: o = !1 } = {}) {
2641
+ if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.handlers = {}, this.contextWindow = window, this.updatePoint = () => {
2642
+ if (!(this.lastMoveEvent && this.lastMoveEventInfo))
2643
+ return;
2644
+ const h = ce(this.lastMoveEventInfo, this.history), f = this.startEvent !== null, d = hl(h.offset, { x: 0, y: 0 }) >= 3;
2645
+ if (!f && !d)
2646
+ return;
2647
+ const { point: m } = h, { timestamp: y } = E;
2648
+ this.history.push({ ...m, timestamp: y });
2649
+ const { onStart: v, onMove: g } = this.handlers;
2650
+ f || (v && v(this.lastMoveEvent, h), this.startEvent = this.lastMoveEvent), g && g(this.lastMoveEvent, h);
2651
+ }, this.handlePointerMove = (h, f) => {
2652
+ this.lastMoveEvent = h, this.lastMoveEventInfo = ue(f, this.transformPagePoint), M.update(this.updatePoint, !0);
2653
+ }, this.handlePointerUp = (h, f) => {
2654
+ this.end();
2655
+ const { onEnd: d, onSessionEnd: m, resumeAnimation: y } = this.handlers;
2656
+ if (this.dragSnapToOrigin && y && y(), !(this.lastMoveEvent && this.lastMoveEventInfo))
2657
+ return;
2658
+ const v = ce(h.type === "pointercancel" ? this.lastMoveEventInfo : ue(f, this.transformPagePoint), this.history);
2659
+ this.startEvent && d && d(h, v), m && m(h, v);
2660
+ }, !pn(e))
2661
+ return;
2662
+ this.dragSnapToOrigin = o, this.handlers = n, this.transformPagePoint = s, this.contextWindow = i || window;
2663
+ const r = Ot(e), a = ue(r, this.transformPagePoint), { point: l } = a, { timestamp: c } = E;
2664
+ this.history = [{ ...l, timestamp: c }];
2665
+ const { onSessionStart: u } = n;
2666
+ u && u(e, ce(a, this.history)), this.removeListeners = Bt(bt(this.contextWindow, "pointermove", this.handlePointerMove), bt(this.contextWindow, "pointerup", this.handlePointerUp), bt(this.contextWindow, "pointercancel", this.handlePointerUp));
2667
+ }
2668
+ updateHandlers(e) {
2669
+ this.handlers = e;
2670
+ }
2671
+ end() {
2672
+ this.removeListeners && this.removeListeners(), Z(this.updatePoint);
2673
+ }
2674
+ }
2675
+ function ue(t, e) {
2676
+ return e ? { point: e(t.point) } : t;
2677
+ }
2678
+ function Zn(t, e) {
2679
+ return { x: t.x - e.x, y: t.y - e.y };
2680
+ }
2681
+ function ce({ point: t }, e) {
2682
+ return {
2683
+ point: t,
2684
+ delta: Zn(t, Ii(e)),
2685
+ offset: Zn(t, fl(e)),
2686
+ velocity: dl(e, 0.1)
2687
+ };
2688
+ }
2689
+ function fl(t) {
2690
+ return t[0];
2691
+ }
2692
+ function Ii(t) {
2693
+ return t[t.length - 1];
2694
+ }
2695
+ function dl(t, e) {
2696
+ if (t.length < 2)
2697
+ return { x: 0, y: 0 };
2698
+ let n = t.length - 1, s = null;
2699
+ const i = Ii(t);
2700
+ for (; n >= 0 && (s = t[n], !(i.timestamp - s.timestamp > /* @__PURE__ */ $(e))); )
2701
+ n--;
2702
+ if (!s)
2703
+ return { x: 0, y: 0 };
2704
+ const o = /* @__PURE__ */ G(i.timestamp - s.timestamp);
2705
+ if (o === 0)
2706
+ return { x: 0, y: 0 };
2707
+ const r = {
2708
+ x: (i.x - s.x) / o,
2709
+ y: (i.y - s.y) / o
2710
+ };
2711
+ return r.x === 1 / 0 && (r.x = 0), r.y === 1 / 0 && (r.y = 0), r;
2712
+ }
2713
+ function ml(t, { min: e, max: n }, s) {
2714
+ return e !== void 0 && t < e ? t = s ? V(e, t, s.min) : Math.max(t, e) : n !== void 0 && t > n && (t = s ? V(n, t, s.max) : Math.min(t, n)), t;
2715
+ }
2716
+ function Jn(t, e, n) {
2717
+ return {
2718
+ min: e !== void 0 ? t.min + e : void 0,
2719
+ max: n !== void 0 ? t.max + n - (t.max - t.min) : void 0
2720
+ };
2721
+ }
2722
+ function pl(t, { top: e, left: n, bottom: s, right: i }) {
2723
+ return {
2724
+ x: Jn(t.x, n, i),
2725
+ y: Jn(t.y, e, s)
2726
+ };
2727
+ }
2728
+ function Qn(t, e) {
2729
+ let n = e.min - t.min, s = e.max - t.max;
2730
+ return e.max - e.min < t.max - t.min && ([n, s] = [s, n]), { min: n, max: s };
2731
+ }
2732
+ function gl(t, e) {
2733
+ return {
2734
+ x: Qn(t.x, e.x),
2735
+ y: Qn(t.y, e.y)
2736
+ };
2737
+ }
2738
+ function yl(t, e) {
2739
+ let n = 0.5;
2740
+ const s = B(t), i = B(e);
2741
+ return i > s ? n = /* @__PURE__ */ Rt(e.min, e.max - s, t.min) : s > i && (n = /* @__PURE__ */ Rt(t.min, t.max - i, e.min)), X(0, 1, n);
2742
+ }
2743
+ function vl(t, e) {
2744
+ const n = {};
2745
+ return e.min !== void 0 && (n.min = e.min - t.min), e.max !== void 0 && (n.max = e.max - t.min), n;
2746
+ }
2747
+ const ke = 0.35;
2748
+ function Tl(t = ke) {
2749
+ return t === !1 ? t = 0 : t === !0 && (t = ke), {
2750
+ x: ts(t, "left", "right"),
2751
+ y: ts(t, "top", "bottom")
2752
+ };
2753
+ }
2754
+ function ts(t, e, n) {
2755
+ return {
2756
+ min: es(t, e),
2757
+ max: es(t, n)
2758
+ };
2759
+ }
2760
+ function es(t, e) {
2761
+ return typeof t == "number" ? t : t[e] || 0;
2762
+ }
2763
+ const W = {
2764
+ x: !1,
2765
+ y: !1
2766
+ };
2767
+ function ji() {
2768
+ return W.x || W.y;
2769
+ }
2770
+ function xl(t) {
2771
+ return t === "x" || t === "y" ? W[t] ? null : (W[t] = !0, () => {
2772
+ W[t] = !1;
2773
+ }) : W.x || W.y ? null : (W.x = W.y = !0, () => {
2774
+ W.x = W.y = !1;
2775
+ });
2776
+ }
2777
+ const Pl = /* @__PURE__ */ new WeakMap();
2778
+ class Sl {
2779
+ constructor(e) {
2780
+ this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = D(), this.visualElement = e;
2781
+ }
2782
+ start(e, { snapToCursor: n = !1 } = {}) {
2783
+ const { presenceContext: s } = this.visualElement;
2784
+ if (s && s.isPresent === !1)
2785
+ return;
2786
+ const i = (u) => {
2787
+ const { dragSnapToOrigin: h } = this.getProps();
2788
+ h ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor(Ot(u).point);
2789
+ }, o = (u, h) => {
2790
+ const { drag: f, dragPropagation: d, onDragStart: m } = this.getProps();
2791
+ if (f && !d && (this.openDragLock && this.openDragLock(), this.openDragLock = xl(f), !this.openDragLock))
2792
+ return;
2793
+ this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), U((v) => {
2794
+ let g = this.getAxisMotionValue(v).get() || 0;
2795
+ if (_.test(g)) {
2796
+ const { projection: P } = this.visualElement;
2797
+ if (P && P.layout) {
2798
+ const p = P.layout.layoutBox[v];
2799
+ p && (g = B(p) * (parseFloat(g) / 100));
2800
+ }
2801
+ }
2802
+ this.originPoint[v] = g;
2803
+ }), m && M.postRender(() => m(u, h)), ve(this.visualElement, "transform");
2804
+ const { animationState: y } = this.visualElement;
2805
+ y && y.setActive("whileDrag", !0);
2806
+ }, r = (u, h) => {
2807
+ const { dragPropagation: f, dragDirectionLock: d, onDirectionLock: m, onDrag: y } = this.getProps();
2808
+ if (!f && !this.openDragLock)
2809
+ return;
2810
+ const { offset: v } = h;
2811
+ if (d && this.currentDirection === null) {
2812
+ this.currentDirection = bl(v), this.currentDirection !== null && m && m(this.currentDirection);
2813
+ return;
2814
+ }
2815
+ this.updateAxis("x", h.point, v), this.updateAxis("y", h.point, v), this.visualElement.render(), y && y(u, h);
2816
+ }, a = (u, h) => this.stop(u, h), l = () => U((u) => this.getAnimationState(u) === "paused" && this.getAxisMotionValue(u).animation?.play()), { dragSnapToOrigin: c } = this.getProps();
2817
+ this.panSession = new Oi(e, {
2818
+ onSessionStart: i,
2819
+ onStart: o,
2820
+ onMove: r,
2821
+ onSessionEnd: a,
2822
+ resumeAnimation: l
2823
+ }, {
2824
+ transformPagePoint: this.visualElement.getTransformPagePoint(),
2825
+ dragSnapToOrigin: c,
2826
+ contextWindow: Fi(this.visualElement)
2827
+ });
2828
+ }
2829
+ stop(e, n) {
2830
+ const s = this.isDragging;
2831
+ if (this.cancel(), !s)
2832
+ return;
2833
+ const { velocity: i } = n;
2834
+ this.startAnimation(i);
2835
+ const { onDragEnd: o } = this.getProps();
2836
+ o && M.postRender(() => o(e, n));
2837
+ }
2838
+ cancel() {
2839
+ this.isDragging = !1;
2840
+ const { projection: e, animationState: n } = this.visualElement;
2841
+ e && (e.isAnimationBlocked = !1), this.panSession && this.panSession.end(), this.panSession = void 0;
2842
+ const { dragPropagation: s } = this.getProps();
2843
+ !s && this.openDragLock && (this.openDragLock(), this.openDragLock = null), n && n.setActive("whileDrag", !1);
2844
+ }
2845
+ updateAxis(e, n, s) {
2846
+ const { drag: i } = this.getProps();
2847
+ if (!s || !Nt(e, i, this.currentDirection))
2848
+ return;
2849
+ const o = this.getAxisMotionValue(e);
2850
+ let r = this.originPoint[e] + s[e];
2851
+ this.constraints && this.constraints[e] && (r = ml(r, this.constraints[e], this.elastic[e])), o.set(r);
2852
+ }
2853
+ resolveConstraints() {
2854
+ const { dragConstraints: e, dragElastic: n } = this.getProps(), s = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : this.visualElement.projection?.layout, i = this.constraints;
2855
+ e && at(e) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : e && s ? this.constraints = pl(s.layoutBox, e) : this.constraints = !1, this.elastic = Tl(n), i !== this.constraints && s && this.constraints && !this.hasMutatedConstraints && U((o) => {
2856
+ this.constraints !== !1 && this.getAxisMotionValue(o) && (this.constraints[o] = vl(s.layoutBox[o], this.constraints[o]));
2857
+ });
2858
+ }
2859
+ resolveRefConstraints() {
2860
+ const { dragConstraints: e, onMeasureDragConstraints: n } = this.getProps();
2861
+ if (!e || !at(e))
2862
+ return !1;
2863
+ const s = e.current;
2864
+ Y(s !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
2865
+ const { projection: i } = this.visualElement;
2866
+ if (!i || !i.layout)
2867
+ return !1;
2868
+ const o = cl(s, i.root, this.visualElement.getTransformPagePoint());
2869
+ let r = gl(i.layout.layoutBox, o);
2870
+ if (n) {
2871
+ const a = n(el(r));
2872
+ this.hasMutatedConstraints = !!a, a && (r = Ci(a));
2873
+ }
2874
+ return r;
2875
+ }
2876
+ startAnimation(e) {
2877
+ const { drag: n, dragMomentum: s, dragElastic: i, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, c = U((u) => {
2878
+ if (!Nt(u, n, this.currentDirection))
2879
+ return;
2880
+ let h = l && l[u] || {};
2881
+ r && (h = { min: 0, max: 0 });
2882
+ const f = i ? 200 : 1e6, d = i ? 40 : 1e7, m = {
2883
+ type: "inertia",
2884
+ velocity: s ? e[u] : 0,
2885
+ bounceStiffness: f,
2886
+ bounceDamping: d,
2887
+ timeConstant: 750,
2888
+ restDelta: 1,
2889
+ restSpeed: 10,
2890
+ ...o,
2891
+ ...h
2892
+ };
2893
+ return this.startAxisValueAnimation(u, m);
2894
+ });
2895
+ return Promise.all(c).then(a);
2896
+ }
2897
+ startAxisValueAnimation(e, n) {
2898
+ const s = this.getAxisMotionValue(e);
2899
+ return ve(this.visualElement, e), s.start(mn(e, s, 0, n, this.visualElement, !1));
2900
+ }
2901
+ stopAnimation() {
2902
+ U((e) => this.getAxisMotionValue(e).stop());
2903
+ }
2904
+ pauseAnimation() {
2905
+ U((e) => this.getAxisMotionValue(e).animation?.pause());
2906
+ }
2907
+ getAnimationState(e) {
2908
+ return this.getAxisMotionValue(e).animation?.state;
2909
+ }
2910
+ /**
2911
+ * Drag works differently depending on which props are provided.
2912
+ *
2913
+ * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
2914
+ * - Otherwise, we apply the delta to the x/y motion values.
2915
+ */
2916
+ getAxisMotionValue(e) {
2917
+ const n = `_drag${e.toUpperCase()}`, s = this.visualElement.getProps(), i = s[n];
2918
+ return i || this.visualElement.getValue(e, (s.initial ? s.initial[e] : void 0) || 0);
2919
+ }
2920
+ snapToCursor(e) {
2921
+ U((n) => {
2922
+ const { drag: s } = this.getProps();
2923
+ if (!Nt(n, s, this.currentDirection))
2924
+ return;
2925
+ const { projection: i } = this.visualElement, o = this.getAxisMotionValue(n);
2926
+ if (i && i.layout) {
2927
+ const { min: r, max: a } = i.layout.layoutBox[n];
2928
+ o.set(e[n] - V(r, a, 0.5));
2929
+ }
2930
+ });
2931
+ }
2932
+ /**
2933
+ * When the viewport resizes we want to check if the measured constraints
2934
+ * have changed and, if so, reposition the element within those new constraints
2935
+ * relative to where it was before the resize.
2936
+ */
2937
+ scalePositionWithinConstraints() {
2938
+ if (!this.visualElement.current)
2939
+ return;
2940
+ const { drag: e, dragConstraints: n } = this.getProps(), { projection: s } = this.visualElement;
2941
+ if (!at(n) || !s || !this.constraints)
2942
+ return;
2943
+ this.stopAnimation();
2944
+ const i = { x: 0, y: 0 };
2945
+ U((r) => {
2946
+ const a = this.getAxisMotionValue(r);
2947
+ if (a && this.constraints !== !1) {
2948
+ const l = a.get();
2949
+ i[r] = yl({ min: l, max: l }, this.constraints[r]);
2950
+ }
2951
+ });
2952
+ const { transformTemplate: o } = this.visualElement.getProps();
2953
+ this.visualElement.current.style.transform = o ? o({}, "") : "none", s.root && s.root.updateScroll(), s.updateLayout(), this.resolveConstraints(), U((r) => {
2954
+ if (!Nt(r, e, null))
2955
+ return;
2956
+ const a = this.getAxisMotionValue(r), { min: l, max: c } = this.constraints[r];
2957
+ a.set(V(l, c, i[r]));
2958
+ });
2959
+ }
2960
+ addListeners() {
2961
+ if (!this.visualElement.current)
2962
+ return;
2963
+ Pl.set(this.visualElement, this);
2964
+ const e = this.visualElement.current, n = bt(e, "pointerdown", (l) => {
2965
+ const { drag: c, dragListener: u = !0 } = this.getProps();
2966
+ c && u && this.start(l);
2967
+ }), s = () => {
2968
+ const { dragConstraints: l } = this.getProps();
2969
+ at(l) && l.current && (this.constraints = this.resolveRefConstraints());
2970
+ }, { projection: i } = this.visualElement, o = i.addEventListener("measure", s);
2971
+ i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), M.read(s);
2972
+ const r = Lt(window, "resize", () => this.scalePositionWithinConstraints()), a = i.addEventListener("didUpdate", ({ delta: l, hasLayoutChanged: c }) => {
2973
+ this.isDragging && c && (U((u) => {
2974
+ const h = this.getAxisMotionValue(u);
2975
+ h && (this.originPoint[u] += l[u].translate, h.set(h.get() + l[u].translate));
2976
+ }), this.visualElement.render());
2977
+ });
2978
+ return () => {
2979
+ r(), n(), o(), a && a();
2980
+ };
2981
+ }
2982
+ getProps() {
2983
+ const e = this.visualElement.getProps(), { drag: n = !1, dragDirectionLock: s = !1, dragPropagation: i = !1, dragConstraints: o = !1, dragElastic: r = ke, dragMomentum: a = !0 } = e;
2984
+ return {
2985
+ ...e,
2986
+ drag: n,
2987
+ dragDirectionLock: s,
2988
+ dragPropagation: i,
2989
+ dragConstraints: o,
2990
+ dragElastic: r,
2991
+ dragMomentum: a
2992
+ };
2993
+ }
2994
+ }
2995
+ function Nt(t, e, n) {
2996
+ return (e === !0 || e === t) && (n === null || n === t);
2997
+ }
2998
+ function bl(t, e = 10) {
2999
+ let n = null;
3000
+ return Math.abs(t.y) > e ? n = "y" : Math.abs(t.x) > e && (n = "x"), n;
3001
+ }
3002
+ class wl extends Q {
3003
+ constructor(e) {
3004
+ super(e), this.removeGroupControls = K, this.removeListeners = K, this.controls = new Sl(e);
3005
+ }
3006
+ mount() {
3007
+ const { dragControls: e } = this.node.getProps();
3008
+ e && (this.removeGroupControls = e.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || K;
3009
+ }
3010
+ unmount() {
3011
+ this.removeGroupControls(), this.removeListeners();
3012
+ }
3013
+ }
3014
+ const ns = (t) => (e, n) => {
3015
+ t && M.postRender(() => t(e, n));
3016
+ };
3017
+ class Al extends Q {
3018
+ constructor() {
3019
+ super(...arguments), this.removePointerDownListener = K;
3020
+ }
3021
+ onPointerDown(e) {
3022
+ this.session = new Oi(e, this.createPanHandlers(), {
3023
+ transformPagePoint: this.node.getTransformPagePoint(),
3024
+ contextWindow: Fi(this.node)
3025
+ });
3026
+ }
3027
+ createPanHandlers() {
3028
+ const { onPanSessionStart: e, onPanStart: n, onPan: s, onPanEnd: i } = this.node.getProps();
3029
+ return {
3030
+ onSessionStart: ns(e),
3031
+ onStart: ns(n),
3032
+ onMove: s,
3033
+ onEnd: (o, r) => {
3034
+ delete this.session, i && M.postRender(() => i(o, r));
3035
+ }
3036
+ };
3037
+ }
3038
+ mount() {
3039
+ this.removePointerDownListener = bt(this.node.current, "pointerdown", (e) => this.onPointerDown(e));
3040
+ }
3041
+ update() {
3042
+ this.session && this.session.updateHandlers(this.createPanHandlers());
3043
+ }
3044
+ unmount() {
3045
+ this.removePointerDownListener(), this.session && this.session.end();
3046
+ }
3047
+ }
3048
+ const $t = {
3049
+ /**
3050
+ * Global flag as to whether the tree has animated since the last time
3051
+ * we resized the window
3052
+ */
3053
+ hasAnimatedSinceResize: !0,
3054
+ /**
3055
+ * We set this to true once, on the first update. Any nodes added to the tree beyond that
3056
+ * update will be given a `data-projection-id` attribute.
3057
+ */
3058
+ hasEverUpdated: !1
3059
+ };
3060
+ function ss(t, e) {
3061
+ return e.max === e.min ? 0 : t / (e.max - e.min) * 100;
3062
+ }
3063
+ const xt = {
3064
+ correct: (t, e) => {
3065
+ if (!e.target)
3066
+ return t;
3067
+ if (typeof t == "string")
3068
+ if (T.test(t))
3069
+ t = parseFloat(t);
3070
+ else
3071
+ return t;
3072
+ const n = ss(t, e.target.x), s = ss(t, e.target.y);
3073
+ return `${n}% ${s}%`;
3074
+ }
3075
+ }, Vl = {
3076
+ correct: (t, { treeScale: e, projectionDelta: n }) => {
3077
+ const s = t, i = J.parse(t);
3078
+ if (i.length > 5)
3079
+ return s;
3080
+ const o = J.createTransformer(t), r = typeof i[0] != "number" ? 1 : 0, a = n.x.scale * e.x, l = n.y.scale * e.y;
3081
+ i[0 + r] /= a, i[1 + r] /= l;
3082
+ const c = V(a, l, 0.5);
3083
+ return typeof i[2 + r] == "number" && (i[2 + r] /= c), typeof i[3 + r] == "number" && (i[3 + r] /= c), o(i);
3084
+ }
3085
+ };
3086
+ class Ml extends mr {
3087
+ /**
3088
+ * This only mounts projection nodes for components that
3089
+ * need measuring, we might want to do it for all components
3090
+ * in order to incorporate transforms
3091
+ */
3092
+ componentDidMount() {
3093
+ const { visualElement: e, layoutGroup: n, switchLayoutGroup: s, layoutId: i } = this.props, { projection: o } = e;
3094
+ Nr(Dl), o && (n.group && n.group.add(o), s && s.register && i && s.register(o), o.root.didUpdate(), o.addEventListener("animationComplete", () => {
3095
+ this.safeToRemove();
3096
+ }), o.setOptions({
3097
+ ...o.options,
3098
+ onExitComplete: () => this.safeToRemove()
3099
+ })), $t.hasEverUpdated = !0;
3100
+ }
3101
+ getSnapshotBeforeUpdate(e) {
3102
+ const { layoutDependency: n, visualElement: s, drag: i, isPresent: o } = this.props, { projection: r } = s;
3103
+ return r && (r.isPresent = o, i || e.layoutDependency !== n || n === void 0 || e.isPresent !== o ? r.willUpdate() : this.safeToRemove(), e.isPresent !== o && (o ? r.promote() : r.relegate() || M.postRender(() => {
3104
+ const a = r.getStack();
3105
+ (!a || !a.members.length) && this.safeToRemove();
3106
+ }))), null;
3107
+ }
3108
+ componentDidUpdate() {
3109
+ const { projection: e } = this.props.visualElement;
3110
+ e && (e.root.didUpdate(), $e.postRender(() => {
3111
+ !e.currentAnimation && e.isLead() && this.safeToRemove();
3112
+ }));
3113
+ }
3114
+ componentWillUnmount() {
3115
+ const { visualElement: e, layoutGroup: n, switchLayoutGroup: s } = this.props, { projection: i } = e;
3116
+ i && (i.scheduleCheckAfterUnmount(), n && n.group && n.group.remove(i), s && s.deregister && s.deregister(i));
3117
+ }
3118
+ safeToRemove() {
3119
+ const { safeToRemove: e } = this.props;
3120
+ e && e();
3121
+ }
3122
+ render() {
3123
+ return null;
3124
+ }
3125
+ }
3126
+ function Ni(t) {
3127
+ const [e, n] = vr(), s = O(ks);
3128
+ return ge.jsx(Ml, { ...t, layoutGroup: s, switchLayoutGroup: O(Us), isPresent: e, safeToRemove: n });
3129
+ }
3130
+ const Dl = {
3131
+ borderRadius: {
3132
+ ...xt,
3133
+ applyTo: [
3134
+ "borderTopLeftRadius",
3135
+ "borderTopRightRadius",
3136
+ "borderBottomLeftRadius",
3137
+ "borderBottomRightRadius"
3138
+ ]
3139
+ },
3140
+ borderTopLeftRadius: xt,
3141
+ borderTopRightRadius: xt,
3142
+ borderBottomLeftRadius: xt,
3143
+ borderBottomRightRadius: xt,
3144
+ boxShadow: Vl
3145
+ };
3146
+ function Cl(t, e, n) {
3147
+ const s = L(t) ? t : mt(t);
3148
+ return s.start(mn("", s, e, n)), s.animation;
3149
+ }
3150
+ function El(t) {
3151
+ return t instanceof SVGElement && t.tagName !== "svg";
3152
+ }
3153
+ const Rl = (t, e) => t.depth - e.depth;
3154
+ class Ll {
3155
+ constructor() {
3156
+ this.children = [], this.isDirty = !1;
3157
+ }
3158
+ add(e) {
3159
+ Je(this.children, e), this.isDirty = !0;
3160
+ }
3161
+ remove(e) {
3162
+ Qe(this.children, e), this.isDirty = !0;
3163
+ }
3164
+ forEach(e) {
3165
+ this.isDirty && this.children.sort(Rl), this.isDirty = !1, this.children.forEach(e);
3166
+ }
3167
+ }
3168
+ function kl(t, e) {
3169
+ const n = I.now(), s = ({ timestamp: i }) => {
3170
+ const o = i - n;
3171
+ o >= e && (Z(s), t(o - e));
3172
+ };
3173
+ return M.setup(s, !0), () => Z(s);
3174
+ }
3175
+ const Ui = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], Bl = Ui.length, is = (t) => typeof t == "string" ? parseFloat(t) : t, rs = (t) => typeof t == "number" || T.test(t);
3176
+ function Fl(t, e, n, s, i, o) {
3177
+ i ? (t.opacity = V(0, n.opacity ?? 1, Ol(s)), t.opacityExit = V(e.opacity ?? 1, 0, Il(s))) : o && (t.opacity = V(e.opacity ?? 1, n.opacity ?? 1, s));
3178
+ for (let r = 0; r < Bl; r++) {
3179
+ const a = `border${Ui[r]}Radius`;
3180
+ let l = os(e, a), c = os(n, a);
3181
+ if (l === void 0 && c === void 0)
3182
+ continue;
3183
+ l || (l = 0), c || (c = 0), l === 0 || c === 0 || rs(l) === rs(c) ? (t[a] = Math.max(V(is(l), is(c), s), 0), (_.test(c) || _.test(l)) && (t[a] += "%")) : t[a] = c;
3184
+ }
3185
+ (e.rotate || n.rotate) && (t.rotate = V(e.rotate || 0, n.rotate || 0, s));
3186
+ }
3187
+ function os(t, e) {
3188
+ return t[e] !== void 0 ? t[e] : t.borderRadius;
3189
+ }
3190
+ const Ol = /* @__PURE__ */ Ki(0, 0.5, pi), Il = /* @__PURE__ */ Ki(0.5, 0.95, K);
3191
+ function Ki(t, e, n) {
3192
+ return (s) => s < t ? 0 : s > e ? 1 : n(/* @__PURE__ */ Rt(t, e, s));
3193
+ }
3194
+ function as(t, e) {
3195
+ t.min = e.min, t.max = e.max;
3196
+ }
3197
+ function N(t, e) {
3198
+ as(t.x, e.x), as(t.y, e.y);
3199
+ }
3200
+ function ls(t, e) {
3201
+ t.translate = e.translate, t.scale = e.scale, t.originPoint = e.originPoint, t.origin = e.origin;
3202
+ }
3203
+ function us(t, e, n, s, i) {
3204
+ return t -= e, t = Xt(t, 1 / n, s), i !== void 0 && (t = Xt(t, 1 / i, s)), t;
3205
+ }
3206
+ function jl(t, e = 0, n = 1, s = 0.5, i, o = t, r = t) {
3207
+ if (_.test(e) && (e = parseFloat(e), e = V(r.min, r.max, e / 100) - r.min), typeof e != "number")
3208
+ return;
3209
+ let a = V(o.min, o.max, s);
3210
+ t === o && (a -= e), t.min = us(t.min, e, n, a, i), t.max = us(t.max, e, n, a, i);
3211
+ }
3212
+ function cs(t, e, [n, s, i], o, r) {
3213
+ jl(t, e[n], e[s], e[i], e.scale, o, r);
3214
+ }
3215
+ const Nl = ["x", "scaleX", "originX"], Ul = ["y", "scaleY", "originY"];
3216
+ function hs(t, e, n, s) {
3217
+ cs(t.x, e, Nl, n ? n.x : void 0, s ? s.x : void 0), cs(t.y, e, Ul, n ? n.y : void 0, s ? s.y : void 0);
3218
+ }
3219
+ function fs(t) {
3220
+ return t.translate === 0 && t.scale === 1;
3221
+ }
3222
+ function Wi(t) {
3223
+ return fs(t.x) && fs(t.y);
3224
+ }
3225
+ function ds(t, e) {
3226
+ return t.min === e.min && t.max === e.max;
3227
+ }
3228
+ function Kl(t, e) {
3229
+ return ds(t.x, e.x) && ds(t.y, e.y);
3230
+ }
3231
+ function ms(t, e) {
3232
+ return Math.round(t.min) === Math.round(e.min) && Math.round(t.max) === Math.round(e.max);
3233
+ }
3234
+ function $i(t, e) {
3235
+ return ms(t.x, e.x) && ms(t.y, e.y);
3236
+ }
3237
+ function ps(t) {
3238
+ return B(t.x) / B(t.y);
3239
+ }
3240
+ function gs(t, e) {
3241
+ return t.translate === e.translate && t.scale === e.scale && t.originPoint === e.originPoint;
3242
+ }
3243
+ class Wl {
3244
+ constructor() {
3245
+ this.members = [];
3246
+ }
3247
+ add(e) {
3248
+ Je(this.members, e), e.scheduleRender();
3249
+ }
3250
+ remove(e) {
3251
+ if (Qe(this.members, e), e === this.prevLead && (this.prevLead = void 0), e === this.lead) {
3252
+ const n = this.members[this.members.length - 1];
3253
+ n && this.promote(n);
3254
+ }
3255
+ }
3256
+ relegate(e) {
3257
+ const n = this.members.findIndex((i) => e === i);
3258
+ if (n === 0)
3259
+ return !1;
3260
+ let s;
3261
+ for (let i = n; i >= 0; i--) {
3262
+ const o = this.members[i];
3263
+ if (o.isPresent !== !1) {
3264
+ s = o;
3265
+ break;
3266
+ }
3267
+ }
3268
+ return s ? (this.promote(s), !0) : !1;
3269
+ }
3270
+ promote(e, n) {
3271
+ const s = this.lead;
3272
+ if (e !== s && (this.prevLead = s, this.lead = e, e.show(), s)) {
3273
+ s.instance && s.scheduleRender(), e.scheduleRender(), e.resumeFrom = s, n && (e.resumeFrom.preserveOpacity = !0), s.snapshot && (e.snapshot = s.snapshot, e.snapshot.latestValues = s.animationValues || s.latestValues), e.root && e.root.isUpdating && (e.isLayoutDirty = !0);
3274
+ const { crossfade: i } = e.options;
3275
+ i === !1 && s.hide();
3276
+ }
3277
+ }
3278
+ exitAnimationComplete() {
3279
+ this.members.forEach((e) => {
3280
+ const { options: n, resumingFrom: s } = e;
3281
+ n.onExitComplete && n.onExitComplete(), s && s.options.onExitComplete && s.options.onExitComplete();
3282
+ });
3283
+ }
3284
+ scheduleRender() {
3285
+ this.members.forEach((e) => {
3286
+ e.instance && e.scheduleRender(!1);
3287
+ });
3288
+ }
3289
+ /**
3290
+ * Clear any leads that have been removed this render to prevent them from being
3291
+ * used in future animations and to prevent memory leaks
3292
+ */
3293
+ removeLeadSnapshot() {
3294
+ this.lead && this.lead.snapshot && (this.lead.snapshot = void 0);
3295
+ }
3296
+ }
3297
+ function $l(t, e, n) {
3298
+ let s = "";
3299
+ const i = t.x.translate / e.x, o = t.y.translate / e.y, r = n?.z || 0;
3300
+ if ((i || o || r) && (s = `translate3d(${i}px, ${o}px, ${r}px) `), (e.x !== 1 || e.y !== 1) && (s += `scale(${1 / e.x}, ${1 / e.y}) `), n) {
3301
+ const { transformPerspective: c, rotate: u, rotateX: h, rotateY: f, skewX: d, skewY: m } = n;
3302
+ c && (s = `perspective(${c}px) ${s}`), u && (s += `rotate(${u}deg) `), h && (s += `rotateX(${h}deg) `), f && (s += `rotateY(${f}deg) `), d && (s += `skewX(${d}deg) `), m && (s += `skewY(${m}deg) `);
3303
+ }
3304
+ const a = t.x.scale * e.x, l = t.y.scale * e.y;
3305
+ return (a !== 1 || l !== 1) && (s += `scale(${a}, ${l})`), s || "none";
3306
+ }
3307
+ const he = ["", "X", "Y", "Z"], _l = { visibility: "hidden" }, Gl = 1e3;
3308
+ let Hl = 0;
3309
+ function fe(t, e, n, s) {
3310
+ const { latestValues: i } = e;
3311
+ i[t] && (n[t] = i[t], e.setStaticValue(t, 0), s && (s[t] = 0));
3312
+ }
3313
+ function _i(t) {
3314
+ if (t.hasCheckedOptimisedAppear = !0, t.root === t)
3315
+ return;
3316
+ const { visualElement: e } = t.options;
3317
+ if (!e)
3318
+ return;
3319
+ const n = Js(e);
3320
+ if (window.MotionHasOptimisedAnimation(n, "transform")) {
3321
+ const { layout: i, layoutId: o } = t.options;
3322
+ window.MotionCancelOptimisedAnimation(n, "transform", M, !(i || o));
3323
+ }
3324
+ const { parent: s } = t;
3325
+ s && !s.hasCheckedOptimisedAppear && _i(s);
3326
+ }
3327
+ function Gi({ attachResizeListener: t, defaultParent: e, measureScroll: n, checkIsScrollRoot: s, resetTransform: i }) {
3328
+ return class {
3329
+ constructor(r = {}, a = e?.()) {
3330
+ this.id = Hl++, this.animationId = 0, this.children = /* @__PURE__ */ new Set(), this.options = {}, this.isTreeAnimating = !1, this.isAnimationBlocked = !1, this.isLayoutDirty = !1, this.isProjectionDirty = !1, this.isSharedProjectionDirty = !1, this.isTransformDirty = !1, this.updateManuallyBlocked = !1, this.updateBlockedByResize = !1, this.isUpdating = !1, this.isSVG = !1, this.needsReset = !1, this.shouldResetTransform = !1, this.hasCheckedOptimisedAppear = !1, this.treeScale = { x: 1, y: 1 }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = !1, this.updateScheduled = !1, this.scheduleUpdate = () => this.update(), this.projectionUpdateScheduled = !1, this.checkUpdateFailed = () => {
3331
+ this.isUpdating && (this.isUpdating = !1, this.clearAllSnapshots());
3332
+ }, this.updateProjection = () => {
3333
+ this.projectionUpdateScheduled = !1, this.nodes.forEach(Xl), this.nodes.forEach(tu), this.nodes.forEach(eu), this.nodes.forEach(ql);
3334
+ }, this.resolvedRelativeTargetAt = 0, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = r, this.root = a ? a.root || a : this, this.path = a ? [...a.path, a] : [], this.parent = a, this.depth = a ? a.depth + 1 : 0;
3335
+ for (let l = 0; l < this.path.length; l++)
3336
+ this.path[l].shouldResetTransform = !0;
3337
+ this.root === this && (this.nodes = new Ll());
3338
+ }
3339
+ addEventListener(r, a) {
3340
+ return this.eventHandlers.has(r) || this.eventHandlers.set(r, new tn()), this.eventHandlers.get(r).add(a);
3341
+ }
3342
+ notifyListeners(r, ...a) {
3343
+ const l = this.eventHandlers.get(r);
3344
+ l && l.notify(...a);
3345
+ }
3346
+ hasListeners(r) {
3347
+ return this.eventHandlers.has(r);
3348
+ }
3349
+ /**
3350
+ * Lifecycles
3351
+ */
3352
+ mount(r) {
3353
+ if (this.instance)
3354
+ return;
3355
+ this.isSVG = El(r), this.instance = r;
3356
+ const { layoutId: a, layout: l, visualElement: c } = this.options;
3357
+ if (c && !c.current && c.mount(r), this.root.nodes.add(this), this.parent && this.parent.children.add(this), this.root.hasTreeAnimated && (l || a) && (this.isLayoutDirty = !0), t) {
3358
+ let u;
3359
+ const h = () => this.root.updateBlockedByResize = !1;
3360
+ t(r, () => {
3361
+ this.root.updateBlockedByResize = !0, u && u(), u = kl(h, 250), $t.hasAnimatedSinceResize && ($t.hasAnimatedSinceResize = !1, this.nodes.forEach(vs));
3362
+ });
3363
+ }
3364
+ a && this.root.registerSharedNode(a, this), this.options.animate !== !1 && c && (a || l) && this.addEventListener("didUpdate", ({ delta: u, hasLayoutChanged: h, hasRelativeLayoutChanged: f, layout: d }) => {
3365
+ if (this.isTreeAnimationBlocked()) {
3366
+ this.target = void 0, this.relativeTarget = void 0;
3367
+ return;
3368
+ }
3369
+ const m = this.options.transition || c.getDefaultTransition() || ou, { onLayoutAnimationStart: y, onLayoutAnimationComplete: v } = c.getProps(), g = !this.targetLayout || !$i(this.targetLayout, d), P = !h && f;
3370
+ if (this.options.layoutRoot || this.resumeFrom || P || h && (g || !this.currentAnimation)) {
3371
+ this.resumeFrom && (this.resumingFrom = this.resumeFrom, this.resumingFrom.resumingFrom = void 0), this.setAnimationOrigin(u, P);
3372
+ const p = {
3373
+ ...en(m, "layout"),
3374
+ onPlay: y,
3375
+ onComplete: v
3376
+ };
3377
+ (c.shouldReduceMotion || this.options.layoutRoot) && (p.delay = 0, p.type = !1), this.startAnimation(p);
3378
+ } else
3379
+ h || vs(this), this.isLead() && this.options.onExitComplete && this.options.onExitComplete();
3380
+ this.targetLayout = d;
3381
+ });
3382
+ }
3383
+ unmount() {
3384
+ this.options.layoutId && this.willUpdate(), this.root.nodes.remove(this);
3385
+ const r = this.getStack();
3386
+ r && r.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0, this.eventHandlers.clear(), Z(this.updateProjection);
3387
+ }
3388
+ // only on the root
3389
+ blockUpdate() {
3390
+ this.updateManuallyBlocked = !0;
3391
+ }
3392
+ unblockUpdate() {
3393
+ this.updateManuallyBlocked = !1;
3394
+ }
3395
+ isUpdateBlocked() {
3396
+ return this.updateManuallyBlocked || this.updateBlockedByResize;
3397
+ }
3398
+ isTreeAnimationBlocked() {
3399
+ return this.isAnimationBlocked || this.parent && this.parent.isTreeAnimationBlocked() || !1;
3400
+ }
3401
+ // Note: currently only running on root node
3402
+ startUpdate() {
3403
+ this.isUpdateBlocked() || (this.isUpdating = !0, this.nodes && this.nodes.forEach(nu), this.animationId++);
3404
+ }
3405
+ getTransformTemplate() {
3406
+ const { visualElement: r } = this.options;
3407
+ return r && r.getProps().transformTemplate;
3408
+ }
3409
+ willUpdate(r = !0) {
3410
+ if (this.root.hasTreeAnimated = !0, this.root.isUpdateBlocked()) {
3411
+ this.options.onExitComplete && this.options.onExitComplete();
3412
+ return;
3413
+ }
3414
+ if (window.MotionCancelOptimisedAnimation && !this.hasCheckedOptimisedAppear && _i(this), !this.root.isUpdating && this.root.startUpdate(), this.isLayoutDirty)
3415
+ return;
3416
+ this.isLayoutDirty = !0;
3417
+ for (let u = 0; u < this.path.length; u++) {
3418
+ const h = this.path[u];
3419
+ h.shouldResetTransform = !0, h.updateScroll("snapshot"), h.options.layoutRoot && h.willUpdate(!1);
3420
+ }
3421
+ const { layoutId: a, layout: l } = this.options;
3422
+ if (a === void 0 && !l)
3423
+ return;
3424
+ const c = this.getTransformTemplate();
3425
+ this.prevTransformTemplateValue = c ? c(this.latestValues, "") : void 0, this.updateSnapshot(), r && this.notifyListeners("willUpdate");
3426
+ }
3427
+ update() {
3428
+ if (this.updateScheduled = !1, this.isUpdateBlocked()) {
3429
+ this.unblockUpdate(), this.clearAllSnapshots(), this.nodes.forEach(ys);
3430
+ return;
3431
+ }
3432
+ this.isUpdating || this.nodes.forEach(Jl), this.isUpdating = !1, this.nodes.forEach(Ql), this.nodes.forEach(zl), this.nodes.forEach(Yl), this.clearAllSnapshots();
3433
+ const a = I.now();
3434
+ E.delta = X(0, 1e3 / 60, a - E.timestamp), E.timestamp = a, E.isProcessing = !0, se.update.process(E), se.preRender.process(E), se.render.process(E), E.isProcessing = !1;
3435
+ }
3436
+ didUpdate() {
3437
+ this.updateScheduled || (this.updateScheduled = !0, $e.read(this.scheduleUpdate));
3438
+ }
3439
+ clearAllSnapshots() {
3440
+ this.nodes.forEach(Zl), this.sharedNodes.forEach(su);
3441
+ }
3442
+ scheduleUpdateProjection() {
3443
+ this.projectionUpdateScheduled || (this.projectionUpdateScheduled = !0, M.preRender(this.updateProjection, !1, !0));
3444
+ }
3445
+ scheduleCheckAfterUnmount() {
3446
+ M.postRender(() => {
3447
+ this.isLayoutDirty ? this.root.didUpdate() : this.root.checkUpdateFailed();
3448
+ });
3449
+ }
3450
+ /**
3451
+ * Update measurements
3452
+ */
3453
+ updateSnapshot() {
3454
+ this.snapshot || !this.instance || (this.snapshot = this.measure(), this.snapshot && !B(this.snapshot.measuredBox.x) && !B(this.snapshot.measuredBox.y) && (this.snapshot = void 0));
3455
+ }
3456
+ updateLayout() {
3457
+ if (!this.instance || (this.updateScroll(), !(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty))
3458
+ return;
3459
+ if (this.resumeFrom && !this.resumeFrom.instance)
3460
+ for (let l = 0; l < this.path.length; l++)
3461
+ this.path[l].updateScroll();
3462
+ const r = this.layout;
3463
+ this.layout = this.measure(!1), this.layoutCorrected = D(), this.isLayoutDirty = !1, this.projectionDelta = void 0, this.notifyListeners("measure", this.layout.layoutBox);
3464
+ const { visualElement: a } = this.options;
3465
+ a && a.notify("LayoutMeasure", this.layout.layoutBox, r ? r.layoutBox : void 0);
3466
+ }
3467
+ updateScroll(r = "measure") {
3468
+ let a = !!(this.options.layoutScroll && this.instance);
3469
+ if (this.scroll && this.scroll.animationId === this.root.animationId && this.scroll.phase === r && (a = !1), a && this.instance) {
3470
+ const l = s(this.instance);
3471
+ this.scroll = {
3472
+ animationId: this.root.animationId,
3473
+ phase: r,
3474
+ isRoot: l,
3475
+ offset: n(this.instance),
3476
+ wasRoot: this.scroll ? this.scroll.isRoot : l
3477
+ };
3478
+ }
3479
+ }
3480
+ resetTransform() {
3481
+ if (!i)
3482
+ return;
3483
+ const r = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout, a = this.projectionDelta && !Wi(this.projectionDelta), l = this.getTransformTemplate(), c = l ? l(this.latestValues, "") : void 0, u = c !== this.prevTransformTemplateValue;
3484
+ r && this.instance && (a || et(this.latestValues) || u) && (i(this.instance, c), this.shouldResetTransform = !1, this.scheduleRender());
3485
+ }
3486
+ measure(r = !0) {
3487
+ const a = this.measurePageBox();
3488
+ let l = this.removeElementScroll(a);
3489
+ return r && (l = this.removeTransform(l)), au(l), {
3490
+ animationId: this.root.animationId,
3491
+ measuredBox: a,
3492
+ layoutBox: l,
3493
+ latestValues: {},
3494
+ source: this.id
3495
+ };
3496
+ }
3497
+ measurePageBox() {
3498
+ const { visualElement: r } = this.options;
3499
+ if (!r)
3500
+ return D();
3501
+ const a = r.measureViewportBox();
3502
+ if (!(this.scroll?.wasRoot || this.path.some(lu))) {
3503
+ const { scroll: c } = this.root;
3504
+ c && (ht(a.x, c.offset.x), ht(a.y, c.offset.y));
3505
+ }
3506
+ return a;
3507
+ }
3508
+ removeElementScroll(r) {
3509
+ const a = D();
3510
+ if (N(a, r), this.scroll?.wasRoot)
3511
+ return a;
3512
+ for (let l = 0; l < this.path.length; l++) {
3513
+ const c = this.path[l], { scroll: u, options: h } = c;
3514
+ c !== this.root && u && h.layoutScroll && (u.wasRoot && N(a, r), ht(a.x, u.offset.x), ht(a.y, u.offset.y));
3515
+ }
3516
+ return a;
3517
+ }
3518
+ applyTransform(r, a = !1) {
3519
+ const l = D();
3520
+ N(l, r);
3521
+ for (let c = 0; c < this.path.length; c++) {
3522
+ const u = this.path[c];
3523
+ !a && u.options.layoutScroll && u.scroll && u !== u.root && ft(l, {
3524
+ x: -u.scroll.offset.x,
3525
+ y: -u.scroll.offset.y
3526
+ }), et(u.latestValues) && ft(l, u.latestValues);
3527
+ }
3528
+ return et(this.latestValues) && ft(l, this.latestValues), l;
3529
+ }
3530
+ removeTransform(r) {
3531
+ const a = D();
3532
+ N(a, r);
3533
+ for (let l = 0; l < this.path.length; l++) {
3534
+ const c = this.path[l];
3535
+ if (!c.instance || !et(c.latestValues))
3536
+ continue;
3537
+ Re(c.latestValues) && c.updateSnapshot();
3538
+ const u = D(), h = c.measurePageBox();
3539
+ N(u, h), hs(a, c.latestValues, c.snapshot ? c.snapshot.layoutBox : void 0, u);
3540
+ }
3541
+ return et(this.latestValues) && hs(a, this.latestValues), a;
3542
+ }
3543
+ setTargetDelta(r) {
3544
+ this.targetDelta = r, this.root.scheduleUpdateProjection(), this.isProjectionDirty = !0;
3545
+ }
3546
+ setOptions(r) {
3547
+ this.options = {
3548
+ ...this.options,
3549
+ ...r,
3550
+ crossfade: r.crossfade !== void 0 ? r.crossfade : !0
3551
+ };
3552
+ }
3553
+ clearMeasurements() {
3554
+ this.scroll = void 0, this.layout = void 0, this.snapshot = void 0, this.prevTransformTemplateValue = void 0, this.targetDelta = void 0, this.target = void 0, this.isLayoutDirty = !1;
3555
+ }
3556
+ forceRelativeParentToResolveTarget() {
3557
+ this.relativeParent && this.relativeParent.resolvedRelativeTargetAt !== E.timestamp && this.relativeParent.resolveTargetDelta(!0);
3558
+ }
3559
+ resolveTargetDelta(r = !1) {
3560
+ const a = this.getLead();
3561
+ this.isProjectionDirty || (this.isProjectionDirty = a.isProjectionDirty), this.isTransformDirty || (this.isTransformDirty = a.isTransformDirty), this.isSharedProjectionDirty || (this.isSharedProjectionDirty = a.isSharedProjectionDirty);
3562
+ const l = !!this.resumingFrom || this !== a;
3563
+ if (!(r || l && this.isSharedProjectionDirty || this.isProjectionDirty || this.parent?.isProjectionDirty || this.attemptToResolveRelativeTarget || this.root.updateBlockedByResize))
3564
+ return;
3565
+ const { layout: u, layoutId: h } = this.options;
3566
+ if (!(!this.layout || !(u || h))) {
3567
+ if (this.resolvedRelativeTargetAt = E.timestamp, !this.targetDelta && !this.relativeTarget) {
3568
+ const f = this.getClosestProjectingParent();
3569
+ f && f.layout && this.animationProgress !== 1 ? (this.relativeParent = f, this.forceRelativeParentToResolveTarget(), this.relativeTarget = D(), this.relativeTargetOrigin = D(), At(this.relativeTargetOrigin, this.layout.layoutBox, f.layout.layoutBox), N(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
3570
+ }
3571
+ if (!(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target = D(), this.targetWithTransforms = D()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), ll(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) : N(this.target, this.layout.layoutBox), ki(this.target, this.targetDelta)) : N(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget)) {
3572
+ this.attemptToResolveRelativeTarget = !1;
3573
+ const f = this.getClosestProjectingParent();
3574
+ f && !!f.resumingFrom == !!this.resumingFrom && !f.options.layoutScroll && f.target && this.animationProgress !== 1 ? (this.relativeParent = f, this.forceRelativeParentToResolveTarget(), this.relativeTarget = D(), this.relativeTargetOrigin = D(), At(this.relativeTargetOrigin, this.target, f.target), N(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
3575
+ }
3576
+ }
3577
+ }
3578
+ getClosestProjectingParent() {
3579
+ if (!(!this.parent || Re(this.parent.latestValues) || Li(this.parent.latestValues)))
3580
+ return this.parent.isProjecting() ? this.parent : this.parent.getClosestProjectingParent();
3581
+ }
3582
+ isProjecting() {
3583
+ return !!((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout);
3584
+ }
3585
+ calcProjection() {
3586
+ const r = this.getLead(), a = !!this.resumingFrom || this !== r;
3587
+ let l = !0;
3588
+ if ((this.isProjectionDirty || this.parent?.isProjectionDirty) && (l = !1), a && (this.isSharedProjectionDirty || this.isTransformDirty) && (l = !1), this.resolvedRelativeTargetAt === E.timestamp && (l = !1), l)
3589
+ return;
3590
+ const { layout: c, layoutId: u } = this.options;
3591
+ if (this.isTreeAnimating = !!(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !this.layout || !(c || u))
3592
+ return;
3593
+ N(this.layoutCorrected, this.layout.layoutBox);
3594
+ const h = this.treeScale.x, f = this.treeScale.y;
3595
+ ul(this.layoutCorrected, this.treeScale, this.path, a), r.layout && !r.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (r.target = r.layout.layoutBox, r.targetWithTransforms = D());
3596
+ const { target: d } = r;
3597
+ if (!d) {
3598
+ this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
3599
+ return;
3600
+ }
3601
+ !this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (ls(this.prevProjectionDelta.x, this.projectionDelta.x), ls(this.prevProjectionDelta.y, this.projectionDelta.y)), wt(this.projectionDelta, this.layoutCorrected, d, this.latestValues), (this.treeScale.x !== h || this.treeScale.y !== f || !gs(this.projectionDelta.x, this.prevProjectionDelta.x) || !gs(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", d));
3602
+ }
3603
+ hide() {
3604
+ this.isVisible = !1;
3605
+ }
3606
+ show() {
3607
+ this.isVisible = !0;
3608
+ }
3609
+ scheduleRender(r = !0) {
3610
+ if (this.options.visualElement?.scheduleRender(), r) {
3611
+ const a = this.getStack();
3612
+ a && a.scheduleRender();
3613
+ }
3614
+ this.resumingFrom && !this.resumingFrom.instance && (this.resumingFrom = void 0);
3615
+ }
3616
+ createProjectionDeltas() {
3617
+ this.prevProjectionDelta = ct(), this.projectionDelta = ct(), this.projectionDeltaWithTransform = ct();
3618
+ }
3619
+ setAnimationOrigin(r, a = !1) {
3620
+ const l = this.snapshot, c = l ? l.latestValues : {}, u = { ...this.latestValues }, h = ct();
3621
+ (!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !a;
3622
+ const f = D(), d = l ? l.source : void 0, m = this.layout ? this.layout.source : void 0, y = d !== m, v = this.getStack(), g = !v || v.members.length <= 1, P = !!(y && !g && this.options.crossfade === !0 && !this.path.some(ru));
3623
+ this.animationProgress = 0;
3624
+ let p;
3625
+ this.mixTargetDelta = (b) => {
3626
+ const x = b / 1e3;
3627
+ Ts(h.x, r.x, x), Ts(h.y, r.y, x), this.setTargetDelta(h), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (At(f, this.layout.layoutBox, this.relativeParent.layout.layoutBox), iu(this.relativeTarget, this.relativeTargetOrigin, f, x), p && Kl(this.relativeTarget, p) && (this.isProjectionDirty = !1), p || (p = D()), N(p, this.relativeTarget)), y && (this.animationValues = u, Fl(u, c, this.latestValues, x, P, g)), this.root.scheduleUpdateProjection(), this.scheduleRender(), this.animationProgress = x;
3628
+ }, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
3629
+ }
3630
+ startAnimation(r) {
3631
+ this.notifyListeners("animationStart"), this.currentAnimation?.stop(!1), this.resumingFrom?.currentAnimation?.stop(!1), this.pendingAnimation && (Z(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = M.update(() => {
3632
+ $t.hasAnimatedSinceResize = !0, this.motionValue || (this.motionValue = mt(0)), this.currentAnimation = Cl(this.motionValue, [0, 1e3], {
3633
+ ...r,
3634
+ isSync: !0,
3635
+ onUpdate: (a) => {
3636
+ this.mixTargetDelta(a), r.onUpdate && r.onUpdate(a);
3637
+ },
3638
+ onStop: () => {
3639
+ },
3640
+ onComplete: () => {
3641
+ r.onComplete && r.onComplete(), this.completeAnimation();
3642
+ }
3643
+ }), this.resumingFrom && (this.resumingFrom.currentAnimation = this.currentAnimation), this.pendingAnimation = void 0;
3644
+ });
3645
+ }
3646
+ completeAnimation() {
3647
+ this.resumingFrom && (this.resumingFrom.currentAnimation = void 0, this.resumingFrom.preserveOpacity = void 0);
3648
+ const r = this.getStack();
3649
+ r && r.exitAnimationComplete(), this.resumingFrom = this.currentAnimation = this.animationValues = void 0, this.notifyListeners("animationComplete");
3650
+ }
3651
+ finishAnimation() {
3652
+ this.currentAnimation && (this.mixTargetDelta && this.mixTargetDelta(Gl), this.currentAnimation.stop(!1)), this.completeAnimation();
3653
+ }
3654
+ applyTransformsToTarget() {
3655
+ const r = this.getLead();
3656
+ let { targetWithTransforms: a, target: l, layout: c, latestValues: u } = r;
3657
+ if (!(!a || !l || !c)) {
3658
+ if (this !== r && this.layout && c && Hi(this.options.animationType, this.layout.layoutBox, c.layoutBox)) {
3659
+ l = this.target || D();
3660
+ const h = B(this.layout.layoutBox.x);
3661
+ l.x.min = r.target.x.min, l.x.max = l.x.min + h;
3662
+ const f = B(this.layout.layoutBox.y);
3663
+ l.y.min = r.target.y.min, l.y.max = l.y.min + f;
3664
+ }
3665
+ N(a, l), ft(a, u), wt(this.projectionDeltaWithTransform, this.layoutCorrected, a, u);
3666
+ }
3667
+ }
3668
+ registerSharedNode(r, a) {
3669
+ this.sharedNodes.has(r) || this.sharedNodes.set(r, new Wl()), this.sharedNodes.get(r).add(a);
3670
+ const c = a.options.initialPromotionConfig;
3671
+ a.promote({
3672
+ transition: c ? c.transition : void 0,
3673
+ preserveFollowOpacity: c && c.shouldPreserveFollowOpacity ? c.shouldPreserveFollowOpacity(a) : void 0
3674
+ });
3675
+ }
3676
+ isLead() {
3677
+ const r = this.getStack();
3678
+ return r ? r.lead === this : !0;
3679
+ }
3680
+ getLead() {
3681
+ const { layoutId: r } = this.options;
3682
+ return r ? this.getStack()?.lead || this : this;
3683
+ }
3684
+ getPrevLead() {
3685
+ const { layoutId: r } = this.options;
3686
+ return r ? this.getStack()?.prevLead : void 0;
3687
+ }
3688
+ getStack() {
3689
+ const { layoutId: r } = this.options;
3690
+ if (r)
3691
+ return this.root.sharedNodes.get(r);
3692
+ }
3693
+ promote({ needsReset: r, transition: a, preserveFollowOpacity: l } = {}) {
3694
+ const c = this.getStack();
3695
+ c && c.promote(this, l), r && (this.projectionDelta = void 0, this.needsReset = !0), a && this.setOptions({ transition: a });
3696
+ }
3697
+ relegate() {
3698
+ const r = this.getStack();
3699
+ return r ? r.relegate(this) : !1;
3700
+ }
3701
+ resetSkewAndRotation() {
3702
+ const { visualElement: r } = this.options;
3703
+ if (!r)
3704
+ return;
3705
+ let a = !1;
3706
+ const { latestValues: l } = r;
3707
+ if ((l.z || l.rotate || l.rotateX || l.rotateY || l.rotateZ || l.skewX || l.skewY) && (a = !0), !a)
3708
+ return;
3709
+ const c = {};
3710
+ l.z && fe("z", r, c, this.animationValues);
3711
+ for (let u = 0; u < he.length; u++)
3712
+ fe(`rotate${he[u]}`, r, c, this.animationValues), fe(`skew${he[u]}`, r, c, this.animationValues);
3713
+ r.render();
3714
+ for (const u in c)
3715
+ r.setStaticValue(u, c[u]), this.animationValues && (this.animationValues[u] = c[u]);
3716
+ r.scheduleRender();
3717
+ }
3718
+ getProjectionStyles(r) {
3719
+ if (!this.instance || this.isSVG)
3720
+ return;
3721
+ if (!this.isVisible)
3722
+ return _l;
3723
+ const a = {
3724
+ visibility: ""
3725
+ }, l = this.getTransformTemplate();
3726
+ if (this.needsReset)
3727
+ return this.needsReset = !1, a.opacity = "", a.pointerEvents = Kt(r?.pointerEvents) || "", a.transform = l ? l(this.latestValues, "") : "none", a;
3728
+ const c = this.getLead();
3729
+ if (!this.projectionDelta || !this.layout || !c.target) {
3730
+ const d = {};
3731
+ return this.options.layoutId && (d.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, d.pointerEvents = Kt(r?.pointerEvents) || ""), this.hasProjected && !et(this.latestValues) && (d.transform = l ? l({}, "") : "none", this.hasProjected = !1), d;
3732
+ }
3733
+ const u = c.animationValues || c.latestValues;
3734
+ this.applyTransformsToTarget(), a.transform = $l(this.projectionDeltaWithTransform, this.treeScale, u), l && (a.transform = l(u, a.transform));
3735
+ const { x: h, y: f } = this.projectionDelta;
3736
+ a.transformOrigin = `${h.origin * 100}% ${f.origin * 100}% 0`, c.animationValues ? a.opacity = c === this ? u.opacity ?? this.latestValues.opacity ?? 1 : this.preserveOpacity ? this.latestValues.opacity : u.opacityExit : a.opacity = c === this ? u.opacity !== void 0 ? u.opacity : "" : u.opacityExit !== void 0 ? u.opacityExit : 0;
3737
+ for (const d in Mt) {
3738
+ if (u[d] === void 0)
3739
+ continue;
3740
+ const { correct: m, applyTo: y, isCSSVariable: v } = Mt[d], g = a.transform === "none" ? u[d] : m(u[d], c);
3741
+ if (y) {
3742
+ const P = y.length;
3743
+ for (let p = 0; p < P; p++)
3744
+ a[y[p]] = g;
3745
+ } else
3746
+ v ? this.options.visualElement.renderState.vars[d] = g : a[d] = g;
3747
+ }
3748
+ return this.options.layoutId && (a.pointerEvents = c === this ? Kt(r?.pointerEvents) || "" : "none"), a;
3749
+ }
3750
+ clearSnapshot() {
3751
+ this.resumeFrom = this.snapshot = void 0;
3752
+ }
3753
+ // Only run on root
3754
+ resetTree() {
3755
+ this.root.nodes.forEach((r) => r.currentAnimation?.stop(!1)), this.root.nodes.forEach(ys), this.root.sharedNodes.clear();
3756
+ }
3757
+ };
3758
+ }
3759
+ function zl(t) {
3760
+ t.updateLayout();
3761
+ }
3762
+ function Yl(t) {
3763
+ const e = t.resumeFrom?.snapshot || t.snapshot;
3764
+ if (t.isLead() && t.layout && e && t.hasListeners("didUpdate")) {
3765
+ const { layoutBox: n, measuredBox: s } = t.layout, { animationType: i } = t.options, o = e.source !== t.layout.source;
3766
+ i === "size" ? U((u) => {
3767
+ const h = o ? e.measuredBox[u] : e.layoutBox[u], f = B(h);
3768
+ h.min = n[u].min, h.max = h.min + f;
3769
+ }) : Hi(i, e.layoutBox, n) && U((u) => {
3770
+ const h = o ? e.measuredBox[u] : e.layoutBox[u], f = B(n[u]);
3771
+ h.max = h.min + f, t.relativeTarget && !t.currentAnimation && (t.isProjectionDirty = !0, t.relativeTarget[u].max = t.relativeTarget[u].min + f);
3772
+ });
3773
+ const r = ct();
3774
+ wt(r, n, e.layoutBox);
3775
+ const a = ct();
3776
+ o ? wt(a, t.applyTransform(s, !0), e.measuredBox) : wt(a, n, e.layoutBox);
3777
+ const l = !Wi(r);
3778
+ let c = !1;
3779
+ if (!t.resumeFrom) {
3780
+ const u = t.getClosestProjectingParent();
3781
+ if (u && !u.resumeFrom) {
3782
+ const { snapshot: h, layout: f } = u;
3783
+ if (h && f) {
3784
+ const d = D();
3785
+ At(d, e.layoutBox, h.layoutBox);
3786
+ const m = D();
3787
+ At(m, n, f.layoutBox), $i(d, m) || (c = !0), u.options.layoutRoot && (t.relativeTarget = m, t.relativeTargetOrigin = d, t.relativeParent = u);
3788
+ }
3789
+ }
3790
+ }
3791
+ t.notifyListeners("didUpdate", {
3792
+ layout: n,
3793
+ snapshot: e,
3794
+ delta: a,
3795
+ layoutDelta: r,
3796
+ hasLayoutChanged: l,
3797
+ hasRelativeLayoutChanged: c
3798
+ });
3799
+ } else if (t.isLead()) {
3800
+ const { onExitComplete: n } = t.options;
3801
+ n && n();
3802
+ }
3803
+ t.options.transition = void 0;
3804
+ }
3805
+ function Xl(t) {
3806
+ t.parent && (t.isProjecting() || (t.isProjectionDirty = t.parent.isProjectionDirty), t.isSharedProjectionDirty || (t.isSharedProjectionDirty = !!(t.isProjectionDirty || t.parent.isProjectionDirty || t.parent.isSharedProjectionDirty)), t.isTransformDirty || (t.isTransformDirty = t.parent.isTransformDirty));
3807
+ }
3808
+ function ql(t) {
3809
+ t.isProjectionDirty = t.isSharedProjectionDirty = t.isTransformDirty = !1;
3810
+ }
3811
+ function Zl(t) {
3812
+ t.clearSnapshot();
3813
+ }
3814
+ function ys(t) {
3815
+ t.clearMeasurements();
3816
+ }
3817
+ function Jl(t) {
3818
+ t.isLayoutDirty = !1;
3819
+ }
3820
+ function Ql(t) {
3821
+ const { visualElement: e } = t.options;
3822
+ e && e.getProps().onBeforeLayoutMeasure && e.notify("BeforeLayoutMeasure"), t.resetTransform();
3823
+ }
3824
+ function vs(t) {
3825
+ t.finishAnimation(), t.targetDelta = t.relativeTarget = t.target = void 0, t.isProjectionDirty = !0;
3826
+ }
3827
+ function tu(t) {
3828
+ t.resolveTargetDelta();
3829
+ }
3830
+ function eu(t) {
3831
+ t.calcProjection();
3832
+ }
3833
+ function nu(t) {
3834
+ t.resetSkewAndRotation();
3835
+ }
3836
+ function su(t) {
3837
+ t.removeLeadSnapshot();
3838
+ }
3839
+ function Ts(t, e, n) {
3840
+ t.translate = V(e.translate, 0, n), t.scale = V(e.scale, 1, n), t.origin = e.origin, t.originPoint = e.originPoint;
3841
+ }
3842
+ function xs(t, e, n, s) {
3843
+ t.min = V(e.min, n.min, s), t.max = V(e.max, n.max, s);
3844
+ }
3845
+ function iu(t, e, n, s) {
3846
+ xs(t.x, e.x, n.x, s), xs(t.y, e.y, n.y, s);
3847
+ }
3848
+ function ru(t) {
3849
+ return t.animationValues && t.animationValues.opacityExit !== void 0;
3850
+ }
3851
+ const ou = {
3852
+ duration: 0.45,
3853
+ ease: [0.4, 0, 0.1, 1]
3854
+ }, Ps = (t) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(t), Ss = Ps("applewebkit/") && !Ps("chrome/") ? Math.round : K;
3855
+ function bs(t) {
3856
+ t.min = Ss(t.min), t.max = Ss(t.max);
3857
+ }
3858
+ function au(t) {
3859
+ bs(t.x), bs(t.y);
3860
+ }
3861
+ function Hi(t, e, n) {
3862
+ return t === "position" || t === "preserve-aspect" && !al(ps(e), ps(n), 0.2);
3863
+ }
3864
+ function lu(t) {
3865
+ return t !== t.root && t.scroll?.wasRoot;
3866
+ }
3867
+ const uu = Gi({
3868
+ attachResizeListener: (t, e) => Lt(t, "resize", e),
3869
+ measureScroll: () => ({
3870
+ x: document.documentElement.scrollLeft || document.body.scrollLeft,
3871
+ y: document.documentElement.scrollTop || document.body.scrollTop
3872
+ }),
3873
+ checkIsScrollRoot: () => !0
3874
+ }), de = {
3875
+ current: void 0
3876
+ }, zi = Gi({
3877
+ measureScroll: (t) => ({
3878
+ x: t.scrollLeft,
3879
+ y: t.scrollTop
3880
+ }),
3881
+ defaultParent: () => {
3882
+ if (!de.current) {
3883
+ const t = new uu({});
3884
+ t.mount(window), t.setOptions({ layoutScroll: !0 }), de.current = t;
3885
+ }
3886
+ return de.current;
3887
+ },
3888
+ resetTransform: (t, e) => {
3889
+ t.style.transform = e !== void 0 ? e : "none";
3890
+ },
3891
+ checkIsScrollRoot: (t) => window.getComputedStyle(t).position === "fixed"
3892
+ }), cu = {
3893
+ pan: {
3894
+ Feature: Al
3895
+ },
3896
+ drag: {
3897
+ Feature: wl,
3898
+ ProjectionNode: zi,
3899
+ MeasureLayout: Ni
3900
+ }
3901
+ };
3902
+ function Yi(t, e, n) {
3903
+ if (t instanceof EventTarget)
3904
+ return [t];
3905
+ if (typeof t == "string") {
3906
+ const i = document.querySelectorAll(t);
3907
+ return i ? Array.from(i) : [];
3908
+ }
3909
+ return Array.from(t);
3910
+ }
3911
+ function Xi(t, e) {
3912
+ const n = Yi(t), s = new AbortController(), i = {
3913
+ passive: !0,
3914
+ ...e,
3915
+ signal: s.signal
3916
+ };
3917
+ return [n, i, () => s.abort()];
3918
+ }
3919
+ function ws(t) {
3920
+ return !(t.pointerType === "touch" || ji());
3921
+ }
3922
+ function hu(t, e, n = {}) {
3923
+ const [s, i, o] = Xi(t, n), r = (a) => {
3924
+ if (!ws(a))
3925
+ return;
3926
+ const { target: l } = a, c = e(l, a);
3927
+ if (typeof c != "function" || !l)
3928
+ return;
3929
+ const u = (h) => {
3930
+ ws(h) && (c(h), l.removeEventListener("pointerleave", u));
3931
+ };
3932
+ l.addEventListener("pointerleave", u, i);
3933
+ };
3934
+ return s.forEach((a) => {
3935
+ a.addEventListener("pointerenter", r, i);
3936
+ }), o;
3937
+ }
3938
+ function As(t, e, n) {
3939
+ const { props: s } = t;
3940
+ t.animationState && s.whileHover && t.animationState.setActive("whileHover", n === "Start");
3941
+ const i = "onHover" + n, o = s[i];
3942
+ o && M.postRender(() => o(e, Ot(e)));
3943
+ }
3944
+ class fu extends Q {
3945
+ mount() {
3946
+ const { current: e } = this.node;
3947
+ e && (this.unmount = hu(e, (n, s) => (As(this.node, s, "Start"), (i) => As(this.node, i, "End"))));
3948
+ }
3949
+ unmount() {
3950
+ }
3951
+ }
3952
+ class du extends Q {
3953
+ constructor() {
3954
+ super(...arguments), this.isActive = !1;
3955
+ }
3956
+ onFocus() {
3957
+ let e = !1;
3958
+ try {
3959
+ e = this.node.current.matches(":focus-visible");
3960
+ } catch {
3961
+ e = !0;
3962
+ }
3963
+ !e || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
3964
+ }
3965
+ onBlur() {
3966
+ !this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
3967
+ }
3968
+ mount() {
3969
+ this.unmount = Bt(Lt(this.node.current, "focus", () => this.onFocus()), Lt(this.node.current, "blur", () => this.onBlur()));
3970
+ }
3971
+ unmount() {
3972
+ }
3973
+ }
3974
+ const qi = (t, e) => e ? t === e ? !0 : qi(t, e.parentElement) : !1, mu = /* @__PURE__ */ new Set([
3975
+ "BUTTON",
3976
+ "INPUT",
3977
+ "SELECT",
3978
+ "TEXTAREA",
3979
+ "A"
3980
+ ]);
3981
+ function pu(t) {
3982
+ return mu.has(t.tagName) || t.tabIndex !== -1;
3983
+ }
3984
+ const _t = /* @__PURE__ */ new WeakSet();
3985
+ function Vs(t) {
3986
+ return (e) => {
3987
+ e.key === "Enter" && t(e);
3988
+ };
3989
+ }
3990
+ function me(t, e) {
3991
+ t.dispatchEvent(new PointerEvent("pointer" + e, { isPrimary: !0, bubbles: !0 }));
3992
+ }
3993
+ const gu = (t, e) => {
3994
+ const n = t.currentTarget;
3995
+ if (!n)
3996
+ return;
3997
+ const s = Vs(() => {
3998
+ if (_t.has(n))
3999
+ return;
4000
+ me(n, "down");
4001
+ const i = Vs(() => {
4002
+ me(n, "up");
4003
+ }), o = () => me(n, "cancel");
4004
+ n.addEventListener("keyup", i, e), n.addEventListener("blur", o, e);
4005
+ });
4006
+ n.addEventListener("keydown", s, e), n.addEventListener("blur", () => n.removeEventListener("keydown", s), e);
4007
+ };
4008
+ function Ms(t) {
4009
+ return pn(t) && !ji();
4010
+ }
4011
+ function yu(t, e, n = {}) {
4012
+ const [s, i, o] = Xi(t, n), r = (a) => {
4013
+ const l = a.currentTarget;
4014
+ if (!Ms(a))
4015
+ return;
4016
+ _t.add(l);
4017
+ const c = e(l, a), u = (d, m) => {
4018
+ window.removeEventListener("pointerup", h), window.removeEventListener("pointercancel", f), _t.has(l) && _t.delete(l), Ms(d) && typeof c == "function" && c(d, { success: m });
4019
+ }, h = (d) => {
4020
+ u(d, l === window || l === document || n.useGlobalTarget || qi(l, d.target));
4021
+ }, f = (d) => {
4022
+ u(d, !1);
4023
+ };
4024
+ window.addEventListener("pointerup", h, i), window.addEventListener("pointercancel", f, i);
4025
+ };
4026
+ return s.forEach((a) => {
4027
+ (n.useGlobalTarget ? window : a).addEventListener("pointerdown", r, i), a instanceof HTMLElement && (a.addEventListener("focus", (c) => gu(c, i)), !pu(a) && !a.hasAttribute("tabindex") && (a.tabIndex = 0));
4028
+ }), o;
4029
+ }
4030
+ function Ds(t, e, n) {
4031
+ const { props: s } = t;
4032
+ if (t.current instanceof HTMLButtonElement && t.current.disabled)
4033
+ return;
4034
+ t.animationState && s.whileTap && t.animationState.setActive("whileTap", n === "Start");
4035
+ const i = "onTap" + (n === "End" ? "" : n), o = s[i];
4036
+ o && M.postRender(() => o(e, Ot(e)));
4037
+ }
4038
+ class vu extends Q {
4039
+ mount() {
4040
+ const { current: e } = this.node;
4041
+ e && (this.unmount = yu(e, (n, s) => (Ds(this.node, s, "Start"), (i, { success: o }) => Ds(this.node, i, o ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
4042
+ }
4043
+ unmount() {
4044
+ }
4045
+ }
4046
+ const Be = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), Tu = (t) => {
4047
+ const e = Be.get(t.target);
4048
+ e && e(t);
4049
+ }, xu = (t) => {
4050
+ t.forEach(Tu);
4051
+ };
4052
+ function Pu({ root: t, ...e }) {
4053
+ const n = t || document;
4054
+ pe.has(n) || pe.set(n, {});
4055
+ const s = pe.get(n), i = JSON.stringify(e);
4056
+ return s[i] || (s[i] = new IntersectionObserver(xu, { root: t, ...e })), s[i];
4057
+ }
4058
+ function Su(t, e, n) {
4059
+ const s = Pu(e);
4060
+ return Be.set(t, n), s.observe(t), () => {
4061
+ Be.delete(t), s.unobserve(t);
4062
+ };
4063
+ }
4064
+ const bu = {
4065
+ some: 0,
4066
+ all: 1
4067
+ };
4068
+ class wu extends Q {
4069
+ constructor() {
4070
+ super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
4071
+ }
4072
+ startObserver() {
4073
+ this.unmount();
4074
+ const { viewport: e = {} } = this.node.getProps(), { root: n, margin: s, amount: i = "some", once: o } = e, r = {
4075
+ root: n ? n.current : void 0,
4076
+ rootMargin: s,
4077
+ threshold: typeof i == "number" ? i : bu[i]
4078
+ }, a = (l) => {
4079
+ const { isIntersecting: c } = l;
4080
+ if (this.isInView === c || (this.isInView = c, o && !c && this.hasEnteredView))
4081
+ return;
4082
+ c && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", c);
4083
+ const { onViewportEnter: u, onViewportLeave: h } = this.node.getProps(), f = c ? u : h;
4084
+ f && f(l);
4085
+ };
4086
+ return Su(this.node.current, r, a);
4087
+ }
4088
+ mount() {
4089
+ this.startObserver();
4090
+ }
4091
+ update() {
4092
+ if (typeof IntersectionObserver > "u")
4093
+ return;
4094
+ const { props: e, prevProps: n } = this.node;
4095
+ ["amount", "margin", "root"].some(Au(e, n)) && this.startObserver();
4096
+ }
4097
+ unmount() {
4098
+ }
4099
+ }
4100
+ function Au({ viewport: t = {} }, { viewport: e = {} } = {}) {
4101
+ return (n) => t[n] !== e[n];
4102
+ }
4103
+ const Vu = {
4104
+ inView: {
4105
+ Feature: wu
4106
+ },
4107
+ tap: {
4108
+ Feature: vu
4109
+ },
4110
+ focus: {
4111
+ Feature: du
4112
+ },
4113
+ hover: {
4114
+ Feature: fu
4115
+ }
4116
+ }, Mu = {
4117
+ layout: {
4118
+ ProjectionNode: zi,
4119
+ MeasureLayout: Ni
4120
+ }
4121
+ }, Fe = { current: null }, Zi = { current: !1 };
4122
+ function Du() {
4123
+ if (Zi.current = !0, !!Ie)
4124
+ if (window.matchMedia) {
4125
+ const t = window.matchMedia("(prefers-reduced-motion)"), e = () => Fe.current = t.matches;
4126
+ t.addListener(e), e();
4127
+ } else
4128
+ Fe.current = !1;
4129
+ }
4130
+ const Cu = /* @__PURE__ */ new WeakMap();
4131
+ function Eu(t, e, n) {
4132
+ for (const s in e) {
4133
+ const i = e[s], o = n[s];
4134
+ if (L(i))
4135
+ t.addValue(s, i);
4136
+ else if (L(o))
4137
+ t.addValue(s, mt(i, { owner: t }));
4138
+ else if (o !== i)
4139
+ if (t.hasValue(s)) {
4140
+ const r = t.getValue(s);
4141
+ r.liveStyle === !0 ? r.jump(i) : r.hasAnimated || r.set(i);
4142
+ } else {
4143
+ const r = t.getStaticValue(s);
4144
+ t.addValue(s, mt(r !== void 0 ? r : i, { owner: t }));
4145
+ }
4146
+ }
4147
+ for (const s in n)
4148
+ e[s] === void 0 && t.removeValue(s);
4149
+ return e;
4150
+ }
4151
+ const Ji = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), Qi = (t) => /^0[^.\s]+$/u.test(t), Ru = {
4152
+ test: (t) => t === "auto",
4153
+ parse: (t) => t
4154
+ }, tr = (t) => (e) => e.test(t), er = [Tt, T, _, q, Kr, Ur, Ru], Cs = (t) => er.find(tr(t)), Lu = [...er, R, J], ku = (t) => Lu.find(tr(t)), Bu = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
4155
+ function Fu(t) {
4156
+ const [e, n] = t.slice(0, -1).split("(");
4157
+ if (e === "drop-shadow")
4158
+ return t;
4159
+ const [s] = n.match(nn) || [];
4160
+ if (!s)
4161
+ return t;
4162
+ const i = n.replace(s, "");
4163
+ let o = Bu.has(e) ? 1 : 0;
4164
+ return s !== n && (o *= 100), e + "(" + o + i + ")";
4165
+ }
4166
+ const Ou = /\b([a-z-]*)\(.*?\)/gu, Oe = {
4167
+ ...J,
4168
+ getAnimatableNone: (t) => {
4169
+ const e = t.match(Ou);
4170
+ return e ? e.map(Fu).join(" ") : t;
4171
+ }
4172
+ }, Iu = {
4173
+ ...He,
4174
+ // Color props
4175
+ color: R,
4176
+ backgroundColor: R,
4177
+ outlineColor: R,
4178
+ fill: R,
4179
+ stroke: R,
4180
+ // Border props
4181
+ borderColor: R,
4182
+ borderTopColor: R,
4183
+ borderRightColor: R,
4184
+ borderBottomColor: R,
4185
+ borderLeftColor: R,
4186
+ filter: Oe,
4187
+ WebkitFilter: Oe
4188
+ }, nr = (t) => Iu[t];
4189
+ function sr(t, e) {
4190
+ let n = nr(t);
4191
+ return n !== Oe && (n = J), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
4192
+ }
4193
+ const Es = [
4194
+ "AnimationStart",
4195
+ "AnimationComplete",
4196
+ "Update",
4197
+ "BeforeLayoutMeasure",
4198
+ "LayoutMeasure",
4199
+ "LayoutAnimationStart",
4200
+ "LayoutAnimationComplete"
4201
+ ];
4202
+ class ju {
4203
+ /**
4204
+ * This method takes React props and returns found MotionValues. For example, HTML
4205
+ * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
4206
+ *
4207
+ * This isn't an abstract method as it needs calling in the constructor, but it is
4208
+ * intended to be one.
4209
+ */
4210
+ scrapeMotionValuesFromProps(e, n, s) {
4211
+ return {};
4212
+ }
4213
+ constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: o, visualState: r }, a = {}) {
4214
+ this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = fn, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
4215
+ this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
4216
+ }, this.renderScheduledAt = 0, this.scheduleRender = () => {
4217
+ const f = I.now();
4218
+ this.renderScheduledAt < f && (this.renderScheduledAt = f, M.render(this.render, !1, !0));
4219
+ };
4220
+ const { latestValues: l, renderState: c } = r;
4221
+ this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = c, this.parent = e, this.props = n, this.presenceContext = s, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = i, this.options = a, this.blockInitialAnimation = !!o, this.isControllingVariants = te(n), this.isVariantNode = js(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
4222
+ const { willChange: u, ...h } = this.scrapeMotionValuesFromProps(n, {}, this);
4223
+ for (const f in h) {
4224
+ const d = h[f];
4225
+ l[f] !== void 0 && L(d) && d.set(l[f], !1);
4226
+ }
4227
+ }
4228
+ mount(e) {
4229
+ this.current = e, Cu.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), Zi.current || Du(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : Fe.current, process.env.NODE_ENV !== "production" && Ne(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
4230
+ }
4231
+ unmount() {
4232
+ this.projection && this.projection.unmount(), Z(this.notifyUpdate), Z(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
4233
+ for (const e in this.events)
4234
+ this.events[e].clear();
4235
+ for (const e in this.features) {
4236
+ const n = this.features[e];
4237
+ n && (n.unmount(), n.isMounted = !1);
4238
+ }
4239
+ this.current = null;
4240
+ }
4241
+ bindToMotionValue(e, n) {
4242
+ this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
4243
+ const s = vt.has(e);
4244
+ s && this.onBindTransform && this.onBindTransform();
4245
+ const i = n.on("change", (a) => {
4246
+ this.latestValues[e] = a, this.props.onUpdate && M.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0);
4247
+ }), o = n.on("renderRequest", this.scheduleRender);
4248
+ let r;
4249
+ window.MotionCheckAppearSync && (r = window.MotionCheckAppearSync(this, e, n)), this.valueSubscriptions.set(e, () => {
4250
+ i(), o(), r && r(), n.owner && n.stop();
4251
+ });
4252
+ }
4253
+ sortNodePosition(e) {
4254
+ return !this.current || !this.sortInstanceNodePosition || this.type !== e.type ? 0 : this.sortInstanceNodePosition(this.current, e.current);
4255
+ }
4256
+ updateFeatures() {
4257
+ let e = "animation";
4258
+ for (e in dt) {
4259
+ const n = dt[e];
4260
+ if (!n)
4261
+ continue;
4262
+ const { isEnabled: s, Feature: i } = n;
4263
+ if (!this.features[e] && i && s(this.props) && (this.features[e] = new i(this)), this.features[e]) {
4264
+ const o = this.features[e];
4265
+ o.isMounted ? o.update() : (o.mount(), o.isMounted = !0);
4266
+ }
4267
+ }
4268
+ }
4269
+ triggerBuild() {
4270
+ this.build(this.renderState, this.latestValues, this.props);
4271
+ }
4272
+ /**
4273
+ * Measure the current viewport box with or without transforms.
4274
+ * Only measures axis-aligned boxes, rotate and skew must be manually
4275
+ * removed with a re-render to work.
4276
+ */
4277
+ measureViewportBox() {
4278
+ return this.current ? this.measureInstanceViewportBox(this.current, this.props) : D();
4279
+ }
4280
+ getStaticValue(e) {
4281
+ return this.latestValues[e];
4282
+ }
4283
+ setStaticValue(e, n) {
4284
+ this.latestValues[e] = n;
4285
+ }
4286
+ /**
4287
+ * Update the provided props. Ensure any newly-added motion values are
4288
+ * added to our map, old ones removed, and listeners updated.
4289
+ */
4290
+ update(e, n) {
4291
+ (e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
4292
+ for (let s = 0; s < Es.length; s++) {
4293
+ const i = Es[s];
4294
+ this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
4295
+ const o = "on" + i, r = e[o];
4296
+ r && (this.propEventSubscriptions[i] = this.on(i, r));
4297
+ }
4298
+ this.prevMotionValues = Eu(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
4299
+ }
4300
+ getProps() {
4301
+ return this.props;
4302
+ }
4303
+ /**
4304
+ * Returns the variant definition with a given name.
4305
+ */
4306
+ getVariant(e) {
4307
+ return this.props.variants ? this.props.variants[e] : void 0;
4308
+ }
4309
+ /**
4310
+ * Returns the defined default transition on this component.
4311
+ */
4312
+ getDefaultTransition() {
4313
+ return this.props.transition;
4314
+ }
4315
+ getTransformPagePoint() {
4316
+ return this.props.transformPagePoint;
4317
+ }
4318
+ getClosestVariantNode() {
4319
+ return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
4320
+ }
4321
+ /**
4322
+ * Add a child visual element to our set of children.
4323
+ */
4324
+ addVariantChild(e) {
4325
+ const n = this.getClosestVariantNode();
4326
+ if (n)
4327
+ return n.variantChildren && n.variantChildren.add(e), () => n.variantChildren.delete(e);
4328
+ }
4329
+ /**
4330
+ * Add a motion value and bind it to this visual element.
4331
+ */
4332
+ addValue(e, n) {
4333
+ const s = this.values.get(e);
4334
+ n !== s && (s && this.removeValue(e), this.bindToMotionValue(e, n), this.values.set(e, n), this.latestValues[e] = n.get());
4335
+ }
4336
+ /**
4337
+ * Remove a motion value and unbind any active subscriptions.
4338
+ */
4339
+ removeValue(e) {
4340
+ this.values.delete(e);
4341
+ const n = this.valueSubscriptions.get(e);
4342
+ n && (n(), this.valueSubscriptions.delete(e)), delete this.latestValues[e], this.removeValueFromRenderState(e, this.renderState);
4343
+ }
4344
+ /**
4345
+ * Check whether we have a motion value for this key
4346
+ */
4347
+ hasValue(e) {
4348
+ return this.values.has(e);
4349
+ }
4350
+ getValue(e, n) {
4351
+ if (this.props.values && this.props.values[e])
4352
+ return this.props.values[e];
4353
+ let s = this.values.get(e);
4354
+ return s === void 0 && n !== void 0 && (s = mt(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
4355
+ }
4356
+ /**
4357
+ * If we're trying to animate to a previously unencountered value,
4358
+ * we need to check for it in our state and as a last resort read it
4359
+ * directly from the instance (which might have performance implications).
4360
+ */
4361
+ readValue(e, n) {
4362
+ let s = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : this.getBaseTargetFromProps(this.props, e) ?? this.readValueFromInstance(this.current, e, this.options);
4363
+ return s != null && (typeof s == "string" && (Ji(s) || Qi(s)) ? s = parseFloat(s) : !ku(s) && J.test(n) && (s = sr(e, n)), this.setBaseTarget(e, L(s) ? s.get() : s)), L(s) ? s.get() : s;
4364
+ }
4365
+ /**
4366
+ * Set the base target to later animate back to. This is currently
4367
+ * only hydrated on creation and when we first read a value.
4368
+ */
4369
+ setBaseTarget(e, n) {
4370
+ this.baseTarget[e] = n;
4371
+ }
4372
+ /**
4373
+ * Find the base target for a value thats been removed from all animation
4374
+ * props.
4375
+ */
4376
+ getBaseTarget(e) {
4377
+ const { initial: n } = this.props;
4378
+ let s;
4379
+ if (typeof n == "string" || typeof n == "object") {
4380
+ const o = qe(this.props, n, this.presenceContext?.custom);
4381
+ o && (s = o[e]);
4382
+ }
4383
+ if (n && s !== void 0)
4384
+ return s;
4385
+ const i = this.getBaseTargetFromProps(this.props, e);
4386
+ return i !== void 0 && !L(i) ? i : this.initialValues[e] !== void 0 && s === void 0 ? void 0 : this.baseTarget[e];
4387
+ }
4388
+ on(e, n) {
4389
+ return this.events[e] || (this.events[e] = new tn()), this.events[e].add(n);
4390
+ }
4391
+ notify(e, ...n) {
4392
+ this.events[e] && this.events[e].notify(...n);
4393
+ }
4394
+ }
4395
+ const Nu = (
4396
+ // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
4397
+ /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
4398
+ );
4399
+ function Uu(t) {
4400
+ const e = Nu.exec(t);
4401
+ if (!e)
4402
+ return [,];
4403
+ const [, n, s, i] = e;
4404
+ return [`--${n ?? s}`, i];
4405
+ }
4406
+ const Ku = 4;
4407
+ function ir(t, e, n = 1) {
4408
+ Y(n <= Ku, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
4409
+ const [s, i] = Uu(t);
4410
+ if (!s)
4411
+ return;
4412
+ const o = window.getComputedStyle(e).getPropertyValue(s);
4413
+ if (o) {
4414
+ const r = o.trim();
4415
+ return Ji(r) ? parseFloat(r) : r;
4416
+ }
4417
+ return Ge(i) ? ir(i, e, n + 1) : i;
4418
+ }
4419
+ function Wu(t) {
4420
+ return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Qi(t) : !0;
4421
+ }
4422
+ const $u = /* @__PURE__ */ new Set(["auto", "none", "0"]);
4423
+ function _u(t, e, n) {
4424
+ let s = 0, i;
4425
+ for (; s < t.length && !i; ) {
4426
+ const o = t[s];
4427
+ typeof o == "string" && !$u.has(o) && Et(o).values.length && (i = t[s]), s++;
4428
+ }
4429
+ if (i && n)
4430
+ for (const o of e)
4431
+ t[o] = sr(n, i);
4432
+ }
4433
+ class Gu extends fn {
4434
+ constructor(e, n, s, i, o) {
4435
+ super(e, n, s, i, o, !0);
4436
+ }
4437
+ readKeyframes() {
4438
+ const { unresolvedKeyframes: e, element: n, name: s } = this;
4439
+ if (!n || !n.current)
4440
+ return;
4441
+ super.readKeyframes();
4442
+ for (let l = 0; l < e.length; l++) {
4443
+ let c = e[l];
4444
+ if (typeof c == "string" && (c = c.trim(), Ge(c))) {
4445
+ const u = ir(c, n.current);
4446
+ u !== void 0 && (e[l] = u), l === e.length - 1 && (this.finalKeyframe = c);
4447
+ }
4448
+ }
4449
+ if (this.resolveNoneKeyframes(), !Ai.has(s) || e.length !== 2)
4450
+ return;
4451
+ const [i, o] = e, r = Cs(i), a = Cs(o);
4452
+ if (r !== a)
4453
+ if (Fn(r) && Fn(a))
4454
+ for (let l = 0; l < e.length; l++) {
4455
+ const c = e[l];
4456
+ typeof c == "string" && (e[l] = parseFloat(c));
4457
+ }
4458
+ else it[s] && (this.needsMeasurement = !0);
4459
+ }
4460
+ resolveNoneKeyframes() {
4461
+ const { unresolvedKeyframes: e, name: n } = this, s = [];
4462
+ for (let i = 0; i < e.length; i++)
4463
+ (e[i] === null || Wu(e[i])) && s.push(i);
4464
+ s.length && _u(e, s, n);
4465
+ }
4466
+ measureInitialState() {
4467
+ const { element: e, unresolvedKeyframes: n, name: s } = this;
4468
+ if (!e || !e.current)
4469
+ return;
4470
+ s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = it[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
4471
+ const i = n[n.length - 1];
4472
+ i !== void 0 && e.getValue(s, i).jump(i, !1);
4473
+ }
4474
+ measureEndState() {
4475
+ const { element: e, name: n, unresolvedKeyframes: s } = this;
4476
+ if (!e || !e.current)
4477
+ return;
4478
+ const i = e.getValue(n);
4479
+ i && i.jump(this.measuredOrigin, !1);
4480
+ const o = s.length - 1, r = s[o];
4481
+ s[o] = it[n](e.measureViewportBox(), window.getComputedStyle(e.current)), r !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = r), this.removedTransforms?.length && this.removedTransforms.forEach(([a, l]) => {
4482
+ e.getValue(a).set(l);
4483
+ }), this.resolveNoneKeyframes();
4484
+ }
4485
+ }
4486
+ class rr extends ju {
4487
+ constructor() {
4488
+ super(...arguments), this.KeyframeResolver = Gu;
4489
+ }
4490
+ sortInstanceNodePosition(e, n) {
4491
+ return e.compareDocumentPosition(n) & 2 ? 1 : -1;
4492
+ }
4493
+ getBaseTargetFromProps(e, n) {
4494
+ return e.style ? e.style[n] : void 0;
4495
+ }
4496
+ removeValueFromRenderState(e, { vars: n, style: s }) {
4497
+ delete n[e], delete s[e];
4498
+ }
4499
+ handleChildMotionValue() {
4500
+ this.childSubscription && (this.childSubscription(), delete this.childSubscription);
4501
+ const { children: e } = this.props;
4502
+ L(e) && (this.childSubscription = e.on("change", (n) => {
4503
+ this.current && (this.current.textContent = `${n}`);
4504
+ }));
4505
+ }
4506
+ }
4507
+ function or(t, { style: e, vars: n }, s, i) {
4508
+ Object.assign(t.style, e, i && i.getProjectionStyles(s));
4509
+ for (const o in n)
4510
+ t.style.setProperty(o, n[o]);
4511
+ }
4512
+ function Hu(t) {
4513
+ return window.getComputedStyle(t);
4514
+ }
4515
+ class zu extends rr {
4516
+ constructor() {
4517
+ super(...arguments), this.type = "html", this.renderInstance = or;
4518
+ }
4519
+ readValueFromInstance(e, n) {
4520
+ if (vt.has(n))
4521
+ return this.projection?.isProjecting ? Ae(n) : ga(e, n);
4522
+ {
4523
+ const s = Hu(e), i = (_e(n) ? s.getPropertyValue(n) : s[n]) || 0;
4524
+ return typeof i == "string" ? i.trim() : i;
4525
+ }
4526
+ }
4527
+ measureInstanceViewportBox(e, { transformPagePoint: n }) {
4528
+ return Bi(e, n);
4529
+ }
4530
+ build(e, n, s) {
4531
+ ze(e, n, s.transformTemplate);
4532
+ }
4533
+ scrapeMotionValuesFromProps(e, n, s) {
4534
+ return Ze(e, n, s);
4535
+ }
4536
+ }
4537
+ const ar = /* @__PURE__ */ new Set([
4538
+ "baseFrequency",
4539
+ "diffuseConstant",
4540
+ "kernelMatrix",
4541
+ "kernelUnitLength",
4542
+ "keySplines",
4543
+ "keyTimes",
4544
+ "limitingConeAngle",
4545
+ "markerHeight",
4546
+ "markerWidth",
4547
+ "numOctaves",
4548
+ "targetX",
4549
+ "targetY",
4550
+ "surfaceScale",
4551
+ "specularConstant",
4552
+ "specularExponent",
4553
+ "stdDeviation",
4554
+ "tableValues",
4555
+ "viewBox",
4556
+ "gradientTransform",
4557
+ "pathLength",
4558
+ "startOffset",
4559
+ "textLength",
4560
+ "lengthAdjust"
4561
+ ]);
4562
+ function Yu(t, e, n, s) {
4563
+ or(t, e, void 0, s);
4564
+ for (const i in e.attrs)
4565
+ t.setAttribute(ar.has(i) ? i : We(i), e.attrs[i]);
4566
+ }
4567
+ class Xu extends rr {
4568
+ constructor() {
4569
+ super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = D;
4570
+ }
4571
+ getBaseTargetFromProps(e, n) {
4572
+ return e[n];
4573
+ }
4574
+ readValueFromInstance(e, n) {
4575
+ if (vt.has(n)) {
4576
+ const s = nr(n);
4577
+ return s && s.default || 0;
4578
+ }
4579
+ return n = ar.has(n) ? n : We(n), e.getAttribute(n);
4580
+ }
4581
+ scrapeMotionValuesFromProps(e, n, s) {
4582
+ return qs(e, n, s);
4583
+ }
4584
+ build(e, n, s) {
4585
+ Hs(e, n, this.isSVGTag, s.transformTemplate, s.style);
4586
+ }
4587
+ renderInstance(e, n, s, i) {
4588
+ Yu(e, n, s, i);
4589
+ }
4590
+ mount(e) {
4591
+ this.isSVGTag = Ys(e.tagName), super.mount(e);
4592
+ }
4593
+ }
4594
+ const qu = (t, e) => Xe(t) ? new Xu(e) : new zu(e, {
4595
+ allowProjection: t !== Ls
4596
+ }), Zu = /* @__PURE__ */ ro({
4597
+ ...Qa,
4598
+ ...Vu,
4599
+ ...cu,
4600
+ ...Mu
4601
+ }, qu), rc = /* @__PURE__ */ Ar(Zu), Ju = {
4602
+ some: 0,
4603
+ all: 1
4604
+ };
4605
+ function Qu(t, e, { root: n, margin: s, amount: i = "some" } = {}) {
4606
+ const o = Yi(t), r = /* @__PURE__ */ new WeakMap(), a = (c) => {
4607
+ c.forEach((u) => {
4608
+ const h = r.get(u.target);
4609
+ if (u.isIntersecting !== !!h)
4610
+ if (u.isIntersecting) {
4611
+ const f = e(u.target, u);
4612
+ typeof f == "function" ? r.set(u.target, f) : l.unobserve(u.target);
4613
+ } else typeof h == "function" && (h(u), r.delete(u.target));
4614
+ });
4615
+ }, l = new IntersectionObserver(a, {
4616
+ root: n,
4617
+ rootMargin: s,
4618
+ threshold: typeof i == "number" ? i : Ju[i]
4619
+ });
4620
+ return o.forEach((c) => l.observe(c)), () => l.disconnect();
4621
+ }
4622
+ function oc(t, { root: e, margin: n, amount: s, once: i = !1, initial: o = !1 } = {}) {
4623
+ const [r, a] = pr(o);
4624
+ return qt(() => {
4625
+ if (!t.current || i && r)
4626
+ return;
4627
+ const l = () => (a(!0), i ? void 0 : () => a(!1)), c = {
4628
+ root: e && e.current || void 0,
4629
+ margin: n,
4630
+ amount: s
4631
+ };
4632
+ return Qu(t.current, l, c);
4633
+ }, [e, t, n, i, s]), r;
4634
+ }
4635
+ export {
4636
+ ks as L,
4637
+ Bs as M,
4638
+ je as P,
4639
+ gr as a,
4640
+ vr as b,
4641
+ yr as c,
4642
+ rc as m,
4643
+ oc as u
4644
+ };
4645
+ //# sourceMappingURL=use-in-view-CZPXmTZM.js.map