@bikdotai/bik-component-library 0.0.721-beta.33 → 0.0.721-beta.35

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 (143) hide show
  1. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +1 -0
  2. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
  3. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
  4. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +5 -1
  5. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js +1 -1
  6. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.styles.d.ts +6 -0
  7. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.styles.js +23 -2
  8. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraphModel.d.ts +11 -0
  9. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraphModel.js +1 -0
  10. package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
  11. package/dist/cjs/index.d.ts +0 -2
  12. package/dist/cjs/index.js +1 -1
  13. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +1 -0
  14. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
  15. package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
  16. package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +5 -1
  17. package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js +1 -1
  18. package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.styles.d.ts +6 -0
  19. package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.styles.js +24 -3
  20. package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraphModel.d.ts +11 -0
  21. package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraphModel.js +1 -0
  22. package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
  23. package/dist/esm/index.d.ts +0 -2
  24. package/dist/esm/index.js +1 -1
  25. package/package.json +1 -2
  26. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.d.ts +0 -4
  27. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +0 -1
  28. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.d.ts +0 -4
  29. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +0 -1
  30. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.d.ts +0 -4
  31. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +0 -1
  32. package/dist/cjs/components/feature-announcements/VideoModal.d.ts +0 -3
  33. package/dist/cjs/components/feature-announcements/VideoModal.js +0 -1
  34. package/dist/cjs/components/feature-announcements/constants/animations.d.ts +0 -27
  35. package/dist/cjs/components/feature-announcements/constants/animations.js +0 -1
  36. package/dist/cjs/components/feature-announcements/constants/dimensions.d.ts +0 -56
  37. package/dist/cjs/components/feature-announcements/constants/dimensions.js +0 -1
  38. package/dist/cjs/components/feature-announcements/constants/index.d.ts +0 -19
  39. package/dist/cjs/components/feature-announcements/constants/index.js +0 -1
  40. package/dist/cjs/components/feature-announcements/constants/localStorageKeys.d.ts +0 -18
  41. package/dist/cjs/components/feature-announcements/constants/localStorageKeys.js +0 -1
  42. package/dist/cjs/components/feature-announcements/constants/selectors.d.ts +0 -21
  43. package/dist/cjs/components/feature-announcements/constants/selectors.js +0 -1
  44. package/dist/cjs/components/feature-announcements/constants/zIndex.d.ts +0 -10
  45. package/dist/cjs/components/feature-announcements/constants/zIndex.js +0 -1
  46. package/dist/cjs/components/feature-announcements/hooks/index.d.ts +0 -1
  47. package/dist/cjs/components/feature-announcements/hooks/useFeatureAnnouncements.d.ts +0 -14
  48. package/dist/cjs/components/feature-announcements/hooks/useFeatureAnnouncements.js +0 -1
  49. package/dist/cjs/components/feature-announcements/index.d.ts +0 -7
  50. package/dist/cjs/components/feature-announcements/styles/index.d.ts +0 -4
  51. package/dist/cjs/components/feature-announcements/styles/joyride.styles.d.ts +0 -125
  52. package/dist/cjs/components/feature-announcements/styles/majorPopup.styles.d.ts +0 -23
  53. package/dist/cjs/components/feature-announcements/styles/majorPopup.styles.js +0 -1
  54. package/dist/cjs/components/feature-announcements/styles/minorPopup.styles.d.ts +0 -16
  55. package/dist/cjs/components/feature-announcements/styles/minorPopup.styles.js +0 -1
  56. package/dist/cjs/components/feature-announcements/styles/videoModal.styles.d.ts +0 -13
  57. package/dist/cjs/components/feature-announcements/styles/videoModal.styles.js +0 -1
  58. package/dist/cjs/components/feature-announcements/types/feature.types.d.ts +0 -52
  59. package/dist/cjs/components/feature-announcements/types/index.d.ts +0 -4
  60. package/dist/cjs/components/feature-announcements/types/props.types.d.ts +0 -43
  61. package/dist/cjs/components/feature-announcements/types/repository.types.d.ts +0 -11
  62. package/dist/cjs/components/feature-announcements/types/router.types.d.ts +0 -7
  63. package/dist/cjs/components/feature-announcements/useFeatureAnnouncements.d.ts +0 -13
  64. package/dist/cjs/components/feature-announcements/utils/animationHelpers.d.ts +0 -18
  65. package/dist/cjs/components/feature-announcements/utils/animationHelpers.js +0 -1
  66. package/dist/cjs/components/feature-announcements/utils/elementHelpers.d.ts +0 -30
  67. package/dist/cjs/components/feature-announcements/utils/elementHelpers.js +0 -1
  68. package/dist/cjs/components/feature-announcements/utils/htmlHelpers.d.ts +0 -18
  69. package/dist/cjs/components/feature-announcements/utils/htmlHelpers.js +0 -1
  70. package/dist/cjs/components/feature-announcements/utils/index.d.ts +0 -3
  71. package/dist/cjs/components/whats-new/WhatsNew.d.ts +0 -23
  72. package/dist/cjs/components/whats-new/WhatsNew.js +0 -1
  73. package/dist/cjs/components/whats-new/WhatsNew.styles.d.ts +0 -11
  74. package/dist/cjs/components/whats-new/WhatsNew.styles.js +0 -185
  75. package/dist/cjs/components/whats-new/WhatsNew.types.d.ts +0 -59
  76. package/dist/cjs/components/whats-new/WhatsNewButton.d.ts +0 -3
  77. package/dist/cjs/components/whats-new/WhatsNewButton.js +0 -1
  78. package/dist/cjs/components/whats-new/WhatsNewPanel.d.ts +0 -3
  79. package/dist/cjs/components/whats-new/WhatsNewPanel.js +0 -1
  80. package/dist/cjs/components/whats-new/WhatsNewProvider.d.ts +0 -4
  81. package/dist/cjs/components/whats-new/WhatsNewProvider.js +0 -1
  82. package/dist/cjs/components/whats-new/index.d.ts +0 -7
  83. package/dist/cjs/components/whats-new/useWhatsNew.d.ts +0 -10
  84. package/dist/cjs/components/whats-new/useWhatsNew.js +0 -1
  85. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.d.ts +0 -4
  86. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +0 -1
  87. package/dist/esm/components/feature-announcements/MajorUpdatePopup.d.ts +0 -4
  88. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +0 -1
  89. package/dist/esm/components/feature-announcements/MinorUpdatePopup.d.ts +0 -4
  90. package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +0 -1
  91. package/dist/esm/components/feature-announcements/VideoModal.d.ts +0 -3
  92. package/dist/esm/components/feature-announcements/VideoModal.js +0 -1
  93. package/dist/esm/components/feature-announcements/constants/animations.d.ts +0 -27
  94. package/dist/esm/components/feature-announcements/constants/animations.js +0 -1
  95. package/dist/esm/components/feature-announcements/constants/dimensions.d.ts +0 -56
  96. package/dist/esm/components/feature-announcements/constants/dimensions.js +0 -1
  97. package/dist/esm/components/feature-announcements/constants/index.d.ts +0 -19
  98. package/dist/esm/components/feature-announcements/constants/index.js +0 -1
  99. package/dist/esm/components/feature-announcements/constants/localStorageKeys.d.ts +0 -18
  100. package/dist/esm/components/feature-announcements/constants/localStorageKeys.js +0 -1
  101. package/dist/esm/components/feature-announcements/constants/selectors.d.ts +0 -21
  102. package/dist/esm/components/feature-announcements/constants/selectors.js +0 -1
  103. package/dist/esm/components/feature-announcements/constants/zIndex.d.ts +0 -10
  104. package/dist/esm/components/feature-announcements/constants/zIndex.js +0 -1
  105. package/dist/esm/components/feature-announcements/hooks/index.d.ts +0 -1
  106. package/dist/esm/components/feature-announcements/hooks/useFeatureAnnouncements.d.ts +0 -14
  107. package/dist/esm/components/feature-announcements/hooks/useFeatureAnnouncements.js +0 -1
  108. package/dist/esm/components/feature-announcements/index.d.ts +0 -7
  109. package/dist/esm/components/feature-announcements/styles/index.d.ts +0 -4
  110. package/dist/esm/components/feature-announcements/styles/joyride.styles.d.ts +0 -125
  111. package/dist/esm/components/feature-announcements/styles/majorPopup.styles.d.ts +0 -23
  112. package/dist/esm/components/feature-announcements/styles/majorPopup.styles.js +0 -1
  113. package/dist/esm/components/feature-announcements/styles/minorPopup.styles.d.ts +0 -16
  114. package/dist/esm/components/feature-announcements/styles/minorPopup.styles.js +0 -1
  115. package/dist/esm/components/feature-announcements/styles/videoModal.styles.d.ts +0 -13
  116. package/dist/esm/components/feature-announcements/styles/videoModal.styles.js +0 -1
  117. package/dist/esm/components/feature-announcements/types/feature.types.d.ts +0 -52
  118. package/dist/esm/components/feature-announcements/types/index.d.ts +0 -4
  119. package/dist/esm/components/feature-announcements/types/props.types.d.ts +0 -43
  120. package/dist/esm/components/feature-announcements/types/repository.types.d.ts +0 -11
  121. package/dist/esm/components/feature-announcements/types/router.types.d.ts +0 -7
  122. package/dist/esm/components/feature-announcements/useFeatureAnnouncements.d.ts +0 -13
  123. package/dist/esm/components/feature-announcements/utils/animationHelpers.d.ts +0 -18
  124. package/dist/esm/components/feature-announcements/utils/animationHelpers.js +0 -1
  125. package/dist/esm/components/feature-announcements/utils/elementHelpers.d.ts +0 -30
  126. package/dist/esm/components/feature-announcements/utils/elementHelpers.js +0 -1
  127. package/dist/esm/components/feature-announcements/utils/htmlHelpers.d.ts +0 -18
  128. package/dist/esm/components/feature-announcements/utils/htmlHelpers.js +0 -1
  129. package/dist/esm/components/feature-announcements/utils/index.d.ts +0 -3
  130. package/dist/esm/components/whats-new/WhatsNew.d.ts +0 -23
  131. package/dist/esm/components/whats-new/WhatsNew.js +0 -1
  132. package/dist/esm/components/whats-new/WhatsNew.styles.d.ts +0 -11
  133. package/dist/esm/components/whats-new/WhatsNew.styles.js +0 -185
  134. package/dist/esm/components/whats-new/WhatsNew.types.d.ts +0 -59
  135. package/dist/esm/components/whats-new/WhatsNewButton.d.ts +0 -3
  136. package/dist/esm/components/whats-new/WhatsNewButton.js +0 -1
  137. package/dist/esm/components/whats-new/WhatsNewPanel.d.ts +0 -3
  138. package/dist/esm/components/whats-new/WhatsNewPanel.js +0 -1
  139. package/dist/esm/components/whats-new/WhatsNewProvider.d.ts +0 -4
  140. package/dist/esm/components/whats-new/WhatsNewProvider.js +0 -1
  141. package/dist/esm/components/whats-new/index.d.ts +0 -7
  142. package/dist/esm/components/whats-new/useWhatsNew.d.ts +0 -10
  143. package/dist/esm/components/whats-new/useWhatsNew.js +0 -1
@@ -4,6 +4,7 @@ export interface AnalyticsTrendInterface {
4
4
  value?: number | string;
5
5
  trendPercent?: number;
6
6
  trendRaw?: number;
7
+ trendRawString?: string;
7
8
  formatVal?: boolean;
8
9
  timeline?: 'today' | 'yesterday' | '7 days' | '30 days' | 'custom';
9
10
  customRange?: Date[];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),s=require("../../constants/Theme.js"),r=require("../../assets/icons/arrow_down.svg.js"),o=require("../../assets/icons/arrow_up.svg.js"),l=require("../../assets/icons/info.svg.js"),a=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),x=require("../TypographyStyle.js"),u=require("./chart/utils/calcPercentage.js"),d=require("./CommonStyles.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=m(t);const j=n=>{let{percent:l,direction:a,timeline:d,customRange:m,trendRaw:p,prefixSymbol:j,trendIconStyle:g,isInternationalStore:h,tooltipTimelineText:y,customTimelineText:R}=n;const b=()=>{const e=((null!=p?p:0)>0?"+":"")+(null!=j?j:"");return void 0===p?"--":`${null!=e?e:""}${(()=>{let e="--";if(p)return e=String(h?u.truncateValueForInternationalStore(Math.abs(p)):u.truncateValueForIndianStore(Math.abs(p))),p<0?"-"+e:e})()}`},[f,O]=t.useState(b()),[S,T]=t.useState(R||"");t.useEffect((()=>{R||T("today"===d?"vs yesterday":"yesterday"===d?"vs 1 day before":"7 days"===d?"vs last 7 days":"30 days"===d?"vs last 30 days":"custom"===d&&m?i.default.getAnalyticsCustomDateTimelineText(m):"")}),[d,m]),t.useEffect((()=>{O(b())}),[p]);const v="negative"===a?r.default:o.default,E="negative"===a?s.COLORS.background.negative.vibrant:"positive"===a?s.COLORS.background.positive.vibrant:s.COLORS.content.placeholder;return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof l&&e.jsxRuntimeExports.jsx(v,{color:E,height:16,width:16,style:Object.assign({marginRight:2},null!=g?g:{})}),"number"==typeof l&&a&&e.jsxRuntimeExports.jsxs(x.Caption,Object.assign({style:{color:E}},{children:["neutral"===a?0:l<1e3?l:">999","%"]})),!!p&&e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:`(${f})`})),d&&(y?e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:y,placement:"bottom"},{children:e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:R||S}))})):e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:R||S})))]}))};exports.AnalyticsTrend=t=>{let{title:i,value:r,trendPercent:o,type:m="horizontal",timeline:g,customRange:h,tooltip:y,card:R=!0,rightSeparator:b=!1,size:f="big",share:O=!1,formatVal:S,prefixSymbol:T,trailingIcon:v,onTrailIconClick:E,iconTooltipBody:C,funnelPercent:w,isLoading:I,trendRaw:$,suffixText:L,trendStyle:q,trendContainerStyle:D,trendIconStyle:F,containerStyle:M,prevTrendDiff:k,relativePercentageDiff:P,isInternationalStore:V,Icon:_,iconContainerStyle:z,tooltipTimelineText:A,customTimelineText:N}=t;const B="big"===f?x.TitleLarge:x.TitleMedium,W=void 0!==o?o<0?"negative":0===o?"neutral":"positive":void 0,U=void 0!==o?O?Math.round(o):Math.abs(Math.round(o)):void 0;return e.jsxRuntimeExports.jsx(d.AnalyticsTrendContainer,Object.assign({card:R,style:Object.assign({},M)},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:_?12:4,borderRightWidth:b?1:0,borderRightColor:s.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:R?0:24,paddingRight:R?0:24,height:"100%",justifyContent:_?"flex-start":"space-between",alignItems:"center"},null!=D?D:{})},{children:[!!_&&e.jsxRuntimeExports.jsx(d.IconContainer,Object.assign({style:Object.assign({},z)},{children:e.jsxRuntimeExports.jsx(_,{})})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=q?q:{})},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsxRuntimeExports.jsx(x.BodyCaption,Object.assign({style:{color:s.COLORS.content.secondary}},{children:i})),y&&e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:y,placement:"right",width:300},{children:e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsxRuntimeExports.jsx(l.default,{color:s.COLORS.content.primary,height:16,width:16})}))}))]})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},O?{justifyContent:"space-between"}:{})},{children:[I&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{width:108,height:26}),!I&&e.jsxRuntimeExports.jsx(B,Object.assign({style:{color:s.COLORS.content.primary}},{children:void 0===r?"--":"number"==typeof r&&S?r>999?V?`${null!=T?T:""}${u.truncateValueForInternationalStore(r)} ${null!=L?L:""}`:`${null!=T?T:""}${u.truncateValueForIndianStore(r)} ${null!=L?L:""}`:`${null!=T?T:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(r)} ${null!=L?L:""}`:`${null!=T?T:""}${r} ${null!=L?L:""}`})),"number"==typeof P&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${P}%`,theme:"light",type:"neutral"}),"horizontal"===m&&!I&&!O&&e.jsxRuntimeExports.jsx(j,{timeline:g,customRange:h,percent:U,direction:W,trendRaw:$,prefixSymbol:T,trendIconStyle:F,isInternationalStore:V,tooltipTimelineText:A,customTimelineText:N}),I&&!O&&"horizontal"===m&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6}),"vertical"===m&&!I&&void 0!==w&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${w} %`,theme:"light",type:"neutral"}),O&&!I&&void 0!==U&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${U} %`,theme:"light",type:"neutral"}),O||I||!k||0==k?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsx(a.Tag,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(k),theme:"light",type:"neutral"})]})),"vertical"===m&&!I&&!O&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsxRuntimeExports.jsx(j,{timeline:g,customRange:h,percent:U,direction:W,trendRaw:$,prefixSymbol:T,trendIconStyle:F,isInternationalStore:V,tooltipTimelineText:A,customTimelineText:N})})),I&&"vertical"===m&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6})]})),C&&!I&&e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:C,placement:"right"},{children:v&&e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--holder",onClick:E},{children:p.default.createElement(v,{height:20,width:20,color:s.COLORS.content.secondary})}))}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),s=require("../../constants/Theme.js"),r=require("../../assets/icons/arrow_down.svg.js"),o=require("../../assets/icons/arrow_up.svg.js"),l=require("../../assets/icons/info.svg.js"),a=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),x=require("../TypographyStyle.js"),u=require("./chart/utils/calcPercentage.js"),d=require("./CommonStyles.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=m(t);const j=n=>{let{percent:l,direction:a,timeline:d,customRange:m,trendRaw:p,trendRawString:j,prefixSymbol:g,trendIconStyle:h,isInternationalStore:y,tooltipTimelineText:R,customTimelineText:b}=n;const f=()=>{const e=((null!=p?p:0)>0?"+":"")+(null!=g?g:"");return void 0===p?"--":`${null!=e?e:""}${(()=>{let e="--";if(p)return e=String(y?u.truncateValueForInternationalStore(Math.abs(p)):u.truncateValueForIndianStore(Math.abs(p))),p<0?"-"+e:e})()}`},[S,O]=t.useState(f()),[T,v]=t.useState(b||"");t.useEffect((()=>{b||v("today"===d?"vs yesterday":"yesterday"===d?"vs 1 day before":"7 days"===d?"vs last 7 days":"30 days"===d?"vs last 30 days":"custom"===d&&m?i.default.getAnalyticsCustomDateTimelineText(m):"")}),[d,m]),t.useEffect((()=>{O(f())}),[p]);const E="negative"===a?r.default:o.default,C="negative"===a?s.COLORS.background.negative.vibrant:"positive"===a?s.COLORS.background.positive.vibrant:s.COLORS.content.placeholder;return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof l&&e.jsxRuntimeExports.jsx(E,{color:C,height:16,width:16,style:Object.assign({marginRight:2},null!=h?h:{})}),"number"==typeof l&&a&&e.jsxRuntimeExports.jsxs(x.Caption,Object.assign({style:{color:C}},{children:["neutral"===a?0:l<1e3?l:">999","%"]})),!!p&&e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:`(${S})`})),!p&&((null==j?void 0:j.length)||0)>0&&e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:`${j}`})),d&&(R?e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:R,placement:"bottom"},{children:e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:b||T}))})):e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:b||T})))]}))};exports.AnalyticsTrend=t=>{let{title:i,value:r,trendPercent:o,type:m="horizontal",timeline:g,customRange:h,tooltip:y,card:R=!0,rightSeparator:b=!1,size:f="big",share:S=!1,formatVal:O,prefixSymbol:T,trailingIcon:v,onTrailIconClick:E,iconTooltipBody:C,funnelPercent:w,isLoading:I,trendRaw:$,trendRawString:L,suffixText:q,trendStyle:D,trendContainerStyle:F,trendIconStyle:M,containerStyle:k,prevTrendDiff:P,relativePercentageDiff:V,isInternationalStore:_,Icon:z,iconContainerStyle:A,tooltipTimelineText:N,customTimelineText:B}=t;const W="big"===f?x.TitleLarge:x.TitleMedium,U=void 0!==o?o<0?"negative":0===o?"neutral":"positive":void 0,G=void 0!==o?S?Math.round(o):Math.abs(Math.round(o)):void 0;return e.jsxRuntimeExports.jsx(d.AnalyticsTrendContainer,Object.assign({card:R,style:Object.assign({},k)},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:z?12:4,borderRightWidth:b?1:0,borderRightColor:s.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:R?0:24,paddingRight:R?0:24,height:"100%",justifyContent:z?"flex-start":"space-between",alignItems:"center"},null!=F?F:{})},{children:[!!z&&e.jsxRuntimeExports.jsx(d.IconContainer,Object.assign({style:Object.assign({},A)},{children:e.jsxRuntimeExports.jsx(z,{})})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=D?D:{})},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsxRuntimeExports.jsx(x.BodyCaption,Object.assign({style:{color:s.COLORS.content.secondary}},{children:i})),y&&e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:y,placement:"right",width:300},{children:e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsxRuntimeExports.jsx(l.default,{color:s.COLORS.content.primary,height:16,width:16})}))}))]})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},S?{justifyContent:"space-between"}:{})},{children:[I&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{width:108,height:26}),!I&&e.jsxRuntimeExports.jsx(W,Object.assign({style:{color:s.COLORS.content.primary}},{children:void 0===r?"--":"number"==typeof r&&O?r>999?_?`${null!=T?T:""}${u.truncateValueForInternationalStore(r)} ${null!=q?q:""}`:`${null!=T?T:""}${u.truncateValueForIndianStore(r)} ${null!=q?q:""}`:`${null!=T?T:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(r)} ${null!=q?q:""}`:`${null!=T?T:""}${r} ${null!=q?q:""}`})),"number"==typeof V&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${V}%`,theme:"light",type:"neutral"}),"horizontal"===m&&!I&&!S&&e.jsxRuntimeExports.jsx(j,{timeline:g,customRange:h,percent:G,direction:U,trendRaw:$,trendRawString:L,prefixSymbol:T,trendIconStyle:M,isInternationalStore:_,tooltipTimelineText:N,customTimelineText:B}),I&&!S&&"horizontal"===m&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6}),"vertical"===m&&!I&&void 0!==w&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${w} %`,theme:"light",type:"neutral"}),S&&!I&&void 0!==G&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${G} %`,theme:"light",type:"neutral"}),S||I||!P||0==P?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsx(a.Tag,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(P),theme:"light",type:"neutral"})]})),"vertical"===m&&!I&&!S&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsxRuntimeExports.jsx(j,{timeline:g,customRange:h,percent:G,direction:U,trendRaw:$,trendRawString:L,prefixSymbol:T,trendIconStyle:M,isInternationalStore:_,tooltipTimelineText:N,customTimelineText:B})})),I&&"vertical"===m&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6})]})),C&&!I&&e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:C,placement:"right"},{children:v&&e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--holder",onClick:E},{children:p.default.createElement(v,{height:20,width:20,color:s.COLORS.content.secondary})}))}))]}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../node_modules/react/jsx-runtime.js"),t=require("../../../../assets/icons/maximize.svg.js"),i=require("chart.js"),o=require("chartjs-plugin-datalabels"),a=require("react"),l=require("react-chartjs-2"),n=require("../../../icon-button/IconButton.js"),s=require("../../../modals/styledModal.js"),r=require("../../../TypographyStyle.js"),d=require("../../../../constants/Theme.js"),c=require("../utils/calcPercentage.js"),u=require("./StackedBarChart.model.js"),x=require("./StackedBarChart.styles.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=v(o);i.Chart.register(i.CategoryScale,i.LinearScale,i.BarElement,i.Tooltip,i.Legend,p.default);exports.StackedBarChart=i=>{var o,v,p,g,O,b,h,R,A,j,y,m,C,I,T,E,f,N,S,H,L,k,F,P,_,G,B,w,D,q,Z,z,M,W,V,Y,J,K,Q,U,X,$;const{headerIcons:ee=[],legendsAndIconDirection:te="row"}=i,[ie,oe]=a.useState(!1),ae=[250,1e3,800,1500,300,600],le=0===i.yAxis.data.length,ne=void 0===i.customColourScaleBrand&&void 0===i.customColourScalePastel?i.colorSchema===u.COLOR_SCHEMA.PASTEL?["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"]:["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"]:i.colorSchema===u.COLOR_SCHEMA.PASTEL?i.customColourScalePastel:i.customColourScaleBrand,se=i.customHoverColour,re=a.useMemo((()=>{var e,t,o;return Object.assign(Object.assign({barPercentage:(null==i?void 0:i.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:i.barWidth,borderRadius:(null==i?void 0:i.borderRadius)||void 0},"object"==typeof(null==i?void 0:i.borderRadius)?{borderSkipped:!1}:{}),(null===(e=null==i?void 0:i.addBarGap)||void 0===e?void 0:e.flag)?{borderWidth:{top:(null===(t=null==i?void 0:i.addBarGap)||void 0===t?void 0:t.value)||2,bottom:(null===(o=null==i?void 0:i.addBarGap)||void 0===o?void 0:o.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[i.barWidth,null==i?void 0:i.borderRadius,null==i?void 0:i.barPercentage,null==i?void 0:i.addBarGap]),de={};i.yAxis.data.map((e=>{e.map((e=>{de[e.name]?de[e.name].push(e.value):de[e.name]=[e.value]}))}));const ce=Object.keys(de).map(((e,t)=>Object.assign({label:e,data:de[e],backgroundColor:null==ne?void 0:ne[t],hoverBackgroundColor:void 0===se?void 0:se[t]},re)));let ue=i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),xe=ce;if(i.truncateBars){const e=((e,t,i)=>{if(t.length<=i)return{truncatedData:e,truncatedLabels:t,originalData:e,originalLabels:t};const o=e.map((e=>e.slice(0,i))),a=e.map((e=>e.slice(i).reduce(((e,t)=>e+t),0)));o.forEach(((e,t)=>e.push(a[t])));const l=t.slice(0,i);return l.push("Others"),{truncatedData:o,truncatedLabels:l,originalData:e,originalLabels:t}})(ce.map((e=>e.data)),ue,i.truncateBars);ce.forEach(((t,i)=>t.data=e.truncatedData[i])),ue=e.truncatedLabels,xe=e.originalData.map(((e,t)=>Object.assign(Object.assign({},ce[t]),{data:e})))}const ve={plugins:{legend:{display:!le&&!i.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!le,callbacks:{label:null===(o=i.tooltipConfig)||void 0===o?void 0:o.labelCallback,title:null===(v=i.tooltipConfig)||void 0===v?void 0:v.titleCallback,footer:null===(p=i.tooltipConfig)||void 0===p?void 0:p.footerCallback},footerFont:null===(O=null===(g=i.tooltipConfig)||void 0===g?void 0:g.footerStyles)||void 0===O?void 0:O.footerFont},datalabels:{display:null!==(b=i.showTotal)&&void 0!==b&&b,anchor:"end",align:"end",clamp:!0,formatter:(e,t)=>{var i;const o=t.datasetIndex,a=t.chart.data.datasets;if(o!==a.length-1)return"";const l=t.dataIndex;let n=0;for(let e=0;e<a.length;e++)n+=null!==(i=a[e].data[l])&&void 0!==i?i:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:d.COLORS.content.secondary}},layout:{padding:{right:i.showTotal&&i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?50:0,top:i.showTotal&&i.orientation!=u.GRAPH_ORIENTATION.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!i.customLegend,labels:{usePointStyle:!0}},indexAxis:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(h=i.yAxis)||void 0===h?void 0:h.title:null===(R=i.xAxis)||void 0===R?void 0:R.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(A=i.yAxis)||void 0===A?void 0:A.title:null===(j=i.xAxis)||void 0===j?void 0:j.title,color:null!==(C=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(y=i.yAxis)||void 0===y?void 0:y.titleColor:null===(m=i.xAxis)||void 0===m?void 0:m.titleColor)&&void 0!==C?C:d.COLORS.content.secondary,font:{size:d.FONTS.caption.fontSize}},grid:{display:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(I=null==i?void 0:i.showGridLines)||void 0===I?void 0:I.x)||(null===(T=null==i?void 0:i.showGridLines)||void 0===T?void 0:T.x)),color:d.COLORS.background.base},ticks:{fontSize:d.FONTS.caption.fontSize,color:null!==(E=i.yAxis.labelColor)&&void 0!==E?E:d.COLORS.content.secondary,callback:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?i.isInternationalStore?c.truncateValueForInternationalStore:c.truncateValueForIndianStore:void 0},stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(f=i.yAxis)||void 0===f?void 0:f.stacked)||(null===(N=i.yAxis)||void 0===N?void 0:N.stacked):"boolean"!=typeof(null===(S=i.xAxis)||void 0===S?void 0:S.stacked)||(null===(H=i.xAxis)||void 0===H?void 0:H.stacked)},y:Object.assign(Object.assign({},(null===(L=null==i?void 0:i.equalHeight)||void 0===L?void 0:L.flag)?{suggestedMin:-(null==i?void 0:i.equalHeight.max),suggestedMax:null==i?void 0:i.equalHeight.max}:{}),{title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(k=i.xAxis)||void 0===k?void 0:k.title:null===(F=i.yAxis)||void 0===F?void 0:F.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(P=i.xAxis)||void 0===P?void 0:P.title:null===(_=i.yAxis)||void 0===_?void 0:_.title,color:null!==(w=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(G=i.xAxis)||void 0===G?void 0:G.titleColor:null===(B=i.yAxis)||void 0===B?void 0:B.titleColor)&&void 0!==w?w:d.COLORS.content.secondary,font:{size:d.FONTS.caption.fontSize}},grid:{display:i.orientation!==u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(D=null==i?void 0:i.showGridLines)||void 0===D?void 0:D.y)||(null===(q=null==i?void 0:i.showGridLines)||void 0===q?void 0:q.y)),color:d.COLORS.background.base},ticks:Object.assign(Object.assign({stepSize:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(Z=i.xAxis)||void 0===Z?void 0:Z.stepSize:null===(z=i.yAxis)||void 0===z?void 0:z.stepSize,fontSize:d.FONTS.caption.fontSize,color:null!==(M=i.xAxis.labelColor)&&void 0!==M?M:d.COLORS.content.secondary},le?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==i?void 0:i.ticksCallback)?null==i?void 0:i.ticksCallback:i.orientation!==u.GRAPH_ORIENTATION.VERTICAL?i.isInternationalStore?c.truncateValueForInternationalStore:c.truncateValueForIndianStore:void 0}),stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(W=i.xAxis)||void 0===W?void 0:W.stacked)||(null===(V=i.xAxis)||void 0===V?void 0:V.stacked):"boolean"!=typeof(null===(Y=i.yAxis)||void 0===Y?void 0:Y.stacked)||(null===(J=i.yAxis)||void 0===J?void 0:J.stacked)})},onClick:(e,t)=>{if(!i.onBarClick)return;const o=t[0].datasetIndex,a=t[0].index,l=e.chart.data.datasets[o].label,n=e.chart.data.labels[a];i.onBarClick(n,l)},onHover:(e,t)=>{i.onBarClick&&t.length&&(e.native.target.style.cursor="pointer")}};i.orientation&&i.orientation!==u.GRAPH_ORIENTATION.VERTICAL?delete ve.scales.y.ticks.callback:delete ve.scales.x.ticks.callback;const pe={labels:ue,datasets:le?[{data:ae,backgroundColor:"rgba(0,0,0,0)"}]:ce},ge={labels:i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),datasets:le?[{data:ae,backgroundColor:"rgba(0,0,0,0)"}]:xe},Oe=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e.jsxRuntimeExports.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:i.allowChartPopup&&!t?"flex-start":"flex-end",flexWrap:"wrap"}},{children:ce.map((t=>e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[e.jsxRuntimeExports.jsx("div",{style:{backgroundColor:t.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),e.jsxRuntimeExports.jsx(r.BodyTiny,Object.assign({color:d.COLORS.content.secondary},{children:t.label}))]}),t.label.replace(" ","_"))))}))};return e.jsxRuntimeExports.jsxs(x.GraphContainerWrapper,Object.assign({style:null!==(K=i.wrapperStyle)&&void 0!==K?K:{},padding:i.outerPadding,customLegend:i.customLegend},{children:[i.chartHeading&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:i.hideHeading?"flex-end":"space-between"}},{children:[!0!==i.hideHeading&&e.jsxRuntimeExports.jsx(r.TitleRegular,Object.assign({color:null!==(Q=i.chartHeading.color)&&void 0!==Q?Q:d.COLORS.content.secondary},{children:i.chartHeading.heading})),i.allowChartPopup&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(n.IconButton,{Icon:t.default,onClick:()=>{oe(!0)}})})}))]})),i.customLegend&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:te,justifyContent:"space-between"}},{children:[e.jsxRuntimeExports.jsx(x.HeaderIconWrapper,{children:ee.map(((t,i)=>e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("div",{children:t})},i)))}),Oe()]})),e.jsxRuntimeExports.jsx("div",Object.assign({className:"graph__wrapper"},{children:e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:null!==(U=i.graphCanvasHeight)&&void 0!==U?U:500,width:null!==(X=i.graphCanvasWidth)&&void 0!==X?X:"auto"}},{children:e.jsxRuntimeExports.jsx(l.Bar,{options:ve,data:pe})}))})),ie&&e.jsxRuntimeExports.jsx(s.StyledModal,Object.assign({open:ie,onClose:()=>oe(!1),closeOnOutsideClick:!0,headingTitle:null===($=i.chartHeading)||void 0===$?void 0:$.heading,width:"85%"},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[i.customLegend&&Oe(!0),e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:e.jsxRuntimeExports.jsx(l.Bar,{options:ve,data:ge})}))]}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../node_modules/react/jsx-runtime.js"),t=require("../../../../assets/icons/maximize.svg.js"),i=require("chart.js"),o=require("chartjs-plugin-datalabels"),a=require("react"),l=require("react-chartjs-2"),n=require("../../../icon-button/IconButton.js"),s=require("../../../modals/styledModal.js"),r=require("../../../TypographyStyle.js"),d=require("../../../../constants/Theme.js"),c=require("../utils/calcPercentage.js"),u=require("./StackedBarChart.model.js"),x=require("./StackedBarChart.styles.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=v(o);i.Chart.register(i.CategoryScale,i.LinearScale,i.BarElement,i.Tooltip,i.Legend,p.default);exports.StackedBarChart=i=>{var o,v,p,O,g,A,b,h,R,j,y,m,f,C,I,T,E,S,N,H,L,k,F,P,B,_,G,w,D,q,Z,z,M,W,$,V,Y,J,K,Q,U,X,ee,te,ie;const{headerIcons:oe=[],legendsAndIconDirection:ae="row"}=i,[le,ne]=a.useState(!1),se=[250,1e3,800,1500,300,600],re=0===i.yAxis.data.length,de=["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"],ce=["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"],ue=i.customBarColors?i.customBarColors:i.customColourScaleBrand||i.customColourScalePastel?i.colorSchema===u.COLOR_SCHEMA.PASTEL?i.customColourScalePastel:i.customColourScaleBrand:i.colorSchema===u.COLOR_SCHEMA.PASTEL?ce:de,xe=i.customHoverColour,ve=a.useMemo((()=>{var e,t,o;return Object.assign(Object.assign({barPercentage:(null==i?void 0:i.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:i.barWidth,borderRadius:(null==i?void 0:i.borderRadius)||void 0},"object"==typeof(null==i?void 0:i.borderRadius)?{borderSkipped:!1}:{}),(null===(e=null==i?void 0:i.addBarGap)||void 0===e?void 0:e.flag)?{borderWidth:{top:(null===(t=null==i?void 0:i.addBarGap)||void 0===t?void 0:t.value)||2,bottom:(null===(o=null==i?void 0:i.addBarGap)||void 0===o?void 0:o.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[i.barWidth,null==i?void 0:i.borderRadius,null==i?void 0:i.barPercentage,null==i?void 0:i.addBarGap]),pe={};i.yAxis.data.map((e=>{e.map((e=>{pe[e.name]?pe[e.name].push(e.value):pe[e.name]=[e.value]}))}));const Oe=Object.keys(pe).map(((e,t)=>Object.assign({label:e,data:pe[e],backgroundColor:null==ue?void 0:ue[t],hoverBackgroundColor:void 0===xe?void 0:xe[t]},ve))),ge=i.renderInHeightWiseManner?Oe.map(((e,t)=>Object.assign(Object.assign({},e),{order:e.data.reduce(((e,t)=>e+(t||0)),0)}))).sort(((e,t)=>t.order-e.order)):Oe;let Ae=i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),be=ge;if(i.truncateBars){const e=((e,t,i)=>{if(t.length<=i)return{truncatedData:e,truncatedLabels:t,originalData:e,originalLabels:t};const o=e.map((e=>e.slice(0,i))),a=e.map((e=>e.slice(i).reduce(((e,t)=>e+t),0)));o.forEach(((e,t)=>e.push(a[t])));const l=t.slice(0,i);return l.push("Others"),{truncatedData:o,truncatedLabels:l,originalData:e,originalLabels:t}})(ge.map((e=>e.data)),Ae,i.truncateBars);ge.forEach(((t,i)=>t.data=e.truncatedData[i])),Ae=e.truncatedLabels,be=e.originalData.map(((e,t)=>Object.assign(Object.assign({},ge[t]),{data:e})))}const he={plugins:{legend:{display:!re&&!i.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!re,callbacks:{label:null===(o=i.tooltipConfig)||void 0===o?void 0:o.labelCallback,title:null===(v=i.tooltipConfig)||void 0===v?void 0:v.titleCallback,footer:null===(p=i.tooltipConfig)||void 0===p?void 0:p.footerCallback},footerFont:null===(g=null===(O=i.tooltipConfig)||void 0===O?void 0:O.footerStyles)||void 0===g?void 0:g.footerFont},datalabels:{display:null!==(A=i.showTotal)&&void 0!==A&&A,anchor:"end",align:"end",clamp:!0,formatter:(e,t)=>{var i;const o=t.datasetIndex,a=t.chart.data.datasets;if(o!==a.length-1)return"";const l=t.dataIndex;let n=0;for(let e=0;e<a.length;e++)n+=null!==(i=a[e].data[l])&&void 0!==i?i:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:d.COLORS.content.secondary}},layout:{padding:{right:i.showTotal&&i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?50:0,top:i.showTotal&&i.orientation!=u.GRAPH_ORIENTATION.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!i.customLegend,labels:{usePointStyle:!0}},indexAxis:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(b=i.yAxis)||void 0===b?void 0:b.title:null===(h=i.xAxis)||void 0===h?void 0:h.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(R=i.yAxis)||void 0===R?void 0:R.title:null===(j=i.xAxis)||void 0===j?void 0:j.title,color:null!==(f=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(y=i.yAxis)||void 0===y?void 0:y.titleColor:null===(m=i.xAxis)||void 0===m?void 0:m.titleColor)&&void 0!==f?f:d.COLORS.content.secondary,font:{size:d.FONTS.caption.fontSize}},grid:{display:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(C=null==i?void 0:i.showGridLines)||void 0===C?void 0:C.x)||(null===(I=null==i?void 0:i.showGridLines)||void 0===I?void 0:I.x)),color:d.COLORS.background.base},ticks:{fontSize:d.FONTS.caption.fontSize,color:null!==(T=i.yAxis.labelColor)&&void 0!==T?T:d.COLORS.content.secondary,callback:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?e=>{var t;return`${i.isInternationalStore?c.truncateValueForInternationalStore(e):c.truncateValueForIndianStore(e)}${(null===(t=i.yAxis)||void 0===t?void 0:t.axisSuffix)||""}`}:(null===(E=i.xAxis)||void 0===E?void 0:E.axisSuffix)?e=>`${e}${i.xAxis.axisSuffix}`:void 0},stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(S=i.yAxis)||void 0===S?void 0:S.stacked)||(null===(N=i.yAxis)||void 0===N?void 0:N.stacked):"boolean"!=typeof(null===(H=i.xAxis)||void 0===H?void 0:H.stacked)||(null===(L=i.xAxis)||void 0===L?void 0:L.stacked)},y:Object.assign(Object.assign({},(null===(k=null==i?void 0:i.equalHeight)||void 0===k?void 0:k.flag)?{suggestedMin:-(null==i?void 0:i.equalHeight.max),suggestedMax:null==i?void 0:i.equalHeight.max}:{}),{max:null===(F=null==i?void 0:i.yAxis)||void 0===F?void 0:F.max,title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(P=i.xAxis)||void 0===P?void 0:P.title:null===(B=i.yAxis)||void 0===B?void 0:B.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(_=i.xAxis)||void 0===_?void 0:_.title:null===(G=i.yAxis)||void 0===G?void 0:G.title,color:null!==(q=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(w=i.xAxis)||void 0===w?void 0:w.titleColor:null===(D=i.yAxis)||void 0===D?void 0:D.titleColor)&&void 0!==q?q:d.COLORS.content.secondary,font:{size:d.FONTS.caption.fontSize}},grid:{display:i.orientation!==u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(Z=null==i?void 0:i.showGridLines)||void 0===Z?void 0:Z.y)||(null===(z=null==i?void 0:i.showGridLines)||void 0===z?void 0:z.y)),color:d.COLORS.background.base},ticks:Object.assign(Object.assign({stepSize:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(M=i.xAxis)||void 0===M?void 0:M.stepSize:null===(W=i.yAxis)||void 0===W?void 0:W.stepSize,fontSize:d.FONTS.caption.fontSize,color:null!==($=i.xAxis.labelColor)&&void 0!==$?$:d.COLORS.content.secondary},re?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==i?void 0:i.ticksCallback)?null==i?void 0:i.ticksCallback:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?e=>{var t;return`${i.isInternationalStore?c.truncateValueForInternationalStore(e):c.truncateValueForIndianStore(e)}${(null===(t=i.xAxis)||void 0===t?void 0:t.axisSuffix)||""}`}:(null===(V=i.yAxis)||void 0===V?void 0:V.axisSuffix)?e=>`${e}${i.yAxis.axisSuffix}`:void 0}),stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(Y=i.xAxis)||void 0===Y?void 0:Y.stacked)||(null===(J=i.xAxis)||void 0===J?void 0:J.stacked):"boolean"!=typeof(null===(K=i.yAxis)||void 0===K?void 0:K.stacked)||(null===(Q=i.yAxis)||void 0===Q?void 0:Q.stacked)})},onClick:(e,t)=>{if(!i.onBarClick)return;const o=t[0].datasetIndex,a=t[0].index,l=e.chart.data.datasets[o].label,n=e.chart.data.labels[a];i.onBarClick(n,l)},onHover:(e,t)=>{i.onBarClick&&t.length&&(e.native.target.style.cursor="pointer")}};i.orientation&&i.orientation!==u.GRAPH_ORIENTATION.VERTICAL?delete he.scales.y.ticks.callback:delete he.scales.x.ticks.callback;const Re={labels:Ae,datasets:re?[{data:se,backgroundColor:"rgba(0,0,0,0)"}]:ge},je={labels:i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),datasets:re?[{data:se,backgroundColor:"rgba(0,0,0,0)"}]:be},ye=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e.jsxRuntimeExports.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:i.allowChartPopup&&!t?"flex-start":"flex-end",flexWrap:"wrap"}},{children:Oe.map((t=>e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[e.jsxRuntimeExports.jsx("div",{style:{backgroundColor:t.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),e.jsxRuntimeExports.jsx(r.BodyTiny,Object.assign({color:d.COLORS.content.secondary},{children:t.label}))]}),t.label.replace(" ","_"))))}))};return e.jsxRuntimeExports.jsxs(x.GraphContainerWrapper,Object.assign({style:null!==(U=i.wrapperStyle)&&void 0!==U?U:{},padding:i.outerPadding,customLegend:i.customLegend},{children:[i.chartHeading&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:i.hideHeading?"flex-end":"space-between"}},{children:[!0!==i.hideHeading&&e.jsxRuntimeExports.jsx(r.TitleRegular,Object.assign({color:null!==(X=i.chartHeading.color)&&void 0!==X?X:d.COLORS.content.secondary},{children:i.chartHeading.heading})),i.allowChartPopup&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(n.IconButton,{Icon:t.default,onClick:()=>{ne(!0)}})})}))]})),i.customLegend&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:ae,justifyContent:"space-between"}},{children:[e.jsxRuntimeExports.jsx(x.HeaderIconWrapper,{children:oe.map(((t,i)=>e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("div",{children:t})},i)))}),ye()]})),e.jsxRuntimeExports.jsx("div",Object.assign({className:"graph__wrapper"},{children:e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:null!==(ee=i.graphCanvasHeight)&&void 0!==ee?ee:500,width:null!==(te=i.graphCanvasWidth)&&void 0!==te?te:"auto"}},{children:e.jsxRuntimeExports.jsx(l.Bar,{options:he,data:Re})}))})),le&&e.jsxRuntimeExports.jsx(s.StyledModal,Object.assign({open:le,onClose:()=>ne(!1),closeOnOutsideClick:!0,headingTitle:null===(ie=i.chartHeading)||void 0===ie?void 0:ie.heading,width:"85%"},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[i.customLegend&&ye(!0),e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:e.jsxRuntimeExports.jsx(l.Bar,{options:he,data:je})}))]}))}))]}))};
@@ -7,6 +7,8 @@ export interface AxisDetailsI {
7
7
  labelColor?: string;
8
8
  stepSize?: number;
9
9
  stacked?: boolean;
10
+ axisSuffix?: string;
11
+ max?: number;
10
12
  }
11
13
  export interface XAxisDataI {
12
14
  name: string;
@@ -58,6 +60,7 @@ export interface StackedBarGraphI {
58
60
  customColourScaleBrand?: string[];
59
61
  customColourScalePastel?: string[];
60
62
  customHoverColour?: string[];
63
+ customBarColors?: string[];
61
64
  isInternationalStore?: boolean;
62
65
  truncateBars?: number;
63
66
  allowChartPopup?: boolean;
@@ -81,7 +84,8 @@ export interface StackedBarGraphI {
81
84
  flag: boolean;
82
85
  value: number;
83
86
  };
84
- ticksCallback?: (value: number) => string;
87
+ ticksCallback?: (value: number | string) => string;
85
88
  legendsAndIconDirection?: 'row-reverse' | 'row';
86
89
  headerIcons?: React.ReactNode[];
90
+ renderInHeightWiseManner?: boolean;
87
91
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../node_modules/react/jsx-runtime.js"),i=require("chart.js"),t=require("react-chartjs-2"),r=require("../../../TypographyStyle.js"),o=require("../../../../constants/Theme.js"),s=require("../LineChart/LineChart.styled.js"),a=require("./VerticalBarAndLinearGraph.styles.js");i.Chart.register(i.CategoryScale,i.LinearScale,i.BarElement,i.Tooltip);exports.VerticalBarAndLinearGraph=i=>{var n,l,x,c,d;const p=[0,0,0,0,0,0],g=-1===i.barAxis.data.findIndex((e=>0!==e)),b=-1===i.lineAxis.data.findIndex((e=>0!==e)),u={min:0,max:2e3,stepSize:200},j=[{legend:i.barAxis.title,color:i.barAxis.graphColor},{legend:i.lineAxis.title,color:i.lineAxis.graphColor}],h={responsive:!0,plugins:{legend:{display:!1}},scales:{x:{title:{display:!!i.xAxis.title,text:i.xAxis.title,color:i.xAxis.titleColor,font:{size:o.FONTS.caption.fontSize}},grid:{display:!1,borderColor:o.COLORS.background.base},ticks:{fontSize:o.FONTS.caption.fontSize,color:null!==(n=i.xAxis.labelColor)&&void 0!==n?n:o.COLORS.content.secondary}},bar:{position:"left",title:{display:!!i.barAxis.title,text:i.barAxis.title,color:i.barAxis.titleColor,font:{size:o.FONTS.caption.fontSize}},grid:{borderColor:"white",color:o.COLORS.background.base},ticks:Object.assign({fontSize:o.FONTS.caption.fontSize,color:null!==(l=i.barAxis.labelColor)&&void 0!==l?l:o.COLORS.content.secondary},g?u:{})},line:{position:"right",title:{display:!!i.lineAxis.title,text:i.lineAxis.title,color:i.lineAxis.titleColor,font:{size:o.FONTS.caption.fontSize}},grid:{display:!1,borderColor:"white",color:o.COLORS.background.base},ticks:Object.assign({fontSize:o.FONTS.caption.fontSize,color:null!==(x=i.lineAxis.labelColor)&&void 0!==x?x:o.COLORS.content.secondary},b?u:{}),display:!0}},maintainAspectRatio:!1},A={labels:i.xAxis.forceShowXAxis?i.xAxis.data.map((e=>e.toString())):g&&b?["-","-","-","-","-","-"]:i.xAxis.data.map((e=>e.toString())),datasets:[{yAxisID:"line",type:"line",data:b?p:i.lineAxis.data,borderColor:i.lineAxis.graphColor||"rgba(0,0,0,0)",borderWidth:2,fill:!1,pointRadius:1},{yAxisID:"bar",type:"bar",data:g?p:i.barAxis.data,backgroundColor:i.barAxis.graphColor||"rgba(0,0,0,0)",barPercentage:.4,categoryPercentage:1,borderRadius:4}]};return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:2}},{children:[e.jsxRuntimeExports.jsx(s.LegendWrapper,Object.assign({position:"center"},{children:j.map(((i,t)=>{let{legend:o,color:a}=i;return o?e.jsxRuntimeExports.jsxs(s.LegendContainer,{children:[e.jsxRuntimeExports.jsx(s.LegendColor,{color:a}),e.jsxRuntimeExports.jsx(r.SmallRegular,Object.assign({color:"#667085"},{children:o}))]},t):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})}))})),e.jsxRuntimeExports.jsxs(a.GraphContainerWrapper,{children:[i.chartHeading&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginBottom:24}},{children:e.jsxRuntimeExports.jsx(r.TitleRegular,Object.assign({color:null!==(c=i.chartHeading.color)&&void 0!==c?c:o.COLORS.content.secondary},{children:i.chartHeading.heading}))})),e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:null!==(d=i.graphCanvasHeight)&&void 0!==d?d:500}},{children:e.jsxRuntimeExports.jsx(t.Chart,{type:"bar",data:A,options:h})}))]})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../../../../node_modules/react/jsx-runtime.js"),e=require("chart.js"),t=require("react-chartjs-2"),o=require("../../../TypographyStyle.js"),r=require("../../../../constants/Theme.js"),a=require("../LineChart/LineChart.styled.js"),l=require("../utils/calcPercentage.js"),n=require("./VerticalBarAndLinearGraph.styles.js"),s=require("./VerticalBarAndLinearGraphModel.js");e.Chart.register(e.CategoryScale,e.LinearScale,e.BarElement,e.Tooltip);exports.VerticalBarAndLinearGraph=e=>{var d,x,c,u,p,b,A,g,v,j,S,h,O,m,R,C,f,y,L;const k=[0,0,0,0,0,0],E=-1===e.barAxis.data.findIndex((i=>0!==i)),I=-1===e.lineAxis.data.findIndex((i=>0!==i)),T=!e.lineAxis2||-1===e.lineAxis2.data.findIndex((i=>0!==i)),N={min:0,max:2e3,stepSize:200},z=[{legend:e.barAxis.title,color:e.barAxis.graphColor},{legend:e.lineAxis.title,color:e.lineAxis.graphColor},...e.lineAxis2?[{legend:e.lineAxis2.title,color:e.lineAxis2.graphColor}]:[]],F={responsive:!0,plugins:{legend:{display:!1}},scales:{x:{title:{display:!!e.xAxis.title,text:e.xAxis.title,color:e.xAxis.titleColor,font:{size:r.FONTS.caption.fontSize}},grid:{display:!1,borderColor:r.COLORS.background.base},ticks:{fontSize:r.FONTS.caption.fontSize,color:null!==(d=e.xAxis.labelColor)&&void 0!==d?d:r.COLORS.content.secondary,callback:(null===(x=e.xAxis)||void 0===x?void 0:x.axisSuffix)?i=>`${i}${e.xAxis.axisSuffix}`:void 0}},bar:{position:"left",title:{display:!!e.barAxis.title,text:e.barAxis.title,color:e.barAxis.titleColor,font:{size:r.FONTS.caption.fontSize}},grid:{borderColor:"white",color:r.COLORS.background.base},max:null===(c=null==e?void 0:e.barAxis)||void 0===c?void 0:c.max,ticks:Object.assign(Object.assign({fontSize:r.FONTS.caption.fontSize,color:null!==(u=e.barAxis.labelColor)&&void 0!==u?u:r.COLORS.content.secondary},E?N:{}),{callback:e.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?i=>{var t;return`${e.isInternationalStore?l.truncateValueForInternationalStore(i):l.truncateValueForIndianStore(i)}${(null===(t=e.barAxis)||void 0===t?void 0:t.axisSuffix)||""}`}:(null===(p=e.barAxis)||void 0===p?void 0:p.axisSuffix)?i=>`${i}${e.barAxis.axisSuffix}`:void 0})},line:{position:"right",title:{display:!!e.lineAxis.title,text:e.lineAxis.title,color:e.lineAxis.titleColor,font:{size:r.FONTS.caption.fontSize}},max:null===(b=null==e?void 0:e.lineAxis)||void 0===b?void 0:b.max,grid:{display:!1,borderColor:"white",color:r.COLORS.background.base},ticks:Object.assign(Object.assign({fontSize:r.FONTS.caption.fontSize,color:null!==(A=e.lineAxis.labelColor)&&void 0!==A?A:r.COLORS.content.secondary},I?N:{}),{callback:e.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?i=>{var t;return`${e.isInternationalStore?l.truncateValueForInternationalStore(i):l.truncateValueForIndianStore(i)}${(null===(t=e.lineAxis)||void 0===t?void 0:t.axisSuffix)||""}`}:(null===(g=e.lineAxis)||void 0===g?void 0:g.axisSuffix)?i=>`${i}${e.lineAxis.axisSuffix}`:void 0}),display:!0}},maintainAspectRatio:!1};e.orientation&&e.orientation!==s.GRAPH_ORIENTATION.VERTICAL?(void 0!==(null===(m=null===(O=null===(h=F.scales)||void 0===h?void 0:h.bar)||void 0===O?void 0:O.ticks)||void 0===m?void 0:m.callback)&&delete F.scales.bar.ticks.callback,void 0!==(null===(f=null===(C=null===(R=F.scales)||void 0===R?void 0:R.line)||void 0===C?void 0:C.ticks)||void 0===f?void 0:f.callback)&&delete F.scales.line.ticks.callback):void 0!==(null===(S=null===(j=null===(v=F.scales)||void 0===v?void 0:v.x)||void 0===j?void 0:j.ticks)||void 0===S?void 0:S.callback)&&delete F.scales.x.ticks.callback;const V={labels:e.xAxis.forceShowXAxis?e.xAxis.data.map((i=>i.toString())):E&&I&&T?["-","-","-","-","-","-"]:e.xAxis.data.map((i=>i.toString())),datasets:[{yAxisID:"line",type:"line",data:e.noDummyValues?e.lineAxis.data:I?k:e.lineAxis.data,borderColor:e.lineAxis.graphColor||"rgba(0,0,0,0)",borderWidth:2,fill:!1,pointRadius:1},...e.lineAxis2?[{yAxisID:"line",type:"line",data:e.noDummyValues?e.lineAxis2.data:T?k:e.lineAxis2.data,borderColor:e.lineAxis2.graphColor||"rgba(0,0,0,0)",borderWidth:2,fill:!1,pointRadius:1}]:[],{yAxisID:"bar",type:"bar",data:e.noDummyValues?e.barAxis.data:E?k:e.barAxis.data,backgroundColor:e.barAxis.graphColor||"rgba(0,0,0,0)",barPercentage:.4,categoryPercentage:1,borderRadius:4}]};return i.jsxRuntimeExports.jsxs(n.GraphWrapper,{children:[e.customLegend?i.jsxRuntimeExports.jsxs(n.LegendsWrapper,{children:[" ",z.map(((e,t)=>{let{legend:a,color:l}=e;return a?i.jsxRuntimeExports.jsxs(n.LegendMiddleWrapper,{children:[i.jsxRuntimeExports.jsx(n.LegendColorBox,{color:l}),i.jsxRuntimeExports.jsx(o.BodyTiny,Object.assign({color:r.COLORS.content.secondary},{children:a}))]},t):null}))]}):i.jsxRuntimeExports.jsx(a.LegendWrapper,Object.assign({position:"center"},{children:z.map(((e,t)=>{let{legend:r,color:l}=e;return r?i.jsxRuntimeExports.jsxs(a.LegendContainer,{children:[i.jsxRuntimeExports.jsx(a.LegendColor,{color:l}),i.jsxRuntimeExports.jsx(o.SmallRegular,Object.assign({color:"#667085"},{children:r}))]},t):i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{})}))})),i.jsxRuntimeExports.jsxs(n.GraphContainerWrapper,{children:[e.chartHeading&&i.jsxRuntimeExports.jsx("div",Object.assign({style:{marginBottom:24}},{children:i.jsxRuntimeExports.jsx(o.TitleRegular,Object.assign({color:null!==(y=e.chartHeading.color)&&void 0!==y?y:r.COLORS.content.secondary},{children:e.chartHeading.heading}))})),i.jsxRuntimeExports.jsx("div",Object.assign({style:{height:null!==(L=e.graphCanvasHeight)&&void 0!==L?L:500}},{children:i.jsxRuntimeExports.jsx(t.Chart,{type:"bar",data:V,options:F})}))]})]})};
@@ -1 +1,7 @@
1
1
  export declare const GraphContainerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const LegendsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const LegendMiddleWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const LegendColorBox: import("styled-components").StyledComponent<"div", any, {
5
+ color: string;
6
+ }, never>;
7
+ export declare const GraphWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,4 +1,25 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../../../constants/Theme.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const n=t(e).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../../../constants/Theme.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=p(e);const d=t.default.div`
2
2
  background-color: ${r.COLORS.surface.standard};
3
3
  padding: 0;
4
- `;exports.GraphContainerWrapper=n;
4
+ `,a=t.default.div`
5
+ display: flex;
6
+ flex-direction: row;
7
+ gap: 10px;
8
+ padding: 0px 24px 12px 24px;
9
+ justify-content: flex-end;
10
+ flex-wrap: wrap;
11
+ `,o=t.default.div`
12
+ display: flex;
13
+ align-items: center;
14
+ gap: 8px;
15
+ margin-top: 4px;
16
+ `,i=t.default.div`
17
+ background-color: ${e=>e.color};
18
+ width: 16px;
19
+ height: 16px;
20
+ border-radius: 2px;
21
+ `,n=t.default.div`
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: 2;
25
+ `;exports.GraphContainerWrapper=d,exports.GraphWrapper=n,exports.LegendColorBox=i,exports.LegendMiddleWrapper=o,exports.LegendsWrapper=a;
@@ -4,11 +4,17 @@ export interface AxisDetailsI {
4
4
  data: number[] | string[];
5
5
  labelColor?: string;
6
6
  graphColor?: string;
7
+ axisSuffix?: string;
8
+ max?: number;
7
9
  }
8
10
  export interface ChartHeadingI {
9
11
  heading: string;
10
12
  color?: string;
11
13
  }
14
+ export declare enum GRAPH_ORIENTATION {
15
+ VERTICAL = "vertical",
16
+ HORIZONTAL = "horizontal"
17
+ }
12
18
  export interface VerticalBarAndLinearGraphI {
13
19
  graphCanvasHeight?: number;
14
20
  tickColor?: string;
@@ -18,5 +24,10 @@ export interface VerticalBarAndLinearGraphI {
18
24
  forceShowXAxis?: boolean;
19
25
  };
20
26
  lineAxis: AxisDetailsI;
27
+ lineAxis2?: AxisDetailsI;
21
28
  barAxis: AxisDetailsI;
29
+ isInternationalStore?: boolean;
30
+ customLegend?: boolean;
31
+ orientation?: GRAPH_ORIENTATION;
32
+ noDummyValues?: boolean;
22
33
  }
@@ -0,0 +1 @@
1
+ "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.GRAPH_ORIENTATION=void 0,(e=exports.GRAPH_ORIENTATION||(exports.GRAPH_ORIENTATION={})).VERTICAL="vertical",e.HORIZONTAL="horizontal";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -45,7 +45,6 @@ export * from './components/TablePagination/';
45
45
  export * from './components/states-modal';
46
46
  export * from './components/states';
47
47
  export * from './components/WhatsAppTextEditor';
48
- export * from './components/whats-new';
49
48
  export * from './helpers';
50
49
  export * from './components/card-selection-modal';
51
50
  export * from './components/image-cropper';
@@ -100,4 +99,3 @@ export * from './components/text-picker';
100
99
  export * from './components/dot-pulse';
101
100
  export * from './components/bik-chatbot';
102
101
  export * from './components/banner';
103
- export * from './components/feature-announcements';
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./amplitude/index.js"),r=require("./components/template-preview/constants/regexPatterns.js"),t=require("./utils/StringUtils.js"),o=require("./constants/Theme.js"),n=require("./constants/zindex.js"),s=require("./components/checkBox/CheckBox.js"),a=require("./components/list-item/ListItem.js"),i=require("./components/pagination/Pagination.js"),p=require("./components/radioButton/RadioButton.js"),u=require("./components/toaster/Toaster.js"),c=require("./components/tooltips/Tooltip.js"),l=require("./components/spinner/Spinner.js"),d=require("./components/stepper/Stepper.js"),m=require("./components/tag/Tag.js"),x=require("./components/icon-button/IconButton.js"),T=require("./components/template-preview/TemplatePreview.js"),P=require("./components/template-preview/WhatsApp/WhatsAppLikePreview.js"),A=require("./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),S=require("./components/template-preview/helpers/SmsTemplateHelper.js"),C=require("./components/template-preview/helpers/WhatsAppFormatToHTML.js"),y=require("./components/template-preview/helpers/VariableEditorHelper.js"),O=require("./components/template-preview/models/TemplateMeta.js"),j=require("./components/template-preview/models/WhatsAppTemplate.js"),b=require("./components/template-preview/models/Channels.js"),E=require("./components/template-context-mapper/TemplateContextMapper.js"),h=require("./components/template-context-mapper/utils/getDataFromTemplateComponent.js"),I=require("./components/template-context-mapper/utils/validateIsUrl.js");require("./_virtual/_tslib.js");var R=require("./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js"),_=require("./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js"),g=require("./components/fab-menu/FABMenu.js"),B=require("./components/floating-action-button/FloatingActionButton.js"),q=require("./components/floating-action-button/FloatingActionButton.styles.js"),f=require("./components/image-compress/ImageCompress.js"),N=require("./components/TypographyStyle.js"),w=require("./components/button/Button.js"),D=require("./components/progress-bar/ProgressBarComponent.js");require("./node_modules/react/jsx-runtime.js");var M=require("./components/progress-bar-v2/ProgressBarV2.js"),k=require("./components/QueryBuilder/QueryBuilder.js"),L=require("./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),V=require("./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js"),U=require("./components/QueryBuilder/redux/queryBuilder.reducer.js"),v=require("./components/QueryBuilder/redux/queryBuilderCache.reducer.js"),F=require("./components/QueryBuilder/types/QueryBuilderOperator.type.js"),G=require("./components/modals/styledModal.js"),W=require("./components/dropdown/DropdownPopover/index.js"),H=require("./components/dropdown/Dropdown.js"),Y=require("./components/dropdown/ChipDropdown.js"),Q=require("./components/dropdown/OpenedDropdown/components/OpennedDropdown.js"),K=require("./components/dropdown/MenuItem/MenuItem.js"),X=require("./components/analytics-card/AnalyticsCard.js"),z=require("./components/analytics-card/AnalyticsCard.styled.js"),Z=require("./components/input/Input.js"),J=require("./components/analytics-chips-and-dropdowns/AnalyticsChip.js"),$=require("./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js"),ee=require("./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js"),re=require("./components/analytics-chips-and-dropdowns/AnalyticsMetric.js"),te=require("./components/analytics-chips-and-dropdowns/AnalyticsTrend.js"),oe=require("./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),ne=require("./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js"),se=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),ae=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),ie=require("./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),pe=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),ue=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),ce=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),le=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),de=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js"),me=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),xe=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),Te=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),Pe=require("./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js"),Ae=require("./components/avatar/Avatar.js"),Se=require("./components/avatar/AvatarHelper.js"),Ce=require("./components/alerts/Alert.js"),ye=require("./components/alerts/AlertHelper.js"),Oe=require("./components/thumbnail/Thumbnail.js"),je=require("./components/curtain/Curtain.js"),be=require("./components/datePicker/DatePicker.js"),Ee=require("./components/datePicker/DatePickerWrapper.js"),he=require("./components/datePicker/TimePicker.js"),Ie=require("./components/switch/Switch.js"),Re=require("./components/plans/SubscriptionPlan.js"),_e=require("./components/plans/SubscriptionPlanSelector.js"),ge=require("./components/plans/NewSubscriptionPlan.js"),Be=require("./components/plans/SubscriptionPlansCollected.js"),qe=require("./components/tabs/Tabs.js"),fe=require("./components/dynamic-tabs/DynamicTabs.js"),Ne=require("./components/shimmer/ShimmerComponent/BikShimmer.js"),we=require("./components/TablePagination/TablePagination.js"),De=require("./components/TablePagination/TablePaginationCard.js"),Me=require("./components/states-modal/StateModalComponent.js"),ke=require("./components/states-modal/DeleteConfirmationModal.js"),Le=require("./components/states/StateComponent.js"),Ve=require("./components/states/ShopifyScopeWrapper.js"),Ue=require("./components/WhatsAppTextEditor/WhatsAppTextEditor.js"),ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),Fe=require("./components/whats-new/WhatsNew.styles.js"),Ge=require("./components/whats-new/WhatsNewButton.js"),We=require("./components/whats-new/WhatsNewPanel.js"),He=require("./components/whats-new/WhatsNewProvider.js"),Ye=require("./components/whats-new/WhatsNew.js"),Qe=require("./components/whats-new/useWhatsNew.js"),Ke=require("./helpers/BaseWhatsappContentLang.helper.js"),Xe=require("./components/curtain/CurtainHelper.js"),ze=require("./utils/resizeImage.js"),Ze=require("./components/variable-picker-v3/model.js"),Je=require("./components/card-selection-modal/CardSelectionModal.js"),$e=require("./components/image-cropper/BikImageCropper.js"),er=require("./components/image-cropper/BikImagePipeline/BikImagePipeline.js"),rr=require("./components/buttonGroup/ButtonGroup.js"),tr=require("./components/accordion/Accordion.js"),or=require("./components/file-uploader/FileUploader.js"),nr=require("./components/colourInput/ColourInput.js"),sr=require("./components/code-block/CodeBlock.js"),ar=require("./components/code-block/types.js"),ir=require("./components/bik-layout/BikHeader.js"),pr=require("./components/bik-layout/BikLayout.js"),ur=require("./components/bik-layout/BikProfile.js"),cr=require("./components/bik-layout/SimpleSidebar.js"),lr=require("./components/bik-layout/BikSidebar.js"),dr=require("./components/bik-layout/FeatureModal.js"),mr=require("./components/bik-layout/SidebarSkeleton.js"),xr=require("./components/bik-layout/ShowShopifyRestrictedModal.js"),Tr=require("./components/bik-layout/FeatureModalV2.js"),Pr=require("./components/searchBar/searchBar.js"),Ar=require("./components/custom-date-time/CustomDateTime.js"),Sr=require("./components/product-picker/ProductPickerModal.js"),Cr=require("./components/discount-modal/DiscountModal.js"),yr=require("./components/discount-modal/CouponExpiration/CouponExpiration.js"),Or=require("./components/discount-modal/type.js"),jr=require("./components/country-code-picker/CountryCodePicker.js"),br=require("./components/country-code-picker/CountryCodePicker.modal.js"),Er=require("./components/shimmer-image/ShimmerImage.js"),hr=require("./components/product-picker-v2/modal.js"),Ir=require("./components/product-picker-v2/type.js"),Rr=require("./components/carousel/carousel.js"),_r=require("./components/carousel-secondary/CarouselSecondary.js"),gr=require("./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js"),Br=require("./components/radioList/RadioList.js"),qr=require("./components/checkList/CheckList.js"),fr=require("./components/postPicker/postPicker.js"),Nr=require("./components/dropdown-button/DropdownButton.js"),wr=require("./components/side-modal/SideModal.js"),Dr=require("./components/keywords-input/KeywordsInput.js"),Mr=require("./components/add-variableV2/AddVariableV2SideModal.js"),kr=require("./components/add-variableV2/AddVariableV2.js"),Lr=require("./components/navigation-hyperlink/NavigationHyperlink.js"),Vr=require("./components/SearchFilter/index.js"),Ur=require("./components/input-with-vars/InputWithVariables.js"),vr=require("./components/dashboard-review-popup/DashboardReviewPopUp.js"),Fr=require("./components/star-rating/StarRating.js"),Gr=require("./components/testimonial-card/TestimonialCard.js"),Wr=require("./components/slider/slider.js"),Hr=require("./components/resizeImage/index.js"),Yr=require("./utils/validator.js"),Qr=require("./components/carousel-preview/CarouselPreview.js"),Kr=require("./components/floater/floater.js"),Xr=require("./components/card-selector/CardSelector.js"),zr=require("./components/card-selector/CardSelectorGroup.js"),Zr=require("./components/variable-picker-v3/VariablePicker.js"),Jr=require("./components/action-button/ActionButtons.js"),$r=require("./components/ai-modals/ActivateBikAI.js"),et=require("./components/ai-modals/AiSyncProgress.js"),rt=require("./components/ai-modals/AiCreditsExhausted.js"),tt=require("./components/ai-modals/AiCreditsLow.js"),ot=require("./components/input-with-vars/customPortal.js"),nt=require("./components/floating-input-dropdown/FloatingInputDropdown.js"),st=require("./components/dropdown/MultilevelDropdownPopover/index.js"),at=require("./components/dropShadow/DropShadow.js"),it=require("./components/multi-level-dropdown/MultiLevelDropdown.js"),pt=require("./components/data-source-panel/DataSourcePanel.js"),ut=require("./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js"),ct=require("./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js"),lt=require("./components/data-source-panel/model.js"),dt=require("./components/text-picker/TextPickerModal.js"),mt=require("./components/dot-pulse/DotPulse.js"),xt=require("./components/bik-chatbot/components/BIKChatbot.js"),Tt=require("./components/bik-chatbot/components/AIChat.js"),Pt=require("./components/bik-chatbot/contexts/AIContext.js"),At=require("./components/bik-chatbot/services/useAIChat.js"),St=require("./components/bik-chatbot/types/chat.js"),Ct=require("./components/bik-chatbot/types/ai.js"),yt=require("./components/banner/AdBanner.js"),Ot=require("./components/banner/model.js"),jt=require("./components/feature-announcements/FeatureAnnouncementProvider.js"),bt=require("./components/feature-announcements/MajorUpdatePopup.js"),Et=require("./components/feature-announcements/MinorUpdatePopup.js"),ht=require("./components/feature-announcements/VideoModal.js"),It=require("./components/feature-announcements/hooks/useFeatureAnnouncements.js"),Rt=require("./components/feature-announcements/constants/index.js"),_t=require("./components/carousel-secondary/model.js"),gt=require("./components/feature-announcements/constants/animations.js"),Bt=require("./components/feature-announcements/constants/dimensions.js");exports.AmplitudeEvent=e.AmplitudeEvent,exports.regexPatterns=r,exports.StringUtils=t.default,exports.BASE_COLORS=o.BASE_COLORS,exports.COLORS=o.COLORS,exports.DEFAULT_THEME=o.DEFAULT_THEME,exports.FONTS=o.FONTS,exports.ComponentZindex=n.ComponentZindex,exports.CheckBox=s.CheckBox,exports.ListItem=a.ListItem,exports.Pagination=i.Pagination,exports.RadioButton=p.RadioButton,exports.Toaster=u.Toaster,exports.Tooltip=c.Tooltip,exports.PureSpinner=l.PureSpinner,exports.Spinner=l.Spinner,exports.Stepper=d.Stepper,exports.Tag=m.Tag,exports.IconButton=x.IconButton,exports.TemplatePreview=T.TemplatePreview,exports.WhatsappLikePreview=P.WhatsappLikePreview,exports.WhatsappLikePreviewV2=A.WhatsappLikePreviewV2,exports.renderVariableUIForPreview=S.renderVariableUIForPreview,exports.WhatsAppFormatToHTML=C.WhatsAppFormatToHTML,exports.VariableEditorHelper=y.VariableEditorHelper,Object.defineProperty(exports,"ACTIONS_TYPES",{enumerable:!0,get:function(){return O.ACTIONS_TYPES}}),exports.CUSTOM_URL_NAME=O.CUSTOM_URL_NAME,Object.defineProperty(exports,"HEADER_TYPES",{enumerable:!0,get:function(){return O.HEADER_TYPES}}),exports.STATIC_URL_CTA_OPTION=O.STATIC_URL_CTA_OPTION,Object.defineProperty(exports,"TEMPLATE_EDITOR",{enumerable:!0,get:function(){return O.TEMPLATE_EDITOR}}),Object.defineProperty(exports,"TEMPLATE_STATUS",{enumerable:!0,get:function(){return O.TEMPLATE_STATUS}}),exports.UNSUBSCRIBE_URL_OPTION=O.UNSUBSCRIBE_URL_OPTION,Object.defineProperty(exports,"BUTTON_TYPE",{enumerable:!0,get:function(){return j.BUTTON_TYPE}}),Object.defineProperty(exports,"POD",{enumerable:!0,get:function(){return j.POD}}),Object.defineProperty(exports,"TEMPLATE_QUALITY",{enumerable:!0,get:function(){return j.TEMPLATE_QUALITY}}),Object.defineProperty(exports,"CHANNEL_TYPE",{enumerable:!0,get:function(){return b.CHANNEL_TYPE}}),exports.TemplateContextMapper=E.TemplateContextMapper,exports.getAllDataFromTemplateComponent=h.getAllDataFromTemplateComponent,exports.getAllDataFromWebpushTemplateComponent=h.getAllDataFromWebpushTemplateComponent,exports.isVariable=I.isVariable,exports.validateIsUrl=I.validateIsUrl,exports.TemplateAnalyticsSkeleton=R.TemplateAnalyticsSkeleton,exports.AnalyticsItem=_.AnalyticsItem,exports.QualityTimelineChart=_.QualityTimelineChart,exports.RightPanelTemplateAnalytics=_.RightPanelTemplateAnalytics,exports.TemplateAnalyticsComponent=_.TemplateAnalyticsComponent,exports.FABMenu=g.FABMenu,exports.FloatingActionButton=B.FloatingActionButton,Object.defineProperty(exports,"DROP_POSITION",{enumerable:!0,get:function(){return q.DROP_POSITION}}),exports.DropdownToggleContainer=q.DropdownToggleContainer,Object.defineProperty(exports,"FAB_POSITION",{enumerable:!0,get:function(){return q.FAB_POSITION}}),exports.FloatingActionButtonContainer=q.FloatingActionButtonContainer,exports.FloatingActionButtonOuterContainer=q.FloatingActionButtonOuterContainer,Object.defineProperty(exports,"MENU_ALIGNMENT",{enumerable:!0,get:function(){return q.MENU_ALIGNMENT}}),exports.StyledDropdown=q.StyledDropdown,exports.TooltipStyled=q.TooltipStyled,exports.ImageService=f.ImageService,exports.AiBodyCaption=N.AiBodyCaption,exports.AiBodyTiny=N.AiBodyTiny,exports.BodyCaption=N.BodyCaption,exports.BodyLarge=N.BodyLarge,exports.BodyPrimary=N.BodyPrimary,exports.BodyPrimaryLink=N.BodyPrimaryLink,exports.BodyRegular=N.BodyRegular,exports.BodySecondary=N.BodySecondary,exports.BodySecondaryLink=N.BodySecondaryLink,exports.BodySmall=N.BodySmall,exports.BodyTiny=N.BodyTiny,exports.ButtonLarge=N.ButtonLarge,exports.ButtonLargeAI=N.ButtonLargeAI,exports.ButtonRegular=N.ButtonRegular,exports.ButtonRegularAI=N.ButtonRegularAI,exports.Caption=N.Caption,exports.CaptionBold=N.CaptionBold,exports.Display=N.Display,exports.SmallRegular=N.SmallRegular,exports.SubHeading=N.SubHeading,exports.TextPlaceholder=N.TextPlaceholder,exports.Tiny=N.Tiny,exports.TitleFour=N.TitleFour,exports.TitleLarge=N.TitleLarge,exports.TitleMedium=N.TitleMedium,exports.TitleRegular=N.TitleRegular,exports.TitleSmall=N.TitleSmall,exports.TitleXlarge=N.TitleXlarge,exports.Button=w.Button,exports.ProgressBarComponent=D.ProgressBarComponent,exports.ProgressCompletedBar=D.ProgressCompletedBar,Object.defineProperty(exports,"ProgressBarType",{enumerable:!0,get:function(){return M.ProgressBarType}}),exports.ProgressBarV2=M.ProgressBarV2,Object.defineProperty(exports,"TextAlignment",{enumerable:!0,get:function(){return M.TextAlignment}}),exports.QueryBuilder=k.QueryBuilder,exports.BaseQueryBuilderNode=L.BaseQueryBuilderNode,exports.PropertyNode=V.PropertyNode,exports.PropertyNodeHeadless=V.PropertyNodeHeadless,exports.queryBuilderSlice=U.queryBuilderSlice,exports.queryBuilderCacheSlice=v.queryBuilderCacheSlice,Object.defineProperty(exports,"AD_STRING_OPERATORS",{enumerable:!0,get:function(){return F.AD_STRING_OPERATORS}}),Object.defineProperty(exports,"ANY_AD_OPERATORS",{enumerable:!0,get:function(){return F.ANY_AD_OPERATORS}}),Object.defineProperty(exports,"ANY_IG_OPERATORS",{enumerable:!0,get:function(){return F.ANY_IG_OPERATORS}}),Object.defineProperty(exports,"BOOLEAN_OPERATORS",{enumerable:!0,get:function(){return F.BOOLEAN_OPERATORS}}),Object.defineProperty(exports,"DATE_OPERATORS",{enumerable:!0,get:function(){return F.DATE_OPERATORS}}),Object.defineProperty(exports,"EVENT_VALUES",{enumerable:!0,get:function(){return F.EVENT_VALUES}}),Object.defineProperty(exports,"EXACTLY_OPERATORS",{enumerable:!0,get:function(){return F.EXACTLY_OPERATORS}}),Object.defineProperty(exports,"FREQUENCY_OPERATORS",{enumerable:!0,get:function(){return F.FREQUENCY_OPERATORS}}),Object.defineProperty(exports,"ICE_BREAKER_OPERATORS",{enumerable:!0,get:function(){return F.ICE_BREAKER_OPERATORS}}),Object.defineProperty(exports,"IG_STRING_OPERATORS",{enumerable:!0,get:function(){return F.IG_STRING_OPERATORS}}),Object.defineProperty(exports,"INTEGER_OPERATORS",{enumerable:!0,get:function(){return F.INTEGER_OPERATORS}}),Object.defineProperty(exports,"MAIL_SUBJECT_OPERATORS",{enumerable:!0,get:function(){return F.MAIL_SUBJECT_OPERATORS}}),Object.defineProperty(exports,"REACTION_OPERATORS",{enumerable:!0,get:function(){return F.REACTION_OPERATORS}}),Object.defineProperty(exports,"SPECIFIC_IG_OPERATORS",{enumerable:!0,get:function(){return F.SPECIFIC_IG_OPERATORS}}),Object.defineProperty(exports,"STRING_OPERATORS",{enumerable:!0,get:function(){return F.STRING_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS",{enumerable:!0,get:function(){return F.STRING_RESTRICTED_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_2",{enumerable:!0,get:function(){return F.STRING_RESTRICTED_OPERATORS_2}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_3",{enumerable:!0,get:function(){return F.STRING_RESTRICTED_OPERATORS_3}}),exports.StyledModal=G.StyledModal,exports.DropdownPopover=W.DropdownPopover,exports.Dropdown=H.Dropdown,exports.ChipDropdown=Y.ChipDropdown,exports.ChipDropdownContainer=Y.ChipDropdownContainer,exports.OpenedDropdown=Q.OpenedDropdown,exports.MenuItemDropdown=K.MenuItemDropdown,exports.AnalyticsCard=X.AnalyticsCard,exports.AnalyticsContainer=z.AnalyticsContainer,exports.CardDataContainer=z.CardDataContainer,exports.Input=Z.Input,exports.AnalyticsChip=J.AnalyticsChip,exports.AnalyticsDropdown=$.AnalyticsDropdown,exports.EachItem=$.EachItem,exports.formatDate=$.formatDate,exports.AnalyticsMultiChip=ee.AnalyticsMultiChip,exports.AnalyticsMetric=re.AnalyticsMetric,exports.AnalyticsTrend=te.AnalyticsTrend,exports.LineChart=oe.LineChart,exports.LinearChipGroupedChart=ne.LinearChipGroupedChart,exports.Card=se.Card,exports.PieChartAnalytics=se.PieChartAnalytics,exports.PieChart=ae.PieChart,exports.HorizontalGraph=ie.HorizontalGraph,exports.StackedBarChart=pe.StackedBarChart,exports.StackedBarDistributionChart=ue.StackedBarDistributionChart,Object.defineProperty(exports,"GRAPH_ORIENTATION",{enumerable:!0,get:function(){return ce.GRAPH_ORIENTATION}}),exports.VerticalGraph=le.VerticalGraph,exports.FunnelVerticalBarGraph=de.FunnelVerticalBarGraph,Object.defineProperty(exports,"HEAT",{enumerable:!0,get:function(){return me.HEAT}}),exports.HEAT_COLORS=me.HEAT_COLORS,Object.defineProperty(exports,"HEAT_GRADING_TYPE",{enumerable:!0,get:function(){return me.HEAT_GRADING_TYPE}}),exports.HeatMap=me.HeatMap,exports.HeatBoxStyled=xe.HeatBoxStyled,exports.HeatMapVertical=xe.HeatMapVertical,exports.VerticalBarAndLinearGraph=Te.VerticalBarAndLinearGraph,Object.defineProperty(exports,"TruncateValue",{enumerable:!0,get:function(){return Pe.TruncateValue}}),exports.calculatePercentage=Pe.calculatePercentage,exports.roundNumber=Pe.roundNumber,exports.truncateValueForIndianStore=Pe.truncateValueForIndianStore,exports.truncateValueForInternationalStore=Pe.truncateValueForInternationalStore,exports.truncateValueTo10K=Pe.truncateValueTo10K,exports.truncateValueToA=Pe.truncateValueToA,exports.truncateValueToB=Pe.truncateValueToB,exports.truncateValueToC=Pe.truncateValueToC,exports.truncateValueToK=Pe.truncateValueToK,exports.truncateValueToL=Pe.truncateValueToL,exports.truncateValueToM=Pe.truncateValueToM,exports.truncateValueToT=Pe.truncateValueToT,exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=Ae.AVATAR_SIZE_VS_ICON_SIZE_MAP,exports.Avatar=Ae.Avatar,exports.BACKGROUND_VS_TEXT_COLOR_MAP=Ae.BACKGROUND_VS_TEXT_COLOR_MAP,Object.defineProperty(exports,"MESSAGE_CHANNELS",{enumerable:!0,get:function(){return Ae.MESSAGE_CHANNELS}}),Object.defineProperty(exports,"AVATAR_BACKGROUND",{enumerable:!0,get:function(){return Se.AVATAR_BACKGROUND}}),exports.AVATAR_SIZE_MAP=Se.AVATAR_SIZE_MAP,Object.defineProperty(exports,"AVATAR_TYPES",{enumerable:!0,get:function(){return Se.AVATAR_TYPES}}),Object.defineProperty(exports,"SIZE",{enumerable:!0,get:function(){return Se.SIZE}}),exports.Alert=Ce.Alert,Object.defineProperty(exports,"ALERT_TYPES",{enumerable:!0,get:function(){return ye.ALERT_TYPES}}),exports.COLOR_CONFIG_MAP=ye.COLOR_CONFIG_MAP,Object.defineProperty(exports,"CONTENT_POSITION",{enumerable:!0,get:function(){return ye.CONTENT_POSITION}}),Object.defineProperty(exports,"RATIO",{enumerable:!0,get:function(){return Oe.RATIO}}),exports.Thumbnail=Oe.Thumbnail,exports.Curtain=je.Curtain,exports.DatePicker=be.DatePicker,exports.DatePickerWrapper=Ee.DatePickerWrapper,exports.TimePicker=he.TimePicker,exports.Loader=Ie.Loader,exports.Switch=Ie.Switch,exports.SwitchContainer=Ie.SwitchContainer,exports.Thumb=Ie.Thumb,exports.SubscriptionPlan=Re.SubscriptionPlan,exports.BottomWrapper=_e.BottomWrapper,exports.HeaderWrapper=_e.HeaderWrapper,exports.SubscriptionPlanSelector=_e.SubscriptionPlanSelector,exports.defaultTabs=_e.defaultTabs,exports.NewSubscriptionPlan=ge.NewSubscriptionPlan,exports.SubscriptionPlansCollected=Be.SubscriptionPlansCollected,exports.TabItemComponent=qe.TabItemComponent,exports.Tabs=qe.Tabs,exports.DynamicTabs=fe.DynamicTabs,exports.BikShimmer=Ne.BikShimmer,exports.TablePagination=we.TablePagination,exports.TablePaginationCard=De.TablePaginationCard,exports.TablePaginationCardStyled=De.TablePaginationCardStyled,exports.StateModalComponent=Me.StateModalComponent,exports.DeleteConfirmationModal=ke.DeleteConfirmationModal,Object.defineProperty(exports,"ButtonActions",{enumerable:!0,get:function(){return Le.ButtonActions}}),Object.defineProperty(exports,"ButtonTypes",{enumerable:!0,get:function(){return Le.ButtonTypes}}),exports.StateComponent=Le.StateComponent,Object.defineProperty(exports,"StateInterface",{enumerable:!0,get:function(){return Le.StateInterface}}),exports.ShopifyScopeWrapper=Ve.ShopifyScopeWrapper,exports.WhatsAppTextEditor=Ue.WhatsAppTextEditor,exports.CustomRightBorder=ve.CustomRightBorder,Object.defineProperty(exports,"EditorActionTypes",{enumerable:!0,get:function(){return ve.EditorActionTypes}}),exports.WhatsAppTextEditorHeader=ve.WhatsAppTextEditorHeader,exports.BackgroundImageContainer=Fe.BackgroundImageContainer,exports.MainCardContainer=Fe.MainCardContainer,exports.MainContainer=Fe.MainContainer,exports.WhatsNewIconContainer=Fe.WhatsNewIconContainer,exports.WhatsNewWrapper=Fe.WhatsNewWrapper,exports.WhatsNewButton=Ge.WhatsNewButton,exports.WhatsNewPanel=We.WhatsNewPanel,exports.WhatsNewProvider=He.WhatsNewProvider,exports.useWhatsNewContext=He.useWhatsNewContext,exports.WhatsNew=Ye.WhatsNew,exports.useWhatsNew=Qe.useWhatsNew,exports.BaseWhatsappContentLangHelper=Ke.BaseWhatsappContentLangHelper,exports.CURTAIN_COLOR_CONFIG_MAP=Xe.CURTAIN_COLOR_CONFIG_MAP,Object.defineProperty(exports,"CURTAIN_MODE",{enumerable:!0,get:function(){return Xe.CURTAIN_MODE}}),Object.defineProperty(exports,"CURTAIN_TYPES",{enumerable:!0,get:function(){return Xe.CURTAIN_TYPES}}),exports.resizeImage=ze.resizeImage,Object.defineProperty(exports,"PickerType",{enumerable:!0,get:function(){return Ze.PickerType}}),exports.CardSelectionModal=Je.CardSelectionModal,exports.BikImageCropper=$e.BikImageCropper,exports.BikImagePipeline=er.BikImagePipeline,exports.ButtonGroup=rr.ButtonGroup,exports.BikAccordion=tr.BikAccordion,exports.FileUploader=or.FileUploader,exports.ColourInput=nr.ColourInput,exports.CodeBlock=sr.CodeBlock,Object.defineProperty(exports,"CodeLanguage",{enumerable:!0,get:function(){return ar.CodeLanguage}}),exports.BikHeader=ir.BikHeader,exports.BikLayout=pr.BikLayout,exports.BikProfile=ur.BikProfile,exports.SimpleSidebar=cr.SimpleSidebar,exports.BikSidebar=lr.BikSidebar,exports.FeatureModal=dr.FeatureModal,exports.SidebarSkeleton=mr.SidebarSkeleton,exports.ShowShopifyRestrictedModal=xr.ShowShopifyRestrictedModal,exports.FeatureModalV2=Tr.FeatureModalV2,exports.SearchBar=Pr.SearchBar,exports.CustomDateTime=Ar.CustomDateTime,exports.PricePleaseProductPicker=Sr.PricePleaseProductPicker,exports.ProductPickerContent=Sr.ProductPickerContent,exports.DiscountModal=Cr.DiscountModal,exports.CouponExpiration=yr.CouponExpiration,Object.defineProperty(exports,"COUPON_EXPIRATION",{enumerable:!0,get:function(){return Or.COUPON_EXPIRATION}}),Object.defineProperty(exports,"DISCOUNT_APPLIES_TO",{enumerable:!0,get:function(){return Or.DISCOUNT_APPLIES_TO}}),Object.defineProperty(exports,"DISCOUNT_TARGET_SELECTION",{enumerable:!0,get:function(){return Or.DISCOUNT_TARGET_SELECTION}}),Object.defineProperty(exports,"DISCOUNT_TARGET_TYPES",{enumerable:!0,get:function(){return Or.DISCOUNT_TARGET_TYPES}}),Object.defineProperty(exports,"DISCOUNT_TYPES",{enumerable:!0,get:function(){return Or.DISCOUNT_TYPES}}),Object.defineProperty(exports,"DISCOUNT_VALUE_TYPES",{enumerable:!0,get:function(){return Or.DISCOUNT_VALUE_TYPES}}),Object.defineProperty(exports,"MIN_PURCHASE_REQUIREMENT",{enumerable:!0,get:function(){return Or.MIN_PURCHASE_REQUIREMENT}}),Object.defineProperty(exports,"OFFER_APPLIES_TO",{enumerable:!0,get:function(){return Or.OFFER_APPLIES_TO}}),exports.initialDynamicCouponErrorState=Or.initialDynamicCouponErrorState,exports.initialStaticCouponErrorState=Or.initialStaticCouponErrorState,exports.CountryCodePicker=jr.CountryCodePicker,exports.CountriesData=br.CountriesData,exports.DEFAULT_IMAGE=Er.DEFAULT_IMAGE,exports.ShimmerImage=Er.ShimmerImage,exports.ProductPickerModal=hr.ProductPickerModal,Object.defineProperty(exports,"ScreenName",{enumerable:!0,get:function(){return Ir.ScreenName}}),exports.Carousel=Rr.Carousel,exports.CarouselSecondary=_r.CarouselSecondary,exports.AccessTokenTroubleshootDialog=gr.AccessTokenTroubleshootDialog,exports.RadioList=Br.RadioList,exports.CheckList=qr.CheckList,Object.defineProperty(exports,"DateKeys",{enumerable:!0,get:function(){return fr.DateKeys}}),Object.defineProperty(exports,"MEDIA_TYPES",{enumerable:!0,get:function(){return fr.MEDIA_TYPES}}),exports.PostPicker=fr.PostPicker,exports.dateOptions=fr.dateOptions,exports.DropdownButton=Nr.DropdownButton,exports.SideModal=wr.SideModal,exports.KeywordsInput=Dr.KeywordsInput,exports.AddVariableV2SideModal=Mr.AddVariableV2SideModal,exports.AddVariableV2=kr.AddVariableV2,exports.NaLinkWrapper=Lr.NaLinkWrapper,exports.NavigationHyperlink=Lr.NavigationHyperlink,exports.SearchFilter=Vr.SearchFilter,exports.InputWithVariables=Ur.InputWithVariables,exports.DashboardReviewPopUp=vr.DashboardReviewPopUp,exports.StarRating=Fr.StarRating,exports.TestimonialCard=Gr.TestimonialCard,exports.BikSlider=Wr.BikSlider,exports.ResizableImage=Hr.ResizableImage,exports.validateURL=Yr.validateURL,exports.CarouselPreview=Qr.CarouselPreview,exports.Floater=Kr.Floater,exports.CardSelector=Xr.CardSelector,exports.CardSelectorGroup=zr.CardSelectorGroup,exports.VariablePicker=Zr.VariablePicker,exports.ActionButtons=Jr.ActionButtons,exports.ActivateBikAi=$r.ActivateBikAi,exports.AiSyncProgress=et.AiSyncProgress,exports.AiCreditsExhausted=rt.AiCreditsExhausted,exports.AiCreditsLow=tt.AiCreditsLow,exports.CustomPortal=ot.CustomPortal,exports.FloatingInputDropdown=nt.FloatingInputDropdown,exports.MultilevelDropdownPopover=st.MultilevelDropdownPopover,exports.DropShadow=at.DropShadow,exports.MultiLevelDropdown=it.MultiLevelDropdown,exports.DataSourcePanel=pt.DataSourcePanel,exports.UnsatisfactoryResponseList=ut.UnsatisfactoryResponseList,exports.UnsatisfactoryCountIntentWiseModal=ct.UnsatisfactoryCountIntentWiseModal,Object.defineProperty(exports,"CustomDataCategories",{enumerable:!0,get:function(){return lt.CustomDataCategories}}),Object.defineProperty(exports,"CustomDataType",{enumerable:!0,get:function(){return lt.CustomDataType}}),exports.TextPickerModal=dt.TextPickerModal,exports.DotPulse=mt.DotPulse,exports.BIKChatbot=xt.BIKChatbot,exports.AIChat=Tt.AIChat,exports.AIProvider=Pt.AIProvider,exports.useAIContext=Pt.useAIContext,exports.useAIChat=At.useAIChat,exports.CHAT_MESSAGE_ROLES=St.CHAT_MESSAGE_ROLES,exports.DEFAULT_CONVERSATION_ID=St.DEFAULT_CONVERSATION_ID,exports.createSessionRecord=St.createSessionRecord,exports.DEFAULT_MAX_TOOL_CALLS=Ct.DEFAULT_MAX_TOOL_CALLS,exports.DEFAULT_RESPONSE_FORMAT=Ct.DEFAULT_RESPONSE_FORMAT,exports.RESPONSE_FORMATS=Ct.RESPONSE_FORMATS,exports.AdBanner=yt.default,Object.defineProperty(exports,"BannerThirdPartyIcon",{enumerable:!0,get:function(){return Ot.BannerThirdPartyIcon}}),Object.defineProperty(exports,"BannerType",{enumerable:!0,get:function(){return Ot.BannerType}}),exports.getUrlForBannerThirdPartyIcon=Ot.getUrlForBannerThirdPartyIcon,exports.FeatureAnnouncementProvider=jt.default,exports.MajorUpdatePopup=bt.default,exports.MinorUpdatePopup=Et.default,exports.VideoModal=ht.VideoModal,exports.useFeatureAnnouncements=It.useFeatureAnnouncements,exports.TEXT=Rt.TEXT,Object.defineProperty(exports,"CarouselVersion",{enumerable:!0,get:function(){return _t.CarouselVersion}}),exports.ANIMATION_TIMING=gt.ANIMATION_TIMING,exports.POPUP_DIMENSIONS=Bt.POPUP_DIMENSIONS;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./amplitude/index.js"),r=require("./components/template-preview/constants/regexPatterns.js"),t=require("./utils/StringUtils.js"),o=require("./constants/Theme.js"),n=require("./constants/zindex.js"),a=require("./components/checkBox/CheckBox.js"),s=require("./components/list-item/ListItem.js"),i=require("./components/pagination/Pagination.js"),p=require("./components/radioButton/RadioButton.js"),u=require("./components/toaster/Toaster.js"),c=require("./components/tooltips/Tooltip.js"),l=require("./components/spinner/Spinner.js"),d=require("./components/stepper/Stepper.js"),m=require("./components/tag/Tag.js"),T=require("./components/icon-button/IconButton.js"),x=require("./components/template-preview/TemplatePreview.js"),P=require("./components/template-preview/WhatsApp/WhatsAppLikePreview.js"),S=require("./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),A=require("./components/template-preview/helpers/SmsTemplateHelper.js"),C=require("./components/template-preview/helpers/WhatsAppFormatToHTML.js"),y=require("./components/template-preview/helpers/VariableEditorHelper.js"),O=require("./components/template-preview/models/TemplateMeta.js"),b=require("./components/template-preview/models/WhatsAppTemplate.js"),E=require("./components/template-preview/models/Channels.js"),j=require("./components/template-context-mapper/TemplateContextMapper.js"),h=require("./components/template-context-mapper/utils/getDataFromTemplateComponent.js"),R=require("./components/template-context-mapper/utils/validateIsUrl.js");require("./_virtual/_tslib.js");var I=require("./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js"),_=require("./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js"),g=require("./components/fab-menu/FABMenu.js"),B=require("./components/floating-action-button/FloatingActionButton.js"),q=require("./components/floating-action-button/FloatingActionButton.styles.js"),f=require("./components/image-compress/ImageCompress.js"),D=require("./components/TypographyStyle.js"),k=require("./components/button/Button.js"),L=require("./components/progress-bar/ProgressBarComponent.js");require("./node_modules/react/jsx-runtime.js");var N=require("./components/progress-bar-v2/ProgressBarV2.js"),M=require("./components/QueryBuilder/QueryBuilder.js"),w=require("./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),V=require("./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js"),U=require("./components/QueryBuilder/redux/queryBuilder.reducer.js"),v=require("./components/QueryBuilder/redux/queryBuilderCache.reducer.js"),F=require("./components/QueryBuilder/types/QueryBuilderOperator.type.js"),G=require("./components/modals/styledModal.js"),H=require("./components/dropdown/DropdownPopover/index.js"),W=require("./components/dropdown/Dropdown.js"),Y=require("./components/dropdown/ChipDropdown.js"),Q=require("./components/dropdown/OpenedDropdown/components/OpennedDropdown.js"),K=require("./components/dropdown/MenuItem/MenuItem.js"),z=require("./components/analytics-card/AnalyticsCard.js"),X=require("./components/analytics-card/AnalyticsCard.styled.js"),Z=require("./components/input/Input.js"),J=require("./components/analytics-chips-and-dropdowns/AnalyticsChip.js"),$=require("./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js"),ee=require("./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js"),re=require("./components/analytics-chips-and-dropdowns/AnalyticsMetric.js"),te=require("./components/analytics-chips-and-dropdowns/AnalyticsTrend.js"),oe=require("./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),ne=require("./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js"),ae=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),se=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),ie=require("./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),pe=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),ue=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),ce=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),le=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),de=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js"),me=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),Te=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),xe=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),Pe=require("./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js"),Se=require("./components/avatar/Avatar.js"),Ae=require("./components/avatar/AvatarHelper.js"),Ce=require("./components/alerts/Alert.js"),ye=require("./components/alerts/AlertHelper.js"),Oe=require("./components/thumbnail/Thumbnail.js"),be=require("./components/curtain/Curtain.js"),Ee=require("./components/datePicker/DatePicker.js"),je=require("./components/datePicker/DatePickerWrapper.js"),he=require("./components/datePicker/TimePicker.js"),Re=require("./components/switch/Switch.js"),Ie=require("./components/plans/SubscriptionPlan.js"),_e=require("./components/plans/SubscriptionPlanSelector.js"),ge=require("./components/plans/NewSubscriptionPlan.js"),Be=require("./components/plans/SubscriptionPlansCollected.js"),qe=require("./components/tabs/Tabs.js"),fe=require("./components/dynamic-tabs/DynamicTabs.js"),De=require("./components/shimmer/ShimmerComponent/BikShimmer.js"),ke=require("./components/TablePagination/TablePagination.js"),Le=require("./components/TablePagination/TablePaginationCard.js"),Ne=require("./components/states-modal/StateModalComponent.js"),Me=require("./components/states-modal/DeleteConfirmationModal.js"),we=require("./components/states/StateComponent.js"),Ve=require("./components/states/ShopifyScopeWrapper.js"),Ue=require("./components/WhatsAppTextEditor/WhatsAppTextEditor.js"),ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),Fe=require("./helpers/BaseWhatsappContentLang.helper.js"),Ge=require("./components/curtain/CurtainHelper.js"),He=require("./utils/resizeImage.js"),We=require("./components/variable-picker-v3/model.js"),Ye=require("./components/card-selection-modal/CardSelectionModal.js"),Qe=require("./components/image-cropper/BikImageCropper.js"),Ke=require("./components/image-cropper/BikImagePipeline/BikImagePipeline.js"),ze=require("./components/buttonGroup/ButtonGroup.js"),Xe=require("./components/accordion/Accordion.js"),Ze=require("./components/file-uploader/FileUploader.js"),Je=require("./components/colourInput/ColourInput.js"),$e=require("./components/code-block/CodeBlock.js"),er=require("./components/code-block/types.js"),rr=require("./components/bik-layout/BikHeader.js"),tr=require("./components/bik-layout/BikLayout.js"),or=require("./components/bik-layout/BikProfile.js"),nr=require("./components/bik-layout/SimpleSidebar.js"),ar=require("./components/bik-layout/BikSidebar.js"),sr=require("./components/bik-layout/FeatureModal.js"),ir=require("./components/bik-layout/SidebarSkeleton.js"),pr=require("./components/bik-layout/ShowShopifyRestrictedModal.js"),ur=require("./components/bik-layout/FeatureModalV2.js"),cr=require("./components/searchBar/searchBar.js"),lr=require("./components/custom-date-time/CustomDateTime.js"),dr=require("./components/product-picker/ProductPickerModal.js"),mr=require("./components/discount-modal/DiscountModal.js"),Tr=require("./components/discount-modal/CouponExpiration/CouponExpiration.js"),xr=require("./components/discount-modal/type.js"),Pr=require("./components/country-code-picker/CountryCodePicker.js"),Sr=require("./components/country-code-picker/CountryCodePicker.modal.js"),Ar=require("./components/shimmer-image/ShimmerImage.js"),Cr=require("./components/product-picker-v2/modal.js"),yr=require("./components/product-picker-v2/type.js"),Or=require("./components/carousel/carousel.js"),br=require("./components/carousel-secondary/CarouselSecondary.js"),Er=require("./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js"),jr=require("./components/radioList/RadioList.js"),hr=require("./components/checkList/CheckList.js"),Rr=require("./components/postPicker/postPicker.js"),Ir=require("./components/dropdown-button/DropdownButton.js"),_r=require("./components/side-modal/SideModal.js"),gr=require("./components/keywords-input/KeywordsInput.js"),Br=require("./components/add-variableV2/AddVariableV2SideModal.js"),qr=require("./components/add-variableV2/AddVariableV2.js"),fr=require("./components/navigation-hyperlink/NavigationHyperlink.js"),Dr=require("./components/SearchFilter/index.js"),kr=require("./components/input-with-vars/InputWithVariables.js"),Lr=require("./components/dashboard-review-popup/DashboardReviewPopUp.js"),Nr=require("./components/star-rating/StarRating.js"),Mr=require("./components/testimonial-card/TestimonialCard.js"),wr=require("./components/slider/slider.js"),Vr=require("./components/resizeImage/index.js"),Ur=require("./utils/validator.js"),vr=require("./components/carousel-preview/CarouselPreview.js"),Fr=require("./components/floater/floater.js"),Gr=require("./components/card-selector/CardSelector.js"),Hr=require("./components/card-selector/CardSelectorGroup.js"),Wr=require("./components/variable-picker-v3/VariablePicker.js"),Yr=require("./components/action-button/ActionButtons.js"),Qr=require("./components/ai-modals/ActivateBikAI.js"),Kr=require("./components/ai-modals/AiSyncProgress.js"),zr=require("./components/ai-modals/AiCreditsExhausted.js"),Xr=require("./components/ai-modals/AiCreditsLow.js"),Zr=require("./components/input-with-vars/customPortal.js"),Jr=require("./components/floating-input-dropdown/FloatingInputDropdown.js"),$r=require("./components/dropdown/MultilevelDropdownPopover/index.js"),et=require("./components/dropShadow/DropShadow.js"),rt=require("./components/multi-level-dropdown/MultiLevelDropdown.js"),tt=require("./components/data-source-panel/DataSourcePanel.js"),ot=require("./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js"),nt=require("./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js"),at=require("./components/data-source-panel/model.js"),st=require("./components/text-picker/TextPickerModal.js"),it=require("./components/dot-pulse/DotPulse.js"),pt=require("./components/bik-chatbot/components/BIKChatbot.js"),ut=require("./components/bik-chatbot/components/AIChat.js"),ct=require("./components/bik-chatbot/contexts/AIContext.js"),lt=require("./components/bik-chatbot/services/useAIChat.js"),dt=require("./components/bik-chatbot/types/chat.js"),mt=require("./components/bik-chatbot/types/ai.js"),Tt=require("./components/banner/AdBanner.js"),xt=require("./components/banner/model.js"),Pt=require("./components/carousel-secondary/model.js");exports.AmplitudeEvent=e.AmplitudeEvent,exports.regexPatterns=r,exports.StringUtils=t.default,exports.BASE_COLORS=o.BASE_COLORS,exports.COLORS=o.COLORS,exports.DEFAULT_THEME=o.DEFAULT_THEME,exports.FONTS=o.FONTS,exports.ComponentZindex=n.ComponentZindex,exports.CheckBox=a.CheckBox,exports.ListItem=s.ListItem,exports.Pagination=i.Pagination,exports.RadioButton=p.RadioButton,exports.Toaster=u.Toaster,exports.Tooltip=c.Tooltip,exports.PureSpinner=l.PureSpinner,exports.Spinner=l.Spinner,exports.Stepper=d.Stepper,exports.Tag=m.Tag,exports.IconButton=T.IconButton,exports.TemplatePreview=x.TemplatePreview,exports.WhatsappLikePreview=P.WhatsappLikePreview,exports.WhatsappLikePreviewV2=S.WhatsappLikePreviewV2,exports.renderVariableUIForPreview=A.renderVariableUIForPreview,exports.WhatsAppFormatToHTML=C.WhatsAppFormatToHTML,exports.VariableEditorHelper=y.VariableEditorHelper,Object.defineProperty(exports,"ACTIONS_TYPES",{enumerable:!0,get:function(){return O.ACTIONS_TYPES}}),exports.CUSTOM_URL_NAME=O.CUSTOM_URL_NAME,Object.defineProperty(exports,"HEADER_TYPES",{enumerable:!0,get:function(){return O.HEADER_TYPES}}),exports.STATIC_URL_CTA_OPTION=O.STATIC_URL_CTA_OPTION,Object.defineProperty(exports,"TEMPLATE_EDITOR",{enumerable:!0,get:function(){return O.TEMPLATE_EDITOR}}),Object.defineProperty(exports,"TEMPLATE_STATUS",{enumerable:!0,get:function(){return O.TEMPLATE_STATUS}}),exports.UNSUBSCRIBE_URL_OPTION=O.UNSUBSCRIBE_URL_OPTION,Object.defineProperty(exports,"BUTTON_TYPE",{enumerable:!0,get:function(){return b.BUTTON_TYPE}}),Object.defineProperty(exports,"POD",{enumerable:!0,get:function(){return b.POD}}),Object.defineProperty(exports,"TEMPLATE_QUALITY",{enumerable:!0,get:function(){return b.TEMPLATE_QUALITY}}),Object.defineProperty(exports,"CHANNEL_TYPE",{enumerable:!0,get:function(){return E.CHANNEL_TYPE}}),exports.TemplateContextMapper=j.TemplateContextMapper,exports.getAllDataFromTemplateComponent=h.getAllDataFromTemplateComponent,exports.getAllDataFromWebpushTemplateComponent=h.getAllDataFromWebpushTemplateComponent,exports.isVariable=R.isVariable,exports.validateIsUrl=R.validateIsUrl,exports.TemplateAnalyticsSkeleton=I.TemplateAnalyticsSkeleton,exports.AnalyticsItem=_.AnalyticsItem,exports.QualityTimelineChart=_.QualityTimelineChart,exports.RightPanelTemplateAnalytics=_.RightPanelTemplateAnalytics,exports.TemplateAnalyticsComponent=_.TemplateAnalyticsComponent,exports.FABMenu=g.FABMenu,exports.FloatingActionButton=B.FloatingActionButton,Object.defineProperty(exports,"DROP_POSITION",{enumerable:!0,get:function(){return q.DROP_POSITION}}),exports.DropdownToggleContainer=q.DropdownToggleContainer,Object.defineProperty(exports,"FAB_POSITION",{enumerable:!0,get:function(){return q.FAB_POSITION}}),exports.FloatingActionButtonContainer=q.FloatingActionButtonContainer,exports.FloatingActionButtonOuterContainer=q.FloatingActionButtonOuterContainer,Object.defineProperty(exports,"MENU_ALIGNMENT",{enumerable:!0,get:function(){return q.MENU_ALIGNMENT}}),exports.StyledDropdown=q.StyledDropdown,exports.TooltipStyled=q.TooltipStyled,exports.ImageService=f.ImageService,exports.AiBodyCaption=D.AiBodyCaption,exports.AiBodyTiny=D.AiBodyTiny,exports.BodyCaption=D.BodyCaption,exports.BodyLarge=D.BodyLarge,exports.BodyPrimary=D.BodyPrimary,exports.BodyPrimaryLink=D.BodyPrimaryLink,exports.BodyRegular=D.BodyRegular,exports.BodySecondary=D.BodySecondary,exports.BodySecondaryLink=D.BodySecondaryLink,exports.BodySmall=D.BodySmall,exports.BodyTiny=D.BodyTiny,exports.ButtonLarge=D.ButtonLarge,exports.ButtonLargeAI=D.ButtonLargeAI,exports.ButtonRegular=D.ButtonRegular,exports.ButtonRegularAI=D.ButtonRegularAI,exports.Caption=D.Caption,exports.CaptionBold=D.CaptionBold,exports.Display=D.Display,exports.SmallRegular=D.SmallRegular,exports.SubHeading=D.SubHeading,exports.TextPlaceholder=D.TextPlaceholder,exports.Tiny=D.Tiny,exports.TitleFour=D.TitleFour,exports.TitleLarge=D.TitleLarge,exports.TitleMedium=D.TitleMedium,exports.TitleRegular=D.TitleRegular,exports.TitleSmall=D.TitleSmall,exports.TitleXlarge=D.TitleXlarge,exports.Button=k.Button,exports.ProgressBarComponent=L.ProgressBarComponent,exports.ProgressCompletedBar=L.ProgressCompletedBar,Object.defineProperty(exports,"ProgressBarType",{enumerable:!0,get:function(){return N.ProgressBarType}}),exports.ProgressBarV2=N.ProgressBarV2,Object.defineProperty(exports,"TextAlignment",{enumerable:!0,get:function(){return N.TextAlignment}}),exports.QueryBuilder=M.QueryBuilder,exports.BaseQueryBuilderNode=w.BaseQueryBuilderNode,exports.PropertyNode=V.PropertyNode,exports.PropertyNodeHeadless=V.PropertyNodeHeadless,exports.queryBuilderSlice=U.queryBuilderSlice,exports.queryBuilderCacheSlice=v.queryBuilderCacheSlice,Object.defineProperty(exports,"AD_STRING_OPERATORS",{enumerable:!0,get:function(){return F.AD_STRING_OPERATORS}}),Object.defineProperty(exports,"ANY_AD_OPERATORS",{enumerable:!0,get:function(){return F.ANY_AD_OPERATORS}}),Object.defineProperty(exports,"ANY_IG_OPERATORS",{enumerable:!0,get:function(){return F.ANY_IG_OPERATORS}}),Object.defineProperty(exports,"BOOLEAN_OPERATORS",{enumerable:!0,get:function(){return F.BOOLEAN_OPERATORS}}),Object.defineProperty(exports,"DATE_OPERATORS",{enumerable:!0,get:function(){return F.DATE_OPERATORS}}),Object.defineProperty(exports,"EVENT_VALUES",{enumerable:!0,get:function(){return F.EVENT_VALUES}}),Object.defineProperty(exports,"EXACTLY_OPERATORS",{enumerable:!0,get:function(){return F.EXACTLY_OPERATORS}}),Object.defineProperty(exports,"FREQUENCY_OPERATORS",{enumerable:!0,get:function(){return F.FREQUENCY_OPERATORS}}),Object.defineProperty(exports,"ICE_BREAKER_OPERATORS",{enumerable:!0,get:function(){return F.ICE_BREAKER_OPERATORS}}),Object.defineProperty(exports,"IG_STRING_OPERATORS",{enumerable:!0,get:function(){return F.IG_STRING_OPERATORS}}),Object.defineProperty(exports,"INTEGER_OPERATORS",{enumerable:!0,get:function(){return F.INTEGER_OPERATORS}}),Object.defineProperty(exports,"MAIL_SUBJECT_OPERATORS",{enumerable:!0,get:function(){return F.MAIL_SUBJECT_OPERATORS}}),Object.defineProperty(exports,"REACTION_OPERATORS",{enumerable:!0,get:function(){return F.REACTION_OPERATORS}}),Object.defineProperty(exports,"SPECIFIC_IG_OPERATORS",{enumerable:!0,get:function(){return F.SPECIFIC_IG_OPERATORS}}),Object.defineProperty(exports,"STRING_OPERATORS",{enumerable:!0,get:function(){return F.STRING_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS",{enumerable:!0,get:function(){return F.STRING_RESTRICTED_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_2",{enumerable:!0,get:function(){return F.STRING_RESTRICTED_OPERATORS_2}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_3",{enumerable:!0,get:function(){return F.STRING_RESTRICTED_OPERATORS_3}}),exports.StyledModal=G.StyledModal,exports.DropdownPopover=H.DropdownPopover,exports.Dropdown=W.Dropdown,exports.ChipDropdown=Y.ChipDropdown,exports.ChipDropdownContainer=Y.ChipDropdownContainer,exports.OpenedDropdown=Q.OpenedDropdown,exports.MenuItemDropdown=K.MenuItemDropdown,exports.AnalyticsCard=z.AnalyticsCard,exports.AnalyticsContainer=X.AnalyticsContainer,exports.CardDataContainer=X.CardDataContainer,exports.Input=Z.Input,exports.AnalyticsChip=J.AnalyticsChip,exports.AnalyticsDropdown=$.AnalyticsDropdown,exports.EachItem=$.EachItem,exports.formatDate=$.formatDate,exports.AnalyticsMultiChip=ee.AnalyticsMultiChip,exports.AnalyticsMetric=re.AnalyticsMetric,exports.AnalyticsTrend=te.AnalyticsTrend,exports.LineChart=oe.LineChart,exports.LinearChipGroupedChart=ne.LinearChipGroupedChart,exports.Card=ae.Card,exports.PieChartAnalytics=ae.PieChartAnalytics,exports.PieChart=se.PieChart,exports.HorizontalGraph=ie.HorizontalGraph,exports.StackedBarChart=pe.StackedBarChart,exports.StackedBarDistributionChart=ue.StackedBarDistributionChart,Object.defineProperty(exports,"GRAPH_ORIENTATION",{enumerable:!0,get:function(){return ce.GRAPH_ORIENTATION}}),exports.VerticalGraph=le.VerticalGraph,exports.FunnelVerticalBarGraph=de.FunnelVerticalBarGraph,Object.defineProperty(exports,"HEAT",{enumerable:!0,get:function(){return me.HEAT}}),exports.HEAT_COLORS=me.HEAT_COLORS,Object.defineProperty(exports,"HEAT_GRADING_TYPE",{enumerable:!0,get:function(){return me.HEAT_GRADING_TYPE}}),exports.HeatMap=me.HeatMap,exports.HeatBoxStyled=Te.HeatBoxStyled,exports.HeatMapVertical=Te.HeatMapVertical,exports.VerticalBarAndLinearGraph=xe.VerticalBarAndLinearGraph,Object.defineProperty(exports,"TruncateValue",{enumerable:!0,get:function(){return Pe.TruncateValue}}),exports.calculatePercentage=Pe.calculatePercentage,exports.roundNumber=Pe.roundNumber,exports.truncateValueForIndianStore=Pe.truncateValueForIndianStore,exports.truncateValueForInternationalStore=Pe.truncateValueForInternationalStore,exports.truncateValueTo10K=Pe.truncateValueTo10K,exports.truncateValueToA=Pe.truncateValueToA,exports.truncateValueToB=Pe.truncateValueToB,exports.truncateValueToC=Pe.truncateValueToC,exports.truncateValueToK=Pe.truncateValueToK,exports.truncateValueToL=Pe.truncateValueToL,exports.truncateValueToM=Pe.truncateValueToM,exports.truncateValueToT=Pe.truncateValueToT,exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=Se.AVATAR_SIZE_VS_ICON_SIZE_MAP,exports.Avatar=Se.Avatar,exports.BACKGROUND_VS_TEXT_COLOR_MAP=Se.BACKGROUND_VS_TEXT_COLOR_MAP,Object.defineProperty(exports,"MESSAGE_CHANNELS",{enumerable:!0,get:function(){return Se.MESSAGE_CHANNELS}}),Object.defineProperty(exports,"AVATAR_BACKGROUND",{enumerable:!0,get:function(){return Ae.AVATAR_BACKGROUND}}),exports.AVATAR_SIZE_MAP=Ae.AVATAR_SIZE_MAP,Object.defineProperty(exports,"AVATAR_TYPES",{enumerable:!0,get:function(){return Ae.AVATAR_TYPES}}),Object.defineProperty(exports,"SIZE",{enumerable:!0,get:function(){return Ae.SIZE}}),exports.Alert=Ce.Alert,Object.defineProperty(exports,"ALERT_TYPES",{enumerable:!0,get:function(){return ye.ALERT_TYPES}}),exports.COLOR_CONFIG_MAP=ye.COLOR_CONFIG_MAP,Object.defineProperty(exports,"CONTENT_POSITION",{enumerable:!0,get:function(){return ye.CONTENT_POSITION}}),Object.defineProperty(exports,"RATIO",{enumerable:!0,get:function(){return Oe.RATIO}}),exports.Thumbnail=Oe.Thumbnail,exports.Curtain=be.Curtain,exports.DatePicker=Ee.DatePicker,exports.DatePickerWrapper=je.DatePickerWrapper,exports.TimePicker=he.TimePicker,exports.Loader=Re.Loader,exports.Switch=Re.Switch,exports.SwitchContainer=Re.SwitchContainer,exports.Thumb=Re.Thumb,exports.SubscriptionPlan=Ie.SubscriptionPlan,exports.BottomWrapper=_e.BottomWrapper,exports.HeaderWrapper=_e.HeaderWrapper,exports.SubscriptionPlanSelector=_e.SubscriptionPlanSelector,exports.defaultTabs=_e.defaultTabs,exports.NewSubscriptionPlan=ge.NewSubscriptionPlan,exports.SubscriptionPlansCollected=Be.SubscriptionPlansCollected,exports.TabItemComponent=qe.TabItemComponent,exports.Tabs=qe.Tabs,exports.DynamicTabs=fe.DynamicTabs,exports.BikShimmer=De.BikShimmer,exports.TablePagination=ke.TablePagination,exports.TablePaginationCard=Le.TablePaginationCard,exports.TablePaginationCardStyled=Le.TablePaginationCardStyled,exports.StateModalComponent=Ne.StateModalComponent,exports.DeleteConfirmationModal=Me.DeleteConfirmationModal,Object.defineProperty(exports,"ButtonActions",{enumerable:!0,get:function(){return we.ButtonActions}}),Object.defineProperty(exports,"ButtonTypes",{enumerable:!0,get:function(){return we.ButtonTypes}}),exports.StateComponent=we.StateComponent,Object.defineProperty(exports,"StateInterface",{enumerable:!0,get:function(){return we.StateInterface}}),exports.ShopifyScopeWrapper=Ve.ShopifyScopeWrapper,exports.WhatsAppTextEditor=Ue.WhatsAppTextEditor,exports.CustomRightBorder=ve.CustomRightBorder,Object.defineProperty(exports,"EditorActionTypes",{enumerable:!0,get:function(){return ve.EditorActionTypes}}),exports.WhatsAppTextEditorHeader=ve.WhatsAppTextEditorHeader,exports.BaseWhatsappContentLangHelper=Fe.BaseWhatsappContentLangHelper,exports.CURTAIN_COLOR_CONFIG_MAP=Ge.CURTAIN_COLOR_CONFIG_MAP,Object.defineProperty(exports,"CURTAIN_MODE",{enumerable:!0,get:function(){return Ge.CURTAIN_MODE}}),Object.defineProperty(exports,"CURTAIN_TYPES",{enumerable:!0,get:function(){return Ge.CURTAIN_TYPES}}),exports.resizeImage=He.resizeImage,Object.defineProperty(exports,"PickerType",{enumerable:!0,get:function(){return We.PickerType}}),exports.CardSelectionModal=Ye.CardSelectionModal,exports.BikImageCropper=Qe.BikImageCropper,exports.BikImagePipeline=Ke.BikImagePipeline,exports.ButtonGroup=ze.ButtonGroup,exports.BikAccordion=Xe.BikAccordion,exports.FileUploader=Ze.FileUploader,exports.ColourInput=Je.ColourInput,exports.CodeBlock=$e.CodeBlock,Object.defineProperty(exports,"CodeLanguage",{enumerable:!0,get:function(){return er.CodeLanguage}}),exports.BikHeader=rr.BikHeader,exports.BikLayout=tr.BikLayout,exports.BikProfile=or.BikProfile,exports.SimpleSidebar=nr.SimpleSidebar,exports.BikSidebar=ar.BikSidebar,exports.FeatureModal=sr.FeatureModal,exports.SidebarSkeleton=ir.SidebarSkeleton,exports.ShowShopifyRestrictedModal=pr.ShowShopifyRestrictedModal,exports.FeatureModalV2=ur.FeatureModalV2,exports.SearchBar=cr.SearchBar,exports.CustomDateTime=lr.CustomDateTime,exports.PricePleaseProductPicker=dr.PricePleaseProductPicker,exports.ProductPickerContent=dr.ProductPickerContent,exports.DiscountModal=mr.DiscountModal,exports.CouponExpiration=Tr.CouponExpiration,Object.defineProperty(exports,"COUPON_EXPIRATION",{enumerable:!0,get:function(){return xr.COUPON_EXPIRATION}}),Object.defineProperty(exports,"DISCOUNT_APPLIES_TO",{enumerable:!0,get:function(){return xr.DISCOUNT_APPLIES_TO}}),Object.defineProperty(exports,"DISCOUNT_TARGET_SELECTION",{enumerable:!0,get:function(){return xr.DISCOUNT_TARGET_SELECTION}}),Object.defineProperty(exports,"DISCOUNT_TARGET_TYPES",{enumerable:!0,get:function(){return xr.DISCOUNT_TARGET_TYPES}}),Object.defineProperty(exports,"DISCOUNT_TYPES",{enumerable:!0,get:function(){return xr.DISCOUNT_TYPES}}),Object.defineProperty(exports,"DISCOUNT_VALUE_TYPES",{enumerable:!0,get:function(){return xr.DISCOUNT_VALUE_TYPES}}),Object.defineProperty(exports,"MIN_PURCHASE_REQUIREMENT",{enumerable:!0,get:function(){return xr.MIN_PURCHASE_REQUIREMENT}}),Object.defineProperty(exports,"OFFER_APPLIES_TO",{enumerable:!0,get:function(){return xr.OFFER_APPLIES_TO}}),exports.initialDynamicCouponErrorState=xr.initialDynamicCouponErrorState,exports.initialStaticCouponErrorState=xr.initialStaticCouponErrorState,exports.CountryCodePicker=Pr.CountryCodePicker,exports.CountriesData=Sr.CountriesData,exports.DEFAULT_IMAGE=Ar.DEFAULT_IMAGE,exports.ShimmerImage=Ar.ShimmerImage,exports.ProductPickerModal=Cr.ProductPickerModal,Object.defineProperty(exports,"ScreenName",{enumerable:!0,get:function(){return yr.ScreenName}}),exports.Carousel=Or.Carousel,exports.CarouselSecondary=br.CarouselSecondary,exports.AccessTokenTroubleshootDialog=Er.AccessTokenTroubleshootDialog,exports.RadioList=jr.RadioList,exports.CheckList=hr.CheckList,Object.defineProperty(exports,"DateKeys",{enumerable:!0,get:function(){return Rr.DateKeys}}),Object.defineProperty(exports,"MEDIA_TYPES",{enumerable:!0,get:function(){return Rr.MEDIA_TYPES}}),exports.PostPicker=Rr.PostPicker,exports.dateOptions=Rr.dateOptions,exports.DropdownButton=Ir.DropdownButton,exports.SideModal=_r.SideModal,exports.KeywordsInput=gr.KeywordsInput,exports.AddVariableV2SideModal=Br.AddVariableV2SideModal,exports.AddVariableV2=qr.AddVariableV2,exports.NaLinkWrapper=fr.NaLinkWrapper,exports.NavigationHyperlink=fr.NavigationHyperlink,exports.SearchFilter=Dr.SearchFilter,exports.InputWithVariables=kr.InputWithVariables,exports.DashboardReviewPopUp=Lr.DashboardReviewPopUp,exports.StarRating=Nr.StarRating,exports.TestimonialCard=Mr.TestimonialCard,exports.BikSlider=wr.BikSlider,exports.ResizableImage=Vr.ResizableImage,exports.validateURL=Ur.validateURL,exports.CarouselPreview=vr.CarouselPreview,exports.Floater=Fr.Floater,exports.CardSelector=Gr.CardSelector,exports.CardSelectorGroup=Hr.CardSelectorGroup,exports.VariablePicker=Wr.VariablePicker,exports.ActionButtons=Yr.ActionButtons,exports.ActivateBikAi=Qr.ActivateBikAi,exports.AiSyncProgress=Kr.AiSyncProgress,exports.AiCreditsExhausted=zr.AiCreditsExhausted,exports.AiCreditsLow=Xr.AiCreditsLow,exports.CustomPortal=Zr.CustomPortal,exports.FloatingInputDropdown=Jr.FloatingInputDropdown,exports.MultilevelDropdownPopover=$r.MultilevelDropdownPopover,exports.DropShadow=et.DropShadow,exports.MultiLevelDropdown=rt.MultiLevelDropdown,exports.DataSourcePanel=tt.DataSourcePanel,exports.UnsatisfactoryResponseList=ot.UnsatisfactoryResponseList,exports.UnsatisfactoryCountIntentWiseModal=nt.UnsatisfactoryCountIntentWiseModal,Object.defineProperty(exports,"CustomDataCategories",{enumerable:!0,get:function(){return at.CustomDataCategories}}),Object.defineProperty(exports,"CustomDataType",{enumerable:!0,get:function(){return at.CustomDataType}}),exports.TextPickerModal=st.TextPickerModal,exports.DotPulse=it.DotPulse,exports.BIKChatbot=pt.BIKChatbot,exports.AIChat=ut.AIChat,exports.AIProvider=ct.AIProvider,exports.useAIContext=ct.useAIContext,exports.useAIChat=lt.useAIChat,exports.CHAT_MESSAGE_ROLES=dt.CHAT_MESSAGE_ROLES,exports.DEFAULT_CONVERSATION_ID=dt.DEFAULT_CONVERSATION_ID,exports.createSessionRecord=dt.createSessionRecord,exports.DEFAULT_MAX_TOOL_CALLS=mt.DEFAULT_MAX_TOOL_CALLS,exports.DEFAULT_RESPONSE_FORMAT=mt.DEFAULT_RESPONSE_FORMAT,exports.RESPONSE_FORMATS=mt.RESPONSE_FORMATS,exports.AdBanner=Tt.default,Object.defineProperty(exports,"BannerThirdPartyIcon",{enumerable:!0,get:function(){return xt.BannerThirdPartyIcon}}),Object.defineProperty(exports,"BannerType",{enumerable:!0,get:function(){return xt.BannerType}}),exports.getUrlForBannerThirdPartyIcon=xt.getUrlForBannerThirdPartyIcon,Object.defineProperty(exports,"CarouselVersion",{enumerable:!0,get:function(){return Pt.CarouselVersion}});
@@ -4,6 +4,7 @@ export interface AnalyticsTrendInterface {
4
4
  value?: number | string;
5
5
  trendPercent?: number;
6
6
  trendRaw?: number;
7
+ trendRawString?: string;
7
8
  formatVal?: boolean;
8
9
  timeline?: 'today' | 'yesterday' | '7 days' | '30 days' | 'custom';
9
10
  customRange?: Date[];
@@ -1 +1 @@
1
- import{j as e}from"../../node_modules/react/jsx-runtime.js";import t,{useState as i,useEffect as n}from"react";import{ShimmerComponentStyled as s}from"../shimmer/ShimmerComponent/ShimmerStyled.js";import r from"../../utils/DateUtils.js";import{COLORS as o}from"../../constants/Theme.js";import l from"../../assets/icons/arrow_down.svg.js";import a from"../../assets/icons/arrow_up.svg.js";import c from"../../assets/icons/info.svg.js";import{Tag as d}from"../tag/Tag.js";import{Tooltip as m}from"../tooltips/Tooltip.js";import{BodyCaption as g,Caption as h,TitleLarge as p,TitleMedium as j}from"../TypographyStyle.js";import{truncateValueForInternationalStore as y,truncateValueForIndianStore as x}from"./chart/utils/calcPercentage.js";import{AnalyticsTrendContainer as u,IconContainer as b}from"./CommonStyles.js";const f=i=>{let{title:n,value:r,trendPercent:l,type:a="horizontal",timeline:h,customRange:f,tooltip:T,card:O=!0,rightSeparator:S=!1,size:w="big",share:$=!1,formatVal:I,prefixSymbol:R,trailingIcon:C,onTrailIconClick:D,iconTooltipBody:M,funnelPercent:k,isLoading:L,trendRaw:z,suffixText:F,trendStyle:P,trendContainerStyle:N,trendIconStyle:_,containerStyle:W,prevTrendDiff:A,relativePercentageDiff:B,isInternationalStore:E,Icon:U,iconContainerStyle:V,tooltipTimelineText:q,customTimelineText:G}=i;const H="big"===w?p:j,J=void 0!==l?l<0?"negative":0===l?"neutral":"positive":void 0,K=void 0!==l?$?Math.round(l):Math.abs(Math.round(l)):void 0;return e.jsx(u,Object.assign({card:O,style:Object.assign({},W)},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:U?12:4,borderRightWidth:S?1:0,borderRightColor:o.stroke.primary,borderRightStyle:"solid",paddingLeft:O?0:24,paddingRight:O?0:24,height:"100%",justifyContent:U?"flex-start":"space-between",alignItems:"center"},null!=N?N:{})},{children:[!!U&&e.jsx(b,Object.assign({style:Object.assign({},V)},{children:e.jsx(U,{})})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=P?P:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(g,Object.assign({style:{color:o.content.secondary}},{children:n})),T&&e.jsx(m,Object.assign({body:T,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsx(c,{color:o.content.primary,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},$?{justifyContent:"space-between"}:{})},{children:[L&&e.jsx(s,{width:108,height:26}),!L&&e.jsx(H,Object.assign({style:{color:o.content.primary}},{children:void 0===r?"--":"number"==typeof r&&I?r>999?E?`${null!=R?R:""}${y(r)} ${null!=F?F:""}`:`${null!=R?R:""}${x(r)} ${null!=F?F:""}`:`${null!=R?R:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(r)} ${null!=F?F:""}`:`${null!=R?R:""}${r} ${null!=F?F:""}`})),"number"==typeof B&&e.jsx(d,{tagText:`${B}%`,theme:"light",type:"neutral"}),"horizontal"===a&&!L&&!$&&e.jsx(v,{timeline:h,customRange:f,percent:K,direction:J,trendRaw:z,prefixSymbol:R,trendIconStyle:_,isInternationalStore:E,tooltipTimelineText:q,customTimelineText:G}),L&&!$&&"horizontal"===a&&e.jsx(s,{height:20,width:141,marginTop:6}),"vertical"===a&&!L&&void 0!==k&&e.jsx(d,{tagText:`${k} %`,theme:"light",type:"neutral"}),$&&!L&&void 0!==K&&e.jsx(d,{tagText:`${K} %`,theme:"light",type:"neutral"}),$||L||!A||0==A?e.jsx(e.Fragment,{}):e.jsx(d,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(A),theme:"light",type:"neutral"})]})),"vertical"===a&&!L&&!$&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(v,{timeline:h,customRange:f,percent:K,direction:J,trendRaw:z,prefixSymbol:R,trendIconStyle:_,isInternationalStore:E,tooltipTimelineText:q,customTimelineText:G})})),L&&"vertical"===a&&e.jsx(s,{height:20,width:141,marginTop:6})]})),M&&!L&&e.jsx(m,Object.assign({body:M,placement:"right"},{children:C&&e.jsx("div",Object.assign({className:"icon--holder",onClick:D},{children:t.createElement(C,{height:20,width:20,color:o.content.secondary})}))}))]}))}))},v=t=>{let{percent:s,direction:c,timeline:d,customRange:g,trendRaw:p,prefixSymbol:j,trendIconStyle:u,isInternationalStore:b,tooltipTimelineText:f,customTimelineText:v}=t;const T=()=>{const e=((null!=p?p:0)>0?"+":"")+(null!=j?j:"");return void 0===p?"--":`${null!=e?e:""}${(()=>{let e="--";if(p)return e=String(b?y(Math.abs(p)):x(Math.abs(p))),p<0?"-"+e:e})()}`},[O,S]=i(T()),[w,$]=i(v||"");n((()=>{v||$("today"===d?"vs yesterday":"yesterday"===d?"vs 1 day before":"7 days"===d?"vs last 7 days":"30 days"===d?"vs last 30 days":"custom"===d&&g?r.getAnalyticsCustomDateTimelineText(g):"")}),[d,g]),n((()=>{S(T())}),[p]);const I="negative"===c?l:a,R="negative"===c?o.background.negative.vibrant:"positive"===c?o.background.positive.vibrant:o.content.placeholder;return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof s&&e.jsx(I,{color:R,height:16,width:16,style:Object.assign({marginRight:2},null!=u?u:{})}),"number"==typeof s&&c&&e.jsxs(h,Object.assign({style:{color:R}},{children:["neutral"===c?0:s<1e3?s:">999","%"]})),!!p&&e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:`(${O})`})),d&&(f?e.jsx(m,Object.assign({body:f,placement:"bottom"},{children:e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:v||w}))})):e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:v||w})))]}))};export{f as AnalyticsTrend};
1
+ import{j as e}from"../../node_modules/react/jsx-runtime.js";import t,{useState as i,useEffect as n}from"react";import{ShimmerComponentStyled as r}from"../shimmer/ShimmerComponent/ShimmerStyled.js";import s from"../../utils/DateUtils.js";import{COLORS as o}from"../../constants/Theme.js";import l from"../../assets/icons/arrow_down.svg.js";import a from"../../assets/icons/arrow_up.svg.js";import c from"../../assets/icons/info.svg.js";import{Tag as d}from"../tag/Tag.js";import{Tooltip as m}from"../tooltips/Tooltip.js";import{BodyCaption as g,Caption as h,TitleLarge as p,TitleMedium as j}from"../TypographyStyle.js";import{truncateValueForInternationalStore as y,truncateValueForIndianStore as x}from"./chart/utils/calcPercentage.js";import{AnalyticsTrendContainer as u,IconContainer as b}from"./CommonStyles.js";const f=i=>{let{title:n,value:s,trendPercent:l,type:a="horizontal",timeline:h,customRange:f,tooltip:T,card:S=!0,rightSeparator:w=!1,size:O="big",share:$=!1,formatVal:I,prefixSymbol:R,trailingIcon:C,onTrailIconClick:D,iconTooltipBody:L,funnelPercent:M,isLoading:k,trendRaw:z,trendRawString:F,suffixText:P,trendStyle:N,trendContainerStyle:_,trendIconStyle:W,containerStyle:A,prevTrendDiff:B,relativePercentageDiff:E,isInternationalStore:U,Icon:V,iconContainerStyle:q,tooltipTimelineText:G,customTimelineText:H}=i;const J="big"===O?p:j,K=void 0!==l?l<0?"negative":0===l?"neutral":"positive":void 0,Q=void 0!==l?$?Math.round(l):Math.abs(Math.round(l)):void 0;return e.jsx(u,Object.assign({card:S,style:Object.assign({},A)},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:V?12:4,borderRightWidth:w?1:0,borderRightColor:o.stroke.primary,borderRightStyle:"solid",paddingLeft:S?0:24,paddingRight:S?0:24,height:"100%",justifyContent:V?"flex-start":"space-between",alignItems:"center"},null!=_?_:{})},{children:[!!V&&e.jsx(b,Object.assign({style:Object.assign({},q)},{children:e.jsx(V,{})})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=N?N:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(g,Object.assign({style:{color:o.content.secondary}},{children:n})),T&&e.jsx(m,Object.assign({body:T,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsx(c,{color:o.content.primary,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},$?{justifyContent:"space-between"}:{})},{children:[k&&e.jsx(r,{width:108,height:26}),!k&&e.jsx(J,Object.assign({style:{color:o.content.primary}},{children:void 0===s?"--":"number"==typeof s&&I?s>999?U?`${null!=R?R:""}${y(s)} ${null!=P?P:""}`:`${null!=R?R:""}${x(s)} ${null!=P?P:""}`:`${null!=R?R:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(s)} ${null!=P?P:""}`:`${null!=R?R:""}${s} ${null!=P?P:""}`})),"number"==typeof E&&e.jsx(d,{tagText:`${E}%`,theme:"light",type:"neutral"}),"horizontal"===a&&!k&&!$&&e.jsx(v,{timeline:h,customRange:f,percent:Q,direction:K,trendRaw:z,trendRawString:F,prefixSymbol:R,trendIconStyle:W,isInternationalStore:U,tooltipTimelineText:G,customTimelineText:H}),k&&!$&&"horizontal"===a&&e.jsx(r,{height:20,width:141,marginTop:6}),"vertical"===a&&!k&&void 0!==M&&e.jsx(d,{tagText:`${M} %`,theme:"light",type:"neutral"}),$&&!k&&void 0!==Q&&e.jsx(d,{tagText:`${Q} %`,theme:"light",type:"neutral"}),$||k||!B||0==B?e.jsx(e.Fragment,{}):e.jsx(d,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(B),theme:"light",type:"neutral"})]})),"vertical"===a&&!k&&!$&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(v,{timeline:h,customRange:f,percent:Q,direction:K,trendRaw:z,trendRawString:F,prefixSymbol:R,trendIconStyle:W,isInternationalStore:U,tooltipTimelineText:G,customTimelineText:H})})),k&&"vertical"===a&&e.jsx(r,{height:20,width:141,marginTop:6})]})),L&&!k&&e.jsx(m,Object.assign({body:L,placement:"right"},{children:C&&e.jsx("div",Object.assign({className:"icon--holder",onClick:D},{children:t.createElement(C,{height:20,width:20,color:o.content.secondary})}))}))]}))}))},v=t=>{let{percent:r,direction:c,timeline:d,customRange:g,trendRaw:p,trendRawString:j,prefixSymbol:u,trendIconStyle:b,isInternationalStore:f,tooltipTimelineText:v,customTimelineText:T}=t;const S=()=>{const e=((null!=p?p:0)>0?"+":"")+(null!=u?u:"");return void 0===p?"--":`${null!=e?e:""}${(()=>{let e="--";if(p)return e=String(f?y(Math.abs(p)):x(Math.abs(p))),p<0?"-"+e:e})()}`},[w,O]=i(S()),[$,I]=i(T||"");n((()=>{T||I("today"===d?"vs yesterday":"yesterday"===d?"vs 1 day before":"7 days"===d?"vs last 7 days":"30 days"===d?"vs last 30 days":"custom"===d&&g?s.getAnalyticsCustomDateTimelineText(g):"")}),[d,g]),n((()=>{O(S())}),[p]);const R="negative"===c?l:a,C="negative"===c?o.background.negative.vibrant:"positive"===c?o.background.positive.vibrant:o.content.placeholder;return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof r&&e.jsx(R,{color:C,height:16,width:16,style:Object.assign({marginRight:2},null!=b?b:{})}),"number"==typeof r&&c&&e.jsxs(h,Object.assign({style:{color:C}},{children:["neutral"===c?0:r<1e3?r:">999","%"]})),!!p&&e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:`(${w})`})),!p&&((null==j?void 0:j.length)||0)>0&&e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:`${j}`})),d&&(v?e.jsx(m,Object.assign({body:v,placement:"bottom"},{children:e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:T||$}))})):e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:T||$})))]}))};export{f as AnalyticsTrend};
@@ -1 +1 @@
1
- import{j as o}from"../../../../node_modules/react/jsx-runtime.js";import i from"../../../../assets/icons/maximize.svg.js";import{Chart as t,CategoryScale as e,LinearScale as a,BarElement as l,Tooltip as n,Legend as d}from"chart.js";import s from"chartjs-plugin-datalabels";import{useState as r,useMemo as c}from"react";import{Bar as u}from"react-chartjs-2";import{IconButton as v}from"../../../icon-button/IconButton.js";import{StyledModal as p}from"../../../modals/styledModal.js";import{TitleRegular as g,BodyTiny as x}from"../../../TypographyStyle.js";import{COLORS as b,FONTS as h}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as m,truncateValueForIndianStore as y}from"../utils/calcPercentage.js";import{COLOR_SCHEMA as f,GRAPH_ORIENTATION as j}from"./StackedBarChart.model.js";import{GraphContainerWrapper as O,HeaderIconWrapper as A}from"./StackedBarChart.styles.js";t.register(e,a,l,n,d,s);const C=t=>{var e,a,l,n,d,s,C,k,L,F,S,H,I,T,R,w,E,B,D,N,Z,z,P,G,W,_,q,M,V,Y,J,K,Q,U,X,$,oo,io,to,eo,ao,lo;const{headerIcons:no=[],legendsAndIconDirection:so="row"}=t,[ro,co]=r(!1),uo=[250,1e3,800,1500,300,600],vo=0===t.yAxis.data.length,po=void 0===t.customColourScaleBrand&&void 0===t.customColourScalePastel?t.colorSchema===f.PASTEL?["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"]:["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"]:t.colorSchema===f.PASTEL?t.customColourScalePastel:t.customColourScaleBrand,go=t.customHoverColour,xo=c((()=>{var o,i,e;return Object.assign(Object.assign({barPercentage:(null==t?void 0:t.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:t.barWidth,borderRadius:(null==t?void 0:t.borderRadius)||void 0},"object"==typeof(null==t?void 0:t.borderRadius)?{borderSkipped:!1}:{}),(null===(o=null==t?void 0:t.addBarGap)||void 0===o?void 0:o.flag)?{borderWidth:{top:(null===(i=null==t?void 0:t.addBarGap)||void 0===i?void 0:i.value)||2,bottom:(null===(e=null==t?void 0:t.addBarGap)||void 0===e?void 0:e.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[t.barWidth,null==t?void 0:t.borderRadius,null==t?void 0:t.barPercentage,null==t?void 0:t.addBarGap]),bo={};t.yAxis.data.map((o=>{o.map((o=>{bo[o.name]?bo[o.name].push(o.value):bo[o.name]=[o.value]}))}));const ho=Object.keys(bo).map(((o,i)=>Object.assign({label:o,data:bo[o],backgroundColor:null==po?void 0:po[i],hoverBackgroundColor:void 0===go?void 0:go[i]},xo)));let mo=t.xAxis.data.map((o=>"string"==typeof o?o:o.name)),yo=ho;if(t.truncateBars){const o=((o,i,t)=>{if(i.length<=t)return{truncatedData:o,truncatedLabels:i,originalData:o,originalLabels:i};const e=o.map((o=>o.slice(0,t))),a=o.map((o=>o.slice(t).reduce(((o,i)=>o+i),0)));e.forEach(((o,i)=>o.push(a[i])));const l=i.slice(0,t);return l.push("Others"),{truncatedData:e,truncatedLabels:l,originalData:o,originalLabels:i}})(ho.map((o=>o.data)),mo,t.truncateBars);ho.forEach(((i,t)=>i.data=o.truncatedData[t])),mo=o.truncatedLabels,yo=o.originalData.map(((o,i)=>Object.assign(Object.assign({},ho[i]),{data:o})))}const fo={plugins:{legend:{display:!vo&&!t.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!vo,callbacks:{label:null===(e=t.tooltipConfig)||void 0===e?void 0:e.labelCallback,title:null===(a=t.tooltipConfig)||void 0===a?void 0:a.titleCallback,footer:null===(l=t.tooltipConfig)||void 0===l?void 0:l.footerCallback},footerFont:null===(d=null===(n=t.tooltipConfig)||void 0===n?void 0:n.footerStyles)||void 0===d?void 0:d.footerFont},datalabels:{display:null!==(s=t.showTotal)&&void 0!==s&&s,anchor:"end",align:"end",clamp:!0,formatter:(o,i)=>{var t;const e=i.datasetIndex,a=i.chart.data.datasets;if(e!==a.length-1)return"";const l=i.dataIndex;let n=0;for(let o=0;o<a.length;o++)n+=null!==(t=a[o].data[l])&&void 0!==t?t:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:b.content.secondary}},layout:{padding:{right:t.showTotal&&t.orientation===j.HORIZONTAL?50:0,top:t.showTotal&&t.orientation!=j.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!t.customLegend,labels:{usePointStyle:!0}},indexAxis:t.orientation===j.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(t.orientation===j.HORIZONTAL?null===(C=t.yAxis)||void 0===C?void 0:C.title:null===(k=t.xAxis)||void 0===k?void 0:k.title),text:t.orientation===j.HORIZONTAL?null===(L=t.yAxis)||void 0===L?void 0:L.title:null===(F=t.xAxis)||void 0===F?void 0:F.title,color:null!==(I=t.orientation===j.HORIZONTAL?null===(S=t.yAxis)||void 0===S?void 0:S.titleColor:null===(H=t.xAxis)||void 0===H?void 0:H.titleColor)&&void 0!==I?I:b.content.secondary,font:{size:h.caption.fontSize}},grid:{display:t.orientation===j.HORIZONTAL&&(void 0===(null===(T=null==t?void 0:t.showGridLines)||void 0===T?void 0:T.x)||(null===(R=null==t?void 0:t.showGridLines)||void 0===R?void 0:R.x)),color:b.background.base},ticks:{fontSize:h.caption.fontSize,color:null!==(w=t.yAxis.labelColor)&&void 0!==w?w:b.content.secondary,callback:t.orientation===j.HORIZONTAL?t.isInternationalStore?m:y:void 0},stacked:t.orientation===j.HORIZONTAL?"boolean"!=typeof(null===(E=t.yAxis)||void 0===E?void 0:E.stacked)||(null===(B=t.yAxis)||void 0===B?void 0:B.stacked):"boolean"!=typeof(null===(D=t.xAxis)||void 0===D?void 0:D.stacked)||(null===(N=t.xAxis)||void 0===N?void 0:N.stacked)},y:Object.assign(Object.assign({},(null===(Z=null==t?void 0:t.equalHeight)||void 0===Z?void 0:Z.flag)?{suggestedMin:-(null==t?void 0:t.equalHeight.max),suggestedMax:null==t?void 0:t.equalHeight.max}:{}),{title:{display:!!(t.orientation===j.HORIZONTAL?null===(z=t.xAxis)||void 0===z?void 0:z.title:null===(P=t.yAxis)||void 0===P?void 0:P.title),text:t.orientation===j.HORIZONTAL?null===(G=t.xAxis)||void 0===G?void 0:G.title:null===(W=t.yAxis)||void 0===W?void 0:W.title,color:null!==(M=t.orientation===j.HORIZONTAL?null===(_=t.xAxis)||void 0===_?void 0:_.titleColor:null===(q=t.yAxis)||void 0===q?void 0:q.titleColor)&&void 0!==M?M:b.content.secondary,font:{size:h.caption.fontSize}},grid:{display:t.orientation!==j.HORIZONTAL&&(void 0===(null===(V=null==t?void 0:t.showGridLines)||void 0===V?void 0:V.y)||(null===(Y=null==t?void 0:t.showGridLines)||void 0===Y?void 0:Y.y)),color:b.background.base},ticks:Object.assign(Object.assign({stepSize:t.orientation===j.HORIZONTAL?null===(J=t.xAxis)||void 0===J?void 0:J.stepSize:null===(K=t.yAxis)||void 0===K?void 0:K.stepSize,fontSize:h.caption.fontSize,color:null!==(Q=t.xAxis.labelColor)&&void 0!==Q?Q:b.content.secondary},vo?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==t?void 0:t.ticksCallback)?null==t?void 0:t.ticksCallback:t.orientation!==j.VERTICAL?t.isInternationalStore?m:y:void 0}),stacked:t.orientation===j.HORIZONTAL?"boolean"!=typeof(null===(U=t.xAxis)||void 0===U?void 0:U.stacked)||(null===(X=t.xAxis)||void 0===X?void 0:X.stacked):"boolean"!=typeof(null===($=t.yAxis)||void 0===$?void 0:$.stacked)||(null===(oo=t.yAxis)||void 0===oo?void 0:oo.stacked)})},onClick:(o,i)=>{if(!t.onBarClick)return;const e=i[0].datasetIndex,a=i[0].index,l=o.chart.data.datasets[e].label,n=o.chart.data.labels[a];t.onBarClick(n,l)},onHover:(o,i)=>{t.onBarClick&&i.length&&(o.native.target.style.cursor="pointer")}};t.orientation&&t.orientation!==j.VERTICAL?delete fo.scales.y.ticks.callback:delete fo.scales.x.ticks.callback;const jo={labels:mo,datasets:vo?[{data:uo,backgroundColor:"rgba(0,0,0,0)"}]:ho},Oo={labels:t.xAxis.data.map((o=>"string"==typeof o?o:o.name)),datasets:vo?[{data:uo,backgroundColor:"rgba(0,0,0,0)"}]:yo},Ao=function(){let i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return o.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:t.allowChartPopup&&!i?"flex-start":"flex-end",flexWrap:"wrap"}},{children:ho.map((i=>o.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[o.jsx("div",{style:{backgroundColor:i.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),o.jsx(x,Object.assign({color:b.content.secondary},{children:i.label}))]}),i.label.replace(" ","_"))))}))};return o.jsxs(O,Object.assign({style:null!==(io=t.wrapperStyle)&&void 0!==io?io:{},padding:t.outerPadding,customLegend:t.customLegend},{children:[t.chartHeading&&o.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:t.hideHeading?"flex-end":"space-between"}},{children:[!0!==t.hideHeading&&o.jsx(g,Object.assign({color:null!==(to=t.chartHeading.color)&&void 0!==to?to:b.content.secondary},{children:t.chartHeading.heading})),t.allowChartPopup&&o.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:o.jsx("div",{children:o.jsx(v,{Icon:i,onClick:()=>{co(!0)}})})}))]})),t.customLegend&&o.jsxs("div",Object.assign({style:{display:"flex",flexDirection:so,justifyContent:"space-between"}},{children:[o.jsx(A,{children:no.map(((i,t)=>o.jsx("div",{children:o.jsx("div",{children:i})},t)))}),Ao()]})),o.jsx("div",Object.assign({className:"graph__wrapper"},{children:o.jsx("div",Object.assign({style:{height:null!==(eo=t.graphCanvasHeight)&&void 0!==eo?eo:500,width:null!==(ao=t.graphCanvasWidth)&&void 0!==ao?ao:"auto"}},{children:o.jsx(u,{options:fo,data:jo})}))})),ro&&o.jsx(p,Object.assign({open:ro,onClose:()=>co(!1),closeOnOutsideClick:!0,headingTitle:null===(lo=t.chartHeading)||void 0===lo?void 0:lo.heading,width:"85%"},{children:o.jsxs("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[t.customLegend&&Ao(!0),o.jsx("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:o.jsx(u,{options:fo,data:Oo})}))]}))}))]}))};export{C as StackedBarChart};
1
+ import{j as i}from"../../../../node_modules/react/jsx-runtime.js";import o from"../../../../assets/icons/maximize.svg.js";import{Chart as t,CategoryScale as e,LinearScale as a,BarElement as l,Tooltip as n,Legend as s}from"chart.js";import d from"chartjs-plugin-datalabels";import{useState as r,useMemo as c}from"react";import{Bar as u}from"react-chartjs-2";import{IconButton as v}from"../../../icon-button/IconButton.js";import{StyledModal as x}from"../../../modals/styledModal.js";import{TitleRegular as p,BodyTiny as g}from"../../../TypographyStyle.js";import{COLORS as b,FONTS as h}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as m,truncateValueForIndianStore as f}from"../utils/calcPercentage.js";import{GRAPH_ORIENTATION as y,COLOR_SCHEMA as j}from"./StackedBarChart.model.js";import{GraphContainerWrapper as A,HeaderIconWrapper as O}from"./StackedBarChart.styles.js";t.register(e,a,l,n,s,d);const C=t=>{var e,a,l,n,s,d,C,k,S,L,F,H,I,T,R,w,B,E,D,N,Z,z,P,G,$,W,_,M,q,V,Y,J,K,Q,U,X,ii,oi,ti,ei,ai,li,ni,si,di;const{headerIcons:ri=[],legendsAndIconDirection:ci="row"}=t,[ui,vi]=r(!1),xi=[250,1e3,800,1500,300,600],pi=0===t.yAxis.data.length,gi=["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"],bi=["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"],hi=t.customBarColors?t.customBarColors:t.customColourScaleBrand||t.customColourScalePastel?t.colorSchema===j.PASTEL?t.customColourScalePastel:t.customColourScaleBrand:t.colorSchema===j.PASTEL?bi:gi,mi=t.customHoverColour,fi=c((()=>{var i,o,e;return Object.assign(Object.assign({barPercentage:(null==t?void 0:t.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:t.barWidth,borderRadius:(null==t?void 0:t.borderRadius)||void 0},"object"==typeof(null==t?void 0:t.borderRadius)?{borderSkipped:!1}:{}),(null===(i=null==t?void 0:t.addBarGap)||void 0===i?void 0:i.flag)?{borderWidth:{top:(null===(o=null==t?void 0:t.addBarGap)||void 0===o?void 0:o.value)||2,bottom:(null===(e=null==t?void 0:t.addBarGap)||void 0===e?void 0:e.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[t.barWidth,null==t?void 0:t.borderRadius,null==t?void 0:t.barPercentage,null==t?void 0:t.addBarGap]),yi={};t.yAxis.data.map((i=>{i.map((i=>{yi[i.name]?yi[i.name].push(i.value):yi[i.name]=[i.value]}))}));const ji=Object.keys(yi).map(((i,o)=>Object.assign({label:i,data:yi[i],backgroundColor:null==hi?void 0:hi[o],hoverBackgroundColor:void 0===mi?void 0:mi[o]},fi))),Ai=t.renderInHeightWiseManner?ji.map(((i,o)=>Object.assign(Object.assign({},i),{order:i.data.reduce(((i,o)=>i+(o||0)),0)}))).sort(((i,o)=>o.order-i.order)):ji;let Oi=t.xAxis.data.map((i=>"string"==typeof i?i:i.name)),Ci=Ai;if(t.truncateBars){const i=((i,o,t)=>{if(o.length<=t)return{truncatedData:i,truncatedLabels:o,originalData:i,originalLabels:o};const e=i.map((i=>i.slice(0,t))),a=i.map((i=>i.slice(t).reduce(((i,o)=>i+o),0)));e.forEach(((i,o)=>i.push(a[o])));const l=o.slice(0,t);return l.push("Others"),{truncatedData:e,truncatedLabels:l,originalData:i,originalLabels:o}})(Ai.map((i=>i.data)),Oi,t.truncateBars);Ai.forEach(((o,t)=>o.data=i.truncatedData[t])),Oi=i.truncatedLabels,Ci=i.originalData.map(((i,o)=>Object.assign(Object.assign({},Ai[o]),{data:i})))}const ki={plugins:{legend:{display:!pi&&!t.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!pi,callbacks:{label:null===(e=t.tooltipConfig)||void 0===e?void 0:e.labelCallback,title:null===(a=t.tooltipConfig)||void 0===a?void 0:a.titleCallback,footer:null===(l=t.tooltipConfig)||void 0===l?void 0:l.footerCallback},footerFont:null===(s=null===(n=t.tooltipConfig)||void 0===n?void 0:n.footerStyles)||void 0===s?void 0:s.footerFont},datalabels:{display:null!==(d=t.showTotal)&&void 0!==d&&d,anchor:"end",align:"end",clamp:!0,formatter:(i,o)=>{var t;const e=o.datasetIndex,a=o.chart.data.datasets;if(e!==a.length-1)return"";const l=o.dataIndex;let n=0;for(let i=0;i<a.length;i++)n+=null!==(t=a[i].data[l])&&void 0!==t?t:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:b.content.secondary}},layout:{padding:{right:t.showTotal&&t.orientation===y.HORIZONTAL?50:0,top:t.showTotal&&t.orientation!=y.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!t.customLegend,labels:{usePointStyle:!0}},indexAxis:t.orientation===y.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(t.orientation===y.HORIZONTAL?null===(C=t.yAxis)||void 0===C?void 0:C.title:null===(k=t.xAxis)||void 0===k?void 0:k.title),text:t.orientation===y.HORIZONTAL?null===(S=t.yAxis)||void 0===S?void 0:S.title:null===(L=t.xAxis)||void 0===L?void 0:L.title,color:null!==(I=t.orientation===y.HORIZONTAL?null===(F=t.yAxis)||void 0===F?void 0:F.titleColor:null===(H=t.xAxis)||void 0===H?void 0:H.titleColor)&&void 0!==I?I:b.content.secondary,font:{size:h.caption.fontSize}},grid:{display:t.orientation===y.HORIZONTAL&&(void 0===(null===(T=null==t?void 0:t.showGridLines)||void 0===T?void 0:T.x)||(null===(R=null==t?void 0:t.showGridLines)||void 0===R?void 0:R.x)),color:b.background.base},ticks:{fontSize:h.caption.fontSize,color:null!==(w=t.yAxis.labelColor)&&void 0!==w?w:b.content.secondary,callback:t.orientation===y.HORIZONTAL?i=>{var o;return`${t.isInternationalStore?m(i):f(i)}${(null===(o=t.yAxis)||void 0===o?void 0:o.axisSuffix)||""}`}:(null===(B=t.xAxis)||void 0===B?void 0:B.axisSuffix)?i=>`${i}${t.xAxis.axisSuffix}`:void 0},stacked:t.orientation===y.HORIZONTAL?"boolean"!=typeof(null===(E=t.yAxis)||void 0===E?void 0:E.stacked)||(null===(D=t.yAxis)||void 0===D?void 0:D.stacked):"boolean"!=typeof(null===(N=t.xAxis)||void 0===N?void 0:N.stacked)||(null===(Z=t.xAxis)||void 0===Z?void 0:Z.stacked)},y:Object.assign(Object.assign({},(null===(z=null==t?void 0:t.equalHeight)||void 0===z?void 0:z.flag)?{suggestedMin:-(null==t?void 0:t.equalHeight.max),suggestedMax:null==t?void 0:t.equalHeight.max}:{}),{max:null===(P=null==t?void 0:t.yAxis)||void 0===P?void 0:P.max,title:{display:!!(t.orientation===y.HORIZONTAL?null===(G=t.xAxis)||void 0===G?void 0:G.title:null===($=t.yAxis)||void 0===$?void 0:$.title),text:t.orientation===y.HORIZONTAL?null===(W=t.xAxis)||void 0===W?void 0:W.title:null===(_=t.yAxis)||void 0===_?void 0:_.title,color:null!==(V=t.orientation===y.HORIZONTAL?null===(M=t.xAxis)||void 0===M?void 0:M.titleColor:null===(q=t.yAxis)||void 0===q?void 0:q.titleColor)&&void 0!==V?V:b.content.secondary,font:{size:h.caption.fontSize}},grid:{display:t.orientation!==y.HORIZONTAL&&(void 0===(null===(Y=null==t?void 0:t.showGridLines)||void 0===Y?void 0:Y.y)||(null===(J=null==t?void 0:t.showGridLines)||void 0===J?void 0:J.y)),color:b.background.base},ticks:Object.assign(Object.assign({stepSize:t.orientation===y.HORIZONTAL?null===(K=t.xAxis)||void 0===K?void 0:K.stepSize:null===(Q=t.yAxis)||void 0===Q?void 0:Q.stepSize,fontSize:h.caption.fontSize,color:null!==(U=t.xAxis.labelColor)&&void 0!==U?U:b.content.secondary},pi?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==t?void 0:t.ticksCallback)?null==t?void 0:t.ticksCallback:t.orientation===y.HORIZONTAL?i=>{var o;return`${t.isInternationalStore?m(i):f(i)}${(null===(o=t.xAxis)||void 0===o?void 0:o.axisSuffix)||""}`}:(null===(X=t.yAxis)||void 0===X?void 0:X.axisSuffix)?i=>`${i}${t.yAxis.axisSuffix}`:void 0}),stacked:t.orientation===y.HORIZONTAL?"boolean"!=typeof(null===(ii=t.xAxis)||void 0===ii?void 0:ii.stacked)||(null===(oi=t.xAxis)||void 0===oi?void 0:oi.stacked):"boolean"!=typeof(null===(ti=t.yAxis)||void 0===ti?void 0:ti.stacked)||(null===(ei=t.yAxis)||void 0===ei?void 0:ei.stacked)})},onClick:(i,o)=>{if(!t.onBarClick)return;const e=o[0].datasetIndex,a=o[0].index,l=i.chart.data.datasets[e].label,n=i.chart.data.labels[a];t.onBarClick(n,l)},onHover:(i,o)=>{t.onBarClick&&o.length&&(i.native.target.style.cursor="pointer")}};t.orientation&&t.orientation!==y.VERTICAL?delete ki.scales.y.ticks.callback:delete ki.scales.x.ticks.callback;const Si={labels:Oi,datasets:pi?[{data:xi,backgroundColor:"rgba(0,0,0,0)"}]:Ai},Li={labels:t.xAxis.data.map((i=>"string"==typeof i?i:i.name)),datasets:pi?[{data:xi,backgroundColor:"rgba(0,0,0,0)"}]:Ci},Fi=function(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return i.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:t.allowChartPopup&&!o?"flex-start":"flex-end",flexWrap:"wrap"}},{children:ji.map((o=>i.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[i.jsx("div",{style:{backgroundColor:o.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),i.jsx(g,Object.assign({color:b.content.secondary},{children:o.label}))]}),o.label.replace(" ","_"))))}))};return i.jsxs(A,Object.assign({style:null!==(ai=t.wrapperStyle)&&void 0!==ai?ai:{},padding:t.outerPadding,customLegend:t.customLegend},{children:[t.chartHeading&&i.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:t.hideHeading?"flex-end":"space-between"}},{children:[!0!==t.hideHeading&&i.jsx(p,Object.assign({color:null!==(li=t.chartHeading.color)&&void 0!==li?li:b.content.secondary},{children:t.chartHeading.heading})),t.allowChartPopup&&i.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:i.jsx("div",{children:i.jsx(v,{Icon:o,onClick:()=>{vi(!0)}})})}))]})),t.customLegend&&i.jsxs("div",Object.assign({style:{display:"flex",flexDirection:ci,justifyContent:"space-between"}},{children:[i.jsx(O,{children:ri.map(((o,t)=>i.jsx("div",{children:i.jsx("div",{children:o})},t)))}),Fi()]})),i.jsx("div",Object.assign({className:"graph__wrapper"},{children:i.jsx("div",Object.assign({style:{height:null!==(ni=t.graphCanvasHeight)&&void 0!==ni?ni:500,width:null!==(si=t.graphCanvasWidth)&&void 0!==si?si:"auto"}},{children:i.jsx(u,{options:ki,data:Si})}))})),ui&&i.jsx(x,Object.assign({open:ui,onClose:()=>vi(!1),closeOnOutsideClick:!0,headingTitle:null===(di=t.chartHeading)||void 0===di?void 0:di.heading,width:"85%"},{children:i.jsxs("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[t.customLegend&&Fi(!0),i.jsx("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:i.jsx(u,{options:ki,data:Li})}))]}))}))]}))};export{C as StackedBarChart};
@@ -7,6 +7,8 @@ export interface AxisDetailsI {
7
7
  labelColor?: string;
8
8
  stepSize?: number;
9
9
  stacked?: boolean;
10
+ axisSuffix?: string;
11
+ max?: number;
10
12
  }
11
13
  export interface XAxisDataI {
12
14
  name: string;
@@ -58,6 +60,7 @@ export interface StackedBarGraphI {
58
60
  customColourScaleBrand?: string[];
59
61
  customColourScalePastel?: string[];
60
62
  customHoverColour?: string[];
63
+ customBarColors?: string[];
61
64
  isInternationalStore?: boolean;
62
65
  truncateBars?: number;
63
66
  allowChartPopup?: boolean;
@@ -81,7 +84,8 @@ export interface StackedBarGraphI {
81
84
  flag: boolean;
82
85
  value: number;
83
86
  };
84
- ticksCallback?: (value: number) => string;
87
+ ticksCallback?: (value: number | string) => string;
85
88
  legendsAndIconDirection?: 'row-reverse' | 'row';
86
89
  headerIcons?: React.ReactNode[];
90
+ renderInHeightWiseManner?: boolean;
87
91
  }
@@ -1 +1 @@
1
- import{j as i}from"../../../../node_modules/react/jsx-runtime.js";import{Chart as t,CategoryScale as e,LinearScale as o,BarElement as r,Tooltip as a}from"chart.js";import{Chart as s}from"react-chartjs-2";import{SmallRegular as l,TitleRegular as n}from"../../../TypographyStyle.js";import{FONTS as c,COLORS as d}from"../../../../constants/Theme.js";import{LegendWrapper as x,LegendContainer as p,LegendColor as g}from"../LineChart/LineChart.styled.js";import{GraphContainerWrapper as b}from"./VerticalBarAndLinearGraph.styles.js";t.register(e,o,r,a);const h=t=>{var e,o,r,a,h;const A=[0,0,0,0,0,0],j=-1===t.barAxis.data.findIndex((i=>0!==i)),m=-1===t.lineAxis.data.findIndex((i=>0!==i)),f={min:0,max:2e3,stepSize:200},y=[{legend:t.barAxis.title,color:t.barAxis.graphColor},{legend:t.lineAxis.title,color:t.lineAxis.graphColor}],C={responsive:!0,plugins:{legend:{display:!1}},scales:{x:{title:{display:!!t.xAxis.title,text:t.xAxis.title,color:t.xAxis.titleColor,font:{size:c.caption.fontSize}},grid:{display:!1,borderColor:d.background.base},ticks:{fontSize:c.caption.fontSize,color:null!==(e=t.xAxis.labelColor)&&void 0!==e?e:d.content.secondary}},bar:{position:"left",title:{display:!!t.barAxis.title,text:t.barAxis.title,color:t.barAxis.titleColor,font:{size:c.caption.fontSize}},grid:{borderColor:"white",color:d.background.base},ticks:Object.assign({fontSize:c.caption.fontSize,color:null!==(o=t.barAxis.labelColor)&&void 0!==o?o:d.content.secondary},j?f:{})},line:{position:"right",title:{display:!!t.lineAxis.title,text:t.lineAxis.title,color:t.lineAxis.titleColor,font:{size:c.caption.fontSize}},grid:{display:!1,borderColor:"white",color:d.background.base},ticks:Object.assign({fontSize:c.caption.fontSize,color:null!==(r=t.lineAxis.labelColor)&&void 0!==r?r:d.content.secondary},m?f:{}),display:!0}},maintainAspectRatio:!1},u={labels:t.xAxis.forceShowXAxis?t.xAxis.data.map((i=>i.toString())):j&&m?["-","-","-","-","-","-"]:t.xAxis.data.map((i=>i.toString())),datasets:[{yAxisID:"line",type:"line",data:m?A:t.lineAxis.data,borderColor:t.lineAxis.graphColor||"rgba(0,0,0,0)",borderWidth:2,fill:!1,pointRadius:1},{yAxisID:"bar",type:"bar",data:j?A:t.barAxis.data,backgroundColor:t.barAxis.graphColor||"rgba(0,0,0,0)",barPercentage:.4,categoryPercentage:1,borderRadius:4}]};return i.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:2}},{children:[i.jsx(x,Object.assign({position:"center"},{children:y.map(((t,e)=>{let{legend:o,color:r}=t;return o?i.jsxs(p,{children:[i.jsx(g,{color:r}),i.jsx(l,Object.assign({color:"#667085"},{children:o}))]},e):i.jsx(i.Fragment,{})}))})),i.jsxs(b,{children:[t.chartHeading&&i.jsx("div",Object.assign({style:{marginBottom:24}},{children:i.jsx(n,Object.assign({color:null!==(a=t.chartHeading.color)&&void 0!==a?a:d.content.secondary},{children:t.chartHeading.heading}))})),i.jsx("div",Object.assign({style:{height:null!==(h=t.graphCanvasHeight)&&void 0!==h?h:500}},{children:i.jsx(s,{type:"bar",data:u,options:C})}))]})]}))};export{h as VerticalBarAndLinearGraph};
1
+ import{j as i}from"../../../../node_modules/react/jsx-runtime.js";import{Chart as o,CategoryScale as l,LinearScale as e,BarElement as a,Tooltip as t}from"chart.js";import{Chart as s}from"react-chartjs-2";import{SmallRegular as n,TitleRegular as r,BodyTiny as d}from"../../../TypographyStyle.js";import{FONTS as c,COLORS as x}from"../../../../constants/Theme.js";import{LegendWrapper as b,LegendContainer as A,LegendColor as u}from"../LineChart/LineChart.styled.js";import{truncateValueForInternationalStore as g,truncateValueForIndianStore as p}from"../utils/calcPercentage.js";import{GraphWrapper as v,GraphContainerWrapper as f,LegendsWrapper as m,LegendMiddleWrapper as h,LegendColorBox as j}from"./VerticalBarAndLinearGraph.styles.js";import{GRAPH_ORIENTATION as y}from"./VerticalBarAndLinearGraphModel.js";o.register(l,e,a,t);const S=o=>{var l,e,a,t,S,C,k,O,z,I,$,L,R,D,H,V,T,w,B;const P=[0,0,0,0,0,0],G=-1===o.barAxis.data.findIndex((i=>0!==i)),N=-1===o.lineAxis.data.findIndex((i=>0!==i)),W=!o.lineAxis2||-1===o.lineAxis2.data.findIndex((i=>0!==i)),Z={min:0,max:2e3,stepSize:200},E=[{legend:o.barAxis.title,color:o.barAxis.graphColor},{legend:o.lineAxis.title,color:o.lineAxis.graphColor},...o.lineAxis2?[{legend:o.lineAxis2.title,color:o.lineAxis2.graphColor}]:[]],F={responsive:!0,plugins:{legend:{display:!1}},scales:{x:{title:{display:!!o.xAxis.title,text:o.xAxis.title,color:o.xAxis.titleColor,font:{size:c.caption.fontSize}},grid:{display:!1,borderColor:x.background.base},ticks:{fontSize:c.caption.fontSize,color:null!==(l=o.xAxis.labelColor)&&void 0!==l?l:x.content.secondary,callback:(null===(e=o.xAxis)||void 0===e?void 0:e.axisSuffix)?i=>`${i}${o.xAxis.axisSuffix}`:void 0}},bar:{position:"left",title:{display:!!o.barAxis.title,text:o.barAxis.title,color:o.barAxis.titleColor,font:{size:c.caption.fontSize}},grid:{borderColor:"white",color:x.background.base},max:null===(a=null==o?void 0:o.barAxis)||void 0===a?void 0:a.max,ticks:Object.assign(Object.assign({fontSize:c.caption.fontSize,color:null!==(t=o.barAxis.labelColor)&&void 0!==t?t:x.content.secondary},G?Z:{}),{callback:o.orientation===y.HORIZONTAL?i=>{var l;return`${o.isInternationalStore?g(i):p(i)}${(null===(l=o.barAxis)||void 0===l?void 0:l.axisSuffix)||""}`}:(null===(S=o.barAxis)||void 0===S?void 0:S.axisSuffix)?i=>`${i}${o.barAxis.axisSuffix}`:void 0})},line:{position:"right",title:{display:!!o.lineAxis.title,text:o.lineAxis.title,color:o.lineAxis.titleColor,font:{size:c.caption.fontSize}},max:null===(C=null==o?void 0:o.lineAxis)||void 0===C?void 0:C.max,grid:{display:!1,borderColor:"white",color:x.background.base},ticks:Object.assign(Object.assign({fontSize:c.caption.fontSize,color:null!==(k=o.lineAxis.labelColor)&&void 0!==k?k:x.content.secondary},N?Z:{}),{callback:o.orientation===y.HORIZONTAL?i=>{var l;return`${o.isInternationalStore?g(i):p(i)}${(null===(l=o.lineAxis)||void 0===l?void 0:l.axisSuffix)||""}`}:(null===(O=o.lineAxis)||void 0===O?void 0:O.axisSuffix)?i=>`${i}${o.lineAxis.axisSuffix}`:void 0}),display:!0}},maintainAspectRatio:!1};o.orientation&&o.orientation!==y.VERTICAL?(void 0!==(null===(D=null===(R=null===(L=F.scales)||void 0===L?void 0:L.bar)||void 0===R?void 0:R.ticks)||void 0===D?void 0:D.callback)&&delete F.scales.bar.ticks.callback,void 0!==(null===(T=null===(V=null===(H=F.scales)||void 0===H?void 0:H.line)||void 0===V?void 0:V.ticks)||void 0===T?void 0:T.callback)&&delete F.scales.line.ticks.callback):void 0!==(null===($=null===(I=null===(z=F.scales)||void 0===z?void 0:z.x)||void 0===I?void 0:I.ticks)||void 0===$?void 0:$.callback)&&delete F.scales.x.ticks.callback;const M={labels:o.xAxis.forceShowXAxis?o.xAxis.data.map((i=>i.toString())):G&&N&&W?["-","-","-","-","-","-"]:o.xAxis.data.map((i=>i.toString())),datasets:[{yAxisID:"line",type:"line",data:o.noDummyValues?o.lineAxis.data:N?P:o.lineAxis.data,borderColor:o.lineAxis.graphColor||"rgba(0,0,0,0)",borderWidth:2,fill:!1,pointRadius:1},...o.lineAxis2?[{yAxisID:"line",type:"line",data:o.noDummyValues?o.lineAxis2.data:W?P:o.lineAxis2.data,borderColor:o.lineAxis2.graphColor||"rgba(0,0,0,0)",borderWidth:2,fill:!1,pointRadius:1}]:[],{yAxisID:"bar",type:"bar",data:o.noDummyValues?o.barAxis.data:G?P:o.barAxis.data,backgroundColor:o.barAxis.graphColor||"rgba(0,0,0,0)",barPercentage:.4,categoryPercentage:1,borderRadius:4}]};return i.jsxs(v,{children:[o.customLegend?i.jsxs(m,{children:[" ",E.map(((o,l)=>{let{legend:e,color:a}=o;return e?i.jsxs(h,{children:[i.jsx(j,{color:a}),i.jsx(d,Object.assign({color:x.content.secondary},{children:e}))]},l):null}))]}):i.jsx(b,Object.assign({position:"center"},{children:E.map(((o,l)=>{let{legend:e,color:a}=o;return e?i.jsxs(A,{children:[i.jsx(u,{color:a}),i.jsx(n,Object.assign({color:"#667085"},{children:e}))]},l):i.jsx(i.Fragment,{})}))})),i.jsxs(f,{children:[o.chartHeading&&i.jsx("div",Object.assign({style:{marginBottom:24}},{children:i.jsx(r,Object.assign({color:null!==(w=o.chartHeading.color)&&void 0!==w?w:x.content.secondary},{children:o.chartHeading.heading}))})),i.jsx("div",Object.assign({style:{height:null!==(B=o.graphCanvasHeight)&&void 0!==B?B:500}},{children:i.jsx(s,{type:"bar",data:M,options:F})}))]})]})};export{S as VerticalBarAndLinearGraph};