drizzle-cube 0.9.6 → 0.9.8

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 (275) hide show
  1. package/README.md +3 -2
  2. package/dist/adapters/ActivityGridChart.config-BGndyZtr.cjs +1 -0
  3. package/dist/adapters/ActivityGridChart.config-ZdvHJAHq.js +2 -0
  4. package/dist/adapters/AreaChart.config-Cybigwcb.js +2 -0
  5. package/dist/adapters/AreaChart.config-DWGesxUg.cjs +1 -0
  6. package/dist/adapters/BarChart.config-Cc04tVQF.js +2 -0
  7. package/dist/adapters/BarChart.config-DBCu0t_-.cjs +1 -0
  8. package/dist/adapters/BoxPlotChart.config-C0WK_ipa.cjs +1 -0
  9. package/dist/adapters/BoxPlotChart.config-DapOUN_R.js +2 -0
  10. package/dist/adapters/BubbleChart.config-DPmf7sI5.cjs +1 -0
  11. package/dist/adapters/BubbleChart.config-DROSTwxW.js +2 -0
  12. package/dist/adapters/CandlestickChart.config-BHoEJ2nY.js +2 -0
  13. package/dist/adapters/CandlestickChart.config-Cm0PKObO.cjs +1 -0
  14. package/dist/adapters/DataTable.config-DLvfXXSH.cjs +1 -0
  15. package/dist/adapters/DataTable.config-DbVrWZIw.js +2 -0
  16. package/dist/adapters/DotStripChart.config-CKPw82HE.js +2 -0
  17. package/dist/adapters/DotStripChart.config-DPIrTLb6.cjs +1 -0
  18. package/dist/adapters/FunnelChart.config-DpiDbOTn.cjs +1 -0
  19. package/dist/adapters/FunnelChart.config-DtBHVpLB.js +2 -0
  20. package/dist/adapters/GaugeChart.config-CmuXGRNV.js +2 -0
  21. package/dist/adapters/GaugeChart.config-DLj1YNsp.cjs +1 -0
  22. package/dist/adapters/HeatMapChart.config-BvFK2bny.cjs +1 -0
  23. package/dist/adapters/HeatMapChart.config-DK18zZV8.js +2 -0
  24. package/dist/adapters/KpiDelta.config-BsaVN5-T.js +2 -0
  25. package/dist/adapters/KpiDelta.config-DHsMgIdk.cjs +1 -0
  26. package/dist/adapters/KpiNumber.config-D82-j-8T.js +2 -0
  27. package/dist/adapters/KpiNumber.config-pFRomJRE.cjs +1 -0
  28. package/dist/adapters/KpiText.config-CCqeKuFB.js +2 -0
  29. package/dist/adapters/KpiText.config-CSeCoBuO.cjs +1 -0
  30. package/dist/adapters/LineChart.config-C2acjFv4.js +2 -0
  31. package/dist/adapters/LineChart.config-Dr9wmiK0.cjs +1 -0
  32. package/dist/adapters/MarkdownChart.config-C-tYLLan.js +2 -0
  33. package/dist/adapters/MarkdownChart.config-Dvyfo0CB.cjs +1 -0
  34. package/dist/adapters/MeasureProfileChart.config-C5CjPw48.js +2 -0
  35. package/dist/adapters/MeasureProfileChart.config-Dj-7HqkS.cjs +1 -0
  36. package/dist/adapters/PieChart.config-CY7nFFQn.cjs +1 -0
  37. package/dist/adapters/PieChart.config-DQLQMHc_.js +2 -0
  38. package/dist/adapters/ProportionBarChart.config-BVqtS7wi.cjs +1 -0
  39. package/dist/adapters/ProportionBarChart.config-BaSgs976.js +2 -0
  40. package/dist/adapters/RadarChart.config-DxJ5k8L9.cjs +1 -0
  41. package/dist/adapters/RadarChart.config-DzL7zQUc.js +2 -0
  42. package/dist/adapters/RadialBarChart.config-Dzl1HiGz.js +2 -0
  43. package/dist/adapters/RadialBarChart.config-XlGTd9gV.cjs +1 -0
  44. package/dist/adapters/RecordsTable.config-CS5oIMvv.js +2 -0
  45. package/dist/adapters/RecordsTable.config-DRQdHghk.cjs +1 -0
  46. package/dist/adapters/RetentionCombinedChart.config-C0iiKOdf.js +2 -0
  47. package/dist/adapters/RetentionCombinedChart.config-Dl20GZnb.cjs +1 -0
  48. package/dist/adapters/RetentionHeatmap.config-Bt42ip_c.js +2 -0
  49. package/dist/adapters/RetentionHeatmap.config-DyggEvyy.cjs +1 -0
  50. package/dist/adapters/SankeyChart.config-DYz1nUx9.js +2 -0
  51. package/dist/adapters/SankeyChart.config-dlNLJMf9.cjs +1 -0
  52. package/dist/adapters/ScatterChart.config-D72zRviD.js +2 -0
  53. package/dist/adapters/ScatterChart.config-DRtyuQvV.cjs +1 -0
  54. package/dist/adapters/SunburstChart.config-C5nHXLcu.cjs +1 -0
  55. package/dist/adapters/SunburstChart.config-j5ioABeT.js +2 -0
  56. package/dist/adapters/TreeMapChart.config-CXKcX5CH.js +2 -0
  57. package/dist/adapters/TreeMapChart.config-DuYbme03.cjs +1 -0
  58. package/dist/adapters/WaterfallChart.config-BCn4tsBV.cjs +1 -0
  59. package/dist/adapters/WaterfallChart.config-BPqhdzTP.js +2 -0
  60. package/dist/adapters/{compiler-CpvetSCm.js → compiler-BKg3j2mm.js} +1260 -2446
  61. package/dist/adapters/compiler-BX6Ug_Uq.cjs +166 -0
  62. package/dist/adapters/core/index.cjs +1 -1
  63. package/dist/adapters/core/index.js +1 -1
  64. package/dist/adapters/{core-BH_56XtM.js → core-Bmb7XMBz.js} +2 -2
  65. package/dist/adapters/{core-CydD6oFu.cjs → core-JgUTMhxl.cjs} +1 -1
  66. package/dist/adapters/express/index.cjs +1 -1
  67. package/dist/adapters/express/index.js +5 -5
  68. package/dist/adapters/fastify/index.cjs +1 -1
  69. package/dist/adapters/fastify/index.js +23 -23
  70. package/dist/adapters/{handler-CtcALGcY.js → handler-CknKLUQW.js} +213 -209
  71. package/dist/adapters/{handler-Dp8fpSpk.cjs → handler-DLWgxPOk.cjs} +8 -8
  72. package/dist/adapters/hono/index.cjs +1 -1
  73. package/dist/adapters/hono/index.js +4 -4
  74. package/dist/adapters/mcp-app-html-Bu4j3yZM.cjs +1 -0
  75. package/dist/adapters/{mcp-app-html-C8vG9epH.js → mcp-app-html-D3GsxPcx.js} +1 -1
  76. package/dist/adapters/mcp-app-html.cjs +1 -1
  77. package/dist/adapters/mcp-app-html.js +1 -1
  78. package/dist/adapters/mcp-tools.cjs +1 -1
  79. package/dist/adapters/mcp-tools.js +3 -3
  80. package/dist/adapters/{mcp-transport-DDxjqyuK.js → mcp-transport-BTmAXLo8.js} +8 -3
  81. package/dist/adapters/{mcp-transport-QGYYYSgR.cjs → mcp-transport-DzxluRyH.cjs} +2 -2
  82. package/dist/adapters/nextjs/index.cjs +1 -1
  83. package/dist/adapters/nextjs/index.js +5 -5
  84. package/dist/adapters/openai-CDH_AU_Z.cjs +19 -0
  85. package/dist/adapters/{openai-pCkHdDh4.js → openai-CYTlIdxS.js} +1 -1
  86. package/dist/adapters/{openai-Cm4JcLuF.cjs → openai-KbobaAQj.cjs} +1 -1
  87. package/dist/adapters/{openai-DH5InEPj.js → openai-enh3Hkzr.js} +510 -439
  88. package/dist/adapters/utils-Du_UZbn5.cjs +139 -0
  89. package/dist/adapters/{utils-C_Mc0qsk.js → utils-i2h5cwI3.js} +2587 -1254
  90. package/dist/adapters/utils.cjs +1 -1
  91. package/dist/adapters/utils.js +1 -1
  92. package/dist/cjs/client/components/shared/dateRangeUtils.d.ts +7 -3
  93. package/dist/cjs/server/adapters/base-adapter.d.ts +3 -3
  94. package/dist/cjs/server/ai/query-schema.d.ts +3 -3
  95. package/dist/cjs/server/builders/date-time-builder.d.ts +1 -2
  96. package/dist/cjs/server/builders/date-time-helpers.d.ts +19 -6
  97. package/dist/cjs/server/builders/filter-operators.d.ts +10 -1
  98. package/dist/cjs/server/execution/query-normalizer.d.ts +9 -0
  99. package/dist/cjs/server/physical-plan/drizzle-sql-builder.d.ts +25 -0
  100. package/dist/cjs/server/physical-plan/semi-join.d.ts +21 -0
  101. package/dist/cjs/server/prompts/single-step-prompt.d.ts +1 -1
  102. package/dist/client/charts.js +12 -12
  103. package/dist/client/chunks/{DashboardEditModal-USQFytJw.js → DashboardEditModal-CiN77tQN.js} +662 -540
  104. package/dist/client/chunks/DashboardEditModal-CiN77tQN.js.map +1 -0
  105. package/dist/client/chunks/{DotStripChart-CjSsunHE.js → DotStripChart-in6QHc0b.js} +3 -3
  106. package/dist/client/chunks/{DotStripChart-CjSsunHE.js.map → DotStripChart-in6QHc0b.js.map} +1 -1
  107. package/dist/client/chunks/{ProportionBarChart-B8UyZBO_.js → ProportionBarChart-CjuOm7NT.js} +3 -3
  108. package/dist/client/chunks/{ProportionBarChart-B8UyZBO_.js.map → ProportionBarChart-CjuOm7NT.js.map} +1 -1
  109. package/dist/client/chunks/{RecordsTable-BSmkwdgd.js → RecordsTable-CXXsiaV1.js} +4 -4
  110. package/dist/client/chunks/{RecordsTable-BSmkwdgd.js.map → RecordsTable-CXXsiaV1.js.map} +1 -1
  111. package/dist/client/chunks/{RetentionCombinedChart-rOdIhUGH.js → RetentionCombinedChart-DFCeEFkx.js} +3 -3
  112. package/dist/client/chunks/{RetentionCombinedChart-rOdIhUGH.js.map → RetentionCombinedChart-DFCeEFkx.js.map} +1 -1
  113. package/dist/client/chunks/{RetentionHeatmap-DVm_7rph.js → RetentionHeatmap-jpshJ2Af.js} +2 -2
  114. package/dist/client/chunks/{RetentionHeatmap-DVm_7rph.js.map → RetentionHeatmap-jpshJ2Af.js.map} +1 -1
  115. package/dist/client/chunks/{analysis-builder-D_tw9BvU.js → analysis-builder-DIOnKxJu.js} +41 -41
  116. package/dist/client/chunks/{analysis-builder-D_tw9BvU.js.map → analysis-builder-DIOnKxJu.js.map} +1 -1
  117. package/dist/client/chunks/{analysis-builder-shared-BSINKFr2.js → analysis-builder-shared-CoX_nmo0.js} +640 -778
  118. package/dist/client/chunks/analysis-builder-shared-CoX_nmo0.js.map +1 -0
  119. package/dist/client/chunks/{chart-activity-grid-CSIsJ12e.js → chart-activity-grid-DGazwi4C.js} +9 -2
  120. package/dist/client/chunks/chart-activity-grid-DGazwi4C.js.map +1 -0
  121. package/dist/client/chunks/{chart-area-BpvSKH5I.js → chart-area-zyLGD-ym.js} +2 -2
  122. package/dist/client/chunks/{chart-area-BpvSKH5I.js.map → chart-area-zyLGD-ym.js.map} +1 -1
  123. package/dist/client/chunks/{chart-bar-Cjzv-LvG.js → chart-bar-DMCBq8qJ.js} +3 -3
  124. package/dist/client/chunks/{chart-bar-Cjzv-LvG.js.map → chart-bar-DMCBq8qJ.js.map} +1 -1
  125. package/dist/client/chunks/{chart-box-plot-DHsHfMt6.js → chart-box-plot-5Z55A-it.js} +2 -2
  126. package/dist/client/chunks/{chart-box-plot-DHsHfMt6.js.map → chart-box-plot-5Z55A-it.js.map} +1 -1
  127. package/dist/client/chunks/{chart-bubble-BtWm6x7L.js → chart-bubble-YD28dX8w.js} +2 -2
  128. package/dist/client/chunks/{chart-bubble-BtWm6x7L.js.map → chart-bubble-YD28dX8w.js.map} +1 -1
  129. package/dist/client/chunks/{chart-candlestick-Bz0_fLuq.js → chart-candlestick-BUMpBI08.js} +2 -2
  130. package/dist/client/chunks/{chart-candlestick-Bz0_fLuq.js.map → chart-candlestick-BUMpBI08.js.map} +1 -1
  131. package/dist/client/chunks/{chart-data-table-BH1A-1RN.js → chart-data-table-BdMo3zVh.js} +2 -2
  132. package/dist/client/chunks/chart-data-table-BdMo3zVh.js.map +1 -0
  133. package/dist/client/chunks/{chart-funnel-C_-K4RLj.js → chart-funnel-BRyZS6ie.js} +2 -2
  134. package/dist/client/chunks/{chart-funnel-C_-K4RLj.js.map → chart-funnel-BRyZS6ie.js.map} +1 -1
  135. package/dist/client/chunks/{chart-gauge-F-vdq2BX.js → chart-gauge-DxgHlZKp.js} +3 -3
  136. package/dist/client/chunks/{chart-gauge-F-vdq2BX.js.map → chart-gauge-DxgHlZKp.js.map} +1 -1
  137. package/dist/client/chunks/{chart-heat-map-D_8TluGo.js → chart-heat-map-5jHm3f-V.js} +3 -3
  138. package/dist/client/chunks/{chart-heat-map-D_8TluGo.js.map → chart-heat-map-5jHm3f-V.js.map} +1 -1
  139. package/dist/client/chunks/{chart-kpi-delta-DGvQ0BHZ.js → chart-kpi-delta-C84P-mwu.js} +3 -3
  140. package/dist/client/chunks/{chart-kpi-delta-DGvQ0BHZ.js.map → chart-kpi-delta-C84P-mwu.js.map} +1 -1
  141. package/dist/client/chunks/{chart-kpi-number-DP6zCh-c.js → chart-kpi-number-D9GqtBWw.js} +5 -5
  142. package/dist/client/chunks/{chart-kpi-number-DP6zCh-c.js.map → chart-kpi-number-D9GqtBWw.js.map} +1 -1
  143. package/dist/client/chunks/{chart-kpi-text-DDbWfMwK.js → chart-kpi-text-D3HqxXzU.js} +3 -3
  144. package/dist/client/chunks/{chart-kpi-text-DDbWfMwK.js.map → chart-kpi-text-D3HqxXzU.js.map} +1 -1
  145. package/dist/client/chunks/{chart-line-DlhmQQ-X.js → chart-line-IEgiF8Nv.js} +3 -3
  146. package/dist/client/chunks/{chart-line-DlhmQQ-X.js.map → chart-line-IEgiF8Nv.js.map} +1 -1
  147. package/dist/client/chunks/{chart-markdown-C5ldCjSN.js → chart-markdown-B_2Ed7FJ.js} +2 -2
  148. package/dist/client/chunks/{chart-markdown-C5ldCjSN.js.map → chart-markdown-B_2Ed7FJ.js.map} +1 -1
  149. package/dist/client/chunks/{chart-measure-profile-CjErXQI4.js → chart-measure-profile-CWsPrQhH.js} +3 -3
  150. package/dist/client/chunks/{chart-measure-profile-CjErXQI4.js.map → chart-measure-profile-CWsPrQhH.js.map} +1 -1
  151. package/dist/client/chunks/{chart-pie-CmKhmUR-.js → chart-pie-BEB2sCXF.js} +3 -3
  152. package/dist/client/chunks/{chart-pie-CmKhmUR-.js.map → chart-pie-BEB2sCXF.js.map} +1 -1
  153. package/dist/client/chunks/{chart-radar-B2bYTyb0.js → chart-radar-BbSbXKbP.js} +3 -3
  154. package/dist/client/chunks/{chart-radar-B2bYTyb0.js.map → chart-radar-BbSbXKbP.js.map} +1 -1
  155. package/dist/client/chunks/{chart-radial-bar-DvQ-xZS-.js → chart-radial-bar-CNYD7tkM.js} +3 -3
  156. package/dist/client/chunks/{chart-radial-bar-DvQ-xZS-.js.map → chart-radial-bar-CNYD7tkM.js.map} +1 -1
  157. package/dist/client/chunks/{chart-sankey-DHIrjmhj.js → chart-sankey-DKnTIvSr.js} +2 -2
  158. package/dist/client/chunks/{chart-sankey-DHIrjmhj.js.map → chart-sankey-DKnTIvSr.js.map} +1 -1
  159. package/dist/client/chunks/{chart-scatter-JnoA3CD5.js → chart-scatter-CSWF6-lx.js} +3 -3
  160. package/dist/client/chunks/{chart-scatter-JnoA3CD5.js.map → chart-scatter-CSWF6-lx.js.map} +1 -1
  161. package/dist/client/chunks/{chart-sunburst-BtzRp5bg.js → chart-sunburst-CdGzCq7q.js} +3 -3
  162. package/dist/client/chunks/{chart-sunburst-BtzRp5bg.js.map → chart-sunburst-CdGzCq7q.js.map} +1 -1
  163. package/dist/client/chunks/{chart-tree-map-HQitd39D.js → chart-tree-map-BiXB7EiM.js} +3 -3
  164. package/dist/client/chunks/{chart-tree-map-HQitd39D.js.map → chart-tree-map-BiXB7EiM.js.map} +1 -1
  165. package/dist/client/chunks/{chart-waterfall-Dd3HMz3p.js → chart-waterfall-5rSDeLEZ.js} +3 -3
  166. package/dist/client/chunks/{chart-waterfall-Dd3HMz3p.js.map → chart-waterfall-5rSDeLEZ.js.map} +1 -1
  167. package/dist/client/chunks/{charts-core-CQFOTTPb.js → charts-core-CKpkoMCa.js} +2 -2
  168. package/dist/client/chunks/{charts-core-CQFOTTPb.js.map → charts-core-CKpkoMCa.js.map} +1 -1
  169. package/dist/client/chunks/charts-loader-BTI0UPK4.js +87 -0
  170. package/dist/client/chunks/{charts-loader-BlxEsp39.js.map → charts-loader-BTI0UPK4.js.map} +1 -1
  171. package/dist/client/chunks/{nl-NL-gaWTnOGQ.js → nl-NL-kRjxedTf.js} +8 -1
  172. package/dist/client/chunks/{nl-NL-gaWTnOGQ.js.map → nl-NL-kRjxedTf.js.map} +1 -1
  173. package/dist/client/chunks/{schema-visualization-BspQ-XB8.js → schema-visualization-BbvL74Sf.js} +3 -3
  174. package/dist/client/chunks/{schema-visualization-BspQ-XB8.js.map → schema-visualization-BbvL74Sf.js.map} +1 -1
  175. package/dist/client/chunks/{useDirtyStateTracking-DY5sjvb6.js → useDirtyStateTracking-BfG1lX_3.js} +4 -4
  176. package/dist/client/chunks/{useDirtyStateTracking-DY5sjvb6.js.map → useDirtyStateTracking-BfG1lX_3.js.map} +1 -1
  177. package/dist/client/chunks/{useExplainAI-BY0Ti3FZ.js → useExplainAI-CDFhgmpE.js} +4 -4
  178. package/dist/client/chunks/{useExplainAI-BY0Ti3FZ.js.map → useExplainAI-CDFhgmpE.js.map} +1 -1
  179. package/dist/client/chunks/{vendor-C4pD7rZf.js → vendor-DeckzF1j.js} +2 -2
  180. package/dist/client/chunks/{vendor-C4pD7rZf.js.map → vendor-DeckzF1j.js.map} +1 -1
  181. package/dist/client/components/shared/dateRangeUtils.d.ts +7 -3
  182. package/dist/client/components.js +2 -2
  183. package/dist/client/hooks.js +3 -3
  184. package/dist/client/icons.js +1 -1
  185. package/dist/client/index.js +18 -18
  186. package/dist/client/index.js.map +1 -1
  187. package/dist/client/providers.js +1 -1
  188. package/dist/client/schema.js +1 -1
  189. package/dist/client/utils.js +4 -4
  190. package/dist/client-bundle-stats.html +1 -1
  191. package/dist/mcp-app/mcp-app.html +2 -2
  192. package/dist/server/adapters/base-adapter.d.ts +3 -3
  193. package/dist/server/ai/query-schema.d.ts +3 -3
  194. package/dist/server/builders/date-time-builder.d.ts +1 -2
  195. package/dist/server/builders/date-time-helpers.d.ts +19 -6
  196. package/dist/server/builders/filter-operators.d.ts +10 -1
  197. package/dist/server/execution/query-normalizer.d.ts +9 -0
  198. package/dist/server/index.cjs +54 -47
  199. package/dist/server/index.js +2562 -2409
  200. package/dist/server/{openai-D346-vmt.cjs → openai-BIHkBS7X.cjs} +1 -1
  201. package/dist/server/{openai-SILGL2q_.js → openai-CPW5x6kl.js} +1 -1
  202. package/dist/server/{openai-D0vh48Oi.js → openai-DCC49vC6.js} +507 -436
  203. package/dist/server/openai-xQRpdAPa.cjs +19 -0
  204. package/dist/server/physical-plan/drizzle-sql-builder.d.ts +25 -0
  205. package/dist/server/physical-plan/semi-join.d.ts +21 -0
  206. package/dist/server/prompts/single-step-prompt.d.ts +1 -1
  207. package/package.json +3 -3
  208. package/dist/adapters/ActivityGridChart.config-BgAUfqKS.js +0 -2
  209. package/dist/adapters/ActivityGridChart.config-CGsjbfYL.cjs +0 -1
  210. package/dist/adapters/AreaChart.config-Bmj24k3G.cjs +0 -1
  211. package/dist/adapters/AreaChart.config-DqJvquc-.js +0 -2
  212. package/dist/adapters/BarChart.config-CzGxsUq-.js +0 -2
  213. package/dist/adapters/BarChart.config-D1uQGV6T.cjs +0 -1
  214. package/dist/adapters/BoxPlotChart.config-I0S4-aNF.js +0 -2
  215. package/dist/adapters/BoxPlotChart.config-wfS4FxGI.cjs +0 -1
  216. package/dist/adapters/BubbleChart.config-BDSknEkc.js +0 -2
  217. package/dist/adapters/BubbleChart.config-CByvW3Rq.cjs +0 -1
  218. package/dist/adapters/CandlestickChart.config-08gqS1xj.cjs +0 -1
  219. package/dist/adapters/CandlestickChart.config-Bkr9bdwM.js +0 -2
  220. package/dist/adapters/DataTable.config-BFP6xnMc.cjs +0 -1
  221. package/dist/adapters/DataTable.config-DHYD7PA8.js +0 -2
  222. package/dist/adapters/DotStripChart.config-DRQybZZu.cjs +0 -1
  223. package/dist/adapters/DotStripChart.config-Sp0fOxfM.js +0 -2
  224. package/dist/adapters/FunnelChart.config-ByARozX6.cjs +0 -1
  225. package/dist/adapters/FunnelChart.config-DhCqap3P.js +0 -2
  226. package/dist/adapters/GaugeChart.config-CfRicB1o.cjs +0 -1
  227. package/dist/adapters/GaugeChart.config-PTQ85WM5.js +0 -2
  228. package/dist/adapters/HeatMapChart.config-0tmGHwm2.cjs +0 -1
  229. package/dist/adapters/HeatMapChart.config-Devz5A5U.js +0 -2
  230. package/dist/adapters/KpiDelta.config-CGTdddOM.js +0 -2
  231. package/dist/adapters/KpiDelta.config-CjWmwXjk.cjs +0 -1
  232. package/dist/adapters/KpiNumber.config-Cd4jw22d.cjs +0 -1
  233. package/dist/adapters/KpiNumber.config-D3Et71Zn.js +0 -2
  234. package/dist/adapters/KpiText.config-B9VATPy2.js +0 -2
  235. package/dist/adapters/KpiText.config-B_dkrdHj.cjs +0 -1
  236. package/dist/adapters/LineChart.config-C3p-mc15.cjs +0 -1
  237. package/dist/adapters/LineChart.config-DXWLMWjn.js +0 -2
  238. package/dist/adapters/MarkdownChart.config-BQGmd6Iz.js +0 -2
  239. package/dist/adapters/MarkdownChart.config-CQFu4297.cjs +0 -1
  240. package/dist/adapters/MeasureProfileChart.config-CXLeprVS.js +0 -2
  241. package/dist/adapters/MeasureProfileChart.config-KpfD016N.cjs +0 -1
  242. package/dist/adapters/PieChart.config-j-syrhBx.js +0 -2
  243. package/dist/adapters/PieChart.config-zzBPh0tx.cjs +0 -1
  244. package/dist/adapters/ProportionBarChart.config-BD9bf-LZ.js +0 -2
  245. package/dist/adapters/ProportionBarChart.config-CBLcLV4Z.cjs +0 -1
  246. package/dist/adapters/RadarChart.config-CW9f_VxU.cjs +0 -1
  247. package/dist/adapters/RadarChart.config-yKvcZ49V.js +0 -2
  248. package/dist/adapters/RadialBarChart.config-DwQYejI6.cjs +0 -1
  249. package/dist/adapters/RadialBarChart.config-xK4AyoOF.js +0 -2
  250. package/dist/adapters/RecordsTable.config-CquV7Wi0.js +0 -2
  251. package/dist/adapters/RecordsTable.config-DzrQXBvh.cjs +0 -1
  252. package/dist/adapters/RetentionCombinedChart.config-BYAFkFb-.cjs +0 -1
  253. package/dist/adapters/RetentionCombinedChart.config-Ddmb-WwM.js +0 -2
  254. package/dist/adapters/RetentionHeatmap.config-CSHXD736.cjs +0 -1
  255. package/dist/adapters/RetentionHeatmap.config-DODcy3gK.js +0 -2
  256. package/dist/adapters/SankeyChart.config-B56o6GFu.js +0 -2
  257. package/dist/adapters/SankeyChart.config-DLnhr2k_.cjs +0 -1
  258. package/dist/adapters/ScatterChart.config-CrIFaC-s.js +0 -2
  259. package/dist/adapters/ScatterChart.config-Dfj1_af-.cjs +0 -1
  260. package/dist/adapters/SunburstChart.config-CuLsLj6v.cjs +0 -1
  261. package/dist/adapters/SunburstChart.config-CvuVUfkp.js +0 -2
  262. package/dist/adapters/TreeMapChart.config-CvbDr1Ic.js +0 -2
  263. package/dist/adapters/TreeMapChart.config-Dqjhe8Xk.cjs +0 -1
  264. package/dist/adapters/WaterfallChart.config-DXFeGg7P.cjs +0 -1
  265. package/dist/adapters/WaterfallChart.config-MLHPNE5q.js +0 -2
  266. package/dist/adapters/compiler-C5OSdfwn.cjs +0 -166
  267. package/dist/adapters/mcp-app-html-DRWnkcx4.cjs +0 -1
  268. package/dist/adapters/openai-CwKv0DD-.cjs +0 -19
  269. package/dist/adapters/utils-BFGzuSlF.cjs +0 -132
  270. package/dist/client/chunks/DashboardEditModal-USQFytJw.js.map +0 -1
  271. package/dist/client/chunks/analysis-builder-shared-BSINKFr2.js.map +0 -1
  272. package/dist/client/chunks/chart-activity-grid-CSIsJ12e.js.map +0 -1
  273. package/dist/client/chunks/chart-data-table-BH1A-1RN.js.map +0 -1
  274. package/dist/client/chunks/charts-loader-BlxEsp39.js +0 -87
  275. package/dist/server/openai-C6tdx3yN.cjs +0 -19
@@ -1 +0,0 @@
1
- {"version":3,"file":"chart-data-table-BH1A-1RN.js","names":["React","isServer","getDefaultState","React","React","React","getIconData","host","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data","data"],"sources":["../../../src/client/charts/chartConfigs.ts","../../../src/client/charts/chartRegistry.ts","../../../src/client/charts/lazyChartConfigRegistry.ts","../../../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js","../../../node_modules/@tanstack/query-core/build/modern/timeoutManager.js","../../../node_modules/@tanstack/query-core/build/modern/utils.js","../../../node_modules/@tanstack/query-core/build/modern/environmentManager.js","../../../node_modules/@tanstack/query-core/build/modern/subscribable.js","../../../node_modules/@tanstack/query-core/build/modern/focusManager.js","../../../node_modules/@tanstack/query-core/build/modern/notifyManager.js","../../../node_modules/@tanstack/query-core/build/modern/onlineManager.js","../../../node_modules/@tanstack/query-core/build/modern/retryer.js","../../../node_modules/@tanstack/query-core/build/modern/removable.js","../../../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../../../node_modules/@tanstack/query-core/build/modern/query.js","../../../node_modules/@tanstack/query-core/build/modern/queryObserver.js","../../../node_modules/@tanstack/query-core/build/modern/mutation.js","../../../node_modules/@tanstack/query-core/build/modern/mutationCache.js","../../../node_modules/@tanstack/query-core/build/modern/queryCache.js","../../../node_modules/@tanstack/query-core/build/modern/queryClient.js","../../../node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js","../../../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../../../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../../../node_modules/@tanstack/react-query/build/modern/suspense.js","../../../node_modules/@tanstack/react-query/build/modern/useBaseQuery.js","../../../node_modules/@tanstack/react-query/build/modern/useQuery.js","../../../src/client/client/CubeClient.ts","../../../src/client/client/BatchCoordinator.ts","../../../src/client/providers/CubeApiProvider.tsx","../../../src/client/hooks/queries/useCubeMetaQuery.ts","../../../src/client/utils/thumbnail.ts","../../../src/client/utils/exportXlsx.ts","../../../src/client/providers/CubeFeaturesProvider.tsx","../../../node_modules/@iconify/react/dist/iconify.js","../../../node_modules/@iconify-icons/heroicons-outline/data/x/x-mark.js","../../../node_modules/@iconify-icons/heroicons-outline/data/p/plus.js","../../../node_modules/@iconify-icons/heroicons-outline/data/p/pencil.js","../../../node_modules/@iconify-icons/heroicons-outline/data/t/trash.js","../../../node_modules/@iconify-icons/heroicons-outline/data/a/arrow-path.js","../../../node_modules/@iconify-icons/heroicons-outline/data/c/clipboard-document.js","../../../node_modules/@iconify-icons/heroicons-outline/data/d/document-duplicate.js","../../../node_modules/@iconify-icons/heroicons-outline/data/c/cog.js","../../../node_modules/@iconify-icons/heroicons-outline/data/f/funnel.js","../../../node_modules/@iconify-icons/heroicons-outline/data/s/share.js","../../../node_modules/@iconify-icons/heroicons-outline/data/c/chevron-up.js","../../../node_modules/@iconify-icons/heroicons-outline/data/c/chevron-down.js","../../../node_modules/@iconify-icons/heroicons-outline/data/c/chevron-left.js","../../../node_modules/@iconify-icons/heroicons-outline/data/c/chevron-right.js","../../../node_modules/@iconify-icons/heroicons-outline/data/m/magnifying-glass.js","../../../node_modules/@iconify-icons/heroicons-outline/data/b/bars-3.js","../../../node_modules/@iconify-icons/heroicons-outline/data/c/check-circle.js","../../../node_modules/@iconify-icons/heroicons-outline/data/e/exclaimation-triangle.js","../../../node_modules/@iconify-icons/heroicons-outline/data/e/exclamation-circle.js","../../../node_modules/@iconify-icons/heroicons-outline/data/s/sparkles.js","../../../node_modules/@iconify-icons/heroicons-outline/data/e/eye.js","../../../node_modules/@iconify-icons/heroicons-outline/data/e/eye-slash.js","../../../node_modules/@iconify-icons/heroicons-outline/data/a/adjustments-horizontal.js","../../../node_modules/@iconify-icons/heroicons-outline/data/c/computer-desktop.js","../../../node_modules/@iconify-icons/heroicons-outline/data/t/table-cells.js","../../../node_modules/@iconify-icons/heroicons-outline/data/l/link.js","../../../node_modules/@iconify-icons/heroicons-outline/data/a/arrow-right.js","../../../node_modules/@iconify-icons/heroicons-outline/data/s/sun.js","../../../node_modules/@iconify-icons/heroicons-outline/data/m/moon.js","../../../node_modules/@iconify-icons/heroicons-outline/data/e/ellipsis-horizontal.js","../../../node_modules/@iconify-icons/heroicons-outline/data/d/document-text.js","../../../node_modules/@iconify-icons/heroicons-outline/data/b/book-open.js","../../../node_modules/@iconify-icons/heroicons-outline/data/c/code-bracket.js","../../../node_modules/@iconify-icons/heroicons-outline/data/s/swatch.js","../../../node_modules/@iconify-icons/heroicons-outline/data/c/camera.js","../../../node_modules/@iconify-icons/heroicons-outline/data/a/arrow-down-tray.js","../../../node_modules/@iconify-icons/heroicons-outline/data/a/arrow-up-tray.js","../../../node_modules/@iconify-icons/heroicons-solid/data/h/hand-thumb-up.js","../../../node_modules/@iconify-icons/heroicons-solid/data/h/hand-thumb-down.js","../../../node_modules/@iconify-icons/heroicons-solid/data/c/chart-bar.js","../../../node_modules/@iconify-icons/heroicons-solid/data/t/tag.js","../../../node_modules/@iconify-icons/heroicons-solid/data/c/calendar.js","../../../node_modules/@iconify-icons/heroicons-solid/data/r/rectangle-group.js","../../../node_modules/@iconify-icons/heroicons-solid/data/p/play.js","../../../node_modules/@iconify-icons/heroicons-solid/data/c/check.js","../../../node_modules/@iconify-icons/heroicons-solid/data/s/scale.js","../../../node_modules/@iconify-icons/heroicons-solid/data/a/arrow-down-circle.js","../../../node_modules/@iconify-icons/heroicons-solid/data/a/arrow-up-circle.js","../../../node_modules/@iconify-icons/heroicons-solid/data/a/arrow-trending-up.js","../../../node_modules/@iconify-icons/heroicons-solid/data/b/beaker.js","../../../node_modules/@iconify-icons/heroicons-solid/data/b/bars-3-bottom-left.js","../../../node_modules/@iconify-icons/heroicons-solid/data/f/finger-print.js","../../../node_modules/@iconify-icons/heroicons-solid/data/c/chart-bar-square.js","../../../node_modules/@iconify-icons/heroicons-solid/data/p/plus-circle.js","../../../node_modules/@iconify-icons/heroicons-solid/data/h/hashtag.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-bar.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-line.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-area-line.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-pie.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-dots-2.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-dots-3.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-bubble.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-radar.js","../../../node_modules/@iconify-icons/tabler/data/r/radar-2.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-treemap.js","../../../node_modules/@iconify-icons/tabler/data/l/list-details.js","../../../node_modules/@iconify-icons/tabler/data/l/layout-distribute-horizontal.js","../../../src/client/icons/customIcons.ts","../../../node_modules/@iconify-icons/tabler/data/c/chart-donut-4.js","../../../node_modules/@iconify-icons/tabler/data/t/table.js","../../../node_modules/@iconify-icons/tabler/data/c/calendar-stats.js","../../../node_modules/@iconify-icons/tabler/data/n/number.js","../../../node_modules/@iconify-icons/tabler/data/t/trending-up.js","../../../node_modules/@iconify-icons/tabler/data/t/typography.js","../../../node_modules/@iconify-icons/tabler/data/f/file-text.js","../../../node_modules/@iconify-icons/tabler/data/i/info-circle.js","../../../node_modules/@iconify-icons/tabler/data/s/selector.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-grid-dots.js","../../../node_modules/@iconify-icons/tabler/data/b/box-padding.js","../../../node_modules/@iconify-icons/tabler/data/s/stairs.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-candle.js","../../../node_modules/@iconify-icons/tabler/data/c/chart-arrows-vertical.js","../../../node_modules/@iconify-icons/tabler/data/g/gauge.js","../../../node_modules/@iconify-icons/heroicons-outline/data/m/map.js","../../../node_modules/@iconify-icons/heroicons-outline/data/c/cube.js","../../../src/client/icons/defaultIcons.ts","../../../src/client/icons/registry.tsx","../../../src/client/components/charts/MissingDependencyFallback.tsx","../../../src/client/charts/chartComponentRegistry.tsx","../../../src/client/providers/CubeMetaProvider.tsx","../../../src/client/components/charts/RecordsTable.config.ts","../../../src/client/components/charts/RetentionHeatmap.config.ts","../../../src/client/components/charts/RetentionCombinedChart.config.ts","../../../src/client/components/charts/DotStripChart.config.ts","../../../src/client/components/charts/ProportionBarChart.config.ts","../../../src/client/charts/chartConfigRegistry.ts","../../../src/client/charts/chartPlugin.ts","../../../src/client/providers/CubeProvider.tsx","../../../src/client/utils/pivotUtils.ts","../../../src/client/components/charts/DataTable.tsx"],"sourcesContent":["\n/**\n * Configuration for a single axis drop zone in the chart configuration UI\n */\nexport interface AxisDropZoneConfig {\n /** The key to store this field in chartConfig (e.g., 'xAxis', 'yAxis', 'sizeField') */\n key: string\n\n /** Display label for the drop zone */\n label: string\n\n /** Optional description/help text shown below the label */\n description?: string\n\n /** Whether at least one field is required in this drop zone */\n mandatory?: boolean\n\n /** Maximum number of items allowed in this drop zone */\n maxItems?: number\n\n /** Which field types this drop zone accepts */\n acceptTypes?: ('dimension' | 'timeDimension' | 'measure')[]\n\n /** Placeholder text when drop zone is empty */\n emptyText?: string\n\n /** Enable L/R axis toggle for items in this drop zone (for dual Y-axis support) */\n enableDualAxis?: boolean\n\n /**\n * Keep this zone out of automatic chart-config inference (the agent's\n * `inferChartConfig`). For zones whose meaning is subtractive or opt-in — the\n * records table's hidden columns being the case in point — filling them from\n * the query changes what renders rather than completing a partial config.\n */\n excludeFromInference?: boolean\n}\n\n/**\n * Configuration for a single display option\n */\nexport interface DisplayOptionConfig {\n /** The key to store this field in displayConfig */\n key: string\n \n /** Display label for the option */\n label: string\n \n /** Type of input control to render */\n type: 'boolean' | 'string' | 'number' | 'select' | 'color' | 'paletteColor' | 'axisFormat' | 'stringArray' | 'buttonGroup' | 'thresholdBands' | 'columnFormats' | 'rowLink'\n \n /** Default value for the option */\n defaultValue?: any\n \n /** Placeholder text for string/number inputs */\n placeholder?: string\n \n /** Options for select type */\n options?: Array<{ value: any; label: string }>\n \n /**\n * Which tab the option belongs on. Defaults to `display`.\n *\n * The Chart tab exists to answer \"what feeds this chart\", which for most\n * types is the axis drop zones. A content-first chart has no zones, and its\n * equivalent input is a display option — markdown's `content` being the case\n * in point, which is its whole substance and wants the room. Marking it\n * `chart` moves it there rather than leaving the tab empty and the editor\n * squeezed into a sidebar.\n */\n placement?: 'chart' | 'display'\n\n /** Help text shown below the input */\n description?: string\n\n /** Visible rows for a string option's textarea. Defaults to 8. */\n rows?: number\n\n /**\n * Render a string option with syntax highlighting rather than as a plain\n * textarea. Only `markdownTemplate` exists, colouring `{{ }}` expressions,\n * `{% %}` tags and markdown headings.\n */\n syntax?: 'markdownTemplate'\n\n /**\n * External reference for options whose full syntax cannot fit in help text.\n * Rendered as a link after the description, so the panel can stay short\n * instead of restating a whole template language badly.\n */\n docsUrl?: string\n\n /** Label for the `docsUrl` link — a translation key, like `label`. */\n docsLabel?: string\n\n /** Minimum value for number inputs */\n min?: number\n \n /** Maximum value for number inputs */\n max?: number\n \n /** Step value for number inputs */\n step?: number\n}\n\n/**\n * Split display options by which tab renders them.\n *\n * Shared by the Chart and Display panels so the two cannot disagree and leave\n * an option shown twice or not at all.\n */\nexport function optionsForPlacement(\n options: DisplayOptionConfig[] | undefined,\n placement: 'chart' | 'display'\n): DisplayOptionConfig[] {\n return (options ?? []).filter((option) => (option.placement ?? 'display') === placement)\n}\n\n/**\n * Whether a chart type can be rendered with the current query shape.\n * Each chart's .config.ts declares its own `isAvailable` to keep requirements\n * co-located with the chart itself (rather than in a central switch).\n */\nexport interface ChartAvailability {\n /** Whether the chart type can be used with the current selections */\n available: boolean\n /** Translation key explaining why the chart is unavailable (for tooltip) */\n reason?: string\n}\n\n/**\n * Snapshot of the current query shape passed to each chart's `isAvailable`.\n */\nexport interface ChartAvailabilityContext {\n /** Number of measures selected */\n measureCount: number\n /**\n * Number of dimension-like breakdowns (regular dimensions + time dimensions).\n * A time dimension can serve any role a regular dimension does (categories,\n * axes, heatmap rows/columns, pie slices, etc.), so they are counted together.\n */\n dimensionCount: number\n /**\n * Number of time dimensions specifically. Only needed by charts that *require*\n * a time dimension (e.g. activityGrid).\n */\n timeDimensionCount: number\n}\n\n/**\n * Configuration for which elements in a chart support clicking (for drill-down)\n */\nexport interface ClickableElementsConfig {\n /** Bars in bar charts */\n bar?: boolean\n /** Points/dots in line/scatter charts */\n point?: boolean\n /** Slices in pie/donut charts */\n slice?: boolean\n /** Cells in heatmaps */\n cell?: boolean\n /** Nodes in treemaps, sankey diagrams */\n node?: boolean\n /** Areas in area charts */\n area?: boolean\n /** Rows in data tables */\n row?: boolean\n}\n\n/**\n * Complete configuration for a chart type\n */\nexport interface ChartTypeConfig {\n /** Display label for the chart type in the picker (e.g., 'Bar Chart', 'KPI Number') */\n label?: string\n\n /** Configuration for each drop zone */\n dropZones: AxisDropZoneConfig[]\n\n /** Simple display options (backward compatibility) - rendered as boolean checkboxes */\n displayOptions?: string[]\n\n /** Structured display options with metadata for different input types */\n displayOptionsConfig?: DisplayOptionConfig[]\n\n /** Optional custom validation function */\n validate?: (config: any) => { isValid: boolean; message?: string }\n\n /** Brief description of the chart */\n description?: string\n\n /** When to use this chart type */\n useCase?: string\n\n /** Whether this chart type skips query requirements (for content-based charts like markdown) */\n skipQuery?: boolean\n\n /** Configuration for which elements support clicking (for drill-down) */\n clickableElements?: ClickableElementsConfig\n\n /**\n * Whether this chart type can render with the given query shape.\n * Omit to mean \"always available\".\n */\n isAvailable?: (ctx: ChartAvailabilityContext) => ChartAvailability\n\n /**\n * This chart lists individual records rather than aggregates, so the query\n * built for it must be `ungrouped`.\n *\n * Declared here rather than switched on a chart type inside the query\n * builders, and read from the eager registry so those stay data-driven — and\n * so a custom chart can opt in through the same flag.\n */\n recordGrain?: boolean\n}\n\n/**\n * Registry of all chart type configurations\n */\nexport interface ChartConfigRegistry {\n [chartType: string]: ChartTypeConfig\n}\n\n/**\n * Default configuration for charts without specific requirements\n */\nexport const defaultChartConfig: ChartTypeConfig = {\n dropZones: [\n {\n key: 'xAxis',\n label: 'chart.dropZone.xAxis.label',\n description: 'chart.dropZone.xAxis.description',\n mandatory: false,\n acceptTypes: ['dimension', 'timeDimension'],\n emptyText: 'chart.dropZone.xAxis.empty'\n },\n {\n key: 'yAxis',\n label: 'chart.dropZone.yAxis.label',\n description: 'chart.dropZone.yAxis.description',\n mandatory: false,\n acceptTypes: ['measure', 'dimension'],\n emptyText: 'chart.dropZone.yAxis.empty'\n },\n {\n key: 'series',\n label: 'chart.dropZone.series.label',\n description: 'chart.dropZone.series.description',\n mandatory: false,\n acceptTypes: ['dimension'],\n emptyText: 'chart.dropZone.series.empty'\n }\n ],\n displayOptions: ['showLegend', 'showGrid', 'showTooltip']\n}\n\n/**\n * Helper function to get configuration for a chart type\n */\nexport function getChartConfig(chartType: string, registry: ChartConfigRegistry): ChartTypeConfig {\n return registry[chartType] || defaultChartConfig\n}","/**\n * Unified Chart Registry — the single source of truth for a chart type.\n *\n * Historically, adding a chart required coordinated edits across four central\n * registries (eager config, lazy config, the loader, the icon map) plus the\n * per-chart component/config/helper/icon files, with the same dynamic-import\n * path repeated three times. A typo in one failed silently.\n *\n * `chartRegistry` collapses that into one entry per chart. The eager config\n * registry, the lazy config registry, the icon lookup, and the dependency lookup\n * are all **derived** from this map — each chart's import path is declared once.\n * Custom (plugin) charts register through the same `ChartRegistryEntry` shape\n * (see `getChartEntry` / `registerCustomChartEntry`), so built-in and custom\n * charts flow through one path.\n *\n * Client/server boundary: this module is DOM-free so the server agent and the\n * eager config registry can import it. The React **component** thunk (which\n * pulls recharts / ChartContainer / DOM globals) is a client-only concern and\n * lives in the loader's component map — NOT here. Lazy loading is purely a\n * client optimisation; server/MCP/agent code reads the eager config directly.\n */\n\nimport type { ComponentType } from 'react'\nimport type { BuiltInChartType } from '../types.js'\nimport type { IconName, IconProps } from '../icons/types.js'\nimport type {\n ChartTypeConfig,\n ChartAvailabilityContext,\n ChartAvailability,\n} from './chartConfigs.js'\nimport { requiresMeasureAndDimension, requiresMeasure } from './chartConfigHelpers.js'\n\nconst RECHARTS_DEP = { packageName: 'recharts', installCommand: 'npm install recharts' }\n\n/**\n * The single source of truth for one chart type's DOM-free metadata: the eager\n * picker fields, the lazy config thunk, the icon name, and dependency info.\n *\n * The React component thunk is deliberately NOT part of the entry — it is the\n * one DOM-bearing piece and is owned by the client loader, keeping this entry\n * (and its consumers, incl. the server agent) free of the chart component graph.\n */\nexport interface ChartRegistryEntry {\n /** Display label for the picker — an i18n key, resolved at render time. */\n label: string\n /**\n * The chart's icon. Built-ins use an `IconName` resolved via the icon registry\n * (override-able via registerIcons/setIcon). Plugins may instead supply a\n * ready-made icon component — both flow through the same entry field so custom\n * and built-in charts resolve their icon along one path.\n */\n icon: IconName | ComponentType<IconProps>\n /** Brief description — i18n key. */\n description?: string\n /** When to use this chart — i18n key. */\n useCase?: string\n /** Whether the chart can render with the current query shape. */\n isAvailable?: (ctx: ChartAvailabilityContext) => ChartAvailability\n /** Optional peer dependency — shows install instructions if the import fails. */\n dependencies?: { packageName: string; installCommand: string }\n /** Lazy config import — resolves the config OBJECT directly (client lazy path). */\n config: () => Promise<ChartTypeConfig>\n}\n\n/**\n * The unified registry — one entry per built-in chart type, the single source of\n * truth for its DOM-free metadata. The eager config registry, the lazy config\n * registry, the icon lookup, and the dependency lookup all derive from this map.\n *\n * Adding a chart is now one entry here plus its component/config files.\n */\nexport const chartRegistry: Record<BuiltInChartType, ChartRegistryEntry> = {\n bar: {\n label: 'chart.bar.label',\n icon: 'chartBar',\n description: 'chart.bar.description',\n useCase: 'chart.bar.useCase',\n isAvailable: requiresMeasureAndDimension,\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/BarChart.config.js')).barChartConfig,\n },\n line: {\n label: 'chart.line.label',\n icon: 'chartLine',\n description: 'chart.line.description',\n useCase: 'chart.line.useCase',\n isAvailable: requiresMeasureAndDimension,\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/LineChart.config.js')).lineChartConfig,\n },\n area: {\n label: 'chart.area.label',\n icon: 'chartArea',\n description: 'chart.area.description',\n useCase: 'chart.area.useCase',\n isAvailable: requiresMeasureAndDimension,\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/AreaChart.config.js')).areaChartConfig,\n },\n pie: {\n label: 'chart.pie.label',\n icon: 'chartPie',\n description: 'chart.pie.description',\n useCase: 'chart.pie.useCase',\n isAvailable: requiresMeasureAndDimension,\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/PieChart.config.js')).pieChartConfig,\n },\n scatter: {\n label: 'chart.scatter.label',\n icon: 'chartScatter',\n description: 'chart.scatter.description',\n useCase: 'chart.scatter.useCase',\n isAvailable: ({ measureCount, dimensionCount }) => {\n if (measureCount < 1) return { available: false, reason: 'chart.availability.requiresMeasure' }\n // Scatter needs either 2 measures, or 1 measure + 1 dimension\n if (measureCount < 2 && dimensionCount < 1) {\n return { available: false, reason: 'chart.availability.scatter' }\n }\n return { available: true }\n },\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/ScatterChart.config.js')).scatterChartConfig,\n },\n bubble: {\n label: 'chart.bubble.label',\n icon: 'chartBubble',\n description: 'chart.bubble.description',\n useCase: 'chart.bubble.useCase',\n isAvailable: ({ measureCount, dimensionCount }) => {\n if (measureCount < 2) return { available: false, reason: 'chart.availability.requiresTwoMeasures' }\n if (dimensionCount < 1) return { available: false, reason: 'chart.availability.bubble' }\n return { available: true }\n },\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/BubbleChart.config.js')).bubbleChartConfig,\n },\n radar: {\n label: 'chart.radar.label',\n icon: 'chartRadar',\n description: 'chart.radar.description',\n useCase: 'chart.radar.useCase',\n isAvailable: requiresMeasureAndDimension,\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/RadarChart.config.js')).radarChartConfig,\n },\n radialBar: {\n label: 'chart.radialBar.label',\n icon: 'chartRadialBar',\n description: 'chart.radialBar.description',\n useCase: 'chart.radialBar.useCase',\n isAvailable: requiresMeasureAndDimension,\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/RadialBarChart.config.js')).radialBarChartConfig,\n },\n treemap: {\n label: 'chart.treemap.label',\n icon: 'chartTreemap',\n description: 'chart.treemap.description',\n useCase: 'chart.treemap.useCase',\n isAvailable: requiresMeasureAndDimension,\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/TreeMapChart.config.js')).treemapChartConfig,\n },\n table: {\n label: 'chart.table.label',\n icon: 'chartTable',\n description: 'chart.table.description',\n useCase: 'chart.table.useCase',\n config: async () => (await import('../components/charts/DataTable.config.js')).dataTableConfig,\n },\n recordsTable: {\n label: 'chart.recordsTable.label',\n icon: 'chartRecordsTable',\n description: 'chart.recordsTable.description',\n useCase: 'chart.recordsTable.useCase',\n config: async () => (await import('../components/charts/RecordsTable.config.js')).recordsTableConfig,\n },\n activityGrid: {\n label: 'chart.activityGrid.label',\n icon: 'chartActivityGrid',\n description: 'chart.activityGrid.description',\n useCase: 'chart.activityGrid.useCase',\n isAvailable: ({ measureCount, timeDimensionCount }) => {\n if (measureCount < 1) return { available: false, reason: 'chart.availability.requiresMeasure' }\n if (timeDimensionCount < 1) return { available: false, reason: 'chart.availability.requiresTimeDimension' }\n return { available: true }\n },\n config: async () => (await import('../components/charts/ActivityGridChart.config.js')).activityGridChartConfig,\n },\n kpiNumber: {\n label: 'chart.kpiNumber.label',\n icon: 'chartKpiNumber',\n description: 'chart.kpiNumber.description',\n useCase: 'chart.kpiNumber.useCase',\n isAvailable: requiresMeasure,\n config: async () => (await import('../components/charts/KpiNumber.config.js')).kpiNumberConfig,\n },\n kpiDelta: {\n label: 'chart.kpiDelta.label',\n icon: 'chartKpiDelta',\n description: 'chart.kpiDelta.description',\n useCase: 'chart.kpiDelta.useCase',\n isAvailable: requiresMeasureAndDimension,\n config: async () => (await import('../components/charts/KpiDelta.config.js')).kpiDeltaConfig,\n },\n kpiText: {\n label: 'chart.kpiText.label',\n icon: 'chartKpiText',\n description: 'chart.kpiText.description',\n useCase: 'chart.kpiText.useCase',\n isAvailable: requiresMeasure,\n config: async () => (await import('../components/charts/KpiText.config.js')).kpiTextConfig,\n },\n markdown: {\n label: 'chart.markdown.label',\n icon: 'chartMarkdown',\n description: 'chart.markdown.description',\n useCase: 'chart.markdown.useCase',\n config: async () => (await import('../components/charts/MarkdownChart.config.js')).markdownConfig,\n },\n funnel: {\n label: 'chart.funnel.label',\n icon: 'chartFunnel',\n description: 'chart.funnel.description',\n useCase: 'chart.funnel.useCase',\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/FunnelChart.config.js')).funnelChartConfig,\n },\n sankey: {\n label: 'chart.sankey.label',\n icon: 'chartSankey',\n description: 'chart.sankey.description',\n useCase: 'chart.sankey.useCase',\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/SankeyChart.config.js')).sankeyChartConfig,\n },\n sunburst: {\n label: 'chart.sunburst.label',\n icon: 'chartSunburst',\n description: 'chart.sunburst.description',\n useCase: 'chart.sunburst.useCase',\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/SunburstChart.config.js')).sunburstChartConfig,\n },\n heatmap: {\n label: 'chart.heatmap.label',\n icon: 'chartHeatmap',\n description: 'chart.heatmap.description',\n useCase: 'chart.heatmap.useCase',\n isAvailable: ({ measureCount, dimensionCount }) => {\n if (measureCount < 1) return { available: false, reason: 'chart.availability.requiresMeasure' }\n if (dimensionCount < 2) return { available: false, reason: 'chart.availability.requiresTwoDimensions' }\n return { available: true }\n },\n dependencies: { packageName: '@nivo/heatmap', installCommand: 'npm install @nivo/heatmap' },\n config: async () => (await import('../components/charts/HeatMapChart.config.js')).heatmapChartConfig,\n },\n retentionHeatmap: {\n label: 'chart.retentionHeatmap.label',\n icon: 'chartRetention',\n description: 'chart.retentionHeatmap.description',\n useCase: 'chart.retentionHeatmap.useCase',\n config: async () => (await import('../components/charts/RetentionHeatmap.config.js')).retentionHeatmapConfig,\n },\n retentionCombined: {\n label: 'chart.retentionCombined.label',\n icon: 'chartRetention',\n description: 'chart.retentionCombined.description',\n useCase: 'chart.retentionCombined.useCase',\n config: async () => (await import('../components/charts/RetentionCombinedChart.config.js')).retentionCombinedConfig,\n },\n boxPlot: {\n label: 'chart.boxPlot.label',\n icon: 'chartBoxPlot',\n description: 'chart.boxPlot.description',\n useCase: 'chart.boxPlot.useCase',\n isAvailable: requiresMeasureAndDimension,\n config: async () => (await import('../components/charts/BoxPlotChart.config.js')).boxPlotChartConfig,\n },\n dotStrip: {\n label: 'chart.dotStrip.label',\n icon: 'chartDotStrip',\n description: 'chart.dotStrip.description',\n useCase: 'chart.dotStrip.useCase',\n isAvailable: requiresMeasureAndDimension,\n config: async () => (await import('../components/charts/DotStripChart.config.js')).dotStripChartConfig,\n },\n waterfall: {\n label: 'chart.waterfall.label',\n icon: 'chartWaterfall',\n description: 'chart.waterfall.description',\n useCase: 'chart.waterfall.useCase',\n isAvailable: requiresMeasureAndDimension,\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/WaterfallChart.config.js')).waterfallChartConfig,\n },\n candlestick: {\n label: 'chart.candlestick.label',\n icon: 'chartCandlestick',\n description: 'chart.candlestick.description',\n useCase: 'chart.candlestick.useCase',\n isAvailable: ({ measureCount, dimensionCount }) => {\n if (measureCount < 2) return { available: false, reason: 'chart.availability.requiresTwoMeasures' }\n if (dimensionCount < 1) return { available: false, reason: 'chart.availability.requiresDimension' }\n return { available: true }\n },\n config: async () => (await import('../components/charts/CandlestickChart.config.js')).candlestickChartConfig,\n },\n measureProfile: {\n label: 'chart.measureProfile.label',\n icon: 'chartMeasureProfile',\n description: 'chart.measureProfile.description',\n useCase: 'chart.measureProfile.useCase',\n isAvailable: ({ measureCount }) => {\n if (measureCount < 2) return { available: false, reason: 'chart.availability.requiresTwoMeasures' }\n return { available: true }\n },\n dependencies: RECHARTS_DEP,\n config: async () => (await import('../components/charts/MeasureProfileChart.config.js')).measureProfileChartConfig,\n },\n proportionBar: {\n label: 'chart.proportionBar.label',\n icon: 'chartProportionBar',\n description: 'chart.proportionBar.description',\n useCase: 'chart.proportionBar.useCase',\n isAvailable: requiresMeasureAndDimension,\n config: async () => (await import('../components/charts/ProportionBarChart.config.js')).proportionBarChartConfig,\n },\n gauge: {\n label: 'chart.gauge.label',\n icon: 'chartGauge',\n description: 'chart.gauge.description',\n useCase: 'chart.gauge.useCase',\n isAvailable: requiresMeasure,\n dependencies: { packageName: 'd3-shape', installCommand: 'npm install d3-shape' },\n config: async () => (await import('../components/charts/GaugeChart.config.js')).gaugeChartConfig,\n },\n}\n\n/**\n * Custom (plugin) chart entries, keyed by chart type. Populated by the chart\n * plugin system via {@link registerCustomChartEntry}. Looked up *ahead* of the\n * built-in `chartRegistry` so a plugin overriding a built-in (e.g. `bar`) wins.\n */\nconst customChartEntries = new Map<string, ChartRegistryEntry>()\n\n/**\n * The single, unified chart-entry lookup. Custom plugin entries take precedence\n * over built-ins, so a plugin override of a built-in type resolves through the\n * same path. Returns `undefined` for unknown types.\n *\n * Every entry-shaped consumer (icon resolution, dependency fallback, plugin\n * icon API) reads through this so built-in and custom charts flow as one.\n */\nexport function getChartEntry(chartType: string): ChartRegistryEntry | undefined {\n return customChartEntries.get(chartType) ?? chartRegistry[chartType as BuiltInChartType]\n}\n\n/** Register a custom chart's entry (plugin system). */\nexport function registerCustomChartEntry(chartType: string, entry: ChartRegistryEntry): void {\n customChartEntries.set(chartType, entry)\n}\n\n/** Remove a custom chart's entry, falling back to the built-in if one exists. */\nexport function unregisterCustomChartEntry(chartType: string): void {\n customChartEntries.delete(chartType)\n}\n\n/** The custom entry for a type, if one is registered (no built-in fallback). */\nexport function getCustomChartEntry(chartType: string): ChartRegistryEntry | undefined {\n return customChartEntries.get(chartType)\n}\n\n// getChartTypeIcon() (in icons/registry) reads each chart's icon from its\n// unified entry via getChartEntry() — imported directly there, so icon\n// resolution does not depend on this module's init order.\n\n/**\n * Composes a migrated chart's full `ChartTypeConfig` from its entry: the entry's\n * metadata (its single declaration site) laid over the chart's config shape\n * (`base` — drop zones, display options, clickable elements, validation).\n *\n * Used by BOTH derivation paths so they return the same full shape as a\n * non-migrated chart's `*.config.ts`:\n * - eager `chartConfigRegistry` (server/full source — read synchronously for the\n * picker AND by the server agent's chart validation + tool guidance), with\n * `base` = the statically-imported config;\n * - lazy `getChartConfigAsync` (client code-split path), with `base` = the\n * config resolved from the entry's `config` thunk.\n */\nexport function composeChartConfig(entry: ChartRegistryEntry, base: ChartTypeConfig): ChartTypeConfig {\n return {\n ...base,\n label: entry.label,\n description: entry.description,\n useCase: entry.useCase,\n isAvailable: entry.isAvailable,\n }\n}\n","/**\n * Lazy Chart Config Registry\n *\n * Provides async loading for chart configurations.\n * This enables code splitting - each chart config loads only when needed.\n */\n\nimport { useState, useEffect } from 'react'\nimport type { ChartType } from '../types.js'\nimport type { ChartTypeConfig, ChartConfigRegistry } from './chartConfigs.js'\nimport { defaultChartConfig } from './chartConfigs.js'\nimport { chartRegistry, getChartEntry, composeChartConfig } from './chartRegistry.js'\n\n// Cache for loaded configs\nconst configCache = new Map<ChartType, ChartTypeConfig>()\n\n/**\n * Get a chart config asynchronously\n *\n * @param chartType The chart type to load config for\n * @returns The chart type config, or null if not found\n *\n * @example\n * ```typescript\n * const config = await getChartConfigAsync('bar')\n * console.log(config?.dropZones)\n * ```\n */\nexport async function getChartConfigAsync(chartType: ChartType): Promise<ChartTypeConfig | null> {\n // Check cache first (plugin overrides land here via registerConfigToCache —\n // their precedence stays ahead of the unified/legacy lookups below).\n if (configCache.has(chartType)) {\n return configCache.get(chartType)!\n }\n\n // Unified registry (custom-first): resolve the chart's config object via its\n // entry's `config` thunk, then compose the entry metadata over it so the lazy\n // public API returns the same full shape (label/description/useCase/isAvailable)\n // as the eager one. Using getChartEntry() means a registered plugin chart still\n // rehydrates here after the public clearChartConfigCache() drops its cache slot.\n const entry = getChartEntry(chartType)\n if (!entry) {\n return null\n }\n\n try {\n const base = await entry.config()\n if (base) {\n const config = composeChartConfig(entry, base)\n configCache.set(chartType, config)\n return config\n }\n return null\n } catch (error) {\n console.error(`Failed to load config for chart type: ${chartType}`, error)\n return null\n }\n}\n\n/**\n * Get a chart config synchronously from cache\n *\n * Returns the cached config if available, otherwise returns the default config.\n * Use this when you need sync access and have already preloaded the config.\n *\n * @param chartType The chart type to get config for\n * @returns The chart type config (from cache or default)\n */\nexport function getChartConfigSync(chartType: ChartType): ChartTypeConfig {\n return configCache.get(chartType) || defaultChartConfig\n}\n\n/**\n * Check if a chart config is already loaded\n */\nexport function isChartConfigLoaded(chartType: ChartType): boolean {\n return configCache.has(chartType)\n}\n\n/**\n * React hook for using chart config\n *\n * Loads the chart config asynchronously and caches it.\n * Returns the default config while loading.\n *\n * @param chartType The chart type to load config for\n * @returns Object with config, loading state, and loaded flag\n *\n * @example\n * ```tsx\n * function ChartSetup({ chartType }) {\n * const { config, loading } = useChartConfig(chartType)\n *\n * if (loading) return <Spinner />\n * return <ConfigForm config={config} />\n * }\n * ```\n */\nexport function useChartConfig(chartType: ChartType | undefined): {\n config: ChartTypeConfig\n loading: boolean\n loaded: boolean\n} {\n const [config, setConfig] = useState<ChartTypeConfig>(\n chartType ? getChartConfigSync(chartType) : defaultChartConfig\n )\n const [loading, setLoading] = useState(false)\n const [loaded, setLoaded] = useState(false)\n\n useEffect(() => {\n if (!chartType) {\n setConfig(defaultChartConfig)\n setLoaded(false)\n return\n }\n\n // Check cache synchronously first\n if (configCache.has(chartType)) {\n setConfig(configCache.get(chartType)!)\n setLoaded(true)\n return\n }\n\n // Load async\n setLoading(true)\n getChartConfigAsync(chartType)\n .then((loadedConfig) => {\n if (loadedConfig) {\n setConfig(loadedConfig)\n setLoaded(true)\n } else {\n setConfig(defaultChartConfig)\n setLoaded(true)\n }\n })\n .finally(() => setLoading(false))\n }, [chartType])\n\n return { config, loading, loaded }\n}\n\n/**\n * Preload a chart config\n *\n * Triggers the async import without needing to use the config immediately.\n * Useful for prefetching configs that will likely be needed.\n *\n * @param chartType The chart type to preload config for\n */\nexport async function preloadChartConfig(chartType: ChartType): Promise<void> {\n if (!configCache.has(chartType)) {\n await getChartConfigAsync(chartType)\n }\n}\n\n/**\n * Preload multiple chart configs\n *\n * @param chartTypes Array of chart types to preload\n */\nexport async function preloadChartConfigs(chartTypes: ChartType[]): Promise<void> {\n await Promise.all(chartTypes.map(preloadChartConfig))\n}\n\n/**\n * Load all chart configs and return as a registry\n *\n * Useful for SSR or when you need all configs upfront.\n * After calling this, all configs are cached and available synchronously.\n *\n * @returns Complete chart config registry\n *\n * @example\n * ```typescript\n * // On server or during initialization\n * const registry = await loadAllChartConfigs()\n * // Now all configs are cached and getChartConfigSync works for all types\n * ```\n */\nexport async function loadAllChartConfigs(): Promise<ChartConfigRegistry> {\n // Every built-in resolves through its chartRegistry entry.\n const chartTypes = Object.keys(chartRegistry) as ChartType[]\n await Promise.all(chartTypes.map(getChartConfigAsync))\n\n const registry: ChartConfigRegistry = {}\n for (const chartType of chartTypes) {\n const config = configCache.get(chartType)\n if (config) {\n registry[chartType] = config\n }\n }\n return registry\n}\n\n/**\n * Clear the config cache\n *\n * Useful for testing or when configs need to be reloaded.\n */\nexport function clearChartConfigCache(): void {\n configCache.clear()\n}\n\n/**\n * Register a custom chart config directly into the cache.\n * Used by the chart plugin system.\n */\nexport function registerConfigToCache(type: string, config: ChartTypeConfig): void {\n configCache.set(type as ChartType, config)\n}\n\n/**\n * Remove a custom chart config from the cache.\n * Used by the chart plugin system.\n */\nexport function unregisterConfigFromCache(type: string): void {\n configCache.delete(type as ChartType)\n}\n","\"use client\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/QueryClientProvider.tsx\n/**\n* The context that `useQueryClient` reads from. `QueryClientProvider` is the normal way to set it.\n*/\nconst QueryClientContext = React.createContext(void 0);\n/**\n* The `useQueryClient` hook returns the current `QueryClient` instance.\n*\n* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n* be used.\n* @returns The current `QueryClient` instance.\n* @throws If no `queryClient` argument is passed and no `QueryClientProvider` is found in the component tree.\n*/\nconst useQueryClient = (queryClient) => {\n\tconst client = React.useContext(QueryClientContext);\n\tif (queryClient) return queryClient;\n\tif (!client) throw new Error(\"No QueryClient set, use QueryClientProvider to set one\");\n\treturn client;\n};\n/**\n* Use the `QueryClientProvider` component to connect and provide a `QueryClient` to your application. Also\n* calls `client.mount()`/`client.unmount()` as this component mounts/unmounts, which subscribes the client to\n* focus/online events (resuming any paused mutations and refetching as needed when the app regains focus or\n* comes back online).\n*\n* @returns The provided `children`, wrapped so they can read the `QueryClient` via `useQueryClient`.\n*\n* @example\n* ```tsx\n* import { QueryClient, QueryClientProvider } from '@tanstack/react-query'\n*\n* const queryClient = new QueryClient()\n*\n* function App() {\n* return <QueryClientProvider client={queryClient}>...</QueryClientProvider>\n* }\n* ```\n*/\nconst QueryClientProvider = ({ client, children }) => {\n\tReact.useEffect(() => {\n\t\tclient.mount();\n\t\treturn () => {\n\t\t\tclient.unmount();\n\t\t};\n\t}, [client]);\n\treturn /* @__PURE__ */ jsx(QueryClientContext.Provider, {\n\t\tvalue: client,\n\t\tchildren\n\t});\n};\n//#endregion\nexport { QueryClientContext, QueryClientProvider, useQueryClient };\n\n//# sourceMappingURL=QueryClientProvider.js.map","//#region src/timeoutManager.ts\nconst defaultTimeoutProvider = {\n\tsetTimeout: (callback, delay) => setTimeout(callback, delay),\n\tclearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\tsetInterval: (callback, delay) => setInterval(callback, delay),\n\tclearInterval: (intervalId) => clearInterval(intervalId)\n};\n/**\n* Allows customization of how timeouts are created.\n*\n* @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n* and `gcTime`. The default TimeoutManager provider uses the platform's global\n* `setTimeout` implementation, which is known to have scalability issues with\n* thousands of timeouts on the event loop.\n*\n* If you hit this limitation, consider providing a custom TimeoutProvider that\n* coalesces timeouts.\n*/\nvar TimeoutManager = class {\n\t#provider = defaultTimeoutProvider;\n\t#providerCalled = false;\n\t/**\n\t* `setTimeoutProvider` can be used to set a custom implementation of the\n\t* `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions,\n\t* called a `TimeoutProvider`.\n\t*\n\t* This may be useful if you notice event loop performance issues with\n\t* thousands of queries. A custom TimeoutProvider could also support timer\n\t* delays longer than the global `setTimeout` maximum delay value of about\n\t* 24 days.\n\t*\n\t* It is important to call `setTimeoutProvider` before creating a\n\t* QueryClient or queries, so that the same provider is used consistently\n\t* for all timers in the application, since different TimeoutProviders\n\t* cannot cancel each others' timers.\n\t*\n\t* @example\n\t* ```ts\n\t* import { timeoutManager, QueryClient } from '@tanstack/query-core'\n\t* import { CustomTimeoutProvider } from './CustomTimeoutProvider'\n\t*\n\t* timeoutManager.setTimeoutProvider(new CustomTimeoutProvider())\n\t*\n\t* export const queryClient = new QueryClient()\n\t* ```\n\t*/\n\tsetTimeoutProvider(provider) {\n\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\tif (this.#providerCalled && provider !== this.#provider) console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, {\n\t\t\t\tprevious: this.#provider,\n\t\t\t\tprovider\n\t\t\t});\n\t\t}\n\t\tthis.#provider = provider;\n\t\tif (process.env.NODE_ENV !== \"production\") this.#providerCalled = false;\n\t}\n\t/**\n\t* `setTimeout` schedules a callback to run after approximately `delay`\n\t* milliseconds, like the global `setTimeout` function. The callback can be\n\t* canceled with `clearTimeout`.\n\t*\n\t* It returns a timer ID, which may be a number or an object that can be\n\t* coerced to a number via `Symbol.toPrimitive`.\n\t*\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const timeoutId = timeoutManager.setTimeout(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t*\n\t* const timeoutIdNumber: number = Number(timeoutId)\n\t* ```\n\t*/\n\tsetTimeout(callback, delay) {\n\t\tif (process.env.NODE_ENV !== \"production\") this.#providerCalled = true;\n\t\treturn this.#provider.setTimeout(callback, delay);\n\t}\n\t/**\n\t* `clearTimeout` cancels a timeout callback scheduled with `setTimeout`,\n\t* like the global `clearTimeout` function. It should be called with a\n\t* timer ID returned by `setTimeout`.\n\t*\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const timeoutId = timeoutManager.setTimeout(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t*\n\t* timeoutManager.clearTimeout(timeoutId)\n\t* ```\n\t*/\n\tclearTimeout(timeoutId) {\n\t\tthis.#provider.clearTimeout(timeoutId);\n\t}\n\t/**\n\t* `setInterval` schedules a callback to be called approximately every\n\t* `delay` milliseconds, like the global `setInterval` function.\n\t*\n\t* Like `setTimeout`, it returns a timer ID, which may be a number or an\n\t* object that can be coerced to a number via `Symbol.toPrimitive`.\n\t*\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const intervalId = timeoutManager.setInterval(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t* ```\n\t*/\n\tsetInterval(callback, delay) {\n\t\tif (process.env.NODE_ENV !== \"production\") this.#providerCalled = true;\n\t\treturn this.#provider.setInterval(callback, delay);\n\t}\n\t/**\n\t* `clearInterval` can be used to cancel an interval, like the global\n\t* `clearInterval` function. It should be called with an interval ID\n\t* returned by `setInterval`.\n\t*\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const intervalId = timeoutManager.setInterval(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t*\n\t* timeoutManager.clearInterval(intervalId)\n\t* ```\n\t*/\n\tclearInterval(intervalId) {\n\t\tthis.#provider.clearInterval(intervalId);\n\t}\n};\n/**\n* Singleton instance of {@link TimeoutManager}, used throughout TanStack Query to schedule and cancel timers.\n*/\nconst timeoutManager = new TimeoutManager();\n/**\n* In many cases code wants to delay to the next event loop tick; this is not\n* mediated by {@link timeoutManager}.\n*\n* This function is provided to make auditing the `tanstack/query-core` for\n* incorrect use of system `setTimeout` easier.\n*/\nfunction systemSetTimeoutZero(callback) {\n\tsetTimeout(callback, 0);\n}\n//#endregion\nexport { TimeoutManager, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager };\n\n//# sourceMappingURL=timeoutManager.js.map","import { timeoutManager } from \"./timeoutManager.js\";\n//#region src/utils.ts\n/** @deprecated\n* use `environmentManager.isServer()` instead.\n*/\nconst isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {}\nfunction functionalUpdate(updater, input) {\n\treturn typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n\treturn typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n\treturn Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction resolveQueryValue(value, query) {\n\treturn typeof value === \"function\" ? value(query) : value;\n}\n/**\n* Checks whether a query matches the given {@link QueryFilters}.\n* Every filter that is specified must match; filters that are left unspecified are ignored.\n*\n* @example\n* ```ts\n* const queryCache = queryClient.getQueryCache()\n*\n* const matchingQueries = queryCache\n* .getAll()\n* .filter((query) => matchQuery({ queryKey: ['posts'] }, query))\n* ```\n*/\nfunction matchQuery(filters, query) {\n\tconst { type = \"all\", exact, fetchStatus, predicate, queryKey, stale } = filters;\n\tif (queryKey) {\n\t\tif (exact) {\n\t\t\tif (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) return false;\n\t\t} else if (!partialMatchKey(query.queryKey, queryKey)) return false;\n\t}\n\tif (type !== \"all\") {\n\t\tconst isActive = query.isActive();\n\t\tif (type === \"active\" && !isActive) return false;\n\t\tif (type === \"inactive\" && isActive) return false;\n\t}\n\tif (typeof stale === \"boolean\" && query.isStale() !== stale) return false;\n\tif (fetchStatus && fetchStatus !== query.state.fetchStatus) return false;\n\tif (predicate && !predicate(query)) return false;\n\treturn true;\n}\n/**\n* Checks whether a mutation matches the given {@link MutationFilters}.\n* Every filter that is specified must match; filters that are left unspecified are ignored.\n* If a `mutationKey` filter is provided but the mutation has no `mutationKey` of its own, it does not match.\n*\n* @example\n* ```ts\n* const mutationCache = queryClient.getMutationCache()\n*\n* const matchingMutations = mutationCache\n* .getAll()\n* .filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation))\n* ```\n*/\nfunction matchMutation(filters, mutation) {\n\tconst { exact, status, predicate, mutationKey } = filters;\n\tif (mutationKey) {\n\t\tif (!mutation.options.mutationKey) return false;\n\t\tif (exact) {\n\t\t\tif (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) return false;\n\t\t} else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) return false;\n\t}\n\tif (status && mutation.state.status !== status) return false;\n\tif (predicate && !predicate(mutation)) return false;\n\treturn true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n\treturn (options?.queryKeyHashFn || hashKey)(queryKey);\n}\n/**\n* Default query & mutation keys hash function.\n* Hashes the value into a stable hash.\n*\n* @example\n* ```ts\n* // Object keys are sorted, so key order doesn't affect the hash:\n* hashKey(['todos', { page: 1, filter: 'done' }]) // === '[\"todos\",{\"filter\":\"done\",\"page\":1}]'\n* ```\n*/\nfunction hashKey(queryKey) {\n\treturn JSON.stringify(queryKey, (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n\t\tresult[key] = val[key];\n\t\treturn result;\n\t}, {}) : val);\n}\nfunction partialMatchKey(a, b) {\n\tif (a === b) return true;\n\tif (typeof a !== typeof b) return false;\n\tif (a && b && typeof a === \"object\" && typeof b === \"object\") {\n\t\tif (Array.isArray(a) && Array.isArray(b)) {\n\t\t\tif (b.length > a.length) return false;\n\t\t\tfor (let i = 0; i < b.length; i++) if (!partialMatchKey(a[i], b[i])) return false;\n\t\t\treturn true;\n\t\t}\n\t\tconst bKeys = Object.keys(b);\n\t\tfor (const key of bKeys) if (!partialMatchKey(a[key], b[key])) return false;\n\t\treturn true;\n\t}\n\treturn false;\n}\nconst hasOwn = Object.prototype.hasOwnProperty;\nfunction replaceEqualDeep(a, b, depth = 0) {\n\tif (a === b) return a;\n\tif (depth > 500) return b;\n\tconst array = isPlainArray(a) && isPlainArray(b);\n\tif (!array && !(isPlainObject(a) && isPlainObject(b))) return b;\n\tconst aSize = (array ? a : Object.keys(a)).length;\n\tconst bItems = array ? b : Object.keys(b);\n\tconst bSize = bItems.length;\n\tconst copy = array ? new Array(bSize) : {};\n\tlet equalItems = 0;\n\tfor (let i = 0; i < bSize; i++) {\n\t\tconst key = array ? i : bItems[i];\n\t\tconst aItem = a[key];\n\t\tconst bItem = b[key];\n\t\tif (aItem === bItem) {\n\t\t\tcopy[key] = aItem;\n\t\t\tif (array ? i < aSize : hasOwn.call(a, key)) equalItems++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (aItem === null || bItem === null || typeof aItem !== \"object\" || typeof bItem !== \"object\") {\n\t\t\tcopy[key] = bItem;\n\t\t\tcontinue;\n\t\t}\n\t\tconst v = replaceEqualDeep(aItem, bItem, depth + 1);\n\t\tcopy[key] = v;\n\t\tif (v === aItem) equalItems++;\n\t}\n\treturn aSize === bSize && equalItems === aSize ? a : copy;\n}\n/**\n* Shallow compare objects.\n*/\nfunction shallowEqualObjects(a, b) {\n\tif (!b || Object.keys(a).length !== Object.keys(b).length) return false;\n\tfor (const key in a) if (a[key] !== b[key]) return false;\n\treturn true;\n}\nfunction isPlainArray(value) {\n\treturn Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n\tif (!hasObjectPrototype(o)) return false;\n\tconst objectPrototype = Object.getPrototypeOf(o);\n\tconst ctor = objectPrototype?.constructor;\n\tif (ctor === void 0) return true;\n\tif (typeof ctor !== \"function\") return false;\n\tconst prot = ctor.prototype;\n\tif (!hasObjectPrototype(prot)) return false;\n\tif (!prot.hasOwnProperty(\"isPrototypeOf\")) return false;\n\tif (objectPrototype !== Object.prototype) return false;\n\treturn true;\n}\nfunction hasObjectPrototype(o) {\n\treturn Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(timeout) {\n\treturn new Promise((resolve) => {\n\t\ttimeoutManager.setTimeout(resolve, timeout);\n\t});\n}\nfunction replaceData(prevData, data, options) {\n\tif (typeof options.structuralSharing === \"function\") return options.structuralSharing(prevData, data);\n\telse if (options.structuralSharing !== false) {\n\t\tif (process.env.NODE_ENV !== \"production\") try {\n\t\t\treturn replaceEqualDeep(prevData, data);\n\t\t} catch (error) {\n\t\t\tconsole.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`);\n\t\t\tthrow error;\n\t\t}\n\t\treturn replaceEqualDeep(prevData, data);\n\t}\n\treturn data;\n}\n/**\n* Intended to be passed as a query's `placeholderData` option, for example\n* `placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new\n* query key is fetching, it keeps displaying the previously fetched data until the new data arrives.\n*\n* @example\n* ```ts\n* new QueryObserver(queryClient, {\n* queryKey: ['posts', page],\n* queryFn: () => fetchPosts(page),\n* placeholderData: keepPreviousData,\n* })\n* ```\n*/\nfunction keepPreviousData(previousData) {\n\treturn previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n\tconst newItems = [...items, item];\n\treturn max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n\tconst newItems = [item, ...items];\n\treturn max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\n/**\n* Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent\n* to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`,\n* a query disabled via `skipToken` cannot be triggered with `refetch`.\n*\n* @example\n* ```ts\n* new QueryObserver(queryClient, {\n* queryKey: ['post', postId],\n* queryFn: postId != null ? () => fetchPost(postId) : skipToken,\n* })\n* ```\n*/\nconst skipToken = Symbol();\nfunction ensureQueryFn(options, fetchOptions) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (options.queryFn === skipToken) console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`);\n\t}\n\tif (!options.queryFn && fetchOptions?.initialPromise) return () => fetchOptions.initialPromise;\n\tif (!options.queryFn || options.queryFn === skipToken) return () => Promise.reject(/* @__PURE__ */ new Error(`Missing queryFn: '${options.queryHash}'`));\n\treturn options.queryFn;\n}\n/**\n* Resolves a `throwOnError` option to a boolean.\n* If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller,\n* additional context such as the query or mutation) and its result is returned, allowing the throwing\n* behavior to be decided per error. Otherwise, `throwOnError` itself is coerced to a boolean (`undefined`\n* resolves to `false`).\n*\n* @example\n* ```ts\n* const throwOnError =\n* query.state.error && typeof options.throwOnError === 'function'\n* ? shouldThrowError(options.throwOnError, [query.state.error, query])\n* : options.throwOnError\n* ```\n*/\nfunction shouldThrowError(throwOnError, params) {\n\tif (typeof throwOnError === \"function\") return throwOnError(...params);\n\treturn !!throwOnError;\n}\nfunction addConsumeAwareSignal(object, getSignal, onCancelled) {\n\tlet consumed = false;\n\tlet signal;\n\tObject.defineProperty(object, \"signal\", {\n\t\tenumerable: true,\n\t\tget: () => {\n\t\t\tsignal ??= getSignal();\n\t\t\tif (consumed) return signal;\n\t\t\tconsumed = true;\n\t\t\tif (signal.aborted) onCancelled();\n\t\t\telse signal.addEventListener(\"abort\", onCancelled, { once: true });\n\t\t\treturn signal;\n\t\t}\n\t});\n\treturn object;\n}\n//#endregion\nexport { addConsumeAwareSignal, addToEnd, addToStart, ensureQueryFn, functionalUpdate, hashKey, hashQueryKeyByOptions, isPlainArray, isPlainObject, isServer, isValidTimeout, keepPreviousData, matchMutation, matchQuery, noop, partialMatchKey, replaceData, replaceEqualDeep, resolveQueryValue, shallowEqualObjects, shouldThrowError, skipToken, sleep, timeUntilStale };\n\n//# sourceMappingURL=utils.js.map","import { isServer as isServer$1 } from \"./utils.js\";\n//#region src/environmentManager.ts\nlet isServerFn = () => isServer$1;\n/**\n* Returns whether the current runtime should be treated as a server environment.\n*/\nconst isServer = () => isServerFn();\n/**\n* Manages how TanStack Query detects whether the current runtime should be treated as\n* server-side, which disables scheduling refetch timers and changes the default `retry` count\n* and `gcTime`. By default, the detection treats a missing `window` (or the presence of a\n* `Deno` global) as server.\n*\n* Override this for runtimes where that default detection would give the wrong answer — for\n* example, a Service Worker, where `window` is undefined even though the environment should\n* behave like a client.\n*\n* @example\n* ```ts\n* import { environmentManager } from '@tanstack/query-core'\n*\n* environmentManager.setIsServer(() => false)\n* ```\n*/\nconst environmentManager = {\n\tisServer,\n\t/**\n\t* Overrides the server check globally.\n\t*/\n\tsetIsServer(isServerValue) {\n\t\tisServerFn = isServerValue;\n\t}\n};\n//#endregion\nexport { environmentManager, isServer };\n\n//# sourceMappingURL=environmentManager.js.map","//#region src/subscribable.ts\nvar Subscribable = class {\n\tconstructor() {\n\t\tthis.listeners = /* @__PURE__ */ new Set();\n\t\tthis.subscribe = this.subscribe.bind(this);\n\t}\n\tsubscribe(listener) {\n\t\tthis.listeners.add(listener);\n\t\tthis.onSubscribe();\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t\tthis.onUnsubscribe();\n\t\t};\n\t}\n\thasListeners() {\n\t\treturn this.listeners.size > 0;\n\t}\n\tonSubscribe() {}\n\tonUnsubscribe() {}\n};\n//#endregion\nexport { Subscribable };\n\n//# sourceMappingURL=subscribable.js.map","import { Subscribable } from \"./subscribable.js\";\n//#region src/focusManager.ts\n/**\n* The `FocusManager` manages the focus state within TanStack Query.\n*\n* It can be used to change the default event listeners or to manually change the focus state.\n*/\nvar FocusManager = class extends Subscribable {\n\t#focused;\n\t#cleanup;\n\t#setup;\n\tconstructor() {\n\t\tsuper();\n\t\tthis.#setup = (onFocus) => {\n\t\t\tif (typeof window !== \"undefined\" && window.addEventListener) {\n\t\t\t\tconst listener = () => onFocus();\n\t\t\t\twindow.addEventListener(\"visibilitychange\", listener, false);\n\t\t\t\treturn () => {\n\t\t\t\t\twindow.removeEventListener(\"visibilitychange\", listener);\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tonSubscribe() {\n\t\tif (!this.#cleanup) this.setEventListener(this.#setup);\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) {\n\t\t\tthis.#cleanup?.();\n\t\t\tthis.#cleanup = void 0;\n\t\t}\n\t}\n\t/**\n\t* `setEventListener` can be used to set a custom event listener that will\n\t* be used to determine the focus state. The provided `setup` function\n\t* receives a `setFocused` callback: call it with a `boolean` to manually\n\t* set the focus state, or with no arguments to re-evaluate the current\n\t* focus state and notify subscribers.\n\t*\n\t* @example\n\t* ```ts\n\t* import { focusManager } from '@tanstack/query-core'\n\t*\n\t* focusManager.setEventListener((handleFocus) => {\n\t* const listener = () => handleFocus()\n\t* // Listen to visibilitychange\n\t* if (typeof window !== 'undefined' && window.addEventListener) {\n\t* window.addEventListener('visibilitychange', listener, false)\n\t* }\n\t*\n\t* return () => {\n\t* // Be sure to unsubscribe if a new handler is set\n\t* window.removeEventListener('visibilitychange', listener)\n\t* }\n\t* })\n\t* ```\n\t*/\n\tsetEventListener(setup) {\n\t\tthis.#setup = setup;\n\t\tthis.#cleanup?.();\n\t\tthis.#cleanup = setup((focused) => {\n\t\t\tif (typeof focused === \"boolean\") this.setFocused(focused);\n\t\t\telse this.onFocus();\n\t\t});\n\t}\n\t/**\n\t* `setFocused` can be used to manually set the focus state. Set `undefined`\n\t* to fall back to the default focus check.\n\t*\n\t* @example\n\t* ```ts\n\t* import { focusManager } from '@tanstack/query-core'\n\t*\n\t* // Set focused\n\t* focusManager.setFocused(true)\n\t*\n\t* // Set unfocused\n\t* focusManager.setFocused(false)\n\t*\n\t* // Fallback to the default focus check\n\t* focusManager.setFocused(undefined)\n\t* ```\n\t*/\n\tsetFocused(focused) {\n\t\tif (this.#focused !== focused) {\n\t\t\tthis.#focused = focused;\n\t\t\tthis.onFocus();\n\t\t}\n\t}\n\t/**\n\t* `onFocus` notifies all subscribed listeners with the current focus state.\n\t*/\n\tonFocus() {\n\t\tconst isFocused = this.isFocused();\n\t\tthis.listeners.forEach((listener) => {\n\t\t\tlistener(isFocused);\n\t\t});\n\t}\n\t/**\n\t* `isFocused` can be used to get the current focus state.\n\t*/\n\tisFocused() {\n\t\tif (typeof this.#focused === \"boolean\") return this.#focused;\n\t\treturn globalThis.document?.visibilityState !== \"hidden\";\n\t}\n};\n/**\n* Singleton instance of {@link FocusManager}, used to manage and observe the focus state within TanStack Query.\n*/\nconst focusManager = new FocusManager();\n//#endregion\nexport { FocusManager, focusManager };\n\n//# sourceMappingURL=focusManager.js.map","import { systemSetTimeoutZero } from \"./timeoutManager.js\";\n//#region src/notifyManager.ts\n/**\n* Default scheduling function used by the notify manager.\n* Schedules the callback with the system's `setTimeout(callback, 0)`.\n*/\nconst defaultScheduler = systemSetTimeoutZero;\nfunction createNotifyManager() {\n\tlet queue = [];\n\tlet transactions = 0;\n\tlet notifyFn = (callback) => {\n\t\tcallback();\n\t};\n\tlet batchNotifyFn = (callback) => {\n\t\tcallback();\n\t};\n\tlet scheduleFn = defaultScheduler;\n\tconst schedule = (callback) => {\n\t\tif (transactions) queue.push(callback);\n\t\telse scheduleFn(() => {\n\t\t\tnotifyFn(callback);\n\t\t});\n\t};\n\tconst flush = () => {\n\t\tconst originalQueue = queue;\n\t\tqueue = [];\n\t\tif (originalQueue.length) scheduleFn(() => {\n\t\t\tbatchNotifyFn(() => {\n\t\t\t\toriginalQueue.forEach((callback) => {\n\t\t\t\t\tnotifyFn(callback);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n\treturn {\n\t\t/**\n\t\t* Batches all updates scheduled inside the passed callback.\n\t\t* This is mainly used internally to optimize query client updating.\n\t\t* Batches can be nested; the queue is only flushed once the outermost `batch` call finishes.\n\t\t* The return value of `callback` is passed through.\n\t\t*/\n\t\tbatch: (callback) => {\n\t\t\tlet result;\n\t\t\ttransactions++;\n\t\t\ttry {\n\t\t\t\tresult = callback();\n\t\t\t} finally {\n\t\t\t\ttransactions--;\n\t\t\t\tif (!transactions) flush();\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\t/**\n\t\t* All calls to the wrapped function will be batched.\n\t\t*/\n\t\tbatchCalls: (callback) => {\n\t\t\treturn (...args) => {\n\t\t\t\tschedule(() => {\n\t\t\t\t\tcallback(...args);\n\t\t\t\t});\n\t\t\t};\n\t\t},\n\t\t/**\n\t\t* Schedules a function to be run on the next batch.\n\t\t* By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`.\n\t\t*/\n\t\tschedule,\n\t\t/**\n\t\t* Use this method to set a custom notify function.\n\t\t* This can be used to for example wrap notifications with `React.act` while running tests.\n\t\t*/\n\t\tsetNotifyFunction: (fn) => {\n\t\t\tnotifyFn = fn;\n\t\t},\n\t\t/**\n\t\t* Use this method to set a custom function to batch notifications together into a single tick.\n\t\t* Framework adapters use this to plug in their own batching primitive, so that a single query\n\t\t* update only triggers one re-render instead of one per subscriber.\n\t\t*\n\t\t* @example\n\t\t* ```ts\n\t\t* import { notifyManager } from '@tanstack/query-core'\n\t\t* import { batch } from 'solid-js'\n\t\t*\n\t\t* notifyManager.setBatchNotifyFunction(batch)\n\t\t* ```\n\t\t*/\n\t\tsetBatchNotifyFunction: (fn) => {\n\t\t\tbatchNotifyFn = fn;\n\t\t},\n\t\t/**\n\t\t* Configures a custom callback that schedules when the next batch runs.\n\t\t* The default behavior is `setTimeout(callback, 0)`.\n\t\t*\n\t\t* @example\n\t\t* ```ts\n\t\t* import { notifyManager } from '@tanstack/query-core'\n\t\t*\n\t\t* // Schedule batches in the next microtask\n\t\t* notifyManager.setScheduler(queueMicrotask)\n\t\t*\n\t\t* // Schedule batches before the next frame is rendered\n\t\t* notifyManager.setScheduler(requestAnimationFrame)\n\t\t*\n\t\t* // Schedule batches some time in the future\n\t\t* notifyManager.setScheduler((cb) => setTimeout(cb, 10))\n\t\t* ```\n\t\t*/\n\t\tsetScheduler: (fn) => {\n\t\t\tscheduleFn = fn;\n\t\t}\n\t};\n}\n/**\n* Handles scheduling and batching callbacks in TanStack Query.\n*/\nconst notifyManager = createNotifyManager();\n//#endregion\nexport { createNotifyManager, defaultScheduler, notifyManager };\n\n//# sourceMappingURL=notifyManager.js.map","import { Subscribable } from \"./subscribable.js\";\n//#region src/onlineManager.ts\n/**\n* The `OnlineManager` manages the online state within TanStack Query. It can\n* be used to change the default event listeners or to manually change the\n* online state.\n*\n* By default, the `onlineManager` assumes an active network connection, and\n* listens to the `online` and `offline` events on the `window` object to\n* detect changes.\n*/\nvar OnlineManager = class extends Subscribable {\n\t#online = true;\n\t#cleanup;\n\t#setup;\n\tconstructor() {\n\t\tsuper();\n\t\tthis.#setup = (onOnline) => {\n\t\t\tif (typeof window !== \"undefined\" && window.addEventListener) {\n\t\t\t\tconst onlineListener = () => onOnline(true);\n\t\t\t\tconst offlineListener = () => onOnline(false);\n\t\t\t\twindow.addEventListener(\"online\", onlineListener, false);\n\t\t\t\twindow.addEventListener(\"offline\", offlineListener, false);\n\t\t\t\treturn () => {\n\t\t\t\t\twindow.removeEventListener(\"online\", onlineListener);\n\t\t\t\t\twindow.removeEventListener(\"offline\", offlineListener);\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tonSubscribe() {\n\t\tif (!this.#cleanup) this.setEventListener(this.#setup);\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) {\n\t\t\tthis.#cleanup?.();\n\t\t\tthis.#cleanup = void 0;\n\t\t}\n\t}\n\t/**\n\t* `setEventListener` can be used to set a custom event listener that will\n\t* be used to determine the online state. The provided `setup` function\n\t* receives a `setOnline` callback that should be called with a `boolean`\n\t* whenever the online state changes.\n\t*\n\t* @example\n\t* ```ts\n\t* import NetInfo from '@react-native-community/netinfo'\n\t* import { onlineManager } from '@tanstack/query-core'\n\t*\n\t* onlineManager.setEventListener((setOnline) => {\n\t* return NetInfo.addEventListener((state) => {\n\t* setOnline(!!state.isConnected)\n\t* })\n\t* })\n\t* ```\n\t*/\n\tsetEventListener(setup) {\n\t\tthis.#setup = setup;\n\t\tthis.#cleanup?.();\n\t\tthis.#cleanup = setup(this.setOnline.bind(this));\n\t}\n\t/**\n\t* `setOnline` can be used to manually set the online state.\n\t*\n\t* @example\n\t* ```ts\n\t* import { onlineManager } from '@tanstack/query-core'\n\t*\n\t* // Set to online\n\t* onlineManager.setOnline(true)\n\t*\n\t* // Set to offline\n\t* onlineManager.setOnline(false)\n\t* ```\n\t*/\n\tsetOnline(online) {\n\t\tif (this.#online !== online) {\n\t\t\tthis.#online = online;\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(online);\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* `isOnline` can be used to get the current online state.\n\t*/\n\tisOnline() {\n\t\treturn this.#online;\n\t}\n};\n/**\n* Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query.\n*/\nconst onlineManager = new OnlineManager();\n//#endregion\nexport { OnlineManager, onlineManager };\n\n//# sourceMappingURL=onlineManager.js.map","import { noop, sleep } from \"./utils.js\";\nimport { isServer } from \"./environmentManager.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\n//#region src/retryer.ts\nfunction defaultRetryDelay(failureCount) {\n\treturn Math.min(1e3 * 2 ** failureCount, 3e4);\n}\nfunction canFetch(networkMode) {\n\treturn (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\n/**\n* The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via\n* `query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch\n* started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead\n* resolve with the promise of the fetch that triggered the cancellation.\n* @example\n* ```ts\n* query.cancel()\n*\n* try {\n* await query.promise\n* } catch (error) {\n* if (error instanceof CancelledError) {\n* // the fetch was cancelled, e.g. via `query.cancel()`\n* }\n* }\n* ```\n*/\nvar CancelledError = class extends Error {\n\tconstructor(options) {\n\t\tsuper(\"CancelledError\");\n\t\tthis.revert = options?.revert;\n\t\tthis.silent = options?.silent;\n\t}\n};\n/**\n* @deprecated Use instanceof `CancelledError` instead.\n*/\nfunction isCancelledError(value) {\n\treturn value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n\tlet isRetryCancelled = false;\n\tlet failureCount = 0;\n\tlet continueFn;\n\tlet status = \"pending\";\n\tlet promiseResolve;\n\tlet promiseReject;\n\tconst promise = new Promise((resolve, reject) => {\n\t\tpromiseResolve = resolve;\n\t\tpromiseReject = reject;\n\t});\n\tpromise.catch(noop);\n\tconst isResolved = () => status !== \"pending\";\n\tconst cancel = (cancelOptions) => {\n\t\tif (!isResolved()) {\n\t\t\tconst error = new CancelledError(cancelOptions);\n\t\t\treject(error);\n\t\t\tconfig.onCancel?.(error);\n\t\t}\n\t};\n\tconst cancelRetry = () => {\n\t\tisRetryCancelled = true;\n\t};\n\tconst continueRetry = () => {\n\t\tisRetryCancelled = false;\n\t};\n\tconst canContinue = () => focusManager.isFocused() && (config.networkMode === \"always\" || onlineManager.isOnline()) && config.canRun();\n\tconst canStart = () => canFetch(config.networkMode) && config.canRun();\n\tconst resolve = (value) => {\n\t\tif (!isResolved()) {\n\t\t\tcontinueFn?.();\n\t\t\tstatus = \"resolved\";\n\t\t\tpromiseResolve(value);\n\t\t}\n\t};\n\tconst reject = (value) => {\n\t\tif (!isResolved()) {\n\t\t\tcontinueFn?.();\n\t\t\tstatus = \"rejected\";\n\t\t\tpromiseReject(value);\n\t\t}\n\t};\n\tconst pause = () => {\n\t\treturn new Promise((continueResolve) => {\n\t\t\tcontinueFn = (value) => {\n\t\t\t\tif (isResolved() || canContinue()) continueResolve(value);\n\t\t\t};\n\t\t\tconfig.onPause?.();\n\t\t}).then(() => {\n\t\t\tcontinueFn = void 0;\n\t\t\tif (!isResolved()) config.onContinue?.();\n\t\t});\n\t};\n\tconst run = () => {\n\t\tif (isResolved()) return;\n\t\tlet promiseOrValue;\n\t\tconst initialPromise = failureCount === 0 ? config.initialPromise : void 0;\n\t\ttry {\n\t\t\tpromiseOrValue = initialPromise ?? config.fn();\n\t\t} catch (error) {\n\t\t\tpromiseOrValue = Promise.reject(error);\n\t\t}\n\t\tPromise.resolve(promiseOrValue).then(resolve).catch((error) => {\n\t\t\tif (isResolved()) return;\n\t\t\tconst retry = config.retry ?? (isServer() ? 0 : 3);\n\t\t\tconst retryDelay = config.retryDelay ?? defaultRetryDelay;\n\t\t\tconst delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n\t\t\tconst shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n\t\t\tif (isRetryCancelled || !shouldRetry) {\n\t\t\t\treject(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfailureCount++;\n\t\t\tconfig.onFail?.(failureCount, error);\n\t\t\tsleep(delay).then(() => {\n\t\t\t\treturn canContinue() ? void 0 : pause();\n\t\t\t}).then(() => {\n\t\t\t\tif (isRetryCancelled) reject(error);\n\t\t\t\telse run();\n\t\t\t});\n\t\t});\n\t};\n\treturn {\n\t\tpromise,\n\t\tstatus: () => status,\n\t\tcancel,\n\t\tcontinue: () => {\n\t\t\tcontinueFn?.();\n\t\t\treturn promise;\n\t\t},\n\t\tcancelRetry,\n\t\tcontinueRetry,\n\t\tcanStart,\n\t\tstart: () => {\n\t\t\tif (canStart()) run();\n\t\t\telse pause().then(run);\n\t\t\treturn promise;\n\t\t}\n\t};\n}\n//#endregion\nexport { CancelledError, canFetch, createRetryer, isCancelledError };\n\n//# sourceMappingURL=retryer.js.map","import { timeoutManager } from \"./timeoutManager.js\";\nimport { isValidTimeout } from \"./utils.js\";\nimport { isServer } from \"./environmentManager.js\";\n//#region src/removable.ts\nvar Removable = class {\n\t#gcTimeout;\n\tdestroy() {\n\t\tthis.clearGcTimeout();\n\t}\n\tscheduleGc() {\n\t\tthis.clearGcTimeout();\n\t\tif (isValidTimeout(this.gcTime)) this.#gcTimeout = timeoutManager.setTimeout(() => {\n\t\t\tthis.optionalRemove();\n\t\t}, this.gcTime);\n\t}\n\tupdateGcTime(newGcTime) {\n\t\tthis.gcTime = Math.max(this.gcTime || 0, newGcTime ?? (isServer() ? Infinity : 3e5));\n\t}\n\tclearGcTimeout() {\n\t\tif (this.#gcTimeout !== void 0) {\n\t\t\ttimeoutManager.clearTimeout(this.#gcTimeout);\n\t\t\tthis.#gcTimeout = void 0;\n\t\t}\n\t}\n};\n//#endregion\nexport { Removable };\n\n//# sourceMappingURL=removable.js.map","import { addConsumeAwareSignal, addToEnd, addToStart, ensureQueryFn } from \"./utils.js\";\n//#region src/infiniteQueryBehavior.ts\nfunction infiniteQueryBehavior(pages) {\n\treturn { onFetch: (context, query) => {\n\t\tconst options = context.options;\n\t\tconst direction = context.fetchOptions?.meta?.fetchMore?.direction;\n\t\tconst oldPages = context.state.data?.pages || [];\n\t\tconst oldPageParams = context.state.data?.pageParams || [];\n\t\tlet result = {\n\t\t\tpages: [],\n\t\t\tpageParams: []\n\t\t};\n\t\tlet currentPage = 0;\n\t\tconst fetchFn = async () => {\n\t\t\tlet cancelled = false;\n\t\t\tconst addSignalProperty = (object) => {\n\t\t\t\taddConsumeAwareSignal(object, () => context.signal, () => cancelled = true);\n\t\t\t};\n\t\t\tconst queryFn = ensureQueryFn(context.options, context.fetchOptions);\n\t\t\tconst fetchPage = async (data, param, previous) => {\n\t\t\t\tif (cancelled) return Promise.reject(context.signal.reason);\n\t\t\t\tif (param == null && data.pages.length) return Promise.resolve(data);\n\t\t\t\tconst createQueryFnContext = () => {\n\t\t\t\t\tconst queryFnContext = {\n\t\t\t\t\t\tclient: context.client,\n\t\t\t\t\t\tqueryKey: context.queryKey,\n\t\t\t\t\t\tpageParam: param,\n\t\t\t\t\t\tdirection: previous ? \"backward\" : \"forward\",\n\t\t\t\t\t\tmeta: context.options.meta\n\t\t\t\t\t};\n\t\t\t\t\taddSignalProperty(queryFnContext);\n\t\t\t\t\treturn queryFnContext;\n\t\t\t\t};\n\t\t\t\tconst queryFnContext = createQueryFnContext();\n\t\t\t\tconst page = await queryFn(queryFnContext);\n\t\t\t\tconst { maxPages } = context.options;\n\t\t\t\tconst addTo = previous ? addToStart : addToEnd;\n\t\t\t\treturn {\n\t\t\t\t\tpages: addTo(data.pages, page, maxPages),\n\t\t\t\t\tpageParams: addTo(data.pageParams, param, maxPages)\n\t\t\t\t};\n\t\t\t};\n\t\t\tif (direction && oldPages.length) {\n\t\t\t\tconst previous = direction === \"backward\";\n\t\t\t\tconst pageParamFn = previous ? getPreviousPageParam : getNextPageParam;\n\t\t\t\tconst oldData = {\n\t\t\t\t\tpages: oldPages,\n\t\t\t\t\tpageParams: oldPageParams\n\t\t\t\t};\n\t\t\t\tresult = await fetchPage(oldData, pageParamFn(options, oldData), previous);\n\t\t\t} else {\n\t\t\t\tconst remainingPages = pages ?? oldPages.length;\n\t\t\t\tdo {\n\t\t\t\t\tconst param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);\n\t\t\t\t\tif (currentPage > 0 && param == null) break;\n\t\t\t\t\tresult = await fetchPage(result, param);\n\t\t\t\t\tcurrentPage++;\n\t\t\t\t} while (currentPage < remainingPages);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t\tif (context.options.persister) context.fetchFn = () => {\n\t\t\treturn context.options.persister?.(fetchFn, {\n\t\t\t\tclient: context.client,\n\t\t\t\tqueryKey: context.queryKey,\n\t\t\t\tmeta: context.options.meta,\n\t\t\t\tsignal: context.signal\n\t\t\t}, query);\n\t\t};\n\t\telse context.fetchFn = fetchFn;\n\t} };\n}\nfunction getNextPageParam(options, { pages, pageParams }) {\n\tconst lastIndex = pages.length - 1;\n\treturn pages.length > 0 ? options.getNextPageParam(pages[lastIndex], pages, pageParams[lastIndex], pageParams) : void 0;\n}\nfunction getPreviousPageParam(options, { pages, pageParams }) {\n\treturn pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;\n}\n/**\n* Checks if there is a next page.\n*/\nfunction hasNextPage(options, data) {\n\tif (!data) return false;\n\treturn getNextPageParam(options, data) != null;\n}\n/**\n* Checks if there is a previous page.\n*/\nfunction hasPreviousPage(options, data) {\n\tif (!data || !options.getPreviousPageParam) return false;\n\treturn getPreviousPageParam(options, data) != null;\n}\n//#endregion\nexport { hasNextPage, hasPreviousPage, infiniteQueryBehavior };\n\n//# sourceMappingURL=infiniteQueryBehavior.js.map","import { ensureQueryFn, noop, replaceData, resolveQueryValue, skipToken, timeUntilStale } from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { CancelledError, canFetch, createRetryer } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nimport { infiniteQueryBehavior } from \"./infiniteQueryBehavior.js\";\n//#region src/query.ts\n/**\n* Represents a single cached query. A `Query` holds the query's key, options,\n* state (data/error/status), and the observers currently subscribed to it.\n*\n* Instances are created and managed internally by `QueryCache`; application\n* code typically interacts with queries indirectly through `QueryClient` or\n* a framework hook like `useQuery`. Direct access to a `Query` instance is\n* possible via `queryCache.find()`/`findAll()` for inspecting cache state.\n*\n* @example\n* ```ts\n* const queryCache = queryClient.getQueryCache()\n* const query = queryCache.find({ queryKey: ['posts'] })\n*\n* if (query) {\n* console.log(query.state.dataUpdatedAt)\n* }\n* ```\n*/\nvar Query = class extends Removable {\n\t#queryType;\n\t#initialState;\n\t#revertState;\n\t#cache;\n\t#client;\n\t#retryer;\n\t#defaultOptions;\n\t#abortSignalConsumed;\n\tconstructor(config) {\n\t\tsuper();\n\t\tthis.#abortSignalConsumed = false;\n\t\tthis.#defaultOptions = config.defaultOptions;\n\t\tthis.setOptions(config.options);\n\t\tthis.observers = [];\n\t\tthis.#client = config.client;\n\t\tthis.#cache = this.#client.getQueryCache();\n\t\tthis.queryKey = config.queryKey;\n\t\tthis.queryHash = config.queryHash;\n\t\tthis.#initialState = getDefaultState(this.options);\n\t\tthis.state = config.state ?? this.#initialState;\n\t\tthis.scheduleGc();\n\t}\n\t/**\n\t* The `meta` object passed in the query's options, if any.\n\t*/\n\tget meta() {\n\t\treturn this.options.meta;\n\t}\n\t/** @internal */\n\tget queryType() {\n\t\treturn this.#queryType;\n\t}\n\t/**\n\t* The promise for the currently in-flight fetch, if the query is fetching.\n\t* `undefined` when the query is not fetching.\n\t*/\n\tget promise() {\n\t\treturn this.#retryer?.promise;\n\t}\n\t/** @internal */\n\tsetOptions(options) {\n\t\tthis.options = {\n\t\t\t...this.#defaultOptions,\n\t\t\t...options\n\t\t};\n\t\tif (options?._type) this.#queryType = options._type;\n\t\tthis.updateGcTime(this.options.gcTime);\n\t\tif (this.state && this.state.data === void 0) {\n\t\t\tconst defaultState = getDefaultState(this.options);\n\t\t\tif (defaultState.data !== void 0) {\n\t\t\t\tthis.setState(successState(defaultState.data, defaultState.dataUpdatedAt));\n\t\t\t\tthis.#initialState = defaultState;\n\t\t\t}\n\t\t}\n\t}\n\toptionalRemove() {\n\t\tif (!this.observers.length && this.state.fetchStatus === \"idle\") this.#cache.remove(this);\n\t}\n\t/** @internal */\n\tsetData(newData, options) {\n\t\tconst data = replaceData(this.state.data, newData, this.options);\n\t\tthis.#dispatch({\n\t\t\tdata,\n\t\t\ttype: \"success\",\n\t\t\tdataUpdatedAt: options?.updatedAt,\n\t\t\tmanual: options?.manual\n\t\t});\n\t\treturn data;\n\t}\n\t/**\n\t* Merges the given partial state directly into this query's state, notifying observers. Used\n\t* by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a\n\t* user manually trigger a loading/error state or edit the cached data.\n\t*/\n\tsetState(state) {\n\t\tthis.#dispatch({\n\t\t\ttype: \"setState\",\n\t\t\tstate\n\t\t});\n\t}\n\t/**\n\t* Cancels the query's currently in-flight fetch, if any.\n\t* - Returns a promise that resolves once the cancellation has settled.\n\t* - If no fetch is in progress, resolves immediately.\n\t*\n\t* @example\n\t* ```ts\n\t* await query.cancel()\n\t* ```\n\t*/\n\tcancel(options) {\n\t\tconst promise = this.#retryer?.promise;\n\t\tthis.#retryer?.cancel(options);\n\t\treturn promise ? promise.then(noop).catch(noop) : Promise.resolve();\n\t}\n\t/**\n\t* Clears the query's garbage collection timeout and silently cancels any\n\t* in-flight fetch. Called by `QueryCache` when the query is removed from\n\t* the cache.\n\t*\n\t* @see {@link Query#cancel}\n\t*/\n\tdestroy() {\n\t\tsuper.destroy();\n\t\tthis.cancel({ silent: true });\n\t}\n\t/** @internal */\n\tget resetState() {\n\t\treturn this.#initialState;\n\t}\n\t/**\n\t* Resets the query back to its initial state (the state it had when it was\n\t* first created, e.g. any `initialData`), destroying it first to cancel any\n\t* in-flight fetch.\n\t*/\n\treset() {\n\t\tthis.destroy();\n\t\tthis.setState(this.resetState);\n\t}\n\t/**\n\t* Returns `true` if the query has at least one observer for which `enabled`\n\t* does not resolve to `false`.\n\t*/\n\tisActive() {\n\t\treturn this.observers.some((observer) => resolveQueryValue(observer.options.enabled, this) !== false);\n\t}\n\t/**\n\t* Returns `true` if the query is disabled, meaning it will not fetch\n\t* automatically.\n\t* - If the query has observers, it is disabled when none of them are active\n\t* (see `isActive`).\n\t* - If the query has no observers, it is disabled when its `queryFn` is\n\t* `skipToken` or it has never been fetched.\n\t*/\n\tisDisabled() {\n\t\tif (this.getObserversCount() > 0) return !this.isActive();\n\t\treturn this.options.queryFn === skipToken || !this.isFetched();\n\t}\n\t/**\n\t* Returns `true` if the query has been fetched, i.e. it has resolved with\n\t* either data or an error at least once.\n\t*/\n\tisFetched() {\n\t\treturn this.state.dataUpdateCount + this.state.errorUpdateCount > 0;\n\t}\n\t/**\n\t* Returns `true` if the query has at least one observer configured with\n\t* `staleTime: 'static'`, meaning it is treated as never stale.\n\t*/\n\tisStatic() {\n\t\tif (this.getObserversCount() > 0) return this.observers.some((observer) => resolveQueryValue(observer.options.staleTime, this) === \"static\");\n\t\treturn false;\n\t}\n\t/**\n\t* Returns `true` if the query is stale.\n\t* - If the query has observers, defers to whether any observer's current\n\t* result reports `isStale` (which accounts for each observer's own\n\t* `staleTime` and `enabled` state).\n\t* - If the query has no observers, it is considered stale when it has no\n\t* data or has been invalidated.\n\t*\n\t* @see {@link Query#isStaleByTime}\n\t* @example\n\t* ```ts\n\t* if (query.isStale()) {\n\t* // refetch or otherwise treat the cached data as outdated\n\t* }\n\t* ```\n\t*/\n\tisStale() {\n\t\tif (this.getObserversCount() > 0) return this.observers.some((observer) => observer.getCurrentResult().isStale);\n\t\treturn this.state.data === void 0 || this.state.isInvalidated;\n\t}\n\t/**\n\t* Returns `true` if the query's data is stale relative to the given\n\t* `staleTime` (defaults to `0`).\n\t* - A query with no data is always stale.\n\t* - `staleTime: 'static'` is never stale.\n\t* - An invalidated query is always stale.\n\t* - Otherwise, staleness is based on elapsed time since `dataUpdatedAt`.\n\t*\n\t* @see {@link Query#isStale}\n\t* @example\n\t* ```ts\n\t* const isStale = query.isStaleByTime(1000 * 60)\n\t* ```\n\t*/\n\tisStaleByTime(staleTime = 0) {\n\t\tif (this.state.data === void 0) return true;\n\t\tif (staleTime === \"static\") return false;\n\t\tif (this.state.isInvalidated) return true;\n\t\treturn !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n\t}\n\t/** @internal */\n\tonFocus() {\n\t\tthis.observers.find((x) => x.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: false });\n\t\tthis.#retryer?.continue();\n\t}\n\t/** @internal */\n\tonOnline() {\n\t\tthis.observers.find((x) => x.shouldFetchOnReconnect())?.refetch({ cancelRefetch: false });\n\t\tthis.#retryer?.continue();\n\t}\n\t/** @internal */\n\taddObserver(observer) {\n\t\tif (!this.observers.includes(observer)) {\n\t\t\tthis.observers.push(observer);\n\t\t\tthis.clearGcTimeout();\n\t\t\tthis.#cache.notify({\n\t\t\t\ttype: \"observerAdded\",\n\t\t\t\tquery: this,\n\t\t\t\tobserver\n\t\t\t});\n\t\t}\n\t}\n\t/** @internal */\n\tremoveObserver(observer) {\n\t\tconst index = this.observers.indexOf(observer);\n\t\tif (index !== -1) {\n\t\t\tthis.observers.splice(index, 1);\n\t\t\tif (!this.observers.length) {\n\t\t\t\tif (this.#retryer) {\n\t\t\t\t\tif (this.#abortSignalConsumed || this.state.fetchStatus === \"paused\" && this.state.status === \"pending\") this.#retryer.cancel({ revert: true });\n\t\t\t\t\telse this.#retryer.cancelRetry();\n\t\t\t\t}\n\t\t\t\tthis.scheduleGc();\n\t\t\t}\n\t\t\tthis.#cache.notify({\n\t\t\t\ttype: \"observerRemoved\",\n\t\t\t\tquery: this,\n\t\t\t\tobserver\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Returns the number of observers currently subscribed to this query.\n\t*\n\t* @example\n\t* ```ts\n\t* if (query.getObserversCount() === 0) {\n\t* // no component is currently watching this query\n\t* }\n\t* ```\n\t*/\n\tgetObserversCount() {\n\t\treturn this.observers.length;\n\t}\n\t/**\n\t* Marks the query as invalidated, unless it is already invalidated. This\n\t* updates `state.isInvalidated` and notifies observers, but does not by\n\t* itself trigger a refetch.\n\t*\n\t* @example\n\t* ```ts\n\t* query.invalidate()\n\t* ```\n\t*/\n\tinvalidate() {\n\t\tif (!this.state.isInvalidated) this.#dispatch({ type: \"invalidate\" });\n\t}\n\t/**\n\t* Fetches the query, i.e. runs its `queryFn` (through any configured\n\t* retryer/behavior) and updates the query's state with the result.\n\t* - If a fetch is already in flight, returns its promise instead of\n\t* starting a new one, unless `fetchOptions.cancelRefetch` is set and the\n\t* query already has data, in which case the current fetch is silently\n\t* cancelled first.\n\t* - If `options` is passed, it replaces the query's current options\n\t* before fetching.\n\t*/\n\tasync fetch(options, fetchOptions) {\n\t\tif (this.state.fetchStatus !== \"idle\" && this.#retryer?.status() !== \"rejected\") {\n\t\t\tif (this.state.data !== void 0 && fetchOptions?.cancelRefetch) this.cancel({ silent: true });\n\t\t\telse if (this.#retryer) {\n\t\t\t\tthis.#retryer.continueRetry();\n\t\t\t\treturn this.#retryer.promise;\n\t\t\t}\n\t\t}\n\t\tif (options) this.setOptions(options);\n\t\tif (!this.options.queryFn) {\n\t\t\tconst observer = this.observers.find((x) => x.options.queryFn);\n\t\t\tif (observer) this.setOptions(observer.options);\n\t\t}\n\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\tif (!Array.isArray(this.options.queryKey)) console.error(`As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`);\n\t\t}\n\t\tconst abortController = new AbortController();\n\t\tconst addSignalProperty = (object) => {\n\t\t\tObject.defineProperty(object, \"signal\", {\n\t\t\t\tenumerable: true,\n\t\t\t\tget: () => {\n\t\t\t\t\tthis.#abortSignalConsumed = true;\n\t\t\t\t\treturn abortController.signal;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tconst fetchFn = () => {\n\t\t\tconst queryFn = ensureQueryFn(this.options, fetchOptions);\n\t\t\tconst createQueryFnContext = () => {\n\t\t\t\tconst queryFnContext = {\n\t\t\t\t\tclient: this.#client,\n\t\t\t\t\tqueryKey: this.queryKey,\n\t\t\t\t\tmeta: this.meta\n\t\t\t\t};\n\t\t\t\taddSignalProperty(queryFnContext);\n\t\t\t\treturn queryFnContext;\n\t\t\t};\n\t\t\tconst queryFnContext = createQueryFnContext();\n\t\t\tthis.#abortSignalConsumed = false;\n\t\t\tif (this.options.persister) return this.options.persister(queryFn, queryFnContext, this);\n\t\t\treturn queryFn(queryFnContext);\n\t\t};\n\t\tconst createFetchContext = () => {\n\t\t\tconst context = {\n\t\t\t\tfetchOptions,\n\t\t\t\toptions: this.options,\n\t\t\t\tqueryKey: this.queryKey,\n\t\t\t\tclient: this.#client,\n\t\t\t\tstate: this.state,\n\t\t\t\tfetchFn\n\t\t\t};\n\t\t\taddSignalProperty(context);\n\t\t\treturn context;\n\t\t};\n\t\tconst context = createFetchContext();\n\t\t(this.#queryType === \"infinite\" ? infiniteQueryBehavior(this.options.pages) : this.options.behavior)?.onFetch(context, this);\n\t\tthis.#revertState = this.state;\n\t\tif (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) this.#dispatch({\n\t\t\ttype: \"fetch\",\n\t\t\tmeta: context.fetchOptions?.meta\n\t\t});\n\t\tconst retryer = this.#retryer = createRetryer({\n\t\t\tinitialPromise: fetchOptions?.initialPromise,\n\t\t\tfn: context.fetchFn,\n\t\t\tonCancel: (error) => {\n\t\t\t\tif (error instanceof CancelledError && error.revert) this.setState({\n\t\t\t\t\t...this.#revertState,\n\t\t\t\t\tfetchStatus: \"idle\"\n\t\t\t\t});\n\t\t\t\tabortController.abort();\n\t\t\t},\n\t\t\tonFail: (failureCount, error) => {\n\t\t\t\tthis.#dispatch({\n\t\t\t\t\ttype: \"failed\",\n\t\t\t\t\tfailureCount,\n\t\t\t\t\terror\n\t\t\t\t});\n\t\t\t},\n\t\t\tonPause: () => {\n\t\t\t\tthis.#dispatch({ type: \"pause\" });\n\t\t\t},\n\t\t\tonContinue: () => {\n\t\t\t\tthis.#dispatch({ type: \"continue\" });\n\t\t\t},\n\t\t\tretry: context.options.retry,\n\t\t\tretryDelay: context.options.retryDelay,\n\t\t\tnetworkMode: context.options.networkMode,\n\t\t\tcanRun: () => true\n\t\t});\n\t\ttry {\n\t\t\tconst data = await retryer.start();\n\t\t\tif (data === void 0) {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`);\n\t\t\t\tthrow new Error(`${this.queryHash} data is undefined`);\n\t\t\t}\n\t\t\tthis.setData(data);\n\t\t\tthis.#cache.config.onSuccess?.(data, this);\n\t\t\tthis.#cache.config.onSettled?.(data, this.state.error, this);\n\t\t\treturn data;\n\t\t} catch (error) {\n\t\t\tif (error instanceof CancelledError) {\n\t\t\t\tif (error.silent) return this.#retryer.promise;\n\t\t\t\telse if (error.revert) {\n\t\t\t\t\tif (this.state.data === void 0) throw error;\n\t\t\t\t\treturn this.state.data;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.#dispatch({\n\t\t\t\ttype: \"error\",\n\t\t\t\terror\n\t\t\t});\n\t\t\tthis.#cache.config.onError?.(error, this);\n\t\t\tthis.#cache.config.onSettled?.(this.state.data, error, this);\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tif (this.#retryer === retryer) this.#retryer = void 0;\n\t\t\tthis.scheduleGc();\n\t\t}\n\t}\n\t#dispatch(action) {\n\t\tconst reducer = (state) => {\n\t\t\tswitch (action.type) {\n\t\t\t\tcase \"failed\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tfetchFailureCount: action.failureCount,\n\t\t\t\t\tfetchFailureReason: action.error\n\t\t\t\t};\n\t\t\t\tcase \"pause\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tfetchStatus: \"paused\"\n\t\t\t\t};\n\t\t\t\tcase \"continue\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tfetchStatus: \"fetching\"\n\t\t\t\t};\n\t\t\t\tcase \"fetch\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\t...fetchState(state.data, this.options),\n\t\t\t\t\tfetchMeta: action.meta ?? null\n\t\t\t\t};\n\t\t\t\tcase \"success\":\n\t\t\t\t\tconst newState = {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\t...successState(action.data, action.dataUpdatedAt),\n\t\t\t\t\t\tdataUpdateCount: state.dataUpdateCount + 1,\n\t\t\t\t\t\t...!action.manual && {\n\t\t\t\t\t\t\tfetchStatus: \"idle\",\n\t\t\t\t\t\t\tfetchFailureCount: 0,\n\t\t\t\t\t\t\tfetchFailureReason: null\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tthis.#revertState = action.manual ? newState : void 0;\n\t\t\t\t\treturn newState;\n\t\t\t\tcase \"error\":\n\t\t\t\t\tconst error = action.error;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\terror,\n\t\t\t\t\t\terrorUpdateCount: state.errorUpdateCount + 1,\n\t\t\t\t\t\terrorUpdatedAt: Date.now(),\n\t\t\t\t\t\tfetchFailureCount: state.fetchFailureCount + 1,\n\t\t\t\t\t\tfetchFailureReason: error,\n\t\t\t\t\t\tfetchStatus: \"idle\",\n\t\t\t\t\t\tstatus: \"error\",\n\t\t\t\t\t\tisInvalidated: true\n\t\t\t\t\t};\n\t\t\t\tcase \"invalidate\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tisInvalidated: true\n\t\t\t\t};\n\t\t\t\tcase \"setState\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\t...action.state\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t\tthis.state = reducer(this.state);\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.observers.slice().forEach((observer) => {\n\t\t\t\tobserver.onQueryUpdate();\n\t\t\t});\n\t\t\tthis.#cache.notify({\n\t\t\t\tquery: this,\n\t\t\t\ttype: \"updated\",\n\t\t\t\taction\n\t\t\t});\n\t\t});\n\t}\n};\nfunction fetchState(data, options) {\n\treturn {\n\t\tfetchFailureCount: 0,\n\t\tfetchFailureReason: null,\n\t\tfetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n\t\t...data === void 0 && {\n\t\t\terror: null,\n\t\t\tstatus: \"pending\"\n\t\t}\n\t};\n}\nfunction successState(data, dataUpdatedAt) {\n\treturn {\n\t\tdata,\n\t\tdataUpdatedAt: dataUpdatedAt ?? Date.now(),\n\t\terror: null,\n\t\tisInvalidated: false,\n\t\tstatus: \"success\"\n\t};\n}\nfunction getDefaultState(options) {\n\tconst data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n\tconst hasData = data !== void 0;\n\tconst initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n\treturn {\n\t\tdata,\n\t\tdataUpdateCount: 0,\n\t\tdataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n\t\terror: null,\n\t\terrorUpdateCount: 0,\n\t\terrorUpdatedAt: 0,\n\t\tfetchFailureCount: 0,\n\t\tfetchFailureReason: null,\n\t\tfetchMeta: null,\n\t\tisInvalidated: false,\n\t\tstatus: hasData ? \"success\" : \"pending\",\n\t\tfetchStatus: \"idle\"\n\t};\n}\n//#endregion\nexport { Query, fetchState };\n\n//# sourceMappingURL=query.js.map","import { timeoutManager } from \"./timeoutManager.js\";\nimport { isValidTimeout, noop, replaceData, resolveQueryValue, shallowEqualObjects, timeUntilStale } from \"./utils.js\";\nimport { isServer } from \"./environmentManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { fetchState } from \"./query.js\";\n//#region src/queryObserver.ts\n/**\n* A `QueryObserver` watches a single query in the `QueryCache` and computes a\n* `QueryObserverResult` from its state, recomputing and notifying subscribers\n* whenever the underlying query (or the observer's options) changes. It is\n* the primitive that framework adapters (e.g. `useQuery`) build their hooks\n* on top of, but it can also be used directly to observe and switch between\n* queries outside of any framework.\n*\n* @example\n* ```ts\n* const observer = new QueryObserver(queryClient, {\n* queryKey: ['posts'],\n* queryFn: fetchPosts,\n* })\n*\n* const unsubscribe = observer.subscribe((result) => {\n* console.log(result.data)\n* })\n* ```\n*/\nvar QueryObserver = class extends Subscribable {\n\t#client;\n\t#currentQuery = void 0;\n\t#currentQueryInitialState = void 0;\n\t#currentResult = void 0;\n\t#currentResultState;\n\t#currentResultOptions;\n\t#selectError;\n\t#selectFn;\n\t#selectResult;\n\t#lastQueryWithDefinedData;\n\t#staleTimeoutId;\n\t#refetchIntervalId;\n\t#currentRefetchInterval;\n\t#trackedProps = /* @__PURE__ */ new Set();\n\tconstructor(client, options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.#client = client;\n\t\tthis.#selectError = null;\n\t\tthis.bindMethods();\n\t\tthis.setOptions(options);\n\t}\n\tbindMethods() {\n\t\tthis.refetch = this.refetch.bind(this);\n\t}\n\tonSubscribe() {\n\t\tif (this.listeners.size === 1) {\n\t\t\tthis.#currentQuery.addObserver(this);\n\t\t\tif (shouldFetchOnMount(this.#currentQuery, this.options)) this.#executeFetch();\n\t\t\telse this.updateResult();\n\t\t\tthis.#updateTimers();\n\t\t}\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) this.destroy();\n\t}\n\t/**\n\t* Returns whether the observed query is currently stale and configured\n\t* (via the `refetchOnReconnect` option) to refetch when the network\n\t* reconnects.\n\t*/\n\tshouldFetchOnReconnect() {\n\t\treturn shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnReconnect);\n\t}\n\t/**\n\t* Returns whether the observed query is currently stale and configured\n\t* (via the `refetchOnWindowFocus` option) to refetch when the window\n\t* regains focus.\n\t*/\n\tshouldFetchOnWindowFocus() {\n\t\treturn shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnWindowFocus);\n\t}\n\t/**\n\t* Stops observing the current query: clears all listeners, cancels the\n\t* stale and refetch-interval timers, and removes this observer from the\n\t* query it was observing.\n\t*/\n\tdestroy() {\n\t\tthis.listeners = /* @__PURE__ */ new Set();\n\t\tthis.#clearStaleTimeout();\n\t\tthis.#clearRefetchInterval();\n\t\tthis.#currentQuery.removeObserver(this);\n\t}\n\t/**\n\t* Updates the observer's options. This will re-resolve the query being\n\t* observed (switching to a different query if the `queryKey` changed),\n\t* trigger a fetch if the new options require one and the observer has\n\t* subscribers, recompute the current result, and reschedule the stale and\n\t* refetch-interval timers as needed.\n\t*\n\t* @example\n\t* ```ts\n\t* observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) })\n\t* // later: switch to a different query, reusing the same observer\n\t* observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) })\n\t* ```\n\t*/\n\tsetOptions(options) {\n\t\tconst prevOptions = this.options;\n\t\tconst prevQuery = this.#currentQuery;\n\t\tthis.options = this.#client.defaultQueryOptions(options);\n\t\tif (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\" && typeof this.options.enabled !== \"function\" && typeof resolveQueryValue(this.options.enabled, this.#currentQuery) !== \"boolean\") throw new Error(\"Expected enabled to be a boolean or a callback that returns a boolean\");\n\t\tthis.#updateQuery();\n\t\tthis.#currentQuery.setOptions(this.options);\n\t\tif (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) this.#client.getQueryCache().notify({\n\t\t\ttype: \"observerOptionsUpdated\",\n\t\t\tquery: this.#currentQuery,\n\t\t\tobserver: this\n\t\t});\n\t\tconst mounted = this.hasListeners();\n\t\tif (mounted && shouldFetchOptionally(this.#currentQuery, prevQuery, this.options, prevOptions)) this.#executeFetch();\n\t\tthis.updateResult();\n\t\tif (mounted && (this.#currentQuery !== prevQuery || resolveQueryValue(this.options.enabled, this.#currentQuery) !== resolveQueryValue(prevOptions.enabled, this.#currentQuery) || resolveQueryValue(this.options.staleTime, this.#currentQuery) !== resolveQueryValue(prevOptions.staleTime, this.#currentQuery))) this.#updateStaleTimeout();\n\t\tconst nextRefetchInterval = this.#computeRefetchInterval();\n\t\tif (mounted && (this.#currentQuery !== prevQuery || resolveQueryValue(this.options.enabled, this.#currentQuery) !== resolveQueryValue(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) this.#updateRefetchInterval(nextRefetchInterval);\n\t}\n\t/**\n\t* Computes the result the observer would produce for the given (already-defaulted) options\n\t* right now, building the underlying `Query` if it doesn't exist yet, without waiting for a\n\t* subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the\n\t* returned value is available synchronously, ahead of `setOptions` triggering an actual fetch.\n\t*/\n\tgetOptimisticResult(options) {\n\t\tconst query = this.#client.getQueryCache().build(this.#client, options);\n\t\tconst result = this.createResult(query, options);\n\t\tif (!shallowEqualObjects(this.getCurrentResult(), result)) {\n\t\t\tthis.#currentResult = result;\n\t\t\tthis.#currentResultOptions = this.options;\n\t\t\tthis.#currentResultState = this.#currentQuery.state;\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* Returns the most recently computed `QueryObserverResult` for the\n\t* observed query. This is a point-in-time read; to be notified of updates\n\t* as they happen, subscribe to the observer instead (its inherited\n\t* `subscribe` method).\n\t*\n\t* @example\n\t* ```ts\n\t* const result = observer.getCurrentResult()\n\t* console.log(result.status, result.data)\n\t* ```\n\t*/\n\tgetCurrentResult() {\n\t\treturn this.#currentResult;\n\t}\n\t/**\n\t* Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via\n\t* {@link QueryObserver#trackProp} (and an optional `onPropTracked` callback). Used by framework\n\t* adapters when `notifyOnChangeProps` is not set, to implement its default \"only re-render on\n\t* properties you actually read\" behavior.\n\t*/\n\ttrackResult(result, onPropTracked) {\n\t\treturn new Proxy(result, { get: (target, key) => {\n\t\t\tthis.trackProp(key);\n\t\t\tonPropTracked?.(key);\n\t\t\treturn Reflect.get(target, key);\n\t\t} });\n\t}\n\t/**\n\t* Records that the given `QueryObserverResult` property was read, so a subsequent update only\n\t* notifies this observer if a tracked property actually changed. Normally called indirectly via\n\t* {@link QueryObserver#trackResult}'s proxy; exposed directly for adapters that track property\n\t* access themselves (e.g. through their own reactivity system) instead of via the proxy.\n\t*/\n\ttrackProp(key) {\n\t\tthis.#trackedProps.add(key);\n\t}\n\t/**\n\t* Returns the `Query` instance this observer is currently observing.\n\t*/\n\tgetCurrentQuery() {\n\t\treturn this.#currentQuery;\n\t}\n\t/**\n\t* Refetches the observed query and returns a promise that resolves with\n\t* the resulting `QueryObserverResult`.\n\t*\n\t* @example\n\t* ```ts\n\t* const result = await observer.refetch({ cancelRefetch: false })\n\t* console.log(result.data)\n\t* ```\n\t*/\n\trefetch({ ...options } = {}) {\n\t\treturn this.fetch({ ...options });\n\t}\n\t/**\n\t* Fetches a query defined by the given options without affecting this\n\t* observer's own tracked query or result, and returns a promise that\n\t* resolves with the `QueryObserverResult` for that fetch. This is useful\n\t* for prefetching data that another observer (e.g. a query about to be\n\t* navigated to) will need, ahead of time.\n\t*\n\t* @example\n\t* ```ts\n\t* const result = await observer.fetchOptimistic({\n\t* queryKey: ['posts', 2],\n\t* queryFn: () => fetchPost(2),\n\t* })\n\t* console.log(result.data)\n\t* ```\n\t*/\n\tfetchOptimistic(options) {\n\t\tconst defaultedOptions = this.#client.defaultQueryOptions(options);\n\t\tconst query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n\t\tlet unsubscribe = () => {};\n\t\tlet resolveEarly;\n\t\tconst cachePromise = new Promise((resolve) => {\n\t\t\tresolveEarly = resolve;\n\t\t\tunsubscribe = this.#client.getQueryCache().subscribe((event) => {\n\t\t\t\tif (event.type === \"updated\" && event.query.queryHash === query.queryHash && query.state.data !== void 0) {\n\t\t\t\t\tunsubscribe();\n\t\t\t\t\tresolve(this.createResult(query, defaultedOptions));\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\treturn Promise.race([query.fetch().then(() => {\n\t\t\tconst result = this.createResult(query, defaultedOptions);\n\t\t\tresolveEarly?.(result);\n\t\t\treturn result;\n\t\t}).finally(() => {\n\t\t\tunsubscribe();\n\t\t}), cachePromise]);\n\t}\n\tfetch(fetchOptions) {\n\t\treturn this.#executeFetch({\n\t\t\t...fetchOptions,\n\t\t\tcancelRefetch: fetchOptions.cancelRefetch ?? true\n\t\t}).then(() => {\n\t\t\tthis.updateResult();\n\t\t\treturn this.#currentResult;\n\t\t});\n\t}\n\t#executeFetch(fetchOptions) {\n\t\tthis.#updateQuery();\n\t\tlet promise = this.#currentQuery.fetch(this.options, fetchOptions);\n\t\tif (!fetchOptions?.throwOnError) promise = promise.catch(noop);\n\t\treturn promise;\n\t}\n\t#shouldScheduleTimer(timeout) {\n\t\treturn !isServer() && resolveQueryValue(this.options.enabled, this.#currentQuery) !== false && isValidTimeout(timeout);\n\t}\n\t#updateStaleTimeout() {\n\t\tthis.#clearStaleTimeout();\n\t\tconst staleTime = resolveQueryValue(this.options.staleTime, this.#currentQuery);\n\t\tif (this.#currentResult.isStale || !this.#shouldScheduleTimer(staleTime)) return;\n\t\tconst timeout = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime) + 1;\n\t\tthis.#staleTimeoutId = timeoutManager.setTimeout(() => {\n\t\t\tif (!this.#currentResult.isStale) this.updateResult();\n\t\t}, timeout);\n\t}\n\t#computeRefetchInterval() {\n\t\treturn resolveQueryValue(this.options.refetchInterval, this.#currentQuery) ?? false;\n\t}\n\t#updateRefetchInterval(nextInterval) {\n\t\tthis.#clearRefetchInterval();\n\t\tthis.#currentRefetchInterval = nextInterval;\n\t\tif (this.#currentRefetchInterval === 0 || !this.#shouldScheduleTimer(this.#currentRefetchInterval)) return;\n\t\tthis.#refetchIntervalId = timeoutManager.setInterval(() => {\n\t\t\tif (this.options.refetchIntervalInBackground || focusManager.isFocused()) this.#executeFetch();\n\t\t}, this.#currentRefetchInterval);\n\t}\n\t#updateTimers() {\n\t\tthis.#updateStaleTimeout();\n\t\tthis.#updateRefetchInterval(this.#computeRefetchInterval());\n\t}\n\t#clearStaleTimeout() {\n\t\tif (this.#staleTimeoutId !== void 0) {\n\t\t\ttimeoutManager.clearTimeout(this.#staleTimeoutId);\n\t\t\tthis.#staleTimeoutId = void 0;\n\t\t}\n\t}\n\t#clearRefetchInterval() {\n\t\tif (this.#refetchIntervalId !== void 0) {\n\t\t\ttimeoutManager.clearInterval(this.#refetchIntervalId);\n\t\t\tthis.#refetchIntervalId = void 0;\n\t\t}\n\t}\n\tcreateResult(query, options) {\n\t\tconst prevQuery = this.#currentQuery;\n\t\tconst prevOptions = this.options;\n\t\tconst prevResult = this.#currentResult;\n\t\tconst prevResultState = this.#currentResultState;\n\t\tconst prevResultOptions = this.#currentResultOptions;\n\t\tconst queryInitialState = query !== prevQuery ? query.state : this.#currentQueryInitialState;\n\t\tconst { state } = query;\n\t\tlet newState = { ...state };\n\t\tlet isPlaceholderData = false;\n\t\tlet data;\n\t\tif (options._optimisticResults) {\n\t\t\tconst mounted = this.hasListeners();\n\t\t\tconst fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n\t\t\tconst fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n\t\t\tif (fetchOnMount || fetchOptionally) newState = {\n\t\t\t\t...newState,\n\t\t\t\t...fetchState(state.data, query.options)\n\t\t\t};\n\t\t\tif (options._optimisticResults === \"isRestoring\") newState.fetchStatus = \"idle\";\n\t\t}\n\t\tlet { error, errorUpdatedAt, status } = newState;\n\t\tdata = newState.data;\n\t\tlet skipSelect = false;\n\t\tif (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n\t\t\tlet placeholderData;\n\t\t\tif (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {\n\t\t\t\tplaceholderData = prevResult.data;\n\t\t\t\tskipSelect = true;\n\t\t\t} else placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(this.#lastQueryWithDefinedData?.state.data, this.#lastQueryWithDefinedData) : options.placeholderData;\n\t\t\tif (placeholderData !== void 0) {\n\t\t\t\tstatus = \"success\";\n\t\t\t\tdata = replaceData(prevResult?.data, placeholderData, options);\n\t\t\t\tisPlaceholderData = true;\n\t\t\t}\n\t\t}\n\t\tif (options.select && data !== void 0 && !skipSelect) {\n\t\t\tif (prevResult && data === prevResultState?.data && options.select === this.#selectFn) data = this.#selectResult;\n\t\t\telse try {\n\t\t\t\tthis.#selectFn = options.select;\n\t\t\t\tdata = options.select(data);\n\t\t\t\tdata = replaceData(prevResult?.data, data, options);\n\t\t\t\tthis.#selectResult = data;\n\t\t\t\tthis.#selectError = null;\n\t\t\t} catch (selectError) {\n\t\t\t\tthis.#selectError = selectError;\n\t\t\t}\n\t\t} else if (data === void 0) this.#selectError = null;\n\t\tif (this.#selectError) {\n\t\t\terror = this.#selectError;\n\t\t\tdata = this.#selectResult;\n\t\t\terrorUpdatedAt = Date.now();\n\t\t\tstatus = \"error\";\n\t\t\tisPlaceholderData = false;\n\t\t}\n\t\tconst isFetching = newState.fetchStatus === \"fetching\";\n\t\tconst isPending = status === \"pending\";\n\t\tconst isError = status === \"error\";\n\t\tconst isLoading = isPending && isFetching;\n\t\tconst hasData = data !== void 0;\n\t\treturn {\n\t\t\tstatus,\n\t\t\tfetchStatus: newState.fetchStatus,\n\t\t\tisPending,\n\t\t\tisSuccess: status === \"success\",\n\t\t\tisError,\n\t\t\tisInitialLoading: isLoading,\n\t\t\tisLoading,\n\t\t\tdata,\n\t\t\tdataUpdatedAt: newState.dataUpdatedAt,\n\t\t\terror,\n\t\t\terrorUpdatedAt,\n\t\t\tfailureCount: newState.fetchFailureCount,\n\t\t\tfailureReason: newState.fetchFailureReason,\n\t\t\terrorUpdateCount: newState.errorUpdateCount,\n\t\t\tisFetched: query.isFetched(),\n\t\t\tisFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n\t\t\tisFetching,\n\t\t\tisRefetching: isFetching && !isPending,\n\t\t\tisLoadingError: isError && !hasData,\n\t\t\tisPaused: newState.fetchStatus === \"paused\",\n\t\t\tisPlaceholderData,\n\t\t\tisRefetchError: isError && hasData,\n\t\t\tisStale: isStale(query, options),\n\t\t\trefetch: this.refetch,\n\t\t\tisEnabled: resolveQueryValue(options.enabled, query) !== false\n\t\t};\n\t}\n\t/**\n\t* Recomputes and stores the current result from the current query/options, notifying listeners\n\t* if it changed. Framework adapters call this right after subscribing to make sure no query\n\t* update was missed in the gap between creating the observer and subscribing to it.\n\t*/\n\tupdateResult() {\n\t\tconst prevResult = this.#currentResult;\n\t\tconst nextResult = this.createResult(this.#currentQuery, this.options);\n\t\tthis.#currentResultState = this.#currentQuery.state;\n\t\tthis.#currentResultOptions = this.options;\n\t\tif (this.#currentResultState.data !== void 0) this.#lastQueryWithDefinedData = this.#currentQuery;\n\t\tif (shallowEqualObjects(nextResult, prevResult)) return;\n\t\tthis.#currentResult = nextResult;\n\t\tconst shouldNotifyListeners = () => {\n\t\t\tif (!prevResult) return true;\n\t\t\tconst { notifyOnChangeProps } = this.options;\n\t\t\tconst notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n\t\t\tif (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) return true;\n\t\t\tconst includedProps = new Set(notifyOnChangePropsValue ?? this.#trackedProps);\n\t\t\tif (this.options.throwOnError) includedProps.add(\"error\");\n\t\t\treturn Object.keys(this.#currentResult).some((key) => {\n\t\t\t\tconst typedKey = key;\n\t\t\t\treturn this.#currentResult[typedKey] !== prevResult[typedKey] && includedProps.has(typedKey);\n\t\t\t});\n\t\t};\n\t\tconst notifyListeners = shouldNotifyListeners();\n\t\tnotifyManager.batch(() => {\n\t\t\tif (notifyListeners) this.listeners.forEach((listener) => {\n\t\t\t\tlistener(this.#currentResult);\n\t\t\t});\n\t\t\tthis.#client.getQueryCache().notify({\n\t\t\t\tquery: this.#currentQuery,\n\t\t\t\ttype: \"observerResultsUpdated\"\n\t\t\t});\n\t\t});\n\t}\n\t#updateQuery() {\n\t\tconst query = this.#client.getQueryCache().build(this.#client, this.options);\n\t\tif (query === this.#currentQuery) return;\n\t\tconst prevQuery = this.#currentQuery;\n\t\tthis.#currentQuery = query;\n\t\tthis.#currentQueryInitialState = query.state;\n\t\tif (this.hasListeners()) {\n\t\t\tprevQuery?.removeObserver(this);\n\t\t\tquery.addObserver(this);\n\t\t}\n\t}\n\t/** @internal */\n\tonQueryUpdate() {\n\t\tthis.updateResult();\n\t\tif (this.hasListeners()) this.#updateTimers();\n\t}\n};\nfunction shouldLoadOnMount(query, options) {\n\treturn resolveQueryValue(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === \"error\" && resolveQueryValue(options.retryOnMount, query) === false);\n}\nfunction shouldFetchOnMount(query, options) {\n\treturn shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\nfunction shouldFetchOn(query, options, field) {\n\tif (resolveQueryValue(options.enabled, query) !== false && resolveQueryValue(options.staleTime, query) !== \"static\") {\n\t\tconst value = resolveQueryValue(field, query);\n\t\treturn value === \"always\" || value !== false && isStale(query, options);\n\t}\n\treturn false;\n}\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n\treturn (query !== prevQuery || resolveQueryValue(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\nfunction isStale(query, options) {\n\treturn resolveQueryValue(options.enabled, query) !== false && query.isStaleByTime(resolveQueryValue(options.staleTime, query));\n}\n//#endregion\nexport { QueryObserver };\n\n//# sourceMappingURL=queryObserver.js.map","import { notifyManager } from \"./notifyManager.js\";\nimport { createRetryer } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\n//#region src/mutation.ts\n/**\n* Represents a single mutation attempt. A `Mutation` holds the mutation's\n* options, state (data/error/status), and the `MutationObserver`s currently\n* subscribed to it.\n*\n* Instances are created and managed internally by `MutationCache`; application\n* code typically interacts with mutations indirectly through `QueryClient` or\n* a framework hook like `useMutation`. Direct access to a `Mutation` instance\n* is possible via `mutationCache.find()`/`getAll()` for inspecting cache state.\n*\n* @example\n* ```ts\n* const mutationCache = queryClient.getMutationCache()\n*\n* const mutation = mutationCache.find({ mutationKey: ['addPost'] })\n* ```\n*/\nvar Mutation = class extends Removable {\n\t#client;\n\t#observers;\n\t#mutationCache;\n\t#retryer;\n\tconstructor(config) {\n\t\tsuper();\n\t\tthis.#client = config.client;\n\t\tthis.mutationId = config.mutationId;\n\t\tthis.#mutationCache = config.mutationCache;\n\t\tthis.#observers = [];\n\t\tthis.state = config.state || getDefaultState();\n\t\tthis.setOptions(config.options);\n\t\tthis.scheduleGc();\n\t}\n\t/** @internal */\n\tsetOptions(options) {\n\t\tthis.options = options;\n\t\tthis.updateGcTime(this.options.gcTime);\n\t}\n\t/**\n\t* The `meta` object passed in the mutation's options, if any.\n\t*/\n\tget meta() {\n\t\treturn this.options.meta;\n\t}\n\t/** @internal */\n\taddObserver(observer) {\n\t\tif (!this.#observers.includes(observer)) {\n\t\t\tthis.#observers.push(observer);\n\t\t\tthis.clearGcTimeout();\n\t\t\tthis.#mutationCache.notify({\n\t\t\t\ttype: \"observerAdded\",\n\t\t\t\tmutation: this,\n\t\t\t\tobserver\n\t\t\t});\n\t\t}\n\t}\n\t/** @internal */\n\tremoveObserver(observer) {\n\t\tthis.#observers = this.#observers.filter((x) => x !== observer);\n\t\tthis.scheduleGc();\n\t\tthis.#mutationCache.notify({\n\t\t\ttype: \"observerRemoved\",\n\t\t\tmutation: this,\n\t\t\tobserver\n\t\t});\n\t}\n\toptionalRemove() {\n\t\tif (!this.#observers.length) {\n\t\t\tif (this.state.status === \"pending\") this.scheduleGc();\n\t\t\telse this.#mutationCache.remove(this);\n\t\t}\n\t}\n\t/**\n\t* Resumes a mutation that is currently paused or was restored from a\n\t* dehydrated, still-`pending` state.\n\t*\n\t* - If this mutation has an active retryer (it paused mid-attempt, e.g. due\n\t* to the network mode or scope-based queuing), its retryer is resumed.\n\t* - Otherwise, if the mutation's status is still `pending` (e.g. it was\n\t* dehydrated while an attempt was in flight and never got a retryer in\n\t* this instance), `execute` is called again with the last known variables.\n\t* - Otherwise the mutation has already settled and this resolves immediately\n\t* without running anything again.\n\t*\n\t* @example\n\t* ```ts\n\t* // typically driven by reconnect handling, e.g. queryClient.resumePausedMutations()\n\t* const mutation = mutationCache.find({ mutationKey: ['addPost'] })\n\t* await mutation?.continue()\n\t* ```\n\t*\n\t* @see {@link Mutation#execute}\n\t*/\n\tcontinue() {\n\t\treturn this.#retryer?.continue() ?? (this.state.status === \"pending\" ? this.execute(this.state.variables) : Promise.resolve());\n\t}\n\t/**\n\t* Runs the mutation function for the given variables through a retryer, and\n\t* drives the mutation's state and lifecycle callbacks through to settlement.\n\t*\n\t* If this mutation's state is already `pending` when `execute` is called\n\t* (i.e. it was restored, still in-flight, from a dehydrated state), the\n\t* `onMutate` step is skipped and a `continue` action is dispatched to\n\t* unpause it; otherwise a `pending` action is dispatched first, then the\n\t* mutation cache's `onMutate` and the mutation's own `onMutate` option are\n\t* awaited in that order, and the resulting context is stored.\n\t*\n\t* The mutation function is then run (subject to `retry`/`retryDelay`/\n\t* `networkMode`, and to the mutation cache's scope-based serialization).\n\t* On success, the cache's `onSuccess`/`onSettled` callbacks run before the\n\t* mutation's own `onSuccess`/`onSettled` options, a `success` action is\n\t* dispatched, and the resolved data is returned. On failure, the same\n\t* cache-then-option ordering is used for `onError`/`onSettled`, but each of\n\t* those four callbacks is individually caught so that a throwing callback\n\t* cannot mask the original error; an `error` action is then dispatched and\n\t* the original error is re-thrown.\n\t*\n\t* @example\n\t* ```ts\n\t* // Called internally by `MutationObserver.mutate` and `Mutation.continue` —\n\t* // applications normally trigger mutations through those, not this method.\n\t* const data = await mutation.execute(variables)\n\t* ```\n\t*\n\t* @see {@link Mutation#continue}\n\t*/\n\tasync execute(variables) {\n\t\tconst onContinue = () => {\n\t\t\tthis.#dispatch({ type: \"continue\" });\n\t\t};\n\t\tconst mutationFnContext = {\n\t\t\tclient: this.#client,\n\t\t\tmeta: this.options.meta,\n\t\t\tmutationKey: this.options.mutationKey\n\t\t};\n\t\tconst retryer = this.#retryer = createRetryer({\n\t\t\tfn: () => {\n\t\t\t\tif (!this.options.mutationFn) return Promise.reject(/* @__PURE__ */ new Error(\"No mutationFn found\"));\n\t\t\t\treturn this.options.mutationFn(variables, mutationFnContext);\n\t\t\t},\n\t\t\tonFail: (failureCount, error) => {\n\t\t\t\tthis.#dispatch({\n\t\t\t\t\ttype: \"failed\",\n\t\t\t\t\tfailureCount,\n\t\t\t\t\terror\n\t\t\t\t});\n\t\t\t},\n\t\t\tonPause: () => {\n\t\t\t\tthis.#dispatch({ type: \"pause\" });\n\t\t\t},\n\t\t\tonContinue,\n\t\t\tretry: this.options.retry ?? 0,\n\t\t\tretryDelay: this.options.retryDelay,\n\t\t\tnetworkMode: this.options.networkMode,\n\t\t\tcanRun: () => this.#mutationCache.canRun(this)\n\t\t});\n\t\tconst restored = this.state.status === \"pending\";\n\t\tconst isPaused = !retryer.canStart();\n\t\ttry {\n\t\t\tif (restored) onContinue();\n\t\t\telse {\n\t\t\t\tthis.#dispatch({\n\t\t\t\t\ttype: \"pending\",\n\t\t\t\t\tvariables,\n\t\t\t\t\tisPaused\n\t\t\t\t});\n\t\t\t\tif (this.#mutationCache.config.onMutate) await this.#mutationCache.config.onMutate(variables, this, mutationFnContext);\n\t\t\t\tconst context = await this.options.onMutate?.(variables, mutationFnContext);\n\t\t\t\tif (context !== this.state.context) this.#dispatch({\n\t\t\t\t\ttype: \"pending\",\n\t\t\t\t\tcontext,\n\t\t\t\t\tvariables,\n\t\t\t\t\tisPaused\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst data = await retryer.start();\n\t\t\tawait this.#mutationCache.config.onSuccess?.(data, variables, this.state.context, this, mutationFnContext);\n\t\t\tawait this.options.onSuccess?.(data, variables, this.state.context, mutationFnContext);\n\t\t\tawait this.#mutationCache.config.onSettled?.(data, null, this.state.variables, this.state.context, this, mutationFnContext);\n\t\t\tawait this.options.onSettled?.(data, null, variables, this.state.context, mutationFnContext);\n\t\t\tthis.#dispatch({\n\t\t\t\ttype: \"success\",\n\t\t\t\tdata\n\t\t\t});\n\t\t\treturn data;\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait this.#mutationCache.config.onError?.(error, variables, this.state.context, this, mutationFnContext);\n\t\t\t} catch (e) {\n\t\t\t\tPromise.reject(e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait this.options.onError?.(error, variables, this.state.context, mutationFnContext);\n\t\t\t} catch (e) {\n\t\t\t\tPromise.reject(e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait this.#mutationCache.config.onSettled?.(void 0, error, this.state.variables, this.state.context, this, mutationFnContext);\n\t\t\t} catch (e) {\n\t\t\t\tPromise.reject(e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait this.options.onSettled?.(void 0, error, variables, this.state.context, mutationFnContext);\n\t\t\t} catch (e) {\n\t\t\t\tPromise.reject(e);\n\t\t\t}\n\t\t\tthis.#dispatch({\n\t\t\t\ttype: \"error\",\n\t\t\t\terror\n\t\t\t});\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tif (this.#retryer === retryer) this.#retryer = void 0;\n\t\t\tthis.#mutationCache.runNext(this);\n\t\t}\n\t}\n\t#dispatch(action) {\n\t\tconst reducer = (state) => {\n\t\t\tswitch (action.type) {\n\t\t\t\tcase \"failed\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tfailureCount: action.failureCount,\n\t\t\t\t\tfailureReason: action.error\n\t\t\t\t};\n\t\t\t\tcase \"pause\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tisPaused: true\n\t\t\t\t};\n\t\t\t\tcase \"continue\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tisPaused: false\n\t\t\t\t};\n\t\t\t\tcase \"pending\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tcontext: action.context,\n\t\t\t\t\tdata: void 0,\n\t\t\t\t\tfailureCount: 0,\n\t\t\t\t\tfailureReason: null,\n\t\t\t\t\terror: null,\n\t\t\t\t\tisPaused: action.isPaused,\n\t\t\t\t\tstatus: \"pending\",\n\t\t\t\t\tvariables: action.variables,\n\t\t\t\t\tsubmittedAt: Date.now()\n\t\t\t\t};\n\t\t\t\tcase \"success\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tdata: action.data,\n\t\t\t\t\tfailureCount: 0,\n\t\t\t\t\tfailureReason: null,\n\t\t\t\t\terror: null,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\tisPaused: false\n\t\t\t\t};\n\t\t\t\tcase \"error\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tdata: void 0,\n\t\t\t\t\terror: action.error,\n\t\t\t\t\tfailureCount: state.failureCount + 1,\n\t\t\t\t\tfailureReason: action.error,\n\t\t\t\t\tisPaused: false,\n\t\t\t\t\tstatus: \"error\"\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t\tthis.state = reducer(this.state);\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.#observers.forEach((observer) => {\n\t\t\t\tobserver.onMutationUpdate(action);\n\t\t\t});\n\t\t\tthis.#mutationCache.notify({\n\t\t\t\tmutation: this,\n\t\t\t\ttype: \"updated\",\n\t\t\t\taction\n\t\t\t});\n\t\t});\n\t}\n};\nfunction getDefaultState() {\n\treturn {\n\t\tcontext: void 0,\n\t\tdata: void 0,\n\t\terror: null,\n\t\tfailureCount: 0,\n\t\tfailureReason: null,\n\t\tisPaused: false,\n\t\tstatus: \"idle\",\n\t\tvariables: void 0,\n\t\tsubmittedAt: 0\n\t};\n}\n//#endregion\nexport { Mutation, getDefaultState };\n\n//# sourceMappingURL=mutation.js.map","import { matchMutation, noop } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Mutation } from \"./mutation.js\";\n//#region src/mutationCache.ts\n/**\n* The `MutationCache` is the storage for mutations.\n*\n* Normally, you will not interact with the `MutationCache` directly and instead use a\n* `QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of\n* safe/known updates to the cache, such as mutations being added, removed, or updated.\n*\n* @example\n* ```ts\n* const unsubscribe = mutationCache.subscribe((event) => {\n* console.log(event.type, event.mutation)\n* })\n* ```\n*/\nvar MutationCache = class extends Subscribable {\n\t#mutations;\n\t#scopes;\n\t#mutationId;\n\tconstructor(config = {}) {\n\t\tsuper();\n\t\tthis.config = config;\n\t\tthis.#mutations = /* @__PURE__ */ new Set();\n\t\tthis.#scopes = /* @__PURE__ */ new Map();\n\t\tthis.#mutationId = 0;\n\t}\n\t/** @internal */\n\tbuild(client, options, state) {\n\t\tconst mutation = new Mutation({\n\t\t\tclient,\n\t\t\tmutationCache: this,\n\t\t\tmutationId: ++this.#mutationId,\n\t\t\toptions: client.defaultMutationOptions(options),\n\t\t\tstate\n\t\t});\n\t\tthis.add(mutation);\n\t\treturn mutation;\n\t}\n\t/** @internal */\n\tadd(mutation) {\n\t\tthis.#mutations.add(mutation);\n\t\tconst scope = scopeFor(mutation);\n\t\tif (typeof scope === \"string\") {\n\t\t\tconst scopedMutations = this.#scopes.get(scope);\n\t\t\tif (scopedMutations) scopedMutations.push(mutation);\n\t\t\telse this.#scopes.set(scope, [mutation]);\n\t\t}\n\t\tthis.notify({\n\t\t\ttype: \"added\",\n\t\t\tmutation\n\t\t});\n\t}\n\t/** @internal */\n\tremove(mutation) {\n\t\tif (this.#mutations.delete(mutation)) {\n\t\t\tconst scope = scopeFor(mutation);\n\t\t\tif (typeof scope === \"string\") {\n\t\t\t\tconst scopedMutations = this.#scopes.get(scope);\n\t\t\t\tif (scopedMutations) {\n\t\t\t\t\tif (scopedMutations.length > 1) {\n\t\t\t\t\t\tconst index = scopedMutations.indexOf(mutation);\n\t\t\t\t\t\tif (index !== -1) scopedMutations.splice(index, 1);\n\t\t\t\t\t} else if (scopedMutations[0] === mutation) this.#scopes.delete(scope);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.notify({\n\t\t\ttype: \"removed\",\n\t\t\tmutation\n\t\t});\n\t}\n\t/** @internal */\n\tcanRun(mutation) {\n\t\tconst scope = scopeFor(mutation);\n\t\tif (typeof scope === \"string\") {\n\t\t\tconst firstPendingMutation = this.#scopes.get(scope)?.find((m) => m.state.status === \"pending\");\n\t\t\treturn !firstPendingMutation || firstPendingMutation === mutation;\n\t\t} else return true;\n\t}\n\t/** @internal */\n\trunNext(mutation) {\n\t\tconst scope = scopeFor(mutation);\n\t\tif (typeof scope === \"string\") return (this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused))?.continue() ?? Promise.resolve();\n\t\telse return Promise.resolve();\n\t}\n\t/**\n\t* Removes all mutations from the cache.\n\t*\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* mutationCache.clear()\n\t* ```\n\t*/\n\tclear() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.#mutations.forEach((mutation) => {\n\t\t\t\tthis.notify({\n\t\t\t\t\ttype: \"removed\",\n\t\t\t\t\tmutation\n\t\t\t\t});\n\t\t\t});\n\t\t\tthis.#mutations.clear();\n\t\t\tthis.#scopes.clear();\n\t\t});\n\t}\n\t/**\n\t* Returns all mutations within the cache.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about a mutation in rare scenarios.\n\t*\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* const mutations = mutationCache.getAll()\n\t* ```\n\t*/\n\tgetAll() {\n\t\treturn Array.from(this.#mutations);\n\t}\n\t/**\n\t* A slightly more advanced method that can be used to get an existing mutation instance from\n\t* the cache. If the mutation does not exist, `undefined` is returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about a mutation in rare scenarios.\n\t*\n\t* @see {@link MutationCache#findAll}\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* const mutation = mutationCache.find({ mutationKey: ['addPost'] })\n\t* ```\n\t*/\n\tfind(filters) {\n\t\tconst defaultedFilters = {\n\t\t\texact: true,\n\t\t\t...filters\n\t\t};\n\t\treturn this.getAll().find((mutation) => matchMutation(defaultedFilters, mutation));\n\t}\n\t/**\n\t* An even more advanced method that can be used to get existing mutation instances from the\n\t* cache that match the given filters. If no mutations match, an empty array is returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about mutations in rare scenarios.\n\t*\n\t* @see {@link MutationCache#find}\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* const mutations = mutationCache.findAll({ mutationKey: ['addPost'] })\n\t* ```\n\t*/\n\tfindAll(filters = {}) {\n\t\treturn this.getAll().filter((mutation) => matchMutation(filters, mutation));\n\t}\n\t/** @internal */\n\tnotify(event) {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(event);\n\t\t\t});\n\t\t});\n\t}\n\t/** @internal */\n\tresumePausedMutations() {\n\t\tconst pausedMutations = this.getAll().filter((x) => x.state.isPaused);\n\t\treturn notifyManager.batch(() => Promise.all(pausedMutations.map((mutation) => mutation.continue().catch(noop))));\n\t}\n};\nfunction scopeFor(mutation) {\n\treturn mutation.options.scope?.id;\n}\n//#endregion\nexport { MutationCache };\n\n//# sourceMappingURL=mutationCache.js.map","import { hashQueryKeyByOptions, matchQuery } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Query } from \"./query.js\";\n//#region src/queryCache.ts\n/**\n* The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta\n* information, and state of the queries it contains.\n*\n* Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient`\n* for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of\n* safe/known updates to the cache, such as queries being added, removed, or updated — updates made\n* outside of the cache's own tracked mechanisms (e.g. mutating a query's state object directly) do\n* not notify subscribers.\n*\n* @example\n* ```ts\n* const unsubscribe = queryCache.subscribe((event) => {\n* console.log(event.type, event.query)\n* })\n* ```\n*/\nvar QueryCache = class extends Subscribable {\n\t#queries;\n\tconstructor(config = {}) {\n\t\tsuper();\n\t\tthis.config = config;\n\t\tthis.#queries = /* @__PURE__ */ new Map();\n\t}\n\t/**\n\t* Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or\n\t* builds and adds a new one to the cache if none exists yet. Used by framework adapters and\n\t* plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing\n\t* the reactive `QueryObserver` machinery.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const query = queryCache.build(queryClient, {\n\t* queryKey: ['posts'],\n\t* queryFn: fetchPosts,\n\t* })\n\t* ```\n\t*/\n\tbuild(client, options, state) {\n\t\tconst queryKey = options.queryKey;\n\t\tconst queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);\n\t\tlet query = this.get(queryHash);\n\t\tif (!query) {\n\t\t\tquery = new Query({\n\t\t\t\tclient,\n\t\t\t\tqueryKey,\n\t\t\t\tqueryHash,\n\t\t\t\toptions: client.defaultQueryOptions(options),\n\t\t\t\tstate,\n\t\t\t\tdefaultOptions: client.getQueryDefaults(queryKey)\n\t\t\t});\n\t\t\tthis.add(query);\n\t\t}\n\t\treturn query;\n\t}\n\t/** @internal */\n\tadd(query) {\n\t\tif (!this.#queries.has(query.queryHash)) {\n\t\t\tthis.#queries.set(query.queryHash, query);\n\t\t\tthis.notify({\n\t\t\t\ttype: \"added\",\n\t\t\t\tquery\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Destroys the given `Query` and removes it from the cache, notifying subscribers with a\n\t* `'removed'` event. A no-op if the query is no longer the one currently stored under its hash\n\t* (e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror\n\t* removals across `QueryCache` instances.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t* const query = queryCache.find({ queryKey: ['posts'] })\n\t*\n\t* if (query) {\n\t* queryCache.remove(query)\n\t* }\n\t* ```\n\t*/\n\tremove(query) {\n\t\tif (this.#queries.get(query.queryHash) === query) {\n\t\t\tquery.destroy();\n\t\t\tthis.#queries.delete(query.queryHash);\n\t\t\tthis.notify({\n\t\t\t\ttype: \"removed\",\n\t\t\t\tquery\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Removes all queries from the cache.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* queryCache.clear()\n\t* ```\n\t*/\n\tclear() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.getAll().forEach((query) => {\n\t\t\t\tthis.remove(query);\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t* Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none\n\t* exists. Unlike {@link QueryCache#find}, this looks up by the already-computed hash rather\n\t* than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash\n\t* to look up directly.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t* const queryHash = hashKey(['posts'])\n\t*\n\t* const query = queryCache.get(queryHash)\n\t* ```\n\t*/\n\tget(queryHash) {\n\t\treturn this.#queries.get(queryHash);\n\t}\n\t/**\n\t* Returns all queries within the cache.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const queries = queryCache.getAll()\n\t* ```\n\t*/\n\tgetAll() {\n\t\treturn [...this.#queries.values()];\n\t}\n\t/**\n\t* A slightly more advanced method that can be used to get an existing query instance from the\n\t* cache. This instance not only contains all the state for the query, but all of the instances,\n\t* and underlying guts of the query as well. If the query does not exist, `undefined` is\n\t* returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to\n\t* decide whether a query is fresh enough to be used as an initial value).\n\t*\n\t* @see {@link QueryCache#findAll}\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const query = queryCache.find({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tfind(filters) {\n\t\tconst defaultedFilters = {\n\t\t\texact: true,\n\t\t\t...filters\n\t\t};\n\t\treturn this.getAll().find((query) => matchQuery(defaultedFilters, query));\n\t}\n\t/**\n\t* An even more advanced method that can be used to get existing query instances from the cache\n\t* that partially match a query key. If no queries match, an empty array is returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about queries in rare scenarios.\n\t*\n\t* @see {@link QueryCache#find}\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const queries = queryCache.findAll({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tfindAll(filters = {}) {\n\t\tconst queries = this.getAll();\n\t\treturn Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;\n\t}\n\t/** @internal */\n\tnotify(event) {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(event);\n\t\t\t});\n\t\t});\n\t}\n\t/** @internal */\n\tonFocus() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.getAll().forEach((query) => {\n\t\t\t\tquery.onFocus();\n\t\t\t});\n\t\t});\n\t}\n\t/** @internal */\n\tonOnline() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.getAll().forEach((query) => {\n\t\t\t\tquery.onOnline();\n\t\t\t});\n\t\t});\n\t}\n};\n//#endregion\nexport { QueryCache };\n\n//# sourceMappingURL=queryCache.js.map","import { functionalUpdate, hashKey, hashQueryKeyByOptions, noop, partialMatchKey, resolveQueryValue, skipToken } from \"./utils.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nimport { QueryCache } from \"./queryCache.js\";\n//#region src/queryClient.ts\n/**\n* `QueryClient` is used to interact with a cache of queries and mutations. It owns a\n* `QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds\n* the default options that are applied to queries and mutations created through it.\n*\n* @example\n* ```ts\n* const queryClient = new QueryClient({\n* defaultOptions: {\n* queries: {\n* staleTime: Infinity,\n* },\n* },\n* })\n*\n* await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts })\n* ```\n*/\nvar QueryClient = class {\n\t#queryCache;\n\t#mutationCache;\n\t#defaultOptions;\n\t#queryDefaults;\n\t#mutationDefaults;\n\t#mountCount;\n\t#unsubscribeFocus;\n\t#unsubscribeOnline;\n\tconstructor(config = {}) {\n\t\tthis.#queryCache = config.queryCache || new QueryCache();\n\t\tthis.#mutationCache = config.mutationCache || new MutationCache();\n\t\tthis.#defaultOptions = config.defaultOptions || {};\n\t\tthis.#queryDefaults = /* @__PURE__ */ new Map();\n\t\tthis.#mutationDefaults = /* @__PURE__ */ new Map();\n\t\tthis.#mountCount = 0;\n\t}\n\t/**\n\t* Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start\n\t* listening for focus/online events and resume paused mutations. Ref-counted via an internal\n\t* mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down\n\t* the shared listeners until the last one unmounts.\n\t*/\n\tmount() {\n\t\tthis.#mountCount++;\n\t\tif (this.#mountCount !== 1) return;\n\t\tthis.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n\t\t\tif (focused) {\n\t\t\t\tawait this.resumePausedMutations();\n\t\t\t\tthis.#queryCache.onFocus();\n\t\t\t}\n\t\t});\n\t\tthis.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n\t\t\tif (online) {\n\t\t\t\tawait this.resumePausedMutations();\n\t\t\t\tthis.#queryCache.onOnline();\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* The inverse of {@link QueryClient#mount} — called by a framework adapter's\n\t* `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online\n\t* listeners once the mount count returns to `0`.\n\t*/\n\tunmount() {\n\t\tthis.#mountCount--;\n\t\tif (this.#mountCount !== 0) return;\n\t\tthis.#unsubscribeFocus?.();\n\t\tthis.#unsubscribeFocus = void 0;\n\t\tthis.#unsubscribeOnline?.();\n\t\tthis.#unsubscribeOnline = void 0;\n\t}\n\t/**\n\t* Returns the number of queries in the cache that are currently fetching, optionally\n\t* matching a set of filters. This includes background-fetching, loading new pages, and\n\t* loading more infinite query results.\n\t*\n\t* @example\n\t* ```ts\n\t* if (queryClient.isFetching()) {\n\t* console.log('At least one query is fetching!')\n\t* }\n\t* ```\n\t*/\n\tisFetching(filters) {\n\t\treturn this.#queryCache.findAll({\n\t\t\t...filters,\n\t\t\tfetchStatus: \"fetching\"\n\t\t}).length;\n\t}\n\t/**\n\t* Returns the number of mutations in the cache that are currently pending, optionally\n\t* matching a set of filters.\n\t*\n\t* @example\n\t* ```ts\n\t* if (queryClient.isMutating()) {\n\t* console.log('At least one mutation is pending!')\n\t* }\n\t* ```\n\t*/\n\tisMutating(filters) {\n\t\treturn this.#mutationCache.findAll({\n\t\t\t...filters,\n\t\t\tstatus: \"pending\"\n\t\t}).length;\n\t}\n\t/**\n\t* Imperative (non-reactive) way to retrieve data for a QueryKey.\n\t* Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n\t*\n\t* Hint: Do not use this function inside a component, because it won't receive updates.\n\t* Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n\t*\n\t* @see {@link QueryClient#getQueriesData}\n\t*/\n\tgetQueryData(queryKey) {\n\t\tconst options = this.defaultQueryOptions({ queryKey });\n\t\treturn this.#queryCache.get(options.queryHash)?.state.data;\n\t}\n\t/**\n\t* @deprecated Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version.\n\t*/\n\tensureQueryData(options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions(options);\n\t\tconst query = this.#queryCache.build(this, defaultedOptions);\n\t\tconst cachedData = query.state.data;\n\t\tif (cachedData === void 0) return this.fetchQuery(options);\n\t\tif (options.revalidateIfStale && query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query))) this.prefetchQuery(defaultedOptions);\n\t\treturn Promise.resolve(cachedData);\n\t}\n\t/**\n\t* Imperative (non-reactive) way to retrieve the cached data of multiple queries at once.\n\t* Only queries matching the given filters are returned; if none match, an empty array is\n\t* returned.\n\t*\n\t* Because the matched queries can hold data of different shapes (e.g. a broad filter can match\n\t* queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather\n\t* than being inferred. Passing a more specific type is a convenience for call sites that know\n\t* every matched query holds the same shape — it is not checked against the actual cache\n\t* contents.\n\t*\n\t* @see {@link QueryClient#getQueryData}\n\t* @example\n\t* ```ts\n\t* const data = queryClient.getQueriesData({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tgetQueriesData(filters) {\n\t\treturn this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n\t\t\treturn [queryKey, state.data];\n\t\t});\n\t}\n\t/**\n\t* Synchronous way to immediately update a query's cached data. If the updater (or the value\n\t* passed) resolves to `undefined`, the cache is left untouched and no query is created;\n\t* otherwise, if the query does not exist yet, it will be created. To update multiple queries\n\t* at once by partially matching query keys, use {@link QueryClient#setQueriesData} instead.\n\t*\n\t* Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved\n\t* via {@link QueryClient#getQueryData}, in place.\n\t*\n\t* @param queryKey - The query key to set data for.\n\t* @param updater - Either the new data, or a function that receives the current data (which\n\t* may be `undefined`) and returns the new data.\n\t*\n\t* @example\n\t* ```ts\n\t* queryClient.setQueryData(['posts'], newPosts)\n\t*\n\t* // Or, using an updater function that receives the current data:\n\t* queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost])\n\t* ```\n\t*/\n\tsetQueryData(queryKey, updater, options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions({ queryKey });\n\t\tconst prevData = this.#queryCache.get(defaultedOptions.queryHash)?.state.data;\n\t\tconst data = functionalUpdate(updater, prevData);\n\t\tif (data === void 0) return;\n\t\treturn this.#queryCache.build(this, defaultedOptions).setData(data, {\n\t\t\t...options,\n\t\t\tmanual: true\n\t\t});\n\t}\n\t/**\n\t* Synchronous way to immediately update the cached data of multiple queries at once, using\n\t* filters or partial query key matching. Only queries that already exist and match the given\n\t* filters are updated; no new cache entries are created. Internally this calls\n\t* {@link QueryClient#setQueryData} for each matching query.\n\t*\n\t* @example\n\t* ```ts\n\t* queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) =>\n\t* oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts,\n\t* )\n\t* ```\n\t*/\n\tsetQueriesData(filters, updater, options) {\n\t\treturn notifyManager.batch(() => this.#queryCache.findAll(filters).map(({ queryKey }) => [queryKey, this.setQueryData(queryKey, updater, options)]));\n\t}\n\t/**\n\t* Imperative (non-reactive) way to retrieve an existing query's state. If the query does not\n\t* exist, `undefined` is returned.\n\t*\n\t* @example\n\t* ```ts\n\t* const state = queryClient.getQueryState(['posts'])\n\t* console.log(state?.dataUpdatedAt)\n\t* ```\n\t*/\n\tgetQueryState(queryKey) {\n\t\tconst options = this.defaultQueryOptions({ queryKey });\n\t\treturn this.#queryCache.get(options.queryHash)?.state;\n\t}\n\t/**\n\t* Removes queries from the cache that match the given filters. Unlike\n\t* {@link QueryClient#invalidateQueries} or {@link QueryClient#refetchQueries}, this removes\n\t* matching queries from the cache instead of refetching them. Without filters, every query in\n\t* the cache is removed.\n\t*\n\t* @example\n\t* ```ts\n\t* queryClient.removeQueries({ queryKey: ['posts'], exact: true })\n\t* ```\n\t*/\n\tremoveQueries(filters) {\n\t\tconst queryCache = this.#queryCache;\n\t\tnotifyManager.batch(() => {\n\t\t\tqueryCache.findAll(filters).forEach((query) => {\n\t\t\t\tqueryCache.remove(query);\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t* Resets queries matching the given filters back to their initial state (e.g. any\n\t* `initialData`), notifying subscribers rather than removing them. Active queries among the\n\t* matched set are then refetched, and the returned promise resolves once that refetch settles.\n\t*\n\t* @example\n\t* ```ts\n\t* await queryClient.resetQueries({ queryKey: ['posts'], exact: true })\n\t* ```\n\t*/\n\tresetQueries(filters, options) {\n\t\tconst queryCache = this.#queryCache;\n\t\treturn notifyManager.batch(() => {\n\t\t\tconst matched = queryCache.findAll(filters);\n\t\t\tconst queriesToRefetch = new Set(matched);\n\t\t\tmatched.forEach((query) => {\n\t\t\t\tquery.reset();\n\t\t\t});\n\t\t\treturn this.refetchQueries({\n\t\t\t\ttype: \"active\",\n\t\t\t\tpredicate: (query) => queriesToRefetch.has(query)\n\t\t\t}, options);\n\t\t});\n\t}\n\t/**\n\t* Cancels outgoing fetches for queries matching the given filters. Most useful when performing\n\t* optimistic updates, since any outgoing refetch that resolves afterwards would otherwise\n\t* overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is\n\t* reverted to its state before the outgoing fetch started.\n\t*\n\t* The returned promise never rejects, even if individual cancellations fail.\n\t*\n\t* @example\n\t* ```ts\n\t* await queryClient.cancelQueries({ queryKey: ['posts'], exact: true })\n\t* ```\n\t*/\n\tcancelQueries(filters, cancelOptions = {}) {\n\t\tconst defaultedCancelOptions = {\n\t\t\trevert: true,\n\t\t\t...cancelOptions\n\t\t};\n\t\tconst promises = notifyManager.batch(() => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)));\n\t\treturn Promise.all(promises).then(noop).catch(noop);\n\t}\n\t/**\n\t* Marks queries matching the given filters as invalidated. Unlike\n\t* {@link QueryClient#removeQueries}, invalidated queries stay in the cache.\n\t*\n\t* Unless `filters.refetchType` is `'none'`, matching queries are then refetched via\n\t* {@link QueryClient#refetchQueries}, using `filters.refetchType` if set, otherwise\n\t* `filters.type`, otherwise `'active'`.\n\t*\n\t* @example\n\t* ```ts\n\t* await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' })\n\t* ```\n\t*/\n\tinvalidateQueries(filters, options = {}) {\n\t\treturn notifyManager.batch(() => {\n\t\t\tthis.#queryCache.findAll(filters).forEach((query) => {\n\t\t\t\tquery.invalidate();\n\t\t\t});\n\t\t\tif (filters?.refetchType === \"none\") return Promise.resolve();\n\t\t\treturn this.refetchQueries({\n\t\t\t\t...filters,\n\t\t\t\ttype: filters?.refetchType ?? filters?.type ?? \"active\"\n\t\t\t}, options);\n\t\t});\n\t}\n\t/**\n\t* Refetches queries matching the given filters, regardless of whether they are stale. Without\n\t* filters, every query in the cache is refetched. Queries that are disabled, or static (only\n\t* have observers with a static `staleTime`), are never refetched.\n\t*\n\t* By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new\n\t* one starts. The returned promise resolves once all matching queries have settled; it does\n\t* not reject on individual query failures unless `throwOnError` is set.\n\t*\n\t* @example\n\t* ```ts\n\t* // refetch all active queries partially matching a query key:\n\t* await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' })\n\t* ```\n\t*/\n\trefetchQueries(filters, options = {}) {\n\t\tconst fetchOptions = {\n\t\t\t...options,\n\t\t\tcancelRefetch: options.cancelRefetch ?? true\n\t\t};\n\t\tconst promises = notifyManager.batch(() => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {\n\t\t\tlet promise = query.fetch(void 0, fetchOptions);\n\t\t\tif (!fetchOptions.throwOnError) promise = promise.catch(noop);\n\t\t\treturn query.state.fetchStatus === \"paused\" ? Promise.resolve() : promise;\n\t\t}));\n\t\treturn Promise.all(promises).then(noop);\n\t}\n\t/**\n\t* Asynchronous method to fetch and cache a query, resolving with the data or throwing with\n\t* the error.\n\t*\n\t* If the query already exists in the cache and its data is not stale (per the given\n\t* `staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched\n\t* and the promise resolves once the fetch settles. If a `select` function is provided, it is\n\t* applied to the data in both cases (cached or freshly fetched) before it is returned.\n\t*\n\t* Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless\n\t* explicitly configured, since there is no component to catch a thrown error and retry through\n\t* re-render.\n\t*\n\t* The accepted options are `QueryObserverOptions` minus the fields that only make sense for a\n\t* reactive observer — `enabled`, `refetchInterval`, `refetchIntervalInBackground`,\n\t* `refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`,\n\t* `notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this\n\t* method's options.\n\t*\n\t* This method replaces the deprecated `fetchQuery`, and — combined with\n\t* `{ staleTime: 'static' }` — the deprecated `ensureQueryData`.\n\t*\n\t* @example\n\t* ```ts\n\t* try {\n\t* const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 })\n\t* } catch (error) {\n\t* console.log(error)\n\t* }\n\t* ```\n\t*/\n\tasync query(options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions(options);\n\t\tif (defaultedOptions.retry === void 0) defaultedOptions.retry = false;\n\t\tconst query = this.#queryCache.build(this, defaultedOptions);\n\t\tconst queryData = query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query)) ? await query.fetch(defaultedOptions) : query.state.data;\n\t\tconst select = defaultedOptions.select;\n\t\tif (select) return select(queryData);\n\t\treturn queryData;\n\t}\n\t/**\n\t* @deprecated Use queryClient.query(options) instead. This method will be removed in the next major version.\n\t*/\n\tfetchQuery(options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions(options);\n\t\tif (defaultedOptions.retry === void 0) defaultedOptions.retry = false;\n\t\tconst query = this.#queryCache.build(this, defaultedOptions);\n\t\treturn query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query)) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n\t}\n\t/**\n\t* @deprecated Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.\n\t*/\n\tprefetchQuery(options) {\n\t\treturn this.fetchQuery(options).then(noop).catch(noop);\n\t}\n\t/**\n\t* Asynchronous method to fetch and cache an infinite query, resolving with an\n\t* {@link InfiniteData} object or throwing with the error.\n\t*\n\t* Behaves like {@link QueryClient#query}, accepting the same options (minus\n\t* `initialPageParam`), plus the required `initialPageParam`, and an optional `pages` /\n\t* `getNextPageParam` pair used to refetch a fixed number of pages from the start.\n\t*\n\t* This method replaces the deprecated `fetchInfiniteQuery`, and — combined with\n\t* `{ staleTime: 'static' }` — the deprecated `ensureInfiniteQueryData`.\n\t*\n\t* @example\n\t* ```ts\n\t* try {\n\t* const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 })\n\t* console.log(data.pages)\n\t* } catch (error) {\n\t* console.log(error)\n\t* }\n\t* ```\n\t*/\n\tinfiniteQuery(options) {\n\t\toptions._type = \"infinite\";\n\t\treturn this.query(options);\n\t}\n\t/**\n\t* @deprecated Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version.\n\t*/\n\tfetchInfiniteQuery(options) {\n\t\toptions._type = \"infinite\";\n\t\treturn this.fetchQuery(options);\n\t}\n\t/**\n\t* @deprecated Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.\n\t*/\n\tprefetchInfiniteQuery(options) {\n\t\treturn this.fetchInfiniteQuery(options).then(noop).catch(noop);\n\t}\n\t/**\n\t* @deprecated Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version.\n\t*/\n\tensureInfiniteQueryData(options) {\n\t\toptions._type = \"infinite\";\n\t\treturn this.ensureQueryData(options);\n\t}\n\t/**\n\t* Resumes mutations that were paused because there was no network connection. Does nothing\n\t* (resolving immediately) if the client is currently offline.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* await queryClient.resumePausedMutations()\n\t* ```\n\t*/\n\tresumePausedMutations() {\n\t\tif (onlineManager.isOnline()) return this.#mutationCache.resumePausedMutations();\n\t\treturn Promise.resolve();\n\t}\n\t/**\n\t* Returns the query cache this client is connected to.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* const queryCache = queryClient.getQueryCache()\n\t* const queries = queryCache.findAll({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tgetQueryCache() {\n\t\treturn this.#queryCache;\n\t}\n\t/**\n\t* Returns the mutation cache this client is connected to.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* const mutationCache = queryClient.getMutationCache()\n\t* const mutations = mutationCache.findAll({ status: 'pending' })\n\t* ```\n\t*/\n\tgetMutationCache() {\n\t\treturn this.#mutationCache;\n\t}\n\t/**\n\t* Returns the default options that were set when creating the client, or via\n\t* {@link QueryClient#setDefaultOptions}.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* const defaultOptions = queryClient.getDefaultOptions()\n\t* ```\n\t*/\n\tgetDefaultOptions() {\n\t\treturn this.#defaultOptions;\n\t}\n\t/**\n\t* Dynamically sets the default options for this client, overwriting any previously defined\n\t* default options.\n\t*\n\t* @see {@link QueryClient#getDefaultOptions}\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* queryClient.setDefaultOptions({\n\t* queries: {\n\t* staleTime: Infinity,\n\t* },\n\t* })\n\t* ```\n\t*/\n\tsetDefaultOptions(options) {\n\t\tthis.#defaultOptions = options;\n\t}\n\t/**\n\t* Sets default options for queries whose query key partially matches the given `queryKey`.\n\t*\n\t* If several registered query defaults match a given query key, they are merged together in\n\t* registration order by {@link QueryClient#getQueryDefaults}, so register defaults from the\n\t* most generic key to the least generic one — more specific defaults should be registered\n\t* after more generic ones so they take precedence.\n\t*\n\t* @example\n\t* ```ts\n\t* queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts })\n\t*\n\t* await queryClient.query({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tsetQueryDefaults(queryKey, options) {\n\t\tthis.#queryDefaults.set(hashKey(queryKey), {\n\t\t\tqueryKey,\n\t\t\tdefaultOptions: options\n\t\t});\n\t}\n\t/**\n\t* Returns the default options registered for queries whose query key partially matches the\n\t* given `queryKey`, via {@link QueryClient#setQueryDefaults}. If multiple registered defaults\n\t* match, they are merged together in registration order.\n\t*\n\t* @example\n\t* ```ts\n\t* const defaultOptions = queryClient.getQueryDefaults(['posts'])\n\t* ```\n\t*/\n\tgetQueryDefaults(queryKey) {\n\t\tconst defaults = [...this.#queryDefaults.values()];\n\t\tconst result = {};\n\t\tdefaults.forEach((queryDefault) => {\n\t\t\tif (partialMatchKey(queryKey, queryDefault.queryKey)) Object.assign(result, queryDefault.defaultOptions);\n\t\t});\n\t\treturn result;\n\t}\n\t/**\n\t* Sets default options for mutations whose mutation key partially matches the given\n\t* `mutationKey`. As with {@link QueryClient#setQueryDefaults}, the order of registration\n\t* matters when several registered defaults match the same mutation key.\n\t*\n\t* @see {@link QueryClient#getMutationDefaults}\n\t* @example\n\t* ```ts\n\t* queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost })\n\t* ```\n\t*/\n\tsetMutationDefaults(mutationKey, options) {\n\t\tthis.#mutationDefaults.set(hashKey(mutationKey), {\n\t\t\tmutationKey,\n\t\t\tdefaultOptions: options\n\t\t});\n\t}\n\t/**\n\t* Returns the default options registered for mutations whose mutation key partially matches\n\t* the given `mutationKey`, via {@link QueryClient#setMutationDefaults}. If multiple registered\n\t* defaults match, they are merged together in registration order.\n\t*\n\t* @example\n\t* ```ts\n\t* const defaultOptions = queryClient.getMutationDefaults(['addPost'])\n\t* ```\n\t*/\n\tgetMutationDefaults(mutationKey) {\n\t\tconst defaults = [...this.#mutationDefaults.values()];\n\t\tconst result = {};\n\t\tdefaults.forEach((queryDefault) => {\n\t\t\tif (partialMatchKey(mutationKey, queryDefault.mutationKey)) Object.assign(result, queryDefault.defaultOptions);\n\t\t});\n\t\treturn result;\n\t}\n\t/**\n\t* Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the\n\t* caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the\n\t* given `queryKey`, then the client's own `defaultOptions.queries`, then the caller's options\n\t* on top. A no-op if the options are already defaulted (`_defaulted: true`).\n\t*/\n\tdefaultQueryOptions(options) {\n\t\tif (options._defaulted) return options;\n\t\tconst defaultedOptions = {\n\t\t\t...this.#defaultOptions.queries,\n\t\t\t...this.getQueryDefaults(options.queryKey),\n\t\t\t...options,\n\t\t\t_defaulted: true\n\t\t};\n\t\tif (!defaultedOptions.queryHash) defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);\n\t\tif (defaultedOptions.refetchOnReconnect === void 0) defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== \"always\";\n\t\tif (defaultedOptions.throwOnError === void 0) defaultedOptions.throwOnError = !!defaultedOptions.suspense;\n\t\tif (!defaultedOptions.networkMode && defaultedOptions.persister) defaultedOptions.networkMode = \"offlineFirst\";\n\t\tif (defaultedOptions.queryFn === skipToken) defaultedOptions.enabled = false;\n\t\treturn defaultedOptions;\n\t}\n\t/**\n\t* The mutation counterpart of {@link QueryClient#defaultQueryOptions}. Called by framework\n\t* adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the\n\t* given `mutationKey`, then the client's `defaultOptions.mutations`, then the caller's options\n\t* on top. A no-op if the options are already defaulted (`_defaulted: true`).\n\t*/\n\tdefaultMutationOptions(options) {\n\t\tif (options?._defaulted) return options;\n\t\treturn {\n\t\t\t...this.#defaultOptions.mutations,\n\t\t\t...options?.mutationKey && this.getMutationDefaults(options.mutationKey),\n\t\t\t...options,\n\t\t\t_defaulted: true\n\t\t};\n\t}\n\t/**\n\t* Clears both the query cache and the mutation cache this client is connected to.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* queryClient.clear()\n\t* ```\n\t*/\n\tclear() {\n\t\tthis.#queryCache.clear();\n\t\tthis.#mutationCache.clear();\n\t}\n};\n//#endregion\nexport { QueryClient };\n\n//# sourceMappingURL=queryClient.js.map","\"use client\";\nimport * as React from \"react\";\n//#region src/IsRestoringProvider.ts\nconst IsRestoringContext = React.createContext(false);\n/**\n* If you are using `PersistQueryClientProvider`, you can also use the `useIsRestoring` hook alongside it to\n* check if a restore is currently in progress. `useQuery` and friends also check this internally to avoid\n* race conditions between the restore and mounting queries.\n*\n* @returns `true` while a persisted client is being restored, `false` otherwise.\n*/\nconst useIsRestoring = () => React.useContext(IsRestoringContext);\n/**\n* The Provider that `PersistQueryClientProvider` uses to signal whether a persisted client is currently\n* being restored, read by `useIsRestoring`.\n*/\nconst IsRestoringProvider = IsRestoringContext.Provider;\n//#endregion\nexport { IsRestoringProvider, useIsRestoring };\n\n//# sourceMappingURL=IsRestoringProvider.js.map","\"use client\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/QueryErrorResetBoundary.tsx\n/**\n* Resets any query errors within the boundary, so queries know they can try again.\n*/\nfunction createValue() {\n\tlet isReset = false;\n\treturn {\n\t\t/**\n\t\t* Clears the reset state, so queries know not to try again until the boundary is reset again.\n\t\t*/\n\t\tclearReset: () => {\n\t\t\tisReset = false;\n\t\t},\n\t\t/**\n\t\t* Resets any query errors within the boundary, so queries know they can try again.\n\t\t*/\n\t\treset: () => {\n\t\t\tisReset = true;\n\t\t},\n\t\t/**\n\t\t* Returns whether the boundary has been reset and not yet cleared.\n\t\t*/\n\t\tisReset: () => {\n\t\t\treturn isReset;\n\t\t}\n\t};\n}\nconst QueryErrorResetBoundaryContext = React.createContext(createValue());\n/**\n* This hook will reset any query errors within the closest `QueryErrorResetBoundary`. If there is no boundary\n* defined it will reset them globally.\n*\n* @returns The boundary's {@link QueryErrorResetBoundaryValue}.\n*\n* @example\n* ```tsx\n* import { ErrorBoundary } from 'react-error-boundary'\n* import { useQueryErrorResetBoundary } from '@tanstack/react-query'\n*\n* function App({ children }: { children: React.ReactNode }) {\n* const { reset } = useQueryErrorResetBoundary()\n*\n* return (\n* <ErrorBoundary\n* onReset={reset}\n* fallbackRender={({ resetErrorBoundary }) => (\n* <div>\n* There was an error!\n* <button onClick={() => resetErrorBoundary()}>Try again</button>\n* </div>\n* )}\n* >\n* {children}\n* </ErrorBoundary>\n* )\n* }\n* ```\n*/\nconst useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);\n/**\n* When using `suspense` or `throwOnError` in your queries, you need a way to let queries know that you want to\n* try again when re-rendering after some error occurred. With the `QueryErrorResetBoundary` component you can\n* reset any query errors within the boundaries of the component.\n*\n* @returns The `children`, rendered as-is, or called with the boundary's {@link QueryErrorResetBoundaryValue}\n* if `children` is a function.\n*\n* @example\n* ```tsx\n* import { ErrorBoundary } from 'react-error-boundary'\n* import { QueryErrorResetBoundary } from '@tanstack/react-query'\n*\n* function App() {\n* return (\n* <QueryErrorResetBoundary>\n* {({ reset }) => (\n* <ErrorBoundary\n* onReset={reset}\n* fallbackRender={({ resetErrorBoundary }) => (\n* <div>\n* There was an error!\n* <button onClick={() => resetErrorBoundary()}>Try again</button>\n* </div>\n* )}\n* >\n* <Page />\n* </ErrorBoundary>\n* )}\n* </QueryErrorResetBoundary>\n* )\n* }\n* ```\n*/\nconst QueryErrorResetBoundary = ({ children }) => {\n\tconst [value] = React.useState(() => createValue());\n\treturn /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, {\n\t\tvalue,\n\t\tchildren: typeof children === \"function\" ? children(value) : children\n\t});\n};\n//#endregion\nexport { QueryErrorResetBoundary, useQueryErrorResetBoundary };\n\n//# sourceMappingURL=QueryErrorResetBoundary.js.map","\"use client\";\nimport * as React from \"react\";\nimport { shouldThrowError } from \"@tanstack/query-core\";\n//#region src/errorBoundaryUtils.ts\nconst ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {\n\tconst throwOnError = query?.state.error && typeof options.throwOnError === \"function\" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;\n\tif (options.suspense || throwOnError) {\n\t\tif (!errorResetBoundary.isReset()) options.retryOnMount = false;\n\t}\n};\nconst useClearResetErrorBoundary = (errorResetBoundary) => {\n\tReact.useEffect(() => {\n\t\terrorResetBoundary.clearReset();\n\t}, [errorResetBoundary]);\n};\nconst getHasError = ({ result, errorResetBoundary, throwOnError, query, suspense }) => {\n\treturn result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));\n};\n//#endregion\nexport { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary };\n\n//# sourceMappingURL=errorBoundaryUtils.js.map","//#region src/suspense.ts\nconst defaultThrowOnError = (_error, query) => query.state.data === void 0;\nconst ensureSuspenseTimers = (defaultedOptions) => {\n\tif (defaultedOptions.suspense) {\n\t\tconst MIN_SUSPENSE_TIME_MS = 1e3;\n\t\tconst clamp = (value) => value === \"static\" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);\n\t\tconst originalStaleTime = defaultedOptions.staleTime;\n\t\tdefaultedOptions.staleTime = typeof originalStaleTime === \"function\" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);\n\t\tif (typeof defaultedOptions.gcTime === \"number\") defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, MIN_SUSPENSE_TIME_MS);\n\t}\n};\nconst shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;\nconst fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {\n\terrorResetBoundary.clearReset();\n});\n//#endregion\nexport { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend };\n\n//# sourceMappingURL=suspense.js.map","\"use client\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useIsRestoring } from \"./IsRestoringProvider.js\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary } from \"./errorBoundaryUtils.js\";\nimport { ensureSuspenseTimers, fetchOptimistic, shouldSuspend } from \"./suspense.js\";\nimport * as React from \"react\";\nimport { noop, notifyManager } from \"@tanstack/query-core\";\n//#region src/useBaseQuery.ts\nfunction useBaseQuery(options, Observer, queryClient) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (typeof options !== \"object\" || Array.isArray(options)) throw new Error(\"Bad argument type. Starting with v5, only the \\\"Object\\\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object\");\n\t}\n\tconst isRestoring = useIsRestoring();\n\tconst errorResetBoundary = useQueryErrorResetBoundary();\n\tconst client = useQueryClient(queryClient);\n\tconst defaultedOptions = client.defaultQueryOptions(options);\n\tconst query = client.getQueryCache().get(defaultedOptions.queryHash);\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (!defaultedOptions.queryFn) console.error(`[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`);\n\t}\n\tconst subscribed = options.subscribed !== false;\n\tdefaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : subscribed ? \"optimistic\" : void 0;\n\tensureSuspenseTimers(defaultedOptions);\n\tensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);\n\tuseClearResetErrorBoundary(errorResetBoundary);\n\tconst [observer] = React.useState(() => new Observer(client, defaultedOptions));\n\tconst result = observer.getOptimisticResult(defaultedOptions);\n\tconst shouldSubscribe = !isRestoring && subscribed;\n\tReact.useSyncExternalStore(React.useCallback((onStoreChange) => {\n\t\tconst unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;\n\t\tobserver.updateResult();\n\t\treturn unsubscribe;\n\t}, [observer, shouldSubscribe]), () => observer.getCurrentResult(), () => observer.getCurrentResult());\n\tReact.useEffect(() => {\n\t\tobserver.setOptions(defaultedOptions);\n\t}, [defaultedOptions, observer]);\n\tif (shouldSuspend(defaultedOptions, result)) throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n\tif (getHasError({\n\t\tresult,\n\t\terrorResetBoundary,\n\t\tthrowOnError: defaultedOptions.throwOnError,\n\t\tquery,\n\t\tsuspense: defaultedOptions.suspense\n\t})) throw result.error;\n\treturn !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\n//#endregion\nexport { useBaseQuery };\n\n//# sourceMappingURL=useBaseQuery.js.map","\"use client\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nimport { QueryObserver } from \"@tanstack/query-core\";\n//#region src/useQuery.ts\nfunction useQuery(options, queryClient) {\n\treturn useBaseQuery(options, QueryObserver, queryClient);\n}\n//#endregion\nexport { useQuery };\n\n//# sourceMappingURL=useQuery.js.map","/**\n * Minimal Cube client implementation\n * Replaces @cubejs-client/core with lighter implementation\n */\n\nimport type {\n CubeQuery,\n CubeApiOptions,\n CubeResultSet,\n CubeValidationIssue,\n ExplainResult,\n ExplainOptions\n} from '../types.js'\n\n/**\n * A failed query, carrying the server's structured validation detail when it\n * sent any. A caller can then react to one dead member — dropping a column for\n * a deleted attribute, say — instead of only seeing prose.\n */\nexport class CubeQueryError extends Error {\n readonly status?: number\n readonly issues?: CubeValidationIssue[]\n\n constructor(message: string, status?: number, issues?: CubeValidationIssue[]) {\n super(message)\n this.name = 'CubeQueryError'\n this.status = status\n this.issues = issues\n }\n}\n\n/**\n * Turn a failed response into a `CubeQueryError`.\n *\n * Every endpoint parsed this the same way inline; the shape is worth having in\n * one place now that a structured `issues` array can ride along with the\n * message.\n */\nasync function toQueryError(response: Response, fallback: string): Promise<CubeQueryError> {\n let message = `${fallback}: ${response.status}`\n let issues: CubeValidationIssue[] | undefined\n\n try {\n const text = await response.text()\n try {\n const body = JSON.parse(text)\n message = body.error ? body.error : `${message} ${text}`\n if (Array.isArray(body.issues)) issues = body.issues\n } catch {\n // Not JSON — the raw text is the best detail available.\n message += ` ${text}`\n }\n } catch {\n // Body unreadable; the status alone will have to do.\n }\n\n return new CubeQueryError(message, response.status, issues)\n}\n\nexport class CubeClient {\n private apiUrl: string\n private headers: Record<string, string>\n private credentials: 'include' | 'omit' | 'same-origin'\n\n constructor(token?: string, options: CubeApiOptions = {}) {\n this.apiUrl = options.apiUrl || '/cubejs-api/v1'\n this.headers = {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n this.credentials = options.credentials ?? 'include'\n\n if (token) {\n this.headers['Authorization'] = token\n }\n }\n\n async load(query: CubeQuery, options?: { bustCache?: boolean }): Promise<CubeResultSet> {\n // Use GET with query parameter for standard Cube.js compatibility\n const queryString = JSON.stringify(query)\n const queryParam = encodeURIComponent(queryString)\n const url = `${this.apiUrl}/load?query=${queryParam}`\n\n // Build headers, optionally adding cache bust header\n const requestHeaders: Record<string, string> = {\n // Remove Content-Type for GET request\n ...Object.fromEntries(\n Object.entries(this.headers).filter(([key]) => key !== 'Content-Type')\n )\n }\n if (options?.bustCache) {\n requestHeaders['X-Cache-Control'] = 'no-cache'\n }\n\n const response = await fetch(url, {\n method: 'GET',\n headers: requestHeaders,\n credentials: this.credentials\n })\n\n if (!response.ok) {\n throw await toQueryError(response, 'Cube query failed')\n }\n\n const result = await response.json()\n return new ResultSet(result)\n }\n\n async meta(): Promise<any> {\n const url = `${this.apiUrl}/meta`\n \n const response = await fetch(url, {\n method: 'GET',\n headers: this.headers,\n credentials: this.credentials\n })\n\n if (!response.ok) {\n throw await toQueryError(response, 'Failed to fetch meta')\n }\n\n return response.json()\n }\n\n async sql(query: CubeQuery): Promise<any> {\n // Use GET with query parameter for standard Cube.js compatibility\n const queryParam = encodeURIComponent(JSON.stringify(query))\n const url = `${this.apiUrl}/sql?query=${queryParam}`\n \n const response = await fetch(url, {\n method: 'GET',\n headers: {\n // Remove Content-Type for GET request\n ...Object.fromEntries(\n Object.entries(this.headers).filter(([key]) => key !== 'Content-Type')\n )\n },\n credentials: this.credentials\n })\n\n if (!response.ok) {\n throw await toQueryError(response, 'SQL generation failed')\n }\n\n return response.json()\n }\n\n async dryRun(query: CubeQuery): Promise<any> {\n const url = `${this.apiUrl}/dry-run`\n\n const response = await fetch(url, {\n method: 'POST',\n headers: this.headers,\n credentials: this.credentials,\n body: JSON.stringify({ query })\n })\n\n if (!response.ok) {\n throw await toQueryError(response, 'Dry run failed')\n }\n\n return response.json()\n }\n\n /**\n * Execute EXPLAIN on a query to get the execution plan\n * Returns normalized plan across PostgreSQL, MySQL, and SQLite\n * Accepts standard queries, funnel queries ({ funnel: {...} }), or flow queries ({ flow: {...} })\n */\n async explain(query: CubeQuery | unknown, options?: ExplainOptions): Promise<ExplainResult> {\n const url = `${this.apiUrl}/explain`\n\n const response = await fetch(url, {\n method: 'POST',\n headers: this.headers,\n credentials: this.credentials,\n body: JSON.stringify({ query, options })\n })\n\n if (!response.ok) {\n throw await toQueryError(response, 'Explain failed')\n }\n\n return response.json()\n }\n\n /**\n * Execute multiple queries in a single batch request\n * Used by BatchCoordinator to optimize network requests\n * Pass { bustCache: true } to bypass server-side cache\n */\n async batchLoad(queries: CubeQuery[], options?: { bustCache?: boolean }): Promise<CubeResultSet[]> {\n const url = `${this.apiUrl}/batch`\n\n // Build headers with optional cache bypass\n const requestHeaders: Record<string, string> = { ...this.headers }\n if (options?.bustCache) {\n requestHeaders['X-Cache-Control'] = 'no-cache'\n }\n\n const response = await fetch(url, {\n method: 'POST',\n headers: requestHeaders,\n credentials: this.credentials,\n body: JSON.stringify({ queries })\n })\n\n if (!response.ok) {\n throw await toQueryError(response, 'Batch query failed')\n }\n\n const batchResponse = await response.json()\n\n // batchResponse.results is an array of individual query results\n // Each result may have succeeded or failed\n return batchResponse.results.map((result: any) => {\n // If this individual query failed, create a ResultSet with error info\n if (!result.success && result.error) {\n // Create a result set that will throw when accessed\n return {\n ...new ResultSet({ data: [], annotation: {} }),\n error: result.error\n }\n }\n\n // Create ResultSet from successful result\n return new ResultSet(result)\n })\n }\n}\n\n/**\n * Simple ResultSet implementation\n */\nclass ResultSet implements CubeResultSet {\n public loadResponse: any\n\n constructor(loadResponse: any) {\n this.loadResponse = loadResponse\n }\n\n rawData(): any[] {\n // Handle new nested structure: loadResponse.results[0].data\n // Keep backward compatibility with old structure: loadResponse.data\n if (this.loadResponse.results && this.loadResponse.results[0]) {\n return this.loadResponse.results[0].data || []\n }\n return this.loadResponse.data || []\n }\n\n tablePivot(): any[] {\n // For pie charts and tables, return the raw data\n return this.rawData()\n }\n\n series(): any[] {\n // Simple series implementation\n return this.rawData()\n }\n\n annotation(): any {\n // Handle new nested structure: loadResponse.results[0].annotation\n // Keep backward compatibility with old structure: loadResponse.annotation\n if (this.loadResponse.results && this.loadResponse.results[0]) {\n return this.loadResponse.results[0].annotation || {}\n }\n return this.loadResponse.annotation || {}\n }\n\n /**\n * Rows the query would return with no limit/offset, when it asked for a\n * total. Undefined otherwise — a paginated view distinguishes \"not requested\"\n * from a genuine zero.\n */\n totalCount(): number | undefined {\n if (this.loadResponse.results && this.loadResponse.results[0]) {\n return this.loadResponse.results[0].total\n }\n return this.loadResponse.total\n }\n\n /**\n * Get cache metadata if result was served from cache\n * Returns undefined if not a cache hit\n */\n cacheInfo(): { hit: true; cachedAt: string; ttlMs: number; ttlRemainingMs: number } | undefined {\n // Handle nested structure: loadResponse.results[0].cache\n if (this.loadResponse.results && this.loadResponse.results[0]) {\n return this.loadResponse.results[0].cache\n }\n return this.loadResponse.cache\n }\n}\n\n/**\n * Factory function to create a cube client\n */\nexport function createCubeClient(token?: string, options: CubeApiOptions = {}): CubeClient {\n return new CubeClient(token, options)\n}\n\n// Legacy compatibility export\nexport function cube(token?: string, options: CubeApiOptions = {}): CubeClient {\n return createCubeClient(token, options)\n}","import type { CubeQuery, CubeResultSet, CubeValidationIssue } from '../types.js'\nimport { CubeQueryError } from './CubeClient.js'\n\n/**\n * Represents a queued query with its resolver/rejector\n */\ninterface QueuedQuery {\n query: CubeQuery\n resolve: (result: CubeResultSet) => void\n reject: (error: Error) => void\n}\n\n/**\n * BatchCoordinator collects queries triggered in the same render cycle\n * and sends them as a single batch request to minimize network overhead.\n *\n * Uses a configurable delay (default 100ms) to batch queries from lazy-loaded\n * portlets that become visible during the same scroll action.\n */\nexport class BatchCoordinator {\n private queue: QueuedQuery[] = []\n private flushScheduled = false\n private batchExecutor: (queries: CubeQuery[]) => Promise<CubeResultSet[]>\n private delayMs: number\n\n constructor(batchExecutor: (queries: CubeQuery[]) => Promise<CubeResultSet[]>, delayMs: number = 50) {\n this.batchExecutor = batchExecutor\n this.delayMs = delayMs\n }\n\n /**\n * Register a query to be batched. Returns a promise that resolves\n * when the batch is executed and this specific query's result is available.\n */\n public register(query: CubeQuery): Promise<CubeResultSet> {\n return new Promise<CubeResultSet>((resolve, reject) => {\n // Add query to queue\n this.queue.push({ query, resolve, reject })\n\n // Schedule flush if not already scheduled\n if (!this.flushScheduled) {\n this.scheduleFlush()\n }\n })\n }\n\n /**\n * Schedule a flush after a short delay to collect multiple queries.\n * The delay allows queries from lazy-loaded portlets that become visible\n * during the same scroll action to be batched together.\n */\n private scheduleFlush(): void {\n this.flushScheduled = true\n\n setTimeout(() => {\n this.flush()\n }, this.delayMs)\n }\n\n /**\n * Execute all queued queries as a batch and resolve individual promises\n */\n private async flush(): Promise<void> {\n // Reset state\n this.flushScheduled = false\n\n // Take current queue and clear it\n const currentQueue = this.queue.slice()\n this.queue = []\n\n if (currentQueue.length === 0) {\n return\n }\n\n try {\n // Extract queries\n const queries = currentQueue.map(item => item.query)\n\n // Execute batch\n const results = await this.batchExecutor(queries)\n\n // Resolve individual promises with their corresponding results\n currentQueue.forEach((item, index) => {\n const result = results[index]\n\n // Check if this specific query had an error\n if (result && 'error' in result && result.error) {\n // Keep any structured validation detail the batch response carried,\n // so a caller can drop one dead member rather than fail the portlet.\n const issues = (result as { issues?: CubeValidationIssue[] }).issues\n item.reject(new CubeQueryError(result.error as string, 400, issues))\n } else {\n item.resolve(result)\n }\n })\n } catch (error) {\n // If entire batch fails, reject all queries\n currentQueue.forEach(item => {\n item.reject(error instanceof Error ? error : new Error(String(error)))\n })\n }\n }\n\n /**\n * Get current queue size (useful for debugging)\n */\n public getQueueSize(): number {\n return this.queue.length\n }\n\n /**\n * Clear the queue (useful for testing/cleanup)\n */\n public clear(): void {\n this.queue = []\n this.flushScheduled = false\n }\n}\n","/**\n * CubeApiProvider - Stable API Context Layer\n *\n * Provides the CubeClient API instance that only changes on authentication updates.\n * Isolated from metadata and feature contexts to prevent unnecessary re-renders.\n */\n\nimport { createContext, useContext, useState, useMemo, useCallback, useEffect, type ReactNode } from 'react'\nimport { createCubeClient, type CubeClient } from '../client/CubeClient.js'\nimport type { CubeQueryOptions, CubeApiOptions } from '../types.js'\nimport { BatchCoordinator } from '../client/BatchCoordinator.js'\n\ninterface CubeApiContextValue {\n cubeApi: CubeClient\n options?: CubeQueryOptions\n apiOptions: CubeApiOptions\n updateApiConfig: (apiOptions: CubeApiOptions, token?: string) => void\n batchCoordinator: BatchCoordinator | null\n enableBatching: boolean\n}\n\nconst CubeApiContext = createContext<CubeApiContextValue | null>(null)\n\ninterface CubeApiProviderProps {\n apiOptions: CubeApiOptions\n token?: string\n options?: CubeQueryOptions\n locale?: string\n enableBatching?: boolean\n batchDelayMs?: number\n children: ReactNode\n}\n\nexport function CubeApiProvider({\n apiOptions: initialApiOptions,\n token: initialToken,\n options = {},\n locale,\n enableBatching = true,\n batchDelayMs = 50,\n children\n}: CubeApiProviderProps) {\n const baseConfig = useMemo(\n () => ({ apiOptions: initialApiOptions, token: initialToken }),\n [initialApiOptions, initialToken]\n )\n const [overrideConfig, setOverrideConfig] = useState<{\n apiOptions: CubeApiOptions\n token?: string\n } | null>(null)\n\n useEffect(() => {\n setOverrideConfig(null)\n }, [baseConfig])\n\n const config = overrideConfig ?? baseConfig\n\n const apiOptionsWithLocale = useMemo(() => {\n if (!locale) return config.apiOptions\n return {\n ...config.apiOptions,\n headers: {\n ...(config.apiOptions.headers ?? {}),\n 'X-DC-Locale': locale\n }\n }\n }, [config.apiOptions, locale])\n\n // Create CubeClient - only recreates when config changes\n const cubeApi = useMemo(() =>\n createCubeClient(config.token, apiOptionsWithLocale),\n [apiOptionsWithLocale, config.token]\n )\n\n // Create BatchCoordinator - only recreates when cubeApi or batching config changes\n const batchCoordinator = useMemo(() => {\n if (!enableBatching) return null\n return new BatchCoordinator((queries) => cubeApi.batchLoad(queries), batchDelayMs)\n }, [enableBatching, cubeApi, batchDelayMs])\n\n // Stable callback for updating config\n const updateApiConfig = useCallback((newApiOptions: CubeApiOptions, newToken?: string) => {\n setOverrideConfig({ apiOptions: newApiOptions, token: newToken })\n }, [])\n\n // Memoize context value - only changes when cubeApi/options change\n const value = useMemo(() => ({\n cubeApi,\n options,\n apiOptions: apiOptionsWithLocale,\n updateApiConfig,\n batchCoordinator,\n enableBatching\n }), [cubeApi, options, apiOptionsWithLocale, updateApiConfig, batchCoordinator, enableBatching])\n\n return (\n <CubeApiContext.Provider value={value}>\n {children}\n </CubeApiContext.Provider>\n )\n}\n\nexport function useCubeApi() {\n const context = useContext(CubeApiContext)\n if (!context) {\n throw new Error('useCubeApi must be used within CubeApiProvider')\n }\n return context\n}\n","/**\n * useCubeMetaQuery - TanStack Query hook for cube metadata\n *\n * Replaces manual caching in useCubeMeta with TanStack Query's built-in\n * cache management. Provides:\n * - Automatic caching with configurable stale time\n * - Built-in loading and error states\n * - Automatic refetch on mount (if stale)\n * - Manual refetch capability\n *\n * This hook wraps the existing CubeClient.meta() method.\n */\n\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\nimport { useCubeApi } from '../../providers/CubeApiProvider.js'\nimport type { CubeMeta, FieldLabelMap } from '../../types.js'\n\n// Query key for cube metadata\nexport const CUBE_META_QUERY_KEY = ['cube', 'meta'] as const\n\n/**\n * Build a field label map from cube metadata\n * Maps field names to their display titles\n */\nfunction buildLabelMap(meta: CubeMeta): FieldLabelMap {\n const labelMap: FieldLabelMap = {}\n\n meta.cubes.forEach((cube) => {\n // Add measures\n cube.measures.forEach((measure) => {\n labelMap[measure.name] = measure.title || measure.shortTitle || measure.name\n })\n\n // Add dimensions\n cube.dimensions.forEach((dimension) => {\n labelMap[dimension.name] = dimension.title || dimension.shortTitle || dimension.name\n })\n\n // Add segments\n cube.segments.forEach((segment) => {\n labelMap[segment.name] = segment.title || segment.shortTitle || segment.name\n })\n })\n\n return labelMap\n}\n\nexport interface UseCubeMetaQueryOptions {\n /**\n * Whether to skip the query (useful for conditional fetching)\n * @default false\n */\n enabled?: boolean\n /**\n * Stale time in milliseconds (how long before data is considered stale)\n * @default 5 * 60 * 1000 (5 minutes)\n */\n staleTime?: number\n}\n\nexport interface UseCubeMetaQueryResult {\n /** Cube metadata */\n meta: CubeMeta | null\n /** Field label map for quick lookups */\n labelMap: FieldLabelMap\n /** Whether the query is loading */\n isLoading: boolean\n /** Whether the query is fetching (includes background refetch) */\n isFetching: boolean\n /** Error if the query failed */\n error: Error | null\n /** Manually refetch the metadata */\n refetch: () => void\n /** Get a field's display label */\n getFieldLabel: (fieldName: string) => string\n}\n\n/**\n * TanStack Query hook for fetching cube metadata\n *\n * Usage:\n * ```tsx\n * const { meta, labelMap, isLoading, error, refetch } = useCubeMetaQuery()\n * ```\n */\nexport function useCubeMetaQuery(\n options: UseCubeMetaQueryOptions = {}\n): UseCubeMetaQueryResult {\n const { enabled = true, staleTime = 5 * 60 * 1000 } = options\n const { cubeApi } = useCubeApi()\n const queryClient = useQueryClient()\n\n const query = useQuery({\n queryKey: CUBE_META_QUERY_KEY,\n queryFn: async () => {\n const metaData = await cubeApi.meta()\n const labelMap = buildLabelMap(metaData)\n return { meta: metaData, labelMap }\n },\n enabled,\n staleTime,\n // Keep data in cache for 15 minutes after it becomes unused\n gcTime: 15 * 60 * 1000,\n })\n\n // Extract data from query result\n const meta = query.data?.meta ?? null\n const labelMap = query.data?.labelMap ?? {}\n\n // Stable refetch function\n const refetch = () => {\n queryClient.invalidateQueries({ queryKey: CUBE_META_QUERY_KEY })\n }\n\n // Stable getFieldLabel function\n const getFieldLabel = (fieldName: string): string => {\n return labelMap[fieldName] || fieldName\n }\n\n return {\n meta,\n labelMap,\n isLoading: query.isLoading,\n isFetching: query.isFetching,\n error: query.error,\n refetch,\n getFieldLabel,\n }\n}\n\n/**\n * Prefetch cube metadata - useful for eager loading\n *\n * Usage:\n * ```tsx\n * const queryClient = useQueryClient()\n * await prefetchCubeMeta(queryClient, cubeApi)\n * ```\n */\nexport async function prefetchCubeMeta(\n queryClient: ReturnType<typeof useQueryClient>,\n cubeApi: ReturnType<typeof useCubeApi>['cubeApi']\n): Promise<void> {\n await queryClient.prefetchQuery({\n queryKey: CUBE_META_QUERY_KEY,\n queryFn: async () => {\n const metaData = await cubeApi.meta()\n const labelMap = buildLabelMap(metaData)\n return { meta: metaData, labelMap }\n },\n })\n}\n","/**\n * Dashboard Thumbnail Capture Utility\n *\n * Provides optional screenshot functionality for dashboard thumbnails.\n * Requires modern-screenshot as an optional peer dependency.\n *\n * Usage:\n * 1. Install the optional dependency: npm install modern-screenshot\n * 2. Enable in CubeProvider: features={{ thumbnail: { enabled: true } }}\n * 3. Thumbnails are automatically captured on dashboard save\n */\n\nimport type { RefObject } from 'react'\nimport type { ThumbnailFeatureConfig } from '../types.js'\n\n// Type definition for modern-screenshot (optional dependency)\ntype ModernScreenshotModule = {\n domToPng: (element: HTMLElement, options?: Record<string, unknown>) => Promise<string>\n domToJpeg: (element: HTMLElement, options?: Record<string, unknown>) => Promise<string>\n}\n\n// Cache the import result to avoid repeated dynamic imports\nlet screenshotModule: ModernScreenshotModule | null = null\nlet moduleChecked = false\n\n/**\n * Resize an image to the specified dimensions while maintaining quality.\n * This takes a high-resolution source and scales it down to target dimensions,\n * which produces better results than capturing at low resolution directly.\n *\n * Uses Canvas imageSmoothingQuality for best downscaling results.\n */\nfunction resizeImage(\n dataUri: string,\n targetWidth: number,\n targetHeight: number,\n format: 'png' | 'jpeg',\n quality: number\n): Promise<string> {\n return new Promise((resolve, reject) => {\n const img = new Image()\n img.onload = () => {\n const canvas = document.createElement('canvas')\n canvas.width = targetWidth\n canvas.height = targetHeight\n\n const ctx = canvas.getContext('2d')\n if (!ctx) {\n reject(new Error('Failed to get canvas context'))\n return\n }\n\n // Enable high-quality image smoothing for downscaling\n ctx.imageSmoothingEnabled = true\n ctx.imageSmoothingQuality = 'high'\n\n // Calculate aspect-ratio-preserving dimensions\n const sourceAspect = img.width / img.height\n const targetAspect = targetWidth / targetHeight\n\n let sourceX = 0\n let sourceY = 0\n let sourceWidth = img.width\n let sourceHeight = img.height\n\n // Crop source to match target aspect ratio (center crop)\n if (sourceAspect > targetAspect) {\n // Source is wider - crop horizontally\n sourceWidth = img.height * targetAspect\n sourceX = (img.width - sourceWidth) / 2\n } else if (sourceAspect < targetAspect) {\n // Source is taller - crop vertically (take from top)\n sourceHeight = img.width / targetAspect\n // Don't center - take from top for dashboard previews\n sourceY = 0\n }\n\n // Draw the scaled and cropped image\n ctx.drawImage(\n img,\n sourceX, sourceY, sourceWidth, sourceHeight, // Source region\n 0, 0, targetWidth, targetHeight // Destination (full canvas)\n )\n\n const mimeType = format === 'jpeg' ? 'image/jpeg' : 'image/png'\n resolve(canvas.toDataURL(mimeType, quality))\n }\n img.onerror = () => reject(new Error('Failed to load image for resizing'))\n img.src = dataUri\n })\n}\n\n/**\n * Check if modern-screenshot is available (installed as peer dependency)\n */\nasync function getScreenshotModule(): Promise<ModernScreenshotModule | null> {\n if (moduleChecked) {\n return screenshotModule\n }\n\n try {\n // Dynamic import - modern-screenshot is an optional peer dependency\n // @ts-ignore - modern-screenshot may not be installed\n screenshotModule = await import('modern-screenshot') as ModernScreenshotModule\n moduleChecked = true\n return screenshotModule\n } catch {\n moduleChecked = true\n screenshotModule = null\n return null\n }\n}\n\n// Extend Window interface for our warning flag\ndeclare global {\n interface Window {\n __drizzle_cube_thumbnail_warning__?: boolean\n }\n}\n\n/**\n * Log a development-mode warning when thumbnail feature is enabled but modern-screenshot is missing\n */\nexport function warnIfScreenshotLibMissing(thumbnailConfig: ThumbnailFeatureConfig | undefined): void {\n if (typeof window === 'undefined') return\n if (!thumbnailConfig?.enabled) return\n\n // Only warn once per session\n if (window.__drizzle_cube_thumbnail_warning__) return\n\n getScreenshotModule().then((mod) => {\n if (!mod && typeof process !== 'undefined' && process.env?.NODE_ENV === 'development') {\n console.warn(\n '[drizzle-cube] Thumbnail feature enabled but modern-screenshot not installed. ' +\n 'Run: npm install modern-screenshot'\n )\n window.__drizzle_cube_thumbnail_warning__ = true\n }\n })\n}\n\n/**\n * Capture a thumbnail of the dashboard element\n *\n * @param elementRef - React ref to the dashboard container element\n * @param config - Thumbnail configuration (dimensions, format, quality)\n * @returns Base64 data URI of the thumbnail, or null if capture failed\n */\nexport async function captureThumbnail(\n elementRef: RefObject<HTMLElement | null>,\n config: ThumbnailFeatureConfig\n): Promise<string | null> {\n // Check if we're in a browser environment\n if (typeof window === 'undefined') {\n return null\n }\n\n // Check if the element ref is valid\n if (!elementRef.current) {\n return null\n }\n\n // Try to load modern-screenshot\n const screenshot = await getScreenshotModule()\n if (!screenshot) {\n return null\n }\n\n try {\n // Higher default dimensions for crisp thumbnails on retina displays\n // 1600x1200 provides good quality while keeping file size reasonable\n const targetWidth = config.width ?? 1600\n const targetHeight = config.height ?? 1200\n const format = config.format ?? 'png'\n const quality = config.quality ?? 0.95 // Higher default quality\n\n const element = elementRef.current\n\n // Always capture at 2x scale for high quality (like copy-to-clipboard)\n // This produces a sharp image that we then resize down\n const captureScale = 2\n\n // Get theme-aware background color (walks DOM tree to find effective bg)\n const backgroundColor = getEffectiveBackgroundColor(element)\n\n // Capture at high resolution with proper background\n const fullDataUri = await screenshot.domToPng(element, {\n scale: captureScale,\n backgroundColor,\n })\n\n // Resize to target dimensions (high-quality downscaling)\n const resizedDataUri = await resizeImage(\n fullDataUri,\n targetWidth,\n targetHeight,\n format,\n quality\n )\n\n return resizedDataUri\n } catch (error) {\n console.error('[drizzle-cube] Failed to capture thumbnail:', error)\n return null\n }\n}\n\n/**\n * Check if thumbnail capture is available and enabled\n */\nexport async function isThumbnailCaptureAvailable(\n config: ThumbnailFeatureConfig | undefined\n): Promise<boolean> {\n if (!config?.enabled) {\n return false\n }\n\n if (typeof window === 'undefined') {\n return false\n }\n\n const screenshot = await getScreenshotModule()\n return screenshot !== null\n}\n\n/**\n * Check if portlet screenshot-to-clipboard is available.\n * Requires both modern-screenshot AND Clipboard API with image support.\n */\nexport async function isPortletCopyAvailable(): Promise<boolean> {\n // Check if we're in browser environment\n if (typeof window === 'undefined') {\n return false\n }\n\n // Check modern-screenshot is installed\n const screenshot = await getScreenshotModule()\n if (!screenshot) {\n return false\n }\n\n // Check Clipboard API supports writing images (ClipboardItem with image/png blob)\n return (\n typeof ClipboardItem !== 'undefined' &&\n typeof navigator?.clipboard?.write === 'function'\n )\n}\n\n/**\n * Check if a background color is transparent or effectively invisible\n */\nfunction isTransparentBackground(color: string): boolean {\n if (!color || color === 'transparent' || color === 'rgba(0, 0, 0, 0)') {\n return true\n }\n // Check for rgba with 0 alpha\n const rgbaMatch = color.match(/rgba\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*([\\d.]+)\\s*\\)/)\n if (rgbaMatch && parseFloat(rgbaMatch[1]) === 0) {\n return true\n }\n return false\n}\n\n/**\n * Find the effective background color by walking up the DOM tree\n */\nfunction getEffectiveBackgroundColor(element: HTMLElement): string {\n let current: HTMLElement | null = element\n\n while (current) {\n const bg = getComputedStyle(current).backgroundColor\n if (!isTransparentBackground(bg)) {\n return bg\n }\n current = current.parentElement\n }\n\n // Fallback to theme variable or white\n const themeColor = getComputedStyle(document.documentElement)\n .getPropertyValue('--dc-surface')\n .trim()\n\n return themeColor || '#ffffff'\n}\n\n/**\n * Capture a portlet element and copy to clipboard as PNG.\n * Returns true on success, false on failure.\n *\n * @param element - The HTML element to capture\n * @returns Promise<boolean> - true if successfully copied to clipboard\n */\nexport async function copyPortletToClipboard(element: HTMLElement): Promise<boolean> {\n try {\n const screenshot = await getScreenshotModule()\n if (!screenshot) {\n console.warn('[drizzle-cube] Cannot copy portlet: modern-screenshot not available')\n return false\n }\n\n // Get theme-aware background color by walking up the DOM tree\n const backgroundColor = getEffectiveBackgroundColor(element)\n\n // Capture as PNG data URL at 2x scale for retina quality\n const dataUrl = await screenshot.domToPng(element, {\n scale: 2,\n backgroundColor,\n })\n\n // Convert data URL to blob\n const response = await fetch(dataUrl)\n const blob = await response.blob()\n\n // Write to clipboard\n await navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })])\n\n return true\n } catch (error) {\n console.warn('[drizzle-cube] Failed to copy portlet to clipboard:', error)\n return false\n }\n}\n","/**\n * XLSX Export Utility\n *\n * Provides optional XLSX export functionality for portlet data.\n * Requires exceljs as an optional peer dependency.\n *\n * Adapted from Guidemode's xlsx-helpers.ts with theme-aware formatting\n * that resolves drizzle-cube CSS variables at export time.\n *\n * Usage:\n * 1. Install the optional dependency: npm install exceljs\n * 2. Enable in CubeProvider: features={{ xlsExport: { enabled: true } }}\n * 3. Download button appears on portlets with data\n */\n\nimport type { XlsExportFeatureConfig } from '../types.js'\nimport type { FlowChartData } from '../types/flow.js'\nimport type { RetentionChartData } from '../types/retention.js'\nimport type { PortletDebugDataEntry } from '../stores/dashboardStore.js'\n\n// Type for ExcelJS module (optional dependency)\ntype ExcelJSModule = { Workbook: new () => ExcelJSWorkbook }\n\n// Minimal ExcelJS types for the subset of API we use\ninterface ExcelJSWorkbook {\n addWorksheet: (name: string) => ExcelJSWorksheet\n xlsx: { writeBuffer: () => Promise<ArrayBuffer> }\n}\n\ninterface ExcelJSWorksheet {\n addRow: (values: unknown[]) => ExcelJSRow\n getRow: (rowNumber: number) => ExcelJSRow\n columns?: ExcelJSColumn[]\n views: Array<{ state: string; ySplit: number }>\n autoFilter: { from: { row: number; column: number }; to: { row: number; column: number } }\n eachRow: (callback: (row: ExcelJSRow) => void) => void\n}\n\ninterface ExcelJSRow {\n number: number\n height: number\n eachCell: (callback: (cell: ExcelJSCell) => void) => void\n}\n\ninterface ExcelJSColumn {\n width: number\n eachCell?: (options: { includeEmpty: boolean }, callback: (cell: ExcelJSCell) => void) => void\n}\n\ninterface ExcelJSCell {\n value: unknown\n font: Record<string, unknown>\n fill: Record<string, unknown>\n alignment: Record<string, unknown>\n border: Record<string, unknown>\n}\n\n// Cache the import result to avoid repeated dynamic imports\nlet excelModule: ExcelJSModule | null = null\nlet moduleChecked = false\n\n// ============================================================================\n// Theme Color Resolution\n// ============================================================================\n\ninterface ThemeColors {\n headerBg: string // ARGB hex for header background\n headerText: string // ARGB hex for header text\n borderColor: string // ARGB hex for cell borders\n}\n\n/** Default colors (light theme fallback) */\nconst DEFAULT_THEME_COLORS: ThemeColors = {\n headerBg: 'FF3B82F6', // --dc-primary light default\n headerText: 'FFFFFFFF', // --dc-primary-content light default\n borderColor: 'FFE5E7EB', // --dc-border light default\n}\n\n/**\n * Convert a CSS color string (hex, rgb, rgba) to ARGB hex format for ExcelJS.\n * Returns null if the color cannot be parsed.\n */\nfunction cssColorToArgb(cssColor: string): string | null {\n if (!cssColor) return null\n\n const trimmed = cssColor.trim()\n\n // Handle #hex format\n if (trimmed.startsWith('#')) {\n const hex = trimmed.slice(1)\n if (hex.length === 3) {\n const expanded = hex.split('').map(c => c + c).join('')\n return `FF${expanded.toUpperCase()}`\n }\n if (hex.length === 6) {\n return `FF${hex.toUpperCase()}`\n }\n if (hex.length === 8) {\n // Already has alpha: RRGGBBAA → AARRGGBB\n return `${hex.slice(6, 8)}${hex.slice(0, 6)}`.toUpperCase()\n }\n return null\n }\n\n // Handle rgb/rgba format\n const rgbMatch = trimmed.match(/rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*([\\d.]+)\\s*)?\\)/)\n if (rgbMatch) {\n const r = parseInt(rgbMatch[1]).toString(16).padStart(2, '0')\n const g = parseInt(rgbMatch[2]).toString(16).padStart(2, '0')\n const b = parseInt(rgbMatch[3]).toString(16).padStart(2, '0')\n const a = rgbMatch[4] !== undefined\n ? Math.round(parseFloat(rgbMatch[4]) * 255).toString(16).padStart(2, '0')\n : 'FF'\n return `${a}${r}${g}${b}`.toUpperCase()\n }\n\n return null\n}\n\n/**\n * Resolve theme colors from CSS custom properties at export time.\n * Falls back to hardcoded defaults if running outside browser or variables aren't set.\n */\nfunction resolveThemeColors(): ThemeColors {\n if (typeof document === 'undefined') return DEFAULT_THEME_COLORS\n\n const style = getComputedStyle(document.documentElement)\n\n const primary = style.getPropertyValue('--dc-primary').trim()\n const primaryContent = style.getPropertyValue('--dc-primary-content').trim()\n const border = style.getPropertyValue('--dc-border').trim()\n\n return {\n headerBg: cssColorToArgb(primary) ?? DEFAULT_THEME_COLORS.headerBg,\n headerText: cssColorToArgb(primaryContent) ?? DEFAULT_THEME_COLORS.headerText,\n borderColor: cssColorToArgb(border) ?? DEFAULT_THEME_COLORS.borderColor,\n }\n}\n\n// ============================================================================\n// Cell Value Normalization\n// ============================================================================\n\nfunction normalizeCellValue(value: unknown): string | number | boolean | Date | null {\n if (value === null || value === undefined) return null\n if (value instanceof Date) return value\n if (typeof value === 'number') return Number.isFinite(value) ? value : null\n if (typeof value === 'boolean') return value\n if (Array.isArray(value)) return value.map(item => String(item)).join(', ')\n if (typeof value === 'object') return JSON.stringify(value)\n return String(value)\n}\n\n// ============================================================================\n// Worksheet Formatting\n// ============================================================================\n\nfunction applyHeaderStyle(row: ExcelJSRow, colors: ThemeColors): void {\n row.height = 18\n row.eachCell((cell: ExcelJSCell) => {\n cell.font = { bold: true, color: { argb: colors.headerText } }\n cell.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: { argb: colors.headerBg },\n }\n cell.alignment = { vertical: 'middle', horizontal: 'center', wrapText: true }\n })\n}\n\nfunction applyBorders(worksheet: ExcelJSWorksheet, colors: ThemeColors): void {\n worksheet.eachRow((row: ExcelJSRow) => {\n row.eachCell((cell: ExcelJSCell) => {\n cell.border = {\n top: { style: 'thin', color: { argb: colors.borderColor } },\n left: { style: 'thin', color: { argb: colors.borderColor } },\n bottom: { style: 'thin', color: { argb: colors.borderColor } },\n right: { style: 'thin', color: { argb: colors.borderColor } },\n }\n cell.alignment = { vertical: 'top', wrapText: true }\n })\n })\n}\n\nfunction autoFitColumns(worksheet: ExcelJSWorksheet, minWidths: number[] = []): void {\n worksheet.columns?.forEach((column: ExcelJSColumn, index: number) => {\n let maxLength = minWidths[index] ?? 10\n column.eachCell?.({ includeEmpty: true }, (cell: ExcelJSCell) => {\n const cellLength = String(cell.value ?? '').length\n if (cellLength > maxLength) maxLength = cellLength\n })\n column.width = Math.min(Math.max(maxLength + 2, minWidths[index] ?? 10), 70)\n })\n}\n\nfunction addTableSheet(\n workbook: ExcelJSWorkbook,\n name: string,\n rows: Array<Record<string, unknown>>,\n colors: ThemeColors\n): void {\n const worksheet = workbook.addWorksheet(name)\n\n if (rows.length === 0) {\n worksheet.addRow(['No data available'])\n autoFitColumns(worksheet, [32])\n return\n }\n\n const headers = Object.keys(rows[0])\n const headerRow = worksheet.addRow(headers)\n applyHeaderStyle(headerRow, colors)\n\n for (const row of rows) {\n worksheet.addRow(headers.map(header => normalizeCellValue(row[header])))\n }\n\n worksheet.views = [{ state: 'frozen', ySplit: 1 }]\n worksheet.autoFilter = {\n from: { row: 1, column: 1 },\n to: { row: 1, column: headers.length },\n }\n\n applyBorders(worksheet, colors)\n autoFitColumns(worksheet)\n}\n\n// ============================================================================\n// Filename Generation\n// ============================================================================\n\nfunction slugifyFilename(filename: string): string {\n return filename\n .replace(/[^a-zA-Z0-9]/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '')\n .toLowerCase()\n}\n\nfunction generateDownloadFilename(baseFilename: string, extension: string): string {\n const slugifiedBase = slugifyFilename(baseFilename)\n const now = new Date()\n const year = now.getFullYear()\n const month = String(now.getMonth() + 1).padStart(2, '0')\n const day = String(now.getDate()).padStart(2, '0')\n const dateStamp = `${year}${month}${day}`\n const uniqueSuffix = crypto.randomUUID().slice(0, 4).toUpperCase()\n return `${slugifiedBase}-${dateStamp}-${uniqueSuffix}.${extension}`\n}\n\n// ============================================================================\n// Module Availability\n// ============================================================================\n\n/**\n * Check if ExcelJS is available (installed as peer dependency)\n */\nasync function getExcelModule(): Promise<ExcelJSModule | null> {\n if (moduleChecked) {\n return excelModule\n }\n\n try {\n // Dynamic import - exceljs is an optional peer dependency\n // @ts-ignore - exceljs may not be installed\n excelModule = await import('exceljs') as ExcelJSModule\n moduleChecked = true\n return excelModule\n } catch {\n moduleChecked = true\n excelModule = null\n return null\n }\n}\n\n/**\n * Check if XLSX export is available (ExcelJS installed)\n */\nexport async function isExportAvailable(): Promise<boolean> {\n if (typeof window === 'undefined') return false\n const mod = await getExcelModule()\n return mod !== null\n}\n\n// Extend Window interface for warning flag\ndeclare global {\n interface Window {\n __drizzle_cube_xls_export_warning__?: boolean\n }\n}\n\n/**\n * Log a development-mode warning when xlsExport feature is enabled but exceljs is missing\n */\nexport function warnIfExcelJsMissing(xlsExportConfig: XlsExportFeatureConfig | undefined): void {\n if (typeof window === 'undefined') return\n if (!xlsExportConfig?.enabled) return\n\n // Only warn once per session\n if (window.__drizzle_cube_xls_export_warning__) return\n\n getExcelModule().then((mod) => {\n if (!mod && typeof process !== 'undefined' && process.env?.NODE_ENV === 'development') {\n console.warn(\n '[drizzle-cube] XLS export feature enabled but exceljs not installed. ' +\n 'Run: npm install exceljs'\n )\n window.__drizzle_cube_xls_export_warning__ = true\n }\n })\n}\n\n// ============================================================================\n// Data Type Detection\n// ============================================================================\n\nfunction isFlowChartData(data: unknown): data is FlowChartData {\n return (\n !!data &&\n typeof data === 'object' &&\n 'nodes' in data &&\n 'links' in data &&\n Array.isArray((data as FlowChartData).nodes) &&\n Array.isArray((data as FlowChartData).links)\n )\n}\n\nfunction isRetentionChartData(data: unknown): data is RetentionChartData {\n return (\n !!data &&\n typeof data === 'object' &&\n 'rows' in data &&\n 'periods' in data &&\n Array.isArray((data as RetentionChartData).rows) &&\n Array.isArray((data as RetentionChartData).periods)\n )\n}\n\n// ============================================================================\n// Browser Download\n// ============================================================================\n\nfunction triggerDownload(buffer: ArrayBuffer, filename: string): void {\n const blob = new Blob([buffer], {\n type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n })\n const url = URL.createObjectURL(blob)\n const anchor = document.createElement('a')\n anchor.href = url\n anchor.download = filename\n document.body.appendChild(anchor)\n anchor.click()\n document.body.removeChild(anchor)\n URL.revokeObjectURL(url)\n}\n\n// ============================================================================\n// Main Export Function\n// ============================================================================\n\n/**\n * Export portlet data as a formatted XLSX file.\n * Returns true on success, false on failure.\n */\nexport async function exportPortletToXlsx(\n portletTitle: string,\n debugData: PortletDebugDataEntry\n): Promise<boolean> {\n const ExcelJS = await getExcelModule()\n if (!ExcelJS) {\n console.warn('[drizzle-cube] Cannot export: exceljs not available')\n return false\n }\n\n try {\n const workbook = new ExcelJS.Workbook()\n const colors = resolveThemeColors()\n const { data } = debugData\n\n if (isFlowChartData(data)) {\n // Flow data: two sheets for nodes and links\n addTableSheet(workbook, 'Nodes', data.nodes as unknown as Record<string, unknown>[], colors)\n addTableSheet(workbook, 'Links', data.links as unknown as Record<string, unknown>[], colors)\n } else if (isRetentionChartData(data)) {\n // Retention data: export rows\n addTableSheet(workbook, portletTitle, data.rows as unknown as Record<string, unknown>[], colors)\n } else if (Array.isArray(data)) {\n // Standard flat data\n addTableSheet(workbook, portletTitle, data as Record<string, unknown>[], colors)\n } else {\n console.warn('[drizzle-cube] Cannot export: unrecognized data format')\n return false\n }\n\n const buffer = await workbook.xlsx.writeBuffer()\n const filename = generateDownloadFilename(portletTitle || 'export', 'xlsx')\n triggerDownload(buffer as ArrayBuffer, filename)\n\n return true\n } catch (error) {\n console.error('[drizzle-cube] Failed to export XLSX:', error)\n return false\n }\n}\n","/**\n * CubeFeaturesProvider - Feature Flags Context Layer\n *\n * Provides feature configuration isolated from API and metadata layers.\n * This prevents components from re-rendering when feature flags change\n * if they don't use features.\n */\n\nimport { createContext, useContext, useState, useMemo, useCallback, useEffect, type ReactNode } from 'react'\nimport type { FeaturesConfig, DashboardLayoutMode } from '../types.js'\nimport { warnIfScreenshotLibMissing } from '../utils/thumbnail.js'\nimport { warnIfExcelJsMissing } from '../utils/exportXlsx.js'\n\ninterface CubeFeaturesContextValue {\n features: FeaturesConfig\n dashboardModes: DashboardLayoutMode[]\n updateFeatures: (newFeatures: Partial<FeaturesConfig>) => void\n}\n\nconst CubeFeaturesContext = createContext<CubeFeaturesContextValue | null>(null)\n\ninterface CubeFeaturesProviderProps {\n features?: FeaturesConfig\n dashboardModes?: DashboardLayoutMode[]\n children: ReactNode\n}\n\nconst DEFAULT_FEATURES: FeaturesConfig = {\n enableAI: true,\n aiEndpoint: '/api/ai/generate',\n showSchemaDiagram: false,\n useAnalysisBuilder: false,\n editToolbar: 'both',\n floatingToolbarPosition: 'right'\n}\n\nexport function CubeFeaturesProvider({\n features: initialFeatures,\n dashboardModes = ['rows', 'grid'],\n children\n}: CubeFeaturesProviderProps) {\n // Merge passed features with defaults so new features get default values\n const [features, setFeatures] = useState<FeaturesConfig>(() => ({\n ...DEFAULT_FEATURES,\n ...initialFeatures\n }))\n\n // Warn in development if thumbnail feature is enabled but modern-screenshot is not installed\n useEffect(() => {\n warnIfScreenshotLibMissing(features.thumbnail)\n }, [features.thumbnail])\n\n // Warn in development if xlsExport feature is enabled but exceljs is not installed\n useEffect(() => {\n warnIfExcelJsMissing(features.xlsExport)\n }, [features.xlsExport])\n\n const updateFeatures = useCallback((newFeatures: Partial<FeaturesConfig>) => {\n setFeatures(prev => ({ ...prev, ...newFeatures }))\n }, [])\n\n const value = useMemo(() => ({\n features,\n dashboardModes,\n updateFeatures\n }), [features, dashboardModes, updateFeatures])\n\n return (\n <CubeFeaturesContext.Provider value={value}>\n {children}\n </CubeFeaturesContext.Provider>\n )\n}\n\n// Default context value when used outside provider (safe fallback for hooks)\nconst DEFAULT_CONTEXT: CubeFeaturesContextValue = {\n features: DEFAULT_FEATURES,\n dashboardModes: ['rows', 'grid'],\n updateFeatures: () => {\n // No-op when used outside provider\n }\n}\n\n/**\n * Hook to access cube features context.\n * Returns default values if used outside CubeFeaturesProvider (graceful fallback).\n */\nexport function useCubeFeatures() {\n const context = useContext(CubeFeaturesContext)\n // Return default context if not within provider (allows hooks like useCubeLoadQuery to work in isolation)\n return context ?? DEFAULT_CONTEXT\n}\n","'use client';\n\nimport { createElement, forwardRef, useState, useEffect } from 'react';\n\n/**\n* Resolve icon set icons\n*\n* Returns parent icon for each icon\n*/\nfunction getIconsTree(data, names) {\n\tconst icons = data.icons;\n\tconst aliases = data.aliases || Object.create(null);\n\tconst resolved = Object.create(null);\n\tfunction resolve(name) {\n\t\tif (icons[name]) return resolved[name] = [];\n\t\tif (!(name in resolved)) {\n\t\t\tresolved[name] = null;\n\t\t\tconst parent = aliases[name] && aliases[name].parent;\n\t\t\tconst value = parent && resolve(parent);\n\t\t\tif (value) resolved[name] = [parent].concat(value);\n\t\t}\n\t\treturn resolved[name];\n\t}\n\t(Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);\n\treturn resolved;\n}\n\n/**\n* Default values for dimensions\n*/\nconst defaultIconDimensions = Object.freeze({\n\tleft: 0,\n\ttop: 0,\n\twidth: 16,\n\theight: 16\n});\n/**\n* Default values for transformations\n*/\nconst defaultIconTransformations = Object.freeze({\n\trotate: 0,\n\tvFlip: false,\n\thFlip: false\n});\n/**\n* Default values for all optional IconifyIcon properties\n*/\nconst defaultIconProps = Object.freeze({\n\t...defaultIconDimensions,\n\t...defaultIconTransformations\n});\n/**\n* Default values for all properties used in ExtendedIconifyIcon\n*/\nconst defaultExtendedIconProps = Object.freeze({\n\t...defaultIconProps,\n\tbody: \"\",\n\thidden: false\n});\n\n/**\n* Merge transformations\n*/\nfunction mergeIconTransformations(obj1, obj2) {\n\tconst result = {};\n\tif (!obj1.hFlip !== !obj2.hFlip) result.hFlip = true;\n\tif (!obj1.vFlip !== !obj2.vFlip) result.vFlip = true;\n\tconst rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;\n\tif (rotate) result.rotate = rotate;\n\treturn result;\n}\n\n/**\n* Merge icon and alias\n*\n* Can also be used to merge default values and icon\n*/\nfunction mergeIconData(parent, child) {\n\tconst result = mergeIconTransformations(parent, child);\n\tfor (const key in defaultExtendedIconProps) if (key in defaultIconTransformations) {\n\t\tif (key in parent && !(key in result)) result[key] = defaultIconTransformations[key];\n\t} else if (key in child) result[key] = child[key];\n\telse if (key in parent) result[key] = parent[key];\n\treturn result;\n}\n\n/**\n* Get icon data, using prepared aliases tree\n*/\nfunction internalGetIconData(data, name, tree) {\n\tconst icons = data.icons;\n\tconst aliases = data.aliases || Object.create(null);\n\tlet currentProps = {};\n\tfunction parse(name$1) {\n\t\tcurrentProps = mergeIconData(icons[name$1] || aliases[name$1], currentProps);\n\t}\n\tparse(name);\n\ttree.forEach(parse);\n\treturn mergeIconData(data, currentProps);\n}\n\n/**\n* Extract icons from an icon set\n*\n* Returns list of icons that were found in icon set\n*/\nfunction parseIconSet(data, callback) {\n\tconst names = [];\n\tif (typeof data !== \"object\" || typeof data.icons !== \"object\") return names;\n\tif (data.not_found instanceof Array) data.not_found.forEach((name) => {\n\t\tcallback(name, null);\n\t\tnames.push(name);\n\t});\n\tconst tree = getIconsTree(data);\n\tfor (const name in tree) {\n\t\tconst item = tree[name];\n\t\tif (item) {\n\t\t\tcallback(name, internalGetIconData(data, name, item));\n\t\t\tnames.push(name);\n\t\t}\n\t}\n\treturn names;\n}\n\n/**\n* Optional properties\n*/\nconst optionalPropertyDefaults = {\n\tprovider: \"\",\n\taliases: {},\n\tnot_found: {},\n\t...defaultIconDimensions\n};\n/**\n* Check props\n*/\nfunction checkOptionalProps(item, defaults) {\n\tfor (const prop in defaults) if (prop in item && typeof item[prop] !== typeof defaults[prop]) return false;\n\treturn true;\n}\n/**\n* Validate icon set, return it as IconifyJSON on success, null on failure\n*\n* Unlike validateIconSet(), this function is very basic.\n* It does not throw exceptions, it does not check metadata, it does not fix stuff.\n*/\nfunction quicklyValidateIconSet(obj) {\n\tif (typeof obj !== \"object\" || obj === null) return null;\n\tconst data = obj;\n\tif (typeof data.prefix !== \"string\" || !obj.icons || typeof obj.icons !== \"object\") return null;\n\tif (!checkOptionalProps(obj, optionalPropertyDefaults)) return null;\n\tconst icons = data.icons;\n\tfor (const name in icons) {\n\t\tconst icon = icons[name];\n\t\tif (!name || typeof icon.body !== \"string\" || !checkOptionalProps(icon, defaultExtendedIconProps)) return null;\n\t}\n\tconst aliases = data.aliases || Object.create(null);\n\tfor (const name in aliases) {\n\t\tconst icon = aliases[name];\n\t\tconst parent = icon.parent;\n\t\tif (!name || typeof parent !== \"string\" || !icons[parent] && !aliases[parent] || !checkOptionalProps(icon, defaultExtendedIconProps)) return null;\n\t}\n\treturn data;\n}\n\n/**\n* Storage by provider and prefix\n*/\nconst dataStorage = Object.create(null);\n/**\n* Create new storage\n*/\nfunction newStorage(provider, prefix) {\n\treturn {\n\t\tprovider,\n\t\tprefix,\n\t\ticons: Object.create(null),\n\t\tmissing: /* @__PURE__ */ new Set()\n\t};\n}\n/**\n* Get storage for provider and prefix\n*/\nfunction getStorage(provider, prefix) {\n\tconst providerStorage = dataStorage[provider] || (dataStorage[provider] = Object.create(null));\n\treturn providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));\n}\n/**\n* Add icon set to storage\n*\n* Returns array of added icons\n*/\nfunction addIconSet(storage, data) {\n\tif (!quicklyValidateIconSet(data)) return [];\n\treturn parseIconSet(data, (name, icon) => {\n\t\tif (icon) storage.icons[name] = icon;\n\t\telse storage.missing.add(name);\n\t});\n}\n/**\n* Add icon to storage\n*/\nfunction addIconToStorage(storage, name, icon) {\n\ttry {\n\t\tif (typeof icon.body === \"string\") {\n\t\t\tstorage.icons[name] = { ...icon };\n\t\t\treturn true;\n\t\t}\n\t} catch (err) {}\n\treturn false;\n}\n/**\n* List available icons\n*/\nfunction listIcons(provider, prefix) {\n\tlet allIcons = [];\n\tconst providers = typeof provider === \"string\" ? [provider] : Object.keys(dataStorage);\n\tproviders.forEach((provider$1) => {\n\t\tconst prefixes = typeof provider$1 === \"string\" && typeof prefix === \"string\" ? [prefix] : Object.keys(dataStorage[provider$1] || {});\n\t\tprefixes.forEach((prefix$1) => {\n\t\t\tconst storage = getStorage(provider$1, prefix$1);\n\t\t\tallIcons = allIcons.concat(Object.keys(storage.icons).map((name) => (provider$1 !== \"\" ? \"@\" + provider$1 + \":\" : \"\") + prefix$1 + \":\" + name));\n\t\t});\n\t});\n\treturn allIcons;\n}\n\n/**\n* Expression to test part of icon name.\n*\n* Used when loading icons from Iconify API due to project naming convension.\n* Ignored when using custom icon sets - convension does not apply.\n*/\nconst matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;\n/**\n* Convert string icon name to IconifyIconName object.\n*/\nconst stringToIcon = (value, validate, allowSimpleName, provider = \"\") => {\n\tconst colonSeparated = value.split(\":\");\n\tif (value.slice(0, 1) === \"@\") {\n\t\tif (colonSeparated.length < 2 || colonSeparated.length > 3) return null;\n\t\tprovider = colonSeparated.shift().slice(1);\n\t}\n\tif (colonSeparated.length > 3 || !colonSeparated.length) return null;\n\tif (colonSeparated.length > 1) {\n\t\tconst name$1 = colonSeparated.pop();\n\t\tconst prefix = colonSeparated.pop();\n\t\tconst result = {\n\t\t\tprovider: colonSeparated.length > 0 ? colonSeparated[0] : provider,\n\t\t\tprefix,\n\t\t\tname: name$1\n\t\t};\n\t\treturn validate && !validateIconName(result) ? null : result;\n\t}\n\tconst name = colonSeparated[0];\n\tconst dashSeparated = name.split(\"-\");\n\tif (dashSeparated.length > 1) {\n\t\tconst result = {\n\t\t\tprovider,\n\t\t\tprefix: dashSeparated.shift(),\n\t\t\tname: dashSeparated.join(\"-\")\n\t\t};\n\t\treturn validate && !validateIconName(result) ? null : result;\n\t}\n\tif (allowSimpleName && provider === \"\") {\n\t\tconst result = {\n\t\t\tprovider,\n\t\t\tprefix: \"\",\n\t\t\tname\n\t\t};\n\t\treturn validate && !validateIconName(result, allowSimpleName) ? null : result;\n\t}\n\treturn null;\n};\n/**\n* Check if icon is valid.\n*\n* This function is not part of stringToIcon because validation is not needed for most code.\n*/\nconst validateIconName = (icon, allowSimpleName) => {\n\tif (!icon) return false;\n\treturn !!((allowSimpleName && icon.prefix === \"\" || !!icon.prefix) && !!icon.name);\n};\n\n/**\n* Allow storing icons without provider or prefix, making it possible to store icons like \"home\"\n*/\nlet simpleNames = false;\nfunction allowSimpleNames(allow) {\n\tif (typeof allow === \"boolean\") simpleNames = allow;\n\treturn simpleNames;\n}\n/**\n* Get icon data\n*\n* Returns:\n* - IconifyIcon on success, object directly from storage so don't modify it\n* - null if icon is marked as missing (returned in `not_found` property from API, so don't bother sending API requests)\n* - undefined if icon is missing in storage\n*/\nfunction getIconData(name) {\n\tconst icon = typeof name === \"string\" ? stringToIcon(name, true, simpleNames) : name;\n\tif (icon) {\n\t\tconst storage = getStorage(icon.provider, icon.prefix);\n\t\tconst iconName = icon.name;\n\t\treturn storage.icons[iconName] || (storage.missing.has(iconName) ? null : void 0);\n\t}\n}\n/**\n* Add one icon\n*/\nfunction addIcon(name, data) {\n\tconst icon = stringToIcon(name, true, simpleNames);\n\tif (!icon) return false;\n\tconst storage = getStorage(icon.provider, icon.prefix);\n\tif (data) return addIconToStorage(storage, icon.name, data);\n\telse {\n\t\tstorage.missing.add(icon.name);\n\t\treturn true;\n\t}\n}\n/**\n* Add icon set\n*/\nfunction addCollection(data, provider) {\n\tif (typeof data !== \"object\") return false;\n\tif (typeof provider !== \"string\") provider = data.provider || \"\";\n\tif (simpleNames && !provider && !data.prefix) {\n\t\tlet added = false;\n\t\tif (quicklyValidateIconSet(data)) {\n\t\t\tdata.prefix = \"\";\n\t\t\tparseIconSet(data, (name, icon) => {\n\t\t\t\tif (addIcon(name, icon)) added = true;\n\t\t\t});\n\t\t}\n\t\treturn added;\n\t}\n\tconst prefix = data.prefix;\n\tif (!validateIconName({\n\t\tprefix,\n\t\tname: \"a\"\n\t})) return false;\n\tconst storage = getStorage(provider, prefix);\n\treturn !!addIconSet(storage, data);\n}\n/**\n* Check if icon data is available\n*/\nfunction iconLoaded(name) {\n\treturn !!getIconData(name);\n}\n/**\n* Get full icon\n*/\nfunction getIcon(name) {\n\tconst result = getIconData(name);\n\treturn result ? {\n\t\t...defaultIconProps,\n\t\t...result\n\t} : result;\n}\n\n/**\n* Default icon customisations values\n*/\nconst defaultIconSizeCustomisations = Object.freeze({\n\twidth: null,\n\theight: null\n});\nconst defaultIconCustomisations = Object.freeze({\n\t...defaultIconSizeCustomisations,\n\t...defaultIconTransformations\n});\n\n/**\n* Regular expressions for calculating dimensions\n*/\nconst unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;\nconst unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;\nfunction calculateSize(size, ratio, precision) {\n\tif (ratio === 1) return size;\n\tprecision = precision || 100;\n\tif (typeof size === \"number\") return Math.ceil(size * ratio * precision) / precision;\n\tif (typeof size !== \"string\") return size;\n\tconst oldParts = size.split(unitsSplit);\n\tif (oldParts === null || !oldParts.length) return size;\n\tconst newParts = [];\n\tlet code = oldParts.shift();\n\tlet isNumber = unitsTest.test(code);\n\twhile (true) {\n\t\tif (isNumber) {\n\t\t\tconst num = parseFloat(code);\n\t\t\tif (isNaN(num)) newParts.push(code);\n\t\t\telse newParts.push(Math.ceil(num * ratio * precision) / precision);\n\t\t} else newParts.push(code);\n\t\tcode = oldParts.shift();\n\t\tif (code === void 0) return newParts.join(\"\");\n\t\tisNumber = !isNumber;\n\t}\n}\n\nfunction splitSVGDefs(content, tag = \"defs\") {\n\tlet defs = \"\";\n\tconst index = content.indexOf(\"<\" + tag);\n\twhile (index >= 0) {\n\t\tconst start = content.indexOf(\">\", index);\n\t\tconst end = content.indexOf(\"</\" + tag);\n\t\tif (start === -1 || end === -1) break;\n\t\tconst endEnd = content.indexOf(\">\", end);\n\t\tif (endEnd === -1) break;\n\t\tdefs += content.slice(start + 1, end).trim();\n\t\tcontent = content.slice(0, index).trim() + content.slice(endEnd + 1);\n\t}\n\treturn {\n\t\tdefs,\n\t\tcontent\n\t};\n}\n/**\n* Merge defs and content\n*/\nfunction mergeDefsAndContent(defs, content) {\n\treturn defs ? \"<defs>\" + defs + \"</defs>\" + content : content;\n}\n/**\n* Wrap SVG content, without wrapping definitions\n*/\nfunction wrapSVGContent(body, start, end) {\n\tconst split = splitSVGDefs(body);\n\treturn mergeDefsAndContent(split.defs, start + split.content + end);\n}\n\n/**\n* Check if value should be unset. Allows multiple keywords\n*/\nconst isUnsetKeyword = (value) => value === \"unset\" || value === \"undefined\" || value === \"none\";\n/**\n* Get SVG attributes and content from icon + customisations\n*\n* Does not generate style to make it compatible with frameworks that use objects for style, such as React.\n* Instead, it generates 'inline' value. If true, rendering engine should add verticalAlign: -0.125em to icon.\n*\n* Customisations should be normalised by platform specific parser.\n* Result should be converted to <svg> by platform specific parser.\n* Use replaceIDs to generate unique IDs for body.\n*/\nfunction iconToSVG(icon, customisations) {\n\tconst fullIcon = {\n\t\t...defaultIconProps,\n\t\t...icon\n\t};\n\tconst fullCustomisations = {\n\t\t...defaultIconCustomisations,\n\t\t...customisations\n\t};\n\tconst box = {\n\t\tleft: fullIcon.left,\n\t\ttop: fullIcon.top,\n\t\twidth: fullIcon.width,\n\t\theight: fullIcon.height\n\t};\n\tlet body = fullIcon.body;\n\t[fullIcon, fullCustomisations].forEach((props) => {\n\t\tconst transformations = [];\n\t\tconst hFlip = props.hFlip;\n\t\tconst vFlip = props.vFlip;\n\t\tlet rotation = props.rotate;\n\t\tif (hFlip) if (vFlip) rotation += 2;\n\t\telse {\n\t\t\ttransformations.push(\"translate(\" + (box.width + box.left).toString() + \" \" + (0 - box.top).toString() + \")\");\n\t\t\ttransformations.push(\"scale(-1 1)\");\n\t\t\tbox.top = box.left = 0;\n\t\t}\n\t\telse if (vFlip) {\n\t\t\ttransformations.push(\"translate(\" + (0 - box.left).toString() + \" \" + (box.height + box.top).toString() + \")\");\n\t\t\ttransformations.push(\"scale(1 -1)\");\n\t\t\tbox.top = box.left = 0;\n\t\t}\n\t\tlet tempValue;\n\t\tif (rotation < 0) rotation -= Math.floor(rotation / 4) * 4;\n\t\trotation = rotation % 4;\n\t\tswitch (rotation) {\n\t\t\tcase 1:\n\t\t\t\ttempValue = box.height / 2 + box.top;\n\t\t\t\ttransformations.unshift(\"rotate(90 \" + tempValue.toString() + \" \" + tempValue.toString() + \")\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\ttransformations.unshift(\"rotate(180 \" + (box.width / 2 + box.left).toString() + \" \" + (box.height / 2 + box.top).toString() + \")\");\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\ttempValue = box.width / 2 + box.left;\n\t\t\t\ttransformations.unshift(\"rotate(-90 \" + tempValue.toString() + \" \" + tempValue.toString() + \")\");\n\t\t\t\tbreak;\n\t\t}\n\t\tif (rotation % 2 === 1) {\n\t\t\tif (box.left !== box.top) {\n\t\t\t\ttempValue = box.left;\n\t\t\t\tbox.left = box.top;\n\t\t\t\tbox.top = tempValue;\n\t\t\t}\n\t\t\tif (box.width !== box.height) {\n\t\t\t\ttempValue = box.width;\n\t\t\t\tbox.width = box.height;\n\t\t\t\tbox.height = tempValue;\n\t\t\t}\n\t\t}\n\t\tif (transformations.length) body = wrapSVGContent(body, \"<g transform=\\\"\" + transformations.join(\" \") + \"\\\">\", \"</g>\");\n\t});\n\tconst customisationsWidth = fullCustomisations.width;\n\tconst customisationsHeight = fullCustomisations.height;\n\tconst boxWidth = box.width;\n\tconst boxHeight = box.height;\n\tlet width;\n\tlet height;\n\tif (customisationsWidth === null) {\n\t\theight = customisationsHeight === null ? \"1em\" : customisationsHeight === \"auto\" ? boxHeight : customisationsHeight;\n\t\twidth = calculateSize(height, boxWidth / boxHeight);\n\t} else {\n\t\twidth = customisationsWidth === \"auto\" ? boxWidth : customisationsWidth;\n\t\theight = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === \"auto\" ? boxHeight : customisationsHeight;\n\t}\n\tconst attributes = {};\n\tconst setAttr = (prop, value) => {\n\t\tif (!isUnsetKeyword(value)) attributes[prop] = value.toString();\n\t};\n\tsetAttr(\"width\", width);\n\tsetAttr(\"height\", height);\n\tconst viewBox = [\n\t\tbox.left,\n\t\tbox.top,\n\t\tboxWidth,\n\t\tboxHeight\n\t];\n\tattributes.viewBox = viewBox.join(\" \");\n\treturn {\n\t\tattributes,\n\t\tviewBox,\n\t\tbody\n\t};\n}\n\n/**\n* IDs usage:\n*\n* id=\"{id}\"\n* xlink:href=\"#{id}\"\n* url(#{id})\n*\n* From SVG animations:\n*\n* begin=\"0;{id}.end\"\n* begin=\"{id}.end\"\n* begin=\"{id}.click\"\n*/\n/**\n* Regular expression for finding ids\n*/\nconst regex = /\\sid=\"(\\S+)\"/g;\n/**\n* New random-ish prefix for ids\n*\n* Do not use dash, it cannot be used in SVG 2 animations\n*/\nconst randomPrefix = \"IconifyId\" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);\n/**\n* Counter for ids, increasing with every replacement\n*/\nlet counter = 0;\n/**\n* Replace IDs in SVG output with unique IDs\n*/\nfunction replaceIDs(body, prefix = randomPrefix) {\n\tconst ids = [];\n\tlet match;\n\twhile (match = regex.exec(body)) ids.push(match[1]);\n\tif (!ids.length) return body;\n\tconst suffix = \"suffix\" + (Math.random() * 16777216 | Date.now()).toString(16);\n\tids.forEach((id) => {\n\t\tconst newID = typeof prefix === \"function\" ? prefix(id) : prefix + (counter++).toString();\n\t\tconst escapedID = id.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\t\tbody = body.replace(new RegExp(\"([#;\\\"])(\" + escapedID + \")([\\\")]|\\\\.[a-z])\", \"g\"), \"$1\" + newID + suffix + \"$3\");\n\t});\n\tbody = body.replace(new RegExp(suffix, \"g\"), \"\");\n\treturn body;\n}\n\n/**\n* Local storate types and entries\n*/\nconst storage = Object.create(null);\n/**\n* Set API module\n*/\nfunction setAPIModule(provider, item) {\n\tstorage[provider] = item;\n}\n/**\n* Get API module\n*/\nfunction getAPIModule(provider) {\n\treturn storage[provider] || storage[\"\"];\n}\n\n/**\n* Create full API configuration from partial data\n*/\nfunction createAPIConfig(source) {\n\tlet resources;\n\tif (typeof source.resources === \"string\") resources = [source.resources];\n\telse {\n\t\tresources = source.resources;\n\t\tif (!(resources instanceof Array) || !resources.length) return null;\n\t}\n\tconst result = {\n\t\tresources,\n\t\tpath: source.path || \"/\",\n\t\tmaxURL: source.maxURL || 500,\n\t\trotate: source.rotate || 750,\n\t\ttimeout: source.timeout || 5e3,\n\t\trandom: source.random === true,\n\t\tindex: source.index || 0,\n\t\tdataAfterTimeout: source.dataAfterTimeout !== false\n\t};\n\treturn result;\n}\n/**\n* Local storage\n*/\nconst configStorage = Object.create(null);\n/**\n* Redundancy for API servers.\n*\n* API should have very high uptime because of implemented redundancy at server level, but\n* sometimes bad things happen. On internet 100% uptime is not possible.\n*\n* There could be routing problems. Server might go down for whatever reason, but it takes\n* few minutes to detect that downtime, so during those few minutes API might not be accessible.\n*\n* This script has some redundancy to mitigate possible network issues.\n*\n* If one host cannot be reached in 'rotate' (750 by default) ms, script will try to retrieve\n* data from different host. Hosts have different configurations, pointing to different\n* API servers hosted at different providers.\n*/\nconst fallBackAPISources = [\"https://api.simplesvg.com\", \"https://api.unisvg.com\"];\nconst fallBackAPI = [];\nwhile (fallBackAPISources.length > 0) if (fallBackAPISources.length === 1) fallBackAPI.push(fallBackAPISources.shift());\nelse if (Math.random() > .5) fallBackAPI.push(fallBackAPISources.shift());\nelse fallBackAPI.push(fallBackAPISources.pop());\nconfigStorage[\"\"] = createAPIConfig({ resources: [\"https://api.iconify.design\"].concat(fallBackAPI) });\n/**\n* Add custom config for provider\n*/\nfunction addAPIProvider(provider, customConfig) {\n\tconst config = createAPIConfig(customConfig);\n\tif (config === null) return false;\n\tconfigStorage[provider] = config;\n\treturn true;\n}\n/**\n* Get API configuration\n*/\nfunction getAPIConfig(provider) {\n\treturn configStorage[provider];\n}\n/**\n* List API providers\n*/\nfunction listAPIProviders() {\n\treturn Object.keys(configStorage);\n}\n\nconst detectFetch = () => {\n\tlet callback;\n\ttry {\n\t\tcallback = fetch;\n\t\tif (typeof callback === \"function\") return callback;\n\t} catch (err) {}\n};\n/**\n* Fetch function\n*/\nlet fetchModule = detectFetch();\n/**\n* Set custom fetch() function\n*/\nfunction setFetch(fetch$1) {\n\tfetchModule = fetch$1;\n}\n/**\n* Get fetch() function. Used by Icon Finder Core\n*/\nfunction getFetch() {\n\treturn fetchModule;\n}\n/**\n* Calculate maximum icons list length for prefix\n*/\nfunction calculateMaxLength(provider, prefix) {\n\tconst config = getAPIConfig(provider);\n\tif (!config) return 0;\n\tlet result;\n\tif (!config.maxURL) result = 0;\n\telse {\n\t\tlet maxHostLength = 0;\n\t\tconfig.resources.forEach((item) => {\n\t\t\tconst host = item;\n\t\t\tmaxHostLength = Math.max(maxHostLength, host.length);\n\t\t});\n\t\tconst url = prefix + \".json?icons=\";\n\t\tresult = config.maxURL - maxHostLength - config.path.length - url.length;\n\t}\n\treturn result;\n}\n/**\n* Should query be aborted, based on last HTTP status\n*/\nfunction shouldAbort(status) {\n\treturn status === 404;\n}\n/**\n* Prepare params\n*/\nconst prepare = (provider, prefix, icons) => {\n\tconst results = [];\n\tconst maxLength = calculateMaxLength(provider, prefix);\n\tconst type = \"icons\";\n\tlet item = {\n\t\ttype,\n\t\tprovider,\n\t\tprefix,\n\t\ticons: []\n\t};\n\tlet length = 0;\n\ticons.forEach((name, index) => {\n\t\tlength += name.length + 1;\n\t\tif (length >= maxLength && index > 0) {\n\t\t\tresults.push(item);\n\t\t\titem = {\n\t\t\t\ttype,\n\t\t\t\tprovider,\n\t\t\t\tprefix,\n\t\t\t\ticons: []\n\t\t\t};\n\t\t\tlength = name.length;\n\t\t}\n\t\titem.icons.push(name);\n\t});\n\tresults.push(item);\n\treturn results;\n};\n/**\n* Get path\n*/\nfunction getPath(provider) {\n\tif (typeof provider === \"string\") {\n\t\tconst config = getAPIConfig(provider);\n\t\tif (config) return config.path;\n\t}\n\treturn \"/\";\n}\n/**\n* Load icons\n*/\nconst send = (host, params, callback) => {\n\tif (!fetchModule) {\n\t\tcallback(\"abort\", 424);\n\t\treturn;\n\t}\n\tlet path = getPath(params.provider);\n\tswitch (params.type) {\n\t\tcase \"icons\": {\n\t\t\tconst prefix = params.prefix;\n\t\t\tconst icons = params.icons;\n\t\t\tconst iconsList = icons.join(\",\");\n\t\t\tconst urlParams = new URLSearchParams({ icons: iconsList });\n\t\t\tpath += prefix + \".json?\" + urlParams.toString();\n\t\t\tbreak;\n\t\t}\n\t\tcase \"custom\": {\n\t\t\tconst uri = params.uri;\n\t\t\tpath += uri.slice(0, 1) === \"/\" ? uri.slice(1) : uri;\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tcallback(\"abort\", 400);\n\t\t\treturn;\n\t}\n\tlet defaultError = 503;\n\tfetchModule(host + path).then((response) => {\n\t\tconst status = response.status;\n\t\tif (status !== 200) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tcallback(shouldAbort(status) ? \"abort\" : \"next\", status);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tdefaultError = 501;\n\t\treturn response.json();\n\t}).then((data) => {\n\t\tif (typeof data !== \"object\" || data === null) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (data === 404) callback(\"abort\", data);\n\t\t\t\telse callback(\"next\", defaultError);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\tcallback(\"success\", data);\n\t\t});\n\t}).catch(() => {\n\t\tcallback(\"next\", defaultError);\n\t});\n};\n/**\n* Export module\n*/\nconst fetchAPIModule = {\n\tprepare,\n\tsend\n};\n\n/**\n* Remove callback\n*/\nfunction removeCallback(storages, id) {\n\tstorages.forEach((storage) => {\n\t\tconst items = storage.loaderCallbacks;\n\t\tif (items) storage.loaderCallbacks = items.filter((row) => row.id !== id);\n\t});\n}\n/**\n* Update all callbacks for provider and prefix\n*/\nfunction updateCallbacks(storage) {\n\tif (!storage.pendingCallbacksFlag) {\n\t\tstorage.pendingCallbacksFlag = true;\n\t\tsetTimeout(() => {\n\t\t\tstorage.pendingCallbacksFlag = false;\n\t\t\tconst items = storage.loaderCallbacks ? storage.loaderCallbacks.slice(0) : [];\n\t\t\tif (!items.length) return;\n\t\t\tlet hasPending = false;\n\t\t\tconst provider = storage.provider;\n\t\t\tconst prefix = storage.prefix;\n\t\t\titems.forEach((item) => {\n\t\t\t\tconst icons = item.icons;\n\t\t\t\tconst oldLength = icons.pending.length;\n\t\t\t\ticons.pending = icons.pending.filter((icon) => {\n\t\t\t\t\tif (icon.prefix !== prefix) return true;\n\t\t\t\t\tconst name = icon.name;\n\t\t\t\t\tif (storage.icons[name]) icons.loaded.push({\n\t\t\t\t\t\tprovider,\n\t\t\t\t\t\tprefix,\n\t\t\t\t\t\tname\n\t\t\t\t\t});\n\t\t\t\t\telse if (storage.missing.has(name)) icons.missing.push({\n\t\t\t\t\t\tprovider,\n\t\t\t\t\t\tprefix,\n\t\t\t\t\t\tname\n\t\t\t\t\t});\n\t\t\t\t\telse {\n\t\t\t\t\t\thasPending = true;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t\tif (icons.pending.length !== oldLength) {\n\t\t\t\t\tif (!hasPending) removeCallback([storage], item.id);\n\t\t\t\t\titem.callback(icons.loaded.slice(0), icons.missing.slice(0), icons.pending.slice(0), item.abort);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n/**\n* Unique id counter for callbacks\n*/\nlet idCounter = 0;\n/**\n* Add callback\n*/\nfunction storeCallback(callback, icons, pendingSources) {\n\tconst id = idCounter++;\n\tconst abort = removeCallback.bind(null, pendingSources, id);\n\tif (!icons.pending.length) return abort;\n\tconst item = {\n\t\tid,\n\t\ticons,\n\t\tcallback,\n\t\tabort\n\t};\n\tpendingSources.forEach((storage) => {\n\t\t(storage.loaderCallbacks || (storage.loaderCallbacks = [])).push(item);\n\t});\n\treturn abort;\n}\n\n/**\n* Check if icons have been loaded\n*/\nfunction sortIcons(icons) {\n\tconst result = {\n\t\tloaded: [],\n\t\tmissing: [],\n\t\tpending: []\n\t};\n\tconst storage = Object.create(null);\n\ticons.sort((a, b) => {\n\t\tif (a.provider !== b.provider) return a.provider.localeCompare(b.provider);\n\t\tif (a.prefix !== b.prefix) return a.prefix.localeCompare(b.prefix);\n\t\treturn a.name.localeCompare(b.name);\n\t});\n\tlet lastIcon = {\n\t\tprovider: \"\",\n\t\tprefix: \"\",\n\t\tname: \"\"\n\t};\n\ticons.forEach((icon) => {\n\t\tif (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) return;\n\t\tlastIcon = icon;\n\t\tconst provider = icon.provider;\n\t\tconst prefix = icon.prefix;\n\t\tconst name = icon.name;\n\t\tconst providerStorage = storage[provider] || (storage[provider] = Object.create(null));\n\t\tconst localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));\n\t\tlet list;\n\t\tif (name in localStorage.icons) list = result.loaded;\n\t\telse if (prefix === \"\" || localStorage.missing.has(name)) list = result.missing;\n\t\telse list = result.pending;\n\t\tconst item = {\n\t\t\tprovider,\n\t\t\tprefix,\n\t\t\tname\n\t\t};\n\t\tlist.push(item);\n\t});\n\treturn result;\n}\n\n/**\n* Convert icons list from string/icon mix to icons and validate them\n*/\nfunction listToIcons(list, validate = true, simpleNames = false) {\n\tconst result = [];\n\tlist.forEach((item) => {\n\t\tconst icon = typeof item === \"string\" ? stringToIcon(item, validate, simpleNames) : item;\n\t\tif (icon) result.push(icon);\n\t});\n\treturn result;\n}\n\n/**\n* Default RedundancyConfig for API calls\n*/\nconst defaultConfig = {\n\tresources: [],\n\tindex: 0,\n\ttimeout: 2e3,\n\trotate: 750,\n\trandom: false,\n\tdataAfterTimeout: false\n};\n\n/**\n* Send query\n*/\nfunction sendQuery(config, payload, query, done) {\n\tconst resourcesCount = config.resources.length;\n\tconst startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;\n\tlet resources;\n\tif (config.random) {\n\t\tlet list = config.resources.slice(0);\n\t\tresources = [];\n\t\twhile (list.length > 1) {\n\t\t\tconst nextIndex = Math.floor(Math.random() * list.length);\n\t\t\tresources.push(list[nextIndex]);\n\t\t\tlist = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));\n\t\t}\n\t\tresources = resources.concat(list);\n\t} else resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));\n\tconst startTime = Date.now();\n\tlet status = \"pending\";\n\tlet queriesSent = 0;\n\tlet lastError;\n\tlet timer = null;\n\tlet queue = [];\n\tlet doneCallbacks = [];\n\tif (typeof done === \"function\") doneCallbacks.push(done);\n\t/**\n\t* Reset timer\n\t*/\n\tfunction resetTimer() {\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = null;\n\t\t}\n\t}\n\t/**\n\t* Abort everything\n\t*/\n\tfunction abort() {\n\t\tif (status === \"pending\") status = \"aborted\";\n\t\tresetTimer();\n\t\tqueue.forEach((item) => {\n\t\t\tif (item.status === \"pending\") item.status = \"aborted\";\n\t\t});\n\t\tqueue = [];\n\t}\n\t/**\n\t* Add / replace callback to call when execution is complete.\n\t* This can be used to abort pending query implementations when query is complete or aborted.\n\t*/\n\tfunction subscribe(callback, overwrite) {\n\t\tif (overwrite) doneCallbacks = [];\n\t\tif (typeof callback === \"function\") doneCallbacks.push(callback);\n\t}\n\t/**\n\t* Get query status\n\t*/\n\tfunction getQueryStatus() {\n\t\treturn {\n\t\t\tstartTime,\n\t\t\tpayload,\n\t\t\tstatus,\n\t\t\tqueriesSent,\n\t\t\tqueriesPending: queue.length,\n\t\t\tsubscribe,\n\t\t\tabort\n\t\t};\n\t}\n\t/**\n\t* Fail query\n\t*/\n\tfunction failQuery() {\n\t\tstatus = \"failed\";\n\t\tdoneCallbacks.forEach((callback) => {\n\t\t\tcallback(void 0, lastError);\n\t\t});\n\t}\n\t/**\n\t* Clear queue\n\t*/\n\tfunction clearQueue() {\n\t\tqueue.forEach((item) => {\n\t\t\tif (item.status === \"pending\") item.status = \"aborted\";\n\t\t});\n\t\tqueue = [];\n\t}\n\t/**\n\t* Got response from module\n\t*/\n\tfunction moduleResponse(item, response, data) {\n\t\tconst isError = response !== \"success\";\n\t\tqueue = queue.filter((queued) => queued !== item);\n\t\tswitch (status) {\n\t\t\tcase \"pending\": break;\n\t\t\tcase \"failed\":\n\t\t\t\tif (isError || !config.dataAfterTimeout) return;\n\t\t\t\tbreak;\n\t\t\tdefault: return;\n\t\t}\n\t\tif (response === \"abort\") {\n\t\t\tlastError = data;\n\t\t\tfailQuery();\n\t\t\treturn;\n\t\t}\n\t\tif (isError) {\n\t\t\tlastError = data;\n\t\t\tif (!queue.length) if (!resources.length) failQuery();\n\t\t\telse execNext();\n\t\t\treturn;\n\t\t}\n\t\tresetTimer();\n\t\tclearQueue();\n\t\tif (!config.random) {\n\t\t\tconst index = config.resources.indexOf(item.resource);\n\t\t\tif (index !== -1 && index !== config.index) config.index = index;\n\t\t}\n\t\tstatus = \"completed\";\n\t\tdoneCallbacks.forEach((callback) => {\n\t\t\tcallback(data);\n\t\t});\n\t}\n\t/**\n\t* Execute next query\n\t*/\n\tfunction execNext() {\n\t\tif (status !== \"pending\") return;\n\t\tresetTimer();\n\t\tconst resource = resources.shift();\n\t\tif (resource === void 0) {\n\t\t\tif (queue.length) {\n\t\t\t\ttimer = setTimeout(() => {\n\t\t\t\t\tresetTimer();\n\t\t\t\t\tif (status === \"pending\") {\n\t\t\t\t\t\tclearQueue();\n\t\t\t\t\t\tfailQuery();\n\t\t\t\t\t}\n\t\t\t\t}, config.timeout);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfailQuery();\n\t\t\treturn;\n\t\t}\n\t\tconst item = {\n\t\t\tstatus: \"pending\",\n\t\t\tresource,\n\t\t\tcallback: (status$1, data) => {\n\t\t\t\tmoduleResponse(item, status$1, data);\n\t\t\t}\n\t\t};\n\t\tqueue.push(item);\n\t\tqueriesSent++;\n\t\ttimer = setTimeout(execNext, config.rotate);\n\t\tquery(resource, payload, item.callback);\n\t}\n\tsetTimeout(execNext);\n\treturn getQueryStatus;\n}\n\n/**\n* Redundancy instance\n*/\nfunction initRedundancy(cfg) {\n\tconst config = {\n\t\t...defaultConfig,\n\t\t...cfg\n\t};\n\tlet queries = [];\n\t/**\n\t* Remove aborted and completed queries\n\t*/\n\tfunction cleanup() {\n\t\tqueries = queries.filter((item) => item().status === \"pending\");\n\t}\n\t/**\n\t* Send query\n\t*/\n\tfunction query(payload, queryCallback, doneCallback) {\n\t\tconst query$1 = sendQuery(config, payload, queryCallback, (data, error) => {\n\t\t\tcleanup();\n\t\t\tif (doneCallback) doneCallback(data, error);\n\t\t});\n\t\tqueries.push(query$1);\n\t\treturn query$1;\n\t}\n\t/**\n\t* Find instance\n\t*/\n\tfunction find(callback) {\n\t\treturn queries.find((value) => {\n\t\t\treturn callback(value);\n\t\t}) || null;\n\t}\n\tconst instance = {\n\t\tquery,\n\t\tfind,\n\t\tsetIndex: (index) => {\n\t\t\tconfig.index = index;\n\t\t},\n\t\tgetIndex: () => config.index,\n\t\tcleanup\n\t};\n\treturn instance;\n}\n\nfunction emptyCallback$1() {}\nconst redundancyCache = Object.create(null);\n/**\n* Get Redundancy instance for provider\n*/\nfunction getRedundancyCache(provider) {\n\tif (!redundancyCache[provider]) {\n\t\tconst config = getAPIConfig(provider);\n\t\tif (!config) return;\n\t\tconst redundancy = initRedundancy(config);\n\t\tconst cachedReundancy = {\n\t\t\tconfig,\n\t\t\tredundancy\n\t\t};\n\t\tredundancyCache[provider] = cachedReundancy;\n\t}\n\treturn redundancyCache[provider];\n}\n/**\n* Send API query\n*/\nfunction sendAPIQuery(target, query, callback) {\n\tlet redundancy;\n\tlet send;\n\tif (typeof target === \"string\") {\n\t\tconst api = getAPIModule(target);\n\t\tif (!api) {\n\t\t\tcallback(void 0, 424);\n\t\t\treturn emptyCallback$1;\n\t\t}\n\t\tsend = api.send;\n\t\tconst cached = getRedundancyCache(target);\n\t\tif (cached) redundancy = cached.redundancy;\n\t} else {\n\t\tconst config = createAPIConfig(target);\n\t\tif (config) {\n\t\t\tredundancy = initRedundancy(config);\n\t\t\tconst moduleKey = target.resources ? target.resources[0] : \"\";\n\t\t\tconst api = getAPIModule(moduleKey);\n\t\t\tif (api) send = api.send;\n\t\t}\n\t}\n\tif (!redundancy || !send) {\n\t\tcallback(void 0, 424);\n\t\treturn emptyCallback$1;\n\t}\n\treturn redundancy.query(query, send, callback)().abort;\n}\n\nfunction emptyCallback() {}\n/**\n* Function called when new icons have been loaded\n*/\nfunction loadedNewIcons(storage) {\n\tif (!storage.iconsLoaderFlag) {\n\t\tstorage.iconsLoaderFlag = true;\n\t\tsetTimeout(() => {\n\t\t\tstorage.iconsLoaderFlag = false;\n\t\t\tupdateCallbacks(storage);\n\t\t});\n\t}\n}\n/**\n* Check icon names for API\n*/\nfunction checkIconNamesForAPI(icons) {\n\tconst valid = [];\n\tconst invalid = [];\n\ticons.forEach((name) => {\n\t\t(name.match(matchIconName) ? valid : invalid).push(name);\n\t});\n\treturn {\n\t\tvalid,\n\t\tinvalid\n\t};\n}\n/**\n* Parse loader response\n*/\nfunction parseLoaderResponse(storage, icons, data) {\n\tfunction checkMissing() {\n\t\tconst pending = storage.pendingIcons;\n\t\ticons.forEach((name) => {\n\t\t\tif (pending) pending.delete(name);\n\t\t\tif (!storage.icons[name]) storage.missing.add(name);\n\t\t});\n\t}\n\tif (data && typeof data === \"object\") try {\n\t\tconst parsed = addIconSet(storage, data);\n\t\tif (!parsed.length) {\n\t\t\tcheckMissing();\n\t\t\treturn;\n\t\t}\n\t} catch (err) {\n\t\tconsole.error(err);\n\t}\n\tcheckMissing();\n\tloadedNewIcons(storage);\n}\n/**\n* Handle response that can be async\n*/\nfunction parsePossiblyAsyncResponse(response, callback) {\n\tif (response instanceof Promise) response.then((data) => {\n\t\tcallback(data);\n\t}).catch(() => {\n\t\tcallback(null);\n\t});\n\telse callback(response);\n}\n/**\n* Load icons\n*/\nfunction loadNewIcons(storage, icons) {\n\tif (!storage.iconsToLoad) storage.iconsToLoad = icons;\n\telse storage.iconsToLoad = storage.iconsToLoad.concat(icons).sort();\n\tif (!storage.iconsQueueFlag) {\n\t\tstorage.iconsQueueFlag = true;\n\t\tsetTimeout(() => {\n\t\t\tstorage.iconsQueueFlag = false;\n\t\t\tconst { provider, prefix } = storage;\n\t\t\tconst icons$1 = storage.iconsToLoad;\n\t\t\tdelete storage.iconsToLoad;\n\t\t\tif (!icons$1 || !icons$1.length) return;\n\t\t\tconst customIconLoader = storage.loadIcon;\n\t\t\tif (storage.loadIcons && (icons$1.length > 1 || !customIconLoader)) {\n\t\t\t\tparsePossiblyAsyncResponse(storage.loadIcons(icons$1, prefix, provider), (data) => {\n\t\t\t\t\tparseLoaderResponse(storage, icons$1, data);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (customIconLoader) {\n\t\t\t\ticons$1.forEach((name) => {\n\t\t\t\t\tconst response = customIconLoader(name, prefix, provider);\n\t\t\t\t\tparsePossiblyAsyncResponse(response, (data) => {\n\t\t\t\t\t\tconst iconSet = data ? {\n\t\t\t\t\t\t\tprefix,\n\t\t\t\t\t\t\ticons: { [name]: data }\n\t\t\t\t\t\t} : null;\n\t\t\t\t\t\tparseLoaderResponse(storage, [name], iconSet);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { valid, invalid } = checkIconNamesForAPI(icons$1);\n\t\t\tif (invalid.length) parseLoaderResponse(storage, invalid, null);\n\t\t\tif (!valid.length) return;\n\t\t\tconst api = prefix.match(matchIconName) ? getAPIModule(provider) : null;\n\t\t\tif (!api) {\n\t\t\t\tparseLoaderResponse(storage, valid, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst params = api.prepare(provider, prefix, valid);\n\t\t\tparams.forEach((item) => {\n\t\t\t\tsendAPIQuery(provider, item, (data) => {\n\t\t\t\t\tparseLoaderResponse(storage, item.icons, data);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n}\n/**\n* Load icons\n*/\nconst loadIcons = (icons, callback) => {\n\tconst cleanedIcons = listToIcons(icons, true, allowSimpleNames());\n\tconst sortedIcons = sortIcons(cleanedIcons);\n\tif (!sortedIcons.pending.length) {\n\t\tlet callCallback = true;\n\t\tif (callback) setTimeout(() => {\n\t\t\tif (callCallback) callback(sortedIcons.loaded, sortedIcons.missing, sortedIcons.pending, emptyCallback);\n\t\t});\n\t\treturn () => {\n\t\t\tcallCallback = false;\n\t\t};\n\t}\n\tconst newIcons = Object.create(null);\n\tconst sources = [];\n\tlet lastProvider, lastPrefix;\n\tsortedIcons.pending.forEach((icon) => {\n\t\tconst { provider, prefix } = icon;\n\t\tif (prefix === lastPrefix && provider === lastProvider) return;\n\t\tlastProvider = provider;\n\t\tlastPrefix = prefix;\n\t\tsources.push(getStorage(provider, prefix));\n\t\tconst providerNewIcons = newIcons[provider] || (newIcons[provider] = Object.create(null));\n\t\tif (!providerNewIcons[prefix]) providerNewIcons[prefix] = [];\n\t});\n\tsortedIcons.pending.forEach((icon) => {\n\t\tconst { provider, prefix, name } = icon;\n\t\tconst storage = getStorage(provider, prefix);\n\t\tconst pendingQueue = storage.pendingIcons || (storage.pendingIcons = /* @__PURE__ */ new Set());\n\t\tif (!pendingQueue.has(name)) {\n\t\t\tpendingQueue.add(name);\n\t\t\tnewIcons[provider][prefix].push(name);\n\t\t}\n\t});\n\tsources.forEach((storage) => {\n\t\tconst list = newIcons[storage.provider][storage.prefix];\n\t\tif (list.length) loadNewIcons(storage, list);\n\t});\n\treturn callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;\n};\n/**\n* Load one icon using Promise\n*/\nconst loadIcon = (icon) => {\n\treturn new Promise((fulfill, reject) => {\n\t\tconst iconObj = typeof icon === \"string\" ? stringToIcon(icon, true) : icon;\n\t\tif (!iconObj) {\n\t\t\treject(icon);\n\t\t\treturn;\n\t\t}\n\t\tloadIcons([iconObj || icon], (loaded) => {\n\t\t\tif (loaded.length && iconObj) {\n\t\t\t\tconst data = getIconData(iconObj);\n\t\t\t\tif (data) {\n\t\t\t\t\tfulfill({\n\t\t\t\t\t\t...defaultIconProps,\n\t\t\t\t\t\t...data\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\treject(icon);\n\t\t});\n\t});\n};\n\n/**\n* Set custom loader for multiple icons\n*/\nfunction setCustomIconsLoader(loader, prefix, provider) {\n\tgetStorage(provider || \"\", prefix).loadIcons = loader;\n}\n/**\n* Set custom loader for one icon\n*/\nfunction setCustomIconLoader(loader, prefix, provider) {\n\tgetStorage(provider || \"\", prefix).loadIcon = loader;\n}\n\n/**\n* Convert IconifyIconCustomisations to FullIconCustomisations, checking value types\n*/\nfunction mergeCustomisations(defaults, item) {\n\tconst result = { ...defaults };\n\tfor (const key in item) {\n\t\tconst value = item[key];\n\t\tconst valueType = typeof value;\n\t\tif (key in defaultIconSizeCustomisations) {\n\t\t\tif (value === null || value && (valueType === \"string\" || valueType === \"number\")) result[key] = value;\n\t\t} else if (valueType === typeof result[key]) result[key] = key === \"rotate\" ? value % 4 : value;\n\t}\n\treturn result;\n}\n\nconst separator = /[\\s,]+/;\n/**\n* Apply \"flip\" string to icon customisations\n*/\nfunction flipFromString(custom, flip) {\n\tflip.split(separator).forEach((str) => {\n\t\tconst value = str.trim();\n\t\tswitch (value) {\n\t\t\tcase \"horizontal\":\n\t\t\t\tcustom.hFlip = true;\n\t\t\t\tbreak;\n\t\t\tcase \"vertical\":\n\t\t\t\tcustom.vFlip = true;\n\t\t\t\tbreak;\n\t\t}\n\t});\n}\n\n/**\n* Get rotation value\n*/\nfunction rotateFromString(value, defaultValue = 0) {\n\tconst units = value.replace(/^-?[0-9.]*/, \"\");\n\tfunction cleanup(value$1) {\n\t\twhile (value$1 < 0) value$1 += 4;\n\t\treturn value$1 % 4;\n\t}\n\tif (units === \"\") {\n\t\tconst num = parseInt(value);\n\t\treturn isNaN(num) ? 0 : cleanup(num);\n\t} else if (units !== value) {\n\t\tlet split = 0;\n\t\tswitch (units) {\n\t\t\tcase \"%\":\n\t\t\t\tsplit = 25;\n\t\t\t\tbreak;\n\t\t\tcase \"deg\": split = 90;\n\t\t}\n\t\tif (split) {\n\t\t\tlet num = parseFloat(value.slice(0, value.length - units.length));\n\t\t\tif (isNaN(num)) return 0;\n\t\t\tnum = num / split;\n\t\t\treturn num % 1 === 0 ? cleanup(num) : 0;\n\t\t}\n\t}\n\treturn defaultValue;\n}\n\n/**\n* Generate <svg>\n*/\nfunction iconToHTML(body, attributes) {\n\tlet renderAttribsHTML = body.indexOf(\"xlink:\") === -1 ? \"\" : \" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\"\";\n\tfor (const attr in attributes) renderAttribsHTML += \" \" + attr + \"=\\\"\" + attributes[attr] + \"\\\"\";\n\treturn \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\"\" + renderAttribsHTML + \">\" + body + \"</svg>\";\n}\n\n/**\n* Encode SVG for use in url()\n*\n* Short alternative to encodeURIComponent() that encodes only stuff used in SVG, generating\n* smaller code.\n*/\nfunction encodeSVGforURL(svg) {\n\treturn svg.replace(/\"/g, \"'\").replace(/%/g, \"%25\").replace(/#/g, \"%23\").replace(/</g, \"%3C\").replace(/>/g, \"%3E\").replace(/\\s+/g, \" \");\n}\n/**\n* Generate data: URL from SVG\n*/\nfunction svgToData(svg) {\n\treturn \"data:image/svg+xml,\" + encodeSVGforURL(svg);\n}\n/**\n* Generate url() from SVG\n*/\nfunction svgToURL(svg) {\n\treturn \"url(\\\"\" + svgToData(svg) + \"\\\")\";\n}\n\nlet policy;\n/**\n* Attempt to create policy\n*/\nfunction createPolicy() {\n\ttry {\n\t\tpolicy = window.trustedTypes.createPolicy(\"iconify\", { createHTML: (s) => s });\n\t} catch (err) {\n\t\tpolicy = null;\n\t}\n}\n/**\n* Clean up value for innerHTML assignment\n*\n* This code doesn't actually clean up anything.\n* It is intended be used with Iconify icon data, which has already been validated\n*/\nfunction cleanUpInnerHTML(html) {\n\tif (policy === void 0) createPolicy();\n\treturn policy ? policy.createHTML(html) : html;\n}\n\nconst defaultExtendedIconCustomisations = {\n ...defaultIconCustomisations,\n inline: false,\n};\n\n/**\n * Default SVG attributes\n */\nconst svgDefaults = {\n 'xmlns': 'http://www.w3.org/2000/svg',\n 'xmlnsXlink': 'http://www.w3.org/1999/xlink',\n 'aria-hidden': true,\n 'role': 'img',\n};\n/**\n * Style modes\n */\nconst commonProps = {\n display: 'inline-block',\n};\nconst monotoneProps = {\n backgroundColor: 'currentColor',\n};\nconst coloredProps = {\n backgroundColor: 'transparent',\n};\n// Dynamically add common props to variables above\nconst propsToAdd = {\n Image: 'var(--svg)',\n Repeat: 'no-repeat',\n Size: '100% 100%',\n};\nconst propsToAddTo = {\n WebkitMask: monotoneProps,\n mask: monotoneProps,\n background: coloredProps,\n};\nfor (const prefix in propsToAddTo) {\n const list = propsToAddTo[prefix];\n for (const prop in propsToAdd) {\n list[prefix + prop] = propsToAdd[prop];\n }\n}\n/**\n * Default values for customisations for inline icon\n */\nconst inlineDefaults = {\n ...defaultExtendedIconCustomisations,\n inline: true,\n};\n/**\n * Fix size: add 'px' to numbers\n */\nfunction fixSize(value) {\n return value + (value.match(/^[-0-9.]+$/) ? 'px' : '');\n}\n/**\n * Render icon\n */\nconst render = (\n// Icon must be validated before calling this function\nicon, \n// Partial properties\nprops, \n// Icon name\nname) => {\n // Get default properties\n const defaultProps = props.inline\n ? inlineDefaults\n : defaultExtendedIconCustomisations;\n // Get all customisations\n const customisations = mergeCustomisations(defaultProps, props);\n // Check mode\n const mode = props.mode || 'svg';\n // Create style\n const style = {};\n const customStyle = props.style || {};\n // Create SVG component properties\n const componentProps = {\n ...(mode === 'svg' ? svgDefaults : {}),\n };\n if (name) {\n const iconName = stringToIcon(name, false, true);\n if (iconName) {\n const classNames = ['iconify'];\n const props = [\n 'provider',\n 'prefix',\n ];\n for (const prop of props) {\n if (iconName[prop]) {\n classNames.push('iconify--' + iconName[prop]);\n }\n }\n componentProps.className = classNames.join(' ');\n }\n }\n // Get element properties\n for (let key in props) {\n const value = props[key];\n if (value === void 0) {\n continue;\n }\n switch (key) {\n // Properties to ignore\n case 'icon':\n case 'style':\n case 'children':\n case 'onLoad':\n case 'mode':\n case 'ssr':\n case 'fallback':\n break;\n // Forward ref\n case '_ref':\n componentProps.ref = value;\n break;\n // Merge class names\n case 'className':\n componentProps[key] =\n (componentProps[key] ? componentProps[key] + ' ' : '') +\n value;\n break;\n // Boolean attributes\n case 'inline':\n case 'hFlip':\n case 'vFlip':\n customisations[key] =\n value === true || value === 'true' || value === 1;\n break;\n // Flip as string: 'horizontal,vertical'\n case 'flip':\n if (typeof value === 'string') {\n flipFromString(customisations, value);\n }\n break;\n // Color: copy to style\n case 'color':\n style.color = value;\n break;\n // Rotation as string\n case 'rotate':\n if (typeof value === 'string') {\n customisations[key] = rotateFromString(value);\n }\n else if (typeof value === 'number') {\n customisations[key] = value;\n }\n break;\n // Remove aria-hidden\n case 'ariaHidden':\n case 'aria-hidden':\n if (value !== true && value !== 'true') {\n delete componentProps['aria-hidden'];\n }\n break;\n // Copy missing property if it does not exist in customisations\n default:\n if (defaultProps[key] === void 0) {\n componentProps[key] = value;\n }\n }\n }\n // Generate icon\n const item = iconToSVG(icon, customisations);\n const renderAttribs = item.attributes;\n // Inline display\n if (customisations.inline) {\n style.verticalAlign = '-0.125em';\n }\n if (mode === 'svg') {\n // Add style\n componentProps.style = {\n ...style,\n ...customStyle,\n };\n // Add icon stuff\n Object.assign(componentProps, renderAttribs);\n // Counter for ids based on \"id\" property to render icons consistently on server and client\n let localCounter = 0;\n let id = props.id;\n if (typeof id === 'string') {\n // Convert '-' to '_' to avoid errors in animations\n id = id.replace(/-/g, '_');\n }\n // Add icon stuff\n componentProps.dangerouslySetInnerHTML = {\n __html: cleanUpInnerHTML(replaceIDs(item.body, id ? () => id + 'ID' + localCounter++ : 'iconifyReact')),\n };\n return createElement('svg', componentProps);\n }\n // Render <span> with style\n const { body, width, height } = icon;\n const useMask = mode === 'mask' ||\n (mode === 'bg' ? false : body.indexOf('currentColor') !== -1);\n // Generate SVG\n const html = iconToHTML(body, {\n ...renderAttribs,\n width: width + '',\n height: height + '',\n });\n // Generate style\n componentProps.style = {\n ...style,\n '--svg': svgToURL(html),\n 'width': fixSize(renderAttribs.width),\n 'height': fixSize(renderAttribs.height),\n ...commonProps,\n ...(useMask ? monotoneProps : coloredProps),\n ...customStyle,\n };\n return createElement('span', componentProps);\n};\n\n/**\n * Initialise stuff\n */\n// Enable short names\nallowSimpleNames(true);\n// Set API module\nsetAPIModule('', fetchAPIModule);\n/**\n * Browser stuff\n */\nif (typeof document !== 'undefined' && typeof window !== 'undefined') {\n const _window = window;\n // Load icons from global \"IconifyPreload\"\n if (_window.IconifyPreload !== void 0) {\n const preload = _window.IconifyPreload;\n const err = 'Invalid IconifyPreload syntax.';\n if (typeof preload === 'object' && preload !== null) {\n (preload instanceof Array ? preload : [preload]).forEach((item) => {\n try {\n if (\n // Check if item is an object and not null/array\n typeof item !== 'object' ||\n item === null ||\n item instanceof Array ||\n // Check for 'icons' and 'prefix'\n typeof item.icons !== 'object' ||\n typeof item.prefix !== 'string' ||\n // Add icon set\n !addCollection(item)) {\n console.error(err);\n }\n }\n catch (e) {\n console.error(err);\n }\n });\n }\n }\n // Set API from global \"IconifyProviders\"\n if (_window.IconifyProviders !== void 0) {\n const providers = _window.IconifyProviders;\n if (typeof providers === 'object' && providers !== null) {\n for (let key in providers) {\n const err = 'IconifyProviders[' + key + '] is invalid.';\n try {\n const value = providers[key];\n if (typeof value !== 'object' ||\n !value ||\n value.resources === void 0) {\n continue;\n }\n if (!addAPIProvider(key, value)) {\n console.error(err);\n }\n }\n catch (e) {\n console.error(err);\n }\n }\n }\n }\n}\nfunction IconComponent(props) {\n const [mounted, setMounted] = useState(!!props.ssr);\n const [abort, setAbort] = useState({});\n // Get initial state\n function getInitialState(mounted) {\n if (mounted) {\n const name = props.icon;\n if (typeof name === 'object') {\n // Icon as object\n return {\n name: '',\n data: name,\n };\n }\n const data = getIconData(name);\n if (data) {\n return {\n name,\n data,\n };\n }\n }\n return {\n name: '',\n };\n }\n const [state, setState] = useState(getInitialState(!!props.ssr));\n // Cancel loading\n function cleanup() {\n const callback = abort.callback;\n if (callback) {\n callback();\n setAbort({});\n }\n }\n // Change state if it is different\n function changeState(newState) {\n if (JSON.stringify(state) !== JSON.stringify(newState)) {\n cleanup();\n setState(newState);\n return true;\n }\n }\n // Update state\n function updateState() {\n var _a;\n const name = props.icon;\n if (typeof name === 'object') {\n // Icon as object\n changeState({\n name: '',\n data: name,\n });\n return;\n }\n // New icon or got icon data\n const data = getIconData(name);\n if (changeState({\n name,\n data,\n })) {\n if (data === undefined) {\n // Load icon, update state when done\n const callback = loadIcons([name], updateState);\n setAbort({\n callback,\n });\n }\n else if (data) {\n // Icon data is available: trigger onLoad callback if present\n (_a = props.onLoad) === null || _a === void 0 ? void 0 : _a.call(props, name);\n }\n }\n }\n // Mounted state, cleanup for loader\n useEffect(() => {\n setMounted(true);\n return cleanup;\n }, []);\n // Icon changed or component mounted\n useEffect(() => {\n if (mounted) {\n updateState();\n }\n }, [props.icon, mounted]);\n // Render icon\n const { name, data } = state;\n if (!data) {\n return props.children\n ? props.children\n : props.fallback\n ? props.fallback\n : createElement('span', {});\n }\n return render({\n ...defaultIconProps,\n ...data,\n }, props, name);\n}\n/**\n * Block icon\n *\n * @param props - Component properties\n */\nconst Icon = forwardRef((props, ref) => IconComponent({\n ...props,\n _ref: ref,\n}));\n/**\n * Inline icon (has negative verticalAlign that makes it behave like icon font)\n *\n * @param props - Component properties\n */\nconst InlineIcon = forwardRef((props, ref) => IconComponent({\n inline: true,\n ...props,\n _ref: ref,\n}));\n/**\n * Internal API\n */\nconst _api = {\n getAPIConfig,\n setAPIModule,\n sendAPIQuery,\n setFetch,\n getFetch,\n listAPIProviders,\n};\n\nexport { Icon, InlineIcon, _api, addAPIProvider, addCollection, addIcon, iconToSVG as buildIcon, calculateSize, getIcon, iconLoaded, listIcons, loadIcon, loadIcons, replaceIDs, setCustomIconLoader, setCustomIconsLoader };\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"m4.5 19.5l15-15m-15 0l15 15\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M12 4v16m8-8H4\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 1 1 3.536 3.536L6.5 21.036H3v-3.572z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m19 7l-.867 12.142A2 2 0 0 1 16.138 21H7.862a2 2 0 0 1-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v3M4 7h16\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M4.5 12c0-1.232.046-2.453.138-3.662a4.006 4.006 0 0 1 3.7-3.7a48.678 48.678 0 0 1 7.324 0a4.006 4.006 0 0 1 3.7 3.7c.017.22.032.441.046.662M4.5 12l-3-3m3 3l3-3m12 3c0 1.232-.046 2.453-.138 3.662a4.006 4.006 0 0 1-3.7 3.7a48.657 48.657 0 0 1-7.324 0a4.006 4.006 0 0 1-3.7-3.7c-.017-.22-.032-.441-.046-.662M19.5 12l-3 3m3-3l3 3\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192c.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M8 7v8a2 2 0 0 0 2 2h6M8 7V5a2 2 0 0 1 2-2h4.586a1 1 0 0 1 .707.293l4.414 4.414a1 1 0 0 1 .293.707V15a2 2 0 0 1-2 2h-2M8 7H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-2\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c.996.608 2.296.07 2.572-1.065\\\"/><path d=\\\"M15 12a3 3 0 1 1-6 0a3 3 0 0 1 6 0\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M12 3c2.755 0 5.455.232 8.083.678c.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M8.684 13.342C8.886 12.938 9 12.482 9 12s-.114-.938-.316-1.342m0 2.684a3 3 0 1 1 0-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 1 0 5.367-2.684a3 3 0 0 0-5.367 2.684m0 9.316a3 3 0 1 0 5.368 2.684a3 3 0 0 0-5.368-2.684\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m5 15l7-7l7 7\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m19 9l-7 7l-7-7\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m15 19l-7-7l7-7\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m9 5l7 7l-7 7\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"m21 21l-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m9 12l2 2l4-4m6 2a9 9 0 1 1-18 0a9 9 0 0 1 18 0\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M12 10.5v3.75m-9.303 3.376C1.83 19.126 2.914 21 4.645 21h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 4.88c-.866-1.501-3.032-1.501-3.898 0L2.697 17.626ZM12 17.25h.007v.008H12v-.008Z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M12 8v4m0 4h.01M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M15 12a3 3 0 1 1-6 0a3 3 0 0 1 6 0\\\"/><path d=\\\"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7s-8.268-2.943-9.542-7\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M3.98 8.223A10.477 10.477 0 0 0 1.934 12c1.292 4.338 5.31 7.5 10.066 7.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 0 1-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M13.828 10.172a4 4 0 0 0-5.656 0l-4 4a4 4 0 1 0 5.656 5.656l1.102-1.101m-.758-4.899a4 4 0 0 0 5.656 0l4-4a4 4 0 0 0-5.656-5.656l-1.1 1.1\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m14 5l7 7m0 0l-7 7m7-7H3\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 1 1-8 0a4 4 0 0 1 8 0\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M20.354 15.354A9 9 0 0 1 8.646 3.646A9.003 9.003 0 0 0 12 21a9 9 0 0 0 8.354-5.646\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M6.75 12a.75.75 0 1 1-1.5 0a.75.75 0 0 1 1.5 0Zm6 0a.75.75 0 1 1-1.5 0a.75.75 0 0 1 1.5 0Zm6 0a.75.75 0 1 1-1.5 0a.75.75 0 0 1 1.5 0Z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M9 12h6m-6 4h6m2 5H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5.586a1 1 0 0 1 .707.293l5.414 5.414a1 1 0 0 1 .293.707V19a2 2 0 0 1-2 2\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18s-3.332.477-4.5 1.253\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M4.098 19.902a3.75 3.75 0 0 0 5.304 0l6.401-6.402M6.75 21A3.75 3.75 0 0 1 3 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 0 0 3.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88a1.124 1.124 0 0 1 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008Z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M3 9a2 2 0 0 1 2-2h.93a2 2 0 0 0 1.664-.89l.812-1.22A2 2 0 0 1 10.07 4h3.86a2 2 0 0 1 1.664.89l.812 1.22A2 2 0 0 0 18.07 7H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\\\"/><path d=\\\"M15 13a3 3 0 1 1-6 0a3 3 0 0 1 6 0\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"1.5\\\" d=\\\"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"currentColor\\\" d=\\\"M1 8.25a1.25 1.25 0 1 1 2.5 0v7.5a1.25 1.25 0 1 1-2.5 0v-7.5ZM11 3V1.7c0-.268.14-.526.395-.607A2 2 0 0 1 14 3c0 .995-.182 1.948-.514 2.826c-.204.54.166 1.174.744 1.174h2.52c1.243 0 2.261 1.01 2.146 2.247a23.864 23.864 0 0 1-1.341 5.974C17.153 16.323 16.072 17 14.9 17h-3.192a3 3 0 0 1-1.341-.317l-2.734-1.366A3 3 0 0 0 6.292 15H5V8h.963c.685 0 1.258-.483 1.612-1.068a4.011 4.011 0 0 1 2.166-1.73c.432-.143.853-.386 1.011-.814c.16-.432.248-.9.248-1.388Z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"currentColor\\\" d=\\\"M18.905 12.75a1.25 1.25 0 0 1-2.5 0v-7.5a1.25 1.25 0 1 1 2.5 0v7.5Zm-10 4.25v1.3c0 .268-.14.526-.395.607A2 2 0 0 1 5.905 17c0-.995.182-1.948.514-2.826c.204-.54-.166-1.174-.744-1.174h-2.52c-1.242 0-2.26-1.01-2.146-2.247c.193-2.08.652-4.082 1.341-5.974C2.752 3.678 3.833 3 5.005 3h3.192a3 3 0 0 1 1.342.317l2.733 1.366A3 3 0 0 0 13.613 5h1.292v7h-.963c-.684 0-1.258.482-1.612 1.068a4.012 4.012 0 0 1-2.165 1.73c-.433.143-.854.386-1.012.814c-.16.432-.248.9-.248 1.388Z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"body\": \"<path fill=\\\"currentColor\\\" d=\\\"M2 11a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1zm6-4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1zm6-3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M17.707 9.293a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-7-7A1 1 0 0 1 2 10V5a3 3 0 0 1 3-3h5c.256 0 .512.098.707.293zM5 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M6 2a1 1 0 0 0-1 1v1H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-1V3a1 1 0 1 0-2 0v1H7V3a1 1 0 0 0-1-1m0 5a1 1 0 0 0 0 2h8a1 1 0 1 0 0-2z\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M2.5 3A1.5 1.5 0 0 0 1 4.5v4A1.5 1.5 0 0 0 2.5 10h6A1.5 1.5 0 0 0 10 8.5v-4A1.5 1.5 0 0 0 8.5 3h-6Zm11 2A1.5 1.5 0 0 0 12 6.5v7a1.5 1.5 0 0 0 1.5 1.5h4a1.5 1.5 0 0 0 1.5-1.5v-7A1.5 1.5 0 0 0 17.5 5h-4Zm-10 7A1.5 1.5 0 0 0 2 13.5v2A1.5 1.5 0 0 0 3.5 17h6a1.5 1.5 0 0 0 1.5-1.5v-2A1.5 1.5 0 0 0 9.5 12h-6Z\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M10 18a8 8 0 1 0 0-16a8 8 0 0 0 0 16M9.555 7.168A1 1 0 0 0 8 8v4a1 1 0 0 0 1.555.832l3-2a1 1 0 0 0 0-1.664z\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M16.707 5.293a1 1 0 0 1 0 1.414l-8 8a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 1.414-1.414L8 12.586l7.293-7.293a1 1 0 0 1 1.414 0\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M10 2a1 1 0 0 1 1 1v1.323l3.954 1.582l1.599-.8a1 1 0 0 1 .894 1.79l-1.233.616l1.738 5.42a1 1 0 0 1-.285 1.05A4 4 0 0 1 15 15a4 4 0 0 1-2.667-1.019a1 1 0 0 1-.285-1.05l1.715-5.349L11 6.477V16h2a1 1 0 1 1 0 2H7a1 1 0 1 1 0-2h2V6.477L6.237 7.582l1.715 5.349a1 1 0 0 1-.285 1.05A4 4 0 0 1 5 15a4 4 0 0 1-2.667-1.019a1 1 0 0 1-.285-1.05l1.738-5.42l-1.233-.617a1 1 0 0 1 .894-1.788l1.599.799L9 4.323V3a1 1 0 0 1 1-1m-5 8.275l-.818 2.55a2 2 0 0 0 1.636 0zm10 0l-.818 2.55a2 2 0 0 0 1.636 0z\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M10 18a8 8 0 1 0 0-16a8 8 0 0 0 0 16Zm.75-11.25a.75.75 0 0 0-1.5 0v4.59L7.3 9.24a.75.75 0 0 0-1.1 1.02l3.25 3.5a.75.75 0 0 0 1.1 0l3.25-3.5a.75.75 0 1 0-1.1-1.02l-1.95 2.1V6.75Z\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M10 18a8 8 0 1 0 0-16a8 8 0 0 0 0 16Zm-.75-4.75a.75.75 0 0 0 1.5 0V8.66l1.95 2.1a.75.75 0 1 0 1.1-1.02l-3.25-3.5a.75.75 0 0 0-1.1 0L6.2 9.74a.75.75 0 1 0 1.1 1.02l1.95-2.1v4.59Z\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M12.577 4.878a.75.75 0 0 1 .919-.53l4.78 1.281a.75.75 0 0 1 .531.919l-1.281 4.78a.75.75 0 0 1-1.449-.387l.81-3.022a19.407 19.407 0 0 0-5.594 5.203a.75.75 0 0 1-1.139.093L7 10.06l-4.72 4.72a.75.75 0 0 1-1.06-1.061l5.25-5.25a.75.75 0 0 1 1.06 0l3.074 3.073a20.923 20.923 0 0 1 5.545-4.931l-3.042-.815a.75.75 0 0 1-.53-.919Z\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M7 2a1 1 0 0 0-.707 1.707L7 4.414v3.758a1 1 0 0 1-.293.707l-4 4C.817 14.769 2.156 18 4.828 18h10.343c2.673 0 4.012-3.231 2.122-5.121l-4-4A1 1 0 0 1 13 8.172V4.414l.707-.707A1 1 0 0 0 13 2zm2 6.172V4h2v4.172a3 3 0 0 0 .879 2.12l1.027 1.028a4 4 0 0 0-2.171.102l-.47.156a4 4 0 0 1-2.53 0l-.563-.187l-.114-.035l1.063-1.063A3 3 0 0 0 9 8.172\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M2 4.75A.75.75 0 0 1 2.75 4h14.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 4.75Zm0 10.5a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5a.75.75 0 0 1-.75-.75ZM2 10a.75.75 0 0 1 .75-.75h14.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 10Z\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"body\": \"<g fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\"><path d=\\\"M6.625 2.655A9 9 0 0 1 19 11a1 1 0 1 1-2 0a7 7 0 0 0-9.625-6.492a1 1 0 1 1-.75-1.853M4.662 4.959A1 1 0 0 1 4.75 6.37A6.97 6.97 0 0 0 3 11a1 1 0 1 1-2 0a8.97 8.97 0 0 1 2.25-5.953a1 1 0 0 1 1.412-.088\\\"/><path d=\\\"M5 11a5 5 0 1 1 10 0a1 1 0 1 1-2 0a3 3 0 1 0-6 0c0 1.677-.345 3.276-.968 4.729a1 1 0 1 1-1.838-.789A10 10 0 0 0 5 11m8.921 2.012a1 1 0 0 1 .831 1.145a20 20 0 0 1-.545 2.436a1 1 0 1 1-1.92-.558q.311-1.07.49-2.192a1 1 0 0 1 1.144-.83\\\"/><path d=\\\"M10 10a1 1 0 0 1 1 1c0 2.236-.46 4.368-1.29 6.304a1 1 0 0 1-1.838-.789A13.95 13.95 0 0 0 9 11a1 1 0 0 1 1-1\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"hidden\": true,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M4.25 2A2.25 2.25 0 0 0 2 4.25v11.5A2.25 2.25 0 0 0 4.25 18h11.5A2.25 2.25 0 0 0 18 15.75V4.25A2.25 2.25 0 0 0 15.75 2H4.25ZM15 5.75a.75.75 0 0 0-1.5 0v8.5a.75.75 0 0 0 1.5 0v-8.5Zm-8.5 6a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0v-2.5ZM8.584 9a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5a.75.75 0 0 1 .75-.75Zm3.58-1.25a.75.75 0 0 0-1.5 0v6.5a.75.75 0 0 0 1.5 0v-6.5Z\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M10 18a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-11a1 1 0 1 0-2 0v2H7a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2h-2z\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 20,\n\t\"height\": 20,\n\t\"body\": \"<path fill=\\\"currentColor\\\" fill-rule=\\\"evenodd\\\" d=\\\"M9.243 3.03a1 1 0 0 1 .727 1.213L9.53 6h2.94l.56-2.243a1 1 0 1 1 1.94.486L14.53 6H17a1 1 0 1 1 0 2h-2.97l-1 4H15a1 1 0 1 1 0 2h-2.47l-.56 2.242a1 1 0 1 1-1.94-.485L10.47 14H7.53l-.56 2.242a1 1 0 1 1-1.94-.485L5.47 14H3a1 1 0 1 1 0-2h2.97l1-4H5a1 1 0 1 1 0-2h2.47l.56-2.243a1 1 0 0 1 1.213-.727M9.03 8l-1 4h2.938l1-4z\\\" clip-rule=\\\"evenodd\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M3 13a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zm12-4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zM9 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zM4 20h14\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M4 19h16M4 15l4-6l4 2l4-5l4 4\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m4 19l4-6l4 2l4-5l4 4v5zm0-7l3-4l4 2l5-6l4 4\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M10 3.2A9 9 0 1 0 20.8 14a1 1 0 0 0-1-1H13a2 2 0 0 1-2-2V4a.9.9 0 0 0-1-.8\\\"/><path d=\\\"M15 3.5A9 9 0 0 1 20.5 9H16a1 1 0 0 1-1-1z\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M3 3v18h18\\\"/><path d=\\\"M7 15a2 2 0 1 0 4 0a2 2 0 1 0-4 0m4-10a2 2 0 1 0 4 0a2 2 0 1 0-4 0m5 7a2 2 0 1 0 4 0a2 2 0 1 0-4 0m5-9l-6 1.5m-.887 2.15l2.771 3.695M16 12.5l-5 2\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M3 7a2 2 0 1 0 4 0a2 2 0 1 0-4 0m11 8a2 2 0 1 0 4 0a2 2 0 1 0-4 0m1-9a3 3 0 1 0 6 0a3 3 0 1 0-6 0M3 18a3 3 0 1 0 6 0a3 3 0 1 0-6 0m6-1l5-1.5m-7.5-7l7.81 5.37M7 7l8-1\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M3 16a3 3 0 1 0 6 0a3 3 0 1 0-6 0m11 3a2 2 0 1 0 4 0a2 2 0 1 0-4 0M10 7.5a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0-9 0\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"m12 3l9.5 7L18 21H6L2.5 10z\\\"/><path d=\\\"m12 7.5l5.5 4L15 17H8.5l-2-5.5z\\\"/><path d=\\\"m2.5 10l9.5 3l9.5-3\\\"/><path d=\\\"M12 3v10l6 8M6 21l6-8\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M11 12a1 1 0 1 0 2 0a1 1 0 1 0-2 0\\\"/><path d=\\\"M15.51 15.56A5 5 0 1 0 12 17\\\"/><path d=\\\"M18.832 17.86A9 9 0 1 0 12 21m0-9v9\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm8-2v16m-8-5h8m0-3h8m-4 0v8m0-4h4\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M13 5h8m-8 4h5m-5 6h8m-8 4h5M3 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M4 4h16M4 20h16M6 11a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2z\\\"/>\"\n};\nexport default data;\n","/**\n * Custom SVG icons for drizzle-cube\n * These are hand-crafted icons when existing icon libraries don't have good options\n */\n\nimport type { IconifyIcon } from '@iconify/types'\n\n/**\n * Custom Flow/Sankey icon\n * Nodes connected by flowing S-curve paths representing user journey flows\n * Shows data flowing between stages with branching paths\n * 24x24 viewBox, stroke-width 1.5 for clean appearance\n */\nexport const flowIcon: IconifyIcon = {\n body: `<g fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"3\" y=\"4\" width=\"5\" height=\"3\" rx=\"0.75\"/>\n <rect x=\"16\" y=\"4\" width=\"5\" height=\"3\" rx=\"0.75\"/>\n <rect x=\"16\" y=\"10.5\" width=\"5\" height=\"3\" rx=\"0.75\"/>\n <rect x=\"16\" y=\"17\" width=\"5\" height=\"3\" rx=\"0.75\"/>\n <path d=\"M8 5.5 C11 5.5, 13 5.5, 16 5.5\"/>\n <path d=\"M8 5.5 C10 5.5, 11 7, 12 9 C13 11, 14 12, 16 12\"/>\n <path d=\"M8 5.5 C10 5.5, 11 10, 12 14 C13 17, 14 18.5, 16 18.5\"/>\n </g>`,\n width: 24,\n height: 24,\n}\n\n/**\n * Custom Funnel icon\n * Horizontal bars that progressively narrow, showing conversion stages\n * Connected by angled lines showing flow between stages\n * 24x24 viewBox, stroke-width 1.5 for clean appearance\n */\nexport const funnelIcon: IconifyIcon = {\n body: `<g fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"4\" rx=\"1\"/>\n <rect x=\"4\" y=\"10\" width=\"16\" height=\"4\" rx=\"1\"/>\n <rect x=\"6\" y=\"17\" width=\"12\" height=\"4\" rx=\"1\"/>\n </g>`,\n width: 24,\n height: 24,\n}\n\n/**\n * Custom Retention icon\n * Grid/heatmap pattern representing cohort retention matrix\n * Shows users tracked across time periods with varying intensity cells\n * 24x24 viewBox, stroke-width 1.5 for clean appearance\n */\nexport const retentionIcon: IconifyIcon = {\n body: `<g fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <!-- Grid cells representing retention matrix -->\n <rect x=\"3\" y=\"3\" width=\"4\" height=\"4\" rx=\"0.5\"/>\n <rect x=\"10\" y=\"3\" width=\"4\" height=\"4\" rx=\"0.5\"/>\n <rect x=\"17\" y=\"3\" width=\"4\" height=\"4\" rx=\"0.5\"/>\n <rect x=\"3\" y=\"10\" width=\"4\" height=\"4\" rx=\"0.5\"/>\n <rect x=\"10\" y=\"10\" width=\"4\" height=\"4\" rx=\"0.5\"/>\n <rect x=\"17\" y=\"10\" width=\"4\" height=\"4\" rx=\"0.5\"/>\n <rect x=\"3\" y=\"17\" width=\"4\" height=\"4\" rx=\"0.5\"/>\n <rect x=\"10\" y=\"17\" width=\"4\" height=\"4\" rx=\"0.5\"/>\n <rect x=\"17\" y=\"17\" width=\"4\" height=\"4\" rx=\"0.5\"/>\n </g>`,\n width: 24,\n height: 24,\n}\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M8.848 14.667L5.5 17.5M12 3v5m4 4h5M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m11.219 3.328L17 19.5\\\"/><path d=\\\"M8 12a4 4 0 1 0 8 0a4 4 0 1 0-8 0\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm0 5h18M10 3v18\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M11.795 21H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4m-1 3v4h4\\\"/><path d=\\\"M14 18a4 4 0 1 0 8 0a4 4 0 1 0-8 0m1-15v4M7 3v4m-4 4h16\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M4 17V7l7 10V7m4 10h5m-5-7a2.5 3 0 1 0 5 0a2.5 3 0 1 0-5 0\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"m3 17l6-6l4 4l8-8\\\"/><path d=\\\"M14 7h7v7\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M4 20h3m7 0h7M6.9 15h6.9m-3.6-8.7L16 20M5 20l6-16h2l7 16\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M14 3v4a1 1 0 0 0 1 1h4\\\"/><path d=\\\"M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2M9 9h1m-1 4h6m-6 4h6\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9-3h.01\\\"/><path d=\\\"M11 12h1v4h1\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m8 9l4-4l4 4m0 6l-4 4l-4-4\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M16 6a2 2 0 1 0 4 0a2 2 0 1 0-4 0M4 12a2 2 0 1 0 4 0a2 2 0 1 0-4 0m0 6a2 2 0 1 0 4 0a2 2 0 1 0-4 0m12 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0m-8 0h8m2 2v1m0-18v1M6 20v1m0-11V3m6 0v18m6-13v8M8 12h13m0-6h-1m-4 0H3m0 6h1m16 6h1M3 18h1m2-4v2\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm4 10v.01M8 12v.01M8 8v.01M16 16v.01M16 12v.01M16 8v.01M12 8v.01M12 16v.01\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M22 5h-5v5h-5v5H7v5H2\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M4 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm2-3v2m0 5v9m4-5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zm2-11v10m0 5v1m4-14a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zm2-2v1m0 6v9\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M18 21V7m-9 8l3-3l3 3m0-5l3-3l3 3M3 21h18m-9 0v-9M3 6l3-3l3 3M6 21V3\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0\\\"/><path d=\\\"M11 12a1 1 0 1 0 2 0a1 1 0 1 0-2 0m2.41-1.41L16 8m-9 4a5 5 0 0 1 5-5\\\"/></g>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m9 20l-5.447-2.724A1 1 0 0 1 3 16.382V5.618a1 1 0 0 1 1.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0 0 21 18.382V7.618a1 1 0 0 0-.553-.894L15 4m0 13V4m0 0L9 7\\\"/>\"\n};\nexport default data;\n","const data = {\n\t\"width\": 24,\n\t\"height\": 24,\n\t\"body\": \"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m20 7l-8-4l-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4\\\"/>\"\n};\nexport default data;\n","/**\n * Default icon definitions using Iconify icon sets\n * Uses HeroIcons (outline/solid) and Tabler icons via Iconify\n */\n\n// HeroIcons Outline\nimport xMark from '@iconify-icons/heroicons-outline/x-mark'\nimport plus from '@iconify-icons/heroicons-outline/plus'\nimport pencil from '@iconify-icons/heroicons-outline/pencil'\nimport trash from '@iconify-icons/heroicons-outline/trash'\nimport arrowPath from '@iconify-icons/heroicons-outline/arrow-path'\nimport clipboardDocument from '@iconify-icons/heroicons-outline/clipboard-document'\nimport documentDuplicate from '@iconify-icons/heroicons-outline/document-duplicate'\nimport cog from '@iconify-icons/heroicons-outline/cog'\nimport funnel from '@iconify-icons/heroicons-outline/funnel'\nimport share from '@iconify-icons/heroicons-outline/share'\nimport chevronUp from '@iconify-icons/heroicons-outline/chevron-up'\nimport chevronDown from '@iconify-icons/heroicons-outline/chevron-down'\nimport chevronLeft from '@iconify-icons/heroicons-outline/chevron-left'\nimport chevronRight from '@iconify-icons/heroicons-outline/chevron-right'\nimport magnifyingGlass from '@iconify-icons/heroicons-outline/magnifying-glass'\nimport bars3 from '@iconify-icons/heroicons-outline/bars-3'\nimport checkCircle from '@iconify-icons/heroicons-outline/check-circle'\nimport exclamationTriangle from '@iconify-icons/heroicons-outline/exclaimation-triangle'\nimport exclamationCircle from '@iconify-icons/heroicons-outline/exclamation-circle'\nimport sparkles from '@iconify-icons/heroicons-outline/sparkles'\nimport eye from '@iconify-icons/heroicons-outline/eye'\nimport eyeSlash from '@iconify-icons/heroicons-outline/eye-slash'\nimport adjustmentsHorizontal from '@iconify-icons/heroicons-outline/adjustments-horizontal'\nimport computerDesktop from '@iconify-icons/heroicons-outline/computer-desktop'\nimport tableCells from '@iconify-icons/heroicons-outline/table-cells'\nimport link from '@iconify-icons/heroicons-outline/link'\nimport arrowRight from '@iconify-icons/heroicons-outline/arrow-right'\nimport sun from '@iconify-icons/heroicons-outline/sun'\nimport moon from '@iconify-icons/heroicons-outline/moon'\nimport ellipsisHorizontal from '@iconify-icons/heroicons-outline/ellipsis-horizontal'\nimport documentText from '@iconify-icons/heroicons-outline/document-text'\nimport bookOpen from '@iconify-icons/heroicons-outline/book-open'\nimport codeBracket from '@iconify-icons/heroicons-outline/code-bracket'\nimport swatch from '@iconify-icons/heroicons-outline/swatch'\nimport camera from '@iconify-icons/heroicons-outline/camera'\nimport arrowDownTray from '@iconify-icons/heroicons-outline/arrow-down-tray'\nimport arrowUpTray from '@iconify-icons/heroicons-outline/arrow-up-tray'\nimport handThumbUp from '@iconify-icons/heroicons-solid/hand-thumb-up'\nimport handThumbDown from '@iconify-icons/heroicons-solid/hand-thumb-down'\n\n// HeroIcons Solid (for field type indicators and measures)\nimport chartBarSolid from '@iconify-icons/heroicons-solid/chart-bar'\nimport tagSolid from '@iconify-icons/heroicons-solid/tag'\nimport calendarSolid from '@iconify-icons/heroicons-solid/calendar'\nimport rectangleGroupSolid from '@iconify-icons/heroicons-solid/rectangle-group'\nimport playSolid from '@iconify-icons/heroicons-solid/play'\nimport checkSolid from '@iconify-icons/heroicons-solid/check'\nimport scaleSolid from '@iconify-icons/heroicons-solid/scale'\nimport arrowDownCircleSolid from '@iconify-icons/heroicons-solid/arrow-down-circle'\nimport arrowUpCircleSolid from '@iconify-icons/heroicons-solid/arrow-up-circle'\nimport arrowTrendingUpSolid from '@iconify-icons/heroicons-solid/arrow-trending-up'\nimport beakerSolid from '@iconify-icons/heroicons-solid/beaker'\nimport bars3BottomLeftSolid from '@iconify-icons/heroicons-solid/bars-3-bottom-left'\nimport fingerPrintSolid from '@iconify-icons/heroicons-solid/finger-print'\nimport chartBarSquareSolid from '@iconify-icons/heroicons-solid/chart-bar-square'\nimport plusCircleSolid from '@iconify-icons/heroicons-solid/plus-circle'\nimport hashtagSolid from '@iconify-icons/heroicons-solid/hashtag'\n\n// Tabler icons for chart types (already using these)\nimport chartBarTabler from '@iconify-icons/tabler/chart-bar'\nimport chartLine from '@iconify-icons/tabler/chart-line'\nimport chartAreaLine from '@iconify-icons/tabler/chart-area-line'\nimport chartPie from '@iconify-icons/tabler/chart-pie'\nimport chartDots2 from '@iconify-icons/tabler/chart-dots-2'\nimport chartDots3 from '@iconify-icons/tabler/chart-dots-3'\nimport chartBubble from '@iconify-icons/tabler/chart-bubble'\nimport chartRadar from '@iconify-icons/tabler/chart-radar'\nimport radar2 from '@iconify-icons/tabler/radar-2'\nimport chartTreemap from '@iconify-icons/tabler/chart-treemap'\nimport listDetails from '@iconify-icons/tabler/list-details'\nimport layoutDistributeHorizontal from '@iconify-icons/tabler/layout-distribute-horizontal'\n// Custom icons - better represents flow/funnel/retention visualizations\nimport { flowIcon, funnelIcon, retentionIcon } from './customIcons.js'\nimport chartDonut4 from '@iconify-icons/tabler/chart-donut-4'\nimport table from '@iconify-icons/tabler/table'\nimport calendarStats from '@iconify-icons/tabler/calendar-stats'\nimport number from '@iconify-icons/tabler/number'\nimport trendingUp from '@iconify-icons/tabler/trending-up'\nimport typography from '@iconify-icons/tabler/typography'\nimport fileText from '@iconify-icons/tabler/file-text'\nimport infoCircle from '@iconify-icons/tabler/info-circle'\nimport selector from '@iconify-icons/tabler/selector'\nimport chartGridDots from '@iconify-icons/tabler/chart-grid-dots'\nimport boxPadding from '@iconify-icons/tabler/box-padding'\nimport stairs from '@iconify-icons/tabler/stairs'\nimport chartCandle from '@iconify-icons/tabler/chart-candle'\nimport chartArrowsVertical from '@iconify-icons/tabler/chart-arrows-vertical'\nimport gauge from '@iconify-icons/tabler/gauge'\nimport map from '@iconify-icons/heroicons-outline/map'\nimport cubeOutline from '@iconify-icons/heroicons-outline/cube'\n\nimport type { IconRegistry } from './types.js'\n\n/**\n * Default icon registry with all icons used in drizzle-cube\n */\nexport const DEFAULT_ICONS: IconRegistry = {\n // Action icons\n close: { icon: xMark, category: 'action' },\n add: { icon: plus, category: 'action' },\n edit: { icon: pencil, category: 'action' },\n delete: { icon: trash, category: 'action' },\n refresh: { icon: arrowPath, category: 'action' },\n copy: { icon: clipboardDocument, category: 'action' },\n duplicate: { icon: documentDuplicate, category: 'action' },\n settings: { icon: cog, category: 'action' },\n filter: { icon: funnel, category: 'action' },\n share: { icon: share, category: 'action' },\n expand: { icon: chevronDown, category: 'action' },\n collapse: { icon: chevronUp, category: 'action' },\n search: { icon: magnifyingGlass, category: 'action' },\n menu: { icon: bars3, category: 'action' },\n run: { icon: playSolid, category: 'action' },\n check: { icon: checkSolid, category: 'action' },\n link: { icon: link, category: 'action' },\n eye: { icon: eye, category: 'action' },\n eyeOff: { icon: eyeSlash, category: 'action' },\n adjustments: { icon: adjustmentsHorizontal, category: 'action' },\n desktop: { icon: computerDesktop, category: 'action' },\n table: { icon: tableCells, category: 'action' },\n sun: { icon: sun, category: 'action' },\n moon: { icon: moon, category: 'action' },\n ellipsisHorizontal: { icon: ellipsisHorizontal, category: 'action' },\n documentText: { icon: documentText, category: 'action' },\n bookOpen: { icon: bookOpen, category: 'action' },\n codeBracket: { icon: codeBracket, category: 'action' },\n swatch: { icon: swatch, category: 'action' },\n camera: { icon: camera, category: 'action' },\n thumbUp: { icon: handThumbUp, category: 'action' },\n thumbDown: { icon: handThumbDown, category: 'action' },\n schemaGraph: { icon: map, category: 'action' },\n cube: { icon: cubeOutline, category: 'action' },\n download: { icon: arrowDownTray, category: 'action' },\n upload: { icon: arrowUpTray, category: 'action' },\n\n // Field type icons (solid for visual distinction)\n measure: { icon: chartBarSolid, category: 'field' },\n dimension: { icon: tagSolid, category: 'field' },\n timeDimension: { icon: calendarSolid, category: 'field' },\n segment: { icon: rectangleGroupSolid, category: 'field' },\n\n // Chart type icons (Tabler - keeping existing visuals)\n chartBar: { icon: chartBarTabler, category: 'chart' },\n chartLine: { icon: chartLine, category: 'chart' },\n chartArea: { icon: chartAreaLine, category: 'chart' },\n chartPie: { icon: chartPie, category: 'chart' },\n chartScatter: { icon: chartDots2, category: 'chart' },\n chartBubble: { icon: chartBubble, category: 'chart' },\n chartRadar: { icon: chartRadar, category: 'chart' },\n chartRadialBar: { icon: radar2, category: 'chart' },\n chartTreemap: { icon: chartTreemap, category: 'chart' },\n chartTable: { icon: table, category: 'chart' },\n chartRecordsTable: { icon: listDetails, category: 'chart' },\n chartActivityGrid: { icon: calendarStats, category: 'chart' },\n chartKpiNumber: { icon: number, category: 'chart' },\n chartKpiDelta: { icon: trendingUp, category: 'chart' },\n chartKpiText: { icon: typography, category: 'chart' },\n chartMarkdown: { icon: fileText, category: 'chart' },\n chartFunnel: { icon: funnelIcon, category: 'chart' },\n chartSankey: { icon: flowIcon, category: 'chart' },\n chartSunburst: { icon: chartDonut4, category: 'chart' },\n chartHeatmap: { icon: chartGridDots, category: 'chart' },\n chartRetention: { icon: retentionIcon, category: 'chart' },\n chartBoxPlot: { icon: boxPadding, category: 'chart' },\n chartDotStrip: { icon: chartDots3, category: 'chart' },\n chartWaterfall: { icon: stairs, category: 'chart' },\n chartCandlestick: { icon: chartCandle, category: 'chart' },\n chartMeasureProfile: { icon: chartArrowsVertical, category: 'chart' },\n chartProportionBar: { icon: layoutDistributeHorizontal, category: 'chart' },\n chartGauge: { icon: gauge, category: 'chart' },\n\n // Measure type icons (solid)\n measureCount: { icon: bars3BottomLeftSolid, category: 'measure' },\n measureCountDistinct: { icon: fingerPrintSolid, category: 'measure' },\n measureCountDistinctApprox: { icon: chartBarSquareSolid, category: 'measure' },\n measureSum: { icon: plusCircleSolid, category: 'measure' },\n measureAvg: { icon: scaleSolid, category: 'measure' },\n measureMin: { icon: arrowDownCircleSolid, category: 'measure' },\n measureMax: { icon: arrowUpCircleSolid, category: 'measure' },\n measureRunningTotal: { icon: arrowTrendingUpSolid, category: 'measure' },\n measureCalculated: { icon: beakerSolid, category: 'measure' },\n measureNumber: { icon: hashtagSolid, category: 'measure' },\n\n // State icons\n success: { icon: checkCircle, category: 'state' },\n warning: { icon: exclamationTriangle, category: 'state' },\n error: { icon: exclamationCircle, category: 'state' },\n info: { icon: infoCircle, category: 'state' },\n loading: { icon: arrowPath, category: 'state' },\n sparkles: { icon: sparkles, category: 'state' },\n\n // Navigation icons\n chevronUp: { icon: chevronUp, category: 'navigation' },\n chevronDown: { icon: chevronDown, category: 'navigation' },\n chevronLeft: { icon: chevronLeft, category: 'navigation' },\n chevronRight: { icon: chevronRight, category: 'navigation' },\n chevronUpDown: { icon: selector, category: 'navigation' },\n arrowUp: { icon: arrowUpCircleSolid, category: 'navigation' },\n arrowDown: { icon: arrowDownCircleSolid, category: 'navigation' },\n arrowRight: { icon: arrowRight, category: 'navigation' },\n arrowPath: { icon: arrowPath, category: 'navigation' },\n}\n","/**\n * Icon Registry - Centralized icon management following the theme pattern\n * Allows users to override any icon with their own implementations\n */\n\nimport { Icon } from '@iconify/react'\nimport type { IconifyIcon } from '@iconify/types'\nimport type { ComponentType } from 'react'\nimport { DEFAULT_ICONS } from './defaultIcons.js'\nimport type { IconRegistry, IconName, IconDefinition, IconCategory, IconProps, PartialIconRegistry } from './types.js'\n// A chart's icon is declared on its unified registry entry (an IconName for\n// built-ins, a component for plugins), resolved custom-first via getChartEntry.\n// Imported directly — not injected — so chart icon resolution does NOT depend on\n// chartRegistry's module init having run first (importing the icon helper\n// standalone must still resolve built-in icons). This is safe: chartRegistry is\n// DOM-free (its chart-component thunks live in ChartLoader, not the entry), so\n// importing it here never drags the chart component graph into the icon module.\nimport { getChartEntry } from '../charts/chartRegistry.js'\n\n// Internal mutable registry - starts with defaults\nlet _registry: IconRegistry = { ...DEFAULT_ICONS }\n\n// Cache for icon components to avoid recreating on every getIcon() call\n// This prevents React from unmounting/remounting icons on each render\nconst _iconComponentCache = new Map<IconName, ComponentType<IconProps>>()\n\n/**\n * Get the full icon registry\n */\nexport function getIconRegistry(): IconRegistry {\n return _registry\n}\n\n/**\n * Get a specific icon as a React component\n * @param name The icon name from the registry\n * @returns A React component that renders the icon (cached for stable references)\n */\nexport function getIcon(name: IconName): ComponentType<IconProps> {\n // Check cache first for stable component references\n const cached = _iconComponentCache.get(name)\n if (cached) {\n return cached\n }\n\n const iconDef = _registry[name]\n if (!iconDef) {\n console.warn(`Icon \"${name}\" not found in registry, using fallback`)\n // Create and cache fallback component\n const FallbackIcon = ({ className, ...props }: IconProps) => (\n <Icon icon={_registry.info.icon} className={className} {...props} />\n )\n return FallbackIcon\n }\n\n // Create and cache the icon component\n const IconComponent = ({ className, ...props }: IconProps) => (\n <Icon icon={iconDef.icon} className={className} {...props} />\n )\n _iconComponentCache.set(name, IconComponent)\n return IconComponent\n}\n\n/**\n * Get icon data directly (for use with Iconify's Icon component)\n * @param name The icon name from the registry\n * @returns The IconifyIcon data\n */\nexport function getIconData(name: IconName): IconifyIcon {\n return _registry[name]?.icon ?? _registry.info.icon\n}\n\n/**\n * Override a single icon in the registry\n * @param name The icon name to override\n * @param icon The new IconifyIcon data\n */\nexport function setIcon(name: IconName, icon: IconifyIcon): void {\n if (_registry[name]) {\n _registry[name] = {\n ..._registry[name],\n icon\n }\n // Clear cache for this icon so it gets recreated with new definition\n _iconComponentCache.delete(name)\n }\n}\n\n/**\n * Register multiple icon overrides at once\n * @param overrides Partial registry with icons to override\n */\nexport function registerIcons(overrides: PartialIconRegistry): void {\n for (const [key, value] of Object.entries(overrides)) {\n if (value && key in _registry) {\n const iconKey = key as IconName\n\n // Check if it's a raw IconifyIcon or a full IconDefinition\n if ('body' in value) {\n // It's an IconifyIcon\n _registry[iconKey] = {\n ..._registry[iconKey],\n icon: value as IconifyIcon\n }\n } else {\n // It's a partial IconDefinition\n const partial = value as Partial<IconDefinition>\n _registry[iconKey] = {\n ..._registry[iconKey],\n ...partial,\n icon: partial.icon ?? _registry[iconKey].icon\n }\n }\n // Clear cache for this icon so it gets recreated with new definition\n _iconComponentCache.delete(iconKey)\n }\n }\n}\n\n/**\n * Reset the registry to default icons\n */\nexport function resetIcons(): void {\n _registry = { ...DEFAULT_ICONS }\n // Clear all cached icon components\n _iconComponentCache.clear()\n}\n\n/**\n * Get all icons in a specific category\n * @param category The icon category to filter by\n * @returns Record of icon names to their components\n */\nexport function getIconsByCategory(category: IconCategory): Record<string, ComponentType<IconProps>> {\n const result: Record<string, ComponentType<IconProps>> = {}\n\n for (const [key, value] of Object.entries(_registry)) {\n if (value.category === category) {\n result[key] = getIcon(key as IconName)\n }\n }\n\n return result\n}\n\n/**\n * Helper to get measure type icon component\n * @param measureType The measure type (count, avg, sum, etc.)\n * @returns React component for the icon\n */\nexport function getMeasureTypeIcon(measureType: string | undefined): ComponentType<IconProps> {\n const typeMap: Record<string, IconName> = {\n count: 'measureCount',\n countDistinct: 'measureCountDistinct',\n countDistinctApprox: 'measureCountDistinctApprox',\n sum: 'measureSum',\n avg: 'measureAvg',\n min: 'measureMin',\n max: 'measureMax',\n runningTotal: 'measureRunningTotal',\n calculated: 'measureCalculated',\n number: 'measureNumber'\n }\n\n const iconName = typeMap[measureType || ''] || 'measureCount'\n return getIcon(iconName)\n}\n\n/**\n * Helper to get chart type icon component\n * @param chartType The chart type (bar, line, pie, etc.)\n * @returns React component for the icon\n */\nexport function getChartTypeIcon(chartType: string): ComponentType<IconProps> {\n // Unified registry: every chart — built-in or plugin — declares its icon on\n // its chartRegistry entry, resolved custom-first so a plugin override of a\n // built-in (e.g. `bar`) wins. A string is an IconName resolved via the icon\n // registry (theme-overridable); a component is used as-is (plugin icons).\n // Unknown types fall back to the bar icon.\n const entryIcon = getChartEntry(chartType)?.icon\n if (entryIcon) {\n return typeof entryIcon === 'string' ? getIcon(entryIcon) : entryIcon\n }\n\n return getIcon('chartBar')\n}\n\n/**\n * Helper to get field type icon component\n * @param fieldType The field type (measure, dimension, timeDimension)\n * @returns React component for the icon\n */\nexport function getFieldTypeIcon(fieldType: string): ComponentType<IconProps> {\n const typeMap: Record<string, IconName> = {\n measure: 'measure',\n dimension: 'dimension',\n timeDimension: 'timeDimension',\n time: 'timeDimension',\n segment: 'segment'\n }\n\n const iconName = typeMap[fieldType] || 'dimension'\n return getIcon(iconName)\n}\n","import { useTranslation } from '../../hooks/useTranslation.js'\n\ninterface MissingDependencyFallbackProps {\n chartType: string\n packageName: string\n installCommand: string\n height?: string | number\n}\n\n/**\n * Fallback component shown when a chart's optional dependency is not installed.\n * Provides clear instructions on how to install the missing package.\n */\nexport function MissingDependencyFallback({\n chartType,\n packageName,\n installCommand,\n height = 200\n}: MissingDependencyFallbackProps) {\n const { t } = useTranslation()\n return (\n <div\n className=\"dc-missing-dependency-fallback\"\n style={{\n height: typeof height === 'number' ? `${height}px` : height,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n padding: '1.5rem',\n textAlign: 'center',\n border: '1px dashed var(--dc-border, #e5e7eb)',\n borderRadius: '0.5rem',\n backgroundColor: 'var(--dc-surface, #f9fafb)'\n }}\n >\n <div style={{ fontSize: '2.5rem', marginBottom: '1rem' }}>📦</div>\n <h3 style={{\n fontSize: '1.125rem',\n fontWeight: 600,\n marginBottom: '0.5rem',\n color: 'var(--dc-text, #111827)'\n }}>\n {t('chart.runtime.missingDep.title')}\n </h3>\n <p style={{\n fontSize: '0.875rem',\n color: 'var(--dc-text-secondary, #6b7280)',\n marginBottom: '1rem',\n maxWidth: '28rem'\n }}>\n {t('chart.runtime.missingDep.description', { chartType, packageName })}\n </p>\n <div style={{\n backgroundColor: 'var(--dc-surface-secondary, #f3f4f6)',\n borderRadius: '0.5rem',\n padding: '0.75rem 1rem',\n fontFamily: 'monospace',\n fontSize: '0.875rem',\n color: 'var(--dc-text, #111827)'\n }}>\n <span style={{\n color: 'var(--dc-text-muted, #9ca3af)',\n userSelect: 'none'\n }}>$ </span>\n {installCommand}\n </div>\n <p style={{\n fontSize: '0.75rem',\n color: 'var(--dc-text-muted, #9ca3af)',\n marginTop: '0.75rem'\n }}>\n {t('chart.runtime.missingDep.restartHint')}\n </p>\n </div>\n )\n}\n","/**\n * Chart Component Registry\n *\n * Holds the shared mutable state and the custom (plugin) chart registration API\n * for the lazy chart loader. This module deliberately does NOT import the built-in\n * chart import map (which dynamically imports DataTable and pulls in CubeProvider /\n * the chart plugin system). Keeping the registration API here — separate from\n * `ChartLoader.tsx` — lets `chartPlugin.ts` register/unregister charts without\n * creating an import cycle (chartPlugin → ChartLoader → DataTable → CubeProvider →\n * chartPlugin).\n */\n\nimport { lazy, ComponentType, LazyExoticComponent } from 'react'\nimport type { ChartType, ChartProps } from '../types.js'\nimport { MissingDependencyFallback } from '../components/charts/MissingDependencyFallback.js'\nimport { useTranslation } from '../hooks/useTranslation.js'\n// chartRegistry only imports pure helpers at runtime, so this stays free of the\n// import-map cycle that this module is careful to avoid.\nimport { getChartEntry } from './chartRegistry.js'\n\n// Type for lazy-loaded chart components\nexport type LazyChartComponent = ComponentType<ChartProps>\n\n// Chart loader cache to prevent re-creating lazy components\nexport const chartLoaderCache = new Map<ChartType, LazyExoticComponent<LazyChartComponent>>()\n\n// Track which chart types have failed to load due to missing dependencies\nexport const failedChartTypes = new Set<ChartType>()\n\n// Registry for custom (plugin) chart components\nexport const customChartMap = new Map<string, LazyExoticComponent<LazyChartComponent>>()\n\n/**\n * Creates a fallback component for an unknown/unregistered chart type.\n */\nexport function createUnknownChartFallback(chartType: string): LazyChartComponent {\n const Fallback: LazyChartComponent = ({ height }) => {\n const { t } = useTranslation()\n return (\n <div\n className=\"dc:flex dc:flex-col dc:items-center dc:justify-center dc:w-full dc:gap-2\"\n style={{ height: typeof height === 'number' ? `${height}px` : height || '200px' }}\n >\n <div className=\"dc:text-sm dc:font-semibold text-dc-text-muted\">{t('chart.runtime.unknownChartType')}</div>\n <div className=\"dc:text-xs text-dc-text-muted\">&ldquo;{chartType}&rdquo; is not registered</div>\n </div>\n )\n }\n Fallback.displayName = `UnknownChart_${chartType}`\n return Fallback\n}\n\n/**\n * Creates a fallback component for a chart type with missing dependencies.\n */\nexport function createFallbackComponent(chartType: ChartType): LazyChartComponent {\n // Dependencies are declared on the chart's unified entry (custom or built-in).\n const depInfo = getChartEntry(chartType)?.dependencies\n\n const FallbackComponent: LazyChartComponent = ({ height }) => (\n <MissingDependencyFallback\n chartType={chartType}\n packageName={depInfo?.packageName || 'unknown'}\n installCommand={depInfo?.installCommand || `npm install [package-name]`}\n height={height}\n />\n )\n\n FallbackComponent.displayName = `${chartType}Fallback`\n return FallbackComponent\n}\n\n/**\n * Wraps a chart import function with error handling.\n * If the import fails (e.g., missing dependency), returns a fallback component.\n */\nexport function createSafeImport(\n chartType: ChartType,\n importFn: () => Promise<{ default: LazyChartComponent }>\n): () => Promise<{ default: LazyChartComponent }> {\n return async () => {\n try {\n return await importFn()\n } catch (error) {\n // Log the error for debugging\n console.warn(\n `[drizzle-cube] Failed to load ${chartType} chart:`,\n error instanceof Error ? error.message : error\n )\n\n // Track that this chart type failed\n failedChartTypes.add(chartType)\n\n // Return the fallback component wrapped in the expected format\n return { default: createFallbackComponent(chartType) }\n }\n }\n}\n\n/**\n * Register a custom chart component.\n * Used by the chart plugin system.\n */\nexport function registerChartComponent(\n type: string,\n component?: ComponentType<ChartProps>,\n lazyComponent?: () => Promise<{ default: ComponentType<ChartProps> }>,\n dependencies?: { packageName: string; installCommand: string }\n): void {\n // Clear any existing built-in cache entry so the custom chart takes priority\n chartLoaderCache.delete(type as ChartType)\n failedChartTypes.delete(type as ChartType)\n\n if (lazyComponent) {\n // Lazy import factory — wrap with safe import for graceful degradation\n const safeImport = dependencies\n ? createSafeImport(type as ChartType, lazyComponent)\n : lazyComponent\n customChartMap.set(type, lazy(safeImport))\n } else if (component) {\n // Eager component — wrap in a resolved lazy for consistent Suspense handling\n const comp = component\n customChartMap.set(type, lazy(() => Promise.resolve({ default: comp as LazyChartComponent })))\n }\n}\n\n/**\n * Unregister a custom chart component.\n * Used by the chart plugin system.\n */\nexport function unregisterChartComponent(type: string): void {\n customChartMap.delete(type)\n chartLoaderCache.delete(type as ChartType)\n failedChartTypes.delete(type as ChartType)\n}\n","/**\n * CubeMetaProvider - Metadata Context Layer\n *\n * Provides cube metadata (meta, labelMap) isolated from API layer.\n * This prevents components from re-rendering when metadata loads\n * if they only need API access.\n *\n * Uses TanStack Query for metadata fetching with built-in caching.\n */\n\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { useCubeMetaQuery } from '../hooks/queries/useCubeMetaQuery.js'\nimport { CubeMetaContext } from './CubeMetaContext.js'\n\ninterface CubeMetaProviderProps {\n children: ReactNode\n}\n\nexport function CubeMetaProvider({ children }: CubeMetaProviderProps) {\n // Use TanStack Query hook for metadata fetching\n const {\n meta,\n labelMap,\n isLoading: metaLoading,\n error,\n refetch,\n getFieldLabel: getFieldLabelFromQuery\n } = useCubeMetaQuery()\n\n // Convert error to string for backward compatibility\n const metaError = error ? (error instanceof Error ? error.message : String(error)) : null\n\n // Wrap refetch to match expected signature\n const refetchMeta = useCallback(() => {\n refetch()\n }, [refetch])\n\n // Create stable getFieldLabel that reads from current labelMap\n const getFieldLabel = useCallback((fieldName: string): string => {\n return getFieldLabelFromQuery(fieldName)\n }, [getFieldLabelFromQuery])\n\n // Memoize context value to prevent unnecessary re-renders\n const value = useMemo(() => ({\n meta,\n labelMap,\n metaLoading,\n metaError,\n getFieldLabel,\n refetchMeta\n }), [meta, labelMap, metaLoading, metaError, getFieldLabel, refetchMeta])\n\n return (\n <CubeMetaContext.Provider value={value}>\n {children}\n </CubeMetaContext.Provider>\n )\n}\n","import type { ChartTypeConfig } from '../../charts/chartConfigs.js'\n\n/**\n * Configuration for the records table.\n *\n * Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the\n * unified `chartRegistry` entry — see `src/client/charts/chartRegistry.ts`. This\n * file owns the lazy-loaded shape: drop zones, display options, clickable\n * elements, validation.\n */\nexport const recordsTableConfig: ChartTypeConfig = {\n dropZones: [\n {\n key: 'columns',\n label: 'chart.recordsTable.dropZone.columns.label',\n description: 'chart.recordsTable.dropZone.columns.description',\n mandatory: false,\n acceptTypes: ['dimension', 'timeDimension', 'measure'],\n emptyText: 'chart.recordsTable.dropZone.columns.empty'\n },\n {\n key: 'hiddenColumns',\n label: 'chart.recordsTable.dropZone.hiddenColumns.label',\n description: 'chart.recordsTable.dropZone.hiddenColumns.description',\n mandatory: false,\n acceptTypes: ['dimension', 'timeDimension', 'measure'],\n emptyText: 'chart.recordsTable.dropZone.hiddenColumns.empty',\n // Hiding is a deliberate choice: auto-filling this from the query would\n // hide every column and render an empty table.\n excludeFromInference: true\n }\n ],\n displayOptions: ['hideHeader'],\n displayOptionsConfig: [\n {\n key: 'columnFormats',\n label: 'chart.recordsTable.option.columnFormats.label',\n type: 'columnFormats',\n description: 'chart.recordsTable.option.columnFormats.description'\n },\n {\n key: 'rowLink',\n label: 'chart.recordsTable.option.rowLink.label',\n type: 'rowLink',\n description: 'chart.recordsTable.option.rowLink.description'\n },\n {\n key: 'pageSize',\n label: 'chart.recordsTable.option.pageSize.label',\n type: 'select',\n defaultValue: 25,\n description: 'chart.recordsTable.option.pageSize.description',\n options: [\n { value: 25, label: 'chart.recordsTable.option.pageSize.option.25' },\n { value: 50, label: 'chart.recordsTable.option.pageSize.option.50' },\n { value: 100, label: 'chart.recordsTable.option.pageSize.option.100' }\n ]\n }\n ],\n clickableElements: { row: true },\n // A record-grain listing: its query must be ungrouped, or the rows collapse\n // into aggregates and generated attribute dimensions stop being legal SQL.\n recordGrain: true\n}\n","/**\n * RetentionHeatmap Chart Configuration\n *\n * The RetentionHeatmap is a specialized chart for retention analysis.\n * It auto-configures from retention data and doesn't need typical axis configuration.\n *\n * Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the\n * unified `chartRegistry` entry (the single source of truth) — see\n * `src/client/charts/chartRegistry.ts`. This file owns the lazy-loaded shape:\n * drop zones, display options, clickable elements, validation.\n */\n\nimport type { ChartTypeConfig } from '../../charts/chartConfigs.js'\n\nexport const retentionHeatmapConfig: ChartTypeConfig = {\n // RetentionHeatmap auto-configures from the retention data structure\n // No drop zones needed as the chart maps directly to cohort × period matrix\n dropZones: [],\n\n // Display options\n displayOptionsConfig: [\n {\n key: 'showLegend',\n label: 'chart.option.showLegend.label',\n type: 'boolean',\n defaultValue: true,\n description: 'chart.configText.show_the_color_intensity_legend',\n },\n {\n key: 'showTooltip',\n label: 'chart.option.showTooltip.label',\n type: 'boolean',\n defaultValue: true,\n description: 'chart.option.showTooltip.description',\n },\n ],\n}\n","/**\n * RetentionCombinedChart Configuration\n *\n * The RetentionCombinedChart visualizes retention analysis data with multiple display modes.\n * It auto-configures from retention data and provides display mode selection.\n *\n * Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the\n * unified `chartRegistry` entry (the single source of truth) — see\n * `src/client/charts/chartRegistry.ts`. This file owns the lazy-loaded shape:\n * drop zones, display options, clickable elements, validation.\n */\n\nimport type { ChartTypeConfig } from '../../charts/chartConfigs.js'\n\nexport const retentionCombinedConfig: ChartTypeConfig = {\n // RetentionCombinedChart auto-configures from the retention data structure\n // No drop zones needed as the chart maps directly to retention result data\n dropZones: [],\n\n // Display options\n displayOptionsConfig: [\n {\n key: 'retentionDisplayMode',\n label: 'chart.option.retentionDisplayMode.label',\n type: 'select',\n defaultValue: 'line',\n options: [\n { value: 'line', label: 'chart.option.retentionDisplayMode.lineChart' },\n { value: 'heatmap', label: 'chart.option.retentionDisplayMode.heatmapTable' },\n { value: 'combined', label: 'chart.option.retentionDisplayMode.combined' },\n ],\n description: 'chart.configText.choose_how_to_visualize_retention_data',\n },\n {\n key: 'showLegend',\n label: 'chart.option.showLegend.label',\n type: 'boolean',\n defaultValue: true,\n description: 'chart.configText.show_the_legend_for_breakdown_segments',\n },\n {\n key: 'showGrid',\n label: 'chart.option.showGrid.label',\n type: 'boolean',\n defaultValue: true,\n description: 'chart.option.showGrid.description',\n },\n {\n key: 'showTooltip',\n label: 'chart.option.showTooltip.label',\n type: 'boolean',\n defaultValue: true,\n description: 'chart.option.showTooltip.description',\n },\n ],\n}\n","import type { ChartTypeConfig } from '../../charts/chartConfigs.js'\n\n/**\n * Configuration for the dot strip (beeswarm) chart type.\n *\n * Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the\n * unified `chartRegistry` entry (the single source of truth) — see\n * `src/client/charts/chartRegistry.ts`. This file owns the lazy-loaded shape:\n * drop zones, display options, clickable elements, validation.\n *\n * The zone *keys* are the standard `xAxis` / `yAxis` / `series` (so no\n * `ChartAxisConfig` change is needed), but the visual axes are transposed —\n * bands are rows and the measure runs horizontally — so the labels name the\n * roles rather than the axes.\n */\nexport const dotStripChartConfig: ChartTypeConfig = {\n displayOptions: ['showGrid', 'showTooltip', 'hideHeader'],\n dropZones: [\n {\n key: 'xAxis',\n label: 'chart.dotStrip.dropZone.xAxis.label',\n description: 'chart.dotStrip.dropZone.xAxis.description',\n mandatory: true,\n maxItems: 1,\n acceptTypes: ['dimension', 'timeDimension'],\n emptyText: 'chart.dotStrip.dropZone.xAxis.empty',\n },\n {\n key: 'yAxis',\n label: 'chart.dotStrip.dropZone.yAxis.label',\n description: 'chart.dotStrip.dropZone.yAxis.description',\n mandatory: true,\n maxItems: 1,\n acceptTypes: ['measure'],\n emptyText: 'chart.dotStrip.dropZone.yAxis.empty',\n },\n {\n key: 'series',\n label: 'chart.dotStrip.dropZone.series.label',\n description: 'chart.dotStrip.dropZone.series.description',\n mandatory: false,\n maxItems: 1,\n acceptTypes: ['dimension'],\n emptyText: 'chart.dotStrip.dropZone.series.empty',\n },\n ],\n clickableElements: {\n point: true,\n },\n displayOptionsConfig: [\n {\n key: 'showMedianMarker',\n label: 'chart.option.showMedianMarker.label',\n type: 'boolean',\n defaultValue: true,\n description: 'chart.option.showMedianMarker.description',\n },\n {\n key: 'showBandStats',\n label: 'chart.option.showBandStats.label',\n type: 'boolean',\n defaultValue: true,\n description: 'chart.option.showBandStats.description',\n },\n {\n key: 'showExtremeLabels',\n label: 'chart.option.showExtremeLabels.label',\n type: 'boolean',\n defaultValue: false,\n description: 'chart.option.showExtremeLabels.description',\n },\n {\n key: 'dotSize',\n label: 'chart.option.dotSize.label',\n type: 'select',\n defaultValue: 'medium',\n options: [\n { value: 'small', label: 'chart.option.dotSize.small' },\n { value: 'medium', label: 'chart.option.dotSize.medium' },\n { value: 'large', label: 'chart.option.dotSize.large' },\n ],\n description: 'chart.option.dotSize.description',\n },\n {\n key: 'bandSort',\n label: 'chart.option.bandSort.label',\n type: 'select',\n defaultValue: 'none',\n options: [\n { value: 'none', label: 'chart.option.bandSort.none' },\n { value: 'valueDesc', label: 'chart.option.bandSort.valueDesc' },\n { value: 'valueAsc', label: 'chart.option.bandSort.valueAsc' },\n { value: 'count', label: 'chart.option.bandSort.count' },\n ],\n description: 'chart.option.bandSort.description',\n },\n {\n key: 'xAxisFormat',\n label: 'chart.option.xAxisFormat.label',\n type: 'axisFormat',\n description: 'chart.option.xAxisFormat.description',\n },\n ],\n}\n","import type { ChartTypeConfig } from '../../charts/chartConfigs.js'\n\n/**\n * Configuration for the proportion bar chart type.\n *\n * Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the\n * unified `chartRegistry` entry (the single source of truth) — see\n * `src/client/charts/chartRegistry.ts`. This file owns the lazy-loaded shape:\n * drop zones, display options, clickable elements, validation.\n */\nexport const proportionBarChartConfig: ChartTypeConfig = {\n dropZones: [\n {\n key: 'xAxis',\n label: 'chart.configText.category',\n description: 'chart.configText.dimension_to_split_the_bar_into_segments',\n mandatory: true,\n maxItems: 1,\n acceptTypes: ['dimension', 'timeDimension'],\n emptyText: 'chart.proportionBar.dropZone.xAxis.empty'\n },\n {\n key: 'yAxis',\n label: 'chart.configText.value',\n description: 'chart.configText.measure_that_determines_each_segments_share',\n mandatory: true,\n maxItems: 1,\n acceptTypes: ['measure'],\n emptyText: 'chart.proportionBar.dropZone.yAxis.empty'\n }\n ],\n displayOptions: ['hideHeader'],\n displayOptionsConfig: [\n {\n key: 'showLabels',\n label: 'chart.option.proportionBarLabels.label',\n type: 'boolean',\n defaultValue: true,\n description: 'chart.option.proportionBarLabels.description'\n },\n {\n key: 'showPercentages',\n label: 'chart.option.showPercentages.label',\n type: 'boolean',\n defaultValue: true,\n description: 'chart.option.showPercentages.description'\n },\n {\n key: 'sortSegments',\n label: 'chart.option.sortSegments.label',\n type: 'boolean',\n defaultValue: false,\n description: 'chart.option.sortSegments.description'\n },\n {\n key: 'decimals',\n label: 'chart.option.decimals.label',\n type: 'number',\n defaultValue: 0,\n min: 0,\n max: 2,\n description: 'chart.option.proportionBarDecimals.description'\n }\n ],\n validate: (config: any) => {\n if (!config?.xAxis || (Array.isArray(config.xAxis) && config.xAxis.length === 0)) {\n return { isValid: false, message: 'chart.proportionBar.validation.dimensionRequired' }\n }\n if (!config?.yAxis || (Array.isArray(config.yAxis) && config.yAxis.length === 0)) {\n return { isValid: false, message: 'chart.proportionBar.validation.measureRequired' }\n }\n return { isValid: true }\n }\n}\n","import { barChartConfig } from '../components/charts/BarChart.config.js'\nimport { lineChartConfig } from '../components/charts/LineChart.config.js'\nimport { areaChartConfig } from '../components/charts/AreaChart.config.js'\nimport { pieChartConfig } from '../components/charts/PieChart.config.js'\nimport { scatterChartConfig } from '../components/charts/ScatterChart.config.js'\nimport { bubbleChartConfig } from '../components/charts/BubbleChart.config.js'\nimport { radarChartConfig } from '../components/charts/RadarChart.config.js'\nimport { radialBarChartConfig } from '../components/charts/RadialBarChart.config.js'\nimport { treemapChartConfig } from '../components/charts/TreeMapChart.config.js'\nimport { dataTableConfig } from '../components/charts/DataTable.config.js'\nimport { recordsTableConfig } from '../components/charts/RecordsTable.config.js'\nimport { activityGridChartConfig } from '../components/charts/ActivityGridChart.config.js'\nimport { kpiNumberConfig } from '../components/charts/KpiNumber.config.js'\nimport { kpiDeltaConfig } from '../components/charts/KpiDelta.config.js'\nimport { kpiTextConfig } from '../components/charts/KpiText.config.js'\nimport { markdownConfig } from '../components/charts/MarkdownChart.config.js'\nimport { funnelChartConfig } from '../components/charts/FunnelChart.config.js'\nimport { sankeyChartConfig } from '../components/charts/SankeyChart.config.js'\nimport { sunburstChartConfig } from '../components/charts/SunburstChart.config.js'\nimport { heatmapChartConfig } from '../components/charts/HeatMapChart.config.js'\nimport { retentionHeatmapConfig } from '../components/charts/RetentionHeatmap.config.js'\nimport { retentionCombinedConfig } from '../components/charts/RetentionCombinedChart.config.js'\nimport { boxPlotChartConfig } from '../components/charts/BoxPlotChart.config.js'\nimport { dotStripChartConfig } from '../components/charts/DotStripChart.config.js'\nimport { waterfallChartConfig } from '../components/charts/WaterfallChart.config.js'\nimport { candlestickChartConfig } from '../components/charts/CandlestickChart.config.js'\nimport { measureProfileChartConfig } from '../components/charts/MeasureProfileChart.config.js'\nimport { proportionBarChartConfig } from '../components/charts/ProportionBarChart.config.js'\nimport { gaugeChartConfig } from '../components/charts/GaugeChart.config.js'\nimport type { BuiltInChartType } from '../types.js'\nimport type { ChartTypeConfig, ChartConfigRegistry } from './chartConfigs.js'\nimport { chartRegistry, composeChartConfig } from './chartRegistry.js'\n\n/**\n * Statically-imported full config shapes (drop zones, display options, clickable\n * elements, validation) for every built-in chart. These are the lazy-loaded\n * side of a chart, but the eager registry below needs them synchronously because\n * the server agent reads drop zones for mandatory-zone validation and tool\n * guidance. Eager metadata (label/description/useCase/isAvailable) is NOT here —\n * it lives on the `chartRegistry` entry, its single source of truth.\n */\nconst baseConfigs: Record<BuiltInChartType, ChartTypeConfig> = {\n bar: barChartConfig,\n line: lineChartConfig,\n area: areaChartConfig,\n pie: pieChartConfig,\n scatter: scatterChartConfig,\n bubble: bubbleChartConfig,\n radar: radarChartConfig,\n radialBar: radialBarChartConfig,\n treemap: treemapChartConfig,\n table: dataTableConfig,\n recordsTable: recordsTableConfig,\n activityGrid: activityGridChartConfig,\n kpiNumber: kpiNumberConfig,\n kpiDelta: kpiDeltaConfig,\n kpiText: kpiTextConfig,\n markdown: markdownConfig,\n funnel: funnelChartConfig,\n sankey: sankeyChartConfig,\n sunburst: sunburstChartConfig,\n heatmap: heatmapChartConfig,\n retentionHeatmap: retentionHeatmapConfig,\n retentionCombined: retentionCombinedConfig,\n boxPlot: boxPlotChartConfig,\n dotStrip: dotStripChartConfig,\n waterfall: waterfallChartConfig,\n candlestick: candlestickChartConfig,\n measureProfile: measureProfileChartConfig,\n proportionBar: proportionBarChartConfig,\n gauge: gaugeChartConfig,\n}\n\n/**\n * Registry of all chart type configurations (the eager / full / server source).\n *\n * Every built-in is composed from its `chartRegistry` entry's metadata (single\n * source of truth) laid over its full config shape. Drop zones / display options\n * stay here in full because the server agent reads them synchronously.\n */\nexport const chartConfigRegistry: ChartConfigRegistry = Object.fromEntries(\n (Object.keys(chartRegistry) as BuiltInChartType[]).map((type) => [\n type,\n composeChartConfig(chartRegistry[type], baseConfigs[type]),\n ])\n)\n\n/**\n * Whether a chart lists records rather than aggregates, and so needs an\n * `ungrouped` query.\n *\n * Reads the eager registry so the query builders need no chart-type switch.\n */\nexport function isRecordGrainChart(chartType: string): boolean {\n return chartConfigRegistry[chartType]?.recordGrain === true\n}\n\n/**\n * Register a custom chart config into the registry.\n * Used by the chart plugin system.\n */\nexport function registerChartConfig(type: string, config: ChartTypeConfig): void {\n chartConfigRegistry[type] = config\n}\n\n/**\n * Unregister a chart config from the registry.\n * Used by the chart plugin system.\n */\nexport function unregisterChartConfig(type: string): void {\n delete chartConfigRegistry[type]\n}\n","/**\n * Chart Plugin System\n *\n * Provides a public API for registering custom chart types at runtime.\n * Custom charts can extend the built-in set or override existing chart types.\n *\n * Registration via CubeProvider (recommended):\n * ```tsx\n * <CubeProvider customCharts={[{ type: 'gantt', label: 'Gantt', config, component }]}>\n * ```\n *\n * Imperative registration (library authors):\n * ```ts\n * import { chartPluginRegistry } from 'drizzle-cube/client'\n * chartPluginRegistry.register({ type: 'gantt', label: 'Gantt', config, component })\n * ```\n */\n\nimport type { ComponentType } from 'react'\nimport type { ChartProps } from '../types.js'\nimport type { ChartTypeConfig } from './chartConfigs.js'\nimport type { IconProps } from '../icons/types.js'\nimport { registerChartConfig, unregisterChartConfig, chartConfigRegistry } from './chartConfigRegistry.js'\nimport { registerConfigToCache, unregisterConfigFromCache } from './lazyChartConfigRegistry.js'\nimport { registerChartComponent, unregisterChartComponent } from './chartComponentRegistry.js'\nimport {\n type ChartRegistryEntry,\n registerCustomChartEntry,\n unregisterCustomChartEntry,\n getCustomChartEntry,\n} from './chartRegistry.js'\n\n/**\n * Map a custom `ChartDefinition` onto the unified `ChartRegistryEntry` shape —\n * the same shape built-in charts use — so both flow through one lookup path.\n * `config` is the label-normalized config; the entry's lazy thunk resolves the\n * provided config object directly (it is already in memory, not code-split).\n */\nfunction chartDefinitionToEntry(\n definition: ChartDefinition,\n config: ChartTypeConfig\n): ChartRegistryEntry {\n return {\n label: config.label ?? definition.label,\n // Plugins supply a ready-made icon component; absent one, use the bar icon.\n icon: definition.icon ?? 'chartBar',\n description: config.description,\n useCase: config.useCase,\n isAvailable: config.isAvailable,\n dependencies: definition.dependencies,\n config: async () => config,\n }\n}\n\n/**\n * Complete definition for registering a custom chart type.\n * Bundles component, config metadata, and optional icon.\n */\nexport interface ChartDefinition {\n /** Unique chart type identifier (e.g., 'myGantt', 'customBar') */\n type: string\n\n /** Display label for the chart type picker */\n label: string\n\n /** Chart type configuration (drop zones, display options, validation) */\n config: ChartTypeConfig\n\n /** The chart component (eager — loaded immediately) */\n component?: ComponentType<ChartProps>\n\n /** Lazy-loaded chart component (for code splitting). Use instead of `component`. */\n lazyComponent?: () => Promise<{ default: ComponentType<ChartProps> }>\n\n /** Optional icon component for the chart type picker */\n icon?: ComponentType<IconProps>\n\n /** Optional dependency info — shows install instructions if the import fails */\n dependencies?: {\n packageName: string\n installCommand: string\n }\n}\n\n/**\n * Central registry for custom chart plugins.\n *\n * Coordinates registration across the three internal registries\n * (config, lazy config cache, chart loader) and provides a\n * `useSyncExternalStore`-compatible subscription API for React reactivity.\n */\nclass ChartPluginRegistry {\n private customCharts = new Map<string, ChartDefinition>()\n private builtInBackups = new Map<string, ChartTypeConfig>()\n private version = 0\n private listeners = new Set<() => void>()\n\n /**\n * Register a custom chart definition.\n * If `type` matches a built-in chart, the built-in is backed up and can be\n * restored by calling `unregister()`.\n */\n register(definition: ChartDefinition): void {\n // Ensure the config has the label set\n const config: ChartTypeConfig = {\n ...definition.config,\n label: definition.config.label || definition.label,\n }\n\n // Backup built-in config if overriding and not already backed up\n if (\n chartConfigRegistry[definition.type] &&\n !this.builtInBackups.has(definition.type) &&\n !this.customCharts.has(definition.type)\n ) {\n this.builtInBackups.set(definition.type, chartConfigRegistry[definition.type])\n }\n\n // Store the definition\n this.customCharts.set(definition.type, definition)\n\n // Produce the unified entry — the single source of truth both built-in and\n // custom charts share — and register the component graph alongside it.\n registerCustomChartEntry(definition.type, chartDefinitionToEntry(definition, config))\n registerChartConfig(definition.type, config)\n registerConfigToCache(definition.type, config)\n registerChartComponent(\n definition.type,\n definition.component,\n definition.lazyComponent,\n definition.dependencies\n )\n\n this.bump()\n }\n\n /**\n * Unregister a custom chart.\n * If the chart type was a built-in override, the original built-in is restored.\n */\n unregister(type: string): void {\n if (!this.customCharts.has(type)) return\n\n this.customCharts.delete(type)\n unregisterCustomChartEntry(type)\n\n // Restore built-in backup if exists\n const backup = this.builtInBackups.get(type)\n if (backup) {\n registerChartConfig(type, backup)\n registerConfigToCache(type, backup)\n this.builtInBackups.delete(type)\n } else {\n unregisterChartConfig(type)\n unregisterConfigFromCache(type)\n }\n\n // Always unregister the custom component\n unregisterChartComponent(type)\n\n this.bump()\n }\n\n /** Get the custom icon component for a chart type, if one was registered. */\n getIcon(type: string): ComponentType<IconProps> | undefined {\n // Derived from the unified entry — a string icon is a built-in IconName, so\n // only a component value counts as a plugin-supplied icon here.\n const icon = getCustomChartEntry(type)?.icon\n return icon && typeof icon !== 'string' ? icon : undefined\n }\n\n /** Get all registered custom chart type strings */\n getCustomTypes(): string[] {\n return Array.from(this.customCharts.keys())\n }\n\n /** Check if a chart type is a custom plugin (not built-in) */\n isCustom(type: string): boolean {\n return this.customCharts.has(type)\n }\n\n /**\n * Subscribe to registry changes.\n * Compatible with React's `useSyncExternalStore`.\n */\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener)\n return () => {\n this.listeners.delete(listener)\n }\n }\n\n /**\n * Get a snapshot of the registry version.\n * Compatible with React's `useSyncExternalStore`.\n */\n getSnapshot = (): number => {\n return this.version\n }\n\n private bump(): void {\n this.version++\n for (const listener of this.listeners) {\n listener()\n }\n }\n}\n\n/** Singleton chart plugin registry */\nexport const chartPluginRegistry = new ChartPluginRegistry()\n","/**\n * CubeProvider - Backward Compatibility Wrapper\n *\n * This provider wraps the three specialized context providers (API, Meta, Features)\n * to maintain 100% backward compatibility with existing code using useCubeContext().\n *\n * New code should use the specialized hooks (useCubeApi, useCubeMeta, useCubeFeatures)\n * for better performance and selective re-rendering.\n *\n * Also includes TanStack Query's QueryClientProvider for data fetching in\n * AnalysisBuilder and other components that use TanStack Query hooks.\n */\n\nimport { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { CubeApiProvider, useCubeApi } from './CubeApiProvider.js'\nimport { CubeMetaProvider } from './CubeMetaProvider.js'\nimport { useCubeMeta } from './CubeMetaContext.js'\nimport { CubeFeaturesProvider, useCubeFeatures } from './CubeFeaturesProvider.js'\nimport type { CubeQueryOptions, CubeApiOptions, FeaturesConfig, DashboardLayoutMode, CubeMeta, FieldLabelMap } from '../types.js'\nimport type { CubeClient } from '../client/CubeClient.js'\nimport type { BatchCoordinator } from '../client/BatchCoordinator.js'\nimport type { ChartDefinition } from '../charts/chartPlugin.js'\nimport { chartPluginRegistry } from '../charts/chartPlugin.js'\nimport { I18nProvider } from './I18nProvider.js'\nimport { setDebugMode } from '../../i18n/runtime.js'\n\nconst DEFAULT_API_OPTIONS: CubeApiOptions = { apiUrl: '/cubejs-api/v1' }\n\n/** Retries left to a request that failed for a reason retrying might fix. */\nconst MAX_RETRIES = 3\n\n/**\n * A 4xx is the server's verdict on the request itself — an invalid query, an\n * unknown member, a missing dashboard. Retrying it cannot change the answer; it\n * only delays the error by the backoff (~7s over three attempts), which is the\n * difference between a widget reporting a bad query at once and appearing to\n * hang. 5xx and network failures are still retried.\n */\nfunction isRequestFault(error: unknown): boolean {\n const status = (error as { status?: number } | null)?.status\n return typeof status === 'number' && status >= 400 && status < 500\n}\n\nexport const createCubeQueryClient = () => new QueryClient({\n defaultOptions: {\n queries: {\n // Stale time: 5 minutes (matches existing cache duration)\n staleTime: 5 * 60 * 1000,\n // GC time: 15 minutes\n gcTime: 15 * 60 * 1000,\n retry: (failureCount, error) => !isRequestFault(error) && failureCount < MAX_RETRIES,\n // Don't refetch on window focus by default (can be overridden per-query)\n refetchOnWindowFocus: false,\n },\n },\n})\n\n// Legacy default client (useful for tests or explicit injection)\nexport const queryClient = createCubeQueryClient()\n\n// Backward compatible interface - merges all three contexts\ninterface CubeContextValue {\n cubeApi: CubeClient\n options?: CubeQueryOptions\n meta: CubeMeta | null\n labelMap: FieldLabelMap\n metaLoading: boolean\n metaError: string | null\n getFieldLabel: (fieldName: string) => string\n refetchMeta: () => void\n updateApiConfig: (apiOptions: CubeApiOptions, token?: string) => void\n features: FeaturesConfig\n batchCoordinator: BatchCoordinator | null\n enableBatching: boolean\n dashboardModes: DashboardLayoutMode[]\n}\n\ninterface CubeProviderProps {\n cubeApi?: CubeClient\n apiOptions?: CubeApiOptions\n token?: string\n options?: CubeQueryOptions\n features?: FeaturesConfig\n dashboardModes?: DashboardLayoutMode[]\n enableBatching?: boolean\n batchDelayMs?: number // Delay in ms to collect queries before batching (default: 100)\n queryClient?: QueryClient\n /** Custom chart definitions to register. Overrides built-in charts when `type` matches. */\n customCharts?: ChartDefinition[]\n /** Locale code for i18n (default: 'en-GB'). Bundled locales are loaded via dynamic import. */\n locale?: string\n /** Optional translation overrides merged on top of the loaded locale. */\n translations?: Record<string, string>\n /** Enable i18n debug mode — logs console warnings for missing translation keys. */\n debugI18n?: boolean\n children: ReactNode\n}\n\n/**\n * CubeProvider - Three-layer context wrapper\n *\n * Wraps children in three isolated context providers for optimal performance:\n * 1. CubeApiProvider - Stable API layer (changes only on auth)\n * 2. CubeMetaProvider - Metadata layer (changes on metadata load)\n * 3. CubeFeaturesProvider - Feature flags layer (changes on feature updates)\n */\nexport function CubeProvider({\n cubeApi: _initialCubeApi, // Intentionally unused - for backward compatibility\n apiOptions,\n token,\n options,\n features,\n dashboardModes,\n enableBatching,\n batchDelayMs,\n queryClient: providedQueryClient,\n customCharts,\n locale,\n translations,\n debugI18n,\n children\n}: CubeProviderProps) {\n // Enable/disable i18n debug mode (warns on missing keys)\n useEffect(() => {\n setDebugMode(!!debugI18n)\n }, [debugI18n])\n\n const [internalQueryClient] = useState(() => createCubeQueryClient())\n const queryClient = providedQueryClient ?? internalQueryClient\n\n // Register/unregister custom charts\n const registeredTypesRef = useRef<string[]>([])\n useEffect(() => {\n if (!customCharts || customCharts.length === 0) {\n // Unregister any previously registered charts\n for (const type of registeredTypesRef.current) {\n chartPluginRegistry.unregister(type)\n }\n registeredTypesRef.current = []\n return\n }\n\n // Unregister old charts that are no longer in the list\n const newTypes = new Set(customCharts.map(c => c.type))\n for (const type of registeredTypesRef.current) {\n if (!newTypes.has(type)) {\n chartPluginRegistry.unregister(type)\n }\n }\n\n // Register all current charts\n for (const chart of customCharts) {\n chartPluginRegistry.register(chart)\n }\n registeredTypesRef.current = customCharts.map(c => c.type)\n\n return () => {\n for (const type of registeredTypesRef.current) {\n chartPluginRegistry.unregister(type)\n }\n registeredTypesRef.current = []\n }\n }, [customCharts])\n\n return (\n <I18nProvider locale={locale} translations={translations}>\n <QueryClientProvider client={queryClient}>\n <CubeApiProvider\n apiOptions={apiOptions || DEFAULT_API_OPTIONS}\n token={token}\n options={options}\n locale={locale}\n enableBatching={enableBatching}\n batchDelayMs={batchDelayMs}\n >\n <CubeMetaProvider>\n <CubeFeaturesProvider features={features} dashboardModes={dashboardModes}>\n {children}\n </CubeFeaturesProvider>\n </CubeMetaProvider>\n </CubeApiProvider>\n </QueryClientProvider>\n </I18nProvider>\n )\n}\n\n/**\n * useCubeContext - Backward compatible hook\n *\n * Merges all three contexts into a single object for backward compatibility.\n * Components using this hook will re-render when ANY context changes.\n *\n * For better performance, use specialized hooks:\n * - useCubeApi() - Only re-renders on API changes\n * - useCubeMeta() - Only re-renders on metadata changes\n * - useCubeFeatures() - Only re-renders on feature changes\n */\nexport function useCubeContext(): CubeContextValue {\n const api = useCubeApi()\n const meta = useCubeMeta()\n const featuresCtx = useCubeFeatures()\n\n return useMemo(() => ({\n ...api,\n ...meta,\n features: featuresCtx.features,\n dashboardModes: featuresCtx.dashboardModes\n }), [api, meta, featuresCtx])\n}\n\n// Re-export specialized hooks for better tree-shaking and performance\nexport { useCubeApi, useCubeMeta, useCubeFeatures }\n\n// Export factory for testing and advanced use cases\nexport { createCubeQueryClient as createQueryClient }\n","/**\n * Pivot utilities for DataTable time dimension pivoting\n *\n * When a query includes a time dimension with granularity, transforms flat data\n * into a pivoted structure with time periods as columns.\n */\n\nimport type { CubeQuery, CubeMeta } from '../types.js'\nimport { formatTimeValue } from './chartUtils.js'\n\n/**\n * Derives ordered column list from a CubeQuery object.\n * Order: dimensions, timeDimensions (as field names), measures\n *\n * @param queryObject The CubeQuery object\n * @returns Array of field names in order\n */\nexport function getOrderedColumnsFromQuery(queryObject?: CubeQuery): string[] {\n if (!queryObject) return []\n\n const columns: string[] = []\n\n // Add regular dimensions first\n if (queryObject.dimensions) {\n columns.push(...queryObject.dimensions)\n }\n\n // Add time dimensions\n if (queryObject.timeDimensions) {\n queryObject.timeDimensions.forEach(td => {\n if (!columns.includes(td.dimension)) {\n columns.push(td.dimension)\n }\n })\n }\n\n // Add measures last\n if (queryObject.measures) {\n columns.push(...queryObject.measures)\n }\n\n return columns\n}\n\n/**\n * Configuration for pivoting based on query structure\n */\nexport interface PivotConfig {\n /** Time dimension field name (e.g., \"Sales.date\") */\n timeDimension: string\n /** Time granularity (e.g., \"month\", \"day\", \"year\") */\n granularity: string\n /** Non-time dimension fields */\n dimensions: string[]\n /** Measure fields */\n measures: string[]\n}\n\n/**\n * Column definition for pivoted table\n */\nexport interface PivotColumn {\n /** Column key for data access */\n key: string\n /** Display label for column header */\n label: string\n /** Whether this is a time column (vs row identifier column) */\n isTimeColumn: boolean\n /** Whether this is the measure column */\n isMeasureColumn?: boolean\n}\n\n/**\n * Row in the pivoted table\n */\nexport interface PivotRow {\n /** Unique row identifier */\n id: string\n /** The measure field name (for icon lookup) */\n measureField: string\n /** Values keyed by column key */\n values: Record<string, any>\n /** Whether this is the first row in a dimension group (for row spanning) */\n isFirstInGroup?: boolean\n /** Number of rows to span for dimension cells (only set on first row in group) */\n dimensionRowSpan?: number\n}\n\n/**\n * Result of pivoting table data\n */\nexport interface PivotedTableData {\n /** Whether data was pivoted (has time dimension with granularity) */\n isPivoted: boolean\n /** Column definitions for the pivoted table */\n columns: PivotColumn[]\n /** Rows of pivoted data */\n rows: PivotRow[]\n}\n\n/**\n * Determines if a query has a time dimension with granularity that should trigger pivoting\n * @param queryObject The CubeQuery object\n * @param xAxisOverride Optional array of fields to use for filtering dimensions and measures\n * (for respecting chartConfig.xAxis configuration)\n * @returns PivotConfig if pivoting should occur, null otherwise\n */\nexport function hasTimeDimensionForPivot(\n queryObject?: CubeQuery,\n xAxisOverride?: string[]\n): PivotConfig | null {\n if (!queryObject?.timeDimensions?.length) return null\n\n // Find the first time dimension with granularity\n const timeDim = queryObject.timeDimensions.find(td => td.granularity)\n if (!timeDim?.granularity) return null\n\n // Must have at least one measure to pivot\n if (!queryObject.measures?.length) return null\n\n let dimensions: string[]\n let measures: string[]\n\n if (xAxisOverride && xAxisOverride.length > 0) {\n // Filter dimensions from xAxisOverride (excluding time dimension and measures)\n dimensions = xAxisOverride.filter(field => {\n // Exclude the time dimension being pivoted (it becomes columns)\n if (field === timeDim.dimension) return false\n // Exclude measures (they become row values, not dimension columns)\n if (queryObject.measures?.includes(field)) return false\n return true\n })\n\n // Filter measures from xAxisOverride - only show measures that are in xAxis\n const measuresInXAxis = xAxisOverride.filter(field =>\n queryObject.measures?.includes(field)\n )\n // If xAxis contains measures, use only those; otherwise fall back to all measures\n measures = measuresInXAxis.length > 0 ? measuresInXAxis : queryObject.measures\n } else {\n dimensions = queryObject.dimensions || []\n measures = queryObject.measures\n }\n\n // Must have at least one measure after filtering\n if (measures.length === 0) return null\n\n return {\n timeDimension: timeDim.dimension,\n granularity: timeDim.granularity,\n dimensions,\n measures\n }\n}\n\n/**\n * Extracts unique time values from data and sorts them chronologically\n */\nfunction extractAndSortTimeValues(\n data: any[],\n timeDimension: string,\n granularity: string\n): string[] {\n const timeSet = new Set<string>()\n\n data.forEach(row => {\n const rawTime = row[timeDimension]\n if (rawTime != null) {\n const formattedTime = formatTimeValue(rawTime, granularity)\n timeSet.add(formattedTime)\n }\n })\n\n // Sort chronologically - ISO date strings sort correctly alphabetically\n return Array.from(timeSet).sort()\n}\n\n/**\n * Builds column definitions for pivoted table\n * Order: Measure (if multiple) -> Dimensions -> Time columns\n */\nfunction buildColumns(\n config: PivotConfig,\n timeValues: string[],\n getFieldLabel: (field: string) => string\n): PivotColumn[] {\n const columns: PivotColumn[] = []\n\n // Add measure column first (if multiple measures)\n if (config.measures.length > 1) {\n columns.push({\n key: '__measure__',\n label: 'Measure',\n isTimeColumn: false,\n isMeasureColumn: true\n })\n }\n\n // Add dimension columns\n config.dimensions.forEach(dim => {\n columns.push({\n key: dim,\n label: getFieldLabel(dim),\n isTimeColumn: false\n })\n })\n\n // Add time columns (already sorted chronologically)\n timeValues.forEach(timeVal => {\n columns.push({\n key: timeVal,\n label: timeVal,\n isTimeColumn: true\n })\n })\n\n return columns\n}\n\n/**\n * Groups data by dimension values, then by time period\n * Returns Map<dimensionKey, Map<formattedTime, dataRow>>\n */\nfunction groupByDimensions(\n data: any[],\n config: PivotConfig\n): Map<string, Map<string, any>> {\n const grouped = new Map<string, Map<string, any>>()\n\n data.forEach(row => {\n // Build dimension key from all dimension values\n const dimKey = config.dimensions.length > 0\n ? config.dimensions.map(dim => String(row[dim] ?? '')).join('|')\n : '__all__'\n\n // Get or create time map for this dimension combo\n if (!grouped.has(dimKey)) {\n grouped.set(dimKey, new Map())\n }\n\n // Store data point by formatted time value\n const rawTime = row[config.timeDimension]\n if (rawTime != null) {\n const formattedTime = formatTimeValue(rawTime, config.granularity)\n grouped.get(dimKey)!.set(formattedTime, row)\n }\n })\n\n return grouped\n}\n\n/**\n * Builds pivoted rows from grouped data\n * Rows are grouped by measure first (all Revenue rows together, all Quantity rows together)\n * Then within each measure group, rows are ordered by dimension values\n */\nfunction buildPivotedRows(\n data: any[],\n config: PivotConfig,\n timeValues: string[],\n getFieldLabel: (field: string) => string\n): PivotRow[] {\n // Group data by dimensions and time\n const grouped = groupByDimensions(data, config)\n const dimensionKeys = Array.from(grouped.keys())\n\n const rows: PivotRow[] = []\n const measureCount = config.measures.length\n const dimensionCount = dimensionKeys.length\n\n // Iterate over measures first, then dimensions\n // This groups all rows for one measure together\n config.measures.forEach((measure) => {\n dimensionKeys.forEach((dimensionKey, dimIndex) => {\n const timeData = grouped.get(dimensionKey)!\n const rowId = measureCount > 1\n ? `${measure}|${dimensionKey}`\n : dimensionKey\n\n const values: Record<string, any> = {}\n\n // Add dimension values\n const dimValues = dimensionKey === '__all__' ? [] : dimensionKey.split('|')\n config.dimensions.forEach((dim, idx) => {\n values[dim] = dimValues[idx] ?? ''\n })\n\n // Add measure name if multiple measures (for display in Measure column)\n if (measureCount > 1) {\n values['__measure__'] = getFieldLabel(measure)\n }\n\n // Add time period values\n timeValues.forEach(timeVal => {\n const dataPoint = timeData.get(timeVal)\n values[timeVal] = dataPoint?.[measure] ?? null\n })\n\n // Track grouping for row spanning (when multiple measures)\n // First row of each measure group should span all dimension rows\n const isFirstInGroup = dimIndex === 0\n const measureRowSpan = isFirstInGroup && measureCount > 1 ? dimensionCount : undefined\n\n rows.push({\n id: rowId,\n measureField: measure,\n values,\n isFirstInGroup,\n dimensionRowSpan: measureRowSpan\n })\n })\n })\n\n return rows\n}\n\n/**\n * Pivots flat data into time-columned table structure\n *\n * @param data Raw data array from query result\n * @param config Pivot configuration\n * @param getFieldLabel Function to get display label for a field\n * @param meta Optional cube metadata for looking up measure types\n * @returns Pivoted table data structure\n */\nexport function pivotTableData(\n data: any[],\n config: PivotConfig,\n getFieldLabel: (field: string) => string,\n _meta?: CubeMeta | null\n): PivotedTableData {\n if (!data || data.length === 0) {\n return { isPivoted: true, columns: [], rows: [] }\n }\n\n // Extract unique time values and sort chronologically\n const timeValues = extractAndSortTimeValues(data, config.timeDimension, config.granularity)\n\n // Build column definitions\n const columns = buildColumns(config, timeValues, getFieldLabel)\n\n // Build pivoted rows\n const rows = buildPivotedRows(data, config, timeValues, getFieldLabel)\n\n return { isPivoted: true, columns, rows }\n}\n\n/**\n * Looks up the measure type from metadata\n *\n * @param measureField The fully qualified measure field name (e.g., \"Sales.revenue\")\n * @param meta Cube metadata\n * @returns The measure type (e.g., \"sum\", \"count\", \"avg\") or undefined\n */\nexport function getMeasureType(measureField: string, meta: CubeMeta | null): string | undefined {\n if (!meta?.cubes) return undefined\n\n for (const cube of meta.cubes) {\n const measure = cube.measures.find(m => m.name === measureField)\n if (measure) {\n return measure.type\n }\n }\n\n return undefined\n}\n","/**\n * Data Table component with time dimension pivoting\n *\n * When a query includes a time dimension with granularity, the table\n * automatically pivots to show time periods as columns.\n */\n\nimport React, { useMemo } from 'react'\nimport { useTranslation } from '../../hooks/useTranslation.js'\nimport { useCubeMeta } from '../../providers/CubeProvider.js'\nimport { getMeasureTypeIcon } from '../../icons/index.js'\nimport {\n hasTimeDimensionForPivot,\n pivotTableData,\n getMeasureType,\n getOrderedColumnsFromQuery,\n type PivotedTableData,\n type PivotColumn,\n type PivotRow\n} from '../../utils/pivotUtils.js'\nimport { formatAxisValue } from '../../utils/chartUtils.js'\nimport type { ChartProps, AxisFormatConfig } from '../../types.js'\n\nconst DataTable = React.memo(function DataTable({\n data,\n chartConfig,\n displayConfig = {},\n queryObject,\n height = 300\n}: ChartProps) {\n const { t } = useTranslation()\n const { getFieldLabel, meta } = useCubeMeta()\n\n // Detect if we should pivot based on query structure\n // Pass chartConfig.xAxis to respect user-configured column ordering\n const pivotConfig = useMemo(\n () => hasTimeDimensionForPivot(queryObject, chartConfig?.xAxis),\n [queryObject, chartConfig?.xAxis]\n )\n\n // Check if pivoting is enabled (default: true when time dimension present)\n const enablePivot = displayConfig?.pivotTimeDimension !== false\n\n // Compute pivoted data if applicable\n const pivotedData = useMemo<PivotedTableData | null>(() => {\n if (!pivotConfig || !enablePivot) return null\n return pivotTableData(data, pivotConfig, getFieldLabel, meta)\n }, [data, pivotConfig, enablePivot, getFieldLabel, meta])\n\n // Empty state\n if (!data || data.length === 0) {\n return (\n <div\n className=\"dc:flex dc:items-center dc:justify-center dc:w-full\"\n style={{ height }}\n >\n <div className=\"dc:text-center text-dc-text-muted\">\n <div className=\"dc:text-sm dc:font-semibold dc:mb-1\">{t('chart.runtime.noData')}</div>\n <div className=\"dc:text-xs text-dc-text-secondary\">{t('chart.runtime.noDataHint.table')}</div>\n </div>\n </div>\n )\n }\n\n // Render pivoted table if applicable\n if (pivotedData?.isPivoted && pivotedData.columns.length > 0) {\n return (\n <PivotedTable\n pivotedData={pivotedData}\n height={height}\n meta={meta}\n leftYAxisFormat={displayConfig?.leftYAxisFormat}\n />\n )\n }\n\n // Fallback to flat table rendering\n return (\n <FlatTable\n data={data}\n chartConfig={chartConfig}\n queryObject={queryObject}\n height={height}\n getFieldLabel={getFieldLabel}\n leftYAxisFormat={displayConfig?.leftYAxisFormat}\n />\n )\n})\n\nexport default DataTable\n\n/**\n * Pivoted table component - renders time dimension as columns\n */\nfunction PivotedTable({\n pivotedData,\n height,\n meta,\n leftYAxisFormat\n}: {\n pivotedData: PivotedTableData\n height: number | string\n meta: any\n leftYAxisFormat?: AxisFormatConfig\n}) {\n const { t } = useTranslation()\n const { columns, rows } = pivotedData\n\n if (columns.length === 0 || rows.length === 0) {\n return (\n <div\n className=\"dc:flex dc:items-center dc:justify-center dc:w-full\"\n style={{ height }}\n >\n <div className=\"dc:text-center text-dc-text-muted\">\n <div className=\"dc:text-sm dc:font-semibold dc:mb-1\">{t('chart.runtime.noData')}</div>\n <div className=\"dc:text-xs text-dc-text-secondary\">{t('chart.runtime.noDataHint.table')}</div>\n </div>\n </div>\n )\n }\n\n return (\n <div className=\"dc:w-full dc:overflow-auto\" style={{ height }}>\n <table className=\"dc:min-w-full dc:divide-y border-dc-border\">\n <thead className=\"bg-dc-surface-secondary dc:sticky dc:top-0\">\n <tr>\n {columns.map((col: PivotColumn) => (\n <th\n key={col.key}\n className={`dc:px-3 dc:py-2 dc:text-xs dc:font-medium text-dc-text-muted dc:uppercase dc:tracking-wider dc:whitespace-nowrap ${\n col.isTimeColumn ? 'dc:text-right' : 'dc:text-left'\n }`}\n >\n {col.label}\n </th>\n ))}\n </tr>\n </thead>\n <tbody className=\"bg-dc-surface dc:divide-y border-dc-border\">\n {rows.map((row: PivotRow) => (\n <PivotedTableRow\n key={row.id}\n row={row}\n columns={columns}\n meta={meta}\n leftYAxisFormat={leftYAxisFormat}\n />\n ))}\n </tbody>\n </table>\n </div>\n )\n}\n\n/**\n * Single row in the pivoted table\n * Supports row spanning for measure cells when grouped by measure\n */\nfunction PivotedTableRow({\n row,\n columns,\n meta,\n leftYAxisFormat\n}: {\n row: PivotRow\n columns: PivotColumn[]\n meta: any\n leftYAxisFormat?: AxisFormatConfig\n}) {\n // Get measure icon for this row\n const measureType = getMeasureType(row.measureField, meta)\n const MeasureIcon = getMeasureTypeIcon(measureType)\n\n return (\n <tr className=\"hover:bg-dc-surface-secondary\">\n {columns.map((col: PivotColumn) => {\n const value = row.values[col.key]\n\n // Measure column - show icon + label with row spanning\n if (col.isMeasureColumn) {\n // Skip this cell if not first in measure group\n if (row.isFirstInGroup === false) {\n return null\n }\n\n return (\n <td\n key={col.key}\n className=\"dc:px-3 dc:py-2 dc:whitespace-nowrap dc:text-sm text-dc-text dc:align-top\"\n rowSpan={row.dimensionRowSpan}\n >\n <div className=\"dc:flex dc:items-center\">\n <MeasureIcon className=\"dc:w-3.5 dc:h-3.5 dc:mr-1.5 text-dc-text-muted dc:shrink-0\" />\n <span>{value}</span>\n </div>\n </td>\n )\n }\n\n // Time column - right-aligned, formatted values (these are measure values)\n if (col.isTimeColumn) {\n return (\n <td\n key={col.key}\n className=\"dc:px-3 dc:py-2 dc:whitespace-nowrap dc:text-sm dc:text-right text-dc-text\"\n >\n {formatPivotCellValue(value, leftYAxisFormat)}\n </td>\n )\n }\n\n // Dimension column - left-aligned (no row spanning) - no number formatting\n return (\n <td\n key={col.key}\n className=\"dc:px-3 dc:py-2 dc:whitespace-nowrap dc:text-sm text-dc-text\"\n >\n {formatPivotCellValue(value)}\n </td>\n )\n })}\n </tr>\n )\n}\n\n/**\n * Format cell value for pivoted table display\n * Shows \"-\" for null/undefined values\n */\nfunction formatPivotCellValue(value: any, formatConfig?: AxisFormatConfig): string {\n if (value === null || value === undefined) return '-'\n if (typeof value === 'number') {\n // Use formatAxisValue if config provided\n if (formatConfig) {\n return formatAxisValue(value, formatConfig)\n }\n // Format with locale and up to 2 decimal places\n if (Number.isInteger(value)) {\n return value.toLocaleString()\n }\n return parseFloat(value.toFixed(2)).toLocaleString()\n }\n if (typeof value === 'boolean') {\n return value ? 'Yes' : 'No'\n }\n return String(value)\n}\n\n/**\n * Flat table component - original non-pivoted table rendering\n */\nfunction FlatTable({\n data,\n chartConfig,\n queryObject,\n height,\n getFieldLabel,\n leftYAxisFormat\n}: {\n data: any[]\n chartConfig?: { xAxis?: string[] }\n queryObject?: ChartProps['queryObject']\n height: number | string\n getFieldLabel: (field: string) => string\n leftYAxisFormat?: AxisFormatConfig\n}) {\n const { t } = useTranslation()\n // Get all columns available in data\n const allColumns = Object.keys(data[0] || {})\n\n // Determine column order with proper fallback:\n // 1. If xAxis is configured, use that order\n // 2. Otherwise, derive order from queryObject (dimensions + timeDimensions + measures)\n // 3. Fallback: Object.keys order\n const columns = useMemo(() => {\n // If xAxis is configured, use that order (filtered to existing columns)\n if (chartConfig?.xAxis && chartConfig.xAxis.length > 0) {\n return chartConfig.xAxis.filter(col => allColumns.includes(col))\n }\n\n // Derive order from queryObject\n const queryOrder = getOrderedColumnsFromQuery(queryObject)\n if (queryOrder.length > 0) {\n // Filter to only columns that exist in data\n const ordered = queryOrder.filter(col => allColumns.includes(col))\n // Add any columns in data that weren't in query (edge case)\n const remaining = allColumns.filter(col => !ordered.includes(col))\n return [...ordered, ...remaining]\n }\n\n // Final fallback: Object.keys order\n return allColumns\n }, [chartConfig?.xAxis, queryObject, allColumns])\n\n if (columns.length === 0) {\n return (\n <div\n className=\"dc:flex dc:items-center dc:justify-center dc:w-full\"\n style={{ height }}\n >\n <div className=\"dc:text-center text-dc-text-muted\">\n <div className=\"dc:text-sm dc:font-semibold dc:mb-1\">No columns available</div>\n <div className=\"dc:text-xs text-dc-text-secondary\">{t('chart.runtime.table.invalidStructure')}</div>\n </div>\n </div>\n )\n }\n\n return (\n <div className=\"dc:w-full dc:overflow-auto\" style={{ height }}>\n <table className=\"dc:min-w-full dc:divide-y border-dc-border\">\n <thead className=\"bg-dc-surface-secondary dc:sticky dc:top-0\">\n <tr>\n {columns.map((column) => (\n <th\n key={column}\n className=\"dc:px-3 dc:py-2 dc:text-left dc:text-xs dc:font-medium text-dc-text-muted dc:uppercase dc:tracking-wider\"\n >\n {getFieldLabel(column)}\n </th>\n ))}\n </tr>\n </thead>\n <tbody className=\"bg-dc-surface dc:divide-y border-dc-border\">\n {data.map((row, index) => (\n <tr key={index} className=\"hover:bg-dc-surface-secondary\">\n {columns.map((column) => (\n <td\n key={column}\n className=\"dc:px-3 dc:py-2 dc:whitespace-nowrap dc:text-sm text-dc-text\"\n >\n {formatCellValue(row[column], leftYAxisFormat)}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )\n}\n\n/**\n * Format cell value for flat table display\n */\nfunction formatCellValue(value: any, formatConfig?: AxisFormatConfig): string {\n if (value == null) return ''\n if (typeof value === 'number') {\n // Use formatAxisValue if config provided\n if (formatConfig) {\n return formatAxisValue(value, formatConfig)\n }\n return value.toLocaleString()\n }\n if (typeof value === 'boolean') {\n return value ? 'Yes' : 'No'\n }\n return String(value)\n}\n"],"x_google_ignoreList":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GA,SAAgB,GACd,GACA,GACuB;CACvB,QAAQ,KAAW,CAAC,EAAA,CAAG,QAAQ,OAAY,EAAO,aAAa,eAAe,CAAS;AACzF;AA+GA,IAAa,KAAsC;CACjD,WAAW;EACT;GACE,KAAK;GACL,OAAO;GACP,aAAa;GACb,WAAW;GACX,aAAa,CAAC,aAAa,eAAe;GAC1C,WAAW;EACb;EACA;GACE,KAAK;GACL,OAAO;GACP,aAAa;GACb,WAAW;GACX,aAAa,CAAC,WAAW,WAAW;GACpC,WAAW;EACb;EACA;GACE,KAAK;GACL,OAAO;GACP,aAAa;GACb,WAAW;GACX,aAAa,CAAC,WAAW;GACzB,WAAW;EACb;CACF;CACA,gBAAgB;EAAC;EAAc;EAAY;CAAa;AAC1D,GC/NM,IAAe;CAAE,aAAa;CAAY,gBAAgB;AAAuB,GAuC1E,IAA8D;CACzE,KAAK;EACH,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS;EACT,aAAa;EACb,cAAc;EACd,QAAQ,aAAa,MAAM,OAAO,iCAAA,CAAA,MAAA,MAAA,EAAA,CAAA,EAAA,CAA4C;CAChF;CACA,MAAM;EACJ,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS;EACT,aAAa;EACb,cAAc;EACd,QAAQ,aAAa,MAAM,OAAO,kCAAA,CAAA,MAAA,MAAA,EAAA,CAAA,EAAA,CAA6C;CACjF;CACA,MAAM;EACJ,OAAO;EACP,MAAM;EACN,aAA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