@bikdotai/bik-component-library 0.0.391-beta.1 → 0.0.391

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 (509) hide show
  1. package/dist/cjs/_virtual/index.js +1 -0
  2. package/dist/cjs/_virtual/index2.js +1 -0
  3. package/dist/cjs/_virtual/index3.js +1 -0
  4. package/dist/cjs/_virtual/react-is.development.js +1 -0
  5. package/dist/cjs/_virtual/react-is.development2.js +1 -0
  6. package/dist/cjs/_virtual/react-is.production.min.js +1 -0
  7. package/dist/cjs/_virtual/react-is.production.min2.js +1 -0
  8. package/dist/cjs/assets/icons/WhiteStarFilled.svg.js +1 -0
  9. package/dist/cjs/assets/icons/checkCircle.svg.js +1 -0
  10. package/dist/cjs/assets/icons/drag_handle.svg.js +1 -0
  11. package/dist/cjs/assets/icons/quotes.svg.js +1 -0
  12. package/dist/cjs/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
  13. package/dist/cjs/components/QueryBuilder/Filters/Segment/components/SegmentFilter.js +1 -1
  14. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js +2 -2
  15. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
  16. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/NumberTime.js +1 -1
  17. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/SingleDate.js +1 -1
  18. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/TwoDate.js +1 -1
  19. package/dist/cjs/components/QueryBuilder/components/Connectors/Connector.js +1 -1
  20. package/dist/cjs/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.js +1 -1
  21. package/dist/cjs/components/QueryBuilder/constants/connector.d.ts +6 -3
  22. package/dist/cjs/components/QueryBuilder/constants/connector.js +1 -1
  23. package/dist/cjs/components/QueryBuilder/types/QueryBuilder.type.d.ts +2 -1
  24. package/dist/cjs/components/QueryBuilder/types/QueryBuilder.type.js +1 -1
  25. package/dist/cjs/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -0
  26. package/dist/cjs/components/QueryBuilder/types/QueryBuilderOperator.type.d.ts +4 -1
  27. package/dist/cjs/components/QueryBuilder/types/QueryBuilderOperator.type.js +1 -1
  28. package/dist/cjs/components/SearchFilter/components/DateRangeOnlyButton.d.ts +7 -0
  29. package/dist/cjs/components/SearchFilter/components/DateRangeOnlyButton.js +1 -0
  30. package/dist/cjs/components/SearchFilter/components/SearchFilterItem.js +1 -1
  31. package/dist/cjs/components/SearchFilter/types/SearchFilter.type.d.ts +4 -0
  32. package/dist/cjs/components/accordion/Accordion.d.ts +2 -0
  33. package/dist/cjs/components/accordion/Accordion.js +1 -1
  34. package/dist/cjs/components/accordion/Accordion.style.d.ts +1 -0
  35. package/dist/cjs/components/accordion/Accordion.style.js +1 -1
  36. package/dist/cjs/components/add-variableV2/AddVariableV2.js +1 -1
  37. package/dist/cjs/components/add-variableV2/AddVariableV2.styled.js +2 -0
  38. package/dist/cjs/components/add-variableV2/AddVariableV2SideModal.js +1 -1
  39. package/dist/cjs/components/alerts/Alert.js +1 -1
  40. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
  41. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +3 -0
  42. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
  43. package/dist/cjs/components/analytics-chips-and-dropdowns/CommonStyles.js +1 -1
  44. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  45. package/dist/cjs/components/avatar/Avatar.js +1 -1
  46. package/dist/cjs/components/bik-layout/BikLayout.d.ts +2 -0
  47. package/dist/cjs/components/bik-layout/BikLayout.js +1 -1
  48. package/dist/cjs/components/bik-layout/CommonStyles.d.ts +10 -0
  49. package/dist/cjs/components/bik-layout/CommonStyles.js +1 -1
  50. package/dist/cjs/components/bik-layout/FeatureModal.d.ts +1 -0
  51. package/dist/cjs/components/bik-layout/FeatureModal.js +1 -1
  52. package/dist/cjs/components/bik-layout/FeatureModalV2.d.ts +12 -0
  53. package/dist/cjs/components/bik-layout/FeatureModalV2.js +1 -0
  54. package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
  55. package/dist/cjs/components/bik-layout/ShowShopifyRestrictedModal.d.ts +13 -0
  56. package/dist/cjs/components/bik-layout/ShowShopifyRestrictedModal.js +1 -0
  57. package/dist/cjs/components/bik-layout/index.d.ts +2 -0
  58. package/dist/cjs/components/button/Button.js +1 -1
  59. package/dist/cjs/components/button/Button.styled.js +1 -1
  60. package/dist/cjs/components/button/model.d.ts +1 -1
  61. package/dist/cjs/components/button/themes.d.ts +3 -2
  62. package/dist/cjs/components/button/themes.js +1 -1
  63. package/dist/cjs/components/carousel-secondary/CarouselSecondary.js +1 -1
  64. package/dist/cjs/components/colourInput/ColourInput.js +1 -1
  65. package/dist/cjs/components/datePicker/DatePicker.js +1 -1
  66. package/dist/cjs/components/datePicker/DatePickerWrapper.d.ts +2 -0
  67. package/dist/cjs/components/datePicker/DatePickerWrapper.js +1 -1
  68. package/dist/cjs/components/discount-modal/CouponExpiration/CouponExpiration.js +1 -1
  69. package/dist/cjs/components/discount-modal/DiscountModal.d.ts +9 -0
  70. package/dist/cjs/components/discount-modal/DiscountModal.js +1 -1
  71. package/dist/cjs/components/discount-modal/DiscountUtils.d.ts +2 -0
  72. package/dist/cjs/components/discount-modal/DiscountUtils.js +1 -1
  73. package/dist/cjs/components/discount-modal/DynamicCoupon/DynamicCoupon.d.ts +7 -5
  74. package/dist/cjs/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
  75. package/dist/cjs/components/discount-modal/StaticCoupon/StaticCoupon.js +1 -1
  76. package/dist/cjs/components/discount-modal/type.d.ts +11 -2
  77. package/dist/cjs/components/discount-modal/type.js +1 -1
  78. package/dist/cjs/components/dropdown/ChipDropdown.js +1 -1
  79. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  80. package/dist/cjs/components/dropdown/type.d.ts +1 -0
  81. package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
  82. package/dist/cjs/components/input/Input.d.ts +1 -0
  83. package/dist/cjs/components/input/Input.js +1 -1
  84. package/dist/cjs/components/input/Input.styled.d.ts +6 -0
  85. package/dist/cjs/components/input/Input.styled.js +1 -1
  86. package/dist/cjs/components/input-with-vars/InputWithVariables.d.ts +3 -1
  87. package/dist/cjs/components/input-with-vars/InputWithVariables.js +6 -6
  88. package/dist/cjs/components/modals/Modal.d.ts +1 -0
  89. package/dist/cjs/components/modals/Modal.js +1 -1
  90. package/dist/cjs/components/modals/styledModal.d.ts +1 -0
  91. package/dist/cjs/components/modals/styledModal.js +1 -1
  92. package/dist/cjs/components/plans/NewSubscriptionPlan.d.ts +18 -0
  93. package/dist/cjs/components/plans/NewSubscriptionPlan.js +1 -0
  94. package/dist/cjs/components/plans/SubscriptionPlan.d.ts +4 -2
  95. package/dist/cjs/components/plans/SubscriptionPlan.js +1 -1
  96. package/dist/cjs/components/plans/SubscriptionPlanSelector.d.ts +1 -0
  97. package/dist/cjs/components/plans/SubscriptionPlanSelector.js +1 -1
  98. package/dist/cjs/components/plans/SubscriptionPlanStyled.d.ts +7 -0
  99. package/dist/cjs/components/plans/SubscriptionPlanStyled.js +1 -1
  100. package/dist/cjs/components/plans/SubscriptionPlansCollected.d.ts +14 -0
  101. package/dist/cjs/components/plans/SubscriptionPlansCollected.js +6 -0
  102. package/dist/cjs/components/plans/index.d.ts +2 -0
  103. package/dist/cjs/components/product-picker/ProductPicker.styled.js +1 -1
  104. package/dist/cjs/components/product-picker/ProductPickerModal.js +1 -1
  105. package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.d.ts +45 -0
  106. package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.js +1 -0
  107. package/dist/cjs/components/product-picker-v2/modal.d.ts +27 -2
  108. package/dist/cjs/components/product-picker-v2/modal.js +1 -1
  109. package/dist/cjs/components/product-picker-v2/productScreen.d.ts +9 -1
  110. package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
  111. package/dist/cjs/components/product-picker-v2/rearrangeScreen.d.ts +18 -0
  112. package/dist/cjs/components/product-picker-v2/rearrangeScreen.js +1 -0
  113. package/dist/cjs/components/product-picker-v2/style.d.ts +3 -0
  114. package/dist/cjs/components/product-picker-v2/style.js +43 -11
  115. package/dist/cjs/components/product-picker-v2/type.d.ts +6 -0
  116. package/dist/cjs/components/product-picker-v2/type.js +1 -0
  117. package/dist/cjs/components/product-picker-v2/variant.d.ts +32 -0
  118. package/dist/cjs/components/product-picker-v2/variant.js +1 -0
  119. package/dist/cjs/components/product-picker-v2/variantComponents.d.ts +21 -0
  120. package/dist/cjs/components/product-picker-v2/variantComponents.js +1 -0
  121. package/dist/cjs/components/side-modal/SideModal.js +1 -1
  122. package/dist/cjs/components/slider/index.d.ts +1 -0
  123. package/dist/cjs/components/slider/slider.d.ts +10 -0
  124. package/dist/cjs/components/slider/slider.js +1 -0
  125. package/dist/cjs/components/star-rating/Star.d.ts +1 -0
  126. package/dist/cjs/components/star-rating/Star.js +1 -1
  127. package/dist/cjs/components/star-rating/StarRating.d.ts +1 -0
  128. package/dist/cjs/components/star-rating/StarRating.js +1 -1
  129. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +5 -1
  130. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
  131. package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +4 -0
  132. package/dist/cjs/components/template-context-mapper/context/templateModalContext.js +1 -1
  133. package/dist/cjs/components/template-context-mapper/modalElements/Body.d.ts +2 -0
  134. package/dist/cjs/components/template-context-mapper/modalElements/Body.js +3 -4
  135. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaV2.d.ts +1 -0
  136. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaV2.js +2 -2
  137. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  138. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +2 -2
  139. package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +3 -1
  140. package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
  141. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.d.ts +2 -1
  142. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
  143. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  144. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorsPanel.d.ts +4 -1
  145. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +24 -2
  146. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  147. package/dist/cjs/components/template-preview/EmailTemplatePreview.styled.js +1 -0
  148. package/dist/cjs/components/template-preview/SmsTemplatePreview.js +1 -1
  149. package/dist/cjs/components/testimonial-card/TestimonialCard.d.ts +14 -0
  150. package/dist/cjs/components/testimonial-card/TestimonialCard.js +1 -0
  151. package/dist/cjs/components/testimonial-card/TestimonialCard.style.d.ts +16 -0
  152. package/dist/cjs/components/testimonial-card/TestimonialCard.style.js +1 -0
  153. package/dist/cjs/components/testimonial-card/index.d.ts +1 -0
  154. package/dist/cjs/components/tooltips/Tooltip.js +1 -1
  155. package/dist/cjs/components/tooltips/TooltipInternal.d.ts +1 -0
  156. package/dist/cjs/components/tooltips/TooltipInternal.js +1 -1
  157. package/dist/cjs/constants/Theme.d.ts +25 -0
  158. package/dist/cjs/constants/Theme.js +1 -1
  159. package/dist/cjs/index.d.ts +2 -0
  160. package/dist/cjs/index.js +1 -1
  161. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/extends.js +1 -0
  162. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +1 -0
  163. package/dist/cjs/node_modules/@mui/base/node_modules/clsx/dist/clsx.mjs.js +1 -0
  164. package/dist/cjs/node_modules/@mui/base/useSlider/useSlider.js +1 -0
  165. package/dist/cjs/node_modules/@mui/base/utils/appendOwnerState.js +1 -0
  166. package/dist/cjs/node_modules/@mui/base/utils/areArraysEqual.js +1 -0
  167. package/dist/cjs/node_modules/@mui/base/utils/extractEventHandlers.js +1 -0
  168. package/dist/cjs/node_modules/@mui/base/utils/isHostComponent.js +1 -0
  169. package/dist/cjs/node_modules/@mui/base/utils/mergeSlotProps.js +1 -0
  170. package/dist/cjs/node_modules/@mui/base/utils/omitEventHandlers.js +1 -0
  171. package/dist/cjs/node_modules/@mui/base/utils/resolveComponentProps.js +1 -0
  172. package/dist/cjs/node_modules/@mui/base/utils/useSlotProps.js +1 -0
  173. package/dist/cjs/node_modules/@mui/material/Slider/Slider.js +1 -0
  174. package/dist/cjs/node_modules/@mui/material/Slider/SliderValueLabel.js +1 -0
  175. package/dist/cjs/node_modules/@mui/material/Slider/sliderClasses.js +1 -0
  176. package/dist/cjs/node_modules/@mui/material/colors/blue.js +1 -0
  177. package/dist/cjs/node_modules/@mui/material/colors/common.js +1 -0
  178. package/dist/cjs/node_modules/@mui/material/colors/green.js +1 -0
  179. package/dist/cjs/node_modules/@mui/material/colors/grey.js +1 -0
  180. package/dist/cjs/node_modules/@mui/material/colors/lightBlue.js +1 -0
  181. package/dist/cjs/node_modules/@mui/material/colors/orange.js +1 -0
  182. package/dist/cjs/node_modules/@mui/material/colors/purple.js +1 -0
  183. package/dist/cjs/node_modules/@mui/material/colors/red.js +1 -0
  184. package/dist/cjs/node_modules/@mui/material/node_modules/clsx/dist/clsx.mjs.js +1 -0
  185. package/dist/cjs/node_modules/@mui/material/styles/createMixins.js +1 -0
  186. package/dist/cjs/node_modules/@mui/material/styles/createPalette.js +1 -0
  187. package/dist/cjs/node_modules/@mui/material/styles/createTheme.js +1 -0
  188. package/dist/cjs/node_modules/@mui/material/styles/createTransitions.js +1 -0
  189. package/dist/cjs/node_modules/@mui/material/styles/createTypography.js +1 -0
  190. package/dist/cjs/node_modules/@mui/material/styles/defaultTheme.js +1 -0
  191. package/dist/cjs/node_modules/@mui/material/styles/identifier.js +1 -0
  192. package/dist/cjs/node_modules/@mui/material/styles/shadows.js +1 -0
  193. package/dist/cjs/node_modules/@mui/material/styles/styled.js +1 -0
  194. package/dist/cjs/node_modules/@mui/material/styles/useTheme.js +1 -0
  195. package/dist/cjs/node_modules/@mui/material/styles/useThemeProps.js +1 -0
  196. package/dist/cjs/node_modules/@mui/material/styles/zIndex.js +1 -0
  197. package/dist/cjs/node_modules/@mui/material/utils/capitalize.js +1 -0
  198. package/dist/cjs/node_modules/@mui/material/utils/shouldSpreadAdditionalProps.js +1 -0
  199. package/dist/cjs/node_modules/@mui/styled-engine/index.js +8 -0
  200. package/dist/cjs/node_modules/@mui/system/esm/borders.js +1 -0
  201. package/dist/cjs/node_modules/@mui/system/esm/breakpoints.js +1 -0
  202. package/dist/cjs/node_modules/@mui/system/esm/colorManipulator.js +1 -0
  203. package/dist/cjs/node_modules/@mui/system/esm/compose.js +1 -0
  204. package/dist/cjs/node_modules/@mui/system/esm/createStyled.js +1 -0
  205. package/dist/cjs/node_modules/@mui/system/esm/createTheme/createBreakpoints.js +1 -0
  206. package/dist/cjs/node_modules/@mui/system/esm/createTheme/createSpacing.js +1 -0
  207. package/dist/cjs/node_modules/@mui/system/esm/createTheme/createTheme.js +1 -0
  208. package/dist/cjs/node_modules/@mui/system/esm/createTheme/shape.js +1 -0
  209. package/dist/cjs/node_modules/@mui/system/esm/cssGrid.js +1 -0
  210. package/dist/cjs/node_modules/@mui/system/esm/memoize.js +1 -0
  211. package/dist/cjs/node_modules/@mui/system/esm/merge.js +1 -0
  212. package/dist/cjs/node_modules/@mui/system/esm/palette.js +1 -0
  213. package/dist/cjs/node_modules/@mui/system/esm/propsToClassKey.js +1 -0
  214. package/dist/cjs/node_modules/@mui/system/esm/responsivePropType.js +1 -0
  215. package/dist/cjs/node_modules/@mui/system/esm/sizing.js +1 -0
  216. package/dist/cjs/node_modules/@mui/system/esm/spacing.js +1 -0
  217. package/dist/cjs/node_modules/@mui/system/esm/style.js +1 -0
  218. package/dist/cjs/node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js +1 -0
  219. package/dist/cjs/node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js +1 -0
  220. package/dist/cjs/node_modules/@mui/system/esm/useTheme.js +1 -0
  221. package/dist/cjs/node_modules/@mui/system/esm/useThemeProps/getThemeProps.js +1 -0
  222. package/dist/cjs/node_modules/@mui/system/esm/useThemeProps/useThemeProps.js +1 -0
  223. package/dist/cjs/node_modules/@mui/system/esm/useThemeWithoutDefault.js +1 -0
  224. package/dist/cjs/node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js +1 -0
  225. package/dist/cjs/node_modules/@mui/utils/esm/capitalize/capitalize.js +1 -0
  226. package/dist/cjs/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes.js +1 -0
  227. package/dist/cjs/node_modules/@mui/utils/esm/composeClasses/composeClasses.js +1 -0
  228. package/dist/cjs/node_modules/@mui/utils/esm/deepmerge.js +1 -0
  229. package/dist/cjs/node_modules/@mui/utils/esm/formatMuiErrorMessage.js +1 -0
  230. package/dist/cjs/node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js +1 -0
  231. package/dist/cjs/node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js +1 -0
  232. package/dist/cjs/node_modules/@mui/utils/esm/getDisplayName.js +1 -0
  233. package/dist/cjs/node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js +1 -0
  234. package/dist/cjs/node_modules/@mui/utils/esm/resolveProps.js +1 -0
  235. package/dist/cjs/node_modules/@mui/utils/esm/setRef.js +1 -0
  236. package/dist/cjs/node_modules/@mui/utils/esm/useControlled/useControlled.js +1 -0
  237. package/dist/cjs/node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js +1 -0
  238. package/dist/cjs/node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js +1 -0
  239. package/dist/cjs/node_modules/@mui/utils/esm/useForkRef/useForkRef.js +1 -0
  240. package/dist/cjs/node_modules/@mui/utils/esm/useIsFocusVisible.js +1 -0
  241. package/dist/cjs/node_modules/@mui/utils/esm/visuallyHidden.js +1 -0
  242. package/dist/cjs/node_modules/@mui/utils/node_modules/react-is/cjs/react-is.development.js +10 -0
  243. package/dist/cjs/node_modules/@mui/utils/node_modules/react-is/cjs/react-is.production.min.js +10 -0
  244. package/dist/cjs/node_modules/@mui/utils/node_modules/react-is/index.js +1 -0
  245. package/dist/cjs/node_modules/object-assign/index.js +7 -0
  246. package/dist/cjs/node_modules/prop-types/checkPropTypes.js +1 -0
  247. package/dist/cjs/node_modules/prop-types/factoryWithThrowingShims.js +1 -0
  248. package/dist/cjs/node_modules/prop-types/factoryWithTypeCheckers.js +1 -0
  249. package/dist/cjs/node_modules/prop-types/index.js +1 -0
  250. package/dist/cjs/node_modules/prop-types/lib/ReactPropTypesSecret.js +1 -0
  251. package/dist/cjs/node_modules/prop-types/lib/has.js +1 -0
  252. package/dist/cjs/node_modules/react-is/cjs/react-is.development.js +9 -0
  253. package/dist/cjs/node_modules/react-is/cjs/react-is.production.min.js +9 -0
  254. package/dist/cjs/node_modules/react-is/index.js +1 -0
  255. package/dist/esm/_virtual/index.js +1 -0
  256. package/dist/esm/_virtual/index2.js +1 -0
  257. package/dist/esm/_virtual/index3.js +1 -0
  258. package/dist/esm/_virtual/react-is.development.js +1 -0
  259. package/dist/esm/_virtual/react-is.development2.js +1 -0
  260. package/dist/esm/_virtual/react-is.production.min.js +1 -0
  261. package/dist/esm/_virtual/react-is.production.min2.js +1 -0
  262. package/dist/esm/assets/icons/WhiteStarFilled.svg.js +1 -0
  263. package/dist/esm/assets/icons/checkCircle.svg.js +1 -0
  264. package/dist/esm/assets/icons/drag_handle.svg.js +1 -0
  265. package/dist/esm/assets/icons/quotes.svg.js +1 -0
  266. package/dist/esm/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
  267. package/dist/esm/components/QueryBuilder/Filters/Segment/components/SegmentFilter.js +1 -1
  268. package/dist/esm/components/QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js +2 -2
  269. package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
  270. package/dist/esm/components/QueryBuilder/components/Connectors/Components/NumberTime.js +1 -1
  271. package/dist/esm/components/QueryBuilder/components/Connectors/Components/SingleDate.js +1 -1
  272. package/dist/esm/components/QueryBuilder/components/Connectors/Components/TwoDate.js +1 -1
  273. package/dist/esm/components/QueryBuilder/components/Connectors/Connector.js +1 -1
  274. package/dist/esm/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.js +1 -1
  275. package/dist/esm/components/QueryBuilder/constants/connector.d.ts +6 -3
  276. package/dist/esm/components/QueryBuilder/constants/connector.js +1 -1
  277. package/dist/esm/components/QueryBuilder/types/QueryBuilder.type.d.ts +2 -1
  278. package/dist/esm/components/QueryBuilder/types/QueryBuilder.type.js +1 -1
  279. package/dist/esm/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -0
  280. package/dist/esm/components/QueryBuilder/types/QueryBuilderOperator.type.d.ts +4 -1
  281. package/dist/esm/components/QueryBuilder/types/QueryBuilderOperator.type.js +1 -1
  282. package/dist/esm/components/SearchFilter/components/DateRangeOnlyButton.d.ts +7 -0
  283. package/dist/esm/components/SearchFilter/components/DateRangeOnlyButton.js +1 -0
  284. package/dist/esm/components/SearchFilter/components/SearchFilterItem.js +1 -1
  285. package/dist/esm/components/SearchFilter/types/SearchFilter.type.d.ts +4 -0
  286. package/dist/esm/components/accordion/Accordion.d.ts +2 -0
  287. package/dist/esm/components/accordion/Accordion.js +1 -1
  288. package/dist/esm/components/accordion/Accordion.style.d.ts +1 -0
  289. package/dist/esm/components/accordion/Accordion.style.js +1 -1
  290. package/dist/esm/components/add-variableV2/AddVariableV2.js +1 -1
  291. package/dist/esm/components/add-variableV2/AddVariableV2.styled.js +2 -0
  292. package/dist/esm/components/add-variableV2/AddVariableV2SideModal.js +1 -1
  293. package/dist/esm/components/alerts/Alert.js +1 -1
  294. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
  295. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +3 -0
  296. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
  297. package/dist/esm/components/analytics-chips-and-dropdowns/CommonStyles.js +1 -1
  298. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  299. package/dist/esm/components/avatar/Avatar.js +1 -1
  300. package/dist/esm/components/bik-layout/BikLayout.d.ts +2 -0
  301. package/dist/esm/components/bik-layout/BikLayout.js +1 -1
  302. package/dist/esm/components/bik-layout/CommonStyles.d.ts +10 -0
  303. package/dist/esm/components/bik-layout/CommonStyles.js +1 -1
  304. package/dist/esm/components/bik-layout/FeatureModal.d.ts +1 -0
  305. package/dist/esm/components/bik-layout/FeatureModal.js +1 -1
  306. package/dist/esm/components/bik-layout/FeatureModalV2.d.ts +12 -0
  307. package/dist/esm/components/bik-layout/FeatureModalV2.js +1 -0
  308. package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
  309. package/dist/esm/components/bik-layout/ShowShopifyRestrictedModal.d.ts +13 -0
  310. package/dist/esm/components/bik-layout/ShowShopifyRestrictedModal.js +1 -0
  311. package/dist/esm/components/bik-layout/index.d.ts +2 -0
  312. package/dist/esm/components/button/Button.js +1 -1
  313. package/dist/esm/components/button/Button.styled.js +1 -1
  314. package/dist/esm/components/button/model.d.ts +1 -1
  315. package/dist/esm/components/button/themes.d.ts +3 -2
  316. package/dist/esm/components/button/themes.js +1 -1
  317. package/dist/esm/components/carousel-secondary/CarouselSecondary.js +1 -1
  318. package/dist/esm/components/colourInput/ColourInput.js +1 -1
  319. package/dist/esm/components/datePicker/DatePicker.js +1 -1
  320. package/dist/esm/components/datePicker/DatePickerWrapper.d.ts +2 -0
  321. package/dist/esm/components/datePicker/DatePickerWrapper.js +1 -1
  322. package/dist/esm/components/discount-modal/CouponExpiration/CouponExpiration.js +1 -1
  323. package/dist/esm/components/discount-modal/DiscountModal.d.ts +9 -0
  324. package/dist/esm/components/discount-modal/DiscountModal.js +1 -1
  325. package/dist/esm/components/discount-modal/DiscountUtils.d.ts +2 -0
  326. package/dist/esm/components/discount-modal/DiscountUtils.js +1 -1
  327. package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.d.ts +7 -5
  328. package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
  329. package/dist/esm/components/discount-modal/StaticCoupon/StaticCoupon.js +1 -1
  330. package/dist/esm/components/discount-modal/type.d.ts +11 -2
  331. package/dist/esm/components/discount-modal/type.js +1 -1
  332. package/dist/esm/components/dropdown/ChipDropdown.js +1 -1
  333. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  334. package/dist/esm/components/dropdown/type.d.ts +1 -0
  335. package/dist/esm/components/dropdown-button/DropdownButton.js +1 -1
  336. package/dist/esm/components/input/Input.d.ts +1 -0
  337. package/dist/esm/components/input/Input.js +1 -1
  338. package/dist/esm/components/input/Input.styled.d.ts +6 -0
  339. package/dist/esm/components/input/Input.styled.js +1 -1
  340. package/dist/esm/components/input-with-vars/InputWithVariables.d.ts +3 -1
  341. package/dist/esm/components/input-with-vars/InputWithVariables.js +6 -6
  342. package/dist/esm/components/modals/Modal.d.ts +1 -0
  343. package/dist/esm/components/modals/Modal.js +1 -1
  344. package/dist/esm/components/modals/styledModal.d.ts +1 -0
  345. package/dist/esm/components/modals/styledModal.js +1 -1
  346. package/dist/esm/components/plans/NewSubscriptionPlan.d.ts +18 -0
  347. package/dist/esm/components/plans/NewSubscriptionPlan.js +1 -0
  348. package/dist/esm/components/plans/SubscriptionPlan.d.ts +4 -2
  349. package/dist/esm/components/plans/SubscriptionPlan.js +1 -1
  350. package/dist/esm/components/plans/SubscriptionPlanSelector.d.ts +1 -0
  351. package/dist/esm/components/plans/SubscriptionPlanSelector.js +1 -1
  352. package/dist/esm/components/plans/SubscriptionPlanStyled.d.ts +7 -0
  353. package/dist/esm/components/plans/SubscriptionPlanStyled.js +1 -1
  354. package/dist/esm/components/plans/SubscriptionPlansCollected.d.ts +14 -0
  355. package/dist/esm/components/plans/SubscriptionPlansCollected.js +6 -0
  356. package/dist/esm/components/plans/index.d.ts +2 -0
  357. package/dist/esm/components/product-picker/ProductPicker.styled.js +1 -1
  358. package/dist/esm/components/product-picker/ProductPickerModal.js +1 -1
  359. package/dist/esm/components/product-picker-v2/helpers/ProductHelper.d.ts +45 -0
  360. package/dist/esm/components/product-picker-v2/helpers/ProductHelper.js +1 -0
  361. package/dist/esm/components/product-picker-v2/modal.d.ts +27 -2
  362. package/dist/esm/components/product-picker-v2/modal.js +1 -1
  363. package/dist/esm/components/product-picker-v2/productScreen.d.ts +9 -1
  364. package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
  365. package/dist/esm/components/product-picker-v2/rearrangeScreen.d.ts +18 -0
  366. package/dist/esm/components/product-picker-v2/rearrangeScreen.js +1 -0
  367. package/dist/esm/components/product-picker-v2/style.d.ts +3 -0
  368. package/dist/esm/components/product-picker-v2/style.js +41 -9
  369. package/dist/esm/components/product-picker-v2/type.d.ts +6 -0
  370. package/dist/esm/components/product-picker-v2/type.js +1 -0
  371. package/dist/esm/components/product-picker-v2/variant.d.ts +32 -0
  372. package/dist/esm/components/product-picker-v2/variant.js +1 -0
  373. package/dist/esm/components/product-picker-v2/variantComponents.d.ts +21 -0
  374. package/dist/esm/components/product-picker-v2/variantComponents.js +1 -0
  375. package/dist/esm/components/side-modal/SideModal.js +1 -1
  376. package/dist/esm/components/slider/index.d.ts +1 -0
  377. package/dist/esm/components/slider/slider.d.ts +10 -0
  378. package/dist/esm/components/slider/slider.js +1 -0
  379. package/dist/esm/components/star-rating/Star.d.ts +1 -0
  380. package/dist/esm/components/star-rating/Star.js +1 -1
  381. package/dist/esm/components/star-rating/StarRating.d.ts +1 -0
  382. package/dist/esm/components/star-rating/StarRating.js +1 -1
  383. package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +5 -1
  384. package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
  385. package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +4 -0
  386. package/dist/esm/components/template-context-mapper/context/templateModalContext.js +1 -1
  387. package/dist/esm/components/template-context-mapper/modalElements/Body.d.ts +2 -0
  388. package/dist/esm/components/template-context-mapper/modalElements/Body.js +5 -6
  389. package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.d.ts +1 -0
  390. package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.js +2 -2
  391. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  392. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +2 -2
  393. package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +3 -1
  394. package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
  395. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +2 -1
  396. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
  397. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  398. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.d.ts +4 -1
  399. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +24 -2
  400. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  401. package/dist/esm/components/template-preview/EmailTemplatePreview.styled.js +6 -5
  402. package/dist/esm/components/template-preview/SmsTemplatePreview.js +1 -1
  403. package/dist/esm/components/testimonial-card/TestimonialCard.d.ts +14 -0
  404. package/dist/esm/components/testimonial-card/TestimonialCard.js +1 -0
  405. package/dist/esm/components/testimonial-card/TestimonialCard.style.d.ts +16 -0
  406. package/dist/esm/components/testimonial-card/TestimonialCard.style.js +1 -0
  407. package/dist/esm/components/testimonial-card/index.d.ts +1 -0
  408. package/dist/esm/components/tooltips/Tooltip.js +1 -1
  409. package/dist/esm/components/tooltips/TooltipInternal.d.ts +1 -0
  410. package/dist/esm/components/tooltips/TooltipInternal.js +1 -1
  411. package/dist/esm/constants/Theme.d.ts +25 -0
  412. package/dist/esm/constants/Theme.js +1 -1
  413. package/dist/esm/index.d.ts +2 -0
  414. package/dist/esm/index.js +1 -1
  415. package/dist/esm/node_modules/@babel/runtime/helpers/esm/extends.js +1 -0
  416. package/dist/esm/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +1 -0
  417. package/dist/esm/node_modules/@mui/base/node_modules/clsx/dist/clsx.mjs.js +1 -0
  418. package/dist/esm/node_modules/@mui/base/useSlider/useSlider.js +1 -0
  419. package/dist/esm/node_modules/@mui/base/utils/appendOwnerState.js +1 -0
  420. package/dist/esm/node_modules/@mui/base/utils/areArraysEqual.js +1 -0
  421. package/dist/esm/node_modules/@mui/base/utils/extractEventHandlers.js +1 -0
  422. package/dist/esm/node_modules/@mui/base/utils/isHostComponent.js +1 -0
  423. package/dist/esm/node_modules/@mui/base/utils/mergeSlotProps.js +1 -0
  424. package/dist/esm/node_modules/@mui/base/utils/omitEventHandlers.js +1 -0
  425. package/dist/esm/node_modules/@mui/base/utils/resolveComponentProps.js +1 -0
  426. package/dist/esm/node_modules/@mui/base/utils/useSlotProps.js +1 -0
  427. package/dist/esm/node_modules/@mui/material/Slider/Slider.js +1 -0
  428. package/dist/esm/node_modules/@mui/material/Slider/SliderValueLabel.js +1 -0
  429. package/dist/esm/node_modules/@mui/material/Slider/sliderClasses.js +1 -0
  430. package/dist/esm/node_modules/@mui/material/colors/blue.js +1 -0
  431. package/dist/esm/node_modules/@mui/material/colors/common.js +1 -0
  432. package/dist/esm/node_modules/@mui/material/colors/green.js +1 -0
  433. package/dist/esm/node_modules/@mui/material/colors/grey.js +1 -0
  434. package/dist/esm/node_modules/@mui/material/colors/lightBlue.js +1 -0
  435. package/dist/esm/node_modules/@mui/material/colors/orange.js +1 -0
  436. package/dist/esm/node_modules/@mui/material/colors/purple.js +1 -0
  437. package/dist/esm/node_modules/@mui/material/colors/red.js +1 -0
  438. package/dist/esm/node_modules/@mui/material/node_modules/clsx/dist/clsx.mjs.js +1 -0
  439. package/dist/esm/node_modules/@mui/material/styles/createMixins.js +1 -0
  440. package/dist/esm/node_modules/@mui/material/styles/createPalette.js +1 -0
  441. package/dist/esm/node_modules/@mui/material/styles/createTheme.js +1 -0
  442. package/dist/esm/node_modules/@mui/material/styles/createTransitions.js +1 -0
  443. package/dist/esm/node_modules/@mui/material/styles/createTypography.js +1 -0
  444. package/dist/esm/node_modules/@mui/material/styles/defaultTheme.js +1 -0
  445. package/dist/esm/node_modules/@mui/material/styles/identifier.js +1 -0
  446. package/dist/esm/node_modules/@mui/material/styles/shadows.js +1 -0
  447. package/dist/esm/node_modules/@mui/material/styles/styled.js +1 -0
  448. package/dist/esm/node_modules/@mui/material/styles/useTheme.js +1 -0
  449. package/dist/esm/node_modules/@mui/material/styles/useThemeProps.js +1 -0
  450. package/dist/esm/node_modules/@mui/material/styles/zIndex.js +1 -0
  451. package/dist/esm/node_modules/@mui/material/utils/capitalize.js +1 -0
  452. package/dist/esm/node_modules/@mui/material/utils/shouldSpreadAdditionalProps.js +1 -0
  453. package/dist/esm/node_modules/@mui/styled-engine/index.js +8 -0
  454. package/dist/esm/node_modules/@mui/system/esm/borders.js +1 -0
  455. package/dist/esm/node_modules/@mui/system/esm/breakpoints.js +1 -0
  456. package/dist/esm/node_modules/@mui/system/esm/colorManipulator.js +1 -0
  457. package/dist/esm/node_modules/@mui/system/esm/compose.js +1 -0
  458. package/dist/esm/node_modules/@mui/system/esm/createStyled.js +1 -0
  459. package/dist/esm/node_modules/@mui/system/esm/createTheme/createBreakpoints.js +1 -0
  460. package/dist/esm/node_modules/@mui/system/esm/createTheme/createSpacing.js +1 -0
  461. package/dist/esm/node_modules/@mui/system/esm/createTheme/createTheme.js +1 -0
  462. package/dist/esm/node_modules/@mui/system/esm/createTheme/shape.js +1 -0
  463. package/dist/esm/node_modules/@mui/system/esm/cssGrid.js +1 -0
  464. package/dist/esm/node_modules/@mui/system/esm/memoize.js +1 -0
  465. package/dist/esm/node_modules/@mui/system/esm/merge.js +1 -0
  466. package/dist/esm/node_modules/@mui/system/esm/palette.js +1 -0
  467. package/dist/esm/node_modules/@mui/system/esm/propsToClassKey.js +1 -0
  468. package/dist/esm/node_modules/@mui/system/esm/responsivePropType.js +1 -0
  469. package/dist/esm/node_modules/@mui/system/esm/sizing.js +1 -0
  470. package/dist/esm/node_modules/@mui/system/esm/spacing.js +1 -0
  471. package/dist/esm/node_modules/@mui/system/esm/style.js +1 -0
  472. package/dist/esm/node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js +1 -0
  473. package/dist/esm/node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js +1 -0
  474. package/dist/esm/node_modules/@mui/system/esm/useTheme.js +1 -0
  475. package/dist/esm/node_modules/@mui/system/esm/useThemeProps/getThemeProps.js +1 -0
  476. package/dist/esm/node_modules/@mui/system/esm/useThemeProps/useThemeProps.js +1 -0
  477. package/dist/esm/node_modules/@mui/system/esm/useThemeWithoutDefault.js +1 -0
  478. package/dist/esm/node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js +1 -0
  479. package/dist/esm/node_modules/@mui/utils/esm/capitalize/capitalize.js +1 -0
  480. package/dist/esm/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes.js +1 -0
  481. package/dist/esm/node_modules/@mui/utils/esm/composeClasses/composeClasses.js +1 -0
  482. package/dist/esm/node_modules/@mui/utils/esm/deepmerge.js +1 -0
  483. package/dist/esm/node_modules/@mui/utils/esm/formatMuiErrorMessage.js +1 -0
  484. package/dist/esm/node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js +1 -0
  485. package/dist/esm/node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js +1 -0
  486. package/dist/esm/node_modules/@mui/utils/esm/getDisplayName.js +1 -0
  487. package/dist/esm/node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js +1 -0
  488. package/dist/esm/node_modules/@mui/utils/esm/resolveProps.js +1 -0
  489. package/dist/esm/node_modules/@mui/utils/esm/setRef.js +1 -0
  490. package/dist/esm/node_modules/@mui/utils/esm/useControlled/useControlled.js +1 -0
  491. package/dist/esm/node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js +1 -0
  492. package/dist/esm/node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js +1 -0
  493. package/dist/esm/node_modules/@mui/utils/esm/useForkRef/useForkRef.js +1 -0
  494. package/dist/esm/node_modules/@mui/utils/esm/useIsFocusVisible.js +1 -0
  495. package/dist/esm/node_modules/@mui/utils/esm/visuallyHidden.js +1 -0
  496. package/dist/esm/node_modules/@mui/utils/node_modules/react-is/cjs/react-is.development.js +10 -0
  497. package/dist/esm/node_modules/@mui/utils/node_modules/react-is/cjs/react-is.production.min.js +10 -0
  498. package/dist/esm/node_modules/@mui/utils/node_modules/react-is/index.js +1 -0
  499. package/dist/esm/node_modules/object-assign/index.js +6 -0
  500. package/dist/esm/node_modules/prop-types/checkPropTypes.js +1 -0
  501. package/dist/esm/node_modules/prop-types/factoryWithThrowingShims.js +1 -0
  502. package/dist/esm/node_modules/prop-types/factoryWithTypeCheckers.js +1 -0
  503. package/dist/esm/node_modules/prop-types/index.js +1 -0
  504. package/dist/esm/node_modules/prop-types/lib/ReactPropTypesSecret.js +1 -0
  505. package/dist/esm/node_modules/prop-types/lib/has.js +1 -0
  506. package/dist/esm/node_modules/react-is/cjs/react-is.development.js +9 -0
  507. package/dist/esm/node_modules/react-is/cjs/react-is.production.min.js +9 -0
  508. package/dist/esm/node_modules/react-is/index.js +1 -0
  509. package/package.json +6 -4
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/search.svg.js"),c=require("react"),o=require("../../constants/Theme.js"),s=require("../button/Button.js"),r=require("../input/Input.js"),l=require("../modals/styledModal.js"),n=require("../spinner/Spinner.js"),i=require("../tag/Tag.js"),d=require("./collectionScreen.js"),a=require("./productScreen.js"),u=require("./reducers.js"),h=require("./searchScreen.js"),p=require("./selectedScreen.js"),C=require("./style.js");exports.ProductPickerModal=S=>{const{storeId:j,selectedItems:x,onClose:v,visible:y,zIndex:b,limit:g,hideCollectionCheckbox:m,hideProductCheckbox:f}=S,[I,P]=c.useReducer(u.collectionsReducer,{}),[q,k]=c.useState("collections"),[T,E]=c.useState(""),[F,O]=c.useState(0),[R,D]=c.useState(!1),[B,w]=c.useState(0),[L,M]=c.useState(""),[z,G]=c.useState(!1),[$,A]=c.useState(!1),[_,H]=c.useState(),[Y,J]=c.useReducer(u.selectedColectionsReducer,Object.keys(x).length>0?x:{});c.useEffect((()=>{D(!0),A(!0),S.collectionFetcher(F,j).then((e=>{P({type:"fetched",data:(null==e?void 0:e.collections)||{}}),D(!1),O((e=>e+1)),A(!1)})).catch()}),[]),c.useEffect((()=>{let e=0;Object.keys(Y||[]).forEach((t=>{var c;Object.keys((null===(c=Y[t])||void 0===c?void 0:c.products)||[]).forEach((c=>{var o,s;Object.keys((null===(s=null===(o=Y[t].products)||void 0===o?void 0:o[c])||void 0===s?void 0:s.variants)||[]).forEach((()=>{e+=1}))}))})),w(e)})),c.useEffect((()=>{var e;T&&!(null===(e=null==I?void 0:I[T])||void 0===e?void 0:e.products)&&(D(!0),S.productFetcher(T,j).then((e=>{Object.keys(e).length&&P({type:"productsFetched",data:{collectionId:T,products:e}}),D(!1)})).catch())}),[T]),c.useEffect((()=>{const e=setTimeout((()=>{L.length&&(G(!0),S.searchFetcher(j,L).then((e=>{H(e),k("searchProducts"),D(!1),G(!1)})))}),800);return()=>clearTimeout(e)}),[L]);const K=()=>{J({type:"reset",data:{}})};return e.jsx(l.StyledModal,Object.assign({zIndex:b,open:y,onClose:()=>{v(),K()},headingTitle:"collections"===q||"products"===q?"Select Products":"view"===q?"Selected Products":"searchProducts"===q?"Searched Products":void 0,footerShadow:!0,centralContainerStyles:{width:"480px"},primaryButton:{buttonText:R?"Loading...":"Add",disabled:R||B<1||g&&B>g||!1,onClick:()=>{S.onAdd(Y,B),K()}},footerLeftCustomElement:g&&B>g?e.jsx(i.Tag,{tagText:`You can only select ${g} products`,type:"negative"}):B>0?e.jsx(s.Button,{onClick:()=>{k("view")},buttonText:`${B} products selected`,buttonType:"tertiaryGray"}):e.jsx(s.Button,{disabled:!0,buttonText:`${B} products selected`,buttonType:"tertiaryGray"})},{children:e.jsxs(C.ContainerStyle,{children:[!S.hideGlobalSearch&&e.jsx(e.Fragment,{children:("collections"===q||"searchProducts"===q)&&e.jsx("div",Object.assign({style:{padding:"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(r.Input,{noErrorHint:!0,rightIcon:{icon:()=>z?e.jsx(n.Spinner,{size:"small",color:o.COLORS.content.primary}):e.jsx(t.default,{})},id:"listInput",height:"24px",type:"text",value:L,onChangeText:e=>{e.length&&e.trim().length&&M(e)},placeholder:"Search products..."})}))}),e.jsxs(C.ScrollContainerStyle,{children:["collections"===q&&e.jsx(d.CollectionsScreen,{customCollectionRestriction:S.customCollectionRestriction,dataLoading:$,collections:I,selectedCollectionsDispatch:J,setCollectionId:E,setScreen:k,selectedCollections:Y,collectionFetcher:S.collectionFetcher,storeId:j,collectionsDispatch:P,setSaveDisabled:D,pagingControls:{curPage:F,setCurPage:O},hideCollectionCheckbox:m}),"products"===q&&T&&e.jsx(u.CollectionIdContext.Provider,Object.assign({value:T},{children:e.jsx(a.ProductsScreen,{hideInCollectionSearch:S.hideInCollectionSearch,customCollectionRestriction:S.customCollectionRestriction,productFetcher:S.productFetcher,setScreen:k,storeId:j,data:I[T],collectionsDispatch:P,selectedCollectionsDispatch:J,selectedData:Y,setSaveDisabled:D,searchInCollectionFetcher:S.searchInCollectionFetcher,hideProductCheckbox:f})})),"view"===q&&e.jsx(p.SelectedScreen,{selectedCollections:Y||{},selectedCollectionsDispatch:J,setScreen:k,collections:I}),"searchProducts"===q&&e.jsx(h.SearchScreen,{customCollectionRestriction:S.customCollectionRestriction,selectedCollections:Y||{},searchedCollections:_||{},selectedCollectionsDispatch:J,setScreen:k,collections:I,onBackPress:()=>{M(""),H({})}})]})]})}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react/jsx-runtime"),r=require("../../assets/icons/search.svg.js"),c=require("react"),o=require("../../constants/Theme.js"),s=require("../button/Button.js"),n=require("../input/Input.js"),l=require("../modals/styledModal.js"),i=require("../spinner/Spinner.js"),a=require("../tag/Tag.js"),d=require("./collectionScreen.js"),u=require("./productScreen.js"),h=require("./rearrangeScreen.js"),p=require("./reducers.js"),S=require("./searchScreen.js"),C=require("./selectedScreen.js"),g=require("./style.js"),x=require("./type.js");exports.ScreenName=void 0,(e=exports.ScreenName||(exports.ScreenName={})).Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products";exports.ProductPickerModal=e=>{const{storeId:j,selectedItems:m,onClose:v,visible:b,zIndex:y,limit:P,hideCollectionCheckbox:f,hideProductCheckbox:O,outOfStockAction:R=x.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:k,selectProductsFromCustomCollection:I,hideSelectionCount:q,title:F,width:T,startupScreen:E=exports.ScreenName.Collections,rearrangeEnabled:D}=e,[N,w]=c.useReducer(p.collectionsReducer,{}),[B,A]=c.useState([exports.ScreenName.Collections,exports.ScreenName.RearrangeProducts].includes(E)?E:exports.ScreenName.Collections),[L,_]=c.useState("grid"),[M,z]=c.useState(""),[G,H]=c.useState(0),[V,$]=c.useState(!1),[K,U]=c.useState(0),[Y,J]=c.useState(""),[Q,W]=c.useState(!1),[X,Z]=c.useState(!1),[ee,te]=c.useState(),[re,ce]=c.useReducer(p.selectedColectionsReducer,Object.keys(m).length>0?m:{});c.useEffect((()=>{$(!0),Z(!0),e.collectionFetcher(G,j).then((e=>{w({type:"fetched",data:(null==e?void 0:e.collections)||{}}),$(!1),H((e=>e+1)),Z(!1)})).catch()}),[]),c.useEffect((()=>{let e=0;Object.keys(re||[]).forEach((t=>{var r;Object.keys((null===(r=re[t])||void 0===r?void 0:r.products)||[]).forEach((r=>{var c,o;Object.keys((null===(o=null===(c=re[t].products)||void 0===c?void 0:c[r])||void 0===o?void 0:o.variants)||[]).forEach((()=>{e+=1}))}))})),U(e)})),c.useEffect((()=>{var t;M&&!(null===(t=null==N?void 0:N[M])||void 0===t?void 0:t.products)&&($(!0),e.productFetcher(M,j).then((e=>{Object.keys(e).length&&w({type:"productsFetched",data:{collectionId:M,products:e}}),$(!1)})).catch())}),[M]),c.useEffect((()=>{const t=setTimeout((()=>{"rearrange"!==B&&(Y.length?(W(!0),e.searchFetcher(j,Y).then((e=>{te(Object.assign({},e)),A("searchProducts"),$(!1),W(!1)}))):A("collections"))}),800);return()=>clearTimeout(t)}),[Y]);const oe=()=>{ce({type:"reset",data:{}})};return t.jsx(l.StyledModal,Object.assign({zIndex:y,open:b,onClose:()=>{v(),oe()},headingTitle:F||("collections"===B||"products"===B?"Select Products":"view"===B?"Selected Products":"searchProducts"===B?"Searched Products":"rearrange"===B?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:T||"480px"},headerRightCustomElement:"rearrange"===B?(console.log("ignore:",_),t.jsx(t.Fragment,{})):t.jsx(t.Fragment,{}),primaryButton:{buttonText:V?"Loading...":B===exports.ScreenName.RearrangeProducts?"Done":"Add",disabled:V||K<1||P&&K>P||!1,onClick:()=>{e.onAdd(re,K),oe()}},footerLeftCustomElement:q?t.jsx(t.Fragment,{}):P&&K>P?t.jsx(a.Tag,{tagText:`You can only select ${P} products`,type:"negative"}):K>0?t.jsx(s.Button,{onClick:()=>{A(D?exports.ScreenName.RearrangeProducts:exports.ScreenName.SelectedProducts)},buttonText:`${K} products selected`,buttonType:["rearrange","view"].includes(B)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(B)}):t.jsx(s.Button,{disabled:!0,buttonText:`${K} products selected`,buttonType:"tertiaryGray"})},{children:t.jsxs(g.ContainerStyle,{children:[e.postHeader&&t.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:e.postHeader})),!e.hideGlobalSearch&&t.jsx(t.Fragment,{children:("collections"===B||"searchProducts"===B)&&t.jsx("div",Object.assign({style:{padding:"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t.jsx(n.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Q?t.jsx(i.Spinner,{size:"small",color:o.COLORS.content.primary}):t.jsx(r.default,{})},id:"listInput",height:"24px",type:"text",value:Y,onChangeText:e=>{e.length&&e.trim().length?J(e):J("")}})}))}),t.jsxs(g.ScrollContainerStyle,{children:["collections"===B&&t.jsx(d.CollectionsScreen,{customCollectionRestriction:e.customCollectionRestriction,dataLoading:X,collections:N,selectedCollectionsDispatch:ce,setCollectionId:z,setScreen:A,selectedCollections:re,collectionFetcher:e.collectionFetcher,storeId:j,collectionsDispatch:w,setSaveDisabled:$,pagingControls:{curPage:G,setCurPage:H},hideCollectionCheckbox:f}),"products"===B&&M&&t.jsx(p.CollectionIdContext.Provider,Object.assign({value:M},{children:t.jsx(u.ProductsScreen,{hideInCollectionSearch:e.hideInCollectionSearch,customCollectionRestriction:e.customCollectionRestriction,productFetcher:e.productFetcher,setScreen:A,storeId:j,data:N[M],collectionsDispatch:w,selectedCollectionsDispatch:ce,selectedData:re,setSaveDisabled:$,searchInCollectionFetcher:e.searchInCollectionFetcher,hideProductCheckbox:O,outOfStockAction:R,hideVariantCheckbox:k,selectProductsFromCustomCollection:I})})),"view"===B&&t.jsx(C.SelectedScreen,{selectedCollections:re||{},selectedCollectionsDispatch:ce,setScreen:A,collections:N}),"rearrange"===B&&t.jsx(h.RearrangeScreen,{selectedCollections:re||{},selectedCollectionsDispatch:ce,setScreen:A,outOfStockAction:R,rearrangeViewType:"grid"===L?"list":"grid"}),"searchProducts"===B&&t.jsx(S.SearchScreen,{customCollectionRestriction:e.customCollectionRestriction,selectedCollections:re||{},searchedCollections:ee||{},selectedCollectionsDispatch:ce,setScreen:A,collections:N,onBackPress:()=>{J(""),te({})}})]})]})}))};
@@ -1,6 +1,7 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { Collection, Product, ProductFetcherReturn, ProductVariant, SelectedItems } from '.';
3
3
  import { CollectionsActions, SelectedCollectionsActions } from './reducers';
4
+ import { OUT_OF_STOCK_ACTION } from './type';
4
5
  interface ProductsScreenInterface {
5
6
  hideInCollectionSearch?: boolean;
6
7
  customCollectionRestriction?: boolean;
@@ -14,6 +15,9 @@ interface ProductsScreenInterface {
14
15
  setScreen: React.Dispatch<React.SetStateAction<string>>;
15
16
  setSaveDisabled: React.Dispatch<React.SetStateAction<boolean>>;
16
17
  hideProductCheckbox?: boolean;
18
+ outOfStockAction?: OUT_OF_STOCK_ACTION;
19
+ hideVariantCheckbox?: boolean;
20
+ selectProductsFromCustomCollection?: boolean;
17
21
  }
18
22
  export declare const ProductsScreen: (props: ProductsScreenInterface) => import("react/jsx-runtime").JSX.Element;
19
23
  interface ProductGroupInterface {
@@ -26,6 +30,8 @@ interface ProductGroupInterface {
26
30
  isProductPartiallyChecked?: boolean;
27
31
  upliftAdditions: any;
28
32
  hideProductCheckbox?: boolean;
33
+ outOfStockAction?: OUT_OF_STOCK_ACTION;
34
+ hideVariantCheckbox?: boolean;
29
35
  }
30
36
  export declare const ProductGroup: (props: ProductGroupInterface) => import("react/jsx-runtime").JSX.Element;
31
37
  interface ProductCardInterface {
@@ -40,6 +46,8 @@ interface ProductCardInterface {
40
46
  isPartiallyChecked?: boolean;
41
47
  upliftAdditions: any;
42
48
  hideProductCheckbox?: boolean;
49
+ outOfStockAction?: OUT_OF_STOCK_ACTION;
50
+ hideVariantCheckbox?: boolean;
43
51
  }
44
52
  export declare const ProductCard: (props: ProductCardInterface) => import("react/jsx-runtime").JSX.Element;
45
53
  export {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),i=require("../../assets/icons/box.svg.js"),o=require("../../assets/icons/search.svg.js"),c=require("lodash"),d=require("react"),s=require("../../constants/Theme.js"),r=require("../checkBox/CheckBox.js"),l=require("../icon-button/IconButton.js"),n=require("../input/Input.js"),a=require("../shimmer/ShimmerComponent/BikShimmer.js"),u=require("../shimmer-image/ShimmerImage.js"),h=require("../spinner/Spinner.js"),v=require("../TypographyStyle.js"),p=require("./collectionScreen.js"),j=require("./emptyState.js"),x=require("./reducers.js"),y=require("./style.js"),g=require("./utility.js");const m=t=>{const{collectionId:i,productId:o,data:c,selectedData:d,selectedCollectionsDispatch:s,viewOnly:r,upliftAdditions:l,isProductPartiallyChecked:n,hideProductCheckbox:a}=t,u=e=>{var t,c,s,r,l,n;if(!(null===(c=null===(t=null==d?void 0:d[i])||void 0===t?void 0:t.products)||void 0===c?void 0:c[o]))return!1;return!!(null===(n=null===(l=null===(r=null===(s=null==d?void 0:d[i])||void 0===s?void 0:s.products)||void 0===r?void 0:r[o])||void 0===l?void 0:l.variants)||void 0===n?void 0:n[e])};return e.jsxs("div",{children:[e.jsx(C,{isVariant:!1,data:c,productId:o,collectionId:i,isSelected:!!(null===(v=null===(h=null==d?void 0:d[i])||void 0===h?void 0:h.products)||void 0===v?void 0:v[o]),isPartiallyChecked:n,selectedCollectionsDispatch:s,upliftAdditions:l,viewOnly:r,hideProductCheckbox:a},o),Object.keys(c.variants||[]).map((t=>e.jsx(C,{isVariant:!0,data:c.variants[t],variantId:t,productId:o,viewOnly:r,upliftAdditions:l,collectionId:i,isSelected:u(t),selectedCollectionsDispatch:s},t)))]});var h,v},C=t=>{const{isVariant:i,data:o,productId:c,collectionId:d,variantId:s,isSelected:l,selectedCollectionsDispatch:n,viewOnly:a,upliftAdditions:h,isPartiallyChecked:j,hideProductCheckbox:x}=t;return e.jsxs(y.ProductCardStyle,Object.assign({isVariant:i},{children:[x||a?e.jsx(e.Fragment,{}):e.jsx(r.CheckBox,{isChecked:l,isPartiallyChecked:j||!1,onValueChange:function(e){i?e?h("variantSelected",{productId:c,variantId:s,collectionId:d,variant:o}):n({type:"variantUnselected",data:{productId:c,variantId:s,collectionId:d}}):e?h("productSelected",{productId:c,collectionId:d,product:o}):n({type:"productUnselected",data:{productId:c,collectionId:d}})}}),e.jsx("div",{children:e.jsx(u.ShimmerImage,{width:40,height:40,imageUrl:o.image,alt:"Item",borderRadius:4})}),e.jsx(v.TitleRegular,{children:p.truncate(o.name,40,!0)})]}))};exports.ProductCard=C,exports.ProductGroup=m,exports.ProductsScreen=u=>{const p=d.useContext(x.CollectionIdContext),{data:C,collectionsDispatch:I,selectedData:b,selectedCollectionsDispatch:k,productFetcher:S,storeId:f,setScreen:O,setSaveDisabled:P,hideInCollectionSearch:q,customCollectionRestriction:E,hideProductCheckbox:D}=u,[w,B]=d.useState(""),[T,R]=d.useState(!1),[A,V]=d.useState(C);d.useEffect((()=>{const e=setTimeout((()=>{w.length?(R(!0),u.searchInCollectionFetcher(f,p,w).then((e=>{var t;const i=c.cloneDeep(C);i.products={};for(const o of e)(null===(t=null==C?void 0:C.products)||void 0===t?void 0:t[o])&&(i.products[o]=C.products[o]);V(i),P(!1),R(!1)}))):V(C)}),800);return()=>clearTimeout(e)}),[w]);const F=!!E&&C.isSmartCollection,U=e=>{var t,i,o,c,d,s,r,l;let n=0,a=0;return!!((null===(i=null===(t=null==b?void 0:b[p])||void 0===t?void 0:t.products)||void 0===i?void 0:i[e])&&(null===(d=Object.keys((null===(c=null===(o=null==C?void 0:C.products)||void 0===o?void 0:o[e])||void 0===c?void 0:c.variants)||[]))||void 0===d||d.forEach((()=>a++)),Object.keys((null===(l=null===(r=null===(s=null==b?void 0:b[p])||void 0===s?void 0:s.products)||void 0===r?void 0:r[e])||void 0===l?void 0:l.variants)||[]).forEach((()=>n++)),n>0&&a!==n))};d.useEffect((()=>{(null==C?void 0:C.products)||_()}),[]);const _=()=>{P(!0),R(!0),S(p,f).then((e=>{Object.keys(e).length&&(I({type:"productsFetched",data:{collectionId:p,products:e}}),V(Object.assign(Object.assign({},A),{products:e}))),P(!1),R(!1)})).catch()},H=(e,t)=>{const i=g.liftTheStateUp(t,C);k({type:e,data:Object.assign(Object.assign({},i),{isRestricted:E})})};return e.jsxs("div",{children:[e.jsxs(y.ProductScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,height:16,onClick:()=>{O("collections")}}),e.jsx(v.BodyCaption,Object.assign({style:{color:s.COLORS.content.secondary}},{children:C.name}))]}),!q&&e.jsx("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(n.Input,{noErrorHint:!0,rightIcon:{icon:()=>T&&w.length?e.jsx(h.Spinner,{size:"small",color:s.COLORS.content.primary}):e.jsx(o.default,{})},id:"listInput",height:"24px",type:"text",value:w,onChangeText:e=>{e.length&&e.trim().length&&B(e)},placeholder:"Search products in this collection..."})})),e.jsxs("div",{children:[Object.keys((null==A?void 0:A.products)||[]).length>0&&!F&&!w.length&&!D&&e.jsxs(y.ProductScreenCollectionCardStyle,{children:[e.jsx(r.CheckBox,{isChecked:!!(null==b?void 0:b[p]),isPartiallyChecked:(e=>{var t;let i=0,o=0;if(b[e]){const c=null==C?void 0:C.products;c&&Object.keys(c).forEach((e=>{var t;const o=null===(t=c[e])||void 0===t?void 0:t.variants;o&&Object.keys(o).forEach((e=>i+=1))}));const d=null===(t=b[e])||void 0===t?void 0:t.products;return d&&Object.keys(d).forEach((e=>{var t;const i=null===(t=d[e])||void 0===t?void 0:t.variants;i&&Object.keys(i).forEach((()=>o+=1))})),o>0&&i!==o}return!1})(p),onValueChange:function(e){k(e?{type:"selected",data:{id:p,val:C}}:{type:"unselected",data:{id:p}})}}),e.jsx("div",Object.assign({style:{width:40,height:40}},{children:e.jsx(i.default,{})})),e.jsx(v.TitleRegular,{children:"All Products"})]}),Object.keys((null==A?void 0:A.products)||[]).length?Object.keys(A.products||[]).map((t=>e.jsx(m,{collectionId:p,isProductPartiallyChecked:U(t),productId:t,data:A.products[t],selectedData:b,selectedCollectionsDispatch:k,viewOnly:!!F,upliftAdditions:H,hideProductCheckbox:D},t))):T?[1,2,3,4,5,6,7,8,9,10].map(((t,i)=>e.jsx("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(a.BikShimmer,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),i))):e.jsx(j.EmptyState,{title:"No products to show",subtitle:w.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),i=require("../../assets/icons/box.svg.js"),o=require("../../assets/icons/search.svg.js"),c=require("lodash"),s=require("react"),r=require("../tag/Tag.js"),d=require("../../constants/Theme.js"),l=require("../checkBox/CheckBox.js"),n=require("../icon-button/IconButton.js"),a=require("../input/Input.js"),u=require("../shimmer/ShimmerComponent/BikShimmer.js"),h=require("../shimmer-image/ShimmerImage.js"),p=require("../spinner/Spinner.js"),v=require("../TypographyStyle.js"),j=require("./collectionScreen.js"),x=require("./emptyState.js"),y=require("./helpers/ProductHelper.js"),g=require("./reducers.js"),C=require("./style.js"),m=require("./type.js"),b=require("./utility.js");const k=t=>{const{collectionId:i,productId:o,data:c,selectedData:s,selectedCollectionsDispatch:r,viewOnly:d,upliftAdditions:l,isProductPartiallyChecked:n,hideProductCheckbox:a,outOfStockAction:u,hideVariantCheckbox:h}=t,p=e=>{var t,c,r,d,l,n;if(!(null===(c=null===(t=null==s?void 0:s[i])||void 0===t?void 0:t.products)||void 0===c?void 0:c[o]))return!1;return!!(null===(n=null===(l=null===(d=null===(r=null==s?void 0:s[i])||void 0===r?void 0:r.products)||void 0===d?void 0:d[o])||void 0===l?void 0:l.variants)||void 0===n?void 0:n[e])};return e.jsxs("div",{children:[e.jsx(O,{isVariant:!1,data:c,productId:o,collectionId:i,isSelected:!!(null===(j=null===(v=null==s?void 0:s[i])||void 0===v?void 0:v.products)||void 0===j?void 0:j[o]),isPartiallyChecked:n,selectedCollectionsDispatch:r,upliftAdditions:l,viewOnly:d,hideProductCheckbox:a,hideVariantCheckbox:h},o),Object.keys(c.variants||[]).map((t=>e.jsx(O,{isVariant:!0,hideVariantCheckbox:h,data:c.variants[t],variantId:t,productId:o,viewOnly:d,upliftAdditions:l,collectionId:i,isSelected:p(t),selectedCollectionsDispatch:r,outOfStockAction:u},t)))]});var v,j},O=t=>{const{isVariant:i,data:o,productId:c,collectionId:s,variantId:d,isSelected:n,selectedCollectionsDispatch:a,viewOnly:u,upliftAdditions:p,isPartiallyChecked:x,hideProductCheckbox:g,outOfStockAction:m,hideVariantCheckbox:b}=t,k=y.ProductHelper.getProductLabels(o,m);return e.jsxs(C.ProductCardStyle,Object.assign({isVariant:i},{children:[i&&!u&&!b||!i&&!u&&!g?e.jsx(l.CheckBox,{isChecked:n,isPartiallyChecked:x||!1,onValueChange:function(e){i?e?p("variantSelected",{productId:c,variantId:d,collectionId:s,variant:o}):a({type:"variantUnselected",data:{productId:c,variantId:d,collectionId:s}}):e?p("productSelected",{productId:c,collectionId:s,product:o}):a({type:"productUnselected",data:{productId:c,collectionId:s}})}}):e.jsx(e.Fragment,{}),e.jsx("div",{children:e.jsx(h.ShimmerImage,{width:40,height:40,imageUrl:o.image,alt:"Item",borderRadius:4})}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[e.jsx(v.TitleRegular,{children:j.truncate(o.name,40,!0)}),k?e.jsx("div",Object.assign({style:{width:90,display:"flex"}},{children:e.jsx(r.Tag,{tagText:k,type:"warning",theme:"light"})})):e.jsx(e.Fragment,{})]}))]}))};exports.ProductCard=O,exports.ProductGroup=k,exports.ProductsScreen=r=>{const h=s.useContext(g.CollectionIdContext),{data:j,collectionsDispatch:y,selectedData:O,selectedCollectionsDispatch:f,productFetcher:I,storeId:S,setScreen:P,setSaveDisabled:q,hideInCollectionSearch:E,customCollectionRestriction:T,hideProductCheckbox:w,outOfStockAction:D=m.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:A=!1,selectProductsFromCustomCollection:B=!1}=r,[V,R]=s.useState(""),[F,U]=s.useState(!1),[_,H]=s.useState(j);s.useEffect((()=>{const e=setTimeout((()=>{V.length?(U(!0),r.searchInCollectionFetcher(S,h,V).then((e=>{var t;const i=c.cloneDeep(j);i.products={};for(const o of e)(null===(t=null==j?void 0:j.products)||void 0===t?void 0:t[o])&&(i.products[o]=j.products[o]);H(i),q(!1),U(!1)}))):H(j)}),800);return()=>clearTimeout(e)}),[V]);const L=!!T&&j.isSmartCollection,K=e=>{var t,i,o,c,s,r,d,l;let n=0,a=0;return!!((null===(i=null===(t=null==O?void 0:O[h])||void 0===t?void 0:t.products)||void 0===i?void 0:i[e])&&(null===(s=Object.keys((null===(c=null===(o=null==j?void 0:j.products)||void 0===o?void 0:o[e])||void 0===c?void 0:c.variants)||[]))||void 0===s||s.forEach((()=>a++)),Object.keys((null===(l=null===(d=null===(r=null==O?void 0:O[h])||void 0===r?void 0:r.products)||void 0===d?void 0:d[e])||void 0===l?void 0:l.variants)||[]).forEach((()=>n++)),n>0&&a!==n))};s.useEffect((()=>{(null==j?void 0:j.products)||N()}),[]);const N=()=>{q(!0),U(!0),I(h,S).then((e=>{Object.keys(e).length&&(y({type:"productsFetched",data:{collectionId:h,products:e}}),H(Object.assign(Object.assign({},_),{products:e}))),q(!1),U(!1)})).catch()},W=(e,t)=>{const i=b.liftTheStateUp(t,j);f({type:e,data:Object.assign(Object.assign({},i),{isRestricted:T})})};return e.jsxs("div",{children:[e.jsxs(C.ProductScreenHeader,{children:[e.jsx(n.IconButton,{Icon:t.default,height:16,onClick:()=>{P("collections")}}),e.jsx(v.BodyCaption,Object.assign({style:{color:d.COLORS.content.secondary}},{children:j.name}))]}),!E&&e.jsx("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(a.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>F&&V.length?e.jsx(p.Spinner,{size:"small",color:d.COLORS.content.primary}):e.jsx(o.default,{})},id:"listInput",height:"24px",type:"text",value:V,onChangeText:e=>{e.length&&e.trim().length?R(e):R("")},placeholder:"Search products in this collection..."})})),e.jsxs("div",{children:[Object.keys((null==_?void 0:_.products)||[]).length>0&&!L&&!V.length&&!w&&e.jsxs(C.ProductScreenCollectionCardStyle,{children:[e.jsx(l.CheckBox,{isChecked:!!(null==O?void 0:O[h]),isPartiallyChecked:(e=>{var t;let i=0,o=0;if(O[e]){const c=null==j?void 0:j.products;c&&Object.keys(c).forEach((e=>{var t;const o=null===(t=c[e])||void 0===t?void 0:t.variants;o&&Object.keys(o).forEach((e=>i+=1))}));const s=null===(t=O[e])||void 0===t?void 0:t.products;return s&&Object.keys(s).forEach((e=>{var t;const i=null===(t=s[e])||void 0===t?void 0:t.variants;i&&Object.keys(i).forEach((()=>o+=1))})),o>0&&i!==o}return!1})(h),onValueChange:function(e){f(e?{type:"selected",data:{id:h,val:j}}:{type:"unselected",data:{id:h}})}}),e.jsx("div",Object.assign({style:{width:40,height:40}},{children:e.jsx(i.default,{})})),e.jsx(v.TitleRegular,{children:"All Products"})]}),Object.keys((null==_?void 0:_.products)||[]).length?Object.keys(_.products||[]).map((t=>e.jsx(k,{outOfStockAction:D,collectionId:h,isProductPartiallyChecked:K(t),productId:t,data:_.products[t],selectedData:O,selectedCollectionsDispatch:f,viewOnly:!B&&!!L,upliftAdditions:W,hideProductCheckbox:w,hideVariantCheckbox:A},t))):F?[1,2,3,4,5,6,7,8,9,10].map(((t,i)=>e.jsx("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(u.BikShimmer,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),i))):e.jsx(x.EmptyState,{title:"No products to show",subtitle:V.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})]})]})};
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { SelectedItems } from '.';
3
+ import { SelectedCollectionsActions } from './reducers';
4
+ import { OUT_OF_STOCK_ACTION } from './type';
5
+ interface RearrangeScreenInterface {
6
+ selectedCollections: SelectedItems;
7
+ selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
8
+ setScreen: React.Dispatch<React.SetStateAction<string>>;
9
+ rearrangeViewType: 'grid' | 'list';
10
+ outOfStockAction?: OUT_OF_STOCK_ACTION;
11
+ }
12
+ /**
13
+ * Screen will be opened on two conditions -
14
+ * 1. When startupScreen is 'rearrange'- Here, this screen will be opened as beginning.
15
+ 2. When rearrangeAfterSelectionEnabled is true - Here instead of selected products screen, rearrange screen will be opened
16
+ */
17
+ export declare const RearrangeScreen: (props: RearrangeScreenInterface) => import("react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("react"),s=require("react-beautiful-dnd"),c=require("../../constants/Theme.js"),n=require("../icon-button/IconButton.js"),i=require("../TypographyStyle.js"),o=require("./emptyState.js"),a=require("./helpers/ProductHelper.js"),l=require("./style.js"),d=require("./variantComponents.js");exports.RearrangeScreen=u=>{const{selectedCollections:p,selectedCollectionsDispatch:j,setScreen:S,rearrangeViewType:h,outOfStockAction:y}=u,[x,q]=r.useState(a.parseSelectedVariantsToArray(p));r.useEffect((()=>{q(a.parseSelectedVariantsToArray(p))}),[p]);return e.jsxs(s.DragDropContext,Object.assign({onDragEnd:e=>{if(!e.destination)return;const t=x,[r]=t.splice(e.source.index,1);t.splice(e.destination.index,0,r),t.forEach(((e,t)=>{e.displayOrder=t})),q(t)}},{children:[e.jsxs(l.SelectedScreenHeader,{children:[e.jsx(n.IconButton,{Icon:t.default,width:16,height:16,color:c.COLORS.content.secondary,onClick:()=>{S("collections")}}),e.jsx(i.BodyCaption,Object.assign({color:c.COLORS.content.secondary},{children:"All Products"}))]}),Object.keys(p).length>0?"list"===h?e.jsx(d.VariantsList,{selectedVariants:x,setSelectedVariants:q,selectedCollectionsDispatch:j,outOfStockAction:y}):e.jsx(d.VariantsGrid,{selectedVariants:x,setSelectedVariants:q,selectedCollectionsDispatch:j}):e.jsx(o.EmptyState,{title:"No Products Selected",subtitle:"Selected products will appear here"})]}))};
@@ -12,3 +12,6 @@ export declare const ProductCardStyle: import("styled-components").StyledCompone
12
12
  }, never>;
13
13
  export declare const SelectedScreenHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
14
14
  export declare const CollectionNameHolder: import("styled-components").StyledComponent<"div", any, {}, never>;
15
+ export declare const VariantCardListStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
16
+ export declare const VariantCardGridStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
17
+ export declare const StyledHeaderRightIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(e);const l=i.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(e);const o=l.default.div`
2
2
  display: flex;
3
3
  background-color: white;
4
4
  max-height: 600px;
5
5
  min-height: 600px;
6
6
  flex-direction: column;
7
- `,r=i.default.div`
7
+ `,r=l.default.div`
8
8
  overflow-y: scroll;
9
9
  overflow-x: hidden;
10
- `,n=i.default.div`
10
+ `,d=l.default.div`
11
11
  height: 64px;
12
12
  background-color: ${e=>e.isDisabled?"#F0F0F0":"white"};
13
13
  border-bottom: 1px solid #e0e0e0;
@@ -17,17 +17,17 @@
17
17
  column-gap: 16px;
18
18
  justify-content: space-between;
19
19
  align-items: center;
20
- `,d=i.default.div`
20
+ `,n=l.default.div`
21
21
  display: flex;
22
22
  flex-direction: row;
23
23
  justify-content: center;
24
24
  align-items: center;
25
25
  column-gap: 18px;
26
- `,a=i.default.div`
26
+ `,a=l.default.div`
27
27
  display: flex;
28
28
  flex-direction: column;
29
29
  justify-content: center;
30
- `,c=i.default.div`
30
+ `,p=l.default.div`
31
31
  display: flex;
32
32
  flex-direction: row;
33
33
  max-height: 32px;
@@ -37,14 +37,14 @@
37
37
  align-items: center;
38
38
  padding: 8px 16px;
39
39
  margin-top: 16px;
40
- `,x=i.default.div`
40
+ `,x=l.default.div`
41
41
  display: flex;
42
42
  flex-direction: row;
43
43
  column-gap: 16px;
44
44
  padding: 12px 16px;
45
45
  border-bottom: 1px solid #e0e0e0;
46
46
  align-items: center;
47
- `,p=i.default.div`
47
+ `,c=l.default.div`
48
48
  height: 64px;
49
49
  background-color: white;
50
50
  border-bottom: 1px solid #e0e0e0;
@@ -55,7 +55,7 @@
55
55
  justify-content: flex-start;
56
56
  align-items: center;
57
57
  padding-left: ${e=>e.isVariant?"42px":"16px"};
58
- `,s=i.default.div`
58
+ `,s=l.default.div`
59
59
  display: flex;
60
60
  flex-direction: row;
61
61
  max-height: 32px;
@@ -64,7 +64,39 @@
64
64
  justify-content: flex-start;
65
65
  align-items: center;
66
66
  padding: 8px 16px;
67
- `,f=i.default.div`
67
+ `,f=l.default.div`
68
68
  display: flex;
69
69
  flex-direction: column;
70
- `;exports.CollectionCardDetailStyle=a,exports.CollectionCardInfoStyle=d,exports.CollectionCardStyle=n,exports.CollectionNameHolder=f,exports.ContainerStyle=l,exports.ProductCardStyle=p,exports.ProductScreenCollectionCardStyle=x,exports.ProductScreenHeader=c,exports.ScrollContainerStyle=r,exports.SelectedScreenHeader=s;
70
+ `,u=l.default.div`
71
+ height: 72px;
72
+ background: white;
73
+ padding: 12px 16px;
74
+ display: flex;
75
+ flex-direction: row;
76
+ gap: 16px;
77
+ align-items: center;
78
+ justify-content: center;
79
+
80
+ .tooltip-title-tag {
81
+ display: flex;
82
+ flex: 1;
83
+ flex-direction: column;
84
+ gap: 2px;
85
+ }
86
+ `,g=l.default.div`
87
+ height: 72px;
88
+ width: 72px;
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+ margin: 16px;
93
+ `;l.default.div`
94
+ display: flex;
95
+ width: 32px;
96
+ height: 32px;
97
+ padding: 6px;
98
+ justify-content: center;
99
+ align-items: center;
100
+ border: 1px solid ${t.COLORS.stroke.primary};
101
+ border-radius: 4px;
102
+ `,exports.CollectionCardDetailStyle=a,exports.CollectionCardInfoStyle=n,exports.CollectionCardStyle=d,exports.CollectionNameHolder=f,exports.ContainerStyle=o,exports.ProductCardStyle=c,exports.ProductScreenCollectionCardStyle=x,exports.ProductScreenHeader=p,exports.ScrollContainerStyle=r,exports.SelectedScreenHeader=s,exports.VariantCardGridStyle=g,exports.VariantCardListStyle=u;
@@ -0,0 +1,6 @@
1
+ export declare enum OUT_OF_STOCK_ACTION {
2
+ HIDE = "HIDE",
3
+ NORMAL = "NORMAL",
4
+ /** @description shows OOS label */
5
+ BLUR = "BLUR"
6
+ }
@@ -0,0 +1 @@
1
+ "use strict";var O;Object.defineProperty(exports,"__esModule",{value:!0}),exports.OUT_OF_STOCK_ACTION=void 0,(O=exports.OUT_OF_STOCK_ACTION||(exports.OUT_OF_STOCK_ACTION={})).HIDE="HIDE",O.NORMAL="NORMAL",O.BLUR="BLUR";
@@ -0,0 +1,32 @@
1
+ /// <reference types="react" />
2
+ import { ProductVariant } from './modal';
3
+ import { SelectedCollectionsActions } from './reducers';
4
+ import { OUT_OF_STOCK_ACTION } from './type';
5
+ /**
6
+ * Extended type from Product Variant, which contains ids and name.
7
+ */
8
+ export type ProductVariantForRearrange = ProductVariant & {
9
+ variantId: string;
10
+ productId: string;
11
+ collectionId: string;
12
+ productName: string;
13
+ };
14
+ /**
15
+ * Props type for variant card in rearrange screen
16
+ */
17
+ export interface VariantCardInterface {
18
+ data: ProductVariantForRearrange;
19
+ selectedCollectionsDispatch?: React.Dispatch<SelectedCollectionsActions>;
20
+ outOfStockAction?: OUT_OF_STOCK_ACTION;
21
+ onDelete?: () => void;
22
+ }
23
+ /**
24
+ * Variant card in list view format.
25
+ * Displays image, name and delete icon
26
+ */
27
+ export declare const VariantCardListView: (props: VariantCardInterface) => import("react/jsx-runtime").JSX.Element;
28
+ /**
29
+ * Variant card in grid view format.
30
+ * Displays only image
31
+ */
32
+ export declare const VariantCardGridView: (props: VariantCardInterface) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/delete.svg.js"),r=require("../../assets/icons/drag_handle.svg.js"),i=require("../../constants/Theme.js"),a=require("../icon-button/IconButton.js"),s=require("../shimmer-image/ShimmerImage.js"),l=require("../TypographyStyle.js"),n=require("./collectionScreen.js"),o=require("./helpers/ProductHelper.js"),d=require("./style.js"),c=require("../tooltips/Tooltip.js"),u=require("../tag/Tag.js");exports.VariantCardGridView=t=>{const{data:r}=t;return e.jsx(d.VariantCardGridStyle,{children:e.jsx(c.Tooltip,Object.assign({body:r.name,alwaysVisible:!1,variant:"dark",placement:"bottom"},{children:e.jsx(s.ShimmerImage,{width:72,height:72,imageUrl:r.image,alt:"Item",borderRadius:4})}))})},exports.VariantCardListView=h=>{const{data:m,selectedCollectionsDispatch:j,outOfStockAction:g}=h,p=o.ProductHelper.getProductLabels(m,g),x=e=>{let t;return t=m.name.includes(m.productName)?m.name:`${m.productName} ${m.name}`,e?n.truncate(t,34,!0):t};return e.jsxs(d.VariantCardListStyle,{children:[e.jsx(r.default,{width:24,height:24,color:i.COLORS.content.placeholder}),e.jsx("div",{children:e.jsx(s.ShimmerImage,{width:40,height:40,imageUrl:m.image,alt:"Item",borderRadius:4},m.variantId)}),e.jsxs("div",Object.assign({className:"tooltip-title-tag"},{children:[e.jsx(c.Tooltip,Object.assign({body:x(!1),placement:"bottom",delay:400},{children:e.jsx(l.TitleRegular,{children:x(!0)})})),p?e.jsx("div",Object.assign({style:{width:90,display:"flex"}},{children:e.jsx(u.Tag,{tagText:p,type:"warning",theme:"light"})})):e.jsx(e.Fragment,{})]})),e.jsx(a.IconButton,{Icon:()=>e.jsx(t.default,{width:24,height:24,color:i.COLORS.content.placeholder}),onClick:()=>{j&&j({type:"variantUnselected",data:{productId:m.productId,variantId:m.variantId,collectionId:m.collectionId}}),h.onDelete&&h.onDelete()}})]})};
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { SelectedCollectionsActions } from './reducers';
3
+ import { OUT_OF_STOCK_ACTION } from './type';
4
+ import { ProductVariantForRearrange } from './variant';
5
+ /**
6
+ * Props for list of variants - applicable both in list and grid view
7
+ */
8
+ export type VariantsComponentProps = {
9
+ selectedVariants: ProductVariantForRearrange[];
10
+ setSelectedVariants: React.Dispatch<React.SetStateAction<ProductVariantForRearrange[]>>;
11
+ selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
12
+ outOfStockAction?: OUT_OF_STOCK_ACTION;
13
+ };
14
+ /**
15
+ * Returns a react component of variants list, which are eligible to drag and drop.
16
+ */
17
+ export declare const VariantsList: ({ selectedVariants, setSelectedVariants, selectedCollectionsDispatch, outOfStockAction, }: VariantsComponentProps) => import("react/jsx-runtime").JSX.Element;
18
+ /**
19
+ * Returns a react component of variants grid, which are eligible to drag and drop.
20
+ */
21
+ export declare const VariantsGrid: ({ selectedVariants }: VariantsComponentProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),a=require("react-beautiful-dnd"),s=require("../../constants/Theme.js"),t=require("./variant.js");exports.VariantsGrid=r=>{let{selectedVariants:s}=r;return e.jsx(a.Droppable,Object.assign({droppableId:"droppable-horizontal"},{children:r=>e.jsxs("div",Object.assign({},r.droppableProps,{ref:r.innerRef,style:Object.assign(Object.assign({},r.droppableProps.style),{display:"flex"})},{children:[e.jsx(a.Droppable,Object.assign({droppableId:"droppable-vertical",direction:"horizontal"},{children:r=>e.jsxs("div",Object.assign({},r.droppableProps,{ref:r.innerRef,style:Object.assign(Object.assign({},r.droppableProps.style),{display:"flex",flexWrap:"wrap",flexDirection:"row"})},{children:[s.map(((r,s)=>e.jsx(a.Draggable,Object.assign({draggableId:`${r.productId}-${r.variantId}`,index:s},{children:(a,s)=>e.jsxs("div",Object.assign({ref:a.innerRef},a.draggableProps,a.dragHandleProps,{children:[e.jsx(t.VariantCardGridView,{data:r}),a.placeholder]}))}),`${r.productId}-${r.variantId}`))),r.placeholder]}))})),r.placeholder]}))}))},exports.VariantsList=i=>{let{selectedVariants:n,setSelectedVariants:d,selectedCollectionsDispatch:l,outOfStockAction:o}=i;const[p,c]=r.useState(-1);function b(e){if(null==e?void 0:e.transform){const r=`translate(0px, ${e.transform.split(",").pop()}`;return Object.assign(Object.assign({},e),{transform:r})}return e}return e.jsx(a.Droppable,Object.assign({droppableId:"droppable-list"},{children:(r,i)=>e.jsxs("div",Object.assign({},r.droppableProps,{ref:r.innerRef,style:Object.assign({backgroundColor:s.COLORS.surface.subdued,padding:"0.05px",height:n.length<8?"550px":"100%"},r.droppableProps.style)},{children:[n.map(((r,i)=>e.jsx("div",Object.assign({style:{background:s.COLORS.surface.hovered,margin:"5px",boxShadow:i===p?"0px 4px 12px rgba(0, 0, 0, 0.12)":""},onMouseEnter:()=>c(i),onMouseLeave:()=>c(-1)},{children:e.jsx(a.Draggable,Object.assign({draggableId:`${r.productId}-${r.variantId}`,index:i},{children:(a,s)=>e.jsx("div",Object.assign({ref:a.innerRef},a.draggableProps,a.dragHandleProps,{style:b(Object.assign(Object.assign({},a.draggableProps.style),a.draggableSnapshot))},{children:e.jsx(t.VariantCardListView,{data:r,selectedCollectionsDispatch:l,onDelete:()=>{const e=n.slice();e[i].displayOrder=null,e.splice(i,1),d(e)},outOfStockAction:o},`${r.productId}-${r.variantId}`)}))}),`${r.productId}-${r.variantId}`)}),`${r.productId}-${r.variantId}`))),r.placeholder&&i.isDraggingOver?e.jsx("div",Object.assign({style:{background:s.COLORS.surface.hovered,margin:"5px"}},{children:r.placeholder})):null]}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react-dom"),o=require("../../assets/icons/cross.svg.js"),r=require("../button/Button.js"),s=require("../TypographyStyle.js"),i=require("./SideModal.style.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=n(t);exports.SideModal=t=>d.default.createPortal(e.jsx(i.SideModalStyle,Object.assign({zIndex:t.zIndex},{children:e.jsxs(i.SideModalContainer,{children:[e.jsxs(i.SideModalHeader,{children:[e.jsx(s.TitleMedium,{children:t.header}),!t.hideCrossButton&&e.jsx(o.default,{width:24,height:24,onClick:t.onClose})]}),e.jsx(i.SideModalBody,{children:t.children}),e.jsxs(i.SideModalFooter,Object.assign({footerDirection:t.footerDirection},{children:[e.jsxs(i.FooterButtonWrapper,Object.assign({footerDirection:t.footerDirection},{children:[e.jsx(r.Button,Object.assign({},t.saveButtonProps)),e.jsx(r.Button,Object.assign({},t.cancelButtonProps))]})),t.footerCustomComponent?t.footerCustomComponent:e.jsx(e.Fragment,{})]}))]})})),document.body);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react-dom"),o=require("../../assets/icons/cross.svg.js"),r=require("../button/Button.js"),s=require("../TypographyStyle.js"),i=require("./SideModal.style.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=n(t);exports.SideModal=t=>d.default.createPortal(e.jsx(i.SideModalStyle,Object.assign({zIndex:t.zIndex},{children:e.jsxs(i.SideModalContainer,Object.assign({width:t.width},{children:[e.jsxs(i.SideModalHeader,{children:[e.jsx(s.TitleMedium,{children:t.header}),!t.hideCrossButton&&e.jsx(o.default,{width:24,height:24,onClick:t.onClose})]}),e.jsx(i.SideModalBody,{children:t.children}),e.jsxs(i.SideModalFooter,Object.assign({footerDirection:t.footerDirection},{children:[e.jsxs(i.FooterButtonWrapper,Object.assign({footerDirection:t.footerDirection},{children:[e.jsx(r.Button,Object.assign({},t.saveButtonProps)),e.jsx(r.Button,Object.assign({},t.cancelButtonProps))]})),t.footerCustomComponent?t.footerCustomComponent:e.jsx(e.Fragment,{})]}))]}))})),document.body);
@@ -0,0 +1 @@
1
+ export * from './slider';
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ export interface SliderBikProps {
3
+ min: number;
4
+ max: number;
5
+ defaultValue: number;
6
+ onChange: (event: Event) => void;
7
+ step?: number;
8
+ disabled?: boolean;
9
+ }
10
+ export declare const BikSlider: React.FC<SliderBikProps>;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../constants/Theme.js"),a=require("../../node_modules/@mui/material/styles/styled.js"),o=require("../../node_modules/@mui/material/Slider/Slider.js");const d=a.default(o.default)({marginTop:"30px",color:r.COLORS.background.brand,height:8,"& .MuiSlider-track":{border:"none"},"& .MuiSlider-thumb":{height:24,width:24,backgroundColor:r.COLORS.background.brand,border:`2px solid ${r.COLORS.background.brand}`,"&:hover":{boxShadow:"0px 0px 0px 8px rgba(115, 29, 207, 0.08)"},"&:focused":{boxShadow:"0px 0px 0px 8px rgba(115, 29, 207, 0.33)"},"&.Mui-active":{boxShadow:"0px 0px 0px 8px rgba(115, 29, 207, 0.5)"},"&.Mui-focusVisible":{boxShadow:"0px 0px 0px 8px rgba(115, 29, 207, 0.08)"},"&:before":{display:"none"}},"& .MuiSlider-valueLabel":{lineHeight:1.2,fontSize:12,background:"unset",padding:0,width:32,height:32,borderRadius:"50% 50% 50% 0",backgroundColor:r.COLORS.background.brand,transformOrigin:"bottom left",transform:"translate(50%, -100%) rotate(-45deg) scale(0)","&:before":{display:"none"},"&.MuiSlider-valueLabelOpen":{transform:"translate(50%, -100%) rotate(-45deg) scale(1)"},"& > *":{transform:"rotate(45deg)"}}});exports.BikSlider=r=>{let{min:a,max:o,defaultValue:i,onChange:t,step:l=1,disabled:n=!1}=r;return e.jsx(d,{valueLabelDisplay:"auto","aria-label":"bik slider",value:i,min:a,max:o,onChange:t,step:l,disabled:n})};
@@ -8,4 +8,5 @@ export declare const Star: React.FC<{
8
8
  onHover?: (hovered: boolean) => void;
9
9
  /** this means this star is hovered-active cause there is a star hovered after this */
10
10
  asHovered?: boolean;
11
+ mode?: 'VIEW' | 'EDIT';
11
12
  }>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../constants/Theme.js"),o=require("../../assets/icons/starEmpty.svg.js"),s=require("../../assets/icons/starFilled.svg.js");exports.Star=l=>{let{size:n,filled:u,emptyColor:i,filledColor:a,onClick:c,asHovered:d,onHover:h}=l;const[v,g]=r.useState(!1);return r.useEffect((()=>{null==h||h(v)}),[v]),d?e.jsx(s.default,{onClick:()=>{null==c||c("select")},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),style:{cursor:"pointer"},width:n,height:n,color:null!=a?a:t.COLORS.background.warning.vibrant}):v?e.jsx(s.default,{onMouseLeave:()=>g(!1),style:{cursor:"pointer"},onClick:()=>{null==c||c("select")},width:n,height:n,color:null!=a?a:t.COLORS.background.warning.vibrant}):u?e.jsx(s.default,{onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),style:{cursor:"pointer"},onClick:()=>{null==c||c("de-select")},width:n,height:n,color:null!=a?a:t.COLORS.background.warning.vibrant}):e.jsx(o.default,{onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),style:{cursor:"pointer"},onClick:()=>{null==c||c("select")},width:n,height:n,color:null!=i?i:t.COLORS.surface.standard})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../constants/Theme.js"),o=require("../../assets/icons/starEmpty.svg.js"),s=require("../../assets/icons/starFilled.svg.js");exports.Star=l=>{let{size:n,filled:u,emptyColor:i,filledColor:a,onClick:c,asHovered:d,onHover:E,mode:f}=l;const[h,v]=r.useState(!1);return r.useEffect((()=>{null==E||E(h)}),[h]),r.useEffect((()=>{d||v(!1)}),[d]),d?e.jsx(s.default,{onClick:()=>{null==c||c("select")},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),style:{cursor:"pointer"},width:n,height:n,color:null!=a?a:t.COLORS.background.warning.vibrant}):h?e.jsx(s.default,{onMouseLeave:()=>v(!1),onMouseEnter:()=>v(!0),style:{cursor:"pointer"},onClick:()=>{null==c||c("select")},width:n,height:n,color:null!=a?a:t.COLORS.background.warning.vibrant}):u?e.jsx(s.default,{onMouseEnter:()=>"VIEW"!==f&&v(!0),onMouseLeave:()=>"VIEW"!==f&&v(!1),style:{cursor:"VIEW"!==f?"pointer":"default"},onClick:()=>{"VIEW"!==f&&(null==c||c("de-select"))},width:n,height:n,color:null!=a?a:t.COLORS.background.warning.vibrant}):e.jsx(o.default,{onMouseEnter:()=>"VIEW"!==f&&v(!0),onMouseLeave:()=>"VIEW"!==f&&v(!1),style:{cursor:"VIEW"!==f?"pointer":"default"},onClick:()=>{"VIEW"!==f&&(null==c||c("select"))},width:n,height:n,color:null!=i?i:t.COLORS.surface.standard})};
@@ -6,4 +6,5 @@ export declare const StarRating: React.FC<{
6
6
  value?: number;
7
7
  maxValue?: number;
8
8
  starSize?: number;
9
+ mode?: 'VIEW' | 'EDIT';
9
10
  }>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var I=require("@emotion/styled/base"),g=require("react/jsx-runtime"),C=require("react"),A=require("./Star.js");function c(I){return I&&"object"==typeof I&&"default"in I?I:{default:I}}const e=c(I).default("div","production"===process.env.NODE_ENV?{target:"e1yh3w250"}:{target:"e1yh3w250",label:"Container"})("production"===process.env.NODE_ENV?{name:"31c8wb",styles:"display:flex;flex-direction:row;gap:12px;justify-content:start;align-items:center"}:{name:"31c8wb",styles:"display:flex;flex-direction:row;gap:12px;justify-content:start;align-items:center",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlN0YXJSYXRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUk2QiIsImZpbGUiOiJTdGFyUmF0aW5nLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4IH0gZnJvbSBcInJlYWN0L2pzeC1ydW50aW1lXCI7XHJcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgdXNlRWZmZWN0LCB1c2VNZW1vLCB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgU3RhciB9IGZyb20gJy4vU3Rhcic7XHJcbmNvbnN0IENvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHRmbGV4LWRpcmVjdGlvbjogcm93O1xuXHRnYXA6IDEycHg7XG5cdGp1c3RpZnktY29udGVudDogc3RhcnQ7XG5cdGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xyXG5leHBvcnQgY29uc3QgU3RhclJhdGluZyA9ICh7IGVtcHR5Q29sb3IsIGZpbGxlZENvbG9yLCBvbkNoYW5nZSwgdmFsdWUsIG1heFZhbHVlLCBzdGFyU2l6ZSB9KSA9PiB7XHJcbiAgICBjb25zdCBbc3RhcnMsIHNldFN0YXJzXSA9IHVzZVN0YXRlKHZhbHVlICE9PSBudWxsICYmIHZhbHVlICE9PSB2b2lkIDAgPyB2YWx1ZSA6IDApO1xyXG4gICAgY29uc3QgW2hvdmVyZWRTdGFyLCBzZXRIb3ZlcmVkU3Rhcl0gPSB1c2VTdGF0ZSgwKTtcclxuICAgIGNvbnN0IGFyciA9IHVzZU1lbW8oKCkgPT4ge1xyXG4gICAgICAgIGNvbnN0IGxpbWl0ID0gbWF4VmFsdWUgIT09IG51bGwgJiYgbWF4VmFsdWUgIT09IHZvaWQgMCA/IG1heFZhbHVlIDogNTtcclxuICAgICAgICByZXR1cm4gQXJyYXkobGltaXQpXHJcbiAgICAgICAgICAgIC5maWxsKG51bGwpXHJcbiAgICAgICAgICAgIC5tYXAoKF8sIGlkeCkgPT4gaWR4ICsgMSk7XHJcbiAgICB9LCBbbWF4VmFsdWVdKTtcclxuICAgIHVzZUVmZmVjdCgoKSA9PiB7XHJcbiAgICAgICAgb25DaGFuZ2Uoc3RhcnMpO1xyXG4gICAgfSwgW3N0YXJzXSk7XHJcbiAgICByZXR1cm4gKF9qc3goQ29udGFpbmVyLCB7IGNoaWxkcmVuOiBhcnIubWFwKChpZHgpID0+IChfanN4KFN0YXIsIHsgYXNIb3ZlcmVkOiBob3ZlcmVkU3RhciA/IGlkeCA8PSBob3ZlcmVkU3RhciA6IHVuZGVmaW5lZCwgc2l6ZTogc3RhclNpemUgIT09IG51bGwgJiYgc3RhclNpemUgIT09IHZvaWQgMCA/IHN0YXJTaXplIDogMjQsIGZpbGxlZDogaG92ZXJlZFN0YXIgPyB1bmRlZmluZWQgOiBpZHggPD0gc3RhcnMsIGVtcHR5Q29sb3I6IGVtcHR5Q29sb3IsIGZpbGxlZENvbG9yOiBmaWxsZWRDb2xvciwgb25DbGljazogKGFjdGlvbikgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKGFjdGlvbiA9PT0gJ2RlLXNlbGVjdCcpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoaWR4IDwgc3RhcnMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhcnMoaWR4KTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFN0YXJzKGlkeCAtIDEpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHNldFN0YXJzKGlkeCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0sIG9uSG92ZXI6IChob3ZlcmVkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaG92ZXJlZClcclxuICAgICAgICAgICAgICAgICAgICBzZXRIb3ZlcmVkU3RhcihpZHgpO1xyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2V0SG92ZXJlZFN0YXIoMCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0gfSwgaWR4KSkpIH0pKTtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9U3RhclJhdGluZy5qcy5tYXAiXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}});exports.StarRating=I=>{let{emptyColor:c,filledColor:l,onChange:t,value:b,maxValue:i,starSize:a}=I;const[s,o]=C.useState(null!=b?b:0),[n,G]=C.useState(0),Z=C.useMemo((()=>Array(null!=i?i:5).fill(null).map(((I,g)=>g+1))),[i]);return C.useEffect((()=>{t(s)}),[s]),g.jsx(e,{children:Z.map((I=>g.jsx(A.Star,{asHovered:n?I<=n:void 0,size:null!=a?a:24,filled:n?void 0:I<=s,emptyColor:c,filledColor:l,onClick:g=>{o("de-select"===g?I<s?I:I-1:I)},onHover:g=>{G(g?I:0)}},I)))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var g=require("@emotion/styled/base"),I=require("react/jsx-runtime"),C=require("react"),A=require("./Star.js");function c(g){return g&&"object"==typeof g&&"default"in g?g:{default:g}}const e=c(g).default("div","production"===process.env.NODE_ENV?{target:"e1yh3w250"}:{target:"e1yh3w250",label:"Container"})("production"===process.env.NODE_ENV?{name:"31c8wb",styles:"display:flex;flex-direction:row;gap:12px;justify-content:start;align-items:center"}:{name:"31c8wb",styles:"display:flex;flex-direction:row;gap:12px;justify-content:start;align-items:center",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlN0YXJSYXRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUk2QiIsImZpbGUiOiJTdGFyUmF0aW5nLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4IH0gZnJvbSBcInJlYWN0L2pzeC1ydW50aW1lXCI7XHJcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgdXNlRWZmZWN0LCB1c2VNZW1vLCB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgU3RhciB9IGZyb20gJy4vU3Rhcic7XHJcbmNvbnN0IENvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHRmbGV4LWRpcmVjdGlvbjogcm93O1xuXHRnYXA6IDEycHg7XG5cdGp1c3RpZnktY29udGVudDogc3RhcnQ7XG5cdGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xyXG5leHBvcnQgY29uc3QgU3RhclJhdGluZyA9ICh7IGVtcHR5Q29sb3IsIGZpbGxlZENvbG9yLCBvbkNoYW5nZSwgdmFsdWUsIG1heFZhbHVlLCBzdGFyU2l6ZSwgbW9kZSwgfSkgPT4ge1xyXG4gICAgY29uc3QgW3N0YXJzLCBzZXRTdGFyc10gPSB1c2VTdGF0ZSh2YWx1ZSAhPT0gbnVsbCAmJiB2YWx1ZSAhPT0gdm9pZCAwID8gdmFsdWUgOiAwKTtcclxuICAgIGNvbnN0IFttb3VudGVkLCBzZXRNb3VudGVkRmxhZ10gPSB1c2VTdGF0ZShmYWxzZSk7XHJcbiAgICBjb25zdCBbaG92ZXJlZFN0YXIsIHNldEhvdmVyZWRTdGFyXSA9IHVzZVN0YXRlKDApO1xyXG4gICAgY29uc3QgYXJyID0gdXNlTWVtbygoKSA9PiB7XHJcbiAgICAgICAgY29uc3QgbGltaXQgPSBtYXhWYWx1ZSAhPT0gbnVsbCAmJiBtYXhWYWx1ZSAhPT0gdm9pZCAwID8gbWF4VmFsdWUgOiA1O1xyXG4gICAgICAgIHJldHVybiBBcnJheShsaW1pdClcclxuICAgICAgICAgICAgLmZpbGwobnVsbClcclxuICAgICAgICAgICAgLm1hcCgoXywgaWR4KSA9PiBpZHggKyAxKTtcclxuICAgIH0sIFttYXhWYWx1ZV0pO1xyXG4gICAgdXNlRWZmZWN0KCgpID0+IHtcclxuICAgICAgICBpZiAobW91bnRlZCkge1xyXG4gICAgICAgICAgICBvbkNoYW5nZShzdGFycyk7XHJcbiAgICAgICAgfVxyXG4gICAgfSwgW3N0YXJzXSk7XHJcbiAgICB1c2VFZmZlY3QoKCkgPT4ge1xyXG4gICAgICAgIHNldE1vdW50ZWRGbGFnKHRydWUpO1xyXG4gICAgfSwgW10pO1xyXG4gICAgcmV0dXJuIChfanN4KENvbnRhaW5lciwgeyBjaGlsZHJlbjogYXJyLm1hcCgoaWR4KSA9PiAoX2pzeChTdGFyLCB7IGFzSG92ZXJlZDogaG92ZXJlZFN0YXIgPyBpZHggPD0gaG92ZXJlZFN0YXIgOiBmYWxzZSwgc2l6ZTogc3RhclNpemUgIT09IG51bGwgJiYgc3RhclNpemUgIT09IHZvaWQgMCA/IHN0YXJTaXplIDogMjQsIGZpbGxlZDogaG92ZXJlZFN0YXIgPyB1bmRlZmluZWQgOiBpZHggPD0gc3RhcnMsIGVtcHR5Q29sb3I6IGVtcHR5Q29sb3IsIGZpbGxlZENvbG9yOiBmaWxsZWRDb2xvciwgb25DbGljazogKGFjdGlvbikgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKGFjdGlvbiA9PT0gJ2RlLXNlbGVjdCcpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoaWR4IDwgc3RhcnMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhcnMoaWR4KTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFN0YXJzKGlkeCAtIDEpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHNldFN0YXJzKGlkeCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0sIG9uSG92ZXI6IChob3ZlcmVkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaG92ZXJlZClcclxuICAgICAgICAgICAgICAgICAgICBzZXRIb3ZlcmVkU3RhcihpZHgpO1xyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2V0SG92ZXJlZFN0YXIoMCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0sIG1vZGU6IG1vZGUgfSwgaWR4KSkpIH0pKTtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9U3RhclJhdGluZy5qcy5tYXAiXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}});exports.StarRating=g=>{let{emptyColor:c,filledColor:l,onChange:t,value:i,maxValue:Z,starSize:b,mode:G}=g;const[a,X]=C.useState(null!=i?i:0),[s,o]=C.useState(!1),[d,n]=C.useState(0),u=C.useMemo((()=>Array(null!=Z?Z:5).fill(null).map(((g,I)=>I+1))),[Z]);return C.useEffect((()=>{s&&t(a)}),[a]),C.useEffect((()=>{o(!0)}),[]),I.jsx(e,{children:u.map((g=>I.jsx(A.Star,{asHovered:!!d&&g<=d,size:null!=b?b:24,filled:d?void 0:g<=a,emptyColor:c,filledColor:l,onClick:I=>{X("de-select"===I?g<a?g:g-1:g)},onHover:I=>{n(I?g:0)},mode:G},g)))})};
@@ -21,5 +21,9 @@ export interface TemplateContextMapperProps {
21
21
  showVariableModal?: boolean;
22
22
  variableList?: VariableListInterfaceV2[];
23
23
  onBackPress?: () => void;
24
+ discountCode?: string;
25
+ setDiscountCode?: (code: string) => void;
26
+ enabledCustomText?: boolean;
27
+ disableEditVariable?: boolean;
24
28
  }
25
- export declare const TemplateContextMapper: ({ selectedTemplate, closeDialog, showVariableMapping, channel, htmlContent, templateVariables, onTemplateSelect, globalPlaceholders, showOnlyContent, whatsappSpecificPickerMeta, zIndex, showVariableModal, variableList, onBackPress, }: TemplateContextMapperProps) => import("react/jsx-runtime").JSX.Element;
29
+ export declare const TemplateContextMapper: ({ selectedTemplate, closeDialog, showVariableMapping, channel, htmlContent, templateVariables, onTemplateSelect, globalPlaceholders, showOnlyContent, whatsappSpecificPickerMeta, zIndex, showVariableModal, variableList, discountCode, setDiscountCode, onBackPress, enabledCustomText, disableEditVariable, }: TemplateContextMapperProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("../../utils/StringUtils.js"),a=require("../modals/styledModal.js"),r=require("../template-preview/models/Channels.js"),s=require("./context/templateModalContext.js"),i=require("./modalElements/Footer.js"),o=require("./modalElements/TemplateSelectModalContent.js"),n=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=d=>{let{selectedTemplate:c,closeDialog:u,showVariableMapping:p,channel:m,htmlContent:h,templateVariables:g,onTemplateSelect:S,globalPlaceholders:v,showOnlyContent:b,whatsappSpecificPickerMeta:j,zIndex:M,showVariableModal:T,variableList:E,onBackPress:P}=d;var x,C;t.useEffect((()=>{q(h)}),[h]);const[L,f]=t.useState(m===r.CHANNEL_TYPE.EMAIL?"desktop":"mobile"),[w,q]=t.useState(h),[y,A]=t.useState(!1),[N,k]=t.useState(c),[V,_]=t.useState(null!=g?g:[]),[H,I]=t.useState(!1);const O=t.useMemo((()=>n.convertPlaceholdersToBikDropdown(v)),[v]);return e.jsx(s.TemplateModalContext.Provider,Object.assign({value:{template:N,setTemplate:k,device:L,setDevice:f,display_content:w,setDisplayContent:q,originalVariableList:V,setOriginalVariableList:_,isError:y,setIsError:A,channel:m,globalNormalizedPlaceholders:O,templateSelectionTriggered:H,setTemplateSelectionTriggered:I}},{children:b?e.jsx(o.default,{channel:r.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:M,centralContainerStyles:{width:m===r.CHANNEL_TYPE.EMAIL&&p?1e3:650},open:!0,onClose:()=>{null==u||u()},headingTitle:null==N?void 0:N.label,headingSubtitle:m===r.CHANNEL_TYPE.WHATSAPP?`${l.default.capitaliseFirstLetterOfString(null!==(x=null==N?void 0:N.category)&&void 0!==x?x:"")} • ${null!==(C=null==N?void 0:N.templateCategory)&&void 0!==C?C:""}`:"",onBackPress:()=>{null==P||P()}},{children:[e.jsx(o.default,{showVariableMapping:p,channel:m,whatsappSpecificPickerMeta:j,showVariableModal:T,variableList:E}),S?e.jsx(i.default,{onSelect:function(){const e=null==S?void 0:S(N,V,null!=w?w:"");e?A(!!e):I(!0)}}):e.jsx(e.Fragment,{})]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("../../utils/StringUtils.js"),a=require("../modals/styledModal.js"),s=require("../template-preview/models/Channels.js"),i=require("./context/templateModalContext.js"),o=require("./modalElements/Footer.js"),r=require("./modalElements/TemplateSelectModalContent.js"),n=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=d=>{let{selectedTemplate:c,closeDialog:u,showVariableMapping:p,channel:m,htmlContent:b,templateVariables:h,onTemplateSelect:C,globalPlaceholders:g,showOnlyContent:S,whatsappSpecificPickerMeta:T,zIndex:v,showVariableModal:E,variableList:j,discountCode:x,setDiscountCode:M,onBackPress:P,enabledCustomText:L,disableEditVariable:f}=d;var w,q;t.useEffect((()=>{V(b)}),[b]);const[y,A]=t.useState(m===s.CHANNEL_TYPE.EMAIL?"desktop":"mobile"),[N,V]=t.useState(b),[k,D]=t.useState(!1),[_,H]=t.useState(c),[I,O]=t.useState(null!=h?h:[]),[B,Y]=t.useState(!1);const z=t.useMemo((()=>n.convertPlaceholdersToBikDropdown(g)),[g]);return e.jsx(i.TemplateModalContext.Provider,Object.assign({value:{template:_,setTemplate:H,device:y,setDevice:A,display_content:N,setDisplayContent:V,originalVariableList:I,setOriginalVariableList:O,isError:k,setIsError:D,channel:m,globalNormalizedPlaceholders:z,templateSelectionTriggered:B,setTemplateSelectionTriggered:Y,enabledCustomText:L,disableEditVariable:f}},{children:S?e.jsx(r.default,{channel:s.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:v,centralContainerStyles:{width:m===s.CHANNEL_TYPE.EMAIL&&p?1e3:650},open:!0,onClose:()=>{null==u||u()},headingTitle:null==_?void 0:_.label,headingSubtitle:m===s.CHANNEL_TYPE.WHATSAPP?`${l.default.capitaliseFirstLetterOfString(null!==(w=null==_?void 0:_.category)&&void 0!==w?w:"")} • ${null!==(q=null==_?void 0:_.templateCategory)&&void 0!==q?q:""}`:"",onBackPress:()=>{null==P||P()}},{children:[e.jsx(r.default,{showVariableMapping:p,channel:m,whatsappSpecificPickerMeta:T,showVariableModal:E,variableList:j,discountCode:x,setDiscountCode:M}),C?e.jsx(o.default,{onSelect:function(){const e=null==C?void 0:C(_,I,null!=N?N:"");e?D(!!e):Y(!0)}}):e.jsx(e.Fragment,{})]}))}))};
@@ -21,6 +21,8 @@ export declare const TemplateModalContext: React.Context<{
21
21
  globalNormalizedPlaceholders?: globalNormalizedPlaceholdersType[] | undefined;
22
22
  templateSelectionTriggered: boolean;
23
23
  setTemplateSelectionTriggered?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
24
+ enabledCustomText?: boolean | undefined;
25
+ disableEditVariable?: boolean | undefined;
24
26
  }>;
25
27
  export declare const useTemplateModalContext: () => {
26
28
  device: DEVICE_TYPES;
@@ -38,4 +40,6 @@ export declare const useTemplateModalContext: () => {
38
40
  globalNormalizedPlaceholders?: globalNormalizedPlaceholdersType[] | undefined;
39
41
  templateSelectionTriggered: boolean;
40
42
  setTemplateSelectionTriggered?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
43
+ enabledCustomText?: boolean | undefined;
44
+ disableEditVariable?: boolean | undefined;
41
45
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../template-preview/models/Channels.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const r=l(e).default.createContext({device:"desktop",templateSelectionTriggered:!1,display_content:null,originalVariableList:[],channel:t.CHANNEL_TYPE.EMAIL,template:null,isError:!1});exports.TemplateModalContext=r,exports.useTemplateModalContext=()=>e.useContext(r);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../template-preview/models/Channels.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const a=l(e).default.createContext({device:"desktop",templateSelectionTriggered:!1,display_content:null,originalVariableList:[],channel:t.CHANNEL_TYPE.EMAIL,template:null,isError:!1,enabledCustomText:!1,disableEditVariable:!1});exports.TemplateModalContext=a,exports.useTemplateModalContext=()=>e.useContext(a);
@@ -6,6 +6,8 @@ export interface BodyProps {
6
6
  whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
7
7
  showVariableModal?: boolean;
8
8
  variableList?: VariableListInterfaceV2[];
9
+ discountCode?: string;
10
+ setDiscountCode?: (code: string) => void;
9
11
  }
10
12
  declare const Body: (props: BodyProps) => import("react/jsx-runtime").JSX.Element;
11
13
  export default Body;
@@ -1,18 +1,17 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("styled-components"),n=require("../../template-preview/models/Channels.js"),o=require("../../../constants/Theme.js"),i=require("../context/templateModalContext.js"),a=require("../utils/getVariableNameEmail.js"),r=require("../utils/highlightFor.js"),s=require("./DesktopPreview.js"),d=require("./EditWhatsAppTemplateV2.js"),u=require("./MobilePreview.js"),p=require("./VariableConnectorsPanel.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=c(l);const m=h.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("styled-components"),n=require("../../template-preview/models/Channels.js"),o=require("../../../constants/Theme.js"),i=require("../context/templateModalContext.js"),a=require("../utils/getVariableNameEmail.js"),r=require("../utils/highlightFor.js"),s=require("./DesktopPreview.js"),d=require("./EditWhatsAppTemplateV2.js"),u=require("./MobilePreview.js"),c=require("./VariableConnectorsPanel.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=p(l);const m=h.default.div`
2
2
  display: flex;
3
3
  // height: 100%;
4
4
  `,f=h.default.div`
5
5
  padding: 16px 14px;
6
- border-left-width: 1px;
7
- border-left-color: ${o.COLORS.stroke.primary};
8
6
  max-width: 350px;
9
7
 
10
8
  height: ${e=>e.channel===n.CHANNEL_TYPE.WHATSAPP?"500px":"475px"};
11
9
  overflow-y: 'auto';
12
10
  padding-bottom: 24px;
11
+ border-left: ${o.COLORS.stroke.primary} 1px solid;
13
12
  `,x=h.default.div`
14
13
  padding: ${e=>e.showOnlyContent?"16px 14px":"16px 32px"};
15
14
  flex: 1;
16
15
  height: 475px;
17
16
  overflow-y: auto;
18
- `;exports.default=l=>{const{showVariableMapping:c,showOnlyContent:h,whatsappSpecificPickerMeta:g,showVariableModal:v,variableList:b}=l,j=t.useRef(),w=t.useRef(),{device:E,display_content:y,channel:C,template:P,setTemplate:T}=i.useTemplateModalContext();const L=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e.jsxs(m,{children:[e.jsx(x,Object.assign({showOnlyContent:h,showVariableMapping:c},{children:"mobile"===E?e.jsx(u.default,{ref:w,display_content:null!=y?y:"",channel:C,template:P}):C!==n.CHANNEL_TYPE.MESSAGE?e.jsx(s.default,{ref:j,channel:C,display_content:null!=y?y:""}):e.jsx(e.Fragment,{})})),c&&e.jsx(f,Object.assign({channel:C},{children:C!==n.CHANNEL_TYPE.WHATSAPP?e.jsx(p.default,{onFocus:C===n.CHANNEL_TYPE.EMAIL?function(e){var t,l,i;const s=null===document||void 0===document?void 0:document.getElementById("mobile"===E?"template_html_mobile":"template_html_desktop"),d=a.getVariableNameForEmailByIndex(e+1),u=C===n.CHANNEL_TYPE.EMAIL?null===(t=null==s?void 0:s.contentWindow)||void 0===t?void 0:t.document.getElementById(d):document.getElementById(d),p=L(u),c=null==u?void 0:u.offsetLeft;"desktop"===E?p&&j.current&&(null===(l=null==s?void 0:s.contentWindow)||void 0===l||l.scrollTo(null!=c?c:0,p),r.highlightFor(d,o.COLORS.background.warning.light,2,C,E)):p&&w.current&&(null===(i=null==s?void 0:s.contentWindow)||void 0===i||i.scrollTo(null!=c?c:0,p),r.highlightFor(d,o.COLORS.background.warning.light,2,C,E))}:void 0,showVariableModal:v,variableList:b}):e.jsx(d.default,{whatsappSpecificPickerMeta:g,template:P,onTemplateChange:e=>{null==T||T(e)},showVariableModal:v,variableList:b})}))]})};
17
+ `;exports.default=l=>{const{showVariableMapping:p,showOnlyContent:h,whatsappSpecificPickerMeta:g,showVariableModal:v,variableList:b,discountCode:j,setDiscountCode:w}=l,C=t.useRef(),E=t.useRef(),{device:y,display_content:P,channel:T,template:L,setTemplate:M}=i.useTemplateModalContext();const _=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e.jsxs(m,{children:[e.jsx(x,Object.assign({showOnlyContent:h,showVariableMapping:p},{children:"mobile"===y?e.jsx(u.default,{ref:E,display_content:null!=P?P:"",channel:T,template:L}):T!==n.CHANNEL_TYPE.MESSAGE?e.jsx(s.default,{ref:C,channel:T,display_content:null!=P?P:""}):e.jsx(e.Fragment,{})})),p&&e.jsx(f,Object.assign({channel:T},{children:T!==n.CHANNEL_TYPE.WHATSAPP?e.jsx(c.default,{onFocus:T===n.CHANNEL_TYPE.EMAIL?function(e){var t,l,i;const s=null===document||void 0===document?void 0:document.getElementById("mobile"===y?"template_html_mobile":"template_html_desktop"),d=a.getVariableNameForEmailByIndex(e+1),u=T===n.CHANNEL_TYPE.EMAIL?null===(t=null==s?void 0:s.contentWindow)||void 0===t?void 0:t.document.getElementById(d):document.getElementById(d),c=_(u),p=null==u?void 0:u.offsetLeft;"desktop"===y?c&&C.current&&(null===(l=null==s?void 0:s.contentWindow)||void 0===l||l.scrollTo(null!=p?p:0,c),r.highlightFor(d,o.COLORS.background.warning.light,2,T,y)):c&&E.current&&(null===(i=null==s?void 0:s.contentWindow)||void 0===i||i.scrollTo(null!=p?p:0,c),r.highlightFor(d,o.COLORS.background.warning.light,2,T,y))}:void 0,showVariableModal:v,variableList:b,discountCode:j,setDiscountCode:w}):e.jsx(d.default,{whatsappSpecificPickerMeta:g,template:L,onTemplateChange:e=>{null==M||M(e)},showVariableModal:v,variableList:b})}))]})};
@@ -6,6 +6,7 @@ export interface EditMediaV2Props {
6
6
  isLoading?: boolean;
7
7
  mediaType?: HEADER_TYPES;
8
8
  handleImageChange?: () => void;
9
+ disableEditVariable?: boolean;
9
10
  }
10
11
  declare const EditMediaV2: (props: EditMediaV2Props) => import("react/jsx-runtime").JSX.Element;
11
12
  export default EditMediaV2;
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/document_pdf.svg.js"),i=require("../../../assets/icons/edit.svg.js"),s=require("../../../assets/icons/refresh.svg.js"),r=require("../../../assets/icons/video_camcorder.svg.js"),n=require("styled-components"),o=require("../../spinner/Spinner.js"),l=require("../../template-preview/models/TemplateMeta.js"),d=require("../../TypographyStyle.js"),a=require("../../../utils/StringUtils.js"),c=require("../../../constants/Theme.js"),h=require("./EditMediaV2.style.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const j=g(n).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/document_pdf.svg.js"),i=require("../../../assets/icons/edit.svg.js"),s=require("../../../assets/icons/refresh.svg.js"),r=require("../../../assets/icons/video_camcorder.svg.js"),n=require("styled-components"),o=require("../../spinner/Spinner.js"),l=require("../../template-preview/models/TemplateMeta.js"),a=require("../../TypographyStyle.js"),d=require("../../../utils/StringUtils.js"),c=require("../../../constants/Theme.js"),h=require("./EditMediaV2.style.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const j=g(n).default.div`
2
2
  padding-left: 14px;
3
3
  padding-right: 6px;
4
4
  width: 44px;
5
5
  height: 24px;
6
6
  border-left: 1px solid ${c.COLORS.stroke.primary};
7
7
  cursor: pointer;
8
- `;exports.default=n=>{const{imageName:g,error:u,isLoading:p,mediaType:x,handleImageChange:y}=n,O=null==g?void 0:g[0].split("/"),m=null==O?void 0:O[O.length-1];return e.jsxs(h.Container,{children:[e.jsx(h.ImageContainer,Object.assign({error:!!u,onClick:u?y:void 0},{children:u?e.jsx(s.default,{color:c.COLORS.content.brand,width:32,height:32}):p?e.jsx(o.Spinner,{size:"small"}):x===l.HEADER_TYPES.IMAGE?e.jsx("img",{alt:"",src:null==g?void 0:g[0],style:{width:"100%",height:"56px",borderRadius:8,objectFit:"cover"}}):x===l.HEADER_TYPES.VIDEO?e.jsx(r.default,{width:18,height:22,color:c.COLORS.content.placeholder}):e.jsx(t.default,{width:18,height:22,color:c.COLORS.content.placeholder})})),e.jsxs(h.RightComponent,{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:g&&u?e.jsx(e.Fragment,{}):p?e.jsx(d.BodyCaption,Object.assign({style:{marginLeft:8}},{children:"Your media is getting loaded..."})):e.jsx(d.BodySecondary,Object.assign({style:{color:c.COLORS.content.primary,marginLeft:8}},{children:a.default.toCapitilize(null==x?void 0:x.toLowerCase())||m}))})),!!u&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",marginLeft:8}},{children:[e.jsxs(d.BodySecondary,Object.assign({style:{color:c.COLORS.content.negative}},{children:["Error loading this ",null==x?void 0:x.toLowerCase(),". Retry"]})),e.jsx(d.Caption,Object.assign({style:{color:c.COLORS.content.secondary}},{children:u}))]})),!u&&!p&&e.jsx(j,Object.assign({onClick:y,onKeyDown:y,role:"presentation"},{children:e.jsx(i.default,{width:24,height:24,color:c.COLORS.content.placeholder})}))]})]})};
8
+ `;exports.default=n=>{const{imageName:g,error:u,isLoading:p,mediaType:x,handleImageChange:y,disableEditVariable:O}=n,m=null==g?void 0:g[0].split("/"),f=null==m?void 0:m[m.length-1];return e.jsxs(h.Container,{children:[e.jsx(h.ImageContainer,Object.assign({error:!!u,onClick:u?y:void 0},{children:u?e.jsx(s.default,{color:c.COLORS.content.brand,width:32,height:32}):p?e.jsx(o.Spinner,{size:"small"}):x===l.HEADER_TYPES.IMAGE?e.jsx("img",{alt:"",src:null==g?void 0:g[0],style:{width:"100%",height:"56px",borderRadius:8,objectFit:"cover"}}):x===l.HEADER_TYPES.VIDEO?e.jsx(r.default,{width:18,height:22,color:c.COLORS.content.placeholder}):e.jsx(t.default,{width:18,height:22,color:c.COLORS.content.placeholder})})),e.jsxs(h.RightComponent,{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:g&&u?e.jsx(e.Fragment,{}):p?e.jsx(a.BodyCaption,Object.assign({style:{marginLeft:8}},{children:"Your media is getting loaded..."})):e.jsx(a.BodySecondary,Object.assign({style:{color:c.COLORS.content.primary,marginLeft:8}},{children:d.default.toCapitilize(null==x?void 0:x.toLowerCase())||f}))})),!!u&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",marginLeft:8}},{children:[e.jsxs(a.BodySecondary,Object.assign({style:{color:c.COLORS.content.negative}},{children:["Error loading this ",null==x?void 0:x.toLowerCase(),". Retry"]})),e.jsx(a.Caption,Object.assign({style:{color:c.COLORS.content.secondary}},{children:u}))]})),!O&&!u&&!p&&e.jsx(j,Object.assign({onClick:y,onKeyDown:y,role:"presentation"},{children:e.jsx(i.default,{width:24,height:24,color:c.COLORS.content.placeholder})}))]})]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),r=require("react"),i=require("../../helpers/FileUploaderHelper.js"),a=require("../../image-cropper/BikImageCropper.js");require("../../image-compress/ImageCompress.js"),require("../../states/StateComponent.js"),require("../../../constants/zindex.js"),require("../../modals/styledModal.js"),require("../../spinner/Spinner.js");var n=require("../../template-preview/models/TemplateMeta.js"),o=require("./EditMediaV2.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(r);exports.default=l=>{let{mediaComponent:u,template:d,updateTemplateImageUrl:c,whatsappSpecificPickerMeta:p}=l;var m,f;const[v,E]=r.useState(void 0),[g,j]=r.useState(),_=s.default.createRef(),[h,S]=r.useState(!1),[q,A]=r.useState("");function C(t){var r;return e.__awaiter(this,void 0,void 0,(function*(){const e=new i.FileUploaderHelper;if(t instanceof Blob){const i=e.validate(t);if(i)A(i),S(!1);else{const e=u.format===n.HEADER_TYPES.IMAGE,i=yield p.uploadMediaFiles({file:t,fileName:v,isImage:e});if(i.success){const[e]=t.type.split("/");c(null!==(r=i.url)&&void 0!==r?r:"","application"===e?n.HEADER_TYPES.DOCUMENT:n.HEADER_TYPES[e.toUpperCase()])}else A("An unknown technical error occured");S(!1)}}else A("An unknown technical error occured"),S(!1)}))}let y;return y=u.format===n.HEADER_TYPES.IMAGE?"image/png, image/jpeg":u.format===n.HEADER_TYPES.VIDEO?"video/mp4":"application/pdf",t.jsxs(t.Fragment,{children:[!!g&&t.jsx(a.BikImageCropper,{aspectRatio:15/8,src:g,onCropComplete:function(t){return e.__awaiter(this,void 0,void 0,(function*(){S(!1),A("");const e=yield fetch(t);C(yield e.blob()).then((()=>{j(void 0)}))}))},onCancel:()=>{S(!1),j("")}}),t.jsx("input",{ref:_,style:{display:"none"},type:"file",onChange:function(e){var t;A(""),S(!0);const r=null===(t=e.target.files)||void 0===t?void 0:t[0];if(u.format===n.HEADER_TYPES.IMAGE){const e=new FileReader;j(""),E(""),e.onload=()=>{j(e.result),E(null==r?void 0:r.name)},r&&e.readAsDataURL(r)}else C(r)},accept:y}),t.jsx(o.default,{imageName:null!==(f=null===(m=null==u?void 0:u.example)||void 0===m?void 0:m.header_handle)&&void 0!==f?f:[],handleImageChange:function(){var e;(null===(e=null==_?void 0:_.current)||void 0===e?void 0:e.click)&&_.current.click()},mediaType:null==u?void 0:u.format,error:q,isLoading:h})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),r=require("../../helpers/FileUploaderHelper.js"),a=require("../../image-cropper/BikImageCropper.js");require("../../image-compress/ImageCompress.js"),require("../../states/StateComponent.js"),require("../../../constants/zindex.js"),require("../../modals/styledModal.js"),require("../../spinner/Spinner.js");var o=require("../../template-preview/models/TemplateMeta.js"),l=require("../context/templateModalContext.js"),n=require("./EditMediaV2.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=s(i);exports.default=s=>{let{mediaComponent:u,template:c,updateTemplateImageUrl:p,whatsappSpecificPickerMeta:m}=s;var f,v;const{disableEditVariable:E}=l.useTemplateModalContext(),[j,g]=i.useState(void 0),[_,h]=i.useState(),C=d.default.createRef(),[q,S]=i.useState(!1),[x,A]=i.useState("");function M(t){var i;return e.__awaiter(this,void 0,void 0,(function*(){const e=new r.FileUploaderHelper;if(t instanceof Blob){const r=e.validate(t);if(r)A(r),S(!1);else{const e=u.format===o.HEADER_TYPES.IMAGE,r=yield m.uploadMediaFiles({file:t,fileName:j,isImage:e});if(r.success){const[e]=t.type.split("/");p(null!==(i=r.url)&&void 0!==i?i:"","application"===e?o.HEADER_TYPES.DOCUMENT:o.HEADER_TYPES[e.toUpperCase()])}else A("An unknown technical error occured");S(!1)}}else A("An unknown technical error occured"),S(!1)}))}let y;return y=u.format===o.HEADER_TYPES.IMAGE?"image/png, image/jpeg":u.format===o.HEADER_TYPES.VIDEO?"video/mp4":"application/pdf",t.jsxs(t.Fragment,{children:[!!_&&t.jsx(a.BikImageCropper,{aspectRatio:15/8,src:_,onCropComplete:function(t){return e.__awaiter(this,void 0,void 0,(function*(){S(!1),A("");const e=yield fetch(t);M(yield e.blob()).then((()=>{h(void 0)}))}))},onCancel:()=>{S(!1),h("")}}),t.jsx("input",{ref:C,style:{display:"none"},type:"file",onChange:function(e){var t;A(""),S(!0);const i=null===(t=e.target.files)||void 0===t?void 0:t[0];if(u.format===o.HEADER_TYPES.IMAGE){const e=new FileReader;h(""),g(""),e.onload=()=>{h(e.result),g(null==i?void 0:i.name)},i&&e.readAsDataURL(i)}else M(i)},accept:y}),t.jsx(n.default,{imageName:null!==(v=null===(f=null==u?void 0:u.example)||void 0===f?void 0:f.header_handle)&&void 0!==v?v:[],handleImageChange:function(){var e;(null===(e=null==C?void 0:C.current)||void 0===e?void 0:e.click)&&C.current.click()},mediaType:null==u?void 0:u.format,error:x,isLoading:q,disableEditVariable:E})]})};
@@ -2,7 +2,7 @@
2
2
  position: relative;
3
3
  height: 100%;
4
4
  border-radius: 31px;
5
- width: ${e=>e.channel===r.CHANNEL_TYPE.WHATSAPP?"236px":"213px"};
5
+ width: ${e=>e.channel===r.CHANNEL_TYPE.WHATSAPP?"236px":"300px"};
6
6
  background-color: white;
7
7
  margin: auto;
8
8
  overflow-y: auto;
@@ -17,4 +17,4 @@
17
17
  height: calc(100% - 17px);
18
18
  border-radius: 16px;
19
19
  overflow-y: auto;
20
- `,c=s.default.forwardRef(((t,i)=>{let{display_content:o,channel:s,template:l}=t;return e.jsx("div",{children:e.jsxs(p,Object.assign({channel:s},{children:[e.jsx("img",{alt:"",src:"https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FkNwEVoGlLpVjOsXoO1M8WgvWicP2%2F6f07b850-8b4b-4d58-96cc-8ba6df7b4e4a-Device___Frame.jpg?alt=media&token=253f1bfe-8481-4f54-bdef-3c0a73697d6a",style:{width:s===r.CHANNEL_TYPE.WHATSAPP?236:213,height:443}}),e.jsx(n,Object.assign({ref:i},{children:e.jsx(a.TemplatePreview,{template:l,channel:s,smsSpecificMeta:{smsDisplayContent:o},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:!0,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:o,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%"},templateContainerStyles:{height:"100%"}}})}))]}))})}));c.displayName="MobilePreview",exports.default=c;
20
+ `,d=s.default.forwardRef(((t,i)=>{let{display_content:o,channel:s,template:l}=t;return e.jsx("div",{children:e.jsxs(p,Object.assign({channel:s},{children:[e.jsx("img",{alt:"",src:"https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FkNwEVoGlLpVjOsXoO1M8WgvWicP2%2F6f07b850-8b4b-4d58-96cc-8ba6df7b4e4a-Device___Frame.jpg?alt=media&token=253f1bfe-8481-4f54-bdef-3c0a73697d6a",style:{width:s===r.CHANNEL_TYPE.WHATSAPP?236:300,height:443}}),e.jsx(n,Object.assign({ref:i},{children:e.jsx(a.TemplatePreview,{template:l,channel:s,smsSpecificMeta:{smsDisplayContent:o},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:!0,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:o,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%",width:"100%"},templateContainerStyles:{height:"100%"}}})}))]}))})}));d.displayName="MobilePreview",exports.default=d;