@bikdotai/bik-component-library 0.0.444 → 0.0.445-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/cjs/assets/{bundle-421aeced.css → bundle-0deb4a74.css} +2 -0
  2. package/dist/cjs/assets/icons/PlusIcon.d.ts +1 -1
  3. package/dist/cjs/assets/icons/qrb.svg.js +1 -0
  4. package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
  5. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  6. package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
  7. package/dist/cjs/components/carousel-preview/CarouselPreview.d.ts +14 -0
  8. package/dist/cjs/components/carousel-preview/CarouselPreview.js +52 -0
  9. package/dist/cjs/components/carousel-preview/CarouselPreviewCard.d.ts +11 -0
  10. package/dist/cjs/components/carousel-preview/CarouselPreviewCard.js +1 -0
  11. package/dist/cjs/components/carousel-preview/index.d.ts +1 -0
  12. package/dist/cjs/components/helpers/FileUploaderHelper.d.ts +7 -1
  13. package/dist/cjs/components/helpers/FileUploaderHelper.js +1 -1
  14. package/dist/cjs/components/product-picker-v2/modal.d.ts +1 -0
  15. package/dist/cjs/components/product-picker-v2/modal.js +1 -1
  16. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +21 -4
  17. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
  18. package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +50 -8
  19. package/dist/cjs/components/template-context-mapper/context/templateModalContext.js +1 -1
  20. package/dist/cjs/components/template-context-mapper/modalElements/Body.js +9 -9
  21. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.d.ts +25 -0
  22. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +47 -0
  23. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  24. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +3 -2
  25. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  26. package/dist/cjs/components/template-context-mapper/modalElements/Footer.d.ts +2 -1
  27. package/dist/cjs/components/template-context-mapper/modalElements/Footer.js +4 -4
  28. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.d.ts +2 -1
  29. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +3 -3
  30. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +12 -3
  31. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +0 -1
  32. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  33. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.d.ts +2 -2
  34. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  35. package/dist/cjs/components/template-preview/TemplatePreview.d.ts +6 -2
  36. package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
  37. package/dist/cjs/components/template-preview/WhatsApp/ChatUI.js +2 -2
  38. package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.d.ts +7 -1
  39. package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.js +12 -5
  40. package/dist/cjs/components/template-preview/WhatsApp/ChatUiV2.js +5 -5
  41. package/dist/cjs/components/template-preview/WhatsApp/LimitedTimeOffer/LimitedTimeOffer.index.js +1 -0
  42. package/dist/cjs/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +4 -6
  43. package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.d.ts +3 -0
  44. package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  45. package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  46. package/dist/cjs/components/template-preview/models/WhatsAppTemplate.d.ts +9 -1
  47. package/dist/cjs/components/template-preview/models/WhatsappCarouselTemplate.d.ts +82 -0
  48. package/dist/cjs/index.d.ts +1 -0
  49. package/dist/cjs/index.js +1 -1
  50. package/dist/esm/assets/{bundle-421aeced.css → bundle-0deb4a74.css} +2 -0
  51. package/dist/esm/assets/icons/PlusIcon.d.ts +1 -1
  52. package/dist/esm/assets/icons/qrb.svg.js +1 -0
  53. package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js +1 -1
  54. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  55. package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
  56. package/dist/esm/components/carousel-preview/CarouselPreview.d.ts +14 -0
  57. package/dist/esm/components/carousel-preview/CarouselPreview.js +52 -0
  58. package/dist/esm/components/carousel-preview/CarouselPreviewCard.d.ts +11 -0
  59. package/dist/esm/components/carousel-preview/CarouselPreviewCard.js +1 -0
  60. package/dist/esm/components/carousel-preview/index.d.ts +1 -0
  61. package/dist/esm/components/helpers/FileUploaderHelper.d.ts +7 -1
  62. package/dist/esm/components/helpers/FileUploaderHelper.js +1 -1
  63. package/dist/esm/components/product-picker-v2/modal.d.ts +1 -0
  64. package/dist/esm/components/product-picker-v2/modal.js +1 -1
  65. package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +21 -4
  66. package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
  67. package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +50 -8
  68. package/dist/esm/components/template-context-mapper/context/templateModalContext.js +1 -1
  69. package/dist/esm/components/template-context-mapper/modalElements/Body.js +9 -9
  70. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.d.ts +25 -0
  71. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +47 -0
  72. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  73. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +3 -2
  74. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  75. package/dist/esm/components/template-context-mapper/modalElements/Footer.d.ts +2 -1
  76. package/dist/esm/components/template-context-mapper/modalElements/Footer.js +4 -4
  77. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.d.ts +2 -1
  78. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +1 -1
  79. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +12 -3
  80. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +0 -1
  81. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  82. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.d.ts +2 -2
  83. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  84. package/dist/esm/components/template-preview/TemplatePreview.d.ts +6 -2
  85. package/dist/esm/components/template-preview/TemplatePreview.js +1 -1
  86. package/dist/esm/components/template-preview/WhatsApp/ChatUI.js +2 -2
  87. package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.d.ts +7 -1
  88. package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.js +20 -13
  89. package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.js +5 -5
  90. package/dist/esm/components/template-preview/WhatsApp/LimitedTimeOffer/LimitedTimeOffer.index.js +5 -4
  91. package/dist/esm/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +5 -7
  92. package/dist/esm/components/template-preview/WhatsAppTemplatePreview.d.ts +3 -0
  93. package/dist/esm/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  94. package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  95. package/dist/esm/components/template-preview/models/WhatsAppTemplate.d.ts +9 -1
  96. package/dist/esm/components/template-preview/models/WhatsappCarouselTemplate.d.ts +82 -0
  97. package/dist/esm/index.d.ts +1 -0
  98. package/dist/esm/index.js +1 -1
  99. package/package.json +2 -1
@@ -1,3 +1,5 @@
1
+ .buttonBack___1mlaL,.buttonFirst___2rhFr,.buttonLast___2yuh0,.buttonNext___2mOCa,.buttonNext___3Lm3s,.dot___3c3SI{cursor:pointer}.image___xtQGH{display:block;width:100%;height:100%}.spinner___27VUp{position:absolute;top:calc(50% - 15px);left:calc(50% - 15px);width:30px;height:30px;animation-name:spin___S3UuE;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;border:4px solid #a9a9a9;border-top-color:#000;border-radius:30px}@keyframes spin___S3UuE{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.container___2O72F{position:relative;overflow:hidden;height:100%;width:100%}.overlay___IV4qY{position:absolute;top:0;left:0;bottom:0;right:0;opacity:0;cursor:zoom-in;transition:opacity .3s,transform .3s}.hover___MYy31,.loading___1pvNI,.zoom___3kqYk{opacity:1}.imageLoadingSpinnerContainer___3UIPD{position:absolute;top:0;right:0;bottom:0;left:0;background-color:#f4f4f4}.slide___3-Nqo{position:relative;display:block;box-sizing:border-box;height:0;margin:0;list-style-type:none}.slide___3-Nqo:focus{outline:none!important}.slideHorizontal___1NzNV{float:left}[dir=rtl] .slideHorizontal___1NzNV{direction:rtl;transform:scaleX(-1)}.slideInner___2mfX9{position:absolute;top:0;left:0;width:100%;height:100%}.focusRing___1airF{position:absolute;top:5px;right:5px;bottom:5px;left:5px;pointer-events:none;outline-width:5px;outline-style:solid;outline-color:Highlight}@media (-webkit-min-device-pixel-ratio:0){.focusRing___1airF{outline-style:auto;outline-color:-webkit-focus-ring-color}}.horizontalSlider___281Ls{position:relative;overflow:hidden;touch-action:pan-y pinch-zoom}[dir=rtl] .horizontalSlider___281Ls{direction:ltr;transform:scaleX(-1)}.horizontalSliderTray___1L-0W{overflow:hidden;width:100%}.verticalSlider___34ZFD{position:relative;overflow:hidden}.verticalSliderTray___267D8{overflow:hidden}.verticalTray___12Key{float:left}.verticalSlideTrayWrap___2nO7o{overflow:hidden}.sliderTray___-vHFQ{display:block;list-style:none;padding:0;margin:0}.sliderAnimation___300FY{transition:transform .5s;transition-timing-function:cubic-bezier(.645,.045,.355,1);will-change:transform}.masterSpinnerContainer___1Z6hB{position:absolute;top:0;right:0;bottom:0;left:0;background-color:#f4f4f4}
2
+ /*# sourceMappingURL=react-carousel.es.css.map */
1
3
  .ReactCrop{position:relative;display:inline-block;cursor:crosshair;overflow:hidden;max-width:100%}.ReactCrop *,.ReactCrop *:before,.ReactCrop *:after{box-sizing:border-box}.ReactCrop--disabled,.ReactCrop--locked{cursor:inherit}.ReactCrop__child-wrapper{max-height:inherit}.ReactCrop__child-wrapper>img,.ReactCrop__child-wrapper>video{display:block;max-width:100%;max-height:inherit}.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper>img,.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper>video{touch-action:none}.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__crop-selection{touch-action:none}.ReactCrop__crop-selection{position:absolute;top:0;left:0;transform:translateZ(0);cursor:move;box-shadow:0 0 0 9999em #00000080}.ReactCrop--disabled .ReactCrop__crop-selection{cursor:inherit}.ReactCrop--circular-crop .ReactCrop__crop-selection{border-radius:50%}.ReactCrop--no-animate .ReactCrop__crop-selection{outline:1px dashed white}.ReactCrop__crop-selection:not(.ReactCrop--no-animate .ReactCrop__crop-selection){animation:marching-ants 1s;background-image:linear-gradient(to right,#fff 50%,#444 50%),linear-gradient(to right,#fff 50%,#444 50%),linear-gradient(to bottom,#fff 50%,#444 50%),linear-gradient(to bottom,#fff 50%,#444 50%);background-size:10px 1px,10px 1px,1px 10px,1px 10px;background-position:0 0,0 100%,0 0,100% 0;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;color:#fff;animation-play-state:running;animation-timing-function:linear;animation-iteration-count:infinite}@keyframes marching-ants{0%{background-position:0 0,0 100%,0 0,100% 0}to{background-position:20px 0,-20px 100%,0 -20px,100% 20px}}.ReactCrop__crop-selection:focus{outline:none;border-color:#00f;border-style:solid}.ReactCrop--invisible-crop .ReactCrop__crop-selection{display:none}.ReactCrop__rule-of-thirds-vt:before,.ReactCrop__rule-of-thirds-vt:after,.ReactCrop__rule-of-thirds-hz:before,.ReactCrop__rule-of-thirds-hz:after{content:"";display:block;position:absolute;background-color:#fff6}.ReactCrop__rule-of-thirds-vt:before,.ReactCrop__rule-of-thirds-vt:after{width:1px;height:100%}.ReactCrop__rule-of-thirds-vt:before{left:33.3333%;left:33.3333333333%}.ReactCrop__rule-of-thirds-vt:after{left:66.6666%;left:66.6666666667%}.ReactCrop__rule-of-thirds-hz:before,.ReactCrop__rule-of-thirds-hz:after{width:100%;height:1px}.ReactCrop__rule-of-thirds-hz:before{top:33.3333%;top:33.3333333333%}.ReactCrop__rule-of-thirds-hz:after{top:66.6666%;top:66.6666666667%}.ReactCrop__drag-handle{position:absolute}.ReactCrop__drag-handle:after{position:absolute;content:"";display:block;width:10px;height:10px;background-color:#0003;border:1px solid rgba(255,255,255,.7);outline:1px solid transparent}.ReactCrop__drag-handle:focus:after{border-color:#00f;background:#2dbfff}.ReactCrop .ord-nw{top:0;left:0;margin-top:-5px;margin-left:-5px;cursor:nw-resize}.ReactCrop .ord-nw:after{top:0;left:0}.ReactCrop .ord-n{top:0;left:50%;margin-top:-5px;margin-left:-5px;cursor:n-resize}.ReactCrop .ord-n:after{top:0}.ReactCrop .ord-ne{top:0;right:0;margin-top:-5px;margin-right:-5px;cursor:ne-resize}.ReactCrop .ord-ne:after{top:0;right:0}.ReactCrop .ord-e{top:50%;right:0;margin-top:-5px;margin-right:-5px;cursor:e-resize}.ReactCrop .ord-e:after{right:0}.ReactCrop .ord-se{bottom:0;right:0;margin-bottom:-5px;margin-right:-5px;cursor:se-resize}.ReactCrop .ord-se:after{bottom:0;right:0}.ReactCrop .ord-s{bottom:0;left:50%;margin-bottom:-5px;margin-left:-5px;cursor:s-resize}.ReactCrop .ord-s:after{bottom:0}.ReactCrop .ord-sw{bottom:0;left:0;margin-bottom:-5px;margin-left:-5px;cursor:sw-resize}.ReactCrop .ord-sw:after{bottom:0;left:0}.ReactCrop .ord-w{top:50%;left:0;margin-top:-5px;margin-left:-5px;cursor:w-resize}.ReactCrop .ord-w:after{left:0}.ReactCrop__disabled .ReactCrop__drag-handle{cursor:inherit}.ReactCrop__drag-bar{position:absolute}.ReactCrop__drag-bar.ord-n{top:0;left:0;width:100%;height:6px;margin-top:-3px}.ReactCrop__drag-bar.ord-e{right:0;top:0;width:6px;height:100%;margin-right:-3px}.ReactCrop__drag-bar.ord-s{bottom:0;left:0;width:100%;height:6px;margin-bottom:-3px}.ReactCrop__drag-bar.ord-w{top:0;left:0;width:6px;height:100%;margin-left:-3px}.ReactCrop--new-crop .ReactCrop__drag-bar,.ReactCrop--new-crop .ReactCrop__drag-handle,.ReactCrop--fixed-aspect .ReactCrop__drag-bar,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-n,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-e,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-s,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-w{display:none}@media (pointer: coarse){.ReactCrop .ord-n,.ReactCrop .ord-e,.ReactCrop .ord-s,.ReactCrop .ord-w{display:none}.ReactCrop__drag-handle{width:24px;height:24px}}
2
4
 
3
5
  @charset "UTF-8";/*!
@@ -1,4 +1,4 @@
1
- import { SVGProps } from "react";
1
+ import { SVGProps } from 'react';
2
2
  export type Icon = React.FC<SVGProps<SVGSVGElement> & {
3
3
  color?: string;
4
4
  width?: string | number;
@@ -0,0 +1 @@
1
+ "use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}var a=e=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 19 19"},e),t||(t=r.createElement("path",{fill:"#1877F2",fillRule:"evenodd",d:"M8.137 3.676a.75.75 0 0 0-.817.163l-5.25 5.25a.75.75 0 0 0 0 1.06l5.25 5.25a.75.75 0 0 0 1.28-.53v-2.307c3.146.15 5.305 1.274 6.89 3.493a.75.75 0 0 0 1.346-.583c-.393-1.963-1.186-3.97-2.609-5.597-1.321-1.51-3.157-2.656-5.627-3.14V4.37a.75.75 0 0 0-.463-.693ZM7.1 6.18v1.19c0 .372.275.689.644.742 2.452.35 4.163 1.39 5.354 2.751.528.603.96 1.277 1.31 1.994-1.754-1.239-3.917-1.813-6.558-1.813a.75.75 0 0 0-.75.75v1.264L3.661 9.62l3.44-3.44Z",clipRule:"evenodd"})));exports.default=a;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("../../helpers/BaseWhatsappContentLang.helper.js"),r=require("react"),l=require("../../constants/Theme.js"),o=require("../TypographyStyle.js"),i=require("./CustomEditor.styled.js"),u=require("./WhatsAppTextEditorHeader.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=c(r);const a="Character limit reached",d=new n.BaseWhatsappContentLangHelper,v={[u.EditorActionTypes.BOLD]:"*",[u.EditorActionTypes.ITALIC]:"_",[u.EditorActionTypes.STRIKETHROUGH]:"~"},p=s.default.forwardRef(((n,c)=>{var s,p,{onChange:h,text:f,RightComponent:g,error:x,limit:j,onError:m,rows:C,actions:E}=n,T=e.__rest(n,["onChange","text","RightComponent","error","limit","onError","rows","actions"]);const y=r.useRef(null);function O(e){const t=null==y?void 0:y.current;null!=t&&(t.selectionStart?(t.focus(),t.selectionEnd=e):t.focus())}function L(e){var t,n;let r=null!==(n=null===(t=y.current)||void 0===t?void 0:t.value)&&void 0!==n?n:"";if(y.current&&e){const t=y.current.selectionStart,n=y.current.selectionEnd,l=e;if(t===n)return S(l);{r=d.wrappWildcard(t,n,l,r);const e=d.getHTML(r);return y.current.value=r,{text:r,html:e}}}return{text:r,html:r}}function S(e){var t,n;let r=null!==(n=null===(t=y.current)||void 0===t?void 0:t.value)&&void 0!==n?n:"";if(y.current&&e){const t=y.current.selectionStart;if(t===y.current.selectionEnd)return H(e,t)}return{text:r,html:r}}function H(e,t){var n,r;let l=null!==(r=null===(n=y.current)||void 0===n?void 0:n.value)&&void 0!==r?r:"";l=l.slice(0,t)+e+l.slice(t);const o=d.getHTML(l);return y.current.value=l,{text:l,html:o}}return r.useImperativeHandle(c,(()=>({addTextOrWrap:L,addText:S,get(){var e,t;return null!==(t=null===(e=y.current)||void 0===e?void 0:e.value)&&void 0!==t?t:""},setCaretPosition:O}))),r.useEffect((()=>{if((null==y?void 0:y.current)&&f){y.current.value=f;const e=d.getHTML(f);null==h||h(f,e)}}),[]),r.useEffect((()=>{var e,t;(null===(e=null==y?void 0:y.current)||void 0===e?void 0:e.value)&&j&&((null===(t=null==y?void 0:y.current)||void 0===t?void 0:t.value.length)>j?null==m||m(a):null==m||m(null!=x?x:""))}),[null===(s=null==y?void 0:y.current)||void 0===s?void 0:s.value.length]),t.jsxs(i.OuterContainer,{children:[t.jsxs(i.Container,Object.assign({isError:!!x},{children:[t.jsx(u.WhatsAppTextEditorHeader,{actions:E,ref:y,onActionSelect:function(e){if((null==v?void 0:v[e])&&y.current){const t=y.current.selectionStart;if(t===y.current.selectionEnd){H(null==v?void 0:v[e],t);const{text:n,html:r}=H(null==v?void 0:v[e],t);O(t+1),null==h||h(n,r)}else{const{text:t,html:n}=L(null==v?void 0:v[e]);null==h||h(t,n)}}},RightComponent:g,onEmojiClick:function(e){const{text:t,html:n}=S(e);null==h||h(t,n)}}),t.jsx(i.TextSpace,Object.assign({ref:y,onChange:function(e){const t=e.target.value,n=d.getHTML(t);null==h||h(t,n)}},T,{rows:C}))]})),x&&x!==a?t.jsx(o.BodyCaption,Object.assign({style:{color:l.COLORS.content.negative}},{children:x})):t.jsx(t.Fragment,{children:j&&(null==y?void 0:y.current)?t.jsxs(o.BodyCaption,Object.assign({style:{color:x===a||(null===(p=null==y?void 0:y.current)||void 0===p?void 0:p.value.length)>j?l.COLORS.content.negative:l.COLORS.content.secondary}},{children:[y.current.value.length,"/",j]})):t.jsx(t.Fragment,{})})]})}));p.displayName="WhatsAppTextEditor",exports.WhatsAppTextEditor=p;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("../../assets/icons/info.svg.js"),r=require("../../helpers/BaseWhatsappContentLang.helper.js"),l=require("react"),o=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),u=require("./CustomEditor.styled.js"),s=require("./WhatsAppTextEditorHeader.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(l);const d="Character limit reached",v=new r.BaseWhatsappContentLangHelper,h={[s.EditorActionTypes.BOLD]:"*",[s.EditorActionTypes.ITALIC]:"_",[s.EditorActionTypes.STRIKETHROUGH]:"~"},p=a.default.forwardRef(((r,c)=>{var a,p,{onChange:f,text:g,RightComponent:x,error:j,limit:m,onError:C,rows:E,actions:T}=r,O=e.__rest(r,["onChange","text","RightComponent","error","limit","onError","rows","actions"]);const y=l.useRef(null);function L(e){const t=null==y?void 0:y.current;null!=t&&(t.selectionStart?(t.focus(),t.selectionEnd=e):t.focus())}function S(e){var t,n;let r=null!==(n=null===(t=y.current)||void 0===t?void 0:t.value)&&void 0!==n?n:"";if(y.current&&e){const t=y.current.selectionStart,n=y.current.selectionEnd,l=e;if(t===n)return R(l);{r=v.wrappWildcard(t,n,l,r);const e=v.getHTML(r);return y.current.value=r,{text:r,html:e}}}return{text:r,html:r}}function R(e){var t,n;let r=null!==(n=null===(t=y.current)||void 0===t?void 0:t.value)&&void 0!==n?n:"";if(y.current&&e){const t=y.current.selectionStart;if(t===y.current.selectionEnd)return H(e,t)}return{text:r,html:r}}function H(e,t){var n,r;let l=null!==(r=null===(n=y.current)||void 0===n?void 0:n.value)&&void 0!==r?r:"";l=l.slice(0,t)+e+l.slice(t);const o=v.getHTML(l);return y.current.value=l,{text:l,html:o}}return l.useImperativeHandle(c,(()=>({addTextOrWrap:S,addText:R,get(){var e,t;return null!==(t=null===(e=y.current)||void 0===e?void 0:e.value)&&void 0!==t?t:""},setCaretPosition:L}))),l.useEffect((()=>{if(null==y?void 0:y.current){y.current.value=g||"";const e=v.getHTML(g||"");null==f||f(g||"",e)}}),[g]),l.useEffect((()=>{var e,t;(null===(e=null==y?void 0:y.current)||void 0===e?void 0:e.value)&&m&&((null===(t=null==y?void 0:y.current)||void 0===t?void 0:t.value.length)>m?null==C||C(d):null==C||C(null!=j?j:""))}),[null===(a=null==y?void 0:y.current)||void 0===a?void 0:a.value.length]),t.jsxs(u.OuterContainer,{children:[t.jsxs(u.Container,Object.assign({isError:!!j},{children:[t.jsx(s.WhatsAppTextEditorHeader,{actions:T,ref:y,onActionSelect:function(e){if((null==h?void 0:h[e])&&y.current){const t=y.current.selectionStart;if(t===y.current.selectionEnd){H(null==h?void 0:h[e],t);const{text:n,html:r}=H(null==h?void 0:h[e],t);L(t+1),null==f||f(n,r)}else{const{text:t,html:n}=S(null==h?void 0:h[e]);null==f||f(t,n)}}},RightComponent:x,onEmojiClick:function(e){const{text:t,html:n}=R(e);null==f||f(t,n)}}),t.jsx(u.TextSpace,Object.assign({ref:y,onChange:function(e){const t=e.target.value,n=v.getHTML(t);null==f||f(t,n)}},O,{rows:E}))]})),j&&j!==d?t.jsxs("div",Object.assign({style:{display:"flex",gap:6,alignItems:"center"}},{children:[t.jsx(n.default,{width:16,height:16,color:o.COLORS.content.negative}),t.jsx(i.BodyCaption,Object.assign({color:o.COLORS.content.negative},{children:j}))]})):t.jsx(t.Fragment,{children:m&&(null==y?void 0:y.current)?t.jsxs(i.BodyCaption,Object.assign({style:{color:j===d||(null===(p=null==y?void 0:y.current)||void 0===p?void 0:p.value.length)>m?o.COLORS.content.negative:o.COLORS.content.secondary}},{children:[y.current.value.length,"/",m]})):t.jsx(t.Fragment,{})})]})}));p.displayName="WhatsAppTextEditor",exports.WhatsAppTextEditor=p;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),r=require("react/jsx-runtime"),i=require("../../../../utils/StringUtils.js"),t=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var g=require("react");require("../../../checkBox/CheckBox.styled.js");var s=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../toaster/Toaster.styled.js"),require("../../../tooltips/Tooltip.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js"),require("../../../icon-button/IconButton.js"),require("../../../template-preview/TemplatePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../curtain/CurtainHelper.js"),require("../../../template-preview/models/TemplateMeta.js"),require("../../../template-preview/models/WhatsAppTemplate.js"),require("../../../modals/styledModal.js"),require("../../../template-preview/models/Channels.js"),require("../../../template-context-mapper/context/templateModalContext.js"),require("../../../template-context-mapper/modalElements/Footer.js"),require("../../../template-context-mapper/modalElements/Body.js"),require("../../../template-context-mapper/modalElements/Header.js"),require("../../../zeroState/ZeroState.js"),require("../../../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../../../button/Button.js"),require("../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../../input/Input.js"),require("react-bootstrap"),require("../../../floating-action-button/FloatingActionButton.styles.js"),require("../../../image-compress/ImageCompress.js"),require("../../../progress-bar/ProgressBarComponent.js"),require("../../../QueryBuilder/QueryBuilder.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),require("../../../QueryBuilder/constants/connectorPosition.js"),require("../../../QueryBuilder/constants/connector.js"),require("../../../QueryBuilder/types/QueryBuilder.type.js"),require("../../../dropdown/Dropdown.js"),require("../../../QueryBuilder/components/InputLoader.js"),require("../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js"),require("react-chips"),require("../../../input/ChipInput.styled.js"),require("../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js"),require("../../../QueryBuilder/components/Connectors/Components/IgPicker.js"),require("../../../QueryBuilder/components/Connectors/Components/InTheLast.js"),require("../../../QueryBuilder/components/Connectors/Components/InTwoLast.js"),require("react-calendar"),require("../../../../utils/DateUtils.js"),require("../../../datePicker/DatePickerWrapper.styled.js"),require("../../../QueryBuilder/components/Connectors/Connector.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js"),require("../../../QueryBuilder/redux/queryBuilder.reducer.js"),require("../../../QueryBuilder/redux/queryBuilderCache.reducer.js"),require("../../../QueryBuilder/types/QueryBuilderOperator.type.js"),require("../../../dropdown/DropdownPopover/index.js"),require("../../../dropdown/ChipDropdown.js"),require("../../../dropdown/MenuItem/MenuItem.js"),require("../../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../analytics-card/AnalyticsCard.styled.js"),require("../../CommonStyles.js"),require("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var I=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../VerticalBarGraph/VerticalGraph.js"),require("../heatmap/HeatMap.js"),require("../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../../avatar/Avatar.js"),require("../../../avatar/AvatarHelper.js"),require("../../../alerts/Alert.styled.js"),require("../../../alerts/AlertHelper.js"),require("../../../thumbnail/Thumbnail.js"),require("../../../curtain/Curtain.styled.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.js"),require("../../../plans/SubscriptionPlansCollected.js"),require("../../../tabs/Tabs.js"),require("../../../TablePagination/TablePagination.styled.js"),require("../../../TablePagination/TablePaginationCard.js"),require("../../../states/StateComponent.js"),require("../../../../_virtual/_tslib.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditor.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),require("../../../card-selection-modal/CardSelectionModal.styled.js"),require("react-image-crop"),require("../../../buttonGroup/ButtonGroupStyle.js"),require("../../../accordion/Accordion.style.js"),require("../../../accordion/AccordionArrow.js"),require("../../../file-uploader/FileUploaderStyle.js"),require("../../../colourInput/ColourInput.styled.js"),require("../../../bik-layout/CommonStyles.js"),require("../../../navigation-hyperlink/NavigationHyperlink.js"),require("../../../bik-layout/SidebarStyles.js"),require("date-fns"),require("react-popper"),require("../../../dropdown/Common.styled.js"),require("../../../custom-date-time/CustomDateTime.styled.js"),require("../../../../node_modules/lodash.debounce/index.js"),require("../../../product-picker/ProductPicker.styled.js"),require("../../../discount-modal/type.js"),require("../../../product-picker-v2/modal.js"),require("../../../discount-modal/DiscountModal.styled.js"),require("../../../discount-modal/DynamicCoupon/DynamicCoupon.js"),require("../../../discount-modal/CouponExpiration/CouponExpiration.js"),require("../../../country-code-picker/CountryCodePicker.styled.js"),require("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.style.js"),require("../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js"),require("../../../radioList/RadioList.styled.js"),require("../../../checkList/CheckList.styled.js"),require("../../../postPicker/postPicker.js"),require("../../../dropdown-button/DropdownButton.style.js"),require("../../../side-modal/SideModal.style.js"),require("../../../add-variableV2/AddVariableV2.styled.js"),require("../../../modals/modal.styled.js"),require("../../../SearchFilter/types/SearchFilter.type.js"),require("../../../SearchFilter/components/DatePickerButton.js"),require("../../../SearchFilter/components/DateRangeOnlyButton.js"),require("../../../input-with-vars/InputWithVariables.js"),require("../../../star-rating/StarRating.js"),require("../../../dashboard-review-popup/components/FiveStar.styled.js"),require("../../../dashboard-review-popup/components/Form.styled.js"),require("../../../dashboard-review-popup/components/ZeroState.js"),require("../../../dashboard-review-popup/DashboardReviewPopUp.styled.js"),require("../../../testimonial-card/TestimonialCard.style.js"),require("../../../slider/slider.js");var C=require("chart.js"),o=require("react-chartjs-2");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e);C.Chart.register(C.ArcElement,C.Legend);const l={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:e=>{if(!e.label)return" 0%";const r=e.dataset.data.reduce(((e,r)=>e+r),0),i=parseFloat((e.raw/r*100).toFixed(1));return` ${e.label}: ${i}%`}}}}},A=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],d=a.default("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(e=>t.COLORS.surface.standard),";border:1px solid ",(e=>t.COLORS.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbH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gZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICA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amVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>r.jsx(d,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:t,slices:C,size:c}=e;const[a,d]=g.useState([]),[u,n]=g.useState();return g.useEffect((()=>{const e=C.reduce(((e,r)=>e+r.count),0);let r=[];if(r=Object.keys(C).map(((e,r)=>Object.assign({color:A[r%A.length]},C[e]))),d([...r]),0===e){n({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:C.map((e=>i.default.capitalize(e.name))),datasets:[{data:C.map((e=>e.count)),backgroundColor:C.map(((e,r)=>{var i;return null!==(i=e.color)&&void 0!==i?i:A[r%A.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};n(e)}}),[C]),u?r.jsxs(r.Fragment,{children:[t&&r.jsx(s.TitleMedium,Object.assign({style:{marginBottom:16}},{children:t})),r.jsxs("div",Object.assign({className:"row"},{children:[r.jsx("div",Object.assign({className:"col-6"},{children:r.jsx("div",Object.assign({style:{width:c,height:c}},{children:r.jsx(o.Doughnut,{data:u,options:Object.assign(Object.assign({},l),{maintainAspectRatio:!c})})}))})),r.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:r.jsx(I.PieChart,{slices:a})}))]}))]}):r.jsx(r.Fragment,{})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),r=require("react/jsx-runtime"),i=require("../../../../utils/StringUtils.js"),t=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var g=require("react");require("../../../checkBox/CheckBox.styled.js");var s=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../toaster/Toaster.styled.js"),require("../../../tooltips/Tooltip.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js"),require("../../../icon-button/IconButton.js"),require("../../../template-preview/TemplatePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../curtain/CurtainHelper.js"),require("../../../template-preview/models/TemplateMeta.js"),require("../../../template-preview/models/WhatsAppTemplate.js"),require("../../../modals/styledModal.js"),require("../../../template-preview/models/Channels.js"),require("../../../template-context-mapper/context/templateModalContext.js"),require("../../../template-context-mapper/modalElements/Footer.js"),require("../../../template-context-mapper/modalElements/Body.js"),require("../../../template-context-mapper/modalElements/Header.js"),require("../../../zeroState/ZeroState.js"),require("../../../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../../../button/Button.js"),require("../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../../input/Input.js"),require("react-bootstrap"),require("../../../floating-action-button/FloatingActionButton.styles.js"),require("../../../image-compress/ImageCompress.js"),require("../../../progress-bar/ProgressBarComponent.js"),require("../../../QueryBuilder/QueryBuilder.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),require("../../../QueryBuilder/constants/connectorPosition.js"),require("../../../QueryBuilder/constants/connector.js"),require("../../../QueryBuilder/types/QueryBuilder.type.js"),require("../../../dropdown/Dropdown.js"),require("../../../QueryBuilder/components/InputLoader.js"),require("../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js"),require("react-chips"),require("../../../input/ChipInput.styled.js"),require("../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js"),require("../../../QueryBuilder/components/Connectors/Components/IgPicker.js"),require("../../../QueryBuilder/components/Connectors/Components/InTheLast.js"),require("../../../QueryBuilder/components/Connectors/Components/InTwoLast.js"),require("react-calendar"),require("../../../../utils/DateUtils.js"),require("../../../datePicker/DatePickerWrapper.styled.js"),require("../../../QueryBuilder/components/Connectors/Connector.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js"),require("../../../QueryBuilder/redux/queryBuilder.reducer.js"),require("../../../QueryBuilder/redux/queryBuilderCache.reducer.js"),require("../../../QueryBuilder/types/QueryBuilderOperator.type.js"),require("../../../dropdown/DropdownPopover/index.js"),require("../../../dropdown/ChipDropdown.js"),require("../../../dropdown/MenuItem/MenuItem.js"),require("../../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../analytics-card/AnalyticsCard.styled.js"),require("../../CommonStyles.js"),require("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var I=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../VerticalBarGraph/VerticalGraph.js"),require("../heatmap/HeatMap.js"),require("../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../../avatar/Avatar.js"),require("../../../avatar/AvatarHelper.js"),require("../../../alerts/Alert.styled.js"),require("../../../alerts/AlertHelper.js"),require("../../../thumbnail/Thumbnail.js"),require("../../../curtain/Curtain.styled.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.js"),require("../../../plans/SubscriptionPlansCollected.js"),require("../../../tabs/Tabs.js"),require("../../../TablePagination/TablePagination.styled.js"),require("../../../TablePagination/TablePaginationCard.js"),require("../../../states/StateComponent.js"),require("../../../../_virtual/_tslib.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditor.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),require("../../../card-selection-modal/CardSelectionModal.styled.js"),require("react-image-crop"),require("../../../buttonGroup/ButtonGroupStyle.js"),require("../../../accordion/Accordion.style.js"),require("../../../accordion/AccordionArrow.js"),require("../../../file-uploader/FileUploaderStyle.js"),require("../../../colourInput/ColourInput.styled.js"),require("../../../bik-layout/CommonStyles.js"),require("../../../navigation-hyperlink/NavigationHyperlink.js"),require("../../../bik-layout/SidebarStyles.js"),require("date-fns"),require("react-popper"),require("../../../dropdown/Common.styled.js"),require("../../../custom-date-time/CustomDateTime.styled.js"),require("../../../../node_modules/lodash.debounce/index.js"),require("../../../product-picker/ProductPicker.styled.js"),require("../../../discount-modal/type.js"),require("../../../product-picker-v2/modal.js"),require("../../../discount-modal/DiscountModal.styled.js"),require("../../../discount-modal/DynamicCoupon/DynamicCoupon.js"),require("../../../discount-modal/CouponExpiration/CouponExpiration.js"),require("../../../country-code-picker/CountryCodePicker.styled.js"),require("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.style.js"),require("../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js"),require("../../../radioList/RadioList.styled.js"),require("../../../checkList/CheckList.styled.js"),require("../../../postPicker/postPicker.js"),require("../../../dropdown-button/DropdownButton.style.js"),require("../../../side-modal/SideModal.style.js"),require("../../../add-variableV2/AddVariableV2.styled.js"),require("../../../modals/modal.styled.js"),require("../../../SearchFilter/types/SearchFilter.type.js"),require("../../../SearchFilter/components/DatePickerButton.js"),require("../../../SearchFilter/components/DateRangeOnlyButton.js"),require("../../../input-with-vars/InputWithVariables.js"),require("../../../star-rating/StarRating.js"),require("../../../dashboard-review-popup/components/FiveStar.styled.js"),require("../../../dashboard-review-popup/components/Form.styled.js"),require("../../../dashboard-review-popup/components/ZeroState.js"),require("../../../dashboard-review-popup/DashboardReviewPopUp.styled.js"),require("../../../testimonial-card/TestimonialCard.style.js"),require("../../../slider/slider.js"),require("../../../carousel-preview/CarouselPreview.js");var C=require("chart.js"),o=require("react-chartjs-2");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e);C.Chart.register(C.ArcElement,C.Legend);const l={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:e=>{if(!e.label)return" 0%";const r=e.dataset.data.reduce(((e,r)=>e+r),0),i=parseFloat((e.raw/r*100).toFixed(1));return` ${e.label}: ${i}%`}}}}},A=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],d=a.default("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(e=>t.COLORS.surface.standard),";border:1px solid ",(e=>t.COLORS.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQzhCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0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iAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEo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BwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>r.jsx(d,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:t,slices:C,size:c}=e;const[a,d]=g.useState([]),[u,n]=g.useState();return g.useEffect((()=>{const e=C.reduce(((e,r)=>e+r.count),0);let r=[];if(r=Object.keys(C).map(((e,r)=>Object.assign({color:A[r%A.length]},C[e]))),d([...r]),0===e){n({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:C.map((e=>i.default.capitalize(e.name))),datasets:[{data:C.map((e=>e.count)),backgroundColor:C.map(((e,r)=>{var i;return null!==(i=e.color)&&void 0!==i?i:A[r%A.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};n(e)}}),[C]),u?r.jsxs(r.Fragment,{children:[t&&r.jsx(s.TitleMedium,Object.assign({style:{marginBottom:16}},{children:t})),r.jsxs("div",Object.assign({className:"row"},{children:[r.jsx("div",Object.assign({className:"col-6"},{children:r.jsx("div",Object.assign({style:{width:c,height:c}},{children:r.jsx(o.Doughnut,{data:u,options:Object.assign(Object.assign({},l),{maintainAspectRatio:!c})})}))})),r.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:r.jsx(I.PieChart,{slices:a})}))]}))]}):r.jsx(r.Fragment,{})};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Menus: ({
3
2
  displayName: string;
4
3
  key: number;
@@ -0,0 +1,14 @@
1
+ import 'pure-react-carousel/dist/react-carousel.es.css';
2
+ import React from 'react';
3
+ import { CHANNEL_TYPE } from "../template-preview/models/Channels";
4
+ import { EmailTemplateType } from "../template-preview/models/EmailTemplate";
5
+ import { SMSTemplateType } from "../template-preview/models/SmsTemplate";
6
+ import { WhatsAppCarouselTemplate } from "../template-preview/models/WhatsappCarouselTemplate";
7
+ import { WhatsAppTemplate } from "../template-preview/models/WhatsAppTemplate";
8
+ export declare const CarouselPreview: React.ForwardRefExoticComponent<{
9
+ channel: CHANNEL_TYPE;
10
+ template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null;
11
+ showSampleValues?: boolean | undefined;
12
+ isPreview?: boolean | undefined;
13
+ cardWidth?: number | undefined;
14
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,52 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/chevronLeft.svg.js"),i=require("../../assets/icons/chevronRight.svg.js"),r=require("pure-react-carousel"),o=require("react"),n=require("styled-components"),s=require("./CarouselPreviewCard.js"),a=require("../../constants/Theme.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(o),c=l(n);const u=c.default.div`
2
+ background-image: url('https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f');
3
+ border-color: ${a.COLORS.stroke.primary};
4
+ border-top-style: solid;
5
+ border-bottom-style: solid;
6
+ border-top-width: 1px;
7
+ border-bottom-width: 1px;
8
+ background-repeat: no-repeat;
9
+ background-position: center;
10
+ background-size: cover;
11
+ position: relative;
12
+ height: 500px;
13
+ overflow-y: auto;
14
+ `,p=c.default.div`
15
+ flex-direction: row;
16
+ display: flex;
17
+ align-items: center;
18
+ .left_button {
19
+ border-radius: 50%;
20
+ width: 24px;
21
+ height: 24px;
22
+ align-items: center;
23
+ justify-content: center;
24
+ display: flex;
25
+ position: absolute;
26
+ left: 0;
27
+ z-index: 10;
28
+ margin-left: 4px;
29
+ border: none;
30
+ background-color: white;
31
+ box-shadow: 0px 1.5px 6px 0px #0000001f;
32
+ }
33
+ .right_button {
34
+ border-radius: 50%;
35
+ width: 24px;
36
+ height: 24px;
37
+ align-items: center;
38
+ justify-content: center;
39
+ display: flex;
40
+ position: absolute;
41
+ right: 0;
42
+ z-index: 10;
43
+ margin-right: 4px;
44
+ border: none;
45
+ background-color: white;
46
+ box-shadow: 0px 1.5px 6px 0px #0000001f;
47
+ }
48
+ .slider {
49
+ width: 100%;
50
+ height: 480px;
51
+ }
52
+ `,h=d.default.forwardRef(((o,n)=>{let{channel:l,template:d,showSampleValues:c,isPreview:h,cardWidth:b}=o;var x,g,v,f;const m=null===(x=null==d?void 0:d.components)||void 0===x?void 0:x[1].cards;return e.jsxs(u,{children:[e.jsx(s.default,{channel:l,template:d,carouselCardIndex:-1,isPreview:h,width:b}),!!(null==m?void 0:m.length)&&e.jsx(r.CarouselProvider,Object.assign({naturalSlideWidth:100,naturalSlideHeight:125,totalSlides:null!==(g=null==m?void 0:m.length)&&void 0!==g?g:1,orientation:"horizontal",visibleSlides:1.3,dragEnabled:!0,touchEnabled:!0},{children:e.jsxs(p,{children:[e.jsx(r.ButtonBack,Object.assign({className:"left_button"},{children:e.jsx(t.default,{height:10,width:10,color:a.COLORS.content.primary})})),e.jsx(r.Slider,Object.assign({className:"slider"},{children:null===(f=null===(v=null==d?void 0:d.components)||void 0===v?void 0:v[1].cards)||void 0===f?void 0:f.map(((t,i)=>{var o,n;const a={components:t.components,mapping:null===(n=null===(o=null==d?void 0:d.mapping)||void 0===o?void 0:o.cards)||void 0===n?void 0:n[i]};return e.jsx(r.Slide,Object.assign({index:i},{children:e.jsx(s.default,{channel:l,template:a,carouselCardIndex:i,isPreview:h,width:b},i)}),i)}))})),e.jsx(r.ButtonNext,Object.assign({className:"right_button"},{children:e.jsx(i.default,{height:10,width:10,color:a.COLORS.content.primary})}))]})}))]})}));exports.CarouselPreview=h;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { CHANNEL_TYPE } from "../template-preview/models/Channels";
3
+ declare const CarouselPreviewCard: React.ForwardRefExoticComponent<{
4
+ channel: CHANNEL_TYPE;
5
+ template: any;
6
+ showSampleValues?: boolean | undefined;
7
+ carouselCardIndex?: number | undefined;
8
+ isPreview?: boolean | undefined;
9
+ width?: number | undefined;
10
+ } & React.RefAttributes<HTMLDivElement>>;
11
+ export default CarouselPreviewCard;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../template-context-mapper/context/templateModalContext.js"),a=require("../template-preview/TemplatePreview.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../constants/Theme.js"),require("../curtain/CurtainHelper.js"),require("../template-preview/models/TemplateMeta.js"),require("../template-preview/models/WhatsAppTemplate.js");const i=s(t).default.forwardRef((t=>{let{channel:s,template:i,showSampleValues:p,carouselCardIndex:l,isPreview:u,width:n}=t;const{cardWidth:o}=r.useTemplateModalContext();return e.jsx("div",Object.assign({style:{width:n||(o||360)}},{children:e.jsx(a.TemplatePreview,{showSampleValues:p,template:i,channel:s,size:"small",hideHeader:!0,carouselCardIndex:l,isWhatsappCarousel:!0,isPreview:u})}))}));exports.default=i;
@@ -0,0 +1 @@
1
+ export * from './CarouselPreview';
@@ -8,5 +8,11 @@ export declare const SIZE_LIMIT_MAP: {
8
8
  };
9
9
  export declare const SUPPORTED_FILE_FORMAT: string[];
10
10
  export declare class FileUploaderHelper {
11
- validate(file: Blob): string | undefined;
11
+ validate(inputData: {
12
+ file?: Blob;
13
+ linkData?: {
14
+ type: string;
15
+ size: number;
16
+ };
17
+ }): string | undefined;
12
18
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/bytesToMB.js");const r="File type no supported",t=e=>`Max file size of ${e}MB is allowed`,p=e=>`Only ${e.toUpperCase()} format allowed`,o={image:5,video:16,application:100},i=["mp4","png","jpeg","jpg","pdf"];exports.FILE_SIZE_REACHED=t,exports.FILE_TYPE_NOT_SUPPORT=r,exports.FileUploaderHelper=class{validate(s){const a=s.size,[l,n]=s.type.split("/");if(!o[l])return r;if(e.bytesToMB(a)>o[l])return t(o[l]);if(!i.includes(n.toLocaleLowerCase())){if("video"===l)return p("mp4");if("image"===l)return p("png, jpeg, jpg");if("application"===l)return p("pdf")}}},exports.SIZE_LIMIT_MAP=o,exports.SUPPORTED_FILE_FORMAT=i,exports.getFileFormatErrorMessage=p;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/bytesToMB.js");const t="File type no supported",p=e=>`Max file size of ${e}MB is allowed`,i=e=>`Only ${e.toUpperCase()} format allowed`,r={image:5,video:16,application:100},s=["mp4","png","jpeg","jpg","pdf"];exports.FILE_SIZE_REACHED=p,exports.FILE_TYPE_NOT_SUPPORT=t,exports.FileUploaderHelper=class{validate(o){const{file:l,linkData:a}=o;let n=0,f="",u="";if(l)n=l.size,f=l.type.split("/")[0],u=l.type.split("/")[1];else{if(!a)return t;n=a.size,f=a.type.split("/")[0],u=a.type.split("/")[1]}if(!r[f])return t;if(e.bytesToMB(n)>r[f])return p(r[f]);if(!s.includes(u.toLocaleLowerCase())){if("video"===f)return i("mp4");if("image"===f)return i("png, jpeg, jpg");if("application"===f)return i("pdf")}}},exports.SIZE_LIMIT_MAP=r,exports.SUPPORTED_FILE_FORMAT=s,exports.getFileFormatErrorMessage=i;
@@ -75,6 +75,7 @@ export type ProductPickerInterface = {
75
75
  pickerType?: 'COLLECTION' | 'PRODUCT';
76
76
  hideProductVariants?: boolean;
77
77
  rearrangeEnabled?: boolean;
78
+ selectSingleItem?: boolean;
78
79
  } & ({
79
80
  startupScreen: ScreenName.RearrangeProducts;
80
81
  rearrangeEnabled: true;
@@ -1 +1 @@
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"),i=require("../modals/styledModal.js"),l=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"),x=require("./selectedScreen.js"),C=require("./style.js"),g=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:y,visible:b,zIndex:v,exactLimit:P,limit:f,hideCollectionCheckbox:k,hideProductCheckbox:T,outOfStockAction:O=g.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:R,selectProductsFromCustomCollection:F,hideSelectionCount:I,title:q,width:E,renderWithoutModal:D,onClickSave:N,pickerType:w,hideProductVariants:$=!1,startupScreen:A=exports.ScreenName.Collections,rearrangeEnabled:B}=e,[M,V]=c.useReducer(p.collectionsReducer,{}),[L,_]=c.useState([exports.ScreenName.Collections,exports.ScreenName.RearrangeProducts].includes(A)?A:exports.ScreenName.Collections),[z,G]=c.useState("grid"),[H,W]=c.useState(""),[K,U]=c.useState(0),[Y,J]=c.useState(!1),[Q,X]=c.useState(0),[Z,ee]=c.useState(""),[te,re]=c.useState(!1),[ce,oe]=c.useState(!1),[se,ne]=c.useState(),[ie,le]=c.useReducer(p.selectedColectionsReducer,Object.keys(m).length>0?m:{}),ae=c.useRef(null);c.useEffect((()=>{J(!0),oe(!0),e.collectionFetcher(K,j).then((e=>{V({type:"fetched",data:(null==e?void 0:e.collections)||{}}),J(!1),U((e=>e+1)),oe(!1)})).catch()}),[]),c.useEffect((()=>{let e=0;Object.keys(ie||[]).forEach((t=>{var r;Object.keys((null===(r=ie[t])||void 0===r?void 0:r.products)||[]).forEach((r=>{var c,o;Object.keys((null===(o=null===(c=ie[t].products)||void 0===c?void 0:c[r])||void 0===o?void 0:o.variants)||[]).forEach((()=>{e+=1}))}))})),X(e)})),c.useEffect((()=>{var t;H&&!(null===(t=null==M?void 0:M[H])||void 0===t?void 0:t.products)&&(J(!0),e.productFetcher(H,j).then((e=>{Object.keys(e).length&&V({type:"productsFetched",data:{collectionId:H,products:e}}),J(!1)})).catch())}),[H]),c.useEffect((()=>{const t=setTimeout((()=>{"rearrange"!==L&&(Z.length?(re(!0),e.searchFetcher(j,Z).then((e=>{ne(Object.assign({},e)),_("searchProducts"),J(!1),re(!1)}))):_("collections"))}),800);return()=>clearTimeout(t)}),[Z]),c.useEffect((()=>{N&&(e.onAdd(ie,Q),de())}),[N]);const de=()=>{le({type:"reset",data:{}})},ue=t.jsxs(C.ContainerStyle,{children:[e.postHeader&&t.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:e.postHeader})),!e.hideGlobalSearch&&t.jsx(t.Fragment,{children:("collections"===L||"searchProducts"===L)&&t.jsx("div",Object.assign({style:{padding:D?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t.jsx(n.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>te?t.jsx(l.Spinner,{size:"small",color:o.COLORS.content.primary}):t.jsx(r.default,{})},id:"listInput",height:"24px",type:"text",value:Z,onChangeText:e=>{e.length&&e.trim().length?ee(e):ee("")}})}))}),t.jsxs(C.ScrollContainerStyle,Object.assign({ref:ae},{children:["collections"===L&&t.jsx(d.CollectionsScreen,{customCollectionRestriction:e.customCollectionRestriction,dataLoading:ce,collections:M,selectedCollectionsDispatch:le,setCollectionId:W,setScreen:_,selectedCollections:ie,collectionFetcher:e.collectionFetcher,storeId:j,collectionsDispatch:V,setSaveDisabled:J,pagingControls:{curPage:K,setCurPage:U},hideCollectionCheckbox:k,renderWithoutModal:D,pickerType:w}),"products"===L&&H&&t.jsx(p.CollectionIdContext.Provider,Object.assign({value:H},{children:t.jsx(u.ProductsScreen,{hideInCollectionSearch:e.hideInCollectionSearch,customCollectionRestriction:e.customCollectionRestriction,productFetcher:e.productFetcher,setScreen:_,storeId:j,data:M[H],collectionsDispatch:V,selectedCollectionsDispatch:le,selectedData:ie,setSaveDisabled:J,searchInCollectionFetcher:e.searchInCollectionFetcher,hideProductCheckbox:T,outOfStockAction:O,hideVariantCheckbox:R,selectProductsFromCustomCollection:F,renderWithoutModal:D,pickerType:w,hideProductVariants:$})})),"view"===L&&t.jsx(x.SelectedScreen,{selectedCollections:ie||{},selectedCollectionsDispatch:le,setScreen:_,collections:M}),"rearrange"===L&&t.jsx(h.RearrangeScreen,{selectedCollections:ie||{},selectedCollectionsDispatch:le,setScreen:_,outOfStockAction:O,rearrangeViewType:"grid"===z?"list":"grid",scrollContainerRef:ae}),"searchProducts"===L&&t.jsx(S.SearchScreen,{customCollectionRestriction:e.customCollectionRestriction,selectedCollections:ie||{},searchedCollections:se||{},selectedCollectionsDispatch:le,setScreen:_,collections:M,onBackPress:()=>{ee(""),ne({})},pickerType:w,hideProductCheckbox:T,hideProductVariants:$,hideVariantCheckbox:R})]}))]});return t.jsx(t.Fragment,{children:D?ue:t.jsx(i.StyledModal,Object.assign({zIndex:v,open:b,onClose:()=>{null==y||y(),de()},headingTitle:q||("collections"===L||"products"===L?"Select Products":"view"===L?"Selected Products":"searchProducts"===L?"Searched Products":"rearrange"===L?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:E||"480px"},headerRightCustomElement:"rearrange"===L?(console.log("ignore:",G),t.jsx(t.Fragment,{})):t.jsx(t.Fragment,{}),primaryButton:{buttonText:Y?"Loading...":L===exports.ScreenName.RearrangeProducts?"Done":"Add",disabled:Y||Q<1||P&&Q<P||!P&&f&&Q>f||!1,onClick:()=>{e.onAdd(ie,Q),de()}},footerLeftCustomElement:I?t.jsx(t.Fragment,{}):P&&Q>P?t.jsx(a.Tag,{tagText:`You can only select ${P} products`,type:"negative"}):f&&Q>f?t.jsx(a.Tag,{tagText:`You can only select ${f} products`,type:"negative"}):Q>0?t.jsx(s.Button,{onClick:()=>{_(B?exports.ScreenName.RearrangeProducts:exports.ScreenName.SelectedProducts)},buttonText:P?`${Q}/${P} products selected`:`${Q} products selected`,buttonType:["rearrange","view"].includes(L)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(L)}):t.jsx(s.Button,{disabled:!0,buttonText:P?`${Q}/${P} products selected`:`${Q} products selected`,buttonType:"tertiaryGray"})},{children:ue}))})};
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"),i=require("../modals/styledModal.js"),l=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"),x=require("./selectedScreen.js"),g=require("./style.js"),C=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:y,visible:b,zIndex:v,exactLimit:P,limit:f,hideCollectionCheckbox:k,hideProductCheckbox:T,outOfStockAction:O=C.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:R,selectProductsFromCustomCollection:I,hideSelectionCount:F,title:q,width:E,renderWithoutModal:D,onClickSave:N,pickerType:w,hideProductVariants:A=!1,startupScreen:$=exports.ScreenName.Collections,rearrangeEnabled:B,selectSingleItem:M=!1}=e,[V,L]=c.useReducer(p.collectionsReducer,{}),[_,z]=c.useState([exports.ScreenName.Collections,exports.ScreenName.RearrangeProducts].includes($)?$:exports.ScreenName.Collections),[G,H]=c.useState("grid"),[W,K]=c.useState(""),[U,Y]=c.useState(0),[J,Q]=c.useState(!1),[X,Z]=c.useState(0),[ee,te]=c.useState(""),[re,ce]=c.useState(!1),[oe,se]=c.useState(!1),[ne,ie]=c.useState(),[le,ae]=c.useReducer(p.selectedColectionsReducer,Object.keys(m).length>0?m:{}),de=c.useRef(null);c.useEffect((()=>{Q(!0),se(!0),e.collectionFetcher(U,j).then((e=>{L({type:"fetched",data:(null==e?void 0:e.collections)||{}}),Q(!1),Y((e=>e+1)),se(!1)})).catch()}),[]),c.useEffect((()=>{let e=0;Object.keys(le||[]).forEach((t=>{var r;Object.keys((null===(r=le[t])||void 0===r?void 0:r.products)||[]).forEach((r=>{var c,o;Object.keys((null===(o=null===(c=le[t].products)||void 0===c?void 0:c[r])||void 0===o?void 0:o.variants)||[]).forEach((()=>{e+=1}))}))})),Z(e)})),c.useEffect((()=>{var t;W&&!(null===(t=null==V?void 0:V[W])||void 0===t?void 0:t.products)&&(Q(!0),e.productFetcher(W,j).then((e=>{Object.keys(e).length&&L({type:"productsFetched",data:{collectionId:W,products:e}}),Q(!1)})).catch())}),[W]),c.useEffect((()=>{const t=setTimeout((()=>{"rearrange"!==_&&(ee.length?(ce(!0),e.searchFetcher(j,ee).then((e=>{ie(Object.assign({},e)),z("searchProducts"),Q(!1),ce(!1)}))):z("collections"))}),800);return()=>clearTimeout(t)}),[ee]),c.useEffect((()=>{N&&(e.onAdd(le,X),ue())}),[N]),c.useEffect((()=>{M&&Object.keys(le||{}).length&&X&&(e.onAdd(le,X),ue())}),[M,le,X]);const ue=()=>{ae({type:"reset",data:{}})},he=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"===_||"searchProducts"===_)&&t.jsx("div",Object.assign({style:{padding:D?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t.jsx(n.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>re?t.jsx(l.Spinner,{size:"small",color:o.COLORS.content.primary}):t.jsx(r.default,{})},id:"listInput",height:"24px",type:"text",value:ee,onChangeText:e=>{e.length&&e.trim().length?te(e):te("")}})}))}),t.jsxs(g.ScrollContainerStyle,Object.assign({ref:de},{children:["collections"===_&&t.jsx(d.CollectionsScreen,{customCollectionRestriction:e.customCollectionRestriction,dataLoading:oe,collections:V,selectedCollectionsDispatch:ae,setCollectionId:K,setScreen:z,selectedCollections:le,collectionFetcher:e.collectionFetcher,storeId:j,collectionsDispatch:L,setSaveDisabled:Q,pagingControls:{curPage:U,setCurPage:Y},hideCollectionCheckbox:k,renderWithoutModal:D,pickerType:w}),"products"===_&&W&&t.jsx(p.CollectionIdContext.Provider,Object.assign({value:W},{children:t.jsx(u.ProductsScreen,{hideInCollectionSearch:e.hideInCollectionSearch,customCollectionRestriction:e.customCollectionRestriction,productFetcher:e.productFetcher,setScreen:z,storeId:j,data:V[W],collectionsDispatch:L,selectedCollectionsDispatch:ae,selectedData:le,setSaveDisabled:Q,searchInCollectionFetcher:e.searchInCollectionFetcher,hideProductCheckbox:T,outOfStockAction:O,hideVariantCheckbox:R,selectProductsFromCustomCollection:I,renderWithoutModal:D,pickerType:w,hideProductVariants:A})})),"view"===_&&t.jsx(x.SelectedScreen,{selectedCollections:le||{},selectedCollectionsDispatch:ae,setScreen:z,collections:V}),"rearrange"===_&&t.jsx(h.RearrangeScreen,{selectedCollections:le||{},selectedCollectionsDispatch:ae,setScreen:z,outOfStockAction:O,rearrangeViewType:"grid"===G?"list":"grid",scrollContainerRef:de}),"searchProducts"===_&&t.jsx(S.SearchScreen,{customCollectionRestriction:e.customCollectionRestriction,selectedCollections:le||{},searchedCollections:ne||{},selectedCollectionsDispatch:ae,setScreen:z,collections:V,onBackPress:()=>{te(""),ie({})},pickerType:w,hideProductCheckbox:T,hideProductVariants:A,hideVariantCheckbox:R})]}))]});return t.jsx(t.Fragment,{children:D?he:t.jsx(i.StyledModal,Object.assign({zIndex:v,open:b,onClose:()=>{null==y||y(),ue()},headingTitle:q||("collections"===_||"products"===_?"Select Products":"view"===_?"Selected Products":"searchProducts"===_?"Searched Products":"rearrange"===_?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:E||"480px"},headerRightCustomElement:"rearrange"===_?(console.log("ignore:",H),t.jsx(t.Fragment,{})):t.jsx(t.Fragment,{}),primaryButton:{buttonText:J?"Loading...":_===exports.ScreenName.RearrangeProducts?"Done":"Add",disabled:J||X<1||P&&X<P||!P&&f&&X>f||!1,onClick:()=>{e.onAdd(le,X),ue()}},footerLeftCustomElement:F?t.jsx(t.Fragment,{}):P&&X>P?t.jsx(a.Tag,{tagText:`You can only select ${P} products`,type:"negative"}):f&&X>f?t.jsx(a.Tag,{tagText:`You can only select ${f} products`,type:"negative"}):X>0?t.jsx(s.Button,{onClick:()=>{z(B?exports.ScreenName.RearrangeProducts:exports.ScreenName.SelectedProducts)},buttonText:P?`${X}/${P} products selected`:`${X} products selected`,buttonType:["rearrange","view"].includes(_)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(_)}):t.jsx(s.Button,{disabled:!0,buttonText:P?`${X}/${P} products selected`:`${X} products selected`,buttonType:"tertiaryGray"})},{children:he}))})};
@@ -1,21 +1,27 @@
1
+ import 'pure-react-carousel/dist/react-carousel.es.css';
1
2
  import { VariableListInterfaceV2 } from "../add-variableV2/AddVariableV2";
3
+ import { CarouselProduct } from "./modalElements/EditWhatsAppCarouselTemplateV2";
4
+ import { WhatsAppCarouselTemplate, WhatsAppCarouselTemplateVariables } from "../template-preview/models/WhatsappCarouselTemplate";
2
5
  import { CHANNEL_TYPE } from '../template-preview/models/Channels';
3
6
  import { EmailTemplateType } from '../template-preview/models/EmailTemplate';
4
7
  import { SMSTemplateType } from '../template-preview/models/SmsTemplate';
5
8
  import { CUSTOM_VARIABLE, GlobalPlaceholderType } from '../template-preview/models/TemplateMeta';
6
9
  import { ExtrasWhatsapp, POD, WhatsAppPickerMeta, WhatsAppTemplate, WhatsAppTemplateVariables } from '../template-preview/models/WhatsAppTemplate';
7
10
  export interface TemplateContextMapperProps {
8
- selectedTemplate: WhatsAppTemplate | EmailTemplateType | SMSTemplateType;
11
+ selectedTemplate: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate;
9
12
  closeDialog?: () => void;
10
13
  showVariableMapping: boolean;
11
14
  channel: CHANNEL_TYPE;
12
15
  globalPlaceholders: GlobalPlaceholderType;
13
16
  /** List of variables being used in this template */
14
- templateVariables: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables;
17
+ templateVariables: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables;
15
18
  /** Only for initial-UI-purpose for the modal */
16
19
  htmlContent: string;
17
20
  showOnlyContent?: boolean;
18
- onTemplateSelect?(template: EmailTemplateType | SMSTemplateType | WhatsAppTemplate, variables: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables, display_content?: string): string | void;
21
+ onTemplateSelect?(template: EmailTemplateType | SMSTemplateType | WhatsAppTemplate | WhatsAppCarouselTemplate, variables: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables, display_content?: string, carouselProducts?: CarouselProduct[]): {
22
+ error: string;
23
+ errorIndexes: number[];
24
+ } | void;
19
25
  whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
20
26
  zIndex?: number;
21
27
  showVariableModal?: boolean;
@@ -29,5 +35,16 @@ export interface TemplateContextMapperProps {
29
35
  disableEditVariable?: boolean;
30
36
  pod?: POD;
31
37
  extras?: ExtrasWhatsapp;
38
+ pickerConf?: {
39
+ searchInCollection: any;
40
+ searchProducts: any;
41
+ fetchCollections: any;
42
+ fetchProducts: any;
43
+ storeId: string;
44
+ };
45
+ selectedCarouselProducts?: CarouselProduct[];
46
+ disableEditExpiry?: boolean;
47
+ cardWidth?: number;
48
+ onDeleteSelectedProducts?: () => void;
32
49
  }
33
- export declare const TemplateContextMapper: ({ selectedTemplate, closeDialog, showVariableMapping, channel, htmlContent, templateVariables, onTemplateSelect, globalPlaceholders, showOnlyContent, whatsappSpecificPickerMeta, zIndex, showVariableModal, variableList, discountCode, setDiscountCode, onBackPress, enabledCustomText, variableListForImage, showSampleValues, disableEditVariable, pod, extras, }: TemplateContextMapperProps) => import("react/jsx-runtime").JSX.Element;
50
+ export declare const TemplateContextMapper: ({ selectedTemplate, closeDialog, showVariableMapping, channel, htmlContent, templateVariables, onTemplateSelect, globalPlaceholders, showOnlyContent, whatsappSpecificPickerMeta, zIndex, showVariableModal, variableList, discountCode, setDiscountCode, onBackPress, enabledCustomText, variableListForImage, showSampleValues, disableEditVariable, pod, extras, pickerConf, selectedCarouselProducts, disableEditExpiry, cardWidth, onDeleteSelectedProducts, }: 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"),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:u,closeDialog:c,showVariableMapping:p,channel:m,htmlContent:h,templateVariables:b,onTemplateSelect:g,globalPlaceholders:v,showOnlyContent:C,whatsappSpecificPickerMeta:S,zIndex:x,showVariableModal:T,variableList:E,discountCode:j,setDiscountCode:M,onBackPress:P,enabledCustomText:L,variableListForImage:w,showSampleValues:f,disableEditVariable:V,pod:q,extras:y}=d;var A,N;t.useEffect((()=>{_(h)}),[h]);const[I,k]=t.useState(m===s.CHANNEL_TYPE.EMAIL?"desktop":"mobile"),[D,_]=t.useState(h),[H,O]=t.useState(!1),[F,B]=t.useState(u),[Y,z]=t.useState(null!=b?b:[]),[$,U]=t.useState(!1);const W=t.useMemo((()=>n.convertPlaceholdersToBikDropdown(v)),[v]);return e.jsx(i.TemplateModalContext.Provider,Object.assign({value:{template:F,setTemplate:B,device:I,setDevice:k,display_content:D,setDisplayContent:_,originalVariableList:Y,setOriginalVariableList:z,isError:H,setIsError:O,channel:m,globalNormalizedPlaceholders:W,templateSelectionTriggered:$,setTemplateSelectionTriggered:U,enabledCustomText:L,disableEditVariable:V,pod:q,extras:y}},{children:C?e.jsx(r.default,{channel:s.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:x,centralContainerStyles:{width:m===s.CHANNEL_TYPE.EMAIL&&p?1e3:800},open:!0,onClose:()=>{null==c||c()},headingTitle:null==F?void 0:F.label,headingSubtitle:m===s.CHANNEL_TYPE.WHATSAPP?`${l.default.capitaliseFirstLetterOfString(null!==(A=null==F?void 0:F.category)&&void 0!==A?A:"")} • ${null!==(N=null==F?void 0:F.templateCategory)&&void 0!==N?N:""}`:"",onBackPress:()=>{null==P||P()}},{children:[e.jsx(r.default,{showSampleValues:f,showVariableMapping:p,channel:m,whatsappSpecificPickerMeta:S,showVariableModal:T,variableList:E,discountCode:j,setDiscountCode:M,variableListForImage:w&&(null==w?void 0:w.length)>0?w:E}),g?e.jsx(o.default,{onSelect:function(){const e=null==g?void 0:g(F,Y,null!=D?D:"");e?O(!!e):U(!0)}}):e.jsx(e.Fragment,{})]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),t=require("../../utils/StringUtils.js"),o=require("../modals/styledModal.js"),a=require("../template-preview/models/Channels.js"),r=require("./context/templateModalContext.js"),s=require("./modalElements/Footer.js"),i=require("./modalElements/TemplateSelectModalContent.js"),n=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=d=>{let{selectedTemplate:u,closeDialog:c,showVariableMapping:p,channel:v,htmlContent:h,templateVariables:m,onTemplateSelect:C,globalPlaceholders:E,showOnlyContent:S,whatsappSpecificPickerMeta:x,zIndex:b,showVariableModal:g,variableList:P,discountCode:T,setDiscountCode:f,onBackPress:j,enabledCustomText:M,variableListForImage:I,showSampleValues:L,disableEditVariable:y,pod:A,extras:w,pickerConf:N,selectedCarouselProducts:V,disableEditExpiry:D,cardWidth:k,onDeleteSelectedProducts:q}=d;var H,_,O,W,F,Y;l.useEffect((()=>{G(h)}),[h]);const B=v===a.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(_=null===(H=u.components)||void 0===H?void 0:H[1])||void 0===_?void 0:_.type),z=u.isProductCarouselType,[R,U]=l.useState(v===a.CHANNEL_TYPE.EMAIL||B?"desktop":"mobile"),[$,G]=l.useState(h),[J,K]=l.useState(!1),[Q,X]=l.useState([]),[Z,ee]=l.useState(u),[le,te]=l.useState([]),[oe,ae]=l.useState(!1),[re,se]=l.useState(null!=m?m:[]),[ie,ne]=l.useState(!1),[de,ue]=l.useState(-1),[ce,pe]=l.useState([]);l.useEffect((()=>{V?pe(V):z&&pe([])}),[V]),l.useEffect((()=>{var e;if(!oe&&z){const l=null===(e=null==Z?void 0:Z.components)||void 0===e?void 0:e[1].cards,t=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,o,a;"HEADER"===e.type&&t.push(null!==(a=null===(o=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===o?void 0:o[0])&&void 0!==a?a:"")}))})),te(t),ae(!0)}}),[oe]);const ve=l.useMemo((()=>n.convertPlaceholdersToBikDropdown(E)),[E]);return e.jsx(r.TemplateModalContext.Provider,Object.assign({value:{template:Z,setTemplate:ee,device:R,setDevice:U,display_content:$,setDisplayContent:G,originalVariableList:re,setOriginalVariableList:se,isError:J,setIsError:K,channel:v,globalNormalizedPlaceholders:ve,templateSelectionTriggered:ie,setTemplateSelectionTriggered:ne,enabledCustomText:M,disableEditVariable:y,pod:A,extras:w,isWhatsappCarousel:B,selectedCarouselIndex:de,setSelectedCarouselIndex:ue,isProductCarouselType:z,cardCount:null===(W=null===(O=u.components)||void 0===O?void 0:O[1].cards)||void 0===W?void 0:W.length,errorIndexes:Q,setErrorIndexes:X,pickerConf:N,carouselProducts:ce,setCarouselProducts:pe,disableEditExpiry:D,cardWidth:k,cardImages:le,onDeleteSelectedProducts:q}},{children:S?e.jsx(i.default,{channel:a.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(o.StyledModal,Object.assign({zIndex:b,centralContainerStyles:{width:B?900:v===a.CHANNEL_TYPE.EMAIL&&p?1e3:800},open:!0,onClose:()=>{null==c||c()},headingTitle:null==Z?void 0:Z.label,headingSubtitle:v===a.CHANNEL_TYPE.WHATSAPP?`${t.default.capitaliseFirstLetterOfString(null!==(F=null==Z?void 0:Z.category)&&void 0!==F?F:"")} • ${null!==(Y=null==Z?void 0:Z.templateCategory)&&void 0!==Y?Y:""}`:"",onBackPress:()=>{null==j||j()}},{children:[e.jsx(i.default,{showSampleValues:L,showVariableMapping:p,channel:v,whatsappSpecificPickerMeta:x,showVariableModal:g,variableList:P,discountCode:T,setDiscountCode:f,variableListForImage:I&&(null==I?void 0:I.length)>0?I:P}),C?e.jsx(s.default,{isWhatsappCarousel:null!=B&&B,onSelect:function(){if((null==ce?void 0:ce.length)<1&&z)return void K(!0);const e=null==C?void 0:C(Z,re,null!=$?$:"",ce);(null==e?void 0:e.errorIndexes)||(null==e?void 0:e.error)?((null==e?void 0:e.errorIndexes)&&X(e.errorIndexes),(null==e?void 0:e.error)&&K(!!(null==e?void 0:e.error))):ne(!0)}}):e.jsx(e.Fragment,{})]}))}))};
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
+ import { CarouselProduct } from "../modalElements/EditWhatsAppCarouselTemplateV2";
2
3
  import { CHANNEL_TYPE } from "../../template-preview/models/Channels";
3
4
  import { EmailTemplateType } from "../../template-preview/models/EmailTemplate";
4
5
  import { SMSTemplateType } from "../../template-preview/models/SmsTemplate";
5
6
  import { CUSTOM_VARIABLE, globalNormalizedPlaceholdersType } from "../../template-preview/models/TemplateMeta";
7
+ import { WhatsAppCarouselTemplate, WhatsAppCarouselTemplateVariables } from "../../template-preview/models/WhatsappCarouselTemplate";
6
8
  import { ExtrasWhatsapp, WhatsAppTemplate, WhatsAppTemplateVariables } from "../../template-preview/models/WhatsAppTemplate";
7
9
  export type DEVICE_TYPES = 'desktop' | 'mobile';
8
10
  export declare const TemplateModalContext: React.Context<{
@@ -10,12 +12,12 @@ export declare const TemplateModalContext: React.Context<{
10
12
  setDevice?: React.Dispatch<React.SetStateAction<DEVICE_TYPES>> | undefined;
11
13
  display_content: string | null;
12
14
  setDisplayContent?: React.Dispatch<React.SetStateAction<string | null>> | undefined;
13
- originalVariableList: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables;
14
- setOriginalVariableList?: React.Dispatch<React.SetStateAction<WhatsAppTemplateVariables | CUSTOM_VARIABLE[]>> | undefined;
15
+ originalVariableList: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables;
16
+ setOriginalVariableList?: React.Dispatch<React.SetStateAction<WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables | CUSTOM_VARIABLE[]>> | undefined;
15
17
  channel: CHANNEL_TYPE;
16
18
  setChannel?: React.Dispatch<React.SetStateAction<CHANNEL_TYPE>> | undefined;
17
- template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | null;
18
- setTemplate?: React.Dispatch<React.SetStateAction<WhatsAppTemplate | EmailTemplateType | SMSTemplateType | null>> | undefined;
19
+ template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null;
20
+ setTemplate?: React.Dispatch<React.SetStateAction<WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null>> | undefined;
19
21
  isError: boolean;
20
22
  setIsError?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
21
23
  globalNormalizedPlaceholders?: globalNormalizedPlaceholdersType[] | undefined;
@@ -25,18 +27,38 @@ export declare const TemplateModalContext: React.Context<{
25
27
  disableEditVariable?: boolean | undefined;
26
28
  pod?: string | undefined;
27
29
  extras?: ExtrasWhatsapp | undefined;
30
+ isWhatsappCarousel?: boolean | undefined;
31
+ selectedCarouselIndex?: number | undefined;
32
+ setSelectedCarouselIndex?: React.Dispatch<React.SetStateAction<number>> | undefined;
33
+ isProductCarouselType?: boolean | undefined;
34
+ cardCount?: number | undefined;
35
+ errorIndexes?: number[] | undefined;
36
+ setErrorIndexes?: React.Dispatch<React.SetStateAction<number[]>> | undefined;
37
+ pickerConf?: {
38
+ searchInCollection: any;
39
+ searchProducts: any;
40
+ fetchCollections: any;
41
+ fetchProducts: any;
42
+ storeId: string;
43
+ } | undefined;
44
+ carouselProducts?: CarouselProduct[] | undefined;
45
+ setCarouselProducts?: React.Dispatch<React.SetStateAction<CarouselProduct[]>> | undefined;
46
+ disableEditExpiry?: boolean | undefined;
47
+ cardWidth?: number | undefined;
48
+ cardImages?: string[] | undefined;
49
+ onDeleteSelectedProducts?: (() => void) | undefined;
28
50
  }>;
29
51
  export declare const useTemplateModalContext: () => {
30
52
  device: DEVICE_TYPES;
31
53
  setDevice?: React.Dispatch<React.SetStateAction<DEVICE_TYPES>> | undefined;
32
54
  display_content: string | null;
33
55
  setDisplayContent?: React.Dispatch<React.SetStateAction<string | null>> | undefined;
34
- originalVariableList: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables;
35
- setOriginalVariableList?: React.Dispatch<React.SetStateAction<WhatsAppTemplateVariables | CUSTOM_VARIABLE[]>> | undefined;
56
+ originalVariableList: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables;
57
+ setOriginalVariableList?: React.Dispatch<React.SetStateAction<WhatsAppTemplateVariables | WhatsAppCarouselTemplateVariables | CUSTOM_VARIABLE[]>> | undefined;
36
58
  channel: CHANNEL_TYPE;
37
59
  setChannel?: React.Dispatch<React.SetStateAction<CHANNEL_TYPE>> | undefined;
38
- template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | null;
39
- setTemplate?: React.Dispatch<React.SetStateAction<WhatsAppTemplate | EmailTemplateType | SMSTemplateType | null>> | undefined;
60
+ template: WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null;
61
+ setTemplate?: React.Dispatch<React.SetStateAction<WhatsAppTemplate | EmailTemplateType | SMSTemplateType | WhatsAppCarouselTemplate | null>> | undefined;
40
62
  isError: boolean;
41
63
  setIsError?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
42
64
  globalNormalizedPlaceholders?: globalNormalizedPlaceholdersType[] | undefined;
@@ -46,4 +68,24 @@ export declare const useTemplateModalContext: () => {
46
68
  disableEditVariable?: boolean | undefined;
47
69
  pod?: string | undefined;
48
70
  extras?: ExtrasWhatsapp | undefined;
71
+ isWhatsappCarousel?: boolean | undefined;
72
+ selectedCarouselIndex?: number | undefined;
73
+ setSelectedCarouselIndex?: React.Dispatch<React.SetStateAction<number>> | undefined;
74
+ isProductCarouselType?: boolean | undefined;
75
+ cardCount?: number | undefined;
76
+ errorIndexes?: number[] | undefined;
77
+ setErrorIndexes?: React.Dispatch<React.SetStateAction<number[]>> | undefined;
78
+ pickerConf?: {
79
+ searchInCollection: any;
80
+ searchProducts: any;
81
+ fetchCollections: any;
82
+ fetchProducts: any;
83
+ storeId: string;
84
+ } | undefined;
85
+ carouselProducts?: CarouselProduct[] | undefined;
86
+ setCarouselProducts?: React.Dispatch<React.SetStateAction<CarouselProduct[]>> | undefined;
87
+ disableEditExpiry?: boolean | undefined;
88
+ cardWidth?: number | undefined;
89
+ cardImages?: string[] | undefined;
90
+ onDeleteSelectedProducts?: (() => void) | undefined;
49
91
  };
@@ -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 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);
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,disableEditExpiry:!1});exports.TemplateModalContext=a,exports.useTemplateModalContext=()=>e.useContext(a);
@@ -1,17 +1,17 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("styled-components"),o=require("../../template-preview/models/Channels.js"),n=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`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("styled-components"),l=require("../../carousel-preview/CarouselPreview.js"),o=require("./EditWhatsAppCarouselTemplateV2.js"),i=require("../../template-preview/models/Channels.js"),s=require("../../../constants/Theme.js"),n=require("../context/templateModalContext.js"),r=require("../utils/getVariableNameEmail.js"),u=require("../utils/highlightFor.js"),d=require("./DesktopPreview.js"),p=require("./EditWhatsAppTemplateV2.js"),c=require("./MobilePreview.js"),h=require("./VariableConnectorsPanel.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=m(a);const v=f.default.div`
2
2
  display: flex;
3
3
  // height: 100%;
4
- `,f=h.default.div`
4
+ `,C=f.default.div`
5
5
  padding: 16px 14px;
6
6
  max-width: 450px;
7
7
 
8
- height: ${e=>e.channel===o.CHANNEL_TYPE.WHATSAPP?"500px":"475px"};
9
- overflow-y: 'auto';
8
+ height: ${e=>e.channel===i.CHANNEL_TYPE.WHATSAPP?"500px":"475px"};
9
+ overflow-y: auto;
10
10
  padding-bottom: 24px;
11
- border-left: ${n.COLORS.stroke.primary} 1px solid;
12
- `,g=h.default.div`
13
- padding: ${e=>e.showOnlyContent?"16px 14px":"16px 32px"};
11
+ border-left: ${s.COLORS.stroke.primary} 1px solid;
12
+ `,x=f.default.div`
13
+ padding: ${e=>e.isWhatsappCarousel?void 0:e.showOnlyContent?"16px 14px":"16px 32px"};
14
14
  flex: 1;
15
- height: 475px;
15
+ height: ${e=>e.isWhatsappCarousel?"500px":"475px"};
16
16
  overflow-y: auto;
17
- `;exports.default=l=>{const{showVariableMapping:p,showOnlyContent:h,whatsappSpecificPickerMeta:x,showVariableModal:v,variableList:b,discountCode:w,setDiscountCode:j,variableListForImage:C,showSampleValues:E}=l,y=t.useRef(),L=t.useRef(),{device:P,display_content:T,channel:M,template:_,setTemplate:A}=i.useTemplateModalContext();const q=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e.jsxs(m,{children:[e.jsx(g,Object.assign({showOnlyContent:h,showVariableMapping:p},{children:"mobile"===P?e.jsx(u.default,{ref:L,display_content:null!=T?T:"",channel:M,template:_,showSampleValues:E}):M!==o.CHANNEL_TYPE.MESSAGE?e.jsx(s.default,{ref:y,channel:M,display_content:null!=T?T:"",showSampleValues:E}):e.jsx(e.Fragment,{})})),p&&e.jsx(f,Object.assign({channel:M},{children:M!==o.CHANNEL_TYPE.WHATSAPP?e.jsx(c.default,{onFocus:M===o.CHANNEL_TYPE.EMAIL?function(e){var t,l,i;const s=null===document||void 0===document?void 0:document.getElementById("mobile"===P?"template_html_mobile":"template_html_desktop"),d=a.getVariableNameForEmailByIndex(e+1),u=M===o.CHANNEL_TYPE.EMAIL?null===(t=null==s?void 0:s.contentWindow)||void 0===t?void 0:t.document.getElementById(d):document.getElementById(d),c=q(u),p=null==u?void 0:u.offsetLeft;"desktop"===P?c&&y.current&&(null===(l=null==s?void 0:s.contentWindow)||void 0===l||l.scrollTo(null!=p?p:0,c),r.highlightFor(d,n.COLORS.background.warning.light,2,M,P)):c&&L.current&&(null===(i=null==s?void 0:s.contentWindow)||void 0===i||i.scrollTo(null!=p?p:0,c),r.highlightFor(d,n.COLORS.background.warning.light,2,M,P))}:void 0,showVariableModal:v,variableList:b,discountCode:w,setDiscountCode:j}):e.jsx(d.default,{whatsappSpecificPickerMeta:x,template:_,onTemplateChange:e=>{null==A||A(e)},showVariableModal:v,variableList:b,variableListForImage:C,discountCode:w,setDiscountCode:j})}))]})};
17
+ `;exports.default=a=>{const{showVariableMapping:m,showOnlyContent:f,whatsappSpecificPickerMeta:g,showVariableModal:w,variableList:b,discountCode:P,setDiscountCode:j,variableListForImage:E,showSampleValues:T}=a,A=t.useRef(),L=t.useRef(),{device:y,display_content:M,channel:N,template:S,setTemplate:_,isWhatsappCarousel:V,isProductCarouselType:q}=n.useTemplateModalContext();const W=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e.jsxs(v,{children:[e.jsx(x,Object.assign({showOnlyContent:f,showVariableMapping:m,isWhatsappCarousel:V},{children:"mobile"===y?e.jsx(c.default,{ref:L,display_content:null!=M?M:"",channel:N,template:S,showSampleValues:T}):N===i.CHANNEL_TYPE.WHATSAPP&&V?e.jsx(l.CarouselPreview,{ref:A,channel:N,template:S,showSampleValues:T,isPreview:!1}):N!==i.CHANNEL_TYPE.MESSAGE?e.jsx(d.default,{ref:A,channel:N,display_content:null!=M?M:"",showSampleValues:T}):e.jsx(e.Fragment,{})})),(q||m)&&e.jsx(C,Object.assign({channel:N},{children:N!==i.CHANNEL_TYPE.WHATSAPP?e.jsx(h.default,{onFocus:N===i.CHANNEL_TYPE.EMAIL?function(e){var t,a,l;const o=null===document||void 0===document?void 0:document.getElementById("mobile"===y?"template_html_mobile":"template_html_desktop"),n=r.getVariableNameForEmailByIndex(e+1),d=N===i.CHANNEL_TYPE.EMAIL?null===(t=null==o?void 0:o.contentWindow)||void 0===t?void 0:t.document.getElementById(n):document.getElementById(n),p=W(d),c=null==d?void 0:d.offsetLeft;"desktop"===y?p&&A.current&&(null===(a=null==o?void 0:o.contentWindow)||void 0===a||a.scrollTo(null!=c?c:0,p),u.highlightFor(n,s.COLORS.background.warning.light,2,N,y)):p&&L.current&&(null===(l=null==o?void 0:o.contentWindow)||void 0===l||l.scrollTo(null!=c?c:0,p),u.highlightFor(n,s.COLORS.background.warning.light,2,N,y))}:void 0,showVariableModal:w,variableList:b,discountCode:P,setDiscountCode:j}):N===i.CHANNEL_TYPE.WHATSAPP&&V?e.jsx(o.default,{whatsappSpecificPickerMeta:g,template:S,showVariableModal:w,variableList:b,variableListForImage:E,discountCode:P,setDiscountCode:j}):e.jsx(p.default,{whatsappSpecificPickerMeta:g,template:S,onTemplateChange:e=>{null==_||_(e)},showVariableModal:w,variableList:b,variableListForImage:E,discountCode:P,setDiscountCode:j})}))]})};
@@ -0,0 +1,25 @@
1
+ import { VariableListInterfaceV2 } from "../../add-variableV2";
2
+ import { WhatsAppPickerMeta } from "../../template-preview";
3
+ import { WhatsAppCarouselTemplate } from "../../template-preview/models/WhatsappCarouselTemplate";
4
+ export interface EditWhatsAppCarouselTemplateV2Props {
5
+ whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
6
+ template: WhatsAppCarouselTemplate;
7
+ showVariableModal?: boolean;
8
+ variableList?: VariableListInterfaceV2[];
9
+ variableListForImage?: VariableListInterfaceV2[];
10
+ discountCode?: string;
11
+ setDiscountCode?: (code: string) => void;
12
+ }
13
+ export interface CarouselProduct {
14
+ name: string;
15
+ image: string;
16
+ quantity: number;
17
+ variantId: string;
18
+ productId: string;
19
+ displayOrder: number;
20
+ collectionId: string;
21
+ productName: string;
22
+ productImage: string;
23
+ }
24
+ declare const EditWhatsAppCarouselTemplateV2: ({ template, whatsappSpecificPickerMeta, showVariableModal, variableList, variableListForImage, discountCode, setDiscountCode, }: EditWhatsAppCarouselTemplateV2Props) => import("react/jsx-runtime").JSX.Element;
25
+ export default EditWhatsAppCarouselTemplateV2;