@bikdotai/bik-component-library 0.0.476-beta-tooltip-input-2 → 0.0.476-beta.0

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 (29) hide show
  1. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.d.ts +1 -0
  2. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
  3. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsMetric.js +1 -1
  4. package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
  5. package/dist/cjs/components/input/Input.d.ts +0 -1
  6. package/dist/cjs/components/input/Input.js +1 -1
  7. package/dist/cjs/components/input/Input.styled.js +1 -1
  8. package/dist/cjs/components/postPicker/postPicker.js +1 -1
  9. package/dist/cjs/components/product-picker-v2/modal.js +1 -1
  10. package/dist/cjs/components/product-picker-v2/searchScreen.d.ts +2 -0
  11. package/dist/cjs/components/product-picker-v2/searchScreen.js +1 -1
  12. package/dist/cjs/components/product-picker-v2/style.js +1 -1
  13. package/dist/cjs/components/template-preview/EmailTemplateThumbnailPreview.d.ts +1 -0
  14. package/dist/cjs/components/template-preview/EmailTemplateThumbnailPreview.js +1 -1
  15. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.d.ts +1 -0
  16. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
  17. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsMetric.js +1 -1
  18. package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
  19. package/dist/esm/components/input/Input.d.ts +0 -1
  20. package/dist/esm/components/input/Input.js +1 -1
  21. package/dist/esm/components/input/Input.styled.js +1 -1
  22. package/dist/esm/components/postPicker/postPicker.js +1 -1
  23. package/dist/esm/components/product-picker-v2/modal.js +1 -1
  24. package/dist/esm/components/product-picker-v2/searchScreen.d.ts +2 -0
  25. package/dist/esm/components/product-picker-v2/searchScreen.js +1 -1
  26. package/dist/esm/components/product-picker-v2/style.js +1 -1
  27. package/dist/esm/components/template-preview/EmailTemplateThumbnailPreview.d.ts +1 -0
  28. package/dist/esm/components/template-preview/EmailTemplateThumbnailPreview.js +1 -1
  29. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("./PostPicker.styled.js"),s=require("../tag/Tag.js"),r=require("../TypographyStyle.js"),i=require("../../utils/unCamelCase.js"),n=require("../../constants/colors.js"),o=require("../../constants/Theme.js"),l=require("../../assets/icons/instagram.svg.js"),d=require("../../assets/icons/warning.svg.js"),c=require("../modals/styledModal.js"),p=require("../shimmer/ShimmerComponent/BikShimmer.js"),h=require("../shimmer-image/ShimmerImage.js"),u=require("../states/StateComponent.js");require("../../_virtual/_tslib.js"),require("../tooltips/Tooltip.js"),require("../analytics-chips-and-dropdowns/CommonStyles.js");var y=require("../analytics-chips-and-dropdowns/AnalyticsDropdown.js");require("../analytics-chips-and-dropdowns/AnalyticsMetric.js"),require("../../utils/DateUtils.js"),require("../analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),require("react-bootstrap"),require("../analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.js"),require("../analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),require("../analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),require("../analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),require("../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),require("../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),require("../analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),require("../analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),require("../analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),require("../analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js");var m,g,j=require("../../assets/icons/searchIcon.js");exports.MEDIA_TYPES=void 0,(m=exports.MEDIA_TYPES||(exports.MEDIA_TYPES={})).STORY="story",m.POST="post",m.REEL="reel",exports.DateKeys=void 0,(g=exports.DateKeys||(exports.DateKeys={})).Today="Today",g["7_Days"]="7",g["30_Days"]="30",g.custom="custom",g.Yesterday="Yesterday";const x=[{label:"Today",value:"today",key:exports.DateKeys.Today,typeValue:[new Date,new Date]},{label:"Last 7 days",value:"7 days",key:exports.DateKeys["7_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-6)),new Date]},{label:"Last 30 days",value:"30 days",key:exports.DateKeys["30_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-29)),new Date]},{label:"Custom range",value:"calender",key:exports.DateKeys.custom,isCustom:!0,dateRangeSelectionOptions:{selectRange:!0,maxDate:new Date((new Date).setMonth((new Date).getMonth()+3))}}];exports.PostPicker=m=>{var g,D;const[S,w]=t.useState(null!==(g=m.previouslySelected)&&void 0!==g?g:[]),[v,C]=t.useState(""),[T,b]=t.useState(!1),[O,f]=t.useState(m.media),[q,P]=t.useState(!1),[E,I]=t.useState(!1);t.useEffect((()=>{m.media.length||(b(!0),setTimeout((()=>{b(!1)}),2e3)),w(m.selected||[])}),[]),t.useEffect((()=>{m.media.length>0&&(f(m.media),b(!1))}),[null===(D=null==m?void 0:m.media)||void 0===D?void 0:D.length]),t.useEffect((()=>{S.length>0&&C("")}),[S.length]),t.useEffect((()=>{q&&(f(m.media),I(!1))}),[q]);return e.jsx(e.Fragment,{children:e.jsxs(c.StyledModal,Object.assign({zIndex:201,open:m.showModal,headingTitle:m.title,onClose:m.onClose,centralContainerStyles:{width:1071,height:m.showFilter?612:564},primaryButton:{disabled:!O.length,buttonType:"primary",buttonText:`Select ${i.unCamelCase(m.mediaType)}`,onClick:()=>{S.length?m.onSelect(S):C(`Please select a ${m.mediaType} to proceed`)}},secondaryButton:{buttonType:"secondary",buttonText:"Back",onClick:()=>m.onClose()},footerLeftCustomElement:v?e.jsx(s.Tag,{tagText:v,type:"negative",LeadingIcon:d.default}):S.length?e.jsxs(r.BodySecondary,{children:[S.length," selected"]}):null},{children:[m.showFilter&&e.jsxs("div",Object.assign({style:{marginTop:24,marginBottom:24,padding:"0 24px",display:"flex",flexDirection:"row",gap:8,alignItems:"center"}},{children:[e.jsx(y.AnalyticsDropdown,{options:x,placeholder:"posted on",resetDropdown:q,onOptionSelected:e=>{var t,a;let s=null,r=null;"Custom range"===e.label?(s=(null===(t=null==e?void 0:e.selectedRange)||void 0===t?void 0:t[0])||new Date,r=(null===(a=null==e?void 0:e.selectedRange)||void 0===a?void 0:a[1])||new Date):(s=e.typeValue[0],r=e.typeValue[1]);const i=m.media.filter((e=>function(e,t,a){const s=new Date(e),r=new Date(t),i=new Date(a);return s>=r&&s<=i}(e.timestamp,s,r)));f(i),I(!0),P(!1)}}),E&&e.jsx(r.ButtonRegular,Object.assign({color:o.COLORS.content.secondary,onClick:()=>P(!0)},{children:"Clear"}))]})),T?e.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:e.jsx(p.BikShimmer,{boxes:[{width:(m.mediaType==exports.MEDIA_TYPES.POST?148:104)+"px",height:(m.mediaType==exports.MEDIA_TYPES.POST?148:172)+"px"}]})})):e.jsx(e.Fragment,{children:O&&O.length?e.jsx(a.StyledProductGrid,Object.assign({mediaType:m.mediaType},{children:O.map((t=>{return e.jsxs(a.StyledProduct,Object.assign({mediaType:m.mediaType,className:""+(s=t,i=S,i.some((e=>e.id===s.id))?"selected":""),onClick:()=>{return e=t,void w((()=>S.find((t=>t.id===e.id))?S.filter((t=>t.id!==e.id)):!m.limit||S.length<m.limit?[...S,e]:(C(`Only ${m.limit} ${m.mediaType}s can be selected`),S)));var e}},{children:[e.jsx(h.ShimmerImage,{imageUrl:t.imageUrl,width:m.mediaType==exports.MEDIA_TYPES.POST?148:104,height:m.mediaType==exports.MEDIA_TYPES.POST?148:172,alt:t.overlayCaption}),e.jsxs("div",Object.assign({className:"overlay"},{children:[e.jsx("a",Object.assign({target:"_blank",rel:"noreferrer",href:t.redirectionUrl},{children:e.jsxs("div",Object.assign({className:"overlay__redirection"},{children:[e.jsx(l.default,{height:22,width:22}),e.jsx(r.BodyPrimary,Object.assign({color:n.PRIMARY,style:{fontWeight:500}},{children:"View"}))]}))})),e.jsx("div",Object.assign({className:"overlay__caption"},{children:e.jsx(r.BodyCaption,Object.assign({color:o.COLORS.content.placeholder},{children:t.overlayCaption}))}))]}))]}),t.id);var s,i}))})):e.jsx("div",Object.assign({style:{justifyContent:"center",alignItems:"center",display:"flex",height:422}},{children:m.media.length?O.length?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"}},{children:[e.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"48px",height:"48px",backgroundColor:`${o.COLORS.background.inverse}`,borderRadius:"50%"}},{children:e.jsx(j.SearchIcon,{color:o.COLORS.content.primaryInverse})})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},{children:[e.jsx(r.TitleMedium,{children:"No results found"}),e.jsx(r.BodyPrimary,{children:"Sorry we could not find any results for the selected filter"})]})),e.jsx("div",Object.assign({onClick:()=>{P(!0)}},{children:e.jsx(r.ButtonLarge,Object.assign({color:`${o.COLORS.content.brand}`},{children:"Clear Filter"}))}))]})):e.jsx(u.StateComponent,{states:u.StateInterface.WARNING,heading:`No ${m.mediaType}s on your account`,subline:`There seems to be no ${m.mediaType}s on your account`,isButtonEnabled:!1,width:400})}))})]}))})},exports.dateOptions=x;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/searchIcon.js"),a=require("react"),s=require("./PostPicker.styled.js"),r=require("../tag/Tag.js"),i=require("../TypographyStyle.js"),n=require("../../utils/unCamelCase.js"),o=require("../../constants/colors.js"),l=require("../../constants/Theme.js"),d=require("../../assets/icons/instagram.svg.js"),c=require("../../assets/icons/warning.svg.js");require("../tooltips/Tooltip.js"),require("../analytics-chips-and-dropdowns/CommonStyles.js");var p=require("../analytics-chips-and-dropdowns/AnalyticsDropdown.js");require("../analytics-chips-and-dropdowns/AnalyticsMetric.js"),require("../../utils/DateUtils.js"),require("../analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),require("react-bootstrap"),require("../analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.js"),require("../analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),require("../analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),require("../analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),require("../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),require("../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),require("../analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),require("../analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),require("../analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),require("../analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js");var u,h,y=require("../modals/styledModal.js"),m=require("../shimmer/ShimmerComponent/BikShimmer.js"),g=require("../shimmer-image/ShimmerImage.js"),j=require("../states/StateComponent.js");require("../../_virtual/_tslib.js"),exports.MEDIA_TYPES=void 0,(u=exports.MEDIA_TYPES||(exports.MEDIA_TYPES={})).STORY="story",u.POST="post",u.REEL="reel",exports.DateKeys=void 0,(h=exports.DateKeys||(exports.DateKeys={})).Today="Today",h["7_Days"]="7",h["30_Days"]="30",h.custom="custom",h.Yesterday="Yesterday";const x=[{label:"Today",value:"today",key:exports.DateKeys.Today,typeValue:[new Date,new Date]},{label:"Last 7 days",value:"7 days",key:exports.DateKeys["7_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-6)),new Date]},{label:"Last 30 days",value:"30 days",key:exports.DateKeys["30_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-29)),new Date]},{label:"Custom range",value:"calender",key:exports.DateKeys.custom,isCustom:!0,dateRangeSelectionOptions:{selectRange:!0,maxDate:new Date((new Date).setMonth((new Date).getMonth()+3))}}];exports.PostPicker=u=>{var h,v;const[D,S]=a.useState(null!==(h=u.previouslySelected)&&void 0!==h?h:[]),[w,C]=a.useState(""),[T,b]=a.useState(!1),[f,O]=a.useState(u.media),[q,E]=a.useState(!1),[P,k]=a.useState(!1),[I,B]=a.useState(!1),_=a.useRef(null);a.useEffect((()=>{u.media.length||(b(!0),setTimeout((()=>{b(!1)}),2e3)),S(u.selected||[])}),[]),a.useEffect((()=>{u.media.length>0&&(O(u.media),b(!1))}),[null===(v=null==u?void 0:u.media)||void 0===v?void 0:v.length]),a.useEffect((()=>{D.length>0&&C("")}),[D.length]),a.useEffect((()=>{q&&(O(u.media),k(!1))}),[q]),a.useEffect((()=>{const e=e=>{document.getElementById("analytic-dropdown").contains(e.target)||B(!I)},t=document.getElementById("post-picker");return t&&t.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e)}}));return e.jsx("div",Object.assign({ref:_},{children:e.jsxs(y.StyledModal,Object.assign({zIndex:201,open:u.showModal,headingTitle:u.title,onClose:u.onClose,centralContainerStyles:{width:1071,height:u.showFilter?650:564},primaryButton:{disabled:!f.length,buttonType:"primary",buttonText:`Select ${n.unCamelCase(u.mediaType)}`,onClick:()=>{D.length?u.onSelect(D):C(`Please select a ${u.mediaType} to proceed`)}},secondaryButton:{buttonType:"secondary",buttonText:"Back",onClick:()=>u.onClose()},footerLeftCustomElement:w?e.jsx(r.Tag,{tagText:w,type:"negative",LeadingIcon:c.default}):D.length?e.jsxs(i.BodySecondary,{children:[D.length," selected"]}):null,id:"post-picker"},{children:[u.showFilter&&e.jsxs("div",Object.assign({style:{marginTop:24,marginBottom:24,padding:"0 24px",display:"flex",flexDirection:"row",gap:8,alignItems:"center"}},{children:[e.jsx(p.AnalyticsDropdown,{options:x,placeholder:"posted on",resetDropdown:q,onOptionSelected:e=>{var t,a;let s=null,r=null;"Custom range"===e.label?(s=(null===(t=null==e?void 0:e.selectedRange)||void 0===t?void 0:t[0])||new Date,r=(null===(a=null==e?void 0:e.selectedRange)||void 0===a?void 0:a[1])||new Date):(s=e.typeValue[0],r=e.typeValue[1]);const i=u.media.filter((e=>function(e,t,a){const s=new Date(e),r=new Date(t),i=new Date(a);return s>=r&&s<=i}(e.timestamp,s,r)));O(i),k(!0),E(!1)},closeDropdown:I}),P&&e.jsx(i.ButtonRegular,Object.assign({color:l.COLORS.content.secondary,onClick:()=>E(!0)},{children:"Clear"}))]})),T?e.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:e.jsx(m.BikShimmer,{boxes:[{width:(u.mediaType==exports.MEDIA_TYPES.POST?148:104)+"px",height:(u.mediaType==exports.MEDIA_TYPES.POST?148:172)+"px"}]})})):e.jsx(e.Fragment,{children:f&&f.length?e.jsx(s.StyledProductGrid,Object.assign({mediaType:u.mediaType},{children:f.map((t=>{return e.jsxs(s.StyledProduct,Object.assign({mediaType:u.mediaType,className:""+(a=t,r=D,r.some((e=>e.id===a.id))?"selected":""),onClick:()=>{return e=t,void S((()=>D.find((t=>t.id===e.id))?D.filter((t=>t.id!==e.id)):!u.limit||D.length<u.limit?[...D,e]:(C(`Only ${u.limit} ${u.mediaType}s can be selected`),D)));var e}},{children:[e.jsx(g.ShimmerImage,{imageUrl:t.imageUrl,width:u.mediaType==exports.MEDIA_TYPES.POST?148:104,height:u.mediaType==exports.MEDIA_TYPES.POST?148:172,alt:t.overlayCaption}),e.jsxs("div",Object.assign({className:"overlay"},{children:[e.jsx("a",Object.assign({target:"_blank",rel:"noreferrer",href:t.redirectionUrl},{children:e.jsxs("div",Object.assign({className:"overlay__redirection"},{children:[e.jsx(d.default,{height:22,width:22}),e.jsx(i.BodyPrimary,Object.assign({color:o.PRIMARY,style:{fontWeight:500}},{children:"View"}))]}))})),e.jsx("div",Object.assign({className:"overlay__caption"},{children:e.jsx(i.BodyCaption,Object.assign({color:l.COLORS.content.placeholder},{children:t.overlayCaption}))}))]}))]}),t.id);var a,r}))})):e.jsx("div",Object.assign({style:{justifyContent:"center",alignItems:"center",display:"flex",height:422}},{children:u.media.length?f.length?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"}},{children:[e.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"48px",height:"48px",backgroundColor:`${l.COLORS.background.inverse}`,borderRadius:"50%"}},{children:e.jsx(t.SearchIcon,{color:l.COLORS.content.primaryInverse})})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},{children:[e.jsx(i.TitleMedium,{children:"No results found"}),e.jsx(i.BodyPrimary,{children:"Sorry we could not find any results for the selected filter"})]})),e.jsx("div",Object.assign({onClick:()=>{E(!0)}},{children:e.jsx(i.ButtonLarge,Object.assign({color:`${l.COLORS.content.brand}`},{children:"Clear Filter"}))}))]})):e.jsx(j.StateComponent,{states:j.StateInterface.WARNING,heading:`No ${u.mediaType}s on your account`,subline:`There seems to be no ${u.mediaType}s on your account`,isButtonEnabled:!1,width:400})}))})]}))}))},exports.dateOptions=x;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react/jsx-runtime"),o=require("../../assets/icons/search.svg.js"),c=require("react"),r=require("../../constants/Theme.js"),s=require("../button/Button.js"),n=require("../input/Input.js"),l=require("../modals/styledModal.js"),i=require("../spinner/Spinner.js"),a=require("../tag/Tag.js"),d=require("./collectionScreen.js"),u=require("./productInfoOverlay.js"),h=require("./productScreen.js"),p=require("./rearrangeScreen.js"),S=require("./reducers.js"),C=require("./searchScreen.js"),x=require("./selectedScreen.js"),g=require("./style.js"),j=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:y,selectedItems:b,onClose:m,visible:f,zIndex:v,exactLimit:P,limit:k,hideCollectionCheckbox:I,hideProductCheckbox:F,outOfStockAction:O=j.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:R,selectProductsFromCustomCollection:T,hideSelectionCount:q,title:E,width:D,renderWithoutModal:w,onClickSave:N,pickerType:A,hideProductVariants:B=!1,startupScreen:M=exports.ScreenName.Collections,rearrangeEnabled:V,selectSingleItem:$=!1,showProductDetails:L}=e,[_,z]=c.useReducer(S.collectionsReducer,{}),[W,G]=c.useState([exports.ScreenName.Collections,exports.ScreenName.RearrangeProducts].includes(M)?M:exports.ScreenName.Collections),[H,K]=c.useState("grid"),[U,Y]=c.useState(""),[J,Q]=c.useState(""),[X,Z]=c.useState(0),[ee,te]=c.useState(!1),[oe,ce]=c.useState(0),[re,se]=c.useState(""),[ne,le]=c.useState(!1),[ie,ae]=c.useState(!1),[de,ue]=c.useReducer(S.searchReducer,{collections:{},products:{}}),[he,pe]=c.useReducer(S.selectedColectionsReducer,Object.keys(b).length>0?b:{}),Se=c.useRef(null),[Ce,xe]=c.useState(!1),[ge,je]=c.useState();c.useEffect((()=>{te(!0),ae(!0),e.collectionFetcher(X,y).then((e=>{z({type:"fetched",data:(null==e?void 0:e.collections)||{}}),te(!1),Z((e=>e+1)),ae(!1)})).catch()}),[]),c.useEffect((()=>{let e=0;B?Object.keys(he||[]).forEach((t=>{var o;Object.keys((null===(o=he[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&he[-1]&&(null===(c=he[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(he||[]).forEach((t=>{var o;Object.keys((null===(o=he[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=he[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),ce(e)}),[_,he,B]),c.useEffect((()=>{J&&(te(!0),e.productFetcher(J,y).then((e=>{Object.keys(e).length&&z({type:"productsFetched",data:{collectionId:J,products:e}}),te(!1)})).catch())}),[J]),c.useEffect((()=>{const t=setTimeout((()=>{"rearrange"!==W&&(re.length?(le(!0),e.searchFetcher(y,re).then((e=>{"collections"in e&&"products"in e?(ue({type:"set",data:e}),z({type:"searched",data:e.collections})):(ue({type:"set",data:{collections:{},products:e}}),z({type:"searched",data:e})),G("searchProducts"),te(!1),le(!1)}))):G("collections"))}),800);return()=>clearTimeout(t)}),[re]),c.useEffect((()=>{N&&(e.onAdd(he,oe),ye())}),[N]),c.useEffect((()=>{$&&Object.keys(he||{}).length&&oe&&(e.onAdd(he,oe),ye())}),[$,he,oe]);const ye=()=>{pe({type:"reset",data:{}})},be=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"===W||"searchProducts"===W)&&t.jsx("div",Object.assign({style:{padding:w?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t.jsx(n.Input,{placeholder:"Search Collections or Products",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>ne?t.jsx(i.Spinner,{size:"small",color:r.COLORS.content.primary}):t.jsx(o.default,{})},id:"listInput",height:"24px",type:"text",value:re,onChangeText:e=>{e.length&&e.trim().length?se(e):se("")}})}))}),t.jsxs(g.ScrollContainerStyle,Object.assign({ref:Se,screenName:W},{children:["collections"===W&&t.jsx(d.CollectionsScreen,{customCollectionRestriction:e.customCollectionRestriction,dataLoading:ie,collections:_,selectedCollectionsDispatch:pe,setCollectionId:Y,setSelectedCollectionId:Q,setScreen:G,selectedCollections:he,collectionFetcher:e.collectionFetcher,storeId:y,collectionsDispatch:z,setSaveDisabled:te,pagingControls:{curPage:X,setCurPage:Z},hideCollectionCheckbox:I,renderWithoutModal:w,pickerType:A}),"products"===W&&U&&t.jsx(S.CollectionIdContext.Provider,Object.assign({value:U},{children:t.jsx(h.ProductsScreen,{hideInCollectionSearch:e.hideInCollectionSearch,customCollectionRestriction:e.customCollectionRestriction,productFetcher:e.productFetcher,setScreen:G,storeId:y,data:_[U],collectionsDispatch:z,selectedCollectionsDispatch:pe,selectedData:he,setSaveDisabled:te,searchInCollectionFetcher:e.searchInCollectionFetcher,hideProductCheckbox:F,outOfStockAction:O,hideVariantCheckbox:R,selectProductsFromCustomCollection:T,renderWithoutModal:w,pickerType:A,hideProductVariants:B,fbStatusFetcher:e.fbStatusFetcher,onProductDetailClick:e=>{xe(!0),je(e)},showProductDetailInfoIcon:L})})),"view"===W&&t.jsx(x.SelectedScreen,{selectedCollections:he||{},selectedCollectionsDispatch:pe,setScreen:G,collections:_,hideProductVariants:B,outOfStockAction:O,storeId:y,fbStatusFetcher:e.fbStatusFetcher}),"rearrange"===W&&t.jsx(p.RearrangeScreen,{selectedCollections:he||{},selectedCollectionsDispatch:pe,setScreen:G,outOfStockAction:O,rearrangeViewType:"grid"===H?"list":"grid",scrollContainerRef:Se,storeId:y,fbStatusFetcher:e.fbStatusFetcher}),"searchProducts"===W&&t.jsx(C.SearchScreen,{customCollectionRestriction:e.customCollectionRestriction,selectedCollections:he||{},searchedCollections:de||{},searchedCollectionsDispatch:ue,selectedCollectionsDispatch:pe,setScreen:G,collections:_,onBackPress:()=>{se(""),ue({type:"set",data:{collections:{},products:{}}})},pickerType:A,hideProductCheckbox:F,hideProductVariants:B,hideVariantCheckbox:R,storeId:y,fbStatusFetcher:e.fbStatusFetcher,setCollectionId:Y,setSelectedCollectionId:Q,renderWithoutModal:w,hideCollectionCheckbox:I})]}))]});return t.jsx(t.Fragment,{children:w?be:t.jsxs(l.StyledModal,Object.assign({zIndex:v,open:f,onClose:()=>{null==m||m(),ye()},headingTitle:E||("collections"===W||"products"===W?"Select Products":"view"===W?"Selected Products":"searchProducts"===W?"Searched Results":"rearrange"===W?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:D||"600px"},headerRightCustomElement:"rearrange"===W?(console.log("ignore:",K),t.jsx(t.Fragment,{})):t.jsx(t.Fragment,{}),footerContainerStyle:e.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:r.COLORS.surface.standard}:void 0,primaryButton:{buttonText:ee?"Loading...":W===exports.ScreenName.RearrangeProducts?"Done":"Add",disabled:ee||oe<1||P&&oe<P||!P&&k&&oe>k||!1,onClick:()=>{e.onAdd(he,oe),ye()}},wrapperStyle:e.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:q?t.jsx(t.Fragment,{}):P&&oe>P?t.jsx(a.Tag,{tagText:`You can only select ${P} products`,type:"negative"}):k&&oe>k?t.jsx(a.Tag,{tagText:`You can only select ${k} products`,type:"negative"}):oe>0?t.jsx(s.Button,{onClick:()=>{G(V?exports.ScreenName.RearrangeProducts:exports.ScreenName.SelectedProducts)},buttonText:P?`${oe}/${P} products selected`:`${oe} products selected`,buttonType:["rearrange","view"].includes(W)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(W)}):t.jsx(s.Button,{disabled:!0,buttonText:P?`${oe}/${P} products selected`:`${oe} products selected`,buttonType:"tertiaryGray"}),hideCrossButton:Ce},{children:[be,Ce&&ge?t.jsx(u.ProductInfoOverlay,{productData:ge,outOfStockAction:O,onClose:()=>{xe(!1)}}):t.jsx(t.Fragment,{})]}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react/jsx-runtime"),o=require("../../assets/icons/search.svg.js"),c=require("react"),r=require("../../constants/Theme.js"),s=require("../button/Button.js"),n=require("../input/Input.js"),l=require("../modals/styledModal.js"),i=require("../spinner/Spinner.js"),a=require("../tag/Tag.js"),d=require("./collectionScreen.js"),u=require("./productInfoOverlay.js"),h=require("./productScreen.js"),p=require("./rearrangeScreen.js"),S=require("./reducers.js"),C=require("./searchScreen.js"),x=require("./selectedScreen.js"),g=require("./style.js"),j=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:y,selectedItems:b,onClose:f,visible:m,zIndex:v,exactLimit:P,limit:k,hideCollectionCheckbox:I,hideProductCheckbox:O,outOfStockAction:F=j.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:R,selectProductsFromCustomCollection:T,hideSelectionCount:q,title:E,width:D,renderWithoutModal:w,onClickSave:N,pickerType:A,hideProductVariants:B=!1,startupScreen:M=exports.ScreenName.Collections,rearrangeEnabled:V,selectSingleItem:$=!1,showProductDetails:L}=e,[_,z]=c.useReducer(S.collectionsReducer,{}),[W,G]=c.useState([exports.ScreenName.Collections,exports.ScreenName.RearrangeProducts].includes(M)?M:exports.ScreenName.Collections),[H,K]=c.useState("grid"),[U,Y]=c.useState(""),[J,Q]=c.useState(""),[X,Z]=c.useState(0),[ee,te]=c.useState(!1),[oe,ce]=c.useState(0),[re,se]=c.useState(""),[ne,le]=c.useState(!1),[ie,ae]=c.useState(!1),[de,ue]=c.useReducer(S.searchReducer,{collections:{},products:{}}),[he,pe]=c.useReducer(S.selectedColectionsReducer,Object.keys(b).length>0?b:{}),Se=c.useRef(null),[Ce,xe]=c.useState(!1),[ge,je]=c.useState();c.useEffect((()=>{te(!0),ae(!0),e.collectionFetcher(X,y).then((e=>{z({type:"fetched",data:(null==e?void 0:e.collections)||{}}),te(!1),Z((e=>e+1)),ae(!1)})).catch()}),[]),c.useEffect((()=>{let e=0;B?Object.keys(he||[]).forEach((t=>{var o;Object.keys((null===(o=he[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&he[-1]&&(null===(c=he[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(he||[]).forEach((t=>{var o;Object.keys((null===(o=he[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=he[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),ce(e)}),[_,he,B]),c.useEffect((()=>{J&&(te(!0),e.productFetcher(J,y).then((e=>{Object.keys(e).length&&z({type:"productsFetched",data:{collectionId:J,products:e}}),te(!1)})).catch())}),[J]),c.useEffect((()=>{const t=setTimeout((()=>{"rearrange"!==W&&(re.length||"collections"!==W)&&(re.length?(le(!0),e.searchFetcher(y,re).then((e=>{"collections"in e&&"products"in e?(ue({type:"set",data:e}),z({type:"searched",data:e.collections})):(ue({type:"set",data:{collections:{},products:e}}),z({type:"searched",data:e})),G("searchProducts"),te(!1),le(!1)}))):G("collections"))}),800);return()=>clearTimeout(t)}),[re]),c.useEffect((()=>{N&&(e.onAdd(he,oe),ye())}),[N]),c.useEffect((()=>{$&&Object.keys(he||{}).length&&oe&&(e.onAdd(he,oe),ye())}),[$,he,oe]);const ye=()=>{pe({type:"reset",data:{}})},be=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"===W||"searchProducts"===W)&&t.jsx("div",Object.assign({style:{padding:w?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t.jsx(n.Input,{placeholder:"Search Collections or Products",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>ne?t.jsx(i.Spinner,{size:"small",color:r.COLORS.content.primary}):t.jsx(o.default,{})},id:"listInput",height:"24px",type:"text",value:re,onChangeText:e=>{e.length&&e.trim().length?se(e):se("")}})}))}),t.jsxs(g.ScrollContainerStyle,Object.assign({ref:Se,screenName:W},{children:["collections"===W&&t.jsx(d.CollectionsScreen,{customCollectionRestriction:e.customCollectionRestriction,dataLoading:ie,collections:_,selectedCollectionsDispatch:pe,setCollectionId:Y,setSelectedCollectionId:Q,setScreen:G,selectedCollections:he,collectionFetcher:e.collectionFetcher,storeId:y,collectionsDispatch:z,setSaveDisabled:te,pagingControls:{curPage:X,setCurPage:Z},hideCollectionCheckbox:I,renderWithoutModal:w,pickerType:A}),"products"===W&&U&&t.jsx(S.CollectionIdContext.Provider,Object.assign({value:U},{children:t.jsx(h.ProductsScreen,{hideInCollectionSearch:e.hideInCollectionSearch,customCollectionRestriction:e.customCollectionRestriction,productFetcher:e.productFetcher,setScreen:G,storeId:y,data:_[U],collectionsDispatch:z,selectedCollectionsDispatch:pe,selectedData:he,setSaveDisabled:te,searchInCollectionFetcher:e.searchInCollectionFetcher,hideProductCheckbox:O,outOfStockAction:F,hideVariantCheckbox:R,selectProductsFromCustomCollection:T,renderWithoutModal:w,pickerType:A,hideProductVariants:B,fbStatusFetcher:e.fbStatusFetcher,onProductDetailClick:e=>{xe(!0),je(e)},showProductDetailInfoIcon:L})})),"view"===W&&t.jsx(x.SelectedScreen,{selectedCollections:he||{},selectedCollectionsDispatch:pe,setScreen:G,collections:_,hideProductVariants:B,outOfStockAction:F,storeId:y,fbStatusFetcher:e.fbStatusFetcher}),"rearrange"===W&&t.jsx(p.RearrangeScreen,{selectedCollections:he||{},selectedCollectionsDispatch:pe,setScreen:G,outOfStockAction:F,rearrangeViewType:"grid"===H?"list":"grid",scrollContainerRef:Se,storeId:y,fbStatusFetcher:e.fbStatusFetcher}),"searchProducts"===W&&t.jsx(C.SearchScreen,{customCollectionRestriction:e.customCollectionRestriction,selectedCollections:he||{},searchedCollections:de||{},searchedCollectionsDispatch:ue,selectedCollectionsDispatch:pe,setScreen:G,collections:_,onBackPress:()=>{se(""),ue({type:"set",data:{collections:{},products:{}}})},pickerType:A,hideProductCheckbox:O,hideProductVariants:B,hideVariantCheckbox:R,storeId:y,fbStatusFetcher:e.fbStatusFetcher,setCollectionId:Y,setSelectedCollectionId:Q,renderWithoutModal:w,hideCollectionCheckbox:I,outOfStockAction:F})]}))]});return t.jsx(t.Fragment,{children:w?be:t.jsxs(l.StyledModal,Object.assign({zIndex:v,open:m,onClose:()=>{null==f||f(),ye()},headingTitle:E||("collections"===W||"products"===W?"Select Products":"view"===W?"Selected Products":"searchProducts"===W?"Searched Results":"rearrange"===W?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:D||"600px"},headerRightCustomElement:"rearrange"===W?(console.log("ignore:",K),t.jsx(t.Fragment,{})):t.jsx(t.Fragment,{}),footerContainerStyle:e.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:r.COLORS.surface.standard}:void 0,primaryButton:{buttonText:ee?"Loading...":W===exports.ScreenName.RearrangeProducts?"Done":"Add",disabled:ee||oe<1||P&&oe<P||!P&&k&&oe>k||!1,onClick:()=>{e.onAdd(he,oe),ye()}},wrapperStyle:e.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:q?t.jsx(t.Fragment,{}):P&&oe>P?t.jsx(a.Tag,{tagText:`You can only select ${P} products`,type:"negative"}):k&&oe>k?t.jsx(a.Tag,{tagText:`You can only select ${k} products`,type:"negative"}):oe>0?t.jsx(s.Button,{onClick:()=>{G(V?exports.ScreenName.RearrangeProducts:exports.ScreenName.SelectedProducts)},buttonText:P?`${oe}/${P} products selected`:`${oe} products selected`,buttonType:["rearrange","view"].includes(W)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(W)}):t.jsx(s.Button,{disabled:!0,buttonText:P?`${oe}/${P} products selected`:`${oe} products selected`,buttonType:"tertiaryGray"}),hideCrossButton:Ce},{children:[be,Ce&&ge?t.jsx(u.ProductInfoOverlay,{productData:ge,outOfStockAction:F,onClose:()=>{xe(!1)}}):t.jsx(t.Fragment,{})]}))})};
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { Collection, FbStatusFetcherReturn, SearchedItems, SelectedItems } from '.';
3
3
  import { SearchReducerActions, SelectedCollectionsActions } from './reducers';
4
+ import { OUT_OF_STOCK_ACTION } from './type';
4
5
  interface SearchScreenInterface {
5
6
  customCollectionRestriction?: boolean;
6
7
  selectedCollections: SelectedItems;
@@ -22,6 +23,7 @@ interface SearchScreenInterface {
22
23
  fbStatusFetcher?: (storeId: string, variantIds: string[]) => FbStatusFetcherReturn;
23
24
  hideCollectionCheckbox?: boolean;
24
25
  renderWithoutModal?: boolean;
26
+ outOfStockAction?: OUT_OF_STOCK_ACTION;
25
27
  }
26
28
  export declare const SearchScreen: (props: SearchScreenInterface) => import("react/jsx-runtime").JSX.Element;
27
29
  export {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),o=require("react"),l=require("../icon-button/IconButton.js"),i=require("../TypographyStyle.js"),c=require("./collectionScreen.js"),s=require("./emptyState.js"),d=require("./product.js"),r=require("./style.js"),n=require("./utility.js");exports.SearchScreen=u=>{var a;const{customCollectionRestriction:h,selectedCollections:v,searchedCollections:p,searchedCollectionsDispatch:C,selectedCollectionsDispatch:j,setScreen:y,collections:k,onBackPress:b,hideVariantCheckbox:x,pickerType:S,hideProductVariants:P,hideProductCheckbox:m,storeId:f,fbStatusFetcher:g,setCollectionId:I,setSelectedCollectionId:q,hideCollectionCheckbox:O,renderWithoutModal:D}=u;o.useEffect((()=>{var e;n.fetchFbStatusCollection(null!==(e=p.products)&&void 0!==e?e:{},f,C,g,"setProducts")}),[null==p?void 0:p.products]);const F=!!h&&(null==v?void 0:v.isCustom);return e.jsxs("div",{children:[e.jsxs(r.SelectedScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,onClick:()=>{y("collections"),b()}}),e.jsx(i.BodyCaption,{children:(null===(a=Object.keys(null==p?void 0:p.collections))||void 0===a?void 0:a.length)?"Searched Collections & Products":"Searched Products"})]}),e.jsx("div",{children:Object.keys(null==p?void 0:p.products).length||Object.keys(null==p?void 0:p.collections).length?e.jsxs(e.Fragment,{children:[e.jsx(e.Fragment,{children:Object.keys(null==p?void 0:p.collections).map((t=>e.jsx(c.CollectionCard,{customCollectionRestriction:h,data:null==k?void 0:k[t],isDisabled:F&&!(null==v?void 0:v[t]),isChecked:!!(null==v?void 0:v[t]),isPartiallyChecked:n.isCollectionPartiallyChecked(t,null==k?void 0:k[t],v,P),selectedCollectionsDispatch:j,setCollectionId:I,setSelectedCollectionId:q,setScreen:y,id:t,hideCollectionCheckbox:O||"-1"===t,selectedCollections:v,renderWithoutModal:D,pickerType:S,usedInSearch:!0},t)))}),e.jsx(e.Fragment,{children:Object.keys(null==p?void 0:p.products).map((t=>{var o,l;return Object.keys((null===(l=null===(o=null==p?void 0:p.products)||void 0===o?void 0:o[t])||void 0===l?void 0:l.products)||[]).map((o=>{var l,i,c;let s=!1;return(null===(l=null==p?void 0:p.products)||void 0===l?void 0:l.isCustom)&&(s=!0),e.jsx(d.ProductGroup,{collectionId:t,upliftAdditions:(e,o)=>((e,t,o)=>{var l;const i=n.liftTheStateUp(o,null===(l=null==p?void 0:p.products)||void 0===l?void 0:l[e]);j({type:t,data:Object.assign(Object.assign({},i),{isRestricted:h})})})(t,e,o),productId:o,data:(null===(i=null==p?void 0:p.products)||void 0===i?void 0:i[t].products)[o],isProductPartiallyChecked:n.isProductPartiallyChecked(t,o,v,null===(c=p.products)||void 0===c?void 0:c[t],P),selectedData:v,selectedCollectionsDispatch:j,viewOnly:s,hideProductCheckbox:m,hideVariantCheckbox:x,hideProductVariants:P,pickerType:S},o)}))}))})]}):e.jsx(s.EmptyState,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),o=require("react"),l=require("../icon-button/IconButton.js"),c=require("../TypographyStyle.js"),i=require("./collectionScreen.js"),s=require("./emptyState.js"),d=require("./product.js"),r=require("./style.js"),n=require("./utility.js");exports.SearchScreen=u=>{var a;const{customCollectionRestriction:h,selectedCollections:v,searchedCollections:p,searchedCollectionsDispatch:C,selectedCollectionsDispatch:j,setScreen:k,collections:y,onBackPress:b,hideVariantCheckbox:x,pickerType:S,hideProductVariants:P,hideProductCheckbox:f,storeId:m,fbStatusFetcher:O,setCollectionId:g,setSelectedCollectionId:I,hideCollectionCheckbox:q,renderWithoutModal:D,outOfStockAction:F}=u;o.useEffect((()=>{var e;n.fetchFbStatusCollection(null!==(e=p.products)&&void 0!==e?e:{},m,C,O,"setProducts")}),[null==p?void 0:p.products]);const T=!!h&&(null==v?void 0:v.isCustom);return e.jsxs("div",{children:[e.jsxs(r.SelectedScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,onClick:()=>{k("collections"),b()}}),e.jsx(c.BodyCaption,{children:(null===(a=Object.keys(null==p?void 0:p.collections))||void 0===a?void 0:a.length)?"Searched Collections & Products":"Searched Products"})]}),e.jsx("div",{children:Object.keys(null==p?void 0:p.products).length||Object.keys(null==p?void 0:p.collections).length?e.jsxs(e.Fragment,{children:[e.jsx(e.Fragment,{children:Object.keys(null==p?void 0:p.collections).map((t=>e.jsx(i.CollectionCard,{customCollectionRestriction:h,data:null==y?void 0:y[t],isDisabled:T&&!(null==v?void 0:v[t]),isChecked:!!(null==v?void 0:v[t]),isPartiallyChecked:n.isCollectionPartiallyChecked(t,null==y?void 0:y[t],v,P),selectedCollectionsDispatch:j,setCollectionId:g,setSelectedCollectionId:I,setScreen:k,id:t,hideCollectionCheckbox:q||"-1"===t,selectedCollections:v,renderWithoutModal:D,pickerType:S,usedInSearch:!0},t)))}),e.jsx(e.Fragment,{children:Object.keys(null==p?void 0:p.products).map((t=>{var o,l;return Object.keys((null===(l=null===(o=null==p?void 0:p.products)||void 0===o?void 0:o[t])||void 0===l?void 0:l.products)||[]).map((o=>{var l,c,i;let s=!1;return(null===(l=null==p?void 0:p.products)||void 0===l?void 0:l.isCustom)&&(s=!0),e.jsx(d.ProductGroup,{collectionId:t,upliftAdditions:(e,o)=>((e,t,o)=>{var l;const c=n.liftTheStateUp(o,null===(l=null==p?void 0:p.products)||void 0===l?void 0:l[e]);j({type:t,data:Object.assign(Object.assign({},c),{isRestricted:h})})})(t,e,o),productId:o,data:(null===(c=null==p?void 0:p.products)||void 0===c?void 0:c[t].products)[o],isProductPartiallyChecked:n.isProductPartiallyChecked(t,o,v,null===(i=p.products)||void 0===i?void 0:i[t],P),selectedData:v,selectedCollectionsDispatch:j,viewOnly:s,hideProductCheckbox:f,hideVariantCheckbox:x,hideProductVariants:P,pickerType:S,outOfStockAction:F},o)}))}))})]}):e.jsx(s.EmptyState,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js"),i=require("./modal.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(e);const l=r.default.div`
2
2
  display: flex;
3
3
  background-color: white;
4
- height: 600px;
4
+ height: 75vh;
5
5
  flex-direction: column;
6
6
  `,n=r.default.div`
7
7
  overflow-y: scroll;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { CSSProperties } from 'styled-components';
3
3
  import { EmailTemplateType } from './models/EmailTemplate';
4
+ export declare const DEFAULT_IMAGE = "https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F9034204a-cbf9-4b93-8b28-ccf880d273f9?alt=media&token=318529b5-8df0-4644-85b0-40fff1dc1d5c";
4
5
  declare const EmailTemplateThumbnailPreview: React.FC<{
5
6
  template: EmailTemplateType;
6
7
  hideHeader?: boolean;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../button/Button.js"),i=require("../TypographyStyle.js"),r=require("./EmailTemplatePreview.styled.js");exports.default=n=>{let{template:a,handleViewTemplate:l,hideHeader:s,hideViewButton:d,containerStyle:o,emailHtmlContainerId:u,emailDisplayContent:j}=n;return e.jsxs(r.EmailContainer,Object.assign({hideHeader:s,style:Object.assign({},null!=o?o:{})},{children:[!s&&e.jsx(r.Header,{children:e.jsx(i.TitleRegular,Object.assign({style:{maxWidth:"100%"}},{children:a.name}))}),e.jsx(r.IframeContainer,{children:j?e.jsx("iframe",{title:"Email template preview",id:null!=u?u:"",width:"100%",srcDoc:j,height:"100%",style:{pointerEvents:"none"}}):e.jsx(r.ImageContainer,Object.assign({hideHeader:s},{children:e.jsx(r.CardLoadingContainer,{})}))}),!d&&e.jsx(r.ViewButton,{children:e.jsx(t.Button,{buttonType:"tertiary",buttonText:"View",onClick:()=>{l&&l()}})})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../button/Button.js"),a=require("../TypographyStyle.js"),n=require("./EmailTemplatePreview.styled.js");const s="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F9034204a-cbf9-4b93-8b28-ccf880d273f9?alt=media&token=318529b5-8df0-4644-85b0-40fff1dc1d5c";exports.DEFAULT_IMAGE=s,exports.default=r=>{let{template:i,handleViewTemplate:o,hideHeader:l,hideViewButton:p,containerStyle:d,emailHtmlContainerId:c,emailDisplayContent:u}=r;return e.jsxs(n.EmailContainer,Object.assign({hideHeader:l,style:Object.assign({},null!=d?d:{})},{children:[!l&&e.jsx(n.Header,{children:e.jsx(a.TitleRegular,Object.assign({style:{maxWidth:"100%"}},{children:i.name}))}),e.jsx(n.IframeContainer,{children:u?e.jsx("iframe",{title:"Email template preview",id:null!=c?c:"",width:"100%",srcDoc:(m=u,m.replace(/<span><\/span><span style="color: #731DCF; text-decoration: underline;">{{##orderProducts}}<\/span><span>\s*<\/span>/g,"").replace(/src="<span><\/span><span style="color: #731DCF; text-decoration: underline;">{{product.photoUrl}}<\/span><span> <\/span>"/g,`src=${s}`).replace(/<span><\/span><span style="color: #731DCF; text-decoration: underline;">{{\/\/orderProducts}}<\/span><span>\s*<\/span>/g,"").replace(/<span><\/span><span style="color: #731DCF; text-decoration: underline;">{{##abandonedCartProducts}}<\/span><span>\s*<\/span>/g,"").replace(/<span><\/span><span style="color: #731DCF; text-decoration: underline;">{{\/\/abandonedCartProducts}}<\/span><span>\s*<\/span>/g,"")),height:"100%",style:{pointerEvents:"none"}}):e.jsx(n.ImageContainer,Object.assign({hideHeader:l},{children:e.jsx(n.CardLoadingContainer,{})}))}),!p&&e.jsx(n.ViewButton,{children:e.jsx(t.Button,{buttonType:"tertiary",buttonText:"View",onClick:()=>{o&&o()}})})]}));var m};
@@ -31,6 +31,7 @@ export interface AnalyticsDropdownInterface {
31
31
  };
32
32
  variant?: 'small' | 'default';
33
33
  datePickerPlacement?: DropDirection;
34
+ closeDropdown?: boolean;
34
35
  }
35
36
  export declare const AnalyticsDropdown: React.FC<AnalyticsDropdownInterface>;
36
37
  export declare const EachItem: React.FC<{
@@ -1 +1 @@
1
- import{jsx as e,Fragment as o,jsxs as n}from"react/jsx-runtime";import{useState as t,useEffect as l}from"react";import{Dropdown as i}from"react-bootstrap";import{DEFAULT_THEME as s,BASE_COLORS as a}from"../../constants/Theme.js";import{DatePicker as d}from"../datePicker/DatePicker.js";import{BodySecondary as c,BodyCaption as r,Caption as g}from"../TypographyStyle.js";import{MainDropdown as p,ItemMenuContainer as u}from"./CommonStyles.js";const m=a=>{let{options:r,placeholder:u="Select an option",selected:m,onOptionSelected:b,resetDropdown:h,maxHeight:f,backgroundColor:y,calendarPopperConfig:k,variant:D="default",datePickerPlacement:j}=a;var S,R,C;const[w,x]=t(!1),[$,T]=t(m),[P,I]=t(),[N,A]=t(!1),E=()=>{!w&&A(!N)},[F,H]=t(m),M="small"===D?g:c;return l((()=>{h&&T(void 0)}),[h]),l((()=>{var e;(null==m?void 0:m.isCustom)&&(null===(e=m.dateRangeSelectionOptions)||void 0===e?void 0:e.selectedDates)?I(m.dateRangeSelectionOptions.selectedDates):I(void 0),T(m)}),[m]),e(o,{children:n(p,Object.assign({drop:"down",show:N,onToggle:E,backgroundColor:y},{children:[e(i.Toggle,Object.assign({id:"dropdown-autoclose-outside",className:"main--dropdown",style:"small"===D?{display:"flex",alignItems:"center",gap:6,padding:"4px 8px",backgroundColor:"#FAFAFA",borderRadius:4,border:`1px solid ${s.colorsV2.stroke.primary}`}:void 0},{children:e(M,Object.assign({style:"small"===D?{color:s.colorsV2.content.secondary}:void 0},{children:(null==$?void 0:$.isCustom)?P?O(P[0])===O(P[1])?`${O(P[0])}`:`${O(P[0])} to ${O(P[1])}`:null==F?void 0:F.label:$?null==$?void 0:$.label:u}))})),e(i.Menu,Object.assign({className:"main--dropdown"},{children:n(p,Object.assign({drop:null!=j?j:"end",id:"sub--dropdown",show:w,onToggle:e=>{!e&&A(!1),x(!w)}},{children:[e("div",Object.assign({style:{maxHeight:f||"auto",overflowY:"scroll"}},{children:r.map((o=>{var n;return e("div",{children:(null==o?void 0:o.isCustom)?e(i.Toggle,Object.assign({className:"sub--dropdown"},{children:e(v,{eachOption:o,selectedOption:$,selectedDate:P,onClickingEachItem:e=>{T(e),x(!0)},rangeSelection:!!(null===(n=null==o?void 0:o.dateRangeSelectionOptions)||void 0===n?void 0:n.selectRange)})})):e(v,{eachOption:o,selectedOption:$,selectedDate:P,onClickingEachItem:e=>{if(I(void 0),T(e),H(e),E(),!e.noOfDays)return void b(e);const o=new Date,n=new Date;n.setDate(o.getDate()-e.noOfDays),b(Object.assign(Object.assign({},e),{selectedRange:[n,o]}))}})},null==o?void 0:o.key)}))})),e(i.Menu,Object.assign({className:"sub--dropdown",popperConfig:{modifiers:[{name:"offset",options:{offset:[(null==k?void 0:k.offsetSkid)||0,(null==k?void 0:k.offsetDistance)||0]}}]}},{children:e(d,{selectRange:(null===(S=null==$?void 0:$.dateRangeSelectionOptions)||void 0===S?void 0:S.selectRange)||!1,maxDate:null===(R=null==$?void 0:$.dateRangeSelectionOptions)||void 0===R?void 0:R.maxDate,minDate:null===(C=null==$?void 0:$.dateRangeSelectionOptions)||void 0===C?void 0:C.minDate,selectedDates:P,onSelectRange:(e,o)=>{const n=[e,o];(null==$?void 0:$.dateRangeSelectionOptions)&&($.dateRangeSelectionOptions.selectedDates=n,b(Object.assign(Object.assign({},$),{selectedRange:[e,o]}))),H($),x(!1),I(n),A(!N)},onSelectDate:e=>{(null==$?void 0:$.dateRangeSelectionOptions)&&($.dateRangeSelectionOptions.selectedDates=[e,e],b(Object.assign(Object.assign({},$),{selectedRange:[e,e]}))),H($),x(!1),I([e,e]),A(!N)}})}))]}))}))]}))})},v=o=>{let{eachOption:t,selectedOption:l,selectedDate:i,onClickingEachItem:s,rangeSelection:d}=o;return n(u,Object.assign({onClick:()=>s(t),isSelected:t.isCustom?t.key==(null==l?void 0:l.key)&&!!i:t.key==(null==l?void 0:l.key)},{children:[e(c,Object.assign({color:t.key==(null==l?void 0:l.key)?a.positive[900]:a.grayscale[900]},{children:t.label})),i&&(null==l?void 0:l.isCustom)&&t.key==(null==l?void 0:l.key)&&e(r,{children:d?`${O(i[0])} to ${O(i[1])}`:`${O(i[0])}`})]}),t.key)},O=e=>e.toLocaleString("default",{day:"numeric",month:"short",year:"numeric"});export{m as AnalyticsDropdown,v as EachItem,O as formatDate};
1
+ import{jsx as e,Fragment as o,jsxs as n}from"react/jsx-runtime";import{useState as t,useEffect as l}from"react";import{Dropdown as i}from"react-bootstrap";import{DEFAULT_THEME as s,BASE_COLORS as a}from"../../constants/Theme.js";import{DatePicker as d}from"../datePicker/DatePicker.js";import{BodySecondary as c,BodyCaption as r,Caption as g}from"../TypographyStyle.js";import{MainDropdown as p,ItemMenuContainer as u}from"./CommonStyles.js";const m=a=>{let{options:r,placeholder:u="Select an option",selected:m,onOptionSelected:b,resetDropdown:h,maxHeight:y,backgroundColor:f,calendarPopperConfig:D,variant:k="default",datePickerPlacement:j,closeDropdown:S}=a;var R,w,C;const[x,$]=t(!1),[T,P]=t(m),[I,N]=t(),[A,E]=t(!1),F=()=>{!x&&E(!A)},[H,M]=t(m),V="small"===k?g:c;return l((()=>{h&&P(void 0)}),[h]),l((()=>{var e;(null==m?void 0:m.isCustom)&&(null===(e=m.dateRangeSelectionOptions)||void 0===e?void 0:e.selectedDates)?N(m.dateRangeSelectionOptions.selectedDates):N(void 0),P(m)}),[m]),l((()=>{E(!1),$(!1)}),[S]),e(o,{children:n(p,Object.assign({drop:"down",show:A,onToggle:F,backgroundColor:f,id:"analytic-dropdown"},{children:[e(i.Toggle,Object.assign({id:"dropdown-autoclose-outside",className:"main--dropdown",style:"small"===k?{display:"flex",alignItems:"center",gap:6,padding:"4px 8px",backgroundColor:"#FAFAFA",borderRadius:4,border:`1px solid ${s.colorsV2.stroke.primary}`}:void 0},{children:e(V,Object.assign({style:"small"===k?{color:s.colorsV2.content.secondary}:void 0},{children:(null==T?void 0:T.isCustom)?I?O(I[0])===O(I[1])?`${O(I[0])}`:`${O(I[0])} to ${O(I[1])}`:null==H?void 0:H.label:T?null==T?void 0:T.label:u}))})),e(i.Menu,Object.assign({className:"main--dropdown"},{children:n(p,Object.assign({drop:null!=j?j:"end",id:"sub--dropdown",show:x,onToggle:e=>{!e&&E(!1),$(!x)}},{children:[e("div",Object.assign({style:{maxHeight:y||"auto",overflowY:"scroll"}},{children:r.map((o=>{var n;return e("div",{children:(null==o?void 0:o.isCustom)?e(i.Toggle,Object.assign({className:"sub--dropdown"},{children:e(v,{eachOption:o,selectedOption:T,selectedDate:I,onClickingEachItem:e=>{P(e),$(!0)},rangeSelection:!!(null===(n=null==o?void 0:o.dateRangeSelectionOptions)||void 0===n?void 0:n.selectRange)})})):e(v,{eachOption:o,selectedOption:T,selectedDate:I,onClickingEachItem:e=>{if(N(void 0),P(e),M(e),F(),!e.noOfDays)return void b(e);const o=new Date,n=new Date;n.setDate(o.getDate()-e.noOfDays),b(Object.assign(Object.assign({},e),{selectedRange:[n,o]}))}})},null==o?void 0:o.key)}))})),e(i.Menu,Object.assign({className:"sub--dropdown",popperConfig:{modifiers:[{name:"offset",options:{offset:[(null==D?void 0:D.offsetSkid)||0,(null==D?void 0:D.offsetDistance)||0]}}]}},{children:e(d,{selectRange:(null===(R=null==T?void 0:T.dateRangeSelectionOptions)||void 0===R?void 0:R.selectRange)||!1,maxDate:null===(w=null==T?void 0:T.dateRangeSelectionOptions)||void 0===w?void 0:w.maxDate,minDate:null===(C=null==T?void 0:T.dateRangeSelectionOptions)||void 0===C?void 0:C.minDate,selectedDates:I,onSelectRange:(e,o)=>{const n=[e,o];(null==T?void 0:T.dateRangeSelectionOptions)&&(T.dateRangeSelectionOptions.selectedDates=n,b(Object.assign(Object.assign({},T),{selectedRange:[e,o]}))),M(T),$(!1),N(n),E(!A)},onSelectDate:e=>{(null==T?void 0:T.dateRangeSelectionOptions)&&(T.dateRangeSelectionOptions.selectedDates=[e,e],b(Object.assign(Object.assign({},T),{selectedRange:[e,e]}))),M(T),$(!1),N([e,e]),E(!A)}})}))]}))}))]}))})},v=o=>{let{eachOption:t,selectedOption:l,selectedDate:i,onClickingEachItem:s,rangeSelection:d}=o;return n(u,Object.assign({onClick:()=>s(t),isSelected:t.isCustom?t.key==(null==l?void 0:l.key)&&!!i:t.key==(null==l?void 0:l.key)},{children:[e(c,Object.assign({color:t.key==(null==l?void 0:l.key)?a.positive[900]:a.grayscale[900]},{children:t.label})),i&&(null==l?void 0:l.isCustom)&&t.key==(null==l?void 0:l.key)&&e(r,{children:d?`${O(i[0])} to ${O(i[1])}`:`${O(i[0])}`})]}),t.key)},O=e=>e.toLocaleString("default",{day:"numeric",month:"short",year:"numeric"});export{m as AnalyticsDropdown,v as EachItem,O as formatDate};
@@ -1 +1 @@
1
- import g from"@emotion/styled/base";import{jsxs as I,jsx as C,Fragment as A}from"react/jsx-runtime";import{COLORS as l}from"../../constants/Theme.js";import{TitleMedium as c,TitleRegular as e}from"../TypographyStyle.js";import{AnalyticsTrend as d}from"./AnalyticsTrend.js";const t=g("div","production"===process.env.NODE_ENV?{target:"e1bel8cf0"}:{target:"e1bel8cf0",label:"TrendContainer"})("production"===process.env.NODE_ENV?{name:"jovua5",styles:"display:flex;flex-direction:row;flex-wrap:wrap"}:{name:"jovua5",styles:"display:flex;flex-direction:row;flex-wrap:wrap",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFuYWx5dGljc01ldHJpYy50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBS2tDIiwiZmlsZSI6IkFuYWx5dGljc01ldHJpYy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBqc3ggYXMgX2pzeCwganN4cyBhcyBfanN4cywgRnJhZ21lbnQgYXMgX0ZyYWdtZW50IH0gZnJvbSBcInJlYWN0L2pzeC1ydW50aW1lXCI7XHJcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgQ09MT1JTIH0gZnJvbSBcIi4uLy4uL2NvbnN0YW50cy9UaGVtZVwiO1xyXG5pbXBvcnQgeyBUaXRsZU1lZGl1bSwgVGl0bGVSZWd1bGFyIH0gZnJvbSAnLi4vVHlwb2dyYXBoeVN0eWxlJztcclxuaW1wb3J0IHsgQW5hbHl0aWNzVHJlbmQgfSBmcm9tICcuL0FuYWx5dGljc1RyZW5kJztcclxuY29uc3QgVHJlbmRDb250YWluZXIgPSBzdHlsZWQuZGl2IGBcblx0ZGlzcGxheTogZmxleDtcblx0ZmxleC1kaXJlY3Rpb246IHJvdztcblx0ZmxleC13cmFwOiB3cmFwO1xuYDtcclxuZXhwb3J0IGNvbnN0IEFuYWx5dGljc01ldHJpYyA9ICh7IHRpdGxlLCB0cmVuZHMsIFJpZ2h0SGVhZGVyQ29tcG9uZW50LCBjb250YWluZXJTdHlsZSwgdGl0bGVTaXplLCB0aXRsZUNvbG9yLCBwZXJSb3csIH0pID0+IHtcclxuICAgIGNvbnN0IFR5cG8gPSB0aXRsZVNpemUgPT09ICdsYXJnZScgPyBUaXRsZU1lZGl1bSA6IFRpdGxlUmVndWxhcjtcclxuICAgIGNvbnN0IHBlclJvd0xvY2FsID0gcGVyUm93IHx8XHJcbiAgICAgICAgKHRyZW5kcy5sZW5ndGggPD0gNCA/IHRyZW5kcy5sZW5ndGggOiB0cmVuZHMubGVuZ3RoICUgMyA9PSAwID8gMyA6IDQpO1xyXG4gICAgY29uc3Qgcm93cyA9IE1hdGguY2VpbCh0cmVuZHMubGVuZ3RoIC8gcGVyUm93TG9jYWwpO1xyXG4gICAgcmV0dXJuIChfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IE9iamVjdC5hc3NpZ24oeyBwYWRkaW5nVG9wOiAyNCwgcGFkZGluZ0JvdHRvbTogMjQgfSwgKGNvbnRhaW5lclN0eWxlICE9PSBudWxsICYmIGNvbnRhaW5lclN0eWxlICE9PSB2b2lkIDAgPyBjb250YWluZXJTdHlsZSA6IHt9KSkgfSwgeyBjaGlsZHJlbjogW19qc3hzKFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6ICdmbGV4JyxcclxuICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAncm93JyxcclxuICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogJ3NwYWNlLWJldHdlZW4nLFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBbdGl0bGUgJiYgKF9qc3goVHlwbywgT2JqZWN0LmFzc2lnbih7IGNvbG9yOiB0aXRsZUNvbG9yICE9PSBudWxsICYmIHRpdGxlQ29sb3IgIT09IHZvaWQgMCA/IHRpdGxlQ29sb3IgOiBDT0xPUlMuY29udGVudC5zZWNvbmRhcnksIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogMjQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nUmlnaHQ6IDI0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZ0JvdHRvbTogOCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiB0aXRsZSB9KSkpLCBSaWdodEhlYWRlckNvbXBvbmVudF0gfSkpLCBfanN4KFRyZW5kQ29udGFpbmVyLCB7IGNoaWxkcmVuOiBBcnJheS5mcm9tKHsgbGVuZ3RoOiByb3dzIH0pLm1hcCgoXywgcm93SW5kZXgpID0+IChfanN4KF9GcmFnbWVudCwgeyBjaGlsZHJlbjogX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6ICdmbGV4JyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAnMTAwJScsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW5Ub3A6IHJvd0luZGV4ID09PSAwID8gMCA6IDE2LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IHRyZW5kc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNsaWNlKHJvd0luZGV4ICogcGVyUm93TG9jYWwsIChyb3dJbmRleCArIDEpICogcGVyUm93TG9jYWwpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWFwKCh0cmVuZCwgaSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIF9hO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4OiAxLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhXaWR0aDogdHJlbmRzLmxlbmd0aCA9PT0gMSA/ICcxMDAlJyA6ICc1MCUnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogX2pzeChBbmFseXRpY3NUcmVuZCwgT2JqZWN0LmFzc2lnbih7fSwgdHJlbmQsIHsgY2FyZDogZmFsc2UsIHNpemU6IChfYSA9IHRyZW5kLnNpemUpICE9PSBudWxsICYmIF9hICE9PSB2b2lkIDAgPyBfYSA6ICdzbWFsbCcsIHJpZ2h0U2VwYXJhdG9yOiBpICsgcm93SW5kZXggKiBwZXJSb3dMb2NhbCA8XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYXRoLm1pbigocm93SW5kZXggKyAxKSAqIHBlclJvd0xvY2FsIC0gMSwgdHJlbmRzLmxlbmd0aCAtIDEpIH0pKSB9KSwgaSkpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSB9KSwgcm93SW5kZXgpIH0pKSkgfSldIH0pKSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUFuYWx5dGljc01ldHJpYy5qcy5tYXAiXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}}),n=g=>{let{title:n,trends:a,RightHeaderComponent:i,containerStyle:s,titleSize:b,titleColor:y,perRow:o}=g;const m="large"===b?c:e,p=o||(a.length<=4?a.length:a.length%3==0?3:4),G=Math.ceil(a.length/p);return I("div",Object.assign({style:Object.assign({paddingTop:24,paddingBottom:24},null!=s?s:{})},{children:[I("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[n&&C(m,Object.assign({color:null!=y?y:l.content.secondary,style:{paddingLeft:24,paddingRight:24,paddingBottom:8}},{children:n})),i]})),C(t,{children:Array.from({length:G}).map(((g,I)=>C(A,{children:C("div",Object.assign({style:{display:"flex",width:"100%",marginTop:0===I?0:16}},{children:a.slice(I*p,(I+1)*p).map(((g,A)=>{var l;return C("div",Object.assign({style:{flex:1,maxWidth:1===a.length?"100%":"50%"}},{children:C(d,Object.assign({},g,{card:!1,size:null!==(l=g.size)&&void 0!==l?l:"small",rightSeparator:A+I*p<Math.min((I+1)*p-1,a.length-1)}))}),A)}))}),I)})))})]}))};export{n as AnalyticsMetric};
1
+ import g from"@emotion/styled/base";import{jsxs as I,jsx as C,Fragment as A}from"react/jsx-runtime";import{COLORS as l}from"../../constants/Theme.js";import{TitleMedium as c,TitleRegular as e}from"../TypographyStyle.js";import{AnalyticsTrend as t}from"./AnalyticsTrend.js";const d=g("div","production"===process.env.NODE_ENV?{target:"e1bel8cf0"}:{target:"e1bel8cf0",label:"TrendContainer"})("production"===process.env.NODE_ENV?{name:"jovua5",styles:"display:flex;flex-direction:row;flex-wrap:wrap"}:{name:"jovua5",styles:"display:flex;flex-direction:row;flex-wrap:wrap",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFuYWx5dGljc01ldHJpYy50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBS2tDIiwiZmlsZSI6IkFuYWx5dGljc01ldHJpYy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBqc3ggYXMgX2pzeCwganN4cyBhcyBfanN4cywgRnJhZ21lbnQgYXMgX0ZyYWdtZW50IH0gZnJvbSBcInJlYWN0L2pzeC1ydW50aW1lXCI7XHJcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgQ09MT1JTIH0gZnJvbSBcIi4uLy4uL2NvbnN0YW50cy9UaGVtZVwiO1xyXG5pbXBvcnQgeyBUaXRsZU1lZGl1bSwgVGl0bGVSZWd1bGFyIH0gZnJvbSAnLi4vVHlwb2dyYXBoeVN0eWxlJztcclxuaW1wb3J0IHsgQW5hbHl0aWNzVHJlbmQgfSBmcm9tICcuL0FuYWx5dGljc1RyZW5kJztcclxuY29uc3QgVHJlbmRDb250YWluZXIgPSBzdHlsZWQuZGl2IGBcblx0ZGlzcGxheTogZmxleDtcblx0ZmxleC1kaXJlY3Rpb246IHJvdztcblx0ZmxleC13cmFwOiB3cmFwO1xuYDtcclxuZXhwb3J0IGNvbnN0IEFuYWx5dGljc01ldHJpYyA9ICh7IHRpdGxlLCB0cmVuZHMsIFJpZ2h0SGVhZGVyQ29tcG9uZW50LCBjb250YWluZXJTdHlsZSwgdGl0bGVTaXplLCB0aXRsZUNvbG9yLCBwZXJSb3csIH0pID0+IHtcclxuICAgIGNvbnN0IFR5cG8gPSB0aXRsZVNpemUgPT09ICdsYXJnZScgPyBUaXRsZU1lZGl1bSA6IFRpdGxlUmVndWxhcjtcclxuICAgIGNvbnN0IHBlclJvd0xvY2FsID0gcGVyUm93IHx8XHJcbiAgICAgICAgKHRyZW5kcy5sZW5ndGggPD0gNCA/IHRyZW5kcy5sZW5ndGggOiB0cmVuZHMubGVuZ3RoICUgMyA9PSAwID8gMyA6IDQpO1xyXG4gICAgY29uc3Qgcm93cyA9IE1hdGguY2VpbCh0cmVuZHMubGVuZ3RoIC8gcGVyUm93TG9jYWwpO1xyXG4gICAgcmV0dXJuIChfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IE9iamVjdC5hc3NpZ24oeyBwYWRkaW5nVG9wOiAyNCwgcGFkZGluZ0JvdHRvbTogMjQgfSwgKGNvbnRhaW5lclN0eWxlICE9PSBudWxsICYmIGNvbnRhaW5lclN0eWxlICE9PSB2b2lkIDAgPyBjb250YWluZXJTdHlsZSA6IHt9KSkgfSwgeyBjaGlsZHJlbjogW19qc3hzKFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6ICdmbGV4JyxcclxuICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAncm93JyxcclxuICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogJ3NwYWNlLWJldHdlZW4nLFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBbdGl0bGUgJiYgKF9qc3goVHlwbywgT2JqZWN0LmFzc2lnbih7IGNvbG9yOiB0aXRsZUNvbG9yICE9PSBudWxsICYmIHRpdGxlQ29sb3IgIT09IHZvaWQgMCA/IHRpdGxlQ29sb3IgOiBDT0xPUlMuY29udGVudC5zZWNvbmRhcnksIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogMjQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nUmlnaHQ6IDI0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZ0JvdHRvbTogOCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiB0aXRsZSB9KSkpLCBSaWdodEhlYWRlckNvbXBvbmVudF0gfSkpLCBfanN4KFRyZW5kQ29udGFpbmVyLCB7IGNoaWxkcmVuOiBBcnJheS5mcm9tKHsgbGVuZ3RoOiByb3dzIH0pLm1hcCgoXywgcm93SW5kZXgpID0+IChfanN4KF9GcmFnbWVudCwgeyBjaGlsZHJlbjogX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHsgZGlzcGxheTogJ2ZsZXgnLCB3aWR0aDogJzEwMCUnIH0gfSwgeyBjaGlsZHJlbjogdHJlbmRzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2xpY2Uocm93SW5kZXggKiBwZXJSb3dMb2NhbCwgKHJvd0luZGV4ICsgMSkgKiBwZXJSb3dMb2NhbClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoKHRyZW5kLCBpKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgX2E7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsZXg6IDEsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFdpZHRoOiB0cmVuZHMubGVuZ3RoID09PSAxID8gJzEwMCUnIDogJzUwJScsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KEFuYWx5dGljc1RyZW5kLCBPYmplY3QuYXNzaWduKHt9LCB0cmVuZCwgeyBjYXJkOiBmYWxzZSwgc2l6ZTogKF9hID0gdHJlbmQuc2l6ZSkgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogJ3NtYWxsJywgcmlnaHRTZXBhcmF0b3I6IGkgKyByb3dJbmRleCAqIHBlclJvd0xvY2FsIDxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1hdGgubWluKChyb3dJbmRleCArIDEpICogcGVyUm93TG9jYWwgLSAxLCB0cmVuZHMubGVuZ3RoIC0gMSkgfSkpIH0pLCBpKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pIH0pLCByb3dJbmRleCkgfSkpKSB9KV0gfSkpKTtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9QW5hbHl0aWNzTWV0cmljLmpzLm1hcCJdfQ== */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}}),i=g=>{let{title:i,trends:n,RightHeaderComponent:b,containerStyle:a,titleSize:s,titleColor:o,perRow:u}=g;const m="large"===s?c:e,Z=u||(n.length<=4?n.length:n.length%3==0?3:4),G=Math.ceil(n.length/Z);return I("div",Object.assign({style:Object.assign({paddingTop:24,paddingBottom:24},null!=a?a:{})},{children:[I("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[i&&C(m,Object.assign({color:null!=o?o:l.content.secondary,style:{paddingLeft:24,paddingRight:24,paddingBottom:8}},{children:i})),b]})),C(d,{children:Array.from({length:G}).map(((g,I)=>C(A,{children:C("div",Object.assign({style:{display:"flex",width:"100%"}},{children:n.slice(I*Z,(I+1)*Z).map(((g,A)=>{var l;return C("div",Object.assign({style:{flex:1,maxWidth:1===n.length?"100%":"50%"}},{children:C(t,Object.assign({},g,{card:!1,size:null!==(l=g.size)&&void 0!==l?l:"small",rightSeparator:A+I*Z<Math.min((I+1)*Z-1,n.length-1)}))}),A)}))}),I)})))})]}))};export{i as AnalyticsMetric};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Menus: ({
3
2
  displayName: string;
4
3
  key: number;
@@ -53,6 +53,5 @@ export interface InputProps {
53
53
  version?: '1.0' | '2.0';
54
54
  textControl?: boolean;
55
55
  noMaxCharCheck?: boolean;
56
- tooltipText?: string;
57
56
  }
58
57
  export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement | null>>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i from"../../assets/icons/info.svg.js";import{forwardRef as l,useState as r,useContext as o,useRef as a,useEffect as s}from"react";import{Button as c}from"../button/Button.js";import{isFunction as d,validateInput as u}from"./Input-helper.js";import{Tooltip as h}from"../tooltips/Tooltip.js";import{BodySecondary as v}from"../TypographyStyle.js";import{COLORS as p}from"../../constants/Theme.js";import g from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as m}from"./context/InputStyleProvider.js";import{RootContainer as f,InputFooter as b,InputWrapper as y,IconHolder as x,PrefixHolder as j,InputContainer as C,InputContainerSmall as k,SuffixHolder as w,InputHeader as O,MaxCharStyle as T}from"./Input.styled.js";const I=l(((l,I)=>{var L,E,z,A,D;const{placeholder:F,leftIcon:M,rightIcon:B,labelText:S,maxCharLimit:K,isRequired:R,hintText:H,type:N,state:_,validate:q,variant:P,button:V,suffixText:W,prefixText:G,onChangeText:J,value:Q,noErrorHint:U,reset:X,rangeValidation:Y,noKeyDownChange:Z,version:$,noMaxCharCheck:ee,labelElement:te}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},l),ne=null==M?void 0:M.icon,ie=null==B?void 0:B.icon,[le,re]=r(!1),[oe,ae]=r(!1),[se,ce]=r(),de="small"===P?"18px":"22px",ue=o(m),[he,ve]=r(),pe=a(null),ge=null!=I?I:pe;s((()=>{ve(Q)}),[Q]),s((()=>{var e;ge.current&&(null===(e=l.onReferenceInit)||void 0===e||e.call(l,ge.current))}),[ge]),s((()=>{const e=ge.current;if(e&&["phonenumber","zip","number"].includes(N))return e.addEventListener("wheel",ye,{passive:!1}),()=>{e.removeEventListener("wheel",ye)}}),[]),s((()=>{X&&ve("")}),[X]),s((()=>{var e;ae(!!l.isActive),l.isActive&&(null===(e=ge.current)||void 0===e||e.focus())}),[l.isActive]),s((()=>{ce(l.errorMessage)}),[l.errorMessage]),s((()=>{var e;re(!1),("invalid"===l.state||se||"disabled-invalid"===l.state)&&re(!0),"active"===l.state&&(null===(e=ge.current)||void 0===e||e.focus())}),[l.state,se]),s((()=>{re(!!se)}),[se]);const me=function(e){if(d(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];e(...n)}},fe=()=>"zip"===N?6:60,be=e=>{const t=0!==K?K:fe();if(Z||J(Q||"",e),ee)return;const n=e.target.value;![8].includes(e.which)&&t>0&&n.length>=t&&e.preventDefault()},ye=e=>{e.preventDefault()},xe=e=>{let t=e.target.value;const n=0!==K?K+1:fe();!ee&&n>0&&t.length>=n&&(t=t.substring(0,n-1)),J(t,e),l.textControl||ve(t);const i=q||u;if(!i||!d(i))return;const[r,o]=i(t,N,Y);re(!r),ce(l.errorMessage?l.errorMessage:o)},je=e=>{var t;l.skipFocus||ae(!0),me(null===(t=l.onFocus)||void 0===t?void 0:t.call(l,e))},Ce=e=>{var t;l.skipFocus||ae(!1),me(null===(t=l.onBlur)||void 0===t?void 0:t.call(l,e))},ke=()=>{var i;return e(n,{children:["multiline"!==N&&t("input",{"data-test":l["data-test"],id:l.id,style:null!==(i=null==ue?void 0:ue.input)&&void 0!==i?i:{},ref:ge,type:["phonenumber","zip","number"].includes(N)?"number":N,value:he,onFocus:e=>je(e),onBlur:e=>Ce(e),placeholder:F||"Enter here",onChange:xe,onClick:e=>me(l.onClick),onKeyDown:e=>be(e)}),"multiline"===N&&t("textarea",{"data-test":l["data-test"],value:he,ref:ge,onFocus:e=>je(e),onBlur:e=>Ce(e),onClick:e=>me(l.onClick),placeholder:F||"Enter here",onChange:xe,onKeyDown:e=>be(e),maxLength:K>0?K:void 0})]})};return e(f,Object.assign({width:l.width,height:l.height,state:_,type:N,style:null!==(L=null==ue?void 0:ue.RootContainer)&&void 0!==L?L:{}},{children:[!U&&(!!H||!!se)&&e(b,Object.assign({invalid:!!se},{children:[!!se&&t(g,{width:16,height:16}),se||H]})),e(y,Object.assign({variant:P,state:_,width:l.width,isActive:"active"===_||oe,isInvalid:le,style:null!==(E=null==ue?void 0:ue.InputWrapper)&&void 0!==E?E:{},version:$,height:l.height},{children:[!!ne&&t(x,Object.assign({variant:P,iconSize:de,onClick:()=>me(null==M?void 0:M.callback),isLeft:!0,style:null!==(z=null==ue?void 0:ue.IconHolder)&&void 0!==z?z:{}},{children:t(ne,{})})),!!G&&t(j,Object.assign({variant:P},{children:G})),"default"===P&&t(C,Object.assign({height:l.height,type:l.type},{children:ke()})),"small"===P&&t(k,Object.assign({height:l.height,type:l.type},{children:ke()})),!!ie&&t(x,Object.assign({variant:P,iconSize:de,onClick:()=>me(null==B?void 0:B.callback),isLeft:!1},{children:t(ie,{})})),!!W&&t(w,Object.assign({variant:P},{children:W})),V&&V.text&&t(c,{buttonText:V.text,onClick:()=>me(null==V?void 0:V.onClick)})]})),(!!S||!!K)&&e(O,Object.assign({invalid:le},{children:[te&&te,e("div",Object.assign({className:"label__container"},{children:[e(v,{children:[S,R?t("span",{children:"*"}):""]}),l.tooltipText&&t(h,Object.assign({body:l.tooltipText,placement:"top"},{children:t("span",{children:t(i,{style:{marginTop:-3},width:18,height:18,color:le?p.content.negative:p.content.primary})})}))]})),K>0&&e(T,{children:[null!==(D=null===(A=l.value)||void 0===A?void 0:A.length)&&void 0!==D?D:0,"/",K]})]}))]}))}));I.displayName="Input";export{I as Input};
1
+ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{forwardRef as i,useState as l,useContext as r,useRef as o,useEffect as a}from"react";import{Button as s}from"../button/Button.js";import{isFunction as c,validateInput as u}from"./Input-helper.js";import{BodySecondary as d}from"../TypographyStyle.js";import v from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as h}from"./context/InputStyleProvider.js";import{RootContainer as p,InputFooter as g,InputWrapper as m,IconHolder as f,PrefixHolder as b,InputContainer as x,InputContainerSmall as y,SuffixHolder as j,InputHeader as C,MaxCharStyle as k}from"./Input.styled.js";const w=i(((i,w)=>{var I,O,L,T,E;const{placeholder:z,leftIcon:A,rightIcon:D,labelText:F,maxCharLimit:M,isRequired:B,hintText:S,type:K,state:R,validate:H,variant:q,button:N,suffixText:P,prefixText:V,onChangeText:W,value:G,noErrorHint:J,reset:Q,rangeValidation:U,noKeyDownChange:X,version:Y,noMaxCharCheck:Z,labelElement:$}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},i),_=null==A?void 0:A.icon,ee=null==D?void 0:D.icon,[te,ne]=l(!1),[ie,le]=l(!1),[re,oe]=l(),ae="small"===q?"18px":"22px",se=r(h),[ce,ue]=l(),de=o(null),ve=null!=w?w:de;a((()=>{ue(G)}),[G]),a((()=>{var e;ve.current&&(null===(e=i.onReferenceInit)||void 0===e||e.call(i,ve.current))}),[ve]),a((()=>{const e=ve.current;if(e&&["phonenumber","zip","number"].includes(K))return e.addEventListener("wheel",me,{passive:!1}),()=>{e.removeEventListener("wheel",me)}}),[]),a((()=>{Q&&ue("")}),[Q]),a((()=>{var e;le(!!i.isActive),i.isActive&&(null===(e=ve.current)||void 0===e||e.focus())}),[i.isActive]),a((()=>{oe(i.errorMessage)}),[i.errorMessage]),a((()=>{var e;ne(!1),("invalid"===i.state||re||"disabled-invalid"===i.state)&&ne(!0),"active"===i.state&&(null===(e=ve.current)||void 0===e||e.focus())}),[i.state,re]),a((()=>{ne(!!re)}),[re]);const he=function(e){if(c(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];e(...n)}},pe=()=>"zip"===K?6:60,ge=e=>{const t=0!==M?M:pe();if(X||W(G||"",e),Z)return;const n=e.target.value;![8].includes(e.which)&&t>0&&n.length>=t&&e.preventDefault()},me=e=>{e.preventDefault()},fe=e=>{let t=e.target.value;const n=0!==M?M+1:pe();!Z&&n>0&&t.length>=n&&(t=t.substring(0,n-1)),W(t,e),i.textControl||ue(t);const l=H||u;if(!l||!c(l))return;const[r,o]=l(t,K,U);ne(!r),oe(i.errorMessage?i.errorMessage:o)},be=e=>{var t;i.skipFocus||le(!0),he(null===(t=i.onFocus)||void 0===t?void 0:t.call(i,e))},xe=e=>{var t;i.skipFocus||le(!1),he(null===(t=i.onBlur)||void 0===t?void 0:t.call(i,e))},ye=()=>{var l;return e(n,{children:["multiline"!==K&&t("input",{"data-test":i["data-test"],id:i.id,style:null!==(l=null==se?void 0:se.input)&&void 0!==l?l:{},ref:ve,type:["phonenumber","zip","number"].includes(K)?"number":K,value:ce,onFocus:e=>be(e),onBlur:e=>xe(e),placeholder:z||"Enter here",onChange:fe,onClick:e=>he(i.onClick),onKeyDown:e=>ge(e)}),"multiline"===K&&t("textarea",{"data-test":i["data-test"],value:ce,ref:ve,onFocus:e=>be(e),onBlur:e=>xe(e),onClick:e=>he(i.onClick),placeholder:z||"Enter here",onChange:fe,onKeyDown:e=>ge(e),maxLength:M>0?M:void 0})]})};return e(p,Object.assign({width:i.width,height:i.height,state:R,type:K,style:null!==(I=null==se?void 0:se.RootContainer)&&void 0!==I?I:{}},{children:[!J&&(!!S||!!re)&&e(g,Object.assign({invalid:!!re},{children:[!!re&&t(v,{width:16,height:16}),re||S]})),e(m,Object.assign({variant:q,state:R,width:i.width,isActive:"active"===R||ie,isInvalid:te,style:null!==(O=null==se?void 0:se.InputWrapper)&&void 0!==O?O:{},version:Y,height:i.height},{children:[!!_&&t(f,Object.assign({variant:q,iconSize:ae,onClick:()=>he(null==A?void 0:A.callback),isLeft:!0,style:null!==(L=null==se?void 0:se.IconHolder)&&void 0!==L?L:{}},{children:t(_,{})})),!!V&&t(b,Object.assign({variant:q},{children:V})),"default"===q&&t(x,Object.assign({height:i.height,type:i.type},{children:ye()})),"small"===q&&t(y,Object.assign({height:i.height,type:i.type},{children:ye()})),!!ee&&t(f,Object.assign({variant:q,iconSize:ae,onClick:()=>he(null==D?void 0:D.callback),isLeft:!1},{children:t(ee,{})})),!!P&&t(j,Object.assign({variant:q},{children:P})),N&&N.text&&t(s,{buttonText:N.text,onClick:()=>he(null==N?void 0:N.onClick)})]})),(!!F||!!M)&&e(C,Object.assign({invalid:te},{children:[$&&$,e(d,{children:[F,B?t("span",{children:"*"}):""]}),M>0&&e(k,{children:[null!==(E=null===(T=i.value)||void 0===T?void 0:T.length)&&void 0!==E?E:0,"/",M]})]}))]}))}));w.displayName="Input";export{w as Input};