"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8674],{g0yS:function(e,t,a){a.d(t,{T:function(){return TextArea}});var o=a("Kz+G"),r=a("q1tI"),n=a("0qvZ"),i=a("H1c6"),l=a("YXre");let TextArea=e=>{var{styles:t}=e,a=(0,o._)(e,["styles"]);let s=(0,l.u)(),{classes:d}=(0,i.u)({variantStyle:s},{name:"MantineTextarea",styles:t});return r.createElement(n.g,Object.assign({classNames:{input:d.input},minRows:2,maxRows:4},a))}},URtS:function(e,t,a){a.d(t,{C:function(){return CardPost},S:function(){return SourceList},V:function(){return VerifiedTag},a:function(){return CardPostPopoverMore},b:function(){return CardReply},c:function(){return CardReplyPopover}});var o=a("Kz+G"),r=a("q1tI"),n=a("LB4I"),i=a("sfOR"),l=a("FUIV"),s=a("ns0B"),d=a.n(s),c=a("9dv4"),p=a("kSP5"),u=a("xPje"),m=a("aZjv"),h=a("7m0Y"),g=a("xp5F"),v=a("rBCA"),b=a("JIuZ"),f=a("iBNF"),x=a("0aZv"),y=a("IQVP"),w=a("jq6R"),E=a("udpS"),C=a("Jvun"),k=a("LPsQ"),S=a("/Xa9"),$=a("aQHZ"),I=a("vWP/"),z=a("VLUI"),N=a("h84G"),T=a("MZpI"),j=a("QaGV"),B=a("bpvy"),P=a("s/gR"),L=a("pMur"),M=a("hJjf"),O=a("bxxm"),_=a("xrdX"),R="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%233E3F58' d='M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M19 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2'/%3e%3c/svg%3e",D="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='3' height='13' fill='none'%3e%3ccircle cx='1.583' cy='6.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 6.417)'/%3e%3ccircle cx='1.583' cy='1.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 1.417)'/%3e%3ccircle cx='1.583' cy='11.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 11.417)'/%3e%3c/svg%3e",A="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.75' d='M2 4h12'/%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.334 1.334 0 0 1 1.334 1.334V4m2 0v9.333a1.334 1.334 0 0 1-1.334 1.334H4.667a1.334 1.334 0 0 1-1.334-1.334V4zM6.667 7.333v4M9.333 7.333v4'/%3e%3c/svg%3e";let CardPostPopoverMore=({authorEmail:e,onDeletePost:t,shareUrl:a,post:n,className:i="",popoverClassName:s="",onEditPost:d})=>{let{data:{locale:v,userInfo:b,env:{isMarryBaby:f}}}=(0,r.useContext)(h.T),{t:x}=(0,l.u)(),[y,w]=(0,r.useState)(!1),[E,C]=(0,r.useState)(!1),[k,S]=(0,r.useState)(!1),{authActionWrapper:$}=(0,m.iV)(),I=e&&(null==b?void 0:b.email)&&e===String(null==b?void 0:b.email);return r.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},k&&r.createElement(c.S,{url:a,text:null==n?void 0:n.title,onClose:()=>S(!1)}),E&&r.createElement(c.P,{thumbnail:p.C.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:x("popup.deletePost.title"),description:x("popup.deletePost.description"),acceptText:x("popup.deletePost.accept"),cancelText:x("popup.deletePost.cancel"),onAccept:()=>(0,o.a)(void 0,void 0,void 0,function*(){if((null==n?void 0:n.id)&&!y){w(!0);try{let e=yield(0,c.h)({id:n.id,locale:v});(null==e?void 0:e.status)===1&&(null==t||t())}catch(e){}w(!1)}}),onClose:()=>C(!1)}),r.createElement(g.b,{className:s,toggleButtonContent:r.createElement("img",{src:f?R:D,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:y},data:I?{isShowheader:!1,type:"list",list:[{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M7.17 3.236H2.995a1.193 1.193 0 0 0-1.193 1.192v8.35a1.193 1.193 0 0 0 1.193 1.192h8.35a1.193 1.193 0 0 0 1.192-1.192V8.603'/%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M11.643 2.341a1.265 1.265 0 0 1 1.789 1.79L7.766 9.795l-2.385.596.596-2.385z'/%3e%3c/svg%3e",label:x("actionPopover.edit"),onClick:d},{icon:A,label:x("actionPopover.delete"),onClick:()=>{$(()=>C(!0))}}]}:{isShowheader:!1,type:"list",list:[{icon:c.i,label:x("morePopover.report"),subTree:{title:x("morePopover.report.title"),description:x("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(u.R).map(e=>({label:u.R[e].label,reason:u.R[e].reportReasonText,reasonValue:e})).map(e=>({label:x(e.label),subTree:{title:x("morePopover.reportSubmit.title"),description:x("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>r.createElement(c.b,{reason:e.reasonValue,reasonText:x(e.reason),postId:null==n?void 0:n.id,onClose:()=>t&&t(!1)})}}))}}]}}))},Z=v.Z.div` position: relative; margin-bottom: 24px; background: white; border-radius: ${f.r.borderRadius}; a { text-decoration: none; } ${b.M.mbDown} { margin-bottom: 8px; } &.flat-top { border-top-left-radius: 0; border-top-right-radius: 0; } .post-pin { padding: 0.5rem 1rem; border-radius: ${f.r.borderRadius} 6px 0 0; } .post-author { display: flex; align-items: center; justify-content: space-between; &.comment { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .post-content-link-wrapper { color: inherit; cursor: pointer; .post-content-title { padding: 1rem 1rem 0; word-break: break-word; } } .social-preview-wrapper.has-image { margin-bottom: 5px; } .social-preview-wrapper, .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-topics { padding: 0 1rem; } .post-reaction { background: none; border-radius: 0 0 6px 6px; &.hide-top-border { ::before { display: none; } } } .most-engaging-wrapper { padding: 1rem; cursor: pointer; .author-avatar-wrapper { width: 2rem; height: 2rem; font-size: 1rem; } .see-more-comments { width: 100%; padding: 12px 0 0; text-align: unset; } } &[data-most-engaging='true'] { border: none; ${b.M.mbDown} { margin: 1rem; border: 1px solid #e4e8ec; } } .top-divider { border-color: #e4e8ec; } .popover { .popover-menu__btn { display: flex; width: 1.5rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } &[data-is-marrybaby='true'] { border: 1px solid #f3f3f3; border-radius: 1rem; /* shadow */ box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.08); .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; ${b.M.mbDown} { width: 18px; height: 18px; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 1rem; } width: 350px; ${b.M.mbDown} { max-width: calc(320px - 2rem); } } } } } .most-engaging-wrapper { position: relative; padding: 0; &::before { position: absolute; z-index: 5; top: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } ${b.M.mbDown} { margin-bottom: 12px; } } `;var F="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e";let CardReplyPopover=({onDeleteComment:e,commentId:t,className:a="",popoverClassName:n=""})=>{let{data:{env:{isMarryBaby:i},locale:s},action:{pushNotifications:d}}=(0,r.useContext)(h.T),{t:p}=(0,l.u)(),[u,v]=(0,r.useState)(!1),{authActionWrapper:b}=(0,m.iV)();return r.createElement("div",{className:a,onClick:e=>{e.preventDefault(),e.stopPropagation()}},u&&r.createElement(c.P,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23a)'%3e%3cpath d='M2 4.008h12m-8.667 0V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008zm-6 3.334v4m2.666-4v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='a'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:p("popup.deleteComment.title"),description:p("popup.deleteComment.description"),acceptText:p("popup.deletePost.accept"),cancelText:p("popup.deletePost.cancel"),onAccept:()=>(0,o.a)(void 0,void 0,void 0,function*(){var a;if(!t)return;let o=yield(0,c.j)({id:t,locale:s});(null==o?void 0:o.status)===1?(e&&e(),d({title:"",message:p("notification.success"),type:"success"})):d({title:"",message:(null===(a=null==o?void 0:o.messages)||void 0===a?void 0:a[0])||p("notification.failure"),type:"danger"})}),onClose:()=>v(!1)}),r.createElement(g.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:A,label:p("actionPopover.delete"),onClick:()=>{b(()=>{v(!0)})}}]},className:n,toggleButtonContent:r.createElement("img",{src:i?R:D,loading:"lazy"}),buttonProps:{}}))},H=v.Z.div` .add-link { color: ${f.r.colors.primaryBase}; } `,U=v.Z.div` margin: 16px 0; background: ${f.r.colors.yellow50}; padding: 5px 10px; border-radius: 2px; .icon { display: inline-block; vertical-align: middle; margin-right: 6px; } `,V=v.Z.div` display: flex; align-items: center; gap: 8px; `,G=v.Z.div` padding: 8px 16px; `,W=v.Z.div` margin-bottom: 12px; width: 100%; `,q=v.Z.div``,J=v.Z.div` margin-bottom: 16px; `,Q=v.Z.div` display: flex; flex-wrap: wrap; row-gap: 16px; ${b.M.tdUp} { align-items: center; column-gap: 24px; } `,K=v.Z.a` display: flex; align-items: center; gap: 16px; ${b.M.mbDown} { width: 100%; justify-content: space-between; } `,X=v.Z.div` display: flex; align-items: center; gap: 16px; `,Y=v.Z.div` border-radius: ${f.r.borderRadius}; overflow: hidden; width: 48px; height: 48px; img { object-fit: cover; width: 100%; height: 100%; } `,RecommentCategories=({categories:e})=>{let{t}=(0,l.u)(),{data:{locale:a,env:{isMarryBaby:o}}}=(0,r.useContext)(h.T),n=(0,O.g)(a,o);return r.createElement(q,null,r.createElement(J,null,r.createElement(i.H,{tag:"h6",as:"h5"},t("cardReply.recommentCategories.heading"))),r.createElement(Q,null,e.map(e=>r.createElement(K,{href:n+e.permalink,key:String(e.termId),target:"_blank"},r.createElement(X,null,r.createElement(Y,null,r.createElement("img",{src:e.featureImage||p.C.getAssetPath(o?"mb-logo.svg":"/logo/logomark.png"),alt:e.displayName,loading:"lazy"})),r.createElement(L.T,{size:"s3",weight:"bold"},e.displayName)),r.createElement(z.Z,{size:20,color:f.r.colors.gray400})))))},ee=v.Z.a` padding: 12px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid ${f.r.colors.neutral100}; text-decoration: none; &:first-child { border-top: 0; } `,SourceItem=({postTitle:e,articleReviewed:t,modifiedTime:a,href:o})=>{let{t:n}=(0,l.u)(),i=(()=>{let{expert:e,editor:a,is_author:o}=t;if(e){let t={name:e.display_name,role:"expert",avatar:e.avatar};return o?Object.assign({title:n("articleAuthor.title.written-by")},t):"expert"===e.role?Object.assign({title:n("articleAuthor.title.expert")},t):Object.assign({title:n("articleAuthor.title.medical")},t)}if(a)return{title:n("articleAuthor.title.fact-check"),name:a.display_name,avatar:a.avatar}})();return r.createElement(ee,{href:o,title:e,target:"_blank"},r.createElement(L.T,{size:"s3",as:"h5",weight:"bold"},e),r.createElement("div",null,r.createElement(E.C,{avatar:null==i?void 0:i.avatar,avatarProps:{size:32},name:null==i?void 0:i.name,role:null==i?void 0:i.role,hideBackground:!0},r.createElement(E.C.SubTextRow,null,r.createElement(E.C.SubText,null,null==i?void 0:i.title," ",r.createElement("span",{style:{color:f.r.colors.gray800}},null==i?void 0:i.name)),r.createElement(E.C.SubDivider,null),r.createElement(E.C.SubText,null,a)))))};var et={header:"F4mmgSy",chevron:"A7QrQ7A"};let SourceList=e=>{var{listUrl:t,hideSourceList:a,categorySlug:s,editMode:d,collapseSource:c,onListChange:u,isMarryBaby:m}=e,g=(0,o._)(e,["listUrl","hideSourceList","categorySlug","editMode","collapseSource","onListChange","isMarryBaby"]);let{t:v}=(0,l.u)(),[b,w]=(0,r.useState)(t||[]),[E,C]=(0,r.useState)([]),[k,S]=(0,r.useState)([]),[$,z]=(0,r.useState)(!1);(0,r.useEffect)(()=>{a||(0,o.a)(void 0,void 0,void 0,function*(){z(!0);let e=b.map(e=>{let t=new URL(e),a=String(t.pathname).split("/").filter(e=>""!=e),o=t.origin,r=-1!==o.search("marrybaby.vn");return{isMarrySite:r,path:a[a.length-1],href:e}}),t=[...e.map(e=>(0,h.c)(e.isMarrySite?(0,h.s)(y.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0):(0,h.g)(y.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0),"GET"))],a=yield Promise.all(t);C(a.map((t,a)=>{var o,r;return(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.post)&&Object.assign(Object.assign({},(0,x.f)(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.post)),{href:e[a].href})}).filter(Boolean)),z(!1)})},[]),(0,r.useEffect)(()=>{!a&&(null==E?void 0:E.length)===0&&s&&(0,o.a)(void 0,void 0,void 0,function*(){var e;let t=yield(0,h.c)(m?(0,h.s)(y.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0):(0,h.g)(y.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0),"GET");(null==t?void 0:t.data)&&S([(0,x.h)(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.category)])})},[E]);let handleRemoveItem=e=>{w(t=>{let a=[...t];return a.splice(e,1),a}),C(t=>{let a=[...t];return a.splice(e,1),a})};return(0,r.useEffect)(()=>{null==u||u(b)},[b]),r.createElement("div",Object.assign({},g),!d&&r.createElement(U,null,r.createElement("img",{className:"icon",src:p.C.getAssetPath("warning.svg"),alt:"warning",style:{marginBottom:"3px",width:"18px"},loading:"lazy"}),r.createElement(L.T,{size:"s3",as:"span",dangerouslySetInnerHTML:{__html:v("cardReply.disclaimer")}})),a?null:$?r.createElement(M.L,null):E.length>0||d?r.createElement(H,null,r.createElement(B.U,{defaultValue:!c&&"accordion",styles:{control:{borderRadius:"inherit",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,borderBottom:0,borderTop:`1px solid ${f.r.colors.neutral100}`},item:{marginBottom:"16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",border:`1px solid ${f.r.colors.neutral100}`,borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px","&[data-active]":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},chevron:r.createElement("div",{className:et.chevron},r.createElement(N.Z,{color:f.r.colors.gray600,size:20}))},r.createElement(B.U.Item,{value:"accordion"},r.createElement(B.U.Control,null,r.createElement("div",{className:et.header},r.createElement(i.H,{as:"h4",tag:"h6"},v("cardReply.source")))),r.createElement(B.U.Panel,null,r.createElement(G,null,(E||[]).map((e,t)=>r.createElement(V,{key:String(t)},"object"==typeof e?r.createElement(SourceItem,Object.assign({},e)):r.createElement(W,null,r.createElement(P.I,{style:{width:"100%"},name:"source-list",value:e||"",size:"sm",onChange:e=>{w(a=>{let o=[...a];return o[t]=e,o}),C(a=>{let o=[...a];return o[t]=e,o})}})),d&&r.createElement(n.B,{size:"md",color:"transparent",icon:r.createElement(T.Z,null),onClick:()=>handleRemoveItem(t)}))),d&&r.createElement(n.B,{className:"add-link",color:"transparent",size:"md",icon:r.createElement(I.Z,{color:f.r.colors.primaryBase,size:18}),onClick:()=>{w(e=>[...e,""]),C(e=>[...e,""])}},"Add source")))))):r.createElement(RecommentCategories,{categories:k}))},ea=v.Z.div` position: relative; margin-bottom: 0; background: white; border-radius: ${f.r.borderRadius}; .verify-tag { margin-top: 12px; } .post-author { &.with-popover { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-reaction { background: none; border-radius: 0 0 6px 6px; } &[data-is-reply='true'] { > .post-author .author-avatar-wrapper { width: 20px; height: 20px; font-size: 10px; } } &[data-is-reply='false'] { border: 1px solid #e4e8ec; } .expert-wrapper { width: 100%; } &[data-has-booking='true'] { display: grid; .post-author { background-color: ${f.r.colors.primary50}; } .btn-wrapper { padding: 0 16px; .btn-booking { width: 100%; margin: 12px 0; } } } .comment-reply-wrapper { padding: 0 1rem; .more-cmt { .chevron-right { height: 1rem; width: 1rem; vertical-align: middle; } } } .top-divider { border-color: #e4e8ec; } .popover { position: absolute; top: 1.5rem; right: 1rem; .popover-menu__btn { display: flex; width: 1rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } } &[data-is-marrybaby='true'] { &[data-is-reply='false'] { border: none; } .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; } } margin-left: 56px; ${b.M.mbDown} { margin-left: 40px; } > .post-author { margin-left: -56px; ${b.M.mbDown} { margin-left: -40px; } .author-info { align-items: center; display: flex; align-items: center; .author-info-top { width: 100%; } .author-info-text-wrapper { justify-content: space-between; } } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } &[data-is-reply] { > .post-author { .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } } .comment-reply-wrapper { padding-right: 0; padding-left: 0; } .post-reaction { &::after { position: absolute; bottom: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } .post-content-wrapper { padding-top: 0; padding-bottom: 0; ${b.M.mbDown} { padding-left: 0.5rem; } } ${b.M.mbDown} { margin-bottom: 12px; } } `,eo=(0,v.Z)(SourceList)` margin-top: 12px; padding: 0.5rem 1rem 1rem; `,VerifiedTag=({userId:e,avatar:t,name:a,role:o,title:i,className:s})=>{let{t:d}=(0,l.u)(),[c,p]=(0,r.useState)(!1);return r.createElement(r.Fragment,null,r.createElement(n.B,{className:`-dzIuHr ${s}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},r.createElement("span",{className:"text"},r.createElement(j.Z,{isSolid:!0,size:18,color:f.r.colors.green800,className:"icon"}),d("cardReply.verifyBy",{name:`${a||""}`}))),r.createElement(E.c,{open:c,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},r.createElement(C.a,{authorProps:{userId:e,avatar:t,name:a,role:o,title:i},hideQuestionTab:!0})))},CardReply=({className:e,style:t,comment:a,type:i="comment",level:s=0,replyingId:d,onPostCommentSuccess:p,post:u,onDeleteComment:v,refetchComment:b,hasQuickBookingEnable:f,handleMakeAppointment:x,cardAuthorProps:S,maxChars:I=600,disableShortenContent:z})=>{var N,T,j,B,P,L,M,O,R,D,A,Z,F;let{data:{locale:H,userInfo:U,env:{isMarryBaby:V}}}=(0,r.useContext)(h.T),{t:G}=(0,l.u)(),[W,q]=(0,r.useState)(a||null),{id:J,countLikes:Q,content:K,replies:X=[],images:Y=[],author:ee,liked:et,link:er,mentionedUser:en,mentions:ei}=W,{text:el,replyingTo:es}=(0,c.k)(K),{authActionWrapper:ed}=(0,m.iV)({_joinCommunityIds:[null===(N=null==u?void 0:u.community)||void 0===N?void 0:N.id],_joinTopicIds:null===(T=null==u?void 0:u.topics)||void 0===T?void 0:T.map(e=>e.id)}),[ec,ep]=(0,r.useState)(4),eu=null!=U&&!!U.id&&(null==X?void 0:X.some(e=>e.author.id===U.id)),addNewReply=e=>{q(t=>{if(!t.replies.find(t=>t.id===e.id)){t.replies.unshift(e);let a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return b&&b(a),a}return t})},[em,eh]=(0,r.useState)(!1),eg=(0,r.useMemo)(()=>"comment"===i&&X&&0!=X.length?X.sort((e,t)=>{let a=new Date(e.createdAt).getTime(),o=new Date(t.createdAt).getTime();return a>o?-1:a{var e,t;(null==ee?void 0:ee.hospitalId)&&(e=ee.hospitalId,(0,o.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,h.c)((0,h.b)(y.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:_.v[H]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&ek(null==a?void 0:a._data.branch)})),(null==ee?void 0:ee.doctorId)&&(t=ee.doctorId,(0,o.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,h.c)((0,h.b)(y.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:_.v[H]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&e$(null==a?void 0:a._data.doctor)}))},[ee.hospitalId,ee.doctorId]);let eI=(null==eS?void 0:eS.valid_outpatient)||(null==eS?void 0:eS.valid_telemedicine),ez=((null==eC?void 0:eC.total_available_service)||(null==eC?void 0:eC.total_available_doctor))>0,eN=f&&(eI||ez),eT=(null===(B=null==W?void 0:W.author)||void 0===B?void 0:B.type)==="chatbot";return r.createElement(m.I_,{defaultParams:{_joinCommunityIds:[null===(P=null==u?void 0:u.community)||void 0===P?void 0:P.id],_joinTopicIds:null===(L=null==u?void 0:u.topics)||void 0===L?void 0:L.map(e=>e.id)}},r.createElement(ea,{className:e,style:t,"data-is-reply":!!s,"data-is-marrybaby":V,"data-has-booking":eN},"reply"===i&&r.createElement($.D,{className:"top-divider",type:"solid"}),r.createElement("div",{style:{padding:"16px 16px 0"}},r.createElement(E.C,Object.assign({avatar:ey,name:ef,username:ex,timeText:null==u?void 0:u.createdTime,community:null==u?void 0:u.community,className:`post-author ${eb?"with-popover":""}`,type:i,userId:null==ee?void 0:ee.id,role:ew,expertId:null==ee?void 0:ee.partnerId,title:null==ee?void 0:ee.title,doctorId:null==ee?void 0:ee.doctorId,hospitalId:null==ee?void 0:ee.hospitalId,hasQuickBooking:eN,handleMakeAppointment:x,isAnonymous:(null==W?void 0:W.isAnonymous)||!!(null==u?void 0:u.isAnonymous)&&(null===(M=null==u?void 0:u.author)||void 0===M?void 0:M.username)===(null==ee?void 0:ee.username),hideBackground:eT,userType:null==ee?void 0:ee.type},S)),!!(null==W?void 0:W.isVerify)&&!(null==W?void 0:W.isOppose)&&r.createElement(VerifiedTag,{title:null===(O=null==W?void 0:W.userVerify)||void 0===O?void 0:O.title,name:null===(R=null==W?void 0:W.userVerify)||void 0===R?void 0:R.name,userId:null===(D=null==W?void 0:W.userVerify)||void 0===D?void 0:D.id,role:null===(A=null==W?void 0:W.userVerify)||void 0===A?void 0:A.role,avatar:null===(Z=null==W?void 0:W.userVerify)||void 0===Z?void 0:Z.avatar,className:"verify-tag"})),r.createElement(C.P,{className:"post-content-wrapper",replyingTo:es,mentionedUser:en,description:el,mentions:eE,maxChars:I,disableShortenContent:z}),r.createElement("span",null),r.createElement("span",null),Y&&Y.length>0?r.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},r.createElement(k.a,{images:Y,authorName:null==ee?void 0:ee.username})):null,(!Y||0===Y.length)&&er?r.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},r.createElement(w.C,{url:er})):null,"most-engaging"!==i?r.createElement(r.Fragment,null,eT&&r.createElement(eo,{listUrl:null==W?void 0:W.source,categorySlug:null==W?void 0:W.categorySlug}),r.createElement(g.C,{type:g.c.reply,loveCount:Q,replyCount:ev,className:"post-reaction",liked:et,isReplied:eu,hideCommentIcon:"reply"===i||eT,hasShare:!1,onCommentClick:()=>ed(()=>eh(e=>!e)),onCommentCountClick:()=>ed(()=>{eh(!0)}),onLikeClick:()=>ed(()=>(0,o.a)(void 0,void 0,void 0,function*(){if(J){let e=yield(0,c.l)({commentId:J,setLike:!et,locale:H});1===e.status&&q(e=>Object.assign(Object.assign({},e),{liked:!et,countLikes:e.countLikes+(et?-1:1)}))}}))}),em&&r.createElement(c.I,{replyingId:d||W.id,replyToName:ef,isReply:!0,onClose:()=>eh(!1),onPostSuccess:e=>{"reply"===i?p&&p(e):addNewReply(e)},post:u,replyingUser:ee}),"comment"===i&&X&&X.length>0?r.createElement("div",{className:"comment-reply-wrapper"},null===(F=null==eg?void 0:eg.slice(0,ec))||void 0===F?void 0:F.map(e=>r.createElement(CardReply,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:J,onPostCommentSuccess:addNewReply,post:u,onDeleteComment:()=>{q(t=>Object.assign(Object.assign({},t),{replies:t.replies.filter(t=>t.id!==e.id),countReplies:t.countReplies-1}))},handleMakeAppointment:x,hasQuickBookingEnable:f})),ev>ec&&r.createElement(r.Fragment,null,r.createElement($.D,{className:"top-divider",type:"solid"}),r.createElement(n.B,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>ep(e=>e+4)},G("comment.seeMoreReplies",{count:ev-ec}),r.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 12 4-4-4-4'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,eb&&r.createElement(CardReplyPopover,{onDeleteComment:v,className:"popover",commentId:W.id})))},getMostEngagingComment=(e,t)=>(0,o.a)(void 0,void 0,void 0,function*(){var a,o,r;let n=yield(0,h.t)((0,h.f)(y.yy.COMMENT.LIST,{postId:e,_locale:t,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(r=null===(o=null===(a=null==n?void 0:n.data)||void 0===a?void 0:a.comments)||void 0===o?void 0:o.map(x.g))||void 0===r?void 0:r[0]}),CardPost=({className:e,style:t,hideViewMoreComment:a,showMostEngaging:s,onCommentClick:p,onCommentCountClick:v,onMostEngagingCommentClick:b,onPostCommentSuccess:f,disableCardLink:x,disableShortenContent:$,onDeletePost:I,onEditPost:z,post:N,mostEngagingComment:T,onDeleteComment:j,showInputComment:B,InlineCommentsComponent:P,hasQuickBookingEnable:L,handleMakeAppointment:M,onSaveUnsaveSuccess:O,cardAuthorProps:_,verticalReactions:R=!1})=>{let[D,A]=(0,r.useState)(N),[H,U]=(0,r.useState)(!1),[V,G]=(0,r.useState)(T),{community:W,topics:q,author:J,slug:Q,isPin:K,liked:X,photos:Y,mentions:ee,title:et,description:ea,previewUrl:eo,likesCount:er,commentsCount:en,id:ei,commented:el}=D,{data:{locale:es,togetherUserId:ed,userInfo:ec,env:{isMarryBaby:ep,togetherBasePath:eu}},action:{pushNotifications:em}}=(0,r.useContext)(h.T),eh=!!(null==ec?void 0:ec.id),{t:eg}=(0,l.u)(),[ev,eb]=(0,r.useState)(B),ef=`${eu}/${(null==W?void 0:W.slug)||"_"}/${Q||""}`,ex=`${(0,h.l)(es)}${ef}`,{authActionWrapper:ey}=(0,m.iV)((null==W?void 0:W.slug)?{_joinCommunityIds:[W.id],_joinTopicIds:null==q?void 0:q.map(e=>e.id)}:void 0),[ew,eE]=(0,r.useState)(!1);(0,r.useEffect)(()=>{eb(B)},[B]);let eC=(null==J?void 0:J.name)||(null==J?void 0:J.username)||"",ek=(null==J?void 0:J.username)||(null==J?void 0:J.name)||"",eS=null==J?void 0:J.avatar,e$=(null==D?void 0:D.isAnonymous)?void 0:null==J?void 0:J.role,[eI,ez]=(0,r.useState)(null),[eN,eT]=(0,r.useState)(null);(0,r.useEffect)(()=>{var e,t;(null==J?void 0:J.hospitalId)&&(e=J.hospitalId,(0,o.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,h.c)((0,h.b)(y.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:h.m[es]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&ez(null==a?void 0:a._data.branch)})),(null==J?void 0:J.doctorId)&&(t=J.doctorId,(0,o.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,h.c)((0,h.b)(y.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:h.m[es]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&eT(null==a?void 0:a._data.doctor)}))},[J.hospitalId,J.doctorId]);let ej=(null==eN?void 0:eN.valid_outpatient)||(null==eN?void 0:eN.valid_telemedicine),eB=((null==eI?void 0:eI.total_available_service)||(null==eI?void 0:eI.total_available_doctor))>0;(0,r.useEffect)(()=>{(0,o.a)(void 0,void 0,void 0,function*(){if(ei&&en&&s&&!(null==T?void 0:T.id)){let e=yield getMostEngagingComment(ei,es);G(e)}})},[ei,es,en,s,null==T?void 0:T.id]),(0,r.useEffect)(()=>{G(T)},[null==T?void 0:T.id]);let onDeleteComment=e=>(0,o.a)(void 0,void 0,void 0,function*(){if(en>1&&(null==V?void 0:V.id)&&(null==V?void 0:V.id)===(null==e?void 0:e.id)){let e=yield getMostEngagingComment(ei,es);G(e)}A(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1})),j&&j(e)});return r.createElement(m.I_,{defaultParams:(null==W?void 0:W.slug)?{_joinCommunityIds:[W.id],_joinTopicIds:null==q?void 0:q.map(e=>e.id)}:void 0},H&&r.createElement(c.S,{url:ex,avatar:u.a,text:et,onClose:()=>U(!1)}),r.createElement(Z,{className:e,style:t,"data-is-marrybaby":ep},K?r.createElement(g.a,{className:"post-pin"}):null,r.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},r.createElement(E.C,Object.assign({avatar:eS,name:eC,username:ek,url:x?void 0:ef,community:W,timeText:null==D?void 0:D.createdTime,className:"post-author",role:e$,userId:null==J?void 0:J.id,expertId:null==J?void 0:J.partnerId,doctorId:null==J?void 0:J.doctorId,hospitalId:null==J?void 0:J.hospitalId,title:null==J?void 0:J.title,hasQuickBooking:L&&(ej||eB),handleMakeAppointment:M,"data-testid":"name",isAnonymous:!!(null==D?void 0:D.isAnonymous),extendEle:r.createElement(CardPostPopoverMore,{authorEmail:String(null==J?void 0:J.email),onDeletePost:I,shareUrl:ex,post:D,className:"popover",onEditPost:z})},_))),r.createElement("a",{href:x?void 0:ef,className:"post-content-link-wrapper"},et&&r.createElement(i.H,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},d()(et)),r.createElement(C.P,{className:"post-content-wrapper",description:ea,disableShortenContent:$,mentions:ee,"data-testid":"Content of the Post"})),r.createElement("span",null),r.createElement("span",null),r.createElement("div",{key:"tag-topic"},q&&q.length>0?r.createElement(g.T,{topics:q,className:"post-topics"}):null),r.createElement("div",{key:"social-preview"},(null==D?void 0:D.introUrl)?r.createElement("div",{className:`social-preview-wrapper ${(null==Y?void 0:Y.length)?"has-image":""}`},r.createElement(S.S,{url:D.introUrl,image:D.bannerImage})):null),r.createElement("div",{key:"image-preview"},(null==Y?void 0:Y.length)?r.createElement("div",{className:"image-preview-wrapper"},r.createElement(k.a,{images:Y,authorName:null==J?void 0:J.name,isSensitive:!!(null==D?void 0:D.isSensitive)})):null),r.createElement("div",{key:"link-preview"},(null==D?void 0:D.introUrl)||(null==Y?void 0:Y.length)||null==eo||!eo.url?null:r.createElement("div",{className:"link-preview-wrapper"},r.createElement(w.C,{title:eo.title,url:eo.url,image:eo.image}))),r.createElement(g.C,{isMarryBaby:ep,type:g.c.post,loveCount:er,replyCount:en,className:`post-reaction ${(null==Y?void 0:Y.length)||(null==eo?void 0:eo.url)?"hide-top-border":""}`,liked:ew?!X:X,isReplied:el,isSaved:(null==D?void 0:D.bookmarked)||!1,onCommentClick:()=>ey(()=>{p?p():eb(e=>!e)}),onCommentCountClick:()=>{ey(()=>{ep?eb(!0):v?v():x||(window.location.href=ef)})},onShareClick:()=>{U(!0)},onLikeClick:()=>(0,o.a)(void 0,void 0,void 0,function*(){ey(()=>(0,o.a)(void 0,void 0,void 0,function*(){if(ei&&!ew){eE(!0);try{let e=yield(0,c.m)({id:ei,locale:es});(null==e?void 0:e.status)!==1?em((0,c.g)(eg)):A(e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked}))}catch(e){em((0,c.g)(eg))}eE(!1)}}))}),onSaveClick:()=>{ey(()=>(0,o.a)(void 0,void 0,void 0,function*(){if((null==ec?void 0:ec.id)&&(null==D?void 0:D.id)){if(null==D?void 0:D.bookmarked){let e=yield(0,h.e)((0,h.f)(y.yy.BOOKMARK.DELETE,{_locale:es}),"DELETE",{headers:{"Content-Type":"application/json"},data:{post_id:String(D.id)}});(null==e?void 0:e.status)===1?(em({title:"",message:eg("post.remove.success"),type:"success",displayIcon:F}),null==O||O()):em({title:"",message:eg("post.remove.failed"),type:"danger",displayIcon:F})}else{let e=yield(0,h.e)((0,h.f)(y.yy.BOOKMARK.CREATE,{_locale:es}),"POST",{headers:{"Content-Type":"application/json"},data:{user_id:ed||ec.id,post_id:D.id}});(null==e?void 0:e.status)===1?(em({title:"",message:eg("post.save.success"),type:"success",displayIcon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23595959'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e"}),null==O||O()):em({title:"",message:eg("post.save.failed"),type:"danger",displayIcon:F})}}}))},onGoToUrl:e=>{let t=e?`${ex}${e}`:ex;eh?window.location.href=t:ey(()=>window.location.href=t)},showingMostEngaging:!!(s&&(null==V?void 0:V.id)),isVertical:R}),ev&&r.createElement(c.I,{isMainCmt:!B,onClose:()=>eb(!1),onPostSuccess:e=>{0!==en||(null==V?void 0:V.id)||G(e),A(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0})),f&&f(e)},post:D}),s&&(null==V?void 0:V.id)?r.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{b?(e.stopPropagation(),b()):window.location.href=ef}},r.createElement(CardReply,{hasQuickBookingEnable:L,handleMakeAppointment:M,comment:V,post:D,onDeleteComment:()=>{onDeleteComment&&onDeleteComment(V)},className:"most-engaging-comment",type:"most-engaging",key:V.id,cardAuthorProps:_}),en>1&&!a&&r.createElement(n.B,{className:"see-more-comments",color:"ghost",size:"md"},eg("comment.seeMoreComments",{count:en-1}))):null,P))}},"8dOb":function(e,t,a){a.d(t,{B:function(){return BlueWhiteLogin},N:function(){return NavigationProfileButton},U:function(){return UserPlain},a:function(){return k},b:function(){return NavigationProvider},u:function(){return useCSSFocusPopupHelper}});var o=a("Kz+G"),r=a("q1tI"),n=a("nmRb"),i=a("/BCu"),l=a("H1c6"),s=a("VLju"),d=a("pMur"),c=a("FUIV"),p=a("kSP5"),u=a("iBNF"),m=a("rBCA"),h=a("JIuZ"),g=a("gEnE"),v=a("xXM3"),b=a.n(v),f=a("+7X0"),x=a("7m0Y"),y=a("bxxm"),w=a("xrdX"),E=a("QHxc"),C=a("hPj0");let BlueWhiteLogin=e=>r.createElement("svg",Object.assign({width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),r.createElement("rect",{y:"0.5",width:"31",height:"31",rx:"15.5",fill:"white"}),r.createElement("path",{d:"M15.4999 14.3797C16.9062 14.3797 18.0462 13.2397 18.0462 11.8334C18.0462 10.4271 16.9062 9.28711 15.4999 9.28711C14.0936 9.28711 12.9536 10.4271 12.9536 11.8334C12.9536 13.2397 14.0936 14.3797 15.4999 14.3797Z",stroke:"#2743AD",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{d:"M19.9092 22.0335C20.7055 21.7825 21.124 20.9029 20.786 20.1399C19.8879 18.1112 17.861 16.6946 15.4999 16.6946C13.1388 16.6946 11.112 18.1112 10.2138 20.1399C9.87585 20.9038 10.2944 21.7825 11.0907 22.0335C12.2249 22.3909 13.7258 22.7131 15.4999 22.7131C17.274 22.7131 18.7749 22.3909 19.9092 22.0335Z",stroke:"#2743AD",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})),UserPlain=e=>r.createElement("svg",Object.assign({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),r.createElement("path",{d:"M9.99991 8.3797C11.4062 8.3797 12.5462 7.23969 12.5462 5.83341C12.5462 4.42712 11.4062 3.28711 9.99991 3.28711C8.59363 3.28711 7.45361 4.42712 7.45361 5.83341C7.45361 7.23969 8.59363 8.3797 9.99991 8.3797Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{d:"M14.4092 16.0335C15.2055 15.7825 15.624 14.9029 15.286 14.1399C14.3879 12.1112 12.361 10.6946 9.99992 10.6946C7.63881 10.6946 5.61196 12.1112 4.71381 14.1399C4.37585 14.9038 4.79436 15.7825 5.59066 16.0335C6.72492 16.3909 8.22584 16.7131 9.99992 16.7131C11.774 16.7131 13.2749 16.3909 14.4092 16.0335Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})),useNavConfig=({locale:e,projectType:t,siteType:a,enableBookingBtn:o})=>{let n=(0,r.useMemo)(()=>{let r="discover"===t||"together"===t||"marryBaby"===t||"profile"===t&&"marryBaby"===a,n="marryBaby"!==a&&"marryBaby"!==t&&f.C.includes(e),i=o&&"marryBaby"!==t&&"discover"===t&&"marryBaby"!==a&&f.d.includes(e),l="marryBaby"===t||f.c.includes(e),s="marryBaby"!==a&&f.E.includes(e),d="marryBaby"!==a&&f.E.includes(e),c=f.V.includes(e),p=f.H.includes(e),u=f.e.includes(e),m=(0,y.g)(e,"marryBaby"===a),h=m;"undefined"!=typeof window&&(h.includes("//id.")&&(h=h.replace("id.","")),h.includes("//staging-id.")&&(h=h.replace("staging-id.","discover.")));let g=(0,y.a)(e,"marryBaby"===a),v={HOME_PAGE_URL:h,CARE_URL_FE:`${h}/care`,TOGETHER_URL_FE:`${h}/community`,VIDEO_URL_FE:`${h}/videos`,SSO_URL:g,TOGETHER_API:(0,y.b)(),DISCOVER_API:(0,y.c)(e)};return{enableSearchBar:r,enableNavCare:n,enableNavCareBooking:i,enableNavTogether:l,enableNavEcom:s,enableProfileEcom:d,enableNavVideo:c,enableProfileMyHealth:!0,enableNavDiscover:!0,enableNavHealthTools:!0,enableProfileMySaved:!0,statics:v,enableNavClinityDownload:p,enableNavCartCare:u}},[]);return n},k=r.createContext({}),NavigationProvider=e=>{var{children:t}=e,a=(0,o._)(e,["children"]);let[n,i]=r.useState(()=>a.currentUrl||`https://${"marryBaby"===a.siteType?x.d[a.locale||"en-PH"]:w.v[a.locale||"en-PH"]}${"together"===a.projectType?"/community":"ecom"===a.projectType?"/ecom":"care"===a.projectType?"/care":""}/`);(0,r.useEffect)(()=>{let update=()=>{i(window.location.href)};return window.addEventListener("popstate",update),update(),()=>{window.removeEventListener("popstate",update)}},[]);let l=useNavConfig({locale:a.locale,projectType:a.projectType,siteType:a.siteType,enableBookingBtn:a.enableBookingBtn});return r.createElement(k.Provider,{value:Object.assign(Object.assign({},a),{customClasses:a.customClasses||{},configs:Object.assign(Object.assign({},l),a.configs),currentUrl:a.currentUrl||n})},t)},useCSSFocusPopupHelper=e=>{let{allowBgScroll:t}=e||{},a=(0,r.useRef)();return{containerRef:a,onContainerFocus:()=>{t||(document.documentElement.style.overflow="hidden")},onContainerBlur:()=>{t||(document.documentElement.style.overflow="")},onButtonMouseDown:e=>{a.current&&(document.activeElement===a.current||a.current.contains(document.activeElement))&&(a.current.blur(),document.activeElement.blur(),e.preventDefault())},onClose:()=>{a.current&&(document.activeElement===a.current||a.current.contains(document.activeElement))&&(a.current.blur(),document.activeElement.blur())}}},S=(0,g.Z)(m.Z.div` position: absolute; right: 0; transition: all 0.5s ease-in-out; overflow-y: auto; &[data-open='true'] { z-index: 200; top: 120%; opacity: 1; visibility: visible; } &[data-open='false'] { display: none; } .popup-content { z-index: 111; height: 100%; border: 1px solid #0000001a; border-radius: 16px; border-top-left-radius: 0; border-top-right-radius: 0; } /* min-height: 415px; */ ${h.M.mbUp} { width: 320px; } ${h.M.mbDown} { position: fixed; left: 0; width: 100%; padding-bottom: 70px; } `,"hhgcomp-navprofilebutton-popup"),$=(0,g.Z)(m.Z.div` position: fixed; z-index: 150; top: var(--header-bottom, 56px); left: 0; width: 100%; height: 100%; align-items: center; ${h.M.mbUp} { background-color: transparent; &[data-type='welcome'] { background: rgba(38, 38, 38, 0.3); } &[data-type='due-date'] { background: rgba(38, 38, 38, 0.3); } } ${h.M.mbDown} { background: rgba(38, 38, 38, 0.3); } &[data-type='welcome'] { top: 0; } &[data-open='false'] { display: none; } `,"hhgcomp-navprofilebutton-popupwrapper"),I=m.Z.div` width: 36px; height: 36px; cursor: pointer; img { border-radius: 50%; } .avatar { width: 36px; height: 36px; object-fit: cover; } .avatar-default { display: flex; align-items: center; justify-content: center; background-color: ${u.r.colors.secondaryBase}; border-radius: 50%; color: white; font-size: 20px; font-weight: bold; } `,z=m.Z.div` display: inline-flex; position: relative; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; text-decoration: none; flex-shrink: 0; cursor: pointer; .user-close-icon { display: none; } &:focus-within { .user-close-icon { display: block; } .user-avatar { display: none; } ${S.classSelector} { z-index: 200; top: 120%; opacity: 1; visibility: visible; display: initial; ${h.M.mbDown} { top: 100%; } } ${$.classSelector} { display: initial; } } `,N=m.Z.a` display: inline-flex; .login-btn[data-color='tertiary'][data-size='md'] { padding-left: 12px; padding-right: 12px; } .mobile-only { ${h.M.mbUp} { display: none; } } .login-btn { display: none; ${h.M.mbUp} { display: block; border: 1px solid ${u.r.colors.neutral100}; } } &[data-win-cash-back-theme='true'] { .login-btn { ${h.M.mbUp} { color: ${u.r.colors.white}; } } } `,ProfilePopup=({isOpen:e,userInfo:t,closePopup:a,siteType:o="helloSites",dispatchLogout:n})=>{let{customClasses:i={},configs:{enableProfileFindMyBooking:l}}=(0,r.useContext)(k);return r.createElement(S,{className:i.profilePopup,"data-open":e},r.createElement("div",{className:b()("popup-content",i.profilePopupContent)},r.createElement(E.l,{siteType:o,onLogout:()=>{n&&(n(),a())},userInfo:t,configs:{enableProfileFindMyBooking:l}})))},NavigationProfileButton=({userInfo:e,siteType:t,onLoginClick:a,currentUrl:m,isMinifyLogin:h,onLogout:g,style:v,isLoading:b,isMobile:f,className:x})=>{let{isWinCashBackTheme:y}=(0,r.useContext)(k),{t:w}=(0,c.u)(),[E,S]=(0,r.useState)(!1),$=(null==e?void 0:e.name)||(null==e?void 0:e.username),{containerRef:T,onContainerFocus:j,onContainerBlur:B,onButtonMouseDown:P,onClose:L}=useCSSFocusPopupHelper(),M=(0,r.useMemo)(()=>Object.assign(Object.assign({},v),{pointerEvents:"auto"}),[v]),O=(0,r.useMemo)(()=>f&&"helloSites"===t,[f,t]);return b?O?r.createElement(i.S,null):r.createElement(s.B,{size:"sm",color:"transparent",loading:!0}):(null==e?void 0:e.id)?r.createElement(r.Fragment,null,r.createElement(z,{ref:T,style:M,tabIndex:0,onBlur:B,onFocus:()=>{var e;j();let t=null===(e=T.current)||void 0===e?void 0:e.querySelector("#navigation-v2 .hhgcomp-navprofilebutton-popup");if(t){let e=t.getBoundingClientRect(),a=e.top,o=`calc(100vh - ${a}px)`;t.setAttribute("style",`max-height: ${o};`)}},className:x},r.createElement("div",{onMouseDown:P},r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"user-close-icon"},r.createElement("path",{d:"M18 6L6 18M18 18L6 6",stroke:"#3E3F58",strokeWidth:"1.3",strokeLinecap:"round"})),r.createElement(l.A,{size:32,className:"user-avatar",src:null==e?void 0:e.avatar,color:"marryBaby"===t?u.r.mbColors.pink:u.r.colors.secondaryBase,placeholderText:$&&$.length?$[0].toUpperCase():"A"})),r.createElement(ProfilePopup,{dispatchLogout:()=>{L(),S(!0)},isOpen:!1,closePopup:L,siteType:t,userInfo:e})),r.createElement(C.F,{openLogoutPopup:E,onCloseHandler:()=>{document.body.classList.toggle("noscroll",!1),S(!1)},siteType:t,onLogoutHandler:()=>(0,o.a)(void 0,void 0,void 0,function*(){S(!1),document.body.classList.toggle("noscroll",!1),yield g()})})):r.createElement(N,{style:Object.assign({textDecoration:"none"},M),"data-event-category":"Sign Up","data-event-action":"Button Click","data-event-label":m,"data-win-cash-back-theme":y,"data-site-type":t,onClick:a},h?r.createElement(I,null,r.createElement("img",{src:p.C.getAssetPath("lock.png"),className:"avatar",loading:"lazy",alt:"avatar"})):r.createElement(r.Fragment,null,"helloSites"===t&&(O?y?r.createElement(BlueWhiteLogin,{className:"mobile-only",style:{cursor:"pointer",width:32,height:32,flexShrink:0}}):r.createElement("img",{className:"mobile-only",src:p.C.getAssetPath("login.svg"),style:{cursor:"pointer",height:24,width:24}}):r.createElement(s.B,{className:"mobile-only",size:"sm",leftIcon:r.createElement(n.Z,{color:"currentColor",isSolid:!0,size:22}),sx:{paddingLeft:"8px",paddingRight:"12px"},styles:{leftIcon:{marginRight:4}}},w("navigation.loginJoin"))),"marryBaby"===t&&r.createElement("div",{className:"mobile-only",style:{paddingLeft:16}},r.createElement(d.T,{size:"p3",color:u.r.mbColors.pink},w("navigation.loginJoin"))),"marryBaby"===t?r.createElement(s.B,{className:"login-btn",size:"md",leftIcon:r.createElement(n.Z,{color:"currentColor",isSolid:!0,size:22})},w("navigation.loginJoin")):r.createElement(s.B,{className:"login-btn",size:"md",leftIcon:y?r.createElement(UserPlain,{style:{flexShrink:0,width:20,height:20}}):r.createElement(n.Z,{color:"#595959",isSolid:!0,size:22}),variant:"ghost",color:"#262626",sx:{fontWeight:500,fontSize:14,lineHeight:22}},w("navigation.loginJoin"))))}},KVxG:function(e,t,a){a.d(t,{D:function(){return DrawerBottom}});var o=a("Kz+G"),r=a("q1tI"),n=a("iuhU"),i=a("h8tX"),l=a("l6P8"),s=a("rSBk"),d=a("rBCA"),c=a("iBNF"),p=a("+7X0");(0,d.Z)(l.D)` /* max-height: 100vh; max-height: 100dvh; */ background-color: white; &[data-vaul-drawer-direction='bottom'] { top: initial !important; border-top-left-radius: 16px !important; border-top-right-radius: 16px !important; padding-bottom: 32px; padding-left: 20px; padding-right: 20px; } .drawer__handle { width: 44px; height: 3px; background-color: ${c.r.colors.neutral500}; margin: 16px auto; flex-shrink: 0; } `;let u=(0,d.Z)(s.dy.Content)` position: fixed; z-index: ${p.Z-9e6+1}; inset: 0; background-color: #fff; outline: none !important; &[data-is-linear='true'] { background: linear-gradient(180deg, #c3e3ff 1.86%, #fff 20%) !important; } &::-webkit-scrollbar { width: 6px; height: 6px; } &::-webkit-scrollbar-track { background-color: transparent; } &::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.4); border-radius: 6px; } &[data-vaul-drawer-direction='bottom'] { top: initial; border-top-left-radius: 16px; border-top-right-radius: 16px; /* padding-bottom: 16px; */ } ${e=>e.isDragging&&` input { caret-color: transparent; } `} `,m=(0,d.Z)(s.dy.Overlay)` position: fixed; inset: 0; z-index: ${p.Z-9e6}; width: 100%; max-height: 100%; background-color: rgb(0, 0, 0, 0.4); `,h=(0,d.Z)(s.dy.Handle)` &[data-vaul-handle] { width: 44px; height: 3px; background-color: ${c.r.colors.neutral500}; margin: 16px auto; flex-shrink: 0; } `;function DrawerBottom(e){var{children:t,onClose:a,isOpen:d,onOpenChange:c,isMobile:p,classNames:g,isLinear:v,overlayClassName:b,contentClassName:f,handlerClassName:x,drawerOverlayProps:y}=e,w=(0,o._)(e,["children","onClose","isOpen","onOpenChange","isMobile","classNames","isLinear","overlayClassName","contentClassName","handlerClassName","drawerOverlayProps"]);let{isDragging:E,handleDragStart:C,handleDragEnd:k}=(0,l.u)(),{onDrag:S,onRelease:$}=w,I=(0,o._)(w,["onDrag","onRelease"]);return p?r.createElement(s.dy.Root,Object.assign({},I,{open:d,onOpenChange:c,onClose:a,onDrag:(e,t)=>{C(),null==S||S(e,t)},onRelease:(e,t)=>{k(),null==$||$(e,t)}}),r.createElement(s.dy.Portal,null,r.createElement(m,Object.assign({className:(0,n.default)(b,"drawer__overlay")},y)),r.createElement(u,{isDragging:E,className:(0,n.default)(f,"drawer__content"),"data-is-linear":v},r.createElement(s.dy.Title,{style:{display:"none"}}),r.createElement(h,{className:(0,n.default)(x,"drawer__handle")}),t))):r.createElement(i.u,Object.assign({withCloseButton:!0,centered:!0,zIndex:500,size:"auto",classNames:g,radius:"lg"},w,{onClose:a,opened:d,styles:{root:{maxHeight:"400px"},body:{background:v?"linear-gradient(180deg, #A5D4FF 0%, #FFFFFF 20%)":void 0}}}),t)}},aQHZ:function(e,t,a){a.d(t,{D:function(){return Divider}});var o=a("q1tI"),r=a("rBCA"),n=a("iBNF");let i=r.Z.hr` border-width: 1px; border-color: ${n.r.colors.neutral200}; border-style: ${e=>e.dividerType}; `,Divider=({type:e="solid",className:t,style:a})=>o.createElement(i,{style:a,className:t,"data-diver-type":e,dividerType:e})},TUlc:function(e,t,a){a.d(t,{C:function(){return CartCareButton},S:function(){return ShoppingCartCare}});var o=a("q1tI"),r=a("xXM3"),n=a.n(r),i=a("rBCA"),l=a("Eso5"),s=a("iBNF"),d=a("JIuZ"),c=a("FUIV"),p=a("pMur");let ShoppingCartCare=e=>o.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none"},e),o.createElement("path",{d:"M1.94434 1.94434L3.44545 2.31989C3.88211 2.42878 4.20989 2.791 4.27545 3.23656L5.55656 11.9454",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{d:"M16.9444 14.7218H4.99997C4.23331 14.7218 3.61108 14.0996 3.61108 13.3329C3.61108 12.5662 4.23331 11.944 4.99997 11.944H14.4766C14.9544 11.944 15.38 11.6385 15.5311 11.184L17.0122 6.73957C17.2522 6.01957 16.7166 5.27734 15.9578 5.27734H4.57553",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{d:"M4.16648 18.8891C4.93354 18.8891 5.55537 18.2673 5.55537 17.5002C5.55537 16.7332 4.93354 16.1113 4.16648 16.1113C3.39941 16.1113 2.77759 16.7332 2.77759 17.5002C2.77759 18.2673 3.39941 18.8891 4.16648 18.8891Z",fill:"currentColor"}),o.createElement("path",{d:"M15.8332 18.8891C16.6003 18.8891 17.2221 18.2673 17.2221 17.5002C17.2221 16.7332 16.6003 16.1113 15.8332 16.1113C15.0662 16.1113 14.4443 16.7332 14.4443 17.5002C14.4443 18.2673 15.0662 18.8891 15.8332 18.8891Z",fill:"currentColor"})),u=(0,i.Z)(l.x)` display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #ffffff33; position: relative; flex-shrink: 0; cursor: pointer; /* Desktop: Square layout */ border-radius: 28px; max-height: 40px; padding: 9px 1rem; background-color: inherit; white-space: nowrap; .cart-care-icon { width: 20px; height: 20px; color: ${s.r.colors.white}; flex-shrink: 0; } .cart-care-button-text { display: block; font-size: 14px; font-weight: 500; line-height: 22px; } /* Mobile: Circle layout */ ${d.M.mbDown} { border-radius: 100%; aspect-ratio: 1/1; width: 32px; height: 32px; padding: auto; background-color: ${s.r.colors.white}; max-height: none; padding: 0; .cart-care-icon { width: 20px; height: 20px; color: ${s.r.colors.blue900}; flex-shrink: 0; } .cart-care-button-text { display: none; } } `,m=(0,i.Z)(l.x)` min-width: 20px; min-height: 20px; aspect-ratio: 1/1; border-radius: 100%; background-color: ${s.r.colors.red500}; color: ${s.r.colors.white}; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: absolute; top: -4px; right: -4px; ${d.M.mbDown} { top: -8px; right: -8px; } `,CartCareButton=e=>{let{count:t=0,href:a,classes:r,boxProps:i,anchorProps:l,tracking:d}=e,{t:h}=(0,c.u)();return o.createElement("a",Object.assign({className:n()("cart-care-button"),href:a,"data-testid":"cart-care-button","data-event-category":"Hamburger Navigation","data-event-action":"Cart Click","data-event-label":a},d,l),o.createElement(u,Object.assign({className:n()("cart-care-button-box",null==r?void 0:r.box)},i),o.createElement(ShoppingCartCare,{className:"cart-care-icon"}),o.createElement(p.T,{size:"label1",color:s.r.colors.white,fw:500,className:"cart-care-button-text"},h("navigation.button.cartCareService")),t>0&&o.createElement(m,{className:n()("cart-care-button-count-box",null==r?void 0:r.count)},o.createElement(p.T,{size:t>99?"label2":"c1",color:s.r.colors.white,fw:600,className:"cart-care-button-count-text"},t>99?"99+":t))))}},YXre:function(e,t,a){a.d(t,{C:function(){return n},F:function(){return i},G:function(){return GlobalTextStyleNew},T:function(){return TemplateProvider},a:function(){return d},u:function(){return useTemplateVariant}});var o,r,n,i,l=a("mYVa"),s=a("q1tI");(o=n||(n={})).LEADGEN="leadgen",o.NONE="none",(r=i||(i={}))[r.regular=400]="regular",r[r.halfBold=500]="halfBold",r[r.semiBold=600]="semiBold",r[r.bold=700]="bold";let d={[n.NONE]:{fontSize:{base:[(0,l.h)(16),(0,l.h)(16)],lg:[(0,l.h)(18),(0,l.h)(16)],md:[(0,l.h)(18),(0,l.h)(16)],sm:[(0,l.h)(16),(0,l.h)(14)],xs:[(0,l.h)(14),(0,l.h)(12)],s1:[(0,l.h)(22),(0,l.h)(18)],s2:[(0,l.h)(18),(0,l.h)(16)],s3:[(0,l.h)(16),(0,l.h)(14)],s4:[(0,l.h)(14),(0,l.h)(12)],s5:[(0,l.h)(12),(0,l.h)(12)],p1:[(0,l.h)(18),(0,l.h)(16)],p2:[(0,l.h)(16),(0,l.h)(16)],p3:[(0,l.h)(16),(0,l.h)(14)],p4:[(0,l.h)(14),(0,l.h)(12)],p5:[(0,l.h)(12),(0,l.h)(12)],c1:[(0,l.h)(16),(0,l.h)(14)],c2:[(0,l.h)(14),(0,l.h)(12)],n1:[(0,l.h)(12),(0,l.h)(12)],label1:[(0,l.h)(14),(0,l.h)(14)],label2:[(0,l.h)(12),(0,l.h)(12)],h1:[(0,l.h)(40),(0,l.h)(26)],h2:[(0,l.h)(32),(0,l.h)(24)],h3:[(0,l.h)(26),(0,l.h)(20)],h4:[(0,l.h)(22),(0,l.h)(18)],h5:[(0,l.h)(18),(0,l.h)(16)],h5New:[(0,l.h)(20),(0,l.h)(18)],h6:[(0,l.h)(16),(0,l.h)(14)],title1:[(0,l.h)(17),(0,l.h)(17)],title2:[(0,l.h)(15),(0,l.h)(15)],body2:[(0,l.h)(15),(0,l.h)(15)]},lineHeight:{base:[(0,l.h)(24),(0,l.h)(24)],lg:[(0,l.h)(32),(0,l.h)(28)],md:[(0,l.h)(32),(0,l.h)(28)],sm:[(0,l.h)(24),(0,l.h)(22)],xs:[(0,l.h)(24),(0,l.h)(18)],s1:[(0,l.h)(32),(0,l.h)(26)],s2:[(0,l.h)(28),(0,l.h)(24)],s3:[(0,l.h)(24),(0,l.h)(24)],s4:[(0,l.h)(22),(0,l.h)(18)],s5:[(0,l.h)(18),(0,l.h)(18)],p1:[(0,l.h)(28),(0,l.h)(28)],p2:[(0,l.h)(24),(0,l.h)(24)],p3:[(0,l.h)(24),(0,l.h)(22)],p4:[(0,l.h)(22),(0,l.h)(18)],c1:[(0,l.h)(24),(0,l.h)(22)],c2:[(0,l.h)(22),(0,l.h)(18)],n1:[(0,l.h)(18),(0,l.h)(18)],label1:[(0,l.h)(22),(0,l.h)(22)],label2:[(0,l.h)(18),(0,l.h)(18)],h1:[(0,l.h)(52),(0,l.h)(34)],h2:[(0,l.h)(42),(0,l.h)(32)],h3:[(0,l.h)(36),(0,l.h)(26)],h4:[(0,l.h)(32),(0,l.h)(26)],h5:[(0,l.h)(28),(0,l.h)(24)],h5New:[(0,l.h)(28),(0,l.h)(24)],h6:[(0,l.h)(24),(0,l.h)(22)],title1:[(0,l.h)(24),(0,l.h)(24)],title2:[(0,l.h)(24),(0,l.h)(24)],body2:[(0,l.h)(24),(0,l.h)(24)]},letterSpacing:{lg:[-.2,0],md:[-.2,0],sm:[0,-.2],s1:[-.6,-.6],s2:[-.4,-.2],s3:[0,-.2],s4:[0,-.2],p1:[-.2,-.2],p2:[0,-.2],p3:[0,-.2],p4:[-.2,0],label1:[0,-.2],h1:[-1.2,-.9],h2:[-1,-.8],h3:[-.8,-.7],h4:[-.6,-.6],h5:[-.2,-.2],h5New:[-.4,-.4],h6:[0,-.2],title1:[-.4,-.4],title2:[-.3,-.3],body2:[-.3,-.3]},fontWeightBySize:{s1:i.semiBold,s2:i.semiBold,s3:i.semiBold,s4:i.semiBold,h1:i.bold,h2:i.bold,h3:i.bold,h4:i.bold,h5:i.bold,h5New:i.semiBold,h6:i.bold},fontWeight:i},[n.LEADGEN]:{fontSize:{base:[(0,l.h)(16),(0,l.h)(16)],lg:[(0,l.h)(18),(0,l.h)(16)],md:[(0,l.h)(18),(0,l.h)(16)],sm:[(0,l.h)(16),(0,l.h)(14)],xs:[(0,l.h)(14),(0,l.h)(12)],s1:[(0,l.h)(22),(0,l.h)(18)],s2:[(0,l.h)(18),(0,l.h)(16)],s3:[(0,l.h)(16),(0,l.h)(14)],s4:[(0,l.h)(14),(0,l.h)(12)],s5:[(0,l.h)(12),(0,l.h)(12)],p1:[(0,l.h)(17),(0,l.h)(17)],p2:[(0,l.h)(15),(0,l.h)(15)],p3:[(0,l.h)(13),(0,l.h)(13)],p4:[(0,l.h)(14),(0,l.h)(12)],p5:[(0,l.h)(12),(0,l.h)(12)],c1:[(0,l.h)(12),(0,l.h)(12)],c2:[(0,l.h)(11),(0,l.h)(11)],n1:[(0,l.h)(12),(0,l.h)(12)],label1:[(0,l.h)(14),(0,l.h)(14)],label2:[(0,l.h)(12),(0,l.h)(12)],h1:[(0,l.h)(40),(0,l.h)(26)],h2:[(0,l.h)(32),(0,l.h)(24)],h3:[(0,l.h)(26),(0,l.h)(22)],h4:[(0,l.h)(22),(0,l.h)(20)],h5:[(0,l.h)(18),(0,l.h)(16)],h5New:[(0,l.h)(20),(0,l.h)(18)],h6:[(0,l.h)(16),(0,l.h)(14)],title1:[(0,l.h)(17),(0,l.h)(17)],title2:[(0,l.h)(15),(0,l.h)(15)],body2:[(0,l.h)(15),(0,l.h)(15)],overline:[(0,l.h)(11),(0,l.h)(11)],subText:[(0,l.h)(10),(0,l.h)(10)]},lineHeight:{base:[(0,l.h)(24),(0,l.h)(24)],lg:[(0,l.h)(32),(0,l.h)(28)],md:[(0,l.h)(32),(0,l.h)(28)],sm:[(0,l.h)(24),(0,l.h)(22)],xs:[(0,l.h)(24),(0,l.h)(18)],s1:[(0,l.h)(32),(0,l.h)(26)],s2:[(0,l.h)(28),(0,l.h)(24)],s3:[(0,l.h)(24),(0,l.h)(24)],s4:[(0,l.h)(22),(0,l.h)(18)],s5:[(0,l.h)(18),(0,l.h)(18)],p1:[(0,l.h)(28),(0,l.h)(28)],p2:[(0,l.h)(24),(0,l.h)(24)],p3:[(0,l.h)(20),(0,l.h)(20)],p4:[(0,l.h)(22),(0,l.h)(18)],c1:[(0,l.h)(16),(0,l.h)(16)],c2:[(0,l.h)(22),(0,l.h)(18)],n1:[(0,l.h)(18),(0,l.h)(18)],label1:[(0,l.h)(22),(0,l.h)(22)],label2:[(0,l.h)(18),(0,l.h)(18)],h1:[(0,l.h)(48),(0,l.h)(34)],h2:[(0,l.h)(40),(0,l.h)(32)],h3:[(0,l.h)(32),(0,l.h)(32)],h4:[(0,l.h)(32),(0,l.h)(28)],h5:[(0,l.h)(28),(0,l.h)(24)],h5New:[(0,l.h)(28),(0,l.h)(24)],h6:[(0,l.h)(24),(0,l.h)(22)],title1:[(0,l.h)(24),(0,l.h)(24)],title2:[(0,l.h)(24),(0,l.h)(24)],body2:[(0,l.h)(24),(0,l.h)(24)],overline:[(0,l.h)(12),(0,l.h)(12)],subText:[(0,l.h)(12),(0,l.h)(12)]},letterSpacing:{lg:[-.2,0],md:[-.2,0],sm:[0,-.2],s1:[-.6,-.6],s2:[-.4,-.2],s3:[0,-.2],s4:[0,-.2],p1:[-.4,-.4],p2:[-.3,-.3],p3:[-.3,-.3],p4:[-.2,0],c1:[-.2,-.2],c2:[-.2,-.2],label1:[0,-.2],h1:[-1.2,-.9],h2:[-1,-.8],h3:[-.6,-.6],h4:[-.6,-.4],h5:[-.2,-.2],h5New:[-.4,-.4],h6:[0,-.2],n1:[-.2,-.2],title1:[-.4,-.4],title2:[-.3,-.3],body2:[-.3,-.3],overline:[-.2,-.2],subText:[-.2,-.2]},fontWeightBySize:{s1:i.semiBold,s2:i.semiBold,s3:i.semiBold,s4:i.semiBold,h1:i.bold,h2:i.bold,h3:i.bold,h4:i.bold,h5:i.bold,h5New:i.semiBold,h6:i.bold},fontWeight:i}},GlobalTextStyleNew=e=>({[n.LEADGEN]:{h1:{fontSize:(0,l.h)(40),lineHeight:(0,l.h)(48),letterSpacing:"-1.2px",[e.fn.smallerThan("sm")]:{fontSize:(0,l.h)(26),lineHeight:(0,l.h)(32),letterSpacing:"-0.6px"}},h2:{fontSize:(0,l.h)(32),lineHeight:(0,l.h)(40),letterSpacing:"-1px",[e.fn.smallerThan("sm")]:{fontSize:(0,l.h)(20),lineHeight:(0,l.h)(28),letterSpacing:"-0.4px"}},h3:{fontSize:(0,l.h)(26),lineHeight:(0,l.h)(32),letterSpacing:"-0.6px",[e.fn.smallerThan("sm")]:{fontSize:(0,l.h)(20),lineHeight:(0,l.h)(28),letterSpacing:"-0.4px"}},p1:{fontSize:(0,l.h)(17),lineHeight:(0,l.h)(28),letterSpacing:"-0.4px"},p2:{fontSize:(0,l.h)(15),lineHeight:(0,l.h)(24),letterSpacing:"-0.3px"}}}),c=(0,s.createContext)(n.NONE),TemplateProvider=({variant:e=n.NONE,children:t})=>s.createElement(c.Provider,{value:e},t),useTemplateVariant=()=>(0,s.useContext)(c)},"diY+":function(e,t,a){a.d(t,{A:function(){return Avatar},D:function(){return DistanceTag},I:function(){return IconWrapper},P:function(){return Pin3},S:function(){return ShapedArrowDown}});var o=a("q1tI"),r=a("rBCA"),n=a("iBNF"),i=a("kuQP"),l=a("pMur");let Pin3=e=>o.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"none"},e),o.createElement("g",{clipPath:"url(#clip0_5371_10640)"},o.createElement("path",{d:"M6.6665 4.3335L8.1665 5.8335L6.6665 7.3335",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{d:"M8.16667 5.8335H5.83333C5.09667 5.8335 4.5 6.43016 4.5 7.16683V7.50016",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{d:"M6.94331 10.3902L10.3907 6.94281C10.9114 6.42211 10.9114 5.57789 10.3907 5.05719L6.94331 1.60981C6.42261 1.08911 5.57839 1.08911 5.05769 1.60981L1.61031 5.05719C1.08961 5.57789 1.08961 6.42211 1.61031 6.94281L5.05769 10.3902C5.57839 10.9109 6.42261 10.9109 6.94331 10.3902Z",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"})),o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_5371_10640"},o.createElement("rect",{width:12,height:12,fill:"white"})))),ShapedArrowDown=e=>o.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none"},e),o.createElement("path",{d:"M13.5554 9.33398L7.99989 5.55621L2.44434 9.33398",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),s=r.Z.div` background-color: var(--background-color, transparent); color: white; cursor: pointer; img { --width: var(--width-prop, 40px); --height: var(--height-prop, 40px); width: var(--width); height: var(--height); } &[data-has-max='true'] { img { max-width: var(--width); max-height: var(--height); } } &[data-avatar-type='square'] { img { --width: var(--width-prop, 72px); --height: var(--height-prop, 72px); border-radius: ${n.r.borderRadius}; } } &[data-avatar-type='rounded'] { img { border-radius: 50%; } } &[data-custom-size='true'] { display: flex; overflow: hidden; overflow: hidden; width: var(--size); height: var(--size); align-items: center; justify-content: center; background-size: cover; font-size: calc(var(--size) / 2); font-weight: bold; &[data-avatar-type='square'] { border-radius: ${n.r.borderRadius}; } &[data-avatar-type='rounded'] { border-radius: 50%; img { --width: 100%; --height: 100%; } } img { object-fit: cover; } } `,d={xs:28,small:32,medium:40,large:48,xl:64,xxl:80,xxxl:96},Avatar=({type:e="square",size:t,avatarImg:a,avatarUrl:r,firstLetter:n,backgroundColor:l,onClick:c,style:p,className:u,width:m,height:h,alt:g})=>{let v=t?d[t]:void 0,[b,f]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(r){let e=document.createElement("img");e.setAttribute("src",r),e.addEventListener("error",()=>{f(!0)})}},[r,f]);let x=(!r&&!a||b)&&n;return o.createElement(s,{style:Object.assign(Object.assign({},p),{"--size":v?v+"px":void 0,"--width-prop":m?m+"px":void 0,"--height-prop":h?h+"px":void 0,"--background-color":l}),"data-has-max":!!(m&&h),"data-avatar-type":e,onClick:c,className:u,avatarUrl:r,"data-custom-size":!!t},a,r&&!b&&o.createElement(i.I,{src:r,alt:g||"avatar"}),x&&n)},c=r.Z.div` display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; color: ${n.r.colors.red700}; border-radius: 8px; border: 1px solid ${n.r.colors.neutral100}; font-size: 0.6875rem; line-height: 1rem; border-radius: 0.5rem; `,p=(0,r.Z)(Pin3)` width: 0.75rem; height: 0.75rem; color: ${n.r.colors.gray400}; `;function DistanceTag({value:e,className:t}){return o.createElement(c,{className:t},o.createElement(p,null),o.createElement(l.T,{size:"p3",weight:"regular",color:n.r.colors.gray400},e))}let u=r.Z.div` display: inline-flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; width: calc(var(--wrapper-size, var(--icon-size)) * 1px); height: calc(var(--wrapper-size, var(--icon-size)) * 1px); &[data-clickable='true'] { cursor: pointer; } > * { width: calc(var(--icon-size) * 1px); height: calc(var(--icon-size) * 1px); } &[data-svg-custom-stroke='true'] > svg * { stroke: var(--icon-stroke-color); } &[data-svg-custom-fill='true'] > svg * { fill: var(--icon-fill-color); } `,IconWrapper=({children:e,className:t,onClick:a,wrapperSize:r,iconSize:n=24,wrapperStyle:i,iconStyle:l,svgIcon:s,wrapperProps:d})=>o.createElement(u,Object.assign({className:t,onClick:a,style:Object.assign(Object.assign(Object.assign(Object.assign({},r&&{"--wrapper-size":r}),n&&{"--icon-size":n}),s&&Object.assign(Object.assign({},s.fill&&{"--icon-fill-color":s.fill}),s.stroke&&{"--icon-stroke-color":s.stroke})),i),"data-clickable":!!a,"data-svg-custom-stroke":!!(null==s?void 0:s.stroke),"data-svg-custom-fill":!!(null==s?void 0:s.fill)},d),o.cloneElement(e,{style:l}))},sO5b:function(e,t,a){a.d(t,{G:function(){return GenderOptionControl}});var o=a("Kz+G"),r=a("q1tI"),n=a("OyPk"),i=a("XHvu"),l=a("/npG"),s=a("mYVa"),d=a("Eso5"),c=a("SPK5"),p=a("H1c6"),u=a("kSP5"),m=a("pMur"),h=a("FUIV");let g={lg:{height:48},md:{height:40},sm:{height:32},xs:{height:32}};var v=(0,l.k)((e,{type:t,gap:a,size:o})=>{let r="mb"===e.other.template,n=g[o]||{},i=n.height;return{root:{},wrapper:Object.assign({gap:(0,s.h)(a||8)},"radio"===t&&{justifyContent:"flex-end",gap:(0,s.h)(a||24)}),groupErr:{fontSize:(0,s.h)(14)},itemRoot:Object.assign({},"button"===t?{flexGrow:1,width:"50%",'&[data-checked="true"]':{".mantine-Radio-label":{borderColor:e.fn.primaryColor()}}}:"radio"===t?{padding:`${(0,s.h)(10)} 0`,margin:0}:{}),itemLabelWrapper:{padding:0,width:"100%"},itemLabel:Object.assign({whiteSpace:"nowrap"},"button"===t?{position:"relative",padding:`${(0,s.h)(2)} ${(0,s.h)(16)}`,border:`1px solid ${r?"#EAEAEC":e.colors.gray[2]}`,backgroundColor:"#fff",borderRadius:(0,s.h)(r?16:4),cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",height:i,'&[data-disabled="true"]':{background:e.colors.gray[1],color:`${e.colors.gray[4]} !important`,img:{opacity:.5}},img:{height:(0,s.h)("lg"===o?26:22)}}:"radio"===t?{fontSize:(0,s.h)(14)}:{}),itemInner:Object.assign(Object.assign({},"button"===t&&{display:"none"}),"radio"===t&&{alignSelf:"center"}),itemBody:Object.assign({},"radio"===t&&{alignItems:"center"})}});let GenderOptionControl=e=>{var{label:t,availableValue:a,styles:l,isBaby:g,genderValue:b={male:"male",female:"female"},type:f="button",hideLabel:x,labelTextProps:y,labelText:w,gap:E,size:C="md",LabelWrapper:k}=e,S=(0,o._)(e,["label","availableValue","styles","isBaby","genderValue","type","hideLabel","labelTextProps","labelText","gap","size","LabelWrapper"]);let{t:$}=(0,h.u)(),{classes:I,cx:z,theme:N}=v({type:f,gap:E,size:C},{name:"GenderOptionControl",styles:l}),T="mb"===N.other.template,[j,B]=(0,r.useState)(),P=(0,r.useRef)(null),L=k?{}:Object.assign({as:"label",size:"p2",weight:"semiBold",variant:"primary"},y),M=k||m.T,O=(0,r.useMemo)(()=>[{value:b.male,label:g?$("gender.boy"):$("gender.male"),icon:g?T?r.createElement(n.Z,null):u.C.getAssetPath("health-tools/boy-icon.svg"):u.C.getAssetPath("health-tools/male-icon.svg")},{value:b.female,label:g?$("gender.girl"):$("gender.female"),icon:g?T?r.createElement(i.Z,null):u.C.getAssetPath("health-tools/girl-icon.svg"):u.C.getAssetPath("health-tools/female-icon.svg")}],[]);return(0,r.useEffect)(()=>{B(a)},[a]),r.createElement(d.x,{ref:P,className:I.root},r.createElement(p.R.Group,Object.assign({className:"radio-group",label:x?void 0:r.createElement(M,Object.assign({id:"gender-option-control-label"},L),t||(g?$("tools.selectBabyGender"):$("tools.selectGender"))),size:"lg"},S,{classNames:{error:I.groupErr}},"radio"===f&&{error:null}),r.createElement(c.k,{className:z(I.wrapper)},O.map(e=>r.createElement(p.R,Object.assign({className:"gender-item",size:"sm",classNames:{root:I.itemRoot,labelWrapper:I.itemLabelWrapper,label:I.itemLabel,inner:I.itemInner,body:I.itemBody},key:e.value,value:e.value},j&&e.value!==j&&{disabled:!0},{label:r.createElement(c.k,{gap:(0,s.h)(8),align:"center",justify:"center",sx:{zIndex:0}},"button"===f&&("string"==typeof e.icon?r.createElement("img",{src:e.icon,className:"gender-image",alt:"female",loading:"lazy"}):e.icon),r.createElement(m.T,Object.assign({size:"p3"},w),e.label))}))))))}},"3uCj":function(e,t,a){a.d(t,{B:function(){return BtnChoice}});var o=a("q1tI"),r=a("VLju"),n=a("rBCA");let i=n.Z.div` display: flex; align-items: center; gap: 8px; button[data-color='tertiary'] { background: white; } `,BtnChoice=({value:e,choices:t,className:a,onChange:n})=>{let[l,s]=(0,o.useState)(e);return(0,o.useEffect)(()=>{s(e)},[e]),o.createElement(i,{className:a},t.map((e,t)=>o.createElement(r.B,{dataEventCategory:e.dataEventCategory,dataEventAction:e.dataEventAction,dataEventLabel:e.dataEventLabel,size:"sm",variant:e.value===l?"primary":"tertiary",className:e.value===l?"btn-choice-selected":"",key:t,onClick:()=>{s(e.value),null==n||n(e.value)}},e.label||"")))}},b97I:function(e,t,a){a.d(t,{T:function(){return Tabs}});var o=a("Kz+G"),r=a("q1tI"),n=a("aKYm"),i=a("VLUI"),l=a("/npG"),s=a("mYVa"),d=a("rlLN"),c=a("vaps"),p=a("VLju"),u=a("pMur"),m=(0,l.k)((e,t)=>{let{variant:a}=t,o={content:"none",top:0,bottom:0,zIndex:1,width:(0,s.h)(56)};return Object.assign({},"inline"===a&&{root:{},tabsList:{gap:(0,s.h)(24),borderBottom:"none",flexWrap:"nowrap"},tab:{padding:`${(0,s.h)(8)} 0`,color:e.colors.gray[4],borderColor:"transparent",borderBottomWidth:(0,s.h)(2),marginBottom:(0,s.h)(-1),transition:"border 0.2s ease","&:hover":{backgroundColor:"initial",borderColor:"transparent"},"&[data-active='true']":{color:e.fn.primaryColor(),borderColor:e.fn.primaryColor()}},tabRightSection:{},tabLabel:{},tabIcon:{},panel:{},scrollArea:{position:"relative","&.prev-bg":{"&:before":Object.assign(Object.assign({},o),{content:'""',position:"absolute",left:0,background:"linear-gradient(90deg, #FFF 0%, rgba(255, 255, 255, 0.00) 100%)"})},"&.next-bg":{"&:after":Object.assign(Object.assign({},o),{content:'""',position:"absolute",right:0,background:"linear-gradient(90deg, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%)"})}},list:{borderBottom:`1px solid ${e.colors.neutral[1]}`},btn:{position:"absolute",top:"50%",zIndex:2,transform:"translate(0, -50%)",width:(0,s.h)(28),height:(0,s.h)(28),padding:0,background:"white",borderRadius:"50%",cursor:"pointer",filter:"drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.04)) drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.04)) drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04))",".mantine-Button-icon":{display:"flex",alignItems:"center",justifyContent:"center"},"&.disabled":{opacity:0,zIndex:0}},prevBtn:{left:0},nextBtn:{right:0}})});let Tabs=e=>{var t,{variant:a="inline",value:l,styles:s,children:h,dataList:g=[],tabProps:v,listProps:b,panelProps:f,TabComponentDisplay:x,startPadding:y=40,defaultValue:w}=e,E=(0,o._)(e,["variant","value","styles","children","dataList","tabProps","listProps","panelProps","TabComponentDisplay","startPadding","defaultValue"]);let{cx:C,classes:k}=m({variant:a},{name:"Tabs",styles:s}),S=(0,r.useRef)(null),$=(0,r.useRef)([]),[I,z]=(0,r.useState)(w||(null===(t=null==g?void 0:g[0])||void 0===t?void 0:t.value)),[N,T]=(0,r.useState)(0),[j,B]=(0,r.useState)(!1),[P,L]=(0,r.useState)(!0),[M,O]=(0,r.useState)({x:0,y:0}),_=(0,r.useRef)(null),R=Object.assign({defaultValue:w,classNames:k},h?{value:l}:{value:I,onTabChange:e=>z(e)});(0,r.useEffect)(()=>{z(l)},[l]),(0,r.useEffect)(()=>{var e,t,a;null===(e=_.current)||void 0===e||e.scrollTo({left:(null===(a=null===(t=null==$?void 0:$.current)||void 0===t?void 0:t[N])||void 0===a?void 0:a.offsetLeft)-y,behavior:"smooth"})},[N]),(0,r.useEffect)(()=>{T(g.findIndex(e=>e.value==I))},[I]),(0,r.useEffect)(()=>{var e,t;L(0===M.x),B((null===(e=null==_?void 0:_.current)||void 0===e?void 0:e.clientWidth)+M.x===(null===(t=null==_?void 0:_.current)||void 0===t?void 0:t.scrollWidth))},[M]);let TabTextComponent=({text:e,dataEventCategory:t,dataEventAction:a,dataEventLabel:o})=>x?r.createElement(x,null,e):r.createElement(u.T,{size:"s3",color:"inherit",weight:"semiBold","data-event-category":t,"data-event-action":a,"data-event-label":o},e);return r.createElement(d.m,Object.assign({},R,E),h||r.createElement(r.Fragment,null,r.createElement(c.x,{className:C(k.scrollArea,`${P?"":"prev-bg"} ${j?"":"next-bg"}`),scrollbarSize:0,viewportRef:_,onScrollPositionChange:O},r.createElement(d.m.List,Object.assign({className:k.list,ref:S},b),g.map((e,t)=>r.createElement(d.m.Tab,Object.assign({ref:e=>$.current[t]=e,className:k.tab,key:String(e.value),value:String(e.value)},v),r.createElement(TabTextComponent,Object.assign({},e))))),r.createElement(p.B,{className:C(k.btn,k.prevBtn,P?"disabled":""),unstyled:!0,onClick:()=>T(N-1>-1?N-1:0),leftIcon:r.createElement(n.Z,{size:16})}),r.createElement(p.B,{className:C(k.btn,k.nextBtn,j?"disabled":""),unstyled:!0,onClick:()=>T(N+1r.createElement(d.m.Panel,Object.assign({value:String(e.value),key:String(e.value)},f),e.content))))};Tabs.List=d.m.List,Tabs.Tab=d.m.Tab,Tabs.Panel=d.m.Panel},R77u:function(e,t,a){a.d(t,{A:function(){return Alert},B:function(){return Badge},C:function(){return CardCollapse},D:function(){return DragFreeCarousel},F:function(){return FileDropdown},G:function(){return Grid},H:function(){return HtmlContent},I:function(){return IconHeading},R:function(){return Radio},S:function(){return StepRenderer},T:function(){return Tag},U:function(){return Upload},a:function(){return BorderHeading},b:function(){return RateStars},c:function(){return Toggle},d:function(){return F},e:function(){return Q},f:function(){return n},g:function(){return i}});var o,r,n,i,l=a("q1tI"),s=a("pMur"),d=a("rBCA"),c=a("iBNF"),p=a("JIuZ"),u=a("4JiQ"),m=a("mYVa"),h=a("iuhU"),g=a("Iblh"),v=a("diY+"),b=a("H1c6"),f=a("Kz+G"),x=a("vsdc"),y=a("gEnE"),w=a("yVya"),E=a("sfOR"),C=a("l6P8"),k=a("FUIV"),S=a("Zdfy");let Upload=e=>l.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"none"},e),l.createElement("path",{d:"M9.82324 8.7033L10.8228 9.70287C10.9267 9.80662 11.056 9.8573 11.2107 9.85493C11.3655 9.85255 11.4948 9.79943 11.5987 9.69555C11.7026 9.59168 11.7545 9.46074 11.7545 9.30274C11.7545 9.14474 11.7026 9.01462 11.5987 8.91237L9.7353 7.04899C9.59968 6.91337 9.44149 6.84555 9.26074 6.84555C9.07999 6.84555 8.9218 6.91337 8.78618 7.04899L6.91549 8.91968C6.81174 9.02355 6.75987 9.15287 6.75987 9.30762C6.75987 9.46237 6.81174 9.59168 6.91549 9.69555C7.01937 9.79943 7.1503 9.85137 7.3083 9.85137C7.4663 9.85137 7.59643 9.79943 7.69868 9.69555L8.69824 8.7033L8.69824 11.5576C8.69824 11.717 8.75218 11.8506 8.86005 11.9583C8.96793 12.0662 9.10156 12.1201 9.26093 12.1201C9.42043 12.1201 9.55399 12.0662 9.66162 11.9583C9.76937 11.8506 9.82324 11.717 9.82324 11.5576L9.82324 8.7033ZM16.3857 9.3063C16.3857 10.2918 16.1987 11.2181 15.8247 12.0852C15.4507 12.9524 14.9432 13.7066 14.3021 14.348C13.6609 14.9894 12.907 15.4972 12.0402 15.8714C11.1735 16.2456 10.2474 16.4326 9.26205 16.4326C8.27655 16.4326 7.35024 16.2456 6.48312 15.8716C5.61599 15.4976 4.86174 14.9901 4.22037 14.3489C3.57899 13.7078 3.07118 12.9539 2.69693 12.0871C2.3228 11.2204 2.13574 10.2943 2.13574 9.30893C2.13574 8.32343 2.32274 7.39712 2.69674 6.52999C3.07074 5.66287 3.5783 4.90862 4.21943 4.26724C4.86055 3.62587 5.61449 3.11805 6.48124 2.7438C7.34799 2.36968 8.27405 2.18262 9.25943 2.18262C10.2449 2.18262 11.1712 2.36962 12.0384 2.74362C12.9055 3.11762 13.6597 3.62518 14.3011 4.2663C14.9425 4.90743 15.4503 5.66137 15.8246 6.52812C16.1987 7.39487 16.3857 8.32093 16.3857 9.3063ZM15.2607 9.30762C15.2607 7.63262 14.6795 6.21387 13.517 5.05137C12.3545 3.88887 10.9357 3.30762 9.26074 3.30762C7.58574 3.30762 6.16699 3.88887 5.00449 5.05137C3.84199 6.21387 3.26074 7.63262 3.26074 9.30762C3.26074 10.9826 3.84199 12.4014 5.00449 13.5639C6.16699 14.7264 7.58574 15.3076 9.26074 15.3076C10.9357 15.3076 12.3545 14.7264 13.517 13.5639C14.6795 12.4014 15.2607 10.9826 15.2607 9.30762Z",fill:"#595959"})),Alert=({style:e,onClose:t,text:a,type:o,contentIcon:r,closeIcon:n,className:i,description:d})=>l.createElement("div",{className:`CHw-fZZ ${i||""}`,style:e,"data-alert-type":o},l.createElement("div",{className:"_03U6VRS"},l.createElement("div",{className:"icon-title"},r,l.createElement(s.T,{weight:"bold",size:"label1"},a)),l.createElement(s.T,{weight:"regular",size:"p3"},d)),l.createElement("div",{className:"EO828Vv",onClick:t},n)),renderNotificationStyles=(e,t,a,o)=>{let r,n="";if("numeric"===e)switch(t){case"medium":n=` height: 16px; font-size: 11px; padding: 1px 6px; `;case"large":n=` height: 24px; font-size: 13px; padding: 1px 10px; `}let i="";a&&(i=` position: absolute; top: 0; left: 75%; `),a&&(r=` left: 70%; ${"large"===t?` top: -7px; `:"medium"===t?` top: -2px; width: 16px; height: 16px; `:""} `);let l="";switch(o){case"primary":l=` background: ${c.r.colors.primary50}; color: ${c.r.colors.primary600}; `;break;case"error":l=` background: ${c.r.colors.error}; color: white; `}switch(e){case"dot":return` ${i} width: 8px; height: 8px; font-size: 0px; border-radius: 50%; ${l} `;case"numeric":return` ${i} width: max-content; border-radius: 32px; ${n} ${r} ${l} `}},$=d.Z.div` position: relative; > div { width: max-content; position: relative; } span { font-weight: ${c.r.sizes.fwBold}; display: flex; justify-content: center; align-items: center; ${e=>renderNotificationStyles(e.notificationType,e.notificationSize,e.hasIcon,e.notificationColor)} } ${e=>e.hasIcon&&` svg { width: 40px; height: 40px; } `} `,Badge=({amount:e,type:t,size:a="medium",color:o="primary",icon:r,className:n})=>l.createElement($,{"data-notification-type":t,"data-notification-size":a,"data-notification-color":o,"data-has-icon":!!r||void 0,notificationType:t,notificationSize:a,notificationColor:o,hasIcon:!!r,className:n},l.createElement("div",null,e&&l.createElement("span",null,e)," ",r&&l.createElement("div",null,r))),I=d.Z.h4` position: relative; line-height: 18px; &:after { position: absolute; top: 1px; left: 0; width: 4px; height: 18px; background-color: ${c.r.colors.primaryBase}; content: ''; } &[data-size='lg'] { font-size: 18px; padding-left: 12px; } &[data-size='sm'] { font-size: 14px; padding-left: 8px; &::after { width: 2px; height: 15px; } } &[data-type='bold'] { font-weight: ${c.r.sizes.fwBold}; } &[data-type='semiBold'] { font-weight: ${c.r.sizes.fwSemiBold}; } &[data-uppercase] { text-transform: uppercase; } ${p.M.mbDown} { &[data-size='lg'] { font-size: 16px; } } `,BorderHeading=({style:e,children:t,className:a,size:o="lg",type:r="bold",upperCase:n,as:i="h4",color:s})=>l.createElement(I,{style:Object.assign({color:s},e),className:a,"data-size":o,"data-type":r,"data-uppercase":n,as:i},t),z=(0,d.Z)(v.S)` flex-shrink: 0; color: ${c.r.colors.neutral800}; width: 16px; height: 16px; transition: transform 0.2s ease-in-out; transform: rotate(-180deg); &[data-is-collapsed='true'] { transform: rotate(0deg); } `,N=d.Z.div` background-color: white; .icon { width: 20px; height: 20px; flex-shrink: 0; color: ${c.r.colors.neutral800}; } .title-collapse { color: #111111; font-weight: var(--fwSemiBold); font-size: 1.0625rem; line-height: 1.5rem; flex-grow: 1; } .box-collapse { display: flex; padding: 1.5rem 1rem 1rem 1rem; gap: 0.75rem; align-items: center; } `;function CardCollapse({children:e,title:t,icon:a,defaultOpened:o=!0,haveCollapse:r=!0,id:n,className:i,as:d="h2"}){let[c,{toggle:p}]=(0,g.q)(o);return l.createElement(N,{id:n,className:i},l.createElement("div",{className:"box-collapse",onClick:()=>{r&&p()}},r&&a,l.createElement(s.T,{as:d,className:"title-collapse"},t),r&&l.createElement(z,{"data-is-collapsed":c})),l.createElement(u.U,{in:!r||c,transitionDuration:200,transitionTimingFunction:"ease"},e))}let T=d.Z.div` position: relative; box-sizing: border-box; border: 1px solid ${c.r.colors.gray200}; background: url('../../../public/bgSvg/arrow-down.svg') no-repeat; background-position: right 16px center; border-radius: ${c.r.borderRadius}; &[data-has-icons='true'] { border: none; background: ${c.r.colors.gray100}; img, svg { display: inline-block; max-width: 16px; margin-right: 6px; } span { vertical-align: middle; display: inline-block; } &:hover { box-shadow: none; } > div { position: relative; width: 100%; display: flex; align-items: center; box-sizing: border-box; } > div::after { content: ''; right: 12px; top: 50%; 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"); width: 10px; height: 8px; position: absolute; background-repeat: no-repeat; transform: translateY(-50%); } } &:hover { box-shadow: 0 0 2px 2px ${c.r.colors.primary200}; } `,j=d.Z.div` padding: 12px 18px 12px 16px; cursor: pointer; &[data-dropdown-open] { padding: 11px 15px 11px 15px; border: 1px solid ${c.r.colors.primaryBase}; border-radius: ${c.r.borderRadius}; box-shadow: 0 0 2px 2px ${c.r.colors.primary200}; } & > svg { height: 16px; width: 16px; } `,B=d.Z.ul` position: absolute; top: 100%; right: 0; left: 0; display: block; margin-top: 4px; background: ${c.r.colors.white}; border-radius: ${c.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'] { background: white; box-shadow: none; border: 1px solid ${c.r.colors.gray200}; filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04)); } `,P=d.Z.li` margin: 8px; padding: 12px 18px 12px 16px; border-radius: ${c.r.borderRadius}; display: flex; &:hover, :active { background: ${c.r.colors.gray100}; } `,L=d.Z.div` display: flex; align-items: center; margin-right: 8px; & > svg { height: 16px; width: 16px; } `,ShareIconPathStyle=()=>l.createElement("style",null,".file-dropdown-path{fill:none;stroke:#595959;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px}"),DefaultFileIcon=()=>l.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 12.17 14.83"},l.createElement("defs",null,l.createElement("clipPath",{id:"prefix__clip-path",transform:"translate(-1.92 -1.54)"},l.createElement("path",{fill:"none",d:"M0 .96h16v16H0z"}))),l.createElement("title",null,"File"),l.createElement("g",{clipPath:"url(#prefix__clip-path)"},l.createElement("path",{className:"file-dropdown-path",d:"M8.67 2.29H4a1.33 1.33 0 00-1.33 1.33v10.67A1.33 1.33 0 004 15.62h8a1.33 1.33 0 001.33-1.33V7z",transform:"translate(-1.92 -1.54)"}),l.createElement("path",{className:"file-dropdown-path",d:"M8.67 2.29V7h4.66",transform:"translate(-1.92 -1.54)"}))),DownloadIcon=()=>l.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 13.5 13.5"},l.createElement("title",null,"download"),l.createElement("path",{className:"file-dropdown-path",d:"M14 11v2.66A1.33 1.33 0 0112.67 15H3.33A1.33 1.33 0 012 13.62V11M4.67 7.62L8 11l3.33-3.34M8 11V3",transform:"translate(-1.25 -2.21)"})),UploadIcon=()=>l.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 13.5 13.5"},l.createElement("title",null,"upload"),l.createElement("path",{className:"file-dropdown-path",d:"M14 11v2.66A1.33 1.33 0 0112.67 15H3.33A1.33 1.33 0 012 13.62V11M11.33 6.29L8 3 4.67 6.29M8 3v8",transform:"translate(-1.25 -2.21)"})),FileDropdown=({className:e,value:t,options:a,onUploadSelected:o,id:r,placeholderIcon:n,placeholder:i,style:s})=>{let[d,c]=(0,l.useState)(!1),showDropdown=()=>c(!d),p=(0,l.useRef)(a.map(e=>"upload"===e.type&&l.createElement("input",{id:"uploader-dropdown-input-"+r+"-"+e.value,key:"uploader-dropdown-input-"+r+"-"+e.value,accept:e.fileAcceptedType,multiple:e.multiple,type:"file",style:{display:"none"},onChange:e=>{console.log("change"),o(e.target.files)}}))),onUpload=e=>{var t;null===(t=document.querySelector(e))||void 0===t||t.click()},onDownload=e=>{e&&window.open(e,"_blank")};return l.createElement(T,{className:e,"data-dropdown-open":!!d,id:r,"data-has-icons":!0,style:s,onBlur:()=>c(!1),tabIndex:0},l.createElement(ShareIconPathStyle,null),l.createElement(j,{onClick:showDropdown},n||l.createElement(DefaultFileIcon,null)," ",l.createElement("span",null,t&&t.value?t.label:i)),d&&l.createElement(B,{onClick:showDropdown,"data-has-icons":!0},a.map(e=>l.createElement(P,{key:`${r}-${e.value}`,"data-selected":t&&t.value===e.value||void 0,onClick:()=>"upload"===e.type?onUpload("#uploader-dropdown-input-"+r+"-"+e.value):onDownload(e.url)},l.createElement(L,null,e.icon||"download"===e.type?l.createElement(DownloadIcon,null):l.createElement(UploadIcon,null)),e.label))),l.createElement(l.Fragment,null,p.current))},M=d.Z.div` --columns: var(--grid-template-columns, repeat(var(--columns-count), 1fr)); --columns-desktop: var( --grid-template-columns-desktop, repeat(var(--columns-count-desktop), 1fr) ); display: grid; grid-template-columns: var(--columns); grid-gap: var(--grid-gap); align-items: var(--align-items); ${p.M.tdUp} { grid-template-columns: var(--columns-desktop); } > * { justify-self: var(--justify-children); } `,Grid=({className:e,columns:t,columnsDesktop:a,gridTemplateColumns:o,gridTemplateColumnsDesktop:r,gap:n,children:i,justifyChildren:s,style:d,alignItems:c})=>l.createElement(M,{className:e,style:Object.assign({"--columns-count":t,"--columns-count-desktop":a,"--grid-template-columns":o,"--grid-template-columns-desktop":r,"--justify-children":s,"--grid-gap":n,"--align-items":c},d)},i),Radio=({size:e="small",label:t,name:a,checked:o,value:r,className:n,isDisabled:i=!1,onChange:s,dataEventCategory:d,dataEventAction:c,dataEventLabel:p})=>{let u=!!c&&!!d&&!!p,m=u?{"data-event-category":d,"data-event-action":c,"data-event-label":p}:{};return l.createElement(b.R,Object.assign({size:"small"===e?"md":"lg",label:t,name:a,checked:o,value:r,className:n,disabled:i,onChange:e=>null==s?void 0:s(e.target.value)},m))},O=d.Z.div` display: inline-flex; gap: calc(var(--gap) * 1px); > svg { width: calc(var(--star-size) * 1px); height: calc(var(--star-size) * 1px); } &[data-selectable='true'] { > svg { cursor: pointer; } } `,StarHalfIcon=e=>l.createElement("svg",Object.assign({},e,{viewBox:"0 0 24 24",fill:"none"}),l.createElement("path",{d:"m139.287 144.772 5.17 3.12c.38.23.85-.11.75-.54l-1.37-5.88 4.56-3.95c.33-.29.16-.84-.29-.88l-6.01-.51-2.35-5.54a.498.498 0 0 0-.92 0l-2.35 5.54-6.01.51a.499.499 0 0 0-.28.88l4.56 3.95-1.37 5.88c-.1.43.37.77.75.54z",fill:"#E4E8EC"}),l.createElement("path",{d:"M139.289 144.771s.013-14.488 0-14.488a.49.49 0 0 0-.46.308l-2.35 5.54-6.01.51a.499.499 0 0 0-.28.88l4.56 3.95-1.37 5.88c-.1.43.37.77.75.54z",fill:"#FFC326"})),StarIcon=e=>{var{isFull:t}=e,a=(0,f._)(e,["isFull"]);return l.createElement("svg",Object.assign({},a,{viewBox:"0 0 32 32",fill:"none"}),l.createElement("path",{d:"m16 23.027 6.893 4.16c.507.306 1.134-.147 1-.72l-1.826-7.84 6.08-5.267a.67.67 0 0 0-.387-1.173l-8.013-.68-3.134-7.387a.664.664 0 0 0-1.226 0l-3.133 7.387-8.014.68a.668.668 0 0 0-.373 1.173l6.08 5.267-1.827 7.84c-.133.573.493 1.026 1 .72z",fill:t?"#FFC326":"#D2D6DC"}))},RateStars=({gap:e=2,size:t=24,star:a,totalStars:o=5,onSelect:r,hideEmptyStars:n,style:i,className:s})=>{let d=Math.floor(a),c=a-d>=.5?1:0,[p,u]=(0,l.useState)(null),m=p||d,h=p?0:c;return l.createElement(O,{"data-selectable":!!r,style:Object.assign({"--gap":e,"--star-size":t},i),className:s},Array.from({length:n?d+c:o}).map((e,t)=>{let onMouseOver=()=>!!r&&u(t+1),onMouseLeave=()=>!!r&&u(null);return t+1<=m?l.createElement(StarIcon,{key:t,onClick:()=>null==r?void 0:r(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,isFull:!0}):t+1===m+h?l.createElement(StarHalfIcon,{key:t,onClick:()=>null==r?void 0:r(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave}):l.createElement(StarIcon,{key:t,onClick:()=>null==r?void 0:r(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave})}))},getTag=(e,t)=>{switch(e){case"yellow":{let e=t?c.r.colors.yellow50:c.r.colors.yellow600;return` background: ${e}; p { color: var( --text-props-color, ${c.r.colors.gray800} ); } `}case"standard":return` background: ${c.r.colors.white}; border: 1px solid ${c.r.colors.gray200}; p { color: var( --text-props-color, ${c.r.colors.gray800} ); } &:hover { background: ${c.r.colors.gray100}; } `;case"red":{let e=t?c.r.colors.red50:c.r.colors.red500;return` background: ${e}; `}case"green":{let e=t?c.r.colors.green50:c.r.colors.green500;return` background: ${e}; `}case"blue":{let e=t?c.r.colors.primary50:c.r.colors.primaryBase;return` background: ${e}; `}case"teal":{let e=t?c.r.colors.teal100:c.r.colors.teal600;return` background: ${e}; `}case"pink":{let e=t?c.r.colors.pink200:c.r.colors.pink800;return` background: ${e}; `}case"violet":{let e=t?c.r.colors.violet100:c.r.colors.violet500;return` background: ${e}; `}case"grey":{let e=t?c.r.colors.gray100:c.r.colors.gray600;return` background: ${e}; `}}},_=d.Z.div` --padding-horizontal: 8px; --pading-vertical: 2px; display: flex; align-items: center; justify-content: center; padding: var(--pading-vertical) var(--padding-horizontal); border-radius: 24px; ${e=>"sponsored"===e.tagType&&` --offset-size: 4px; display: flex; align-items: center; justify-content: center; box-sizing: content-box; position: relative; box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.08); border-radius: 0 4px 18px 0; height: 24px; width: 90px; border-left: var(--offset-size) solid ${c.r.colors.accentLight}; padding: 0; margin-left: calc(var(--offset-size) * -1); p { font-weight: ${c.r.sizes.fwBold}; color: var( --text-props-color, ${c.r.colors.secondaryDark} ); font-size: 11px; margin-left: calc(var(--offset-size) * -1); } &::after { width: calc(var(--offset-size) * 2); height: var(--offset-size); background: ${c.r.colors.accentMain}; position: absolute; left: calc(var(--offset-size) * -1); bottom: calc(var(--offset-size) * -1); clip-path: polygon(0 1%, 100% 0%, 100% 100%); content: ''; } `} ${e=>e.isInline&&` display: inline-block; `} ${e=>e.tagHasMorePadding&&` &[data-has-more-padding] { padding: calc(var(--pading-vertical) + 5px) var(--padding-horizontal); } `} p { ${e=>e.tagIsLight?` color: var(--text-props-color, #000); `:` color: var(--text-props-color, ${c.r.colors.white}); `} } ${e=>getTag(e.tagType,e.tagIsLight)} ${e=>e.tagIsSquared&&"sponsored"!==e.tagType&&` border-radius: 4px; `} ${e=>e.tagIsALink&&` cursor: pointer; `} &[data-is-selected], &:active { background: ${c.r.colors.primary50}; } `,Tag=({type:e,children:t,style:a,isInline:o,isSquared:r=!1,className:n,isLight:i,hasMorePadding:s,isLink:d,isSelected:c,textProps:p={size:"sm"}})=>{let u=p.color?{"--text-props-color":p.color}:{};return l.createElement(_,{"data-is-squared":r||void 0,"data-tag-type":e,"data-is-light":i||void 0,"data-has-more-padding":s||void 0,"data-is-inline":o||void 0,style:Object.assign(Object.assign({},a),u),className:n,"data-is-selected":c||void 0,"data-is-link":d||void 0,tagType:e,isInline:o,tagHasMorePadding:s,tagIsLight:i,tagIsSquared:r,tagIsALink:d},l.createElement(x.T,Object.assign({},p),t))},R="24px",D=(0,y.Z)(d.Z.span` position: relative; display: block; width: 40px; height: ${R}; background: #c3cbd4; border-radius: 100px; cursor: pointer; &:after { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 90px; content: ''; transition: 0.3s; } `,"hhgcomp-toggle-icon"),A=d.Z.span` padding-left: 15px; `,Z=d.Z.div` height: ${R}; input[type='checkbox'] { width: 0; height: 0; visibility: hidden; } label { cursor: pointer; display: inline-flex; color: ${c.r.colors.gray600}; } input:checked + label ${D.classSelector} { background: ${c.r.colors.primaryBase}; &:after { left: calc(100% - 2px); transform: translateX(-100%); } } `,Toggle=({className:e,id:t,onChange:a,checked:o,style:r,label:n})=>l.createElement(Z,{className:e,style:r},l.createElement("input",{type:"checkbox",id:t,onChange:a,checked:o}),l.createElement("label",{htmlFor:t},l.createElement(D,null),n&&l.createElement(A,null,n))),F=(0,l.createContext)({currentStep:0,setCurrentStep:()=>!1,setMaxStep:()=>!1,nextStep:()=>!1,prevStep:()=>!1}),StepRenderer=({children:e,onStepChange:t})=>{let[a,o]=(0,l.useState)(0),[r,n]=(0,l.useState)(0),i=l.Children.count(e);return(0,l.useEffect)(()=>{n(i-1)},[i]),(0,l.useEffect)(()=>{null==t||t(a)},[a]),l.createElement(F.Provider,{value:{currentStep:a,setCurrentStep:o,setMaxStep:n,nextStep:()=>a+1<=r&&o(a+1),prevStep:()=>a-1>=0&&o(a-1)}},(0,w.Z)(e).map((e,t)=>{let o=t===a;return l.createElement(l.Fragment,{key:t},l.isValidElement(e)?e.props.alwaysRender||o?l.cloneElement(e,{isActive:t===a,stepIndex:t}):null:o?e:null)}))},H=d.Z.div` display: flex; align-items: center; gap: 8px; `,U=(0,d.Z)(E.H)` font-weight: var(--fwBold); `,IconHeading=({icon:e,title:t,className:a,style:o})=>l.createElement(H,{className:a,style:o},e,l.createElement(U,{tag:"h6",color:"var(--secondaryDark)"},t)),sanitizeHtml=e=>{if(!e)return"";let t=e.replace(/\n$/,"").replace(/\n/g,"
");return t},HtmlContent=({htmlContent:e,className:t})=>{let a=sanitizeHtml(e);return l.createElement("div",{className:t,dangerouslySetInnerHTML:{__html:a}})};(o=n||(n={})).ONE_TO_ONE="1:1",o.THREE_TO_ONE="3:1",(r=i||(i={})).PNG=".png",r.JPG=".jpg",r.JPEG=".jpeg";let getBase64=e=>new Promise((t,a)=>{let o=new FileReader;o.onload=()=>t(o.result),o.onerror=a,o.readAsDataURL(e)}),handleMultipleImageFiles=e=>(0,f.a)(void 0,void 0,void 0,function*(){if(0===e.length)return[];let t=yield Promise.all(e.map(e=>getBase64(e)));return t}),V=d.Z.div` display: flex; flex-direction: column; .image-upload-input-error { margin-top: ${(0,m.h)(12)}; display: flex; flex-direction: column; gap: ${(0,m.h)(4)}; } `,G=d.Z.div` display: flex; flex-direction: column; gap: ${(0,m.h)(4)}; margin-top: ${(0,m.h)(4)}; span { color: ${c.r.colors.neutral500}; } `,W=d.Z.div` position: relative; width: fit-content; padding: ${(0,m.h)(8)} ${(0,m.h)(12)}; border-radius: ${(0,m.h)(12)}; border: ${(0,m.h)(1)} solid ${c.r.colors.neutral200}; cursor: pointer; display: flex; align-items: center; gap: ${(0,m.h)(8)}; margin-top: ${(0,m.h)(18)}; &.image-upload-dragover { border-color: ${c.r.colors.primaryBase}; } &.image-upload-error { border-color: ${c.r.colors.error}; } &.image-upload-disabled { cursor: not-allowed; background-color: ${c.r.colors.gray100}; color: ${c.r.colors.gray400}; border-color: ${c.r.colors.gray200}; } svg { width: ${(0,m.h)(18)}; height: ${(0,m.h)(18)}; } input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: -1; } `,q=d.Z.div` position: relative; width: ${(0,m.h)(90)}; height: ${(0,m.h)(90)}; border-radius: ${(0,m.h)(12)}; overflow: hidden; background-color: ${c.r.colors.gray100}; display: flex; align-items: center; justify-content: center; img { width: 100%; height: 100%; object-fit: contain; } svg { width: ${(0,m.h)(14)}; height: ${(0,m.h)(14)}; color: ${c.r.colors.white}; } .image-upload-remove-button { cursor: pointer; position: absolute; top: ${(0,m.h)(6)}; right: ${(0,m.h)(6)}; background: ${c.r.colors.black}; border-radius: ${(0,m.h)(12)}; padding: ${(0,m.h)(2)}; display: flex; &:hover { opacity: 0.8; } } `,J=d.Z.div` display: flex; gap: ${(0,m.h)(8)}; margin-top: ${(0,m.h)(18)}; `,Q=(0,l.forwardRef)(({label:e,name:t,error:a,acceptedTypes:o=[i.PNG,i.JPG,i.JPEG],maxSize:r=1,acceptedRatios:n,multiple:d=!1,disabled:p=!1,id:u,className:g,onChange:v,value:b,showValidationRules:x=!1,description:y,useBase64:w=!1,placeholder:E},S)=>{let{t:$}=(0,k.u)(),[I,z]=(0,l.useState)(!1),[N,T]=(0,l.useState)([]),j=(0,l.useRef)(null),B=!!a||N.length>0,P=(0,l.useMemo)(()=>b?Array.isArray(b)?b:[b]:[],[b]),L=(0,l.useCallback)(e=>{var t;let a=[],n="."+(null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase());o.includes(n)||a.push(`Unsupported file format. Please upload a ${o.join(", ")} file.`);let i=e.size/1048576;return i>r&&a.push(`File too large. Please upload an image smaller than ${r}MB.`),{file:e,isValid:0===a.length,errors:a}},[o,r]),M=(0,l.useCallback)(e=>new Promise(t=>{if(!n||!n.length||!e.type.startsWith("image/")){t([]);return}let a=new Image;a.onload=()=>{let e=a.width/a.height,o=`${e.toFixed(1)}:1`,r=n.some(t=>{let[a,o]=t.split(":"),r=parseInt(a)/parseInt(o);return .1>Math.abs(e-r)});t(r?[]:[`Image ratio ${o} is not accepted.`])},a.onerror=()=>t(["Invalid image file"]),a.src=URL.createObjectURL(e)}),[n]),O=(0,l.useMemo)(()=>P.map(e=>"string"==typeof e?e:e instanceof File?URL.createObjectURL(e):"").filter(Boolean),[P]),_=(0,l.useCallback)(e=>(0,f.a)(void 0,void 0,void 0,function*(){let a=Array.from(e),o=[],r=[];for(let e of a){let t=L(e),a=yield M(e),n=[...t.errors,...a];0===n.length?r.push(e):o.push(...n)}if(T(o),0===r.length)return;let n=w?yield handleMultipleImageFiles(r):r;v({target:{name:t,value:d?[...P,...n]:n.slice(0,1)}})}),[L,M,d,v,t,P]),removeFile=e=>{let a=P.filter((t,a)=>a!==e);T([]),v({target:{name:t,value:d?a:""}})},R=(0,l.useCallback)(e=>{j.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]),D=(0,l.useCallback)(()=>{!p&&j.current&&j.current.click()},[p]),A=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),z(!0)},[]),Z=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),z(!1)},[]),F=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),H=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),z(!1);let t=e.dataTransfer.files;t.length>0&&_(t)},[_]);return l.createElement(V,{className:g},l.createElement("label",{htmlFor:u||t},"string"==typeof e?l.createElement(s.T,{size:"title2"},e):e,y&&l.createElement(s.T,{size:"p3",mt:(0,m.h)(4),color:c.r.colors.gray700},y)),x&&l.createElement(G,null,l.createElement(s.T,{size:"p3"},"Formats: ",o.join("/")),n&&l.createElement(s.T,{size:"p3"},"Max size: ",r,"MB - Accepted ratios:"," ",n.join("/"))),(d||0===P.length)&&l.createElement(W,{className:(0,h.default)(I&&"image-upload-dragover",B&&"image-upload-error",p&&"image-upload-disabled"),onDragEnter:A,onDragLeave:Z,onDragOver:F,onDrop:H,onClick:D},l.createElement("input",{ref:R,type:"file",id:u||t,name:t,accept:o.join(","),multiple:d,onChange:e=>{let t=e.target.files;t&&t.length>0&&_(t)},disabled:p}),l.createElement(Upload,null),l.createElement(s.T,{size:"p3",fw:500},E||$("common.btn.uploadPhoto"))),P.length>0&&l.createElement(J,null,O.map((e,t)=>l.createElement(q,{key:t},l.createElement("img",{src:e,alt:`Uploaded file ${t+1}`,className:"image-upload-preview-image"}),l.createElement("button",{onClick:e=>{e.stopPropagation(),removeFile(t)},className:"image-upload-remove-button"},l.createElement(C.C,null))))),B&&l.createElement("div",{className:"image-upload-input-error"},[...N,a].map(e=>l.createElement(s.T,{key:e,className:"error-text",size:"c1",color:c.r.colors.red600},e))))}),K=(0,d.Z)(S.l)` & .mantine-Carousel-control { width: auto; } `,DragFreeCarousel=e=>{var{children:t,gapItem:a=8,slideSize:o="auto",withControls:r=!1,withIndicators:n=!1,dragFree:i=!0,align:s="start"}=e,d=(0,f._)(e,["children","gapItem","slideSize","withControls","withIndicators","dragFree","align"]);return l.createElement(K,Object.assign({slideSize:o,slideGap:a,withControls:r,withIndicators:n,dragFree:i,align:s,containScroll:"trimSnaps"},d),l.Children.map(t,(e,t)=>l.createElement(S.l.Slide,{key:t},e)))}}}]);