1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6488],{20869:(e,t,l)=>{l.d(t,{Q:()=>r});var n=l(212115);let r=e=>{let{editingItem:t,form:l,iconValues:r,iconColor:i,iconAlign:a,isShow:o,isLinkedToCategory:u,linkedCategories:d,showIcon:s,onAdd:c}=e,v=(0,n.useRef)(null),g=(0,n.useRef)(!0),m=(0,n.useRef)({editingItem:t,formValues:l.getFieldsValue(),iconValues:r,iconColor:i,iconAlign:a,isShow:o,isLinkedToCategory:u,linkedCategories:d,showIcon:s});(0,n.useEffect)(()=>{m.current.editingItem=t,t&&(m.current.iconValues=r,m.current.iconColor=i,m.current.iconAlign=a,m.current.isShow=o,m.current.isLinkedToCategory=u,m.current.linkedCategories=d,m.current.showIcon=s)},[t,r,i,a,o,u,d,s]),(0,n.useEffect)(()=>{if(t){let e=null!==t.url&&void 0!==t.url?t.url:t.isLinkedToCategory?void 0:"";m.current.formValues={label:t.label,parentId:t.parentId||"none",url:e}}},[t]);let p=(0,n.useCallback)(()=>{if(!t)return;let e=m.current.formValues||l.getFieldsValue(),n="none"===e.parentId?null:e.parentId,v=!!n,g=null!==e.url&&void 0!==e.url&&e.url?e.url.trim():"";c({...t,label:e.label,parentId:n,url:g,icon:r,iconColor:i,iconAlign:a,isShow:o,isLinkedToCategory:!v&&u,linkedCategories:v?[]:d,showIcon:s})},[t,l,r,i,a,o,u,d,s,c]),h=(0,n.useCallback)(()=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{p()},300)},[p]),y=(0,n.useCallback)(()=>{v.current&&clearTimeout(v.current),p()},[p]),f=(0,n.useCallback)(()=>{g.current=!1},[]);return(0,n.useEffect)(()=>()=>{if(v.current&&clearTimeout(v.current),!g.current)return;let e=m.current;if(!e.editingItem||!e.formValues)return;let t=e.formValues,l="none"===t.parentId?null:t.parentId,n=!!l,r=t.url?t.url.trim():"";c({...e.editingItem,label:t.label,parentId:l,url:r,icon:e.iconValues,iconColor:e.iconColor,iconAlign:e.iconAlign,isShow:e.isShow,isLinkedToCategory:!n&&e.isLinkedToCategory,linkedCategories:n?[]:e.linkedCategories,showIcon:e.showIcon})},[]),{updateFieldInRef:(e,t)=>{m.current.formValues&&(m.current.formValues[e]=t)},debouncedUpdate:h,immediateUpdate:y,disableAutoSave:f}}},28438:(e,t,l)=>{l.d(t,{N:()=>a});var n=l(212115),r=l(995838),i=l(254624);let a=(e,t,l,a)=>
1{let[o,u]=(0,n.useState)(1),[d,s]=(0,n.useState)((null==a?void 0:a.pageSize)||10),[c,v]=(0,n.useState)("");(0,n.useEffect)(()=>u(1),[JSON.stringify(l)]);let{data:g,error:m,isLoading:p,isFetching:h,refetch:y}=(0,r.I)({queryKey:[...e,l,o,d,c,"usePage"],queryFn:async e=>{let{signal:n}=e,r=await t({...l,page:o-1,size:d,sort:c},n);return(0,i.E)(r)},initialData:{content:[],total:0},...a}),f=(0,n.useCallback)((e,t)=>{u(e),s(t)},[]),I=(0,n.useCallback)((e,t,l,n)=>{let{action:r}=n;"paginate"===r?(u(e.current),s(e.pageSize)):"sort"===r&&(l.order?v("".concat(l.field,",").concat(l.order.slice(0,-3).toUpperCase())):v(""))},[]);return{data:g,error:m,isLoading:p,isFetching:h,page:o,pageSize:d,content:(null==g?void 0:g.content)||[],total:null==g?void 0:g.total,refetch:y,pagination:{current:o,pageSize:d,total:null==g?void 0:g.total,onChange:f,showSizeChanger:(null==g?void 0:g.total)>0&&!(null==a?void 0:a.pageSize),position:["bottomCenter"],pageSizeOptions:[10,20,50]},onChange:I}}},62938:(e,t,l)=>{l.d(t,{A:()=>a});var n=l(705041),r=l(724895),i=l(484404);let a=function(e){let{router:t,setVisibleModal:l,setInfoModal:a,errorModal:o,user:u,url:d}=e;return{mutationSendLinkActivate:(0,n.n)({mutationFn:r.A.resendActivationMail,onSuccess:()=>{t.push(i.A.getPortalByCustomerType(u.customerType).createPath(d))},onError:()=>{l(!0),a(o)}})}}},70568:(e,t,l)=>{l.d(t,{v:()=>d});var n=l(212115),r=l(135695),i=l(995838),a=l(705041),o=l(245834),u=l(556943);let d=()=>{let e=(0,r.useSearchParams)(),t=(0,r.useRouter)(),[l,d]=(0,n.useState)(!1),{data:s}
1=(0,i.I)({queryKey:["getSystemParamCookieAffiliate"],queryFn:async()=>{let e=await o.A.getSystemParamCookieAffiliate();return null==e?void 0:e.paramIntegerValue},refetchOnWindowFocus:!1,refetchOnMount:!1,initialData:0}),c=(0,a.n)({mutationKey:["countLink"],mutationFn:u.A.countClickAffiliate,onError:e=>{(null==e?void 0:e.errorCode)&&d(!0),t.replace("/inactive-affiliate")}});return(0,n.useEffect)(()=>{if(e.get("aff_source")&&e.get("aff_content")&&e.get("aff_id_agency")){let t=[{key:"current_distributed_link",value:window.location.href.replace("https://","").replace("http://","")}];e.forEach((e,l)=>t.push({key:l,value:e})),c.mutate(t)}},[e]),{affiliateCookieExpireTime:s,isInactiveLink:l}}},72103:(e,t,l)=>{l.d(t,{g:()=>r});var n=l(212115);let r=e=>{let{isEnabled:t,textAlign:l,columnContentAlign:r,setProp:i}=e,a=(0,n.useRef)(!1);(0,n.useEffect)(()=>{!a.current&&(a.current=!0,t&&"left"===l&&r&&i(e=>{e.desktop.textAlign=void 0,e.tablet.textAlign=void 0,e.mobile.textAlign=void 0}))},[t,l,r,i])}},103957:(e,t,l)=>{l.d(t,{b:()=>a});var n=l(212115),r=l(195889);let i=(e,t)=>{let[l,i]=(0,n.useState)({top:0,left:0,width:0,isVisible:!0}),a=(0,n.useCallback)(()=>{if(e.current&&t)try{(0,r.xX)(),(0,r.gT)();let t=e.current.getBoundingClientRect(),l=t.top>=-10&&t.bottom>0&&t.height>0,n=(0,r.Kk)(e.current).getBoundingClientRect(),a=e.current.ownerDocument!==document,o={x:0,y:0};if(a){let e=document.querySelector("iframe");if(e){let t=e.getBoundingClientRect();o.x=t.left,o.y=t.top}}let u=Math.max(n.left+o.x,0),d=t.bottom+o.y+2,s=window.innerHeight,c=s-t.bottom,v=t.top;c<200&&v>200&&(d=t.top+o.y-200),d=Math.max(d,10),d=Math.min(d,s-200-10),i(e=>{let t={top:d,left:u,width:n.width,isVisible:l};return Math.abs(e.top-t.top)>1||Math.abs(e.left-t.left)>1||Math.abs(e.width-t.width)>1||e.isVisible!==t.isVisible?t:e})}catch(e){console.error("Error calculating dropdown position:",e)}},[e,t]);return(0,n.useEffect)(()=>{if(t){var l;let t;a();let n=()=>a(),r=()=>a(),i=(null==(l=e.current)?void 0:l.getBoundingClientRect().top)||0,o=()=>{var l;let n=(null==(l=e.current)?void 0:l.getBoundingClientRect().top)||0;Math.abs(n-i)>1&&(a(),i=n),t=requestAnimationFrame(o)};return t=requestAnimationFrame(o),window.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",r,{passive:!0}),()=>{window.removeEventListener("scroll",n),window.removeEventListener("resize",r),t&&cancelAnimationFrame(t)}}},[t,a,e]),l},a=(e,t)=>{let l=(0,n.useRef)({});(0,n.useEffect)(()=>{let t=new Set((null==e?void 0:e.map(e=>e.value))||[]);Object.keys(l.current).map(Number).forEach(e=>{t.has(e)||delete l.current[e]})},[e]);let r=null==e?void 0:e.find(e=>e.value===t),a=i({current:l.current[t||-1]||null},!!t&&!!(null==r?void 0:r.isLinkedToCategory));return{menuItemRefs:l,currentHoveredItem:r,dropdownPosition:a,setMenuItemRef:(e,t)=>{l.current[e]=t}}}},111371:(e,t,l)=>{l.d(t,{X:()=>a});var n=l(894135),r=l(954049);let i=(e,t)=>{let{id:l}=(0,n.oB)();return(0,n.hG)(n=>(0,r.p)(n.nodes,l,e,t))},a=(e,t)=>{let{isEnabled:l}=(0,n.hG)(e=>({isEnabled:e.options.enabled}));return{isEditorEnabled:l,headingProps:i(e,t)}}},126221:(e,t,l)=>{l.d(t,{Q:()=>r});var n=l(212115);let r=(e,t)=>{let[l,r]=(0,n.useState)(e);return(0,n.useEffect)(()=>{let l=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(l)}},[e,t]),l}},221577:(e,t,l)=>{l.d(t,{C1:()=>c,TC:()=>s,Wz:()=>v});var n=l(995838),r=l(478563),i=l(556943),a=l(442603),o=l(144801),u=l(8965);let d={DEVICE:"PHYSICAL",SOFTWARE:"DIGITAL",TELECOMMUNICATION:"SERVICE",SAAS:"DIGITAL"},s=(e,t,l,a,o)=>{let{data:u,isLoading:s}=(0,n.I)({queryKey:["getProductList",e,t,l],queryFn:async()=>{let n={search:l?(0,r.XW)(l):void 0,customerType:a,serviceProductType:e,productClassification:d[e],createdSource:r.vb.ONE,order:t.order,categoryIds:(0,r.py)(t.categoryIds)},u=await i.A.getProductLstWithCategory(n);return o&&o(u),u}});return{productLstWithCategory:u,isLoading:s}},c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,{data:l}=(0,n.I)({queryKey:["getServiceRecommend"],queryFn:async()=>{var l;let n=await a.A.getServiceRecommend({size:t,customerType:e});return(null==(l=n.content)?void 0:l.length)?n.content.filter(e=>"DEVICE"!==e.productType).map(o.O7):[]},enabled:"PERSONAL"===e});return{lstServiceRecommend:l}},v=(e,t,l,i)=>{let{data:a,isLoading:o}=(0,n.I)({queryKey:["getComboList",e,t],queryFn:async()=>{let n={search:t?(0,r.XW)(t):void 0,customerType:l,order:e.order,categoryIds:(0,r.py)(e.categoryIds)},a=await u.A.getComboList(n);return i&&i(a),a}});return{comboLstWithCategory:a,isLoading:o}}},224186:(e,t,l)=>{l.d(t,{L:()=>a});var n=l(212115),r=l(171610),i=l(475794);let a=function(){let e=arguments.length>
10&&void 0!==arguments[0]?arguments[0]:"",[t,l]=(0,n.useState)({regionId:null,provinceId:null,wardId:null,streetId:null}),a=(0,n.useCallback)((e,t)=>{l(l=>{let n={...l,[e]:t};return"regionId"===e?(n.provinceId=null,n.wardId=null,n.streetId=null):"provinceId"===e?(n.wardId=null,n.streetId=null):"wardId"===e&&(n.streetId=null),n})},[]),[{data:o,isFetching:u},{data:d,isFetching:s},{data:c,isFetching:v},{data:g,isFetching:m}]=(0,r.E)({queries:[{queryKey:["getAllNation",e],queryFn:async()=>{let e=await i.A.getAllRegion();return null==e?void 0:e.map(e=>({value:e.id,label:e.name}))},initialData:[]},{queryKey:["getProvinceById",t.regionId,e],queryFn:async()=>{var e;let t=await i.A.getProvinces();return null==t||null==(e=t.content)?void 0:e.map(e=>({label:e.name,value:e.id,code:e.code,id:e.id}))},initialData:[]},{queryKey:["getWardById",t.provinceId,e],queryFn:async()=>{var e;let l=await i.A.getWards({provinceId:t.provinceId});return t.provinceId?null==l||null==(e=l.content)?void 0:e.map(e=>({label:null==e?void 0:e.name,value:null==e?void 0:e.id,code:null==e?void 0:e.code})):[]},initialData:[],enabled:!!t.provinceId},{queryKey:["getStreetById",t.wardId,t.provinceId,e],queryFn:async()=>{var e;let l=await i.A.getStreets({provinceId:t.provinceId,wardId:t.wardId});return t.provinceId&&t.wardId?null==l||null==(e=l.content)?void 0:e.map(e=>({value:e.id,label:e.name})):[]},initialData:[],enabled:!!t.wardId}]});return{address:t,updateAddress:a,regionList:o,provinceList:d,wardList:c,streetList:g,loadingCountry:u,loadingProvince:s,loadingWard:v,loadingStreet:m}}},254624:(e,t,l)=>{l.d(t,{E:()=>r});var n=l(610876);let r=e=>{var t;return(null==e||null==(t=e.data)?void 0:t.content)?{content:e.data.content,total:e.data.totalElements,...(0,n.omit)(e,["data"])}:(null==e?void 0:e.content)?{content:e.content,total:e.totalElements}:(null==e?void 0:e.length)>0?{content:e,total:e.length}:(null==e?void 0:e.data)?{content:e.data,total:e.totalElements}:{content:[],total:0}}},294462:(e,t,l)=>{l.d(t,{z:()=>s});var n=l(212115),r=l(894135),i=l(134540),a=l(950402),o=l(712797),u=l(607453),d=l(87339);let s=()=>{var e;let[t,l]=(0,n.useState)(!1),[s,c]=(0,n.useState)(null),v=(0,i.d4)(u.L9),{actions:g,values:m}=(0,r.oB)(e=>({values:e.data.props})),p="mobile"===v?"desktop":v,h=(null==(e=m[p])?void 0:e.items)||[];(0,n.useEffect)(()=>{s&&!(0,d.li)(h,s.value)&&c(null)},[h]);let y=(0,n.useCallback)(e=>{let{active:t,over:l}=e;l&&t.id!==l.id&&g.setProp(e=>{var n;let r=[...(null==(n=e[p])?void 0:n.items)||[]],i=r.findIndex(e=>e.value===t.id),o=r.findIndex(e=>e.value===l.id);e[p]={...e[p],items:(0,a.be)(r,i,o)}})},[g,p]),f=(0,n.useCallback)(e=>new Promise((t,n)=>{try{g.setProp(t=>{var l;let r=(0,d.TW)((null==(l=t[p])?void 0:l.items)||[]);if(e.parentId){if(!(0,d.$Z)(r,e,e.parentId))return void n(Error("Parent menu not found"))}else r.push(e);t[p]={...t[p],items:r}},o.oS),l(!1),c(null),t()}catch(e){n(e)}}),[g,p]),I=(0,n.useCallback)(e=>{g.setProp(t=>{var l;let n=(0,d.TW)((null==(l=t[p])?void 0:l.items)||[]),r=(0,d.TD)(n,s.value),i=r?r.parentItems[r.index]:null,a=(null==i?void 0:i.children)||[];(0,d.ax)(n,s.value);let o={...e,value:s.value,children:a.length>0?a:void 0};if(o.parentId){let e=r&&(null==i?void 0:i.parentId)===o.parentId;(0,d.lu)(n,o,o.parentId,e?r.index:void 0)}else!r||(null==i?void 0:i.parentId)?n.push(o):n.splice(r.index,0,o);t[p]={...t[p],items:n}})},[g,s,p]),C=(0,n.useCallback)(e=>{c(null),g.setProp(t=>{var l;let n=(0,d.TW)((null==(l=t[p])?void 0:l.items)||[]);(0,d.ax)(n,e),t[p]={...t[p],items:n}})},[g,p]);return{menuItems:h,showAddForm:t,editingItem:s,setShowAddForm:l,handleDragEnd:y,handleAddMenuItem:f,handleUpdateMenuItem:I,handleDeleteMenuItem:C,handleToggleEdit:(0,n.useCallback)((e,t)=>{try{e.stopPropagation(),e.preventDefault(),setTimeout(()=>{try{c(e=>(null==e?void 0:e.value)===t.value?null:t)}catch(e){console.error("[MenuBar] Error in setEditingItem:",e)}},0)}catch(e){console.error("[MenuBar] Error in handleToggleEdit:",e)}},[]),handleUpdateEditingItem:(0,n.useCallback)(e=>{try{setTimeout(()=>{try{c(e)}catch(e){console.error("[MenuBar] Error in setEditingItem (update):",e)}},0)}catch(e){console.error("[MenuBar] Error in handleUpdateEditingItem:",e)}},[])}}},298710:(e,t,l)=>{l.d(t,{l:()=>a});var n=l(135695),r=l(995838),i=l(556943);let a=()=>{var e;
1let t=(0,n.useSearchParams)().get("redirect"),l=(e=new URL("https:"+t),e.searchParams),a=(null==l?void 0:l.get("pricingId"))||(null==l?void 0:l.get("comboId"))||(null==l?void 0:l.get("serviceId")),o=(null==l?void 0:l.get("pricingId"))?"PRICING":(null==l?void 0:l.get("comboId"))?"COMBO":(null==l?void 0:l.get("serviceId"))?"SERVICE":void 0,{data:u,isFetching:d}=(0,r.I)({queryKey:["getProductCustomerType",a,o],queryFn:()=>i.A.getProductCustomerType(a,o),enabled:!!a&&!!o,initialData:[]});return{productCustomerType:u,loadingProductCustomerType:d,redirectUrl:t}}},326752:(e,t,l)=>{l.d(t,{p:()=>r});var n=l(894135);let r=()=>{let{actions:e,query:t}=(0,n.hG)();return{setSectionVisibility:(l,n)=>{if(e&&t)try{let r=t.getNodes(),i=Object.keys(r).find(e=>{var t,n,i;return(null==(i=r[e])||null==(n=i.data)||null==(t=n.props)?void 0:t.id)===l});i&&e.setHidden(i,!n)}catch(e){}},setItemsVisibility:function(l,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4;if(e&&t)try{let i=t.getNodes(),a=Object.keys(i);for(let t=1;t<=r;t++){let r="".concat(l,"-").concat(t),o=a.find(e=>{var t,l,n;return(null==(n=i[e])||null==(l=n.data)||null==(t=l.props)?void 0:t.id)===r});o&&e.setHidden(o,!n[t-1])}}catch(e){}},editorActions:e,query:t}}},373885:(e,t,l)=>{l.d(t,{_:()=>a});var n=l(212115),r=l(995838),i=l(254624);let a=(e,t,l,a)=>
1{let[o,u]=(0,n.useState)(1),d=(0,n.useMemo)(()=>(null==a?void 0:a.pageSize)||10,[a]),[s,c]=(0,n.useState)((null==l?void 0:l.sort)||null),[v,g]=(0,n.useState)({content:[],total:0});(0,n.useEffect)(()=>{g({content:[],total:0}),u(1)},[JSON.stringify(l)]);let{error:m,isLoading:p,isFetching:h,refetch:y}=(0,r.I)({queryKey:[...e,l,o,d,s,"usePageScroll"],queryFn:async()=>{let e=await t({...l,page:0,size:o*d,sort:s}).catch(()=>g({content:[],total:0}));g((0,i.E)(e))},...a}),f=(0,n.useCallback)(()=>{(null==v?void 0:v.total)>=o*d&&u(o+1)},[v,o,d]),I=(0,n.useCallback)(e=>{var t,l,n;let r=(null==e||null==(t=e.target)?void 0:t.scrollTop)!==void 0?e.target.scrollTop:document.documentElement.scrollTop,i=((null==e||null==(l=e.target)?void 0:l.scrollHeight)!==void 0?e.target.scrollHeight:document.documentElement.scrollHeight)-((null==e||null==(n=e.target)?void 0:n.clientHeight)!==void 0?e.target.clientHeight:document.documentElement.clientHeight);((null==a?void 0:a.threshold)?a.threshold>1?i-r<=a.threshold:r/i>=a.threshold:r/i>=.99)&&f()},[f,a]),C=(0,n.useCallback)((e,t,l,n)=>{let{action:r}=n;"sort"===r&&(l.order?c("".concat(l.field,",").concat(l.order.slice(0,-3).toUpperCase())):c(""))},[]);return{data:v,error:m,isLoading:p,isFetching:h,page:o,pageSize:d,content:(null==v?void 0:v.content)||[],total:null==v?void 0:v.total,refetch:y,loadMore:f,onChange:C,onScroll:I}}},374749:(e,t,l)=>{l.d(t,{Q:()=>a});var n=l(212115);let r={isMobile:"(max-width: 480px)",isDesktop:"(min-width: 481px)",isTablet:"(min-width: 481px) and (max-width: 767px)"};function i(e){let t=(0,n.useCallback)(t=>{let l=window.matchMedia(e);return l.addEventListener("change",t),()=>l.removeEventListener("change",t)},[e]);return(0,n.useSyncExternalStore)(t,()=>window.matchMedia(e).matches,()=>!1)}let a=()=>({isMobile:i(r.isMobile),isDesktop:i(r.isDesktop),isTablet:i(r.isTablet)})},397099:(e,t,l)=>{l.d(t,{i:()=>r});var n=l(212115);let r=()=>{let[e,t]=(0,n.useState)(null),[l,r]=(0,n.useState)(null),i=(0,n.useCallback)(()=>{l&&(clearTimeout(l),r(null))},[l]),a=(0,n.useCallback)(l=>{i(),e!==l&&r(setTimeout(()=>{t(l)},50))},[e,i]),o=(0,n.useCallback)(()=>{if(!l){let e=setTimeout(()=>{t(null),r(null)},300);r(e)}},[l]),u=(0,n.useCallback)(()=>{i()},[i]),d=(0,n.useCallback)(()=>{i(),t(null)},[i]);return(0,n.useEffect)(()=>()=>{l&&clearTimeout(l)},[l]),{hoveredItem:e,handleMouseOver:a,handleMouseOut:o,handleDropdownMouseEnter:u,handleDropdownMouseLeave:d}}},414094:(e,t,l)=>{l.d(t,{J:()=>u});var n=l(212115),r=l(135695),i=l(134540),a=l(484404),o=l(91433);let u=()=>{let e=(0,i.wA)(),t=(0,i.d4)(o.mB),l=(0,i.d4)(o.xs),u=(0,r.useRouter)(),d=(0,r.usePathname)(),s=(0,r.useSearchParams)().get("isWorkplace"),c=(0,n.useMemo)(()=>(null==d?void 0:d.startsWith(a.A.sme.path))||(null==d?void 0:d.startsWith("/verify")),[d]),v=!!(null==t?void 0:t.id);return{user:t,updateUser:t=>{t?e(o.tR.updateUser(t)):e(o.tR.updateUser({}))},clearUser:()=>{"true"===s?u.push(a.A.getPortalByCustomerType(t.customerType).createPath("",void 0)):c&&("FALSE"===localStorage.getItem("pageNotPrivate")||"true"===s)&&u.push(a.A.getPortalByCustomerType(t.customerType).createPath("",void 0)),e(o.tR.updateUser({isAffiliateLogout:"YES"===t.isAffiliate?1:2}))},changeStatus:t=>{e(o.tR.changeStatus(t))},changeNotifyToken:t=>{e(o.tR.updateNotifyToken(t))},tokenNotify:l,isLoggedIn:v}}},436430:(e,t,l)=>{l.d(t,{p:()=>n});let n=e=>{let{editingCategoryId:t,linkedCategories:l,expandedCategories:n,setEditingCategoryId:r,setLinkedCategories:i,setExpandedCategories:a,setShowCategoryIconModal:o,updateEditingItem:u}=e;return{handleCategoryIconClick:e=>{r(e),o(!0)},handleCategoryIconUpdate:(e,n,r)=>{if(t){let a=l.map(l=>l.id===t?{...l,icon:e,iconColor:n,iconAlign:r||l.iconAlign||"start"}:l);i(a),u({linkedCategories:a})}},handleCloseCategoryIconModal:()=>{o(!1),r(null)},handleDeleteAllCategories:()=>{i([]),u({linkedCategories:[]})},handleToggleExpanded:e=>{let t=new Set(n);t.has(e)?t.delete(e):t.add(e),a(t)}}}},468977:(e,t,l)=>{l.d(t,{I:()=>f});var n=l(212115),r=l(135695),i=l(134540),a=l(995838),o=l(952878),u=l(484404),d=l(7322),s=l(597195),c=l(144801),v=l(442603),g=l(840478),m=l(872107),p=l(953635);let h={activeTab:"TELECOMMUNICATION",pricingMultiPlanId:0,pricingId:0,isOpenChooseAddon:!1,countClick:0,serviceId:0,variantId:0},y=(e,t)=>{switch(t.type){case"SET_ACTIVE_TAB":return{...e,activeTab:t.payload};case"SET_ID_PRICING_PERIOD":return{...e,pricingMultiPlanId:t.payload.pricingMultiPlanId,pricingId:t.payload.pricingId,countClick:t.payload.countClick,serviceId:t.payload.serviceId,variantId:t.payload.variantId};case p.U.SET_OPEN_MODAL_CHOOSE_ADDON:return{...e,isOpenChooseAddon:t.payload};default:return e}},f=e=>{let{defaultActiveTab:t}=e,l=(0,r.useRouter)(),f=(0,i.wA)(),[I,C]=(0,n.useReducer)(y,h),{isLoggedIn:A}
1=(0,m.Jd)(),[S,w]=(0,n.useState)(!1),b=(0,r.usePathname)(),T=u.A.getPortalTypeByPath(b).path,E=o.tV[T.split("/")[1]],P=(0,i.d4)(g.yN),k=(0,i.d4)(g.mx),{pricingMultiPlanId:O,pricingId:F,countClick:M}=I,L=(0,n.useCallback)(()=>{if(!A)return void w(!0);["SAAS","TELECOMMUNICATION"].includes(t||I.activeTab)&&l.push("/checkout/service?pricingId=".concat(I.pricingId,"&pricingMultiPlanId=").concat(I.pricingMultiPlanId,"&serviceId=").concat(I.serviceId))},[A,I.activeTab,t,l,I.pricingId,I.pricingMultiPlanId,I.serviceId]),{isFetching:q}=(0,a.I)({queryKey:["getAddonList",O,M],queryFn:async()=>{var e;let t=await v.A.getAddonList(F,{pricingMultiPlanId:O,customerType:E});return t&&(t=(0,c.mv)(t)),f(g.Ed.initBilling(t)),(null==t||null==(e=t.addons)?void 0:e.length)?C({type:p.U.SET_OPEN_MODAL_CHOOSE_ADDON,payload:!0}):L(),t},initialData:[],enabled:!!F&&M>0}),{isLoading:N}=(0,a.I)({queryKey:["getDataCalculateAddon",P],queryFn:async()=>{let e=await d.A.getCalculateAddon((0,s.wM)(k));return f(g.Ed.handleCalculateAddon(e)),e},enabled:!!F&&!q&&!!(null==k?void 0:k.length)}),D=(0,n.useCallback)((e,t,l)=>{if(!A)return void w(!0);t&&C({type:"SET_ID_PRICING_PERIOD",payload:{pricingMultiPlanId:e,pricingId:t,serviceId:l,countClick:I.countClick+1,variantId:0}})},[A,I.countClick]);return{state:I,dispatch:C,onBuyNow:L,handleBuyNow:D,dispatchRedux:f,isLoadingCalculate:N,isFetchingAddon:q,isConfirmLogin:S,setIsConfirmLogin:w}}},470278:(e,t,l)=>{l.d(t,{P:()=>r});var n=l(212115);let r=(e,t,l)=>{let[r,i]=(0,n.useState)(e),a=void 0!==t?t:r,o=(0,n.useCallback)(e=>{let t="function"==typeof e?e(a):e;l?l(t):i(e)},[l,a]);return[a,o]}},472971:(e,t,l)=>{l.d(t,{A:()=>o});var n=l(212115),r=l(995838),i=l(215718),a=l(475794);let o=(e,t)=>{let l=i.A.useFormInstance(),o=t||l,u=i.A.useWatch([],o),d=(0,n.useMemo)(()=>e||u,[u,e]),s=(0,n.useCallback)(t=>{e?Object.assign(e,t):o.setFieldsValue(t)},[o,e]),{data:c,isFetching:v}=(0,r.I)({queryKey:["getAllProvince"],queryFn:()=>a.A.getProvinces().then(e=>{var t,l;return null==e||null==(l=e.content)?void 0:l.reduce((e,t)=>({...e,[t.id]:t.name}),{list:null==e||null==(t=e.content)?void 0:t.map(e=>({label:null==e?void 0:e.name,value:null==e?void 0:e.id}))})})}),{data:g,isFetching:m}=(0,r.I)({queryKey:["getAllWard",null==d?void 0:d.provinceId],queryFn:()=>a.A.getWards({provinceId:null==d?void 0:d.provinceId}).then(e=>{var t,l;return null==e||null==(l=e.content)?void 0:l.reduce((e,t)=>({...e,[t.id]:t.name}),{list:null==e||null==(t=e.content)?void 0:t.map(e=>({label:null==e?void 0:e.name,value:null==e?void 0:e.id}))})}).then(e=>((null==e?void 0:e[null==d?void 0:d.wardId])||s({wardId:void 0,streetId:void 0}),e)),enabled:!!(null==d?void 0:d.provinceId)}),{data:p,isFetching:h}=(0,r.I)({queryKey:["getAllStreet",null==d?void 0:d.provinceId,null==d?void 0:d.wardId],queryFn:()=>a.A.getStreets({provinceId:null==d?void 0:d.provinceId,wardId:null==d?void 0:d.wardId}).then(e=>{var t,l;return null==e||null==(l=e.content)?void 0:l.reduce((e,t)=>({...e,[t.id]:t.name}),{list:null==e||null==(t=e.content)?void 0:t.map(e=>({label:null==e?void 0:e.name,value:null==e?void 0:e.id}))})}).then(e=>((null==e?void 0:e[null==d?void 0:d.streetId])||s({streetId:void 0}),e)),enabled:!!(null==d?void 0:d.provinceId)&&!!(null==d?void 0:d.wardId)}),y=(0,n.useMemo)(()=>{let e=[(null==d?void 0:d.homeNumber)?"Sá» ".concat(null==d?void 0:d.homeNumber):"",null==p?void 0:p[null==d?void 0:d.streetId],null==g?void 0:g[null==d?void 0:d.wardId],null==c?void 0:c[null==d?void 0:d.provinceId]].filter(e=>!!e).join(", ");return s({address:e}),e},[null==d?void 0:d.homeNumber,null==d?void 0:d.provinceId,null==d?void 0:d.streetId,null==d?void 0:d.wardId,s,c,p,g]);return{provinceId:null==d?void 0:d.provinceId,provinces:c,loadingProvinces:v,wardId:null==d?void 0:d.wardId,wards:g,loadingWards:m,streetId:null==d?void 0:d.streetId,streets:p,loadingStreets:h,address:y}}},535164:(e,t,l)=>{l.d(t,{N:()=>d});var n=l(135695),r=l(705041),i=l(857383),a=l(724895),o=l(414094),u=l(70568);let d=e=>{let{onSuccessCallback:t}=e||{},{affiliateCookieExpireTime:l}=(0,u.v)(),{clearUser:d}=(0,o.J)(),s=(0,n.useRouter)();return(0,r.n)({mutationFn:a.A.logout,onSuccess:(e,n,r)=>{i.A.remove("matomoUrl"),i.A.remove("_aff_network"),i.A.remove("_aff_sid"),i.A.remove("apinfo"),i.A.remove("APINFO"),window.localStorage.removeItem("localCartIdEnterprise"),window.localStorage.removeItem("localCartIdHouseHold"),window.localStorage.removeItem("localCartIdPersonal"),d(),0===l&&(i.A.remove("affiliate_link_code"),i.A.remove("aff_u"),i.A.remove("aff_source")),s.replace("/sme-portal/login"),t&&t(e,n,r)}})}},547821:(e,t,l)=>{l.d(t,{u:()=>u});var n=l(215718),r=l(134540),i=l(952878),a=l(607453),o=l(767933);let u=()=>{let e=n.A.useWatch("selectedProduct"),t=(0,r.d4)(a.vf),l=(null==e?void 0:e.serviceId)||(null==t?void 0:t.serviceId)||(0,i.Mg)(),u=(null==e?void 0:e.pricingId)||(null==t?void 0:t.pricingId),{data:d,isLoading:s,error:c}=(0,o.S)(l,u,"getServiceDetail");return{serviceDetail:d,isLoading:s,error:c,selectedProduct:e,serviceId:l,pricingId:u}}},598767:(e,t,l)=>{l.d(t,{w:()=>i});var n=l(995838),r=l(291881);let i=()=>(0,n.I)({queryKey:["getLstProvince"],queryFn:async()=>{let e=await r.A.getContactProvinces();return null==e?void 0:e.map(e=>({label:e.name,value:e.id})).sort((e,t)=>
1e.label.localeCompare(t.label,"vi"))},initialData:[]})},625856:(e,t,l)=>{l.d(t,{A:()=>s});var n=l(212115),r=l(995838),i=l(406239),a=l(535164),o=l(414094),u=l(177294);let d=e=>(0,r.I)({queryKey:["systemParamIdleTime"],queryFn:async()=>{let e=await i.A.getDetailSystemParam("INFORMATION_SECURITY");if(!(null==e?void 0:e.paramTextValue))return null;let t=JSON.parse(null==e?void 0:e.paramTextValue),l=null==t?void 0:t.idleSessionTimeout;if(!l)return null;let n=Number(l.hours)||0;return 60*n*6e4+60*(Number(l.minutes)||0)*1e3+1e3*(Number(l.seconds)||0)},refetchOnWindowFocus:!1,enabled:!!e}),s=e=>{let{onSuccessLogout:t}=e,{user:l,tokenNotify:r}=(0,o.J)(),{data:i}=d(null==l?void 0:l.id),s=(0,a.N)({onSuccessCallback(){null==t||t()}}),c=(0,n.useCallback)(()=>{s.mutateAsync({deviceToken:r,user:l}),(0,u.US)()},[s,r,l]);(0,n.useEffect)(()=>{if(!i)return;let e=new BroadcastChannel("activity-sync"),t=()=>{localStorage.setItem("lastActivity",Date.now().toString()),e.postMessage("activity-reset")},l=["mousemove","keydown","scroll","click"];l.forEach(e=>{window.addEventListener(e,t)}),e.onmessage=e=>{"activity-reset"===e.data&&localStorage.setItem("lastActivity",Date.now().toString())};let n=setInterval(()=>{let e=localStorage.getItem("lastActivity");Date.now()-Number(e||"0")>i&&c()},6e4);return()=>{l.forEach(e=>{window.removeEventListener(e,t)}),clearInterval(n),e.close()}},[i,c])}},687100:(e,t,l)=>{l.d(t,{p:()=>a});var n=l(212115),r=l(894135),i=l(787178);let a=(e,t,l)=>{let{actions:a,query:o}=(0,r.hG)(),u=(0,n.useRef)(void 0);(0,n.useEffect)(()=>{var n,r,d;if(!e||!t)return;if(void 0===u.current){u.current=t;return}if(u.current===t)return;u.current=t;let s=(0,i.KB)(t),c=[];try{let t=o.node(e).get();if(!t)return;let l=(null==(n=t.data)?void 0:n.nodes)||[];c.push(...l)}catch(e){return}for(;c.length;){let e=c.shift();try{let t=o.node(e).get();if(!t)continue;(null==(r=t.data)?void 0:r.displayName)==="VÄn bản"&&a.setProp(e,e=>{(null==e?void 0:e[l])&&(e[l].textAlign=s)});let n=(null==(d=t.data)?void 0:d.nodes)||[];(null==n?void 0:n.length)&&c.push(...n)}catch(e){}}},[a,t,e,o,l])}},688548:(e,t,l)=>{l.d(t,{L:()=>o});var n=l(212115),r=l(894135),i=l(134540),a=l(607453);let o=()=>{let{query:e}=(0,r.hG)(),{id:t}=(0,r.oB)(),l=(0,i.d4)(a.L9),o=(0,n.useMemo)(()=>{try{let r=e.node(t).get().data.parent;for(;r;){let t=e.node(r).get();if("Column"===t.data.displayName){var n;return null==(n=t.data.props[l])?void 0:n.contentAlign}r=t.data.parent}}catch(e){}return null},[e,t,l]);return{parentColumnContentAlign:o,isInheritedFromColumn:!!o}}},725825:(e,t,l)=>{l.d(t,{s:()=>s});var n=l(212115),r=l(215718),i=l(844098),a=l(132890);let o=e=>null!==e.url&&void 0!==e.url?e.url:e.isLinkedToCategory?void 0:"",u=e=>e?e.trim():"",d=(e,t)=>!!e&&""!==t&&e!==t,s=(e,t)=>{var l,s,c;let[v]=r.A.useForm(),[g,m]=(0,n.useState)((null==e?void 0:e.icon)||i.zY.MENU_ICON),[p,h]=(0,n.useState)((null==e?void 0:e.iconColor)||i.zY.ICON_COLOR),[y,f]=(0,n.useState)((null==e?void 0:e.iconAlign)||i.zY.ICON_ALIGN),[I,C]=(0,n.useState)(null!=(l=null==e?void 0:e.showIcon)&&l),[A,S]=(0,n.useState)(null==(s=null==e?void 0:e.isShow)||s),[w,b]=(0,n.useState)(null!=(c=null==e?void 0:e.isLinkedToCategory)&&c),[T,E]=(0,n.useState)((null==e?void 0:e.linkedCategories)||[]),[P,k]=(0,n.useState)((null==e?void 0:e.linkedCategories)||[]),[O,F]=(0,n.useState)(!1),[M,L]=(0,n.useState)(!1),[q,N]=(0,n.useState)(!1),[D,R]=(0,n.useState)(null),[V,_]=(0,n.use
1State)(null),[x,B]=(0,n.useState)(new Set);(0,n.useEffect)(()=>{T.length>0&&B(new Set(T.filter(e=>1===e.level).map(e=>e.id)))},[T]),(0,n.useEffect)(()=>{if(e){var t,l;let n=o(e);v.setFieldsValue({label:e.label,parentId:e.parentId||"none",url:n}),m(e.icon),h(e.iconColor),f(e.iconAlign||i.zY.ICON_ALIGN),S(e.isShow),b(null!=(t=e.isLinkedToCategory)&&t),E(e.linkedCategories||[]),C(null!=(l=e.showIcon)&&l)}},[null==e?void 0:e.value]);let W=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=v.getFieldsValue(),n=t.linkedCategories||T,r=u(l.url),i=void 0!==t.url?t.url:r;return{...e,label:l.label,parentId:"none"===l.parentId?null:l.parentId,url:i,icon:g,iconColor:p,iconAlign:y,isShow:A,isLinkedToCategory:w,linkedCategories:n,showIcon:I,...t}},U=l=>{if(e)try{setTimeout(()=>{try{t(W(l))}catch(e){console.error("[MenuBarForm] Error in onAdd:",e)}},0)}catch(e){console.error("[MenuBarForm] Error in updateEditingItem:",e)}};return{form:v,iconValues:g,iconColor:p,iconAlign:y,showIcon:I,isShow:A,isLinkedToCategory:w,linkedCategories:T,savedLinkedCategories:P,showCategoryModal:O,showCategoryIconModal:M,showCategoryUrlModal:q,editingCategoryId:D,editingCategory:V,expandedCategories:x,setIconValues:m,setIconColor:h,setIconAlign:f,setShowIcon:C,setIsShow:S,setIsLinkedToCategory:b,setLinkedCategories:E,setSavedLinkedCategories:k,setShowCategoryModal:F,setShowCategoryIconModal:L,setShowCategoryUrlModal:N,setEditingCategoryId:R,setEditingCategory:_,setExpandedCategories:B,getUpdatedItem:W,updateEditingItem:U,handleConfirmCategories:e=>{E(e),k(e),F(!1);let t=(0,a.VW)(e),l=v.getFieldValue("url");d(t,l)?(v.setFieldValue("url",t),U({linkedCategories:e,url:t})):U({linkedCategories:e,url:l||""})},handleEditCategoryUrl:e=>{_(e),N(!0)},handleSaveCategoryUrl:(e,t)=>{let l=T.map(l=>{if(l.id===e||l.id.toString()===e.toString())return{...l,...t};if(l.children&&l.children.length>0){let n=l.children.findIndex(t=>t.id===e||t.id.toString()===e.toString());if(-1!==n){let e=[...l.children];return e[n]={...e[n],...t},{...l,children:e}}}return l});E(l),k(l),N(!1),_(null),U({linkedCategories:l})},resetForm:()=>{v.resetFields();let e=(0,a.UP)();m(e.iconValues),h(e.iconColor),f(e.iconAlign),b(e.isLinkedToCategory),E(e.linkedCategories),C(e.showIcon)}}}},767933:(e,t,l)=>{l.d(t,{S:()=>i});var n=l(995838),r=l(556943);let i=(e,t,l,i)=>(0,n.I)({queryKey:[l||"getFilteredServiceInfo",e,t],queryFn:async()=>{let l=await r.A.getServiceInfoPublic(e);if((null==l?void 0:l.pricing)&&t){let e=l.pricing.find(e=>e.id===Number(t));if(e)return{...l,pricing:[e]}}return l},refetchOnWindowFocus:!1,enabled:void 0!==i?i:!!e})},769663:(e,t,l)=>{l.d(t,{W:()=>m});var n=l(995838),r=l(442603),i=l(556943),a=l(8965),o=l(724867),u=l(174343),d=l(952878),s=l(593884),c=l(144801);let v=e=>{switch(e){case"all":return i.A.getAll;case"top-selling-service":default:return r.A.getLstTopSellingService;case"top-amount-service":return r.A.getTopAmountServices;case"new-service":return r.A.getNewServices;case"list-service-view":case"viewed-service":return r.A.getServiceRecommend;case"list-service-rating":return r.A.getFavoriteServices;case"list-service-suggestions":return r.A.getSuggestions;case"top-selling-combo":return a.A.getTopSellingCombos;case"top-amount-combo":return a.A.getTopAmountCombos;case"new-combo":return a.A.getNewCombos;case"list-combo-rating":return a.A.getFavoriteCombos;case"list-combo-view":case"viewed-combo":return a.A.getRecommendedComboList}},g=(e,t,l,n,r,i,a,o)=>{if(e===u.RJ.CATEGORY){let e=[u.MG.TELECOMMUNICATION,u.MG.SAAS,u.MG.DEVICE,u.MG.SERVICE,u.Wd.COMBO].includes(t),d=r.categoryIds&&r.categoryIds.length>0?r.categoryIds[0]:void 0,s=i||a||(o?o():void 0);return{size:l,customerType:n,lstCreatedSource:u.wO,...e&&t!==u.Wd.COMBO&&{serviceProductTypes:t===u.MG.SERVICE?[u.MG.TELECOMMUNICATION,u.MG.SAAS]:t},..."list-service-suggestions"===r.category&&s&&{id:s},...d&&{category:d}}}if(e===u.RJ.MANUAL){var s;let e="COMBO"===r.productType;return(null==(s=r.products)?void 0:s.map(t=>({id:t.idApi,type:e?d.vZ.COMBO:d.vZ.SERVICE})))||[]}return{}},m=e=>{let{activeTab:t,maxProducts:l,activeTabSetting:i,selectedProductServiceId:a,metadataServiceId:d,customerType:m,serviceProductTypes:p}=e;return(0,n.I)({queryKey:["getServiceRecommend",t,l,m,null==i?void 0:i.category,null==i?void 0:i.selectVia,null==i?void 0:i.products,null==i?void 0:i.categoryIds,null==i?void 0:i.productType,a,d,JSON.stringify(p)],queryFn:async()=>{var e,n,p;if(!i)return[];let h=r.A.getLstTopSellingService;if(i.selectVia===u.RJ.MANUAL){h=o.A.getListProductsSelected;let e=g(i.selectVia,t,l,m,i,a,d),r=await h(e);return(null==r||null==(n=r.content)?void 0:n.length)?(0,s.CR)(r.content,t===u.Wd.COMBO,c.O7):(null==r?void 0:r.length)?(0,s.CR)(r.slice(0,l),t===u.Wd.COMBO,c.O7):[]}if(h=v(i.category),i.categoryIds&&i.categoryIds.length>0){let e=[];for(let n of i.categoryIds)try{let r=a||d;if("list-service-suggestions"===i.category&&!r)continue;let o={size:l,customerType:m,lstCreatedSource:u.wO,category:n,...t!==u.Wd.COMBO&&{serviceProductTypes:t===u.MG.SERVICE?[u.MG.TELECOMMUNICATION,u.MG.SAAS]:t},..."list-service-suggestions"===i.category&&r&&{id:r}},s=await h(o);(null==s||null==(p=s.content)?void 0:p.length)?e.push(...s.content):(null==s?void 0:s.length)&&e.push(...s)}catch(e){}let n=Array.from(new Map(e.map(e=>[e.id,e])).values()).slice(0,l);return(0,s.CR)(n,t===u.Wd.COMBO,c.O7)}if("list-service-suggestions"===i.category&&!(a||d))return[];let y=g(i.selectVia,t,l,m,i,a,d),f=await h(y);return(null==f||null==(e=f.content)?void 0:e.length)?(0,s.CR)(f.content,t===u.Wd.COMBO,c.O7):(null==f?void 0:f.length)?(0,s.CR)(f.slice(0,l),t===u.Wd.COMBO,c.O7):[]},enabled:!!t&&p.length>0})}},830487:(e,t,l)=>{l.d(t,{C:()=>u});var n=l(212115),r=l(215718),i=l(894135),a=l(134540),o=l(607453);let u=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],{enabled:u}=(0,i.hG)(e=>({enabled:e.options.enabled})),d=(0,a.d4)(o.vf),s=r.A.useWatch("selectedProduct"),c=null==s?void 0:s.pricingId,v=(0,n.useRef)(null),g=(0,n.useRef)(void 0),m=(0,n.useRef)(!1);return(0,n.useEffect)(()=>
1{if(!u||!e)return;let l=(null==d?void 0:d.isNewPage)!==!1,n=null!==v.current&&v.current!==e,r=void 0!==g.current&&g.current!==c||void 0===g.current&&void 0!==c&&m.current,i=!m.current&&l;n||r||i?(t(),m.current=!0,v.current=e,g.current=c):null===v.current&&(v.current=e,g.current=c,m.current=!0)},[u,e,c,null==d?void 0:d.isNewPage,...l]),{isEditorEnabled:u}}},858009:(e,t,l)=>{l.d(t,{u:()=>i});var n=l(212115),r=l(132890);let i=(e,t,l)=>{let[i,a]=(0,n.useState)([]),[o,u]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(e)if(t.length>0){let e=t.filter(e=>1===e.level).map(e=>e.id.toString()),l=[];t.forEach(e=>{1===e.level&&e.children?e.children.forEach(e=>{l.push(e.id.toString())}):2===e.level&&l.push(e.id.toString())}),a(e),u(l)}else a([]),u([])},[e,t]);let d=(0,r.Aj)(i,l);return{selectedLevel1:i,selectedLevel2:o,handleSelectAllLevel1:e=>{if(e.target.checked){let e=l.map(e=>e.id.toString()),t=l.flatMap(e=>e.children||[]).map(e=>e.id.toString());a(e),u(t)}else a([]),u([])},handleLevel1Change:(e,t)=>{let n;if(t)n=[...i,e];else{n=i.filter(t=>t!==e);let t=(0,r.hV)(e,l);u(e=>e.filter(e=>!t.includes(e)))}a(n)},handleSelectAllLevel2:(e,t)=>{let n=(0,r.hV)(e,l);t?u(e=>[...new Set([...e,...n])]):u(e=>e.filter(e=>!n.includes(e)))},handleLevel2Change:(e,t)=>
1{t?u(t=>[...t,e]):u(t=>t.filter(t=>t!==e))},getSelectedCategoryLinks:()=>(0,r.Rq)(i,o,l),isAllLevel1Selected:d,isAllLevel2SelectedForParent:e=>(0,r.gf)(e,o,l)}}},860807:(e,t,l)=>{l.d(t,{A:()=>d});var n=l(212115),r=l(36618);let i=e=>e.join("."),a=(e,t)=>{e({type:"SET_STATE",payload:t})},o=(e,t)=>{e({type:"SET_FIELDS_VALUE",payload:t})},u=(e,t,l)=>{Array.isArray(t)&&(t=i(t)),e({type:"SET_FIELD_VALUE",payload:{key:t,value:l}})},d=e=>{let t=(0,n.useContext)(r._S);return null==t?((null==e?void 0:e.disabledWarning)||console.warn("useLocalState must be used within a LocalStateProvider"),{isInitialized:!1,state:r.xP,dispatch:()=>{},setState:()=>{},setFieldsValue:()=>{},setFieldValue:()=>{},reset:()=>{},subscribe:()=>{},unsubscribe:()=>{}}):{isInitialized:!0,state:t.state,dispatch:t.dispatch,setState:e=>a(t.dispatch,e),setFieldsValue:e=>o(t.dispatch,e),setFieldValue:(e,l)=>u(t.dispatch,e,l),reset:()=>t.dispatch({type:"RESET"}),subscribe:t.subscribe,unsubscribe:t.unsubscribe}}},870412:(e,t,l)=>{l.d(t,{Q8:()=>u,d7:()=>d,dU:()=>o});var n=l(723915),r=l(520996);let i=(0,n.Wp)({apiKey:"AIzaSyAsVPtu-75E2PECrGyTgeYdKR8vfFIfgKg",authDomain:"onesme-2d1ca.firebaseapp.com",projectId:"onesme-2d1ca",storageBucket:"onesme-2d1ca.appspot.com",messagingSenderId:"211694514178",appId:"1:211694514178:web:00c65b4253c36346c8f71b",measurementId:"G-95CWWY8ST8"}),a=null,o=async()=>{await (0,r.TT)()?(a=(0,r.dG)(i),console.log("Firebase Messaging is supported.")):console.warn("Firebase Messaging is not supported in this browser.")},u=async(e,t)=>a?(0,r.gf)(a,{vapidKey:"BHgv9HiIximJSCgiudpwfg1Pc3TcrjSd_DmBuRuCA5QTXUAkNGe38eCym57O7NNMKmL7yuh44ruBUQGNKJi0A-k"}).then(t=>{t?e(t):console.log("No registration token available. Request permission to generate one.")}).catch(e=>{console.error("An error occurred while retrieving token.",e),t(e)}):(console.warn("Messaging is not initialized or not supported."),Promise.resolve()),d=async()=>new Promise((e,t)=>{a?(0,r.xD)(a,t=>{e(t)}):t("Messaging is not initialized or not supported.")})},872107:(e,t,l)=>{l.d(t,{Op:()=>G,uU:()=>W,sD:()=>V,Wu:()=>i,dx:()=>j,ag:()=>s,Ul:()=>H.A,Ng:()=>c.N,hS:()=>q,N5:()=>v.N,l5:()=>p,wn:()=>I,Qs:()=>C.Q,Qb:()=>k,YU:()=>S,bK:()=>T,p1:()=>L,Jd:()=>d.J});var n=l(212115),r=l(315094);let i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,[l,i]=(0,n.useState)(e);return[l,(0,n.useCallback)((0,r.debounce)(i,t),[])]};var a=l(995838),o=l(460081),u=l(724895),d=l(414094);let s=()=>{let{user:e,updateUser:t,changeStatus:l}=(0,d.J)();return(0,a.I)({queryKey:["getProfileUserInApp"],queryFn:async()=>{try{let n=JSON.parse(localStorage.getItem("user")),r=(0,o.iD)();if(e.loading||e.statusACCOUNT===u.A.ACC_STATUS.DENIED)if(n.id||r){let e=await u.A.getMyProfile();t(e)}else t({});else(null==n?void 0:n.time)>(null==e?void 0:e.time)?(t(n),(0,o.Cz)()):l();return e}catch(e){return(null==e?void 0:e.dontCatchError)||(t({}),(0,o.L)()),null}},refetchOnWindowFocus:!0,retry:0})};l(667348);var c=l(535164),v=l(28438),g=l(623464);let m={posts:"/wp/v2/posts",categories:"/wp/v2/categories",tags:"/wp/v2/tags",pages:"/wp/v2/pages",comments:"/wp/v2/comments",media:"/wp/v2/media",users:"/wp/v2/users"},p=e=>{let{resource:t,action:l="GET",params:n={},id:r,enabled:i=!0}=e,o="".concat("https://onesme.vn/blog/index.php?rest_route=").concat(m[t]);return r&&(o+="/".concat(r)),(0,a.I)({queryKey:[l,o,n],queryFn:async()=>(await g.A.get(o,{params:n})).data,enabled:"GET"===l&&!!i})};var h=l(135695),y=l(349096);let f={SERVICE:"/service/",COMBO:"/combo/"},I=()=>{let e=(0,h.useRouter)(),t=(0,y.jE)(),l=(0,h.usePathname)(),{user:n}=(0,d.J)();return{handleLogin:()=>{(l.includes(f.SERVICE)||l.includes(f.COMBO))&&t.removeQueries({queryKey:["getServiceDetFail"]}),e.push("/sme-portal/login?redirect=".concat(encodeURIComponent(l)))},getUrlLoggedIn:()=>"/sme-portal/login?redirect=".concat(encodeURIComponent(l)),toHomePage:()=>{let t=(null==n?void 0:n.customerType)?n.customerType.toLowerCase():"home";e.push("/".concat(t))}}};var C=l(374749),A=l(17299);let S=e=>{let{pathname:t}=(0,A.A)(),[l,r]=(0,n.useState)({y:0,down:!1}),i=e||1,a=(0,n.useCallback)(()=>{Math.abs(window.scrollY-l.y)>=i&&r({y:window.scrollY,down:window.scrollY>l.y})},[i,l.y]);return(0,n.useEffect)(()=>(window.addEventListener("scroll",a),()=>{window.removeEventListener("scroll",a)}
1),[a]),(0,n.useEffect)(()=>{r({y:window.scrollY,down:!1})},[t]),l};var w=l(705041),b=l(484404);let T=e=>{let{router:t,setVisibleModal:l,setInfoModal:n,errorModal:r,user:i,url:a}=e;return{mutationSendOTP:(0,w.n)({mutationFn:u.A.sendOTP,onSuccess:()=>{t.push(b.A.getPortalByCustomerType(i.customerType).createPath(a,null))},onError:()=>{l(!0),n(r)}})}},E=e=>Object.keys(e).length,P=(e,t)=>{let l=n.useRef(!1);n.useEffect(()=>{t&&!l.current&&(e(),l.current=!0)},[t])},k=()=>{let{updateUser:e,changeStatus:t}=(0,d.J)(),l=(0,h.useSearchParams)(),n=l.get("uuid"),r=l.get("token"),i=l.get("refresh"),a=l.get("isWorkplace");P(()=>{(async()=>{try{var l;if((!n||!r||!a)&&window.parent.location&&window.location===window.parent.location)return void localStorage.removeItem("isWorkplace");let d=null!=(l=localStorage.getItem("user"))?l:"{}",s=JSON.parse(d);"smeUUID"in s&&n!==s.smeUUID&&(localStorage.removeItem("user"),e({})),await (0,o.WG)({access_token:r,refresh_token:i,expires_in:3600,token_type:"bearer"},!0);try{let l=await u.A.getMyProfile();E(l)?e(l):(t(u.A.ACC_STATUS.DENIED_FROM_LOGIN),await (0,o.L)())}catch(e){console.log("Error fetching user profile:",e),await (0,o.L)()}}catch(e){console.log("Error in fetchUserProfile:",e),localStorage.removeItem("isWorkplace")}})().then(e=>e)},r)};var O=l(216428),F=l(203318),M=l(243285);let L=()=>{let e=(0,y.jE)(),t=(0,h.usePathname)(),{user:l}=(0,d.J)(),r=(0,n.useMemo)(()=>{var e;return["enterprise","house-hold","personal"].find(e=>t.includes(e))||(null==(e=l.customerType)?void 0:e.replace("_","-").toLowerCase())||"enterprise"},[t,l.customerType]),i=(0,n.useMemo)(()=>"".concat(window.location.origin,"_localCartId_").concat(r),[r]),a=(0,n.useCallback)(()=>window.localStorage.getItem(i),[i]),o=(0,n.useCallback)(t=>{document.documentElement.style.pointerEvents="none";let n=l.id?void 0:a();F.A.getCartDetail({cartId:n}).then(async r=>{var a,o,u,d,s,c;let v=((null==r?void 0:r.lstProduct)||[]).map(e=>({...e,type:1})),g=t.selectedPricing,m=new Date,p="".concat(g.pricingDraftId,"_").concat(m.toLocaleString("en-GB").replaceAll("/","").replaceAll(":","").replaceAll(", ","_")),h={...t,matomoId:p,lstPricing:[g]},y=v.findIndex(e=>e.serviceId===h.serviceId),f=null==(o=v[y])||null==(a=o.lstPricing)?void 0:a.findIndex(e=>e.pricingId===g.pricingId&&e.pricingMultiPlanId===g.pricingMultiPlanId),I=v.findIndex(e=>e.variantDraftId===h.variantDraftId);if("false"===await F.A.getProductMultiSub(t.isService,t.serviceId)||!(null==h?void 0:h.allowMultiSub)&&y>=0&&v[y].lstPricing.length&&(f<0||["FLAT_RATE","COMBO"].includes(String(g.pricingPlan))))return O.Ay.error("Dá»ch vụ m\xe0 bạn chá»n Ä\xe3 ÄÆ°á»£c ÄÄng k\xfd. H\xe3y chá»n dá»ch vụ kh\xe1c"),Promise.reject();y>=0?(I>=0?(null==(d=v[I].variant)?void 0:d.quantity)?v[I].variant.quantity+=(null==h?void 0:h.variantQuantity)||1:v[I].quantityVariant+=(null==h?void 0:h.variantQuantity)||1:v.push({...h,quantityVariant:(null==h?void 0:h.variantQuantity)||1,variant:{quantity:(null==h?void 0:h.variantQuantity)||1}}),f>=0&&!["FLAT_RATE","COMBO"].includes(String(g.pricingPlan))?(v[y].lstPricing[f].quantity+=1,null==(c=v[y].lstPricing[f])||null==(s=c.lstAddon)||s.forEach(e=>{e.quantity+=1})):v[y].lstPricing.push(g)):v.push(h),F.A.updateCart({lstProduct:v},(null==r||null==(u=r.lstProduct)?void 0:u.length)?n:void 0).then(t=>{l.id||window.localStorage.setItem(i,t),document.documentElement.style.pointerEvents="",O.Ay.success("Th\xeam sản phẩm v\xe0o giá» h\xe0ng th\xe0nh c\xf4ng"),e.invalidateQueries({queryKey:["getCartDetailHeader"]})}).catch(()=>{document.documentElement.style.pointerEvents=""})}).catch(()=>{document.documentElement.style.pointerEvents=""})},[i,a,e,l.id]),u=(0,n.useCallback)(()=>{let t=a();t&&F.A.getCartDetail({cartId:t}).then(t=>{let l=(null==t?void 0:t.lstProduct)||[];l.length?F.A.getCartDetail({}).then(t=>{let n=(null==t?void 0:t.lstProduct)||[];n.length?l.forEach(e=>{let t=n.findIndex(t=>e.serviceId===t.serviceId&&e.variantDraftId===t.variantDraftId);t>=0?e.lstPricing.length&&e.lstPricing.forEach(e=>{0>n[t].lstPricing.findIndex(t=>e.pricingId===t.pricingId&&e.pricingMultiPlanId===t.pricingMultiPlanId)&&n[t].lstPricing.push(e)}):n.push(e)}
1):n=l,n.forEach(e=>{e.type=1}),F.A.updateCart({lstProduct:n}).then(()=>{e.invalidateQueries({queryKey:["getCartDetailHeader"]}).then(()=>window.localStorage.removeItem(i))}).catch(()=>O.Ay.error("Ä\xe3 xảy ra lá»i khi Äá»ng bá» giá» h\xe0ng"))}):window.localStorage.removeItem(i)})},[i,a,e]);return{CONVERT_UPDATE_CART_DTO:o,MERGE_CART:u,GET_CART:(0,n.useCallback)(async()=>{let e=l.id?void 0:a();if(e||l.id){var t,n,r;let l=await F.A.getCartDetail({cartId:e});if(null==l||null==(t=l.lstProduct)?void 0:t.length){let t=!1;l.lstProduct.forEach(e=>{e.type=1,(0,M.I9)(e)&&e.selected&&(t=!0,e.selected=!1),e.lstPricing.forEach(e=>{(0,M.I9)(e)&&e.selected&&(t=!0,e.selected=!1);let l=e.minimumQuantity>0?e.minimumQuantity:1,n=e.maximumQuantity>0?e.maximumQuantity:0x3b9ac9ff,r=Math.max(Math.min(e.quantity,n),l);e.quantity!==r&&(e.quantity=r,t=!0),e.lstAddon.forEach(l=>{(0,M.I9)(l)&&e.selected&&(t=!0,e.selected=!1);let n=l.minimumQuantity>0?l.minimumQuantity:1,r=l.maximumQuantity>0?l.maximumQuantity:0x3b9ac9ff,i=Math.max(Math.min(l.quantity,r),n);l.quantity!==i&&(l.quantity=i,t=!0),l.required&&!l.selected&&(l.selected=!0,t=!0)})})}),t&&(await F.A.updateCart(l,e),l=await F.A.getCartDetail({cartId:e}))}return(null==l||null==(n=l.lstAttributeInServices)?void 0:n.length)&&(null==l||null==(r=l.lstProduct)?void 0:r.length)&&l.lstProduct.forEach(e=>{let t=e.variant;t&&(e.lstAttribute=t.valueList.map(e=>({...l.lstAttributeInServices.find(t=>t.id===e.attributesId)||{},selectedValue:e.valueName})))}),l}return{lstAttributeInServices:[],lstVariantInServices:[],lstProduct:[],price:0}},[a,l.id]),UPDATE_CART:(0,n.useCallback)(async t=>{let n=l.id?void 0:a();t.lstProduct.forEach(e=>{e.type=1}
1),await F.A.updateCart(t,n).catch(()=>O.Ay.success("Cáºp nháºt th\xf4ng tin giá» h\xe0ng thất bại")),await e.invalidateQueries({queryKey:["getCartDetail"]})},[a,e,l.id]),CART_CUSTOMER_TYPE:r,CART_ID_LOCATION:i,GET_CART_ID:a}},q=()=>{let[e,t]=(0,n.useState)(!1),l=(0,n.useCallback)(e=>{t(t=>void 0!==e?e:!t)},[]);return{isOpen:e,handleOpen:()=>l(!0),handleClose:()=>l(!1),handleToggle:l}};var N=l(894135),D=l(134540),R=l(607453);let V=e=>{let{arrayName:t="",propertyName:l="",index:r,defaultValue:i}=e,a=(0,D.d4)(R.L9),{actions:{setProp:o},values:u}=(0,N.oB)(e=>({values:e.data.props}));return{value:(0,n.useMemo)(()=>{let e=u[a];if(t){var n,o,d;e=void 0!==r?null==e||null==(o=e[t])||null==(n=o[r])?void 0:n[l]:null==e||null==(d=e[t])?void 0:d[l]}else e=null==e?void 0:e[l];return null!=e?e:i},[u,a,t,r,l,i]),updateValue:(0,n.useCallback)(e=>{o(n=>{let i=n[a];if(t)if(void 0!==r){var o;(null==i||null==(o=i[t])?void 0:o[r])&&(i[t][r][l]=e,"titleText"===l?i[t][r].isCustomTitle=!0:"descriptionText"===l&&(i[t][r].isCustomDescription=!0))}else(null==i?void 0:i[t])&&(i[t][l]=e);else i&&(i[l]=e)},300)},[o,t,r,l,a])}};var _=l(695155),x=l(165027),B=l(952878);let W=()=>{var e,t;let{user:l}=(0,d.J)(),n=(0,h.useRouter)(),r=(0,h.usePathname)(),i=(null==l?void 0:l.id)&&(null==l||null==(e=l.roles)?void 0:e.some(e=>e===B.aW)),a=[{path:"/admin-portal",isLoggedIn:i},{path:"/dev-portal",isLoggedIn:(null==l?void 0:l.id)&&(null==l||null==(t=l.roles)?void 0:t.some(e=>e===B.C_))}].find(e=>{let{path:t,isLoggedIn:l}=e;return!(null==r?void 0:r.startsWith(t))&&l});return a?(0,_.jsx)(x.A,{onClick:()=>n.push(a.path)}):null};var U=l(432796),K=l(544966);let G=e=>{let{validatorFn:t,debounceMs:l=500,errorMessage:r="C\xf3 lá»i xảy ra",resultPassed:i=!0,validationCondition:a,onSuccess:o,onFailure:u,onFinally:d}=e,s=(0,n.useRef)(null),c=(0,n.useRef)(null);return{validator:(0,n.useCallback)(function(e,n){for(var v=arguments.length,g=Array(v>2?v-2:0),m=2;m<v;m++)g[m-2]=arguments[m];return s.current&&clearTimeout(s.current),c.current&&(c.current.resolve(),c.current=null),new Promise((e,v)=>{c.current={resolve:e,reject:v},s.current=setTimeout(async()=>{var l,s;try{let s=await t(n,...g);if((null==(l=c.current)?void 0:l.resolve)!==e)return;if((0,U.isNil)(s)||a&&!a(n))return void e();(i?(0,K.G4)(s):!(0,K.G4)(s))?(o&&o(s),e()):(u&&u(s),v(Error(r))),d&&d(s),c.current=null}catch(e){if((null==(s=c.current)?void 0:s.reject)!==v)return;console.warn("Async validation error:",e),v(Error((null==e?void 0:e.message)||"C\xf3 lá»i xảy ra")),d&&d(!1),c.current=null}},l)})},[l,t,i,r])}};var z=l(447650),Q=l(843038);let J=[".ant-modal-root",".ant-drawer-open",".ant-popover-open"],j=()=>{let[e,t]=(0,n.useState)(!1),l=(0,n.useRef)(null),r=(0,n.useRef)(null),i=(0,h.usePathname)(),a=(0,n.useCallback)(()=>{t(!1),l.current&&(clearTimeout(l.current),l.current=null),r.current&&(r.current.disconnect(),r.current=null)},[]);return(0,n.useEffect)(()=>{a()},[i,a]),(0,n.useEffect)(()=>()=>a(),[a]),{isFullscreenLoading:e,showFullscreenLoading:(0,n.useCallback)(()=>{t(!0),l.current&&clearTimeout(l.current),r.current&&r.current.disconnect();let e=()=>J.some(e=>!!document.querySelector(e));if(e())return void a();r.current=new MutationObserver(()=>{e()&&a()}),r.current.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),l.current=setTimeout(a,8e3)},[a]),hideFullscreenLoading:a,FullscreenLoadingSpinner:()=>e?(0,z.createPortal)((0,_.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/30",children:(0,_.jsx)(Q.A,{size:"large"})}),document.body):null}};var H=l(860807)},881409:(e,t,l)=>{l.d(t,{a:()=>g});var n=l(212115),r=l(135695),i=l(215718),a=l(216428),o=l(995838),u=l(705041),d=l(46756),s=l(391458),c=l(76462),v=l(414094);let g=()=>{let[e]=i.A.useForm(),{user:t}=(0,v.J)(),[l,g]=(0,n.useState)(!1),m=(0,r.usePathname)(),p=(null==t?void 0:t.customerType)==="PERSONAL"||m.includes("personal"),[h,y]=(0,n.useState)({firstTerm:!1,secondTerm:!1,thirdTerm:!1,fourthTerm:!1,sixthTerm:!1,seventhTerm:!1,eightTerm:!1,ninthTerm:!1}),[f,I]=(0,n.useState)({firstTerm:!1,secondTerm:!1,thirdTerm:!1,fourthTerm:!1,fifthTerm:!1,sixthTerm:!1,seventhTerm:!1,eightTerm:!1,ninthTerm:!1}),{data:C}=(0,o.I)({queryKey:["dataPrivacyHook"],queryFn:async()=>await c.A.getDataPolicy(),enabled:!!t.permissions}),A=(0,u.n)({mutationFn:c.A.putDataPolicy,onSuccess:()=>{a.Ay.success("Cáºp nháºt Äiá»u khoản th\xe0nh c\xf4ng")},onError:()=>{a.Ay.error("Cáºp nháºt Äiá»u khoản kh\xf4ng th\xe0nh c\xf4ng")}});(0,n.useEffect)(()=>
1{if(null==C?void 0:C.confirmedDataPolicies){let t={firstTerm:C.confirmedDataPolicies.includes(1),secondTerm:C.confirmedDataPolicies.includes(2),thirdTerm:C.confirmedDataPolicies.includes(3),fourthTerm:C.confirmedDataPolicies.includes(4),fifthTerm:C.confirmedDataPolicies.includes(5),sixthTerm:C.confirmedDataPolicies.includes(6),seventhTerm:C.confirmedDataPolicies.includes(7),eightTerm:C.confirmedDataPolicies.includes(8),ninthTerm:C.confirmedDataPolicies.includes(9)};I(t),e.setFieldsValue(t),S(t,C.confirmStatus)}},[C,e]);let S=(e,t)=>{g(Object.keys(e).filter(e=>"fifthTerm"!==e).every(t=>e[t])&&t)},w=(0,n.useMemo)(()=>(0,d.K7)(p,f),[f,p]),b=(0,n.useMemo)(()=>(0,d.Bz)(p,f),[f,p]),T=e=>{let t={firstTerm:1,secondTerm:2,thirdTerm:3,fourthTerm:4,fifthTerm:5},l={...t,sixthTerm:6,seventhTerm:7,eightTerm:8,ninthTerm:9},n=p?t:l;return Object.entries(e).filter(e=>{let[t,l]=e;return l&&t in n}).map(e=>{let[t]=e;return n[t]}).sort((e,t)=>e-t)},E=async()=>{let e=await s.A.getClientIp(),t=T(f);A.mutate({confirmedDataPolicies:t,ipAddress:e})};return{form:e,interacted:h,checkboxes:f,isAgreeButtonEnabled:l,isCheckAll:w,isCheckSome:b,handleSingleCheck:e=>{let{name:t,checked:l}=e.target;y(e=>({...e,[t]:!0})),I(e=>{let n={...e,[t]:l},r=Object.keys(n).filter(e=>"fifthTerm"!==e).every(e=>n[e]),i=r&&n.fifthTerm||r;return S(n,i),n})},handleSelectAll:t=>{let{checked:l}=t.target;y(e=>{let t={...e};return Object.keys(t).forEach(e=>{t[e]=!0}),t}),I(e=>{let t={...e};return Object.keys(t).forEach(e=>{t[e]=l}),S(t,!0),t}),e.setFieldsValue({firstTerm:l,secondTerm:l,thirdTerm:l,fourthTerm:l,fifthTerm:l,sixthTerm:l,seventhTerm:l,eightTerm:l,ninthTerm:l}),e.validateFields(["firstTerm","secondTerm","thirdTerm","fourthTerm","sixthTerm","seventhTerm","eightTerm","ninthTerm"])},dataPrivacy:C,onFinish:E,isPersonal:p}}},910501:(e,t,l)=>{l.d(t,{k:()=>o});var n=l(995838),r=l(9136),i=l(844098);let a=()=>i.KC.map(e=>{let t={id:e.id,name:e.name,level:e.level,icon:e.icon,url:e.url};return e.children&&e.children.length>0&&(t.children=e.children.map(e=>({id:e.id,name:e.name,level:e.level,parentId:e.parentId,url:e.url}))),t}),o=()=>(0,n.I)({queryKey:["page-builder-category-list"],queryFn:async()=>{try{let e=await r.A.getCategoriesWithPagination({value:"",page:0,size:1e3,displayed:"UNSET"}),t=(null==e?void 0:e.content)||e,l=a();if(!t||!Array.isArray(t))return l;let n=t.filter(e=>{if(1!==e.level)return!1;let t="VISIBLE"===e.displayedStatus,l=e.applyCode||[],n=l.includes("SERVICE")||l.includes("DEVICE");return t&&n}).map(e=>{var t;let l=(null==(t=e.children)?void 0:t.filter(e=>{let t="VISIBLE"===e.displayedStatus,l=e.applyCode||[],n=l.includes("SERVICE")||l.includes("DEVICE");return 2===e.level&&t&&n}).map(t=>({id:t.id,name:t.name,level:2,parentId:e.id,url:i.y.LEVEL_2(t.id),applyCode:t.applyCode||[]})))||[];return{id:e.id,name:e.name,level:1,children:l.length>0?l:void 0,url:i.y.LEVEL_1(e.id),applyCode:e.applyCode||[]}});return[...l,...n.filter(e=>!l.some(t=>t.id===e.id))]}catch(e){return console.error("Error fetching category list:",e),a()}},staleTime:3e5,gcTime:6e5})},936528:(e,t,l)=>{l.d(t,{F:()=>a});var n=l(212115),r=l(995838),i=l(39635);let a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{includeWard:t=!0,includeStreet:l=!0}=e,[a,o]=(0,n.useState)(null),[u,d]=(0,n.useState)(null),[s,c]=(0,n.useState)(null),{data:v,isFetching:g}=(0,r.I)({queryKey:["getProvinces"],queryFn:async()=>{let e=await i.A.getProvinces();return(null==e?void 0:e.map(e=>({label:e.name,value:e.id,...e})))||[]},staleTime:3e5,gcTime:6e5,retry:1,refetchOnWindowFocus:!1}),{data:m,isFetching:p,refetch:h}=(0,r.I)({queryKey:["getWardsByProvince",a],queryFn:async()=>{if(!a)return[];let e=await i.A.getWardsByProvince(a);return(null==e?void 0:e.map(e=>({label:e.name,value:e.id,...e})))||[]},enabled:!!a&&t,staleTime:3e5,gcTime:6e5,retry:1,refetchOnWindowFocus:!1}),{data:y,isFetching:f,refetch:I}=(0,r.I)({queryKey:["getStreetsByProvinceAndWard",a,u],queryFn:async()=>{if(!a||!u)return[];let e=await i.A.getStreetsByProvinceAndWard(a,u);return(null==e?void 0:e.map(e=>({label:e.name,value:e.id,...e})))||[]},enabled:!!a&&!!u&&l,staleTime:3e5,gcTime:6e5,retry:1,refetchOnWindowFocus:!1});return{provinceId:a,wardId:u,streetId:s,setProvinceId:o,setWardId:d,setStreetId:c,provinceList:v,wardList:m,streetList:y,loadingProvince:g,loadingWard:p,loadingStreet:f,refetchWard:h,refetchStreet:I}}},999931:(e,t,l)=>{l.d(t,{A:()=>s});var n=l(135695),r=l(995838),i=l(134540),a=l(414094),o=l(144801),u=l(8965),d=l(840478);let s=e=>{let{comboId:t}=e,{user:l}=(0,a.J)(),s=(0,n.usePathname)(),c=(0,i.wA)(),{data:v,isLoading:g}=(0,r.I)({queryKey:["getServiceDetFail",t],queryFn:async()=>{let e=await u.A.getDetailCombo1(Number(t),{customerType:(0,o.FZ)(l,s)});return c(d.Ed.handleInitCombo(e)),e},refetchOnWindowFocus:!1,enabled:!!t}),{data:m}=(0,r.I)({queryKey:["getList",t],queryFn:async()=>{let{data:e}=await u.A.getServicePackCombo(t);return e},refetchOnWindowFocus:!1,enabled:!!t}),{data:p,refetch:h}=(0,r.I)({queryKey:["getRatingInfo"],queryFn:async()=>await u.A.getRatingInfo(t),refetchOnWindowFocus:!1,enabled:!!t});return{comboDetail:v,ratingInfo:p,lstPackageCombo:m,loadingComboDetail:g,refetch:h}}}}]);
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.