(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7289,7074,5639,9675,9275,9903,4137,9948,6678,7202,4806],{Cov9:function(e,t,n){"use strict";n.d(t,{h:function(){return r},x:function(){return o}});var i=n("NMK5");let r=(0,i.Jj)(e=>{var t,n;return void 0!==e&&e?{province:e.state||"",keyCategory:e.key_category,category:e.category,description:e.description,qualityMin:e.air_quality_min||null,qualityMax:e.air_quality_max||null,currentAqiusValue:(null==e?void 0:null===(t=e.pollution)||void 0===t?void 0:t.aqius)||null,updatedTime:(null==e?void 0:null===(n=e.pollution)||void 0===n?void 0:n.ts)||null}:null}),o=(0,i.Jj)(e=>void 0!==e&&e?{title:e.title||"",description:e.description||"",disclaimer:e.disclaimer||"",featuredImage:e.featured_image||""}:null)},GWVq:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var i=n("iAbL");let r={formatProductPromotion:e=>e?{id:e.id||0,name:e.name||"",thumbnail:e.thumbnail||"",expirationDate:e.expiration_date||""}:null,formatPriceInfo:e=>e?{final:e.final||0,regular:e.regular||0,discountPercent:e.discount_percent||0}:null,formatCategory:function(e,t,n){var i,o,a;let l=n?n+"/"+e.slug:e.slug,u=(null==e?void 0:null===(o=e.children)||void 0===o?void 0:null===(i=o.map)||void 0===i?void 0:i.call(o,t=>r.formatCategory(t,e.id,l)))||[];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:l||"",children:u,parentId:t||0,products:(null===(a=e.products)||void 0===a?void 0:a.map(this.formatProduct))||[]}},formatProduct:e=>{var t,n,o;return e?{id:e.id||0,price:e.price&&r.formatPriceInfo(e.price)||{final:0,regular:0,discountPercent:0},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===(n=e.product_promotions)||void 0===n?void 0:null===(t=n.map)||void 0===t?void 0:t.call(n,r.formatProductPromotion).filter(i.$K))||[],isInStock:(null==e?void 0:e.is_in_stock)||!1,isAffiliateProduct:(null==e?void 0:e.is_affiliate_product)||!1,affiliates:(null===(o=e.affiliates)||void 0===o?void 0:o.map(e=>({channelCode:e.channel_code||"",price:e.price,url:e.url})))||[]}:null}}},bflR:function(e,t,n){"use strict";n.d(t,{$W:function(){return fetchVideoPreview}});var i=n("09QT"),r=n("oQBk");function normalizePreviewImageUrl(e){if(e)return e.replace(/&/g,"&")}async function fetchVideoPreview(e){if(!e.length)return[];let t=function(e,t){let n=[];for(let i=0;i{let t=await (0,i.d)(r.y.TOGETHER.FETCH_MULTI_PREVIEW,{method:"POST",data:{links:e.map(e=>e.urlVideo),update:!0}},"together"),n=function(e){if(null==e)return[];if(Array.isArray(e))return e;if("object"==typeof e){if(Array.isArray(e.previews))return e.previews;if(Array.isArray(e.data))return e.data;if(Array.isArray(e.results))return e.results}return[]}(null==t?void 0:t.data);return e.map((e,t)=>(function(e,t){if(!e||"object"!=typeof e)return{title:t.videoTitle||"",url:t.urlVideo};if(e.preview&&"object"==typeof e.preview){let n=e.preview;return{title:t.videoTitle||n.title||"",url:t.urlVideo,image:normalizePreviewImageUrl(n.image)}}return e.data?{...e.data,url:t.urlVideo,title:t.videoTitle||e.title||"",image:normalizePreviewImageUrl("string"==typeof e.data.image?e.data.image:void 0)}:{...e,url:t.urlVideo,title:t.videoTitle||("string"==typeof e.title?e.title:"")||""}})(function(e,t,n){let i=t.urlVideo,r=e[n];if(r&&"object"==typeof r&&r.link===i)return r;let o=e.find(e=>"object"==typeof e&&e&&e.link===i);return null!=o?o:r}(n,e,t),e))}));return[].concat(...n)}},ejbI:function(e,t,n){"use strict";function myImageLoader(e){let{src:t="",width:n,quality:i}=e;return t.includes("?")?"".concat(t,"&w=").concat(n,"&q=").concat(i||75):"".concat(t,"?w=").concat(n,"&q=").concat(i||75)}n.d(t,{Z:function(){return myImageLoader}})},Fyo5:function(e,t,n){"use strict";n.d(t,{B9:function(){return isValidStatus},le:function(){return checkValidDataApi},rx:function(){return checkValidData}});var i=n("qe1T");function checkValidDataApi(e){var t;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!!e&&"string"==typeof(null==e?void 0:e.state)&&(!!n||""!==e.state)&&"number"==typeof(null==e?void 0:null===(t=e.pollution)||void 0===t?void 0:t.aqius)}function checkValidData(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!!e&&"string"==typeof(null==e?void 0:e.province)&&(!!t||""!==e.province)&&"number"==typeof(null==e?void 0:e.currentAqiusValue)}function isValidStatus(e){return Object.values(i.P).includes(e)}},QW8v:function(e,t,n){"use strict";n.d(t,{W:function(){return d}});var i=n("VNqU"),r=n("09QT"),o=n("Cov9"),a=n("oQBk"),l=n("Tk9B"),u=n("Fyo5");let d=(0,i.Ue)((e,t)=>({loading:!1,error:null,currentData:null,cardInfo:null,listProvinces:null,currentLocation:null,setCurrentLocation(t){e({currentLocation:t})},fetchInitData:async()=>{let{loading:n,listProvinces:i}=t();if(!n&&!i){e({loading:!0,error:null});try{var d,c;let t=await (0,l.k)(!1),n=(null==t?void 0:t.location)||null,[i,s,m,v]=await Promise.all([(0,r.d)(a.y.HEALTH_TOOL.GET_AIR_POPULATION_INFO),n?(0,r.d)(a.y.HEALTH_TOOL.GET_AIR_POPULATION_SPECIFIC_PROVINCE,{params:{type:"geo",lat:n.latitude,lng:n.longitude}}):null,(0,r.d)(a.y.HEALTH_TOOL.GET_AIR_POPULATION_DEFAULT),(0,r.d)(a.y.HEALTH_TOOL.GET_AIR_POPULATION_PROVINCE),(0,l.k)(!1)]),f=null==s?void 0:s.data,g=null==m?void 0:m.data,p=(0,u.le)(f,!0),k=(0,u.le)(g),h=!!(null==i?void 0:i.data)&&!!(null==v?void 0:null===(d=v.data)||void 0===d?void 0:d.provinces)&&(p||k);if(h){let r=n&&p;e({currentLocation:r?t:null,cardInfo:(0,o.x)(null==i?void 0:i.data),currentData:(0,o.h)(r?f:k?g:null),listProvinces:(null==v?void 0:null===(c=v.data)||void 0===c?void 0:c.provinces)||[]})}else e({error:"General error"})}catch(t){e({error:t.message})}finally{e({loading:!1})}}},retryFetchInitData:async()=>{e({error:null}),await t().fetchInitData()}}))},tjQ2:function(e,t,n){"use strict";n.d(t,{Ep:function(){return ArticleStoreProvider},WM:function(){return useArticleStore}});var i=n("BGKE"),r=n("q1tI"),o=n("sEfC"),a=n.n(o),l=n("oWg6"),u=n("VNqU"),d=n("2vNa"),c=n("Bp26");let s=["small","medium","large"],m=(0,r.createContext)(null),createArticleStore=e=>(0,l.M)((t,n)=>({articles:[],bookmarkIds:[],chineseTranslate:c.w.traditional,currentArticle:null,currentProgress:0,fontSize:"small",isBookmarked:!1,isCommentPopupOpen:!1,isLiked:!1,isDisliked:!1,totalComment:0,categories:[],...e||{},addToArticles:e=>{!e||n().articles.find(t=>e.id===t.id)||t({articles:n().articles.concat(e)})},addToBookmark:e=>t({isBookmarked:!0,bookmarkIds:[...n().bookmarkIds,e]}),removeBookmark:e=>{let i=n().bookmarkIds.filter(t=>t!==e);t({isBookmarked:!1,bookmarkIds:i})},setArticles:e=>t(t=>({articles:"function"==typeof e?e(t.articles):e})),setBookmarkIds:e=>{t({bookmarkIds:e})},setChineseTranslate:e=>t({chineseTranslate:e}),setCurrentArticle:a()(e=>t({currentArticle:e}),300),setCurrentProgress:e=>t({currentProgress:e}),cycleFontSize:()=>t({fontSize:(0,d.D)(s,n().fontSize)}),setIsBookmarked:e=>t({isBookmarked:e}),setIsCommentPopupOpen:e=>t({isCommentPopupOpen:e}),setIsLiked:e=>t({isLiked:e}),setIsDisliked:e=>t({isDisliked:e}),setTotalComment:e=>t({totalComment:e}),setCategories:e=>t({categories:e}),setShowDictionaryShortcutBtn:e=>t({showDictionaryShortcutBtn:e})})),ArticleStoreProvider=e=>{let{init:t,refreshKey:n,children:o}=e,a=(0,r.useRef)(createArticleStore(t)),l=a.current;return(0,r.useEffect)(()=>{n&&a.current.setState(t)},[n]),(0,i.tZ)(m.Provider,{value:l,children:o})},useArticleStore=(e,t)=>{let n=(0,r.useContext)(m),i=(0,u.oR)(n,e,t);return i}},Bp26:function(e,t,n){"use strict";var i,r;n.d(t,{w:function(){return i}}),(r=i||(i={}))[r.traditional=0]="traditional",r[r.simplified=1]="simplified"},Qx0X:function(e,t,n){"use strict";n.d(t,{D:function(){return i},L:function(){return r}});let i="#284A75",r={loading:!1,shouldRender:!1,error:null,imsakDate:null,maghribDate:null,nextImsakDate:null,ramadanEvent:null,loadingCurrentLocation:!1}},yv45:function(e,t,n){"use strict";n.d(t,{Uc:function(){return checkValidEvent},dD:function(){return getCountDownData},kW:function(){return getColorShade},lR:function(){return handlerEventState}});var i=n("Wgwc"),r=n.n(i),o=n("QiCV");n("qe1T");var a=n("5nj8"),l=n("H+I9"),u=n("Qx0X"),d=n("JPk0");function checkValidEvent(e){var t,n;let i=r().unix((null==e?void 0:null===(t=e.prayerTimes)||void 0===t?void 0:t.imsak.timestamp)||0),o=r().unix((null==e?void 0:null===(n=e.prayerTimes)||void 0===n?void 0:n.maghrib.timestamp)||0),a=r().unix((null==e?void 0:e.nextImsak.timestamp)||0);return{shouldRender:!!e&&i.isValid()&&o.isValid()&&a.isValid(),imsakDate:i,maghribDate:o,nextImsakDate:a}}let getColorShade=e=>{let{h:t,s:n,b:i}=(0,a.sU)(e,!0),r=(0,a.Nv)(t,n,i-12),o=(0,a.Nv)(t,n,i-20),l=(0,a.Nv)(t,30,90);return{mainColor:e,secondColor:"rgb(".concat(r[0],",").concat(r[1],",").concat(r[2],")"),thirdColor:"rgb(".concat(o[0],",").concat(o[1],",").concat(o[2],")"),bgFillColor:"rgb(".concat(l[0],",").concat(l[1],",").concat(l[2],")")}};function handlerEventState(e,t){let n=checkValidEvent(t);return(null==n?void 0:n.shouldRender)?{shouldRender:!0,currentZone:(null==t?void 0:t.zone)||"",ramadanEvent:t,imsakDate:n.imsakDate,maghribDate:n.maghribDate,nextImsakDate:n.nextImsakDate,colorShade:getColorShade(t.color||u.D),selectedZone:t?{label:(null==t?void 0:t.zoneName)||"",value:(null==t?void 0:t.zone)||""}:null,status:(0,o.Vy)({toDate:e,imsakDate:n.imsakDate,maghribDate:n.maghribDate,nextImsakDate:n.nextImsakDate})}:{...u.L,shouldRender:!0,status:d.I.IDLE}}function getCountDownData(e){let{status:t,toDate:n,imsakDate:i,maghribDate:r}=e,o=t===d.I.COUNT_DOWN_TO_PRAY_TIME?i:r;return(0,l.VA)({starDate:n,endDate:o})}},I07S:function(e,t,n){"use strict";n.d(t,{Y:function(){return useRamadanStore}});var i=n("VNqU");let useRamadanStore=(e,t,n)=>(0,i.oR)(e,t,n)},pdCJ:function(e,t,n){"use strict";n.d(t,{P:function(){return createRamadanStore}});var i=n("Wgwc"),r=n.n(i),o=n("oWg6"),a=n("NMK5");let l=(0,a.Jj)(e=>{var t,n,i,o,a,l,u,d,c,s,m,v;if(void 0===e||!e||!e.prayer_times)return null;let f=e.widget_settings||{},g=f.start_date||"",p=f.end_date||"",k=e.date||"",h=r()(g),y=r()(k),D=r()(p),_=h.isValid()&&y.isValid()&&D.isValid()&&y.isBetween(h,D,null,"[]");return _?{date:k,zone:e.zone||"",zoneName:e.zone_name||"",gregorianDate:"".concat(e.gregorian_date||""," - ").concat(e.hijri_date||""),prayerTimes:{imsak:{time:null===(n=e.prayer_times)||void 0===n?void 0:null===(t=n.imsak)||void 0===t?void 0:t.time,timestamp:r()("".concat(k," ").concat(null===(o=e.prayer_times)||void 0===o?void 0:null===(i=o.imsak)||void 0===i?void 0:i.time),"YYYY-MM-DD h:mm A").unix()},maghrib:{time:null===(l=e.prayer_times)||void 0===l?void 0:null===(a=l.maghrib)||void 0===a?void 0:a.time,timestamp:r()("".concat(k," ").concat(null===(d=e.prayer_times)||void 0===d?void 0:null===(u=d.maghrib)||void 0===u?void 0:u.time),"YYYY-MM-DD h:mm A").unix()}},nextImsak:{time:null===(c=e.next_day_imsak)||void 0===c?void 0:c.time,timestamp:r()("".concat(k," ").concat(null===(s=e.next_day_imsak)||void 0===s?void 0:s.time),"YYYY-MM-DD h:mm A").unix()},color:f.widget_color||null,sponsorItem:{name:(null===(m=f.sponsor)||void 0===m?void 0:m.post_title)||"",logo:(null===(v=f.sponsor)||void 0===v?void 0:v.logo)||"",content:f.widget_text||""},startDate:g,endDate:p}:null}),u=(0,a.Jj)(e=>void 0!==e&&e?{value:e.code||"",label:e.label||""}:null);var d=n("09QT"),c=n("oQBk");let getEventZones=()=>(0,d.d)(c.y.RAMADAN_WIDGET.GET_ZONES),getPrayerTimes=e=>(0,d.d)(c.y.RAMADAN_WIDGET.GET_PRAYER_TIMES,{params:e});var s=n("QiCV"),m=n("H+I9"),v=n("Tk9B"),f=n("Qx0X"),g=n("yv45"),p=n("JPk0");let createRamadanStore=e=>(0,o.M)((t,n)=>{let i=(null==e?void 0:e.toDate)||r()();return{loading:!1,shouldRender:!1,error:null,toDate:i,imsakDate:null,maghribDate:null,nextImsakDate:null,errorCurrentLocation:!1,loadingCurrentLocation:!1,listZone:null,ramadanEvent:null,colorShade:(0,g.kW)(f.D),selectedZone:null,currentZone:null,status:p.I.IDLE,currentLocation:(null==e?void 0:e.currentLocation)||null,setStatus:e=>t({status:e}),setSelectedZone:e=>t({selectedZone:e}),setCurrentLocation:e=>t({currentLocation:e}),setCurrentZone:e=>t({currentZone:e}),setLoadingCurrentLocation:e=>t({loadingCurrentLocation:e}),setErrorCurrentLocation:e=>t({errorCurrentLocation:e}),handleChangeZone:async e=>{let i=n(),{toDate:r}=i||{};if(r){t({loading:!0,error:null});try{let n=await getPrayerTimes({zoneId:e,date:r.format("YYYY-MM-DD")}),o=l((null==n?void 0:n.data)||null);t({...i,...(0,g.lR)(r,o)})}catch(e){t({error:e.message,ramadanEvent:null})}finally{t({loading:!1})}}},handleChangeLocation:async e=>{let i=n();t({loadingCurrentLocation:!0});let{toDate:r,currentLocation:o}=i||{},a=o;if(!a){let e=await (0,v.k)(),t=null==e?void 0:e.location;a=(null==t?void 0:t.latitude)&&(null==t?void 0:t.longitude)?t:null}if(a){let[n]=await Promise.all([getPrayerTimes({lat:a.latitude||"",lng:a.longitude||"",date:null==r?void 0:r.format("YYYY-MM-DD")})]),o=l((null==n?void 0:n.data)||null);t({...i,...(0,g.lR)(r,o),currentLocation:a,loadingCurrentLocation:!1}),null==e||e()}else t({errorCurrentLocation:!0,loadingCurrentLocation:!1})},fetchInitData:async()=>{let e=n(),{loading:r,listZone:o,currentLocation:a}=e||{};if(!r&&!o){t({loading:!0,error:null});try{var d;let n=(null==a?void 0:a.latitude)&&(null==a?void 0:a.longitude),r=n?a:null;if(!r){let e=await (0,v.k)(!1),t=(null==e?void 0:e.location)||null,n=(null==t?void 0:t.latitude)&&(null==t?void 0:t.longitude);n&&(r=t)}let[o,c,s]=await Promise.all([getEventZones(),getPrayerTimes({date:null==i?void 0:i.format("YYYY-MM-DD")}),getPrayerTimes({lat:(null==r?void 0:r.latitude)||"",lng:(null==r?void 0:r.longitude)||"",date:null==i?void 0:i.format("YYYY-MM-DD")})]),m=l(c.data),f=l(s.data),p=(0,g.Uc)(m);if(!m&&!p.shouldRender){t({shouldRender:!1});return}let k=f||(r?null:m);t({...e,...(0,g.lR)(i,k),listZone:((null==o?void 0:null===(d=o.data)||void 0===d?void 0:d.zones)||[]).map(u),currentLocation:r})}catch(e){t({error:e.message})}finally{t({loading:!1})}}},updateTime:e=>{let{imsakDate:i,maghribDate:r,nextImsakDate:o}=n();t({toDate:e,status:(0,s.Vy)({toDate:e,imsakDate:i,maghribDate:r,nextImsakDate:o})})},getCountDownData:()=>{let{status:e,toDate:t,imsakDate:i,maghribDate:r}=n(),o=e===p.I.COUNT_DOWN_TO_PRAY_TIME?i:r;return(0,m.VA)({starDate:t,endDate:o})},handleCloseLocatorDropdown:()=>{t({loadingCurrentLocation:!1,errorCurrentLocation:!1})}}})},JPk0:function(e,t,n){"use strict";var i,r;n.d(t,{I:function(){return i}}),(r=i||(i={})).IDLE="idle",r.COUNT_DOWN_TO_PRAY_TIME="count_down_to_pray_time",r.COUNT_DOWN_TO_BREAKING_TIME="count_down_to_breaking_time"},d30B:function(e,t,n){var i=n("q1tI");function Info(e){return i.createElement("svg",e,[i.createElement("path",{d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z",fill:"#2D87F3",key:0}),i.createElement("path",{d:"M8 11V8",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",key:1}),i.createElement("path",{d:"M8 5H8.01",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",key:2})])}Info.defaultProps={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},e.exports=Info,Info.default=Info},hvR8:function(e,t,n){var i=n("q1tI");function Danger(e){return i.createElement("svg",e,[i.createElement("path",{d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",fill:"#262626",key:0}),i.createElement("path",{d:"M14.8286 9.17163L9.17176 14.8285",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",key:1}),i.createElement("path",{d:"M9.17139 9.17163L14.8282 14.8285",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",key:2})])}Danger.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},e.exports=Danger,Danger.default=Danger},X1xk:function(e,t,n){var i=n("q1tI");function Success(e){return i.createElement("svg",e,[i.createElement("path",{d:"M10.0001 18.3334C14.6025 18.3334 18.3334 14.6024 18.3334 10C18.3334 5.39765 14.6025 1.66669 10.0001 1.66669C5.39771 1.66669 1.66675 5.39765 1.66675 10C1.66675 14.6024 5.39771 18.3334 10.0001 18.3334Z",fill:"#00B16A",key:0}),i.createElement("path",{d:"M13.8333 7.5L8.33325 12.5L5.83325 10.2273",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",key:1})])}Success.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},e.exports=Success,Success.default=Success},l0B8:function(e,t,n){var i=n("q1tI");function Warning(e){return i.createElement("svg",e,i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 1.66666C5.4 1.66666 1.66667 5.39999 1.66667 9.99999C1.66667 14.6 5.4 18.3333 10 18.3333C14.6 18.3333 18.3333 14.6 18.3333 9.99999C18.3333 5.39999 14.6 1.66666 10 1.66666ZM10 10.8333C9.54167 10.8333 9.16667 10.4583 9.16667 9.99999V6.66666C9.16667 6.20832 9.54167 5.83332 10 5.83332C10.4583 5.83332 10.8333 6.20832 10.8333 6.66666V9.99999C10.8333 10.4583 10.4583 10.8333 10 10.8333ZM9.16667 12.5V14.1667H10.8333V12.5H9.16667Z",fill:"#FE921D"}))}Warning.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},e.exports=Warning,Warning.default=Warning},VYCi:function(){},"A/s0":function(){},YZfw:function(){},uMuU:function(){}}]);