(self.webpackChunkhhgDiscoverV1=self.webpackChunkhhgDiscoverV1||[]).push([[7638],{"7/Cf":function(e,o,t){"use strict";t.d(o,{dh:function(){return getHhgIdFromCookie},lT:function(){return getSubotCookieId},VV:function(){return getUserIdFromCookie},Us:function(){return getUserInfoFromCookie}});var i=t("iVi/"),n=t("p46w"),l=t.n(n),r=t("Q6jF"),a=t("9brV"),d=window.atob&&window.atob.bind(window)||function(e){let o=String(e).replace(/=+$/,"");if(o.length%4==1)throw Error("'atob' failed: The string to be decoded is not correctly encoded.");let t="";for(let e=0,i=0,n,l=0;n=o.charAt(l++);~n&&(i=e%4?64*i+n:n,e++%4)&&(t+=String.fromCharCode(255&i>>(-2*e&6))))n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return t};let getUserIdFromCookie=e=>{let o=i.parse(e||""),t=o[a.ty],n=t||l().get(a.ty)||"";try{let e=n.split(".")[1],o=e.replace(/-/g,"+").replace(/_/g,"/"),t=decodeURIComponent(d(o).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(t).sub}catch(e){return""}},getUserInfoFromCookie=e=>{let o=i.parse(e||""),t=o[a.ty],n=t||l().get(a.ty)||"";try{let e=n.split(".")[1],o=e.replace(/-/g,"+").replace(/_/g,"/"),t=decodeURIComponent(d(o).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join("")),i=JSON.parse(t);return{email:i.email,id:i.sub}}catch(e){return{email:"",id:0}}},getHhgIdFromCookie=e=>{let o=i.parse(e||""),t=o["hhg-id"];return t||l().get("hhg-id")||""},getSubotCookieId=e=>{if(e)return l().set("hhg-id",e),e;let o=getHhgIdFromCookie();if(o)return o;let t=(0,r.A)();return l().set("hhg-id",t),t}},"/tE8":function(e,o,t){"use strict";t.d(o,{DT:function(){return validateEmail},NM:function(){return checkMobile},qU:function(){return validateURL}});var i=t("9brV");let n=/(?:phone|windows\s+phone|ipod|blackberry|(?:android|bb\d+|meego|silk|googlebot) .+? mobile|palm|windows\s+ce|opera mini|avantgo|mobilesafari|docomo|kaios)/i,l=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,r=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,checkMobile=e=>{if(i.kU)return n.test(e||"");let o=e||(i.kU?"":navigator.userAgent);return l.test(o)||r.test(o.substring(0,4))},validateEmail=e=>/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase()),validateURL=e=>{try{return new URL(e),!0}catch(e){return!1}}},johO:function(e,o,t){"use strict";t.d(o,{R:function(){return Loading}});var i=t("BGKE"),n=t("tuDO"),l=t("dDsW"),r=t("rBCA");let a=(0,r.A)("div",{target:"e1tazl0y0"})("display:flex;align-items:center;justify-content:center;padding:1em;"),Loading=e=>{let{className:o,size:t="md"}=e,{formatMessage:r}=(0,l.A)(),d=r({id:"player.loading",defaultMessage:"Loading"});return(0,i.Y)(a,{className:o,children:(0,i.Y)(n.B,{size:t,color:"transparent",isLoading:!0,children:d})})}},"n/tb":function(e,o,t){"use strict";t.d(o,{D1:function(){return h},JV:function(){return f},Pe:function(){return p},QP:function(){return g},Se:function(){return r},TF:function(){return m},U9:function(){return c},Z9:function(){return d},Zu:function(){return u},cT:function(){return s},dr:function(){return b},fO:function(){return v},kt:function(){return x},yR:function(){return a}});var i=t("rBCA"),n=t("CL9C"),l=t("iBNF");let r=(0,i.A)("div",{target:"e1c6pofg0"})("margin:24px 0;.big-divider{border:0;height:8px;background-color:#f7f9fc;margin:24px 0;}"),a=(0,i.A)("div",{target:"e1c6pofg1"})("margin:12px 0 24px 0;",n.M.mbDown,"{width:calc(100% + 2rem);max-width:unset;margin-right:-1rem;margin-left:-1rem;}.container{",n.M.mbDown,"{padding:4px 16px 32px 16px;}",n.M.mbUp,"{padding:8px 4px 32px 4px;}}&[data-custom-columns='false']{.section{",n.M.mbUp,"{margin-right:24px;}}}.section{",n.M.mbDown,"{max-width:283px;margin:0 16p 0 0x;}.grid-layout{",n.M.mbUp,"{grid-column-gap:24px;padding:0 24px 0 0;height:100%;}",n.M.mbDown,"{grid-column-gap:12px;padding:0 12px 0 0;}}}&[data-column-count='3']{.section{.grid-layout{",n.M.mbUp,"{padding:0 54px 0 0;}}}}"),d=(0,i.A)("div",{target:"e1c6pofg2"})("width:100%;margin:0 0 8px 0;border-radius:",l.w.borderRadius,";box-shadow:0px 16px 24px rgba(0,0,0,0.06),0px 2px 8px rgba(0,0,0,0.04),0px 0px 1px rgba(0,0,0,0.04);overflow-x:hidden;",n.M.mbDown,"{max-width:271px;min-height:342px;}",n.M.mbUp,"{max-width:342px;min-height:388px;height:100%;}.post-divider{border-top:0.5px solid #e4e8ec;border-bottom:none;margin:0;}&[data-home='true']{",n.M.mbDown,"{max-width:271px;min-height:318px;}",n.M.mbUp,"{max-width:368px;min-height:294px;}}"),c=(0,i.A)("div",{target:"e1c6pofg3"})("position:absolute;top:0;display:block;width:100%;",n.M.mbDown,"{height:152px;}",n.M.mbUp,"{height:236px;}background-position:center;background-repeat:no-repeat;background-size:cover;border-radius:",l.w.borderRadius,";.thumbnail-container{display:flex;width:100%;height:100%;align-items:flex-end;justify-content:center;.thumbnail{position:absolute;z-index:10;bottom:0;",n.M.mbDown,"{width:80px;height:80px;}",n.M.mbUp,"{width:100px;height:100px;}margin:auto;border-radius:50%;}}&[data-home='true']{",n.M.mbUp,"{height:152px;}.thumbnail-container{.thumbnail{",n.M.mbDown,"{bottom:0;}",n.M.mbUp,"{bottom:33px;}}}}"),s=(0,i.A)("div",{target:"e1c6pofg4"})("position:relative;width:100%;a{text-decoration:none;}",n.M.mbDown,"{margin-top:112px;padding:56px 16px 16px 16px;}",n.M.mbUp,"{margin-top:176px;padding:69px 16px 16px 16px;}background:white;border-radius:20px 20px 6px 6px;text-align:center;.statictis{display:flex;justify-content:space-around;",n.M.mbDown,"{magin-top:4px;}",n.M.mbUp,"{margin-top:8px;}}.button{width:100%;margin-top:24px;}&[data-home='false']{.statictis-item{",n.M.mbUp,"{display:flex;flex-direction:column;flex:1;.number{margin-right:4px;}}}}&[data-home='true']{",n.M.mbUp,"{margin-top:77px;padding:54px 16px 16px 16px;}.statictis{",n.M.mbUp,"{margin-top:18px;}}}"),u=(0,i.A)("div",{target:"e1c6pofg5"})("display:flex;align-items:center;justify-content:space-between;",n.M.mbDown,"{padding:11px 8px;}",n.M.mbUp,"{padding:10px 16px;}.info{display:flex;align-items:center;text-decoration:none;}.topic-thumbnail{",n.M.mbDown,"{width:32px;height:32px;}",n.M.mbUp,"{width:40px;height:40px;}margin-right:8px;}.title{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1;text-overflow:ellipsis;}&[data-custom]{.follow-btn{padding:6px 12px;border-color:",l.w.colors.primaryActive,";color:",l.w.colors.primaryActive,";font-size:13px;font-weight:bold;line-height:20px;white-space:nowrap;}}&[data-has-followed='true']{.follow-btn{span{display:flex;align-items:center;}img{width:18px;height:18px;margin-right:8px;}border-color:",l.w.colors.gray300,";color:",l.w.colors.gray800,";}}"),p=(0,i.A)("a",{target:"e1c6pofg6"})("display:flex;align-items:center;justify-content:center;padding:0 0 16px 0;text-decoration:none;p{color:",l.w.colors.primaryActive,";",n.M.mbDown,"{font-size:12px;font-weight:600;line-height:18px;}",n.M.mbUp,"{font-weight:bold;font-size:14px;line-height:22px;}}img{",n.M.mbDown,"{width:16px;height:16px;}",n.M.mbUp,"{width:18px;height:18px;}}"),g=(0,i.A)("div",{target:"e1c6pofg7"})("display:flex;.line{border-right:5px solid #2d87f3;margin:4px 0;margin-right:16px;}h5{color:",l.w.colors.gray800,";margin-bottom:4px;",n.M.mbUp,"{padding:0px 16px;}}"),m=(0,i.A)("div",{target:"e1c6pofg8"})("padding:16px;",n.M.mbDown,"{min-height:262px;}",n.M.mbUp,"{min-height:332px;}.post-title{display:-webkit-box;overflow:hidden;margin-top:16px;-webkit-box-orient:vertical;-webkit-line-clamp:2;}"),h=(0,i.A)("div",{target:"e1c6pofg9"})("display:flex;justify-content:space-between;.option-icon{width:32px;height:32px;cursor:pointer;}"),v=(0,i.A)("div",{target:"e1c6pofg10"})("display:flex;align-items:center;.avatar-container{position:relative;margin-right:8px;.avatar{width:40px;height:40px;border-radius:50%;}.badge{position:absolute;right:0;bottom:0;width:14px;height:14px;}}.author-info{.author-name{display:flex;align-items:center;.role{height:fit-content;padding:0 8px;margin-left:4px;background:#ff6f4d;border-radius:10px;color:white;font-size:8px;font-weight:600;line-height:18px;}}.speciality{.position-container{}}}"),f=(0,i.A)("div",{target:"e1c6pofg11"})("margin-top:8px;line-height:1.5;word-break:break-word;.post-content-replying{display:inline-block;margin-right:5px;color:",l.w.colors.primaryBase,";cursor:pointer;&.tag-only{margin-right:0;}}.post-content{display:inline;white-space:pre-wrap;/* > *:first-of-type,*/\n > mention:first-of-type ~ *{&:not(ul),&:not(ol){display:inline-block;}}> mention:first-of-type{margin-right:5px;}&.has-see-more{*:last-child{&:not(ul),&:not(ol){display:inline;}}}img{width:100%;height:unset;}ul,ol{display:block;padding-left:1rem;list-style-position:inside;}ol{list-style-type:decimal;}ul{list-style-type:disc;}mention{padding-right:4px;color:#1890ff;:hover{text-decoration:underline;}}}.see-more-text{cursor:pointer;}"),b=(0,i.A)("div",{target:"e1c6pofg13"})("display:flex;justify-content:space-between;padding:14px 16px;.like-comment{display:flex;.action{display:flex;align-items:center;margin-right:24px;color:",l.w.colors.gray800,";text-decoration:none;background:transparent;img{width:24px;height:24px;margin-right:4px;cursor:pointer;}}}.write-comment{display:flex;align-items:center;color:",l.w.colors.primaryActive,";cursor:pointer;font-size:14px;font-weight:bold;line-height:22px;text-decoration:none;img{width:18px;height:18px;}}"),x=(0,i.A)("div",{target:"e1c6pofg14"})("display:inline-block;width:3px;height:3px;margin-bottom:calc(0.5em - 3px);background-color:",l.w.colors.gray400,";border-radius:50%;")},jgjd:function(e,o,t){"use strict";var i=t("BGKE"),n=t("+OUp"),l=t("dDsW"),r=t("9brV");o.A=(0,n.forwardRef)((e,o)=>{let{onFinish:t,onClick:a,isFinished:d,resendLabel:c,className:s}=e,[u,p]=(0,n.useState)(r.H5),g=(0,n.useRef)(),m=(0,n.useRef)(),{formatMessage:h}=(0,l.A)();m.current=t;let v=(0,n.useCallback)(()=>{let e=r.H5;p(e),clearInterval(g.current),g.current=setInterval(()=>{if(p(e-=1),0===e){var o;null===(o=m.current)||void 0===o||o.call(m,!0),clearInterval(g.current)}},1e3)},[]),f=(0,n.useCallback)(()=>{p(0),clearInterval(g.current)},[]);return(0,n.useImperativeHandle)(o,()=>({reset:v,cancel:f,isFinished:0===u})),(0,n.useEffect)(()=>(v(),()=>{clearInterval(g.current)}),[]),(0,i.FD)("div",{className:s,onClick:a,children:[c||h({id:"subot.resendOTP.button",defaultMessage:"Resend"}),u>0&&!d&&" (".concat(u,"s)")]})})},XNaN:function(e,o,t){"use strict";t.d(o,{u:function(){return OTPInfoForm}});var i=t("BGKE"),n=t("+OUp"),l=t("tuDO"),r=t("E+oP"),a=t.n(r),d=t("wUmw"),c=t("dDsW"),s=t("RB7Y"),u=t("LSb+"),p=t("aVqH"),g=t("bPK4"),m=t("mYBQ"),h=t("4cPY"),v=t("PAs/"),f=t("Rlzi"),b=t.n(f),x=t("jgjd"),w=t("rBCA"),y=t("iBNF"),k=t("CL9C"),C=t("9brV");let A=(0,w.A)("div",{target:"e1hkw0jq0"})("margin:0 auto;background:#f7f9fc;border-radius:",y.w.borderRadius,";",k.M.mbDown,"{padding:16px;}",k.M.tdDown,"{padding:24px;}",k.M.mbUp,"{padding:32px;}.user-info-form{.input-row{",k.M.mbDown,"{margin-bottom:16px;}",k.M.tdDown,"{margin-bottom:18px;}",k.M.mbUp,"{margin-bottom:20px;}.address-dropdown > ul{z-index:20000;max-height:250px;overflow-y:auto;}&.error{margin-bottom:0;}}label{display:block;margin-bottom:6px;color:",y.w.colors.gray600,";font-size:13px;font-weight:bold;}input[type='tel'],input[type='number']{width:100%;padding:12px 16px;border:solid 1px ",y.w.colors.gray200,";background:#fff;border-radius:",y.w.borderRadius,";&[disabled]{background-color:",y.w.colors.gray100,";}}input[type='number']::-webkit-inner-spin-button,input[type='number']::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;}button{width:100%;}.error-message{display:block;padding-bottom:20px;color:",y.w.colors.red700,";font-weight:",y.w.sizes.fwRegular,";}.submit-btn{padding:12px 24px;background-color:",y.w.colors.primaryBase,";border-radius:",y.w.borderRadius,";color:#fff;cursor:pointer;font-size:16px;font-weight:700;line-height:24px;transition:background-color 0.3s,border-color 0.3s;display:flex;justify-content:center;&:hover{background-color:",y.w.colors.primaryHover,";}&[disabled]{background-color:",y.w.colors.gray200,";color:#bfbfbf;cursor:not-allowed;}.spinner{margin-right:20px;}}.submit-btn-row{",k.M.mbUp,"{margin-bottom:16px;}",k.M.tdDown,"{margin-bottom:14px;}",k.M.mbDown,"{margin-bottom:12px;}.subot-checkbox{display:flex;align-items:flex-start;margin:0;cursor:pointer;&__input{position:relative;display:block;overflow:hidden;width:18px;height:18px;box-sizing:border-box;padding:0;margin-right:10px;&:before{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;background-color:",y.w.colors.primaryBase,";background-image:url('",C.nS,"/checkbox.svg');background-position:center;background-repeat:no-repeat;background-size:120%;content:'';opacity:0;transition:0.3s all ease;}&:checked:before{opacity:1;transition:0.3s all ease;}}&__label{flex:1;font-weight:400;line-height:1.4;}}}}"),M=(0,w.A)("div",{target:"e1hkw0jq1"})("position:relative;.PhoneInputCountry{background-color:#f2f2f2;.PhoneInputCountrySelectArrow{display:none !important;}}.icon-edit-phone{width:1em;height:1em;position:absolute;right:16px;top:17px;cursor:pointer;path{fill:",y.w.colors.gray600,";}}");t("Dfpe");let OTPInfoForm=e=>{let{className:o,style:t,actions:r,countryCode:f,phoneNumber:w,areaCode:y,callBack:k}=e,C=(0,n.useRef)(),[P,S]=(0,n.useState)(!1),[D,_]=(0,n.useState)(!1),[Y,N]=(0,n.useState)(!1),[E,z]=(0,n.useState)(!1),{register:U,formState:{errors:I},control:T,trigger:L,getValues:F,setValue:B}=(0,d.mN)(),{formatMessage:R}=(0,c.A)(),handleSendOTP=async e=>{e.preventDefault();let o=F(),t=(0,s.lq)(o.phone||"");if((null==t?void 0:t.nationalNumber)&&(null==t?void 0:t.countryCallingCode)){_(!0);try{var i;let e=await (0,p.px)((0,g.PU)(u.PATHS.SUBOT.POST_SEND_OTP),"POST",{data:{phone_number:t.nationalNumber,area_code:"+".concat(t.countryCallingCode)}});if(_(!1),(null==e?void 0:e._status)===1){E&&(S(!1),C.current.reset()),z(!0),setTimeout(()=>{let e=document.querySelector(".input-otp-code");e&&(e.focus(),e.scrollIntoView({block:"center"}))},100);return}if((null==e?void 0:e._status)===0&&(null==e?void 0:null===(i=e._messages)||void 0===i?void 0:i[0])==="This phone number was verified"){C.current&&C.current.cancel(),(0,m.showNotification)({title:"",message:"Số điện thoại n\xe0y đ\xe3 được x\xe1c minh.",type:"success"});let e=r.find(e=>e.type===v.rQ.USER_SUBMIT_SEND);e&&k(e,o.phone);return}throw Error()}catch(e){_(!1),C.current&&C.current.cancel(),showMessageSomethingWrong()}}},handleOnVerify=async(e,o)=>{if(e.preventDefault(),N(!0),await L(),a()(I)){let e=F(),{number:t}=e,i=(0,s.lq)(e.phone||"");if((null==i?void 0:i.nationalNumber)&&(null==i?void 0:i.countryCallingCode))try{let n=await (0,p.px)((0,g.PU)(u.PATHS.SUBOT.POST_VERIFY_OTP),"POST",{data:{phone_number:i.nationalNumber,area_code:"+".concat(i.countryCallingCode),code:t}});if(N(!1),(null==n?void 0:n._status)===1){(0,m.showNotification)({title:"",message:R({id:"subot.verifyOTP.success.message"}),type:"success"}),k(o,e.phone);return}throw Error()}catch(e){(0,m.showNotification)({title:"",message:R({id:"validation.error.validOTP"}),type:"danger"}),N(!1)}}else N(!1)},showMessageSomethingWrong=()=>{(0,m.showNotification)({title:"",message:R({id:"notification.comment.somethingWrong"}),type:"danger"})},renderFormInput=e=>{if(!e.key)return null;switch(e.type){case v.rQ.USER_SUBMIT_PHONE:return(0,i.FD)("div",{className:"input-row",children:[(0,i.Y)("label",{htmlFor:e.key,children:e.label}),(0,i.Y)(d.xI,{name:e.key,control:T,rules:{required:!0,validate:e=>(0,s.h1)(e)},render:o=>{let{field:{onChange:t,value:n}}=o,r=!P&&E||D;return(0,i.FD)(M,{children:[(0,i.Y)(h.WK,{value:n,defaultValue:w,onChange:t,defaultCountry:f,id:e.id,className:"input-row ".concat(e.id),name:e.key,disabled:r,flagComponent:h.qX,placeholder:e.label}),r&&(0,i.Y)(b(),{viewBox:"0 0 24 24",className:"icon-edit-phone",onClick:()=>{var e;t(""),z(!1),N(!1),null===(e=C.current)||void 0===e||e.cancel()}}),e.key&&I[e.key]&&(0,i.Y)("p",{className:"error-message",children:R({id:"validation.error.validNumber",defaultMessage:"Please enter a valid number."})}),(0,i.Y)("div",{className:"submit-btn-row",children:(0,i.Y)(l.B,{className:"submit-btn",size:"lg",onClick:handleSendOTP,isDisabled:!P&&E||D,isLoading:D,children:E?(0,i.Y)(x.A,{ref:C,isFinished:P,onFinish:S}):(0,i.Y)("span",{children:R({id:"subot.sendOTP.button",defaultMessage:"Send OTP"})})})},e.id)]})}})]},e.id);case v.rQ.USER_SUBMIT_NUMBER:if(!E)return"";return(0,i.FD)("div",{className:"input-row",children:[(0,i.Y)("label",{htmlFor:e.key,children:e.label}),(0,i.Y)("input",{type:"tel",id:e.id,placeholder:e.label,...U(e.key,{required:!0,pattern:/^[0-9]{0,6}$/}),className:"input-otp-code"}),I[e.key]&&(0,i.Y)("p",{className:"error-message",children:R({id:"validation.error.validOTP",defaultMessage:"Invalid OTP provided"})})]},e.id);default:return""}},renderFormSubmitAndTerms=e=>e.type===v.rQ.USER_SUBMIT_SEND&&E?(0,i.Y)("div",{className:"submit-btn-row",children:(0,i.Y)(l.B,{className:"submit-btn",size:"lg",isDisabled:Y,isLoading:Y,onClick:o=>handleOnVerify(o,e),children:e.label})},e.id):"";return(0,n.useEffect)(()=>{if(w){let e=r.find(e=>e.type===v.rQ.USER_SUBMIT_PHONE);e&&e.key&&B(e.key,"+".concat(y).concat(w))}},[w,y]),(0,i.Y)(A,{className:o,style:t,children:(0,i.FD)("form",{className:"user-info-form",children:[r.map(e=>renderFormInput(e)),r.map(e=>renderFormSubmitAndTerms(e))]})})}},dJ4d:function(e,o,t){"use strict";t.d(o,{R:function(){return i}});let i="other"},"+6r0":function(e,o,t){"use strict";t.d(o,{M:function(){return i}});let i="stateInlineSSO"},iCAz:function(e,o,t){"use strict";t.d(o,{$Q:function(){return extractVoucherAnswers},KA:function(){return getPreviousStateFromStorage},Rx:function(){return extractUnifiedAnswers},ix:function(){return getSubotInlineLogs},xd:function(){return saveSubotInlineLogs}});var i=t("HG5m"),n=t("LSb+"),l=t("aVqH"),r=t("7/Cf"),a=t("bPK4"),d=t("9brV"),c=t("PAs/"),s=t("dJ4d"),u=t("+6r0");let getPreviousStateFromStorage=(e,o)=>{let{getParams:t}=o;try{if(!(0,r.VV)())return null;let o=JSON.parse(localStorage.getItem(u.M)||"");if((null==o?void 0:o.botId)===e&&o.listNodes&&o.activeId&&o.createdAt+18e5>Date.now()){localStorage.removeItem(u.M);let e=o.listNodes.slice(-1)[0].position===c.Ch.SSO;if(e)return{listNodes:o.listNodes,activeId:o.activeId,params:{...t(),...o.params,account_id:(0,r.VV)()||null,cookie_id:(0,r.lT)(o.params.cookie_id)}}}return null}catch(e){return null}},getSubotInlineLogs=async e=>{try{var o,t;if(!e)return null;let i=await (0,l.px)((0,a.PU)(n.PATHS.SUBOT.GET_SUBOT_LOG,{botId:e.id,cookieId:(0,r.lT)(),accountId:(0,r.VV)()||""}),"GET",{params:{type:"inline"}});if(!(null==i?void 0:null===(o=i._data)||void 0===o?void 0:o.data)||(null==i?void 0:null===(t=i._data)||void 0===t?void 0:t.type)!=="inline")return null;let d=JSON.parse(i._data.data),c=d.nodes,s="in_progress"===i._data.status,u="complete"===i._data.status;if(s||u)return{nodes:[e,...c],activeId:d.activeId,params:{...d.params,account_id:(0,r.VV)()||d.params.account_id||null}};return null}catch(e){return null}},getExtraLogsWithCarePath=()=>{try{let e=window.next,o=e.router.components["/[...slug]"].props.pageProps,t="services-connection"===o.template;if(!t)return{};return{project_id:"care-path",user_funnel:o.spotlight.additionalSlugActive||"",audience_name:o.spotlight.groupIdActive||""}}catch(e){return{}}},extractUnifiedAnswers=e=>{let o=e.filter(e=>"Unified Questions"===e.name),t=o.reduce((e,o)=>{var t,i,n,l,r,a,d,u,p,g,m,h,v,f,b,x,w,y,k,C,A;if(o.actions&&(null===(t=o._message)||void 0===t?void 0:t.action_id)&&(null===(i=o._message)||void 0===i?void 0:i.action_value)){let t=o._message.action_value;if(o.type===c.Z6.FORM){let t=["address","province","district","commune"],i=((null===(n=o._message)||void 0===n?void 0:n.form_submit_meta)||[]).filter(e=>!t.includes(e.control)),c=((null===(l=o._message)||void 0===l?void 0:l.form_submit_meta)||[]).filter(e=>t.includes(e.control)).reduce((e,o)=>(e[o.control]=o,e),{}),s=[null===(r=c.address)||void 0===r?void 0:r.value,null===(a=c.commune)||void 0===a?void 0:a.value,null===(d=c.district)||void 0===d?void 0:d.value,null===(u=c.province)||void 0===u?void 0:u.value].filter(Boolean).join(", ");s&&c.address?e.push({attribute:c.address.key,value:s,label_question:(null===(g=o.intents)||void 0===g?void 0:null===(p=g[0])||void 0===p?void 0:p.label)||""}):i.forEach(t=>{var i,n;e.push({attribute:t.key,value:t.value,label_question:(null===(n=o.intents)||void 0===n?void 0:null===(i=n[0])||void 0===i?void 0:i.label)||""})})}if(o.type===c.Z6.TEXT){if(o.is_multi_select){let t=Object.keys(o._message.selected_actions||{}),i=o.actions.filter(e=>e.label&&t.includes(e.id)).map(e=>e.label);t.length&&e.push({attribute:o.actions[0].key||"",value:i,label_question:(null===(h=o.intents)||void 0===h?void 0:null===(m=h[0])||void 0===m?void 0:m.label)||""})}else{let i=o._message.action_id,n=o.actions.find(e=>e.id===i),l=null==n?void 0:n.label,r=null===(b=o._message)||void 0===b?void 0:null===(f=b.form_submit_meta)||void 0===f?void 0:null===(v=f.find(e=>e.key===s.R))||void 0===v?void 0:v.value,a=(null==n?void 0:n.type)===c.rQ.USER_CHOICE_TEXT_BY_INPUT;l&&i&&e.push({attribute:t,value:a&&r?r:l,label_question:(null===(w=o.intents)||void 0===w?void 0:null===(x=w[0])||void 0===x?void 0:x.label)||""})}}if(o.type===c.Z6.POLL){let t=o.id,i=(null===(k=o._message)||void 0===k?void 0:null===(y=k.current_polls)||void 0===y?void 0:y[t])||[],n=o.actions.filter(e=>e.label&&i.includes(e.id)).map(e=>e.label);i.length&&e.push({attribute:o.actions[0].key||"",value:n,label_question:(null===(A=o.intents)||void 0===A?void 0:null===(C=A[0])||void 0===C?void 0:C.label)||""})}}return e},[]);return t},extractVoucherAnswers=(e,o)=>{try{var t;if((null===(t=o.extra_settings)||void 0===t?void 0:t.subot_type)!==i.h.voucherAcuvue)return;let n="",l="",a="",d="",s="",u={},p=(0,r.Us)().email;if((e||[]).forEach(e=>{var o,t,i,r,g,m;let h=e._message;if(!h)return;let v=null===(o=e.actions)||void 0===o?void 0:o.find(e=>e.id===h.action_id);if("voucher_product"===h.action_value?n=(null==v?void 0:v.label)||"":"voucher_color"===h.action_value&&(l=(null==v?void 0:v.label)||""),e.type===c.Z6.FORM){let e=null===(t=h.form_submit_meta)||void 0===t?void 0:t.find(e=>"voucher_size"===e.key),o=null===(i=h.form_submit_meta)||void 0===i?void 0:i.find(e=>"voucher_location"===e.key),n=null===(r=h.form_submit_meta)||void 0===r?void 0:r.find(e=>"email"===e.control),l=null===(g=h.form_submit_meta)||void 0===g?void 0:g.find(e=>"tel"===e.control);e&&(a=e.value),o&&(d=o.value),n&&(p=n.value),l&&(s=l.value),null===(m=h.form_submit_meta)||void 0===m||m.filter(e=>!["voucher_size","voucher_location","email","tel"].includes(e.control)).forEach(e=>{u[e.key]=e.value})}}),"ACUVUE\xae OASYS (1-DAY) WITH HYDRALUXE\xae"===n&&p)return{...u,email:p,voucherName:n,voucher_product:n,voucher_location:d,voucher_size:a,voucher_color:l,phone:s};if(n&&l&&a&&p)return{...u,email:p,voucherName:"".concat(n,"|").concat(l,"|").concat(a),voucher_product:n,voucher_location:d,voucher_size:a,voucher_color:l,phone:s}}catch(e){console.log("ExtractVoucherAnswer",e)}},saveSubotInlineLogs=async e=>{let{nodes:o,activeId:t,params:i,accountIdFromLogs:s}=e;try{let e="in_progress",u=o[o.length-1];(null==u?void 0:u.type)&&c.sR.includes(u.type)&&(e="complete");let p=o.slice(1),g={activeId:t,params:i,nodes:p,tracking:{...getExtraLogsWithCarePath(),full_url:window.location.href},unifiedAnswers:extractUnifiedAnswers(p),voucherAnswers:extractVoucherAnswers(p,o[0])},m={cookie_id:(0,r.lT)(),account_id:s||(0,r.VV)()||null,bot_id:o[0].id,flow_uuid:o[0].flow_uuid,data:JSON.stringify(g),status:e,type:"inline",market:d.HL[l.Hg]};await (0,l.px)((0,a.PU)(n.PATHS.SUBOT.POST_SUBOT_CREATE_LOG),"POST",{data:m})}catch(e){}}},rp0m:function(e,o,t){"use strict";t.d(o,{_:function(){return VideoList}});var i=t("BGKE"),n=t("+OUp"),l=t.n(n),r=t("iBNF"),a=t("+YhV"),d=t("yUew"),c=t("P+HS"),s=t("a5L+"),u=t("rBCA"),p=t("CL9C"),g=t("U+Ez");let m=(0,u.A)("div",{target:"e1hasf570"})(p.M.mbDown,"{margin-left:-16px;margin-right:-16px;}"),h=(0,u.A)(c.Carousel,{target:"e1hasf571"})(),v=(0,u.A)(g.H,{target:"e1hasf572"})("margin-block:20px;padding-left:16px;border-left:5px solid ",null===r.w||void 0===r.w?void 0:r.w.colors.primaryBase,";"),VideoList=e=>{let{videos:o,title:t,description:n,slideToShow:u=1.2,isAutoPlay:p=!1,...g}=e,f=(0,s.a)();return(null==o?void 0:o.length)&&0!==o.length?1===o.length?(0,i.FD)(m,{...g,children:[t&&(l().isValidElement(t)?t:(0,i.Y)(v,{tag:"h2",color:r.w.colors.secondaryBase,children:t})),n&&(0,i.Y)(a.T,{size:"p3",style:{marginBottom:"16px"},children:n}),(0,i.Y)(d.S,{url:o[0].videoUrl||"",autoPlay:p})]}):(0,i.FD)(m,{...g,children:[t&&(l().isValidElement(t)?t:(0,i.Y)(v,{tag:"h2",color:r.w.colors.secondaryBase,children:t})),n&&(0,i.Y)(a.T,{size:"p3",style:{marginBottom:"16px"},children:n}),(0,i.Y)(h,{slidesToShow:u,slideGap:f?16:24,withIndicators:!1,controlSize:32,controlsOffset:5,draggable:!1,speed:8,children:o.map((e,o)=>(0,i.Y)(c.Carousel.Slide,{children:(0,i.Y)(d.S,{url:e.videoUrl||"",autoPlay:p})},o))})]}):null}},"4cPY":function(e,o,t){"use strict";t.d(o,{LR:function(){return PhoneInput},WK:function(){return PhoneInputWithCode},qX:function(){return FlagComponent}});var i=t("BGKE"),n=t("rBCA"),l=t("iBNF"),r=t("TSYQ"),a=t.n(r),d=t("RB7Y"),c=t("SSaT"),s=t.n(c);let u=(0,n.A)("div",{target:"egdqp8n0"})("display:flex;align-items:center;> svg,> img{width:24px;height:24px;margin-right:5px;border-radius:2px;}> div{color:",l.w.colors.gray800||"",";white-space:nowrap;}"),p=(0,n.A)(d.Ay,{target:"egdqp8n1"})("display:flex;border:1px solid ",l.w.colors.gray200||"",";border-radius:",l.w.borderRadius,";.PhoneInputCountry{position:relative;padding:12px 8px 12px 16px;border-right:1px solid ",l.w.colors.gray200||"",";background-color:",l.w.colors.gray100||"",";border-radius:6px 0 0 6px;color:",l.w.colors.gray800||"",";.PhoneInputCountrySelect{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;pointer-events:none;}.PhoneInputCountryIconImg{width:24px;height:16px;border-radius:2px;object-fit:cover;object-position:center;}}.PhoneInputInput{padding:0 16px;}&.has--error{border-color:",l.w.colors.red700||"",";}&.PhoneInput--focus{border-color:",l.w.colors.primaryBase||"",";box-shadow:0px 0px 2px 2px #91caff;}"),g=(0,n.A)(d.Ay,{target:"egdqp8n2"})("&.PhoneInput{.PhoneInputCountry{padding:10px;border:solid 1px ",l.w.colors.gray200,";border-right:none;margin:0;background-color:#f2f2f2;border-bottom-left-radius:6px;border-top-left-radius:6px;padding:0 15px;.PhoneInputCountrySelectArrow{transform:rotate(0deg);display:flex;align-items:center;border:none;margin-left:10px;width:auto;}}.PhoneInputInput{padding-left:10px;border:solid 1px ",l.w.colors.gray200,";margin:0;width:100%;padding:12px 16px;background:#fff;border-bottom-left-radius:0 !important;border-bottom-right-radius:6px !important;border-top-left-radius:0 !important;border-top-right-radius:6px !important;}.PhoneInputCountrySelect{+ .PhoneInputCountryIcon--border{border:none;box-shadow:none;}}&.PhoneInput--readOnly{.PhoneInputCountrySelect{pointer-events:none;}}}.PhoneInputCountryIcon{width:auto;height:auto;box-shadow:none;background-color:transparent;.PhoneInputCountryIconImg{width:24px;height:24px;}}"),FlagComponentPHOnly=e=>{let o="+("+(0,d.Ko)(e.country)+")";return(0,i.FD)(u,{children:[(0,i.Y)(s(),{}),(0,i.Y)("div",{children:o})]})},FlagComponent=e=>{var o;let t="+("+(0,d.Ko)(e.country)+")",n=null===(o=e.flagUrl)||void 0===o?void 0:o.replace("{XX}",e.country);return(0,i.FD)(u,{children:[(0,i.Y)("img",{className:"PhoneInputCountryIconImg",alt:e.countryName,src:n,loading:"lazy"}),(0,i.Y)("div",{children:t})]})},PhoneInput=e=>{let{className:o,error:t,...n}=e;return(0,i.Y)(p,{className:a()(o,{"has--error":!!t}),flagComponent:FlagComponentPHOnly,...n})},PhoneInputWithCode=e=>(0,i.Y)(g,{...e,flagComponent:FlagComponent})},YRaK:function(e,o,t){"use strict";t.d(o,{A:function(){return embedAffiliateProduct}});var i=t("BGKE"),n=t("rBCA"),l=t("U+Ez"),r=t("iBNF"),a=t("+OUp"),d=t("+YhV"),c=t("NQBa"),s=t("tuDO"),u=t("8BcA"),p=t.n(u),g=t("dDsW"),m=t("ROQx"),h=t("LSb+"),v=t("aVqH"),f=t("bPK4"),b=t("/sjq"),x=t("AG8C"),w=t("9brV"),y=t("CL9C"),k=t("ysNr");let C=(0,n.A)("div",{target:"evw5lgk0"})(y.M.mbDown,"{margin:32px 0 8px 0;}",y.M.mbUp,"{margin:48px 0 32px 0;}padding:16px;border-radius:",r.w.borderRadius,";box-shadow:0px 10px 16px rgba(0,0,0,0.04),0px 2px 8px rgba(0,0,0,0.04),0px 0px 1px rgba(0,0,0,0.04);.divider{border-top:8px solid #f7f9fc;border-bottom:none;margin:0;margin-left:-1rem;}"),A=(0,n.A)("div",{target:"evw5lgk1"})(y.M.mbUp,"{display:flex;justify-content:space-between;}",y.M.mbDown,"{padding-bottom:24px;}.collapse-button{width:100%;margin-top:16px;",y.M.mbUp,"{margin-top:8px;}.down-icon{width:18px;height:18px;margin-left:8px;vertical-align:middle;}.up-icon{width:18px;height:18px;margin-left:8px;vertical-align:text-top;}}&[data-is-carousel='true']{.container{padding:0;.section{",y.M.mbDown,"{padding:0 16px;}}.item-grid{padding:0;}}}"),M=(0,n.A)("div",{target:"evw5lgk2"})("display:flex;height:36px;align-items:center;margin-top:8px;"),P=(0,n.A)(d.T,{target:"evw5lgk3"})("margin-right:16px;font-size:18px;font-weight:600;line-height:26px;&[data-is-single-vendor='true']{overflow:hidden;width:35%;margin:0;}"),S=(0,n.A)(d.T,{target:"evw5lgk4"})(y.M.mbUp,"{min-height:51px;}margin-top:4px;font-size:18px;font-weight:600;line-height:26px;"),D=(0,n.A)("div",{target:"evw5lgk5"})(y.M.mbUp,"{width:calc(50% - 16px);}"),_=(0,n.A)("div",{target:"evw5lgk6"})(y.M.mbUp,"{width:50%;}"),Y=(0,n.A)("div",{target:"evw5lgk7"})("position:relative;"),N=(0,n.A)("div",{target:"evw5lgk8"})("position:absolute;z-index:10;top:5px;right:5px;height:26px;padding:4px 6px;background-color:",r.w.colors.red500,";border-radius:",r.w.borderRadius,";color:white;"),E=(0,n.A)(d.T,{target:"evw5lgk9"})("min-height:18px;",y.M.mbUp,"{min-height:25px;}"),z=(0,n.A)("a",{target:"evw5lgk10"})("color:",r.w.colors.gray400,";text-decoration:none;"),U=(0,n.A)("div",{target:"evw5lgk11"})("text-align:center;"),I=(0,n.A)("img",{target:"evw5lgk12"})("width:auto;max-width:100%;height:230px;",y.M.mbUp,"{height:208px;}"),T=(0,n.A)("div",{target:"evw5lgk13"})(y.M.mbUp,"{position:absolute;background:white;z-index:10;top:60px;width:100%;&[data-is-single-vendor='false']{&[data-is-shown-description='true']{overflow:visible;}}}transition:all 0.5s linear;overflow:hidden;box-sizing:border-box;&[data-is-collapse='true']{max-height:0;padding:0 16px;border:0px solid transparent;",y.M.mbDown,"{margin-top:0;}border-radius:",r.w.borderRadius,";}.event{pointer-events:none;align-items:center;}&[data-is-collapse='false']{max-height:310px;padding:8px 16px;border:1px solid #e4e8ec;",y.M.mbDown,"{margin-top:16px;}border-radius:",r.w.borderRadius,";}"),L=(0,n.A)("a",{target:"evw5lgk14"})("display:flex;align-items:center;justify-content:space-between;margin:8px 0;text-decoration:none;"),F=(0,n.A)("div",{target:"evw5lgk15"})("display:flex;align-items:center;gap:8px;"),B=(0,n.A)("img",{target:"evw5lgk16"})("max-width:32px;"),R=(0,n.A)(d.T,{target:"evw5lgk17"})("font-size:14px;font-weight:600;line-height:22px;"),O=(0,n.A)("div",{target:"evw5lgk18"})("margin-top:16px;",y.M.mbUp,"{position:relative;}a{text-decoration:none;}"),H=(0,n.A)("div",{target:"evw5lgk19"})("margin:16px 0;&[data-is-single-vendor='true']{flex-grow:1;margin:0;}"),V=(0,n.A)("div",{target:"evw5lgk20"})("color:",r.w.colors.primaryActive,";font-size:14px;font-weight:bold;line-height:22px;"),j=(0,n.A)("div",{target:"evw5lgk21"})("display:flex;align-items:center;"),q=(0,n.A)("div",{target:"evw5lgk22"})("width:28px;height:28px;cursor:pointer;"),W=(0,n.A)("div",{target:"evw5lgk23"})("width:calc(100% - 68px);box-sizing:border-box;padding:5px 8px;border:1px solid ",r.w.colors.gray400,";margin-right:8px;border-radius:",r.w.borderRadius,";"),Q=(0,n.A)("div",{target:"evw5lgk24"})("position:relative;display:flex;width:16px;align-items:center;margin-right:8px;&[data-is-shown-description='false']{&::before{display:none;}}"),K=(0,n.A)("img",{target:"evw5lgk25"})("width:16px;height:16px;margin-right:4px;&:hover{cursor:pointer;}"),G=(0,n.A)("div",{target:"evw5lgk26"})(y.M.mbUp,"{&::before{position:absolute;z-index:9;top:-3%;left:117px;content:' ';width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:8px solid ",r.w.colors.gray100,";}}&[data-is-shown-description='false']{display:none;}",y.M.mbUp,"{position:absolute;width:330px;z-index:10;top:130%;left:-116px;}box-sizing:border-box;border:1px solid ",r.w.colors.gray100,";background:",r.w.colors.neutral50,";border-radius:",r.w.borderRadius,";"),Z=(0,n.A)("div",{target:"evw5lgk27"})("margin:16px;.promotion-condition{.condition-content{ul{list-style:inside;}}}"),X=(0,n.A)("div",{target:"evw5lgk28"})("margin-bottom:17px;color:red;"),J=(0,n.A)("div",{target:"evw5lgk29"})("display:flex;align-items:center;justify-content:space-between;"),$=(0,n.A)(s.B,{target:"evw5lgk30"})("width:100%;margin-top:16px;"),ee=(0,n.A)("div",{target:"evw5lgk31"})(y.M.mbDown,"{position:fixed;left:50%;left:0;bottom:0;width:100%;background-color:",r.w.colors.white,";border-radius:",r.w.borderRadius,";transition:all 5s ease-in-out;box-shadow:0px 0px 4px ",r.w.colors.gray200,";&[data-open='true']{transition:all 5s ease-in-out;z-index:200;bottom:0;opacity:1;visibility:visible;width:100%;}}"),eo=(0,n.A)("div",{target:"evw5lgk32"})("position:fixed;z-index:110;top:0;left:0;width:100%;height:100%;align-items:center;background:rgba(38,38,38,0.3);&[data-open='false']{display:none;}"),et=(0,n.A)("div",{target:"evw5lgk33"})("position:absolute;z-index:10;top:210px;right:28px;width:calc(50% - 28px);.affiliate-scroll-list > .container{overflow-y:hidden;}"),ei=(0,n.A)("div",{target:"evw5lgk34"})("position:absolute;z-index:10;top:118px;right:28px;width:210px;transition-delay:0.4s;&[data-is-hidden='true']{opacity:0;transition:0s;visibility:hidden;}"),en=(0,n.A)(k.S,{target:"evw5lgk35"})(".image-gallery-wrapper .image-block{width:initial;}");var el=t("ECoa"),er=t("UQ/i"),ea=t("a5L+");let AffiliateSkeleton=()=>{let e=(0,ea.a)();return(0,i.FD)(C,{children:[e?(0,i.Y)(er.TQ,{type:"solid",className:"divider"}):null,(0,i.FD)(A,{children:[(0,i.Y)(D,{children:(0,i.Y)(Y,{children:(0,i.Y)(el.A,{height:e?306:277})})}),(0,i.FD)(_,{children:[(0,i.Y)(el.A,{width:100,height:21,style:{marginBottom:8}}),(0,i.Y)(el.A,{className:"product-title",height:51,style:{marginBottom:8}}),(0,i.Y)(el.A,{height:30,width:200,style:{marginBottom:8}}),(0,i.Y)(el.A,{height:45,className:"collapse-button collapse"})]})]}),e?(0,i.Y)(er.TQ,{type:"solid",className:"divider"}):null]})};var ed=t("n/tb");let AffiliatePromotion=e=>{var o,t,n,l,r;let{vendor:s,shownDescription:u,isMobile:m,isSingleVendor:h,isCopied:v,idxPromotion:f,setCopied:b,dataProductChannel:x,dataProductSku:y,dataProductBrand:k,dataProductName:C,dataProductPrice:A,dataProductCategory:M}=e,{formatMessage:P}=(0,g.A)(),[S,D]=(0,a.useState)(!1);(0,a.useEffect)(()=>{u(S)},[S]);let copyToClipboard=async e=>{try{b(-1),await navigator.clipboard.writeText(e),b(f)}catch(e){console.error("Failed to copy: ",e)}},DescriptionPromotion=()=>{var e,o,t,n,l;return(0,i.Y)(G,{"data-is-shown-description":S,"data-is-single-vendor":h,children:(0,i.FD)(Z,{children:[(0,i.Y)(X,{children:(0,i.Y)(d.T,{size:"p4",type:"bold",color:"#262626",style:{display:"inline"},children:null==s?void 0:null===(e=s.promotion)||void 0===e?void 0:e.name})}),(0,i.FD)(J,{children:[(0,i.Y)(d.T,{size:"n1",type:"bold",color:"#595959",style:{fontWeight:600},children:P({id:"affiliate.promotion.discountCode",defaultMessage:"Discount Code"})}),(0,i.Y)(d.T,{size:"n1",type:"bold",color:"#2685F1",children:null==s?void 0:null===(o=s.promotion)||void 0===o?void 0:o.code}),(0,i.Y)(q,{onClick:()=>{var e;return copyToClipboard(null==s?void 0:null===(e=s.promotion)||void 0===e?void 0:e.code)},children:(0,i.Y)("img",{loading:"lazy",src:v?"".concat(w.Mp,"/copy-success.svg"):"".concat(w.Mp,"/copy-blue.svg"),alt:"Copy Button","data-event-category":"Affiliates","data-event-action":"Copy Promotion Code","data-event-label":"".concat(null==s?void 0:null===(t=s.promotion)||void 0===t?void 0:t.name,": ").concat(null==s?void 0:null===(n=s.promotion)||void 0===n?void 0:n.code),"data-product-channel":x,"data-product-sku":y,"data-product-brand":k,"data-product-name":C,"data-product-price":A,"data-product-category":M})})]}),(0,i.Y)(c.D,{type:"solid"}),(0,i.FD)("div",{className:"promotion-end-date",children:[(0,i.Y)(d.T,{size:"n1",type:"bold",color:"#595959",style:{fontWeight:600},children:P({id:"affiliate.promotion.endDate",defaultMessage:"End Date"})}),(0,i.Y)(d.T,{size:"n1",color:"#737373",children:p()().format(w.K_)})]}),(0,i.Y)(c.D,{type:"solid"}),(0,i.FD)("div",{className:"promotion-condition",children:[(0,i.Y)(d.T,{size:"n1",type:"bold",color:"#595959",style:{fontWeight:600},children:P({id:"affiliate.promotion.condition",defaultMessage:"Condition"})}),(0,i.Y)(d.T,{size:"n1",color:"#737373",children:(0,i.Y)("span",{className:"condition-content",dangerouslySetInnerHTML:{__html:null==s?void 0:null===(l=s.promotion)||void 0===l?void 0:l.description}})})]}),m&&(0,i.Y)($,{color:"secondary",size:"md",onClick:()=>D(!1),children:P({id:"affiliate.promotion.close",defaultMessage:"Close"})})]})})};return(0,i.Y)(H,{"data-is-single-vendor":h,children:(0,i.FD)(j,{children:[(null==s?void 0:null===(o=s.promotion)||void 0===o?void 0:o.description)&&(0,i.FD)(Q,{"data-is-shown-description":S,onMouseEnter:()=>!m&&D(!0),onMouseLeave:()=>!m&&D(!1),onClick:()=>m&&D(!0),children:[(0,i.Y)(K,{src:"".concat(w.Mp,"/info-dark.svg"),alt:"Description Info"}),m?(0,i.FD)(i.FK,{children:[(0,i.Y)(ee,{"data-open":S,onClick:e=>e.stopPropagation(),children:(0,i.Y)(DescriptionPromotion,{})}),(0,i.Y)(eo,{"data-open":S,onClick:e=>{e.stopPropagation(),D(!1)}})]}):(0,i.Y)(DescriptionPromotion,{})]}),(0,i.FD)(W,{children:[(0,i.Y)(d.T,{size:"n1",style:{display:"inline"},children:"".concat(null==s?void 0:null===(t=s.promotion)||void 0===t?void 0:t.name,": ")}),(0,i.Y)(d.T,{size:"n1",type:"bold",color:"#737373",style:{display:"inline"},children:null==s?void 0:null===(n=s.promotion)||void 0===n?void 0:n.code})]}),(0,i.Y)(q,{onClick:()=>{var e;return copyToClipboard(null==s?void 0:null===(e=s.promotion)||void 0===e?void 0:e.code)},children:(0,i.Y)("img",{loading:"lazy",src:v?"".concat(w.Mp,"/copy-success.svg"):"".concat(w.Mp,"/copy.svg"),alt:"Copy Button","data-event-category":"Affiliates","data-event-action":"Copy Promotion Code","data-event-label":"".concat(null==s?void 0:null===(l=s.promotion)||void 0===l?void 0:l.name,": ").concat(null==s?void 0:null===(r=s.promotion)||void 0===r?void 0:r.code),"data-product-channel":x,"data-product-sku":y,"data-product-brand":k,"data-product-name":C,"data-product-price":A,"data-product-category":M})})]})})},Affiliate=e=>{var o,t,n,u,y,k,H,j,q,W,Q,K,G,Z,X,J,$,ee,eo,et,ei,el,er,ea,ec,es,eu,ep,eg,em,eh,ev,ef,eb,ex,ew,ey,ek,eC,eA,eM,eP,eS,eD,e_,eY,eN,eE,ez,eU,eI,eT,eL,eF,eB;let{productId:eR,isCarousel:eO,isMobile:eH,noFollow:eV,sponsored:ej,openNewTab:eq,changeCollapseCarousel:eW,isCarouselCollapse:eQ,idxAffiliate:eK,isFocus:eG,setFocus:eZ,title:eX=""}=e,[eJ,e$]=(0,a.useState)(!0),[e0,e1]=(0,a.useState)(null),[e2,e6]=(0,a.useState)(!1),[e5,e4]=(0,a.useState)(-1),[e3,e8]=(0,a.useState)(!1),{locale:e7,router:{asPath:e9}}=(0,x.$)(),{formatMessage:oe}=(0,g.A)();(0,a.useEffect)(()=>{eH||e$(!!eQ)},[eQ]),(0,a.useEffect)(()=>{e4(-1)},[eG]),(0,a.useEffect)(()=>{let fetchProductDetail=async()=>{var e,o;e8(!1);let t=await (0,v.px)((0,f.er)(h.PATHS.COMMON.GET_AFFILIATE_PRODUCT,{productId:eR}),"get");if(null==t?void 0:null===(e=t.data)||void 0===e?void 0:e[0]){let e=(0,m.Og)(null==t?void 0:null===(o=t.data)||void 0===o?void 0:o[0],e7);e1(e)}e8(!0)};fetchProductDetail()},[]);let oo=(0,a.useRef)(null),ot=(0,a.useRef)(0);if((0,a.useEffect)(()=>{var e;let o=null===(e=oo.current)||void 0===e?void 0:e.previousElementSibling;for(;o;)"P"===o.tagName&&ot.current++,o=o.previousElementSibling;console.log("Number of
tags above the
tags above the