1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4834],{54834:function(e,l,t){t.r(l),t.d(l,{default:function(){return z}});var i=t(3827),r=t(64090),s=t(24232),a=t(30828),n=t(25032),o=t(74404),d=t.n(o),u=t(81754),c=t(73175),p=t(43046),f=t(91328),x=t(36510),b=t(47232),m=t(27579),v=t(70503),h=t(65652),g=t(82912),w=t(27227),y=t(29298),T=t(66877);let R=(0,s.default)(()=>Promise.all([t.e(1216),t.e(748)]).then(t.bind(t,90748)),{loadableGenerated:{webpack:()=>[90748]}}),E=(0,s.default)(()=>t.e(6681).then(t.bind(t,56681)),{loadableGenerated:{webpack:()=>[56681]}}),C=(0,s.default)(()=>Promise.all([t.e(5210),t.e(4066)]).then(t.bind(t,84066)),{loadableGenerated:{webpack:()=>[84066]}}),P=e=>{let{item:l,productId:t,isMobile:s,personalizedOptions:a,imageWithText:n,isUploadIncomplete:o,setIsToastVisible:d,setCurrentToast:u,setTextEntered:p,setPreviewImage:f,onContinueMultiImageUpload:x,drawerProps:b}=e,[v,P]=(0,r.useState)(0),_=(0,T.$)();return(0,i.jsx)("div",{className:_?"flex h-full min-h-0 flex-1 flex-col":void 0,children:(0,i.jsxs)(h.mQ,{children:[(0,i.jsxs)(g.Z,{selected:v,onChange:e=>{P(e)},tabCount:2,tabListStyle:"inline-flex w-full items-center gap-2 text-center border-b border-[#EEE] ".concat(_?"":"px-20"),isActiveStyle:"px-20 py-12 border-b-[#4C4D27] font-[500] !text-[#4C4D27]",children:[(0,i.jsx)(w.Z,{bgStyleClass:"px-20 py-12 w-[175px] border-b-2 font-14 text-center font-500 text-[#757575]",children:m._G.UPLOAD_PHOTOS}),(0,i.jsx)(w.Z,{bgStyleClass:"px-20 py-12 w-[175px] border-b-2 font-14 text-center font-500 text-[#757575]",children:m._G.ENTER_TEXT})]}),(0,i.jsx)(y.Z,{children:(0,i.jsxs)("div",{className:_?"flex min-h-0 flex-1 flex-col":void 0,children:[(0,i.jsxs)("div",{className:_?"h-full min-h-0 flex-1 overflow-y-auto pt-20":"h-[calc(100vh-180px)] overflow-auto pb-20 pl-20 pr-20 pt-20",children:[(0,i.jsx)(R,{item:l,productId:t,setIsToastVisible:d,setCurrentToast:u,onPersonalizationSaved:null==b?void 0:b.onPersonalizationSaved}),(0,i.jsx)(E,{item:l})]}),(0,i.jsx)("div",{className:_?"fixed left-0 bottom-0 mt-auto shrink-0 flex w-full flex-col items-center gap-[10px] border-t border-gray-200 bg-white-900 px-[16px] py-[16px]":"fixed bottom-0 flex w-full flex-col items-center gap-[10px] border-t border-gray-200 bg-white-900 px-[20px] py-[16px]",children:(0,i.jsx)(c.default,{classes:"text-base flex justify-center w-full",buttonVariant:"filled",label:"Continue",onClick:x,isRemoveExtraPadding:!0})})]})}),(0,i.jsx)(y.Z,{children:(0,i.jsx)(C,{isMobile:s,productId:t,personalizedOptions:null==a?void 0:a.filter(e=>"TEXT"===e.contentType),imageWithText:n,isUploadIncomplete:o,setTextEntered:p,setPreviewImage:f,drawerProps:b})})]})})};P.propTypes={item:d().object.isRequired,productId:d().string.isRequired,isMobile:d().bool.isRequired,personalizedOptions:d().array,imageWithText:d().bool.isRequired,isUploadIncomplete:d().bool.isRequired,setIsToastVisible:d().func.isRequired,setCurrentToast:d().func.isRequired,setTextEntered:d().func.isRequired,setPreviewImage:d().func.isRequired,onContinueMultiImageUpload:d().func.isRequired,drawerProps:d().object};var _=t(42630),I=t(96333),j=t(52426),q=t(68605);let S=(0,s.default)(()=>Promise.all([t.e(1216),t.e(748)]).then(t.bind(t,90748)),{loadableGenerated:{webpack:()=>[90748]}}),O=(0,s.default)(()=>t.e(6681).then(t.bind(t,56681)),{loadableGenerated:{webpack:()=>[56681]}}),k=e=>{let{item:l,productId:t,setPreviewImage:s,previewImage:o,isMobile:d,imageWithText:h,personalizedOptions:g,setTextEntered:w,cleverTapData:y,drawerProps:R}=e,{maxInputRequired:E,minInputRequired:C,fieldName:k,contentType:z,label:N}=l,U=(0,a.I0)(),{trackEvent:A}=(0,I.Z)(),[G,D]=(0,r.useState)({}),[L,M]=(0,r.useState)(null),[H,Z]=(0,r.useState)(!1),{isMultiImageDrawerOpen:V,onOpenMultiImageDrawer:W,onCloseMultiImageDrawer:X,setIsMultiImageDrawerOpen:F,hideVisibleUI:B,isEmbeddedInPreCheckout:K,onPersonalizationSaved:$}=R||{},J=(0,a.v9)(e=>e.personalization.multiImageConfig),Q=(0,a.v9)(e=>{var l;return null===(l=e.personalization)||void 0===l?void 0:l.uploadFinalStatus}),Y=(0,a.v9)(e=>{var l;return null===(l=e.personalization)||void 0===l?void 0:l.imageUploadError}),ee=(0,a.v9)(e=>{var l;return null===(l=e.personalization)||void 0===l?void 0:l.uploadProgressStatus}),el=(0,a.v9)(e=>e.personalization.userPersonalization),et=(0,a.v9)(e=>e.personalization.multiImageText),ei=(0,a.v9)(e=>e.personalization.clearPersonalizedData),er=(0,u.uZ)(J),es=parseInt(C,10)===er,ea=parseInt(C,10)>er,en=(null==ee?void 0:ee.percentComplete)!==""&&!Q,eo=(0,u.cu)(E);(0,r.useEffect)(()=>{ei&&U((0,n.Cc)(eo))},[ei]),(0,r.useEffect)(()=>{let e=(0,u.Nh)(t),l=e&&Array.isArray(e)&&(null==e?void 0:e.find(e=>e.fieldName===k));if(l&&(0,u.cw)(l.value).length>0){if(h&&w(!0),U((0,n.Pw)(e)),h&&Array.isArray(e)){let l=e.filter(e=>e.contentType===m._G.TEXT);l.length>0&&U((0,n.Rr)(l))}let t=null==eo?void 0:eo.map((e,t)=>{var i;let r=null==l?void 0:null===(i=l.value)||void 0===i?void 0:i[t];return r?{...e,imgUrl:r,uploaded:!0}:e});U((0,n.Cc)(t))}else U((0,n.Cc)(eo))},[k,t]),(0,r.useEffect)(()=>{es?(s(!0),A(j.dR.uploadPhotoDone,{...y,photo_count:er,is_photo_uploaded:!0},["clevertap"])):s(!1)},[es]);let ed=()=>{Z(!0),M(!0),D({})},eu=(0,r.useCallback)(()=>{let e={fieldName:k,contentType:z,label:N,index:null,value:(null==J?void 0:J.map(e=>null==e?void 0:e.imgUrl))||[]},l=h?[...et]:el;(0,u.qp)(t,e,l,U)},[z,U,k,h,N,J,et,t,el]),ec=(0,r.useMemo)(()=>{let e=null==g?void 0:g.filter(e=>"TEXT"===e.contentType),l=Array.isArray(et)&&et.length>0&&(null==et?void 0:et.filter(e=>null!==e&&(null==e?void 0:e.value.some(e=>""!==e))));return(null==e?void 0:e.length)===(null==l?void 0:l.length)},[et,g]),ep=()=>
1{if(h){if(ec)w(!0),s(!0),U((0,n.Kj)(!0)),eu(),U((0,n.y1)()),null==$||$(),null==X||X();else{let e=document.getElementById("tab_2");e&&e.click()}}else s(!0),eu(),U((0,n.y1)()),null==$||$(),null==X||X()},ef=()=>{if(ea){ed();return}ep(),(0,_.Vr)()};(0,r.useEffect)(()=>{let e={validationError:{variant:"info",header:m._G.PLEASE_UPLOAD_ALL_PHOTOS_TO_CONTINUE},sizeError:{variant:"error",header:"Upload failed",subHeader:m._G.PLEASE_CHECK_THE_INSTRUCTION_AGAIN},success:{variant:"success",header:m._G.PHOTOS_UPLOADED_SUCCESSFULLY},progress:{variant:"info",header:m._G.UPLOADING,subHeader:m._G.WINDOW_REFRESH_MESSAGE,fill:null==ee?void 0:ee.percentComplete,strokeWidth:"10"}},l=null;switch(!0){case H:l=e.validationError;break;case Y:l=e.sizeError;break;case Q:l=e.success;break;case!!ee:l=e.progress}l&&D(l)},[ee,Q,H,Y]);let ex=()=>Q||H||Y,eb=()=>{D({}),M(!1)},em=(0,r.useCallback)(()=>{if(en)return;(0,_.Vr)(),(0,q.Rk)();let e=(0,u.Nh)(t),i=h?{personalizedOptions:g,personalizedProduct:!0}:{personalizedOptions:[l],personalizedProduct:!0},r=Array.isArray(e)&&e.length>0&&(0,u.uJ)(i,e);
1if(ea||h&&!ec){if(r){if(U((0,n.Pw)(e)),h){let l=e.filter(e=>e.contentType===m._G.TEXT);U((0,n.Rr)(l)),w(!0)}}else{eu();let e=(0,u.Nh)(t);Array.isArray(e)&&e.length>0&&U((0,n.Pw)(e)),h&&w(ec),null==$||$()}}else eu(),h&&w(!0),null==$||$();U((0,n.y1)());let s=document.getElementById("tab_1");s&&s.click(),null==X||X()},[ec,U,h,ea,en,l,X,g,t,eu,w,$]),ev=(0,r.useCallback)(()=>!en,[en]),eh=(0,T.$)(),eg=K||eh,ew={Tag:"p",classes:"w-full flex items-center flex-shrink-0 font-600 text-16 text-fnp-500"},ey=(0,i.jsxs)("div",{className:eg?"relative flex h-full min-h-0 w-full flex-1 flex-col":"w-full",children:[!eg&&(d?(0,i.jsxs)("div",{className:"flex items-center justify-start ".concat("px-[16px] py-[10px] sm:flex border-b border-gray-300 "),children:[(0,i.jsx)(v.Z,{labelColor:"w-full font-normal",classes:"py-2",iconSrc:"/icons/left-arrow.svg",onClick:em}),(0,i.jsx)(f.default,{...ew,classes:"".concat(ew.classes," pl-12"),children:h?m._G.CUSTOMIZE_PRODUCT:m._G.UPLOAD_PHOTOS})]}):(0,i.jsx)(f.default,{...ew,classes:"".concat(ew.classes," ").concat("h-[48px] px-[16px] py-[10px] justify-between border-b border-gray-200 bg-white-900 shadow-sm"),children:h?m._G.CUSTOMIZE_PRODUCT:m._G.UPLOAD_PHOTOS})),h?(0,i.jsx)(P,{item:l,productId:t,setPreviewImage:s,isMobile:d,imageWithText:h,personalizedOptions:g,setTextEntered:w,isUploadIncomplete:ea,setIsToastVisible:M,setCurrentToast:D,setIsMultiImageDrawerOpen:F,onContinueMultiImageUpload:ef,drawerProps:R}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:eg?"min-h-0 flex-1 overflow-y-auto pb-80":"h-[calc(100vh-130px)] overflow-auto pb-20 pl-20 pr-20 pt-12",children:[(0,i.jsx)(S,{item:l,productId:t,setIsToastVisible:M,setCurrentToast:D,onPersonalizationSaved:null==R?void 0:R.onPersonalizationSaved}),(0,i.jsx)(O,{item:l})]}),(0,i.jsx)("div",{className:eg?"fixed left-0 bottom-0 mt-auto shrink-0 flex w-full flex-col items-center gap-[10px] border-t border-gray-200 bg-white-900 px-[16px] py-[16px]":"fixed bottom-0 flex w-full flex-col items-center gap-[10px] border-t border-gray-200 bg-white-900 px-[20px] py-[16px]",children:(0,i.jsx)(c.default,{classes:"text-base flex justify-center w-full",buttonVariant:"filled",label:"Continue",onClick:ef,isRemoveExtraPadding:!0})})]}),L&&(0,i.jsx)(x.default,{variant:null==G?void 0:G.variant,isToast:L,header:null==G?void 0:G.header,subHeader:null==G?void 0:G.subHeader,duration:3e3,isDrawer:!eg,isMobile:d,placement:"bottom",position:eg?b.rg:"",onToastChange:()=>{ex()&&(eb(),U((0,n.y1)()),Z(!1))},fill:null==G?void 0:G.fill,strokeWidth:(null==G?void 0:G.strokeWidth)||"10"})]});return(0,i.jsxs)("div",{className:eg?"flex h-full min-h-0 flex-1 flex-col":"w-full",children:[!B&&(0,i.jsx)(c.default,{classes:"text-base flex justify-center w-full",buttonVariant:"customOutlined",label:h||o?m._G.EDIT:(0,m.tx)(E),onClick:W,isRemoveExtraPadding:!0}),(V||K)&&(0,i.jsx)(p.default,{position:d?"bottom":"right",isOpen:V||K,onDrawerClose:em,onBeforeClose:ev,styles:"p-0 h-full ".concat(d?"":"min-w-[360px] max-w-[400px] xll:max-w-[532px] xl:max-w-[400px]"),isDrawerCustomStyles:!d,childContainerClass:eg?"flex h-full min-h-0 flex-1 flex-col":"",children:ey})]})};k.propTypes={item:d().shape({allowedMediaType:d().string.isRequired,minSize:d().number.isRequired,minUnit:d().string.isRequired,maxSize:d().number.isRequired,maxUnit:d().string.isRequired,contentType:d().string.isRequired,fieldName:d().string.isRequired,label:d().string.isRequired,required:d().bool.isRequired,maxInputRequired:d().number.isRequired,minInputRequired:d().number.isRequired,value:d().arrayOf(d().shape({url:d().string.isRequired,id:d().number.isRequired})).isRequired}).isRequired,indexNumber:d().number,setPreviewImage:d().func.isRequired,setImageSizeError:d().func.isRequired,productId:d().string.isRequired,previewImage:d().bool,isMobile:d().bool,imageWithText:d().bool.isRequired,personalizedOptions:d().arrayOf(d().shape({id:d().number.isRequired,text:d().string.isRequired})).isRequired,setTextEntered:d().func.isRequired,cleverTapData:d().object,drawerProps:d().object};var z=k}}]); 2//# sourceMappingURL=4834.b03d3297983d1072.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.