1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2317],{37853:(e,t,i)=>{i.r(t),i.d(t,{ToastProvider:()=>h.t,default:()=>v,useToast:()=>h.d});var n=i(6029),l=i(55729),o=i(81278),r=i.n(o),a=i(10386),s=i(58600),u=i(51324),c=i(76150),d=i(27429),f=i(30395),h=i(85993);let p=(0,f.createGlobalStyle)([".ant-notification-notice-icon{font-size:20px !important;}.ant-notification-notice-with-icon{display:flex;justify-content:center;text-align:left;flex-direction:column;}.ant-notification-notice-description{margin-top:0px !important;}"]);a.Ay.config({top:80});let v=l.memo(()=>{let{toast:e,setToast:t}=(0,h.d)();return l.useEffect(()=>{let e=()=>{var e;t({show:!1,msg:"",des:""}),null===a.Ay||void 0===a.Ay||null==(e=a.Ay.destroy)||e.call(a.Ay)};return r().events.on("routeChangeStart",e),()=>{r().events.off("routeChangeStart",e)}},[]),l.useEffect(()=>{if(e.show){let i=e.type||"info",l=null,o={color:"#fff !important",fontSize:"14px",fontFamily:"Inter",borderRadius:"4px",padding:"8px",minHeight:"40px",display:"flex",alignItems:"center",justifyContent:"flex-start"},r={};"success"===i?(l=(0,n.jsx)(s.A,{color:"#fff",width:"20px",style:{fontSize:"20px",color:"#fff"}}),r={...o,background:"#00AB56",borderColor:"#00AB56"}):"error"===i?(l=(0,n.jsx)(u.A,{color:"#fff",width:"20px",style:{fontSize:"20px",color:"#fff"}}),r={...o,background:"#FF424F",borderColor:"#FF424F"}):"info"===i&&(l=(0,n.jsx)(c.A,{color:"#fff",width:"20px",style:{fontSize:"20px",color:"#fff"}}),r={...o,background:"#64646D",borderColor:"#64646D"}),a.Ay.open({placement:e.placement||"top",duration:e.duration||5,top:e.top,icon:l,closeIcon:!1,onClose:()=>t({show:!1,msg:"",des:""}),style:r,description:e.msg?(0,n.jsx)(d.so,{style:{textAlign:"left",alignItems:"center",justifyContent:"stretch",color:"#fff",display:"inline"},dangerouslySetInnerHTML:{__html:e.msg||"Ä\xe3 c\xf3 lá»i xảy ra! Xin vui l\xf2ng thá» lại sau."}}):null,type:i})}else{var i;null===a.Ay||void 0===a.Ay||null==(i=a.Ay.destroy)||i.call(a.Ay)}},[e]),(0,n.jsx)(p,{})})},42317:(e,t,i)=>{i.d(t,{A:()=>v});var n=i(6029),l=i(55729),o=i(6255);i(27429);var r=i(58057),a=i(95440),s=i(81278),u=i(26345),c=i(57450),d=i(37738),f=i(848),h=i(99327),p=i(17479);let v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,l.memo)(function(i){let{cbSuccess:v=()=>{},cbError:g=()=>{},userId:x="",showingId:m="",...y}=i;if(!m||m<1){var b,A;return null==(A=window)||null==(b=A.location)?void 0:b.replace("/")}let w=(0,s.useRouter)(),{t:C}=(0,r.useLanguage)(),{error:k,setError:_}=(0,c.h)(),j=(0,d.wA)(),{openAuthenModal:S}=(0,d.d4)(e=>e.homePage??{}),E=(0,h.useAppConfig)(),T=(0,l.useMemo)(()=>E&&!E.isLoading&&3===E.versionCaptcha,[null==E?void 0:E.isLoading,null==E?void 0:E.versionCaptcha]),I=(0,l.useCallback)(()=>{setTimeout(()=>{w.push("/")},1e3)},[w]),{config:L,confirmCaptcha:F,refreshCaptcha:$,isSuccess:R,isValidating:N}=(0,a.A)(v,I,I,x,!1,m),P=(0,l.useMemo)(()=>{let e={title:C("captcha.title"),description:C("captcha.description"),content:C("captcha.content"),button:C("captcha.button"),refresh:C("captcha.refresh")};return(null==L?void 0:L.showError)&&(e={...e,message:{type:"error",text:C("captcha.error")}}),e},[C,L]),z=(0,l.useCallback)(()=>(null==L?void 0:L.type)===u.mT.ROTATE?(0,n.jsx)(o.A.Rotate,{config:P,data:L.rotate,events:{confirm:(e,t)=>{F(e),setTimeout(()=>{null==t||t()},100)},refresh:$,close:I}}):(null==L?void 0:L.type)===u.mT.SLIDE?(0,n.jsx)(o.A.Slide,{config:P,data:{image:L.slide.image,thumb:L.slide.thumb,thumbHeight:L.slide.tile_height,thumbWidth:L.slide.tile_width,thumbX:L.slide.tile_x,thumbY:L.slide.tile_y},events:{confirm:(e,t)=>{F(e),setTimeout(()=>{null==t||t()},100)},refresh:$,close:I}}):null,[L,P,F,$,I]);return((0,l.useEffect)(()=>{S&&T&&!R&&E&&!E.isLoading&&window.location.reload()},[S,j,T,R,E]),!E||E.isLoading)?(0,n.jsx)(f.A,{}):T?(0,n.jsxs)(n.Fragment,{children:[!R&&(0,n.jsx)(p.A,{visible:!S&&!(null==k?void 0:k.show),centered:!0,backdrop:"static",keyboard:!1,width:"326px",hideCancelButton:!0,hideOkButton:!0,backgroundColor:"transparent",...t,children:z()}),e&&R?(0,n.jsx)(e,{...y,neededTKBCaptcha:T,userId:x,versionCaptcha:E.versionCaptcha,subichaLink:E.subichaLink,subichaWating:E.subichaWating}):null]}):(0,n.jsx)(e,{...y,neededTKBCaptcha:!1,versionCaptcha:E.versionCaptcha})})}},49951:(e,t,i)=>{i.d(t,{I:()=>l,m:()=>n});let n=(0,i(12404).Mz)(e=>e.user,e=>
1{if(!e.checking){let t=Object.keys(e.tboxUser).length>0;return{...e,login:t}}return e}),l=e=>e.router||{}},85993:(e,t,i)=>{i.d(t,{d:()=>a,t:()=>r});var n=i(6029),l=i(55729);let o=(0,l.createContext)(),r=e=>{let{children:t}=e,[i,r]=(0,l.useState)({show:!1,type:"info",msg:"",des:"",placement:"topRight",duration:3});return(0,n.jsx)(o.Provider,{value:{toast:i,setToast:r},children:t})},a=()=>{let e=(0,l.useContext)(o);if(!e)throw Error("useToast must be used within a ToastProvider");return e}},95440:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(55729),l=i(42730),o=i(1337),r=i(37853),a=i(24669),s=i(29993),u=i(51188),c=i(57450),d=i(37738),f=i(97600);let h={rotate:{image:"",thumb:""},slide:{image:"",thumb:"",tile_height:0,tile_width:0,tile_x:0,tile_y:0},key:"0",mobile:!1,type:"slide",showError:!0},p=(e,t,i,p,v,g)=>{let{setToast:x}=(0,r.useToast)(),{setError:m}=(0,c.h)(),y=(0,d.wA)(),{isAuth:b}=(0,f.F)(),[A,w]=(0,n.useState)({}),[C,k]=(0,n.useState)(!1),[_,j]=(0,n.useState)(!0),[S,E]=(0,n.useState)(""),[T,I]=(0,n.useState)(!0),L=(0,n.useRef)(0),F=(0,n.useRef)(),$=`tkc_${p}${g}`;if(!g||g<1)return{};let R=(0,n.useCallback)((e,i)=>{if(L.current+=1,o._t.includes(i)?I(!1):x({show:!0,type:"error",msg:e||"Error"}),L.current>=5)null==t||t();else{var n;null==F||null==(n=F.current)||n.call(F)}},[t,x]),N=(0,n.useCallback)(async()=>{if(!S||!b||!g||!T)return;let e=(null===a.A||void 0===a.A?void 0:a.A.getLanguage())??"vi",t=["vi","en"].includes(e)?e:"vi";try{let e=await (0,l.Fe)(`/sapporo/api/v2/capt/gen/${g}`,{},{"x-device-info":`platform=web;device-id=${S}`,"x-accept-language":t},"https://api-v2.ticketbox.vn",0,m,y);if(1===e.code&&e.data)w(e.data);else{let t=(null==e?void 0:e.extensionsCode)||"";o._t.includes(t)&&I(!1),w(h)}}catch(e){w(h)}},[S,y,T,b,R,m,g]);(0,n.useEffect)(()=>{F.current=N},[N]);let P=(0,n.useCallback)(async e=>{let t="object"==typeof e&&"x"in e&&"y"in e?`${e.x},${e.y}`:`${e}`,i=a.A.getLanguage(),n=["vi","en"].includes(i)?i:"vi";await z({captcha:t,key:A.key,deviceInfo:`platform=web;device-id=${S}`,lang:n})},[A,S,g]),z=async t=>{let{captcha:i="",key:n="",deviceInfo:r="",lang:u}=t;try{var c,d;let t=await (0,l.n7)(`/sapporo/api/v2/capt/check/${g}`,{key:n,value:i},{"x-device-info":r,"x-accept-language":u},"https://api-v2.ticketbox.vn",0,m,y);if(j(!1),1===t.code&&(null==t||null==(c=t.data)?void 0:c.token)){let i=(0,s.f1)(null==t||null==(d=t.data)?void 0:d.token);a.A.setCaptcha({keyName:$,value:t.data.token,expTime:i.exp}),L.current=0,null==e||e(),k(!0)}else{let e=(null==t?void 0:t.extensionsCode)||"";o._t.includes(e)&&I(!1),R(null==t?void 0:t.message,e)}return t}catch(e){R("","");return}};return(0,n.useEffect)(()=>{(async()=>{let e=a.A.getDeviceId();if(e)E(e);else try{let e=await (0,u.l)();E(e.device_id)}catch(e){}})()},[]),(0,n.useEffect)(()=>{if(!S||!T)return;if(void 0!==v&&v)return void N();let t=a.A.getCaptcha($),i=(e=>{if(!e)return!1;let t=(0,s.f1)(e);if((null==t?void 0:t.user_id)===p){let t=(0,s.xP)(e);return k(!t),!t}return!1})(t);if(t&&i){null==e||e(),N();return}N()},[$,S,v]),{config:A,confirmCaptcha:P,refreshCaptcha:()=>{N()},onCloseCaptcha:i,isSuccess:C,isValidating:_}}},97600:(e,t,i)=>{i.d(t,{F:()=>v,k:()=>g});var n=i(6029),l=i(55729),o=i(37738),r=i(1356),a=i(49951),s=i(848),u=i(79720),c=i(24669),d=i(69895),f=i(57450),h=i(81278);let p=()=>{let e=(0,o.wA)(),{error:t,setError:i}=(0,f.h)(),{openAuthenModal:n}=(0,o.d4)(e=>e.homePage??{}),a=async t=>{c.A.logOut(),await e((0,r.Ig)()),(null==t?void 0:t.show)||n||e({type:"OPEN_AUTHEN_MODAL"})};l.useEffect(()=>{a(t)},[t])},v=()=>{let{login:e,tboxUser:t,checking:i}=(0,o.d4)(e=>(0,a.m)(e)),n=(0,h.useRouter)(),{showingId:l,id:r,eventId:s}=null==n?void 0:n.query;if(!(0,u.oc)())return{isChecking:!0,isAuth:!1,nextStep:""};let c=!!l&&Number(l)||!!s&&Number(r);return{isChecking:i,isAuth:e&&(0,d.M3)(),nextStep:t.next_step,userId:t.id,showingId:c}},g=e=>t=>{let{isAuth:i,isChecking:l,nextStep:o,userId:r,showingId:a}=v();return l?(0,n.jsx)(s.A,{}):i?(0,n.jsx)(e,{...t,userId:r,showingId:a}):(0,n.jsx)(p,{})}}}]);
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.