"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4190],{VYyz:function(e,t,a){a.d(t,{I:function(){return InputCommentBar},P:function(){return PopupDanger},S:function(){return SharePopup},a:function(){return PopupFrame},b:function(){return SubmitReportForm},c:function(){return S},d:function(){return getPostFormData},e:function(){return editPost},f:function(){return createPost},g:function(){return getDefaultFailNoti},h:function(){return deletePost},i:function(){return O},j:function(){return deleteComment},k:function(){return decodeCommentBody},l:function(){return likeUnlikeComment},m:function(){return likeUnlikePost},u:function(){return useImagePicker}});var n=a("q1tI"),r=a("Jn/A"),l=a("OGdO"),o=a("ZQ3V"),i=a("K2Xj"),s=a("i8i4"),d=a("4fTT"),c=a("rBCA"),u=a("iBNF"),p=a("6eqW"),m=a("4JTe"),g=a("ZKGu"),h=a("OQNV"),b=a("5+xW"),v=a("IQVP"),f=a("SfG2"),C=a("RDA3"),x=a("WpsW"),E=a("XaQQ"),y=a("ShtJ"),w=a("t/pd"),P=a("fKfj"),D=a("6k05"),I=a("8Jy2"),F=a("/pFO");let useImagePicker=(e,t)=>{let[a,r]=(0,n.useState)(e||[]),l=(0,n.useMemo)(()=>(e||a).map(e=>"string"==typeof e?e:URL.createObjectURL(e)),[e,a]);return{onSelectImages:n=>{let l=n.target.files;if(l){if(t&&e){let n=e||a;t(n.concat(Array.from(l)))}else r(a=>{let n=e||a;return t&&t(n.concat(Array.from(l))),n.concat(Array.from(l))})}},onRemoveImage:a=>{t&&e?(e.splice(a,1),t(e.slice())):r(n=>{let r=e||n;return r.splice(a,1),t&&t(r.slice()),r.slice()})},onRemoveAllImages:()=>{t?t([]):r([])},imageSrcs:l,imageFiles:e||a}},getDefaultFailNoti=e=>({message:e("notification.failure"),type:"danger"}),likeUnlikePost=({id:e,locale:t})=>(0,p.a)(void 0,void 0,void 0,function*(){if(!e)return;let a=yield(0,d.e)((0,d.f)(v.yy.POST.LIKE,{id:e,_locale:t}),"GET");return a}),deletePost=({id:e,locale:t})=>(0,p.a)(void 0,void 0,void 0,function*(){if(!e)return;let a=yield(0,d.e)((0,d.f)(v.yy.POST.DELETE,{id:e,_locale:t}),"DELETE");return a}),getPostFormData=({title:e,description:t,communityId:a,imageFiles:n,previewUrl:r,topicIds:l,locale:o,sanitizeFunction:s,categoryCommunityId:d,categoryTopicIds:c,introUrl:u,bannerUrl:m,scheduleTime:g,isAnonymous:h,isAskDoctor:v})=>(0,p.a)(void 0,void 0,void 0,function*(){let p=new FormData,C=(0,f.j)(t),x=(0,f.j)(e),E=(0,f.i)(C);if(p.append("title",x),p.append("description",(0,f.k)(C,s)),d?p.append("category_community",String(d)):a&&p.append("community_id",String(a)),p.append("is_anonymous",h?"1":"0"),p.append("is_question",v?"1":"0"),(null==r?void 0:r.title)&&p.append("preview_title",r.title),(null==r?void 0:r.description)&&p.append("preview_description",r.description),(null==r?void 0:r.url)&&p.append("preview_link",(0,i.c)(r.url)),(null==r?void 0:r.image)&&p.append("preview_image",(0,i.c)(r.image)),null==l||l.forEach(e=>{p.append("topics[]",String(e||""))}),null==c||c.forEach(e=>{p.append("category_topics[]",String(e||""))}),null==n?void 0:n.length){let e=yield Promise.all(n.map((e,t)=>new Promise(a=>{setTimeout(()=>{a((0,f.u)(e,o))},2e3*t)})));null==e||e.filter(Boolean).slice(0,b.M).forEach((e,t)=>{p.append(`images[${t}]`,e)})}else p.append("images","");return null==E||E.forEach(e=>{p.append("mention_ids[]",e)}),p.append("intro_url",u||""),p.append("banner",m||""),g&&(p.append("post_type","scheduled"),p.append("schedule_datetime",g)),p}),createPost=({locale:e,formData:t,isArticleComment:a})=>(0,p.a)(void 0,void 0,void 0,function*(){let n=yield(0,d.e)((0,d.f)(a?v.yy.POST.CREATE_ARTICLE_COMMENT:v.yy.POST.CREATE,{_locale:e}),"POST",{data:t});return n}),editPost=({id:e,locale:t,formData:a})=>(0,p.a)(void 0,void 0,void 0,function*(){let n=yield(0,d.e)((0,d.f)(v.yy.POST.UPDATE,{id:e,_locale:t}),"POST",{data:a});return n}),reportPost=({id:e,reason:t,locale:a})=>{let n=new FormData;return n.append("reason",t),(0,d.e)((0,d.f)(v.yy.POST.REPORT,{_locale:a,id:e}),"POST",{data:n})},k=c.Z.div` [data-type='confirm'] { max-width: 468px; /* height: 486px; */ padding: 0; .popup-content { display: flex; flex-direction: column; padding: 0; .close-button { top: 16px; right: 16px; width: 24px; height: 24px; z-index: 5; } .header { display: flex; height: 56px; align-items: center; padding: 16px 56px 16px 32px; border-bottom: 1px solid ${u.r.colors.neutral100}; font-weight: 900; width: 100%; justify-content: space-between; } .content { overflow: auto; flex: 1; .topic-list-wrapper { padding: 1rem; } } } } > div&[data-open='true'] { z-index: 250; &:last-child { z-index: 200; } } ${e=>e.isExpand&&` & > div[data-open] { width: 100%; height: 100%; max-width: none; max-height: none; } `} ${e=>e.hasFullscreen&&` & > div[data-open] { transition: all 0.5s ease-in-out, width 0s, height 0s; } `} `,_=c.Z.div` cursor: pointer; display: flex; align-items: center; `,PopupFrame=({className:e,style:t,closeIcon:a,heading:r="",children:o,isOpen:i=!1,hasFullscreen:s=!1,disableClickOutside:d=!1,initExpand:c=!1,onExpandChange:u,onClose:p=()=>null})=>{let[m,g]=(0,n.useState)(c);return n.createElement(k,{className:e,style:t,isExpand:m,hasFullscreen:s},n.createElement(D.P,{type:"confirm",onClose:p,isOpen:i,closeIcon:a||n.createElement("img",{src:I.C,loading:"lazy"}),enableAnimation:!s,disableClickOutside:d},n.createElement("div",{className:"header"},n.createElement(l.H,{tag:"h5"},r),s&&n.createElement(_,{onClick:()=>{null==u||u(),g(!m)}},n.createElement(P.Z,{size:14,isExpand:m}))),n.createElement("div",{className:"content"},"function"==typeof o?o(m):o)))};var S="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='25' fill='none'%3e%3cpath fill='%23262626' d='M12 22.984c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.478-10 10 4.477 10 10 10'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m14.828 10.156-5.657 5.657M9.172 10.156l5.657 5.657'/%3e%3c/svg%3e";let L=c.Z.div` [data-type='confirm'] { width: min(360px, 100%); height: auto; &[data-open='false'] { top: calc(-100% - 500px); } } z-index: 600; .header { display: none !important; } .confirm-dialog { position: relative; overflow: auto; width: 100%; padding-top: 44px; background: #fff; border-radius: ${u.r.borderRadius}; .confirm-content { display: flex; flex-direction: column; align-items: center; padding: 0 16px 16px; text-align: center; .title { margin-bottom: 8px; font-size: 24px; line-height: 32px; word-break: break-word; overflow-wrap: break-word; } .desc { margin-bottom: 24px; color: ${u.r.colors.gray500}; font-size: 18px; line-height: 24px; text-align: center; word-break: break-word; overflow-wrap: break-word; } .btn-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; button { margin: 0 4px 0.5rem; } } } } .thumbnail-container { width: 80px; height: 80px; margin-bottom: 32px; .thumbnail { width: 100%; height: 100%; } &.is-icon { display: flex; align-items: center; justify-content: center; background: #e0e9fc; border-radius: 1rem; .thumbnail { width: 40px; height: 40px; } } } &[data-is-marrybaby='true'] { .popup-frame { > div:first-child { overflow: hidden; border-radius: 1rem; &[data-open='true'] { ${i.M.mbDown} { top: 100%; transform: translate(-50%, -100%); max-width: unset; width: 100%; background: unset; overflow: unset; } } } .popup-content { .close-button { ${i.M.mbDown} { display: none; } } .confirm-dialog { ${i.M.mbDown} { background: unset; position: relative; overflow-x: hidden; &::before { content: ''; width: 200%; background: #fff; position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: -1; height: 100%; border-top-left-radius: 100%; border-top-right-radius: 100%; } } .confirm-content { padding: 0 40px 40px; ${i.M.mbDown} { padding-left: 1.5rem; padding-right: 1.5rem; } .btn-group { width: 100%; justify-content: space-between; button { flex: 1; margin: 0; &:first-child { margin-right: 0.5rem; } } } } } } .thumbnail-container { ${i.M.mbDown} { display: none; } &.is-icon { background: #ffeaf1; border-radius: 24px; } &.is-mobile { position: absolute; top: 0; left: 50%; display: none; width: 48px; height: 48px; transform: translate(-50%, -50%); &.is-icon { border-radius: 1rem; .thumbnail { width: 24px; height: 24px; } } ${i.M.mbDown} { display: flex; } } } } } `,PopupDanger=({className:e,isMarryBaby:t,style:a,title:c,description:u,acceptText:p,cancelText:m,onAccept:g,onCancel:h,thumbnail:b,isThumbnailIcon:v,onClose:f,acceptBtnTracking:C,acceptBtnProps:x,cancelBtnProps:E})=>{let{data:{env:{isMarryBaby:y}}}=(0,n.useContext)(d.T),w="boolean"==typeof t?t:y,[P,D]=(0,n.useState)(!1);return((0,n.useEffect)(()=>((0,i.t)(!0),setTimeout(()=>D(!0),0),()=>(0,i.t)(!1)),[]),"undefined"==typeof window)?null:s.createPortal(n.createElement(L,{"data-is-marrybaby":w,className:e,style:a,"data-open":P},n.createElement(PopupFrame,{className:"popup-frame",isOpen:P,onClose:f},n.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},n.createElement("div",{className:"confirm-content"},b&&n.createElement("div",{className:`thumbnail-container ${v?"is-icon":""}`},n.createElement("img",{className:"thumbnail",src:b,loading:"lazy"})),n.createElement(l.H,{className:"title",tag:"h2"},c),n.createElement(o.T,{className:"desc",size:"lg"},u),n.createElement("div",{className:"btn-group"},n.createElement(r.B,Object.assign({theme:w?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==g||g(),null==f||f()}},x,C),p),n.createElement(r.B,Object.assign({theme:w?"marryBaby":"helloSites",size:"md",onClick:()=>{null==h||h(),null==f||f()}},E),m)))),w&&b&&n.createElement("div",{className:`thumbnail-container is-mobile ${v?"is-icon":""}`},n.createElement("img",{className:"thumbnail",src:b,loading:"lazy"})))),(0,i.a)())},M=c.Z.div` padding: 1rem; border-top: 1px solid #f2f2f2; &[data-is-reply='true'] { padding-right: 0; padding-left: 0; border-top: 1px solid #e4e8ec; margin-right: 1rem; margin-left: 1rem; } .error-text { padding: 1rem; color: ${u.r.colors.red700}; } .reply-to-container { display: flex; justify-content: space-between; padding-bottom: 0.75rem; margin-top: -0.25rem; .icon-close-comment { width: 16px; height: 16px; cursor: pointer; } a { text-decoration: none; } } .input-container { display: flex; align-items: center; .avatar-wrapper { display: flex; flex-shrink: 0; align-items: center; margin-right: 0.5rem; &.avatar-wrapper-reply { width: 32px; height: 32px; .avatar { width: 32px; height: 32px; } } } .input-wrapper { margin-right: 0.5rem; &[data-has-error] { .as-input { border-color: ${u.r.colors.red700}; } } .as-input { .textarea { width: 100%; max-height: 225px; min-height: 75px; .ql-toolbar { padding: 0; } .ql-editor { padding-left: 0; padding-right: 0; } .quill { height: 0; } } width: 100%; padding: 12px 16px; border: solid 1px ${u.r.colors.gray200}; border-radius: ${u.r.borderRadius}; &:active, &:focus { border-color: ${u.r.colors.primaryBase}; box-shadow: 0px 0px 2px 2px ${u.r.colors.primary200}; } &:disabled { background-color: ${u.r.colors.gray100}; cursor: not-allowed; } span { &[data-error='true'] { color: red; text-decoration: underline; } } } &[data-has-action-icon] { .as-input { padding: 12px 48px 12px 16px; } } &[data-has-display-icon] { .as-input { padding: 12px 16px 12px 48px; } } &[data-has-action-icon][data-has-display-icon] { .as-input { padding: 12px 48px; } } &[data-size='lg'] { .as-input { font-size: 16px; font-weight: ${u.r.sizes.fwRegular}; ${i.M.mbDown} { font-size: 22px; line-height: 1.2; } ${i.M.mbUp} { font-size: 26px; line-height: 1.2; } } } &[data-size='md'] { .as-input { font-weight: ${u.r.sizes.fwRegular}; line-height: 22px; ${i.M.mbDown} { font-size: 14px; line-height: 1.2; } ${i.M.mbUp} { font-size: 16px; line-height: 1.2; } } } &[data-size='sm'] { .as-input { font-weight: ${u.r.sizes.fwRegular}; line-height: 20px; ${i.M.mbDown} { font-size: 13px; line-height: 1.5; } ${i.M.mbUp} { font-size: 13px; line-height: 1.5; } } } } .images-input-label { height: 100%; cursor: pointer; .icon-images-input { width: 24px; height: 24px; vertical-align: middle; } } .send-button { display: flex; width: 40px; height: 40px; flex-shrink: 0; align-items: center; justify-content: center; padding: 0; border: none; &.send-button-post { background: ${u.r.colors.neutral100}; border-radius: 50%; } .icon-enter { width: 20px; height: 20px; vertical-align: middle; } &[data-is-loading='true'] { > div { display: flex; align-items: center; justify-content: center; } } } } .preview-images-container { margin-top: 1rem; .image-src-wrapper { position: relative; width: 100%; padding-top: 66.67%; &:not(:last-child) { margin-bottom: 1rem; } .preview-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; } .icon-close-circle { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; cursor: pointer; } } } `,$=(0,n.createContext)({}),getCommentFormBody=({postId:e,message:t,photos:a,link:n,locale:r,sanitizeFunction:l,replyingUserId:o,replyingUserName:i,replyingId:s})=>(0,p.a)(void 0,void 0,void 0,function*(){let d=new FormData,c=(0,f.k)(t.replace(/(\ )+/g," "),l),u=(0,f.i)(c);if(a&&a.length>0){let e=yield Promise.all(null==a?void 0:a.map(e=>(0,f.u)(e,r)));e.filter(Boolean).slice(0,b.M).forEach(e=>{d.append("images[]",e)})}return n&&d.append("link",n),null==u||u.forEach(e=>{d.append("mention_ids[]",e)}),d.append("post_id",e),s&&d.append("parent_id",s),o&&(u.unshift(o),c=`[mention+id="${o}"+name="${(i||"").replace('"',"'")}"]${c}`,d.append("parent_user_id",String(o))),d.append("content",c),d.append("content",c),d}),submitComment=(e,t)=>(0,p.a)(void 0,void 0,void 0,function*(){return(0,d.e)((0,d.f)(v.yy.COMMENT.CREATE,{_locale:t}),"POST",{data:e})}),decodeCommentBody=e=>{try{let t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"",n=e.replace(/\[@([^\]]+)\]/,"");return{text:n.trim(),replyingTo:a}}catch(e){}return{text:""}},submitReply=(e,t)=>(0,p.a)(void 0,void 0,void 0,function*(){return(0,d.e)((0,d.f)(v.yy.COMMENT.REPLY,{_locale:t}),"POST",{data:e})}),likeUnlikeComment=({commentId:e,setLike:t=!1,locale:a})=>(0,p.a)(void 0,void 0,void 0,function*(){return(0,d.e)((0,d.f)(t?v.yy.COMMENT.LIKE:v.yy.COMMENT.UNLIKE,{_locale:a,id:e}),"GET")}),deleteComment=({id:e,locale:t})=>(0,d.e)((0,d.f)(v.yy.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"),InputCommentBar=({isReply:e,className:t,onClose:a,replyToName:l,style:i,replyingId:s,replyingUser:c,onPostSuccess:u,post:v,isMarryBaby:f})=>{let{action:{pushNotifications:w,sanitizeFunction:P},data:{userInfo:D,locale:I,env:{isMarryBaby:F}}}=(0,n.useContext)(d.T),{t:k}=(0,g.u)(),{onSelectImages:_,onRemoveImage:L,imageSrcs:T,onRemoveAllImages:N,imageFiles:O}=useImagePicker(),[H,B]=(0,n.useState)(""),{trigger:j}=(0,n.useContext)($),[z,R]=(0,n.useState)(!1),Z=(0,n.useRef)(null),A=(0,n.useRef)(null),U=(0,n.useRef)(null),[V,W]=(0,n.useState)([]),[q,Q]=(0,n.useState)([]),[G,K]=(0,n.useState)(null);return(0,n.useEffect)(()=>{var e;null===(e=U.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{var e;null===(e=A.current)||void 0===e||e.focus()},400)},[j]),n.createElement(M,{"data-is-reply":e,className:t,style:i},e&&n.createElement("div",{className:"reply-to-container"},n.createElement(o.T,{size:"p4"},n.createElement("span",{dangerouslySetInnerHTML:{__html:k("inputComment.replyTo",{name:`@${l||""}`})}})),n.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3ccircle cx='8' cy='8.5' r='6.667' fill='white' stroke='%23404040'/%3e%3cpath stroke='%23404040' stroke-linecap='round' stroke-linejoin='round' d='m10 6.5-4 4M6 6.5l4 4'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>a&&a(),loading:"lazy"})),n.createElement("div",{className:"input-container",ref:U},n.createElement(E.U,{className:`avatar-wrapper ${e?"avatar-wrapper-reply":""}`,avatar:(null==D?void 0:D.id)?D.avatar:b.D,username:(null==D?void 0:D.name)||(null==D?void 0:D.username)}),n.createElement("input",{ref:Z,onChange:_,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),n.createElement(m.I,{value:H,name:"input",size:"md",className:"input-wrapper",displayIcon:n.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M10.754 4.854H4.492a1.79 1.79 0 0 0-1.789 1.789v12.524a1.79 1.79 0 0 0 1.79 1.789h12.523a1.79 1.79 0 0 0 1.79-1.79v-6.261'/%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M17.463 3.512a1.898 1.898 0 0 1 2.684 2.684l-8.498 8.498-3.579.895.895-3.579z'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:n.createElement("div",{className:"as-input"},n.createElement(y.R,{className:"textarea",html:H,onChange:B,onImagePickerClick:()=>{var e;return null===(e=Z.current)||void 0===e?void 0:e.click()},bannedWords:q,onPreviewUrlChange:K,onInvalidUrlsChange:W,setEditorRef:e=>A.current=e,isReplying:e}))}),n.createElement(r.B,{theme:("boolean"==typeof f?f:F)?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>(0,p.a)(void 0,void 0,void 0,function*(){var t,n,r,l,o,i,d,p,m;if((null==v?void 0:v.id)&&!z){R(!0);try{let g=yield getCommentFormBody(Object.assign({message:H,photos:O,postId:String(v.id),link:null==G?void 0:G.url,sanitizeFunction:P,locale:I},e&&s?{replyingUserId:String((null==c?void 0:c.id)||(null===(t=null==v?void 0:v.author)||void 0===t?void 0:t.id)||""),replyingId:s,replyingUserName:(null==c?void 0:c.name)||(null==c?void 0:c.username)||""}:{})),b=yield e&&s?submitReply(g,I):submitComment(g,I),f=null==b?void 0:b.data;(null==f?void 0:f.id)&&!(null===(r=null===(n=null==b?void 0:b.messages)||void 0===n?void 0:n.moderation)||void 0===r?void 0:r.type)?(e=>{B(""),N(),a&&a();let t=(0,h.g)(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),u&&u(t)})(b):(null===(o=null===(l=null==b?void 0:b.messages)||void 0===l?void 0:l.moderation)||void 0===o?void 0:o.type)==="banned"?(w({title:k("notification.comment.blocked.title"),message:k("notification.comment.blocked.message"),type:"danger"}),b.messages.moderation.words&&Q(b.messages.moderation.words)):(null===(d=null===(i=null==b?void 0:b.messages)||void 0===i?void 0:i.moderation)||void 0===d?void 0:d.type)==="suspect"?(w({title:k("notification.comment.suspect.title"),message:k("notification.comment.suspect.message"),type:"warning"}),B(""),N(),a&&a()):(null===(p=null==b?void 0:b.messages)||void 0===p?void 0:p.find(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))}))?(w({message:k("notification.suspend.message"),type:"warning"}),B(""),N(),a&&a()):w({title:"",message:(null===(m=null==b?void 0:b.messages)||void 0===m?void 0:m[0])||k("notification.comment.somethingWrong"),type:"danger"})}catch(e){w({title:"",message:k("notification.comment.somethingWrong"),type:"danger"})}R(!1)}}),isLoading:z,isDisabled:!!(null==V?void 0:V.length)||z||!H||(null==H?void 0:H.length)<2||!H.trim()},n.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='21' fill='none'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m7.5 9.734-3.75 3.75 3.75 3.75'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M16.25 4.734v5.569c0 .843-.33 1.653-.915 2.25a3.1 3.1 0 0 1-2.21.931H3.75'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==V?void 0:V.length)?n.createElement("div",{className:"error-text"},k("notification.limitUrlDomain")):null,(!T||0===T.length)&&G&&n.createElement("div",{className:"link-preview-wrapper"},G.isFetching?n.createElement(x.L,null):n.createElement(n.Fragment,null,n.createElement(C.C,{title:G.title,url:G.url||"#",image:G.image,noRefetch:!0}),n.createElement("img",{src:S,className:"icon-close",onClick:()=>K(null),loading:"lazy"}))),T&&T.length>0&&n.createElement("div",{className:"preview-images-container"},T.map((e,t)=>n.createElement("div",{key:t,className:"image-src-wrapper"},n.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),n.createElement("img",{src:S,className:"icon-close-circle",onClick:()=>L(t),loading:"lazy"})))))},SharePopup=({trackingCategory:e,className:t,style:a,url:r,text:l,onClose:o})=>{let{data:{env:{isMarryBaby:s}}}=(0,n.useContext)(d.T),{t:c}=(0,g.u)(),[u,p]=(0,n.useState)(!1);return(0,n.useEffect)(()=>((0,i.t)(!0),setTimeout(()=>p(!0),0),()=>(0,i.t)(!1)),[]),n.createElement(w.h,null,n.createElement(T,{"data-is-marrybaby":s,className:t,style:a},n.createElement(PopupFrame,{className:"share-popup",isOpen:u,onClose:o,heading:c("bottomBar.share")},u&&n.createElement(F.r,{trackingCategory:e,shareUrl:r||("undefined"!=typeof window?window.location.href:""),title:l}))))},T=c.Z.div` .share-popup { > div:first-child { height: unset; } } .custom-share__header { display: flex; flex-wrap: no-wrap; align-items: center; padding: 1rem; border-bottom: 1px solid ${u.r.colors.neutral100}; margin-bottom: 16px; .custom-share__header-image { width: 38px; height: 38px; flex-shrink: 0; & > img { width: 100%; height: 100%; object-fit: cover; object-position: center; } } .custom-share__header-info { flex: 1; padding: 0 8px; word-break: break-word; [data-tag='h4'] { margin-bottom: 8px; font-size: 14px; font-weight: bold; line-height: 14px; } [data-size='md'] { color: #a5a5a5; font-size: 14px; line-height: 14px; } } } &[data-is-marrybaby='true'] { .share-popup { > div:first-child { overflow: hidden; border-radius: 1rem; &[data-open='true'] { ${i.M.mbDown} { max-width: unset; width: 100%; top: 100%; transform: translate(-50%, -100%); border-bottom-left-radius: 0; border-bottom-right-radius: 0; } } } .close-button { display: block; } .popup-content { .header { display: block; padding: 1rem; background-color: rgb(243, 243, 243); } .content { padding-bottom: 1rem; } } .share-mb-text { margin: 1rem 1rem 0.5rem; } } } `,N=c.Z.div` padding: 0 8px; margin-top: 18px; .report-list { margin-bottom: 18px; .report-item { display: flex; align-items: center; margin-bottom: 10px; font-weight: 600; & > img { width: 12px; height: 12px; margin-right: 8px; } .__label { font-size: 14px; } } } .report-submit { width: 100%; } &[data-is-marrybaby='true'] { padding: 0 1rem 1rem; } `;var O="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12M8 5v3M8 11h.007'/%3e%3c/svg%3e";let SubmitReportForm=({className:e,style:t,reason:a,reasonText:l,onClose:i,postId:s})=>{let{data:{locale:c,env:{isMarryBaby:m}},action:{pushNotifications:h}}=(0,n.useContext)(d.T),{t:b}=(0,g.u)(),[v,f]=(0,n.useState)(!1);return n.createElement(N,{"data-is-marrybaby":m,className:e,style:t},n.createElement("ul",{className:"report-list"},n.createElement("li",{className:"report-item"},n.createElement("img",{src:O,loading:"lazy"}),n.createElement(o.T,{className:"__label",color:u.r.colors.gray800,size:"p4"},l))),n.createElement(r.B,{theme:m?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:v,onClick:()=>(0,p.a)(void 0,void 0,void 0,function*(){if(s&&!v){f(!0);try{let e=yield reportPost({id:s,reason:a,locale:c});(null==e?void 0:e.status)===1&&(h({message:"Post reported",type:"success"}),i&&i())}catch(e){}f(!1)}})},b("submit")))}},"3r1x":function(e,t,a){a.d(t,{B:function(){return BabyPoopForm}});var n=a("6eqW"),r=a("q1tI"),l=a("/npG"),o=a("mYVa"),i=a("Eso5"),s=a("iuhU"),d=a("ZQ3V"),c=a("p3w3"),u=a("ZKGu"),p=a("yjyv"),m=a("Xlwb"),g=(0,l.k)((e,{hasOnClickFn:t})=>({root:{position:"relative",display:"flex",flexDirection:"column",gap:(0,o.h)(16)},sponsorBox:{display:"flex",gap:(0,o.h)(12),alignItems:"center",backgroundColor:e.colors.neutral[0],border:`1px solid ${e.colors.neutral[1]}`,borderRadius:(0,o.h)(4),padding:"4px 12px",alignSelf:"flex-start"},sponsorLogo:{maxHeight:(0,o.h)(32)},btn:{minWidth:(0,o.h)(180),[e.fn.largerThan("sm")]:{alignSelf:"flex-end"},visibility:t?"visible":"hidden"}}));let BabyPoopForm=e=>{var{babyPoopPage:t,onClickFindOut:a,currentUrl:l,sponsorLogo:o,btnProps:h,styles:b,classNames:v}=e,f=(0,n._)(e,["babyPoopPage","onClickFindOut","currentUrl","sponsorLogo","btnProps","styles","classNames"]);let{t:C}=(0,u.u)(),{classes:x}=g({hasOnClickFn:!!a},{name:"BabyPoopForm",styles:b,classNames:v}),{classes:E={}}=(0,r.useContext)(p.C);return r.createElement(m.H.FormRow,null,r.createElement(i.x,Object.assign({className:x.root},f),o&&r.createElement(i.x,{className:x.sponsorBox},r.createElement(d.T,{size:"p4"},C("common.sponsoredBy")),r.createElement("img",{loading:"lazy",src:o,alt:"sponsor",className:x.sponsorLogo})),r.createElement(d.T,{size:"p3",as:"div",className:"description",dangerouslySetInnerHTML:{__html:t.description}}),r.createElement(c.B,Object.assign({className:(0,s.default)(x.btn,E.submitBtn),onClick:a,dataEventCategory:"Health Tool",dataEventAction:"Baby Stool Inquiry",dataEventLabel:l},h),C("babyPoop.findOut"))))}},"7mOA":function(e,t,a){a.d(t,{D:function(){return DatePicker}});var n=a("6eqW"),r=a("q1tI"),l=a("8vDj"),o=a("gHhT"),i=a("catb"),s=a("Jbia"),d=a("i2MM"),c=a("Yoob"),u=a("PmKk"),p=a("yNk5");let DatePicker=e=>{var t,{value:a,fullWidth:m=!0}=e,g=(0,n._)(e,["value","fullWidth"]);let h=(0,l.rZ)(),b="mb"===h.other.template,v=null===(t=s.I[p.env.UNIFY_LOCALE||u.L.Vietnam])||void 0===t?void 0:t.dateFormat;return r.createElement(i.a,Object.assign({locale:c.M[p.env.UNIFY_LOCALE||u.L.Vietnam],valueFormat:v,size:"md",clearable:!1,popoverProps:m?{styles:{dropdown:{minWidth:"100%",display:"flex",justifyContent:"center",alignItems:"center"}}}:{},styles:{root:{position:"relative"},rightSection:{pointerEvents:"none",cursor:"default"}},rightSection:r.createElement(o.E,{src:d.C.getAssetPath(b?"MB-calendar.svg":"OutlineCalendar.svg"),width:18,height:18}),value:a,placeholder:v},g,{className:`input-control ${(null==g?void 0:g.className)||""}`}))}},o912:function(e,t,a){a.d(t,{D:function(){return DueDateForm},a:function(){return $}});var n,r,l,o,i=a("6eqW"),s=a("q1tI"),d=a("8vDj"),c=a("iuhU"),u=a("DA0W"),p=a("SPK5"),m=a("FQtM"),g=a("Eso5"),h=a("25AQ"),b=a("mhs0"),v=a("PmKk"),f=a("cChf"),C=a("ZFu2"),x=a("Wgwc"),E=a.n(x),y=a("TH2c"),w=a("7mOA"),P=a("ZQ3V"),D=a("ZKGu"),I=a("Xlwb"),F=a("fkrl"),k=a("yjyv"),_=a("Jbia"),S=a("iBNF");(n=l||(l={}))[n.lastPeriod=0]="lastPeriod",n[n.conception=1]="conception",n[n.IVF=2]="IVF",n[n.IUI=3]="IUI",n[n.ultrasound=4]="ultrasound";let L={[String(l.lastPeriod)]:{value:String(l.lastPeriod),icon:b.L,label:"dueDatePage.lastPeriod"},[String(l.IVF)]:{value:String(l.IVF),icon:e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,i._)(e,["isMarryBaby","size"]);let r=Object.assign({width:a,height:a},n);return t?s.createElement("svg",Object.assign({viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),s.createElement("path",{d:"M15.804 28.278a3.16 3.16 0 0 1-3.18-3.208l.128-20.306 6.405.008-.128 20.307c-.012 1.757-1.452 3.191-3.225 3.2",fill:"#fff"}),s.createElement("path",{d:"m12.72 10.266-.116 14.788c-.011 1.757 1.423 3.197 3.18 3.208 1.774-.008 3.214-1.442 3.225-3.2V10.267",fill:"#FFEAF1"}),s.createElement("circle",{cx:"14.662",cy:"19.027",transform:"rotate(-49.83 14.662 19.027)",fill:"#3E3F58",r:"1.012"}),s.createElement("circle",{cx:"16.326",cy:"13.426",r:"1.012",transform:"rotate(-49.83 16.326 13.426)",fill:"#3E3F58"}),s.createElement("path",{d:"m14.662 19.026.087 1.022a.98.98 0 0 0 .344.667.98.98 0 0 1 .32.98l-.123.51m1.036-8.779.087 1.022a.98.98 0 0 0 .344.666.98.98 0 0 1 .32.98l-.123.511",stroke:"#3E3F58"}),s.createElement("path",{d:"M18.833 27.597a3.94 3.94 0 0 1-3.02 1.408 4 4 0 0 1-2.795-1.148 3.98 3.98 0 0 1-1.14-2.795l.108-20.553c0-.426.344-.756.753-.738.426 0 .757.345.738.754l-.108 20.553c.002.656.248 1.256.697 1.733a2.42 2.42 0 0 0 1.727.706 2.483 2.483 0 0 0 2.47-2.462l.109-20.553c0-.426.344-.757.753-.738.426 0 .757.344.738.754l-.108 20.553a3.85 3.85 0 0 1-.922 2.526",fill:"#202135"}),s.createElement("path",{d:"M20.753 4.975a.75.75 0 0 1-.58.262l-8.714-.027a.727.727 0 0 1-.738-.754c0-.425.344-.756.754-.737l8.713.026c.426 0 .756.344.738.754a.66.66 0 0 1-.173.476",fill:"#202135"})):s.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),s.createElement("path",{d:"M13.064 5.794a17.8 17.8 0 0 1 3.34-4.638l4.26 2.881a17.8 17.8 0 0 0-3.272 4.507l-1.08 2.12a.65.65 0 0 0 .124.76 7.9 7.9 0 0 1 2.296 4.81c.027.265-1.141 5.997-9.376 5.573-1.587-.082-5.724-1.269-6.12-2.86a8 8 0 0 1-.233-2.161c.124-4.165 3.718-7.648 7.884-7.647h.098a.65.65 0 0 0 .59-.36z",fill:"#BCDEFF"}),s.createElement("path",{d:"M20.75 3.234 16.696.496a.886.886 0 1 0-.992 1.469l4.056 2.738a.886.886 0 0 0 .992-1.469",fill:"#E3F2FF"}),s.createElement("path",{d:"M18.771 17.024a7.87 7.87 0 0 1-2.7 5.944A4.2 4.2 0 0 1 13.301 24H8.473a4.2 4.2 0 0 1-2.769-1.03 7.9 7.9 0 0 1-2.468-4.023c.924.468 2.191.805 3.922.805 1.142 0 2.01-.346 2.775-.834q.323-.21.629-.446c1.973-1.516 3.524-3.668 8.17-2.238q.04.39.04.79",fill:"#2D87F3"}),s.createElement("path",{d:"M11.858 15.5c-1.78.348-3.096-1.608-2.134-3.121a2.06 2.06 0 0 1 1.529-.944q.303-.03.588.025a.27.27 0 0 0 .268-.107c.282-.373.737-.573 1.2-.639.224-.031.374-.24.379-.44.021-.794.657-1.311 1.288-1.234.183.022.223.27.058.35l-.012.006a.9.9 0 0 0-.28.196c-.213.263-.187.407-.153.6.03.167.066.37-.04.715a1.45 1.45 0 0 1-.504.7c-.255.19-.445.23-.592.263-.088.019-.16.034-.223.076a.27.27 0 0 0-.07.379c.184.27.306.587.344.934a2.063 2.063 0 0 1-1.646 2.24",fill:"#fff"}),s.createElement("ellipse",{cx:"10",cy:"20.5",rx:"3",ry:"2.5",fill:"#FF6F4D"}))},label:"dueDatePage.ivf"},[String(l.conception)]:{value:String(l.conception),icon:e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,i._)(e,["isMarryBaby","size"]);let r=Object.assign({width:a,height:a},n);return t?s.createElement("svg",Object.assign({viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),s.createElement("path",{d:"M16.5 27.133c1.298 0 2.596-.149 3.868-.447a9.15 9.15 0 0 0 6.818-6.818 16.94 16.94 0 0 0 0-7.736 9.15 9.15 0 0 0-6.818-6.818 16.94 16.94 0 0 0-7.736 0 9.15 9.15 0 0 0-6.818 6.818A17 17 0 0 0 5.367 16a.867.867 0 1 1-1.734 0c0-1.43.165-2.862.494-4.264a10.88 10.88 0 0 1 8.109-8.11 18.7 18.7 0 0 1 8.528 0 10.88 10.88 0 0 1 8.11 8.11 18.7 18.7 0 0 1 0 8.528 10.88 10.88 0 0 1-8.11 8.11 18.7 18.7 0 0 1-4.264.493.867.867 0 0 1 0-1.734",fill:"#3E3F58"}),s.createElement("path",{d:"M11.633 16a4.867 4.867 0 1 1 9.734 0 4.867 4.867 0 0 1-9.734 0m4.867-3.133a3.133 3.133 0 1 0 0 6.266 3.133 3.133 0 0 0 0-6.266",fill:"#E85388"}),s.createElement("path",{d:"M9.834 25.333a2.667 2.667 0 1 0-2.298-1.312l-.084.084a3.25 3.25 0 0 0-.952 2.298c0 .726-.41 1.39-1.06 1.715l-1.238.619a.667.667 0 0 0 .596 1.193l1.24-.62a3.25 3.25 0 0 0 1.796-2.907c0-.508.202-.995.561-1.355l.084-.084c.397.235.86.37 1.355.37",fill:"#3E3F58"})):s.createElement("svg",Object.assign({width:a,height:a,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),s.createElement("circle",{cx:"9",cy:"6.75",fill:"#91CAFF",r:"6.75"}),s.createElement("circle",{cx:"9",cy:"6.75",fill:"#2D87F3",r:"5.4"}),s.createElement("path",{d:"M1.789 12.2a.245.245 0 0 1-.02-.489c.073-.006 1.795-.167 1.761-1.605-.013-.587.15-1.057.485-1.397.524-.53 1.273-.528 1.305-.527a.245.245 0 0 1-.002.49h-.002c-.011 0-.582.004-.955.385-.236.24-.351.59-.34 1.038.018.793-.367 1.41-1.114 1.787a3.3 3.3 0 0 1-1.118.319M.75 17.774a.245.245 0 0 1 .226-.263c.073-.006 1.786-.162 1.749-1.593-.016-.586.146-1.055.48-1.392.521-.528 1.27-.524 1.3-.523a.245.245 0 0 1-.006.49c-.015 0-.58.004-.949.38q-.352.362-.335 1.033c.02.791-.362 1.406-1.106 1.78a3.3 3.3 0 0 1-1.095.313.245.245 0 0 1-.263-.225",fill:"#D2D6DC"}),s.createElement("path",{d:"M8.659 5.035c-.562-.561-1.956-.078-2.699.665-.407.407-.635.91-.665 1.373v.124l1.145 1.16.181.042c.464-.03.966-.258 1.373-.665.743-.743 1.226-2.137.665-2.699",fill:"#E3F2FF"}),s.createElement("path",{d:"m5.295 7.073-.292.75a.55.55 0 0 0 .124.589l.155.155a.55.55 0 0 0 .589.124l.75-.292z",fill:"#91CAFF"}),s.createElement("path",{d:"M8.098 11.358a.87.87 0 0 0-.233-.523c-.562-.562-1.956-.079-2.699.664-.407.408-.635.91-.665 1.373v.125l1.146 1.16.18.042c.464-.03.966-.258 1.374-.666.566-.566.98-1.51.897-2.175",fill:"#E3F2FF"}),s.createElement("path",{d:"m4.5 12.872-.29.75a.55.55 0 0 0 .123.589l.156.155a.55.55 0 0 0 .588.124l.75-.292z",fill:"#91CAFF"}))},label:"dueDatePage.conceptionDate"},[String(l.IUI)]:{value:String(l.IUI),icon:e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,i._)(e,["isMarryBaby","size"]);let r=Object.assign({width:a,height:a},n);return s.createElement("svg",Object.assign({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),s.createElement("ellipse",{cx:"10",cy:"7.5",rx:"7.5",ry:"7.5",fill:"#91CAFF"}),s.createElement("ellipse",{cx:"10",cy:"7.5",rx:"6",ry:"6",fill:"#2D87F3"}),s.createElement("path",{d:"M1.98877 13.5566C1.8483 13.5566 1.72914 13.4487 1.71769 13.3062C1.7056 13.1563 1.81732 13.025 1.9672 13.013C2.04819 13.0061 3.96085 12.8267 3.92397 11.2296C3.90887 10.5766 4.09013 10.0544 4.46266 9.6775C5.04496 9.08834 5.87737 9.09055 5.91289 9.09138C6.06324 9.09309 6.18376 9.21636 6.18204 9.36675C6.18033 9.51603 6.05877 9.63593 5.90985 9.63593C5.9091 9.63593 5.90835 9.63593 5.9076 9.63593C5.8958 9.63593 5.26174 9.64041 4.84671 10.0637C4.58418 10.3314 4.4569 10.7194 4.46838 11.2171C4.48874 12.0983 4.06094 12.7846 3.23124 13.202C2.63342 13.5027 2.03606 13.5537 2.01095 13.5558C2.00351 13.5563 1.99611 13.5566 1.98877 13.5566Z",fill:"#D2D6DC"}),s.createElement("path",{d:"M0.834813 19.7487C0.823187 19.5988 0.935297 19.4678 1.08522 19.4562C1.16581 19.4496 3.06971 19.2768 3.02807 17.6868C3.011 17.0352 3.1904 16.5146 3.56121 16.1394C4.14076 15.5531 4.97192 15.5577 5.00687 15.5587C5.15722 15.5608 5.27734 15.6845 5.27516 15.8349C5.27301 15.9849 5.15117 16.106 4.99993 16.1032C4.99989 16.1032 4.99982 16.1032 4.99975 16.1032C4.98315 16.1032 4.35528 16.1074 3.9453 16.5255C3.68491 16.791 3.55946 17.177 3.57245 17.6725C3.59545 18.552 3.17051 19.2358 2.34353 19.6499C1.74807 19.948 1.15233 19.9971 1.12728 19.9991C0.976577 20.0107 0.846367 19.898 0.834813 19.7487Z",fill:"#D2D6DC"}),s.createElement("path",{d:"M9.62226 5.59508C8.99818 4.971 7.44969 5.50769 6.62421 6.33313C6.1713 6.78604 5.91828 7.34408 5.88477 7.85874V7.99721L7.15753 9.28601L7.35857 9.33258C7.87323 9.29906 8.43127 9.04605 8.88418 8.59314C9.70966 7.76766 10.2463 6.21916 9.62226 5.59508Z",fill:"#E3F2FF"}),s.createElement("path",{d:"M5.88516 7.85889L5.5611 8.69259C5.47325 8.91856 5.52723 9.17508 5.69865 9.3465L5.87139 9.51925C5.95823 9.60609 6.06693 9.66256 6.18243 9.68584C6.29486 9.70856 6.4137 9.70005 6.52509 9.65676L7.3588 9.3327L5.88516 7.85889Z",fill:"#91CAFF"}),s.createElement("path",{d:"M8.99894 12.6201C8.97018 12.3889 8.88805 12.1875 8.73945 12.0389C8.11537 11.4149 6.56687 11.9515 5.7414 12.777C5.28849 13.2299 5.03547 13.7879 5.00195 14.3026V14.4411L6.27493 15.7298L6.47597 15.7764C6.99063 15.7429 7.54867 15.4898 8.00158 15.0369C8.63034 14.4081 9.09073 13.3598 8.99894 12.6201Z",fill:"#E3F2FF"}),s.createElement("path",{d:"M5.00235 14.3027L4.67829 15.1364C4.59043 15.3624 4.64441 15.6189 4.81583 15.7904L4.98858 15.9631C5.07542 16.0499 5.18412 16.1064 5.29962 16.1297C5.41205 16.1524 5.53089 16.1439 5.64228 16.1006L6.47598 15.7766L5.00235 14.3027Z",fill:"#91CAFF"}))},label:"dueDatePage.IUI"},[String(l.ultrasound)]:{value:String(l.ultrasound),icon:e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,i._)(e,["isMarryBaby","size"]);let r=Object.assign({width:a,height:a},n);return s.createElement("svg",Object.assign({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),s.createElement("g",{clipPath:"url(#clip0_5646_32454)"},s.createElement("path",{d:"M17.278 1.47119H2.7207C2.03035 1.47119 1.4707 2.03084 1.4707 2.72119V17.2785C1.4707 17.9689 2.03035 18.5285 2.7207 18.5285H17.278C17.9684 18.5285 18.528 17.9689 18.528 17.2785V2.72119C18.528 2.03084 17.9684 1.47119 17.278 1.47119Z",fill:"#65B5FF"}),s.createElement("path",{d:"M11.23 9.94794C12.1285 10.4395 11.7085 11.7187 10.9077 11.7734C10.1386 11.8261 9.79346 11.6067 9.12721 11.1589C8.74409 10.9014 8.11299 9.67872 7.93815 9.36872C7.74008 9.01332 7.58143 8.63733 7.46503 8.24747C7.31862 7.75122 7.71315 7.30122 8.03987 7.31731C8.09475 7.32086 8.14794 7.33765 8.19491 7.36625C8.24188 7.39485 8.28122 7.43441 8.30956 7.48153C8.3227 7.49619 8.33867 7.50803 8.3565 7.51636C8.37433 7.52469 8.39367 7.52933 8.41334 7.53C8.43301 7.53067 8.45261 7.52736 8.47097 7.52027C8.48933 7.51317 8.50607 7.50244 8.52018 7.48872C8.55856 7.44827 8.60864 7.42084 8.66339 7.41028C8.71814 7.39972 8.77482 7.40655 8.82549 7.42981C9.03081 7.56731 8.99503 7.80294 9.13081 8.11544C9.34088 8.4938 9.61306 8.83417 9.93596 9.12231C10.3217 9.44809 10.5785 9.59138 11.23 9.94794Z",fill:"#2B62CD"}),s.createElement("path",{d:"M19.5332 1.54781C19.5129 1.54783 19.4928 1.54386 19.4741 1.53611C19.4553 1.52836 19.4383 1.51699 19.424 1.50265C19.4096 1.48832 19.3982 1.47129 19.3904 1.45255C19.3827 1.43381 19.3787 1.41372 19.3787 1.39344V0.932812C19.3784 0.850311 19.3455 0.771271 19.2872 0.712933C19.2288 0.654596 19.1498 0.621695 19.0673 0.621406H18.6066C18.5665 0.62013 18.5285 0.603298 18.5006 0.574472C18.4726 0.545646 18.457 0.507087 18.457 0.466953C18.457 0.42682 18.4726 0.38826 18.5006 0.359434C18.5285 0.330608 18.5665 0.313776 18.6066 0.3125H19.0673C19.2317 0.312707 19.3894 0.378127 19.5057 0.494414C19.622 0.6107 19.6874 0.768359 19.6876 0.932812V1.39344C19.6876 1.43438 19.6713 1.47365 19.6424 1.5026C19.6134 1.53155 19.5742 1.54781 19.5332 1.54781Z",fill:"#2D87F3"}),s.createElement("path",{d:"M0.689531 1.54789C0.648588 1.54789 0.609323 1.53163 0.580372 1.50268C0.551421 1.47372 0.535156 1.43446 0.535156 1.39352V0.932891C0.535363 0.768356 0.600848 0.610626 0.717236 0.494326C0.833623 0.378027 0.991403 0.312661 1.15594 0.312578H1.61641C1.6371 0.31192 1.65772 0.315428 1.67703 0.322893C1.69635 0.330359 1.71397 0.34163 1.72884 0.356038C1.74371 0.370445 1.75554 0.387695 1.76361 0.406762C1.77169 0.425829 1.77585 0.446324 1.77585 0.467031C1.77585 0.487738 1.77169 0.508234 1.76361 0.527301C1.75554 0.546368 1.74371 0.563618 1.72884 0.578025C1.71397 0.592432 1.69635 0.603703 1.67703 0.611169C1.65772 0.618635 1.6371 0.622143 1.61641 0.621484H1.15594C1.07325 0.621484 0.993926 0.654258 0.935352 0.712626C0.876779 0.770995 0.843727 0.8502 0.843437 0.932891V1.39352C0.843438 1.43438 0.827238 1.47357 0.798388 1.50251C0.769538 1.53145 0.730393 1.54777 0.689531 1.54789Z",fill:"#2D87F3"}),s.createElement("path",{d:"M19.0673 19.4648H18.6066C18.5665 19.4636 18.5285 19.4467 18.5006 19.4179C18.4726 19.3891 18.457 19.3505 18.457 19.3104C18.457 19.2702 18.4726 19.2317 18.5006 19.2029C18.5285 19.174 18.5665 19.1572 18.6066 19.1559H19.0673C19.1498 19.1556 19.2288 19.1227 19.2872 19.0644C19.3455 19.0061 19.3784 18.927 19.3787 18.8445V18.3841C19.378 18.3634 19.3815 18.3427 19.389 18.3234C19.3965 18.3041 19.4077 18.2865 19.4221 18.2716C19.4365 18.2567 19.4538 18.2449 19.4729 18.2368C19.4919 18.2288 19.5124 18.2246 19.5331 18.2246C19.5538 18.2246 19.5743 18.2288 19.5934 18.2368C19.6125 18.2449 19.6297 18.2567 19.6441 18.2716C19.6585 18.2865 19.6698 18.3041 19.6773 18.3234C19.6847 18.3427 19.6882 18.3634 19.6876 18.3841V18.8441C19.6875 19.0086 19.6221 19.1664 19.5058 19.2828C19.3895 19.3991 19.2318 19.4646 19.0673 19.4648Z",fill:"#2D87F3"}),s.createElement("path",{d:"M1.40625 19.6875H0.940156C0.773755 19.6873 0.614228 19.6211 0.496565 19.5034C0.378901 19.3858 0.312707 19.2262 0.3125 19.0598V18.5938C0.3125 18.5523 0.328962 18.5126 0.358265 18.4833C0.387567 18.454 0.42731 18.4375 0.46875 18.4375C0.51019 18.4375 0.549933 18.454 0.579235 18.4833C0.608538 18.5126 0.625 18.5523 0.625 18.5938V19.0595C0.624979 19.1009 0.633115 19.1419 0.648942 19.1802C0.664769 19.2185 0.687977 19.2532 0.717242 19.2825C0.746507 19.3118 0.781256 19.3351 0.819503 19.3509C0.857751 19.3668 0.898749 19.375 0.940156 19.375H1.40625C1.44769 19.375 1.48743 19.3915 1.51674 19.4208C1.54604 19.4501 1.5625 19.4898 1.5625 19.5312C1.5625 19.5727 1.54604 19.6124 1.51674 19.6417C1.48743 19.671 1.44769 19.6875 1.40625 19.6875Z",fill:"#2D87F3"}),s.createElement("path",{d:"M3.95953 2.8125H2.65625C2.61481 2.8125 2.57507 2.79604 2.54576 2.76674C2.51646 2.73743 2.5 2.69769 2.5 2.65625C2.5 2.61481 2.51646 2.57507 2.54576 2.54576C2.57507 2.51646 2.61481 2.5 2.65625 2.5H3.95953C4.00097 2.5 4.04071 2.51646 4.07002 2.54576C4.09932 2.57507 4.11578 2.61481 4.11578 2.65625C4.11578 2.69769 4.09932 2.73743 4.07002 2.76674C4.04071 2.79604 4.00097 2.8125 3.95953 2.8125Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.3443 14.9688H16.7285C16.6871 14.9688 16.6473 14.9523 16.618 14.923C16.5887 14.8937 16.5723 14.8539 16.5723 14.8125C16.5723 14.7711 16.5887 14.7313 16.618 14.702C16.6473 14.6727 16.6871 14.6562 16.7285 14.6562H17.3443C17.3857 14.6562 17.4255 14.6727 17.4548 14.702C17.4841 14.7313 17.5005 14.7711 17.5005 14.8125C17.5005 14.8539 17.4841 14.8937 17.4548 14.923C17.4255 14.9523 17.3857 14.9688 17.3443 14.9688Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.3443 16.3027H16.7285C16.6871 16.3027 16.6473 16.2863 16.618 16.257C16.5887 16.2277 16.5723 16.1879 16.5723 16.1465C16.5723 16.105 16.5887 16.0653 16.618 16.036C16.6473 16.0067 16.6871 15.9902 16.7285 15.9902H17.3443C17.3857 15.9902 17.4255 16.0067 17.4548 16.036C17.4841 16.0653 17.5005 16.105 17.5005 16.1465C17.5005 16.1879 17.4841 16.2277 17.4548 16.257C17.4255 16.2863 17.3857 16.3027 17.3443 16.3027Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.3443 13.6499H16.7285C16.6871 13.6499 16.6473 13.6334 16.618 13.6041C16.5887 13.5748 16.5723 13.5351 16.5723 13.4937C16.5723 13.4522 16.5887 13.4125 16.618 13.3832C16.6473 13.3539 16.6871 13.3374 16.7285 13.3374H17.3443C17.3857 13.3374 17.4255 13.3539 17.4548 13.3832C17.4841 13.4125 17.5005 13.4522 17.5005 13.4937C17.5005 13.5351 17.4841 13.5748 17.4548 13.6041C17.4255 13.6334 17.3857 13.6499 17.3443 13.6499Z",fill:"#2D87F3"}),s.createElement("path",{d:"M4.99063 3.84375H2.65625C2.61481 3.84375 2.57507 3.82729 2.54576 3.79799C2.51646 3.76868 2.5 3.72894 2.5 3.6875C2.5 3.64606 2.51646 3.60632 2.54576 3.57701C2.57507 3.54771 2.61481 3.53125 2.65625 3.53125H4.99063C5.03207 3.53125 5.07181 3.54771 5.10111 3.57701C5.13041 3.60632 5.14687 3.64606 5.14687 3.6875C5.14687 3.72894 5.13041 3.76868 5.10111 3.79799C5.07181 3.82729 5.03207 3.84375 4.99063 3.84375Z",fill:"#2D87F3"}),s.createElement("path",{d:"M4.99063 4.875H2.65625C2.61481 4.875 2.57507 4.85854 2.54576 4.82924C2.51646 4.79993 2.5 4.76019 2.5 4.71875C2.5 4.67731 2.51646 4.63757 2.54576 4.60826C2.57507 4.57896 2.61481 4.5625 2.65625 4.5625H4.99063C5.03207 4.5625 5.07181 4.57896 5.10111 4.60826C5.13041 4.63757 5.14687 4.67731 5.14687 4.71875C5.14687 4.76019 5.13041 4.79993 5.10111 4.82924C5.07181 4.85854 5.03207 4.875 4.99063 4.875Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.3443 12.3843H16.7285C16.6871 12.3843 16.6473 12.3678 16.618 12.3385C16.5887 12.3092 16.5723 12.2695 16.5723 12.228C16.5723 12.1866 16.5887 12.1468 16.618 12.1175C16.6473 12.0882 16.6871 12.0718 16.7285 12.0718H17.3443C17.3857 12.0718 17.4255 12.0882 17.4548 12.1175C17.4841 12.1468 17.5005 12.1866 17.5005 12.228C17.5005 12.2695 17.4841 12.3092 17.4548 12.3385C17.4255 12.3678 17.3857 12.3843 17.3443 12.3843Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.3443 17.6562H16.7285C16.6871 17.6562 16.6473 17.6398 16.618 17.6105C16.5887 17.5812 16.5723 17.5414 16.5723 17.5C16.5723 17.4586 16.5887 17.4188 16.618 17.3895C16.6473 17.3602 16.6871 17.3438 16.7285 17.3438H17.3443C17.3857 17.3438 17.4255 17.3602 17.4548 17.3895C17.4841 17.4188 17.5005 17.4586 17.5005 17.5C17.5005 17.5414 17.4841 17.5812 17.4548 17.6105C17.4255 17.6398 17.3857 17.6562 17.3443 17.6562Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.0352 17.6563C16.9937 17.6563 16.954 17.6398 16.9247 17.6105C16.8954 17.5812 16.8789 17.5415 16.8789 17.5001V12.228C16.8789 12.1866 16.8954 12.1468 16.9247 12.1175C16.954 12.0882 16.9937 12.0718 17.0352 12.0718C17.0766 12.0718 17.1163 12.0882 17.1456 12.1175C17.1749 12.1468 17.1914 12.1866 17.1914 12.228V17.5001C17.1914 17.5415 17.1749 17.5812 17.1456 17.6105C17.1163 17.6398 17.0766 17.6563 17.0352 17.6563Z",fill:"#2D87F3"}),s.createElement("path",{d:"M8.60596 12.3197C8.54189 12.4053 8.46174 12.4775 8.37002 12.5324C8.13096 12.6807 7.05018 13.0533 5.9919 12.0152C5.72695 11.7747 5.47994 11.5151 5.25284 11.2385C5.07471 11.0041 4.83877 10.959 4.57627 10.5683C4.34659 10.2262 4.36846 9.61991 4.57627 9.35412C4.84502 9.01194 5.32627 8.84022 5.62627 9.49631C5.76534 9.80256 6.47002 10.476 7.0294 10.6262C7.09603 10.6424 7.16404 10.6523 7.23252 10.6558C7.85752 10.6952 8.57627 11.1307 8.74659 11.6512C8.77467 11.766 8.77661 11.8857 8.75227 12.0014C8.72793 12.1172 8.67794 12.2259 8.60596 12.3197Z",fill:"#2B62CD"}),s.createElement("path",{d:"M17.8215 7.60137C17.3465 10.2436 15.2621 10.3982 14.3965 11.2482C13.9965 11.642 14.0606 11.7092 13.9965 12.7201C13.9231 13.8951 13.2621 16.1139 11.0356 16.7654C8.77777 17.4279 6.96371 16.5029 6.00121 14.6982C5.14339 13.0904 4.21527 13.6154 3.00121 13.1811C2.42152 12.9717 2.00433 12.4811 2.01996 11.9748C2.03871 11.3217 2.40902 10.8404 3.37777 11.3217C4.04964 11.6545 4.69496 11.5936 5.30433 11.5201C5.63507 11.4688 5.96971 11.4468 6.30433 11.4545C6.96796 11.5169 7.60602 11.7417 8.16214 12.1092C8.31527 12.2061 8.42621 12.2889 8.48402 12.3342C8.0626 11.9665 7.71478 11.5222 7.45902 11.0248C7.44183 10.9936 7.2848 10.655 7.25589 10.592C6.96136 9.95137 7.39027 9.35606 7.83714 9.35606C7.87141 9.35549 7.9056 9.3597 7.93871 9.36855C8.05114 9.39698 8.14976 9.46457 8.21683 9.55918C8.23545 9.57848 8.25784 9.59375 8.28261 9.60403C8.30738 9.61431 8.334 9.61939 8.36082 9.61895C8.38763 9.61851 8.41407 9.61256 8.43849 9.60147C8.46291 9.59038 8.48479 9.57439 8.50277 9.55449C8.54371 9.50394 8.60167 9.47004 8.66579 9.45911C8.72992 9.44818 8.79583 9.46098 8.85121 9.49512C9.13871 9.66699 8.98871 10.0232 9.19808 10.4342C9.42152 10.8732 10.109 11.3389 10.634 11.2389C11.0293 11.1623 11.8606 10.6811 10.634 10.167C9.94808 9.88105 9.86683 9.48418 9.93558 9.12168C9.96058 8.99356 10.1621 8.41543 10.1653 8.39356C10.1996 8.1248 9.64652 7.69668 10.1653 7.31699C10.4215 7.12949 10.459 6.88262 10.5075 6.56855C10.7934 4.6998 12.02 3.47168 13.9825 3.47168C16.5262 3.47168 18.1418 5.82793 17.8215 7.60137Z",fill:"#2D87F3"}),s.createElement("path",{d:"M11.0678 7.4316C11.006 7.43496 10.9443 7.42333 10.888 7.3977C10.8317 7.37207 10.7824 7.33321 10.7443 7.28441C10.7305 7.26814 10.7201 7.24921 10.7139 7.22877C10.7076 7.20833 10.7056 7.18683 10.708 7.16559C10.7104 7.14436 10.7171 7.12384 10.7278 7.1053C10.7384 7.08677 10.7527 7.07062 10.7699 7.05784C10.787 7.04507 10.8066 7.03594 10.8274 7.03103C10.8482 7.02613 10.8698 7.02553 10.8908 7.0293C10.9118 7.03306 10.9319 7.0411 10.9497 7.05292C10.9675 7.06474 10.9827 7.08009 10.9943 7.09801C11.0256 7.1391 11.159 7.11504 11.2378 7.0802C11.2756 7.06321 11.3186 7.06193 11.3573 7.07666C11.3961 7.09138 11.4274 7.1209 11.4444 7.15871C11.4614 7.19653 11.4627 7.23954 11.4479 7.27829C11.4332 7.31705 11.4037 7.34836 11.3659 7.36535C11.272 7.40738 11.1706 7.42991 11.0678 7.4316Z",fill:"#2B62CD"}),s.createElement("path",{d:"M11.548 13.1983C11.5518 13.2185 11.5515 13.2392 11.5471 13.2592C11.5428 13.2792 11.5345 13.2981 11.5227 13.3149C11.5109 13.3316 11.4958 13.3458 11.4785 13.3567C11.4611 13.3675 11.4417 13.3748 11.4215 13.378C11.2165 13.4117 11.0089 13.4279 10.8012 13.4265C10.5169 13.4214 10.2349 13.3757 9.96367 13.2905C9.44418 13.1038 8.96486 12.8201 8.55117 12.4546C7.77477 11.8262 7.66367 11.4171 7.45898 11.0249C7.74314 11.4988 8.12768 11.9047 8.58555 12.214C9.03605 12.5485 9.53089 12.8188 10.0559 13.0171C10.4848 13.1224 10.9305 13.141 11.3668 13.0718C11.387 13.0677 11.4079 13.0678 11.4281 13.0721C11.4483 13.0763 11.4675 13.0846 11.4844 13.0964C11.5014 13.1082 11.5157 13.1233 11.5267 13.1409C11.5376 13.1584 11.5449 13.1779 11.548 13.1983Z",fill:"#2B62CD"}),s.createElement("path",{d:"M10.5484 8.85297C10.511 8.86675 10.4712 8.87312 10.4313 8.87172C10.2958 8.86506 10.164 8.82594 10.0469 8.75766C10.0858 8.62969 10.1177 8.54703 10.1419 8.46875C10.2299 8.5323 10.3369 8.56419 10.4453 8.55922C10.464 8.55169 10.4839 8.54798 10.504 8.54833C10.5241 8.54867 10.5439 8.55306 10.5623 8.56122C10.5807 8.56939 10.5972 8.58116 10.6109 8.59585C10.6247 8.61054 10.6353 8.62784 10.6422 8.64672C10.6561 8.68656 10.6541 8.73021 10.6366 8.76862C10.6192 8.80703 10.5876 8.83724 10.5484 8.85297Z",fill:"#2B62CD"})),s.createElement("defs",null,s.createElement("clipPath",{id:"clip0_5646_32454"},s.createElement("rect",{width:"20",height:"20",fill:"white"}))))},label:"dueDatePage.ultrasound"}},M=[String(l.lastPeriod),String(l.IVF),String(l.conception)],$={[v.L.Cambodia]:M,[v.L.Singapore]:M,[v.L.India]:M,[v.L.Indonesia]:[String(l.lastPeriod),String(l.IUI),String(l.IVF),String(l.ultrasound)],[v.L.Malaysia]:M,[v.L.Myanmar]:M,[v.L.PhilippinesEnglish]:M,[v.L.PhilippinesTagalog]:M,[v.L.Taiwan]:M,[v.L.Thailand]:M,[v.L.Vietnam]:[String(l.lastPeriod),String(l.IVF),String(l.IUI),String(l.ultrasound)]},T="yyyy-MM-dd",getDueDateLastPeriod=(e,t)=>({otherInfo:{method:l.lastPeriod+1,first_day:(0,h.Z)(e,T),measurement_date:null,insemination_date:null,cycle_length_days:t,conception_date:null,ivf_transfer_date:null,days_transfer:null}}),getDueDateConception=e=>({otherInfo:{method:l.conception+1,conception_date:(0,h.Z)(e,T),measurement_date:null,insemination_date:null,first_day:null,cycle_length_days:null,ivf_transfer_date:null,days_transfer:null}}),getDueDateIVF=(e,t)=>({otherInfo:{method:l.IVF+1,ivf_transfer_date:(0,h.Z)(e,T),measurement_date:null,insemination_date:null,days_transfer:t,conception_date:null,first_day:null,cycle_length_days:null}}),getDueDateIUI=e=>({otherInfo:{method:l.conception+1,insemination_date:(0,h.Z)(e,T),measurement_date:null,conception_date:null,first_day:null,cycle_length_days:null,ivf_transfer_date:null,days_transfer:null}}),getDueDateUltrasound=(e,t)=>{let[a,n]=t.split("|"),[r,o]=[Number(a),Number(n)];return{otherInfo:{method:l.conception+1,measurement_date:(0,h.Z)(e,T),conception_date:null,insemination_date:null,crl_value:r,msd_value:o,first_day:null,cycle_length_days:null,ivf_transfer_date:null,days_transfer:null}}},N=(0,s.createContext)({}),O=(0,s.createContext)({}),DefaultLayout$4=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(O);return s.createElement(I.H.FormRow,null,s.createElement(w.D,Object.assign({label:s.createElement(P.T,{size:"p2",weight:"semiBold"},e("dueDatePage.lastPeriod.lastPeriodLabel"))},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date})))},InlineLayout$4=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(O);return s.createElement(I.H.FormRow,null,s.createElement(I.H.BorderInlineControl,{width:300,label:e("dueDatePage.lastPeriod.lastPeriodLabel")},s.createElement(w.D,Object.assign({},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date,error:null}))),t.errors.lastPeriodDate&&s.createElement(I.H.Error,null,t.errors.lastPeriodDate))},MbLayout$4=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(O);return s.createElement(I.H.BorderBoxControl,{label:e("dueDatePage.lastPeriod.lastPeriodLabel"),rightSection:s.createElement(F.Z,null)},s.createElement(w.D,Object.assign({},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},rightSection:null,maxDate:new Date})))},ConceptionForm=({})=>{let{classes:e={}}=(0,s.useContext)(k.C),{formLayout:t,onSubmit:a,currentUrl:n,submitProps:r}=(0,s.useContext)(N),o=(0,d.rZ)(),{t:i}=(0,D.u)(),u=(0,f.c)({initialValues:{lastPeriodDate:new Date}}),p={onSubmit:u.onSubmit(e=>{let{lastPeriodDate:t}=e,n=`${_.Q.type}=${l.conception}&${_.Q.startDate}=${E()(t).format(_.A)}&${_.Q.additional}= `;a(getDueDateConception(t),n)})};return s.createElement(O.Provider,{value:{form:u}},s.createElement(I.H,Object.assign({formLayout:t},p),"inline"===t?s.createElement(InlineLayout$4,null):"mb"===o.other.template?s.createElement(MbLayout$4,null):s.createElement(DefaultLayout$4,null),s.createElement(I.H.FormRow,{className:e.submitWrapper},s.createElement(I.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:n,className:(0,c.default)("due-date-calculate-button",e.submitBtn),type:"submit"},r),i("dueDatePage.lastPeriod.calculate")))))},H=(0,s.createContext)({}),DefaultLayout$3=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(H);return s.createElement(I.H.FormRow,null,s.createElement(w.D,Object.assign({label:s.createElement(P.T,{size:"p2",weight:"semiBold"},e("dueDatePage.date_of_IUI_procedure"))},t.getInputProps("dateOfIUIProcedure"),{popoverProps:{withinPortal:!0},maxDate:new Date})))},InlineLayout$3=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(H);return s.createElement(I.H.FormRow,null,s.createElement(I.H.BorderInlineControl,{width:300,label:e("dueDatePage.date_of_IUI_procedure")},s.createElement(w.D,Object.assign({},t.getInputProps("dateOfIUIProcedure"),{popoverProps:{withinPortal:!0},maxDate:new Date,error:null}))))},MbLayout$3=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(H);return s.createElement(I.H.BorderBoxControl,{label:e("dueDatePage.date_of_IUI_procedure"),rightSection:s.createElement(F.Z,null)},s.createElement(w.D,Object.assign({},t.getInputProps("dateOfIUIProcedure"),{popoverProps:{withinPortal:!0},rightSection:null,maxDate:new Date})))},IUIForm=({})=>{let{formLayout:e,onSubmit:t,currentUrl:a,submitProps:n}=(0,s.useContext)(N),{classes:r={}}=(0,s.useContext)(k.C),o=(0,d.rZ)(),{t:i}=(0,D.u)(),u=(0,f.c)({initialValues:{dateOfIUIProcedure:new Date}}),p={onSubmit:u.onSubmit(e=>{let{dateOfIUIProcedure:a}=e,n=`${_.Q.type}=${l.IUI}&${_.Q.startDate}=${E()(a).format(_.A)}&${_.Q.additional}= `;t(getDueDateIUI(a),n)})};return s.createElement(H.Provider,{value:{form:u}},s.createElement(I.H,Object.assign({formLayout:e},p),"inline"===e?s.createElement(InlineLayout$3,null):"mb"===o.other.template?s.createElement(MbLayout$3,null):s.createElement(DefaultLayout$3,null),s.createElement(I.H.FormRow,{className:r.submitWrapper},s.createElement(I.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:a,className:(0,c.default)("due-date-calculate-button",r.submitBtn),type:"submit"},n),i("dueDatePage.lastPeriod.calculate")))))},B=(0,s.createContext)({}),DefaultLayout$2=()=>{let{t:e}=(0,D.u)(),{form:t,transferDateOptions:a}=(0,s.useContext)(B);return s.createElement(s.Fragment,null,s.createElement(I.H.FormRow,null,s.createElement(w.D,Object.assign({label:s.createElement(P.T,{size:"p2",weight:"semiBold"},e("dueDatePage.ivf.transferDate"))},t.getInputProps("IVFDate"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),s.createElement(I.H.FormRow,null,s.createElement(y.R.Group,Object.assign({},t.getInputProps("dayTransfer")),s.createElement(u.Z,null,a.map((e,t)=>s.createElement(y.R,{key:t,value:e.value,label:e.label}))))))},InlineLayout$2=()=>{let{t:e}=(0,D.u)(),{form:t,transferDateOptions:a}=(0,s.useContext)(B);return s.createElement(s.Fragment,null,s.createElement(I.H.FormRow,null,s.createElement(I.H.BorderInlineControl,{width:300,label:e("dueDatePage.ivf.transferDate")},s.createElement(w.D,Object.assign({},t.getInputProps("IVFDate"),{popoverProps:{withinPortal:!0},maxDate:new Date})))),s.createElement(I.H.FormRow,null,s.createElement(I.H.BorderInlineControl,{width:"none"},s.createElement(y.R.Group,Object.assign({},t.getInputProps("dayTransfer")),s.createElement(u.Z,null,a.map((e,t)=>s.createElement(y.R,{key:t,value:e.value,label:e.label})))))))},MbLayout$2=()=>{let{t:e}=(0,D.u)(),{form:t,transferDateOptions:a}=(0,s.useContext)(B);return s.createElement(s.Fragment,null,s.createElement(I.H.BorderBoxControl,{label:e("dueDatePage.ivf.transferDate"),rightSection:s.createElement(F.Z,null)},s.createElement(w.D,Object.assign({},t.getInputProps("IVFDate"),{popoverProps:{withinPortal:!0},maxDate:new Date,rightSection:null}))),s.createElement(y.R.Group,Object.assign({},t.getInputProps("dayTransfer")),s.createElement(u.Z,null,a.map((e,t)=>s.createElement(y.R,{key:t,value:e.value,label:e.label})))))},IVFForm=({})=>{var e;let{classes:t={}}=(0,s.useContext)(k.C),{formLayout:a,onSubmit:n,currentUrl:r,submitProps:o}=(0,s.useContext)(N),{t:i}=(0,D.u)(),u=(0,d.rZ)(),p=[{value:"3",label:i("dueDatePage.ivf.transferDateRadio",{number:3})},{value:"5",label:i("dueDatePage.ivf.transferDateRadio",{number:5})}],m=(0,f.c)({initialValues:{IVFDate:new Date,dayTransfer:null===(e=null==p?void 0:p[0])||void 0===e?void 0:e.value}}),g={onSubmit:m.onSubmit(e=>{let{IVFDate:t}=e,a=Number(e.dayTransfer),r=`${_.Q.type}=${l.IVF}&${_.Q.startDate}=${E()(t).format(_.A)}&${_.Q.additional}=${a}`;n(getDueDateIVF(t,Number(a)),r)})};return s.createElement(B.Provider,{value:{form:m,transferDateOptions:p}},s.createElement(I.H,Object.assign({formLayout:a},g),"inline"===a?s.createElement(InlineLayout$2,null):"mb"===u.other.template?s.createElement(MbLayout$2,null):s.createElement(DefaultLayout$2,null),s.createElement(I.H.FormRow,{className:t.submitWrapper},s.createElement(I.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:r,className:(0,c.default)("due-date-calculate-button",t.submitBtn),type:"submit"},o),i("dueDatePage.lastPeriod.calculate")))))},j=(0,s.createContext)({}),DefaultLayout$1=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(j),a=(0,s.useMemo)(()=>[...Array(21)].map((t,a)=>({label:e("dueDatePage.daysText",{number:a+20}),value:`${a+20}`})),[]);return s.createElement(s.Fragment,null,s.createElement(I.H.FormRow,null,s.createElement(w.D,Object.assign({label:s.createElement(P.T,{size:"p2",weight:"semiBold"},e("dueDatePage.lastPeriod.lastPeriodLabel"))},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),s.createElement(I.H.FormRow,null,s.createElement(y.I.Wrapper,{label:s.createElement(P.T,{size:"p2",weight:"semiBold"},e("dueDatePage.lastPeriod.periodLengthLabel"))},s.createElement(y.S,Object.assign({placeholder:e("tools.inputPlaceholder",{content:e("dueDatePage.daysText",{number:30})}),data:a,withinPortal:!0},t.getInputProps("periodLength"))))))},InlineLayout$1=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(j),a=(0,s.useMemo)(()=>[...Array(21)].map((t,a)=>({label:e("dueDatePage.daysText",{number:a+20}),value:`${a+20}`})),[]);return s.createElement(s.Fragment,null,s.createElement(I.H.FormRow,null,s.createElement(I.H.BorderInlineControl,{label:e("dueDatePage.lastPeriod.lastPeriodLabel"),width:300},s.createElement(w.D,Object.assign({},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date})))),s.createElement(I.H.FormRow,null,s.createElement(I.H.BorderInlineControl,{label:e("dueDatePage.lastPeriod.periodLengthLabel"),width:300},s.createElement(y.S,Object.assign({placeholder:e("tools.inputPlaceholder",{content:e("dueDatePage.daysText",{number:30})}),data:a},t.getInputProps("periodLength"),{error:null,withinPortal:!0})))),t.errors.periodLength&&s.createElement(I.H.FormRow,null,s.createElement(I.H.Error,null,t.errors.periodLength)))},MbLayout$1=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(j);return s.createElement(s.Fragment,null,s.createElement(I.H.BorderBoxControl,{label:e("dueDatePage.lastPeriod.lastPeriodLabel"),rightSection:s.createElement(F.Z,null)},s.createElement(w.D,Object.assign({rightSection:null},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),s.createElement(I.H.BorderBoxControl,{label:e("dueDatePage.lastPeriod.periodLengthLabel"),rightSection:e("ovulationPage.dayUnit")},s.createElement(y.I.Number,Object.assign({min:20,max:40,placeholder:e("tools.inputPlaceholder",{content:"30"})},t.getInputProps("periodLength")))),t.errors.periodLength&&s.createElement(I.H.Error,null,t.errors.periodLength))},LastPeriodForm=({})=>{let{formLayout:e,onSubmit:t,currentUrl:a,submitProps:n}=(0,s.useContext)(N),{classes:r={}}=(0,s.useContext)(k.C),{t:o}=(0,D.u)(),i=(0,d.rZ)(),u="mb"===i.other.template,p=(0,f.c)({initialValues:{lastPeriodDate:new Date},validate:{periodLength:(0,C.U)(o("validation.error.requiredField"))}}),m={onSubmit:p.onSubmit(e=>{let{periodLength:a,lastPeriodDate:n}=e,r=`${_.Q.type}=${l.lastPeriod}&${_.Q.startDate}=${E()(n).format(_.A)}&${_.Q.additional}=${a}`;t(getDueDateLastPeriod(n,a),r)})};return s.createElement(j.Provider,{value:{form:p}},s.createElement(I.H,Object.assign({formLayout:e},m),"inline"===e?s.createElement(InlineLayout$1,null):u?s.createElement(MbLayout$1,null):s.createElement(DefaultLayout$1,null),s.createElement(I.H.FormRow,{className:r.submitWrapper},s.createElement(I.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:a,className:(0,c.default)("due-date-calculate-button",r.submitBtn),type:"submit"},n),o("dueDatePage.lastPeriod.calculate")))))},z=(0,s.createContext)({}),Info=e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,i._)(e,["isMarryBaby","size"]);let r=Object.assign({width:a,height:a},n);return s.createElement("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),s.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00065 1.3335C4.32065 1.3335 1.33398 4.32016 1.33398 8.00016C1.33398 11.6802 4.32065 14.6668 8.00065 14.6668C11.6807 14.6668 14.6673 11.6802 14.6673 8.00016C14.6673 4.32016 11.6807 1.3335 8.00065 1.3335ZM8.00065 11.3335C7.63398 11.3335 7.33398 11.0335 7.33398 10.6668V8.00016C7.33398 7.6335 7.63398 7.3335 8.00065 7.3335C8.36732 7.3335 8.66732 7.6335 8.66732 8.00016V10.6668C8.66732 11.0335 8.36732 11.3335 8.00065 11.3335ZM7.33398 6.00016H8.66732V4.66683H7.33398V6.00016Z",fill:"#2D87F3"}))},DefaultLayout=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(z),a=s.createElement(P.T,{size:"p4",color:S.r.colors.gray400},"mm"),n=t.getInputProps("ultrasoundCRL"),r=t.getInputProps("ultrasoundMSD");return s.createElement(s.Fragment,null,s.createElement(I.H.FormRow,null,s.createElement(w.D,Object.assign({label:s.createElement(P.T,{size:"p2",weight:"semiBold"},e("dueDatePage.date_of_ultrasound"))},t.getInputProps("dateOfUltrasound"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),s.createElement(I.H.FormRow,null,s.createElement(p.k,{align:"center",gap:4,mb:4},s.createElement(P.T,{size:"p2",weight:"semiBold"},e("dueDatePage.validation.one_is_required")),s.createElement(m.u,{withinPortal:!0,withArrow:!0,width:300,multiline:!0,label:e("dueDatePage.ultrasound.tooltip")},s.createElement(p.k,null,s.createElement(Info,{size:16})))),s.createElement(p.k,{gap:8},s.createElement(y.I,Object.assign({placeholder:"CRL",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},n,{errorProps:{sx:{display:"none"}}})),s.createElement(y.I,Object.assign({placeholder:"MSD",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},r,{errorProps:{sx:{display:"none"}}}))),(t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)&&s.createElement(P.T,{size:"p4",color:S.r.colors.red500},t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)))},InlineLayout=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(z),a=s.createElement(P.T,{size:"p4",color:S.r.colors.gray400},"mm"),n=t.getInputProps("ultrasoundCRL"),r=t.getInputProps("ultrasoundMSD");return s.createElement(s.Fragment,null,s.createElement(I.H.FormRow,null,s.createElement(I.H.BorderInlineControl,{width:300,label:e("dueDatePage.date_of_ultrasound")},s.createElement(w.D,Object.assign({},t.getInputProps("dateOfUltrasound"),{popoverProps:{withinPortal:!0},maxDate:new Date,error:null})))),s.createElement(I.H.FormRow,null,s.createElement(I.H.BorderInlineControl,{width:300,label:s.createElement(p.k,{align:"center",gap:4},s.createElement("span",null,e("dueDatePage.validation.one_is_required")),s.createElement(m.u,{withinPortal:!0,withArrow:!0,width:300,multiline:!0,label:e("dueDatePage.ultrasound.tooltip")},s.createElement(p.k,null,s.createElement(Info,{size:16}))))},s.createElement(g.x,null,s.createElement(p.k,{gap:8},s.createElement(y.I,Object.assign({placeholder:"CRL",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},n,{errorProps:{sx:{display:"none"}}})),s.createElement(y.I,Object.assign({placeholder:"MSD",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},r,{errorProps:{sx:{display:"none"}}}))))),(t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)&&s.createElement(I.H.Error,null,t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)))},MbLayout=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,s.useContext)(z);return s.createElement(I.H.BorderBoxControl,{label:e("dueDatePage.date_of_ultrasound"),rightSection:s.createElement(F.Z,null)},s.createElement(w.D,Object.assign({},t.getInputProps("dateOfUltrasound"),{popoverProps:{withinPortal:!0},rightSection:null,maxDate:new Date})))},UltrasoundForm=({})=>{let{classes:e={}}=(0,s.useContext)(k.C),{formLayout:t,onSubmit:a,currentUrl:n,submitProps:r}=(0,s.useContext)(N),o=(0,d.rZ)(),{t:i}=(0,D.u)(),u=(0,f.c)({initialValues:{dateOfUltrasound:new Date},validate:e=>{let t=Number(e.ultrasoundCRL),a=Number(e.ultrasoundMSD);if(!t&&!a)return{ultrasoundCRL:i("dueDatePage.validation.record_not_valid")};let n=t>=5&&t<=101,r=a>0&&a<=13;return n||r?{}:t&&!n?{ultrasoundCRL:i("dueDatePage.validation.record_not_valid")}:a&&!r?{ultrasoundMSD:i("dueDatePage.validation.crl")}:void 0}}),p={onSubmit:u.onSubmit(e=>{let{dateOfUltrasound:t,ultrasoundCRL:n,ultrasoundMSD:r}=e,o=`${n}|${r}`,i=`${_.Q.type}=${l.ultrasound}&${_.Q.startDate}=${E()(t).format(_.A)}&${_.Q.additional}=${o}`;a(getDueDateUltrasound(t,o),i)})};return s.createElement(z.Provider,{value:{form:u}},s.createElement(I.H,Object.assign({formLayout:t},p),"inline"===t?s.createElement(InlineLayout,null):"mb"===o.other.template?s.createElement(MbLayout,null):s.createElement(DefaultLayout,null),s.createElement(I.H.FormRow,{className:e.submitWrapper},s.createElement(I.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:n,className:(0,c.default)("due-date-calculate-button",e.submitBtn),type:"submit"},r),i("dueDatePage.lastPeriod.calculate")))))},FormSwitcher=()=>{let{calculatorType:e}=(0,s.useContext)(N);switch(e){case l.lastPeriod:return s.createElement(LastPeriodForm,null);case l.conception:return s.createElement(ConceptionForm,null);case l.IVF:return s.createElement(IVFForm,null);case l.IUI:return s.createElement(IUIForm,null);case l.ultrasound:return s.createElement(UltrasoundForm,null);default:return null}};(r=o||(o={}))[r.trackPeriod=0]="trackPeriod",r[r.conceive=1]="conceive",r[r.avoidPregnancy=2]="avoidPregnancy";let R=(0,s.forwardRef)((e,t)=>{var{label:a,icon:n}=e,r=(0,i._)(e,["label","icon"]);return s.createElement(g.x,Object.assign({ref:t,sx:{gap:"1rem",display:"flex",padding:"5px 6px",alignItems:"center","&[data-selected]":{backgroundColor:S.r.colors.gray100},"&[data-selected]:hover":{backgroundColor:S.r.colors.gray100},"&[data-hovered]":{backgroundColor:S.r.colors.gray100}},className:""},r),n,s.createElement(P.T,{size:"p4"},a))}),DueDateForm=e=>{var{locale:t,formLayout:a="default",submitProps:n,currentUrl:r,isMobile:o,onSubmit:d}=e,c=(0,i._)(e,["locale","formLayout","submitProps","currentUrl","isMobile","onSubmit"]);let{t:u}=(0,D.u)(),[p,m]=(0,s.useState)(l.lastPeriod),g=(0,s.useMemo)(()=>(null==$?void 0:$[t].map(e=>{let t=L[e],a=t.icon;return Object.assign(Object.assign({},t),{label:u(t.label),icon:s.createElement(a,{size:20})})}))||[],[t,u]),h=(0,s.useMemo)(()=>g.find(e=>e.value===String(p)),[p,g]);return s.createElement(N.Provider,{value:{calculatingMethods:g,submitProps:n,currentUrl:r,isMobile:o,formLayout:a,onSubmit:d,calculatorType:p,setCalculatorType:m}},s.createElement(I.H,Object.assign({component:"div",formLayout:a},c),"default"===a?s.createElement(I.H.FormRow,null,s.createElement(I.H.Control,null,s.createElement(y.S,{label:s.createElement(P.T,{size:"p2",weight:"semiBold"},u("dueDatePage.calculationMethod")),value:String(p),data:g,itemComponent:R,onChange:e=>m(Number(e)),icon:null==h?void 0:h.icon}))):s.createElement(I.H.FormRow,null,s.createElement(I.H.BorderInlineControl,{label:s.createElement(P.T,{size:"p2",weight:"semiBold"},u("dueDatePage.calculationMethod")),width:300},s.createElement(y.S,{value:String(p),data:g,itemComponent:R,onChange:e=>m(Number(e))}))),s.createElement(FormSwitcher,null)))}},FPOE:function(e,t,a){a.d(t,{D:function(){return Dropdown}});var n=a("q1tI"),r=a("8vDj"),l=a("rBCA"),o=a("iBNF");let i=l.Z.div` --dropdown-padding: 12px 18px 12px 16px; position: relative; box-sizing: border-box; border: 1px solid ${o.r.colors.gray200}; background: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A") no-repeat; background-position: right 16px center; border-radius: ${o.r.borderRadius}; &[data-disabled='true'], :disabled { background-color: #f2f2f2; cursor: not-allowed; } &[data-size='sm'] { font-size: 13px; line-height: 20px; } &[data-size='md'] { font-size: 14px; line-height: 21px; } &[data-size='lg'] { font-size: 16px; line-height: 24px; } &[data-has-icons='true'] { border: none; background: ${o.r.colors.gray100}; img, svg { display: inline-block; max-width: 16px; margin-right: 6px; } span { display: inline-block; vertical-align: middle; } &:hover { box-shadow: none; } > div { position: relative; display: flex; width: 100%; box-sizing: border-box; align-items: center; } > div::after { position: absolute; top: 50%; right: 12px; width: 10px; height: 8px; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A"); background-repeat: no-repeat; content: ''; transform: translateY(-50%); } } &:hover { box-shadow: 0 0 2px 2px ${e=>e.shadowColor}; } &[data-is-native='true'] { padding: var(--dropdown-padding); line-height: 24px; &:focus { box-shadow: 0px 0px 2px 2px ${e=>e.shadowColor}; } } `,s=l.Z.div` padding: var(--dropdown-padding); cursor: pointer; &.with-label { padding-top: 34px; padding-bottom: 12px; } &[data-dropdown-open] { padding: 11px 15px 11px 15px; border: 1px solid ${e=>e.color}; border-radius: ${o.r.borderRadius}; box-shadow: 0 0 2px 2px ${e=>e.shadowColor}; } `,d=l.Z.ul` position: absolute; top: 100%; /* right: 0; */ min-width: 100%; left: 0; display: block; margin-top: 4px; background: ${o.r.colors.white}; border-radius: ${o.r.borderRadius}; box-shadow: -1px 1px 2px rgba(67, 70, 74, 0.0001), -2px 2px 5px rgba(67, 86, 100, 0.123689); cursor: pointer; &[data-has-icons='true'] { border: 1px solid ${o.r.colors.gray200}; background: white; box-shadow: none; filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04)); } `,c=l.Z.li` display: flex; padding: 12px 18px 12px 16px; &[data-disabled='true'] { cursor: not-allowed; color: #bfbfbf; & > * { pointer-events: none; } } &:hover, :active { background: ${o.r.colors.gray100}; } `,u=l.Z.div` max-width: 16px; margin-right: 8px; `,p=l.Z.div` position: absolute; top: 12px; left: 16px; pointer-events: none; `,Dropdown=({className:e,value:t,options:a,onChange:l=()=>void 0,id:o,placeholderIcon:m,placeholder:g,style:h,size:b="lg",groupedWithLabel:v,disabled:f,dropdownLabelTrackingAttributes:C={},isNativeSelect:x=!1})=>{let E=(0,r.rZ)(),[y,w]=n.useState(!1),showDropdown=()=>!f&&w(!y);if(x){let e="object"==typeof(null==t?void 0:t.value)&&t.value instanceof Date?t.value.toString():null==t?void 0:t.value;return n.createElement(i,{color:E.fn.primaryColor(),shadowColor:E.colors[E.primaryColor][2],as:"select","data-is-native":"true",value:e||void 0,disabled:f,onChange:e=>{if("string"==typeof e.target.value){let t=a.find(t=>t.value===e.target.value);t&&l(t)}}},g&&n.createElement("option",{value:g,disabled:!0,selected:!0},g),a.map(e=>n.createElement("option",{key:`${o}-${e.value}`,value:e.value,disabled:!!e.disabled&&e.disabled},e.label)))}return n.createElement(i,{color:E.fn.primaryColor(),shadowColor:E.colors[E.primaryColor][2],className:e,"data-dropdown-open":y||void 0,"data-size":b,id:o,"data-has-icons":!!m,style:h,onBlur:()=>w(!1),tabIndex:0,"data-disabled":f},!!v&&n.createElement(p,null,v),n.createElement(s,Object.assign({color:E.fn.primaryColor(),shadowColor:E.colors[E.primaryColor][2],onClick:showDropdown,className:v&&"with-label"},C),m," ",n.createElement("span",null,t&&t.value?t.label:g)),y&&n.createElement(d,{onClick:showDropdown,"data-has-icons":!!m},a.map(e=>n.createElement(c,{key:`${o}-${e.value}`,"data-selected":t&&t.value===e.value||void 0,onClick:()=>!e.disabled&&!f&&(null==l?void 0:l(e)),"data-disabled":!!e.disabled&&e.disabled},e.icon&&n.createElement(u,null,e.icon),e.label))))}},A0Xv:function(e,t,a){a.d(t,{L:function(){return Loading}});var n=a("q1tI"),r=a("ZKGu"),l=a("Jn/A");let Loading=({className:e,size:t="md"})=>{let{t:a}=(0,r.u)();return n.createElement("div",{className:`PD6nRZX ${e}`},n.createElement(l.B,{size:t,color:"transparent",isLoading:!0},a("loading")))}},XhNS:function(e,t,a){a.d(t,{C:function(){return ChoiceField},T:function(){return TextField},i:function(){return D},u:function(){return g}});var n=a("/npG"),r=a("iuhU"),l=a("Eso5"),o=a("8vDj"),i=a("LeBD"),s=a("6eqW"),d=a("q1tI"),c=a("ChHM"),u=a("AeFk"),p=a("rBCA"),m=a("iBNF"),g=(0,n.k)(e=>(0,i.G)(e)[i.C.LEADGEN]);let h=(0,d.createContext)({}),b=u.iv` height: 100% !important; min-height: calc(var(--container-height, 56px) * 24 / 56); line-height: calc(var(--container-height, 56px) * 24 / 56); border: none !important; border-radius: 0 !important; outline: none !important; box-shadow: none !important; padding: 0; cursor: pointer; /* opacity: 0; */ ::placeholder { color: ${m.r.colors.gray400}; } `,v=u.iv` height: auto !important; cursor: text; opacity: 1; transition: 0.1s ease-in-out all; `,f=u.iv` position: absolute; top: calc(var(--container-height) / 2); left: var(--space-x, 16px); margin: 0; z-index: 1; cursor: pointer; transform: translateY(-50%); transition: 0.125s ease-in all; right: 0; // auto grow width `,C=u.iv` top: var(--space-y-shrink, 6px); transform: translateY(0); transition: 0.125s ease-out all; right: 0; // auto grow width `,x=u.iv` min-height: var(--container-height, 56px); display: flex; align-items: flex-end; border: 1px solid ${m.r.colors.gray200}; border-radius: 8px; background-color: #fff; padding-inline: var(--space-x, 16px); padding-block: var(--space-y-not-shrink, 16px); cursor: pointer; pointer-events: none; &:has(.mantine-Input-rightSection) { padding-right: var(--container-height, 56px); } .mantine-Input-icon { display: none; } .mantine-NumberInput-control { border-color: ${m.r.colors.gray200}; } `,E=u.iv` height: auto; min-height: var(--container-height, 56px); padding-block: var(--space-y-shrink, 6px); cursor: text; pointer-events: auto; `,y=u.iv` color: ${m.r.colors.red800}; font-size: 12px; line-height: 1.5; `,w=p.Z.div` --space-x: 16px; --space-y-not-shrink: 15px; --space-y-shrink: 6px; --container-height: 56px; --label-not-shrink: 16px; --label-shrink: 12px; --input: 15px; position: relative; min-width: 100px; max-width: 100%; display: inline-block; .textField_wrapper { display: inline-block; width: 100%; cursor: pointer; } .mantine-InputWrapper-root { &[data-invalid='true'] { .mantine-Input-wrapper { border-color: ${m.r.colors.red400}; } } .mantine-Input-wrapper { &:has([data-invalid]) { border-color: ${m.r.colors.red400}; } } } .mantine-InputWrapper-label { ${f} } .mantine-Input-wrapper { ${x} + .mantine-Popover-dropdown[data-position="bottom-start"] { left: 0 !important; } + .mantine-Popover-dropdown[data-position='top-start'] { top: unset !important; left: 0 !important; bottom: 100% !important; } } .mantine-Input-input { ${b} } &.textField_shrink { .mantine-InputWrapper-label { ${C} } .mantine-Input-wrapper { ${E} &.mantine-Select-wrapper { .mantine-Select-rightSection { pointer-events: auto !important; } } } .mantine-Input-input { ${v} } &:has(.PhoneInput) { .mantine-InputWrapper-label { left: var(--space-x, 16px); } .PhoneInput { .PhoneInputInput { opacity: 1; } } } } &:focus-within { .mantine-Input-wrapper { transition: 0.25s linear border; border-color: ${m.r.colors.primary600}; box-shadow: 0 0 4px ${m.r.colors.primary200}; } } .PhoneInput { --phone-select: 75px; --phone-input-space-x: 8px; width: 100%; opacity: 1; border: none; .PhoneInputCountry { background-color: transparent; border: none; padding: 0; width: var(--phone-select, 75px); } .PhoneInputInput { flex: 1; min-width: 0; line-height: 1.5; outline: none !important; border: none; box-shadow: none; font-size: var(--input, 15px); padding: 0 var(--phone-input-space-x, 8px); /* opacity: 0; */ color: ${m.r.colors.gray800} !important; :focus { color: ${m.r.colors.gray800} !important; } } } &:has(.PhoneInput) { .mantine-InputWrapper-label { left: calc( var(--space-x, 16px) + var(--phone-select, 75px) + var(--phone-input-space-x, 8px) ); } } .icon { position: absolute; top: calc(var(--container-height) / 2); right: var(--space-x, 16px); transform: translateY(-50%); transition: 0.125s ease-in all; &.shrink { top: calc(var(--container-height) / 2 - 4px); transform: translateY(0); } } `,P=p.Z.div` &.leadgen-form_checkbox, &.leadgen-form_radio { width: 100%; } &.leadgen-form_dropdown { width: calc(50% - 12px); } .mantine-InputWrapper-root { display: block; } .mantine-InputWrapper-label { margin-bottom: 0.5rem; color: ${m.r.colors.gray800}; font-size: 16px; font-weight: 400; line-height: 1.5; } .mantine-Radio-root, .mantine-Checkbox-root { gap: 8px; min-width: calc(50% - 4px); // input[type='radio'], // input[type='checkbox'] { // border-color: ${m.r.colors.gray600}; // width: 18px; // height: 18px; // } // input[type='checkbox'] { // border-radius: 4px; // } // &[data-checked='true'] { // input[type='radio'], // input[type='checkbox'] { // border-color: ${m.r.colors.primary600}; // } // input[type='radio'] { // background-color: white; // } // } .mantine-Checkbox-input { &:checked { border-color: ${m.r.colors.primary600}; } } } .leadgen-choiceContainer { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; } .mantine-InputWrapper-error { ${y} } `;p.Z.div` position: absolute; top: calc(var(--container-height) / 2); right: var(--space-x, 16px); `;let TextField=e=>{let{shrink:t,onChangeShrink:a,children:n,className:l}=e,o=(0,s._)(e,["shrink","onChangeShrink","children","className"]),[i,c]=(0,d.useState)(t),[u,p]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{c(t)},[t]),d.createElement(h.Provider,Object.assign({value:{shrinkProps:t,shrink:i,setShrink:c,onChangeShrink:a,hasIcon:u,setHasIcon:p}},o),d.createElement(w,Object.assign({shrink:i,className:(0,r.default)(l,"textField",{textField_shrink:!!i})},o),n))},TextFieldControl=e=>{let{shrink:t,shrinkProps:a,onChangeShrink:n,setShrink:r,hasIcon:o}=(0,d.useContext)(h),{children:i,htmlFor:s}=e,u=(0,c.O)(()=>{a||(r(!1),null==n||n(!1))}),focusInput=e=>{setTimeout(()=>{let t=e.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])'),a=t.item(t.length-1);a&&a.focus({preventScroll:!0})},150)},p=(0,d.useCallback)(e=>{if(t){focusInput(e.currentTarget);return}r(!0),null==n||n(!0),focusInput(e.currentTarget)},[t]);return(0,d.useEffect)(()=>{r(a)},[a]),d.createElement(l.x,{ref:u,onClick:p,className:"textField_wrapper",component:s?"label":"div",htmlFor:s},"function"==typeof i?i({shrink:!!t,hasIcon:o}):i)},TextFieldIcon=({Icon:e})=>{let{shrink:t,setHasIcon:a}=(0,d.useContext)(h),n=(0,o.rZ)();return(0,d.useEffect)(()=>{e&&a(!0)},[]),e?d.createElement(e,{className:`icon ${t?"shrink":""}`,shrink:t,size:24,color:n.colors.gray[9]}):null};TextField.Control=TextFieldControl,TextField.Icon=TextFieldIcon;let ChoiceField=e=>{let{children:t,className:a}=e,n=(0,s._)(e,["children","className"]);return d.createElement(P,Object.assign({className:(0,r.default)(a,"choiceField")},n),t)};var D=Object.freeze({__proto__:null,TextField:TextField,TextFieldControl:TextFieldControl,TextFieldIcon:TextFieldIcon,ChoiceField:ChoiceField})},FPg9:function(e,t,a){a.d(t,{S:function(){return Spoiler}});var n=a("6eqW"),r=a("q1tI"),l=a("uCoU"),o=a("ZQ3V"),i=a("ZKGu"),s=a("iBNF");let Spoiler=e=>{var{children:t,line:a,lineHeight:d,trackingAttributes:c,maxHeight:u,customExpandFn:p}=e,m=(0,n._)(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);let{t:g}=(0,i.u)(),h=(0,r.useMemo)(()=>u||(a&&d?a*d:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0)),[]);t||console.error("[HHG-Comp]:[Spoiler] Please provide children");let b=(0,r.useMemo)(()=>c?{"data-event-category":c.dataEventCategory,"data-event-action":c.dataEventAction,"data-event-label":c.dataEventLabel}:{},[c]);return r.createElement(l.o,Object.assign({showLabel:r.createElement(o.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},b,{onClick:p}),g("articlePage.readMore")),hideLabel:r.createElement(o.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},b),g("articlePage.showLess"))},m,{maxHeight:h}),t)}},NKjB:function(e,t,a){a.r(t),a.d(t,{ProfileChatbot:function(){return ProfileChatbot},TabDataInit:function(){return E},TabName:function(){return l},UserType:function(){return o}});var n,r,l,o,i=a("6eqW"),s=a("q1tI"),d=a("qM2N"),c=a("A0Xv"),u=a("OQNV"),p=a("IQVP"),m=a("4fTT"),g=a("WedE"),h=a("vWP/"),b=a("4JiQ"),v=a("cphq"),f=a("PmKk");a("NmYn"),a("gY0P"),a("Wgwc"),a("QgiU"),a("rBCA");let C=(0,s.createContext)({}),Faqs=({faqs:e})=>{let[t,a]=(0,s.useState)([]),handleClick=e=>{if(t.includes(e)){let n=t.filter(t=>t!==e);a(n)}else a(t=>[...t,e])};return s.createElement("div",{className:"_0NhMo6T"},e.map((e,a)=>{let n=t.includes(a);return s.createElement("div",{className:"nrZtZ-u",key:a},s.createElement("div",{className:"faq-item",onClick:()=>handleClick(a)},s.createElement("div",{className:"faq-question",dangerouslySetInnerHTML:{__html:e.question||""}}),n?s.createElement(g.Z,null):s.createElement(h.Z,null)),s.createElement(b.U,{in:n,className:"faq-answer"},s.createElement("div",{dangerouslySetInnerHTML:{__html:e.answer||""}})))}))};var x={container:"_2ugC2Ll",body:"CCwRHCd",description:"RF63WXG",cardAuthorWrapper:"PIaeC0v"};let formatExperience=e=>e?{title:null==e?void 0:e.title,organization:null==e?void 0:e.organization,duration:e.duration}:{},formatEducation=e=>e?{completedYear:null==e?void 0:e.completed_year,schoolName:e.school_name,study:e.study}:{};(n=l||(l={}))[n.About=0]="About",n[n.Care=1]="Care",n[n.Answer=2]="Answer",n[n.Posts=3]="Posts",(r=o||(o={}))[r.Expert=0]="Expert",r[r.User=1]="User";let E={experiences:[],relatedPosts:[],educations:[],awards:[],contact:{},data:{}},ProfileChatbot=e=>{var{authorProps:t,authActionWrapper:a,onSkipQuestion:n,onCloseFromPost:r,onChatWithBot:l,showSkipQuestionTag:o,currentPageUrl:g}=e,h=(0,i._)(e,["authorProps","authActionWrapper","onSkipQuestion","onCloseFromPost","onChatWithBot","showSkipQuestionTag","currentPageUrl"]);let{data:{locale:b,userInfo:E,env:{isMarryBaby:y}}}=(0,s.useContext)(m.T),w=String(null==t?void 0:t.userId),[P,D]=(0,s.useState)(),[I,F]=(0,s.useState)(!1),[k,_]=(0,s.useState)(),[S,L]=(0,s.useState)([]),[M,$]=(0,s.useState)(""),T=(null==E?void 0:E._togetherUserId)===(null==t?void 0:t.userId),[N,O]=(0,s.useState)(1),H={value:String(N),dataList:[{value:"1",text:"FAQs",content:s.createElement(Faqs,{faqs:S})}],onTabChange:e=>O(Number(e))};return(0,s.useEffect)(()=>{(0,i.a)(void 0,void 0,void 0,function*(){var e,t,a,n,r,l,o,i,s,d,c;F(!0);let g=yield Promise.all([(0,m.c)((0,m.f)(p.yy.USER.DETAIL,{_locale:b,id:w}),"GET"),(0,m.c)((0,m.f)(p.yy.CHATBOT.PROFILE,{_locale:b}),"GET"),(0,m.c)((0,m.f)(p.yy.CHATBOT.FAQS_LIST,{_locale:b}),"GET")]),[h,v,f]=g,C={data:null==h?void 0:h.data,experiences:((null===(t=null===(e=null==h?void 0:h.data)||void 0===e?void 0:e.fields)||void 0===t?void 0:t.experiences)||[]).map(formatExperience),relatedPosts:((null===(a=null==h?void 0:h.data)||void 0===a?void 0:a.related_post)||[]).map(e=>(0,u.b)(e.post)),educations:((null===(r=null===(n=null==h?void 0:h.data)||void 0===n?void 0:n.fields)||void 0===r?void 0:r.educations)||[]).map(formatEducation),awards:(null===(o=null===(l=null==h?void 0:h.data)||void 0===l?void 0:l.fields)||void 0===o?void 0:o.awards_accreditations)||[],contact:(null===(s=null===(i=null==h?void 0:h.data)||void 0===i?void 0:i.fields)||void 0===s?void 0:s.contact)||{}};(null==h?void 0:h.status)===1&&_(C),L((null===(d=null==f?void 0:f.data)||void 0===d?void 0:d.faqs)||[]),$((null===(c=null==v?void 0:v.data)||void 0===c?void 0:c.description)||""),F(!1)})},[]),s.createElement(C.Provider,{value:{isMarryBaby:y,siteType:y?"marryBaby":"helloSites",authorId:String((null==t?void 0:t.userId)||""),authActionWrapper:a,onSkipQuestion:n,info:k,authorProps:t,onCloseFromPost:r,countValues:P,setCountValues:D,isAuthorLogin:T,showSkipQuestionTag:o,currentPageUrl:g}},s.createElement("div",Object.assign({},h,{className:`${x.container} ${(null==h?void 0:h.className)||""}`,"data-is-marrybaby":y}),I?s.createElement(c.L,null):s.createElement(s.Fragment,null,s.createElement("div",{className:x.cardAuthorWrapper},s.createElement(v.C,Object.assign({},t,{className:"card-author",showDetailPopup:!1,showChatbotButton:b===f.L.Vietnam,onChatWithBot:l}))),s.createElement("div",{className:x.description,dangerouslySetInnerHTML:{__html:M}}),S.length>0&&s.createElement("div",{className:x.body},s.createElement(d.T,Object.assign({},H))))))}}}]);