@hhgtech/hhg-components 1.22.8 → 1.22.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/care.js +1 -1
- package/build/components/mantine/CentralCarousel/index.d.ts +1 -0
- package/build/components.js +1 -1
- package/build/{cookieHelper-612b90fa.js → cookieHelper-3553173d.js} +1 -1
- package/build/esm/care.js +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/cookieHelper-8c12973e.js +1 -0
- package/build/esm/hooks.js +1 -1
- package/build/esm/{index-7b7b3406.js → index-5a0d36de.js} +1 -1
- package/build/esm/{index-37ba6c72.js → index-681be88e.js} +1 -1
- package/build/esm/{index-649fc75a.js → index-6f851157.js} +1 -1
- package/build/esm/index-d20231b7.js +1 -0
- package/build/esm/{index-c014ea04.js → index-fcd90b74.js} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/lead.js +1 -0
- package/build/esm/mantine.js +1 -1
- package/build/esm/misc.js +1 -1
- package/build/esm/navigation.js +1 -1
- package/build/esm/pwg.js +1 -1
- package/build/esm/together.js +1 -1
- package/build/esm/{types-d1fd7d11.js → types-5dc38a6e.js} +1 -1
- package/build/esm/{types-2b84314e.js → types-a219eed8.js} +1 -1
- package/build/esm/{useFbDataLayer-c44ed8d3.js → useFbDataLayer-5c74c566.js} +1 -1
- package/build/hooks.js +1 -1
- package/build/{index-de78a526.js → index-145ee47e.js} +1 -1
- package/build/{index-587a9376.js → index-3aff0afd.js} +1 -1
- package/build/{index-4ee9e0a4.js → index-46d18a00.js} +1 -1
- package/build/{index-6a4ab611.js → index-54e59382.js} +1 -1
- package/build/index-8ddc0bb9.js +1 -0
- package/build/index.js +1 -1
- package/build/lead/campaign.d.ts +12 -0
- package/build/lead/constants.d.ts +0 -2
- package/build/lead/index.d.ts +9 -0
- package/build/lead/index.styled.d.ts +1 -0
- package/build/lead/layouts/centerTab.d.ts +10 -0
- package/build/lead/layouts/closeButton.d.ts +6 -0
- package/build/lead/layouts/floating.d.ts +15 -0
- package/build/lead/layouts/lightbox.d.ts +13 -0
- package/build/lead/layouts/tab.d.ts +9 -0
- package/build/lead/leadGenContext.d.ts +9 -0
- package/build/lead/newLeadPopup.d.ts +12 -0
- package/build/lead/oldLeadPopup.d.ts +12 -0
- package/build/lead/thankyou.d.ts +11 -0
- package/build/lead/utils.d.ts +6 -1
- package/build/lead.js +1 -0
- package/build/mantine.js +1 -1
- package/build/misc/cookieHelper.d.ts +6 -1
- package/build/misc.js +1 -1
- package/build/navigation.js +1 -1
- package/build/pwg.js +1 -1
- package/build/together.js +1 -1
- package/build/{types-636fe383.js → types-3b481a79.js} +1 -1
- package/build/{types-643498e8.js → types-d0f54c42.js} +1 -1
- package/build/{useFbDataLayer-bf534f29.js → useFbDataLayer-88be276d.js} +1 -1
- package/package.json +3 -1
- package/build/esm/cookieHelper-0e8521c3.js +0 -1
- package/build/esm/index-b080540e.js +0 -1
- package/build/index-ebe71f71.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-e6f346c4.js"),t=require("react"),o=require("./index-aba6bda8.js"),i=require("./utils-df758048.js"),n=require("styled-components"),r=require("./cookieHelper-612b90fa.js"),a=require("slugify"),l=require("string-format");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u,d,c=s(t),_=s(n),p=s(a),m=s(l),v={xs:28,small:32,medium:40,large:48,xl:64,xxl:80,xxxl:96},g=_.default.div(u||(u=e.__makeTemplateObject(["\n position: fixed;\n left: 50%;\n\n padding: 0 16px 32px;\n background-color: ",";\n border-radius: 6px;\n box-shadow: 0px 4px 8px ",";\n transform: translate(-50%, -50%);\n transition: all 0.5s ease-in-out;\n visibility: hidden;\n\n &[data-open='true'] {\n z-index: 200;\n top: 50%;\n opacity: 1;\n visibility: visible;\n }\n\n &[data-open='false'] {\n top: -50%;\n }\n\n &[data-type='lead'] {\n width: 332px;\n height: 460px;\n\n div {\n top: -15px;\n right: -15px;\n }\n }\n\n &[data-type='form'] {\n width: 496px;\n height: 548px;\n "," {\n width: 340px;\n }\n }\n\n &[data-type='confirm'] {\n "," {\n width: calc(100% - 32px);\n }\n "," {\n width: 100%;\n max-width: 407px;\n }\n }\n\n .popup-content {\n position: relative;\n z-index: 111;\n height: 100%;\n padding: 16px;\n }\n\n .close-button {\n position: absolute;\n top: 16px;\n right: 0;\n cursor: pointer;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n }\n }\n"],["\n position: fixed;\n left: 50%;\n\n padding: 0 16px 32px;\n background-color: ",";\n border-radius: 6px;\n box-shadow: 0px 4px 8px ",";\n transform: translate(-50%, -50%);\n transition: all 0.5s ease-in-out;\n visibility: hidden;\n\n &[data-open='true'] {\n z-index: 200;\n top: 50%;\n opacity: 1;\n visibility: visible;\n }\n\n &[data-open='false'] {\n top: -50%;\n }\n\n &[data-type='lead'] {\n width: 332px;\n height: 460px;\n\n div {\n top: -15px;\n right: -15px;\n }\n }\n\n &[data-type='form'] {\n width: 496px;\n height: 548px;\n "," {\n width: 340px;\n }\n }\n\n &[data-type='confirm'] {\n "," {\n width: calc(100% - 32px);\n }\n "," {\n width: 100%;\n max-width: 407px;\n }\n }\n\n .popup-content {\n position: relative;\n z-index: 111;\n height: 100%;\n padding: 16px;\n }\n\n .close-button {\n position: absolute;\n top: 16px;\n right: 0;\n cursor: pointer;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n }\n }\n"])),(function(e){return e.theme.colors.white}),(function(e){return e.theme.colors.gray200}),i.MediaQueries.mbDown,i.MediaQueries.mbDown,i.MediaQueries.mbUp),h=_.default.div(d||(d=e.__makeTemplateObject(["\n position: fixed;\n z-index: 110;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n align-items: center;\n background: rgba(38, 38, 38, 0.3);\n\n &[data-open='false'] {\n display: none;\n }\n"],["\n position: fixed;\n z-index: 110;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n align-items: center;\n background: rgba(38, 38, 38, 0.3);\n\n &[data-open='false'] {\n display: none;\n }\n"]))),E="DD/MM/YYYY",f="/images/avatar.jpg",T="/images/default-image.jpg",b={DUE_DATE:"DUE_DATE",BMI:"BMI",BMR:"BMR",OVULATION:"OVULATION",IFRAME:"IFRAME",PWG:"PWG",THR:"THR"},A={"id-ID":{"kalkulator-bmi":b.BMI,"kebutuhan-kalori":b.BMR,"kalkulator-hari-perkiraan-lahir":b.DUE_DATE,"kalkulator-masa-subur-2":b.OVULATION,"kalkulator-kenaikan-berat-badan-ibu-hamil":b.PWG,"kalkulator-detak-jantung-saat-olahraga":b.THR},"ms-MY":{"kalkulator-bmi":b.BMI,"kalkulator-bmr":b.BMR,"kalkulator-tarikh-bersalin":b.DUE_DATE,"kalkulator-kesuburan":b.OVULATION,"kalkulator-tambah-berat-badan-hamil":b.PWG,"target-heart-rate-calculator":b.THR},"vi-VN":{"cach-tinh-chi-so-bmi":b.BMI,"tinh-chi-so-bmr":b.BMR,"cong-cu-tinh-ngay-du-sinh":b.DUE_DATE,"tinh-ngay-rung-trung":b.OVULATION,"cong-cu-tinh-can-nang-khi-mang-thai":b.PWG,"cong-cu-do-nhip-tim":b.THR},"zh-TW":{"bmi-calculator":b.BMI,"bmr-calculator":b.BMR,"due-date-calculator":b.DUE_DATE,"ovulation-calculator":b.OVULATION,"pregnancy-weight-gain-calculator":b.PWG,"target-heart-rate-calculator":b.THR},"en-PH":{"bmi-calculator":b.BMI,"bmr-calculator":b.BMR,"due-date-calculator":b.DUE_DATE,"ovulation-calculator":b.OVULATION,"pregnancy-weight-gain-calculator":b.PWG,"target-heart-rate-calculator":b.THR},"th-TH":{"เครื่องคำนวณหา-ค่าดัชนี":b.BMI,"เครื่องคำนวณอัตราการเผาผลาญพลังงาน-bmr":b.BMR,"เครื่องมือคำนวณกำหนดคลอด":b.DUE_DATE,"เครื่องคำนวณการตกไข่-ovulation-calculat":b.OVULATION,"เครื่องคำนวณน้ำหนักตัว":b.PWG,"เครื่องวัดอัตราการเต้น":b.THR},"hi-IN":{"bmi-calculator-en":b.BMI,"bmi-calculator":b.BMI,"bmr-calculator":b.BMR,"delivery-date-calculator":b.DUE_DATE,"ovulation-calculator":b.OVULATION,"pregnancy-weight-gain-calculator":b.PWG,"target-heart-rate-calculator":b.THR},"km-KH":{"គណនា-bmi":b.BMI,"គណនា-bmr":b.BMR,"គណនាថ្ងៃសម្រាលកូន":b.DUE_DATE,"គណនាថ្ងៃមេជីវិតញីទុំធ្លាក់":b.OVULATION,"គណនាទម្ងន់ស្ត្រីពពោះ":b.PWG,"គណនារកចង្វាក់បេះដូងល្អ":b.THR},"my-MM":{"bmi-calculator":b.BMI,"bmr-calculator":b.BMR,"due-date-calendar":b.DUE_DATE,"ovulation-calculator":b.OVULATION,"pregnaancy-weight-calculator":b.PWG,"target-heartrate":b.THR,"pregnancy-weight-calculator":b.PWG,"target-heart-rate":b.THR}},y="hhg_user_token",O="together_admin_token",w={report_scam:{label:"morePopover.report.scam",reportReasonText:"morePopover.report.scam"},report_sex:{label:"morePopover.report.sex",reportReasonText:"morePopover.report.sex"},report_offensive:{label:"morePopover.report.offensive",reportReasonText:"morePopover.report.offensive"},report_violence:{label:"morePopover.report.violence",reportReasonText:"morePopover.report.violence"},report_prohibited:{label:"morePopover.report.prohibited",reportReasonText:"morePopover.report.prohibited"},report_spam:{label:"morePopover.report.spam",reportReasonText:"morePopover.report.spam"},report_falseNews:{label:"morePopover.report.falseNews",reportReasonText:"morePopover.report.falseNews"},report_other:{label:"morePopover.report.other",reportReasonText:"morePopover.report.other"}},I={"en-PH":{ALL:"all",HOSPITAL:"hospital",SERVICE:"service",DOCTOR:"doctor",SEARCH:"search",SPECIALTIES:"specialties",CURRENT:"current-location"},"vi-VN":{ALL:"tat-ca",HOSPITAL:"benh-vien",SERVICE:"dich-vu",DOCTOR:"bac-si",SEARCH:"tim-kiem",SPECIALTIES:"chuyen-khoa",CURRENT:"vi-tri-hien-tai"},"id-ID":{ALL:"semua",HOSPITAL:"rumah-sakit",SERVICE:"layanan",DOCTOR:"dokter",SEARCH:"cari",SPECIALTIES:"spesialisasi",CURRENT:"posisi-saya-saat-ini"}},L=Object.freeze({__proto__:null,POST_DATE_FORMAT:"dd/MM/yyyy",NORMAL_DATE_FORMAT:"YYYY-MM-DD",DUE_DATE_FORMAT:E,DEFAULT_AVATAR_IMG:f,DEFAULT_RESULT_IMG:"/images/default.png",DEFAULT_IMG:T,BMI_LEVELS:["underweight","healthy","overweight","obese_level_1","obese_level_2"],BMR_LEVELS:["low","normal","high"],CORAL_TOKEN_COOKE:"coral_together_user_token",HEALTH_TOOL_TYPE:b,LOCALE_HEALTH_TOOLS:A,BEARER_TOKEN_COOKIE:y,TOGETHER_DISCLAIMER_COOKIE:"hhg_together_disclaimer",BEARER_ADMIN_TOKEN_COOKIE:O,Z_INDEX:{adBlock:48,articleAdContainer:47,headerContainerHome:99,headerContainerPopup:200,headerContainerPopupSUbLevel:300,menuSearchInputPopup:5,menuSearchInputDisplayIcon:6,menuSearchPopup:200},BmrActiveLevels:[{value:"sedentary",icon:"bmr-sedentary",name:"bmr.activeLevel.sedentary",description:"bmr.activeLevel.sedentary.description"},{value:"lightly-active",icon:"bmr-light",name:"bmr.activeLevel.lightlyActive",description:"bmr.activeLevel.lightlyActive.description"},{value:"moderately-active",icon:"bmr-moderately",name:"bmr.activeLevel.moderatelyActive",description:"bmr.activeLevel.moderatelyActive.description"},{value:"intensely-active",icon:"bmr-intensively",name:"bmr.activeLevel.intenselyActive",description:"bmr.activeLevel.intenselyActive.description"},{value:"extremely-active",icon:"bmr-extremely",name:"bmr.activeLevel.extremelyActive",description:"bmr.activeLevel.extremelyActive.description"}],LEAD_CAMPAIGN_CODE:"lmoct7xfr5sv4fv",LEAD_TOKEN_COOKIE:"hhg-id",GA_TOKEN_COOKIE:"_ga",GOOGLE_CALENDAR_AUTH_CLIENT_ID:"1038242799566-esoq4ij201ve5qfp266nbca44scpo3c6.apps.googleusercontent.com",FIND_CARE_IFRAME_URL:"https://www.appsheet.com/start/4ba34ebe-3cb6-4c16-8dd4-d074025a5bb6#appName=DependentDropdowns-2711103&group=%5B%5D&page=card&sort=%5B%5D&table=Menu&view=Menu",REPORT_REASON_MAP:w,MB_SOCIAL_LINKS:{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/marry.baby.vn",INSTAGRAM:"https://www.instagram.com/marrybaby.vn/",TWITTER:"",YOUTUBE:"https://www.youtube.com/channel/UCeZybTkY1VzJ3N7LvPGdKbg",ZALO:"http://zalo.me/806483414530291942"},INTERNAL_ROLES:["admin","moderator","local-admin"],EXTERNAL_ROLES:["ambassador","expert","sponsor","guide","influencer"],INTERNAL_PROFILE_ROLES:["moderator","local-admin"],EXTERNAL_PROFILE_ROLES:["expert","ambassador","sponsor"],RoleDataMap:{moderator:{text:"Moderator",fid:"cardAuthor.moderator",background:"#fe921d"},admin:{text:"Admin",fid:"cardAuthor.admin",background:"#2b62cd"},"local-admin":{text:"Local admin",fid:"cardAuthor.localAdmin",background:"#2b62cd"},expert:{text:"Expert",fid:"cardAuthor.expert",background:"#ff6f4d"},sponsor:{text:"Sponsor",fid:"cardAuthor.sponsor",background:"#00c7e6"},ambassador:{text:"Ambassador",fid:"cardAuthor.ambassador",background:"#00CB8A"}},MAX_IMAGE_UPLOADS:20,LOCALISED_SLUGS:I}),S=function(e){return e?{displayName:e.display_name||null,avatar:e.avatar||null,thumbnailAvatar:e.avatar_thumbnail||null,profileUrl:e.profile_url||null,description:e.description||null,metaTag:e.meta_tag||""}:{}},x=function(e){return e?{id:e.ID||null,name:e.name||null,specialty:e.specialty||null,avatar:e.avatar||null,permalink:e.permalink||null,thumbnailAvatar:e.avatar_thumbnail||null}:{}},R=function(t){var o,i,n,r;return t?{id:t.ID,postName:t.post_name,sponsor:t.sponsor?D(t.sponsor):null,isSponsored:t.is_sponsored||null,postTitle:t.post_title||"",postModified:t.post_modified||"",postDate:t.post_date||"",modifiedTime:t.modified_time||"",permalink:t.permalink||"",featureImage:t.image||null,featureImageMobile:t.image_medium||null,featureImageMobileXs:t.image_thumbnail||null,author:S(t.author),reviewer:t.reviewed_by&&S(t.reviewed_by)||null,articleReviewed:(null==t?void 0:t.reviewed)?e.__assign(e.__assign({},null==t?void 0:t.reviewed),{author:k(null===(o=null==t?void 0:t.reviewed)||void 0===o?void 0:o.author),editor:k(null===(i=null==t?void 0:t.reviewed)||void 0===i?void 0:i.editor),expert:k(null===(n=null==t?void 0:t.reviewed)||void 0===n?void 0:n.expert),fact_check:k(null===(r=null==t?void 0:t.reviewed)||void 0===r?void 0:r.fact_check)}):null,category:C(t.category),postContent:t.post_content||null,sections:t.sections||null,categories:(t.categories||[]).map(C),sources:t.sources||null,description:t.description||null,excerpt:t.excerpt||null,expert:x(t.expert),metaTag:t.meta_tag||null}:{}},k=function(t){return void 0!==t&&t?e.__assign(e.__assign({},t),{profile_url:(null==t?void 0:t.slug)?["expert","medical"].includes((null==t?void 0:t.role)||"")?"/expert/".concat(null==t?void 0:t.slug):"/author/".concat(null==t?void 0:t.slug):t.profile_url}):null},D=function(e){return e?{title:e.title,logo:e.logo,link:e.link}:{}},P=function(e){return{postTitle:e.post_title,permalink:e.permalink}},C=function(e){var t,o;return e?{termId:e.term_id||null,sponsor:e.sponsor?D(e.sponsor):null,isSponsored:e.is_sponsored||null,categoryName:e.cat_name||null,name:e.name||null,iconUrl:e.icon||"",slugName:e.category_nicename||null,description:e.description||null,featureImage:e.image||null,displayName:e.name||null,parent:e.parent||null,permalink:e.permalink||null,slug:e.slug||null,childCates:(null===(t=e.child_cates)||void 0===t?void 0:t.map((function(e){return C(e)})))||[],colorFeatureImage:e.color_feature_image||null,imageColor:e.image_color||null,textColor:e.text_color||null,catParent:(null===(o=e.cat_parent)||void 0===o?void 0:o.name)?{name:e.cat_parent.name,permalink:e.cat_parent.permalink}:{},metaTag:e.meta_tag||"",reviewedBy:e.reviewed_by?P(e.reviewed_by):null,reviewedDate:e.reviewed_date||"",faqs:e.faqs?e.faqs.map((function(e){return G(e)})):null}:{}},G=function(e){return{title:e.title,content:e.content}},N=function(e){return e?{icon:e.icon,link:e.link.startsWith("http")?e.link:"/health-tools"+e.link,subtitle:e.subtitle,title:e.title}:{}},U=function(e){return e?{topicCount:e.topics_count||0,postCount:e.posts_count||0,memberCount:e.members_count||0,thumbnail:e.thumbnail||"",coverImage:e.cover_image||"",mobileCoverImage:e.mobile_cover_image||"",name:e.name||"",description:e.description||"",slug:e.slug||"",id:e.id||0,joined:Boolean(e.joined),isActive:null===e.is_active||void 0===e.is_active||Boolean(e.is_active),mappedCategoryId:e.mapped_category_id||0,discoverCategory:e.discover_category?{categoryId:e.discover_category.category_id||0,name:e.discover_category.name||""}:null,isHidden:Boolean(e.is_hidden)}:{}},M=function(e){var t,o,i,n;return e?{id:e.id||0,name:e.name||"",image:e.thumbnail||"",slug:e.slug||"",url:"/"+(null===(t=e.community)||void 0===t?void 0:t.slug)+"/"+(null==e?void 0:e.slug)||"",description:e.description||"",joined:e.joined||!1,postCount:e.count_posts||0,memberCount:e.count_members||0,communityId:String(null===(o=e.community)||void 0===o?void 0:o.id),communitySlug:null===(i=e.community)||void 0===i?void 0:i.slug,communityName:null===(n=e.community)||void 0===n?void 0:n.name,order:e.order||0,isActive:null===e.is_active||void 0===e.is_active||Boolean(e.is_active),mappedCategoryId:e.mapped_category_id||0,discoverCategory:e.discover_category?{categoryId:e.discover_category.category_id||0,name:e.discover_category.name||""}:null,isHidden:Boolean(e.is_hidden)}:{}},B=function(e){var t,o,i,n,r,a,l,s,u,d,c,_,p,m,v,g,h,E,f,T,b;return e?{id:e.id,topics:(null===(t=e.topics)||void 0===t?void 0:t.map((function(t){var o,i,n,r;return{id:t.id||0,name:t.name||"",slug:t.slug||"",url:"/"+(null===(o=e.community)||void 0===o?void 0:o.slug)+"/"+t.slug,communityId:String(null===(i=e.community)||void 0===i?void 0:i.id),communitySlug:(null===(n=e.community)||void 0===n?void 0:n.slug)||"",communityName:(null===(r=e.community)||void 0===r?void 0:r.name)||"",isHidden:Boolean(t.is_hidden),isActive:!0}})))||[],community:{id:(null===(o=e.community)||void 0===o?void 0:o.id)||0,name:(null===(i=e.community)||void 0===i?void 0:i.name)||"",slug:(null===(n=e.community)||void 0===n?void 0:n.slug)||"",isActive:!0,isHidden:Boolean(null===(r=e.community)||void 0===r?void 0:r.is_hidden)},slug:e.slug||"",author:{id:(null===(a=e.user)||void 0===a?void 0:a.id)||0,username:(null===(l=e.user)||void 0===l?void 0:l.user_name)||"",email:(null===(s=e.user)||void 0===s?void 0:s.email)||"",name:(null===(u=e.user)||void 0===u?void 0:u.name)||"",avatar:(null===(d=e.user)||void 0===d?void 0:d.avatar)||"",role:(null===(c=e.user)||void 0===c?void 0:c.role)?null===(p=null===(_=e.user)||void 0===_?void 0:_.role)||void 0===p?void 0:p.toLowerCase():"",type:(null===(m=e.user)||void 0===m?void 0:m.type)||"",partnerId:(null===(v=e.user)||void 0===v?void 0:v.partner_id)?String(null===(g=e.user)||void 0===g?void 0:g.partner_id):"",title:(null===(h=e.user)||void 0===h?void 0:h.title)||"",doctorId:(null===(E=e.user)||void 0===E?void 0:E.doctor_id)?String(null===(f=e.user)||void 0===f?void 0:f.doctor_id):"",hospitalId:(null===(T=e.user)||void 0===T?void 0:T.hospital_id)?String(null===(b=e.user)||void 0===b?void 0:b.hospital_id):""},previewUrl:{title:e.preview_title||"",url:e.preview_link||"",image:e.preview_image||"",description:e.preview_description||""},createdAt:e.created_at||"",scheduleDateTime:e.schedule_datetime||"",photos:e.images||[],description:e.description||"",commentsCount:e.comments_count||0,likesCount:e.likes_count||0,title:e.name||"",isPin:!!e.is_pin,pinDate:e.pin_date||"",liked:e.liked||!1,bookmarked:Boolean(e.bookmarked)||!1,mentions:e.mentions||[],commented:Boolean(e.commented)||!1,introUrl:e.intro_url||"",bannerImage:e.banner_image||""}:{}},H=function(e){return e?{disclaimer:e.disclaimer,featuredImage:e.featured_image,info:e.info||[],reviewedBy:e.reviewed_by?{id:e.reviewed_by.ID,permalink:e.reviewed_by.permalink,name:e.reviewed_by.name,postTitle:e.reviewed_by.post_title}:null,reviewedDate:e.reviewed_date}:{}},F=function(e){var t,o,i,n,r,a,l,s,u,d,c,_,p,m,v,g,h,E,f,T,b,A,y,O,w,I,L,S,x,R,k,D;return e?{content:e.content,countLikes:e.likes_count,countReplies:e.replies_count,createdAt:e.created_at,createdTime:e.created_time,id:String(e.id),images:e.image||[],link:e.link||null,replies:e.replies&&e.replies.length>0?e.replies.map(F):[],author:{id:(null===(t=e.user)||void 0===t?void 0:t.id)||0,username:(null===(o=e.user)||void 0===o?void 0:o.user_name)||"",name:(null===(i=e.user)||void 0===i?void 0:i.name)||"",role:(null===(n=e.user)||void 0===n?void 0:n.role)?null===(a=null===(r=e.user)||void 0===r?void 0:r.role)||void 0===a?void 0:a.toLowerCase():"",avatar:(null===(l=e.user)||void 0===l?void 0:l.avatar)||"",type:(null===(s=e.user)||void 0===s?void 0:s.type)||"",email:(null===(u=e.user)||void 0===u?void 0:u.email)||"",partnerId:(null===(d=e.user)||void 0===d?void 0:d.partner_id)?String(null===(c=e.user)||void 0===c?void 0:c.partner_id):"",title:(null===(_=e.user)||void 0===_?void 0:_.title)||"",doctorId:(null===(p=e.user)||void 0===p?void 0:p.doctor_id)?String(null===(m=e.user)||void 0===m?void 0:m.doctor_id):"",hospitalId:(null===(v=e.user)||void 0===v?void 0:v.hospital_id)?String(null===(g=e.user)||void 0===g?void 0:g.hospital_id):""},liked:!!e.liked,mentionedUser:e.mentioned?{id:(null===(h=e.mentioned)||void 0===h?void 0:h.id)||0,username:(null===(E=e.mentioned)||void 0===E?void 0:E.user_name)||"",name:(null===(f=e.mentioned)||void 0===f?void 0:f.name)||"",role:(null===(T=e.mentioned)||void 0===T?void 0:T.role)?null===(A=null===(b=e.mentioned)||void 0===b?void 0:b.role)||void 0===A?void 0:A.toLowerCase():"",avatar:(null===(y=e.mentioned)||void 0===y?void 0:y.avatar)||"",type:(null===(O=e.mentioned)||void 0===O?void 0:O.type)||"",email:(null===(w=e.mentioned)||void 0===w?void 0:w.email)||"",partnerId:(null===(I=e.mentioned)||void 0===I?void 0:I.partner_id)?String(null===(L=e.mentioned)||void 0===L?void 0:L.partner_id):"",doctorId:(null===(S=e.mentioned)||void 0===S?void 0:S.doctor_id)?String(null===(x=e.mentioned)||void 0===x?void 0:x.doctor_id):"",hospitalId:(null===(R=e.mentioned)||void 0===R?void 0:R.hospital_id)?String(null===(k=e.mentioned)||void 0===k?void 0:k.hospital_id):"",title:(null===(D=e.mentioned)||void 0===D?void 0:D.title)||""}:null,mentions:e.mentions||[]}:{}},V=function(e){return void 0!==e&&e?(null==e?void 0:e.turn_off_profile)?"":(null==e?void 0:e.slug)?["expert","medical"].includes((null==e?void 0:e.role)||"")?"/expert/".concat(null==e?void 0:e.slug):"/author/".concat(null==e?void 0:e.slug):(null==e?void 0:e.profile_url)||(null==e?void 0:e.permalink)||"#":""},K=Object.freeze({__proto__:null,formatAuthor:S,formatArticleExpert:x,formatArticle:R,formatUserProfile:k,formatBMIResult:function(e){var t,o,i,n,r,a,l,s,u;return e&&e.status?{status:null==e?void 0:e.status,comparison:null!==(t=null==e?void 0:e.comparison)&&void 0!==t?t:"",assessmentData:[{tab:"tools.condition",content:null!==(o=null==e?void 0:e.condition)&&void 0!==o?o:""},{tab:"tools.risks",content:null!==(i=null==e?void 0:e.risk)&&void 0!==i?i:""},{tab:"tools.suggestion",content:null!==(n=null==e?void 0:e.suggestion)&&void 0!==n?n:""}],chartData:(null===(r=null==e?void 0:e.chart_data)||void 0===r?void 0:r.length)>0?null==e?void 0:e.chart_data:[],disclaimer:null!==(a=null==e?void 0:e.disclaimer)&&void 0!==a?a:"",illustrator:null!==(l=null==e?void 0:e.illustrator)&&void 0!==l?l:"",faqs:null!==(s=null==e?void 0:e.faqs)&&void 0!==s?s:[],suggestedArticlesLink:null!==(u=null==e?void 0:e.suggested_articles_link)&&void 0!==u?u:""}:{}},formatSponsor:D,formatReviewedCategory:P,formatCategory:C,formatCategoryApi:function(e){return e?{categoryInfo:C(e.data.category)||null,explainersPosts:(e.data.explainers_posts||[]).map(R),subCategories:(e.data.sub_categories||[]).map(C)}:{}},formatFaqsCategory:G,formatHealthTool:N,formatHealthToolTypeCategory:function(e){var t,o;return e?{termId:(null==e?void 0:e.term_id)||0,name:(null==e?void 0:e.name)||"",healthTools:null!==(o=null===(t=null==e?void 0:e.health_tools)||void 0===t?void 0:t.map((function(e){return N(e)})))&&void 0!==o?o:[]}:{}},formatCommunity:U,formatTopic:M,formatPost:B,formatPostPagination:function(e){return e?{currentPage:e.current||0,lastPage:e.last||0,total:e.total_items||0}:{}},formatNotification:function(e){var t,o,i;return e?{time:e.created_at,content:e.content,postId:String(e.post_id),fromUser:{name:null===(t=e.from_user)||void 0===t?void 0:t.name,id:null===(o=e.from_user)||void 0===o?void 0:o.id,avatar:null===(i=e.from_user)||void 0===i?void 0:i.avatar},toUserId:String(e.to_user_id),postSlug:e.post_slug||"",communitySlug:e.community_slug||""}:{}},formatSpotlightsList:function(e){return e?e.map((function(e){return{id:e.ID,name:e.name,permalink:e.permalink,image:(null==e?void 0:e.small_banner)||(null==e?void 0:e.image),imageMedium:(null==e?void 0:e.image_medium)||null,imageThumbnail:(null==e?void 0:e.image_thumbnail)||null,startDate:null==e?void 0:e.start_date,endDate:null==e?void 0:e.end_date}})):[]},formatOvulationInfo:H,formatSuggestedArticle:function(e){return e?{postId:e.post_id||null,categoryId:e.category_id||null,postUrl:e.post_url||null,postReviewed:e.post_reviewed||null,postPageviews:e.post_pageviews||null,postRank:e.post_rank||null,isPin:e.is_pin||null,frequency:e.frequency||null,topic:e.topic||null}:{}},formatTopicHealthTool:function(e){return e?{id:e.tool_id||null,topicFrequency:e.frequency||null,topicId:e.topic_id||null,topicName:e.topic_name||null,isPinned:!!e.is_pin||null,toolLink:e.tool_link||""}:{}},formatComment:F,formatReportedPostToPostDetail:function(e){return e?{name:e.title,description:e.description,images:e.images,likes_count:e.count_likes,comments_count:e.count_comments,topics:[],slug:e.post_slug,id:e.post_id,is_pin:e.is_pin,pin_date:"",post_type:e.post_type,schedule_datetime:e.schedule_datetime,is_active:e.is_active,preview_title:e.preview_title||"",preview_image:e.preview_image||"",preview_description:e.preview_description||"",preview_link:e.preview_link||"",user:e.user,created_at:"",created_time:"",community:{id:e.community_id,name:e.community_name,slug:e.community_slug,description:""}}:{}},formatTopicSubot:function(e){return e?{chatBotId:e.subot_id,isPinned:e.is_pin,topicId:e.topic_id,topicFrequency:e.frequency}:{}},formatSiteWideBanner:function(e,t){return void 0!==e&&e?{content:(null==e?void 0:e.content)||"",icon:(null==e?void 0:e.icon)||"",type:t||"other"}:null},formatPWGContent:function(e){return e?{disclaimer:e.disclaimer,info:e.info||[],reviewedBy:e.reviewed_by?k(e.reviewed_by):null,reviewedDate:e.reviewed_date,metaTag:e.meta_tag}:{}},formatUserProfileUrl:V,formatTHRContent:function(e){return e?{disclaimer:e.disclaimer,info:e.info||[],reviewedBy:e.reviewed_by?k(e.reviewed_by):null,reviewedDate:e.reviewed_date,metaTag:e.meta_tag}:{}},formatBabyGrowthContent:function(e){var t,o,i;return e&&e.information?{information:null!==(t=e.information.map((function(e){return{title:e.title,description:e.description}})))&&void 0!==t?t:[],reviewBy:{reviewer:(null===(o=e.reviewed_by)||void 0===o?void 0:o.display_name)||(null===(i=e.reviewed_by)||void 0===i?void 0:i.name)||"",date:e.reviewed_date||"",link:V(null==e?void 0:e.reviewed_by)},metaTag:e.meta_tag||"",title:e.title||"",description:e.description||"",disclaimer:e.disclaimer||"",is_sponsored:e.is_sponsored||!1,sponsor:e.sponsor,featuredImage:e.featured_image||""}:{}}}),j={BASE_API_PATH:"/",PROFILE:"profile?website_url={website_url}",SEARCH_USER:"profile/search?website_url={website_url}&name={name}",FETCH_PREVIEW:"fetch/preview?website_url={website_url}",FETCH_POST_OR_TOPIC:"fetch/{slug}?website_url={website_url}&community_slug={communitySlug}",POST:{LIST:"post?website_url={website_url}&slug={slug}&pin={pin}&page={page}&community_id={communityId}&topic_id={topicId}&sort_by={sort}&id={id}",DETAIL_BY_ID_OR_SLUG:"post/{idSlug}?website_url={website_url}",CREATE:"post/create?website_url={website_url}",LIKE:"post/{id}/like?website_url={website_url}",DELETE:"post/{id}/delete?website_url={website_url}",REPORT:"post/{id}/report?website_url={website_url}",UPDATE:"post/{id}/update?website_url={website_url}",FOLLOW:"post/{id}/follow?website_url={website_url}",CREATE_ARTICLE_COMMENT:"article-comment/create?website_url={website_url}"},COMMENT:{LIST:"comment?website_url={website_url}&post_id={postId}&page={page}&sort_by={sort}&items_per_page={perPage}&_without_reply={withoutReply}",CREATE:"comment/create?website_url={website_url}",REPLY:"comment/reply?website_url={website_url}",DELETE:"comment/{id}/delete?website_url={website_url}",LIKE:"comment/{id}/like?website_url={website_url}",UNLIKE:"comment/{id}/unlike?website_url={website_url}",IMAGE_UPLOAD:"comment/image/upload?website_url={website_url}"},COMMUNITY:{LIST:"community?website_url={website_url}&page={page}",DETAIL_BY_ID_OR_SLUG:"community/{idSlug}?website_url={website_url}",JOIN:"community/join?website_url={website_url}",LEAVE:"community/leave?website_url={website_url}"},TOPIC:{LIST:"topic?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}&page={page}",DETAIL_BY_ID_OR_SLUG:"topic/{idSlug}?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}",HEALTH_TOOLS:"tools?topic_id={topicId}&website_url={website_url}",SUBOTS:"subots?topic_id={topicId}&website_url={website_url}",SUGGESTED_POSTS:"suggested-posts?topic_id={topicId}&website_url={website_url}&page={page}",JOIN:"topic/join?website_url={website_url}",LEAVE:"topic/leave?website_url={website_url}"},BOOKMARK:{LIST:"bookmark?user_id={userId}&website_url={website_url}",CREATE:"bookmark/create?website_url={website_url}",DELETE:"bookmark/delete?website_url={website_url}"},UPLOAD_IMAGE:"auth/comment/image/upload?website_url={website_url}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info"},Y=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var o={},i=(t||{}).decode||X,n=0;for(;n<e.length;){var r=e.indexOf("=",n);if(-1===r)break;var a=e.indexOf(";",n);if(-1===a)a=e.length;else if(a<r){n=e.lastIndexOf(";",r-1)+1;continue}var l=e.slice(n,r).trim();if(void 0===o[l]){var s=e.slice(r+1,a).trim();34===s.charCodeAt(0)&&(s=s.slice(1,-1)),o[l]=J(s,i)}n=a+1}return o},W=function(e,t,o){var i=o||{},n=i.encode||$;if("function"!=typeof n)throw new TypeError("option encode is invalid");if(!q.test(e))throw new TypeError("argument name is invalid");var r=n(t);if(r&&!q.test(r))throw new TypeError("argument val is invalid");var a=e+"="+r;if(null!=i.maxAge){var l=i.maxAge-0;if(isNaN(l)||!isFinite(l))throw new TypeError("option maxAge is invalid");a+="; Max-Age="+Math.floor(l)}if(i.domain){if(!q.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain="+i.domain}if(i.path){if(!q.test(i.path))throw new TypeError("option path is invalid");a+="; Path="+i.path}if(i.expires){var s=i.expires;if(!function(e){return"[object Date]"===z.call(e)||e instanceof Date}(s)||isNaN(s.valueOf()))throw new TypeError("option expires is invalid");a+="; Expires="+s.toUTCString()}i.httpOnly&&(a+="; HttpOnly");i.secure&&(a+="; Secure");if(i.priority){switch("string"==typeof i.priority?i.priority.toLowerCase():i.priority){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(i.sameSite){switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},z=Object.prototype.toString,q=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function X(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function $(e){return encodeURIComponent(e)}function J(e,t){try{return t(e)}catch(t){return e}}var Z={parse:Y,serialize:W},Q={"vi-VN":"hellobacsi.com","id-ID":"hellosehat.com","ms-MY":"hellodoktor.com","km-KH":"hellokrupet.com","en-PH":"hellodoctor.com.ph","th-TH":"hellokhunmor.com","my-MM":"hellosayarwon.com","zh-TW":"helloyishi.com.tw","hi-IN":"helloswasthya.com"},ee={"vi-VN":"marrybaby.vn"},te=process.env.NEXT_PUBLIC_DEPLOY_LOCALE||"vi-VN",oe=function(e){var t=exports.GlobalData.env.isMarryBaby;return"https://".concat(t?ee[e]:Q[e])},ie=function(e){var t=e.indexOf("?");return t>=0?e.slice(0,t+1)+e.slice(t+1).replace(/[^=&]+=(&|$)/g,"").replace(/&$/,""):e},ne=function(t,o,i){var n="";i&&(n=Object.keys(i).map((function(e){return e+"="+i[e]})).join("&"));var r=((null===exports.GlobalData||void 0===exports.GlobalData?void 0:exports.GlobalData.env)||{}).togetherBaseApiUrl,a=void 0===r?"":r,l=m.default(t,e.__assign(e.__assign({},(null==o?void 0:o._locale)?{website_url:oe(String(o._locale))}:{}),o));return l+="".concat(l.includes("?")?"&":"?").concat(n),a+"api/v1/"+ie(l)},re=function(e){return(null==e?void 0:e.data)&&(e.data instanceof FormData?e.body=e.data:"object"==typeof e.data&&(e.body=JSON.stringify(e.data)),delete e.data),e},ae=function(t,o,i,n){return void 0===n&&(n=!1),e.__awaiter(void 0,void 0,void 0,(function(){var r,a,l,s,u;return e.__generator(this,(function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),[4,fetch(n?t:(c=t,encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]")),e.__assign(e.__assign({method:o},re(i)),{headers:e.__assign({},null==i?void 0:i.headers)})).then((function(e){return e.json()}))];case 1:return(r=d.sent())?[2,r]:[3,3];case 2:return a=d.sent(),console.log(a),console.log({url:t,status:null===(l=null==a?void 0:a.response)||void 0===l?void 0:l.status,statusText:null===(s=null==a?void 0:a.response)||void 0===s?void 0:s.statusText}),[2,(null===(u=null==a?void 0:a.response)||void 0===u?void 0:u.data)||null];case 3:return[2,null]}var c}))}))},le=function(t,o,i,n){return e.__awaiter(void 0,void 0,void 0,(function(){var a,l,s,u;return e.__generator(this,(function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),a=Z.parse(n||""),l=a[y],(s=l||r.getCookie(y))&&s.length?[4,fetch(t,e.__assign(e.__assign({method:o},re(i)),{headers:e.__assign({Authorization:"Bearer "+s},null==i?void 0:i.headers)})).then((function(e){return e.json()}))]:[3,2];case 1:if(u=d.sent())return[2,u];d.label=2;case 2:return[3,4];case 3:return d.sent(),[2,null];case 4:return[2,null]}}))}))};function se(e,t,o){var i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),n=-1!==e.indexOf("?")?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+o+"$2"):e+n+t+"="+o}var ue=function(e,t,o,i){return o&&t?"".concat(o,"-").concat(t):"".concat(p.default(e||"",{lower:!0,locale:i||te}),"-").concat(t)},de={locale:"vi-VN",env:{isMarryBaby:!1,togetherBasePath:"/community"},router:{basePath:"",asPath:"/"}},ce=t.createContext({data:de,action:{pushNotifications:function(e){return e},sanitizeFunction:function(e){return e}}});exports.GlobalData=de;var _e,pe=_.default.div(_e||(_e=e.__makeTemplateObject(["\n width: 40px;\n height: 40px;\n flex-shrink: 0;\n cursor: pointer;\n font-size: 20px;\n\n img {\n border-radius: 50%;\n }\n\n .avatar {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .avatar-default {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n border-radius: 50%;\n color: white;\n font-size: 1em;\n font-weight: bold;\n line-height: 1;\n }\n\n &[data-is-marrybaby='true'] {\n .avatar-default {\n background-color: ",";\n }\n }\n"],["\n width: 40px;\n height: 40px;\n flex-shrink: 0;\n cursor: pointer;\n font-size: 20px;\n\n img {\n border-radius: 50%;\n }\n\n .avatar {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .avatar-default {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n border-radius: 50%;\n color: white;\n font-size: 1em;\n font-weight: bold;\n line-height: 1;\n }\n\n &[data-is-marrybaby='true'] {\n .avatar-default {\n background-color: ",";\n }\n }\n"])),(function(e){return e.theme.colors.secondaryBase}),(function(e){return e.theme.mbColors.pink}));exports.ADMIN_PATHS={SEARCH_USER:"admin/profile/search?website_url={website_url}&name={name}",COMMENT:{IMAGE_UPLOAD:"admin/comment/image/upload?website_url={website_url}"}},exports.Avatar=function(i){var n=i.type,r=void 0===n?"square":n,a=i.size,l=i.avatarImg,s=i.avatarUrl,u=i.firstLetter,d=i.backgroundColor,_=i.onClick,p=i.style,m=i.className,g=i.isAmp,h=void 0!==g&&g,E=i.width,f=i.height,T=a?v[a]:void 0,b=t.useState(!1),A=b[0],y=b[1];t.useEffect((function(){if(s){var e=document.createElement("img");e.setAttribute("src",s),e.addEventListener("error",(function(){y(!0)}))}}),[s,y]);var O=(!s&&!l||A)&&u;return c.default.createElement(o.StyledAvatar,{style:e.__assign(e.__assign({},p),{"--size":!h&&T?T+"px":void 0,"--width-prop":E?E+"px":void 0,"--height-prop":f?f+"px":void 0,"--background-color":d}),"data-has-max":!(!E||!f),"data-avatar-type":r,onClick:_,className:m,avatarUrl:s,"data-is-amp":h,"data-custom-size":!!a},l,s&&!A&&c.default.createElement("img",{src:s}),O&&u)},exports.BEARER_TOKEN_COOKIE=y,exports.CARE_PATHS={GET_DOCTOR_INFO:"api/doctors/{doctorId}?site={website_url}",GET_HOSPITAL_INFO:"api/hospital/branch/{hospital_branch_id}?site={website_url}"},exports.DEFAULT_AVATAR_IMG=f,exports.DEFAULT_IMG=T,exports.DISCOVER_PATHS={BASE_API_PATH:"/",GET_SEARCH_ARTICLES:"search?s={keyword}&page={page}",GET_ALL_CATEGORIES:"categories?type=all",GET_HOMEPAGE_POSTS:"home/trending-post?type={type}",GET_HOMEPAGE_LATEST_POSTS:"articles?page=1&_islatest=1",GET_ARTICLE_DETAIL:"article/{slug}?skip_ids={skipIds}&_isrelated={isRelated}",GET_CATEGORY_DETAIL:"category/{slug}",GET_CATEGORY_OR_ARTICLE_DETAIL:"fetch/{fullSlug}",GET_PREVIEW_ARTICLE:"fetch/{fullSlug}?preview_nonce={nonce}&preview=true",GET_ARTICLE_OF_CATEGORY:"articles?category_id={categoryId}&page={currentPage}",GET_PAGE_STATIC:"page/{slug}",GET_ALL_HEALTH_TOOLS:"healthtools",GET_ALL_MARRYBABY_HEALTH_TOOLS:"health-tools",GET_HEALTH_TOOLS_BY_CATEGORY:"healthtools?_hasgroup=1",GET_AUTHOR:"author/{slug}",GET_ALL_EXPERTS:"experts",GET_ALL_EXPERTS_PAGING:"experts?page={page}",GET_EXPERT:"expert/{slug}",GET_EXPERT_POST:"expert/article?page={page}",POST_ARTICLE_FEEDBACK:"article/feedback/{id}",GET_AZ_DRUGS:"category/a-z/{category}",GET_HOMEPAGE_MEDICAL_REVIEWED:"home/medical-reviewed",GET_ARTICLES_BY_IDS:"articles?ids={ids}",GET_ARTICLE_OF_CATEGORY_NO_EXPLAINERS:"articles?category_id={categoryId}&page={currentPage}&skip_ids={ids}",GET_EXPERT_OF_CATEGORY:"category/expert/?id={id}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info",GET_DUE_DATE_ALL_WEEKS:"health-tools/due-date-calculator/all",GET_DUE_DATE_SUGGESTED_ARTICLES:"health-tools/due-date-calculator/result?from_week={from}&to_week={to}",GET_PROFILE:"user/profile",GET_ADMIN_PROFILE:"GET_ADMIN_PROFILE",GET_FEATURE:"feature",POST_NEW_FEATURE:"feature/update",CREATE_BOOKMARK:"bookmark/create",DELETE_BOOKMARK:"bookmark/delete",DELETE_ALL_BOOKMARK:"bookmark/delete-all",GET_ALL_BOOKMARK:"bookmark",SSO_USER_PROFILE:"user",SSO_USER_BOOKMARKS:"user/bookmarks",SSO_USER_PASSWORD:"user/settings/password",SSO_USER_EMAIL:"user/settings/update-email",SSO_CLOSE_ACCOUNT:"user/settings/close-account",SSO_HELP:"user/settings/help",GET_HEALTH_TOOL_OVULATION_INFO:"health-tools/ovulation-calculator/info",GET_HEALTH_TOOL_OVULATION_SUGGESTED_ARTICLES:"health-tools/ovulation-calculator/result?method={method}",GET_HEALTH_TOOL_BMI_INFO:"health-tools/bmi-calculator/info",GET_HEALTH_TOOL_BMI_RESULT:"health-tools/bmi-calculator/result?gender={gender}&bmi={bmi}&age={age}",GET_HEALTH_TOOL_BMR_INFO:"health-tools/bmr-calculator/info",GET_HEALTH_TOOL_BMR_RESULT:"health-tools/bmr-calculator/result?kcals={kcals}&gender={gender}&age={age}",GET_HEALTH_TOOL_PWG_INFO:"health-tools/preweight-gain-calculator/info",GET_HEALTH_TOOL_THR_INFO:"health-tools/target-heart-rate/info",GET_HEALTH_TOOL_BABY_GROWTH_INFO:"health-tools/baby-growth-tracking/info",POST_UPDATE_LOCATION:"tracking/geo/",GET_SIDIS_DUE_DATE:"frontend/tools/due_date",GET_SIDIS_OVULATION:"frontend/tools/ovulation",GET_SIDIS_BMI:"frontend/tools/bmi",GET_SIDIS_BMR:"frontend/tools/bmr",POST_LOGOUT:"user/logout",OVULATION_CREATE_EVENT:"ovulation/event?method={method}&day={day}&cycle={cycle}&period={period}&token={token}&user_id={user_id}",GET_ALL_SPOTLIGHT:"spotlights?per_page={perPage}&order_by={orderBy}",SSO_UPDATE_FIRST_TIME_BOOKMARK:"bookmark/update-first-time",POST_COMMENT_NOTIFICATION:"comment/notification",GET_ABOUT_US_DATA:"about",POST_LEAD_IMPRESSION:"campaign/{campaignCode}/impression",POST_LEAD_POPUP_EXIT:"campaign/{campaignCode}/popup_exit",POST_LEAD_LEAD:"campaign/{campaignCode}/lead",POST_SSO_VERIFY_TOKEN:"verify-id-token",GET_LANDING_PAGE_FIRST_NODE:"landing_page/bot",GET_LANDING_PAGE_NEXT_NODE:"landing_page/messages",POST_LANDING_PAGE_IMPRESSION:"landing_page/impressions",POST_LANDING_PAGE_CLICK:"landing_page/clicks",FETCH_URL_DATA:"preview",GET_SPOTLIGHT_LANDING:"spotlight/{slug}",GET_FOOTER_INFO:"footer",CHECK_SSO_EMAIL:"member/check-email",GET_HOMEPAGE_SITEWIDE_BANNER:"home/sitewide-banner",GET_DYNAMIC_FOOTER:"menu/footer",GET_EXPERTS:"experts?page={page}&number={perPage}&s={search}",GET_EXPERT_BY_ID:"expert/{id}"},exports.DUE_DATE_FORMAT=E,exports.DefaultComponentGlobalContextData=de,exports.HEALTH_TOOL_TYPE=b,exports.MAX_IMAGE_UPLOADS=20,exports.PATHS=j,exports.Popup=function(e){var t=e.type,o=void 0===t?"lead":t,i=e.closeIcon,n=e.isOpen,r=void 0===n||n,a=e.onClose,l=e.children,s=e.className,u=void 0===s?"":s,d=e.enableAnimation,_=void 0===d||d;return c.default.createElement(c.default.Fragment,null,c.default.createElement(g,{"data-open":r,"data-type":o,"data-animation":_},c.default.createElement("div",{className:"".concat(u||""," popup-content")},!!i&&c.default.createElement("div",{className:"close-button",onClick:a},i),l)),c.default.createElement(h,{"data-open":r,onClick:a}))},exports.REPORT_REASON_MAP=w,exports.TogetherComponentGlobalContext=ce,exports.TogetherComponentGlobalContextProvider=function(e){var o=e.locale,i=void 0===o?"vi-VN":o,n=e.children,r=e.userInfo,a=e.router,l=e.env,s=void 0===l?{isMarryBaby:!1,togetherBasePath:"/community"}:l,u=e.sanitizeFunction,d=void 0===u?function(e){return e}:u,_=e.pushNotifications,p=void 0===_?function(){return!1}:_,m=t.useState(),v=m[0],g=m[1];return exports.GlobalData={userInfo:r,locale:i,togetherUserId:v,router:a,env:s},t.useEffect((function(){(null==r?void 0:r.id)&&le(ne(j.PROFILE,{_locale:i}),"GET").then((function(e){var t;g(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)}))}),[null==r?void 0:r.id]),c.default.createElement(ce.Provider,{value:{data:{userInfo:r,locale:i,togetherUserId:v,router:a,env:s},action:{pushNotifications:p,sanitizeFunction:d}}},n)},exports.UserAvatar=function(e){var o=e.className,i=e.isMarryBaby,n=e.style,r=e.avatar,a=e.username,l=e.isLazy,s=t.useContext(ce).data.env.isMarryBaby,u="boolean"==typeof i?i:s,d=t.useState(!1),_=d[0],p=d[1];return t.useEffect((function(){var e=new Image;e.onerror=function(){p(!0)},e.src=r}),[]),c.default.createElement(pe,{"data-is-marrybaby":u,className:o,style:n},r&&!_?c.default.createElement("img",{src:l?void 0:r,"data-src":l?r:void 0,className:"avatar ".concat(l?"lazy":""),alt:"avatar",onError:function(){p(!0)}}):c.default.createElement("div",{className:"avatar avatar-default"},a&&(null==a?void 0:a.length)>0?a[0].toUpperCase():"A"))},exports.callApi=ae,exports.callApiWithAdminAuth=function(t,o,i,n){return e.__awaiter(void 0,void 0,void 0,(function(){var a,l,s,u;return e.__generator(this,(function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),a=Z.parse(n||""),l=a[O],(s=l||r.getCookie(O))&&s.length?[4,fetch(t,e.__assign(e.__assign({method:o},re(i)),{headers:e.__assign({Authorization:"Bearer "+s},null==i?void 0:i.headers)})).then((function(e){return e.json()}))]:[3,2];case 1:if(u=d.sent())return[2,u];d.label=2;case 2:return[3,4];case 3:return d.sent(),[2,null];case 4:return[2,null]}}))}))},exports.callApiWithAuth=le,exports.callApiWithOptionalAuth=function(t,o,i,n){return void 0===o&&(o="GET"),e.__awaiter(void 0,void 0,void 0,(function(){var a,l,s,u,d,c,_,p,m,v,g,h,E,f;return e.__generator(this,(function(T){switch(T.label){case 0:if(T.trys.push([0,7,,8]),a="string"==typeof t?t:t.url,l="string"==typeof t?t:t.backupUrl,s=Z.parse(n||""),u=s[y],!(d=u||r.getCookie(y))||!d.length)return[3,5];T.label=1;case 1:return T.trys.push([1,3,,4]),[4,fetch(a,e.__assign(e.__assign({method:o},re(i)),{headers:e.__assign({Authorization:"Bearer "+d},null==i?void 0:i.headers)})).then((function(e){return e.json()}))];case 2:return c=T.sent(),(null===(m=null==c?void 0:c.messages)||void 0===m?void 0:m.find((function(e){return"Unauthenticated"===(null==e?void 0:e.toLowerCase())})))?[2,ae(l||a,o,i)]:c?[2,c]:[3,4];case 3:return _=T.sent(),console.log({status:null===(v=null==_?void 0:_.response)||void 0===v?void 0:v.status,statusText:null===(g=null==_?void 0:_.response)||void 0===g?void 0:g.statusText}),[2,ae(l||a,o,i)];case 4:return[3,6];case 5:return[2,ae(l||a,o,i)];case 6:return[3,8];case 7:return p=T.sent(),console.log({status:null===(h=null==p?void 0:p.response)||void 0===h?void 0:h.status,statusText:null===(E=null==p?void 0:p.response)||void 0===E?void 0:E.statusText}),[2,(null===(f=null==p?void 0:p.response)||void 0===f?void 0:f.data)||null];case 8:return[2,null]}}))}))},exports.constants=L,exports.dataTransform=K,exports.domainLocales=Q,exports.formatComment=F,exports.formatCommunity=U,exports.formatOvulationInfo=H,exports.formatPost=B,exports.formatTopic=M,exports.formatUserProfileUrl=V,exports.getApiPath=ne,exports.getCareDoctorUrl=function(e){var t,o=e.name,i=e.id,n=e.locale;return"/care/".concat(null===(t=I[n||"vi-VN"])||void 0===t?void 0:t.DOCTOR,"/").concat(ue(o,i))},exports.getCareHospitalUrl=function(e){var t,o=e.name,i=e.id,n=e.slug,r=e.locale;return"/care/".concat(null===(t=I[r||"vi-VN"])||void 0===t?void 0:t.HOSPITAL,"/").concat(ue(o,i,n))},exports.getCarePath=function(t,o){var i=((null===exports.GlobalData||void 0===exports.GlobalData?void 0:exports.GlobalData.env)||{}).careBaseApiUrl;return((void 0===i?"":i)||"https://service-health-care.hellohealthgroup.com/")+ie(m.default(t,e.__assign({},o)))},exports.getCurrentBaseUrl=function(e){var t=exports.GlobalData.env.isMarryBaby;if("undefined"!=typeof window)return window.location.origin;var o="staging"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return"development"===process.env.NEXT_PUBLIC_DEPLOY_ENV?"http://localhost:3000":"https://".concat(o?t?"fe.":"discover.":t?"www.":"").concat(Q[e])},exports.getDiscoverApiPath=function(t,o){var i=((null===exports.GlobalData||void 0===exports.GlobalData?void 0:exports.GlobalData.env)||{}).discoverBaseApiUrl;return(void 0===i?"":i)+"wp-json/api/"+ie(m.default(t,e.__assign({},o)))},exports.getUrlToSignUp=function(e,t,o){void 0===o&&(o="/community");var i=e||("undefined"!=typeof window?window.location.href:"/"),n="undefined"!=typeof window?window.location.origin:"";return n||e&&(e.startsWith("http://")||e.startsWith("https://"))&&(n=e.split("/").slice(0,3).join("/")),function(e,t){var o=exports.GlobalData.env.publicSSO,i=e||window.location.href;return t&&Object.keys(t).map((function(e){se(i,e,t[e])})),se(i,"source","communities"),o?"".concat(o,"?returnUrl=").concat(encodeURIComponent(i.toString())):i}("".concat(n).concat(o,"/on-boarding?return=").concat(encodeURIComponent(i)),t)};
|
|
1
|
+
"use strict";var e=require("./tslib.es6-e6f346c4.js"),t=require("react"),o=require("./index-aba6bda8.js"),i=require("./utils-df758048.js"),n=require("styled-components"),r=require("./cookieHelper-3553173d.js"),a=require("slugify"),l=require("string-format");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u,d,c=s(t),_=s(n),p=s(a),m=s(l),v={xs:28,small:32,medium:40,large:48,xl:64,xxl:80,xxxl:96},g=_.default.div(u||(u=e.__makeTemplateObject(["\n position: fixed;\n left: 50%;\n\n padding: 0 16px 32px;\n background-color: ",";\n border-radius: 6px;\n box-shadow: 0px 4px 8px ",";\n transform: translate(-50%, -50%);\n transition: all 0.5s ease-in-out;\n visibility: hidden;\n\n &[data-open='true'] {\n z-index: 200;\n top: 50%;\n opacity: 1;\n visibility: visible;\n }\n\n &[data-open='false'] {\n top: -50%;\n }\n\n &[data-type='lead'] {\n width: 332px;\n height: 460px;\n\n div {\n top: -15px;\n right: -15px;\n }\n }\n\n &[data-type='form'] {\n width: 496px;\n height: 548px;\n "," {\n width: 340px;\n }\n }\n\n &[data-type='confirm'] {\n "," {\n width: calc(100% - 32px);\n }\n "," {\n width: 100%;\n max-width: 407px;\n }\n }\n\n .popup-content {\n position: relative;\n z-index: 111;\n height: 100%;\n padding: 16px;\n }\n\n .close-button {\n position: absolute;\n top: 16px;\n right: 0;\n cursor: pointer;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n }\n }\n"],["\n position: fixed;\n left: 50%;\n\n padding: 0 16px 32px;\n background-color: ",";\n border-radius: 6px;\n box-shadow: 0px 4px 8px ",";\n transform: translate(-50%, -50%);\n transition: all 0.5s ease-in-out;\n visibility: hidden;\n\n &[data-open='true'] {\n z-index: 200;\n top: 50%;\n opacity: 1;\n visibility: visible;\n }\n\n &[data-open='false'] {\n top: -50%;\n }\n\n &[data-type='lead'] {\n width: 332px;\n height: 460px;\n\n div {\n top: -15px;\n right: -15px;\n }\n }\n\n &[data-type='form'] {\n width: 496px;\n height: 548px;\n "," {\n width: 340px;\n }\n }\n\n &[data-type='confirm'] {\n "," {\n width: calc(100% - 32px);\n }\n "," {\n width: 100%;\n max-width: 407px;\n }\n }\n\n .popup-content {\n position: relative;\n z-index: 111;\n height: 100%;\n padding: 16px;\n }\n\n .close-button {\n position: absolute;\n top: 16px;\n right: 0;\n cursor: pointer;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n }\n }\n"])),(function(e){return e.theme.colors.white}),(function(e){return e.theme.colors.gray200}),i.MediaQueries.mbDown,i.MediaQueries.mbDown,i.MediaQueries.mbUp),h=_.default.div(d||(d=e.__makeTemplateObject(["\n position: fixed;\n z-index: 110;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n align-items: center;\n background: rgba(38, 38, 38, 0.3);\n\n &[data-open='false'] {\n display: none;\n }\n"],["\n position: fixed;\n z-index: 110;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n align-items: center;\n background: rgba(38, 38, 38, 0.3);\n\n &[data-open='false'] {\n display: none;\n }\n"]))),E="DD/MM/YYYY",f="/images/avatar.jpg",T="/images/default-image.jpg",b={DUE_DATE:"DUE_DATE",BMI:"BMI",BMR:"BMR",OVULATION:"OVULATION",IFRAME:"IFRAME",PWG:"PWG",THR:"THR"},A={"id-ID":{"kalkulator-bmi":b.BMI,"kebutuhan-kalori":b.BMR,"kalkulator-hari-perkiraan-lahir":b.DUE_DATE,"kalkulator-masa-subur-2":b.OVULATION,"kalkulator-kenaikan-berat-badan-ibu-hamil":b.PWG,"kalkulator-detak-jantung-saat-olahraga":b.THR},"ms-MY":{"kalkulator-bmi":b.BMI,"kalkulator-bmr":b.BMR,"kalkulator-tarikh-bersalin":b.DUE_DATE,"kalkulator-kesuburan":b.OVULATION,"kalkulator-tambah-berat-badan-hamil":b.PWG,"target-heart-rate-calculator":b.THR},"vi-VN":{"cach-tinh-chi-so-bmi":b.BMI,"tinh-chi-so-bmr":b.BMR,"cong-cu-tinh-ngay-du-sinh":b.DUE_DATE,"tinh-ngay-rung-trung":b.OVULATION,"cong-cu-tinh-can-nang-khi-mang-thai":b.PWG,"cong-cu-do-nhip-tim":b.THR},"zh-TW":{"bmi-calculator":b.BMI,"bmr-calculator":b.BMR,"due-date-calculator":b.DUE_DATE,"ovulation-calculator":b.OVULATION,"pregnancy-weight-gain-calculator":b.PWG,"target-heart-rate-calculator":b.THR},"en-PH":{"bmi-calculator":b.BMI,"bmr-calculator":b.BMR,"due-date-calculator":b.DUE_DATE,"ovulation-calculator":b.OVULATION,"pregnancy-weight-gain-calculator":b.PWG,"target-heart-rate-calculator":b.THR},"th-TH":{"เครื่องคำนวณหา-ค่าดัชนี":b.BMI,"เครื่องคำนวณอัตราการเผาผลาญพลังงาน-bmr":b.BMR,"เครื่องมือคำนวณกำหนดคลอด":b.DUE_DATE,"เครื่องคำนวณการตกไข่-ovulation-calculat":b.OVULATION,"เครื่องคำนวณน้ำหนักตัว":b.PWG,"เครื่องวัดอัตราการเต้น":b.THR},"hi-IN":{"bmi-calculator-en":b.BMI,"bmi-calculator":b.BMI,"bmr-calculator":b.BMR,"delivery-date-calculator":b.DUE_DATE,"ovulation-calculator":b.OVULATION,"pregnancy-weight-gain-calculator":b.PWG,"target-heart-rate-calculator":b.THR},"km-KH":{"គណនា-bmi":b.BMI,"គណនា-bmr":b.BMR,"គណនាថ្ងៃសម្រាលកូន":b.DUE_DATE,"គណនាថ្ងៃមេជីវិតញីទុំធ្លាក់":b.OVULATION,"គណនាទម្ងន់ស្ត្រីពពោះ":b.PWG,"គណនារកចង្វាក់បេះដូងល្អ":b.THR},"my-MM":{"bmi-calculator":b.BMI,"bmr-calculator":b.BMR,"due-date-calendar":b.DUE_DATE,"ovulation-calculator":b.OVULATION,"pregnaancy-weight-calculator":b.PWG,"target-heartrate":b.THR,"pregnancy-weight-calculator":b.PWG,"target-heart-rate":b.THR}},y="hhg_user_token",O="together_admin_token",w={report_scam:{label:"morePopover.report.scam",reportReasonText:"morePopover.report.scam"},report_sex:{label:"morePopover.report.sex",reportReasonText:"morePopover.report.sex"},report_offensive:{label:"morePopover.report.offensive",reportReasonText:"morePopover.report.offensive"},report_violence:{label:"morePopover.report.violence",reportReasonText:"morePopover.report.violence"},report_prohibited:{label:"morePopover.report.prohibited",reportReasonText:"morePopover.report.prohibited"},report_spam:{label:"morePopover.report.spam",reportReasonText:"morePopover.report.spam"},report_falseNews:{label:"morePopover.report.falseNews",reportReasonText:"morePopover.report.falseNews"},report_other:{label:"morePopover.report.other",reportReasonText:"morePopover.report.other"}},I={"en-PH":{ALL:"all",HOSPITAL:"hospital",SERVICE:"service",DOCTOR:"doctor",SEARCH:"search",SPECIALTIES:"specialties",CURRENT:"current-location"},"vi-VN":{ALL:"tat-ca",HOSPITAL:"benh-vien",SERVICE:"dich-vu",DOCTOR:"bac-si",SEARCH:"tim-kiem",SPECIALTIES:"chuyen-khoa",CURRENT:"vi-tri-hien-tai"},"id-ID":{ALL:"semua",HOSPITAL:"rumah-sakit",SERVICE:"layanan",DOCTOR:"dokter",SEARCH:"cari",SPECIALTIES:"spesialisasi",CURRENT:"posisi-saya-saat-ini"}},L=Object.freeze({__proto__:null,POST_DATE_FORMAT:"dd/MM/yyyy",NORMAL_DATE_FORMAT:"YYYY-MM-DD",DUE_DATE_FORMAT:E,DEFAULT_AVATAR_IMG:f,DEFAULT_RESULT_IMG:"/images/default.png",DEFAULT_IMG:T,BMI_LEVELS:["underweight","healthy","overweight","obese_level_1","obese_level_2"],BMR_LEVELS:["low","normal","high"],CORAL_TOKEN_COOKE:"coral_together_user_token",HEALTH_TOOL_TYPE:b,LOCALE_HEALTH_TOOLS:A,BEARER_TOKEN_COOKIE:y,TOGETHER_DISCLAIMER_COOKIE:"hhg_together_disclaimer",BEARER_ADMIN_TOKEN_COOKIE:O,Z_INDEX:{adBlock:48,articleAdContainer:47,headerContainerHome:99,headerContainerPopup:200,headerContainerPopupSUbLevel:300,menuSearchInputPopup:5,menuSearchInputDisplayIcon:6,menuSearchPopup:200},BmrActiveLevels:[{value:"sedentary",icon:"bmr-sedentary",name:"bmr.activeLevel.sedentary",description:"bmr.activeLevel.sedentary.description"},{value:"lightly-active",icon:"bmr-light",name:"bmr.activeLevel.lightlyActive",description:"bmr.activeLevel.lightlyActive.description"},{value:"moderately-active",icon:"bmr-moderately",name:"bmr.activeLevel.moderatelyActive",description:"bmr.activeLevel.moderatelyActive.description"},{value:"intensely-active",icon:"bmr-intensively",name:"bmr.activeLevel.intenselyActive",description:"bmr.activeLevel.intenselyActive.description"},{value:"extremely-active",icon:"bmr-extremely",name:"bmr.activeLevel.extremelyActive",description:"bmr.activeLevel.extremelyActive.description"}],LEAD_CAMPAIGN_CODE:"lmoct7xfr5sv4fv",LEAD_TOKEN_COOKIE:"hhg-id",GA_TOKEN_COOKIE:"_ga",GOOGLE_CALENDAR_AUTH_CLIENT_ID:"1038242799566-esoq4ij201ve5qfp266nbca44scpo3c6.apps.googleusercontent.com",FIND_CARE_IFRAME_URL:"https://www.appsheet.com/start/4ba34ebe-3cb6-4c16-8dd4-d074025a5bb6#appName=DependentDropdowns-2711103&group=%5B%5D&page=card&sort=%5B%5D&table=Menu&view=Menu",REPORT_REASON_MAP:w,MB_SOCIAL_LINKS:{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/marry.baby.vn",INSTAGRAM:"https://www.instagram.com/marrybaby.vn/",TWITTER:"",YOUTUBE:"https://www.youtube.com/channel/UCeZybTkY1VzJ3N7LvPGdKbg",ZALO:"http://zalo.me/806483414530291942"},INTERNAL_ROLES:["admin","moderator","local-admin"],EXTERNAL_ROLES:["ambassador","expert","sponsor","guide","influencer"],INTERNAL_PROFILE_ROLES:["moderator","local-admin"],EXTERNAL_PROFILE_ROLES:["expert","ambassador","sponsor"],RoleDataMap:{moderator:{text:"Moderator",fid:"cardAuthor.moderator",background:"#fe921d"},admin:{text:"Admin",fid:"cardAuthor.admin",background:"#2b62cd"},"local-admin":{text:"Local admin",fid:"cardAuthor.localAdmin",background:"#2b62cd"},expert:{text:"Expert",fid:"cardAuthor.expert",background:"#ff6f4d"},sponsor:{text:"Sponsor",fid:"cardAuthor.sponsor",background:"#00c7e6"},ambassador:{text:"Ambassador",fid:"cardAuthor.ambassador",background:"#00CB8A"}},MAX_IMAGE_UPLOADS:20,LOCALISED_SLUGS:I}),S=function(e){return e?{displayName:e.display_name||null,avatar:e.avatar||null,thumbnailAvatar:e.avatar_thumbnail||null,profileUrl:e.profile_url||null,description:e.description||null,metaTag:e.meta_tag||""}:{}},x=function(e){return e?{id:e.ID||null,name:e.name||null,specialty:e.specialty||null,avatar:e.avatar||null,permalink:e.permalink||null,thumbnailAvatar:e.avatar_thumbnail||null}:{}},R=function(t){var o,i,n,r;return t?{id:t.ID,postName:t.post_name,sponsor:t.sponsor?D(t.sponsor):null,isSponsored:t.is_sponsored||null,postTitle:t.post_title||"",postModified:t.post_modified||"",postDate:t.post_date||"",modifiedTime:t.modified_time||"",permalink:t.permalink||"",featureImage:t.image||null,featureImageMobile:t.image_medium||null,featureImageMobileXs:t.image_thumbnail||null,author:S(t.author),reviewer:t.reviewed_by&&S(t.reviewed_by)||null,articleReviewed:(null==t?void 0:t.reviewed)?e.__assign(e.__assign({},null==t?void 0:t.reviewed),{author:k(null===(o=null==t?void 0:t.reviewed)||void 0===o?void 0:o.author),editor:k(null===(i=null==t?void 0:t.reviewed)||void 0===i?void 0:i.editor),expert:k(null===(n=null==t?void 0:t.reviewed)||void 0===n?void 0:n.expert),fact_check:k(null===(r=null==t?void 0:t.reviewed)||void 0===r?void 0:r.fact_check)}):null,category:C(t.category),postContent:t.post_content||null,sections:t.sections||null,categories:(t.categories||[]).map(C),sources:t.sources||null,description:t.description||null,excerpt:t.excerpt||null,expert:x(t.expert),metaTag:t.meta_tag||null}:{}},k=function(t){return void 0!==t&&t?e.__assign(e.__assign({},t),{profile_url:(null==t?void 0:t.slug)?["expert","medical"].includes((null==t?void 0:t.role)||"")?"/expert/".concat(null==t?void 0:t.slug):"/author/".concat(null==t?void 0:t.slug):t.profile_url}):null},D=function(e){return e?{title:e.title,logo:e.logo,link:e.link}:{}},P=function(e){return{postTitle:e.post_title,permalink:e.permalink}},C=function(e){var t,o;return e?{termId:e.term_id||null,sponsor:e.sponsor?D(e.sponsor):null,isSponsored:e.is_sponsored||null,categoryName:e.cat_name||null,name:e.name||null,iconUrl:e.icon||"",slugName:e.category_nicename||null,description:e.description||null,featureImage:e.image||null,displayName:e.name||null,parent:e.parent||null,permalink:e.permalink||null,slug:e.slug||null,childCates:(null===(t=e.child_cates)||void 0===t?void 0:t.map((function(e){return C(e)})))||[],colorFeatureImage:e.color_feature_image||null,imageColor:e.image_color||null,textColor:e.text_color||null,catParent:(null===(o=e.cat_parent)||void 0===o?void 0:o.name)?{name:e.cat_parent.name,permalink:e.cat_parent.permalink}:{},metaTag:e.meta_tag||"",reviewedBy:e.reviewed_by?P(e.reviewed_by):null,reviewedDate:e.reviewed_date||"",faqs:e.faqs?e.faqs.map((function(e){return G(e)})):null}:{}},G=function(e){return{title:e.title,content:e.content}},N=function(e){return e?{icon:e.icon,link:e.link.startsWith("http")?e.link:"/health-tools"+e.link,subtitle:e.subtitle,title:e.title}:{}},U=function(e){return e?{topicCount:e.topics_count||0,postCount:e.posts_count||0,memberCount:e.members_count||0,thumbnail:e.thumbnail||"",coverImage:e.cover_image||"",mobileCoverImage:e.mobile_cover_image||"",name:e.name||"",description:e.description||"",slug:e.slug||"",id:e.id||0,joined:Boolean(e.joined),isActive:null===e.is_active||void 0===e.is_active||Boolean(e.is_active),mappedCategoryId:e.mapped_category_id||0,discoverCategory:e.discover_category?{categoryId:e.discover_category.category_id||0,name:e.discover_category.name||""}:null,isHidden:Boolean(e.is_hidden)}:{}},M=function(e){var t,o,i,n;return e?{id:e.id||0,name:e.name||"",image:e.thumbnail||"",slug:e.slug||"",url:"/"+(null===(t=e.community)||void 0===t?void 0:t.slug)+"/"+(null==e?void 0:e.slug)||"",description:e.description||"",joined:e.joined||!1,postCount:e.count_posts||0,memberCount:e.count_members||0,communityId:String(null===(o=e.community)||void 0===o?void 0:o.id),communitySlug:null===(i=e.community)||void 0===i?void 0:i.slug,communityName:null===(n=e.community)||void 0===n?void 0:n.name,order:e.order||0,isActive:null===e.is_active||void 0===e.is_active||Boolean(e.is_active),mappedCategoryId:e.mapped_category_id||0,discoverCategory:e.discover_category?{categoryId:e.discover_category.category_id||0,name:e.discover_category.name||""}:null,isHidden:Boolean(e.is_hidden)}:{}},B=function(e){var t,o,i,n,r,a,l,s,u,d,c,_,p,m,v,g,h,E,f,T,b;return e?{id:e.id,topics:(null===(t=e.topics)||void 0===t?void 0:t.map((function(t){var o,i,n,r;return{id:t.id||0,name:t.name||"",slug:t.slug||"",url:"/"+(null===(o=e.community)||void 0===o?void 0:o.slug)+"/"+t.slug,communityId:String(null===(i=e.community)||void 0===i?void 0:i.id),communitySlug:(null===(n=e.community)||void 0===n?void 0:n.slug)||"",communityName:(null===(r=e.community)||void 0===r?void 0:r.name)||"",isHidden:Boolean(t.is_hidden),isActive:!0}})))||[],community:{id:(null===(o=e.community)||void 0===o?void 0:o.id)||0,name:(null===(i=e.community)||void 0===i?void 0:i.name)||"",slug:(null===(n=e.community)||void 0===n?void 0:n.slug)||"",isActive:!0,isHidden:Boolean(null===(r=e.community)||void 0===r?void 0:r.is_hidden)},slug:e.slug||"",author:{id:(null===(a=e.user)||void 0===a?void 0:a.id)||0,username:(null===(l=e.user)||void 0===l?void 0:l.user_name)||"",email:(null===(s=e.user)||void 0===s?void 0:s.email)||"",name:(null===(u=e.user)||void 0===u?void 0:u.name)||"",avatar:(null===(d=e.user)||void 0===d?void 0:d.avatar)||"",role:(null===(c=e.user)||void 0===c?void 0:c.role)?null===(p=null===(_=e.user)||void 0===_?void 0:_.role)||void 0===p?void 0:p.toLowerCase():"",type:(null===(m=e.user)||void 0===m?void 0:m.type)||"",partnerId:(null===(v=e.user)||void 0===v?void 0:v.partner_id)?String(null===(g=e.user)||void 0===g?void 0:g.partner_id):"",title:(null===(h=e.user)||void 0===h?void 0:h.title)||"",doctorId:(null===(E=e.user)||void 0===E?void 0:E.doctor_id)?String(null===(f=e.user)||void 0===f?void 0:f.doctor_id):"",hospitalId:(null===(T=e.user)||void 0===T?void 0:T.hospital_id)?String(null===(b=e.user)||void 0===b?void 0:b.hospital_id):""},previewUrl:{title:e.preview_title||"",url:e.preview_link||"",image:e.preview_image||"",description:e.preview_description||""},createdAt:e.created_at||"",scheduleDateTime:e.schedule_datetime||"",photos:e.images||[],description:e.description||"",commentsCount:e.comments_count||0,likesCount:e.likes_count||0,title:e.name||"",isPin:!!e.is_pin,pinDate:e.pin_date||"",liked:e.liked||!1,bookmarked:Boolean(e.bookmarked)||!1,mentions:e.mentions||[],commented:Boolean(e.commented)||!1,introUrl:e.intro_url||"",bannerImage:e.banner_image||""}:{}},H=function(e){return e?{disclaimer:e.disclaimer,featuredImage:e.featured_image,info:e.info||[],reviewedBy:e.reviewed_by?{id:e.reviewed_by.ID,permalink:e.reviewed_by.permalink,name:e.reviewed_by.name,postTitle:e.reviewed_by.post_title}:null,reviewedDate:e.reviewed_date}:{}},F=function(e){var t,o,i,n,r,a,l,s,u,d,c,_,p,m,v,g,h,E,f,T,b,A,y,O,w,I,L,S,x,R,k,D;return e?{content:e.content,countLikes:e.likes_count,countReplies:e.replies_count,createdAt:e.created_at,createdTime:e.created_time,id:String(e.id),images:e.image||[],link:e.link||null,replies:e.replies&&e.replies.length>0?e.replies.map(F):[],author:{id:(null===(t=e.user)||void 0===t?void 0:t.id)||0,username:(null===(o=e.user)||void 0===o?void 0:o.user_name)||"",name:(null===(i=e.user)||void 0===i?void 0:i.name)||"",role:(null===(n=e.user)||void 0===n?void 0:n.role)?null===(a=null===(r=e.user)||void 0===r?void 0:r.role)||void 0===a?void 0:a.toLowerCase():"",avatar:(null===(l=e.user)||void 0===l?void 0:l.avatar)||"",type:(null===(s=e.user)||void 0===s?void 0:s.type)||"",email:(null===(u=e.user)||void 0===u?void 0:u.email)||"",partnerId:(null===(d=e.user)||void 0===d?void 0:d.partner_id)?String(null===(c=e.user)||void 0===c?void 0:c.partner_id):"",title:(null===(_=e.user)||void 0===_?void 0:_.title)||"",doctorId:(null===(p=e.user)||void 0===p?void 0:p.doctor_id)?String(null===(m=e.user)||void 0===m?void 0:m.doctor_id):"",hospitalId:(null===(v=e.user)||void 0===v?void 0:v.hospital_id)?String(null===(g=e.user)||void 0===g?void 0:g.hospital_id):""},liked:!!e.liked,mentionedUser:e.mentioned?{id:(null===(h=e.mentioned)||void 0===h?void 0:h.id)||0,username:(null===(E=e.mentioned)||void 0===E?void 0:E.user_name)||"",name:(null===(f=e.mentioned)||void 0===f?void 0:f.name)||"",role:(null===(T=e.mentioned)||void 0===T?void 0:T.role)?null===(A=null===(b=e.mentioned)||void 0===b?void 0:b.role)||void 0===A?void 0:A.toLowerCase():"",avatar:(null===(y=e.mentioned)||void 0===y?void 0:y.avatar)||"",type:(null===(O=e.mentioned)||void 0===O?void 0:O.type)||"",email:(null===(w=e.mentioned)||void 0===w?void 0:w.email)||"",partnerId:(null===(I=e.mentioned)||void 0===I?void 0:I.partner_id)?String(null===(L=e.mentioned)||void 0===L?void 0:L.partner_id):"",doctorId:(null===(S=e.mentioned)||void 0===S?void 0:S.doctor_id)?String(null===(x=e.mentioned)||void 0===x?void 0:x.doctor_id):"",hospitalId:(null===(R=e.mentioned)||void 0===R?void 0:R.hospital_id)?String(null===(k=e.mentioned)||void 0===k?void 0:k.hospital_id):"",title:(null===(D=e.mentioned)||void 0===D?void 0:D.title)||""}:null,mentions:e.mentions||[]}:{}},V=function(e){return void 0!==e&&e?(null==e?void 0:e.turn_off_profile)?"":(null==e?void 0:e.slug)?["expert","medical"].includes((null==e?void 0:e.role)||"")?"/expert/".concat(null==e?void 0:e.slug):"/author/".concat(null==e?void 0:e.slug):(null==e?void 0:e.profile_url)||(null==e?void 0:e.permalink)||"#":""},K=Object.freeze({__proto__:null,formatAuthor:S,formatArticleExpert:x,formatArticle:R,formatUserProfile:k,formatBMIResult:function(e){var t,o,i,n,r,a,l,s,u;return e&&e.status?{status:null==e?void 0:e.status,comparison:null!==(t=null==e?void 0:e.comparison)&&void 0!==t?t:"",assessmentData:[{tab:"tools.condition",content:null!==(o=null==e?void 0:e.condition)&&void 0!==o?o:""},{tab:"tools.risks",content:null!==(i=null==e?void 0:e.risk)&&void 0!==i?i:""},{tab:"tools.suggestion",content:null!==(n=null==e?void 0:e.suggestion)&&void 0!==n?n:""}],chartData:(null===(r=null==e?void 0:e.chart_data)||void 0===r?void 0:r.length)>0?null==e?void 0:e.chart_data:[],disclaimer:null!==(a=null==e?void 0:e.disclaimer)&&void 0!==a?a:"",illustrator:null!==(l=null==e?void 0:e.illustrator)&&void 0!==l?l:"",faqs:null!==(s=null==e?void 0:e.faqs)&&void 0!==s?s:[],suggestedArticlesLink:null!==(u=null==e?void 0:e.suggested_articles_link)&&void 0!==u?u:""}:{}},formatSponsor:D,formatReviewedCategory:P,formatCategory:C,formatCategoryApi:function(e){return e?{categoryInfo:C(e.data.category)||null,explainersPosts:(e.data.explainers_posts||[]).map(R),subCategories:(e.data.sub_categories||[]).map(C)}:{}},formatFaqsCategory:G,formatHealthTool:N,formatHealthToolTypeCategory:function(e){var t,o;return e?{termId:(null==e?void 0:e.term_id)||0,name:(null==e?void 0:e.name)||"",healthTools:null!==(o=null===(t=null==e?void 0:e.health_tools)||void 0===t?void 0:t.map((function(e){return N(e)})))&&void 0!==o?o:[]}:{}},formatCommunity:U,formatTopic:M,formatPost:B,formatPostPagination:function(e){return e?{currentPage:e.current||0,lastPage:e.last||0,total:e.total_items||0}:{}},formatNotification:function(e){var t,o,i;return e?{time:e.created_at,content:e.content,postId:String(e.post_id),fromUser:{name:null===(t=e.from_user)||void 0===t?void 0:t.name,id:null===(o=e.from_user)||void 0===o?void 0:o.id,avatar:null===(i=e.from_user)||void 0===i?void 0:i.avatar},toUserId:String(e.to_user_id),postSlug:e.post_slug||"",communitySlug:e.community_slug||""}:{}},formatSpotlightsList:function(e){return e?e.map((function(e){return{id:e.ID,name:e.name,permalink:e.permalink,image:(null==e?void 0:e.small_banner)||(null==e?void 0:e.image),imageMedium:(null==e?void 0:e.image_medium)||null,imageThumbnail:(null==e?void 0:e.image_thumbnail)||null,startDate:null==e?void 0:e.start_date,endDate:null==e?void 0:e.end_date}})):[]},formatOvulationInfo:H,formatSuggestedArticle:function(e){return e?{postId:e.post_id||null,categoryId:e.category_id||null,postUrl:e.post_url||null,postReviewed:e.post_reviewed||null,postPageviews:e.post_pageviews||null,postRank:e.post_rank||null,isPin:e.is_pin||null,frequency:e.frequency||null,topic:e.topic||null}:{}},formatTopicHealthTool:function(e){return e?{id:e.tool_id||null,topicFrequency:e.frequency||null,topicId:e.topic_id||null,topicName:e.topic_name||null,isPinned:!!e.is_pin||null,toolLink:e.tool_link||""}:{}},formatComment:F,formatReportedPostToPostDetail:function(e){return e?{name:e.title,description:e.description,images:e.images,likes_count:e.count_likes,comments_count:e.count_comments,topics:[],slug:e.post_slug,id:e.post_id,is_pin:e.is_pin,pin_date:"",post_type:e.post_type,schedule_datetime:e.schedule_datetime,is_active:e.is_active,preview_title:e.preview_title||"",preview_image:e.preview_image||"",preview_description:e.preview_description||"",preview_link:e.preview_link||"",user:e.user,created_at:"",created_time:"",community:{id:e.community_id,name:e.community_name,slug:e.community_slug,description:""}}:{}},formatTopicSubot:function(e){return e?{chatBotId:e.subot_id,isPinned:e.is_pin,topicId:e.topic_id,topicFrequency:e.frequency}:{}},formatSiteWideBanner:function(e,t){return void 0!==e&&e?{content:(null==e?void 0:e.content)||"",icon:(null==e?void 0:e.icon)||"",type:t||"other"}:null},formatPWGContent:function(e){return e?{disclaimer:e.disclaimer,info:e.info||[],reviewedBy:e.reviewed_by?k(e.reviewed_by):null,reviewedDate:e.reviewed_date,metaTag:e.meta_tag}:{}},formatUserProfileUrl:V,formatTHRContent:function(e){return e?{disclaimer:e.disclaimer,info:e.info||[],reviewedBy:e.reviewed_by?k(e.reviewed_by):null,reviewedDate:e.reviewed_date,metaTag:e.meta_tag}:{}},formatBabyGrowthContent:function(e){var t,o,i;return e&&e.information?{information:null!==(t=e.information.map((function(e){return{title:e.title,description:e.description}})))&&void 0!==t?t:[],reviewBy:{reviewer:(null===(o=e.reviewed_by)||void 0===o?void 0:o.display_name)||(null===(i=e.reviewed_by)||void 0===i?void 0:i.name)||"",date:e.reviewed_date||"",link:V(null==e?void 0:e.reviewed_by)},metaTag:e.meta_tag||"",title:e.title||"",description:e.description||"",disclaimer:e.disclaimer||"",is_sponsored:e.is_sponsored||!1,sponsor:e.sponsor,featuredImage:e.featured_image||""}:{}}}),j={BASE_API_PATH:"/",PROFILE:"profile?website_url={website_url}",SEARCH_USER:"profile/search?website_url={website_url}&name={name}",FETCH_PREVIEW:"fetch/preview?website_url={website_url}",FETCH_POST_OR_TOPIC:"fetch/{slug}?website_url={website_url}&community_slug={communitySlug}",POST:{LIST:"post?website_url={website_url}&slug={slug}&pin={pin}&page={page}&community_id={communityId}&topic_id={topicId}&sort_by={sort}&id={id}",DETAIL_BY_ID_OR_SLUG:"post/{idSlug}?website_url={website_url}",CREATE:"post/create?website_url={website_url}",LIKE:"post/{id}/like?website_url={website_url}",DELETE:"post/{id}/delete?website_url={website_url}",REPORT:"post/{id}/report?website_url={website_url}",UPDATE:"post/{id}/update?website_url={website_url}",FOLLOW:"post/{id}/follow?website_url={website_url}",CREATE_ARTICLE_COMMENT:"article-comment/create?website_url={website_url}"},COMMENT:{LIST:"comment?website_url={website_url}&post_id={postId}&page={page}&sort_by={sort}&items_per_page={perPage}&_without_reply={withoutReply}",CREATE:"comment/create?website_url={website_url}",REPLY:"comment/reply?website_url={website_url}",DELETE:"comment/{id}/delete?website_url={website_url}",LIKE:"comment/{id}/like?website_url={website_url}",UNLIKE:"comment/{id}/unlike?website_url={website_url}",IMAGE_UPLOAD:"comment/image/upload?website_url={website_url}"},COMMUNITY:{LIST:"community?website_url={website_url}&page={page}",DETAIL_BY_ID_OR_SLUG:"community/{idSlug}?website_url={website_url}",JOIN:"community/join?website_url={website_url}",LEAVE:"community/leave?website_url={website_url}"},TOPIC:{LIST:"topic?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}&page={page}",DETAIL_BY_ID_OR_SLUG:"topic/{idSlug}?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}",HEALTH_TOOLS:"tools?topic_id={topicId}&website_url={website_url}",SUBOTS:"subots?topic_id={topicId}&website_url={website_url}",SUGGESTED_POSTS:"suggested-posts?topic_id={topicId}&website_url={website_url}&page={page}",JOIN:"topic/join?website_url={website_url}",LEAVE:"topic/leave?website_url={website_url}"},BOOKMARK:{LIST:"bookmark?user_id={userId}&website_url={website_url}",CREATE:"bookmark/create?website_url={website_url}",DELETE:"bookmark/delete?website_url={website_url}"},UPLOAD_IMAGE:"auth/comment/image/upload?website_url={website_url}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info"},Y=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var o={},i=(t||{}).decode||X,n=0;for(;n<e.length;){var r=e.indexOf("=",n);if(-1===r)break;var a=e.indexOf(";",n);if(-1===a)a=e.length;else if(a<r){n=e.lastIndexOf(";",r-1)+1;continue}var l=e.slice(n,r).trim();if(void 0===o[l]){var s=e.slice(r+1,a).trim();34===s.charCodeAt(0)&&(s=s.slice(1,-1)),o[l]=J(s,i)}n=a+1}return o},W=function(e,t,o){var i=o||{},n=i.encode||$;if("function"!=typeof n)throw new TypeError("option encode is invalid");if(!q.test(e))throw new TypeError("argument name is invalid");var r=n(t);if(r&&!q.test(r))throw new TypeError("argument val is invalid");var a=e+"="+r;if(null!=i.maxAge){var l=i.maxAge-0;if(isNaN(l)||!isFinite(l))throw new TypeError("option maxAge is invalid");a+="; Max-Age="+Math.floor(l)}if(i.domain){if(!q.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain="+i.domain}if(i.path){if(!q.test(i.path))throw new TypeError("option path is invalid");a+="; Path="+i.path}if(i.expires){var s=i.expires;if(!function(e){return"[object Date]"===z.call(e)||e instanceof Date}(s)||isNaN(s.valueOf()))throw new TypeError("option expires is invalid");a+="; Expires="+s.toUTCString()}i.httpOnly&&(a+="; HttpOnly");i.secure&&(a+="; Secure");if(i.priority){switch("string"==typeof i.priority?i.priority.toLowerCase():i.priority){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(i.sameSite){switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},z=Object.prototype.toString,q=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function X(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function $(e){return encodeURIComponent(e)}function J(e,t){try{return t(e)}catch(t){return e}}var Z={parse:Y,serialize:W},Q={"vi-VN":"hellobacsi.com","id-ID":"hellosehat.com","ms-MY":"hellodoktor.com","km-KH":"hellokrupet.com","en-PH":"hellodoctor.com.ph","th-TH":"hellokhunmor.com","my-MM":"hellosayarwon.com","zh-TW":"helloyishi.com.tw","hi-IN":"helloswasthya.com"},ee={"vi-VN":"marrybaby.vn"},te=process.env.NEXT_PUBLIC_DEPLOY_LOCALE||"vi-VN",oe=function(e){var t=exports.GlobalData.env.isMarryBaby;return"https://".concat(t?ee[e]:Q[e])},ie=function(e){var t=e.indexOf("?");return t>=0?e.slice(0,t+1)+e.slice(t+1).replace(/[^=&]+=(&|$)/g,"").replace(/&$/,""):e},ne=function(t,o,i){var n="";i&&(n=Object.keys(i).map((function(e){return e+"="+i[e]})).join("&"));var r=((null===exports.GlobalData||void 0===exports.GlobalData?void 0:exports.GlobalData.env)||{}).togetherBaseApiUrl,a=void 0===r?"":r,l=m.default(t,e.__assign(e.__assign({},(null==o?void 0:o._locale)?{website_url:oe(String(o._locale))}:{}),o));return l+="".concat(l.includes("?")?"&":"?").concat(n),a+"api/v1/"+ie(l)},re=function(e){return(null==e?void 0:e.data)&&(e.data instanceof FormData?e.body=e.data:"object"==typeof e.data&&(e.body=JSON.stringify(e.data)),delete e.data),e},ae=function(t,o,i,n){return void 0===n&&(n=!1),e.__awaiter(void 0,void 0,void 0,(function(){var r,a,l,s,u;return e.__generator(this,(function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),[4,fetch(n?t:(c=t,encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]")),e.__assign(e.__assign({method:o},re(i)),{headers:e.__assign({},null==i?void 0:i.headers)})).then((function(e){return e.json()}))];case 1:return(r=d.sent())?[2,r]:[3,3];case 2:return a=d.sent(),console.log(a),console.log({url:t,status:null===(l=null==a?void 0:a.response)||void 0===l?void 0:l.status,statusText:null===(s=null==a?void 0:a.response)||void 0===s?void 0:s.statusText}),[2,(null===(u=null==a?void 0:a.response)||void 0===u?void 0:u.data)||null];case 3:return[2,null]}var c}))}))},le=function(t,o,i,n){return e.__awaiter(void 0,void 0,void 0,(function(){var a,l,s,u;return e.__generator(this,(function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),a=Z.parse(n||""),l=a[y],(s=l||r.getCookie(y))&&s.length?[4,fetch(t,e.__assign(e.__assign({method:o},re(i)),{headers:e.__assign({Authorization:"Bearer "+s},null==i?void 0:i.headers)})).then((function(e){return e.json()}))]:[3,2];case 1:if(u=d.sent())return[2,u];d.label=2;case 2:return[3,4];case 3:return d.sent(),[2,null];case 4:return[2,null]}}))}))};function se(e,t,o){var i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),n=-1!==e.indexOf("?")?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+o+"$2"):e+n+t+"="+o}var ue=function(e,t,o,i){return o&&t?"".concat(o,"-").concat(t):"".concat(p.default(e||"",{lower:!0,locale:i||te}),"-").concat(t)},de={locale:"vi-VN",env:{isMarryBaby:!1,togetherBasePath:"/community"},router:{basePath:"",asPath:"/"}},ce=t.createContext({data:de,action:{pushNotifications:function(e){return e},sanitizeFunction:function(e){return e}}});exports.GlobalData=de;var _e,pe=_.default.div(_e||(_e=e.__makeTemplateObject(["\n width: 40px;\n height: 40px;\n flex-shrink: 0;\n cursor: pointer;\n font-size: 20px;\n\n img {\n border-radius: 50%;\n }\n\n .avatar {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .avatar-default {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n border-radius: 50%;\n color: white;\n font-size: 1em;\n font-weight: bold;\n line-height: 1;\n }\n\n &[data-is-marrybaby='true'] {\n .avatar-default {\n background-color: ",";\n }\n }\n"],["\n width: 40px;\n height: 40px;\n flex-shrink: 0;\n cursor: pointer;\n font-size: 20px;\n\n img {\n border-radius: 50%;\n }\n\n .avatar {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .avatar-default {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n border-radius: 50%;\n color: white;\n font-size: 1em;\n font-weight: bold;\n line-height: 1;\n }\n\n &[data-is-marrybaby='true'] {\n .avatar-default {\n background-color: ",";\n }\n }\n"])),(function(e){return e.theme.colors.secondaryBase}),(function(e){return e.theme.mbColors.pink}));exports.ADMIN_PATHS={SEARCH_USER:"admin/profile/search?website_url={website_url}&name={name}",COMMENT:{IMAGE_UPLOAD:"admin/comment/image/upload?website_url={website_url}"}},exports.Avatar=function(i){var n=i.type,r=void 0===n?"square":n,a=i.size,l=i.avatarImg,s=i.avatarUrl,u=i.firstLetter,d=i.backgroundColor,_=i.onClick,p=i.style,m=i.className,g=i.isAmp,h=void 0!==g&&g,E=i.width,f=i.height,T=a?v[a]:void 0,b=t.useState(!1),A=b[0],y=b[1];t.useEffect((function(){if(s){var e=document.createElement("img");e.setAttribute("src",s),e.addEventListener("error",(function(){y(!0)}))}}),[s,y]);var O=(!s&&!l||A)&&u;return c.default.createElement(o.StyledAvatar,{style:e.__assign(e.__assign({},p),{"--size":!h&&T?T+"px":void 0,"--width-prop":E?E+"px":void 0,"--height-prop":f?f+"px":void 0,"--background-color":d}),"data-has-max":!(!E||!f),"data-avatar-type":r,onClick:_,className:m,avatarUrl:s,"data-is-amp":h,"data-custom-size":!!a},l,s&&!A&&c.default.createElement("img",{src:s}),O&&u)},exports.BEARER_TOKEN_COOKIE=y,exports.CARE_PATHS={GET_DOCTOR_INFO:"api/doctors/{doctorId}?site={website_url}",GET_HOSPITAL_INFO:"api/hospital/branch/{hospital_branch_id}?site={website_url}"},exports.DEFAULT_AVATAR_IMG=f,exports.DEFAULT_IMG=T,exports.DISCOVER_PATHS={BASE_API_PATH:"/",GET_SEARCH_ARTICLES:"search?s={keyword}&page={page}",GET_ALL_CATEGORIES:"categories?type=all",GET_HOMEPAGE_POSTS:"home/trending-post?type={type}",GET_HOMEPAGE_LATEST_POSTS:"articles?page=1&_islatest=1",GET_ARTICLE_DETAIL:"article/{slug}?skip_ids={skipIds}&_isrelated={isRelated}",GET_CATEGORY_DETAIL:"category/{slug}",GET_CATEGORY_OR_ARTICLE_DETAIL:"fetch/{fullSlug}",GET_PREVIEW_ARTICLE:"fetch/{fullSlug}?preview_nonce={nonce}&preview=true",GET_ARTICLE_OF_CATEGORY:"articles?category_id={categoryId}&page={currentPage}",GET_PAGE_STATIC:"page/{slug}",GET_ALL_HEALTH_TOOLS:"healthtools",GET_ALL_MARRYBABY_HEALTH_TOOLS:"health-tools",GET_HEALTH_TOOLS_BY_CATEGORY:"healthtools?_hasgroup=1",GET_AUTHOR:"author/{slug}",GET_ALL_EXPERTS:"experts",GET_ALL_EXPERTS_PAGING:"experts?page={page}",GET_EXPERT:"expert/{slug}",GET_EXPERT_POST:"expert/article?page={page}",POST_ARTICLE_FEEDBACK:"article/feedback/{id}",GET_AZ_DRUGS:"category/a-z/{category}",GET_HOMEPAGE_MEDICAL_REVIEWED:"home/medical-reviewed",GET_ARTICLES_BY_IDS:"articles?ids={ids}",GET_ARTICLE_OF_CATEGORY_NO_EXPLAINERS:"articles?category_id={categoryId}&page={currentPage}&skip_ids={ids}",GET_EXPERT_OF_CATEGORY:"category/expert/?id={id}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info",GET_DUE_DATE_ALL_WEEKS:"health-tools/due-date-calculator/all",GET_DUE_DATE_SUGGESTED_ARTICLES:"health-tools/due-date-calculator/result?from_week={from}&to_week={to}",GET_PROFILE:"user/profile",GET_ADMIN_PROFILE:"GET_ADMIN_PROFILE",GET_FEATURE:"feature",POST_NEW_FEATURE:"feature/update",CREATE_BOOKMARK:"bookmark/create",DELETE_BOOKMARK:"bookmark/delete",DELETE_ALL_BOOKMARK:"bookmark/delete-all",GET_ALL_BOOKMARK:"bookmark",SSO_USER_PROFILE:"user",SSO_USER_BOOKMARKS:"user/bookmarks",SSO_USER_PASSWORD:"user/settings/password",SSO_USER_EMAIL:"user/settings/update-email",SSO_CLOSE_ACCOUNT:"user/settings/close-account",SSO_HELP:"user/settings/help",GET_HEALTH_TOOL_OVULATION_INFO:"health-tools/ovulation-calculator/info",GET_HEALTH_TOOL_OVULATION_SUGGESTED_ARTICLES:"health-tools/ovulation-calculator/result?method={method}",GET_HEALTH_TOOL_BMI_INFO:"health-tools/bmi-calculator/info",GET_HEALTH_TOOL_BMI_RESULT:"health-tools/bmi-calculator/result?gender={gender}&bmi={bmi}&age={age}",GET_HEALTH_TOOL_BMR_INFO:"health-tools/bmr-calculator/info",GET_HEALTH_TOOL_BMR_RESULT:"health-tools/bmr-calculator/result?kcals={kcals}&gender={gender}&age={age}",GET_HEALTH_TOOL_PWG_INFO:"health-tools/preweight-gain-calculator/info",GET_HEALTH_TOOL_THR_INFO:"health-tools/target-heart-rate/info",GET_HEALTH_TOOL_BABY_GROWTH_INFO:"health-tools/baby-growth-tracking/info",POST_UPDATE_LOCATION:"tracking/geo/",GET_SIDIS_DUE_DATE:"frontend/tools/due_date",GET_SIDIS_OVULATION:"frontend/tools/ovulation",GET_SIDIS_BMI:"frontend/tools/bmi",GET_SIDIS_BMR:"frontend/tools/bmr",POST_LOGOUT:"user/logout",OVULATION_CREATE_EVENT:"ovulation/event?method={method}&day={day}&cycle={cycle}&period={period}&token={token}&user_id={user_id}",GET_ALL_SPOTLIGHT:"spotlights?per_page={perPage}&order_by={orderBy}",SSO_UPDATE_FIRST_TIME_BOOKMARK:"bookmark/update-first-time",POST_COMMENT_NOTIFICATION:"comment/notification",GET_ABOUT_US_DATA:"about",POST_LEAD_IMPRESSION:"campaign/{campaignCode}/impression",POST_LEAD_POPUP_EXIT:"campaign/{campaignCode}/popup_exit",POST_LEAD_LEAD:"campaign/{campaignCode}/lead",POST_SSO_VERIFY_TOKEN:"verify-id-token",GET_LANDING_PAGE_FIRST_NODE:"landing_page/bot",GET_LANDING_PAGE_NEXT_NODE:"landing_page/messages",POST_LANDING_PAGE_IMPRESSION:"landing_page/impressions",POST_LANDING_PAGE_CLICK:"landing_page/clicks",FETCH_URL_DATA:"preview",GET_SPOTLIGHT_LANDING:"spotlight/{slug}",GET_FOOTER_INFO:"footer",CHECK_SSO_EMAIL:"member/check-email",GET_HOMEPAGE_SITEWIDE_BANNER:"home/sitewide-banner",GET_DYNAMIC_FOOTER:"menu/footer",GET_EXPERTS:"experts?page={page}&number={perPage}&s={search}",GET_EXPERT_BY_ID:"expert/{id}"},exports.DUE_DATE_FORMAT=E,exports.DefaultComponentGlobalContextData=de,exports.HEALTH_TOOL_TYPE=b,exports.MAX_IMAGE_UPLOADS=20,exports.PATHS=j,exports.Popup=function(e){var t=e.type,o=void 0===t?"lead":t,i=e.closeIcon,n=e.isOpen,r=void 0===n||n,a=e.onClose,l=e.children,s=e.className,u=void 0===s?"":s,d=e.enableAnimation,_=void 0===d||d;return c.default.createElement(c.default.Fragment,null,c.default.createElement(g,{"data-open":r,"data-type":o,"data-animation":_},c.default.createElement("div",{className:"".concat(u||""," popup-content")},!!i&&c.default.createElement("div",{className:"close-button",onClick:a},i),l)),c.default.createElement(h,{"data-open":r,onClick:a}))},exports.REPORT_REASON_MAP=w,exports.TogetherComponentGlobalContext=ce,exports.TogetherComponentGlobalContextProvider=function(e){var o=e.locale,i=void 0===o?"vi-VN":o,n=e.children,r=e.userInfo,a=e.router,l=e.env,s=void 0===l?{isMarryBaby:!1,togetherBasePath:"/community"}:l,u=e.sanitizeFunction,d=void 0===u?function(e){return e}:u,_=e.pushNotifications,p=void 0===_?function(){return!1}:_,m=t.useState(),v=m[0],g=m[1];return exports.GlobalData={userInfo:r,locale:i,togetherUserId:v,router:a,env:s},t.useEffect((function(){(null==r?void 0:r.id)&&le(ne(j.PROFILE,{_locale:i}),"GET").then((function(e){var t;g(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)}))}),[null==r?void 0:r.id]),c.default.createElement(ce.Provider,{value:{data:{userInfo:r,locale:i,togetherUserId:v,router:a,env:s},action:{pushNotifications:p,sanitizeFunction:d}}},n)},exports.UserAvatar=function(e){var o=e.className,i=e.isMarryBaby,n=e.style,r=e.avatar,a=e.username,l=e.isLazy,s=t.useContext(ce).data.env.isMarryBaby,u="boolean"==typeof i?i:s,d=t.useState(!1),_=d[0],p=d[1];return t.useEffect((function(){var e=new Image;e.onerror=function(){p(!0)},e.src=r}),[]),c.default.createElement(pe,{"data-is-marrybaby":u,className:o,style:n},r&&!_?c.default.createElement("img",{src:l?void 0:r,"data-src":l?r:void 0,className:"avatar ".concat(l?"lazy":""),alt:"avatar",onError:function(){p(!0)}}):c.default.createElement("div",{className:"avatar avatar-default"},a&&(null==a?void 0:a.length)>0?a[0].toUpperCase():"A"))},exports.callApi=ae,exports.callApiWithAdminAuth=function(t,o,i,n){return e.__awaiter(void 0,void 0,void 0,(function(){var a,l,s,u;return e.__generator(this,(function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),a=Z.parse(n||""),l=a[O],(s=l||r.getCookie(O))&&s.length?[4,fetch(t,e.__assign(e.__assign({method:o},re(i)),{headers:e.__assign({Authorization:"Bearer "+s},null==i?void 0:i.headers)})).then((function(e){return e.json()}))]:[3,2];case 1:if(u=d.sent())return[2,u];d.label=2;case 2:return[3,4];case 3:return d.sent(),[2,null];case 4:return[2,null]}}))}))},exports.callApiWithAuth=le,exports.callApiWithOptionalAuth=function(t,o,i,n){return void 0===o&&(o="GET"),e.__awaiter(void 0,void 0,void 0,(function(){var a,l,s,u,d,c,_,p,m,v,g,h,E,f;return e.__generator(this,(function(T){switch(T.label){case 0:if(T.trys.push([0,7,,8]),a="string"==typeof t?t:t.url,l="string"==typeof t?t:t.backupUrl,s=Z.parse(n||""),u=s[y],!(d=u||r.getCookie(y))||!d.length)return[3,5];T.label=1;case 1:return T.trys.push([1,3,,4]),[4,fetch(a,e.__assign(e.__assign({method:o},re(i)),{headers:e.__assign({Authorization:"Bearer "+d},null==i?void 0:i.headers)})).then((function(e){return e.json()}))];case 2:return c=T.sent(),(null===(m=null==c?void 0:c.messages)||void 0===m?void 0:m.find((function(e){return"Unauthenticated"===(null==e?void 0:e.toLowerCase())})))?[2,ae(l||a,o,i)]:c?[2,c]:[3,4];case 3:return _=T.sent(),console.log({status:null===(v=null==_?void 0:_.response)||void 0===v?void 0:v.status,statusText:null===(g=null==_?void 0:_.response)||void 0===g?void 0:g.statusText}),[2,ae(l||a,o,i)];case 4:return[3,6];case 5:return[2,ae(l||a,o,i)];case 6:return[3,8];case 7:return p=T.sent(),console.log({status:null===(h=null==p?void 0:p.response)||void 0===h?void 0:h.status,statusText:null===(E=null==p?void 0:p.response)||void 0===E?void 0:E.statusText}),[2,(null===(f=null==p?void 0:p.response)||void 0===f?void 0:f.data)||null];case 8:return[2,null]}}))}))},exports.constants=L,exports.dataTransform=K,exports.domainLocales=Q,exports.formatComment=F,exports.formatCommunity=U,exports.formatOvulationInfo=H,exports.formatPost=B,exports.formatTopic=M,exports.formatUserProfileUrl=V,exports.getApiPath=ne,exports.getCareDoctorUrl=function(e){var t,o=e.name,i=e.id,n=e.locale;return"/care/".concat(null===(t=I[n||"vi-VN"])||void 0===t?void 0:t.DOCTOR,"/").concat(ue(o,i))},exports.getCareHospitalUrl=function(e){var t,o=e.name,i=e.id,n=e.slug,r=e.locale;return"/care/".concat(null===(t=I[r||"vi-VN"])||void 0===t?void 0:t.HOSPITAL,"/").concat(ue(o,i,n))},exports.getCarePath=function(t,o){var i=((null===exports.GlobalData||void 0===exports.GlobalData?void 0:exports.GlobalData.env)||{}).careBaseApiUrl;return((void 0===i?"":i)||"https://service-health-care.hellohealthgroup.com/")+ie(m.default(t,e.__assign({},o)))},exports.getCurrentBaseUrl=function(e){var t=exports.GlobalData.env.isMarryBaby;if("undefined"!=typeof window)return window.location.origin;var o="staging"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return"development"===process.env.NEXT_PUBLIC_DEPLOY_ENV?"http://localhost:3000":"https://".concat(o?t?"fe.":"discover.":t?"www.":"").concat(Q[e])},exports.getDiscoverApiPath=function(t,o){var i=((null===exports.GlobalData||void 0===exports.GlobalData?void 0:exports.GlobalData.env)||{}).discoverBaseApiUrl;return(void 0===i?"":i)+"wp-json/api/"+ie(m.default(t,e.__assign({},o)))},exports.getUrlToSignUp=function(e,t,o){void 0===o&&(o="/community");var i=e||("undefined"!=typeof window?window.location.href:"/"),n="undefined"!=typeof window?window.location.origin:"";return n||e&&(e.startsWith("http://")||e.startsWith("https://"))&&(n=e.split("/").slice(0,3).join("/")),function(e,t){var o=exports.GlobalData.env.publicSSO,i=e||window.location.href;return t&&Object.keys(t).map((function(e){se(i,e,t[e])})),se(i,"source","communities"),o?"".concat(o,"?returnUrl=").concat(encodeURIComponent(i.toString())):i}("".concat(n).concat(o,"/on-boarding?return=").concat(encodeURIComponent(i)),t)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-e6f346c4.js"),n=require("react"),r=require("./Locale-11b51016.js"),t=require("./gAssets.js"),i=require("./theme-b4bf0ca3.js"),l=require("./index-8cf56087.js"),o=require("styled-components"),a=require("./index-
|
|
1
|
+
"use strict";var e=require("./tslib.es6-e6f346c4.js"),n=require("react"),r=require("./Locale-11b51016.js"),t=require("./gAssets.js"),i=require("./theme-b4bf0ca3.js"),l=require("./index-8cf56087.js"),o=require("styled-components"),a=require("./index-8ddc0bb9.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s,d,u,p,m,b=c(n),x=c(o),f=x.default.div(s||(s=e.__makeTemplateObject(["\n display: inline-flex;\n overflow: hidden;\n width: ","px;\n height: ","px;\n box-sizing: border-box;\n align-items: center;\n justify-content: center;\n\n border: 1px solid #e4e8ec;\n background-color: ",";\n border-radius: ",";\n & > * {\n width: ","px;\n height: ","px;\n }\n"],["\n display: inline-flex;\n overflow: hidden;\n width: ","px;\n height: ","px;\n box-sizing: border-box;\n align-items: center;\n justify-content: center;\n\n border: 1px solid #e4e8ec;\n background-color: ",";\n border-radius: ",";\n & > * {\n width: ","px;\n height: ","px;\n }\n"])),(function(e){return e.size}),(function(e){return e.size}),(function(e){return e.backgroundColor||i.theme.colors.white}),(function(e){return e.borderRadius||"50%"}),(function(e){return e.iconSize}),(function(e){return e.iconSize})),g=x.default.div(d||(d=e.__makeTemplateObject(["\n display: inline-block;\n height: 108px;\n background-color: ",";\n border-radius: 60px;\n cursor: pointer;\n &.selected-week-pill {\n background-color: ",";\n }\n\n & > div:first-child {\n margin: 4px 4px 0;\n }\n\n & > p {\n margin-top: 8px;\n text-align: center;\n }\n\n & > * {\n pointer-events: none;\n }\n"],["\n display: inline-block;\n height: 108px;\n background-color: ",";\n border-radius: 60px;\n cursor: pointer;\n &.selected-week-pill {\n background-color: ",";\n }\n\n & > div:first-child {\n margin: 4px 4px 0;\n }\n\n & > p {\n margin-top: 8px;\n text-align: center;\n }\n\n & > * {\n pointer-events: none;\n }\n"])),(function(e){return e.theme.colors.white}),(function(e){return e.theme.colors.pink100})),h=[r.LOCALE.Myanmar,r.LOCALE.Taiwan],k=x.default((function(r){var o=r.icon,a=r.name,c=r.className,s=r.locale,d=void 0===s?"en-PH":s,u=r.onSelect,p=e.__rest(r,["icon","name","className","locale","onSelect"]),m=n.useMemo((function(){return null==c?void 0:c.includes("selected-week-pill")}),[c]);return b.default.createElement(g,e.__assign({onClick:u,className:c?"week-pill".concat(" non-pointer-event-child ",c):"week-pill non-pointer-event-child"},p),b.default.createElement(f,{size:64,iconSize:40,backgroundColor:i.theme.colors.white},b.default.createElement("img",{src:o||t.CommonGAssets.getAssetPath("week_default.png"),alt:""})),m?b.default.createElement(l.Text,e.__assign({type:"semiBold",size:"n1",color:i.theme.colors.gray800},h.includes(d)&&{style:{fontSize:"10px"}}),a):b.default.createElement(l.Text,e.__assign({size:"n1",color:i.theme.colors.gray600},h.includes(d)&&{style:{fontSize:"10px"}}),a))}))(u||(u=e.__makeTemplateObject(["\n box-shadow: 0px 0px 24px rgba(0, 0, 0, 0.08);\n"],["\n box-shadow: 0px 0px 24px rgba(0, 0, 0, 0.08);\n"]))),_=x.default(a.CentralCarousel.Slide)(p||(p=e.__makeTemplateObject([""],[""]))),w=x.default(a.CentralCarousel)(m||(m=e.__makeTemplateObject(["\n .centerred-pill-wrapper {\n padding: 16px 0;\n }\n"],["\n .centerred-pill-wrapper {\n padding: 16px 0;\n }\n"])));exports.PillCarousel=function(n){var t=n.data,i=n.isMobile,l=n.onSlideChange,o=n.pillProps,a=n.locale,c=void 0===a?r.LOCALE.Vietnam:a,s=n.blurFromIndex,d=n.blurLength,u=e.__rest(n,["data","isMobile","onSlideChange","pillProps","locale","blurFromIndex","blurLength"]),p={withControls:!i,slideGap:16,blurFromCenter:!0,blurFromIndex:s||(i?2:4),blurLength:d||(i?1:3),onSlideChange:l};return b.default.createElement(w,e.__assign({},p,u),(function(n){return t.map((function(r,t){return b.default.createElement(_,e.__assign({key:t,onClick:l},o),b.default.createElement("div",{className:"centerred-pill-wrapper"},b.default.createElement(k,{locale:c,name:r.name,icon:r.icon,className:t===n?"selected-week-pill":""})))}))}))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./tslib.es6-e6f346c4.js"),n=require("react"),t=require("@mantine/carousel"),r=require("@mantine/hooks"),l=require("styled-components");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u,o=i(n),c=i(l).default(t.Carousel.Slide)(u||(u=e.__makeTemplateObject([""],[""]))),a=n.createContext({}),d=function(e,n){return e>=n?e-n:e},s=function(l){var i=l.children,u=l.blurFromCenter,c=l.blurFromIndex,s=l.blurLength,f=void 0===s?3:s,v=l.maxBlurOpacity,p=void 0===v?.5:v,h=l.onSlideChange,x=l.selectSlideWhenClick,m=e.__rest(l,["children","blurFromCenter","blurFromIndex","blurLength","maxBlurOpacity","onSlideChange","selectSlideWhenClick"]),S=r.useResizeObserver(),g=S[0],b=S[1],C=n.useRef(null),y=n.useState(0),k=y[0],_=y[1],E=function(){var e,n,t,r=null===(e=null==C?void 0:C.current)||void 0===e?void 0:e.selectedScrollSnap();_(r);var l=(null===(n=null==C?void 0:C.current)||void 0===n?void 0:n.slideNodes())||[],i=l.length,o=(null===(t=null==C?void 0:C.current)||void 0===t?void 0:t.slidesInView()).length,a=Math.floor(o/2),s=u?c+f-1:a,v=r+s,h=v===i?0:v>i?v-i:v,x=r-s,m=x<0?i+x:x>0?r-s:0,S=Array(2*s+1).fill("").map((function(e,n){return d(m+n,i)}));l.map((function(e,n){if(n===r?e.classList.add("center-slide"):e.classList.remove("center-slide"),-1!==S.indexOf(n))for(var t=p/f,l=0;l<f;l++){if(n===d(m+l,i)||n===(o=i,(u=h-l)<0?o+u:u)){e.style.opacity=String((l+1)*t);break}e.style.opacity="1"}else e.style.opacity="0";var u,o}))},q={getEmblaApi:function(e){C.current=e},onSlideChange:function(e){E(),null==h||h(e)}};return n.useEffect((function(){(null==C?void 0:C.current)&&E()}),[b]),o.default.createElement(a.Provider,{value:{slider:null==C?void 0:C.current,centerSlide:k,selectSlideWhenClick:x}},o.default.createElement(t.Carousel,e.__assign({ref:g,slideSize:"auto",containScroll:"trimSnaps"},q,m,{loop:!0}),"function"==typeof i?i(k):i))};s.Slide=function(t){var r=t.children,l=t.onClick,i=e.__rest(t,["children","onClick"]),u=n.useContext(a),d=u.slider,s=u.selectSlideWhenClick,f=n.useRef(),v=n.useRef(""),p=n.useState(0),h=p[0],x=p[1];n.useEffect((function(){v.current=String(Math.round(1e4*Math.random()))}),[]),n.useEffect((function(){var e=(null==d?void 0:d.slideNodes())||[];x(e.findIndex((function(e){return e.dataset.key===v.current})))}),[d]);var m={ref:f,"data-key":v.current,"data-index":h,styles:function(){return{control:{width:"40px",height:"40px",border:0,background:"white",boxShadow:"rgb(0 0 0 / 4%) 0px 10px 16px, rgb(0 0 0 / 4%) 0px 2px 8px, rgb(0 0 0 / 4%) 0px 0px 1px",svg:{width:"20px",height:"20px"}}}}};return o.default.createElement(c,e.__assign({},m,i),o.default.createElement("div",{onClick:function(){s&&(null==d||d.scrollTo(h)),null==l||l(h)}},r))},exports.CentralCarousel=s;
|
package/build/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-57503957.js"),r=require("./index-04b29b8d.js"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-57503957.js"),r=require("./index-04b29b8d.js"),o=require("./index-3aff0afd.js"),t=require("./index-46d18a00.js"),a=require("./index-d632029d.js"),s=require("./index-cbc786e1.js"),i=require("./index-145ee47e.js"),p=require("./index-aba6bda8.js"),n=require("./index-f1d22aeb.js"),x=require("./index-6193a08c.js"),d=require("./index-4b65b38e.js"),u=require("./index-753d5042.js"),l=require("./index-8cf56087.js"),g=require("./index-dfc05d3b.js"),c=require("./index-2bf458c4.js"),C=require("./index-76dc603c.js"),P=require("./index-54e59382.js"),m=require("./footer.js"),b=require("./useTranslations-00120db0.js"),h=require("./useScrollbarSize-586f6706.js"),f=require("./useFbDataLayer-88be276d.js"),q=require("./useHealthToolCache-7866f415.js"),S=require("./translationsProvider-e8f5d92d.js"),T=require("./translationsContext-9e231a88.js"),v=require("./types-3b481a79.js"),D=require("./types-d0f54c42.js"),j=require("./constants-ca5ea110.js"),y=require("./localizeNumberFormat-155e5aec.js"),B=require("./screenSizeContext-562a50e8.js"),L=require("./cookieHelper-3553173d.js"),k=require("./lazyLoad-f5c59bb0.js");require("react"),require("styled-components");var I=require("./theme-b4bf0ca3.js"),A=require("./dataTransform-a27830ef.js"),N=require("./routing-a1ce2d90.js"),R=require("./utils-df758048.js"),w=require("./getDynamicHealthTool-04d91381.js"),M=require("./getSocialList-2ed6dad4.js");require("./Locale-11b51016.js"),require("./isProduction-32e6a55a.js"),require("./tslib.es6-e6f346c4.js"),require("lodash/throttle"),require("keen-slider/react"),require("dayjs"),require("./gAssets.js"),require("react-hook-form"),require("./index-66fcfd20.js"),require("@mantine/core"),require("@mantine/hooks"),require("@hookform/resolvers/yup"),require("date-fns"),require("react-range"),require("./types-2b3bdf79.js"),require("react-day-picker/DayPickerInput"),require("./defaultClassWrapper-0eac7dff.js"),require("./useOutsideClick-528bfd6c.js"),require("date-fns/locale/en-US"),require("date-fns/locale/id"),require("date-fns/locale/vi"),require("date-fns/locale/zh-TW"),require("slugify"),require("string-format"),require("./index.styled-5df734b4.js"),require("./core-27ea44f3.js"),require("dayjs/plugin/relativeTime"),require("lodash/debounce"),require("./index-7d3b086d.js"),require("react-dom"),require("./index-8ddc0bb9.js"),require("@mantine/carousel"),require("innertext"),require("react-contenteditable"),require("react-loading-skeleton"),require("lodash/shuffle"),require("vanilla-lazyload"),exports.Types=e.index,exports.Constants=r.index,exports.Alert=o.Alert,exports.AmpNextPage=o.AmpNextPage,exports.ArticleCard=o.ArticleCard,exports.BMICardEmbed=o.BMICardEmbed,exports.BMRCardEmbed=o.BMRCardEmbed,exports.BabyGrowthCardEmbed=o.BabyGrowthCardEmbed,exports.BabyPoopEmbed=o.BabyPoopEmbed,exports.Badge=o.Badge,exports.BorderHeading=o.BorderHeading,exports.Breadcrumbs=o.Breadcrumbs,exports.Carousel=o.Carousel,exports.CategoryCard=o.CategoryCard,exports.Checkbox=o.Checkbox,exports.CheckboxGroup=o.CheckboxGroup,exports.CookieAcceptConfirm=o.CookieAcceptConfirm,exports.DatePicker=o.DatePicker,exports.DateRangePicker=o.DateRangePicker,exports.DoctorInfo=o.DoctorInfo,exports.DueDateCardEmbed=o.DueDateCardEmbed,exports.FileDropdown=o.FileDropdown,exports.FloatButtonGroup=o.FloatButtonGroup,exports.Grid=o.Grid,exports.IconText=o.IconText,exports.MobileBottomNavigation=o.MobileBottomNavigation,exports.MobileBottomNavigationIcon=o.MobileBottomNavigationIcon,exports.OvulationCardEmbed=o.OvulationCardEmbed,exports.PWGCardEmbed=o.PWGCardEmbed,exports.Pagination=o.Pagination,exports.Progress=o.Progress,exports.ProgressBar=o.ProgressBar,exports.Radio=o.Radio,exports.RadioGroup=o.RadioGroup,exports.RateStars=o.RateStars,exports.ScrollList=o.ScrollList,exports.SeoHead=o.SeoHead,exports.Shadow=o.Shadow,exports.ShareContainer=o.ShareContainer,exports.ShareDrawer=o.ShareDrawer,exports.SideMenu=o.index,exports.Slider=o.Slider,exports.StatisticCard=o.StatisticCard,exports.SurveyQuestionCard=o.SurveyQuestionCard,exports.SurveyThankyouCard=o.SurveyThankyouCard,exports.THRCardEmbed=o.THRCardEmbed,exports.Table=o.index$1,exports.Tabs=o.Tabs,exports.Tag=o.Tag,exports.Toggle=o.Toggle,exports.ToolsBannerCard=o.ToolsBannerCard,exports.UnderlinedLink=o.UnderlinedLink,exports.Uploader=o.Uploader,exports.Avatar=t.Avatar,exports.DefaultComponentGlobalContextData=t.DefaultComponentGlobalContextData,Object.defineProperty(exports,"GlobalData",{enumerable:!0,get:function(){return t.GlobalData}}),exports.Popup=t.Popup,exports.TogetherComponentGlobalContext=t.TogetherComponentGlobalContext,exports.TogetherComponentGlobalContextProvider=t.TogetherComponentGlobalContextProvider,exports.TogetherConstants=t.constants,exports.TogetherDataTransforms=t.dataTransform,exports.UserAvatar=t.UserAvatar,exports.Button=a.Button,exports.AuthorBadge=s.AuthorBadge,exports.Divider=s.Divider,exports.Dropdown=s.Dropdown,exports.Flag=i.Flag,exports.LanguageSwitcher=i.LanguageSwitcher,exports.NavigationLogoutPopup=i.NavigationLogoutPopup,exports.NavigationProfileButton=i.NavigationProfileButton,exports.NavigationV2=i.NavigationV2,exports.ProfilePopup=i.ProfilePopup,exports.UserProfileNavigation=i.UserProfileNavigation,exports.UserProfileNavigationHeader=i.NavHeader,exports.UserProfileNavigationStats=i.UserStats,exports.getNavMenuContent=i.getNavMenuContent,exports.getNavMenuContentWithCache=i.getNavMenuContentWithCache,exports.Heading=p.Heading,exports.Input=n.Input,exports.Label=x.Label,exports.Logo=d.Logo,exports.PureInput=u.PureInput,exports.Text=l.Text,exports.Drawer=g.Drawer,exports.Icon=g.Icon,exports.Menu=g.Menu,exports.Modal=g.Modal,exports.NewBabyProfileRadio=g.NewBabyProfileRadio,exports.RadioImageGroup=g.RadioImageGroup,exports.TextArea=g.TextArea,exports.TextDivider=g.TextDivider,exports.Container=c.Container,exports.CustomReferenceDot=C.CustomReferenceDot,exports.PillCarousel=P.PillCarousel,exports.Footer=m.Footer,exports.useTranslations=b.useTranslations,exports.MEASURE_ELEMENT_CLASS=h.MEASURE_ELEMENT_CLASS,exports.useScrollbarSize=h.useScrollbarSize,exports.useFbDataLayer=f.useFbDataLayer,exports.useHealthToolsCache=q.useHealthToolsCache,exports.TranslationsProvider=S.TranslationsProvider,exports.translationsMap=S.translationsMap,exports.TranslationsContext=T.TranslationsContext,exports.defaultTranslations=T.defaultTranslations,exports.CardAuthor=v.CardAuthor,exports.CardLink=v.CardLink,exports.CardPost=v.CardPost,exports.CardPostPopoverMore=v.CardPostPopoverMore,exports.CardReactions=v.CardReactions,exports.CardReply=v.CardReply,exports.CardReplyPopover=v.CardReplyPopover,exports.CreateNewPostContent=v.CreateNewPostContent,exports.CreatePostDescription=v.CreatePostDescription,exports.CreatePostTitle=v.CreatePostTitle,exports.ImagePreviewPopup=v.ImagePreviewPopup,exports.InputCommentBar=v.InputCommentBar,exports.LabelPin=v.LabelPin,exports.LabelSortPin=v.LabelSortPin,exports.LabelSorting=v.LabelSorting,exports.Loading=v.Loading,exports.PopoverMenu=v.PopoverMenu,exports.PopupDanger=v.PopupDanger,exports.PopupDoctor=v.PopupDoctor,exports.PopupExpert=v.PopupExpert,exports.PopupFrame=v.PopupFrame,exports.PopupHospital=v.PopupHospital,exports.PostContent=v.PostContent,exports.PostImagePreview=v.PostImagePreview,exports.PostSingleImageViewPopup=v.PostSingleImageViewPopup,exports.ShareBox=v.ShareBox,exports.SharePopup=v.SharePopup,exports.SocialLinkPreview=v.SocialLinkPreview,exports.SubmitReportForm=v.SubmitReportForm,exports.TagTopic=v.TagTopic,exports.TogetherAuthConfigContext=v.TogetherAuthConfigContext,exports.TogetherAuthConfigContextProvider=v.TogetherAuthConfigContextProvider,exports.TogetherTypes=v.types,exports.TopicSelectList=v.TopicSelectList,exports.useTogetherAuthRequiredAction=v.useTogetherAuthRequiredAction,exports.BookingSearchBar=D.BookingSearchBar,exports.CareTypes=D.types,exports.CareConstants=j.constants,exports.ageGenerate=y.ageGenerate,exports.convertLocalizedStringToNumber=y.convertLocalizedStringToNumber,exports.localizeNumberFormat=y.localizeNumberFormat,exports.ScreenSizeContext=B.ScreenSizeContext,exports.ScreenSizeContextProvider=B.ScreenSizeContextProvider,exports.fadeIn=B.fadeIn,exports.getWindowSizeGroups=B.getWindowSizeGroups,exports.slideInDown=B.slideInDown,exports.slideInLeft=B.slideInLeft,exports.slideInRight=B.slideInRight,exports.slideInUp=B.slideInUp,exports.slideOutDown=B.slideOutDown,exports.slideOutLeft=B.slideOutLeft,exports.slideOutRight=B.slideOutRight,exports.slideOutUp=B.slideOutUp,exports.deleteCookie=L.deleteCookie,exports.getCookie=L.getCookie,exports.setCookie=L.setCookie,Object.defineProperty(exports,"lazyLoadInstance",{enumerable:!0,get:function(){return k.lazyLoadInstance}}),exports.theme=I.theme,exports.abbreviateNumber=A.abbreviateNumber,exports.formatPill=A.formatPill,exports.getCareApiDomain=N.getCareApiDomain,exports.getCurrentBaseUrl=N.getCurrentBaseUrl,exports.getCurrentSsoUrl=N.getCurrentSsoUrl,exports.getDiscoverApiDomain=N.getDiscoverApiDomain,exports.getTogetherApiDomain=N.getTogetherApiDomain,exports.Breakpoints=R.Breakpoints,exports.MediaQueries=R.MediaQueries,exports.formatUrlWithPageParam=R.formatUrlWithPageParam,exports.getBoundariesFromMediaQueryKey=R.getBoundariesFromMediaQueryKey,exports.getPopupWrapperDom=R.getPopupWrapperDom,exports.makeParams=R.makeParams,exports.safeEncodeURI=R.safeEncodeURI,exports.startCase=R.startCase,exports.toggleNoScroll=R.toggleNoScroll,exports.formatHealthTool=w.formatHealthTool,exports.getDynamicHealthTool=w.getDynamicHealthTool,exports.getDynamicHealthToolWithCache=w.getDynamicHealthToolWithCache,exports.getSocialList=M.getSocialList;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FormEvent } from 'react';
|
|
2
|
+
export declare const LeadCampaign: ({ campaign, action, onSubmit, onClose, }: {
|
|
3
|
+
campaign: any;
|
|
4
|
+
action?: string;
|
|
5
|
+
onSubmit?: (e: FormEvent<HTMLFormElement>, categoryLevel?: number, categoryData?: {
|
|
6
|
+
[k: number]: {
|
|
7
|
+
value?: string;
|
|
8
|
+
value_en?: string;
|
|
9
|
+
};
|
|
10
|
+
}, popupId?: string) => void;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
}) => JSX.Element;
|
|
@@ -2,9 +2,7 @@ export declare const CAMPAIGN_TARGET_TYPE: {
|
|
|
2
2
|
LINKS: number;
|
|
3
3
|
TAGS: number;
|
|
4
4
|
};
|
|
5
|
-
export declare let LEAD_SITE_ID: number;
|
|
6
5
|
export declare let LEAD_API: string;
|
|
7
|
-
export declare let LEAD_SITE_DOMAIN: string;
|
|
8
6
|
export declare const LEAD_VERSION = "2.1-aka-3.0.63 - \uD83C\uDF20 The Starry Night";
|
|
9
7
|
export declare let LEAD_IS_DEV: boolean;
|
|
10
8
|
export declare let LEAD_DEV_URL: string;
|
package/build/lead/index.d.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LOCALE } from 'src/interfaces/types/Locale';
|
|
3
|
+
export type Props = {
|
|
4
|
+
apiUrl?: string;
|
|
5
|
+
siteDomain?: string;
|
|
6
|
+
siteId?: string;
|
|
7
|
+
locale?: LOCALE;
|
|
8
|
+
};
|
|
9
|
+
export declare const LeadGen: ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, }: Props) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LeadWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const CenterTabLayout: ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }: {
|
|
3
|
+
popupId: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
newTab?: boolean;
|
|
6
|
+
imageDestkop?: string;
|
|
7
|
+
imageMobile?: string;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
onOtherSubmit?: () => void;
|
|
10
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const FloatingLayout: ({ popupId, url, title, urlText, titleAlign, subtitle, subtitleAlign, newTab, imageDesktop, imageMobile, onClose, onOtherSubmit, }: {
|
|
3
|
+
popupId: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
titleAlign?: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
subtitleAlign?: string;
|
|
8
|
+
url?: string;
|
|
9
|
+
urlText?: string;
|
|
10
|
+
newTab?: boolean;
|
|
11
|
+
imageDesktop?: string;
|
|
12
|
+
imageMobile?: string;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
onOtherSubmit?: () => void;
|
|
15
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FormEvent } from 'react';
|
|
2
|
+
export declare const LightboxLayout: ({ popupId, extraFields, onClose, onOtherSubmit, imageMobile, imageDesktop, imageBackground, currentLayout, title, onSubmit, }: {
|
|
3
|
+
popupId: string;
|
|
4
|
+
currentLayout: string;
|
|
5
|
+
extraFields: any;
|
|
6
|
+
title?: string;
|
|
7
|
+
imageMobile?: string;
|
|
8
|
+
imageDesktop?: string;
|
|
9
|
+
imageBackground?: string;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
onOtherSubmit?: () => void;
|
|
12
|
+
onSubmit?: (e: FormEvent<HTMLFormElement>) => void;
|
|
13
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const TabLayout: ({ popupId, url, newTab, image, onClose, onOtherSubmit, }: {
|
|
3
|
+
popupId: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
newTab?: boolean;
|
|
6
|
+
image?: string;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
onOtherSubmit?: () => void;
|
|
9
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LOCALE } from 'src/interfaces/types';
|
|
3
|
+
export type LeadGenContextType = {
|
|
4
|
+
apiUrl?: string;
|
|
5
|
+
siteDomain?: string;
|
|
6
|
+
siteId?: string;
|
|
7
|
+
locale?: LOCALE;
|
|
8
|
+
};
|
|
9
|
+
export declare const LeadGenContext: import("react").Context<LeadGenContextType>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FormEvent } from 'react';
|
|
2
|
+
export declare const NewLeadPopup: ({ campaign, action, onSubmit, onClose, }: {
|
|
3
|
+
campaign: any;
|
|
4
|
+
action?: string;
|
|
5
|
+
onSubmit?: (e: FormEvent<HTMLFormElement>, categoryLevel?: number, categoryData?: {
|
|
6
|
+
[k: number]: {
|
|
7
|
+
value?: string;
|
|
8
|
+
value_en?: string;
|
|
9
|
+
};
|
|
10
|
+
}, popupId?: string) => void;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FormEvent } from 'react';
|
|
2
|
+
export declare const OldLeadPopup: ({ campaign, action, onSubmit, onClose, }: {
|
|
3
|
+
campaign: any;
|
|
4
|
+
action?: string;
|
|
5
|
+
onSubmit?: (e: FormEvent<HTMLFormElement>, categoryLevel?: number, categoryData?: {
|
|
6
|
+
[k: number]: {
|
|
7
|
+
value?: string;
|
|
8
|
+
value_en?: string;
|
|
9
|
+
};
|
|
10
|
+
}, popupId?: string) => void;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ThankyouPopup: ({ title, titleAlign, subtitle, subtitleAlign, link, linkNewTab, linkText, image, }: {
|
|
3
|
+
title: string;
|
|
4
|
+
titleAlign?: string;
|
|
5
|
+
subtitle: string;
|
|
6
|
+
subtitleAlign?: string;
|
|
7
|
+
link: string;
|
|
8
|
+
linkNewTab?: boolean;
|
|
9
|
+
linkText: string;
|
|
10
|
+
image?: string;
|
|
11
|
+
}) => JSX.Element;
|
package/build/lead/utils.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export declare function leadLoadCssLink(linkCss: any): void;
|
|
2
1
|
export declare function isMobile(): boolean;
|
|
2
|
+
export declare function checkShowPopup({ leadApi, leadSiteId, leadDomain, onShowPopup, }: {
|
|
3
|
+
leadApi: string;
|
|
4
|
+
leadSiteId: string;
|
|
5
|
+
leadDomain: string;
|
|
6
|
+
onShowPopup?: (campaign: any, action: string) => void;
|
|
7
|
+
}): void;
|