1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7419],{56953:function(e,t,o){var n=o(32463),i=o(11448);o(32790);var r=o(81592),a=o(85938),s=o(16837),u=o(41070),l=o(50927),d=o(28157);function c(){let e=(0,n._)(["\n .MuiDialog-paper {\n border-radius: 8px;\n }\n"]);return c=function(){return e},e}let v=(0,s.zo)(r.Z)(c());t.Z=e=>{let{title:t,titleProps:o,children:n,onClose:r,backdropClick:c=!1,dialogContentProps:h={},withCloseIcon:f=!0,height:p="auto",...w}=e,m=(0,s.Fg)();return(0,i.jsxs)(v,{keepMounted:!0,onClose:(e,t)=>{(c||"backdropClick"!==t)&&r&&r(t)},PaperProps:{sx:{mx:0,width:"100%",position:"absolute",bottom:0,margin:0,borderRadius:"12px 12px 0 0 !important",overflow:"inherit",height:p},elevation:0},...w,children:[f&&(0,i.jsx)(l.Z,{position:"absolute",display:"flex",width:"40px",height:"40px",justifyContent:"space-around",top:"-52px",right:"16px",borderRadius:"100%",bgcolor:m.palette.neutral["neutral-1"],children:r?(0,i.jsx)(a.Z,{sx:{padding:"0px"},onClick:()=>r("closeButtonClick"),children:(0,i.jsx)(u.Close,{color:m.palette.iconColor.default,size:28})}):null}),(0,i.jsx)(d.Z,{sx:{padding:"16px",pt:"8px"},...h,children:n})]})}},82902:function(e,t,o){o.d(t,{Z:function(){return b}});var n=o(32790),i=o(41054),r=o(2977),a=o(99786),s=o(46038),u=o(7416),l=o(43242),d=o(32804);let{Get:c}=o(49186).default,v=e=>c({url:"/accounts/v1/customer/detail",config:{headers:e}}),h=e=>!e||e.length<=10?"***":"".concat(e.slice(0,10),"...").concat(e.slice(-4)),f=e=>{let{auth:{isAuthenticated:t},webviewSessionProps:o,setWebviewSessionProps:n,updateAuth:i}=e;return{isAuthenticated:t,updateAuth:i,webviewSessionProps:o,setWebviewSessionProps:n}},p=e=>{let t=(0,l.u)(document.cookie);if(!(null==t?void 0:t.nativeHeaders))return null;let o=JSON.parse(t.nativeHeaders);return s.cM.info("Found Webview Session Props from Cookie",{customInfo:{origin:"useWebviewSession.tryCookieSession",nativeHeaders:{...o,Authorization:h((null==o?void 0:o.Authorization)||"")}}}),(0,d.IO)(document.cookie,e)},w=async e=>{let t=await (0,d.Ob)();if(!t)return null;let o={...t};return delete o.AUTHORIZATION,s.cM.info("Found Webview Session Props from Window Context",{customInfo:{origin:"useWebviewSession.tryWindowSession",nativeHeaders:{...o,Authorization:h((null==o?void 0:o.Authorization)||"")}}}),(0,d.oh)(t,e)};var m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{sessionCheckPriority:t="cookie"}=e,o=Object.fromEntries((0,a.useSearchParams)()),{isAuthenticated:l,webviewSessionProps:c,updateAuth:m,setWebviewSessionProps:b}=(0,u.Z)((0,r.N)(f)),[g,N]=(0,n.useState)(!0),S=async()=>{var e,n;if("window"===t){let e=await w(o);return e?e:p(o)||(s.cM.error("nativeHeaders Not Found (window)",{customInfo:{origin:"useWebviewSession.getWebviewSessionPropsBySource",nativeHeaders:null===(n=window)||void 0===n?void 0:n.nativeHeaders}}),(0,d.bO)(o))}let i=p(o);return i?i:await w(o)||(s.cM.error("nativeHeaders Not Found",{customInfo:{origin:"useWebviewSession.getWebviewSessionPropsBySource",nativeHeaders:null===(e=window)||void 0===e?void 0:e.nativeHeaders}}),(0,d.bO)(o))};(0,n.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await S();e&&b(t)}catch(e){}})(),()=>{e=!1}},[]);let k=async()=>{if(!c.nativeHeaders)throw N(!1),i.Am.error("Terjadi kesalahan, silahkan coba beberapa saat lagi."),s.cM.error("Native Headers Not Found",{customInfo:{origin:"useWebviewSession.getCustomerInfo"}}),Error("Native Headers Not Found");if(l){N(!1);return}try{let{data:e}=await v(c.nativeHeaders);m({isAuthenticated:c.isAuthenticated,user:{phoneNumber:e.phone_number,firstName:e.first_name,lastName:e.last_name,active:e.active,isFraud:e.is_fraud,id:(null==e?void 0:e.id)||0}})}catch(t){var e;s.cM.info("Failed to fetch customer info",{customInfo:{origin:"useWebviewSession.getCustomerInfo",nativeHeaders:{...c.nativeHeaders,Authorization:h((null===(e=c.nativeHeaders)||void 0===e?void 0:e.Authorization)||"")},error:t instanceof Error?t.message:JSON.stringify(t)}}),i.Am.error("Terjadi kesalahan, silahkan coba beberapa saat lagi.")}finally{N(!1)}};return(0,n.useEffect)(()=>{c.hasSessionCheck&&(c.isWebview||(0,a.notFound)(),k())},[c.hasSessionCheck]),{loading:g,webviewSessionProps:c}},b=e=>{let{children:t,sessionCheckPriority:o}=e,{loading:n}=m({sessionCheckPriority:o});return n?null:t}},49186:function(e,t,o){o.d(t,{default:function(){return N}});var n=o(72091),i=o(44527),r=o(46038),a=o(23702),s=o(41865);let u=e=>{let t=a.g_?a.g_.split(","):[],o=e.response&&!!t.length&&t.includes(String(e.response.status));if(e.isAxiosError&&o){var n,i,u;let t=(null===(n=e.config)||void 0===n?void 0:n.method)||"",o=(null===(i=e.config)||void 0===i?void 0:i.url)||"",a=(null===(u=e.config)||void 0===u?void 0:u.data)||"";if(e.response){let n=(0,s.L)(e),i="".concat(n,". ").concat(t," ").concat(o);r.cM.error(i,{customInfo:{origin:"network-interceptor",data:{method:t&&t.toLocaleUpperCase(),url:o,body:a,statusCode:e.response.status}}})}}};var l=o(84650),d=o(24526),c=o(94235),v=o(73822),h=o(98399),f=o(43484);let p=()=>!1,w=()=>"true"===new URLSearchParams(window.location.search).get("webview"),m=async()=>
1{if(p()){let{cookies:e}=await o.e(5994).then(o.bind(o,55994));return(await (0,i.iW)(e(),l.dx)).token}return(0,c.KJ)().getState().token||null},b=async()=>{if(p()){var e;let{cookies:t}=await o.e(5994).then(o.bind(o,55994));return(null===(e=t().get(v.$))||void 0===e?void 0:e.value)||""}return(0,h.C)()},g=async e=>{var t,o;if(!e.headers.Authorization){let o=await m();o=(null===(t=e.url)||void 0===t?void 0:t.startsWith("https://api.astronauts.id"))?null:o,e.headers.Authorization=o?"Bearer ".concat(String(o)):void 0}if(!e.headers["X-DEVICE-ID"]){let t=await b();t=(null===(o=e.url)||void 0===o?void 0:o.startsWith("https://api.astronauts.id"))?"":t,e.headers["X-DEVICE-ID"]=t||void 0}return e};var N=(0,n.a)({baseURL:"https://api.astronauts.id",headers:(0,d.a)(),maxRedirects:0,timeout:6e4},{interceptorResponseReject:e=>{if(!p()){var t,o;if((null==e?void 0:null===(t=e.response)||void 0===t?void 0:t.status)===302)return window.location.href=a.su,Promise.reject();if(!w()&&(null==e?void 0:null===(o=e.response)||void 0===o?void 0:o.status)===401)return(0,f.clientErrorUnuthorizedHandler)(),Promise.reject();u(e)}return Promise.reject(e)},interceptorRequest:g})},41865:function(e,t,o){o.d(t,{L:function(){return n}});let n=e=>{if(null==e?void 0:e.response){var t,o,n,i,r,a,s,u;return(null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(o=n.data)||void 0===o?void 0:null===(t=o.error)||void 0===t?void 0:t.message)||(null==e?void 0:null===(r=e.response)||void 0===r?void 0:null===(i=r.data)||void 0===i?void 0:i.message)||(null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(a=s.data)||void 0===a?void 0:a.error_message)||"Failed with status code ".concat(null===(u=e.response)||void 0===u?void 0:u.status)}return"Terjadi kesalahan"}},39024:function(e,t,o){o.d(t,{B:function(){return i}});var n=o(23702);let i=e=>{try{let t=decodeURIComponent(e.trim());if(/^(javascript|data|vbscript|file|blob|ftp|mailto|about|chrome|safari|edge|intent):/i.test(t))return!1;if(t.startsWith("/")&&!t.startsWith("//"))return!0;let o=new URL(t);if(!["http:","https:"].includes(o.protocol))return!1;return o.hostname===n.XD||o.hostname.endsWith(".".concat(n.XD))}catch(e){return!1}}},98399:function(e,t,o){o.d(t,{C:function(){return a}});var n=o(43242),i=o(73822);let r=()=>!0,a=()=>{if(!r())throw Error("This helper can only be called on client");return(0,n.u)(document.cookie)[i.$]||""}},24526:function(e,t,o){o.d(t,{a:function(){return i}});var n=o(23702);let i=e=>Object.fromEntries(Object.entries({"Access-Control-Allow-Origin":void 0,"Access-Control-Max-Age":7200,"X-API-VERSION":n.P4,"X-APP-VERSION":"android-2.17.1","X-DEVICE":n.oe,"X-DEVICE-VERSION":n.Ji,"X-DEVICE-ID":null,...e||{}}).filter(e=>{let[,t]=e;return null!=t&&""!==t}))},43484:function(e,t,o){o.d(t,{clientErrorUnuthorizedHandler:function(){return i}});var n=o(39024);let i=()=>{let e=new URL(window.location.href),t="".concat(e.pathname).concat(e.search),o=(0,n.B)(t)?encodeURIComponent(t):"/";window.location.href="".concat("/auth/cleanup","?redirectURL=").concat(o)}},99202:function(e,t,o){var n,i,r,a;o.d(t,{oi:function(){return l}}),(r=n||(n={})).Home="Home",r.Loyalty="Loyalty",r.Auth="Auth",(a=i||(i={})).NativeShare="NativeShare",a.TrackEvent="TrackEvent",a.NavPop="NavPop",a.NavPush="NavPush",a.NavToHome="NavToHome",a.PushData="PushData";let s=e=>{var t,o;if(!(null===(o=window)||void 0===o?void 0:null===(t=o.ReactNativeWebView)||void 0===t?void 0:t.postMessage)){console.error("Native API Not Found");return}window.ReactNativeWebView.postMessage(JSON.stringify(e))},u=(e,t)=>{var o,n;if(!(null===(n=window)||void 0===n?void 0:null===(o=n.ReactNativeWebView)||void 0===o?void 0:o.postMessage)){console.error("Native API Not Found");return}window.ReactNativeWebView.postMessage(JSON.stringify({action:e,payload:t}))},l={nativeShare:e=>{u("NativeShare",e)},trackEvent:e=>{u("TrackEvent",e)},navPop:()=>{u("NavPop")},navPush:e=>{u("NavPush",e)},navToHome:()=>{u("NavToHome")},pushData:e=>{s(e)}}}}]); 2//# sourceMappingURL=7419-ee30acf309c530c8.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.