1(this.webpackJsonpcommunity=this.webpackJsonpcommunity||[]).push([[39],{148:function(e,t,s){"use strict";var a=s(154),i=s.n(a),r=s(71),c=s.n(r);t.a=i.a.bind(c.a)},200:function(e,t,s){"use strict";var a=s(1),i=s(148),r=s(13),c=s(34),n=s(0);class d extends a.Component{render(){return Object(n.jsx)("div",{className:Object(i.a)("base-layout")+" "+("undefined"!=typeof this.props.className?this.props.className:""),children:Object(n.jsxs)("main",{style:{paddingTop:"content-hub-container"==this.props.className||"content-hub-detail-page-container"==this.props.className?"0px":"15px"},children:[Object(n.jsx)("div",{id:"startMainContentSection"}),Object(n.jsx)("div",{className:Object(i.a)("left-panel-decative","right-panel-decative"),children:Object(n.jsx)("div",{className:Object(i.a)("center-panel"),children:Object(n.jsx)("div",{children:this.props.children})})})]})})}}t.a=Object(c.b)(e=>e,e=>Object(r.b)({},e))(d)},720:function(e,t,s){},721:function(e,t,s){},722:function(e,t,s){},723:function(e,t,s){},724:function(e,t,s){},725:function(e,t,s){},726:function(e,t,s){},727:function(e,t,s){},728:function(e,t,s){},729:function(e,t,s){},764:function(e,t,s){"use strict";s.r(t),s.d(t,"VitaminDTrackerContainer",function(){return H});var a=s(1),i=s(13),r=s(34),c=s(33),n=s(213),d=s.n(n),l=(s(720),s(200)),o=(s(721),s(0));var h=e=>{let{name:t,size:s=24,color:a,filled:i=!1,style:r={},className:c=""}=e;return Object(o.jsx)("span",{className:`material-symbols-outlined ${c}`.trim(),style:{fontSize:s,color:a,fontVariationSettings:i?"'FILL' 1":void 0,lineHeight:1,...r},children:t})},j=(s(722),s(42));const b=`community/${j.a}/vitamin-d-tracker/result/`,m={plain:Object(j.o)(`${b}sun-plain.png`),shy:Object(j.o)(`${b}sun-shy.png`),laugh:Object(j.o)(`${b}sun-laugh.png`),cry:Object(j.o)(`${b}sun-cry.png`),melt:Object(j.o)(`${b}sun-melt.png`),star:Object(j.o)(`${b}sun-star.png`),cloud:Object(j.o)(`${b}sun-cloud.png`)},p=(e,t,s)=>{if(!s)return"plain";const a=t>0?e/t:0;return a>=1?"star":a>=.75?"laugh":a>=.5?"shy":a>0?"cry":"melt"},u=(e,t)=>e?"berlebihan"===e?"melt":"target_tercapai"===e?"laugh":"hampir_cukup"===e?"shy":"cry":t?"plain":"cloud";var _=e=>{let{moodKey:t,size:s=100,className:a="",animate:i=!1}=e;const r=m[t]||m.plain,c=m[t]?t:"plain";return Object(o.jsx)("img",{src:r,alt:c,className:`${d()("vd-sun-mood")} ${i?d()("vd-sun-mood--float"):""} ${a}`.trim(),style:{width:s,height:s,objectFit:"contain"}})},v=s(8),O=s(3);var x=e=>{let{title:t="Sesi berakhir",body:s="Sesi Anda tidak valid atau sudah berakhir. Silakan buka kembali Pemantau Vitamin D dari aplikasi theAsianparent.",hint:a="Halaman ini memerlukan login yang aktif",icon:i="lock"}=e;return Object(o.jsxs)("div",{className:d()("vd-auth-error"),children:[Object(o.jsx)(_,{moodKey:"cry",size:96,className:d()("vd-auth-error__sun")}),Object(o.jsx)("h2",{className:d()("vd-auth-error__title"),children:t}),Object(o.jsx)("p",{className:d()("vd-auth-error__body"),children:s}),Object(o.jsxs)("div",{className:d()("vd-auth-error__icon-row"),children:[Object(o.jsx)(h,{name:i,size:18,color:"#8E9EA6"}),Object(o.jsx)("span",{children:a})]}),Object(o.jsxs)("div",{className:d()("vd-auth-error__store-row"),children:[Object(o.jsx)("a",{href:O.d.android,rel:"noopener noreferrer",className:d()("vd-auth-error__store-btn"),children:Object(o.jsx)("img",{src:Object(v.a)("html-edm/2018/sep/tap-welcome","icon-android.svg"),alt:"Get it on Google Play",loading:"lazy"})}),Object(o.jsx)("a",{href:O.d.ios,rel:"noopener noreferrer",className:d()("vd-auth-error__store-btn"),children:Object(o.jsx)("img",{src:Object(v.a)("html-edm/2018/sep/tap-welcome","icon-ios.svg"),alt:"Download on the App Store",loading:"lazy"})})]})]})};s(723);var f=e=>{let{profiles:t,onSelect:s}=e;return Object(o.jsxs)("div",{className:d()("vd-profile-select"),children:[Object(o.jsx)("h2",{className:d()("vd-profile-select__title"),children:"Siapa yang ingin dipantau?"}),Object(o.jsx)("p",{className:d()("vd-profile-select__subtitle"),children:"Pilih profil untuk mulai memantau vitamin D hari ini"}),Object(o.jsx)("div",{className:d()("vd-profile-select__list"),children:t.map(e=>Object(o.jsxs)("button",{type:"button",className:d()("vd-profile-select__card"),onClick:()=>s(e.profileId),children:[Object(o.jsx)("span",{className:d()("vd-profile-select__avatar"),children:Object(o.jsx)("img",{src:e.avatarUrl,alt:""})}),Object(o.jsxs)("span",{className:d()("vd-profile-select__info"),children:[Object(o.jsx)("span",{className:d()("vd-profile-select__name"),children:e.name||("parent"===e.kind?"Anda":"Anak")}),Object(o.jsx)("span",{className:d()("vd-profile-select__hint"),children:"parent"===e.kind?"Pantau vitamin D untuk diri sendiri":"Pantau vitamin D si Kecil"})]}),Object(o.jsx)(h,{name:"chevron_right",size:20,color:"#bdc8cd"})]},e.profileId))})]})},k=(s(724),s(725),s(303)),g=s.n(k);s(294),s(295);const N={dots:!0,arrows:!1,infinite:!0,autoplay:!0,autoplaySpeed:4e3,speed:500,slidesToShow:1,slidesToScroll:1,adaptiveHeight:!0};var y=e=>{let{banners:t,profileType:s,userId:a}=e;return t&&0!==t.length?Object(o.jsx)("div",{className:d()("vd-banner-carousel"),children:Object(o.jsx)(g.a,{...N,infinite:t.length>1,autoplay:t.length>1,children:t.map((e,t)=>Object(o.jsx)("a",{className:d()("vd-banner-carousel__slide"),href:e.landingUrl,target:"_blank",rel:"noopener noreferrer",onClick:()=>{Object(O.p)("dynamic","vitamin_d_tracker","banner_click",e.title),Object(O.u)("vitamin_d_tracker_banner_click",{user_id:a,profile_type:s,banner_id:e.id,destination_url:e.landingUrl,banner_position:t+1})},children:Object(o.jsx)("img",{src:e.imageUrl,alt:e.title})}
1,e.landingUrl+e.title))})}):null};const w=["M","S","S","R","K","J","S"],S=e=>{const t=new Date;return t.setDate(t.getDate()+(e-6)),w[t.getDay()]};var D=e=>{let{profileName:t,profileAvatarUrl:s,profileKind:a,profileType:i,userId:r,summary:c,fact:n,banners:l,onStartQuiz:b,onHeroClick:m,onBack:u}=e;const{today:v,week:O,streak:x}=c,f=j.c,k=v?v.totalIu:0,g=Math.min(100,Math.round(k/f*100)),N=p(k,f,!!v),w="parent"===a?"Parent":"si kecil";return Object(o.jsxs)("div",{className:d()("vd-dashboard"),children:[Object(o.jsxs)("button",{type:"button",className:d()("vd-dashboard__back"),onClick:u,children:[Object(o.jsx)(h,{name:"arrow_back",size:18,color:"#8E9EA6"}),s&&Object(o.jsx)("span",{className:d()("vd-dashboard__back-avatar"),children:Object(o.jsx)("img",{src:s,alt:""})}),t]}),Object(o.jsxs)("section",{className:d()("vd-dashboard__hero"),onClick:m,role:"button",tabIndex:0,children:[Object(o.jsx)(_,{moodKey:N,size:128,animate:!0,className:d()("vd-dashboard__hero-sun")}),Object(o.jsx)("div",{className:d()("vd-dashboard__hero-top"),children:Object(o.jsx)("span",{className:d()("vd-dashboard__hero-label"),children:"VITAMIN D \xb7 HARI INI"})}),Object(o.jsx)("div",{className:d()("vd-dashboard__hero-track"),children:Object(o.jsx)("div",{className:d()("vd-dashboard__hero-fill"),style:{width:`${g}%`}})}),Object(o.jsx)("div",{className:d()("vd-dashboard__iu-text"),children:`${k}/${f} IU`}),Object(o.jsxs)("div",{className:d()("vd-dashboard__hero-note"),children:["Rekomendasi IDAI:",Object(o.jsx)("div",{children:"- Anak usia 0-12 bulan 400 IU per hari"}),Object(o.jsx)("div",{children:"- Anak usia di atas 12 bulan 600 IU per hari"}),Object(o.jsx)("div",{children:"- Ibu hamil dan menyusui 600 IU per hari"})]})]}),Object(o.jsxs)("button",{type:"button",className:d()("vd-dashboard__cta"),onClick:b,children:[Object(o.jsx)("span",{className:d()("vd-dashboard__cta-icon"),children:Object(o.jsx)(h,{name:"wb_sunny",size:20,color:"#fff"})}),Object(o.jsxs)("span",{className:d()("vd-dashboard__cta-text"),children:[Object(o.jsx)("span",{className:d()("vd-dashboard__cta-title"),children:"Cek Status Sekarang"}),Object(o.jsxs)("span",{className:d()("vd-dashboard__cta-subtitle"),children:["Apakah vitamin D ",w," cukup hari ini?"]})]}),Object(o.jsx)(h,{name:"chevron_right",size:20,color:"#bdc8cd"})]}),Object(o.jsxs)("p",{className:d()("vd-dashboard__cta-disclaimer"),children:[Object(o.jsx)(h,{name:"verified",size:12,color:"#8E9EA6",filled:!0}),"Pemantau vitamin D ini sudah diulas oleh dokter anak"]}),Object(o.jsxs)("section",{className:d()("vd-dashboard__streak"),children:[Object(o.jsxs)("div",{className:d()("vd-dashboard__streak-badge"),children:[Object(o.jsx)("span",{children:x}),Object(o.jsx)("span",{className:d()("vd-dashboard__streak-flame"),children:Object(o.jsx)(h,{name:"local_fire_department",size:11,color:"#fff",filled:!0})})]}),Object(o.jsxs)("div",{className:d()("vd-dashboard__streak-info"),children:[Object(o.jsx)("h3",{className:d()("vd-dashboard__streak-title"),children:x>0?`${x} Hari Beruntun!`:"Mulai Streak Hari Ini"}),Object(o.jsx)("p",{className:d()("vd-dashboard__streak-subtitle"),children:x>0?`Pertahankan kebiasaan baik ${"parent"===a?"Parent":"si Kecil"} \ud83d\udd25`:"Isi checklist harian untuk memulai streak \ud83d\udd25"}),Object(o.jsx)("div",{className:d()("vd-dashboard__week"),children:O.map((e,t)=>{const s=6===t,a=e?e.status:null,i=!!a;return Object(o.jsxs)("div",{className:d()("vd-dashboard__week-dot-wrap"),children:[Object(o.jsx)("div",{className:d()("vd-dashboard__week-dot",i&&"vd-dashboard__week-dot--done",s&&!i&&"vd-dashboard__week-dot--today"),children:i&&Object(o.jsx)(h,{name:"check",size:13,color:j.d[a],filled:!0})}),Object(o.jsx)("span",{className:d()("vd-dashboard__week-label",s&&"vd-dashboard__week-label--today"),children:S(t)})]},t)})})]})]}),Object(o.jsxs)("div",{className:d()("vd-dashboard__tip"),children:[Object(o.jsx)("span",{className:d()("vd-dashboard__tip-icon"),children:Object(o.jsx)(h,{name:"lightbulb",size:18,color:"#fff"})}),Object(o.jsxs)("div",{children:[Object(o.jsx)("h4",{className:d()("vd-dashboard__tip-title"),children:"Tahukah Parents?"}),Object(o.jsx)("p",{className:d()("vd-dashboard__tip-body"),children:n})]})]}),Object(o.jsx)(y,{banners:l,profileType:i,userId:r})]})};s(726);const z=Object(j.o)("community/staging/vitamin-d-tracker/others/quiz-background.gif");var I=e=>{let{steps:t,currentStep:s,answers:a,onAnswer:i,onDoseChange:r,onBrandChange:c,onBack:n,onNext:l,onExitToDashboard:b,submitError:m}=e;const p=t[s];if(!p)return null;const u=p.id===j.i&&a[j.i]===j.g&&""===a.customDoseIU,_=p.id===j.i&&(a[j.i]===j.g||a[j.i]===j.h),v=(a.customSupplementBrand||"").trim(),O=_&&!v,x=_&&!!v&&/^\d+$/.test(v),f=O||x,k=Object(j.p)(p,a)&&!u&&!f,g=s===t.length-1;return Object(o.jsxs)("div",{className:d()("vd-quiz"),children:[Object(o.jsx)("section",{className:d()("vd-quiz__scene"),style:{backgroundImage:`url(${z})`},children:Object(o.jsxs)("div",{className:d()("vd-quiz__progress-pill"),children:[Object(o.jsx)("div",{className:d()("vd-quiz__progress-track"),children:Object(o.jsx)("div",{className:d()("vd-quiz__progress-fill"),style:{width:(s+1)/t.length*100+"%"}})}),Object(o.jsxs)("span",{children:[s+1," dari ",t.length]})]})}),Object(o.jsxs)("section",{className:d()("vd-quiz__card-wrap"),children:[Object(o.jsxs)("div",{className:d()("vd-quiz__card"),children:[Object(o.jsx)("h2",{className:d()("vd-quiz__question"),children:p.question}),Object(o.jsx)("div",{className:d()("vd-quiz__options","grid"===p.layout&&"vd-quiz__options--grid"),children:p.options.map(e=>{const t=((e,t,s)=>"multi"===e.type?t[e.id].includes(s):t[e.id]===s)(p,a,e.key);return Object(o.jsxs)("button",{type:"button",className:d()("vd-quiz__option","grid"===p.layout&&"vd-quiz__option--grid",t&&"vd-quiz__option--selected"),onClick:()=>i(p.id,e.key),children:[Object(o.jsx)("span",{className:d()("vd-quiz__option-icon"),children:e.imageUrl?Object(o.jsx)("img",{src:e.imageUrl,alt:"",className:d()("vd-quiz__option-img")}):Object(o.jsx)(h,{name:p.icon,size:22,color:t?"#E8B923":"#5b7480"})}),Object(o.jsx)("span",{className:d()("vd-quiz__option-label"),children:e.label})]},e.key)})}),p.hint&&Object(o.jsx)("p",{className:d()("vd-quiz__hint"),children:p.hint}
1),p.id===j.i&&a[j.i]===j.g&&Object(o.jsxs)(o.Fragment,{children:[Object(o.jsxs)("div",{className:d()("vd-quiz__dose",u&&"vd-quiz__dose--error"),children:[Object(o.jsx)("span",{children:"Jumlah IU"}),Object(o.jsx)("input",{type:"number",min:"0",step:"50",className:d()("vd-quiz__dose-input"),value:null!=a.customDoseIU?a.customDoseIU:j.b,onChange:e=>r(""===e.target.value?"":Math.max(0,Number(e.target.value)))}),Object(o.jsx)("span",{children:"IU"})]}),u&&Object(o.jsx)("p",{className:d()("vd-quiz__field-error"),children:"Jumlah IU wajib diisi"})]}),_&&Object(o.jsxs)(o.Fragment,{children:[Object(o.jsxs)("div",{className:d()("vd-quiz__brand",f&&"vd-quiz__brand--error"),children:[Object(o.jsx)("span",{children:"Merek Vitamin D"}),Object(o.jsx)("input",{type:"text",placeholder:"Contoh: Youvit",className:d()("vd-quiz__brand-input"),value:a.customSupplementBrand||"",onChange:e=>c(e.target.value)})]}),O&&Object(o.jsx)("p",{className:d()("vd-quiz__field-error"),children:"Merek Vitamin D wajib diisi"}),x&&Object(o.jsx)("p",{className:d()("vd-quiz__field-error"),children:"Merek tidak boleh hanya berupa angka"})]})]}),m&&Object(o.jsx)("p",{style:{textAlign:"center",color:"#ED484A",fontSize:13,margin:"12px 0 0"},children:"Gagal mengirim jawaban. Silakan coba lagi."}),Object(o.jsxs)("div",{className:d()("vd-quiz__nav"),children:[Object(o.jsx)("button",{type:"button",className:d()("vd-quiz__back"),onClick:s>0?n:b,children:"\u2190 Kembali"}),Object(o.jsx)("button",{type:"button",className:d()("vd-quiz__next",k&&"vd-quiz__next--enabled"),disabled:!k,onClick:l,children:g?"Lihat Hasil \u2728":"Lanjut \u2192"})]})]})]})};s(727);const A="vitamin_d_tracker",P=["MG","SN","SL","RB","KM","JM","SB"],T=e=>{const t=new Date;return t.setDate(t.getDate()+(e-6)),P[t.getDay()]},q=e=>"berlebihan"===e||"target_tercapai"===e?"100%":"hampir_cukup"===e?"65%":"kurang"===e?"35%":"25%";var U=e=>{let{profileName:t,summary:s,articles:a,profileType:i,userId:r,onShare:c,onDownloadPdf:n,onEditAnswers:l,onSwitchProfile:b}=e;const{today:m,week:v,streak:x}=s,f=j.c,k=m.totalIu,g=m.status,N=j.f[g]||j.f.kurang,y=j.d[g]||j.d.kurang,w=Math.min(100,Math.round(k/f*100)),S=p(k,f,!0);return Object(o.jsxs)("div",{className:d()("vd-result"),children:[Object(o.jsx)("section",{className:d()("vd-result__hero"),children:Object(o.jsx)(_,{moodKey:S,size:220,animate:!0})}),Object(o.jsxs)("main",{className:d()("vd-result__main"),children:[m.funFact&&Object(o.jsxs)("div",{className:d()("vd-result__fun-fact"),children:[Object(o.jsx)("span",{className:d()("vd-result__fun-fact-icon"),children:Object(o.jsx)(h,{name:"lightbulb",size:20,color:"#fff",filled:!0})}),Object(o.jsxs)("div",{children:[Object(o.jsx)("p",{className:d()("vd-result__fun-fact-eyebrow"),children:"Fakta Menarik"}),Object(o.jsx)("p",{className:d()("vd-result__fun-fact-text"),children:m.funFact})]})]}),Object(o.jsxs)("div",{className:d()("vd-result__card"),children:[Object(o.jsxs)("div",{className:d()("vd-result__card-head"),children:[Object(o.jsxs)("div",{children:[Object(o.jsxs)("p",{className:d()("vd-result__card-eyebrow"),children:["Hasil untuk ",t]}),Object(o.jsx)("p",{className:d()("vd-result__status-label"),style:{color:y},children:N})]}),Object(o.jsx)("div",{className:d()("vd-result__status-badge"),style:{background:`${y}1a`},children:Object(o.jsx)(h,{name:j.e[g],size:22,color:y})})]}),Object(o.jsxs)("div",{className:d()("vd-result__progress-head"),children:[Object(o.jsx)("span",{children:"ASUPAN VITAMIN D"}),Object(o.jsxs)("span",{className:d()("vd-result__total"),children:[k," ",Object(o.jsxs)("em",{children:["/ ",f," IU"]})]})]}),Object(o.jsx)("div",{className:d()("vd-result__progress-track"),children:Object(o.jsx)("div",{className:d()("vd-result__progress-fill"),style:{width:`${w}%`}})}),Object(o.jsx)("div",{className:d()("vd-result__tip"),style:{borderLeftColor:y},children:Object(o.jsx)("p",{children:m.message})})]}),m.promo&&Object(o.jsxs)("div",{className:d()("vd-result__promo"),children:[Object(o.jsx)("img",{src:m.promo.image_url,alt:m.promo.product_title}),Object(o.jsxs)("div",{children:[Object(o.jsx)("h3",{children:m.promo.product_title}),Object(o.jsx)("p",{children:m.promo.description}),Object(o.jsx)("a",{href:m.promo.landing_url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{Object(O.p)("dynamic",A,"promo_cta_click",m.promo.product_title),Object(O.u)("vitamin_d_tracker_promotion_click",{user_id:r,profile_type:i,status:g,cta_label:"Lihat Produk",destination_url:m.promo.landing_url})},children:Object(o.jsx)("button",{type:"button",children:"Lihat Produk"})})]})]}),Object(o.jsxs)("section",{className:d()("vd-result__week-card"),
1children:[Object(o.jsxs)("h3",{children:["Catatan ",t]}),Object(o.jsxs)("div",{className:d()("vd-result__streak-chip"),children:[Object(o.jsx)(h,{name:"local_fire_department",size:16,color:"#F2797A",filled:!0}),Object(o.jsxs)("span",{children:["Streak: ",x," hari beruntun"]})]}),Object(o.jsx)("div",{className:d()("vd-result__bars"),children:v.map((e,t)=>{const s=6===t,a=e?e.status:null;return Object(o.jsxs)("div",{className:d()("vd-result__bar-col"),children:[Object(o.jsx)(_,{moodKey:u(a,s),size:28}),Object(o.jsx)("div",{className:d()("vd-result__bar-track"),children:Object(o.jsx)("div",{className:d()("vd-result__bar",s&&"vd-result__bar--today"),style:{height:q(a)}})}),Object(o.jsx)("span",{className:d()("vd-result__bar-label",s&&"vd-result__bar-label--today"),children:T(t)})]},t)})})]}),a.length>0&&Object(o.jsxs)("div",{className:d()("vd-result__articles"),children:[Object(o.jsx)("h3",{children:"Artikel Rekomendasi"}),Object(o.jsx)("div",{className:d()("vd-result__articles-scroll"),children:a.map((e,t)=>Object(o.jsxs)("a",{href:e.landingUrl,target:"_blank",rel:"noopener noreferrer",className:d()("vd-result__article"),onClick:()=>{Object(O.p)("dynamic",A,"article_click",e.title),Object(O.u)("vitamin_d_tracker_article_click",{user_id:r,profile_type:i,article_id:e.id,article_title:e.title,article_tag:e.tag,position_in_list:t+1,destination_url:e.landingUrl})},children:[Object(o.jsx)("div",{className:d()("vd-result__article-thumb"),children:e.imageUrl?Object(o.jsx)("img",{src:e.imageUrl,alt:e.title}):Object(o.jsx)(h,{name:"article",size:40,color:"#5AC8E7",filled:!0})}),Object(o.jsxs)("div",{className:d()("vd-result__article-body"),children:[Object(o.jsx)("span",{children:e.tag}),Object(o.jsx)("p",{children:e.title})]})]},e.title))})]}),Object(o.jsxs)("div",{className:d()("vd-result__actions"),children:[Object(o.jsxs)("button",{type:"button",className:d()("vd-result__share"),onClick:c,children:[Object(o.jsx)(h,{name:"share",size:20,color:"#fff"})," Bagikan Laporan"]}),Object(o.jsxs)("button",{type:"button",className:d()("vd-result__pdf"),onClick:n,children:[Object(o.jsx)(h,{name:"picture_as_pdf",size:20,color:"#F2797A"})," Unduh PDF"]})]}),Object(o.jsxs)("div",{className:d()("vd-result__links"),children:[Object(o.jsx)("button",{type:"button",className:d()("vd-result__edit"),onClick:l,children:"Ubah jawaban hari ini"}),Object(o.jsx)("button",{type:"button",className:d()("vd-result__switch"),onClick:b,children:"Ganti Profil (Parent/Anak Lain)"})]})]})]})};s(728);const C="vitamin_d_tracker",R=(e,t)=>{var s,a;return null!==(s=window.webkit)&&void 0!==s&&null!==(a=s.messageHandlers)&&void 0!==a&&a[e]?(Object(O.p)("dynamic",C,"app_bridge_success",`${e} (iOS)`),window.webkit.messageHandlers[e].postMessage(t),!0):window.AppBridge&&"function"===typeof window.AppBridge[e]?(Object(O.p)("dynamic",C,"app_bridge_success",`${e} (Android)`),window.AppBridge[e](t),!0):(Object(O.p)("dynamic",C,"app_bridge_error",`${e} not found`),!1)};var F=e=>{let{profileName:t,summary:s,onBack:a,onEditAnswers:i,onShare:r}=e;const{today:c}=s,n=j.c,l=j.f[c.status]||j.f.kurang,b=Math.min(100,Math.round(c.totalIu/n*100)),m=p(c.totalIu,n,!0);return Object(o.jsxs)("div",{className:d()("vd-pdf"),children:[Object(o.jsxs)("button",{type:"button",className:d()("vd-pdf__back"),onClick:a,children:[Object(o.jsx)(h,{name:"arrow_back",size:20,color:"#4BB9D3"})," Kembali"]}),Object(o.jsxs)("div",{className:d()("vd-pdf__sheet"),children:[Object(o.jsxs)("div",{className:d()("vd-pdf__hero"),children:[Object(o.jsx)(_,{moodKey:m,size:100,animate:!0}),Object(o.jsx)("h2",{className:d()("vd-pdf__gelar"),children:l}),Object(o.jsxs)("p",{className:d()("vd-pdf__subtitle"),children:["Hasil Evaluasi ",t]}),Object(o.jsx)("p",{className:d()("vd-pdf__message"),children:c.message})]}),Object(o.jsxs)("div",{className:d()("vd-pdf__body"),children:[Object(o.jsxs)("div",{className:d()("vd-pdf__breakdown"),children:[Object(o.jsx)("h3",{children:"Rincian Estimasi Asupan (IU)"}),Object(o.jsxs)("div",{className:d()("vd-pdf__row"),children:[Object(o.jsx)("span",{className:d()("vd-pdf__row-label"),children:"\u2600\ufe0f Dari Matahari:"}),Object(o.jsxs)("span",{className:d()("vd-pdf__row-value"),children:[c.sunIu," IU"]})]}),Object(o.jsxs)("div",{className:d()("vd-pdf__row"),children:[Object(o.jsx)("span",{className:d()("vd-pdf__row-label"),children:"\ud83d\udca7 Dari Suplemen:"}),Object(o.jsxs)("span",{className:d()("vd-pdf__row-value"),children:[c.suppIu," IU"]})]}),Object(o.jsxs)("div",{className:d()("vd-pdf__row"),children:[Object(o.jsx)("span",{className:d()("vd-pdf__row-label"),children:"\ud83c\udf7d\ufe0f Dari Makanan:"}),Object(o.jsxs)("span",{className:d()("vd-pdf__row-value"),children:[c.foodIu," IU"]})]}),Object(o.jsxs)("div",{className:d()("vd-pdf__row","vd-pdf__row--last"),children:[Object(o.jsx)("span",{className:d()("vd-pdf__row-label"),children:"\u26a0\ufe0f Faktor Risiko:"}),Object(o.jsxs)("span",{className:d()("vd-pdf__row-value"),style:{color:c.riskIu<0?"#ED484A":"#3e484c"},children:[c.riskIu," IU"]})]})]}),Object(o.jsxs)("div",{className:d()("vd-pdf__row"),children:[Object(o.jsx)("span",{className:d()("vd-pdf__row-label","vd-pdf__row-label--bold"),children:"Target Harian Ideal:"}
1),Object(o.jsxs)("span",{className:d()("vd-pdf__row-value"),children:[n," IU"]})]}),Object(o.jsxs)("div",{className:d()("vd-pdf__row"),children:[Object(o.jsx)("span",{className:d()("vd-pdf__row-label","vd-pdf__row-label--bold"),children:"Total Estimasi Didapat:"}),Object(o.jsxs)("span",{className:d()("vd-pdf__row-value","vd-pdf__row-value--big"),children:[c.totalIu," IU"]})]}),Object(o.jsx)("div",{className:d()("vd-pdf__progress-track"),children:Object(o.jsx)("div",{className:d()("vd-pdf__progress-fill"),style:{width:`${b}%`}})}),Object(o.jsxs)("div",{className:d()("vd-pdf__progress-labels"),children:[Object(o.jsx)("span",{children:"0 IU"}),Object(o.jsxs)("span",{children:[n," IU"]})]}),Object(o.jsx)("p",{className:d()("vd-pdf__disclaimer"),children:"*Estimasi ini adalah perkiraan kasar berdasarkan jawaban Bunda"}),Object(o.jsx)("div",{className:d()("vd-pdf__edit-row"),children:Object(o.jsx)("button",{type:"button",className:d()("vd-pdf__edit"),onClick:i,children:"Ubah jawaban hari ini"})})]})]}),Object(o.jsxs)("div",{className:d()("vd-pdf__actions"),children:[Object(o.jsxs)("button",{type:"button",className:d()("vd-pdf__print"),onClick:()=>{R("saveVitaminDReportPdf","")||(Object(O.p)("dynamic","vitamin_d_tracker","pdf_print_click",""),window.print())},children:[Object(o.jsx)(h,{name:"print",size:20,color:"#fff"})," Cetak / Simpan PDF"]}),Object(o.jsxs)("button",{type:"button",className:d()("vd-pdf__share"),onClick:()=>{R("shareVitaminDReportImage","")||r()},children:[Object(o.jsx)(h,{name:"share",size:20,color:"#F2797A"})," Bagikan Laporan"]})]})]})};s(729);const $=Object(j.o)("tap-web/logo/logo_theAsianparent_black.png");var B=()=>Object(o.jsxs)("div",{className:d()("vd-desktop"),children:[Object(o.jsx)("img",{className:d()("vd-desktop__logo"),src:$,alt:"theAsianparent",loading:"lazy"}),Object(o.jsx)("div",{className:d()("vd-desktop__icon"),children:Object(o.jsx)(h,{name:"wb_sunny",size:32,color:"#fff"})}),Object(o.jsx)("h1",{className:d()("vd-desktop__title"),children:"Pemantau Vitamin D"}),Object(o.jsx)("p",{className:d()("vd-desktop__desc"),children:"Fitur ini hanya tersedia di layar ponsel. Buka halaman ini dari HP kamu, atau unduh aplikasi theAsianparent untuk mulai memantau vitamin D si Kecil."}),Object(o.jsxs)("div",{className:d()("vd-desktop__badges"),children:[Object(o.jsx)("a",{href:"https://play.google.com/store/apps/details?referrer=utm_source%3Dvitamin-d-tracker&id=com.tickledmedia.ParentTown",target:"_blank",rel:"noopener noreferrer",children:Object(o.jsx)("img",{src:Object(v.a)("html-edm/footer","google-play-store.png"),alt:"Google Play",loading:"lazy"})}),Object(o.jsx)("a",{href:"https://itunes.apple.com/in/app/parenttown/id1042523855?ct=utm_source%3Dvitamin-d-tracker&mt=8",target:"_blank",rel:"noopener noreferrer",children:Object(o.jsx)("img",{src:Object(v.a)("html-edm/footer","app-store-logo.png"),alt:"App Store",loading:"lazy"})})]})]}),M=s(150);const E="vitamin_d_tracker",K=Object(j.o)(`community/${j.a}/vitamin-d-tracker/others/sun.png`);class H extends a.Component{constructor(e){super(e),this.goToDashboard=e=>{const t=this.props.vitaminDTrackerReducer.profiles.find(t=>t.profileId===e);Object(O.p)("dynamic",E,"select_profile_click",t&&t.kind||""),this.props.setVitaminDActiveProfile(e),this.props.vitaminDSummaryFetch(e),this.setState({screen:"dashboard"})},this.goToSelect=()=>this.setState({screen:"select"}),this.startQuiz=()=>this.setState({screen:"quiz",currentStep:0,todayAnswers:Object(j.n)(this.quizSteps())}),this.startQuizFromCta=()=>{Object(O.p)("dynamic",E,"start_quiz_cta_click",""),this.startQuiz()},this.exitQuizToDashboard=()=>{Object(O.p)("dynamic",E,"quiz_exit_to_dashboard_click",""),this.setState({screen:"dashboard"})},this.goToHeroTarget=()=>{Object(O.p)("dynamic",E,"hero_click","");const e=this.props.vitaminDTrackerReducer.activeProfileId,t=this.props.vitaminDTrackerReducer.summaries[e];t&&t.today?this.setState({screen:"result"}):this.startQuiz()},this.onAnswer=(e,t)=>{Object(O.p)("dynamic",E,"quiz_answer_click",`${e}:${t}`);const s=this.quizSteps().find(t=>t.id===e);this.setState(a=>
1{if("multi"===s.type){const s=a.todayAnswers[e];let i;if("none"===t)i=s.includes("none")?[]:["none"];else{const e=s.filter(e=>"none"!==e);i=e.includes(t)?e.filter(e=>e!==t):[...e,t]}return{todayAnswers:{...a.todayAnswers,[e]:i}}}const i={[e]:t};return e===j.i&&t!==j.g&&(i.customDoseIU=null),e===j.i&&t!==j.h&&t!==j.g&&(i.customSupplementBrand=null),{todayAnswers:{...a.todayAnswers,...i}}})},this.onDoseChange=e=>this.setState(t=>({todayAnswers:{...t.todayAnswers,customDoseIU:e}})),this.onBrandChange=e=>this.setState(t=>({todayAnswers:{...t.todayAnswers,customSupplementBrand:e}})),this.goBack=()=>{Object(O.p)("dynamic",E,"quiz_back_click",""),this.setState(e=>({currentStep:Math.max(0,e.currentStep-1)}))},this.goNext=()=>{const{currentStep:e,todayAnswers:t}=this.state,s=this.quizSteps();if(e<s.length-1)return Object(O.p)("dynamic",E,"quiz_next_click",s[e].id),void this.setState({currentStep:e+1});Object(O.p)("dynamic",E,"quiz_submit_click","");const a=this.props.vitaminDTrackerReducer.activeProfileId;this.props.vitaminDSubmitAnswers(a,Object(j.k)(s,t)).then(e=>{e&&(Object(O.u)("vitamin_d_tracker_successful",{user_id:this.activeUserId(),profile_type:Object(j.q)(this.props.vitaminDTrackerReducer.profiles,a),total_iu:e.total_iu,status:e.status,streak:e.streak,suplement_selected:Object(j.m)(t)}),this.setState({screen:"result"}))})},this.editAnswers=()=>this.setState({screen:"quiz",currentStep:0,todayAnswers:Object(j.n)(this.quizSteps())}),this.editAnswersFromResult=()=>{Object(O.p)("dynamic",E,"result_edit_answers_click",""),this.editAnswers()},this.editAnswersFromPdf=()=>{Object(O.p)("dynamic",E,"pdf_edit_answers_click",""),this.editAnswers()},this.goToPdf=()=>{Object(O.p)("dynamic",E,"download_pdf_click",""),this.setState({screen:"pdf"})},this.goToPdfFromShare=()=>{Object(O.p)("dynamic",E,"share_report_click",""),this.setState({screen:"pdf"})},this.backToResult=()=>{Object(O.p)("dynamic",E,"pdf_back_click",""),this.setState({screen:"result"})},this.switchProfile=()=>{Object(O.p)("dynamic",E,"switch_profile_click",""),this.goToSelect()},this.backToSelectFromDashboard=()=>{Object(O.p)("dynamic",E,"dashboard_back_click",""),this.goToSelect()},this.onShare=()=>{Object(O.p)("dynamic",E,"share_report_click","");const{vitaminDTrackerReducer:e}=this.props,t=e.summaries[e.activeProfileId];if(!t||!t.today)return;const s=e.profiles.find(t=>t.profileId===e.activeProfileId),a=`Laporan Vitamin D ${s&&s.name||"Si Kecil"} hari ini: Status ${t.today.status}.\n\u2014 via Pemantau Vitamin D Anak`;navigator.share?navigator.share({title:"Laporan Vitamin D",text:a}).catch(()=>{}):navigator.clipboard&&navigator.clipboard.writeText(a).catch(()=>{})},this.state={screen:"select",currentStep:0,todayAnswers:{},factIndex:0}}componentDidMount(){document.body.classList.add("no-body-padding");const e=new URLSearchParams("undefined"!==typeof window?window.location.search:"");this.sessionId=Math.random().toString(36).slice(2)+Date.now().toString(36),Object(O.u)("vitamin_d_tracker_opened",{user_id:this.activeUserId(),entry_point:e.get("entry_point")||"",active_profile:e.get("active_profile")||"",session_id:this.sessionId}),this.props.vitaminDContentFetch().then(()=>{this.setState({factIndex:Math.floor(Math.random()*Math.max(1,this.props.vitaminDTrackerReducer.content.facts.length))})}),this.props.vitaminDProfilesFetch().then(()=>{this.props.vitaminDSummaryFetch(this.props.vitaminDTrackerReducer.activeProfileId)})}componentWillUnmount(){document.body.classList.remove("no-body-padding")}quizSteps(){return Object(j.l)(this.props.vitaminDTrackerReducer.content.quiz,this.activeProfileName())}activeProfileName(){const{profiles:e,activeProfileId:t}=this.props.vitaminDTrackerReducer,s=e.find(e=>e.profileId===t);return s?s.name||("parent"===s.kind?"Anda":"Anak"):""}activeProfileAvatarUrl(){const{profiles:e,activeProfileId:t}=this.props.vitaminDTrackerReducer,s=e.find(e=>e.profileId===t);return s?s.avatarUrl:""}activeProfileKind(){const{profiles:e,activeProfileId:t}=this.props.vitaminDTrackerReducer,s=e.find(e=>e.profileId===t);return s?s.kind:"child"}activeProfileType(){const{profiles:e,activeProfileId:t}=this.props.vitaminDTrackerReducer;return Object(j.q)(e,t)}activeUserId(){return this.props.userReducer&&this.props.userReducer.id||""}renderScreen(){const{vitaminDTrackerReducer:e}=this.props,{screen:t,currentStep:s,todayAnswers:a,factIndex:i}=this.state,r=e.summaries[e.activeProfileId],{facts:c,articles:n,banners:d}=e.content;return"select"===t?Object(o.jsx)(f,{profiles:e.profiles,onSelect:this.goToDashboard}):"dashboard"===t&&r?Object(o.jsx)(D,{profileName:this.activeProfileName(),profileAvatarUrl:this.activeProfileAvatarUrl(),profileKind:this.activeProfileKind(),profileType:this.activeProfileType(),userId:this.activeUserId(),summary:r,fact:c[i]||"",banners:d,onStartQuiz:this.startQuizFromCta,onHeroClick:this.goToHeroTarget,onBack:this.backToSelectFromDashboard}):"quiz"===t?Object(o.jsx)(I,{steps:this.quizSteps(),currentStep:s,answers:a,onAnswer:this.onAnswer,onDoseChange:this.onDoseChange,onBrandChange:this.onBrandChange,onBack:this.goBack,onNext:this.goNext,onExitToDashboard:this.exitQuizToDashboard,submitError:this.props.vitaminDTrackerReducer.submitError}):"result"===t&&r&&r.today?Object(o.jsx)(U,{profileName:this.activeProfileName(),profileType:this.activeProfileType(),userId:this.activeUserId(),summary:r,articles:n,onShare:this.goToPdfFromShare,onDownloadPdf:this.goToPdf,onEditAnswers:this.editAnswersFromResult,onSwitchProfile:this.switchProfile}):"pdf"===t&&r&&r.today?Object(o.jsx)(F,{profileName:this.activeProfileName(),summary:r,onBack:this.backToResult,onEditAnswers:this.editAnswersFromPdf,onShare:this.onShare}):"dashboard"===t||"result"===t||"pdf"===t?Object(o.jsx)("div",{style:{padding:"48px 24px",textAlign:"center",color:"#8E9EA6"},children:"Memuat..."}):null}render(){const{authError:e,authErrorReason:t}=this.props.vitaminDTrackerReducer;return e?"network"===t?Object(o.jsx)(x,{title:"Gagal memuat halaman",body:"Terjadi kendala jaringan saat memuat Pemantau Vitamin D. Silakan coba lagi beberapa saat lagi.",hint:"Periksa koneksi internet kamu dan muat ulang halaman",icon:"wifi_off"}):Object(o.jsx)(x,{}):Object(o.jsxs)(a.Fragment,{children:[Object(o.jsxs)(l.a,{history:this.props.history,match:this.props.match,className:d()("vd-container","full-width-page","only-mobile"),children:[Object(o.jsx)("div",{className:d()("vd-header"),children:Object(o.jsxs)("div",{className:d()("vd-header__brand"),children:[Object(o.jsx)("span",{className:d()("vd-header__brand-icon"),children:Object(o.jsx)("img",{src:K,alt:"",className:d()("vd-header__brand-logo")})}),Object(o.jsxs)("div",{children:[Object(o.jsx)("h1",{children:"Pemantau Vitamin D"}),Object(o.jsx)("p",{children:"theAsianparent"})]})]})}),this.renderScreen()]}),Object(o.jsx)("div",{className:d()("not-mobile"),children:Object(o.jsx)(B,{})})]})}}t.default=Object(r.b)(e=>({vitaminDTrackerReducer:e.vitaminDTrackerReducer,userReducer:e.userReducer}),e=>Object(i.b)({vitaminDProfilesFetch:M.rc,vitaminDContentFetch:M.q
1c,vitaminDSummaryFetch:M.tc,vitaminDSubmitAnswers:M.sc,setVitaminDActiveProfile:M.Lb},e))(Object(c.b)()(H))}}]); 2//# sourceMappingURL=VitaminDTrackerContainerChunk.ce9b4573.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.