@hhgtech/hhg-components 1.23.68-beta-2 → 1.23.68-beta-3

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 (129) hide show
  1. package/build/{Visible-b77f930d.js → Visible-3635fa9a.js} +1 -1
  2. package/build/babyGrowth.js +1 -1
  3. package/build/cache.js +1 -1
  4. package/build/care.js +1 -1
  5. package/build/components.js +1 -1
  6. package/build/constants.js +1 -1
  7. package/build/core-f93d586c.js +1 -0
  8. package/build/{dataTransform-f7301843.js → dataTransform-2dfb028c.js} +1 -1
  9. package/build/{defaultClassWrapper-9293db71.js → defaultClassWrapper-7d12d090.js} +1 -1
  10. package/build/ecom.js +1 -1
  11. package/build/esm/lead.js +1 -1
  12. package/build/footer.js +1 -1
  13. package/build/gAssets.js +1 -1
  14. package/build/getDynamicHealthTool-b0029837.js +1 -0
  15. package/build/{getSocialList-3719c946.js → getSocialList-7addcf4f.js} +1 -1
  16. package/build/hooks.js +1 -1
  17. package/build/i18n.js +1 -1
  18. package/build/index-153e6d45.js +1 -0
  19. package/build/{index-1ce16686.js → index-19a37353.js} +1 -1
  20. package/build/{index-f56567b9.js → index-37be7cd1.js} +1 -1
  21. package/build/{index-75d6fa19.js → index-38ca0ea6.js} +1 -1
  22. package/build/{index-3141d4f3.js → index-3945c316.js} +1 -1
  23. package/build/{index-c38760af.js → index-3f76bdd2.js} +1 -1
  24. package/build/{index-198fab7c.js → index-526513df.js} +1 -1
  25. package/build/{index-6560fdbf.js → index-599abc79.js} +1 -1
  26. package/build/{index-4992938b.js → index-646a824f.js} +1 -1
  27. package/build/{index-e3e936c2.js → index-698cf326.js} +1 -1
  28. package/build/index-69a99b5b.js +1 -0
  29. package/build/{index-f6a1b9a9.js → index-735fde9a.js} +1 -1
  30. package/build/{index-1ec9b2ff.js → index-87412fcd.js} +1 -1
  31. package/build/{index-c3c14228.js → index-888af50d.js} +1 -1
  32. package/build/{index-3e130da7.js → index-96f240b5.js} +1 -1
  33. package/build/{index-5c9279a8.js → index-a00c4bb1.js} +1 -1
  34. package/build/{index-f0011ea5.js → index-a72c1bb6.js} +1 -1
  35. package/build/index-a738e5d6.js +1 -0
  36. package/build/{index-bab461c7.js → index-c6e1f9a5.js} +1 -1
  37. package/build/{index-8530a658.js → index-e8175855.js} +1 -1
  38. package/build/{index-88c49c2f.js → index-f6d8bb6e.js} +1 -1
  39. package/build/index.js +1 -1
  40. package/build/{index.styled-acd93e46.js → index.styled-06113ed9.js} +1 -1
  41. package/build/{index.styled-96c3fb8b.js → index.styled-2c03a965.js} +1 -1
  42. package/build/{index.styled-b306a2fe.js → index.styled-9a18156c.js} +1 -1
  43. package/build/{index.styled-875a2ce0.js → index.styled-af4a6cd5.js} +1 -1
  44. package/build/{index.styled-e23561d7.js → index.styled-d865f10a.js} +1 -1
  45. package/build/{index.styled-6c988d9d.js → index.styled-da402642.js} +1 -1
  46. package/build/lead.js +1 -1
  47. package/build/mantine.js +1 -1
  48. package/build/misc.js +1 -1
  49. package/build/navigation.js +1 -1
  50. package/build/onboarding.js +1 -1
  51. package/build/pwg.js +1 -1
  52. package/build/{routing-ceeee031.js → routing-9046f7a4.js} +1 -1
  53. package/build/{screenSizeContext-fe795ddf.js → screenSizeContext-4e057a75.js} +1 -1
  54. package/build/together.js +1 -1
  55. package/build/{translationsProvider-c6fc1b66.js → translationsProvider-e7e4a933.js} +1 -1
  56. package/build/{types-16adf405.js → types-19f6a0da.js} +1 -1
  57. package/build/{types-9bc0a8db.js → types-1f4f1f55.js} +1 -1
  58. package/build/types.js +1 -1
  59. package/build/{useFbDataLayer-b996387f.js → useFbDataLayer-a2d0b93e.js} +1 -1
  60. package/build/useHealthToolCache-6ee77237.js +1 -0
  61. package/build/{useTranslations-4b1a9d4f.js → useTranslations-d94de332.js} +1 -1
  62. package/package.json +1 -1
  63. package/build/core-8be3f88c.js +0 -1
  64. package/build/getDynamicHealthTool-fa7b9cde.js +0 -1
  65. package/build/index-66318c8d.js +0 -1
  66. package/build/index-784aed36.js +0 -1
  67. package/build/index-96103039.js +0 -1
  68. package/build/useHealthToolCache-098ef5ca.js +0 -1
  69. /package/build/{BMI_BOYS.percentile.monthly-3afadb48.js → BMI_BOYS.percentile.monthly-dd44b62f.js} +0 -0
  70. /package/build/{BMI_BOYS.percentile.weekly-b78872c6.js → BMI_BOYS.percentile.weekly-22ae3153.js} +0 -0
  71. /package/build/{BMI_BOYS.percentile.yearly-32b81057.js → BMI_BOYS.percentile.yearly-43935cf7.js} +0 -0
  72. /package/build/{BMI_BOYS.zscore.monthly-7ac39478.js → BMI_BOYS.zscore.monthly-9ef65ea0.js} +0 -0
  73. /package/build/{BMI_BOYS.zscore.weekly-8fd7b89d.js → BMI_BOYS.zscore.weekly-9bb94778.js} +0 -0
  74. /package/build/{BMI_BOYS.zscore.yearly-531d8af5.js → BMI_BOYS.zscore.yearly-e6562a39.js} +0 -0
  75. /package/build/{BMI_GIRLS.percentile.monthly-2d2628eb.js → BMI_GIRLS.percentile.monthly-5635f235.js} +0 -0
  76. /package/build/{BMI_GIRLS.percentile.weekly-c96d44a6.js → BMI_GIRLS.percentile.weekly-ea0b022f.js} +0 -0
  77. /package/build/{BMI_GIRLS.percentile.yearly-8d7efbf0.js → BMI_GIRLS.percentile.yearly-1c7f8058.js} +0 -0
  78. /package/build/{BMI_GIRLS.zscore.monthly-bbc32634.js → BMI_GIRLS.zscore.monthly-cfaf65a7.js} +0 -0
  79. /package/build/{BMI_GIRLS.zscore.weekly-9454f83c.js → BMI_GIRLS.zscore.weekly-33de7afd.js} +0 -0
  80. /package/build/{BMI_GIRLS.zscore.yearly-3819fe29.js → BMI_GIRLS.zscore.yearly-b5c4871d.js} +0 -0
  81. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-acaa0d1c.js → HEAD CIRCUM_BOYS.percentile.monthly-e61beb3f.js} +0 -0
  82. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-d14b7e9f.js → HEAD CIRCUM_BOYS.percentile.weekly-f5209a4d.js} +0 -0
  83. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-a05ce9b0.js → HEAD CIRCUM_BOYS.percentile.yearly-fe6fd20b.js} +0 -0
  84. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-a5e799b8.js → HEAD CIRCUM_BOYS.zscore.monthly-811e34bd.js} +0 -0
  85. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-0cf3f351.js → HEAD CIRCUM_BOYS.zscore.weekly-b13235cd.js} +0 -0
  86. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-d6042b09.js → HEAD CIRCUM_BOYS.zscore.yearly-33ea8183.js} +0 -0
  87. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-15682da2.js → HEAD CIRCUM_GIRLS.percentile.monthly-1708f7d3.js} +0 -0
  88. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-b8aa3d38.js → HEAD CIRCUM_GIRLS.percentile.weekly-0b14d3ad.js} +0 -0
  89. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-2faf3801.js → HEAD CIRCUM_GIRLS.percentile.yearly-b1610827.js} +0 -0
  90. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-d075da59.js → HEAD CIRCUM_GIRLS.zscore.monthly-60a08ac0.js} +0 -0
  91. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-b135b994.js → HEAD CIRCUM_GIRLS.zscore.weekly-1bb49497.js} +0 -0
  92. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-a814ad26.js → HEAD CIRCUM_GIRLS.zscore.yearly-48f267c0.js} +0 -0
  93. /package/build/{HEIGHT_BOYS.percentile.monthly-4a590dfa.js → HEIGHT_BOYS.percentile.monthly-14ff05ff.js} +0 -0
  94. /package/build/{HEIGHT_BOYS.percentile.weekly-994d69f9.js → HEIGHT_BOYS.percentile.weekly-d0188c1d.js} +0 -0
  95. /package/build/{HEIGHT_BOYS.percentile.yearly-f3f8974e.js → HEIGHT_BOYS.percentile.yearly-437f7d9a.js} +0 -0
  96. /package/build/{HEIGHT_BOYS.zscore.monthly-ec785ce7.js → HEIGHT_BOYS.zscore.monthly-f91cf012.js} +0 -0
  97. /package/build/{HEIGHT_BOYS.zscore.weekly-29d8d9c6.js → HEIGHT_BOYS.zscore.weekly-94eb733b.js} +0 -0
  98. /package/build/{HEIGHT_BOYS.zscore.yearly-5e2b3a3c.js → HEIGHT_BOYS.zscore.yearly-06bcc8dc.js} +0 -0
  99. /package/build/{HEIGHT_GIRLS.percentile.monthly-bc8529cd.js → HEIGHT_GIRLS.percentile.monthly-4296587d.js} +0 -0
  100. /package/build/{HEIGHT_GIRLS.percentile.weekly-0c189d61.js → HEIGHT_GIRLS.percentile.weekly-3936ae72.js} +0 -0
  101. /package/build/{HEIGHT_GIRLS.percentile.yearly-282bb255.js → HEIGHT_GIRLS.percentile.yearly-59ce5302.js} +0 -0
  102. /package/build/{HEIGHT_GIRLS.zscore.monthly-3e0b4923.js → HEIGHT_GIRLS.zscore.monthly-3e3e6610.js} +0 -0
  103. /package/build/{HEIGHT_GIRLS.zscore.weekly-93191708.js → HEIGHT_GIRLS.zscore.weekly-7c45bb62.js} +0 -0
  104. /package/build/{HEIGHT_GIRLS.zscore.yearly-7aa25061.js → HEIGHT_GIRLS.zscore.yearly-2602058c.js} +0 -0
  105. /package/build/{Locale-9e0137c9.js → Locale-858ea147.js} +0 -0
  106. /package/build/{WEIGHT_BOYS.percentile.monthly-ead9f710.js → WEIGHT_BOYS.percentile.monthly-b66dc11f.js} +0 -0
  107. /package/build/{WEIGHT_BOYS.percentile.weekly-ba9ad6c0.js → WEIGHT_BOYS.percentile.weekly-1e39fdcb.js} +0 -0
  108. /package/build/{WEIGHT_BOYS.percentile.yearly-f816b6fa.js → WEIGHT_BOYS.percentile.yearly-782a8cca.js} +0 -0
  109. /package/build/{WEIGHT_BOYS.zscore.monthly-14e6c23c.js → WEIGHT_BOYS.zscore.monthly-95220614.js} +0 -0
  110. /package/build/{WEIGHT_BOYS.zscore.weekly-22024b82.js → WEIGHT_BOYS.zscore.weekly-bd52e60c.js} +0 -0
  111. /package/build/{WEIGHT_BOYS.zscore.yearly-348003ae.js → WEIGHT_BOYS.zscore.yearly-c043ad42.js} +0 -0
  112. /package/build/{WEIGHT_GIRLS.percentile.monthly-a4692217.js → WEIGHT_GIRLS.percentile.monthly-1f27a25e.js} +0 -0
  113. /package/build/{WEIGHT_GIRLS.percentile.weekly-09b8667c.js → WEIGHT_GIRLS.percentile.weekly-4e4fad8b.js} +0 -0
  114. /package/build/{WEIGHT_GIRLS.percentile.yearly-c94a3e61.js → WEIGHT_GIRLS.percentile.yearly-dc89d7c2.js} +0 -0
  115. /package/build/{WEIGHT_GIRLS.zscore.monthly-76fe8e8d.js → WEIGHT_GIRLS.zscore.monthly-ab424900.js} +0 -0
  116. /package/build/{WEIGHT_GIRLS.zscore.weekly-69aa2458.js → WEIGHT_GIRLS.zscore.weekly-f51ed6dd.js} +0 -0
  117. /package/build/{WEIGHT_GIRLS.zscore.yearly-11650ac4.js → WEIGHT_GIRLS.zscore.yearly-bd88e09c.js} +0 -0
  118. /package/build/{constants-7af41f2d.js → constants-2d5385d1.js} +0 -0
  119. /package/build/{cookieHelper-1083539e.js → cookieHelper-fe26456e.js} +0 -0
  120. /package/build/{dataTransform-3fa23ae4.js → dataTransform-47e40b78.js} +0 -0
  121. /package/build/{isProduction-32029254.js → isProduction-763c43ef.js} +0 -0
  122. /package/build/{localizeNumberFormat-4530324a.js → localizeNumberFormat-2093bf11.js} +0 -0
  123. /package/build/{theme-1632f3f2.js → theme-513105f9.js} +0 -0
  124. /package/build/{translationsContext-a38930b2.js → translationsContext-1ab4ef19.js} +0 -0
  125. /package/build/{tslib.es6-edac99fc.js → tslib.es6-c51cbe7c.js} +0 -0
  126. /package/build/{types-6ccea541.js → types-adf338b1.js} +0 -0
  127. /package/build/{useOutsideClick-88d5c440.js → useOutsideClick-1e7a53aa.js} +0 -0
  128. /package/build/{useScrollbarSize-30bbeccc.js → useScrollbarSize-6fe1a611.js} +0 -0
  129. /package/build/{utils-74bfc266.js → utils-24bdf53f.js} +0 -0
package/build/ecom.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tslib.es6-edac99fc.js"),o=require("./theme-1632f3f2.js");require("./index-e3e936c2.js");var t=require("./isProduction-32029254.js"),i=require("./types-6ccea541.js");require("./Locale-9e0137c9.js");var l,n=Object.freeze({__proto__:null}),a=Object.freeze({__proto__:null}),r="development"===process.env.NEXT_PUBLIC_DEPLOY_ENV,s="undefined"==typeof window,u=process.env.NEXT_PUBLIC_DEPLOY_LOCALE?process.env.NEXT_PUBLIC_DEPLOY_LOCALE:"vi-VN",c=process.env.NEXT_PUBLIC_GOOGLE_MAP_KEY||"",d=process.env.NEXT_PUBLIC_ADMIN_GOOGLE_LOCATION_KEY,m=process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID||"289442006438-cihobuq1h3r4426pur7u0e43fqdnep59.apps.googleusercontent.com",p={"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"},_=r?"http://localhost:3001":t.isProduction?"https://".concat(p[u]):"https://discover.".concat(p[u]),h=t.isProduction?"https://wp.".concat(p[u],"/"):"https://staging.".concat(p[u],"/"),E=process.env.NEXT_PUBLIC_TOGETHER_API_URL&&""!==process.env.NEXT_PUBLIC_TOGETHER_API_URL?process.env.NEXT_PUBLIC_TOGETHER_API_URL:"https://together.".concat(p[u],"/"),v="".concat(_,"/community"),I=process.env.NEXT_PUBLIC_SSO_URL||"http://staging-id.hellobacsi.com/";!function(e){e[e.FEMALE=0]="FEMALE",e[e.MALE=1]="MALE",e[e.ANY=2]="ANY"}(l||(l={}));var T={"vi-VN":{HOME:function(){return JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/#website","@type":"WebSite",description:"Hello Bacsi - Health Information",inLanguage:"vi-VN",name:"Hello Bacsi",potentialAction:[{"@type":"SearchAction","query-input":"required name=search_term_string",target:"https://hellobacsi.com/shop/tim-kiem/?keyword={search_term_string}"}],url:"https://hellobacsi.com/shop/"}]})},CATEGORY:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),void 0===t&&(t=[]),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/#breadcrumb","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/","@type":"WebPage",name:"Hello Bacsi",url:"https://hellobacsi.com/shop/"}},{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/danh-muc","@type":"WebPage",name:"Hello Bacsi - Danh Muc",url:"https://hellobacsi.com/shop/danh-muc"}}]},{"@type":"ItemList",url:e,numberOfItems:o,itemListElement:t}]})},BRAND:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),void 0===t&&(t=[]),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/#breadcrumb","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/","@type":"WebPage",name:"Hello Bacsi",url:"https://hellobacsi.com/shop/"}},{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/thuong-hieu","@type":"WebPage",name:"Hello Bacsi - Thuong Hieu",url:"https://hellobacsi.com/shop/thuong-hieu"}}]},{"@type":"ItemList",url:e,numberOfItems:o,itemListElement:t}]})},BRAND_DETAIL:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/thuong-hieu/#brand","@type":"BrandDetail",itemListElement:[{"@type":"Item",item:{"@id":"https://hellobacsi.com/shop".concat(e),"@type":"WebPage",name:"Hello Bacsi - Thuong Hieu",url:"https://hellobacsi.com/shop".concat(e)}}]},{"@type":"BrandDetail",url:"https://hellobacsi.com/shop".concat(e),numberOfItems:o,itemListElement:null!=t?t:{}}]})},PRODUCT_DETAIL:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/san-pham/#product","@type":"ProductDetail",itemListElement:[{"@type":"Item",item:{"@id":"https://hellobacsi.com/shop/san-pham/".concat(e),"@type":"WebPage",name:"Hello Bacsi - Thuong Hieu",url:"https://hellobacsi.com/shop/san-pham/".concat(e)}}]},{"@type":"BrandDetail",url:e,numberOfItems:o,itemListElement:null!=t?t:{}}]})}}},g=Object.freeze({__proto__:null,isDevelopment:r,IS_SSR:s,locale:u,BEARER_TOKEN_COOKIE:"hhg_user_token",BEARER_ADMIN_TOKEN_COOKIE:"hhg_admin_token",GUEST_CART_ID_COOKIE:"hhg_guest_cart_id",GOOGLE_MAP_KEY:c,GOOGLE_ADMIN_LOCATION_KEY:d,GOOGLE_CLIENT_ID:m,GOOGLE_CALENDAR_API_KEY:"",basePath:"shop",SSO_USER_BASE_PATH:"user",CARE_BASE_PATH:"care",COMMUNITY_BASE_PATH:"community",HEALTH_TOOLs_BASE_PATH:"health-tools",NOTIFICATION_TIME_OUT:3e3,DOMAIN_LOCALES:p,DISCOVER_URL_FE:_,DISCOVER_URL_BE:h,TOGETHER_URL_BE:E,TOGETHER_URL_FE:v,SSO_URL:I,DISCOVERY_FOOTER_URL:"#",HEALTH_CARE_FOOTER_URL:"#",HEALTH_TOOLS_FOOTER_URL:"#",HEALTH_TOGETHER_FOOTER_URL:"#",POLICIES_FOOTER_URL:"#",FAQ_FOOTER_URL:"#",SITEMAP_FOOTER_URL:"#",ABOUT_US_FOOTER_URL:"#",EXECUTIVE_BIOS_FOOTER_URL:"#",ADVERTISING_FOOTER_URL:"#",CONTACT_US_FOOTER_URL:"#",ABOUT_GO_CARE_FOOTER_URL:"#",get Gender(){return l},EMAIL_REGEX:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,COUNTRY_SITENAME:{ID:"Hello Sehat",TH:"Hello Khunmor",MY:"Hello Doktor",KH:"Hello Krupet",TW:"Hello Yishi",MM:"Hello Sayarwon",IN:"Hello Swasthya",VN:"Hello Bacsi",PH:"Hello Doctor"},LOCALE_SPECS:{"vi-VN":{LOGO_TYPE:"hellobacsi",SITE_NAME:"HelloBacsi",SITE_NAME_FORMATTED:"Hello Bacsi",HOMEPAGE_IMAGE:"https://hellobacsi.com/images/country-thumbnails/VN.png",SITE_ID:"1",INSIDER_TAG:"//hellobacsivn.api.useinsider.com/ins.js?id=10003798",TOOLTIP_IMAGE:"/images/tooltips-vn.png"},"en-PH":{LOGO_TYPE:"hellodoctor",SITE_NAME:"HelloDoctor",HOMEPAGE_IMAGE:"https://hellodoctor.com.ph/images/country-thumbnails/PH.png",SITE_NAME_FORMATTED:"Hello Doctor",SITE_ID:"9",CATEGORIES_TYPE:"short",INSIDER_TAG:"//hellodoctorph.api.useinsider.com/ins.js?id=10004527",TOOLTIP_IMAGE:"/images/tooltips-ph.png"},"th-TH":{LOGO_TYPE:"hellokhunmor",SITE_NAME:"HelloKhunmor",HOMEPAGE_IMAGE:"https://hellokhunmor.com/images/country-thumbnails/TH.png",SITE_NAME_FORMATTED:"Hello Khunmor",SITE_ID:"3",CATEGORIES_TYPE:"long",INSIDER_TAG:"//hellokhunmor.api.useinsider.com/ins.js?id=10004524",TOOLTIP_IMAGE:"/images/tooltips-th.png"},"km-KH":{LOGO_TYPE:"hellokrupet",SITE_NAME:"HelloKrupet",HOMEPAGE_IMAGE:"https://hellokrupet.com/images/country-thumbnails/KH.JPG",SITE_NAME_FORMATTED:"Hello Krupet",SITE_ID:"4",CATEGORIES_TYPE:"long",INSIDER_TAG:"//hellokrupet.api.useinsider.com/ins.js?id=10004523",TOOLTIP_IMAGE:"/images/tooltips-kh.png"},"my-MM":{LOGO_TYPE:"hellosayarwon",SITE_NAME:"HelloSayarwon",HOMEPAGE_IMAGE:"https://hellosayarwon.com/images/country-thumbnails/PH.png",SITE_NAME_FORMATTED:"Hello Sayarwon",SITE_ID:"7",INSIDER_TAG:"//hellosayarwon.api.useinsider.com/ins.js?id=10004522"},"zh-TW":{LOGO_TYPE:"helloyishi",SITE_NAME:"HelloYishi",HOMEPAGE_IMAGE:"https://helloyishi.com.tw/images/country-thumbnails/TW.png",SITE_NAME_FORMATTED:"Hello Yishi",SITE_ID:"6",INSIDER_TAG:"//helloyishi.api.useinsider.com/ins.js?id=10004526",TOOLTIP_IMAGE:"/images/tooltips-tw.png"},"id-ID":{LOGO_TYPE:"hellosehat",SITE_NAME:"HelloSehat",HOMEPAGE_IMAGE:"https://hellosehat.com/images/country-thumbnails/ID.png",SITE_NAME_FORMATTED:"Hello Sehat",SITE_ID:"2",INSIDER_TAG:"//hellosehat.api.useinsider.com/ins.js?id=10003799",TOOLTIP_IMAGE:"/images/tooltips-id.png"},"hi-IN":{LOGO_TYPE:"helloswasthya",SITE_NAME:"HelloSwasthya",HOMEPAGE_IMAGE:"https://helloswasthya.com/images/country-thumbnails/IN.png",SITE_NAME_FORMATTED:"हैलो स्वास्थ्य",SITE_ID:"8",CATEGORIES_TYPE:"long",INSIDER_TAG:"//helloswasthya.api.useinsider.com/ins.js?id=10004498",TOOLTIP_IMAGE:"/images/tooltips-in.png"},"ms-MY":{LOGO_TYPE:"hellodoktor",SITE_NAME:"HelloDoktor",HOMEPAGE_IMAGE:"https://hellodoktor.com/images/country-thumbnails/MY.png",SITE_NAME_FORMATTED:"Hello Doktor",SITE_ID:"5",INSIDER_TAG:"//hellodoktor.api.useinsider.com/ins.js?id=10004525",TOOLTIP_IMAGE:"/images/tooltips-my.png"}},SOCIAL_MEDIA:{"vi-VN":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellobacsi/",INSTAGRAM:"https://www.instagram.com/hellobacsi/",TWITTER:null,YOUTUBE:"https://www.youtube.com/channel/UCYHzHDXngnB7jkmcQgXwE0w"},"en-PH":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/HelloDoctorPH/",INSTAGRAM:"https://www.instagram.com/hellodoctor_ph/",TWITTER:null},"km-KH":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellokrupet/",INSTAGRAM:"https://www.instagram.com/hellokrupetofficial/",TWITTER:null,YOUTUBE:"https://www.youtube.com/channel/UCVK4p9YPIMkmoerk3X-y-TQ"},"ms-MY":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/HelloDoktorMY/",INSTAGRAM:"https://www.instagram.com/_hellodoktor_/",TWITTER:null},"id-ID":{LINKEDIN:"https://www.linkedin.com/company/hello-sehat/",FACEBOOK:"https://www.facebook.com/hellosehat",INSTAGRAM:"https://www.instagram.com/hellosehat/",TWITTER:"https://twitter.com/HelloSehat"},"my-MM":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellosayarwon/",INSTAGRAM:"https://www.facebook.com/hellosayarwon/",TWITTER:null},"zh-TW":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/helloyishi/",INSTAGRAM:"https://www.instagram.com/helloyishi/",TWITTER:null},"hi-IN":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/HelloSwasthya/",INSTAGRAM:"https://www.instagram.com/hello_swasthya/",TWITTER:null},"th-TH":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellokhunmor/",INSTAGRAM:"https://www.instagram.com/hellokhunmor/",TWITTER:null,YOUTUBE:"https://www.youtube.com/channel/UCbdbow4UhKfa7rqIhclNPIQ/"}},FLAG_LINKS:{ID:"https://hellosehat.com/",TH:"https://hellokhunmor.com/",MY:"https://hellodoktor.com/",KH:"https://hellokrupet.com/",TW:"https://helloyishi.com.tw/",MM:"https://hellosayarwon.com/",IN:"https://helloswasthya.com/",VN:"https://hellobacsi.com/",PH:"https://hellodoctor.com.ph/"},STATIC_PAGES:{"vi-VN":{PRIVACY:"/privacy",TERM_OF_USE:"/dieu-khoan-su-dung",PRIVACY_POLICY:"/chinh-sach-quyen-rieng-tu",EDITORIAL_CORRECTIONS_POLICY:"/chinh-sach-bien-tap-chinh-sua",ADVERTISING_SPONSOR_POLICY:"/chinh-sach-quang-cao-tai-tro",POLICIES:"/chinh-sach",FAQS:"/thong-tin-quan-trong",SITEMAP:"/sitemap",ABOUT_US:"/about-us",ADVERTISEMENT:"/quang-cao-voi-chung-toi",CONTACT_US:"/lien-he",ABOUT_GO_CARE:"/about-go-care",HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/hello-bacsi/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"km-KH":{POLICIES:"/policies",TERM_OF_USE:"/ខនិងលក្ខខណ្ឌ",PRIVACY_POLICY:"/គោលការណ៍ឯកជនភាព",EDITORIAL_CORRECTIONS_POLICY:"/គោលការណ៍ខ្លឹមសារមាតិកា",ADVERTISING_SPONSOR_POLICY:"/គោលការណ៍ផ្សាយពាណិជ្ជកម",FAQS:"/faqs",SITEMAP:"/sitemap",ABOUT_US:"/about-us",ADVERTISEMENT:"/advertisement",CONTACT_US:"/contact-us",ABOUT_GO_CARE:"/about-go-care",HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"/#",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"en-PH":{POLICIES:"/policies",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-and-corrections-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-and-sponsor-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:null,CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"my-MM":{POLICIES:"/polisi-terma-syarat",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/pengiklanan",CONTACT_US:"/hubungi-kami",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:" https://hellohealthgroup.com/hello-doktor/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"zh-TW":{POLICIES:"/policies",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-and-corrections-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-and-sponsor-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/advertising",CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,FACILITY:"/facility",HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"id-ID":{POLICIES_EN:"/policies",TERM_OF_USE:"/kebijakan-pengguna",PRIVACY_POLICY:"/kebijakan-privasi",EDITORIAL_CORRECTIONS_POLICY:"/kebijakan-editorial",ADVERTISING_SPONSOR_POLICY:"/kebijakan-iklan",POLICIES:"/kebijakan",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:null,CONTACT_US:"/kontak-kami",CONTACT_EN:"/contact",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/hello-sehat/",RECRUITMENT:"https://hellohealthgroup.com/careers/",EDITORIAL_POLICY:"/edit-id",EDITORIAL_POLICY_EN:"/edit-en"},"hi-IN":{POLICIES:"/policies",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-and-corrections-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-and-sponsor-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:null,CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"ms-MY":{POLICIES:"/polisi-terma-syarat",TERM_OF_USE:"/terma-dan-syarat",PRIVACY_POLICY:"/polisi-privasi",EDITORIAL_CORRECTIONS_POLICY:"/polisi-editorial",ADVERTISING_SPONSOR_POLICY:"/polisi-pengiklanan",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/pengiklanan",CONTACT_US:"/hubungi-kami",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:" https://hellohealthgroup.com/hello-doktor/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"th-TH":{POLICIES_EN:"/policies",TERM_OF_USE:"/เงื่อนใขการใช้งาน",PRIVACY_POLICY:"/นโยบายความเป็นส่วนตัว",EDITORIAL_CORRECTIONS_POLICY:"/นโยบายบรรณธิการ",ADVERTISING_SPONSOR_POLICY:"/นโยบายการโฆษณาและผู้สนับสนุน",POLICIES:"/นโยบาย",FAQS:"/คำถามที่พบบ่อย",SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/ลงโฆษณากับเรา",CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"}},FAVICONS:{"vi-VN":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"km-KH":[{type:"link",rel:"icon",href:"/by-locales/km-KH/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/km-KH/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/km-KH/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/km-KH/icon-270x270.png"}],"en-PH":[{type:"link",rel:"icon",href:"/by-locales/en-PH/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/en-PH/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon",href:"/by-locales/en-PH/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/en-PH/icon-270x270.png"}],"id-ID":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"ms-MY":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"th-TH":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"my-MM":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"zh-TW":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"hi-IN":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}]},LOCALE_COUNTRY:{"vi-VN":{id:1,name:"Vietnam"},"id-ID":{id:2,name:"Indonesia"},"ms-MY":{id:3,name:"Malaysia"},"km-KH":{id:4,name:"Cambodia"},"en-PH":{id:5,name:"Philippines"},"th-TH":{id:6,name:"Thai Lan"},"my-MM":{id:7,name:"Myanmar"},"zh-TW":{id:8,name:"Taiwan"},"hi-IN":{id:9,name:"India"}},MAX_ALLOWED_IMG_SIZE:20971520,COUNTRY_CODE_BY_LOCALE:{"vi-VN":"vn","id-ID":"id","ms-MY":"my","km-KH":"kh","en-PH":"ph","th-TH":"th","my-MM":"mm","zh-TW":"tw","hi-IN":"in"},COUNTRY_CURRENCY_SYMBOL:{"vi-VN":"₫","id-ID":"Rp","ms-MY":"RM","km-KH":"៛","en-PH":"₱","th-TH":"฿","my-MM":"K","zh-TW":"$","hi-IN":"₹"},CURRENCY_PREFIX:{IDR:"Dimulai dari"},LOCALISED_SLUGS:{"en-PH":{PRODUCT:"product",CATEGORY:"category",BRAND:"brand",SEARCH:"search",PROFILE:"profile",PROFILE_MANAGE_ORDERS:"profile/manage-orders",PROFILE_MANAGE_ADDRESS:"profile/deliver-address",PROFILE_VOUCHER:"profile/voucher",PROFILE_MEMBER_CARD:"profile/member-card",CART:"cart",CART_CHECKOUT:"cart/checkout",ORDER_CONFIRMATION:"order-confirmation",PROMOTION:"promotion"},"vi-VN":{PRODUCT:"san-pham",CATEGORY:"danh-muc",BRAND:"thuong-hieu",SEARCH:"tim-kiem",PROFILE:"ho-so",PROFILE_MANAGE_ORDERS:"ho-so/quan-li-don-hang",PROFILE_MANAGE_ADDRESS:"ho-so/dia-chi-giao-hang",PROFILE_VOUCHER:"ho-so/khuyen-mai",PROFILE_MEMBER_CARD:"ho-so/the-thanh-vien",CART:"gio-hang",CART_CHECKOUT:"gio-hang/thanh-toan",ORDER_CONFIRMATION:"kiem-tra-don-hang",PROMOTION:"khuyen-mai"}},HEADER_LOGO_ALIGNMENT:"188px",globalFontFamily:"Inter",ENABLE_COMMUNITY_LOCALES:["vi-VN","id-ID","ms-MY","en-PH","th-TH"],ENABLE_CARE_LOCALES:["vi-VN","id-ID","en-PH"],ENABLE_HEALTH_PARENTING_LOCALES:["vi-VN","en-PH","id-ID","ms-MY","km-KH","th-TH","my-MM","zh-TW"],SEO_SCHEMA:T});function O(e){return null!=e}var A={formatAutoCompleteAddress:function(e){return e&&e.place_id?{placeId:e.place_id,description:e.description||""}:null},formatPrice:function(e,o){var t="string"==typeof e?parseInt(e):e;return new Intl.NumberFormat(o||"vi-VN").format(t)},formatHotSearchKeyword:function(e){return{text:(null==e?void 0:e.name)||""}},formatHelpfulUrl:function(e){return{name:(null==e?void 0:e.name)||"",featuredImage:(null==e?void 0:e.featured_image)||"",url:(null==e?void 0:e.url)||""}},formatCategory:function(e,t,i){var l,n,a,r=i?i+"/"+e.slug:e.slug,s=(null===(n=null===(l=null==e?void 0:e.children)||void 0===l?void 0:l.map)||void 0===n?void 0:n.call(l,(function(o){return A.formatCategory(o,e.id,r)})))||[];return{id:null==e?void 0:e.id,name:(null==e?void 0:e.name)||"",logo:(null==e?void 0:e.logo)||"",slug:(null==e?void 0:e.slug)||"",fullSlug:r||"",children:s,backgroundColor:e.color||o.theme.colors.teal50,parentId:t||0,products:(null===(a=e.products)||void 0===a?void 0:a.map(A.formatProduct))||[]}},formatFooterInfo:function(e){var o,t,i,l,n,a,r,s,u,c,d,m,p,_,h,E,v,I,T,g=(null===(i=null===(t=null===(o=null==e?void 0:e.branch)||void 0===o?void 0:o.branch)||void 0===t?void 0:t.map)||void 0===i?void 0:i.call(t,(function(e){return{flag:e.flag||"",name:e.name||"",url:e.url||""}})))||[],O=(null===(a=null===(n=null===(l=null==e?void 0:e.general)||void 0===l?void 0:l.verified)||void 0===n?void 0:n.map)||void 0===a?void 0:a.call(n,(function(e){return{image:e.image||"",url:e.url||""}})))||[],A=(null===(s=null===(r=null==e?void 0:e.menu)||void 0===r?void 0:r.map)||void 0===s?void 0:s.call(r,(function(e){var o,t;return{menu_title:e.menu_title,items:null===(t=null===(o=e.items)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,(function(e){return{title:e.title,url:e.url}}))}})))||[],f=(null===(d=null===(c=null===(u=null==e?void 0:e.social)||void 0===u?void 0:u.socials)||void 0===c?void 0:c.map)||void 0===d?void 0:d.call(c,(function(e){return{icon:e.icon||"",name:e.name||"",url:e.url||""}})))||[];return{branch:{title:(null===(m=null==e?void 0:e.branch)||void 0===m?void 0:m.title)||"",branch:g},general:{logo:null!==(_=null===(p=null==e?void 0:e.general)||void 0===p?void 0:p.logo)&&void 0!==_?_:"",content:null!==(E=null===(h=null==e?void 0:e.general)||void 0===h?void 0:h.content)&&void 0!==E?E:"",copyright:null!==(I=null===(v=null==e?void 0:e.general)||void 0===v?void 0:v.copyright)&&void 0!==I?I:"",verified:O},menu:A,social:{title:(null===(T=null==e?void 0:e.social)||void 0===T?void 0:T.title)||"",socials:f}}},formatNavigation:function(e){var o,t,i,l,n,a;return{hotSearchKeywords:(null===(t=null===(o=null==e?void 0:e.hot_search_keywords)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatHotSearchKeyword))||[],helpfulUrls:(null===(l=null===(i=null==e?void 0:e.helpful_urls)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,A.formatHelpfulUrl))||[],categories:(null===(a=null===(n=null==e?void 0:e.categories)||void 0===n?void 0:n.map)||void 0===a?void 0:a.call(n,(function(e){return A.formatCategory(e)})))||[],footer:A.formatFooterInfo(null==e?void 0:e.footer),storeId:(null==e?void 0:e.store_id)||0,customerId:(null==e?void 0:e.customer_id)||0,cartItemsQty:"number"==typeof(null==e?void 0:e.cart_items_qty)?e.cart_items_qty:null}},formatPriceInfo:function(e){return e?{final:e.final||0,regular:e.regular||0,discountPercent:e.discount_percent||0}:null},formatProduct:function(e){var o,t,i,l;if(!e)return null;var n={final:0,regular:0,discountPercent:0};return{id:e.id||0,price:e.price&&A.formatPriceInfo(e.price)||n,thumbnail:e.thumbnail||"",name:e.name||"",averageRating:Number((e.average_rating||0).toFixed(2)),reviewsCount:e.reviews_count||0,tag:e.tag||null,sku:e.sku||"",slug:e.slug||"",images:e.images||[],tags:e.tags||[],unit:e.unit||"",brand:e.brand?{name:e.brand.name||"",image:e.brand.image||"",slug:e.brand.slug||"",productsCount:e.brand.products_count||0}:null,description:e.description||"",productPromotions:(null===(t=null===(o=e.product_promotions)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatProductPromotion).filter(O))||[],categories:(null===(l=null===(i=e.categories)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,(function(e){return A.formatCategory(e)})).filter(O))||[],isInStock:(null==e?void 0:e.is_in_stock)||!1}},formatBanner:function(e){return e?{name:e.name||"",url:e.url||"",featuredImage:e.featured_image||"",alt:e.image_alt}:null},formatBlogPost:function(e){var o,t;return e?{title:e.title||"",image:e.image||"",link:e.link||"",postData:e.post_data?{reviewed:e.post_data.reviewed?{author:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.author||void 0),editor:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.editor||void 0),expert:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.expert||void 0),factCheck:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.fact_check||void 0),isAuthor:Boolean(e.post_data.reviewed.is_author)}:null,categories:e.post_data.categories?null===(t=(o=e.post_data.categories).map)||void 0===t?void 0:t.call(o,(function(e){return{termId:e.term_id||0,name:e.name||"",permalink:e.permalink||"",textColor:e.text_color||""}})):[],postDate:e.post_data.post_date||"",postModified:e.post_data.post_modified||"",modifiedTime:e.post_data.modified_time||""}:null}:null},formatBlogPostDataReviewedUser:function(e){return e?{id:e.ID||0,userId:e.user_id||0,formerRole:e.former_role||"",role:e.role||"",slug:e.slug||"",displayName:e.display_name||"",description:e.description||"",profileUrl:e.profile_url||"",avatar:e.avatar||"",avatarThumbnail:e.avatar_thumbnail||"",turnOffProfile:Boolean(e.turn_off_profile)}:null},formatBrand:function(e){var o,t,i,l;return e?{id:e.id||0,image:e.image||"",position:e.position||"",isPopular:e.is_popular||!1,summary:e.summary||"",name:e.name||"",slug:e.slug||"",description:e.description||null,banners:(null===(t=null===(o=e.banners)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatBanner).filter(O))||[],bestsellerProducts:(null===(l=null===(i=e.bestseller_products)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,A.formatProduct).filter(O))||[]}:null},formatHomePage:function(e){var o,t,i,l,n,a,r,s,u,c,d,m,p,_,h,E,v,I,T,g;return e?{brands:e.brands?null===(t=(o=e.brands).map)||void 0===t?void 0:t.call(o,A.formatBrand).filter(O):[],hotDeals:e.hot_deals?null===(l=(i=e.hot_deals).map)||void 0===l?void 0:l.call(i,A.formatProduct).filter(O):[],newProducts:e.new_products?null===(a=(n=e.new_products).map)||void 0===a?void 0:a.call(n,A.formatProduct).filter(O):[],slideBanners:e.slide_banners?null===(s=(r=e.slide_banners).map)||void 0===s?void 0:s.call(r,A.formatBanner).filter(O):[],subBanners:e.sub_banners?null===(c=(u=e.sub_banners).map)||void 0===c?void 0:c.call(u,A.formatBanner).filter(O):[],footerBanners:e.footer_banners?null===(m=(d=e.footer_banners).map)||void 0===m?void 0:m.call(d,A.formatBanner).filter(O):[],blogPosts:e.blog_posts?null===(_=(p=e.blog_posts).map)||void 0===_?void 0:_.call(p,A.formatBlogPost).filter(O):[],popularCategories:e.popular_categories?null===(E=(h=e.popular_categories).map)||void 0===E?void 0:E.call(h,(function(e){return A.formatCategory(e)})).filter(O):[],suggestProducts:e.suggest_products?null===(I=(v=e.suggest_products).map)||void 0===I?void 0:I.call(v,(function(e){return A.formatCategory(e)})).filter(O):[],promotions:e.promotions?null===(g=(T=e.promotions).map)||void 0===g?void 0:g.call(T,(function(e){return A.formatPromotion(e)})).filter(O):[]}:null},formatCategoryPage:function(e){var o,t,i,l;return e?{id:e.id||0,name:e.name||"",slug:e.slug||"",description:e.description||null,banners:(null===(t=null===(o=e.banners)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatBanner).filter(O))||[],bestsellerProducts:(null===(l=null===(i=e.bestseller_products)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,A.formatProduct).filter(O))||[]}:null},formatBrandPage:function(e){return e?A.formatBrand(e):null},formatPagination:function(e){return e?{current:e.current||0,first:e.first||0,itemsPerPage:e.items_per_page||0,last:e.last||0,next:e.next||0,prev:e.prev||0,totalItems:e.total_items||0}:null},formatProductDetailPage:function(o){var t,i,l,n,a,r,s,u;return o?e.__assign(e.__assign({},A.formatProduct(o)),{relatedProducts:(null===(i=null===(t=o.related_products)||void 0===t?void 0:t.map)||void 0===i?void 0:i.call(t,A.formatProduct).filter(O))||[],bestsellerProducts:(null===(n=null===(l=o.bestseller_products)||void 0===l?void 0:l.map)||void 0===n?void 0:n.call(l,A.formatProduct).filter(O))||[],viewedProducts:(null===(r=null===(a=o.viewed_products)||void 0===a?void 0:a.map)||void 0===r?void 0:r.call(a,A.formatProduct).filter(O))||[],promotions:(null===(u=null===(s=o.promotions)||void 0===s?void 0:s.map)||void 0===u?void 0:u.call(s,A.formatPromotion).filter(O))||[]}):null},formatProductReview:function(e){var o,t;return e?{reviewId:e.review_id||"",createdAt:e.created_at||"",title:e.title||"",detail:e.detail||"",nickname:e.nick_name||"",avatar:e.avatar||"",ratingVotes:(null===(t=null===(o=e.rating_votes)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,(function(e){return{ratingCode:e.rating_code||"",value:Number(e.value)||0,percent:Number(e.percent)||0}})))||[],images:e.images||[]}:null},formatProductPromotion:function(e){return e?{id:e.id||0,name:e.name||"",thumbnail:e.thumbnail||"",expirationDate:e.expiration_date||""}:null},formatPromotion:function(e){return e?{id:e.id||0,name:e.name||"",slug:e.slug||"",thumbnail:e.thumbnail||"",expiredDate:e.expired_date||"",banners:e.banners||[],points:0,description:e.description||"",metaTitle:e.meta_title||"",metaKeywords:e.meta_keywords||"",metaDescription:e.meta_description||""}:null},formatCustomAttributes:function(e,o){var t;return(null==e?void 0:e.length)&&(null===(t=null==e?void 0:e.find((function(e){return e.attribute_code===o})))||void 0===t?void 0:t.value)||""},formatAddress:function(e){var o,t,i,l;return e?{id:e.id||0,fullName:e.firstname||"",telephone:e.telephone||"",province:{value:null===(o=e.region)||void 0===o?void 0:o.region_id,label:null===(t=e.region)||void 0===t?void 0:t.region}||null,district:{value:A.formatCustomAttributes(e.custom_attributes,"district_id"),label:A.formatCustomAttributes(e.custom_attributes,"district")},commune:{value:A.formatCustomAttributes(e.custom_attributes,"ward_id"),label:A.formatCustomAttributes(e.custom_attributes,"ward")},street:(null===(i=null==e?void 0:e.street)||void 0===i?void 0:i.length)?null==e?void 0:e.street[0]:"",isDefault:e.default_billing&&e.default_shipping||!1,fullAddress:(null===(l=null==e?void 0:e.extension_attributes)||void 0===l?void 0:l.full_address)||""}:null},formatProvince:function(e){return(null==e?void 0:e.available_regions)?e.available_regions.map((function(e){return{value:e.id||"",label:e.name||""}})):[]},formatDistrict:function(e){return(null==e?void 0:e.districts)?e.districts.map((function(e){return{value:e.id||"",label:e.name||""}})):[]},formatCommune:function(e){return(null==e?void 0:e.communes)?e.communes.map((function(e){return{value:e.id||"",label:e.name||""}})):[]},formatOrder:function(e){var o,t;return e?{orderNumber:(null==e?void 0:e.order_number)||"",shippingData:(null==e?void 0:e.shipping_data)?{shippingMethod:e.shipping_data.shipping_method||"",shippingDescription:e.shipping_data.shipping_description||"",shippingAddress:e.shipping_data.shipping_address?{fullName:e.shipping_data.shipping_address.firstname||"",fullAddress:e.shipping_data.shipping_address.full_address||"",telephone:e.shipping_data.shipping_address.telephone||""}:null,storeAddress:null}:null,orderedDate:(null==e?void 0:e.ordered_date)||"",status:(null==e?void 0:e.status)||null,totals:(null==e?void 0:e.totals)?{subtotal:e.totals.subtotal||0,shippingAmount:e.totals.shipping_amount||0,discountAmount:e.totals.discount_amount||0,grandTotal:e.totals.grand_total||0}:null,products:(null===(t=null===(o=null==e?void 0:e.products)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,(function(e){return{sku:e.sku||"",name:e.name||"",price:e.price||0,rowTotal:e.row_total||0,image:e.image||"",qty:e.qty||0}})))||[],paymentMethod:(null==e?void 0:e.payment_method)||""}:null},formatStatistic:function(e){var o,t,i,l,n;return e?{pending:Number(null===(o=null==e?void 0:e.find((function(e){return"pending"===e.status})))||void 0===o?void 0:o.amount)||0,processing:Number(null===(t=null==e?void 0:e.find((function(e){return"processing"===e.status})))||void 0===t?void 0:t.amount)||0,delivering:Number(null===(i=null==e?void 0:e.find((function(e){return"delivering"===e.status})))||void 0===i?void 0:i.amount)||0,complete:Number(null===(l=null==e?void 0:e.find((function(e){return"complete"===e.status})))||void 0===l?void 0:l.amount)||0,canceled:Number(null===(n=null==e?void 0:e.find((function(e){return"canceled"===e.status})))||void 0===n?void 0:n.amount)||0}:{}},formatCartItem:function(e){var o,t,i,l,n,a,r,s;return e?{itemId:e.item_id||0,sku:e.sku||"",qty:e.qty||0,name:e.name||"",price:e.price||0,basePrice:(null===(o=e.extension_attributes)||void 0===o?void 0:o.base_price)||0,productType:e.product_type||"",quoteId:e.quote_id||"",thumbnail:(null===(t=e.extension_attributes)||void 0===t?void 0:t.thumbnail)||"",rowTotal:(null===(i=e.extension_attributes)||void 0===i?void 0:i.row_total)||0,promotions:(null===(a=null===(n=null===(l=e.extension_attributes)||void 0===l?void 0:l.promotions)||void 0===n?void 0:n.map)||void 0===a?void 0:a.call(n,A.formatProductPromotion))||[],isInStock:(null===(r=e.extension_attributes)||void 0===r?void 0:r.is_in_stock)||!1,urlProduct:(null===(s=e.extension_attributes)||void 0===s?void 0:s.url_key)||""}:null},formatCartAddress:function(e){var o;return e?{customerAddressId:(null==e?void 0:e.customer_address_id)||0,id:e.id||0,region:e.region||"",regionId:e.region_id||0,regionCode:e.region_code||"",countryId:e.country_id||"",street:e.street||[],postcode:e.postcode||"",city:e.city||"",firstname:e.firstname||"",lastname:e.lastname||"",customerId:e.customer_id||0,email:e.email||"",telephone:e.telephone||"",sameAsBilling:e.same_as_billing||0,saveInAddressBook:e.save_in_address_book||0,fullAddress:(null===(o=e.extension_attributes)||void 0===o?void 0:o.full_address)||""}:null},formatEstimatedShipping:function(e){return e?{carrierCode:e.carrier_code||"",methodCode:e.method_code||"",carrierTitle:e.carrier_title||"",methodTitle:e.method_title||"",amount:e.amount||0,baseAmount:e.base_amount||0,available:e.available||!1,errorMessage:e.error_message||"",priceExclTax:e.price_excl_tax||0,priceInclTax:e.price_incl_tax||0}:null},formatCartLoggedInCustomer:function(e){var o,t,i;return e?{email:e.email||"",firstname:e.firstname||"",lastname:e.lastname||"",id:e.id||0,groupId:e.group_id||0,createdAt:e.created_at||"",updatedAt:e.updated_at||"",createdIn:e.created_in||"",storeId:e.store_id||0,websiteId:e.website_id||0,addresses:(null===(t=null===(o=e.addresses)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatCartAddress))||[],disableAutoGroupChange:e.disable_auto_group_change||0,isSubscribed:(null===(i=e.extension_attributes)||void 0===i?void 0:i.is_subscribed)||!1}:null},formatCart:function(e){var o,t,i,l,n,a,r,s,u,c,d,m,p,_;return e?{id:e.id||0,createdAt:e.created_at||"",updatedAt:e.updated_at||"",isActive:e.is_active||!1,isVirtual:e.is_virtual||!1,items:(null===(i=null===(t=null===(o=e.items)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatCartItem))||void 0===i?void 0:i.sort((function(e,o){return Number(null==o?void 0:o.isInStock)-Number(null==e?void 0:e.isInStock)})))||[],itemsCount:e.items_count||0,itemsQty:e.items_qty||0,customer:e.customer?A.formatCartLoggedInCustomer(e.customer):null,billingAddress:e.billing_address?A.formatCartAddress(e.billing_address):null,origOrderId:e.orig_order_id||0,currency:{globalCurrencyCode:(null===(l=e.currency)||void 0===l?void 0:l.global_currency_code)||"",baseCurrencyCode:(null===(n=e.currency)||void 0===n?void 0:n.base_currency_code)||"",storeCurrencyCode:(null===(a=e.currency)||void 0===a?void 0:a.store_currency_code)||"",quoteCurrencyCode:(null===(r=e.currency)||void 0===r?void 0:r.quote_currency_code)||"",storeToBaseRate:(null===(s=e.currency)||void 0===s?void 0:s.store_to_base_rate)||0,storeToQuoteRate:(null===(u=e.currency)||void 0===u?void 0:u.store_to_quote_rate)||0,baseToGlobalRate:(null===(c=e.currency)||void 0===c?void 0:c.base_to_global_rate)||0,baseToQuoteRate:(null===(d=e.currency)||void 0===d?void 0:d.base_to_quote_rate)||0},customerIsGuest:e.customer_is_guest||!1,customerNoteNotify:e.customer_note_notify||!1,customerTaxClassId:e.customer_tax_class_id||0,storeId:e.store_id||0,shippingAssignments:null===(_=null===(p=null===(m=e.extension_attributes)||void 0===m?void 0:m.shipping_assignments)||void 0===p?void 0:p.map)||void 0===_?void 0:_.call(p,(function(e){var o,t,i;return{shipping:{address:e.shipping.address?A.formatCartAddress(e.shipping.address):null,method:(null===(o=e.shipping)||void 0===o?void 0:o.method)||""},items:(null===(i=(t=e.items).map)||void 0===i?void 0:i.call(t,A.formatCartItem))||[]}}))}:null},formatCartTotal:function(e){var o,t,i;return e?{grandTotal:e.grand_total||0,baseGrandTotal:e.base_grand_total||0,subtotal:e.subtotal||0,baseSubtotal:e.base_subtotal||0,discountAmount:e.discount_amount||0,baseDiscountAmount:e.base_discount_amount||0,subtotalWithDiscount:e.subtotal_with_discount||0,baseSubtotalWithDiscount:e.base_subtotal_with_discount||0,shippingAmount:e.shipping_amount||0,baseShippingAmount:e.base_shipping_amount||0,shippingDiscountAmount:e.shipping_discount_amount||0,baseShippingDiscountAmount:e.base_shipping_discount_amount||0,taxAmount:e.tax_amount||0,baseTaxAmount:e.base_tax_amount||0,weeeTaxAppliedAmount:e.weee_tax_applied_amount||0,shippingTaxAmount:e.shipping_tax_amount||0,baseShippingTaxAmount:e.base_shipping_tax_amount||0,subtotalInclTax:e.subtotal_incl_tax||0,shippingInclTax:e.shipping_incl_tax||0,baseShippingInclTax:e.base_shipping_incl_tax||0,baseCurrencyCode:e.base_currency_code||"",quoteCurrencyCode:e.quote_currency_code||"",itemsQty:e.items_qty||0,coupon:{couponCode:e.coupon_code||"",couponDescription:(null===(o=null==e?void 0:e.extension_attributes)||void 0===o?void 0:o.coupon_description_text)||""},items:(null===(i=null===(t=e.items)||void 0===t?void 0:t.map)||void 0===i?void 0:i.call(t,(function(e){return{itemId:e.item_id||0,price:e.price||0,basePrice:e.base_price||0,qty:e.qty||0,rowTotal:e.row_total||0,baseRowTotal:e.base_row_total||0,rowTotalWithDiscount:e.row_total_with_discount||0,taxAmount:e.tax_amount||0,baseTaxAmount:e.base_tax_amount||0,taxPercent:e.tax_percent||0,discountAmount:e.discount_amount||0,baseDiscountAmount:e.base_discount_amount||0,discountPercent:e.discount_percent||0,priceInclTax:e.price_incl_tax||0,basePriceInclTax:e.base_price_incl_tax||0,rowTotalInclTax:e.row_total_incl_tax||0,baseRowTotalInclTax:e.base_row_total_incl_tax||0,options:e.options||"",weeeTaxAppliedAmount:e.weee_tax_applied_amount||0,weeeTaxApplied:e.weee_tax_applied||0,name:e.name||""}})))||[],totalSegments:e.total_segments||[]}:null},formatPaymentMethod:function(e){return e?null==e?void 0:e.map((function(e){return{code:(null==e?void 0:e.payment_code)||"",title:(null==e?void 0:e.payment_title)||"",thumbnail:(null==e?void 0:e.payment_thumbnail)||""}})):null},formatPaymentInformation:function(e){var o;return e?{paymentMethods:A.formatPaymentMethod(null===(o=null==e?void 0:e.extension_attributes)||void 0===o?void 0:o.payment_detail_info)||[],totals:A.formatCartTotal(e.totals)}:null},formatOrderConfirmation:function(e){return e?{isSuccess:e.is_success||!1,orderInfo:A.formatOrder(e.order_info)}:null},formatCoupons:function(e){var o;return(null===(o=null==e?void 0:e.items)||void 0===o?void 0:o.length)?e.items.map((function(e){return{code:(null==e?void 0:e.code)||"",name:(null==e?void 0:e.name)||"",thumbnail:(null==e?void 0:e.thumbnail)||"",description:(null==e?void 0:e.expired_date)||""}})):null},formatShippings:function(e){return e?e.map((function(e){var o;return{carrierCode:e.carrier_code||"",methodCode:e.method_code||"",title:e.carrier_title||"",description:e.method_title||"",price:(null==e?void 0:e.base_amount)||0,thumbnail:(null===(o=null==e?void 0:e.extension_attributes)||void 0===o?void 0:o.thumbnail)||""}})):[]}},f=Object.freeze({__proto__:null,dataFormatter:A});exports.EcomTypes=i.types,exports.EcomApiTypes=n,exports.EcomConstants=g,exports.EcomDataFormatter=f,exports.EcomDataTypes=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tslib.es6-c51cbe7c.js"),o=require("./theme-513105f9.js");require("./index-698cf326.js");var t=require("./isProduction-763c43ef.js"),i=require("./types-adf338b1.js");require("./Locale-858ea147.js");var l,n=Object.freeze({__proto__:null}),a=Object.freeze({__proto__:null}),r="development"===process.env.NEXT_PUBLIC_DEPLOY_ENV,s="undefined"==typeof window,u=process.env.NEXT_PUBLIC_DEPLOY_LOCALE?process.env.NEXT_PUBLIC_DEPLOY_LOCALE:"vi-VN",c=process.env.NEXT_PUBLIC_GOOGLE_MAP_KEY||"",d=process.env.NEXT_PUBLIC_ADMIN_GOOGLE_LOCATION_KEY,m=process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID||"289442006438-cihobuq1h3r4426pur7u0e43fqdnep59.apps.googleusercontent.com",p={"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"},_=r?"http://localhost:3001":t.isProduction?"https://".concat(p[u]):"https://discover.".concat(p[u]),h=t.isProduction?"https://wp.".concat(p[u],"/"):"https://staging.".concat(p[u],"/"),E=process.env.NEXT_PUBLIC_TOGETHER_API_URL&&""!==process.env.NEXT_PUBLIC_TOGETHER_API_URL?process.env.NEXT_PUBLIC_TOGETHER_API_URL:"https://together.".concat(p[u],"/"),v="".concat(_,"/community"),I=process.env.NEXT_PUBLIC_SSO_URL||"http://staging-id.hellobacsi.com/";!function(e){e[e.FEMALE=0]="FEMALE",e[e.MALE=1]="MALE",e[e.ANY=2]="ANY"}(l||(l={}));var T={"vi-VN":{HOME:function(){return JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/#website","@type":"WebSite",description:"Hello Bacsi - Health Information",inLanguage:"vi-VN",name:"Hello Bacsi",potentialAction:[{"@type":"SearchAction","query-input":"required name=search_term_string",target:"https://hellobacsi.com/shop/tim-kiem/?keyword={search_term_string}"}],url:"https://hellobacsi.com/shop/"}]})},CATEGORY:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),void 0===t&&(t=[]),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/#breadcrumb","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/","@type":"WebPage",name:"Hello Bacsi",url:"https://hellobacsi.com/shop/"}},{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/danh-muc","@type":"WebPage",name:"Hello Bacsi - Danh Muc",url:"https://hellobacsi.com/shop/danh-muc"}}]},{"@type":"ItemList",url:e,numberOfItems:o,itemListElement:t}]})},BRAND:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),void 0===t&&(t=[]),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/#breadcrumb","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/","@type":"WebPage",name:"Hello Bacsi",url:"https://hellobacsi.com/shop/"}},{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/thuong-hieu","@type":"WebPage",name:"Hello Bacsi - Thuong Hieu",url:"https://hellobacsi.com/shop/thuong-hieu"}}]},{"@type":"ItemList",url:e,numberOfItems:o,itemListElement:t}]})},BRAND_DETAIL:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/thuong-hieu/#brand","@type":"BrandDetail",itemListElement:[{"@type":"Item",item:{"@id":"https://hellobacsi.com/shop".concat(e),"@type":"WebPage",name:"Hello Bacsi - Thuong Hieu",url:"https://hellobacsi.com/shop".concat(e)}}]},{"@type":"BrandDetail",url:"https://hellobacsi.com/shop".concat(e),numberOfItems:o,itemListElement:null!=t?t:{}}]})},PRODUCT_DETAIL:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/san-pham/#product","@type":"ProductDetail",itemListElement:[{"@type":"Item",item:{"@id":"https://hellobacsi.com/shop/san-pham/".concat(e),"@type":"WebPage",name:"Hello Bacsi - Thuong Hieu",url:"https://hellobacsi.com/shop/san-pham/".concat(e)}}]},{"@type":"BrandDetail",url:e,numberOfItems:o,itemListElement:null!=t?t:{}}]})}}},g=Object.freeze({__proto__:null,isDevelopment:r,IS_SSR:s,locale:u,BEARER_TOKEN_COOKIE:"hhg_user_token",BEARER_ADMIN_TOKEN_COOKIE:"hhg_admin_token",GUEST_CART_ID_COOKIE:"hhg_guest_cart_id",GOOGLE_MAP_KEY:c,GOOGLE_ADMIN_LOCATION_KEY:d,GOOGLE_CLIENT_ID:m,GOOGLE_CALENDAR_API_KEY:"",basePath:"shop",SSO_USER_BASE_PATH:"user",CARE_BASE_PATH:"care",COMMUNITY_BASE_PATH:"community",HEALTH_TOOLs_BASE_PATH:"health-tools",NOTIFICATION_TIME_OUT:3e3,DOMAIN_LOCALES:p,DISCOVER_URL_FE:_,DISCOVER_URL_BE:h,TOGETHER_URL_BE:E,TOGETHER_URL_FE:v,SSO_URL:I,DISCOVERY_FOOTER_URL:"#",HEALTH_CARE_FOOTER_URL:"#",HEALTH_TOOLS_FOOTER_URL:"#",HEALTH_TOGETHER_FOOTER_URL:"#",POLICIES_FOOTER_URL:"#",FAQ_FOOTER_URL:"#",SITEMAP_FOOTER_URL:"#",ABOUT_US_FOOTER_URL:"#",EXECUTIVE_BIOS_FOOTER_URL:"#",ADVERTISING_FOOTER_URL:"#",CONTACT_US_FOOTER_URL:"#",ABOUT_GO_CARE_FOOTER_URL:"#",get Gender(){return l},EMAIL_REGEX:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,COUNTRY_SITENAME:{ID:"Hello Sehat",TH:"Hello Khunmor",MY:"Hello Doktor",KH:"Hello Krupet",TW:"Hello Yishi",MM:"Hello Sayarwon",IN:"Hello Swasthya",VN:"Hello Bacsi",PH:"Hello Doctor"},LOCALE_SPECS:{"vi-VN":{LOGO_TYPE:"hellobacsi",SITE_NAME:"HelloBacsi",SITE_NAME_FORMATTED:"Hello Bacsi",HOMEPAGE_IMAGE:"https://hellobacsi.com/images/country-thumbnails/VN.png",SITE_ID:"1",INSIDER_TAG:"//hellobacsivn.api.useinsider.com/ins.js?id=10003798",TOOLTIP_IMAGE:"/images/tooltips-vn.png"},"en-PH":{LOGO_TYPE:"hellodoctor",SITE_NAME:"HelloDoctor",HOMEPAGE_IMAGE:"https://hellodoctor.com.ph/images/country-thumbnails/PH.png",SITE_NAME_FORMATTED:"Hello Doctor",SITE_ID:"9",CATEGORIES_TYPE:"short",INSIDER_TAG:"//hellodoctorph.api.useinsider.com/ins.js?id=10004527",TOOLTIP_IMAGE:"/images/tooltips-ph.png"},"th-TH":{LOGO_TYPE:"hellokhunmor",SITE_NAME:"HelloKhunmor",HOMEPAGE_IMAGE:"https://hellokhunmor.com/images/country-thumbnails/TH.png",SITE_NAME_FORMATTED:"Hello Khunmor",SITE_ID:"3",CATEGORIES_TYPE:"long",INSIDER_TAG:"//hellokhunmor.api.useinsider.com/ins.js?id=10004524",TOOLTIP_IMAGE:"/images/tooltips-th.png"},"km-KH":{LOGO_TYPE:"hellokrupet",SITE_NAME:"HelloKrupet",HOMEPAGE_IMAGE:"https://hellokrupet.com/images/country-thumbnails/KH.JPG",SITE_NAME_FORMATTED:"Hello Krupet",SITE_ID:"4",CATEGORIES_TYPE:"long",INSIDER_TAG:"//hellokrupet.api.useinsider.com/ins.js?id=10004523",TOOLTIP_IMAGE:"/images/tooltips-kh.png"},"my-MM":{LOGO_TYPE:"hellosayarwon",SITE_NAME:"HelloSayarwon",HOMEPAGE_IMAGE:"https://hellosayarwon.com/images/country-thumbnails/PH.png",SITE_NAME_FORMATTED:"Hello Sayarwon",SITE_ID:"7",INSIDER_TAG:"//hellosayarwon.api.useinsider.com/ins.js?id=10004522"},"zh-TW":{LOGO_TYPE:"helloyishi",SITE_NAME:"HelloYishi",HOMEPAGE_IMAGE:"https://helloyishi.com.tw/images/country-thumbnails/TW.png",SITE_NAME_FORMATTED:"Hello Yishi",SITE_ID:"6",INSIDER_TAG:"//helloyishi.api.useinsider.com/ins.js?id=10004526",TOOLTIP_IMAGE:"/images/tooltips-tw.png"},"id-ID":{LOGO_TYPE:"hellosehat",SITE_NAME:"HelloSehat",HOMEPAGE_IMAGE:"https://hellosehat.com/images/country-thumbnails/ID.png",SITE_NAME_FORMATTED:"Hello Sehat",SITE_ID:"2",INSIDER_TAG:"//hellosehat.api.useinsider.com/ins.js?id=10003799",TOOLTIP_IMAGE:"/images/tooltips-id.png"},"hi-IN":{LOGO_TYPE:"helloswasthya",SITE_NAME:"HelloSwasthya",HOMEPAGE_IMAGE:"https://helloswasthya.com/images/country-thumbnails/IN.png",SITE_NAME_FORMATTED:"हैलो स्वास्थ्य",SITE_ID:"8",CATEGORIES_TYPE:"long",INSIDER_TAG:"//helloswasthya.api.useinsider.com/ins.js?id=10004498",TOOLTIP_IMAGE:"/images/tooltips-in.png"},"ms-MY":{LOGO_TYPE:"hellodoktor",SITE_NAME:"HelloDoktor",HOMEPAGE_IMAGE:"https://hellodoktor.com/images/country-thumbnails/MY.png",SITE_NAME_FORMATTED:"Hello Doktor",SITE_ID:"5",INSIDER_TAG:"//hellodoktor.api.useinsider.com/ins.js?id=10004525",TOOLTIP_IMAGE:"/images/tooltips-my.png"}},SOCIAL_MEDIA:{"vi-VN":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellobacsi/",INSTAGRAM:"https://www.instagram.com/hellobacsi/",TWITTER:null,YOUTUBE:"https://www.youtube.com/channel/UCYHzHDXngnB7jkmcQgXwE0w"},"en-PH":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/HelloDoctorPH/",INSTAGRAM:"https://www.instagram.com/hellodoctor_ph/",TWITTER:null},"km-KH":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellokrupet/",INSTAGRAM:"https://www.instagram.com/hellokrupetofficial/",TWITTER:null,YOUTUBE:"https://www.youtube.com/channel/UCVK4p9YPIMkmoerk3X-y-TQ"},"ms-MY":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/HelloDoktorMY/",INSTAGRAM:"https://www.instagram.com/_hellodoktor_/",TWITTER:null},"id-ID":{LINKEDIN:"https://www.linkedin.com/company/hello-sehat/",FACEBOOK:"https://www.facebook.com/hellosehat",INSTAGRAM:"https://www.instagram.com/hellosehat/",TWITTER:"https://twitter.com/HelloSehat"},"my-MM":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellosayarwon/",INSTAGRAM:"https://www.facebook.com/hellosayarwon/",TWITTER:null},"zh-TW":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/helloyishi/",INSTAGRAM:"https://www.instagram.com/helloyishi/",TWITTER:null},"hi-IN":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/HelloSwasthya/",INSTAGRAM:"https://www.instagram.com/hello_swasthya/",TWITTER:null},"th-TH":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellokhunmor/",INSTAGRAM:"https://www.instagram.com/hellokhunmor/",TWITTER:null,YOUTUBE:"https://www.youtube.com/channel/UCbdbow4UhKfa7rqIhclNPIQ/"}},FLAG_LINKS:{ID:"https://hellosehat.com/",TH:"https://hellokhunmor.com/",MY:"https://hellodoktor.com/",KH:"https://hellokrupet.com/",TW:"https://helloyishi.com.tw/",MM:"https://hellosayarwon.com/",IN:"https://helloswasthya.com/",VN:"https://hellobacsi.com/",PH:"https://hellodoctor.com.ph/"},STATIC_PAGES:{"vi-VN":{PRIVACY:"/privacy",TERM_OF_USE:"/dieu-khoan-su-dung",PRIVACY_POLICY:"/chinh-sach-quyen-rieng-tu",EDITORIAL_CORRECTIONS_POLICY:"/chinh-sach-bien-tap-chinh-sua",ADVERTISING_SPONSOR_POLICY:"/chinh-sach-quang-cao-tai-tro",POLICIES:"/chinh-sach",FAQS:"/thong-tin-quan-trong",SITEMAP:"/sitemap",ABOUT_US:"/about-us",ADVERTISEMENT:"/quang-cao-voi-chung-toi",CONTACT_US:"/lien-he",ABOUT_GO_CARE:"/about-go-care",HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/hello-bacsi/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"km-KH":{POLICIES:"/policies",TERM_OF_USE:"/ខនិងលក្ខខណ្ឌ",PRIVACY_POLICY:"/គោលការណ៍ឯកជនភាព",EDITORIAL_CORRECTIONS_POLICY:"/គោលការណ៍ខ្លឹមសារមាតិកា",ADVERTISING_SPONSOR_POLICY:"/គោលការណ៍ផ្សាយពាណិជ្ជកម",FAQS:"/faqs",SITEMAP:"/sitemap",ABOUT_US:"/about-us",ADVERTISEMENT:"/advertisement",CONTACT_US:"/contact-us",ABOUT_GO_CARE:"/about-go-care",HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"/#",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"en-PH":{POLICIES:"/policies",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-and-corrections-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-and-sponsor-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:null,CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"my-MM":{POLICIES:"/polisi-terma-syarat",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/pengiklanan",CONTACT_US:"/hubungi-kami",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:" https://hellohealthgroup.com/hello-doktor/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"zh-TW":{POLICIES:"/policies",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-and-corrections-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-and-sponsor-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/advertising",CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,FACILITY:"/facility",HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"id-ID":{POLICIES_EN:"/policies",TERM_OF_USE:"/kebijakan-pengguna",PRIVACY_POLICY:"/kebijakan-privasi",EDITORIAL_CORRECTIONS_POLICY:"/kebijakan-editorial",ADVERTISING_SPONSOR_POLICY:"/kebijakan-iklan",POLICIES:"/kebijakan",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:null,CONTACT_US:"/kontak-kami",CONTACT_EN:"/contact",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/hello-sehat/",RECRUITMENT:"https://hellohealthgroup.com/careers/",EDITORIAL_POLICY:"/edit-id",EDITORIAL_POLICY_EN:"/edit-en"},"hi-IN":{POLICIES:"/policies",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-and-corrections-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-and-sponsor-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:null,CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"ms-MY":{POLICIES:"/polisi-terma-syarat",TERM_OF_USE:"/terma-dan-syarat",PRIVACY_POLICY:"/polisi-privasi",EDITORIAL_CORRECTIONS_POLICY:"/polisi-editorial",ADVERTISING_SPONSOR_POLICY:"/polisi-pengiklanan",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/pengiklanan",CONTACT_US:"/hubungi-kami",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:" https://hellohealthgroup.com/hello-doktor/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"th-TH":{POLICIES_EN:"/policies",TERM_OF_USE:"/เงื่อนใขการใช้งาน",PRIVACY_POLICY:"/นโยบายความเป็นส่วนตัว",EDITORIAL_CORRECTIONS_POLICY:"/นโยบายบรรณธิการ",ADVERTISING_SPONSOR_POLICY:"/นโยบายการโฆษณาและผู้สนับสนุน",POLICIES:"/นโยบาย",FAQS:"/คำถามที่พบบ่อย",SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/ลงโฆษณากับเรา",CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"}},FAVICONS:{"vi-VN":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"km-KH":[{type:"link",rel:"icon",href:"/by-locales/km-KH/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/km-KH/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/km-KH/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/km-KH/icon-270x270.png"}],"en-PH":[{type:"link",rel:"icon",href:"/by-locales/en-PH/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/en-PH/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon",href:"/by-locales/en-PH/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/en-PH/icon-270x270.png"}],"id-ID":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"ms-MY":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"th-TH":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"my-MM":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"zh-TW":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"hi-IN":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}]},LOCALE_COUNTRY:{"vi-VN":{id:1,name:"Vietnam"},"id-ID":{id:2,name:"Indonesia"},"ms-MY":{id:3,name:"Malaysia"},"km-KH":{id:4,name:"Cambodia"},"en-PH":{id:5,name:"Philippines"},"th-TH":{id:6,name:"Thai Lan"},"my-MM":{id:7,name:"Myanmar"},"zh-TW":{id:8,name:"Taiwan"},"hi-IN":{id:9,name:"India"}},MAX_ALLOWED_IMG_SIZE:20971520,COUNTRY_CODE_BY_LOCALE:{"vi-VN":"vn","id-ID":"id","ms-MY":"my","km-KH":"kh","en-PH":"ph","th-TH":"th","my-MM":"mm","zh-TW":"tw","hi-IN":"in"},COUNTRY_CURRENCY_SYMBOL:{"vi-VN":"₫","id-ID":"Rp","ms-MY":"RM","km-KH":"៛","en-PH":"₱","th-TH":"฿","my-MM":"K","zh-TW":"$","hi-IN":"₹"},CURRENCY_PREFIX:{IDR:"Dimulai dari"},LOCALISED_SLUGS:{"en-PH":{PRODUCT:"product",CATEGORY:"category",BRAND:"brand",SEARCH:"search",PROFILE:"profile",PROFILE_MANAGE_ORDERS:"profile/manage-orders",PROFILE_MANAGE_ADDRESS:"profile/deliver-address",PROFILE_VOUCHER:"profile/voucher",PROFILE_MEMBER_CARD:"profile/member-card",CART:"cart",CART_CHECKOUT:"cart/checkout",ORDER_CONFIRMATION:"order-confirmation",PROMOTION:"promotion"},"vi-VN":{PRODUCT:"san-pham",CATEGORY:"danh-muc",BRAND:"thuong-hieu",SEARCH:"tim-kiem",PROFILE:"ho-so",PROFILE_MANAGE_ORDERS:"ho-so/quan-li-don-hang",PROFILE_MANAGE_ADDRESS:"ho-so/dia-chi-giao-hang",PROFILE_VOUCHER:"ho-so/khuyen-mai",PROFILE_MEMBER_CARD:"ho-so/the-thanh-vien",CART:"gio-hang",CART_CHECKOUT:"gio-hang/thanh-toan",ORDER_CONFIRMATION:"kiem-tra-don-hang",PROMOTION:"khuyen-mai"}},HEADER_LOGO_ALIGNMENT:"188px",globalFontFamily:"Inter",ENABLE_COMMUNITY_LOCALES:["vi-VN","id-ID","ms-MY","en-PH","th-TH"],ENABLE_CARE_LOCALES:["vi-VN","id-ID","en-PH"],ENABLE_HEALTH_PARENTING_LOCALES:["vi-VN","en-PH","id-ID","ms-MY","km-KH","th-TH","my-MM","zh-TW"],SEO_SCHEMA:T});function O(e){return null!=e}var A={formatAutoCompleteAddress:function(e){return e&&e.place_id?{placeId:e.place_id,description:e.description||""}:null},formatPrice:function(e,o){var t="string"==typeof e?parseInt(e):e;return new Intl.NumberFormat(o||"vi-VN").format(t)},formatHotSearchKeyword:function(e){return{text:(null==e?void 0:e.name)||""}},formatHelpfulUrl:function(e){return{name:(null==e?void 0:e.name)||"",featuredImage:(null==e?void 0:e.featured_image)||"",url:(null==e?void 0:e.url)||""}},formatCategory:function(e,t,i){var l,n,a,r=i?i+"/"+e.slug:e.slug,s=(null===(n=null===(l=null==e?void 0:e.children)||void 0===l?void 0:l.map)||void 0===n?void 0:n.call(l,(function(o){return A.formatCategory(o,e.id,r)})))||[];return{id:null==e?void 0:e.id,name:(null==e?void 0:e.name)||"",logo:(null==e?void 0:e.logo)||"",slug:(null==e?void 0:e.slug)||"",fullSlug:r||"",children:s,backgroundColor:e.color||o.theme.colors.teal50,parentId:t||0,products:(null===(a=e.products)||void 0===a?void 0:a.map(A.formatProduct))||[]}},formatFooterInfo:function(e){var o,t,i,l,n,a,r,s,u,c,d,m,p,_,h,E,v,I,T,g=(null===(i=null===(t=null===(o=null==e?void 0:e.branch)||void 0===o?void 0:o.branch)||void 0===t?void 0:t.map)||void 0===i?void 0:i.call(t,(function(e){return{flag:e.flag||"",name:e.name||"",url:e.url||""}})))||[],O=(null===(a=null===(n=null===(l=null==e?void 0:e.general)||void 0===l?void 0:l.verified)||void 0===n?void 0:n.map)||void 0===a?void 0:a.call(n,(function(e){return{image:e.image||"",url:e.url||""}})))||[],A=(null===(s=null===(r=null==e?void 0:e.menu)||void 0===r?void 0:r.map)||void 0===s?void 0:s.call(r,(function(e){var o,t;return{menu_title:e.menu_title,items:null===(t=null===(o=e.items)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,(function(e){return{title:e.title,url:e.url}}))}})))||[],f=(null===(d=null===(c=null===(u=null==e?void 0:e.social)||void 0===u?void 0:u.socials)||void 0===c?void 0:c.map)||void 0===d?void 0:d.call(c,(function(e){return{icon:e.icon||"",name:e.name||"",url:e.url||""}})))||[];return{branch:{title:(null===(m=null==e?void 0:e.branch)||void 0===m?void 0:m.title)||"",branch:g},general:{logo:null!==(_=null===(p=null==e?void 0:e.general)||void 0===p?void 0:p.logo)&&void 0!==_?_:"",content:null!==(E=null===(h=null==e?void 0:e.general)||void 0===h?void 0:h.content)&&void 0!==E?E:"",copyright:null!==(I=null===(v=null==e?void 0:e.general)||void 0===v?void 0:v.copyright)&&void 0!==I?I:"",verified:O},menu:A,social:{title:(null===(T=null==e?void 0:e.social)||void 0===T?void 0:T.title)||"",socials:f}}},formatNavigation:function(e){var o,t,i,l,n,a;return{hotSearchKeywords:(null===(t=null===(o=null==e?void 0:e.hot_search_keywords)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatHotSearchKeyword))||[],helpfulUrls:(null===(l=null===(i=null==e?void 0:e.helpful_urls)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,A.formatHelpfulUrl))||[],categories:(null===(a=null===(n=null==e?void 0:e.categories)||void 0===n?void 0:n.map)||void 0===a?void 0:a.call(n,(function(e){return A.formatCategory(e)})))||[],footer:A.formatFooterInfo(null==e?void 0:e.footer),storeId:(null==e?void 0:e.store_id)||0,customerId:(null==e?void 0:e.customer_id)||0,cartItemsQty:"number"==typeof(null==e?void 0:e.cart_items_qty)?e.cart_items_qty:null}},formatPriceInfo:function(e){return e?{final:e.final||0,regular:e.regular||0,discountPercent:e.discount_percent||0}:null},formatProduct:function(e){var o,t,i,l;if(!e)return null;var n={final:0,regular:0,discountPercent:0};return{id:e.id||0,price:e.price&&A.formatPriceInfo(e.price)||n,thumbnail:e.thumbnail||"",name:e.name||"",averageRating:Number((e.average_rating||0).toFixed(2)),reviewsCount:e.reviews_count||0,tag:e.tag||null,sku:e.sku||"",slug:e.slug||"",images:e.images||[],tags:e.tags||[],unit:e.unit||"",brand:e.brand?{name:e.brand.name||"",image:e.brand.image||"",slug:e.brand.slug||"",productsCount:e.brand.products_count||0}:null,description:e.description||"",productPromotions:(null===(t=null===(o=e.product_promotions)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatProductPromotion).filter(O))||[],categories:(null===(l=null===(i=e.categories)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,(function(e){return A.formatCategory(e)})).filter(O))||[],isInStock:(null==e?void 0:e.is_in_stock)||!1}},formatBanner:function(e){return e?{name:e.name||"",url:e.url||"",featuredImage:e.featured_image||"",alt:e.image_alt}:null},formatBlogPost:function(e){var o,t;return e?{title:e.title||"",image:e.image||"",link:e.link||"",postData:e.post_data?{reviewed:e.post_data.reviewed?{author:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.author||void 0),editor:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.editor||void 0),expert:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.expert||void 0),factCheck:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.fact_check||void 0),isAuthor:Boolean(e.post_data.reviewed.is_author)}:null,categories:e.post_data.categories?null===(t=(o=e.post_data.categories).map)||void 0===t?void 0:t.call(o,(function(e){return{termId:e.term_id||0,name:e.name||"",permalink:e.permalink||"",textColor:e.text_color||""}})):[],postDate:e.post_data.post_date||"",postModified:e.post_data.post_modified||"",modifiedTime:e.post_data.modified_time||""}:null}:null},formatBlogPostDataReviewedUser:function(e){return e?{id:e.ID||0,userId:e.user_id||0,formerRole:e.former_role||"",role:e.role||"",slug:e.slug||"",displayName:e.display_name||"",description:e.description||"",profileUrl:e.profile_url||"",avatar:e.avatar||"",avatarThumbnail:e.avatar_thumbnail||"",turnOffProfile:Boolean(e.turn_off_profile)}:null},formatBrand:function(e){var o,t,i,l;return e?{id:e.id||0,image:e.image||"",position:e.position||"",isPopular:e.is_popular||!1,summary:e.summary||"",name:e.name||"",slug:e.slug||"",description:e.description||null,banners:(null===(t=null===(o=e.banners)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatBanner).filter(O))||[],bestsellerProducts:(null===(l=null===(i=e.bestseller_products)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,A.formatProduct).filter(O))||[]}:null},formatHomePage:function(e){var o,t,i,l,n,a,r,s,u,c,d,m,p,_,h,E,v,I,T,g;return e?{brands:e.brands?null===(t=(o=e.brands).map)||void 0===t?void 0:t.call(o,A.formatBrand).filter(O):[],hotDeals:e.hot_deals?null===(l=(i=e.hot_deals).map)||void 0===l?void 0:l.call(i,A.formatProduct).filter(O):[],newProducts:e.new_products?null===(a=(n=e.new_products).map)||void 0===a?void 0:a.call(n,A.formatProduct).filter(O):[],slideBanners:e.slide_banners?null===(s=(r=e.slide_banners).map)||void 0===s?void 0:s.call(r,A.formatBanner).filter(O):[],subBanners:e.sub_banners?null===(c=(u=e.sub_banners).map)||void 0===c?void 0:c.call(u,A.formatBanner).filter(O):[],footerBanners:e.footer_banners?null===(m=(d=e.footer_banners).map)||void 0===m?void 0:m.call(d,A.formatBanner).filter(O):[],blogPosts:e.blog_posts?null===(_=(p=e.blog_posts).map)||void 0===_?void 0:_.call(p,A.formatBlogPost).filter(O):[],popularCategories:e.popular_categories?null===(E=(h=e.popular_categories).map)||void 0===E?void 0:E.call(h,(function(e){return A.formatCategory(e)})).filter(O):[],suggestProducts:e.suggest_products?null===(I=(v=e.suggest_products).map)||void 0===I?void 0:I.call(v,(function(e){return A.formatCategory(e)})).filter(O):[],promotions:e.promotions?null===(g=(T=e.promotions).map)||void 0===g?void 0:g.call(T,(function(e){return A.formatPromotion(e)})).filter(O):[]}:null},formatCategoryPage:function(e){var o,t,i,l;return e?{id:e.id||0,name:e.name||"",slug:e.slug||"",description:e.description||null,banners:(null===(t=null===(o=e.banners)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatBanner).filter(O))||[],bestsellerProducts:(null===(l=null===(i=e.bestseller_products)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,A.formatProduct).filter(O))||[]}:null},formatBrandPage:function(e){return e?A.formatBrand(e):null},formatPagination:function(e){return e?{current:e.current||0,first:e.first||0,itemsPerPage:e.items_per_page||0,last:e.last||0,next:e.next||0,prev:e.prev||0,totalItems:e.total_items||0}:null},formatProductDetailPage:function(o){var t,i,l,n,a,r,s,u;return o?e.__assign(e.__assign({},A.formatProduct(o)),{relatedProducts:(null===(i=null===(t=o.related_products)||void 0===t?void 0:t.map)||void 0===i?void 0:i.call(t,A.formatProduct).filter(O))||[],bestsellerProducts:(null===(n=null===(l=o.bestseller_products)||void 0===l?void 0:l.map)||void 0===n?void 0:n.call(l,A.formatProduct).filter(O))||[],viewedProducts:(null===(r=null===(a=o.viewed_products)||void 0===a?void 0:a.map)||void 0===r?void 0:r.call(a,A.formatProduct).filter(O))||[],promotions:(null===(u=null===(s=o.promotions)||void 0===s?void 0:s.map)||void 0===u?void 0:u.call(s,A.formatPromotion).filter(O))||[]}):null},formatProductReview:function(e){var o,t;return e?{reviewId:e.review_id||"",createdAt:e.created_at||"",title:e.title||"",detail:e.detail||"",nickname:e.nick_name||"",avatar:e.avatar||"",ratingVotes:(null===(t=null===(o=e.rating_votes)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,(function(e){return{ratingCode:e.rating_code||"",value:Number(e.value)||0,percent:Number(e.percent)||0}})))||[],images:e.images||[]}:null},formatProductPromotion:function(e){return e?{id:e.id||0,name:e.name||"",thumbnail:e.thumbnail||"",expirationDate:e.expiration_date||""}:null},formatPromotion:function(e){return e?{id:e.id||0,name:e.name||"",slug:e.slug||"",thumbnail:e.thumbnail||"",expiredDate:e.expired_date||"",banners:e.banners||[],points:0,description:e.description||"",metaTitle:e.meta_title||"",metaKeywords:e.meta_keywords||"",metaDescription:e.meta_description||""}:null},formatCustomAttributes:function(e,o){var t;return(null==e?void 0:e.length)&&(null===(t=null==e?void 0:e.find((function(e){return e.attribute_code===o})))||void 0===t?void 0:t.value)||""},formatAddress:function(e){var o,t,i,l;return e?{id:e.id||0,fullName:e.firstname||"",telephone:e.telephone||"",province:{value:null===(o=e.region)||void 0===o?void 0:o.region_id,label:null===(t=e.region)||void 0===t?void 0:t.region}||null,district:{value:A.formatCustomAttributes(e.custom_attributes,"district_id"),label:A.formatCustomAttributes(e.custom_attributes,"district")},commune:{value:A.formatCustomAttributes(e.custom_attributes,"ward_id"),label:A.formatCustomAttributes(e.custom_attributes,"ward")},street:(null===(i=null==e?void 0:e.street)||void 0===i?void 0:i.length)?null==e?void 0:e.street[0]:"",isDefault:e.default_billing&&e.default_shipping||!1,fullAddress:(null===(l=null==e?void 0:e.extension_attributes)||void 0===l?void 0:l.full_address)||""}:null},formatProvince:function(e){return(null==e?void 0:e.available_regions)?e.available_regions.map((function(e){return{value:e.id||"",label:e.name||""}})):[]},formatDistrict:function(e){return(null==e?void 0:e.districts)?e.districts.map((function(e){return{value:e.id||"",label:e.name||""}})):[]},formatCommune:function(e){return(null==e?void 0:e.communes)?e.communes.map((function(e){return{value:e.id||"",label:e.name||""}})):[]},formatOrder:function(e){var o,t;return e?{orderNumber:(null==e?void 0:e.order_number)||"",shippingData:(null==e?void 0:e.shipping_data)?{shippingMethod:e.shipping_data.shipping_method||"",shippingDescription:e.shipping_data.shipping_description||"",shippingAddress:e.shipping_data.shipping_address?{fullName:e.shipping_data.shipping_address.firstname||"",fullAddress:e.shipping_data.shipping_address.full_address||"",telephone:e.shipping_data.shipping_address.telephone||""}:null,storeAddress:null}:null,orderedDate:(null==e?void 0:e.ordered_date)||"",status:(null==e?void 0:e.status)||null,totals:(null==e?void 0:e.totals)?{subtotal:e.totals.subtotal||0,shippingAmount:e.totals.shipping_amount||0,discountAmount:e.totals.discount_amount||0,grandTotal:e.totals.grand_total||0}:null,products:(null===(t=null===(o=null==e?void 0:e.products)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,(function(e){return{sku:e.sku||"",name:e.name||"",price:e.price||0,rowTotal:e.row_total||0,image:e.image||"",qty:e.qty||0}})))||[],paymentMethod:(null==e?void 0:e.payment_method)||""}:null},formatStatistic:function(e){var o,t,i,l,n;return e?{pending:Number(null===(o=null==e?void 0:e.find((function(e){return"pending"===e.status})))||void 0===o?void 0:o.amount)||0,processing:Number(null===(t=null==e?void 0:e.find((function(e){return"processing"===e.status})))||void 0===t?void 0:t.amount)||0,delivering:Number(null===(i=null==e?void 0:e.find((function(e){return"delivering"===e.status})))||void 0===i?void 0:i.amount)||0,complete:Number(null===(l=null==e?void 0:e.find((function(e){return"complete"===e.status})))||void 0===l?void 0:l.amount)||0,canceled:Number(null===(n=null==e?void 0:e.find((function(e){return"canceled"===e.status})))||void 0===n?void 0:n.amount)||0}:{}},formatCartItem:function(e){var o,t,i,l,n,a,r,s;return e?{itemId:e.item_id||0,sku:e.sku||"",qty:e.qty||0,name:e.name||"",price:e.price||0,basePrice:(null===(o=e.extension_attributes)||void 0===o?void 0:o.base_price)||0,productType:e.product_type||"",quoteId:e.quote_id||"",thumbnail:(null===(t=e.extension_attributes)||void 0===t?void 0:t.thumbnail)||"",rowTotal:(null===(i=e.extension_attributes)||void 0===i?void 0:i.row_total)||0,promotions:(null===(a=null===(n=null===(l=e.extension_attributes)||void 0===l?void 0:l.promotions)||void 0===n?void 0:n.map)||void 0===a?void 0:a.call(n,A.formatProductPromotion))||[],isInStock:(null===(r=e.extension_attributes)||void 0===r?void 0:r.is_in_stock)||!1,urlProduct:(null===(s=e.extension_attributes)||void 0===s?void 0:s.url_key)||""}:null},formatCartAddress:function(e){var o;return e?{customerAddressId:(null==e?void 0:e.customer_address_id)||0,id:e.id||0,region:e.region||"",regionId:e.region_id||0,regionCode:e.region_code||"",countryId:e.country_id||"",street:e.street||[],postcode:e.postcode||"",city:e.city||"",firstname:e.firstname||"",lastname:e.lastname||"",customerId:e.customer_id||0,email:e.email||"",telephone:e.telephone||"",sameAsBilling:e.same_as_billing||0,saveInAddressBook:e.save_in_address_book||0,fullAddress:(null===(o=e.extension_attributes)||void 0===o?void 0:o.full_address)||""}:null},formatEstimatedShipping:function(e){return e?{carrierCode:e.carrier_code||"",methodCode:e.method_code||"",carrierTitle:e.carrier_title||"",methodTitle:e.method_title||"",amount:e.amount||0,baseAmount:e.base_amount||0,available:e.available||!1,errorMessage:e.error_message||"",priceExclTax:e.price_excl_tax||0,priceInclTax:e.price_incl_tax||0}:null},formatCartLoggedInCustomer:function(e){var o,t,i;return e?{email:e.email||"",firstname:e.firstname||"",lastname:e.lastname||"",id:e.id||0,groupId:e.group_id||0,createdAt:e.created_at||"",updatedAt:e.updated_at||"",createdIn:e.created_in||"",storeId:e.store_id||0,websiteId:e.website_id||0,addresses:(null===(t=null===(o=e.addresses)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatCartAddress))||[],disableAutoGroupChange:e.disable_auto_group_change||0,isSubscribed:(null===(i=e.extension_attributes)||void 0===i?void 0:i.is_subscribed)||!1}:null},formatCart:function(e){var o,t,i,l,n,a,r,s,u,c,d,m,p,_;return e?{id:e.id||0,createdAt:e.created_at||"",updatedAt:e.updated_at||"",isActive:e.is_active||!1,isVirtual:e.is_virtual||!1,items:(null===(i=null===(t=null===(o=e.items)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatCartItem))||void 0===i?void 0:i.sort((function(e,o){return Number(null==o?void 0:o.isInStock)-Number(null==e?void 0:e.isInStock)})))||[],itemsCount:e.items_count||0,itemsQty:e.items_qty||0,customer:e.customer?A.formatCartLoggedInCustomer(e.customer):null,billingAddress:e.billing_address?A.formatCartAddress(e.billing_address):null,origOrderId:e.orig_order_id||0,currency:{globalCurrencyCode:(null===(l=e.currency)||void 0===l?void 0:l.global_currency_code)||"",baseCurrencyCode:(null===(n=e.currency)||void 0===n?void 0:n.base_currency_code)||"",storeCurrencyCode:(null===(a=e.currency)||void 0===a?void 0:a.store_currency_code)||"",quoteCurrencyCode:(null===(r=e.currency)||void 0===r?void 0:r.quote_currency_code)||"",storeToBaseRate:(null===(s=e.currency)||void 0===s?void 0:s.store_to_base_rate)||0,storeToQuoteRate:(null===(u=e.currency)||void 0===u?void 0:u.store_to_quote_rate)||0,baseToGlobalRate:(null===(c=e.currency)||void 0===c?void 0:c.base_to_global_rate)||0,baseToQuoteRate:(null===(d=e.currency)||void 0===d?void 0:d.base_to_quote_rate)||0},customerIsGuest:e.customer_is_guest||!1,customerNoteNotify:e.customer_note_notify||!1,customerTaxClassId:e.customer_tax_class_id||0,storeId:e.store_id||0,shippingAssignments:null===(_=null===(p=null===(m=e.extension_attributes)||void 0===m?void 0:m.shipping_assignments)||void 0===p?void 0:p.map)||void 0===_?void 0:_.call(p,(function(e){var o,t,i;return{shipping:{address:e.shipping.address?A.formatCartAddress(e.shipping.address):null,method:(null===(o=e.shipping)||void 0===o?void 0:o.method)||""},items:(null===(i=(t=e.items).map)||void 0===i?void 0:i.call(t,A.formatCartItem))||[]}}))}:null},formatCartTotal:function(e){var o,t,i;return e?{grandTotal:e.grand_total||0,baseGrandTotal:e.base_grand_total||0,subtotal:e.subtotal||0,baseSubtotal:e.base_subtotal||0,discountAmount:e.discount_amount||0,baseDiscountAmount:e.base_discount_amount||0,subtotalWithDiscount:e.subtotal_with_discount||0,baseSubtotalWithDiscount:e.base_subtotal_with_discount||0,shippingAmount:e.shipping_amount||0,baseShippingAmount:e.base_shipping_amount||0,shippingDiscountAmount:e.shipping_discount_amount||0,baseShippingDiscountAmount:e.base_shipping_discount_amount||0,taxAmount:e.tax_amount||0,baseTaxAmount:e.base_tax_amount||0,weeeTaxAppliedAmount:e.weee_tax_applied_amount||0,shippingTaxAmount:e.shipping_tax_amount||0,baseShippingTaxAmount:e.base_shipping_tax_amount||0,subtotalInclTax:e.subtotal_incl_tax||0,shippingInclTax:e.shipping_incl_tax||0,baseShippingInclTax:e.base_shipping_incl_tax||0,baseCurrencyCode:e.base_currency_code||"",quoteCurrencyCode:e.quote_currency_code||"",itemsQty:e.items_qty||0,coupon:{couponCode:e.coupon_code||"",couponDescription:(null===(o=null==e?void 0:e.extension_attributes)||void 0===o?void 0:o.coupon_description_text)||""},items:(null===(i=null===(t=e.items)||void 0===t?void 0:t.map)||void 0===i?void 0:i.call(t,(function(e){return{itemId:e.item_id||0,price:e.price||0,basePrice:e.base_price||0,qty:e.qty||0,rowTotal:e.row_total||0,baseRowTotal:e.base_row_total||0,rowTotalWithDiscount:e.row_total_with_discount||0,taxAmount:e.tax_amount||0,baseTaxAmount:e.base_tax_amount||0,taxPercent:e.tax_percent||0,discountAmount:e.discount_amount||0,baseDiscountAmount:e.base_discount_amount||0,discountPercent:e.discount_percent||0,priceInclTax:e.price_incl_tax||0,basePriceInclTax:e.base_price_incl_tax||0,rowTotalInclTax:e.row_total_incl_tax||0,baseRowTotalInclTax:e.base_row_total_incl_tax||0,options:e.options||"",weeeTaxAppliedAmount:e.weee_tax_applied_amount||0,weeeTaxApplied:e.weee_tax_applied||0,name:e.name||""}})))||[],totalSegments:e.total_segments||[]}:null},formatPaymentMethod:function(e){return e?null==e?void 0:e.map((function(e){return{code:(null==e?void 0:e.payment_code)||"",title:(null==e?void 0:e.payment_title)||"",thumbnail:(null==e?void 0:e.payment_thumbnail)||""}})):null},formatPaymentInformation:function(e){var o;return e?{paymentMethods:A.formatPaymentMethod(null===(o=null==e?void 0:e.extension_attributes)||void 0===o?void 0:o.payment_detail_info)||[],totals:A.formatCartTotal(e.totals)}:null},formatOrderConfirmation:function(e){return e?{isSuccess:e.is_success||!1,orderInfo:A.formatOrder(e.order_info)}:null},formatCoupons:function(e){var o;return(null===(o=null==e?void 0:e.items)||void 0===o?void 0:o.length)?e.items.map((function(e){return{code:(null==e?void 0:e.code)||"",name:(null==e?void 0:e.name)||"",thumbnail:(null==e?void 0:e.thumbnail)||"",description:(null==e?void 0:e.expired_date)||""}})):null},formatShippings:function(e){return e?e.map((function(e){var o;return{carrierCode:e.carrier_code||"",methodCode:e.method_code||"",title:e.carrier_title||"",description:e.method_title||"",price:(null==e?void 0:e.base_amount)||0,thumbnail:(null===(o=null==e?void 0:e.extension_attributes)||void 0===o?void 0:o.thumbnail)||""}})):[]}},f=Object.freeze({__proto__:null,dataFormatter:A});exports.EcomTypes=i.types,exports.EcomApiTypes=n,exports.EcomConstants=g,exports.EcomDataFormatter=f,exports.EcomDataTypes=a;
package/build/esm/lead.js CHANGED
@@ -1 +1 @@
1
- import{b as e,c as t,d as a,a as n,_ as o}from"./tslib.es6-2f067bc0.js";import l,{createContext as r,useMemo as i,useRef as c,useState as d,useEffect as s,useContext as u}from"react";import m from"lodash/debounce";import{createPortal as p}from"react-dom";import{T as h}from"./translationsContext-3f8c93da.js";import{g as v,s as g}from"./cookieHelper-a14e48bf.js";import{b as f,a as b}from"./utils-f2ffc856.js";import{v1 as y}from"uuid";import{u as k}from"./useTranslations-4b3edceb.js";import{H as _}from"./index.styled-0220d09e.js";import{B as E}from"./index-8d3013e7.js";import{CommonGAssets as w}from"./gAssets.js";import"./index.styled-75b31c01.js";import"./index-0493bb30.js";import"@mantine/core";import"./index.styled-e06c12aa.js";import"string-format";import"./index-955162e1.js";import"./index.styled-5338f8f0.js";import"date-fns";import"react-day-picker/DayPickerInput";import"./index.styled-a97d34db.js";import"./index-490d005e.js";import"lodash/throttle";import"keen-slider/react";import"./index-e806a100.js";import"dayjs";import"./types-74ddb058.js";import"./screenSizeContext-561add4e.js";import"styled-components";import"./isProduction-c75ce7d7.js";import"./Locale-2652d4a4.js";import"react-hook-form";import{I as N,N as C}from"./index-dd65e217.js";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-639548a5.js";import"@mantine/dates";import{R as S,l as x,D as T,e as P}from"./index-01c6ad78.js";import{S as B}from"./index-eba2534d.js";import{M as O}from"./index-d2caea48.js";import{createFormContext as j}from"@mantine/form";import"@mantine/hooks";import"./index-b2d5879e.js";import"yup";import{T as L}from"./index-d1e3c8d5.js";import{t as I}from"./theme-9e29b135.js";import"./defaultClassWrapper-68ab9212.js";import"./index-4e2aa837.js";import"./index-46ccbe17.js";import"@hookform/resolvers/yup";import"./index-88c3ffb5.js";import"slugify";import"./routing-e38c3e50.js";import"dayjs/plugin/relativeTime";import"./useScrollbarSize-e261817f.js";import"@mantine/carousel";import"./Visible-1f2b5764.js";var A={LINKS:1,TAGS:2},U="https://dev.leadgen.hellobacsi.com/",D={MOBILE:1,DESKTOP:2},M="";U.includes("localhost")&&(U="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(M="pink");var H="https://"+location.hostname+location.pathname+location.search;H=H.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));var R={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},W=R[document.documentElement.lang]||R["vi-VN"];var V,q={"validator.required":"This field is required.","validator.remote":"Please fix this field.","validator.email":"Please enter a valid email address.","validator.phone":"Please input correct phone number.","validator.url":"Please enter a valid URL.","validator.date":"Please enter a valid date.","validator.dateISO":"Please enter a valid date (ISO).","validator.number":"Please enter a valid number.","validator.digits":"Please enter only digits.","validator.creditcard":"Please enter a valid credit card number.","validator.equalTo":"Please enter the same value again.","validator.accept":"Please enter a value with a valid extension.","validator.maxlength":"jQuery.validator.format('Please enter no more than {0} characters.","validator.minlength":"jQuery.validator.format('Please enter at least {0} characters.","validator.rangelength":"jQuery.validator.format('Please enter a value between {0} and {1} characters long.","validator.range":"jQuery.validator.format('Please enter a value between {0} and {1}.","validator.max":"jQuery.validator.format('Please enter a value less than or equal to {0}.","validator.min":"jQuery.validator.format('Please enter a value greater than or equal to {0}.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},F={"en-PH":q,"vi-VN":{"validator.required":"Vui lòng điền mục này","validator.email":"Vui lòng điền email có thật.","validator.number":"Vui lòng điền số có thật","validator.digits":"Vui lòng chỉ điền số","validator.maxlength":"Vui lòng điền dưới {0} số","validator.minlength":"Vui lòng điền hơn {0} số","validator.remote":"Hãy sửa cho đúng.","validator.url":"Hãy nhập URL.","validator.date":"Hãy nhập ngày.","validator.dateISO":"Hãy nhập ngày (ISO).","validator.creditcard":"Hãy nhập số thẻ tín dụng.","validator.equalTo":"Hãy nhập thêm lần nữa.","validator.extension":"Phần mở rộng không đúng.","validator.rangelength":"Hãy nhập từ {0} đến {1} kí tự.","validator.range":"Hãy nhập từ {0} đến {1}.","validator.max":"Hãy nhập từ {0} trở xuống.","validator.min":"Hãy nhập từ {0} trở lên.","validator.phone":"Nhập đúng định dạng số điện thoại","validator.emailUsed":"Email này đã được sử dụng cho chiến dịch.","validator.phoneUsed":"Số điện thoại này đã được sử dụng cho chiến dịch.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"hi-IN":{"validator.required":"इस क्षेत्र की आवश्यकता है।","validator.email":"कृपया एक मान्य ईमेल पता दर्ज करें","validator.number":"कृपया एक वैध संख्या दर्ज करें","validator.digits":"कृपया केवल अंक दर्ज करें","validator.maxlength":"कृपया {0} अक्षर से अधिक दर्ज न करें","validator.minlength":"कृपया कम से कम {0} अक्षर दर्ज करें","validator.phone":"कृपया एक वैध संख्या दर्ज करें","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"id-ID":{"validator.required":"Kolom ini wajib diisi","validator.email":"Tolong daftarkan email yang valid","validator.number":"Tolong daftarkan nomor telepon yang valid","validator.digits":"Tolong masukkan angka saja","validator.maxlength":"Jangan memasukkan lebih dari {0} karakter","validator.minlength":"Tolong ketik sedikitnya {0} karakter","validator.phone":"Tolong daftarkan nomor telepon yang valid","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"ms-MY":{"validator.required":"Bahagian ini wajib diisi.","validator.email":"Sila masukkan alamat emel yang sah.","validator.number":"Sila masukkan no telefon yang sah.","validator.digits":"Sila masukkan nombor digit sahaja.","validator.maxlength":"Sila masukkan tidak lebih dari {0} aksara","validator.minlength":"Sila masukkan sekurang-kurangnya {0} aksara","validator.phone":"Sila masukkan no telefon yang sah.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"my-MM":{"validator.required":"ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်","validator.email":"မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ","validator.number":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.digits":"နံပါတ်များသာဖြည့်ပါ","validator.maxlength":"ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ","validator.minlength":"ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ","validator.phone":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"km-KH":{"validator.required":"ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ","validator.email":"សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.number":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.digits":"វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ","validator.maxlength":"សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ","validator.minlength":"សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស","validator.phone":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"zh-TW":{"validator.required":"此為必填欄位","validator.email":"請填入有效的 email 地址","validator.number":"請填入有效的電話號碼","validator.digits":"此欄位僅能輸入數字","validator.maxlength":"請輸入少於 {0} 位數","validator.minlength":"請輸入至少 {0} 位數","validator.phone":"請填入有效的電話號碼","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"th-TH":{"validator.required":"ต้องระบุข้อมูลในช่องนี้","validator.email":"กรุณาใส่อีเมล์ที่ถูกต้อง","validator.number":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.digits":"กรุณาส่เฉพาะตัวเลข","validator.maxlength":"กรุณาใส่ตัวเลขมากกว่า {0} หลัก","validator.minlength":"กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก","validator.phone":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"tl-PH":q},z=function(e){var t=F[e];return t||F["en-PH"]},J=r({}),Y=function(e){var t=e.onClose,a=e.containerClassName,n=e.svgClassName;return l.createElement("button",{onClick:t,className:"le-newbuilder-close-button js-modal__close ".concat(a||"")},l.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n},l.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"white"}),l.createElement("path",{d:"M16 17.05L10.925 22.125C10.7917 22.2584 10.621 22.329 10.413 22.337C10.2044 22.3457 10.025 22.275 9.87502 22.125C9.72502 21.975 9.65002 21.8 9.65002 21.6C9.65002 21.4 9.72502 21.225 9.87502 21.075L14.95 16L9.87502 10.925C9.74169 10.7917 9.67102 10.6207 9.66302 10.412C9.65436 10.204 9.72502 10.025 9.87502 9.87502C10.025 9.72502 10.2 9.65002 10.4 9.65002C10.6 9.65002 10.775 9.72502 10.925 9.87502L16 14.95L21.075 9.87502C21.2084 9.74169 21.3794 9.67069 21.588 9.66202C21.796 9.65402 21.975 9.72502 22.125 9.87502C22.275 10.025 22.35 10.2 22.35 10.4C22.35 10.6 22.275 10.775 22.125 10.925L17.05 16L22.125 21.075C22.2584 21.2084 22.329 21.379 22.337 21.587C22.3457 21.7957 22.275 21.975 22.125 22.125C21.975 22.275 21.8 22.35 21.6 22.35C21.4 22.35 21.225 22.275 21.075 22.125L16 17.05Z",fill:"#595959"})))},G=function(e){var t=e.popupId,a=e.url,n=e.newTab,o=e.imageDestkop,r=e.imageMobile,i=e.onClose,c=e.onOtherSubmit;return l.createElement("div",{id:t,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"center_tab"},l.createElement("div",{className:"le-center-tab-popup"},l.createElement("div",{style:{position:"relative"}},l.createElement("a",{className:"js-popup-other-submit",href:a,target:n?"blank":"_parent",onClick:c},l.createElement("img",{className:"le-only-mobile",src:r}),l.createElement("img",{className:"le-only-desktop",src:o})),l.createElement(Y,{onClose:i,containerClassName:"close-button-top-right"}))))},K=function(e){var t=e.popupId,a=e.url,n=e.title,o=e.urlText,r=e.titleAlign,i=e.subtitle,c=e.subtitleAlign,d=e.newTab,s=e.imageDesktop,u=e.imageMobile,m=e.onClose,p=e.onOtherSubmit;return l.createElement("div",{id:t,className:"lead-modal-wrapper lead-floating-wrapper","data-popup-url":location.pathname,"data-popup-type":"floating"},l.createElement("aside",{className:"le-only-desktop"},l.createElement("div",{className:"le-floating-desktop"},l.createElement("div",{className:"le-floating-desktop-wrap",style:{position:"relative",background:"#fff"}},s?l.createElement("div",null,l.createElement("img",{style:{maxWidth:120,borderTopLeftRadius:5,borderBottomLeftRadius:5},src:s})):null,l.createElement("div",{style:{padding:20}},l.createElement("div",{className:"le-floating-desktop-title le-text-align-".concat(r)},n),l.createElement("div",{className:"le-floating-desktop-desc le-text-align-".concat(c)},i)),l.createElement("a",{target:d?"blank":"_parent",style:{marginLeft:35,textDecoration:"none"},href:a},l.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:p},o)),l.createElement(Y,{onClose:m,containerClassName:"close-button-top-right"})))),l.createElement("aside",{className:"le-only-mobile"},l.createElement("div",{className:"le-floating-mobile"},l.createElement("div",{className:"le-floating-mobile-wrap",style:{position:"relative",background:"#fff"}},l.createElement("aside",{style:{display:"flex",justifyContent:"space-between"}},l.createElement("div",null,l.createElement("div",{className:"le-floating-mobile-title le-text-align-".concat(r)},n),l.createElement("div",{className:"le-floating-mobile-desc le-text-align-".concat(c)},i)),u?l.createElement("div",null,l.createElement("img",{style:{marginLeft:15,marginTop:4,maxWidth:100},src:u})):null),l.createElement("div",{style:{textAlign:"center",marginTop:10}},l.createElement("a",{target:d?"blank":"_parent",href:a,style:{textDecoration:"none"}},l.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:p},o))),l.createElement(Y,{onClose:m,containerClassName:"close-button-top-right"})))))},Q=function(e){var t=e.title,a=e.titleAlign,n=e.subtitle,o=e.subtitleAlign,r=e.link,i=e.linkNewTab,c=e.linkText,d=e.image;return l.createElement("div",{className:"lead-modal__thank-you"},l.createElement("div",{style:{width:"100%"}},l.createElement("img",{src:d,style:{maxHeight:162,objectFit:"cover"}}),t&&l.createElement("h1",{className:"le-thankyou-title le-text-align-".concat(a)},t),n&&l.createElement("p",{className:"le-thankyou-subtitle le-text-align-".concat(o)},n),c&&l.createElement("div",null,l.createElement("a",{href:r,target:i?"_blank":"parrent",rel:"noreferrer"},l.createElement("button",{className:"lead-modal__btn ".concat(M)},c)))))},X=new function(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"},Z=function(t){var a=t.url,n=t.data,o=void 0===n?void 0:n,l=e(t,["url","data"]);return l.body=JSON.stringify(o),l.headers={"Content-Type":"application/json"},fetch("".concat(X.apiLeadUrl).concat(a),l).then((function(e){return e.json()})).catch((function(e){return{}}))},$=function(t){var a=t.url,n=t.data,o=e(t,["url","data"]);return o.body=JSON.stringify(n),o.headers={"Content-Type":"application/json"},fetch("".concat(X.apiSubotUrl).concat(a),o).then((function(e){return e.json()})).catch((function(e){return{}}))},ee=function(e){var t=e.bot_id,a=e.email,n=e.phone;return n&&n.startsWith("0")&&(n=n.substring(1)),$({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:t,email:a,phone:n}})},te=function(e){var t=e.campaign_id,a=e.email,n=e.phone;return n&&n.startsWith("0")&&(n=n.substring(1)),Z({url:"api/subot-campaign/check",method:"post",data:{campaign_id:t,email:a,phone:n}})},ae=function(e){var t=e.phone;return Z({url:"api/sms/otp",method:"post",data:{phone_number:t.replace("+","")}})},ne=function(e){var t=e.phone,a=e.otp;return Z({url:"api/sms/verify",method:"post",data:{otp_code:a,phone_number:t.replace("+","")}})},oe=function(e,n,o){return t(void 0,void 0,void 0,(function(){var t,l,r,i,c,d;return a(this,(function(a){switch(a.label){case 0:return t="email"in o?"email":"phone",l="email"in o?o.email:o.phone,r="email"in o?"validator.emailUsed":"validator.phoneUsed",[4,te((c={campaign_id:[e]},c[t]=l,c))];case 1:return"SubmitLeadWithBotId_ERR_001"===(i=a.sent())._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode?[2,r]:n.length?[4,ee((d={bot_id:n},d[t]=l,d))]:[3,3];case 2:if("CheckSuBotLeadTool_ERR_001"===a.sent()._errorCode)return[2,r];a.label=3;case 3:return[2]}}))}))},le={email:{},phone:{}},re=function(e,n,o){return t(void 0,void 0,void 0,(function(){var t,l,r,i;return a(this,(function(a){switch(a.label){case 0:if(t="email"in o?"email":"phone",l="email"in o?o.email:o.phone,r="email"in o?"validator.emailUsed":"validator.phoneUsed",le[t][l]){if(le[t][l].value)return[2,r];if(!le[t][l].value&&le[t][l].expire>Date.now())return[2,""]}return[4,oe(e,n,o)];case 1:return i=a.sent(),le[t][l]=i?{value:!0}:{value:!1,expire:Date.now()+6e4},[2,i]}}))}))},ie=function(e){var t=e.content,a=e.inlinePosition,o=i((function(){if(!a)return null;var e=document.querySelectorAll('[data-url="'.concat(location.pathname,'"] .body-content')),t=Array.from(e).reduce((function(e,t){return n(n([],e,!0),Array.from(t.children),!0)}),[]);if(null==t?void 0:t.length){var o=t.filter((function(e){return"P"===e.nodeName})),l=t.filter((function(e){return"H2"===e.nodeName})),r=null;switch(a){case"1th":r=o[0];break;case"2th":r=o[1];break;case"3th":r=o[2];break;case"4th":r=o[3];break;case"5th":r=o[4];break;case"6th":r=o[5];break;case"7th":r=o[6];break;case"8th":r=o[7];break;case"9th":r=o[8];break;case"10th":r=o[9];break;case"11th":r=o[10];break;case"12th":r=o[11];break;case"lastP":r=o[o.length-1];break;case"1thH2":r=l[0];break;case"2thH2":r=l[1];break;case"3thH2":r=l[2];break;case"4thH2":r=l[3];break;case"5thH2":r=l[4];break;case"6thH2":r=l[5];break;case"7thH2":r=l[6];break;case"8thH2":r=l[7];break;case"9thH2":r=l[8];break;case"10thH2":r=l[9];break;case"lastH2":r=l[l.length-1]}if(r){if(r.parentElement.querySelector(".inline-lead-wrapper"))return r.parentElement.querySelector(".inline-lead-wrapper");var i=document.createElement("div");return i.classList.add("inline-lead-wrapper"),r.nextElementSibling?r.parentElement.insertBefore(i,r.nextElementSibling):r.parentElement.appendChild(i),i}}}),[a]);return a&&o?p(t,o):null},ce=function(e){var t=e.content,a=i((function(){var e=Array.from(document.querySelectorAll(".hc2-sidebar-with-ads,.page-main-col .right-col.f-right,.hhg-lead-sidebar"));return e.forEach((function(e){if(!e.querySelector(".sidebar-lead-modal-wrapper")){var t=document.createElement("div");t.classList.add("sidebar-lead-modal-wrapper"),e.prepend(t)}})),e.map((function(e){return e.querySelector(".sidebar-lead-modal-wrapper")}))}),[]);return l.createElement(l.Fragment,null,a.map((function(e){return p(t,f(e,"sidebar-lead-modal-wrapper"))})))},de=(V=j())[0],se=V[1],ue=V[2],me="undefined"==typeof window,pe={VN:"vi",ID:"id",TH:"th",MY:"ms",TW:"zh-TW",KH:"km",MM:"my",IN:"hi",PH:"en"},he=function(e,n){return void 0===e&&(e=""),void 0===n&&(n=""),t(void 0,void 0,void 0,(function(){return a(this,(function(t){return[2,new Promise((function(t,a){if(!e)return a("Need valid text input");if(me)return a("Need valid window object");try{(new window.google.maps.places.AutocompleteService).getPlacePredictions({input:e,componentRestrictions:{country:n},language:pe[n]},t)}catch(e){a(e)}}))]}))}))},ve=["places"],ge=function(e){var n=e.name,r=e.placeholder,u=se(),m=d(""),p=m[0],h=m[1],v=d(""),g=v[0],f=v[1],b=function(e,n,o){void 0===e&&(e=""),void 0===n&&(n=""),void 0===o&&(o=500);var l=d([]),r=l[0],i=l[1],c=d(!1),u=c[0],m=c[1];return s((function(){var l;return e?l=window.setTimeout((function(){return t(void 0,void 0,void 0,(function(){var t,o;return a(this,(function(a){switch(a.label){case 0:if(!e)return i([]),[2];a.label=1;case 1:return a.trys.push([1,3,4,5]),m(!0),[4,he(e,n)];case 2:return t=a.sent(),i(!(l=t)||l.length<1?[]:l.map((function(e){return{placeId:e.place_id,description:e.description}}))),[3,5];case 3:return o=a.sent(),console.error(o),[3,5];case 4:return m(!1),[7];case 5:return[2]}var l}))}))}),o):r.length&&i([]),function(){window.clearTimeout(l)}}),[e,o,n]),{isLoading:u,predictions:r}}(p||"15 Lê","VN").predictions,y=d(null),k=y[0],_=y[1],E=d(!1),w=E[0],N=E[1],C=c(Math.random().toString(36).substring(7)),S=i((function(){var e=b.map((function(e){return{value:e.description,label:e.description}})),t=e.find((function(e){return e.value===g}));return!g||t?e:[{value:g,label:g}].concat(e)}),[b,g]);return s((function(){var e,t,a;(null===(a=null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===a?void 0:a.AutocompleteService)?N(!0):import("@react-google-maps/api").then((function(e){_((function(){return e.LoadScript})),setTimeout((function(){N(!0)}),200)}))}),[]),w?l.createElement(l.Fragment,null,k&&l.createElement(k,{googleMapsApiKey:"AIzaSyB9QmhfEYcy2wj5X3Fl38aCD5UkET6n82M",libraries:ve,loadingElement:l.createElement(l.Fragment,null)}),l.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":n,"data-control":"text"}),l.createElement(B,o({className:"lead-modal__form-control",label:r,placeholder:r,withAsterisk:!0,name:n,data:S,searchValue:p,onSearchChange:function(e){h(e)},filter:function(){return!0},clearable:!0,searchable:!0,onChange:function(e){return f(e||"")},icon:l.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M9.99999 9.79167C10.4028 9.79167 10.7467 9.64944 11.0317 9.365C11.3161 9.08 11.4583 8.73611 11.4583 8.33333C11.4583 7.93056 11.3161 7.58667 11.0317 7.30167C10.7467 7.01722 10.4028 6.875 9.99999 6.875C9.59721 6.875 9.25332 7.01722 8.96832 7.30167C8.68388 7.58667 8.54166 7.93056 8.54166 8.33333C8.54166 8.73611 8.68388 9.08 8.96832 9.365C9.25332 9.64944 9.59721 9.79167 9.99999 9.79167ZM9.99999 17.875C9.90277 17.875 9.80555 17.8611 9.70832 17.8333C9.6111 17.8056 9.52082 17.7569 9.43749 17.6875C7.46527 15.8958 5.98971 14.2361 5.01082 12.7083C4.03138 11.1806 3.54166 9.77778 3.54166 8.5C3.54166 6.48611 4.1911 4.87833 5.48999 3.67667C6.78832 2.47556 8.29166 1.875 9.99999 1.875C11.7083 1.875 13.2119 2.47556 14.5108 3.67667C15.8092 4.87833 16.4583 6.48611 16.4583 8.5C16.4583 9.77778 15.9689 11.1806 14.99 12.7083C14.0105 14.2361 12.5347 15.8958 10.5625 17.6875C10.4792 17.7569 10.3889 17.8056 10.2917 17.8333C10.1944 17.8611 10.0972 17.875 9.99999 17.875Z",fill:"#8C8C8C"})),autoComplete:"no-auto-complete-"+C.current,rightSection:l.createElement(l.Fragment,null)},u.getInputProps(n)))):l.createElement("div",{style:{height:73}})},fe=function(e){var t=e.children,a=e.align;return l.createElement("p",{className:"lead-modal__description ".concat("le-text-align-"+(a||"")," ").concat(M)},t)},be=function(e){var t=e.children,a=e.align;return l.createElement("h2",{className:"lead-modal__title ".concat("le-text-align-"+(a||"")," ").concat(M)},t)},ye=function(e){var t=e.listBlockAdded,a=e.popupId,n=e.locale,r=e.onClose,i=e.onOtherSubmit,c=se();return l.createElement(l.Fragment,null,t.map((function(e,t){var d=e||{},s=d.name,u=void 0===s?"":s,m=d.data,p=void 0===m?{}:m,h=p.placeholder,v=p.value,g=p.align,f=p.listQuestion,b=p.isSendMailChimp,y=void 0!==b&&b,k=p.newtab,_=p.url;switch(u){case"TitleBlock":return l.createElement(be,{key:t,align:g},v);case"SubtitleBlock":return l.createElement(fe,{key:t,align:g},v);case"TextBlock":return l.createElement(N,o({key:t,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:h,className:"lead-modal__form-control",label:h,"data-control":"text",name:v},c.getInputProps(v)));case"NumberBlock":return l.createElement(C,o({key:t,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:h,className:"lead-modal__form-control",label:h,"data-control":"number",name:v},c.getInputProps(v)));case"EmailBlock":return l.createElement(N,o({key:t,withAsterisk:!0,spellCheck:!1,placeholder:h,className:"lead-modal__form-control",label:h,"data-control":"email",name:v},c.getInputProps(v)));case"PhoneOtpBlock":case"PhoneBlock":var w=a+"-"+v+"-"+t;return l.createElement(N.Wrapper,o({size:"md",withAsterisk:!0,key:t,label:h,className:"lead-modal__form-control",labelProps:{htmlFor:w}},c.getInputProps(v)),l.createElement(P,{name:v,spellCheck:!1,type:"tel",placeholder:h,onChange:function(e){c.setFieldValue(v,e)},id:w,defaultCountry:n&&O[n]||"VN","data-control":"tel"}));case"LocationBlock":return l.createElement(ge,{key:t,name:v,placeholder:h});case"DateBlock":return l.createElement(T,o({withAsterisk:!0,key:t,type:"date",name:v,placeholder:h,className:"lead-modal__form-control",label:h,"data-control":"date"},c.getInputProps(v)));case"LinkButtonBlock":return l.createElement("div",{key:t},l.createElement("a",{target:k?"blank":"parrent",href:_,style:{textDecoration:"none"}},l.createElement(E,{type:"button",size:"md",className:"lead-modal__btn ".concat(M),onClick:function(){null==r||r(),null==i||i()}},v)));case"CheckboxBlock":return l.createElement(l.Fragment,null,y&&l.createElement("div",{style:{display:"none"},"data-name":v+"-mailchimp"}),l.createElement(x.Group,o({withAsterisk:!0,className:"lead-modal__form-control",key:t,label:h,size:"md"},c.getInputProps(v)),f.map((function(e,t){return l.createElement(x,{name:v,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})}))));case"RadioBlock":return l.createElement(l.Fragment,null,y&&l.createElement(N,{type:"hidden",name:v+"-mailchimp",value:y}),l.createElement(S.Group,o({withAsterisk:!0,className:"lead-modal__form-control",key:t,label:h,size:"md"},c.getInputProps(v)),f.map((function(e,t){return l.createElement(S,{name:v,key:t,value:e.value,label:e.placeholder,"data-control":"radio"})}))));case"DropdownBlock":return l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":v,"data-control":"dropdown"}),l.createElement(B,o({key:t,className:"lead-modal__form-control",label:h,withAsterisk:!0,name:v,data:f.map((function(e){return{value:e.value,label:e.placeholder}}))},c.getInputProps(v))))}return null})))},ke=function(e){var n=e.phone,o=e.onSuccess,r=e.autoSendWhenOpen,i=k().t,u=d(""),m=u[0],p=u[1],h=d(!1),v=h[0],g=h[1],f=d(0),b=f[0],y=f[1],w=c(null),C=d(),S=C[0],x=C[1],T=d(""),P=T[0],B=T[1],O=c();s((function(){t(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(a){switch(a.label){case 0:return O.current?[3,2]:[4,import("react-phone-number-input")];case 1:e=a.sent(),O.current=e.formatPhoneNumberIntl,a.label=2;case 2:return B((null===(t=O.current)||void 0===t?void 0:t.call(O,n))||n),[2]}}))}))}),[n]);var j=function(){return t(void 0,void 0,void 0,(function(){var e,t,l;return a(this,(function(a){switch(a.label){case 0:return n?[4,ae({phone:n})]:[2];case 1:return e=a.sent(),"Send sms successfully"===(t=null===(l=null==e?void 0:e._messages)||void 0===l?void 0:l[0])?(y(60),setTimeout((function(){w.current&&(w.current.focus(),w.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===t?o():x(t||"something Wrong"),[2]}}))}))};return s((function(){setTimeout((function(){b>0&&y((function(e){return e-1}))}),1e3)}),[b]),s((function(){r&&!b&&j()}),[]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:function(e){e.preventDefault(),t(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(a){switch(a.label){case 0:return m?[4,ne({phone:n,otp:m})]:[2];case 1:return e=a.sent(),"Verify successfully"===(t=null==e?void 0:e._messages[0])||"This phone number was verified"===t?o():x(t||"something Wrong"),[2]}}))}))},className:"lead-phone-otp-form"},l.createElement(_,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},i("lead.otp.title")),l.createElement(L,{size:"p1",color:I.colors.gray600},i("lead.otp.desc",{phone:P})),l.createElement(N,{ref:w,name:"_"+name+"-otp",spellCheck:!1,type:"text",placeholder:"Enter OTP",className:"lead-modal__form-control",label:"Phone OTP","data-control":"otp",withAsterisk:!0,pattern:"[0-9]*",value:m,onChange:function(e){g(!0),p(e),x(e?void 0:"OTP is required")},error:v?S:void 0}),l.createElement(E,{size:"md",color:"primary",className:"lead-modal__btn ".concat(M),disabled:!m},i("lead.otp.verify")),l.createElement(E,{type:"button",size:"md",color:"transparent",className:"lead-modal__btn lead-phone-otp-button ".concat(M),onClick:function(){j()},disabled:!!b},i("lead.otp.resend",{timer:b?" (".concat(b,"s)"):""}))))},_e=function(e){var t,a,n,r=e.popupId,u=e.extraFields,m=e.onClose,p=e.onOtherSubmit,h=e.imageMobile,v=e.imageDesktop,g=e.imageOverlayMobile,f=e.imageOverlayDesktop,b=e.imageBackground,y=e.currentLayout,_=e.title,N=e.onSubmit,C=e.showThankyou,S=e.campaignId,x=e.campaign_subot_id,T=e.locale,P=JSON.parse(u.listBlockAdded),B=JSON.parse(u.actionBlocks),O=JSON.parse(u.textBlocks),j=B.submitBlock.data.url,L=B.submitBlock.data.text,I=B.submitBlock.data.text2,A=B.submitBlock.data.value,U=location.pathname,D=y.includes("Inline")||"Sidebar"===y,H="Slider"===y,R=d(!0),V=R[0],q=R[1],F=d(""),z=F[0],J=F[1],G=c(),K=function(){z?J(""):null==m||m()};if(window.innerWidth<769&&["Fullscreen","Slider"].includes(y))return console.log("😎 Not show fullscreen, slider on mobile "),null;s((function(){(y.includes("LightBox")||"Fullscreen"==y)&&document.body.classList.add("noscroll"),window.intlTelInputUtils||require("intl-tel-input/build/js/utils"),le.email={},le.phone={}}),[]);var X=c(!1),Z=c(!1),$=function(e){var t=e.listBlockAdded,a=void 0===t?[]:t,n=e.validatingPhoneRef,l=e.validatingEmailRef,r=e.campaignId,d=e.campaign_subot_id,s=void 0===d?[]:d,u=k().t,m=i((function(){var e=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","LocationBlock"],t=function(e,t){return function(a){if(h.current.isTouched(e))return void 0===a||""===a||Array.isArray(a)&&0===a.length?u("validator.required"):null==t?void 0:t(a)}};return a.filter((function(t){return e.includes(t.name)})).reduce((function(e,a){var i,c,d,m,p;return"NumberBlock"===a.name?o(o({},e),((i={})[a.data.value]=t(a.data.value,(function(e){if(isNaN(Number(e)))return u("validator.number")})),i)):"EmailBlock"===a.name?o(o({},e),((c={})[a.data.value]=t(a.data.value,(function(e){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return u("validator.email");l.current=!0,re(r,s,{email:e}).then((function(e){e&&h.current.setFieldError(a.data.value,u(e)),l.current=!1})).catch((function(e){console.error(e),l.current=!1}))})),c)):"PhoneBlock"===a.name||"PhoneOtpBlock"===a.name?o(o({},e),((d={})[a.data.value]=t(a.data.value,(function(e){if(window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),W.countryCode))return u("validator.phone");n.current=!0,re(r,s,{phone:e}).then((function(e){e&&h.current.setFieldError(a.data.value,u(e)),n.current=!1})).catch((function(e){console.error(e),n.current=!1}))})),d)):"DateBlock"===a.name?o(o({},e),((m={})[a.data.value]=t(a.data.value,(function(e){if(isNaN(Date.parse(e)))return u("validator.date")})),m)):o(o({},e),((p={})[a.data.value]=t(a.data.value),p))}),{})}),[a.map((function(e){return e.name})).join(",")]),p=ue({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:m}),h=c(p);return h.current=p,{form:p,validateObj:m}}({listBlockAdded:P,validatingPhoneRef:X,validatingEmailRef:Z,campaignId:S,campaign_subot_id:x}),ee=$.form,te=$.validateObj,ae=l.createElement(l.Fragment,null,l.createElement("style",{dangerouslySetInnerHTML:{__html:".le-newbuilder-overlay {\n background: url(".concat(g,") ;\n background-repeat: no-repeat;\n background-size: cover;\n }\n @media screen and (min-width:768px) {\n .le-newbuilder-overlay {\n background: url(").concat(f,") ;\n background-repeat: no-repeat;\n background-size: cover;\n }\n }")}}),l.createElement("div",{id:r,"data-popup-url":U,"data-popup-type":"lightbox-inline",className:"lead-modal lead-modal-wrapper modal--animate-scale ".concat(D?"le-buider-inline":""," ").concat(H?"le-buider-slider":"")},"Fullscreen"==y?l.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:b||""}):null,l.createElement("div",{className:"lead-modal__wrapper le-newbuilder-wrap-".concat(y)},l.createElement("div",{className:"lead-modal__content le-newbuilder-".concat(y)},C?l.createElement(Q,{title:C.title,titleAlign:C.titleAlign,subtitle:C.subtitle,subtitleAlign:C.subtitleAlign,link:C.link,linkNewTab:C.linkNewTab,linkText:C.linkText,image:C.image}):l.createElement(l.Fragment,null,l.createElement("header",{className:"lead-modal__header"},z?l.createElement("img",{src:w.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%"}}):l.createElement(l.Fragment,null,["LightBoxA","InlineA","Sidebar","Slider"].includes(y)?h?l.createElement("img",{draggable:"false",className:"lead-modal__image lead-modal-image-cover",src:h,alt:""}):null:l.createElement(l.Fragment,null,v?l.createElement("img",{draggable:"false",className:"le-only-desktop lead-modal__image lead-modal-image-cover",style:{height:"100%",objectFit:"cover"},src:v,alt:""}):null,h?l.createElement("img",{draggable:"false",className:"le-only-mobile lead-modal__image lead-modal-image-cover",src:h,alt:""}):null))),z&&l.createElement(ke,{phone:z,autoSendWhenOpen:!0,onSuccess:function(){null==N||N(G.current,ee.values)}}),l.createElement("div",{"data-hidden":!!z,className:"lead-modal__body le-newbuilder-overlay"},l.createElement(de,{form:ee},l.createElement("form",{ref:G,className:"lead-modal__form ".concat(r),onSubmit:function(e){e.preventDefault(),ee.setTouched(Object.keys(te).reduce((function(e,t){return e[t]=!0,e}),{})),Z.current||X.current||setTimeout((function(){ee.onSubmit((function(e){var t,a;if(P.findIndex((function(e){return"PhoneOtpBlock"===e.name}))>-1){var n=null===(a=null===(t=P.find((function(e){return"PhoneOtpBlock"===e.name})))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;J(e[n])}else null==N||N(G.current,e)}))(e)}),100)}},l.createElement("div",{style:{marginBottom:20}},l.createElement("h2",{className:"lead-modal__title ".concat("le-text-align-"+(null===(t=O.titleBlock.data)||void 0===t?void 0:t.align)," ").concat(M)},_),l.createElement("p",{className:"lead-modal__description ".concat("le-text-align-"+(null===(a=O.titleBlock.data)||void 0===a?void 0:a.align)," ").concat(M)},O.subtitleBlock.data.value)),l.createElement("div",{className:"lead-modal__form-control-wrapper"},l.createElement(ye,{listBlockAdded:P,popupId:r,locale:T,onClose:K,onOtherSubmit:p})),(null===(n=null==B?void 0:B.submitBlock)||void 0===n?void 0:n.isHide)?null:l.createElement(l.Fragment,null,l.createElement("div",{className:"lead-modal__checkbox-wrapper ".concat(M)},l.createElement("div",{className:"lead-modal__checkbox"},l.createElement("input",{id:"lead-term-checkbox",className:"lead-modal__checkbox__input ".concat(M),type:"checkbox","aria-label":"Checkbox label",checked:V,onChange:function(e){return q(e.currentTarget.checked)}}),l.createElement("div",{className:"lead-modal__checkbox__control","aria-hidden":"true"})),l.createElement("label",{htmlFor:"checkbox",className:"lead-modal__checkbox__label"},L," ",l.createElement("span",{style:{fontWeight:"bold"}},l.createElement("a",{target:"blank",href:j||"https://hellobacsi.com/chinh-sach",rel:"noopener noreferrer",style:{textDecoration:"none"}},I)))),l.createElement(E,{size:"md",id:"lead-submit",type:"submit",className:"lead-modal__btn ".concat(M),disabled:!V},A))))))),!y.includes("Inline")&&l.createElement(Y,{onClose:K,containerClassName:"close-button-top-right"}))));return y.includes("LightBox")||"Fullscreen"==y||"Slider"==y?ae:"Sidebar"==y?l.createElement(ce,{content:ae}):y.includes("Inline")?l.createElement(ie,{content:ae,inlinePosition:u.popupInlinePosition}):null},Ee=function(e){var t=e.popupId,a=e.link,n=e.linkText,o=e.linkNewTab,r=e.onClose,i=e.imageMobile,c=e.imageDesktop,d=e.currentLayout,s=e.onOtherSubmit,u=location.pathname;return l.createElement("div",{id:t,className:"lead-modal-wrapper","data-popup-url":u,"data-popup-type":"skin_ab"},"SkinA"==d?l.createElement("aside",{className:"le-only-desktop"},l.createElement("div",{className:"le-skin-a-desktop"},l.createElement("div",{style:{position:"relative"}},l.createElement("img",{src:c}),l.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"calc(100% - 15px)"},href:a,target:o?"blank":"_parent"},l.createElement("button",{onClick:s,className:"le-joinbow-btn js-popup-other-submit"},n)),l.createElement(Y,{onClose:r,containerClassName:"close-button-top-right"})))):"SkinB"==d?l.createElement("aside",{className:"le-only-desktop"},l.createElement("div",{className:""},l.createElement("div",{style:{position:"relative",zIndex:1e4}},l.createElement("img",{src:c,style:{width:"100%"}}),l.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"100%"},href:a,target:o?"blank":"_parent"},l.createElement("button",{onClick:s,className:"le-joinbow-btn-mobile js-popup-other-submit"},n)),l.createElement(Y,{containerClassName:"close-button-top-right",onClose:r})))):null,l.createElement("aside",{className:"le-only-mobile"},l.createElement("div",{className:"le-skin-mobile"},l.createElement("div",{style:{position:"relative"}},l.createElement("img",{src:i,style:{width:"100%"}}),l.createElement("a",{style:{position:"absolute",top:"82%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",maxWidth:"calc(100% - 15px)"},href:a,target:o?"blank":"_parent"},l.createElement("button",{onClick:s,className:"le-joinbow-btn-mobile js-popup-other-submit"},n)),l.createElement(Y,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:r})))))},we=function(e){var t=e.popupId,a=e.url,n=e.newTab,o=e.image,r=e.onClose,i=e.onOtherSubmit;return l.createElement("div",{id:t,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"tab"},l.createElement("div",{className:"le-tab-popup"},l.createElement("div",{style:{position:"relative"}},l.createElement("a",{href:a,target:n?"blank":"_parent",onClick:i},l.createElement("img",{className:"js-popup-other-submit",src:o})),l.createElement(Y,{onClose:r,containerClassName:"close-button-top-right"}))))};var Ne=function(e){for(var t=n([],e,!0),a=t.length-1;a>0;a--){var o=Math.floor(Math.random()*(a+1)),l=t[a];t[a]=t[o],t[o]=l}return t};function Ce(e){var t=e.leadApi,a=e.leadSiteId,l=e.leadDomain,r=e.onShowPopup,i=e.DEBUG_URL||("https://"+location.hostname+location.pathname+location.search).toLowerCase();fetch(t+"api/campaign/"+a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:i,ga_client_id:v("_ga")||null})}).then((function(e){return e.json()})).then((function(e){var t,a,c,d,s;if(Se("List campagin: ",e),H="https://"+location.hostname+location.pathname+location.search,1==e._status){var u=(null===(a=null===(t=e._data)||void 0===t?void 0:t.campaigns)||void 0===a?void 0:a.filter((function(e){return 1===e.formatted_status})))||[];v("hhg-id")||(g("hhg-id",y(),{domain:"."+l,path:"/"}),Se("😍 Set HHG ID cookie"));var m=[];m=/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)?u.filter((function(e){return e.device_types.some((function(e){return e.id==D.MOBILE}))})):u.filter((function(e){return e.device_types.some((function(e){return e.id==D.DESKTOP}))})),Se("👓 campaignsDevice",m);var p=m.map((function(e,t){return e.targets.filter((function(e){return e.type==A.LINKS})).map((function(e){return o(o({},e),{campaignIndex:t})}))})).flat(1);p=p.filter((function(e){var t=new URL(String(e.target).toLowerCase());return"exact_match"==e.option?Boolean(i===t.href):"start_with"==e.option?!!i.includes(String(e.target))&&!e.sub_target.filter((function(e){return"excluding"==e.option})).map((function(e){return e.value})).includes(i):void 0}));var h=Array.from(document.getElementsByTagName("META")).filter((function(e){return"article:tag"==e.getAttribute("property")})).map((function(e){return e.content})),f=[];h&&h.length&&(f=m.map((function(e,t){return e.targets.filter((function(e){return e.type==A.TAGS})).map((function(e){return o(o({},e),{campaignIndex:t})}))})).flat(1).filter((function(e){return h.includes(e.target)})));var b=n(n([],p,!0),f,!0),k=document.cookie.split("; ").map((function(e){return e.split("=")[0]})),_=k.filter((function(e){return e.includes("lead_submited")}));Se("--listCampaignCodeSubmited",_);var E=k.filter((function(e){return e.includes("lead_closed")}));Se("--listCampaignCodeClosed",E);var w=n(n([],_,!0),E,!0),N=b.filter((function(e){return!w.some((function(t){return t.includes(m[e.campaignIndex].code)}))})),C=Ne(N);if(Se("--listCampaignValid : ",C),C&&C.length){var S=m[C[0].campaignIndex];Se("CAMPAIGN_SHOW",S);var x=S.rules,T=Number(null===(c=x.find((function(e){return"time"==e.rule})))||void 0===c?void 0:c.value);Se("timeoutRule",T);var P=Number(null===(d=x.find((function(e){return"scroll"==e.rule})))||void 0===d?void 0:d.value);Se("scrollRule",P);var B=Number(null===(s=x.find((function(e){return"exclude_sponsored"==e.rule})))||void 0===s?void 0:s.value);Se("excludeSponsored",B);var O=Boolean(document.querySelector(".hhg-disclaimer-text"));if(Se("💎 LEAD current page isSponsored",O),O&&B)return;var j="TIME";if(Number.isInteger(T)&&(j="TIME",Se("✨ SHOW AWESOME POPUP AFTER: ",T," seconds"),setTimeout((function(){null==r||r(S,j)}),1e3*T)),Number.isInteger(P)){j="SCROLL",Se("✨ SHOW AWESOME AFTER: SCROLL",P," %");var L=document.querySelector('[data-url="'.concat(location.pathname,'"]'))||document.querySelector("body"),I=L.getBoundingClientRect().top,U=L.offsetHeight;Se("👓 Element check scroll: ",L);var M=function(){var e=window.pageYOffset||document.documentElement.scrollTop,t=0;e>=I&&(t=Math.round((e-I)/(U-innerHeight)*100)),Se("---Scroll",t,P),t>=P&&(window.removeEventListener("scroll",M),null==r||r(S,j))};window.addEventListener("scroll",M,{passive:!0})}}else Se("🚧 No lead campaigns on current URL, tags")}})).catch((function(e){Se("Lead error: ",e)}))}var Se=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];("production"!==process.env.NODE_ENV||process.env.NEXT_PUBLIC_DEPLOY_ENV&&"production"!==process.env.NEXT_PUBLIC_DEPLOY_ENV||"undefined"!=typeof localStorage&&"true"===localStorage.getItem("hhg_debug"))&&console.log.apply(console,e)};var xe=function(e){var t,a,n=e.campaign,o=e.action,r=e.onSubmit,i=e.onClose,d=e.showThankyou,m=e.locale;k().t;var p=u(J),h=p.apiUrl,f=p.siteDomain;s((function(){var e=v("_ga")||null;fetch("".concat(h,"api/campaign/").concat(w,"/impression"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:o,url:location.href.toLowerCase(),title_article:document.title,cookie_id:v("hhg-id"),ga_client_id:e})})}),[]);var b=n.extra_fields,_=n.image,E=n.image_desktop,w=n.code,N=n.image_background,C=n.image_overlay_mobile,S=n.image_overlay_desktop,x=b.currentLayout,T=b.imageBlocks?JSON.parse(b.imageBlocks):{},P=JSON.parse(b.actionBlocks),B=JSON.parse(b.textBlocks),O=(null===(a=null===(t=null==B?void 0:B.titleBlock)||void 0===t?void 0:t.data)||void 0===a?void 0:a.value)||"",j={1:{},2:{},3:{}},L=c("lead-modal-"+y()),I=function(e){if(void 0===e&&(e="Xin chao {{category_2}} extra"),e.includes("{{category_")){var t="{{category_".length,a=e.search("{{category_");return+e.charAt(t+a)}return null}(O);if(I){Se("⚡️ Has categoryLevel",I);var A=Array.from(document.getElementsByTagName("META")),U=A.find((function(e){return e.name==="content_category_".concat(I)})),D=A.find((function(e){return e.name==="content_category_en_".concat(I)}));if(!U||!D)return Se("⚡️ No META TAG for categoryLevel, not show popup",I),null;j[I]={value:U.content,value_en:D.content},O=O.replace("{{category_".concat(I,"}}"),U.content),Se("⚡️ Set categoryData ",I)}else Se("⚡️ No categoryLevel",I);var M=function(){var e,t,a,o;if(Se("👌 Other submit click"),document.body.classList.remove("noscroll"),x.includes("Skin")){var l=document.querySelector("#masthead");l&&(l.style.top="0px !important;")}var r=Number(null!==(t=null===(e=n.rules.find((function(e){return"days_to_show_again"==e.rule})))||void 0===e?void 0:e.value)&&void 0!==t?t:7),c=Number(null!==(o=null===(a=n.rules.find((function(e){return"show_again_after_submit"==e.rule})))||void 0===a?void 0:a.value)&&void 0!==o?o:0);0===c&&(Se("⛔ Popup never show again!"),g("lead_submited_".concat(w),"target_".concat(b.popupVersion),{domain:"."+f,path:"/"})),1==c&&(Se("⌛ Popup will show again after ".concat(r," days!")),g("lead_submited_".concat(w),"target_".concat(b.popupVersion),{domain:"."+f,days:r,path:"/"}));var d=v("_ga")||null,s={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:v("hhg-id"),ga_client_id:d};I&&(s.category=j[I].value_en),fetch("".concat(h,"api/campaign/").concat(w,"/lead"),{method:"POST",body:JSON.stringify(s),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((function(e){return e.json()})).then((function(e){"error"===e.status&&Se(e)})).catch((function(e){Se("Error:",e)})),null==i||i()};return"CenterTab"===x?l.createElement(G,{popupId:L.current,url:T.imageMobile.data.url,newTab:T.imageMobile.data.newtab,imageMobile:_,imageDestkop:E,onClose:i,onOtherSubmit:M}):"Tab"===x?l.createElement(we,{popupId:L.current,url:T.imageMobile.data.url,newTab:T.imageMobile.data.newtab,image:_,onClose:i,onOtherSubmit:M}):"Floating"===x?l.createElement(K,{popupId:L.current,title:O,titleAlign:B.titleBlock.data.align,subtitle:B.subtitleBlock.data.value,subtitleAlign:B.subtitleBlock.data.align,url:P.linkButtonBlock.data.url,urlText:P.linkButtonBlock.data.value,newTab:P.linkButtonBlock.data.newtab,imageMobile:_,imageDesktop:E,onClose:i,onOtherSubmit:M}):x.includes("LightBox")||x.includes("Inline")||"Fullscreen"==x||"Sidebar"==x||"Slider"==x?l.createElement(_e,{popupId:L.current,extraFields:b,onClose:i,onOtherSubmit:M,imageMobile:_,imageDesktop:E,imageBackground:N,currentLayout:x,title:O,onSubmit:function(e,t){return r(e,t,I,j)},key:x,imageOverlayDesktop:S,imageOverlayMobile:C,showThankyou:d,campaignId:n.id,campaign_subot_id:n.bot_id||[],locale:m}):x.includes("Skin")?l.createElement(Ee,{popupId:L.current,link:P.linkButtonBlock.data.url,linkNewTab:!!P.linkButtonBlock.data.newtab,linkText:P.linkButtonBlock.data.value,onClose:i,onOtherSubmit:M,imageMobile:_,imageDesktop:E,currentLayout:x}):null},Te=function(e){var n,o=e.apiUrl,r=e.siteDomain,u=e.siteId,f=e.locale,y=e.apiSubotUrl,k=e.DEBUG_URL,_=c(),E=c(Date.now()),w=i((function(){var e=o;return e.includes("localhost")&&(e="https://dev.leadgen.hellobacsi.com/"),{apiUrl:e}}),[o,r,u]).apiUrl,N=d(null),C=N[0],S=N[1],x=d(""),T=x[0],P=x[1],B=d(null),O=B[0],j=B[1];s((function(){X.apiLeadUrl=w,X.apiSubotUrl=y}),[w,y]);var L=function(e,t){S(e),P(t)},I=function(){var e,t;if(C){Se("👋👋👋 CLOSE POPUP ".concat(C.code," 👋👋👋"));var a=Number(null===(e=C.rules.find((function(e){return"show_again_after_exit"==e.rule})))||void 0===e?void 0:e.value),n=Number(null===(t=C.rules.find((function(e){return"days_to_show_again"==e.rule})))||void 0===t?void 0:t.value);0==a&&g("lead_closed_".concat(C.code),"target_".concat(C.extra_fields.popupVersion),n?{domain:"."+r,days:n,path:"/"}:{domain:"."+r,path:"/"}),document.body.classList.remove("noscroll"),fetch("".concat(w,"api/campaign/").concat(C.code,"/popup_exit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"CLICK",url:location.href.toLowerCase(),title_article:document.title,cookie_id:v("hhg-id"),duration:Math.ceil((Date.now()-E.current)/1e3)})}),S(null),j(null)}};s((function(){if(window.next){var e=m((function(e){Se("--🌻 routeChangeComplete",e,Date.now());var t=location.pathname;I(),document.querySelectorAll('[data-popup-url="'.concat(t,'"]')).length||Ce({leadApi:w,leadDomain:r,leadSiteId:u,onShowPopup:L,DEBUG_URL:k}),_.current&&window.removeEventListener("scroll",_.current)}),500);window.next.router.events.on("routeChangeComplete",e)}Ce({leadApi:w,leadDomain:r,leadSiteId:u,onShowPopup:L,DEBUG_URL:k})}),[]);return s((function(){C&&(E.current=Date.now())}),[C]),l.createElement(J.Provider,{value:{apiUrl:w,siteDomain:r,siteId:u,locale:f}},l.createElement(h.Provider,{value:{locale:f,values:z(f)}},p(l.createElement(l.Fragment,null,"2.1"===(null===(n=null==C?void 0:C.extra_fields)||void 0===n?void 0:n.popupVersion)&&l.createElement(xe,{campaign:C,action:T,onSubmit:function(e,n,o,l){return t(void 0,void 0,void 0,(function(){var t,i,c,d,s,u,m,p,h,f,b,y,k,_,E,N,S,x,T,P,B,O,L,A,U,D,M,H,R,V,q,F;return a(this,(function(a){switch(a.label){case 0:return n?(Se("submitHandler",o,l),t=Object.keys(n).map((function(e){return{name:e,value:String(n[e])}})),i=2,c=v("_ga")||null,window.intlTelInputUtils?[3,2]:[4,require("intl-tel-input/build/js/utils")]):[2];case 1:a.sent(),a.label=2;case 2:return d={url:location.href.toLowerCase(),title_article:document.title,meta:t.map((function(t){var a,n,o=(null===(a=e.querySelector('*[name="'.concat(t.name,'"]')))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(n=e.querySelector('*[data-extra][data-name="'.concat(t.name,'"]')))||void 0===n?void 0:n.getAttribute("data-control"))||"text",l="tel"===o?window.intlTelInputUtils.formatNumber(String(t.value),null==W?void 0:W.countryCodeNumber,i).replace(/\s+/g,""):t.value;return{key:t.name,value:l,control:o,is_sent_mailchimp:e.querySelector('div[data-name="'.concat(t.name,'-mailchimp"]'))?"true":"false"}})),cookie_id:v("hhg-id"),ga_client_id:c},o&&l[o].value_en&&(d.category=l[o].value_en),s=Number((null===(L=null===(O=C.rules)||void 0===O?void 0:O.find((function(e){return"days_to_show_again"===e.rule})))||void 0===L?void 0:L.value)||7),0==(u=Number((null===(U=null===(A=C.rules)||void 0===A?void 0:A.find((function(e){return"show_again_after_submit"===e.rule})))||void 0===U?void 0:U.value)||0))&&(Se("⛔ Popup never show again!"),g("lead_submited_".concat(C.code),"target_".concat(C.extra_fields.targetType),{domain:"."+r,path:"/"})),1==u&&(Se("⌛ Popup will show again after ".concat(s," days!")),g("lead_submited_".concat(C.code),"target_".concat(C.extra_fields.targetType),{domain:"."+r,days:s,path:"/"})),fetch("".concat(w,"api/campaign/").concat(C.code,"/lead"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}),"notshow"==C.extra_fields.popupShowThankYou?(I(),document.body.classList.remove("noscroll"),[2]):(m=!0,p=C.thank_you_image||"".concat(w,"admin/img/thanksyou.png"),h=C.extra_fields.popupThankyouTitle||"Thank you.",f=C.extra_fields.popupThankyouDesc||"We appreciate your time!",b="",y="",E="","2.1"==C.extra_fields.popupVersion&&(N=C.extra_fields,S=JSON.parse(N.listBlockThankyou),x=S.find((function(e){return"TitleBlock"==e.name})),T=S.find((function(e){return"SubtitleBlock"==e.name})),P=S.find((function(e){return"LinkButtonBlock"==e.name})),h=(null===(D=null==x?void 0:x.data)||void 0===D?void 0:D.value)||"",b=(null===(M=null==x?void 0:x.data)||void 0===M?void 0:M.align)||"",f=(null===(H=null==T?void 0:T.data)||void 0===H?void 0:H.value)||"",y=(null===(R=null==T?void 0:T.data)||void 0===R?void 0:R.align)||"",k=(null===(V=null==P?void 0:P.data)||void 0===V?void 0:V.value)||"",_=(null===(q=null==P?void 0:P.data)||void 0===q?void 0:q.newtab)||!1,E=(null===(F=null==P?void 0:P.data)||void 0===F?void 0:F.url)||"",B=C.extra_fields.currentLayout,["SkinA","SkinB","Floating","Tab","CenterTab"].includes(B)&&(m=!1)),j(m?{title:h,titleAlign:b,subtitle:f,subtitleAlign:y,link:E,linkNewTab:_,linkText:k,image:p}:null),sessionStorage.getItem("insider_object")?window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")):window.insider_object={user:{email:"",phone_number:"",gdpr_optin:!0,sms_optin:!0,email_optin:!0}},t.map((function(e){var t=e.name,a=e.value;"tel"==t?window.insider_object.user.phone_number=a:"email"==t&&(window.insider_object.user.email=a)})),sessionStorage.setItem("insider_object",JSON.stringify(window.insider_object)),[2])}}))}))},onClose:I,showThankyou:O,locale:f})),b())))};export{Te as LeadGen};
1
+ import{b as e,c as t,d as a,a as n,_ as o}from"./tslib.es6-2f067bc0.js";import l,{createContext as r,useMemo as i,useRef as c,useState as d,useEffect as s,useContext as u}from"react";import m from"lodash/debounce";import{createPortal as p}from"react-dom";import{T as v}from"./translationsContext-3f8c93da.js";import{g as h,s as g}from"./cookieHelper-a14e48bf.js";import{b as f,a as b}from"./utils-f2ffc856.js";import{v1 as y}from"uuid";import{u as k}from"./useTranslations-4b3edceb.js";import{H as _}from"./index.styled-0220d09e.js";import{B as E}from"./index-8d3013e7.js";import{CommonGAssets as w}from"./gAssets.js";import"./index.styled-75b31c01.js";import"./index-0493bb30.js";import"@mantine/core";import"./index.styled-e06c12aa.js";import"string-format";import"./index-955162e1.js";import"./index.styled-5338f8f0.js";import"date-fns";import"react-day-picker/DayPickerInput";import"./index.styled-a97d34db.js";import"./index-490d005e.js";import"lodash/throttle";import"keen-slider/react";import"./index-e806a100.js";import"dayjs";import"./types-74ddb058.js";import"./screenSizeContext-561add4e.js";import"styled-components";import"./isProduction-c75ce7d7.js";import"./Locale-2652d4a4.js";import"react-hook-form";import{I as N,N as C}from"./index-dd65e217.js";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-639548a5.js";import"@mantine/dates";import{R as S,l as x,D as T,e as P}from"./index-01c6ad78.js";import{S as B}from"./index-eba2534d.js";import{M as O}from"./index-d2caea48.js";import{createFormContext as j}from"@mantine/form";import"@mantine/hooks";import"./index-b2d5879e.js";import"yup";import{T as L}from"./index-d1e3c8d5.js";import{t as I}from"./theme-9e29b135.js";import"./defaultClassWrapper-68ab9212.js";import"./index-4e2aa837.js";import"./index-46ccbe17.js";import"@hookform/resolvers/yup";import"./index-88c3ffb5.js";import"slugify";import"./routing-e38c3e50.js";import"dayjs/plugin/relativeTime";import"./useScrollbarSize-e261817f.js";import"@mantine/carousel";import"./Visible-1f2b5764.js";var A={LINKS:1,TAGS:2},U="https://dev.leadgen.hellobacsi.com/",D={MOBILE:1,DESKTOP:2},M="";U.includes("localhost")&&(U="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(M="pink");var H="https://"+location.hostname+location.pathname+location.search;H=H.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));var R={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},F=R[document.documentElement.lang]||R["vi-VN"];var V,W={"validator.required":"This field is required.","validator.remote":"Please fix this field.","validator.email":"Please enter a valid email address.","validator.phone":"Please input correct phone number.","validator.url":"Please enter a valid URL.","validator.date":"Please enter a valid date.","validator.dateISO":"Please enter a valid date (ISO).","validator.number":"Please enter a valid number.","validator.digits":"Please enter only digits.","validator.creditcard":"Please enter a valid credit card number.","validator.equalTo":"Please enter the same value again.","validator.accept":"Please enter a value with a valid extension.","validator.maxlength":"jQuery.validator.format('Please enter no more than {0} characters.","validator.minlength":"jQuery.validator.format('Please enter at least {0} characters.","validator.rangelength":"jQuery.validator.format('Please enter a value between {0} and {1} characters long.","validator.range":"jQuery.validator.format('Please enter a value between {0} and {1}.","validator.max":"jQuery.validator.format('Please enter a value less than or equal to {0}.","validator.min":"jQuery.validator.format('Please enter a value greater than or equal to {0}.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},q={"en-PH":W,"vi-VN":{"validator.required":"Vui lòng điền mục này","validator.email":"Vui lòng điền email có thật.","validator.number":"Vui lòng điền số có thật","validator.digits":"Vui lòng chỉ điền số","validator.maxlength":"Vui lòng điền dưới {0} số","validator.minlength":"Vui lòng điền hơn {0} số","validator.remote":"Hãy sửa cho đúng.","validator.url":"Hãy nhập URL.","validator.date":"Hãy nhập ngày.","validator.dateISO":"Hãy nhập ngày (ISO).","validator.creditcard":"Hãy nhập số thẻ tín dụng.","validator.equalTo":"Hãy nhập thêm lần nữa.","validator.extension":"Phần mở rộng không đúng.","validator.rangelength":"Hãy nhập từ {0} đến {1} kí tự.","validator.range":"Hãy nhập từ {0} đến {1}.","validator.max":"Hãy nhập từ {0} trở xuống.","validator.min":"Hãy nhập từ {0} trở lên.","validator.phone":"Nhập đúng định dạng số điện thoại","validator.emailUsed":"Email này đã được sử dụng cho chiến dịch.","validator.phoneUsed":"Số điện thoại này đã được sử dụng cho chiến dịch.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"hi-IN":{"validator.required":"इस क्षेत्र की आवश्यकता है।","validator.email":"कृपया एक मान्य ईमेल पता दर्ज करें","validator.number":"कृपया एक वैध संख्या दर्ज करें","validator.digits":"कृपया केवल अंक दर्ज करें","validator.maxlength":"कृपया {0} अक्षर से अधिक दर्ज न करें","validator.minlength":"कृपया कम से कम {0} अक्षर दर्ज करें","validator.phone":"कृपया एक वैध संख्या दर्ज करें","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"id-ID":{"validator.required":"Kolom ini wajib diisi","validator.email":"Tolong daftarkan email yang valid","validator.number":"Tolong daftarkan nomor telepon yang valid","validator.digits":"Tolong masukkan angka saja","validator.maxlength":"Jangan memasukkan lebih dari {0} karakter","validator.minlength":"Tolong ketik sedikitnya {0} karakter","validator.phone":"Tolong daftarkan nomor telepon yang valid","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"ms-MY":{"validator.required":"Bahagian ini wajib diisi.","validator.email":"Sila masukkan alamat emel yang sah.","validator.number":"Sila masukkan no telefon yang sah.","validator.digits":"Sila masukkan nombor digit sahaja.","validator.maxlength":"Sila masukkan tidak lebih dari {0} aksara","validator.minlength":"Sila masukkan sekurang-kurangnya {0} aksara","validator.phone":"Sila masukkan no telefon yang sah.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"my-MM":{"validator.required":"ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်","validator.email":"မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ","validator.number":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.digits":"နံပါတ်များသာဖြည့်ပါ","validator.maxlength":"ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ","validator.minlength":"ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ","validator.phone":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"km-KH":{"validator.required":"ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ","validator.email":"សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.number":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.digits":"វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ","validator.maxlength":"សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ","validator.minlength":"សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស","validator.phone":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"zh-TW":{"validator.required":"此為必填欄位","validator.email":"請填入有效的 email 地址","validator.number":"請填入有效的電話號碼","validator.digits":"此欄位僅能輸入數字","validator.maxlength":"請輸入少於 {0} 位數","validator.minlength":"請輸入至少 {0} 位數","validator.phone":"請填入有效的電話號碼","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"th-TH":{"validator.required":"ต้องระบุข้อมูลในช่องนี้","validator.email":"กรุณาใส่อีเมล์ที่ถูกต้อง","validator.number":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.digits":"กรุณาส่เฉพาะตัวเลข","validator.maxlength":"กรุณาใส่ตัวเลขมากกว่า {0} หลัก","validator.minlength":"กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก","validator.phone":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"tl-PH":W},z=function(e){var t=q[e];return t||q["en-PH"]},J=r({}),Y=function(e){var t=e.onClose,a=e.containerClassName,n=e.svgClassName;return l.createElement("button",{onClick:t,className:"le-newbuilder-close-button js-modal__close ".concat(a||"")},l.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n},l.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"white"}),l.createElement("path",{d:"M16 17.05L10.925 22.125C10.7917 22.2584 10.621 22.329 10.413 22.337C10.2044 22.3457 10.025 22.275 9.87502 22.125C9.72502 21.975 9.65002 21.8 9.65002 21.6C9.65002 21.4 9.72502 21.225 9.87502 21.075L14.95 16L9.87502 10.925C9.74169 10.7917 9.67102 10.6207 9.66302 10.412C9.65436 10.204 9.72502 10.025 9.87502 9.87502C10.025 9.72502 10.2 9.65002 10.4 9.65002C10.6 9.65002 10.775 9.72502 10.925 9.87502L16 14.95L21.075 9.87502C21.2084 9.74169 21.3794 9.67069 21.588 9.66202C21.796 9.65402 21.975 9.72502 22.125 9.87502C22.275 10.025 22.35 10.2 22.35 10.4C22.35 10.6 22.275 10.775 22.125 10.925L17.05 16L22.125 21.075C22.2584 21.2084 22.329 21.379 22.337 21.587C22.3457 21.7957 22.275 21.975 22.125 22.125C21.975 22.275 21.8 22.35 21.6 22.35C21.4 22.35 21.225 22.275 21.075 22.125L16 17.05Z",fill:"#595959"})))},G=function(e){var t=e.popupId,a=e.url,n=e.newTab,o=e.imageDestkop,r=e.imageMobile,i=e.onClose,c=e.onOtherSubmit;return l.createElement("div",{id:t,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"center_tab"},l.createElement("div",{className:"le-center-tab-popup"},l.createElement("div",{style:{position:"relative"}},l.createElement("a",{className:"js-popup-other-submit",href:a,target:n?"blank":"_parent",onClick:c},l.createElement("img",{className:"le-only-mobile",src:r}),l.createElement("img",{className:"le-only-desktop",src:o})),l.createElement(Y,{onClose:i,containerClassName:"close-button-top-right"}))))},K=function(e){var t=e.popupId,a=e.url,n=e.title,o=e.urlText,r=e.titleAlign,i=e.subtitle,c=e.subtitleAlign,d=e.newTab,s=e.imageDesktop,u=e.imageMobile,m=e.onClose,p=e.onOtherSubmit;return l.createElement("div",{id:t,className:"lead-modal-wrapper lead-floating-wrapper","data-popup-url":location.pathname,"data-popup-type":"floating"},l.createElement("aside",{className:"le-only-desktop"},l.createElement("div",{className:"le-floating-desktop"},l.createElement("div",{className:"le-floating-desktop-wrap",style:{position:"relative",background:"#fff"}},s?l.createElement("div",null,l.createElement("img",{style:{maxWidth:120,borderTopLeftRadius:5,borderBottomLeftRadius:5},src:s})):null,l.createElement("div",{style:{padding:20}},l.createElement("div",{className:"le-floating-desktop-title le-text-align-".concat(r)},n),l.createElement("div",{className:"le-floating-desktop-desc le-text-align-".concat(c)},i)),l.createElement("a",{target:d?"blank":"_parent",style:{marginLeft:35,textDecoration:"none"},href:a},l.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:p},o)),l.createElement(Y,{onClose:m,containerClassName:"close-button-top-right"})))),l.createElement("aside",{className:"le-only-mobile"},l.createElement("div",{className:"le-floating-mobile"},l.createElement("div",{className:"le-floating-mobile-wrap",style:{position:"relative",background:"#fff"}},l.createElement("aside",{style:{display:"flex",justifyContent:"space-between"}},l.createElement("div",null,l.createElement("div",{className:"le-floating-mobile-title le-text-align-".concat(r)},n),l.createElement("div",{className:"le-floating-mobile-desc le-text-align-".concat(c)},i)),u?l.createElement("div",null,l.createElement("img",{style:{marginLeft:15,marginTop:4,maxWidth:100},src:u})):null),l.createElement("div",{style:{textAlign:"center",marginTop:10}},l.createElement("a",{target:d?"blank":"_parent",href:a,style:{textDecoration:"none"}},l.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:p},o))),l.createElement(Y,{onClose:m,containerClassName:"close-button-top-right"})))))},Q=function(e){var t=e.title,a=e.titleAlign,n=e.subtitle,o=e.subtitleAlign,r=e.link,i=e.linkNewTab,c=e.linkText,d=e.image;return l.createElement("div",{className:"lead-modal__thank-you"},l.createElement("div",{style:{width:"100%"}},l.createElement("img",{src:d,style:{maxHeight:162,objectFit:"cover"}}),t&&l.createElement("h1",{className:"le-thankyou-title le-text-align-".concat(a)},t),n&&l.createElement("p",{className:"le-thankyou-subtitle le-text-align-".concat(o)},n),c&&l.createElement("div",null,l.createElement("a",{href:r,target:i?"_blank":"parrent",rel:"noreferrer"},l.createElement("button",{className:"lead-modal__btn ".concat(M)},c)))))},X=new function(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"},Z=function(t){var a=t.url,n=t.data,o=void 0===n?void 0:n,l=e(t,["url","data"]);return l.body=JSON.stringify(o),l.headers={"Content-Type":"application/json"},fetch("".concat(X.apiLeadUrl).concat(a),l).then((function(e){return e.json()})).catch((function(e){return{}}))},$=function(t){var a=t.url,n=t.data,o=e(t,["url","data"]);return o.body=JSON.stringify(n),o.headers={"Content-Type":"application/json"},fetch("".concat(X.apiSubotUrl).concat(a),o).then((function(e){return e.json()})).catch((function(e){return{}}))},ee=function(e){var t=e.bot_id,a=e.email,n=e.phone;return n&&n.startsWith("0")&&(n=n.substring(1)),$({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:t,email:a,phone:n}})},te=function(e){var t=e.campaign_id,a=e.email,n=e.phone;return n&&n.startsWith("0")&&(n=n.substring(1)),Z({url:"api/subot-campaign/check",method:"post",data:{campaign_id:t,email:a,phone:n}})},ae=function(e){var t=e.phone;return Z({url:"api/sms/otp",method:"post",data:{phone_number:t.replace("+","")}})},ne=function(e){var t=e.phone,a=e.otp;return Z({url:"api/sms/verify",method:"post",data:{otp_code:a,phone_number:t.replace("+","")}})},oe=function(e,n,o){return t(void 0,void 0,void 0,(function(){var t,l,r,i,c,d;return a(this,(function(a){switch(a.label){case 0:return t="email"in o?"email":"phone",l="email"in o?o.email:o.phone,r="email"in o?"validator.emailUsed":"validator.phoneUsed",[4,te((c={campaign_id:[e]},c[t]=l,c))];case 1:return"SubmitLeadWithBotId_ERR_001"===(i=a.sent())._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode?[2,r]:n.length?[4,ee((d={bot_id:n},d[t]=l,d))]:[3,3];case 2:if("CheckSuBotLeadTool_ERR_001"===a.sent()._errorCode)return[2,r];a.label=3;case 3:return[2]}}))}))},le={email:{},phone:{}},re=function(e,n,o){return t(void 0,void 0,void 0,(function(){var t,l,r,i;return a(this,(function(a){switch(a.label){case 0:if(t="email"in o?"email":"phone",l="email"in o?o.email:o.phone,r="email"in o?"validator.emailUsed":"validator.phoneUsed",le[t][l]){if(le[t][l].value)return[2,r];if(!le[t][l].value&&le[t][l].expire>Date.now())return[2,""]}return[4,oe(e,n,o)];case 1:return i=a.sent(),le[t][l]=i?{value:!0}:{value:!1,expire:Date.now()+6e4},[2,i]}}))}))},ie=function(e){var t=e.content,a=e.inlinePosition,o=i((function(){if(!a)return null;var e=document.querySelectorAll('[data-url="'.concat(location.pathname,'"] .body-content')),t=Array.from(e).reduce((function(e,t){return n(n([],e,!0),Array.from(t.children),!0)}),[]);if(null==t?void 0:t.length){var o=t.filter((function(e){return"P"===e.nodeName})),l=t.filter((function(e){return"H2"===e.nodeName})),r=null;switch(a){case"1th":r=o[0];break;case"2th":r=o[1];break;case"3th":r=o[2];break;case"4th":r=o[3];break;case"5th":r=o[4];break;case"6th":r=o[5];break;case"7th":r=o[6];break;case"8th":r=o[7];break;case"9th":r=o[8];break;case"10th":r=o[9];break;case"11th":r=o[10];break;case"12th":r=o[11];break;case"lastP":r=o[o.length-1];break;case"1thH2":r=l[0];break;case"2thH2":r=l[1];break;case"3thH2":r=l[2];break;case"4thH2":r=l[3];break;case"5thH2":r=l[4];break;case"6thH2":r=l[5];break;case"7thH2":r=l[6];break;case"8thH2":r=l[7];break;case"9thH2":r=l[8];break;case"10thH2":r=l[9];break;case"lastH2":r=l[l.length-1]}if(r){if(r.parentElement.querySelector(".inline-lead-wrapper"))return r.parentElement.querySelector(".inline-lead-wrapper");var i=document.createElement("div");return i.classList.add("inline-lead-wrapper"),r.nextElementSibling?r.parentElement.insertBefore(i,r.nextElementSibling):r.parentElement.appendChild(i),i}}}),[a]);return a&&o?p(t,o):null},ce=function(e){var t=e.content,a=i((function(){var e=Array.from(document.querySelectorAll(".hc2-sidebar-with-ads,.page-main-col .right-col.f-right,.hhg-lead-sidebar"));return e.forEach((function(e){if(!e.querySelector(".sidebar-lead-modal-wrapper")){var t=document.createElement("div");t.classList.add("sidebar-lead-modal-wrapper"),e.prepend(t)}})),e.map((function(e){return e.querySelector(".sidebar-lead-modal-wrapper")}))}),[]);return l.createElement(l.Fragment,null,a.map((function(e){return p(t,f(e,"sidebar-lead-modal-wrapper"))})))},de=(V=j())[0],se=V[1],ue=V[2],me="undefined"==typeof window,pe={VN:"vi",ID:"id",TH:"th",MY:"ms",TW:"zh-TW",KH:"km",MM:"my",IN:"hi",PH:"en"},ve=function(e,n){return void 0===e&&(e=""),void 0===n&&(n=""),t(void 0,void 0,void 0,(function(){return a(this,(function(t){return[2,new Promise((function(t,a){if(!e)return a("Need valid text input");if(me)return a("Need valid window object");try{(new window.google.maps.places.AutocompleteService).getPlacePredictions({input:e,componentRestrictions:{country:n},language:pe[n]},t)}catch(e){a(e)}}))]}))}))},he=["places"],ge=function(e){var n=e.name,r=e.placeholder,u=se(),m=d(""),p=m[0],v=m[1],h=d(""),g=h[0],f=h[1],b=function(e,n,o){void 0===e&&(e=""),void 0===n&&(n=""),void 0===o&&(o=500);var l=d([]),r=l[0],i=l[1],c=d(!1),u=c[0],m=c[1];return s((function(){var l;return e?l=window.setTimeout((function(){return t(void 0,void 0,void 0,(function(){var t,o;return a(this,(function(a){switch(a.label){case 0:if(!e)return i([]),[2];a.label=1;case 1:return a.trys.push([1,3,4,5]),m(!0),[4,ve(e,n)];case 2:return t=a.sent(),i(!(l=t)||l.length<1?[]:l.map((function(e){return{placeId:e.place_id,description:e.description}}))),[3,5];case 3:return o=a.sent(),console.error(o),[3,5];case 4:return m(!1),[7];case 5:return[2]}var l}))}))}),o):r.length&&i([]),function(){window.clearTimeout(l)}}),[e,o,n]),{isLoading:u,predictions:r}}(p||"15 Lê","VN").predictions,y=d(null),k=y[0],_=y[1],E=d(!1),w=E[0],N=E[1],C=c(Math.random().toString(36).substring(7)),S=i((function(){var e=b.map((function(e){return{value:e.description,label:e.description}})),t=e.find((function(e){return e.value===g}));return!g||t?e:[{value:g,label:g}].concat(e)}),[b,g]);return s((function(){var e,t,a;(null===(a=null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===a?void 0:a.AutocompleteService)?N(!0):import("@react-google-maps/api").then((function(e){_((function(){return e.LoadScript})),setTimeout((function(){N(!0)}),200)}))}),[]),w?l.createElement(l.Fragment,null,k&&l.createElement(k,{googleMapsApiKey:"AIzaSyB9QmhfEYcy2wj5X3Fl38aCD5UkET6n82M",libraries:he,loadingElement:l.createElement(l.Fragment,null)}),l.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":n,"data-control":"text"}),l.createElement(B,o({className:"lead-modal__form-control",label:r,placeholder:r,withAsterisk:!0,name:n,data:S,searchValue:p,onSearchChange:function(e){v(e)},filter:function(){return!0},clearable:!0,searchable:!0,onChange:function(e){return f(e||"")},icon:l.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M9.99999 9.79167C10.4028 9.79167 10.7467 9.64944 11.0317 9.365C11.3161 9.08 11.4583 8.73611 11.4583 8.33333C11.4583 7.93056 11.3161 7.58667 11.0317 7.30167C10.7467 7.01722 10.4028 6.875 9.99999 6.875C9.59721 6.875 9.25332 7.01722 8.96832 7.30167C8.68388 7.58667 8.54166 7.93056 8.54166 8.33333C8.54166 8.73611 8.68388 9.08 8.96832 9.365C9.25332 9.64944 9.59721 9.79167 9.99999 9.79167ZM9.99999 17.875C9.90277 17.875 9.80555 17.8611 9.70832 17.8333C9.6111 17.8056 9.52082 17.7569 9.43749 17.6875C7.46527 15.8958 5.98971 14.2361 5.01082 12.7083C4.03138 11.1806 3.54166 9.77778 3.54166 8.5C3.54166 6.48611 4.1911 4.87833 5.48999 3.67667C6.78832 2.47556 8.29166 1.875 9.99999 1.875C11.7083 1.875 13.2119 2.47556 14.5108 3.67667C15.8092 4.87833 16.4583 6.48611 16.4583 8.5C16.4583 9.77778 15.9689 11.1806 14.99 12.7083C14.0105 14.2361 12.5347 15.8958 10.5625 17.6875C10.4792 17.7569 10.3889 17.8056 10.2917 17.8333C10.1944 17.8611 10.0972 17.875 9.99999 17.875Z",fill:"#8C8C8C"})),autoComplete:"no-auto-complete-"+C.current,rightSection:l.createElement(l.Fragment,null)},u.getInputProps(n)))):l.createElement("div",{style:{height:73}})},fe=function(e){var t=e.children,a=e.align;return l.createElement("p",{className:"lead-modal__description ".concat("le-text-align-"+(a||"")," ").concat(M)},t)},be=function(e){var t=e.children,a=e.align;return l.createElement("h2",{className:"lead-modal__title ".concat("le-text-align-"+(a||"")," ").concat(M)},t)},ye=function(e){var t=e.listBlockAdded,a=e.popupId,n=e.locale,r=e.onClose,i=e.onOtherSubmit,c=se();return l.createElement(l.Fragment,null,t.map((function(e,t){var d=e||{},s=d.name,u=void 0===s?"":s,m=d.data,p=void 0===m?{}:m,v=p.placeholder,h=p.value,g=p.align,f=p.listQuestion,b=p.isSendMailChimp,y=void 0!==b&&b,k=p.newtab,_=p.url;switch(u){case"TitleBlock":return l.createElement(be,{key:t,align:g},h);case"SubtitleBlock":return l.createElement(fe,{key:t,align:g},h);case"TextBlock":return l.createElement(N,o({key:t,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:v,className:"lead-modal__form-control",label:v,"data-control":"text",name:h},c.getInputProps(h)));case"NumberBlock":return l.createElement(C,o({key:t,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:v,className:"lead-modal__form-control",label:v,"data-control":"number",name:h},c.getInputProps(h)));case"EmailBlock":return l.createElement(N,o({key:t,withAsterisk:!0,spellCheck:!1,placeholder:v,className:"lead-modal__form-control",label:v,"data-control":"email",name:h},c.getInputProps(h)));case"PhoneOtpBlock":case"PhoneBlock":var w=a+"-"+h+"-"+t;return l.createElement(N.Wrapper,o({size:"md",withAsterisk:!0,key:t,label:v,className:"lead-modal__form-control",labelProps:{htmlFor:w}},c.getInputProps(h)),l.createElement(P,{name:h,spellCheck:!1,type:"tel",placeholder:v,onChange:function(e){c.setFieldValue(h,e)},id:w,defaultCountry:n&&O[n]||"VN","data-control":"tel"}));case"LocationBlock":return l.createElement(ge,{key:t,name:h,placeholder:v});case"DateBlock":return l.createElement(T,o({withAsterisk:!0,key:t,type:"date",name:h,placeholder:v,className:"lead-modal__form-control",label:v,"data-control":"date"},c.getInputProps(h)));case"LinkButtonBlock":return l.createElement("div",{key:t},l.createElement("a",{target:k?"blank":"parrent",href:_,style:{textDecoration:"none"}},l.createElement(E,{type:"button",size:"md",className:"lead-modal__btn ".concat(M),onClick:function(){null==r||r(),null==i||i()}},h)));case"CheckboxBlock":return l.createElement(l.Fragment,null,y&&l.createElement("div",{style:{display:"none"},"data-name":h+"-mailchimp"}),l.createElement(x.Group,o({withAsterisk:!0,className:"lead-modal__form-control",key:t,label:v,size:"md"},c.getInputProps(h)),f.map((function(e,t){return l.createElement(x,{name:h,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})}))));case"RadioBlock":return l.createElement(l.Fragment,null,y&&l.createElement(N,{type:"hidden",name:h+"-mailchimp",value:y}),l.createElement(S.Group,o({withAsterisk:!0,className:"lead-modal__form-control",key:t,label:v,size:"md"},c.getInputProps(h)),f.map((function(e,t){return l.createElement(S,{name:h,key:t,value:e.value,label:e.placeholder,"data-control":"radio"})}))));case"DropdownBlock":return l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":h,"data-control":"dropdown"}),l.createElement(B,o({key:t,className:"lead-modal__form-control",label:v,withAsterisk:!0,name:h,data:f.map((function(e){return{value:e.value,label:e.placeholder}}))},c.getInputProps(h))))}return null})))},ke=function(e){var n=e.phone,o=e.onSuccess,r=e.autoSendWhenOpen,i=k().t,u=d(""),m=u[0],p=u[1],v=d(!1),h=v[0],g=v[1],f=d(0),b=f[0],y=f[1],w=c(null),C=d(),S=C[0],x=C[1],T=d(""),P=T[0],B=T[1],O=c();s((function(){t(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(a){switch(a.label){case 0:return O.current?[3,2]:[4,import("react-phone-number-input")];case 1:e=a.sent(),O.current=e.formatPhoneNumberIntl,a.label=2;case 2:return B((null===(t=O.current)||void 0===t?void 0:t.call(O,n))||n),[2]}}))}))}),[n]);var j=function(){return t(void 0,void 0,void 0,(function(){var e,t,l;return a(this,(function(a){switch(a.label){case 0:return n?[4,ae({phone:n})]:[2];case 1:return e=a.sent(),"Send sms successfully"===(t=null===(l=null==e?void 0:e._messages)||void 0===l?void 0:l[0])?(y(60),setTimeout((function(){w.current&&(w.current.focus(),w.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===t?o():x(t||"something Wrong"),[2]}}))}))};return s((function(){setTimeout((function(){b>0&&y((function(e){return e-1}))}),1e3)}),[b]),s((function(){r&&!b&&j()}),[]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:function(e){e.preventDefault(),t(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(a){switch(a.label){case 0:return m?[4,ne({phone:n,otp:m})]:[2];case 1:return e=a.sent(),"Verify successfully"===(t=null==e?void 0:e._messages[0])||"This phone number was verified"===t?o():x(t||"something Wrong"),[2]}}))}))},className:"lead-phone-otp-form"},l.createElement(_,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},i("lead.otp.title")),l.createElement(L,{size:"p1",color:I.colors.gray600},i("lead.otp.desc",{phone:P})),l.createElement(N,{ref:w,name:"_"+name+"-otp",spellCheck:!1,type:"text",placeholder:"Enter OTP",className:"lead-modal__form-control",label:"Phone OTP","data-control":"otp",withAsterisk:!0,pattern:"[0-9]*",value:m,onChange:function(e){g(!0),p(e),x(h&&!e?"OTP is required":void 0)},error:h?S:void 0}),l.createElement(E,{size:"md",color:"primary",className:"lead-modal__btn ".concat(M),disabled:!m},i("lead.otp.verify")),l.createElement(E,{type:"button",size:"md",color:"transparent",className:"lead-modal__btn lead-phone-otp-button ".concat(M),onClick:function(){j()},disabled:!!b},i("lead.otp.resend",{timer:b?" (".concat(b,"s)"):""}))))},_e=function(e){var t,a,n,r=e.popupId,u=e.extraFields,m=e.onClose,p=e.onOtherSubmit,v=e.imageMobile,h=e.imageDesktop,g=e.imageOverlayMobile,f=e.imageOverlayDesktop,b=e.imageBackground,y=e.currentLayout,_=e.title,N=e.onSubmit,C=e.showThankyou,S=e.campaignId,x=e.campaign_subot_id,T=e.locale,P=JSON.parse(u.listBlockAdded),B=JSON.parse(u.actionBlocks),O=JSON.parse(u.textBlocks),j=B.submitBlock.data.url,L=B.submitBlock.data.text,I=B.submitBlock.data.text2,A=B.submitBlock.data.value,U=location.pathname,D=y.includes("Inline")||"Sidebar"===y,H="Slider"===y,R=d(!0),V=R[0],W=R[1],q=d(""),z=q[0],J=q[1],G=c(),K=function(){z?J(""):null==m||m()};if(window.innerWidth<769&&["Fullscreen","Slider"].includes(y))return console.log("😎 Not show fullscreen, slider on mobile "),null;s((function(){(y.includes("LightBox")||"Fullscreen"==y)&&document.body.classList.add("noscroll"),window.intlTelInputUtils||require("intl-tel-input/build/js/utils"),le.email={},le.phone={}}),[]);var X=c(!1),Z=c(!1),$=function(e){var t=e.listBlockAdded,a=void 0===t?[]:t,n=e.validatingPhoneRef,l=e.validatingEmailRef,r=e.campaignId,d=e.campaign_subot_id,s=void 0===d?[]:d,u=k().t,m=i((function(){var e=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","LocationBlock"],t=function(e,t){return function(a){if(v.current.isTouched(e))return void 0===a||""===a||Array.isArray(a)&&0===a.length?u("validator.required"):null==t?void 0:t(a)}};return a.filter((function(t){return e.includes(t.name)})).reduce((function(e,a){var i,c,d,m,p;return"NumberBlock"===a.name?o(o({},e),((i={})[a.data.value]=t(a.data.value,(function(e){if(isNaN(Number(e)))return u("validator.number")})),i)):"EmailBlock"===a.name?o(o({},e),((c={})[a.data.value]=t(a.data.value,(function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(l.current=!0,re(r,s,{email:e}).then((function(e){e?v.current.setFieldError(a.data.value,u(e)):v.current.clearFieldError(a.data.value),l.current=!1})).catch((function(e){console.error(e),v.current.setFieldError(a.data.value,e.message||"Something went wrong"),l.current=!1})),"Validating..."):u("validator.email")})),c)):"PhoneBlock"===a.name||"PhoneOtpBlock"===a.name?o(o({},e),((d={})[a.data.value]=t(a.data.value,(function(e){return window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),F.countryCode)?u("validator.phone"):(n.current=!0,re(r,s,{phone:e}).then((function(e){e?v.current.setFieldError(a.data.value,u(e)):v.current.clearFieldError(a.data.value),n.current=!1})).catch((function(e){console.error(e),v.current.setFieldError(a.data.value,e.message||"Something went wrong"),n.current=!1})),"Validating...")})),d)):"DateBlock"===a.name?o(o({},e),((m={})[a.data.value]=t(a.data.value,(function(e){if(isNaN(Date.parse(e)))return u("validator.date")})),m)):o(o({},e),((p={})[a.data.value]=t(a.data.value),p))}),{})}),[a.map((function(e){return e.name})).join(",")]),p=ue({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:m}),v=c(p);return v.current=p,{form:p,validateObj:m}}({listBlockAdded:P,validatingPhoneRef:X,validatingEmailRef:Z,campaignId:S,campaign_subot_id:x}),ee=$.form,te=$.validateObj,ae=l.createElement(l.Fragment,null,l.createElement("style",{dangerouslySetInnerHTML:{__html:".le-newbuilder-overlay {\n background: url(".concat(g,") ;\n background-repeat: no-repeat;\n background-size: cover;\n }\n @media screen and (min-width:768px) {\n .le-newbuilder-overlay {\n background: url(").concat(f,") ;\n background-repeat: no-repeat;\n background-size: cover;\n }\n }")}}),l.createElement("div",{id:r,"data-popup-url":U,"data-popup-type":"lightbox-inline",className:"lead-modal lead-modal-wrapper modal--animate-scale ".concat(D?"le-buider-inline":""," ").concat(H?"le-buider-slider":"")},"Fullscreen"==y?l.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:b||""}):null,l.createElement("div",{className:"lead-modal__wrapper le-newbuilder-wrap-".concat(y)},l.createElement("div",{className:"lead-modal__content le-newbuilder-".concat(y)},C?l.createElement(Q,{title:C.title,titleAlign:C.titleAlign,subtitle:C.subtitle,subtitleAlign:C.subtitleAlign,link:C.link,linkNewTab:C.linkNewTab,linkText:C.linkText,image:C.image}):l.createElement(l.Fragment,null,l.createElement("header",{className:"lead-modal__header"},z?l.createElement("img",{src:w.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%"}}):l.createElement(l.Fragment,null,["LightBoxA","InlineA","Sidebar","Slider"].includes(y)?v?l.createElement("img",{draggable:"false",className:"lead-modal__image lead-modal-image-cover",src:v,alt:""}):null:l.createElement(l.Fragment,null,h?l.createElement("img",{draggable:"false",className:"le-only-desktop lead-modal__image lead-modal-image-cover",style:{height:"100%",objectFit:"cover"},src:h,alt:""}):null,v?l.createElement("img",{draggable:"false",className:"le-only-mobile lead-modal__image lead-modal-image-cover",src:v,alt:""}):null))),z&&l.createElement(ke,{phone:z,autoSendWhenOpen:!0,onSuccess:function(){null==N||N(G.current,ee.values)}}),l.createElement("div",{"data-hidden":!!z,className:"lead-modal__body le-newbuilder-overlay"},l.createElement(de,{form:ee},l.createElement("form",{ref:G,className:"lead-modal__form ".concat(r),onSubmit:function(e){var t,a;if(e.preventDefault(),ee.setTouched(Object.keys(te).reduce((function(e,t){return e[t]=!0,e}),{})),!Z.current&&!X.current&&!Object.keys(ee.errors).length)if(P.findIndex((function(e){return"PhoneOtpBlock"===e.name}))>-1){var n=null===(a=null===(t=P.find((function(e){return"PhoneOtpBlock"===e.name})))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;J(ee.values[n])}else null==N||N(G.current,ee.values)}},l.createElement("div",{style:{marginBottom:20}},l.createElement("h2",{className:"lead-modal__title ".concat("le-text-align-"+(null===(t=O.titleBlock.data)||void 0===t?void 0:t.align)," ").concat(M)},_),l.createElement("p",{className:"lead-modal__description ".concat("le-text-align-"+(null===(a=O.titleBlock.data)||void 0===a?void 0:a.align)," ").concat(M)},O.subtitleBlock.data.value)),l.createElement("div",{className:"lead-modal__form-control-wrapper"},l.createElement(ye,{listBlockAdded:P,popupId:r,locale:T,onClose:K,onOtherSubmit:p})),(null===(n=null==B?void 0:B.submitBlock)||void 0===n?void 0:n.isHide)?null:l.createElement(l.Fragment,null,l.createElement("div",{className:"lead-modal__checkbox-wrapper ".concat(M)},l.createElement("div",{className:"lead-modal__checkbox"},l.createElement("input",{id:"lead-term-checkbox",className:"lead-modal__checkbox__input ".concat(M),type:"checkbox","aria-label":"Checkbox label",checked:V,onChange:function(e){return W(e.currentTarget.checked)}}),l.createElement("div",{className:"lead-modal__checkbox__control","aria-hidden":"true"})),l.createElement("label",{htmlFor:"checkbox",className:"lead-modal__checkbox__label"},L," ",l.createElement("span",{style:{fontWeight:"bold"}},l.createElement("a",{target:"blank",href:j||"https://hellobacsi.com/chinh-sach",rel:"noopener noreferrer",style:{textDecoration:"none"}},I)))),l.createElement(E,{size:"md",id:"lead-submit",type:"submit",className:"lead-modal__btn ".concat(M),disabled:!V},A))))))),!y.includes("Inline")&&l.createElement(Y,{onClose:K,containerClassName:"close-button-top-right"}))));return y.includes("LightBox")||"Fullscreen"==y||"Slider"==y?ae:"Sidebar"==y?l.createElement(ce,{content:ae}):y.includes("Inline")?l.createElement(ie,{content:ae,inlinePosition:u.popupInlinePosition}):null},Ee=function(e){var t=e.popupId,a=e.link,n=e.linkText,o=e.linkNewTab,r=e.onClose,i=e.imageMobile,c=e.imageDesktop,d=e.currentLayout,s=e.onOtherSubmit,u=location.pathname;return l.createElement("div",{id:t,className:"lead-modal-wrapper","data-popup-url":u,"data-popup-type":"skin_ab"},"SkinA"==d?l.createElement("aside",{className:"le-only-desktop"},l.createElement("div",{className:"le-skin-a-desktop"},l.createElement("div",{style:{position:"relative"}},l.createElement("img",{src:c}),l.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"calc(100% - 15px)"},href:a,target:o?"blank":"_parent"},l.createElement("button",{onClick:s,className:"le-joinbow-btn js-popup-other-submit"},n)),l.createElement(Y,{onClose:r,containerClassName:"close-button-top-right"})))):"SkinB"==d?l.createElement("aside",{className:"le-only-desktop"},l.createElement("div",{className:""},l.createElement("div",{style:{position:"relative",zIndex:1e4}},l.createElement("img",{src:c,style:{width:"100%"}}),l.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"100%"},href:a,target:o?"blank":"_parent"},l.createElement("button",{onClick:s,className:"le-joinbow-btn-mobile js-popup-other-submit"},n)),l.createElement(Y,{containerClassName:"close-button-top-right",onClose:r})))):null,l.createElement("aside",{className:"le-only-mobile"},l.createElement("div",{className:"le-skin-mobile"},l.createElement("div",{style:{position:"relative"}},l.createElement("img",{src:i,style:{width:"100%"}}),l.createElement("a",{style:{position:"absolute",top:"82%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",maxWidth:"calc(100% - 15px)"},href:a,target:o?"blank":"_parent"},l.createElement("button",{onClick:s,className:"le-joinbow-btn-mobile js-popup-other-submit"},n)),l.createElement(Y,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:r})))))},we=function(e){var t=e.popupId,a=e.url,n=e.newTab,o=e.image,r=e.onClose,i=e.onOtherSubmit;return l.createElement("div",{id:t,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"tab"},l.createElement("div",{className:"le-tab-popup"},l.createElement("div",{style:{position:"relative"}},l.createElement("a",{href:a,target:n?"blank":"_parent",onClick:i},l.createElement("img",{className:"js-popup-other-submit",src:o})),l.createElement(Y,{onClose:r,containerClassName:"close-button-top-right"}))))};var Ne=function(e){for(var t=n([],e,!0),a=t.length-1;a>0;a--){var o=Math.floor(Math.random()*(a+1)),l=t[a];t[a]=t[o],t[o]=l}return t};function Ce(e){var t=e.leadApi,a=e.leadSiteId,l=e.leadDomain,r=e.onShowPopup,i=e.DEBUG_URL||("https://"+location.hostname+location.pathname+location.search).toLowerCase();fetch(t+"api/campaign/"+a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:i,ga_client_id:h("_ga")||null})}).then((function(e){return e.json()})).then((function(e){var t,a,c,d,s;if(Se("List campagin: ",e),H="https://"+location.hostname+location.pathname+location.search,1==e._status){var u=(null===(a=null===(t=e._data)||void 0===t?void 0:t.campaigns)||void 0===a?void 0:a.filter((function(e){return 1===e.formatted_status})))||[];h("hhg-id")||(g("hhg-id",y(),{domain:"."+l,path:"/"}),Se("😍 Set HHG ID cookie"));var m=[];m=/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)?u.filter((function(e){return e.device_types.some((function(e){return e.id==D.MOBILE}))})):u.filter((function(e){return e.device_types.some((function(e){return e.id==D.DESKTOP}))})),Se("👓 campaignsDevice",m);var p=m.map((function(e,t){return e.targets.filter((function(e){return e.type==A.LINKS})).map((function(e){return o(o({},e),{campaignIndex:t})}))})).flat(1);p=p.filter((function(e){var t=new URL(String(e.target).toLowerCase());return"exact_match"==e.option?Boolean(i===t.href):"start_with"==e.option?!!i.includes(String(e.target))&&!e.sub_target.filter((function(e){return"excluding"==e.option})).map((function(e){return e.value})).includes(i):void 0}));var v=Array.from(document.getElementsByTagName("META")).filter((function(e){return"article:tag"==e.getAttribute("property")})).map((function(e){return e.content})),f=[];v&&v.length&&(f=m.map((function(e,t){return e.targets.filter((function(e){return e.type==A.TAGS})).map((function(e){return o(o({},e),{campaignIndex:t})}))})).flat(1).filter((function(e){return v.includes(e.target)})));var b=n(n([],p,!0),f,!0),k=document.cookie.split("; ").map((function(e){return e.split("=")[0]})),_=k.filter((function(e){return e.includes("lead_submited")}));Se("--listCampaignCodeSubmited",_);var E=k.filter((function(e){return e.includes("lead_closed")}));Se("--listCampaignCodeClosed",E);var w=n(n([],_,!0),E,!0),N=b.filter((function(e){return!w.some((function(t){return t.includes(m[e.campaignIndex].code)}))})),C=Ne(N);if(Se("--listCampaignValid : ",C),C&&C.length){var S=m[C[0].campaignIndex];Se("CAMPAIGN_SHOW",S);var x=S.rules,T=Number(null===(c=x.find((function(e){return"time"==e.rule})))||void 0===c?void 0:c.value);Se("timeoutRule",T);var P=Number(null===(d=x.find((function(e){return"scroll"==e.rule})))||void 0===d?void 0:d.value);Se("scrollRule",P);var B=Number(null===(s=x.find((function(e){return"exclude_sponsored"==e.rule})))||void 0===s?void 0:s.value);Se("excludeSponsored",B);var O=Boolean(document.querySelector(".hhg-disclaimer-text"));if(Se("💎 LEAD current page isSponsored",O),O&&B)return;var j="TIME";if(Number.isInteger(T)&&(j="TIME",Se("✨ SHOW AWESOME POPUP AFTER: ",T," seconds"),setTimeout((function(){null==r||r(S,j)}),1e3*T)),Number.isInteger(P)){j="SCROLL",Se("✨ SHOW AWESOME AFTER: SCROLL",P," %");var L=document.querySelector('[data-url="'.concat(location.pathname,'"]'))||document.querySelector("body"),I=L.getBoundingClientRect().top,U=L.offsetHeight;Se("👓 Element check scroll: ",L);var M=function(){var e=window.pageYOffset||document.documentElement.scrollTop,t=0;e>=I&&(t=Math.round((e-I)/(U-innerHeight)*100)),Se("---Scroll",t,P),t>=P&&(window.removeEventListener("scroll",M),null==r||r(S,j))};window.addEventListener("scroll",M,{passive:!0})}}else Se("🚧 No lead campaigns on current URL, tags")}})).catch((function(e){Se("Lead error: ",e)}))}var Se=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];("production"!==process.env.NODE_ENV||process.env.NEXT_PUBLIC_DEPLOY_ENV&&"production"!==process.env.NEXT_PUBLIC_DEPLOY_ENV||"undefined"!=typeof localStorage&&"true"===localStorage.getItem("hhg_debug"))&&console.log.apply(console,e)};var xe=function(e){var t,a,n=e.campaign,o=e.action,r=e.onSubmit,i=e.onClose,d=e.showThankyou,m=e.locale;k().t;var p=u(J),v=p.apiUrl,f=p.siteDomain;s((function(){var e=h("_ga")||null;fetch("".concat(v,"api/campaign/").concat(w,"/impression"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:o,url:location.href.toLowerCase(),title_article:document.title,cookie_id:h("hhg-id"),ga_client_id:e})})}),[]);var b=n.extra_fields,_=n.image,E=n.image_desktop,w=n.code,N=n.image_background,C=n.image_overlay_mobile,S=n.image_overlay_desktop,x=b.currentLayout,T=b.imageBlocks?JSON.parse(b.imageBlocks):{},P=JSON.parse(b.actionBlocks),B=JSON.parse(b.textBlocks),O=(null===(a=null===(t=null==B?void 0:B.titleBlock)||void 0===t?void 0:t.data)||void 0===a?void 0:a.value)||"",j={1:{},2:{},3:{}},L=c("lead-modal-"+y()),I=function(e){if(void 0===e&&(e="Xin chao {{category_2}} extra"),e.includes("{{category_")){var t="{{category_".length,a=e.search("{{category_");return+e.charAt(t+a)}return null}(O);if(I){Se("⚡️ Has categoryLevel",I);var A=Array.from(document.getElementsByTagName("META")),U=A.find((function(e){return e.name==="content_category_".concat(I)})),D=A.find((function(e){return e.name==="content_category_en_".concat(I)}));if(!U||!D)return Se("⚡️ No META TAG for categoryLevel, not show popup",I),null;j[I]={value:U.content,value_en:D.content},O=O.replace("{{category_".concat(I,"}}"),U.content),Se("⚡️ Set categoryData ",I)}else Se("⚡️ No categoryLevel",I);var M=function(){var e,t,a,o;if(Se("👌 Other submit click"),document.body.classList.remove("noscroll"),x.includes("Skin")){var l=document.querySelector("#masthead");l&&(l.style.top="0px !important;")}var r=Number(null!==(t=null===(e=n.rules.find((function(e){return"days_to_show_again"==e.rule})))||void 0===e?void 0:e.value)&&void 0!==t?t:7),c=Number(null!==(o=null===(a=n.rules.find((function(e){return"show_again_after_submit"==e.rule})))||void 0===a?void 0:a.value)&&void 0!==o?o:0);0===c&&(Se("⛔ Popup never show again!"),g("lead_submited_".concat(w),"target_".concat(b.popupVersion),{domain:"."+f,path:"/"})),1==c&&(Se("⌛ Popup will show again after ".concat(r," days!")),g("lead_submited_".concat(w),"target_".concat(b.popupVersion),{domain:"."+f,days:r,path:"/"}));var d=h("_ga")||null,s={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:h("hhg-id"),ga_client_id:d};I&&(s.category=j[I].value_en),fetch("".concat(v,"api/campaign/").concat(w,"/lead"),{method:"POST",body:JSON.stringify(s),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((function(e){return e.json()})).then((function(e){"error"===e.status&&Se(e)})).catch((function(e){Se("Error:",e)})),null==i||i()};return"CenterTab"===x?l.createElement(G,{popupId:L.current,url:T.imageMobile.data.url,newTab:T.imageMobile.data.newtab,imageMobile:_,imageDestkop:E,onClose:i,onOtherSubmit:M}):"Tab"===x?l.createElement(we,{popupId:L.current,url:T.imageMobile.data.url,newTab:T.imageMobile.data.newtab,image:_,onClose:i,onOtherSubmit:M}):"Floating"===x?l.createElement(K,{popupId:L.current,title:O,titleAlign:B.titleBlock.data.align,subtitle:B.subtitleBlock.data.value,subtitleAlign:B.subtitleBlock.data.align,url:P.linkButtonBlock.data.url,urlText:P.linkButtonBlock.data.value,newTab:P.linkButtonBlock.data.newtab,imageMobile:_,imageDesktop:E,onClose:i,onOtherSubmit:M}):x.includes("LightBox")||x.includes("Inline")||"Fullscreen"==x||"Sidebar"==x||"Slider"==x?l.createElement(_e,{popupId:L.current,extraFields:b,onClose:i,onOtherSubmit:M,imageMobile:_,imageDesktop:E,imageBackground:N,currentLayout:x,title:O,onSubmit:function(e,t){return r(e,t,I,j)},key:x,imageOverlayDesktop:S,imageOverlayMobile:C,showThankyou:d,campaignId:n.id,campaign_subot_id:n.bot_id||[],locale:m}):x.includes("Skin")?l.createElement(Ee,{popupId:L.current,link:P.linkButtonBlock.data.url,linkNewTab:!!P.linkButtonBlock.data.newtab,linkText:P.linkButtonBlock.data.value,onClose:i,onOtherSubmit:M,imageMobile:_,imageDesktop:E,currentLayout:x}):null},Te=function(e){var n,o=e.apiUrl,r=e.siteDomain,u=e.siteId,f=e.locale,y=e.apiSubotUrl,k=e.DEBUG_URL,_=c(),E=c(Date.now()),w=i((function(){var e=o;return e.includes("localhost")&&(e="https://dev.leadgen.hellobacsi.com/"),{apiUrl:e}}),[o,r,u]).apiUrl,N=d(null),C=N[0],S=N[1],x=d(""),T=x[0],P=x[1],B=d(null),O=B[0],j=B[1];s((function(){X.apiLeadUrl=w,X.apiSubotUrl=y}),[w,y]);var L=function(e,t){S(e),P(t)},I=function(){var e,t;if(C){Se("👋👋👋 CLOSE POPUP ".concat(C.code," 👋👋👋"));var a=Number(null===(e=C.rules.find((function(e){return"show_again_after_exit"==e.rule})))||void 0===e?void 0:e.value),n=Number(null===(t=C.rules.find((function(e){return"days_to_show_again"==e.rule})))||void 0===t?void 0:t.value);0==a&&g("lead_closed_".concat(C.code),"target_".concat(C.extra_fields.popupVersion),n?{domain:"."+r,days:n,path:"/"}:{domain:"."+r,path:"/"}),document.body.classList.remove("noscroll"),fetch("".concat(w,"api/campaign/").concat(C.code,"/popup_exit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"CLICK",url:location.href.toLowerCase(),title_article:document.title,cookie_id:h("hhg-id"),duration:Math.ceil((Date.now()-E.current)/1e3)})}),S(null),j(null)}};s((function(){if(window.next){var e=m((function(e){Se("--🌻 routeChangeComplete",e,Date.now());var t=location.pathname;I(),document.querySelectorAll('[data-popup-url="'.concat(t,'"]')).length||Ce({leadApi:w,leadDomain:r,leadSiteId:u,onShowPopup:L,DEBUG_URL:k}),_.current&&window.removeEventListener("scroll",_.current)}),500);window.next.router.events.on("routeChangeComplete",e)}Ce({leadApi:w,leadDomain:r,leadSiteId:u,onShowPopup:L,DEBUG_URL:k})}),[]);return s((function(){C&&(E.current=Date.now())}),[C]),l.createElement(J.Provider,{value:{apiUrl:w,siteDomain:r,siteId:u,locale:f}},l.createElement(v.Provider,{value:{locale:f,values:z(f)}},p(l.createElement(l.Fragment,null,"2.1"===(null===(n=null==C?void 0:C.extra_fields)||void 0===n?void 0:n.popupVersion)&&l.createElement(xe,{campaign:C,action:T,onSubmit:function(e,n,o,l){return t(void 0,void 0,void 0,(function(){var t,i,c,d,s,u,m,p,v,f,b,y,k,_,E,N,S,x,T,P,B,O,L,A,U,D,M,H,R,V,W,q;return a(this,(function(a){switch(a.label){case 0:return n?(Se("submitHandler",o,l),t=Object.keys(n).map((function(e){return{name:e,value:String(n[e])}})),i=2,c=h("_ga")||null,window.intlTelInputUtils?[3,2]:[4,require("intl-tel-input/build/js/utils")]):[2];case 1:a.sent(),a.label=2;case 2:return d={url:location.href.toLowerCase(),title_article:document.title,meta:t.map((function(t){var a,n,o=(null===(a=e.querySelector('*[name="'.concat(t.name,'"]')))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(n=e.querySelector('*[data-extra][data-name="'.concat(t.name,'"]')))||void 0===n?void 0:n.getAttribute("data-control"))||"text",l="tel"===o?window.intlTelInputUtils.formatNumber(String(t.value),null==F?void 0:F.countryCodeNumber,i).replace(/\s+/g,""):t.value;return{key:t.name,value:l,control:o,is_sent_mailchimp:e.querySelector('div[data-name="'.concat(t.name,'-mailchimp"]'))?"true":"false"}})),cookie_id:h("hhg-id"),ga_client_id:c},o&&l[o].value_en&&(d.category=l[o].value_en),s=Number((null===(L=null===(O=C.rules)||void 0===O?void 0:O.find((function(e){return"days_to_show_again"===e.rule})))||void 0===L?void 0:L.value)||7),0==(u=Number((null===(U=null===(A=C.rules)||void 0===A?void 0:A.find((function(e){return"show_again_after_submit"===e.rule})))||void 0===U?void 0:U.value)||0))&&(Se("⛔ Popup never show again!"),g("lead_submited_".concat(C.code),"target_".concat(C.extra_fields.targetType),{domain:"."+r,path:"/"})),1==u&&(Se("⌛ Popup will show again after ".concat(s," days!")),g("lead_submited_".concat(C.code),"target_".concat(C.extra_fields.targetType),{domain:"."+r,days:s,path:"/"})),fetch("".concat(w,"api/campaign/").concat(C.code,"/lead"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}),"notshow"==C.extra_fields.popupShowThankYou?(I(),document.body.classList.remove("noscroll"),[2]):(m=!0,p=C.thank_you_image||"".concat(w,"admin/img/thanksyou.png"),v=C.extra_fields.popupThankyouTitle||"Thank you.",f=C.extra_fields.popupThankyouDesc||"We appreciate your time!",b="",y="",E="","2.1"==C.extra_fields.popupVersion&&(N=C.extra_fields,S=JSON.parse(N.listBlockThankyou),x=S.find((function(e){return"TitleBlock"==e.name})),T=S.find((function(e){return"SubtitleBlock"==e.name})),P=S.find((function(e){return"LinkButtonBlock"==e.name})),v=(null===(D=null==x?void 0:x.data)||void 0===D?void 0:D.value)||"",b=(null===(M=null==x?void 0:x.data)||void 0===M?void 0:M.align)||"",f=(null===(H=null==T?void 0:T.data)||void 0===H?void 0:H.value)||"",y=(null===(R=null==T?void 0:T.data)||void 0===R?void 0:R.align)||"",k=(null===(V=null==P?void 0:P.data)||void 0===V?void 0:V.value)||"",_=(null===(W=null==P?void 0:P.data)||void 0===W?void 0:W.newtab)||!1,E=(null===(q=null==P?void 0:P.data)||void 0===q?void 0:q.url)||"",B=C.extra_fields.currentLayout,["SkinA","SkinB","Floating","Tab","CenterTab"].includes(B)&&(m=!1)),j(m?{title:v,titleAlign:b,subtitle:f,subtitleAlign:y,link:E,linkNewTab:_,linkText:k,image:p}:null),sessionStorage.getItem("insider_object")?window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")):window.insider_object={user:{email:"",phone_number:"",gdpr_optin:!0,sms_optin:!0,email_optin:!0}},t.map((function(e){var t=e.name,a=e.value;"tel"==t?window.insider_object.user.phone_number=a:"email"==t&&(window.insider_object.user.email=a)})),sessionStorage.setItem("insider_object",JSON.stringify(window.insider_object)),[2])}}))}))},onClose:I,showThankyou:O,locale:f})),b())))};export{Te as LeadGen};