@carto/ps-react-ui 4.3.0-widgets.0 → 5.0.0-widgets.2

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 (277) hide show
  1. package/dist/components.js +25 -23
  2. package/dist/components.js.map +1 -1
  3. package/dist/error-zHOU_QIB.js +38 -0
  4. package/dist/error-zHOU_QIB.js.map +1 -0
  5. package/dist/exports-Cr43OCul.js +51 -0
  6. package/dist/exports-Cr43OCul.js.map +1 -0
  7. package/dist/{lasso-tool-BC-rsMMW.js → lasso-tool-CYn3ivf-.js} +165 -183
  8. package/dist/lasso-tool-CYn3ivf-.js.map +1 -0
  9. package/dist/no-data-Cz80hEWj.js +61 -0
  10. package/dist/no-data-Cz80hEWj.js.map +1 -0
  11. package/dist/options-D9wflre6.js +49 -0
  12. package/dist/options-D9wflre6.js.map +1 -0
  13. package/dist/row-C_m1ovHv.js +35 -0
  14. package/dist/row-C_m1ovHv.js.map +1 -0
  15. package/dist/series-6xp-KQ0S.js +91 -0
  16. package/dist/series-6xp-KQ0S.js.map +1 -0
  17. package/dist/{smart-tooltip-BSlcAkBM.js → smart-tooltip-BEtBaIdz.js} +2 -2
  18. package/dist/{smart-tooltip-BSlcAkBM.js.map → smart-tooltip-BEtBaIdz.js.map} +1 -1
  19. package/dist/styles-dOu_pRNb.js +77 -0
  20. package/dist/styles-dOu_pRNb.js.map +1 -0
  21. package/dist/tooltip-BDnrRKrp.js +25 -0
  22. package/dist/tooltip-BDnrRKrp.js.map +1 -0
  23. package/dist/types/hooks/index.d.ts +2 -0
  24. package/dist/types/hooks/use-debounce.d.ts +19 -0
  25. package/dist/types/hooks/use-widget-ref.d.ts +17 -0
  26. package/dist/types/widgets/_shared/chart-config/config-factory.d.ts +5 -11
  27. package/dist/types/widgets/_shared/chart-config/option-builders.d.ts +3 -8
  28. package/dist/types/widgets/actions/change-column/change-column-icon.d.ts +1 -0
  29. package/dist/types/widgets/actions/change-column/change-column.d.ts +16 -0
  30. package/dist/types/widgets/actions/change-column/sortable-column-item.d.ts +9 -0
  31. package/dist/types/widgets/actions/change-column/types.d.ts +19 -0
  32. package/dist/types/widgets/actions/download/download.d.ts +1 -1
  33. package/dist/types/widgets/actions/download/exports.d.ts +1 -1
  34. package/dist/types/widgets/actions/download/types.d.ts +3 -11
  35. package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +1 -1
  36. package/dist/types/widgets/actions/fullscreen/styles.d.ts +6 -0
  37. package/dist/types/widgets/actions/fullscreen/types.d.ts +8 -9
  38. package/dist/types/widgets/actions/index.d.ts +14 -1
  39. package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +19 -0
  40. package/dist/types/widgets/actions/lock-selection/types.d.ts +38 -0
  41. package/dist/types/widgets/actions/relative-data/relative-data.d.ts +18 -0
  42. package/dist/types/widgets/actions/relative-data/style.d.ts +8 -0
  43. package/dist/types/widgets/actions/relative-data/types.d.ts +27 -0
  44. package/dist/types/widgets/actions/relative-data/utils.d.ts +9 -0
  45. package/dist/types/widgets/actions/relative-data/utils.test.d.ts +1 -0
  46. package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +18 -0
  47. package/dist/types/widgets/actions/searcher/searcher.d.ts +21 -0
  48. package/dist/types/widgets/actions/searcher/types.d.ts +64 -0
  49. package/dist/types/widgets/actions/shared/styles.d.ts +11 -0
  50. package/dist/types/widgets/actions/stack-toggle/grouped-bar-chart-icon.d.ts +1 -0
  51. package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +16 -0
  52. package/dist/types/widgets/actions/stack-toggle/types.d.ts +25 -0
  53. package/dist/types/widgets/actions/zoom-toggle/index.d.ts +2 -0
  54. package/dist/types/widgets/actions/zoom-toggle/style.d.ts +13 -0
  55. package/dist/types/widgets/actions/zoom-toggle/types.d.ts +41 -0
  56. package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +18 -0
  57. package/dist/types/widgets/bar/config.d.ts +5 -4
  58. package/dist/types/widgets/bar/index.d.ts +2 -2
  59. package/dist/types/widgets/bar/types.d.ts +6 -12
  60. package/dist/types/widgets/category/category-ui.d.ts +2 -0
  61. package/dist/types/widgets/category/components/category-bar.d.ts +7 -0
  62. package/dist/types/widgets/category/components/category-legend.d.ts +6 -0
  63. package/dist/types/widgets/category/components/category-row-multi.d.ts +11 -0
  64. package/dist/types/widgets/category/components/category-row-other.d.ts +6 -0
  65. package/dist/types/widgets/category/components/category-row-single.d.ts +11 -0
  66. package/dist/types/widgets/category/components/index.d.ts +10 -0
  67. package/dist/types/widgets/category/config.d.ts +15 -0
  68. package/dist/types/widgets/category/index.d.ts +6 -0
  69. package/dist/types/widgets/category/skeleton.d.ts +1 -0
  70. package/dist/types/widgets/category/style.d.ts +121 -0
  71. package/dist/types/widgets/category/types.d.ts +33 -0
  72. package/dist/types/widgets/echart/echart-ui.d.ts +1 -1
  73. package/dist/types/widgets/echart/index.d.ts +2 -2
  74. package/dist/types/widgets/echart/options.d.ts +2 -3
  75. package/dist/types/widgets/echart/types.d.ts +11 -10
  76. package/dist/types/widgets/echart/utils.d.ts +22 -16
  77. package/dist/types/widgets/error/error.d.ts +2 -0
  78. package/dist/types/widgets/error/index.d.ts +2 -0
  79. package/dist/types/widgets/error/types.d.ts +12 -0
  80. package/dist/types/widgets/formula/components/row.d.ts +1 -1
  81. package/dist/types/widgets/formula/config.d.ts +4 -2
  82. package/dist/types/widgets/formula/index.d.ts +2 -1
  83. package/dist/types/widgets/formula/types.d.ts +6 -18
  84. package/dist/types/widgets/histogram/config.d.ts +5 -4
  85. package/dist/types/widgets/histogram/index.d.ts +2 -2
  86. package/dist/types/widgets/histogram/types.d.ts +6 -12
  87. package/dist/types/widgets/index.d.ts +6 -4
  88. package/dist/types/widgets/markdown/config.d.ts +4 -2
  89. package/dist/types/widgets/markdown/index.d.ts +2 -2
  90. package/dist/types/widgets/markdown/markdown-ui.d.ts +1 -1
  91. package/dist/types/widgets/markdown/types.d.ts +6 -16
  92. package/dist/types/widgets/no-data/index.d.ts +2 -0
  93. package/dist/types/widgets/no-data/no-data.d.ts +35 -0
  94. package/dist/types/widgets/no-data/style.d.ts +6 -0
  95. package/dist/types/widgets/no-data/types.d.ts +67 -0
  96. package/dist/types/widgets/note/note.d.ts +1 -1
  97. package/dist/types/widgets/note/style.d.ts +12 -1
  98. package/dist/types/widgets/note/types.d.ts +4 -3
  99. package/dist/types/widgets/pie/config.d.ts +5 -4
  100. package/dist/types/widgets/pie/index.d.ts +2 -2
  101. package/dist/types/widgets/pie/types.d.ts +6 -12
  102. package/dist/types/widgets/range/config.d.ts +6 -2
  103. package/dist/types/widgets/range/index.d.ts +2 -1
  104. package/dist/types/widgets/range/types.d.ts +6 -17
  105. package/dist/types/widgets/root/index.d.ts +2 -1
  106. package/dist/types/widgets/root/root.d.ts +1 -1
  107. package/dist/types/widgets/root/types.d.ts +6 -12
  108. package/dist/types/widgets/root/utils.d.ts +1 -0
  109. package/dist/types/widgets/scatterplot/config.d.ts +5 -4
  110. package/dist/types/widgets/scatterplot/index.d.ts +2 -2
  111. package/dist/types/widgets/scatterplot/types.d.ts +6 -12
  112. package/dist/types/widgets/selection-summary/index.d.ts +2 -0
  113. package/dist/types/widgets/selection-summary/selection-summary.d.ts +2 -0
  114. package/dist/types/widgets/selection-summary/style.d.ts +9 -0
  115. package/dist/types/widgets/selection-summary/types.d.ts +13 -0
  116. package/dist/types/widgets/spread/config.d.ts +10 -2
  117. package/dist/types/widgets/spread/index.d.ts +2 -1
  118. package/dist/types/widgets/spread/types.d.ts +6 -18
  119. package/dist/types/widgets/stores/index.d.ts +2 -0
  120. package/dist/types/widgets/stores/types.d.ts +179 -12
  121. package/dist/types/widgets/stores/widget-store.d.ts +2 -27
  122. package/dist/types/widgets/subheader/index.d.ts +2 -0
  123. package/dist/types/widgets/subheader/style.d.ts +19 -0
  124. package/dist/types/widgets/subheader/subheader.d.ts +2 -0
  125. package/dist/types/widgets/subheader/types.d.ts +10 -0
  126. package/dist/types/widgets/table/components/cell-header.d.ts +5 -0
  127. package/dist/types/widgets/table/components/cell.d.ts +16 -0
  128. package/dist/types/widgets/table/components/index.d.ts +4 -0
  129. package/dist/types/widgets/table/components/pagination-actions.d.ts +5 -0
  130. package/dist/types/widgets/table/components/pagination.d.ts +5 -0
  131. package/dist/types/widgets/table/components/row.d.ts +5 -0
  132. package/dist/types/widgets/table/config.d.ts +11 -0
  133. package/dist/types/widgets/table/helpers.d.ts +38 -0
  134. package/dist/types/widgets/table/helpers.test.d.ts +1 -0
  135. package/dist/types/widgets/table/hooks/index.d.ts +6 -0
  136. package/dist/types/widgets/table/hooks/use-pagination.d.ts +45 -0
  137. package/dist/types/widgets/table/hooks/use-pagination.test.d.ts +1 -0
  138. package/dist/types/widgets/table/hooks/use-selection.d.ts +32 -0
  139. package/dist/types/widgets/table/hooks/use-selection.test.d.ts +1 -0
  140. package/dist/types/widgets/table/hooks/use-sort.d.ts +29 -0
  141. package/dist/types/widgets/table/hooks/use-sort.test.d.ts +1 -0
  142. package/dist/types/widgets/table/index.d.ts +13 -0
  143. package/dist/types/widgets/table/serializer.d.ts +16 -0
  144. package/dist/types/widgets/table/skeleton.d.ts +10 -0
  145. package/dist/types/widgets/table/style.d.ts +33 -0
  146. package/dist/types/widgets/table/table-ui.d.ts +32 -0
  147. package/dist/types/widgets/table/types.d.ts +201 -0
  148. package/dist/types/widgets/timeseries/config.d.ts +5 -4
  149. package/dist/types/widgets/timeseries/index.d.ts +2 -2
  150. package/dist/types/widgets/timeseries/types.d.ts +6 -12
  151. package/dist/types/widgets/toolbar-actions/index.d.ts +2 -0
  152. package/dist/types/widgets/toolbar-actions/styles.d.ts +37 -0
  153. package/dist/types/widgets/toolbar-actions/toolbar-actions.d.ts +8 -0
  154. package/dist/types/widgets/toolbar-actions/types.d.ts +45 -0
  155. package/dist/types/widgets/wrapper/index.d.ts +2 -2
  156. package/dist/types/widgets/wrapper/styles.d.ts +6 -0
  157. package/dist/types/widgets/wrapper/types.d.ts +7 -5
  158. package/dist/types/widgets/wrapper/wrapper-ui.d.ts +1 -1
  159. package/dist/types/widgets/wrapper/wrapper.d.ts +1 -1
  160. package/dist/utils-Dv5Z47UQ.js +144 -0
  161. package/dist/utils-Dv5Z47UQ.js.map +1 -0
  162. package/dist/widget-store-DNyVElxd.js +190 -0
  163. package/dist/widget-store-DNyVElxd.js.map +1 -0
  164. package/dist/widgets/actions.js +826 -6
  165. package/dist/widgets/actions.js.map +1 -1
  166. package/dist/widgets/bar.js +189 -4
  167. package/dist/widgets/bar.js.map +1 -1
  168. package/dist/widgets/category.js +460 -0
  169. package/dist/widgets/category.js.map +1 -0
  170. package/dist/widgets/echart.js +120 -8
  171. package/dist/widgets/echart.js.map +1 -1
  172. package/dist/widgets/error.js +5 -0
  173. package/dist/widgets/error.js.map +1 -0
  174. package/dist/widgets/formula.js +117 -20
  175. package/dist/widgets/formula.js.map +1 -1
  176. package/dist/widgets/histogram.js +172 -4
  177. package/dist/widgets/histogram.js.map +1 -1
  178. package/dist/widgets/markdown.js +127 -0
  179. package/dist/widgets/markdown.js.map +1 -0
  180. package/dist/widgets/no-data.js +5 -0
  181. package/dist/widgets/no-data.js.map +1 -0
  182. package/dist/widgets/note.js +121 -2
  183. package/dist/widgets/note.js.map +1 -1
  184. package/dist/widgets/pie.js +213 -4
  185. package/dist/widgets/pie.js.map +1 -1
  186. package/dist/widgets/range.js +210 -12
  187. package/dist/widgets/range.js.map +1 -1
  188. package/dist/widgets/root.js +65 -2
  189. package/dist/widgets/root.js.map +1 -1
  190. package/dist/widgets/scatterplot.js +219 -4
  191. package/dist/widgets/scatterplot.js.map +1 -1
  192. package/dist/widgets/selection-summary.js +40 -0
  193. package/dist/widgets/selection-summary.js.map +1 -0
  194. package/dist/widgets/skeleton-loader.js +21 -2
  195. package/dist/widgets/skeleton-loader.js.map +1 -1
  196. package/dist/widgets/spread.js +162 -17
  197. package/dist/widgets/spread.js.map +1 -1
  198. package/dist/widgets/stores.js +5 -0
  199. package/dist/widgets/stores.js.map +1 -0
  200. package/dist/widgets/subheader.js +52 -0
  201. package/dist/widgets/subheader.js.map +1 -0
  202. package/dist/widgets/table.js +691 -0
  203. package/dist/widgets/table.js.map +1 -0
  204. package/dist/widgets/timeseries.js +171 -4
  205. package/dist/widgets/timeseries.js.map +1 -1
  206. package/dist/widgets/toolbar-actions.js +6106 -0
  207. package/dist/widgets/toolbar-actions.js.map +1 -0
  208. package/dist/widgets/wrapper.js +292 -6
  209. package/dist/widgets/wrapper.js.map +1 -1
  210. package/dist/widgets.js +6 -83
  211. package/dist/widgets.js.map +1 -1
  212. package/package.json +46 -6
  213. package/dist/const-BLV7Tvte.js +0 -758
  214. package/dist/const-BLV7Tvte.js.map +0 -1
  215. package/dist/download-KroQ0SWg.js +0 -195
  216. package/dist/download-KroQ0SWg.js.map +0 -1
  217. package/dist/echart-CqfROFu3.js +0 -214
  218. package/dist/echart-CqfROFu3.js.map +0 -1
  219. package/dist/formula-ui-ChzvMEOG.js +0 -52
  220. package/dist/formula-ui-ChzvMEOG.js.map +0 -1
  221. package/dist/lasso-tool-BC-rsMMW.js.map +0 -1
  222. package/dist/markdown-n_tOtoiT.js +0 -27
  223. package/dist/markdown-n_tOtoiT.js.map +0 -1
  224. package/dist/markdown-ui-BBrzzd7Y.js +0 -62
  225. package/dist/markdown-ui-BBrzzd7Y.js.map +0 -1
  226. package/dist/note-DF-n70TX.js +0 -101
  227. package/dist/note-DF-n70TX.js.map +0 -1
  228. package/dist/range-ui-CtUX11Xm.js +0 -146
  229. package/dist/range-ui-CtUX11Xm.js.map +0 -1
  230. package/dist/root-L_WZnJY5.js +0 -46
  231. package/dist/root-L_WZnJY5.js.map +0 -1
  232. package/dist/row-DQaSxmDV.js +0 -18
  233. package/dist/row-DQaSxmDV.js.map +0 -1
  234. package/dist/series-CsyEPq-X.js +0 -83
  235. package/dist/series-CsyEPq-X.js.map +0 -1
  236. package/dist/skeleton-BSPcEvfq.js +0 -27
  237. package/dist/skeleton-BSPcEvfq.js.map +0 -1
  238. package/dist/skeleton-C4rOYTy-.js +0 -78
  239. package/dist/skeleton-C4rOYTy-.js.map +0 -1
  240. package/dist/skeleton-C9Jqc241.js +0 -82
  241. package/dist/skeleton-C9Jqc241.js.map +0 -1
  242. package/dist/skeleton-D-zHBBIw.js +0 -64
  243. package/dist/skeleton-D-zHBBIw.js.map +0 -1
  244. package/dist/skeleton-DMP-IwaJ.js +0 -109
  245. package/dist/skeleton-DMP-IwaJ.js.map +0 -1
  246. package/dist/skeleton-DRorqowB.js +0 -22
  247. package/dist/skeleton-DRorqowB.js.map +0 -1
  248. package/dist/skeleton-DsZhv-AH.js +0 -89
  249. package/dist/skeleton-DsZhv-AH.js.map +0 -1
  250. package/dist/skeleton-Dx3FCer0.js +0 -13
  251. package/dist/skeleton-Dx3FCer0.js.map +0 -1
  252. package/dist/skeleton-QVDdb1c2.js +0 -21
  253. package/dist/skeleton-QVDdb1c2.js.map +0 -1
  254. package/dist/skeleton-loader-DWC1-EAx.js +0 -23
  255. package/dist/skeleton-loader-DWC1-EAx.js.map +0 -1
  256. package/dist/spread-ui-BjzH190y.js +0 -82
  257. package/dist/spread-ui-BjzH190y.js.map +0 -1
  258. package/dist/style-BGeCtQkP.js +0 -19
  259. package/dist/style-BGeCtQkP.js.map +0 -1
  260. package/dist/style-C7v1iwqD.js +0 -34
  261. package/dist/style-C7v1iwqD.js.map +0 -1
  262. package/dist/styles-cohnxh9F.js +0 -23
  263. package/dist/styles-cohnxh9F.js.map +0 -1
  264. package/dist/types/widgets/config-loader/index.d.ts +0 -2
  265. package/dist/types/widgets/config-loader/types.d.ts +0 -12
  266. package/dist/types/widgets/config-loader/use-config.d.ts +0 -5
  267. package/dist/types/widgets/widget/const.d.ts +0 -2
  268. package/dist/types/widgets/widget/types.d.ts +0 -47
  269. package/dist/types/widgets/widget/widget.d.ts +0 -2
  270. package/dist/use-config-BYEOiIcu.js +0 -43
  271. package/dist/use-config-BYEOiIcu.js.map +0 -1
  272. package/dist/widget-store-yDO2ul8g.js +0 -44
  273. package/dist/widget-store-yDO2ul8g.js.map +0 -1
  274. package/dist/widgets/config-loader.js +0 -5
  275. package/dist/widgets/config-loader.js.map +0 -1
  276. package/dist/wrapper-57csMybC.js +0 -265
  277. package/dist/wrapper-57csMybC.js.map +0 -1
@@ -0,0 +1,51 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import a from "html2canvas";
3
+ import { ImageOutlined as l } from "@mui/icons-material";
4
+ import { SvgIcon as s } from "@mui/material";
5
+ function d(e) {
6
+ const t = e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e);
7
+ return /[",\n]/.test(t) ? `"${t.replace(/"/g, '""')}"` : t;
8
+ }
9
+ async function h(e) {
10
+ const t = e.map((n) => n.map(d).join(",")).join(`
11
+ `), o = new Blob([t], {
12
+ type: "text/csv;charset=utf-8;"
13
+ });
14
+ return Promise.resolve(URL.createObjectURL(o));
15
+ }
16
+ const g = {
17
+ id: "csv",
18
+ label: "CSV",
19
+ icon: /* @__PURE__ */ c(s, { children: /* @__PURE__ */ c("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", fill: "none", viewBox: "0 0 18 18", children: /* @__PURE__ */ c("path", { fill: "currentColor", d: "M4.313 11.25h2.25v-1.125H4.688v-2.25h1.875V6.75h-2.25a.726.726 0 0 0-.535.216.726.726 0 0 0-.216.534v3c0 .213.072.39.216.534a.726.726 0 0 0 .534.216Zm2.925 0h2.25c.212 0 .39-.072.534-.216a.726.726 0 0 0 .216-.534V9.375a.931.931 0 0 0-.216-.59.658.658 0 0 0-.534-.273H8.363v-.637h1.875V6.75h-2.25a.726.726 0 0 0-.535.216.726.726 0 0 0-.216.534v1.125c0 .213.072.403.216.572a.675.675 0 0 0 .534.253h1.126v.675H7.238v1.125Zm4.95 0h1.124l1.313-4.5H13.5l-.75 2.588L12 6.75h-1.125l1.313 4.5ZM3 15c-.413 0-.766-.147-1.06-.44a1.445 1.445 0 0 1-.44-1.06v-9c0-.412.147-.766.44-1.06C2.235 3.148 2.588 3 3 3h12c.412 0 .766.147 1.06.44.293.294.44.648.44 1.06v9c0 .412-.147.766-.44 1.06-.294.293-.647.44-1.06.44H3Zm0-1.5h12v-9H3v9Z" }) }) }),
20
+ modifier: h,
21
+ callback: (e) => {
22
+ URL.revokeObjectURL(e);
23
+ }
24
+ };
25
+ async function m(e) {
26
+ if (!e || typeof e == "function" || !e.current) {
27
+ console.warn("[CARTO downloadFileToPNG] Invalid ref passed to downloadFileToPNG. Expected a React ref object with a .current property pointing to an HTMLElement. Download aborted.");
28
+ return;
29
+ }
30
+ const o = e.current.cloneNode(!0);
31
+ o.querySelector(".widget-toolbar-container")?.remove(), o.querySelector(".widget-wrapper-actions")?.remove(), document.body.appendChild(o);
32
+ const n = o.getBoundingClientRect(), r = {
33
+ useCORS: !0,
34
+ scale: 2,
35
+ backgroundColor: "#fff",
36
+ width: n.width,
37
+ height: n.height
38
+ }, i = (await a(o, r)).toDataURL("image/png");
39
+ return document.body.removeChild(o), Promise.resolve(i);
40
+ }
41
+ const b = {
42
+ id: "png",
43
+ label: "PNG",
44
+ icon: /* @__PURE__ */ c(l, {}),
45
+ modifier: m
46
+ };
47
+ export {
48
+ g as a,
49
+ b as d
50
+ };
51
+ //# sourceMappingURL=exports-Cr43OCul.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports-Cr43OCul.js","sources":["../src/widgets/actions/download/exports.tsx"],"sourcesContent":["import type { Ref } from 'react'\nimport type { DownloadItem } from './types'\nimport html2canvas from 'html2canvas'\nimport { ImageOutlined } from '@mui/icons-material'\nimport { SvgIcon } from '@mui/material'\n\n// Helper to escape CSV cell values\nfunction escapeCSVCell<D>(value: D): string {\n const str =\n value == null\n ? ''\n : typeof value === 'object'\n ? JSON.stringify(value)\n : String(value)\n\n // If the value contains a comma, quote, or newline, wrap in quotes and escape quotes\n if (/[\",\\n]/.test(str)) {\n return `\"${str.replace(/\"/g, '\"\"')}\"`\n }\n return str\n}\n\nasync function downloadFileToCSV<D>(data: D[][]) {\n const csvContent = data\n .map((row) => row.map(escapeCSVCell<D>).join(','))\n .join('\\n')\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })\n return Promise.resolve(URL.createObjectURL(blob))\n}\n\nexport const downloadToCSV: DownloadItem<unknown[][]> = {\n id: 'csv',\n label: 'CSV',\n icon: (\n <SvgIcon>\n <svg\n xmlns='http://www.w3.org/2000/svg'\n width='18'\n height='18'\n fill='none'\n viewBox='0 0 18 18'\n >\n <path\n fill='currentColor'\n d='M4.313 11.25h2.25v-1.125H4.688v-2.25h1.875V6.75h-2.25a.726.726 0 0 0-.535.216.726.726 0 0 0-.216.534v3c0 .213.072.39.216.534a.726.726 0 0 0 .534.216Zm2.925 0h2.25c.212 0 .39-.072.534-.216a.726.726 0 0 0 .216-.534V9.375a.931.931 0 0 0-.216-.59.658.658 0 0 0-.534-.273H8.363v-.637h1.875V6.75h-2.25a.726.726 0 0 0-.535.216.726.726 0 0 0-.216.534v1.125c0 .213.072.403.216.572a.675.675 0 0 0 .534.253h1.126v.675H7.238v1.125Zm4.95 0h1.124l1.313-4.5H13.5l-.75 2.588L12 6.75h-1.125l1.313 4.5ZM3 15c-.413 0-.766-.147-1.06-.44a1.445 1.445 0 0 1-.44-1.06v-9c0-.412.147-.766.44-1.06C2.235 3.148 2.588 3 3 3h12c.412 0 .766.147 1.06.44.293.294.44.648.44 1.06v9c0 .412-.147.766-.44 1.06-.294.293-.647.44-1.06.44H3Zm0-1.5h12v-9H3v9Z'\n />\n </svg>\n </SvgIcon>\n ),\n modifier: downloadFileToCSV,\n callback: (data) => {\n URL.revokeObjectURL(data)\n },\n}\n\nasync function downloadFileToPNG(ref: Ref<HTMLElement | null> | undefined) {\n if (!ref || typeof ref === 'function' || !ref.current) {\n // eslint-disable-next-line no-console\n console.warn(\n '[CARTO downloadFileToPNG] Invalid ref passed to downloadFileToPNG. ' +\n 'Expected a React ref object with a .current property pointing to an HTMLElement. ' +\n 'Download aborted.',\n )\n return\n }\n\n const element = ref.current\n const clone = element.cloneNode(true) as HTMLElement\n\n clone.querySelector('.widget-toolbar-container')?.remove()\n clone.querySelector('.widget-wrapper-actions')?.remove()\n\n document.body.appendChild(clone)\n\n const rect = clone.getBoundingClientRect()\n\n const opts = {\n useCORS: true,\n scale: 2,\n backgroundColor: '#fff',\n width: rect.width,\n height: rect.height,\n }\n\n const canvasResult: HTMLCanvasElement = await html2canvas(clone, opts)\n\n const result = canvasResult.toDataURL('image/png')\n\n document.body.removeChild(clone)\n\n return Promise.resolve(result)\n}\n\nexport const downloadToPNG: Omit<DownloadItem, 'modifier'> & {\n modifier: (\n ref: Ref<HTMLElement | null> | undefined,\n ) => Promise<string | undefined>\n} = {\n id: 'png',\n label: 'PNG',\n icon: <ImageOutlined />,\n modifier: downloadFileToPNG,\n}\n"],"names":["escapeCSVCell","value","str","JSON","stringify","String","test","replace","downloadFileToCSV","data","csvContent","map","row","join","blob","Blob","type","Promise","resolve","URL","createObjectURL","downloadToCSV","id","label","icon","SvgIcon","jsx","modifier","callback","revokeObjectURL","downloadFileToPNG","ref","current","console","warn","clone","cloneNode","querySelector","remove","document","body","appendChild","rect","getBoundingClientRect","opts","useCORS","scale","backgroundColor","width","height","result","html2canvas","toDataURL","removeChild","downloadToPNG","ImageOutlined"],"mappings":";;;;AAOA,SAASA,EAAiBC,GAAkB;AAC1C,QAAMC,IACJD,KAAS,OACL,KACA,OAAOA,KAAU,WACfE,KAAKC,UAAUH,CAAK,IACpBI,OAAOJ,CAAK;AAGpB,SAAI,SAASK,KAAKJ,CAAG,IACZ,IAAIA,EAAIK,QAAQ,MAAM,IAAI,CAAC,MAE7BL;AACT;AAEA,eAAeM,EAAqBC,GAAa;AAC/C,QAAMC,IAAaD,EAChBE,IAAKC,CAAAA,MAAQA,EAAID,IAAIX,CAAgB,EAAEa,KAAK,GAAG,CAAC,EAChDA,KAAK;AAAA,CAAI,GACNC,IAAO,IAAIC,KAAK,CAACL,CAAU,GAAG;AAAA,IAAEM,MAAM;AAAA,EAAA,CAA2B;AACvE,SAAOC,QAAQC,QAAQC,IAAIC,gBAAgBN,CAAI,CAAC;AAClD;AAEO,MAAMO,IAA2C;AAAA,EACtDC,IAAI;AAAA,EACJC,OAAO;AAAA,EACPC,wBACGC,GAAA,EACC,UAAA,gBAAAC,EAAC,SACC,OAAM,8BACN,OAAM,MACN,QAAO,MACP,MAAK,QACL,SAAQ,aAER,UAAA,gBAAAA,EAAC,QAAA,EACC,MAAK,gBACL,GAAE,+sBAAA,CAA8sB,EAAA,CAEptB,EAAA,CACF;AAAA,EAEFC,UAAUnB;AAAAA,EACVoB,UAAWnB,CAAAA,MAAS;AAClBU,QAAIU,gBAAgBpB,CAAI;AAAA,EAC1B;AACF;AAEA,eAAeqB,EAAkBC,GAA0C;AACzE,MAAI,CAACA,KAAO,OAAOA,KAAQ,cAAc,CAACA,EAAIC,SAAS;AAErDC,YAAQC,KACN,uKAGF;AACA;AAAA,EACF;AAGA,QAAMC,IADUJ,EAAIC,QACEI,UAAU,EAAI;AAEpCD,EAAAA,EAAME,cAAc,2BAA2B,GAAGC,OAAAA,GAClDH,EAAME,cAAc,yBAAyB,GAAGC,OAAAA,GAEhDC,SAASC,KAAKC,YAAYN,CAAK;AAE/B,QAAMO,IAAOP,EAAMQ,sBAAAA,GAEbC,IAAO;AAAA,IACXC,SAAS;AAAA,IACTC,OAAO;AAAA,IACPC,iBAAiB;AAAA,IACjBC,OAAON,EAAKM;AAAAA,IACZC,QAAQP,EAAKO;AAAAA,EAAAA,GAKTC,KAFkC,MAAMC,EAAYhB,GAAOS,CAAI,GAEzCQ,UAAU,WAAW;AAEjDb,kBAASC,KAAKa,YAAYlB,CAAK,GAExBlB,QAAQC,QAAQgC,CAAM;AAC/B;AAEO,MAAMI,IAIT;AAAA,EACFhC,IAAI;AAAA,EACJC,OAAO;AAAA,EACPC,wBAAO+B,GAAA,EAAa;AAAA,EACpB5B,UAAUG;AACZ;"}
@@ -1,62 +1,46 @@
1
- import { jsx as i, jsxs as x, Fragment as R } from "react/jsx-runtime";
2
- import { c as v } from "react/compiler-runtime";
3
- import { ArrowDropDown as te, MoreVertOutlined as oe } from "@mui/icons-material";
4
- import { Tooltip as le, Chip as ie, Paper as ne, IconButton as re, Menu as ae, Box as ce, Divider as H, MenuItem as z, ListItemIcon as se, SvgIcon as de, ListItemText as ue, ToggleButton as pe, Typography as F } from "@mui/material";
5
- import { d as q } from "./cjs-D9ro6BXv.js";
6
- import { useState as ge, useMemo as J } from "react";
7
- let K = 500;
8
- function Q(t) {
9
- const e = v(10);
10
- let l, o, n, a;
11
- e[0] !== t ? ({
12
- children: l,
13
- title: a,
14
- enterNextDelay: n,
15
- ...o
16
- } = t, e[0] = t, e[1] = l, e[2] = o, e[3] = n, e[4] = a) : (l = e[1], o = e[2], n = e[3], a = e[4]);
17
- const r = n === void 0 ? K : n;
18
- let c;
19
- return e[5] !== l || e[6] !== r || e[7] !== o || e[8] !== a ? (c = /* @__PURE__ */ i(le, { title: a, enterNextDelay: r, ...o, children: l }), e[5] = l, e[6] = r, e[7] = o, e[8] = a, e[9] = c) : c = e[9], c;
20
- }
21
- function Le(t) {
22
- K = t;
23
- }
24
- function he(t) {
25
- const e = v(3);
1
+ import { jsx as i, jsxs as T, Fragment as R } from "react/jsx-runtime";
2
+ import { c as b } from "react/compiler-runtime";
3
+ import { ArrowDropDown as ee, MoreVertOutlined as te } from "@mui/icons-material";
4
+ import { Chip as oe, Paper as le, IconButton as ie, Menu as ne, Box as re, Divider as H, MenuItem as z, ListItemIcon as ae, SvgIcon as ce, ListItemText as se, ToggleButton as de, Typography as q } from "@mui/material";
5
+ import { d as N } from "./cjs-D9ro6BXv.js";
6
+ import { useState as ue, useMemo as J } from "react";
7
+ import { T as K } from "./tooltip-BDnrRKrp.js";
8
+ function ge(t) {
9
+ const e = b(3);
26
10
  let l;
27
11
  e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm16 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm-2.829 1a2.996 2.996 0 0 0 0 2H6.829a2.995 2.995 0 0 0 0-2h10.342Zm-2.463-5.707 3.998 4a3.013 3.013 0 0 0-1.414 1.414l-4-3.999a3.014 3.014 0 0 0 1.31-1.214l.106-.201ZM2.998 6.829a2.995 2.995 0 0 0 2.002 0v10.342a2.993 2.993 0 0 0-2.002 0V6.83ZM12 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm1.84-3.919c.464.483 1.09.81 1.79.896l-1.47 2.94a2.992 2.992 0 0 0-1.79-.894l1.47-2.942ZM16 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4ZM4 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm9.171.998a2.994 2.994 0 0 0 0 2.002H6.829a2.995 2.995 0 0 0 0-2.002h6.342Z", fill: "currentColor" }), e[0] = l) : l = e[0];
28
12
  let o;
29
13
  return e[1] !== t ? (o = /* @__PURE__ */ i("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...t, children: l }), e[1] = t, e[2] = o) : o = e[2], o;
30
14
  }
31
- function fe(t) {
32
- const e = v(3);
15
+ function pe(t) {
16
+ const e = b(3);
33
17
  let l;
34
18
  e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm16 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm-2.829 1a2.993 2.993 0 0 0-.17.974l-.001.052.007.183a3 3 0 0 0 .164.79H6.829a2.995 2.995 0 0 0 0-2h10.342ZM2.998 6.828a2.995 2.995 0 0 0 2.002 0V17.17a2.993 2.993 0 0 0-2.002 0V6.83Zm16.001 0a2.995 2.995 0 0 0 2 0V17.17a2.993 2.993 0 0 0-2 0V6.829ZM20 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4ZM4 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm13.171.998a2.991 2.991 0 0 0-.17.976L17 4.026l.007.183a3 3 0 0 0 .164.79H6.829a2.995 2.995 0 0 0 0-2H17.17Z", fill: "currentColor" }), e[0] = l) : l = e[0];
35
19
  let o;
36
20
  return e[1] !== t ? (o = /* @__PURE__ */ i("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...t, children: l }), e[1] = t, e[2] = o) : o = e[2], o;
37
21
  }
38
- function me(t) {
39
- const e = v(3);
22
+ function he(t) {
23
+ const e = b(3);
40
24
  let l;
41
25
  e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 6a2 2 0 1 1 0 4 2 2 0 0 1 0-4Z", fill: "currentColor" }), e[0] = l) : l = e[0];
42
26
  let o;
43
27
  return e[1] !== t ? (o = /* @__PURE__ */ i("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...t, children: l }), e[1] = t, e[2] = o) : o = e[2], o;
44
28
  }
45
- function ve(t) {
46
- const e = v(3);
29
+ function fe(t) {
30
+ const e = b(3);
47
31
  let l;
48
32
  e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 3c4.935 0 9 3.736 9 9l-.002.343-.012.668c-.012.438-.033.86-.062 1.266l-.05.597C20.498 18.767 19.267 21 17 21c-1.192 0-1.971-.341-2.988-1.122l-.472-.375c-.401-.319-.64-.473-.888-.566a4.938 4.938 0 0 0-.415-.13l-.34-.085-.398-.086-.456-.086-.66-.111-1.708-.273a9.112 9.112 0 0 1-.952-.206C5.46 17.301 3 14.954 3 12.015c0-1.508.485-2.995 1.436-4.458.355.585.906 1.04 1.562 1.272C5.328 9.916 5 10.977 5 12.015c0 1.889 1.78 3.588 3.282 4.025l.085.023.345.076.517.092 1.619.257.583.1.518.098.237.05.433.103c.272.07.512.143.73.224.434.161.783.373 1.235.718l.457.362c.806.646 1.24.857 1.959.857.893 0 1.63-1.518 1.895-4.45l.045-.585c.013-.2.024-.407.033-.62l.02-.655c.005-.224.007-.454.007-.69 0-4.12-3.133-7-7-7a1 1 0 1 1 0-2ZM7 4a2 2 0 1 1 0 4 2 2 0 0 1 0-4Z", fill: "currentColor" }), e[0] = l) : l = e[0];
49
33
  let o;
50
34
  return e[1] !== t ? (o = /* @__PURE__ */ i("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...t, children: l }), e[1] = t, e[2] = o) : o = e[2], o;
51
35
  }
52
- function be(t) {
53
- const e = v(3);
36
+ function me(t) {
37
+ const e = b(3);
54
38
  let l;
55
39
  e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i("path", { fillRule: "evenodd", clipRule: "evenodd", d: "m10.083 19.394.057.113a1 1 0 0 0 1.72.007l2.869-4.786 4.786-2.87a1 1 0 0 0-.121-1.777l-14-6c-.83-.356-1.669.483-1.313 1.313l6.002 14ZM6.905 6.904l9.903 4.244-3.322 1.995-.102.069a1 1 0 0 0-.242.274l-1.992 3.321-4.245-9.903Z", fill: "currentColor" }), e[0] = l) : l = e[0];
56
40
  let o;
57
41
  return e[1] !== t ? (o = /* @__PURE__ */ i("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...t, children: l }), e[1] = t, e[2] = o) : o = e[2], o;
58
42
  }
59
- const S = {
43
+ const x = {
60
44
  action: {
61
45
  tooltip: {
62
46
  active: "Click on the map to draw your spatial filter",
@@ -92,21 +76,21 @@ const S = {
92
76
  },
93
77
  deleteAll: "Remove all"
94
78
  }
95
- }, _e = {
79
+ }, Be = {
96
80
  polygon: {
97
- icon: he
81
+ icon: ge
98
82
  },
99
83
  rectangle: {
100
- icon: fe
84
+ icon: pe
101
85
  },
102
86
  circle: {
103
- icon: me
87
+ icon: he
104
88
  },
105
89
  lasso: {
106
- icon: ve
90
+ icon: fe
107
91
  },
108
92
  edit: {
109
- icon: be
93
+ icon: me
110
94
  }
111
95
  }, M = {
112
96
  container: {
@@ -272,46 +256,46 @@ const S = {
272
256
  }
273
257
  }
274
258
  };
275
- function we(t) {
276
- const e = v(18), {
259
+ function ve(t) {
260
+ const e = b(18), {
277
261
  chipProps: l,
278
262
  value: o,
279
- labels: n,
280
- onChipToggle: a,
281
- onDelete: r
282
- } = t, c = o.visible ? "active" : "inactive", s = n?.tooltip?.[c] ?? S.chip.tooltip[c], d = l?.TooltipProps;
263
+ labels: r,
264
+ onChipToggle: c,
265
+ onDelete: n
266
+ } = t, s = o.visible ? "active" : "inactive", a = r?.tooltip?.[s] ?? x.chip.tooltip[s], d = l?.TooltipProps;
283
267
  let u;
284
268
  e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = {
285
269
  ...M.chip.chip
286
270
  }, e[0] = u) : u = e[0];
287
- const g = o.visible ? "secondary" : "default";
288
- let p;
289
- e[1] !== r || e[2] !== o.id ? (p = () => r(o.id), e[1] = r, e[2] = o.id, e[3] = p) : p = e[3];
271
+ const p = o.visible ? "secondary" : "default";
272
+ let g;
273
+ e[1] !== n || e[2] !== o.id ? (g = () => n(o.id), e[1] = n, e[2] = o.id, e[3] = g) : g = e[3];
290
274
  let h;
291
- e[4] !== a || e[5] !== o.id || e[6] !== o.visible ? (h = () => a(o.id, !o.visible), e[4] = a, e[5] = o.id, e[6] = o.visible, e[7] = h) : h = e[7];
292
- const b = l?.ChipsProps;
275
+ e[4] !== c || e[5] !== o.id || e[6] !== o.visible ? (h = () => c(o.id, !o.visible), e[4] = c, e[5] = o.id, e[6] = o.visible, e[7] = h) : h = e[7];
276
+ const v = l?.ChipsProps;
293
277
  let f;
294
- e[8] !== g || e[9] !== p || e[10] !== h || e[11] !== b || e[12] !== o.label ? (f = /* @__PURE__ */ i(ie, { sx: u, color: g, size: "small", onDelete: p, label: o.label, onClick: h, ...b }), e[8] = g, e[9] = p, e[10] = h, e[11] = b, e[12] = o.label, e[13] = f) : f = e[13];
295
- let T;
296
- return e[14] !== s || e[15] !== d || e[16] !== f ? (T = /* @__PURE__ */ i(Q, { title: s, placement: "bottom", ...d, children: f }), e[14] = s, e[15] = d, e[16] = f, e[17] = T) : T = e[17], T;
278
+ e[8] !== p || e[9] !== g || e[10] !== h || e[11] !== v || e[12] !== o.label ? (f = /* @__PURE__ */ i(oe, { sx: u, color: p, size: "small", onDelete: g, label: o.label, onClick: h, ...v }), e[8] = p, e[9] = g, e[10] = h, e[11] = v, e[12] = o.label, e[13] = f) : f = e[13];
279
+ let C;
280
+ return e[14] !== a || e[15] !== d || e[16] !== f ? (C = /* @__PURE__ */ i(K, { title: a, placement: "bottom", ...d, children: f }), e[14] = a, e[15] = d, e[16] = f, e[17] = C) : C = e[17], C;
297
281
  }
298
- function C(t) {
299
- const e = v(44), {
282
+ function S(t) {
283
+ const e = b(44), {
300
284
  enabled: l,
301
285
  values: o,
302
- actionProps: n,
303
- chipProps: a,
304
- labels: r,
305
- modes: c,
306
- modesMapping: s,
286
+ actionProps: r,
287
+ chipProps: c,
288
+ labels: n,
289
+ modes: s,
290
+ modesMapping: a,
307
291
  modeSelected: d,
308
292
  PaperProps: u,
309
- onActionToggle: g,
310
- onChipToggle: p,
293
+ onActionToggle: p,
294
+ onChipToggle: g,
311
295
  onDelete: h,
312
- onChangeMode: b,
296
+ onChangeMode: v,
313
297
  onAllChipToggle: f,
314
- onAllDelete: T,
298
+ onAllDelete: C,
315
299
  ChipsSlot: j,
316
300
  ActionSlot: W,
317
301
  SecondaryActionsSlot: X,
@@ -319,7 +303,7 @@ function C(t) {
319
303
  } = t;
320
304
  let I;
321
305
  e[0] !== o ? (I = o === void 0 ? [] : o, e[0] = o, e[1] = I) : I = e[1];
322
- const G = I;
306
+ const E = I;
323
307
  let y;
324
308
  e[2] !== u ? (y = u === void 0 ? {} : u, e[2] = u, e[3] = y) : y = e[3];
325
309
  let w, A;
@@ -327,26 +311,26 @@ function C(t) {
327
311
  sx: A,
328
312
  ...w
329
313
  } = y, e[4] = y, e[5] = w, e[6] = A) : (w = e[5], A = e[6]);
330
- const O = j === void 0 ? C.Chips : j, P = W === void 0 ? C.Action : W, k = X === void 0 ? C.SecondaryActions : X, $ = U === void 0 ? C.Options : U;
331
- let E;
332
- e[7] !== w || e[8] !== n || e[9] !== a || e[10] !== l || e[11] !== r || e[12] !== d || e[13] !== c || e[14] !== s || e[15] !== g || e[16] !== f || e[17] !== T || e[18] !== b || e[19] !== p || e[20] !== h || e[21] !== G ? (E = {
314
+ const O = j === void 0 ? S.Chips : j, P = W === void 0 ? S.Action : W, k = X === void 0 ? S.SecondaryActions : X, V = U === void 0 ? S.Options : U;
315
+ let G;
316
+ e[7] !== w || e[8] !== r || e[9] !== c || e[10] !== l || e[11] !== n || e[12] !== d || e[13] !== s || e[14] !== a || e[15] !== p || e[16] !== f || e[17] !== C || e[18] !== v || e[19] !== g || e[20] !== h || e[21] !== E ? (G = {
333
317
  enabled: l,
334
- values: G,
335
- actionProps: n,
336
- chipProps: a,
337
- labels: r,
338
- modes: c,
339
- modesMapping: s,
318
+ values: E,
319
+ actionProps: r,
320
+ chipProps: c,
321
+ labels: n,
322
+ modes: s,
323
+ modesMapping: a,
340
324
  modeSelected: d,
341
325
  PaperProps: w,
342
- onActionToggle: g,
343
- onChipToggle: p,
326
+ onActionToggle: p,
327
+ onChipToggle: g,
344
328
  onDelete: h,
345
- onChangeMode: b,
329
+ onChangeMode: v,
346
330
  onAllChipToggle: f,
347
- onAllDelete: T
348
- }, e[7] = w, e[8] = n, e[9] = a, e[10] = l, e[11] = r, e[12] = d, e[13] = c, e[14] = s, e[15] = g, e[16] = f, e[17] = T, e[18] = b, e[19] = p, e[20] = h, e[21] = G, e[22] = E) : E = e[22];
349
- const m = E;
331
+ onAllDelete: C
332
+ }, e[7] = w, e[8] = r, e[9] = c, e[10] = l, e[11] = n, e[12] = d, e[13] = s, e[14] = a, e[15] = p, e[16] = f, e[17] = C, e[18] = v, e[19] = g, e[20] = h, e[21] = E, e[22] = G) : G = e[22];
333
+ const m = G;
350
334
  let D;
351
335
  e[23] !== A ? (D = {
352
336
  ...M.container,
@@ -355,112 +339,112 @@ function C(t) {
355
339
  let Z;
356
340
  e[25] !== P || e[26] !== m ? (Z = !!P && /* @__PURE__ */ i(P, { ...m }), e[25] = P, e[26] = m, e[27] = Z) : Z = e[27];
357
341
  let B;
358
- e[28] !== $ || e[29] !== m ? (B = !!$ && /* @__PURE__ */ i(Y, { children: (ee) => /* @__PURE__ */ i($, { ...m, ...ee }) }), e[28] = $, e[29] = m, e[30] = B) : B = e[30];
342
+ e[28] !== V || e[29] !== m ? (B = !!V && /* @__PURE__ */ i(Q, { children: (Y) => /* @__PURE__ */ i(V, { ...m, ...Y }) }), e[28] = V, e[29] = m, e[30] = B) : B = e[30];
359
343
  let L;
360
344
  e[31] !== O || e[32] !== m ? (L = !!O && /* @__PURE__ */ i(O, { ...m }), e[31] = O, e[32] = m, e[33] = L) : L = e[33];
361
345
  let _;
362
346
  e[34] !== k || e[35] !== m ? (_ = !!k && /* @__PURE__ */ i(k, { ...m }), e[34] = k, e[35] = m, e[36] = _) : _ = e[36];
363
- let V;
364
- return e[37] !== w || e[38] !== D || e[39] !== Z || e[40] !== B || e[41] !== L || e[42] !== _ ? (V = /* @__PURE__ */ x(ne, { sx: D, ...w, children: [
347
+ let $;
348
+ return e[37] !== w || e[38] !== D || e[39] !== Z || e[40] !== B || e[41] !== L || e[42] !== _ ? ($ = /* @__PURE__ */ T(le, { sx: D, ...w, children: [
365
349
  Z,
366
350
  B,
367
351
  L,
368
352
  _
369
- ] }), e[37] = w, e[38] = D, e[39] = Z, e[40] = B, e[41] = L, e[42] = _, e[43] = V) : V = e[43], V;
353
+ ] }), e[37] = w, e[38] = D, e[39] = Z, e[40] = B, e[41] = L, e[42] = _, e[43] = $) : $ = e[43], $;
370
354
  }
371
- function Me(t) {
372
- const e = v(12), {
355
+ function be(t) {
356
+ const e = b(12), {
373
357
  actionProps: l,
374
358
  labels: o,
375
- enabled: n,
376
- children: a,
377
- onActionToggle: r
378
- } = t, c = n ? "active" : "inactive", s = o?.tooltip?.[c] ?? S.action.tooltip[c], d = l?.TooltipProps;
359
+ enabled: r,
360
+ children: c,
361
+ onActionToggle: n
362
+ } = t, s = r ? "active" : "inactive", a = o?.tooltip?.[s] ?? x.action.tooltip[s], d = l?.TooltipProps;
379
363
  let u;
380
- e[0] !== n || e[1] !== r ? (u = () => r(!n), e[0] = n, e[1] = r, e[2] = u) : u = e[2];
381
- let g;
382
- e[3] !== s || e[4] !== a || e[5] !== n || e[6] !== u ? (g = /* @__PURE__ */ i(pe, { value: "toggle", sx: M.actions.icon, onClick: u, "aria-label": s, selected: n, children: a }), e[3] = s, e[4] = a, e[5] = n, e[6] = u, e[7] = g) : g = e[7];
364
+ e[0] !== r || e[1] !== n ? (u = () => n(!r), e[0] = r, e[1] = n, e[2] = u) : u = e[2];
383
365
  let p;
384
- return e[8] !== s || e[9] !== d || e[10] !== g ? (p = /* @__PURE__ */ i(Q, { title: s, placement: "right", ...d, children: g }), e[8] = s, e[9] = d, e[10] = g, e[11] = p) : p = e[11], p;
366
+ e[3] !== a || e[4] !== c || e[5] !== r || e[6] !== u ? (p = /* @__PURE__ */ i(de, { value: "toggle", sx: M.actions.icon, onClick: u, "aria-label": a, selected: r, children: c }), e[3] = a, e[4] = c, e[5] = r, e[6] = u, e[7] = p) : p = e[7];
367
+ let g;
368
+ return e[8] !== a || e[9] !== d || e[10] !== p ? (g = /* @__PURE__ */ i(K, { title: a, placement: "right", ...d, children: p }), e[8] = a, e[9] = d, e[10] = p, e[11] = g) : g = e[11], g;
385
369
  }
386
- function Y({
370
+ function Q({
387
371
  TriggerProps: {
388
- Icon: t = /* @__PURE__ */ i(te, {}),
372
+ Icon: t = /* @__PURE__ */ i(ee, {}),
389
373
  sx: e
390
374
  } = {},
391
375
  MenuProps: l,
392
376
  children: o
393
377
  }) {
394
- const [n, a] = ge(null), r = !!n, c = (d) => {
395
- a(d.currentTarget);
396
- }, s = () => {
397
- a(null);
378
+ const [r, c] = ue(null), n = !!r, s = (d) => {
379
+ c(d.currentTarget);
380
+ }, a = () => {
381
+ c(null);
398
382
  };
399
- return /* @__PURE__ */ x(R, { children: [
400
- /* @__PURE__ */ i(re, { sx: {
383
+ return /* @__PURE__ */ T(R, { children: [
384
+ /* @__PURE__ */ i(ie, { sx: {
401
385
  ...M.options.icon,
402
386
  ...e
403
- }, onClick: c, children: t }),
404
- /* @__PURE__ */ i(ae, { id: "lasso-menu", anchorEl: n, open: r, onClose: s, MenuListProps: {
387
+ }, onClick: s, children: t }),
388
+ /* @__PURE__ */ i(ne, { id: "lasso-menu", anchorEl: r, open: n, onClose: a, MenuListProps: {
405
389
  "aria-labelledby": "lasso-button",
406
390
  sx: M.options.menu
407
391
  }, ...l, children: /* @__PURE__ */ i("div", { children: o({
408
- onClose: s
392
+ onClose: a
409
393
  }) }) })
410
394
  ] });
411
395
  }
412
- function Te(t) {
413
- const e = v(5), {
396
+ function we(t) {
397
+ const e = b(5), {
414
398
  data: l,
415
399
  labels: o,
416
- children: n
400
+ children: r
417
401
  } = t;
418
402
  if (l.length <= 1)
419
403
  return null;
420
- const a = o?.mode?.title ?? S.options.mode.title;
421
- let r;
422
- e[0] !== a ? (r = /* @__PURE__ */ i(F, { variant: "subtitle2", color: "text.secondary", sx: M.options.title, children: a }), e[0] = a, e[1] = r) : r = e[1];
423
- let c;
424
- return e[2] !== n || e[3] !== r ? (c = /* @__PURE__ */ x(R, { children: [
425
- r,
426
- n
427
- ] }), e[2] = n, e[3] = r, e[4] = c) : c = e[4], c;
404
+ const c = o?.mode?.title ?? x.options.mode.title;
405
+ let n;
406
+ e[0] !== c ? (n = /* @__PURE__ */ i(q, { variant: "subtitle2", color: "text.secondary", sx: M.options.title, children: c }), e[0] = c, e[1] = n) : n = e[1];
407
+ let s;
408
+ return e[2] !== r || e[3] !== n ? (s = /* @__PURE__ */ T(R, { children: [
409
+ n,
410
+ r
411
+ ] }), e[2] = r, e[3] = n, e[4] = s) : s = e[4], s;
428
412
  }
429
- function N({
413
+ function F({
430
414
  data: t,
431
415
  modeSelected: e,
432
416
  labels: l,
433
417
  onChangeMode: o,
434
- onClose: n
418
+ onClose: r
435
419
  }) {
436
- const a = (r, c) => {
437
- r.preventDefault(), o?.(c), n();
420
+ const c = (n, s) => {
421
+ n.preventDefault(), o?.(s), r();
438
422
  };
439
- return t.map((r) => {
440
- const s = (l?.mode?.options ?? S.options.mode.options)[r.value];
441
- return /* @__PURE__ */ x(z, { disabled: !!r.disabled, onClick: (d) => a(d, r.value), selected: r.value === e, children: [
442
- /* @__PURE__ */ i(se, { sx: M.options.icons, children: /* @__PURE__ */ i(de, { children: /* @__PURE__ */ i(r.icon, {}) }) }),
443
- /* @__PURE__ */ i(ue, { children: s })
444
- ] }, r.value);
423
+ return t.map((n) => {
424
+ const a = (l?.mode?.options ?? x.options.mode.options)[n.value];
425
+ return /* @__PURE__ */ T(z, { disabled: !!n.disabled, onClick: (d) => c(d, n.value), selected: n.value === e, children: [
426
+ /* @__PURE__ */ i(ae, { sx: M.options.icons, children: /* @__PURE__ */ i(ce, { children: /* @__PURE__ */ i(n.icon, {}) }) }),
427
+ /* @__PURE__ */ i(se, { children: a })
428
+ ] }, n.value);
445
429
  });
446
430
  }
447
- function Ce(t) {
448
- const e = v(8), {
431
+ function Me(t) {
432
+ const e = b(8), {
449
433
  values: l,
450
434
  labels: o,
451
- onAllChipToggle: n,
452
- onAllDelete: a
435
+ onAllChipToggle: r,
436
+ onAllDelete: c
453
437
  } = t;
454
438
  if (!l?.length || l.length <= 1)
455
439
  return null;
456
- const c = l?.some(xe) ? o?.actions?.toggleAll?.active ?? S.actions.toggleAll.active : o?.actions?.toggleAll?.inactive ?? S.actions.toggleAll.inactive, s = o?.actions?.deleteAll ?? S.actions.deleteAll;
440
+ const s = l?.some(Ce) ? o?.actions?.toggleAll?.active ?? x.actions.toggleAll.active : o?.actions?.toggleAll?.inactive ?? x.actions.toggleAll.inactive, a = o?.actions?.deleteAll ?? x.actions.deleteAll;
457
441
  let d;
458
442
  e[0] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ i(H, { orientation: "vertical", flexItem: !0 }), e[0] = d) : d = e[0];
459
- let u, g;
443
+ let u, p;
460
444
  e[1] === Symbol.for("react.memo_cache_sentinel") ? (u = {
461
- Icon: /* @__PURE__ */ i(oe, {}),
445
+ Icon: /* @__PURE__ */ i(te, {}),
462
446
  sx: M.options.more
463
- }, g = {
447
+ }, p = {
464
448
  anchorOrigin: {
465
449
  vertical: "bottom",
466
450
  horizontal: "right"
@@ -469,84 +453,82 @@ function Ce(t) {
469
453
  vertical: "top",
470
454
  horizontal: "right"
471
455
  }
472
- }, e[1] = u, e[2] = g) : (u = e[1], g = e[2]);
473
- let p;
474
- return e[3] !== s || e[4] !== n || e[5] !== a || e[6] !== c ? (p = /* @__PURE__ */ x(R, { children: [
456
+ }, e[1] = u, e[2] = p) : (u = e[1], p = e[2]);
457
+ let g;
458
+ return e[3] !== a || e[4] !== r || e[5] !== c || e[6] !== s ? (g = /* @__PURE__ */ T(R, { children: [
475
459
  d,
476
- /* @__PURE__ */ i(Y, { TriggerProps: u, MenuProps: g, children: (h) => /* @__PURE__ */ x(R, { children: [
460
+ /* @__PURE__ */ i(Q, { TriggerProps: u, MenuProps: p, children: (h) => /* @__PURE__ */ T(R, { children: [
477
461
  /* @__PURE__ */ i(z, { color: "inherit", onClick: () => {
478
- n?.(), h.onClose();
479
- }, children: c }),
462
+ r?.(), h.onClose();
463
+ }, children: s }),
480
464
  /* @__PURE__ */ i(H, {}),
481
465
  /* @__PURE__ */ i(z, { color: "error", onClick: () => {
482
- a?.(), h.onClose();
483
- }, children: /* @__PURE__ */ i(F, { variant: "body2", color: "error", children: s }) })
466
+ c?.(), h.onClose();
467
+ }, children: /* @__PURE__ */ i(q, { variant: "body2", color: "error", children: a }) })
484
468
  ] }) })
485
- ] }), e[3] = s, e[4] = n, e[5] = a, e[6] = c, e[7] = p) : p = e[7], p;
469
+ ] }), e[3] = a, e[4] = r, e[5] = c, e[6] = s, e[7] = g) : g = e[7], g;
486
470
  }
487
- function xe(t) {
471
+ function Ce(t) {
488
472
  return t.visible;
489
473
  }
490
- C.Action = function({
474
+ S.Action = function({
491
475
  modes: e,
492
476
  modesMapping: l,
493
477
  modeSelected: o,
494
- actionProps: n,
495
- enabled: a,
496
- labels: r,
497
- onActionToggle: c
478
+ actionProps: r,
479
+ enabled: c,
480
+ labels: n,
481
+ onActionToggle: s
498
482
  }) {
499
- const s = J(() => q(e ?? {}, l ?? {}), [e, l]), d = (h) => c?.(h), g = (o ? o in (e ?? {}) : !1) ? o : Object.keys(s)[0], p = s[g];
500
- return /* @__PURE__ */ i(Me, { actionProps: n, labels: r?.action, enabled: a ?? !1, onActionToggle: d, children: p?.icon && /* @__PURE__ */ i(p.icon, {}) });
483
+ const a = J(() => N(e ?? {}, l ?? {}), [e, l]), d = (h) => s?.(h), p = (o ? o in (e ?? {}) : !1) ? o : Object.keys(a)[0], g = a[p];
484
+ return /* @__PURE__ */ i(be, { actionProps: r, labels: n?.action, enabled: c ?? !1, onActionToggle: d, children: g?.icon && /* @__PURE__ */ i(g.icon, {}) });
501
485
  };
502
- C.Chips = function({
486
+ S.Chips = function({
503
487
  values: e,
504
488
  labels: l,
505
489
  chipProps: o,
506
- onDelete: n,
507
- onChipToggle: a,
508
- onActionToggle: r
490
+ onDelete: r,
491
+ onChipToggle: c,
492
+ onActionToggle: n
509
493
  }) {
510
- const c = (s) => (r?.(!1), n?.(s));
511
- return !!e?.length && /* @__PURE__ */ i(ce, { sx: M.chip.container, children: e?.map((s) => /* @__PURE__ */ i(we, { value: s, labels: l?.chip, chipProps: o, onDelete: c, onChipToggle: (d, u) => a?.(d, u) }, s.id)) });
494
+ const s = (a) => (n?.(!1), r?.(a));
495
+ return !!e?.length && /* @__PURE__ */ i(re, { sx: M.chip.container, children: e?.map((a) => /* @__PURE__ */ i(ve, { value: a, labels: l?.chip, chipProps: o, onDelete: s, onChipToggle: (d, u) => c?.(d, u) }, a.id)) });
512
496
  };
513
- C.SecondaryActions = Ce;
514
- C.Options = function({
497
+ S.SecondaryActions = Me;
498
+ S.Options = function({
515
499
  values: e,
516
500
  modes: l,
517
501
  modesMapping: o,
518
- modeSelected: n,
519
- labels: a,
520
- onChangeMode: r,
521
- ...c
502
+ modeSelected: r,
503
+ labels: c,
504
+ onChangeMode: n,
505
+ ...s
522
506
  }) {
523
- const s = J(() => q(l ?? {}, o ?? {}), [l, o]), {
507
+ const a = J(() => N(l ?? {}, o ?? {}), [l, o]), {
524
508
  edit: d,
525
509
  ...u
526
- } = s, p = (n ? n in (l ?? {}) : !1) ? n : Object.keys(s)[0], h = Object.values(u), b = (f) => r?.(f);
527
- return /* @__PURE__ */ x(R, { children: [
528
- /* @__PURE__ */ i(Te, { data: h, labels: a?.options, children: /* @__PURE__ */ i(N, { ...c, labels: a?.options, data: h, modeSelected: p, onChangeMode: b }) }),
529
- !!d && /* @__PURE__ */ x(R, { children: [
510
+ } = a, g = (r ? r in (l ?? {}) : !1) ? r : Object.keys(a)[0], h = Object.values(u), v = (f) => n?.(f);
511
+ return /* @__PURE__ */ T(R, { children: [
512
+ /* @__PURE__ */ i(we, { data: h, labels: c?.options, children: /* @__PURE__ */ i(F, { ...s, labels: c?.options, data: h, modeSelected: g, onChangeMode: v }) }),
513
+ !!d && /* @__PURE__ */ T(R, { children: [
530
514
  /* @__PURE__ */ i(H, {}),
531
- /* @__PURE__ */ i(N, { ...c, labels: a?.options, data: [{
515
+ /* @__PURE__ */ i(F, { ...s, labels: c?.options, data: [{
532
516
  ...d,
533
517
  disabled: !e?.length
534
- }], modeSelected: p, onChangeMode: b })
518
+ }], modeSelected: g, onChangeMode: v })
535
519
  ] })
536
520
  ] });
537
521
  };
538
522
  export {
539
- _e as D,
540
- we as L,
541
- be as S,
542
- Q as T,
543
- S as a,
544
- C as b,
545
- me as c,
546
- ve as d,
547
- he as e,
548
- fe as f,
549
- Le as g,
523
+ Be as D,
524
+ ve as L,
525
+ me as S,
526
+ x as a,
527
+ S as b,
528
+ he as c,
529
+ fe as d,
530
+ ge as e,
531
+ pe as f,
550
532
  M as s
551
533
  };
552
- //# sourceMappingURL=lasso-tool-BC-rsMMW.js.map
534
+ //# sourceMappingURL=lasso-tool-CYn3ivf-.js.map