@hhgtech/hhg-components 1.22.32 → 1.22.34

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.
Files changed (33) hide show
  1. package/build/babyGrowth.js +1 -1
  2. package/build/components/atoms/checkbox/index.d.ts +2 -1
  3. package/build/components/molecules/tabs/index.d.ts +1 -0
  4. package/build/components.js +1 -1
  5. package/build/esm/babyGrowth.js +1 -1
  6. package/build/esm/components.js +1 -1
  7. package/build/esm/hooks.js +1 -1
  8. package/build/esm/{index-49f531ae.js → index-27d646df.js} +1 -1
  9. package/build/esm/index-4c7e6985.js +1 -0
  10. package/build/esm/{index-03c5444a.js → index-99c3440f.js} +1 -1
  11. package/build/esm/{index-c1f96447.js → index-9c9eb3ce.js} +1 -1
  12. package/build/esm/index.js +1 -1
  13. package/build/esm/navigation.js +1 -1
  14. package/build/esm/together.js +1 -1
  15. package/build/esm/{types-ce3a6454.js → types-baa7b18e.js} +1 -1
  16. package/build/esm/useFbDataLayer-39219288.js +1 -0
  17. package/build/hooks.js +1 -1
  18. package/build/{index-4a7640b0.js → index-7f1e8b1d.js} +1 -1
  19. package/build/index-94c7b6dd.js +1 -0
  20. package/build/{index-bd12fd05.js → index-cc4f7e3b.js} +1 -1
  21. package/build/{index-0878c97f.js → index-d9ed29f2.js} +1 -1
  22. package/build/index.js +1 -1
  23. package/build/navigation.js +1 -1
  24. package/build/together/components/molecules/cardAuthor/index.d.ts +2 -2
  25. package/build/together/components/molecules/postContent/index.d.ts +3 -3
  26. package/build/together.js +1 -1
  27. package/build/{types-d78ab83b.js → types-afa65e83.js} +1 -1
  28. package/build/useFbDataLayer-eedaa95c.js +1 -0
  29. package/package.json +1 -1
  30. package/build/esm/index-fa05a63f.js +0 -1
  31. package/build/esm/useFbDataLayer-bb248530.js +0 -1
  32. package/build/index-1b08d5a7.js +0 -1
  33. package/build/useFbDataLayer-900607af.js +0 -1
@@ -0,0 +1 @@
1
+ import{d as e,e as n}from"./tslib.es6-c7fb770c.js";import{useEffect as t}from"react";import{g as r}from"./cookieHelper-8dd17c53.js";function i(e){var n=(new TextEncoder).encode(e.trim().toLowerCase());return crypto.subtle.digest("SHA-256",n).then((function(e){return Array.from(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}))}var o=function(o){t((function(){return(null==o?void 0:o.id)&&e(void 0,void 0,void 0,(function(){var e,t,a,l,c,u,s,d,f,p,m,h,b,g;return n(this,(function(n){switch(n.label){case 0:return[4,fetch("https://api.ipify.org").then((function(e){return e.text()}))];case 1:return(e=n.sent())?[3,3]:[4,fetch("https://icanhazip.com").then((function(e){return e.text()}))];case 2:e=n.sent(),n.label=3;case 3:return[4,Promise.all([o.email?i(o.email):null,o.phone?i(o.phone):null,o.birthday?i(o.birthday.split("-").join("")):null,o.gender?"m":"f",o.city_name?i(o.city_name).then((function(e){return e.replace(/\s/g,"")})):null,o.name?i(o.name):null])];case 4:return t=n.sent(),a=t[0],l=t[1],c=t[2],u=t[3],s=t[4],d=t[5],f={fbc:r("_fbc")||"",fbp:r("_fbp")||""},p={user_id:o.id},d&&(p.fn=d),a&&(f.em=a,p.em=a),l&&(f.ph=l,p.ph=l),c&&(f.db=c,p.db=c),u&&(f.ge=u,p.ge=u),s&&(f.ct=s,p.ct=s),null===(h=null===(m=window.localStorage)||void 0===m?void 0:m.setItem)||void 0===h||h.call(m,"fbDataLayer_userInfo",JSON.stringify(p)),null===(g=null===(b=window.localStorage)||void 0===b?void 0:b.setItem)||void 0===g||g.call(b,"fbClientIp",JSON.stringify({client_ip_address:(null==e?void 0:e.replace("\n",""))||"",client_user_agent:navigator.userAgent||""})),[2]}}))})),function(){}}),[o])};export{o as u};
package/build/hooks.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./useTranslations-231429a4.js"),r=require("./useScrollbarSize-f805c30e.js"),s=require("./useFbDataLayer-900607af.js"),a=require("./useHealthToolCache-38f50452.js");require("react"),require("./translationsContext-8d6c61df.js"),require("string-format"),require("lodash/debounce"),require("./tslib.es6-0065074f.js"),require("./cookieHelper-54048238.js"),require("./getDynamicHealthTool-95168d7e.js"),require("./core-e6a29d83.js"),require("./isProduction-69fc41c0.js"),require("./routing-9b0aa164.js"),require("./index-01fbb796.js"),require("./Locale-a817e0b3.js"),exports.useTranslations=e.useTranslations,exports.MEASURE_ELEMENT_CLASS=r.MEASURE_ELEMENT_CLASS,exports.useScrollbarSize=r.useScrollbarSize,exports.useFbDataLayer=s.useFbDataLayer,exports.useHealthToolsCache=a.useHealthToolsCache;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./useTranslations-231429a4.js"),r=require("./useScrollbarSize-f805c30e.js"),s=require("./useFbDataLayer-eedaa95c.js"),a=require("./useHealthToolCache-38f50452.js");require("react"),require("./translationsContext-8d6c61df.js"),require("string-format"),require("lodash/debounce"),require("./tslib.es6-0065074f.js"),require("./cookieHelper-54048238.js"),require("./getDynamicHealthTool-95168d7e.js"),require("./core-e6a29d83.js"),require("./isProduction-69fc41c0.js"),require("./routing-9b0aa164.js"),require("./index-01fbb796.js"),require("./Locale-a817e0b3.js"),exports.useTranslations=e.useTranslations,exports.MEASURE_ELEMENT_CLASS=r.MEASURE_ELEMENT_CLASS,exports.useScrollbarSize=r.useScrollbarSize,exports.useFbDataLayer=s.useFbDataLayer,exports.useHealthToolsCache=a.useHealthToolsCache;
@@ -1 +1 @@
1
- "use strict";var e=require("./tslib.es6-0065074f.js"),t=require("react"),o=require("./index-bd12fd05.js"),i=require("./utils-950aead5.js"),n=require("styled-components"),r=require("./cookieHelper-54048238.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-0065074f.js"),t=require("react"),o=require("./index-cc4f7e3b.js"),i=require("./utils-950aead5.js"),n=require("styled-components"),r=require("./cookieHelper-54048238.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)};