@undp/data-viz 2.3.1 → 2.3.3

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 (154) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +1 -1
  3. package/dist/BarGraph.cjs +1 -1
  4. package/dist/BarGraph.js +2 -2
  5. package/dist/BasicStatCard.cjs +1 -1
  6. package/dist/BasicStatCard.js +15 -15
  7. package/dist/BeeSwarmChart.cjs +1 -1
  8. package/dist/BeeSwarmChart.js +2 -2
  9. package/dist/BiVariateChoroplethMap.cjs +1 -1
  10. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  11. package/dist/BiVariateChoroplethMap.js +202 -202
  12. package/dist/BiVariateChoroplethMap.js.map +1 -1
  13. package/dist/BulletChart.cjs +1 -1
  14. package/dist/BulletChart.js +2 -2
  15. package/dist/ButterflyChart.cjs +1 -1
  16. package/dist/ButterflyChart.js +2 -2
  17. package/dist/ChoroplethMap.cjs +1 -1
  18. package/dist/ChoroplethMap.cjs.map +1 -1
  19. package/dist/ChoroplethMap.js +33 -33
  20. package/dist/ChoroplethMap.js.map +1 -1
  21. package/dist/CirclePackingGraph.cjs +1 -1
  22. package/dist/CirclePackingGraph.js +2 -2
  23. package/dist/ColorLegend.cjs +1 -1
  24. package/dist/ColorLegend.js +7 -7
  25. package/dist/ColorLegendWithMouseOver.cjs +1 -1
  26. package/dist/ColorLegendWithMouseOver.js +1 -1
  27. package/dist/CopyTextButton.cjs +1 -1
  28. package/dist/CopyTextButton.js +1 -1
  29. package/dist/CsvDownloadButton.cjs +2 -2
  30. package/dist/CsvDownloadButton.js +1 -1
  31. package/dist/DataCards.cjs +1 -1
  32. package/dist/DataCards.js +3 -3
  33. package/dist/DataCards.js.map +1 -1
  34. package/dist/DataTable.cjs +1 -1
  35. package/dist/DataTable.js +2 -2
  36. package/dist/DifferenceLineChart.cjs +1 -1
  37. package/dist/DifferenceLineChart.js +1 -1
  38. package/dist/DonutChart.cjs +1 -1
  39. package/dist/DonutChart.js +20 -20
  40. package/dist/DotDensityMap.cjs +1 -1
  41. package/dist/DotDensityMap.cjs.map +1 -1
  42. package/dist/DotDensityMap.js +46 -46
  43. package/dist/DotDensityMap.js.map +1 -1
  44. package/dist/DualAxisLineChart.cjs +1 -1
  45. package/dist/DualAxisLineChart.js +1 -1
  46. package/dist/DumbbellChart.cjs +1 -1
  47. package/dist/DumbbellChart.js +2 -2
  48. package/dist/{EmptyState-CGeBqbmR.cjs → EmptyState-DX0t62iF.cjs} +2 -2
  49. package/dist/{EmptyState-CGeBqbmR.cjs.map → EmptyState-DX0t62iF.cjs.map} +1 -1
  50. package/dist/{EmptyState-tZBErBKF.js → EmptyState-Pj-emXt5.js} +3 -3
  51. package/dist/{EmptyState-tZBErBKF.js.map → EmptyState-Pj-emXt5.js.map} +1 -1
  52. package/dist/ExcelDownloadButton.cjs +1 -1
  53. package/dist/ExcelDownloadButton.js +7 -7
  54. package/dist/FootNote.cjs +1 -1
  55. package/dist/FootNote.js +1 -1
  56. package/dist/GeoHubCompareMaps.cjs +1 -1
  57. package/dist/GeoHubCompareMaps.js +1 -1
  58. package/dist/GeoHubMap.cjs +1 -1
  59. package/dist/GeoHubMap.js +1 -1
  60. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  61. package/dist/GeoHubMapWithLayerSelection.js +2 -2
  62. package/dist/GraphDescription.cjs +1 -1
  63. package/dist/GraphDescription.js +1 -1
  64. package/dist/{GraphEl-ic8C5Ksc.cjs → GraphEl-CWjTuiYd.cjs} +2 -2
  65. package/dist/{GraphEl-ic8C5Ksc.cjs.map → GraphEl-CWjTuiYd.cjs.map} +1 -1
  66. package/dist/{GraphEl-L5hNe7wJ.js → GraphEl-DDXkYObU.js} +7 -7
  67. package/dist/{GraphEl-L5hNe7wJ.js.map → GraphEl-DDXkYObU.js.map} +1 -1
  68. package/dist/GraphFooter.cjs +1 -1
  69. package/dist/GraphFooter.js +1 -1
  70. package/dist/GraphTitle.cjs +1 -1
  71. package/dist/GraphTitle.js +1 -1
  72. package/dist/GriddedGraphs.cjs +1 -1
  73. package/dist/GriddedGraphs.js +1 -1
  74. package/dist/HeatMap.cjs +1 -1
  75. package/dist/HeatMap.js +1 -1
  76. package/dist/Histogram.cjs +1 -1
  77. package/dist/Histogram.js +1 -1
  78. package/dist/HybridMap.cjs +1 -1
  79. package/dist/HybridMap.cjs.map +1 -1
  80. package/dist/HybridMap.js +42 -42
  81. package/dist/HybridMap.js.map +1 -1
  82. package/dist/ImageDownloadButton.cjs +1 -1
  83. package/dist/ImageDownloadButton.js +1 -1
  84. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  85. package/dist/LineChartWithConfidenceInterval.js +1 -1
  86. package/dist/LinearColorLegend.cjs +1 -1
  87. package/dist/LinearColorLegend.js +1 -1
  88. package/dist/MultiLineAltChart.cjs +1 -1
  89. package/dist/MultiLineAltChart.js +1 -1
  90. package/dist/MultiLineChart.cjs +1 -1
  91. package/dist/MultiLineChart.js +1 -1
  92. package/dist/ParetoChart.cjs +1 -1
  93. package/dist/ParetoChart.js +1 -1
  94. package/dist/RadarChart.cjs +1 -1
  95. package/dist/RadarChart.js +1 -1
  96. package/dist/SVGDownloadButton.cjs +1 -1
  97. package/dist/SVGDownloadButton.js +8 -8
  98. package/dist/SankeyChart.cjs +1 -1
  99. package/dist/SankeyChart.js +80 -80
  100. package/dist/ScatterPlot.cjs +1 -1
  101. package/dist/ScatterPlot.js +2 -2
  102. package/dist/SimpleLineChart.cjs +1 -1
  103. package/dist/SimpleLineChart.js +1 -1
  104. package/dist/SingleGraphDashboard.cjs +1 -1
  105. package/dist/SingleGraphDashboard.js +1 -1
  106. package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
  107. package/dist/SingleGraphDashboardGeoHubMaps.js +10 -10
  108. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  109. package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
  110. package/dist/SlopeChart.cjs +1 -1
  111. package/dist/SlopeChart.js +1 -1
  112. package/dist/{Source-B5AoSlsi.cjs → Source-B3i0Bx2R.cjs} +2 -2
  113. package/dist/{Source-B5AoSlsi.cjs.map → Source-B3i0Bx2R.cjs.map} +1 -1
  114. package/dist/{Source-F8EYCYkV.js → Source-_STIejqs.js} +14 -14
  115. package/dist/{Source-F8EYCYkV.js.map → Source-_STIejqs.js.map} +1 -1
  116. package/dist/Source.cjs +1 -1
  117. package/dist/Source.js +2 -2
  118. package/dist/StatCardFromData.cjs +1 -1
  119. package/dist/StatCardFromData.js +12 -12
  120. package/dist/StripChart.cjs +1 -1
  121. package/dist/StripChart.js +1 -1
  122. package/dist/ThreeDGlobe.cjs +1 -1
  123. package/dist/ThreeDGlobe.js +2 -2
  124. package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
  125. package/dist/ThresholdColorLegendWithMouseOver.js +10 -10
  126. package/dist/TreeMapGraph.cjs +1 -1
  127. package/dist/TreeMapGraph.js +29 -29
  128. package/dist/Typography-DrJ7IOdw.cjs +2 -0
  129. package/dist/Typography-DrJ7IOdw.cjs.map +1 -0
  130. package/dist/Typography-iR8PEgdt.js +263 -0
  131. package/dist/Typography-iR8PEgdt.js.map +1 -0
  132. package/dist/UnitChart.cjs +1 -1
  133. package/dist/UnitChart.js +25 -25
  134. package/dist/WaterfallChart.cjs +1 -1
  135. package/dist/WaterfallChart.js +1 -1
  136. package/dist/{index-BQYOuXdl.js → index-B-4y_iGB.js} +19 -17
  137. package/dist/index-B-4y_iGB.js.map +1 -0
  138. package/dist/{index-D5ihtaJJ.js → index-BE-lvE4c.js} +3 -3
  139. package/dist/{index-D5ihtaJJ.js.map → index-BE-lvE4c.js.map} +1 -1
  140. package/dist/{index-Dgjq6aZ2.cjs → index-DlrGwLQA.cjs} +2 -2
  141. package/dist/{index-Dgjq6aZ2.cjs.map → index-DlrGwLQA.cjs.map} +1 -1
  142. package/dist/index-sbKVyHS2.cjs +2 -0
  143. package/dist/index-sbKVyHS2.cjs.map +1 -0
  144. package/dist/index.cjs +1 -1
  145. package/dist/index.js +2 -2
  146. package/dist/style.css +1 -1
  147. package/package.json +3 -3
  148. package/dist/Typography-hWfh3H0J.js +0 -142
  149. package/dist/Typography-hWfh3H0J.js.map +0 -1
  150. package/dist/Typography-sa1UE0oF.cjs +0 -2
  151. package/dist/Typography-sa1UE0oF.cjs.map +0 -1
  152. package/dist/index-BQYOuXdl.js.map +0 -1
  153. package/dist/index-C6er0ety.cjs +0 -2
  154. package/dist/index-C6er0ety.cjs.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-6v2a2njQ.cjs"),Q=require("./Typography-sa1UE0oF.cjs"),U=require("./GraphFooter.cjs"),X=require("./GraphHeader.cjs"),Y=require("./numberFormattingFunction-02t-wJta.cjs");function tt(Z){const t=r.compilerRuntimeExports.c(48),{year:l,value:j,graphTitle:i,suffix:q,sources:c,prefix:z,graphDescription:n,footNote:x,padding:W,backgroundColor:L,graphID:w,language:D,theme:P,ariaLabel:_,textBackground:I,headingFontSize:M,centerAlign:O,verticalAlign:V,layout:J,styles:e,classNames:o,precision:b}=Z,v=q===void 0?"":q,E=z===void 0?"":z,a=L===void 0?!1:L,s=D===void 0?"en":D,K=P===void 0?"light":P,R=I===void 0?!1:I,$=M===void 0?"4.375rem":M,N=O===void 0?!1:O,k=V===void 0?"center":V,y=J===void 0?"primary":J,F=`${K||"light"} w-full`,C=s==="he"||s==="ar"?"rtl":void 0,G=`${K||"light"} flex flex-col w-full box-border h-full ${a?a===!0?"bg-primary-gray-200 dark:bg-primary-gray-650":"":"bg-transparent"} ${s||"en"}`,T=o?.graphContainer;let u;t[0]!==G||t[1]!==T?(u=r.mo(G,T),t[0]=G,t[1]=T,t[2]=u):u=t[2];let d;t[3]!==e?.graphContainer?(d=e?.graphContainer||{},t[3]=e?.graphContainer,t[4]=d):d=t[4];let p;t[5]!==a?(p=a&&a!==!0?{backgroundColor:a}:{},t[5]=a,t[6]=p):p=t[6];const A=a?W||"1rem":W||0;let m;t[7]!==d||t[8]!==p||t[9]!==A?(m={...d,...p,padding:A},t[7]=d,t[8]=p,t[9]=A,t[10]=m):m=t[10];const B=_||`${i?`The graph shows ${i}. `:""}This is a statistic card.${n?` ${n}`:""}`,H=`flex flex-col w-full grow ${y!=="secondary"?"gap-12 justify-between":"gap-4 justify-center"}`;let g;t[11]!==N||t[12]!==o?.description||t[13]!==o?.footnote||t[14]!==o?.source||t[15]!==o?.title||t[16]!==x||t[17]!==n||t[18]!==i||t[19]!==$||t[20]!==s||t[21]!==y||t[22]!==b||t[23]!==E||t[24]!==c||t[25]!==e?.description||t[26]!==e?.footnote||t[27]!==e?.source||t[28]!==e?.title||t[29]!==v||t[30]!==R||t[31]!==j||t[32]!==k||t[33]!==l?(g=y!=="secondary"?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[i||n?r.jsxRuntimeExports.jsx(X.GraphHeader,{styles:{title:e?.title,description:e?.description},classNames:{title:o?.title,description:o?.description},graphTitle:i,graphDescription:n}):null,r.jsxRuntimeExports.jsx("div",{className:`flex flex-col justify-between grow ${k==="top"?"justify-start":k==="bottom"?"justify-end":"justify-center"}`,children:r.jsxRuntimeExports.jsxs(Q.$,{marginBottom:"base",className:`leading-none text-outline font-heading ${N?"text-center":s==="he"||s==="ar"?"text-right":"text-left"} ${R?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:$,letterSpacing:"0.05rem"},children:[Y.numberFormattingFunction(j,"NA",b,E,v)," ",l?r.jsxRuntimeExports.jsxs("span",{className:"text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400",style:{marginLeft:"-8px",lineHeight:"1.09",textShadow:"none",WebkitTextStrokeWidth:0},children:["(",l,")"]}):null]})}),c||x?r.jsxRuntimeExports.jsx(U.GraphFooter,{styles:{footnote:e?.footnote,source:e?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:c,footNote:x}):null]}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs(Q.$,{marginBottom:y==="secondary"?"none":"base",className:`leading-none text-outline font-heading ${N?"text-center":s==="he"||s==="ar"?"text-right":"text-left"} ${R?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:$,letterSpacing:"0.05rem"},children:[Y.numberFormattingFunction(j,"NA",b,E,v)," ",l?r.jsxRuntimeExports.jsxs("span",{className:"text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400",style:{marginLeft:"-8px",lineHeight:"1.09",textShadow:"none",WebkitTextStrokeWidth:0},children:["(",l,")"]}):null]}),i||n?r.jsxRuntimeExports.jsx(X.GraphHeader,{styles:{title:e?.title,description:e?.description},classNames:{title:o?.title,description:o?.description},graphTitle:i,graphDescription:n}):null,c||x?r.jsxRuntimeExports.jsx(U.GraphFooter,{styles:{footnote:e?.footnote,source:e?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:c,footNote:x}):null]}),t[11]=N,t[12]=o?.description,t[13]=o?.footnote,t[14]=o?.source,t[15]=o?.title,t[16]=x,t[17]=n,t[18]=i,t[19]=$,t[20]=s,t[21]=y,t[22]=b,t[23]=E,t[24]=c,t[25]=e?.description,t[26]=e?.footnote,t[27]=e?.source,t[28]=e?.title,t[29]=v,t[30]=R,t[31]=j,t[32]=k,t[33]=l,t[34]=g):g=t[34];let f;t[35]!==H||t[36]!==g?(f=r.jsxRuntimeExports.jsx("div",{className:H,children:g}),t[35]=H,t[36]=g,t[37]=f):f=t[37];let h;t[38]!==w||t[39]!==C||t[40]!==u||t[41]!==m||t[42]!==B||t[43]!==f?(h=r.jsxRuntimeExports.jsx("div",{id:w,dir:C,className:u,style:m,"aria-label":B,children:f}),t[38]=w,t[39]=C,t[40]=u,t[41]=m,t[42]=B,t[43]=f,t[44]=h):h=t[44];let S;return t[45]!==F||t[46]!==h?(S=r.jsxRuntimeExports.jsx("div",{className:F,children:h}),t[45]=F,t[46]=h,t[47]=S):S=t[47],S}exports.BasicStatCard=tt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-6v2a2njQ.cjs"),Q=require("./Typography-DrJ7IOdw.cjs"),U=require("./GraphFooter.cjs"),X=require("./GraphHeader.cjs"),Y=require("./numberFormattingFunction-02t-wJta.cjs");function tt(Z){const t=r.compilerRuntimeExports.c(48),{year:l,value:j,graphTitle:i,suffix:q,sources:c,prefix:z,graphDescription:n,footNote:x,padding:W,backgroundColor:L,graphID:w,language:D,theme:P,ariaLabel:_,textBackground:I,headingFontSize:M,centerAlign:O,verticalAlign:V,layout:J,styles:e,classNames:o,precision:b}=Z,v=q===void 0?"":q,R=z===void 0?"":z,a=L===void 0?!1:L,s=D===void 0?"en":D,K=P===void 0?"light":P,E=I===void 0?!1:I,N=M===void 0?"4.375rem":M,k=O===void 0?!1:O,$=V===void 0?"center":V,y=J===void 0?"primary":J,F=`${K||"light"} w-full`,C=s==="he"||s==="ar"?"rtl":void 0,G=`${K||"light"} flex flex-col w-full box-border h-full ${a?a===!0?"bg-primary-gray-200 dark:bg-primary-gray-650":"":"bg-transparent"} ${s||"en"}`,T=o?.graphContainer;let u;t[0]!==G||t[1]!==T?(u=r.mo(G,T),t[0]=G,t[1]=T,t[2]=u):u=t[2];let d;t[3]!==e?.graphContainer?(d=e?.graphContainer||{},t[3]=e?.graphContainer,t[4]=d):d=t[4];let p;t[5]!==a?(p=a&&a!==!0?{backgroundColor:a}:{},t[5]=a,t[6]=p):p=t[6];const A=a?W||"1rem":W||0;let m;t[7]!==d||t[8]!==p||t[9]!==A?(m={...d,...p,padding:A},t[7]=d,t[8]=p,t[9]=A,t[10]=m):m=t[10];const B=_||`${i?`The graph shows ${i}. `:""}This is a statistic card.${n?` ${n}`:""}`,H=`flex flex-col w-full grow ${y!=="secondary"?"gap-12 justify-between":"gap-4 justify-center"}`;let g;t[11]!==k||t[12]!==o?.description||t[13]!==o?.footnote||t[14]!==o?.source||t[15]!==o?.title||t[16]!==x||t[17]!==n||t[18]!==i||t[19]!==N||t[20]!==s||t[21]!==y||t[22]!==b||t[23]!==R||t[24]!==c||t[25]!==e?.description||t[26]!==e?.footnote||t[27]!==e?.source||t[28]!==e?.title||t[29]!==v||t[30]!==E||t[31]!==j||t[32]!==$||t[33]!==l?(g=y!=="secondary"?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[i||n?r.jsxRuntimeExports.jsx(X.GraphHeader,{styles:{title:e?.title,description:e?.description},classNames:{title:o?.title,description:o?.description},graphTitle:i,graphDescription:n}):null,r.jsxRuntimeExports.jsx("div",{className:`flex flex-col justify-between grow ${$==="top"?"justify-start":$==="bottom"?"justify-end":"justify-center"}`,children:r.jsxRuntimeExports.jsxs(Q.R,{marginBottom:"base",className:`leading-none text-outline font-heading ${k?"text-center":s==="he"||s==="ar"?"text-right":"text-left"} ${E?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:N,letterSpacing:"0.05rem"},children:[Y.numberFormattingFunction(j,"NA",b,R,v)," ",l?r.jsxRuntimeExports.jsxs("span",{className:"text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400",style:{marginLeft:"-8px",lineHeight:"1.09",textShadow:"none",WebkitTextStrokeWidth:0},children:["(",l,")"]}):null]})}),c||x?r.jsxRuntimeExports.jsx(U.GraphFooter,{styles:{footnote:e?.footnote,source:e?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:c,footNote:x}):null]}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs(Q.R,{marginBottom:y==="secondary"?"none":"base",className:`leading-none text-outline font-heading ${k?"text-center":s==="he"||s==="ar"?"text-right":"text-left"} ${E?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:N,letterSpacing:"0.05rem"},children:[Y.numberFormattingFunction(j,"NA",b,R,v)," ",l?r.jsxRuntimeExports.jsxs("span",{className:"text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400",style:{marginLeft:"-8px",lineHeight:"1.09",textShadow:"none",WebkitTextStrokeWidth:0},children:["(",l,")"]}):null]}),i||n?r.jsxRuntimeExports.jsx(X.GraphHeader,{styles:{title:e?.title,description:e?.description},classNames:{title:o?.title,description:o?.description},graphTitle:i,graphDescription:n}):null,c||x?r.jsxRuntimeExports.jsx(U.GraphFooter,{styles:{footnote:e?.footnote,source:e?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:c,footNote:x}):null]}),t[11]=k,t[12]=o?.description,t[13]=o?.footnote,t[14]=o?.source,t[15]=o?.title,t[16]=x,t[17]=n,t[18]=i,t[19]=N,t[20]=s,t[21]=y,t[22]=b,t[23]=R,t[24]=c,t[25]=e?.description,t[26]=e?.footnote,t[27]=e?.source,t[28]=e?.title,t[29]=v,t[30]=E,t[31]=j,t[32]=$,t[33]=l,t[34]=g):g=t[34];let f;t[35]!==H||t[36]!==g?(f=r.jsxRuntimeExports.jsx("div",{className:H,children:g}),t[35]=H,t[36]=g,t[37]=f):f=t[37];let h;t[38]!==w||t[39]!==C||t[40]!==u||t[41]!==m||t[42]!==B||t[43]!==f?(h=r.jsxRuntimeExports.jsx("div",{id:w,dir:C,className:u,style:m,"aria-label":B,children:f}),t[38]=w,t[39]=C,t[40]=u,t[41]=m,t[42]=B,t[43]=f,t[44]=h):h=t[44];let S;return t[45]!==F||t[46]!==h?(S=r.jsxRuntimeExports.jsx("div",{className:F,children:h}),t[45]=F,t[46]=h,t[47]=S):S=t[47],S}exports.BasicStatCard=tt;
2
2
  //# sourceMappingURL=BasicStatCard.cjs.map
@@ -1,5 +1,5 @@
1
1
  import { c as tt, m as et, j as r } from "./index-CHPV5EwG-DecW7_qr.js";
2
- import { $ as U } from "./Typography-hWfh3H0J.js";
2
+ import { R as U } from "./Typography-iR8PEgdt.js";
3
3
  import { GraphFooter as V } from "./GraphFooter.js";
4
4
  import { GraphHeader as X } from "./GraphHeader.js";
5
5
  import { n as Y } from "./numberFormattingFunction-14YCbkN2.js";
@@ -8,13 +8,13 @@ function at(Z) {
8
8
  year: l,
9
9
  value: j,
10
10
  graphTitle: s,
11
- suffix: D,
11
+ suffix: R,
12
12
  sources: c,
13
- prefix: E,
13
+ prefix: D,
14
14
  graphDescription: n,
15
15
  footNote: d,
16
- padding: G,
17
- backgroundColor: R,
16
+ padding: E,
17
+ backgroundColor: G,
18
18
  graphID: F,
19
19
  language: I,
20
20
  theme: q,
@@ -27,7 +27,7 @@ function at(Z) {
27
27
  styles: e,
28
28
  classNames: o,
29
29
  precision: b
30
- } = Z, v = D === void 0 ? "" : D, $ = E === void 0 ? "" : E, a = R === void 0 ? !1 : R, i = I === void 0 ? "en" : I, Q = q === void 0 ? "light" : q, N = J === void 0 ? !1 : J, k = K === void 0 ? "4.375rem" : K, w = M === void 0 ? !1 : M, S = O === void 0 ? "center" : O, y = P === void 0 ? "primary" : P, A = `${Q || "light"} w-full`, B = i === "he" || i === "ar" ? "rtl" : void 0, T = `${Q || "light"} flex flex-col w-full box-border h-full ${a ? a === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650" : "" : "bg-transparent"} ${i || "en"}`, z = o?.graphContainer;
30
+ } = Z, v = R === void 0 ? "" : R, N = D === void 0 ? "" : D, a = G === void 0 ? !1 : G, i = I === void 0 ? "en" : I, Q = q === void 0 ? "light" : q, k = J === void 0 ? !1 : J, $ = K === void 0 ? "4.375rem" : K, w = M === void 0 ? !1 : M, S = O === void 0 ? "center" : O, y = P === void 0 ? "primary" : P, A = `${Q || "light"} w-full`, B = i === "he" || i === "ar" ? "rtl" : void 0, T = `${Q || "light"} flex flex-col w-full box-border h-full ${a ? a === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650" : "" : "bg-transparent"} ${i || "en"}`, z = o?.graphContainer;
31
31
  let f;
32
32
  t[0] !== T || t[1] !== z ? (f = et(T, z), t[0] = T, t[1] = z, t[2] = f) : f = t[2];
33
33
  let m;
@@ -36,7 +36,7 @@ function at(Z) {
36
36
  t[5] !== a ? (p = a && a !== !0 ? {
37
37
  backgroundColor: a
38
38
  } : {}, t[5] = a, t[6] = p) : p = t[6];
39
- const W = a ? G || "1rem" : G || 0;
39
+ const W = a ? E || "1rem" : E || 0;
40
40
  let g;
41
41
  t[7] !== m || t[8] !== p || t[9] !== W ? (g = {
42
42
  ...m,
@@ -45,7 +45,7 @@ function at(Z) {
45
45
  }, t[7] = m, t[8] = p, t[9] = W, t[10] = g) : g = t[10];
46
46
  const H = _ || `${s ? `The graph shows ${s}. ` : ""}This is a statistic card.${n ? ` ${n}` : ""}`, L = `flex flex-col w-full grow ${y !== "secondary" ? "gap-12 justify-between" : "gap-4 justify-center"}`;
47
47
  let x;
48
- t[11] !== w || t[12] !== o?.description || t[13] !== o?.footnote || t[14] !== o?.source || t[15] !== o?.title || t[16] !== d || t[17] !== n || t[18] !== s || t[19] !== k || t[20] !== i || t[21] !== y || t[22] !== b || t[23] !== $ || t[24] !== c || t[25] !== e?.description || t[26] !== e?.footnote || t[27] !== e?.source || t[28] !== e?.title || t[29] !== v || t[30] !== N || t[31] !== j || t[32] !== S || t[33] !== l ? (x = y !== "secondary" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
48
+ t[11] !== w || t[12] !== o?.description || t[13] !== o?.footnote || t[14] !== o?.source || t[15] !== o?.title || t[16] !== d || t[17] !== n || t[18] !== s || t[19] !== $ || t[20] !== i || t[21] !== y || t[22] !== b || t[23] !== N || t[24] !== c || t[25] !== e?.description || t[26] !== e?.footnote || t[27] !== e?.source || t[28] !== e?.title || t[29] !== v || t[30] !== k || t[31] !== j || t[32] !== S || t[33] !== l ? (x = y !== "secondary" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
49
49
  s || n ? /* @__PURE__ */ r.jsx(X, { styles: {
50
50
  title: e?.title,
51
51
  description: e?.description
@@ -53,11 +53,11 @@ function at(Z) {
53
53
  title: o?.title,
54
54
  description: o?.description
55
55
  }, graphTitle: s, graphDescription: n }) : null,
56
- /* @__PURE__ */ r.jsx("div", { className: `flex flex-col justify-between grow ${S === "top" ? "justify-start" : S === "bottom" ? "justify-end" : "justify-center"}`, children: /* @__PURE__ */ r.jsxs(U, { marginBottom: "base", className: `leading-none text-outline font-heading ${w ? "text-center" : i === "he" || i === "ar" ? "text-right" : "text-left"} ${N ? "text-primary-black dark:text-primary-white" : "transparent"}`, style: {
57
- fontSize: k,
56
+ /* @__PURE__ */ r.jsx("div", { className: `flex flex-col justify-between grow ${S === "top" ? "justify-start" : S === "bottom" ? "justify-end" : "justify-center"}`, children: /* @__PURE__ */ r.jsxs(U, { marginBottom: "base", className: `leading-none text-outline font-heading ${w ? "text-center" : i === "he" || i === "ar" ? "text-right" : "text-left"} ${k ? "text-primary-black dark:text-primary-white" : "transparent"}`, style: {
57
+ fontSize: $,
58
58
  letterSpacing: "0.05rem"
59
59
  }, children: [
60
- Y(j, "NA", b, $, v),
60
+ Y(j, "NA", b, N, v),
61
61
  " ",
62
62
  l ? /* @__PURE__ */ r.jsxs("span", { className: "text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400", style: {
63
63
  marginLeft: "-8px",
@@ -78,11 +78,11 @@ function at(Z) {
78
78
  source: o?.source
79
79
  }, sources: c, footNote: d }) : null
80
80
  ] }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
81
- /* @__PURE__ */ r.jsxs(U, { marginBottom: y === "secondary" ? "none" : "base", className: `leading-none text-outline font-heading ${w ? "text-center" : i === "he" || i === "ar" ? "text-right" : "text-left"} ${N ? "text-primary-black dark:text-primary-white" : "transparent"}`, style: {
82
- fontSize: k,
81
+ /* @__PURE__ */ r.jsxs(U, { marginBottom: y === "secondary" ? "none" : "base", className: `leading-none text-outline font-heading ${w ? "text-center" : i === "he" || i === "ar" ? "text-right" : "text-left"} ${k ? "text-primary-black dark:text-primary-white" : "transparent"}`, style: {
82
+ fontSize: $,
83
83
  letterSpacing: "0.05rem"
84
84
  }, children: [
85
- Y(j, "NA", b, $, v),
85
+ Y(j, "NA", b, N, v),
86
86
  " ",
87
87
  l ? /* @__PURE__ */ r.jsxs("span", { className: "text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400", style: {
88
88
  marginLeft: "-8px",
@@ -109,7 +109,7 @@ function at(Z) {
109
109
  footnote: o?.footnote,
110
110
  source: o?.source
111
111
  }, sources: c, footNote: d }) : null
112
- ] }), t[11] = w, t[12] = o?.description, t[13] = o?.footnote, t[14] = o?.source, t[15] = o?.title, t[16] = d, t[17] = n, t[18] = s, t[19] = k, t[20] = i, t[21] = y, t[22] = b, t[23] = $, t[24] = c, t[25] = e?.description, t[26] = e?.footnote, t[27] = e?.source, t[28] = e?.title, t[29] = v, t[30] = N, t[31] = j, t[32] = S, t[33] = l, t[34] = x) : x = t[34];
112
+ ] }), t[11] = w, t[12] = o?.description, t[13] = o?.footnote, t[14] = o?.source, t[15] = o?.title, t[16] = d, t[17] = n, t[18] = s, t[19] = $, t[20] = i, t[21] = y, t[22] = b, t[23] = N, t[24] = c, t[25] = e?.description, t[26] = e?.footnote, t[27] = e?.source, t[28] = e?.title, t[29] = v, t[30] = k, t[31] = j, t[32] = S, t[33] = l, t[34] = x) : x = t[34];
113
113
  let u;
114
114
  t[35] !== L || t[36] !== x ? (u = /* @__PURE__ */ r.jsx("div", { className: L, children: x }), t[35] = L, t[36] = x, t[37] = u) : u = t[37];
115
115
  let h;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-6v2a2njQ.cjs"),p=require("react"),Ye=require("./index-DQA8q5sC.cjs"),He=require("./index-Cno4Q0YE.cjs"),ze=require("./Spinner-jTMOLuw_.cjs"),st=require("./Typography-sa1UE0oF.cjs"),We=require("./numberFormattingFunction-02t-wJta.cjs"),Ze=require("./Tooltip-BLa2EfMs.cjs"),v=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Je=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),ye=require("./Colors.cjs"),Ke=require("./Axis-Jt_tmhxS.cjs"),Qe=require("./ReferenceLine-M9aP3dj-.cjs"),rt=require("./YTicksAndGridLines-UzVC5eBM.cjs"),lt=require("./XTicksAndGridLines-CekrPykD.cjs"),_e=require("./DetailsModal-DHttOA80.cjs"),et=require("./pow-BnyPO-NX.cjs"),tt=require("./linear-CgUCbw9F.cjs"),le=require("./y-QcCbqrzx.cjs"),Pe=require("./uniqBy-O05lp2S5.cjs"),at=require("./GraphHeader.cjs"),Xe=require("./GraphContainer-B1EDxJ0S.cjs"),ct=require("./EmptyState-CGeBqbmR.cjs"),ut=require("./ColorLegendWithMouseOver.cjs"),dt=require("./GraphFooter.cjs");function xt(t){const e=n.compilerRuntimeExports.c(28),{data:i,circleColors:j,showTicks:ae,width:S,height:w,colorDomain:P,topMargin:C,bottomMargin:ee,leftMargin:te,rightMargin:ce,suffix:h,prefix:A,showLabels:T,tooltip:X,onSeriesMouseOver:ue,refValues:D,selectedColor:g,startFromZero:L,radius:m,maxRadiusValue:Y,maxValue:H,minValue:z,highlightedDataPoints:ge,onSeriesMouseClick:me,resetSelectionOnDoubleClick:W,detailsOnClick:V,styles:R,classNames:a,noOfTicks:y,dimmedOpacity:de,precision:xe,customLayers:fe,hideAxisLine:ve}=t,pe=C===void 0?25:C,I=ee===void 0?10:ee,ie=te===void 0?100:te,oe=ce===void 0?40:ce,he=p.useRef(null),[ne,Z]=p.useState(void 0),[F,U]=p.useState(void 0),[u,c]=p.useState(null),[se,J]=p.useState(void 0),[K,$]=p.useState(void 0);let Q;e[0]!==I||e[1]!==ie||e[2]!==oe||e[3]!==pe?(Q={top:pe,bottom:I,left:ie,right:oe},e[0]=I,e[1]=ie,e[2]=oe,e[3]=pe,e[4]=Q):Q=e[4];const d=Q,x=S-d.left-d.right,re=w-d.top-d.bottom,q=i.filter(At).length===0?i:He.orderBy(i.filter(qt),"radius","desc");let _;e[5]!==i||e[6]!==H||e[7]!==L?(_=v.checkIfNullOrUndefined(H)?Math.max(...i.filter($t).map(Lt))<0&&!L?0:Math.max(...i.filter(Dt).map(wt)):H,e[5]=i,e[6]=H,e[7]=L,e[8]=_):_=e[8];const B=_;let G;e[9]!==i||e[10]!==z||e[11]!==L?(G=v.checkIfNullOrUndefined(z)?Math.min(...i.filter(St).map(Nt))>=0&&!L?0:Math.min(...i.filter(Ct).map(kt)):z,e[9]=i,e[10]=z,e[11]=L,e[12]=G):G=e[12];const f=G,r=i.filter(Ot).length!==i.length?et.sqrt().domain([0,v.checkIfNullOrUndefined(Y)?Math.max(...i.map(Rt).filter(Et)):Y]).range([.25,m]).nice():void 0,l=tt.linear().domain([f,B]).range([re,0]).nice(),b=l.ticks(y);p.useEffect(()=>{const s=q.map(Mt).filter(bt);le.forceSimulation(s).force("y",le.forceY(o=>l(o.position)).strength(5)).force("x",le.forceX(o=>x/2).strength(1)).force("collide",le.forceCollide(o=>r?r(o.radius||0)+1:m+1)).force("charge",le.forceManyBody().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{c(s)}).on("end",()=>{c(s)})},[i,m,re,x,f,B,q,l,r]);const M=u?n.jsxRuntimeExports.jsx("svg",{width:`${S}px`,height:`${w}px`,viewBox:`0 0 ${S} ${w}`,direction:"ltr",ref:he,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${d.left},${d.top})`,children:[ae?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(Ke.Axis,{hideAxisLine:ve,y1:l(f<0?0:f),y2:l(f<0?0:f),x1:0-d.left,x2:x+d.right,label:ae?We.numberFormattingFunction(f<0?0:f,"NA",xe,A,h):void 0,labelPos:{x:0-d.left,y:l(f<0?0:f),dx:0,dy:B<0?"1em":-5},classNames:{axis:a?.xAxis?.axis,label:a?.yAxis?.labels},styles:{axis:R?.xAxis?.axis,label:R?.yAxis?.labels}}),n.jsxRuntimeExports.jsx(rt.YTicksAndGridLines,{values:b.filter(jt),y:b.filter(yt).map(s=>l(s)),x1:0-d.left,x2:x+d.right,styles:{gridLines:R?.yAxis?.gridLines,labels:R?.yAxis?.labels},classNames:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},suffix:h,prefix:A,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:xe})]}):null,fe.filter(vt).map(gt),u.map(s=>n.jsxRuntimeExports.jsxs("g",{className:"undp-viz-g-with-hover",transform:`translate(${s.x},${s.y})`,opacity:g?s.color&&j[P.indexOf(s.color)]===g?1:de:ge.length!==0?ge.indexOf(s.label)!==-1?.85:de:.85,onMouseEnter:o=>{Z(s),$(o.clientY),J(o.clientX),ue?.(s)},onMouseMove:o=>{Z(s),$(o.clientY),J(o.clientX)},onClick:()=>{(me||V)&&(Ye.isEqual(F,s)&&W?(U(void 0),me?.(void 0)):(U(s),me?.(s)))},onMouseLeave:()=>{Z(void 0),J(void 0),$(void 0),ue?.(void 0)},children:[n.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,r:r?r(s.radius||0):m,fill:i.filter(ht).length===0?j[0]:s.color?j[P.indexOf(s.color)]:ye.Colors.gray}),(r?r(s.radius||0):m)>10&&T?n.jsxRuntimeExports.jsx("g",{children:n.jsxRuntimeExports.jsx("foreignObject",{y:0-(r?r(s.radius||0):m),x:0-(r?r(s.radius||0):m),width:2*(r?r(s.radius||0):m),height:2*(r?r(s.radius||0):m),children:n.jsxRuntimeExports.jsx("div",{className:"flex flex-col justify-center items-center h-inherit py-0 px-1.5",children:T?n.jsxRuntimeExports.jsx("p",{className:n.mo("text-center leading-none m-0",a?.graphObjectValues),style:{fontSize:`${Math.min(Math.max(Math.round((r?r(s.radius||0):m)/4),10),Math.max(Math.round((r?r(s.radius||0):m)*12/`${s.label}`.length),10),20)}px`,hyphens:"auto",color:Je.getTextColorBasedOnBgColor(i.filter(pt).length===0?j[0]:s.color?j[P.indexOf(s.color)]:ye.Colors.gray),...R?.graphObjectValues||{}},children:s.label}):null})})}):null]},s.label)),D?n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:D.map((s,o)=>n.jsxRuntimeExports.jsx(Qe.RefLineY,{text:s.text,color:s.color,y:l(s.value),x1:0-d.left,x2:x+d.right,classNames:s.classNames,styles:s.styles,isInView:!0},o))}):null,fe.filter(ft).map(mt)]})}):n.jsxRuntimeExports.jsx("div",{style:{width:`${S}px`,height:`${w}px`},children:n.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:n.jsxRuntimeExports.jsx(ze.w,{})})});let N;e[13]!==a?.tooltip||e[14]!==se||e[15]!==K||e[16]!==ne||e[17]!==R?.tooltip||e[18]!==X?(N=ne&&X&&se&&K?n.jsxRuntimeExports.jsx(Ze.Tooltip,{data:ne,body:X,xPos:se,yPos:K,backgroundStyle:R?.tooltip,className:a?.tooltip}):null,e[13]=a?.tooltip,e[14]=se,e[15]=K,e[16]=ne,e[17]=R?.tooltip,e[18]=X,e[19]=N):N=e[19];let O;e[20]!==a?.modal||e[21]!==V||e[22]!==F?(O=V&&F!==void 0?n.jsxRuntimeExports.jsx(_e.DetailsModal,{body:V,data:F,setData:U,className:a?.modal}):null,e[20]=a?.modal,e[21]=V,e[22]=F,e[23]=O):O=e[23];let k;return e[24]!==M||e[25]!==N||e[26]!==O?(k=n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[M,N,O]}),e[24]=M,e[25]=N,e[26]=O,e[27]=k):k=e[27],k}function mt(t){return t.layer}function ft(t){return t.position==="after"}function pt(t){return t.color}function ht(t){return t.color}function gt(t){return t.layer}function vt(t){return t.position==="before"}function yt(t){return t!==0}function jt(t){return t!==0}function bt(t){return t.position}function Mt(t){return{...t,...t.data&&{data:{...t.data}}}}function Et(t){return t!=null}function Rt(t){return t.radius}function Ot(t){return t.radius===void 0||t.radius===null}function kt(t){return t.position}function Ct(t){return!v.checkIfNullOrUndefined(t.position)}function Nt(t){return t.position}function St(t){return!v.checkIfNullOrUndefined(t.position)}function wt(t){return t.position}function Dt(t){return!v.checkIfNullOrUndefined(t.position)}function Lt(t){return t.position}function $t(t){return!v.checkIfNullOrUndefined(t.position)}function qt(t){return!v.checkIfNullOrUndefined(t.radius)}function At(t){return!v.checkIfNullOrUndefined(t.radius)}function Tt(t){const e=n.compilerRuntimeExports.c(28),{data:i,circleColors:j,showTicks:ae,width:S,height:w,colorDomain:P,topMargin:C,bottomMargin:ee,leftMargin:te,rightMargin:ce,showLabels:h,tooltip:A,onSeriesMouseOver:T,refValues:X,selectedColor:ue,startFromZero:D,radius:g,maxRadiusValue:L,maxValue:m,minValue:Y,highlightedDataPoints:H,onSeriesMouseClick:z,rtl:ge,resetSelectionOnDoubleClick:me,detailsOnClick:W,suffix:V,prefix:R,styles:a,classNames:y,noOfTicks:de,dimmedOpacity:xe,precision:fe,customLayers:ve,hideAxisLine:pe}=t,I=C===void 0?25:C,ie=ee===void 0?10:ee,oe=te===void 0?10:te,he=ce===void 0?10:ce,ne=p.useRef(null),[Z,F]=p.useState(void 0),[U,u]=p.useState(void 0),[c,se]=p.useState(null),[J,K]=p.useState(void 0),[$,Q]=p.useState(void 0);let d;e[0]!==ie||e[1]!==oe||e[2]!==he||e[3]!==I?(d={top:I,bottom:ie,left:oe,right:he},e[0]=ie,e[1]=oe,e[2]=he,e[3]=I,e[4]=d):d=e[4];const x=d,re=S-x.left-x.right,q=w-x.top-x.bottom,_=i.filter(si).length===0?i:He.orderBy(i.filter(ni),"radius","desc");let B;e[5]!==i||e[6]!==m||e[7]!==D?(B=v.checkIfNullOrUndefined(m)?Math.max(...i.filter(oi).map(ii))<0&&!D?0:Math.max(...i.filter(ti).map(ei)):m,e[5]=i,e[6]=m,e[7]=D,e[8]=B):B=e[8];const G=B;let f;e[9]!==i||e[10]!==Y||e[11]!==D?(f=v.checkIfNullOrUndefined(Y)?Math.min(...i.filter(_t).map(Qt))>=0&&!D?0:Math.min(...i.filter(Kt).map(Jt)):Y,e[9]=i,e[10]=Y,e[11]=D,e[12]=f):f=e[12];const r=f,l=i.filter(Zt).length!==i.length?et.sqrt().domain([0,v.checkIfNullOrUndefined(L)?Math.max(...i.map(Wt).filter(zt)):L]).range([.25,g]).nice():void 0,b=tt.linear().domain([r,G]).range([0,re]).nice(),M=b.ticks(de);p.useEffect(()=>{const o=_.map(Ht).filter(Yt);le.forceSimulation(o).force("x",le.forceX(E=>b(E.position)).strength(5)).force("y",le.forceY(E=>q/2).strength(1)).force("collide",le.forceCollide(E=>l?l(E.radius||0)+1:g+1)).force("charge",le.forceManyBody().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{se(o)}).on("end",()=>{se(o)})},[i,g,q,re,r,G,_,b,l]);const N=c?n.jsxRuntimeExports.jsx("svg",{width:`${S}px`,height:`${w}px`,viewBox:`0 0 ${S} ${w}`,direction:"ltr",ref:ne,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${x.left},${x.top})`,children:[ae?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(Ke.Axis,{hideAxisLine:pe,x1:b(r<0?0:r),x2:b(r<0?0:r),y1:0-x.top,y2:q+x.bottom,label:ae?We.numberFormattingFunction(r<0?0:r,"NA",fe,R,V):void 0,labelPos:{x:b(r<0?0:r),y:0-I,dy:"0.75em",dx:3},classNames:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels},styles:{axis:a?.xAxis?.axis,label:a?.yAxis?.labels}}),n.jsxRuntimeExports.jsx(lt.XTicksAndGridLines,{values:M.filter(Xt),x:M.filter(Pt).map(o=>b(o)),y1:0-I,y2:q+x.bottom,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:y?.xAxis?.gridLines,labels:y?.xAxis?.labels},suffix:V,prefix:R,labelType:"secondary",showGridLines:!0,precision:fe})]}):null,ve.filter(Gt).map(Bt),c.map(o=>n.jsxRuntimeExports.jsxs("g",{className:"undp-viz-g-with-hover",transform:`translate(${o.x},${o.y})`,opacity:ue?o.color&&j[P.indexOf(o.color)]===ue?1:xe:H.length!==0?H.indexOf(o.label)!==-1?.85:xe:.85,onMouseEnter:E=>{F(o),Q(E.clientY),K(E.clientX),T?.(o)},onMouseMove:E=>{F(o),Q(E.clientY),K(E.clientX)},onClick:()=>{(z||W)&&(Ye.isEqual(U,o)&&me?(u(void 0),z?.(void 0)):(u(o),z?.(o)))},onMouseLeave:()=>{F(void 0),K(void 0),Q(void 0),T?.(void 0)},children:[n.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,fill:i.filter(Ut).length===0?j[0]:o.color?j[P.indexOf(o.color)]:ye.Colors.gray,radius:l?l(o.radius||0):g}),(l?l(o.radius||0):g)>10&&h?n.jsxRuntimeExports.jsx("g",{children:n.jsxRuntimeExports.jsx("foreignObject",{y:0-(l?l(o.radius||0):g),x:0-(l?l(o.radius||0):g),width:2*(l?l(o.radius||0):g),height:2*(l?l(o.radius||0):g),children:n.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-1.5",children:h?n.jsxRuntimeExports.jsx(st.j,{className:n.mo("text-center leading-none m-0",y?.graphObjectValues),marginBottom:"none",style:{fontSize:`${Math.min(Math.max(Math.round((l?l(o.radius||0):g)/4),10),Math.max(Math.round((l?l(o.radius||0):g)*12/`${o.label}`.length),10),20)}px`,color:Je.getTextColorBasedOnBgColor(i.filter(Ft).length===0?j[0]:o.color?j[P.indexOf(o.color)]:ye.Colors.gray),hyphens:"auto",...a?.graphObjectValues||{}},children:o.label}):null})})}):null]},o.label)),X?n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:X.map((o,E)=>n.jsxRuntimeExports.jsx(Qe.RefLineX,{text:o.text,color:o.color,x:b(o.value),y1:0-x.top,y2:q+x.bottom,textSide:b(o.value)>re*.75||ge?"left":"right",classNames:o.classNames,styles:o.styles,isInView:!0},E))}):null,ve.filter(It).map(Vt)]})}):n.jsxRuntimeExports.jsx("div",{style:{width:`${S}px`,height:`${w}px`},children:n.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:n.jsxRuntimeExports.jsx(ze.w,{})})});let O;e[13]!==y?.tooltip||e[14]!==J||e[15]!==$||e[16]!==Z||e[17]!==a?.tooltip||e[18]!==A?(O=Z&&A&&J&&$?n.jsxRuntimeExports.jsx(Ze.Tooltip,{data:Z,body:A,xPos:J,yPos:$,backgroundStyle:a?.tooltip,className:y?.tooltip}):null,e[13]=y?.tooltip,e[14]=J,e[15]=$,e[16]=Z,e[17]=a?.tooltip,e[18]=A,e[19]=O):O=e[19];let k;e[20]!==y?.modal||e[21]!==W||e[22]!==U?(k=W&&U!==void 0?n.jsxRuntimeExports.jsx(_e.DetailsModal,{body:W,data:U,setData:u,className:y?.modal}):null,e[20]=y?.modal,e[21]=W,e[22]=U,e[23]=k):k=e[23];let s;return e[24]!==N||e[25]!==O||e[26]!==k?(s=n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[N,O,k]}),e[24]=N,e[25]=O,e[26]=k,e[27]=s):s=e[27],s}function Vt(t){return t.layer}function It(t){return t.position==="after"}function Ft(t){return t.color}function Ut(t){return t.color}function Bt(t){return t.layer}function Gt(t){return t.position==="before"}function Pt(t){return t!==0}function Xt(t){return t!==0}function Yt(t){return t.position}function Ht(t){return{...t,...t.data&&{data:{...t.data}}}}function zt(t){return t!=null}function Wt(t){return t.radius}function Zt(t){return t.radius===void 0||t.radius===null}function Jt(t){return t.position}function Kt(t){return!v.checkIfNullOrUndefined(t.position)}function Qt(t){return t.position}function _t(t){return!v.checkIfNullOrUndefined(t.position)}function ei(t){return t.position}function ti(t){return!v.checkIfNullOrUndefined(t.position)}function ii(t){return t.position}function oi(t){return!v.checkIfNullOrUndefined(t.position)}function ni(t){return!v.checkIfNullOrUndefined(t.radius)}function si(t){return!v.checkIfNullOrUndefined(t.radius)}function ri(t){const e=n.compilerRuntimeExports.c(92),{data:i,graphTitle:j,topMargin:ae,bottomMargin:S,leftMargin:w,rightMargin:P,colors:C,sources:ee,graphDescription:te,height:ce,width:h,footNote:A,colorDomain:T,colorLegendTitle:X,padding:ue,relativeHeight:D,tooltip:g,onSeriesMouseOver:L,refValues:m,showColorScale:Y,graphID:H,radius:z,showLabels:ge,showTicks:me,maxRadiusValue:W,maxValue:V,minValue:R,highlightedDataPoints:a,onSeriesMouseClick:y,ariaLabel:de,backgroundColor:xe,graphDownload:fe,dataDownload:ve,language:pe,showNAColor:I,minHeight:ie,theme:oe,resetSelectionOnDoubleClick:he,detailsOnClick:ne,orientation:Z,suffix:F,prefix:U,styles:u,classNames:c,noOfTicks:se,dimmedOpacity:J,precision:K,customLayers:$,hideAxisLine:Q}=t,d=z===void 0?5:z,x=ge===void 0?!0:ge,re=me===void 0?!0:me;let q;e[0]!==a?(q=a===void 0?[]:a,e[0]=a,e[1]=q):q=e[1];const _=q,B=xe===void 0?!1:xe,G=fe===void 0?!1:fe,f=ve===void 0?!1:ve,r=pe===void 0?"en":pe,l=I===void 0?!0:I,b=ie===void 0?0:ie,M=oe===void 0?"light":oe,N=he===void 0?!0:he,O=Z===void 0?"vertical":Z,k=F===void 0?"":F,s=U===void 0?"":U,o=se===void 0?5:se,E=J===void 0?.3:J,Le=K===void 0?2:K;let ke;e[2]!==$?(ke=$===void 0?[]:$,e[2]=$,e[3]=ke):ke=e[3];const $e=ke,qe=Q===void 0?!1:Q,[Ce,it]=p.useState(0),[Ne,ot]=p.useState(0),[Ae,nt]=p.useState(void 0),Te=p.useRef(null),Ue=p.useRef(null),Ve=O==="horizontal"?Tt:xt;let Se,we;e[4]===Symbol.for("react.memo_cache_sentinel")?(Se=()=>{const Be=new ResizeObserver(Ge=>{it(Ge[0].target.clientWidth||620),ot(Ge[0].target.clientHeight||480)});return Te.current&&Be.observe(Te.current),()=>Be.disconnect()},we=[],e[4]=Se,e[5]=we):(Se=e[4],we=e[5]),p.useEffect(Se,we);const Ie=c?.graphContainer,Fe=u?.graphContainer;let je;e[6]!==c?.description||e[7]!==c?.title||e[8]!==i||e[9]!==f||e[10]!==te||e[11]!==G||e[12]!==j||e[13]!==u?.description||e[14]!==u?.title||e[15]!==h?(je=j||te||G||f?n.jsxRuntimeExports.jsx(at.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:c?.title,description:c?.description},graphTitle:j,graphDescription:te,width:h,graphDownload:G?Ue:void 0,dataDownload:f?i.map(fi).filter(mi).length>0?i.map(xi).filter(di):i.filter(ui):null}):null,e[6]=c?.description,e[7]=c?.title,e[8]=i,e[9]=f,e[10]=te,e[11]=G,e[12]=j,e[13]=u?.description,e[14]=u?.title,e[15]=h,e[16]=je):je=e[16];let be;e[17]!==c?.colorLegend||e[18]!==T||e[19]!==X||e[20]!==C||e[21]!==i||e[22]!==Y||e[23]!==l||e[24]!==M||e[25]!==h?(be=Y!==!1&&i.filter(ci).length!==0&&i.length>0?n.jsxRuntimeExports.jsx(ut.ColorLegendWithMouseOver,{width:h,colorLegendTitle:X,colors:C||ye.Colors[M].categoricalColors.colors,colorDomain:T||Pe.uniqBy(i,"color",!0),setSelectedColor:nt,showNAColor:l,className:c?.colorLegend}):null,e[17]=c?.colorLegend,e[18]=T,e[19]=X,e[20]=C,e[21]=i,e[22]=Y,e[23]=l,e[24]=M,e[25]=h,e[26]=be):be=e[26];let Me;e[27]!==i.length?(Me=i.length===0&&n.jsxRuntimeExports.jsx(ct.EmptyState,{}),e[27]=i.length,e[28]=Me):Me=e[28];let Ee;e[29]!==Ve||e[30]!==S||e[31]!==c||e[32]!==T||e[33]!==C||e[34]!==$e||e[35]!==i||e[36]!==ne||e[37]!==E||e[38]!==qe||e[39]!==_||e[40]!==w||e[41]!==W||e[42]!==V||e[43]!==R||e[44]!==o||e[45]!==y||e[46]!==L||e[47]!==Le||e[48]!==s||e[49]!==d||e[50]!==m||e[51]!==N||e[52]!==P||e[53]!==Ae||e[54]!==x||e[55]!==re||e[56]!==u||e[57]!==k||e[58]!==Ne||e[59]!==Ce||e[60]!==M||e[61]!==g||e[62]!==ae?(Ee=Ce&&Ne&&i.length>0?n.jsxRuntimeExports.jsx(Ve,{hideAxisLine:qe,data:i,circleColors:i.filter(ai).length===0?C?[C]:[ye.Colors.primaryColors["blue-600"]]:C||ye.Colors[M].categoricalColors.colors,colorDomain:i.filter(li).length===0?[]:T||Pe.uniqBy(i,"color",!0),width:Ce,selectedColor:Ae,height:Ne,showTicks:re,leftMargin:w,rightMargin:P,topMargin:ae,bottomMargin:S,showLabels:x,tooltip:g,onSeriesMouseOver:L,refValues:m,startFromZero:!1,radius:d,maxRadiusValue:W,maxValue:V,minValue:R,highlightedDataPoints:_,onSeriesMouseClick:y,resetSelectionOnDoubleClick:N,detailsOnClick:ne,styles:u,classNames:c,suffix:k,prefix:s,noOfTicks:o||5,dimmedOpacity:E,precision:Le,customLayers:$e}):null,e[29]=Ve,e[30]=S,e[31]=c,e[32]=T,e[33]=C,e[34]=$e,e[35]=i,e[36]=ne,e[37]=E,e[38]=qe,e[39]=_,e[40]=w,e[41]=W,e[42]=V,e[43]=R,e[44]=o,e[45]=y,e[46]=L,e[47]=Le,e[48]=s,e[49]=d,e[50]=m,e[51]=N,e[52]=P,e[53]=Ae,e[54]=x,e[55]=re,e[56]=u,e[57]=k,e[58]=Ne,e[59]=Ce,e[60]=M,e[61]=g,e[62]=ae,e[63]=Ee):Ee=e[63];let Re;e[64]!==Me||e[65]!==Ee?(Re=n.jsxRuntimeExports.jsxs(Xe.GraphArea,{ref:Te,children:[Me,Ee]}),e[64]=Me,e[65]=Ee,e[66]=Re):Re=e[66];let Oe;e[67]!==c?.footnote||e[68]!==c?.source||e[69]!==A||e[70]!==ee||e[71]!==u?.footnote||e[72]!==u?.source||e[73]!==h?(Oe=ee||A?n.jsxRuntimeExports.jsx(dt.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:c?.footnote,source:c?.source},sources:ee,footNote:A,width:h}):null,e[67]=c?.footnote,e[68]=c?.source,e[69]=A,e[70]=ee,e[71]=u?.footnote,e[72]=u?.source,e[73]=h,e[74]=Oe):Oe=e[74];let De;return e[75]!==de||e[76]!==B||e[77]!==H||e[78]!==ce||e[79]!==r||e[80]!==b||e[81]!==ue||e[82]!==D||e[83]!==Ie||e[84]!==Fe||e[85]!==je||e[86]!==be||e[87]!==Re||e[88]!==Oe||e[89]!==M||e[90]!==h?(De=n.jsxRuntimeExports.jsxs(Xe.GraphContainer,{className:Ie,style:Fe,id:H,ref:Ue,"aria-label":de,backgroundColor:B,theme:M,language:r,minHeight:b,width:h,height:ce,relativeHeight:D,padding:ue,children:[je,be,Re,Oe]}),e[75]=de,e[76]=B,e[77]=H,e[78]=ce,e[79]=r,e[80]=b,e[81]=ue,e[82]=D,e[83]=Ie,e[84]=Fe,e[85]=je,e[86]=be,e[87]=Re,e[88]=Oe,e[89]=M,e[90]=h,e[91]=De):De=e[91],De}function li(t){return t.color}function ai(t){return t.color}function ci(t){return t.color}function ui(t){return t!==void 0}function di(t){return t!==void 0}function xi(t){return t.data}function mi(t){return t!==void 0}function fi(t){return t.data}exports.BeeSwarmChart=ri;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-6v2a2njQ.cjs"),p=require("react"),Ye=require("./index-DQA8q5sC.cjs"),He=require("./index-Cno4Q0YE.cjs"),ze=require("./Spinner-jTMOLuw_.cjs"),st=require("./Typography-DrJ7IOdw.cjs"),We=require("./numberFormattingFunction-02t-wJta.cjs"),Ze=require("./Tooltip-BLa2EfMs.cjs"),v=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Je=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),ye=require("./Colors.cjs"),Ke=require("./Axis-Jt_tmhxS.cjs"),Qe=require("./ReferenceLine-M9aP3dj-.cjs"),rt=require("./YTicksAndGridLines-UzVC5eBM.cjs"),lt=require("./XTicksAndGridLines-CekrPykD.cjs"),_e=require("./DetailsModal-DHttOA80.cjs"),et=require("./pow-BnyPO-NX.cjs"),tt=require("./linear-CgUCbw9F.cjs"),le=require("./y-QcCbqrzx.cjs"),Pe=require("./uniqBy-O05lp2S5.cjs"),at=require("./GraphHeader.cjs"),Xe=require("./GraphContainer-B1EDxJ0S.cjs"),ct=require("./EmptyState-DX0t62iF.cjs"),ut=require("./ColorLegendWithMouseOver.cjs"),dt=require("./GraphFooter.cjs");function xt(t){const e=n.compilerRuntimeExports.c(28),{data:i,circleColors:j,showTicks:ae,width:S,height:w,colorDomain:P,topMargin:C,bottomMargin:ee,leftMargin:te,rightMargin:ce,suffix:h,prefix:A,showLabels:T,tooltip:X,onSeriesMouseOver:ue,refValues:D,selectedColor:g,startFromZero:L,radius:m,maxRadiusValue:Y,maxValue:H,minValue:z,highlightedDataPoints:ge,onSeriesMouseClick:me,resetSelectionOnDoubleClick:W,detailsOnClick:V,styles:R,classNames:a,noOfTicks:y,dimmedOpacity:de,precision:xe,customLayers:fe,hideAxisLine:ve}=t,pe=C===void 0?25:C,I=ee===void 0?10:ee,ie=te===void 0?100:te,oe=ce===void 0?40:ce,he=p.useRef(null),[ne,Z]=p.useState(void 0),[F,U]=p.useState(void 0),[u,c]=p.useState(null),[se,J]=p.useState(void 0),[K,$]=p.useState(void 0);let Q;e[0]!==I||e[1]!==ie||e[2]!==oe||e[3]!==pe?(Q={top:pe,bottom:I,left:ie,right:oe},e[0]=I,e[1]=ie,e[2]=oe,e[3]=pe,e[4]=Q):Q=e[4];const d=Q,x=S-d.left-d.right,re=w-d.top-d.bottom,q=i.filter(At).length===0?i:He.orderBy(i.filter(qt),"radius","desc");let _;e[5]!==i||e[6]!==H||e[7]!==L?(_=v.checkIfNullOrUndefined(H)?Math.max(...i.filter($t).map(Lt))<0&&!L?0:Math.max(...i.filter(Dt).map(wt)):H,e[5]=i,e[6]=H,e[7]=L,e[8]=_):_=e[8];const B=_;let G;e[9]!==i||e[10]!==z||e[11]!==L?(G=v.checkIfNullOrUndefined(z)?Math.min(...i.filter(St).map(Nt))>=0&&!L?0:Math.min(...i.filter(Ct).map(kt)):z,e[9]=i,e[10]=z,e[11]=L,e[12]=G):G=e[12];const f=G,r=i.filter(Ot).length!==i.length?et.sqrt().domain([0,v.checkIfNullOrUndefined(Y)?Math.max(...i.map(Rt).filter(Et)):Y]).range([.25,m]).nice():void 0,l=tt.linear().domain([f,B]).range([re,0]).nice(),b=l.ticks(y);p.useEffect(()=>{const s=q.map(Mt).filter(bt);le.forceSimulation(s).force("y",le.forceY(o=>l(o.position)).strength(5)).force("x",le.forceX(o=>x/2).strength(1)).force("collide",le.forceCollide(o=>r?r(o.radius||0)+1:m+1)).force("charge",le.forceManyBody().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{c(s)}).on("end",()=>{c(s)})},[i,m,re,x,f,B,q,l,r]);const M=u?n.jsxRuntimeExports.jsx("svg",{width:`${S}px`,height:`${w}px`,viewBox:`0 0 ${S} ${w}`,direction:"ltr",ref:he,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${d.left},${d.top})`,children:[ae?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(Ke.Axis,{hideAxisLine:ve,y1:l(f<0?0:f),y2:l(f<0?0:f),x1:0-d.left,x2:x+d.right,label:ae?We.numberFormattingFunction(f<0?0:f,"NA",xe,A,h):void 0,labelPos:{x:0-d.left,y:l(f<0?0:f),dx:0,dy:B<0?"1em":-5},classNames:{axis:a?.xAxis?.axis,label:a?.yAxis?.labels},styles:{axis:R?.xAxis?.axis,label:R?.yAxis?.labels}}),n.jsxRuntimeExports.jsx(rt.YTicksAndGridLines,{values:b.filter(jt),y:b.filter(yt).map(s=>l(s)),x1:0-d.left,x2:x+d.right,styles:{gridLines:R?.yAxis?.gridLines,labels:R?.yAxis?.labels},classNames:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},suffix:h,prefix:A,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:xe})]}):null,fe.filter(vt).map(gt),u.map(s=>n.jsxRuntimeExports.jsxs("g",{className:"undp-viz-g-with-hover",transform:`translate(${s.x},${s.y})`,opacity:g?s.color&&j[P.indexOf(s.color)]===g?1:de:ge.length!==0?ge.indexOf(s.label)!==-1?.85:de:.85,onMouseEnter:o=>{Z(s),$(o.clientY),J(o.clientX),ue?.(s)},onMouseMove:o=>{Z(s),$(o.clientY),J(o.clientX)},onClick:()=>{(me||V)&&(Ye.isEqual(F,s)&&W?(U(void 0),me?.(void 0)):(U(s),me?.(s)))},onMouseLeave:()=>{Z(void 0),J(void 0),$(void 0),ue?.(void 0)},children:[n.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,r:r?r(s.radius||0):m,fill:i.filter(ht).length===0?j[0]:s.color?j[P.indexOf(s.color)]:ye.Colors.gray}),(r?r(s.radius||0):m)>10&&T?n.jsxRuntimeExports.jsx("g",{children:n.jsxRuntimeExports.jsx("foreignObject",{y:0-(r?r(s.radius||0):m),x:0-(r?r(s.radius||0):m),width:2*(r?r(s.radius||0):m),height:2*(r?r(s.radius||0):m),children:n.jsxRuntimeExports.jsx("div",{className:"flex flex-col justify-center items-center h-inherit py-0 px-1.5",children:T?n.jsxRuntimeExports.jsx("p",{className:n.mo("text-center leading-none m-0",a?.graphObjectValues),style:{fontSize:`${Math.min(Math.max(Math.round((r?r(s.radius||0):m)/4),10),Math.max(Math.round((r?r(s.radius||0):m)*12/`${s.label}`.length),10),20)}px`,hyphens:"auto",color:Je.getTextColorBasedOnBgColor(i.filter(pt).length===0?j[0]:s.color?j[P.indexOf(s.color)]:ye.Colors.gray),...R?.graphObjectValues||{}},children:s.label}):null})})}):null]},s.label)),D?n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:D.map((s,o)=>n.jsxRuntimeExports.jsx(Qe.RefLineY,{text:s.text,color:s.color,y:l(s.value),x1:0-d.left,x2:x+d.right,classNames:s.classNames,styles:s.styles,isInView:!0},o))}):null,fe.filter(ft).map(mt)]})}):n.jsxRuntimeExports.jsx("div",{style:{width:`${S}px`,height:`${w}px`},children:n.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:n.jsxRuntimeExports.jsx(ze.w,{})})});let N;e[13]!==a?.tooltip||e[14]!==se||e[15]!==K||e[16]!==ne||e[17]!==R?.tooltip||e[18]!==X?(N=ne&&X&&se&&K?n.jsxRuntimeExports.jsx(Ze.Tooltip,{data:ne,body:X,xPos:se,yPos:K,backgroundStyle:R?.tooltip,className:a?.tooltip}):null,e[13]=a?.tooltip,e[14]=se,e[15]=K,e[16]=ne,e[17]=R?.tooltip,e[18]=X,e[19]=N):N=e[19];let O;e[20]!==a?.modal||e[21]!==V||e[22]!==F?(O=V&&F!==void 0?n.jsxRuntimeExports.jsx(_e.DetailsModal,{body:V,data:F,setData:U,className:a?.modal}):null,e[20]=a?.modal,e[21]=V,e[22]=F,e[23]=O):O=e[23];let k;return e[24]!==M||e[25]!==N||e[26]!==O?(k=n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[M,N,O]}),e[24]=M,e[25]=N,e[26]=O,e[27]=k):k=e[27],k}function mt(t){return t.layer}function ft(t){return t.position==="after"}function pt(t){return t.color}function ht(t){return t.color}function gt(t){return t.layer}function vt(t){return t.position==="before"}function yt(t){return t!==0}function jt(t){return t!==0}function bt(t){return t.position}function Mt(t){return{...t,...t.data&&{data:{...t.data}}}}function Et(t){return t!=null}function Rt(t){return t.radius}function Ot(t){return t.radius===void 0||t.radius===null}function kt(t){return t.position}function Ct(t){return!v.checkIfNullOrUndefined(t.position)}function Nt(t){return t.position}function St(t){return!v.checkIfNullOrUndefined(t.position)}function wt(t){return t.position}function Dt(t){return!v.checkIfNullOrUndefined(t.position)}function Lt(t){return t.position}function $t(t){return!v.checkIfNullOrUndefined(t.position)}function qt(t){return!v.checkIfNullOrUndefined(t.radius)}function At(t){return!v.checkIfNullOrUndefined(t.radius)}function Tt(t){const e=n.compilerRuntimeExports.c(28),{data:i,circleColors:j,showTicks:ae,width:S,height:w,colorDomain:P,topMargin:C,bottomMargin:ee,leftMargin:te,rightMargin:ce,showLabels:h,tooltip:A,onSeriesMouseOver:T,refValues:X,selectedColor:ue,startFromZero:D,radius:g,maxRadiusValue:L,maxValue:m,minValue:Y,highlightedDataPoints:H,onSeriesMouseClick:z,rtl:ge,resetSelectionOnDoubleClick:me,detailsOnClick:W,suffix:V,prefix:R,styles:a,classNames:y,noOfTicks:de,dimmedOpacity:xe,precision:fe,customLayers:ve,hideAxisLine:pe}=t,I=C===void 0?25:C,ie=ee===void 0?10:ee,oe=te===void 0?10:te,he=ce===void 0?10:ce,ne=p.useRef(null),[Z,F]=p.useState(void 0),[U,u]=p.useState(void 0),[c,se]=p.useState(null),[J,K]=p.useState(void 0),[$,Q]=p.useState(void 0);let d;e[0]!==ie||e[1]!==oe||e[2]!==he||e[3]!==I?(d={top:I,bottom:ie,left:oe,right:he},e[0]=ie,e[1]=oe,e[2]=he,e[3]=I,e[4]=d):d=e[4];const x=d,re=S-x.left-x.right,q=w-x.top-x.bottom,_=i.filter(si).length===0?i:He.orderBy(i.filter(ni),"radius","desc");let B;e[5]!==i||e[6]!==m||e[7]!==D?(B=v.checkIfNullOrUndefined(m)?Math.max(...i.filter(oi).map(ii))<0&&!D?0:Math.max(...i.filter(ti).map(ei)):m,e[5]=i,e[6]=m,e[7]=D,e[8]=B):B=e[8];const G=B;let f;e[9]!==i||e[10]!==Y||e[11]!==D?(f=v.checkIfNullOrUndefined(Y)?Math.min(...i.filter(_t).map(Qt))>=0&&!D?0:Math.min(...i.filter(Kt).map(Jt)):Y,e[9]=i,e[10]=Y,e[11]=D,e[12]=f):f=e[12];const r=f,l=i.filter(Zt).length!==i.length?et.sqrt().domain([0,v.checkIfNullOrUndefined(L)?Math.max(...i.map(Wt).filter(zt)):L]).range([.25,g]).nice():void 0,b=tt.linear().domain([r,G]).range([0,re]).nice(),M=b.ticks(de);p.useEffect(()=>{const o=_.map(Ht).filter(Yt);le.forceSimulation(o).force("x",le.forceX(E=>b(E.position)).strength(5)).force("y",le.forceY(E=>q/2).strength(1)).force("collide",le.forceCollide(E=>l?l(E.radius||0)+1:g+1)).force("charge",le.forceManyBody().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{se(o)}).on("end",()=>{se(o)})},[i,g,q,re,r,G,_,b,l]);const N=c?n.jsxRuntimeExports.jsx("svg",{width:`${S}px`,height:`${w}px`,viewBox:`0 0 ${S} ${w}`,direction:"ltr",ref:ne,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${x.left},${x.top})`,children:[ae?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(Ke.Axis,{hideAxisLine:pe,x1:b(r<0?0:r),x2:b(r<0?0:r),y1:0-x.top,y2:q+x.bottom,label:ae?We.numberFormattingFunction(r<0?0:r,"NA",fe,R,V):void 0,labelPos:{x:b(r<0?0:r),y:0-I,dy:"0.75em",dx:3},classNames:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels},styles:{axis:a?.xAxis?.axis,label:a?.yAxis?.labels}}),n.jsxRuntimeExports.jsx(lt.XTicksAndGridLines,{values:M.filter(Xt),x:M.filter(Pt).map(o=>b(o)),y1:0-I,y2:q+x.bottom,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:y?.xAxis?.gridLines,labels:y?.xAxis?.labels},suffix:V,prefix:R,labelType:"secondary",showGridLines:!0,precision:fe})]}):null,ve.filter(Gt).map(Bt),c.map(o=>n.jsxRuntimeExports.jsxs("g",{className:"undp-viz-g-with-hover",transform:`translate(${o.x},${o.y})`,opacity:ue?o.color&&j[P.indexOf(o.color)]===ue?1:xe:H.length!==0?H.indexOf(o.label)!==-1?.85:xe:.85,onMouseEnter:E=>{F(o),Q(E.clientY),K(E.clientX),T?.(o)},onMouseMove:E=>{F(o),Q(E.clientY),K(E.clientX)},onClick:()=>{(z||W)&&(Ye.isEqual(U,o)&&me?(u(void 0),z?.(void 0)):(u(o),z?.(o)))},onMouseLeave:()=>{F(void 0),K(void 0),Q(void 0),T?.(void 0)},children:[n.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,fill:i.filter(Ut).length===0?j[0]:o.color?j[P.indexOf(o.color)]:ye.Colors.gray,radius:l?l(o.radius||0):g}),(l?l(o.radius||0):g)>10&&h?n.jsxRuntimeExports.jsx("g",{children:n.jsxRuntimeExports.jsx("foreignObject",{y:0-(l?l(o.radius||0):g),x:0-(l?l(o.radius||0):g),width:2*(l?l(o.radius||0):g),height:2*(l?l(o.radius||0):g),children:n.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-1.5",children:h?n.jsxRuntimeExports.jsx(st._,{className:n.mo("text-center leading-none m-0",y?.graphObjectValues),marginBottom:"none",style:{fontSize:`${Math.min(Math.max(Math.round((l?l(o.radius||0):g)/4),10),Math.max(Math.round((l?l(o.radius||0):g)*12/`${o.label}`.length),10),20)}px`,color:Je.getTextColorBasedOnBgColor(i.filter(Ft).length===0?j[0]:o.color?j[P.indexOf(o.color)]:ye.Colors.gray),hyphens:"auto",...a?.graphObjectValues||{}},children:o.label}):null})})}):null]},o.label)),X?n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:X.map((o,E)=>n.jsxRuntimeExports.jsx(Qe.RefLineX,{text:o.text,color:o.color,x:b(o.value),y1:0-x.top,y2:q+x.bottom,textSide:b(o.value)>re*.75||ge?"left":"right",classNames:o.classNames,styles:o.styles,isInView:!0},E))}):null,ve.filter(It).map(Vt)]})}):n.jsxRuntimeExports.jsx("div",{style:{width:`${S}px`,height:`${w}px`},children:n.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:n.jsxRuntimeExports.jsx(ze.w,{})})});let O;e[13]!==y?.tooltip||e[14]!==J||e[15]!==$||e[16]!==Z||e[17]!==a?.tooltip||e[18]!==A?(O=Z&&A&&J&&$?n.jsxRuntimeExports.jsx(Ze.Tooltip,{data:Z,body:A,xPos:J,yPos:$,backgroundStyle:a?.tooltip,className:y?.tooltip}):null,e[13]=y?.tooltip,e[14]=J,e[15]=$,e[16]=Z,e[17]=a?.tooltip,e[18]=A,e[19]=O):O=e[19];let k;e[20]!==y?.modal||e[21]!==W||e[22]!==U?(k=W&&U!==void 0?n.jsxRuntimeExports.jsx(_e.DetailsModal,{body:W,data:U,setData:u,className:y?.modal}):null,e[20]=y?.modal,e[21]=W,e[22]=U,e[23]=k):k=e[23];let s;return e[24]!==N||e[25]!==O||e[26]!==k?(s=n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[N,O,k]}),e[24]=N,e[25]=O,e[26]=k,e[27]=s):s=e[27],s}function Vt(t){return t.layer}function It(t){return t.position==="after"}function Ft(t){return t.color}function Ut(t){return t.color}function Bt(t){return t.layer}function Gt(t){return t.position==="before"}function Pt(t){return t!==0}function Xt(t){return t!==0}function Yt(t){return t.position}function Ht(t){return{...t,...t.data&&{data:{...t.data}}}}function zt(t){return t!=null}function Wt(t){return t.radius}function Zt(t){return t.radius===void 0||t.radius===null}function Jt(t){return t.position}function Kt(t){return!v.checkIfNullOrUndefined(t.position)}function Qt(t){return t.position}function _t(t){return!v.checkIfNullOrUndefined(t.position)}function ei(t){return t.position}function ti(t){return!v.checkIfNullOrUndefined(t.position)}function ii(t){return t.position}function oi(t){return!v.checkIfNullOrUndefined(t.position)}function ni(t){return!v.checkIfNullOrUndefined(t.radius)}function si(t){return!v.checkIfNullOrUndefined(t.radius)}function ri(t){const e=n.compilerRuntimeExports.c(92),{data:i,graphTitle:j,topMargin:ae,bottomMargin:S,leftMargin:w,rightMargin:P,colors:C,sources:ee,graphDescription:te,height:ce,width:h,footNote:A,colorDomain:T,colorLegendTitle:X,padding:ue,relativeHeight:D,tooltip:g,onSeriesMouseOver:L,refValues:m,showColorScale:Y,graphID:H,radius:z,showLabels:ge,showTicks:me,maxRadiusValue:W,maxValue:V,minValue:R,highlightedDataPoints:a,onSeriesMouseClick:y,ariaLabel:de,backgroundColor:xe,graphDownload:fe,dataDownload:ve,language:pe,showNAColor:I,minHeight:ie,theme:oe,resetSelectionOnDoubleClick:he,detailsOnClick:ne,orientation:Z,suffix:F,prefix:U,styles:u,classNames:c,noOfTicks:se,dimmedOpacity:J,precision:K,customLayers:$,hideAxisLine:Q}=t,d=z===void 0?5:z,x=ge===void 0?!0:ge,re=me===void 0?!0:me;let q;e[0]!==a?(q=a===void 0?[]:a,e[0]=a,e[1]=q):q=e[1];const _=q,B=xe===void 0?!1:xe,G=fe===void 0?!1:fe,f=ve===void 0?!1:ve,r=pe===void 0?"en":pe,l=I===void 0?!0:I,b=ie===void 0?0:ie,M=oe===void 0?"light":oe,N=he===void 0?!0:he,O=Z===void 0?"vertical":Z,k=F===void 0?"":F,s=U===void 0?"":U,o=se===void 0?5:se,E=J===void 0?.3:J,Le=K===void 0?2:K;let ke;e[2]!==$?(ke=$===void 0?[]:$,e[2]=$,e[3]=ke):ke=e[3];const $e=ke,qe=Q===void 0?!1:Q,[Ce,it]=p.useState(0),[Ne,ot]=p.useState(0),[Ae,nt]=p.useState(void 0),Te=p.useRef(null),Ue=p.useRef(null),Ve=O==="horizontal"?Tt:xt;let Se,we;e[4]===Symbol.for("react.memo_cache_sentinel")?(Se=()=>{const Be=new ResizeObserver(Ge=>{it(Ge[0].target.clientWidth||620),ot(Ge[0].target.clientHeight||480)});return Te.current&&Be.observe(Te.current),()=>Be.disconnect()},we=[],e[4]=Se,e[5]=we):(Se=e[4],we=e[5]),p.useEffect(Se,we);const Ie=c?.graphContainer,Fe=u?.graphContainer;let je;e[6]!==c?.description||e[7]!==c?.title||e[8]!==i||e[9]!==f||e[10]!==te||e[11]!==G||e[12]!==j||e[13]!==u?.description||e[14]!==u?.title||e[15]!==h?(je=j||te||G||f?n.jsxRuntimeExports.jsx(at.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:c?.title,description:c?.description},graphTitle:j,graphDescription:te,width:h,graphDownload:G?Ue:void 0,dataDownload:f?i.map(fi).filter(mi).length>0?i.map(xi).filter(di):i.filter(ui):null}):null,e[6]=c?.description,e[7]=c?.title,e[8]=i,e[9]=f,e[10]=te,e[11]=G,e[12]=j,e[13]=u?.description,e[14]=u?.title,e[15]=h,e[16]=je):je=e[16];let be;e[17]!==c?.colorLegend||e[18]!==T||e[19]!==X||e[20]!==C||e[21]!==i||e[22]!==Y||e[23]!==l||e[24]!==M||e[25]!==h?(be=Y!==!1&&i.filter(ci).length!==0&&i.length>0?n.jsxRuntimeExports.jsx(ut.ColorLegendWithMouseOver,{width:h,colorLegendTitle:X,colors:C||ye.Colors[M].categoricalColors.colors,colorDomain:T||Pe.uniqBy(i,"color",!0),setSelectedColor:nt,showNAColor:l,className:c?.colorLegend}):null,e[17]=c?.colorLegend,e[18]=T,e[19]=X,e[20]=C,e[21]=i,e[22]=Y,e[23]=l,e[24]=M,e[25]=h,e[26]=be):be=e[26];let Me;e[27]!==i.length?(Me=i.length===0&&n.jsxRuntimeExports.jsx(ct.EmptyState,{}),e[27]=i.length,e[28]=Me):Me=e[28];let Ee;e[29]!==Ve||e[30]!==S||e[31]!==c||e[32]!==T||e[33]!==C||e[34]!==$e||e[35]!==i||e[36]!==ne||e[37]!==E||e[38]!==qe||e[39]!==_||e[40]!==w||e[41]!==W||e[42]!==V||e[43]!==R||e[44]!==o||e[45]!==y||e[46]!==L||e[47]!==Le||e[48]!==s||e[49]!==d||e[50]!==m||e[51]!==N||e[52]!==P||e[53]!==Ae||e[54]!==x||e[55]!==re||e[56]!==u||e[57]!==k||e[58]!==Ne||e[59]!==Ce||e[60]!==M||e[61]!==g||e[62]!==ae?(Ee=Ce&&Ne&&i.length>0?n.jsxRuntimeExports.jsx(Ve,{hideAxisLine:qe,data:i,circleColors:i.filter(ai).length===0?C?[C]:[ye.Colors.primaryColors["blue-600"]]:C||ye.Colors[M].categoricalColors.colors,colorDomain:i.filter(li).length===0?[]:T||Pe.uniqBy(i,"color",!0),width:Ce,selectedColor:Ae,height:Ne,showTicks:re,leftMargin:w,rightMargin:P,topMargin:ae,bottomMargin:S,showLabels:x,tooltip:g,onSeriesMouseOver:L,refValues:m,startFromZero:!1,radius:d,maxRadiusValue:W,maxValue:V,minValue:R,highlightedDataPoints:_,onSeriesMouseClick:y,resetSelectionOnDoubleClick:N,detailsOnClick:ne,styles:u,classNames:c,suffix:k,prefix:s,noOfTicks:o||5,dimmedOpacity:E,precision:Le,customLayers:$e}):null,e[29]=Ve,e[30]=S,e[31]=c,e[32]=T,e[33]=C,e[34]=$e,e[35]=i,e[36]=ne,e[37]=E,e[38]=qe,e[39]=_,e[40]=w,e[41]=W,e[42]=V,e[43]=R,e[44]=o,e[45]=y,e[46]=L,e[47]=Le,e[48]=s,e[49]=d,e[50]=m,e[51]=N,e[52]=P,e[53]=Ae,e[54]=x,e[55]=re,e[56]=u,e[57]=k,e[58]=Ne,e[59]=Ce,e[60]=M,e[61]=g,e[62]=ae,e[63]=Ee):Ee=e[63];let Re;e[64]!==Me||e[65]!==Ee?(Re=n.jsxRuntimeExports.jsxs(Xe.GraphArea,{ref:Te,children:[Me,Ee]}),e[64]=Me,e[65]=Ee,e[66]=Re):Re=e[66];let Oe;e[67]!==c?.footnote||e[68]!==c?.source||e[69]!==A||e[70]!==ee||e[71]!==u?.footnote||e[72]!==u?.source||e[73]!==h?(Oe=ee||A?n.jsxRuntimeExports.jsx(dt.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:c?.footnote,source:c?.source},sources:ee,footNote:A,width:h}):null,e[67]=c?.footnote,e[68]=c?.source,e[69]=A,e[70]=ee,e[71]=u?.footnote,e[72]=u?.source,e[73]=h,e[74]=Oe):Oe=e[74];let De;return e[75]!==de||e[76]!==B||e[77]!==H||e[78]!==ce||e[79]!==r||e[80]!==b||e[81]!==ue||e[82]!==D||e[83]!==Ie||e[84]!==Fe||e[85]!==je||e[86]!==be||e[87]!==Re||e[88]!==Oe||e[89]!==M||e[90]!==h?(De=n.jsxRuntimeExports.jsxs(Xe.GraphContainer,{className:Ie,style:Fe,id:H,ref:Ue,"aria-label":de,backgroundColor:B,theme:M,language:r,minHeight:b,width:h,height:ce,relativeHeight:D,padding:ue,children:[je,be,Re,Oe]}),e[75]=de,e[76]=B,e[77]=H,e[78]=ce,e[79]=r,e[80]=b,e[81]=ue,e[82]=D,e[83]=Ie,e[84]=Fe,e[85]=je,e[86]=be,e[87]=Re,e[88]=Oe,e[89]=M,e[90]=h,e[91]=De):De=e[91],De}function li(t){return t.color}function ai(t){return t.color}function ci(t){return t.color}function ui(t){return t!==void 0}function di(t){return t!==void 0}function xi(t){return t.data}function mi(t){return t!==void 0}function fi(t){return t.data}exports.BeeSwarmChart=ri;
2
2
  //# sourceMappingURL=BeeSwarmChart.cjs.map
@@ -3,7 +3,7 @@ import { useRef as At, useState as T, useEffect as Gt } from "react";
3
3
  import { i as qt } from "./index-Bwrro8-q.js";
4
4
  import { o as Zt } from "./index-BZQYSqar.js";
5
5
  import { w as Ut } from "./Spinner--r2RrJV8.js";
6
- import { j as me } from "./Typography-hWfh3H0J.js";
6
+ import { _ as me } from "./Typography-iR8PEgdt.js";
7
7
  import { n as Jt } from "./numberFormattingFunction-14YCbkN2.js";
8
8
  import { T as Kt } from "./Tooltip-BRnAz2Gv.js";
9
9
  import { c as x } from "./checkIfNullOrUndefined-DmfiKkNw.js";
@@ -20,7 +20,7 @@ import { f as ie, a as ne, b as re, c as se, d as le } from "./y-BqfogMAB.js";
20
20
  import { u as Wt } from "./uniqBy-BHy4I8PK.js";
21
21
  import { GraphHeader as ge } from "./GraphHeader.js";
22
22
  import { a as xe, G as ve } from "./GraphContainer-CF6ws3pd.js";
23
- import { E as ye } from "./EmptyState-tZBErBKF.js";
23
+ import { E as ye } from "./EmptyState-Pj-emXt5.js";
24
24
  import { ColorLegendWithMouseOver as be } from "./ColorLegendWithMouseOver.js";
25
25
  import { GraphFooter as Me } from "./GraphFooter.js";
26
26
  function je(e) {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),s=require("react"),vt=require("./getSliderMarks-CIuSoedo.cjs"),Mt=require("./Spinner-jTMOLuw_.cjs"),jt=require("./parse-xYI9yrvL.cjs"),qt=require("./index-DQA8q5sC.cjs"),A=require("./index-DLFt97gy.cjs"),It=require("./index-C5K--w8d.cjs"),bt=require("./Typography-sa1UE0oF.cjs"),Et=require("./numberFormattingFunction-02t-wJta.cjs"),zt=require("./Tooltip-BLa2EfMs.cjs"),kt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ft=require("./index-C6er0ety.cjs"),Pt=require("./DetailsModal-DHttOA80.cjs"),xt=require("./select-Bnfk0lJx.cjs"),Ct=require("./threshold-DNsSUf8Q.cjs"),et=require("./proxy-C4-uo6nS.cjs"),At=require("./use-in-view-C3o_ntMv.cjs"),Bt=require("./index-CoobIWNj.cjs"),Ft=require("./GraphHeader.cjs"),Lt=require("./GraphFooter.cjs"),gt=require("./Colors.cjs"),Wt=require("./fetchAndParseData-QTF6tjij.cjs"),wt=require("./getJenks-BzJvhy_H.cjs"),Rt=require("./GraphContainer-B1EDxJ0S.cjs");function _t(a){const{data:e,xDomain:u,mapData:B,xColorLegendTitle:ze,yDomain:Y,yColorLegendTitle:J,width:x,height:p,colors:h,scale:Pe,centerPoint:E,mapBorderWidth:F,mapNoDataColor:K,mapBorderColor:pe,tooltip:Z,onSeriesMouseOver:he,zoomScaleExtend:xe,zoomTranslateExtend:ge,highlightedIds:k,onSeriesMouseClick:Q,mapProperty:R,resetSelectionOnDoubleClick:Ae,detailsOnClick:y,showColorScale:fe,styles:Be,classNames:L,mapProjection:W,zoomInteraction:D,animate:S,dimmedOpacity:N,customLayers:ee,collapseColorScaleByDefault:ye,zoomAndCenterByHighlightedIds:ve,projectionRotate:_,rewindCoordinatesInMapData:je}=a,v=s.useMemo(()=>je?A.index_default(B,{reverse:!0}):B,[B,je]),[Fe,be]=s.useState(ye===void 0?!(x<680):!ye),[T,Ee]=s.useState(void 0),[H,c]=s.useState(void 0),[l,te]=s.useState(void 0),[ke,oe]=s.useState(void 0),[Ce,$]=s.useState(void 0),w=s.useRef(null),re=At.useInView(w,{once:S.once,amount:S.amount}),we=s.useRef(null),G=s.useRef(null);s.useEffect(()=>{const t=xt.select(we.current),r=xt.select(w.current),g=m=>{if(D==="noZoom")return!1;if(D==="button")return!m.type.includes("wheel");const C=m.type==="wheel",j=m.type.startsWith("touch"),Me=m.type==="mousedown"||m.type==="mousemove";return j?!0:C?D==="scroll"?!0:m.ctrlKey:Me&&!m.button&&!m.ctrlKey},b=A.zoom().scaleExtent(xe).translateExtent(ge||[[-20,-20],[x+20,p+20]]).filter(g).on("zoom",({transform:m})=>{t.attr("transform",m)});r.call(b),G.current=b},[p,x,D]);const V=A.index_default$1({...v,features:ve?v.features.filter(t=>(k||[]).length===0||k.indexOf(t.properties[R])!==-1):v.features}),f=It.index_default({...v,features:ve?v.features.filter(t=>(k||[]).length===0||k.indexOf(t.properties[R])!==-1):v.features}),O=V[2]-V[0],ne=V[3]-V[1],Re=x*190/960*360/O,De=p*190/678*180/ne,M=Pe*Math.min(Re,De),Se=W==="mercator"?A.geoMercator().rotate(_).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):W==="equalEarth"?A.geoEqualEarth().rotate(_).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):W==="naturalEarth"?A.geoNaturalEarth1().rotate(_).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):W==="orthographic"?A.geoOrthographic().rotate(_).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):A.geoAlbersUsa().rotate(_).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M),U=A.geoPath().projection(Se),Ne=Array.from({length:u.length},(t,r)=>r),Oe=Array.from({length:Y.length},(t,r)=>r),ae=Ct.threshold().domain(u).range(Ne),ie=Ct.threshold().domain(Y).range(Oe),se=t=>{if(!w.current||!G.current)return;xt.select(w.current).call(G.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(et.motion.svg,{viewBox:`0 0 ${x} ${p}`,width:`${x}px`,height:`${p}px`,ref:w,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:we,children:[ee.filter(t=>t.position==="before").map(t=>t.layer),v.features.map((t,r)=>{if(!t.properties?.[R])return null;const g=U(t);return g?o.jsxRuntimeExports.jsx(et.motion.g,{opacity:T?N:k.length!==0?k.indexOf(t.properties[R])!==-1?1:N:1,children:o.jsxRuntimeExports.jsx("path",{d:g,style:{stroke:pe,strokeWidth:F,fill:K}})},r):null}),o.jsxRuntimeExports.jsx(Bt.AnimatePresence,{children:e.map(t=>{const r=v.features.findIndex(j=>t.id===j.properties[R]);if(r===-1)return null;const g=U(v.features[r]);if(!g)return null;const b=kt.checkIfNullOrUndefined(t.x)?void 0:ae(t.x),m=kt.checkIfNullOrUndefined(t.y)?void 0:ie(t.y),C=b!==void 0&&m!==void 0?h[m][b]:K;return o.jsxRuntimeExports.jsx(et.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:T?T===C?1:N:k.length!==0?k.indexOf(t.id)!==-1?1:N:1,transition:{duration:S.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},onMouseEnter:j=>{te(t),$(j.clientY),oe(j.clientX),he?.(t)},onClick:()=>{(Q||y)&&(qt.isEqual(H,t)&&Ae?(c(void 0),Q?.(void 0)):(c(t),Q?.(t)))},onMouseMove:j=>{te(t),$(j.clientY),oe(j.clientX)},onMouseLeave:()=>{te(void 0),oe(void 0),$(void 0),he?.(void 0)},children:o.jsxRuntimeExports.jsx(et.motion.path,{d:g,variants:{initial:{fill:C,opacity:0},whileInView:{fill:C,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},className:`${C===K?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"stroke-primary-white dark:stroke-primary-gray-650"}`,style:{stroke:pe,strokeWidth:F}},`${t.id}`)},t.id)})}),l?v.features.filter(t=>t.properties[R]===l.id).map((t,r)=>o.jsxRuntimeExports.jsx("path",{d:U(t)||"",className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},r)):null,ee.filter(t=>t.position==="after").map(t=>t.layer)]})}),fe===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",L?.colorLegend),children:Fe?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{be(!1)},children:o.jsxRuntimeExports.jsx(ft.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:"175px"},children:[o.jsxRuntimeExports.jsxs("div",{className:"flex gap-1 items-center",children:[o.jsxRuntimeExports.jsx("svg",{width:"136px",viewBox:"0 0 136 136",className:"shrink-0",children:o.jsxRuntimeExports.jsxs("g",{children:[h.map((t,r)=>o.jsxRuntimeExports.jsx("g",{transform:`translate(0,${100-r*25})`,children:t.map((g,b)=>o.jsxRuntimeExports.jsx("rect",{y:1,x:b*25+1,fill:g,width:23,height:23,strokeWidth:T===g?2:.25,style:{cursor:"pointer"},onMouseOver:()=>{Ee(g)},onMouseLeave:()=>{Ee(void 0)}},b))},r)),o.jsxRuntimeExports.jsx("g",{transform:"translate(0,125)",children:u.map((t,r)=>o.jsxRuntimeExports.jsx("text",{y:10,x:(r+1)*25,fontSize:10,textAnchor:"middle",children:typeof t=="string"||t<1?t:Et.numberFormattingFunction(t,"NA")},r))}),Y.map((t,r)=>o.jsxRuntimeExports.jsx("g",{transform:`translate(${Math.max(Math.min(u.length+1,5),4)*25+10},${100-r*25})`,children:o.jsxRuntimeExports.jsx("text",{x:0,transform:"rotate(-90)",y:0,fontSize:10,textAnchor:"middle",children:typeof t=="string"||t<1?t:Et.numberFormattingFunction(t,"NA")})},r))]})}),o.jsxRuntimeExports.jsx(bt.j,{marginBottom:"none",size:"xs",className:"leading-normal text-center shrink-0",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical",overflow:"hidden",writingMode:"vertical-rl",height:"8.5rem",transform:"rotate(180deg)"},children:J})]}),o.jsxRuntimeExports.jsx(bt.j,{marginBottom:"none",size:"xs",className:"mt-1 leading-normal text-center",style:{display:"-webkit-box",WebkitLineClamp:"1",width:"8.5rem",WebkitBoxOrient:"vertical",overflow:"hidden"},children:ze})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{be(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),D==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>se("in"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>se("out"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),l&&Z&&ke&&Ce?o.jsxRuntimeExports.jsx(zt.Tooltip,{data:l,body:Z,xPos:ke,yPos:Ce,backgroundStyle:Be?.tooltip,className:L?.tooltip}):null,y&&H!==void 0?o.jsxRuntimeExports.jsx(Pt.DetailsModal,{body:y,data:H,setData:c,className:L?.modal}):null]})}function Tt(a){const e=o.compilerRuntimeExports.c(121),{data:u,graphTitle:B,mapData:ze,colors:Y,sources:J,graphDescription:x,height:p,width:h,footNote:Pe,xDomain:E,yDomain:F,xColorLegendTitle:K,yColorLegendTitle:pe,tooltip:Z,scale:he,centerPoint:xe,padding:ge,mapBorderWidth:k,mapNoDataColor:Q,backgroundColor:R,mapBorderColor:Ae,relativeHeight:y,onSeriesMouseOver:fe,isWorldMap:Be,zoomScaleExtend:L,zoomTranslateExtend:W,graphID:D,showColorScale:S,highlightedIds:N,onSeriesMouseClick:ee,mapProperty:ye,graphDownload:ve,dataDownload:_,showAntarctica:je,language:v,minHeight:Fe,theme:be,ariaLabel:T,resetSelectionOnDoubleClick:Ee,detailsOnClick:H,styles:c,classNames:l,mapProjection:te,zoomInteraction:ke,animate:oe,dimmedOpacity:Ce,customLayers:$,timeline:w,collapseColorScaleByDefault:re,zoomAndCenterByHighlightedIds:we,projectionRotate:G,rewindCoordinatesInMapData:V}=a,f=ze===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":ze,O=Y===void 0?gt.Colors.light.bivariateColors.colors05x05:Y,ne=Pe===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":Pe,Re=K===void 0?"X Color key":K,De=pe===void 0?"Y Color key":pe,M=he===void 0?.95:he,Se=k===void 0?.5:k,U=Q===void 0?gt.Colors.light.graphNoData:Q,Ne=R===void 0?!1:R,Oe=Ae===void 0?gt.Colors.light.grays["gray-500"]:Ae,ae=Be===void 0?!0:Be;let ie;e[0]!==L?(ie=L===void 0?[.8,6]:L,e[0]=L,e[1]=ie):ie=e[1];const se=ie,t=S===void 0?!0:S;let r;e[2]!==N?(r=N===void 0?[]:N,e[2]=N,e[3]=r):r=e[3];const g=r,b=ye===void 0?"ISO3":ye,m=ve===void 0?!1:ve,C=_===void 0?!1:_,j=je===void 0?!1:je,Me=v===void 0?"en":v,q=Fe===void 0?0:Fe,tt=be===void 0?"light":be,ot=Ee===void 0?!0:Ee,rt=te===void 0?"naturalEarth":te,nt=ke===void 0?"button":ke,Le=oe===void 0?!1:oe,at=Ce===void 0?.3:Ce;let We;e[4]!==$?(We=$===void 0?[]:$,e[4]=$,e[5]=We):We=e[5];const it=We;let _e;e[6]!==w?(_e=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,e[6]=w,e[7]=_e):_e=e[7];const n=_e,st=we===void 0?!1:we;let Te;e[8]!==G?(Te=G===void 0?[0,0]:G,e[8]=G,e[9]=Te):Te=e[9];const lt=Te,ct=V===void 0?!0:V,[X,Dt]=s.useState(0),[qe,St]=s.useState(0),[I,Nt]=s.useState(n.autoplay);let Ie;if(e[10]!==u||e[11]!==n.dateFormat){let d;e[13]!==n.dateFormat?(d=P=>jt.parse(`${P.date}`,n.dateFormat||"yyyy",new Date).getTime(),e[13]=n.dateFormat,e[14]=d):d=e[14],Ie=[...new Set(u.filter(Zt).map(d))],Ie.sort(Kt),e[10]=u,e[11]=n.dateFormat,e[12]=Ie}else Ie=e[12];const i=Ie,[z,dt]=s.useState(n.autoplay?0:i.length-1),[le,Ot]=s.useState(void 0),ut=s.useRef(null),yt=s.useRef(null);let $e,Ge;e[15]===Symbol.for("react.memo_cache_sentinel")?($e=()=>{const d=new ResizeObserver(P=>{Dt(P[0].target.clientWidth||620),St(P[0].target.clientHeight||480)});return ut.current&&d.observe(ut.current),()=>d.disconnect()},Ge=[],e[15]=$e,e[16]=Ge):($e=e[15],Ge=e[16]),s.useEffect($e,Ge);let He;e[17]===Symbol.for("react.memo_cache_sentinel")?(He=d=>{Ot(d)},e[17]=He):He=e[17];const Ve=s.useEffectEvent(He);let Ue;e[18]!==f||e[19]!==Ve?(Ue=()=>{typeof f=="string"?Wt.fetchAndParseJSON(f).then(P=>{Ve(P)}):Ve(f)},e[18]=f,e[19]=Ve,e[20]=Ue):Ue=e[20];let Xe;e[21]!==f?(Xe=[f],e[21]=f,e[22]=Xe):Xe=e[22],s.useEffect(Ue,Xe);let Ye,Je;e[23]!==I||e[24]!==n.speed||e[25]!==i?(Ye=()=>{const d=setInterval(()=>{dt(P=>P<i.length-1?P+1:0)},(n.speed||2)*1e3);return I||clearInterval(d),()=>clearInterval(d)},Je=[i,I,n.speed],e[23]=I,e[24]=n.speed,e[25]=i,e[26]=Ye,e[27]=Je):(Ye=e[26],Je=e[27]),s.useEffect(Ye,Je);const mt=n.dateFormat||"yyyy";let Ke;e[28]!==z||e[29]!==mt||e[30]!==n.showOnlyActiveDate||e[31]!==i?(Ke=vt.getSliderMarks(i,z,n.showOnlyActiveDate,mt),e[28]=z,e[29]=mt,e[30]=n.showOnlyActiveDate,e[31]=i,e[32]=Ke):Ke=e[32];const Ze=Ke;if(E&&F&&(E.length!==O[0].length-1||F.length!==O.length-1))return console.error("the xDomain and yDomain array length don't match to the color array length"),null;const pt=l?.graphContainer,ht=c?.graphContainer;let ce;e[33]!==l?.description||e[34]!==l?.title||e[35]!==u||e[36]!==C||e[37]!==x||e[38]!==m||e[39]!==B||e[40]!==c?.description||e[41]!==c?.title||e[42]!==h?(ce=B||x||m||C?o.jsxRuntimeExports.jsx(Ft.GraphHeader,{styles:{title:c?.title,description:c?.description},classNames:{title:l?.title,description:l?.description},graphTitle:B,graphDescription:x,width:h,graphDownload:m?yt:void 0,dataDownload:C?u.map(Jt).filter(Yt).length>0?u.map(Xt).filter(Ut):u.filter(Vt):null}):null,e[33]=l?.description,e[34]=l?.title,e[35]=u,e[36]=C,e[37]=x,e[38]=m,e[39]=B,e[40]=c?.description,e[41]=c?.title,e[42]=h,e[43]=ce):ce=e[43];let de;e[44]!==z||e[45]!==Ze||e[46]!==I||e[47]!==n.enabled||e[48]!==i?(de=n.enabled&&i.length>0&&Ze?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Nt(!I)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":I?"Click to pause animation":"Click to play animation",children:I?o.jsxRuntimeExports.jsx(ft.Pause,{}):o.jsxRuntimeExports.jsx(ft.Play,{})}),o.jsxRuntimeExports.jsx(vt.Nr,{min:i[0],max:i[i.length-1],marks:Ze,step:null,defaultValue:i[i.length-1],value:i[z],onChangeComplete:d=>{dt(i.indexOf(d))},onChange:d=>{dt(i.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[44]=z,e[45]=Ze,e[46]=I,e[47]=n.enabled,e[48]=i,e[49]=de):de=e[49];let ue;e[50]!==Le||e[51]!==xe||e[52]!==l||e[53]!==re||e[54]!==O||e[55]!==it||e[56]!==u||e[57]!==H||e[58]!==at||e[59]!==p||e[60]!==g||e[61]!==z||e[62]!==ae||e[63]!==Oe||e[64]!==Se||e[65]!==U||e[66]!==rt||e[67]!==b||e[68]!==le||e[69]!==q||e[70]!==ee||e[71]!==fe||e[72]!==lt||e[73]!==y||e[74]!==ot||e[75]!==ct||e[76]!==M||e[77]!==j||e[78]!==t||e[79]!==c||e[80]!==qe||e[81]!==X||e[82]!==n.dateFormat||e[83]!==n.enabled||e[84]!==Z||e[85]!==i||e[86]!==h||e[87]!==Re||e[88]!==E||e[89]!==De||e[90]!==F||e[91]!==st||e[92]!==nt||e[93]!==se||e[94]!==W?(ue=o.jsxRuntimeExports.jsx(Rt.GraphArea,{ref:ut,children:X&&qe&&le?o.jsxRuntimeExports.jsx(_t,{data:u.filter(d=>n.enabled?d.date===jt.format(new Date(i[z]),n.dateFormat||"yyyy"):d),mapData:j?le:{...le,features:le.features.filter(Ht)},xDomain:E||wt.getJenks(u.map(Gt),O[0].length),yDomain:F||wt.getJenks(u.map($t),O.length),width:X,height:qe,scale:M,centerPoint:xe,colors:O,xColorLegendTitle:Re,yColorLegendTitle:De,mapBorderWidth:Se,mapNoDataColor:U,mapBorderColor:Oe,tooltip:Z,onSeriesMouseOver:fe,isWorldMap:ae,zoomScaleExtend:se,zoomTranslateExtend:W,onSeriesMouseClick:ee,mapProperty:b,highlightedIds:g,resetSelectionOnDoubleClick:ot,styles:c,showColorScale:t,classNames:l,mapProjection:rt||(ae?"naturalEarth":"mercator"),detailsOnClick:H,zoomInteraction:nt,animate:Le===!0?{duration:.5,once:!0,amount:.5}:Le||{duration:0,once:!0,amount:0},dimmedOpacity:at,customLayers:it,collapseColorScaleByDefault:re,zoomAndCenterByHighlightedIds:st,projectionRotate:lt,rewindCoordinatesInMapData:ct}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(q,p||(y?q?(h||X)*y>q?(h||X)*y:q:(h||X)*y:qe))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(Mt.w,{"aria-label":"Loading graph"})})}),e[50]=Le,e[51]=xe,e[52]=l,e[53]=re,e[54]=O,e[55]=it,e[56]=u,e[57]=H,e[58]=at,e[59]=p,e[60]=g,e[61]=z,e[62]=ae,e[63]=Oe,e[64]=Se,e[65]=U,e[66]=rt,e[67]=b,e[68]=le,e[69]=q,e[70]=ee,e[71]=fe,e[72]=lt,e[73]=y,e[74]=ot,e[75]=ct,e[76]=M,e[77]=j,e[78]=t,e[79]=c,e[80]=qe,e[81]=X,e[82]=n.dateFormat,e[83]=n.enabled,e[84]=Z,e[85]=i,e[86]=h,e[87]=Re,e[88]=E,e[89]=De,e[90]=F,e[91]=st,e[92]=nt,e[93]=se,e[94]=W,e[95]=ue):ue=e[95];let me;e[96]!==l?.footnote||e[97]!==l?.source||e[98]!==ne||e[99]!==J||e[100]!==c?.footnote||e[101]!==c?.source||e[102]!==h?(me=J||ne?o.jsxRuntimeExports.jsx(Lt.GraphFooter,{styles:{footnote:c?.footnote,source:c?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:J,footNote:ne,width:h}):null,e[96]=l?.footnote,e[97]=l?.source,e[98]=ne,e[99]=J,e[100]=c?.footnote,e[101]=c?.source,e[102]=h,e[103]=me):me=e[103];let Qe;return e[104]!==T||e[105]!==Ne||e[106]!==D||e[107]!==p||e[108]!==Me||e[109]!==q||e[110]!==ge||e[111]!==y||e[112]!==pt||e[113]!==ht||e[114]!==ce||e[115]!==de||e[116]!==ue||e[117]!==me||e[118]!==tt||e[119]!==h?(Qe=o.jsxRuntimeExports.jsxs(Rt.GraphContainer,{className:pt,style:ht,id:D,ref:yt,"aria-label":T,backgroundColor:Ne,theme:tt,language:Me,minHeight:q,width:h,height:p,relativeHeight:y,padding:ge,children:[ce,de,ue,me]}),e[104]=T,e[105]=Ne,e[106]=D,e[107]=p,e[108]=Me,e[109]=q,e[110]=ge,e[111]=y,e[112]=pt,e[113]=ht,e[114]=ce,e[115]=de,e[116]=ue,e[117]=me,e[118]=tt,e[119]=h,e[120]=Qe):Qe=e[120],Qe}function $t(a){return a.y}function Gt(a){return a.x}function Ht(a){return a.properties.NAME!=="Antarctica"}function Vt(a){return a!==void 0}function Ut(a){return a!==void 0}function Xt(a){return a.data}function Yt(a){return a!==void 0}function Jt(a){return a.data}function Kt(a,e){return a-e}function Zt(a){return a.date}exports.BiVariateChoroplethMap=Tt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),s=require("react"),vt=require("./getSliderMarks-CIuSoedo.cjs"),Mt=require("./Spinner-jTMOLuw_.cjs"),jt=require("./parse-xYI9yrvL.cjs"),qt=require("./index-DQA8q5sC.cjs"),A=require("./index-DLFt97gy.cjs"),It=require("./index-C5K--w8d.cjs"),bt=require("./Typography-DrJ7IOdw.cjs"),Et=require("./numberFormattingFunction-02t-wJta.cjs"),zt=require("./Tooltip-BLa2EfMs.cjs"),kt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ft=require("./index-sbKVyHS2.cjs"),Pt=require("./DetailsModal-DHttOA80.cjs"),xt=require("./select-Bnfk0lJx.cjs"),Ct=require("./threshold-DNsSUf8Q.cjs"),et=require("./proxy-C4-uo6nS.cjs"),At=require("./use-in-view-C3o_ntMv.cjs"),Bt=require("./index-CoobIWNj.cjs"),Ft=require("./GraphHeader.cjs"),_t=require("./GraphFooter.cjs"),gt=require("./Colors.cjs"),Lt=require("./fetchAndParseData-QTF6tjij.cjs"),wt=require("./getJenks-BzJvhy_H.cjs"),Rt=require("./GraphContainer-B1EDxJ0S.cjs");function Wt(a){const{data:e,xDomain:u,mapData:B,xColorLegendTitle:ze,yDomain:Y,yColorLegendTitle:J,width:x,height:p,colors:h,scale:Pe,centerPoint:E,mapBorderWidth:F,mapNoDataColor:K,mapBorderColor:pe,tooltip:Z,onSeriesMouseOver:he,zoomScaleExtend:xe,zoomTranslateExtend:ge,highlightedIds:k,onSeriesMouseClick:Q,mapProperty:R,resetSelectionOnDoubleClick:Ae,detailsOnClick:y,showColorScale:fe,styles:Be,classNames:_,mapProjection:L,zoomInteraction:D,animate:S,dimmedOpacity:N,customLayers:ee,collapseColorScaleByDefault:ye,zoomAndCenterByHighlightedIds:ve,projectionRotate:W,rewindCoordinatesInMapData:je}=a,v=s.useMemo(()=>je?A.index_default(B,{reverse:!0}):B,[B,je]),[Fe,be]=s.useState(ye===void 0?!(x<680):!ye),[T,Ee]=s.useState(void 0),[H,c]=s.useState(void 0),[l,te]=s.useState(void 0),[ke,oe]=s.useState(void 0),[Ce,$]=s.useState(void 0),w=s.useRef(null),re=At.useInView(w,{once:S.once,amount:S.amount}),we=s.useRef(null),G=s.useRef(null);s.useEffect(()=>{const t=xt.select(we.current),r=xt.select(w.current),g=m=>{if(D==="noZoom")return!1;if(D==="button")return!m.type.includes("wheel");const C=m.type==="wheel",j=m.type.startsWith("touch"),Me=m.type==="mousedown"||m.type==="mousemove";return j?!0:C?D==="scroll"?!0:m.ctrlKey:Me&&!m.button&&!m.ctrlKey},b=A.zoom().scaleExtent(xe).translateExtent(ge||[[-20,-20],[x+20,p+20]]).filter(g).on("zoom",({transform:m})=>{t.attr("transform",m)});r.call(b),G.current=b},[p,x,D]);const V=A.index_default$1({...v,features:ve?v.features.filter(t=>(k||[]).length===0||k.indexOf(t.properties[R])!==-1):v.features}),f=It.index_default({...v,features:ve?v.features.filter(t=>(k||[]).length===0||k.indexOf(t.properties[R])!==-1):v.features}),O=(V[2]-V[0])*1.15,ne=(V[3]-V[1])*1.15,Re=x*190/960*360/O,De=p*190/678*180/ne,M=Pe*Math.min(Re,De),Se=L==="mercator"?A.geoMercator().rotate(W).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):L==="equalEarth"?A.geoEqualEarth().rotate(W).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):L==="naturalEarth"?A.geoNaturalEarth1().rotate(W).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):L==="orthographic"?A.geoOrthographic().rotate(W).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):A.geoAlbersUsa().rotate(W).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M),U=A.geoPath().projection(Se),Ne=Array.from({length:u.length},(t,r)=>r),Oe=Array.from({length:Y.length},(t,r)=>r),ae=Ct.threshold().domain(u).range(Ne),ie=Ct.threshold().domain(Y).range(Oe),se=t=>{if(!w.current||!G.current)return;xt.select(w.current).call(G.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(et.motion.svg,{viewBox:`0 0 ${x} ${p}`,width:`${x}px`,height:`${p}px`,ref:w,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:we,children:[ee.filter(t=>t.position==="before").map(t=>t.layer),v.features.map((t,r)=>{if(!t.properties?.[R])return null;const g=U(t);return g?o.jsxRuntimeExports.jsx(et.motion.g,{opacity:T?N:k.length!==0?k.indexOf(t.properties[R])!==-1?1:N:1,children:o.jsxRuntimeExports.jsx("path",{d:g,style:{stroke:pe,strokeWidth:F,fill:K}})},r):null}),o.jsxRuntimeExports.jsx(Bt.AnimatePresence,{children:e.map(t=>{const r=v.features.findIndex(j=>t.id===j.properties[R]);if(r===-1)return null;const g=U(v.features[r]);if(!g)return null;const b=kt.checkIfNullOrUndefined(t.x)?void 0:ae(t.x),m=kt.checkIfNullOrUndefined(t.y)?void 0:ie(t.y),C=b!==void 0&&m!==void 0?h[m][b]:K;return o.jsxRuntimeExports.jsx(et.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:T?T===C?1:N:k.length!==0?k.indexOf(t.id)!==-1?1:N:1,transition:{duration:S.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},onMouseEnter:j=>{te(t),$(j.clientY),oe(j.clientX),he?.(t)},onClick:()=>{(Q||y)&&(qt.isEqual(H,t)&&Ae?(c(void 0),Q?.(void 0)):(c(t),Q?.(t)))},onMouseMove:j=>{te(t),$(j.clientY),oe(j.clientX)},onMouseLeave:()=>{te(void 0),oe(void 0),$(void 0),he?.(void 0)},children:o.jsxRuntimeExports.jsx(et.motion.path,{d:g,variants:{initial:{fill:C,opacity:0},whileInView:{fill:C,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},className:`${C===K?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"stroke-primary-white dark:stroke-primary-gray-650"}`,style:{stroke:pe,strokeWidth:F}},`${t.id}`)},t.id)})}),l?v.features.filter(t=>t.properties[R]===l.id).map((t,r)=>o.jsxRuntimeExports.jsx("path",{d:U(t)||"",className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},r)):null,ee.filter(t=>t.position==="after").map(t=>t.layer)]})}),fe===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",_?.colorLegend),children:Fe?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{be(!1)},children:o.jsxRuntimeExports.jsx(ft.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:"175px"},children:[o.jsxRuntimeExports.jsxs("div",{className:"flex gap-1 items-center",children:[o.jsxRuntimeExports.jsx("svg",{width:"136px",viewBox:"0 0 136 136",className:"shrink-0",children:o.jsxRuntimeExports.jsxs("g",{children:[h.map((t,r)=>o.jsxRuntimeExports.jsx("g",{transform:`translate(0,${100-r*25})`,children:t.map((g,b)=>o.jsxRuntimeExports.jsx("rect",{y:1,x:b*25+1,fill:g,width:23,height:23,strokeWidth:T===g?2:.25,style:{cursor:"pointer"},onMouseOver:()=>{Ee(g)},onMouseLeave:()=>{Ee(void 0)}},b))},r)),o.jsxRuntimeExports.jsx("g",{transform:"translate(0,125)",children:u.map((t,r)=>o.jsxRuntimeExports.jsx("text",{y:10,x:(r+1)*25,fontSize:10,textAnchor:"middle",children:typeof t=="string"||t<1?t:Et.numberFormattingFunction(t,"NA")},r))}),Y.map((t,r)=>o.jsxRuntimeExports.jsx("g",{transform:`translate(${Math.max(Math.min(u.length+1,5),4)*25+10},${100-r*25})`,children:o.jsxRuntimeExports.jsx("text",{x:0,transform:"rotate(-90)",y:0,fontSize:10,textAnchor:"middle",children:typeof t=="string"||t<1?t:Et.numberFormattingFunction(t,"NA")})},r))]})}),o.jsxRuntimeExports.jsx(bt._,{marginBottom:"none",size:"xs",className:"leading-normal text-center shrink-0",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical",overflow:"hidden",writingMode:"vertical-rl",height:"8.5rem",transform:"rotate(180deg)"},children:J})]}),o.jsxRuntimeExports.jsx(bt._,{marginBottom:"none",size:"xs",className:"mt-1 leading-normal text-center",style:{display:"-webkit-box",WebkitLineClamp:"1",width:"8.5rem",WebkitBoxOrient:"vertical",overflow:"hidden"},children:ze})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{be(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),D==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>se("in"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>se("out"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),l&&Z&&ke&&Ce?o.jsxRuntimeExports.jsx(zt.Tooltip,{data:l,body:Z,xPos:ke,yPos:Ce,backgroundStyle:Be?.tooltip,className:_?.tooltip}):null,y&&H!==void 0?o.jsxRuntimeExports.jsx(Pt.DetailsModal,{body:y,data:H,setData:c,className:_?.modal}):null]})}function Tt(a){const e=o.compilerRuntimeExports.c(121),{data:u,graphTitle:B,mapData:ze,colors:Y,sources:J,graphDescription:x,height:p,width:h,footNote:Pe,xDomain:E,yDomain:F,xColorLegendTitle:K,yColorLegendTitle:pe,tooltip:Z,scale:he,centerPoint:xe,padding:ge,mapBorderWidth:k,mapNoDataColor:Q,backgroundColor:R,mapBorderColor:Ae,relativeHeight:y,onSeriesMouseOver:fe,isWorldMap:Be,zoomScaleExtend:_,zoomTranslateExtend:L,graphID:D,showColorScale:S,highlightedIds:N,onSeriesMouseClick:ee,mapProperty:ye,graphDownload:ve,dataDownload:W,showAntarctica:je,language:v,minHeight:Fe,theme:be,ariaLabel:T,resetSelectionOnDoubleClick:Ee,detailsOnClick:H,styles:c,classNames:l,mapProjection:te,zoomInteraction:ke,animate:oe,dimmedOpacity:Ce,customLayers:$,timeline:w,collapseColorScaleByDefault:re,zoomAndCenterByHighlightedIds:we,projectionRotate:G,rewindCoordinatesInMapData:V}=a,f=ze===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":ze,O=Y===void 0?gt.Colors.light.bivariateColors.colors05x05:Y,ne=Pe===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":Pe,Re=K===void 0?"X Color key":K,De=pe===void 0?"Y Color key":pe,M=he===void 0?.95:he,Se=k===void 0?.5:k,U=Q===void 0?gt.Colors.light.graphNoData:Q,Ne=R===void 0?!1:R,Oe=Ae===void 0?gt.Colors.light.grays["gray-500"]:Ae,ae=Be===void 0?!0:Be;let ie;e[0]!==_?(ie=_===void 0?[.8,6]:_,e[0]=_,e[1]=ie):ie=e[1];const se=ie,t=S===void 0?!0:S;let r;e[2]!==N?(r=N===void 0?[]:N,e[2]=N,e[3]=r):r=e[3];const g=r,b=ye===void 0?"ISO3":ye,m=ve===void 0?!1:ve,C=W===void 0?!1:W,j=je===void 0?!1:je,Me=v===void 0?"en":v,q=Fe===void 0?0:Fe,tt=be===void 0?"light":be,ot=Ee===void 0?!0:Ee,rt=te===void 0?"naturalEarth":te,nt=ke===void 0?"button":ke,_e=oe===void 0?!1:oe,at=Ce===void 0?.3:Ce;let Le;e[4]!==$?(Le=$===void 0?[]:$,e[4]=$,e[5]=Le):Le=e[5];const it=Le;let We;e[6]!==w?(We=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,e[6]=w,e[7]=We):We=e[7];const n=We,st=we===void 0?!1:we;let Te;e[8]!==G?(Te=G===void 0?[0,0]:G,e[8]=G,e[9]=Te):Te=e[9];const lt=Te,ct=V===void 0?!0:V,[X,Dt]=s.useState(0),[qe,St]=s.useState(0),[I,Nt]=s.useState(n.autoplay);let Ie;if(e[10]!==u||e[11]!==n.dateFormat){let d;e[13]!==n.dateFormat?(d=P=>jt.parse(`${P.date}`,n.dateFormat||"yyyy",new Date).getTime(),e[13]=n.dateFormat,e[14]=d):d=e[14],Ie=[...new Set(u.filter(Zt).map(d))],Ie.sort(Kt),e[10]=u,e[11]=n.dateFormat,e[12]=Ie}else Ie=e[12];const i=Ie,[z,dt]=s.useState(n.autoplay?0:i.length-1),[le,Ot]=s.useState(void 0),ut=s.useRef(null),yt=s.useRef(null);let $e,Ge;e[15]===Symbol.for("react.memo_cache_sentinel")?($e=()=>{const d=new ResizeObserver(P=>{Dt(P[0].target.clientWidth||620),St(P[0].target.clientHeight||480)});return ut.current&&d.observe(ut.current),()=>d.disconnect()},Ge=[],e[15]=$e,e[16]=Ge):($e=e[15],Ge=e[16]),s.useEffect($e,Ge);let He;e[17]===Symbol.for("react.memo_cache_sentinel")?(He=d=>{Ot(d)},e[17]=He):He=e[17];const Ve=s.useEffectEvent(He);let Ue;e[18]!==f||e[19]!==Ve?(Ue=()=>{typeof f=="string"?Lt.fetchAndParseJSON(f).then(P=>{Ve(P)}):Ve(f)},e[18]=f,e[19]=Ve,e[20]=Ue):Ue=e[20];let Xe;e[21]!==f?(Xe=[f],e[21]=f,e[22]=Xe):Xe=e[22],s.useEffect(Ue,Xe);let Ye,Je;e[23]!==I||e[24]!==n.speed||e[25]!==i?(Ye=()=>{const d=setInterval(()=>{dt(P=>P<i.length-1?P+1:0)},(n.speed||2)*1e3);return I||clearInterval(d),()=>clearInterval(d)},Je=[i,I,n.speed],e[23]=I,e[24]=n.speed,e[25]=i,e[26]=Ye,e[27]=Je):(Ye=e[26],Je=e[27]),s.useEffect(Ye,Je);const mt=n.dateFormat||"yyyy";let Ke;e[28]!==z||e[29]!==mt||e[30]!==n.showOnlyActiveDate||e[31]!==i?(Ke=vt.getSliderMarks(i,z,n.showOnlyActiveDate,mt),e[28]=z,e[29]=mt,e[30]=n.showOnlyActiveDate,e[31]=i,e[32]=Ke):Ke=e[32];const Ze=Ke;if(E&&F&&(E.length!==O[0].length-1||F.length!==O.length-1))return console.error("the xDomain and yDomain array length don't match to the color array length"),null;const pt=l?.graphContainer,ht=c?.graphContainer;let ce;e[33]!==l?.description||e[34]!==l?.title||e[35]!==u||e[36]!==C||e[37]!==x||e[38]!==m||e[39]!==B||e[40]!==c?.description||e[41]!==c?.title||e[42]!==h?(ce=B||x||m||C?o.jsxRuntimeExports.jsx(Ft.GraphHeader,{styles:{title:c?.title,description:c?.description},classNames:{title:l?.title,description:l?.description},graphTitle:B,graphDescription:x,width:h,graphDownload:m?yt:void 0,dataDownload:C?u.map(Jt).filter(Yt).length>0?u.map(Xt).filter(Ut):u.filter(Vt):null}):null,e[33]=l?.description,e[34]=l?.title,e[35]=u,e[36]=C,e[37]=x,e[38]=m,e[39]=B,e[40]=c?.description,e[41]=c?.title,e[42]=h,e[43]=ce):ce=e[43];let de;e[44]!==z||e[45]!==Ze||e[46]!==I||e[47]!==n.enabled||e[48]!==i?(de=n.enabled&&i.length>0&&Ze?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Nt(!I)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":I?"Click to pause animation":"Click to play animation",children:I?o.jsxRuntimeExports.jsx(ft.Pause,{}):o.jsxRuntimeExports.jsx(ft.Play,{})}),o.jsxRuntimeExports.jsx(vt.Nr,{min:i[0],max:i[i.length-1],marks:Ze,step:null,defaultValue:i[i.length-1],value:i[z],onChangeComplete:d=>{dt(i.indexOf(d))},onChange:d=>{dt(i.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[44]=z,e[45]=Ze,e[46]=I,e[47]=n.enabled,e[48]=i,e[49]=de):de=e[49];let ue;e[50]!==_e||e[51]!==xe||e[52]!==l||e[53]!==re||e[54]!==O||e[55]!==it||e[56]!==u||e[57]!==H||e[58]!==at||e[59]!==p||e[60]!==g||e[61]!==z||e[62]!==ae||e[63]!==Oe||e[64]!==Se||e[65]!==U||e[66]!==rt||e[67]!==b||e[68]!==le||e[69]!==q||e[70]!==ee||e[71]!==fe||e[72]!==lt||e[73]!==y||e[74]!==ot||e[75]!==ct||e[76]!==M||e[77]!==j||e[78]!==t||e[79]!==c||e[80]!==qe||e[81]!==X||e[82]!==n.dateFormat||e[83]!==n.enabled||e[84]!==Z||e[85]!==i||e[86]!==h||e[87]!==Re||e[88]!==E||e[89]!==De||e[90]!==F||e[91]!==st||e[92]!==nt||e[93]!==se||e[94]!==L?(ue=o.jsxRuntimeExports.jsx(Rt.GraphArea,{ref:ut,children:X&&qe&&le?o.jsxRuntimeExports.jsx(Wt,{data:u.filter(d=>n.enabled?d.date===jt.format(new Date(i[z]),n.dateFormat||"yyyy"):d),mapData:j?le:{...le,features:le.features.filter(Ht)},xDomain:E||wt.getJenks(u.map(Gt),O[0].length),yDomain:F||wt.getJenks(u.map($t),O.length),width:X,height:qe,scale:M,centerPoint:xe,colors:O,xColorLegendTitle:Re,yColorLegendTitle:De,mapBorderWidth:Se,mapNoDataColor:U,mapBorderColor:Oe,tooltip:Z,onSeriesMouseOver:fe,isWorldMap:ae,zoomScaleExtend:se,zoomTranslateExtend:L,onSeriesMouseClick:ee,mapProperty:b,highlightedIds:g,resetSelectionOnDoubleClick:ot,styles:c,showColorScale:t,classNames:l,mapProjection:rt||(ae?"naturalEarth":"mercator"),detailsOnClick:H,zoomInteraction:nt,animate:_e===!0?{duration:.5,once:!0,amount:.5}:_e||{duration:0,once:!0,amount:0},dimmedOpacity:at,customLayers:it,collapseColorScaleByDefault:re,zoomAndCenterByHighlightedIds:st,projectionRotate:lt,rewindCoordinatesInMapData:ct}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(q,p||(y?q?(h||X)*y>q?(h||X)*y:q:(h||X)*y:qe))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(Mt.w,{"aria-label":"Loading graph"})})}),e[50]=_e,e[51]=xe,e[52]=l,e[53]=re,e[54]=O,e[55]=it,e[56]=u,e[57]=H,e[58]=at,e[59]=p,e[60]=g,e[61]=z,e[62]=ae,e[63]=Oe,e[64]=Se,e[65]=U,e[66]=rt,e[67]=b,e[68]=le,e[69]=q,e[70]=ee,e[71]=fe,e[72]=lt,e[73]=y,e[74]=ot,e[75]=ct,e[76]=M,e[77]=j,e[78]=t,e[79]=c,e[80]=qe,e[81]=X,e[82]=n.dateFormat,e[83]=n.enabled,e[84]=Z,e[85]=i,e[86]=h,e[87]=Re,e[88]=E,e[89]=De,e[90]=F,e[91]=st,e[92]=nt,e[93]=se,e[94]=L,e[95]=ue):ue=e[95];let me;e[96]!==l?.footnote||e[97]!==l?.source||e[98]!==ne||e[99]!==J||e[100]!==c?.footnote||e[101]!==c?.source||e[102]!==h?(me=J||ne?o.jsxRuntimeExports.jsx(_t.GraphFooter,{styles:{footnote:c?.footnote,source:c?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:J,footNote:ne,width:h}):null,e[96]=l?.footnote,e[97]=l?.source,e[98]=ne,e[99]=J,e[100]=c?.footnote,e[101]=c?.source,e[102]=h,e[103]=me):me=e[103];let Qe;return e[104]!==T||e[105]!==Ne||e[106]!==D||e[107]!==p||e[108]!==Me||e[109]!==q||e[110]!==ge||e[111]!==y||e[112]!==pt||e[113]!==ht||e[114]!==ce||e[115]!==de||e[116]!==ue||e[117]!==me||e[118]!==tt||e[119]!==h?(Qe=o.jsxRuntimeExports.jsxs(Rt.GraphContainer,{className:pt,style:ht,id:D,ref:yt,"aria-label":T,backgroundColor:Ne,theme:tt,language:Me,minHeight:q,width:h,height:p,relativeHeight:y,padding:ge,children:[ce,de,ue,me]}),e[104]=T,e[105]=Ne,e[106]=D,e[107]=p,e[108]=Me,e[109]=q,e[110]=ge,e[111]=y,e[112]=pt,e[113]=ht,e[114]=ce,e[115]=de,e[116]=ue,e[117]=me,e[118]=tt,e[119]=h,e[120]=Qe):Qe=e[120],Qe}function $t(a){return a.y}function Gt(a){return a.x}function Ht(a){return a.properties.NAME!=="Antarctica"}function Vt(a){return a!==void 0}function Ut(a){return a!==void 0}function Xt(a){return a.data}function Yt(a){return a!==void 0}function Jt(a){return a.data}function Kt(a,e){return a-e}function Zt(a){return a.date}exports.BiVariateChoroplethMap=Tt;
2
2
  //# sourceMappingURL=BiVariateChoroplethMap.cjs.map