1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i=(new e.Error).stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="ed75603e-fc9a-4add-8fcd-2834c54f0b11",e._sentryDebugIdIdentifier="sentry-dbid-ed75603e-fc9a-4add-8fcd-2834c54f0b11")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5023],{2135:function(e,i,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/thank-you",function(){return t(97814)}])},97814:function(e,i,t){"use strict";t.r(i),t.d(i,{__N_SSG:function(){return N},default:function(){return D}});var r=t(62364),n=t(15437),o=t(25675),l=t.n(o),a=t(41664),d=t.n(a),c=t(67294),s=t(81292),u=t(42727),p=t(89600),h=t(11163);let v=n.ZP.div.withConfig({componentId:"sc-95e42bc-0"})(["display:flex;align-items:center;padding:1.6rem;font-size:1.6rem;border-radius:4px;background-color:",";color:",";border:1px solid ",";"],e=>{let{type:i}=e;return"success"===i?"#d4edda":"#f8d7da"},e=>{let{type:i}=e;return"success"===i?"#155724":"#721c24"},e=>{let{type:i}=e;return"success"===i?"#c3e6cb":"#f5c6cb"}),f=n.ZP.div.withConfig({componentId:"sc-95e42bc-1"})(["margin-right:8px;"]);var m=e=>{let{type:i,icon:t,children:n}=e;return(0,r.BX)(v,{type:i,children:[t&&(0,r.tZ)(f,{children:t}),n]})},g=t(47041),w=t(77778),y=t(5810),_=t(61312),b=t(92729),Z=t(62554),x=t(83454);let I=n.ZP.div.withConfig({componentId:"sc-3dc659e6-0"})(["margin-top:3.2rem;margin-bottom:3.2rem;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),k=n.ZP.h1.withConfig({componentId:"sc-3dc659e6-1"})(["margin-bottom:4rem;text-align:center;"]),S=(0,n.ZP)(d()).withConfig({componentId:"sc-3dc659e6-2"})(["color:",";text-decoration:none;margin-top:4rem;"],e=>{let{theme:i}=e;return i.colors.naviPurple.main});var N=!0,D=e=>{var i,t,n,o,a,d,v,f;let{content:N,shared:D}=e,E={canonicalUrl:"".concat(null!==(o=x.env.NS_URL_HOSTNAME)&&void 0!==o?o:"https://www.navisavitravel.com").concat(null!==(a=null==N?void 0:N.slug)&&void 0!==a?a:"thank-you"),metaDescription:null!==(d=null==N?void 0:N.metaDescription)&&void 0!==d?d:"Thank You",title:null!==(v=null==N?void 0:N.pageTitle)&&void 0!==v?v:"Thank You"},{clearCart:C,fetchUserPurchaseData:X}=(0,y.iQ)(),P=(0,u.Eg)(N,D),T=null==N?void 0:N.openGraphMetadata,B=(null==D?void 0:D.activeChannels)||[],Y=(0,h.useRouter)(),{session_id:j,success:O}=Y.query,q=null!==(f=(0,g.getCookie)("session_id"))&&void 0!==f?f:"",G="true"===O,[H,R]=(0,c.useState)(null),[L,U]=(0,c.useState)(!0),[A,J]=(0,c.useState)(null),[M,z]=(0,c.useState)(null),[F,Q]=(0,c.useState)(!0);return((0,c.useEffect)(()=>{j&&j!==q&&(0,g.setCookie)("session_id",j,{maxAge:1800,path:"/"}),j&&q&&Y.replace("/thank-you?success=true",void 0,{shallow:!0})},[j,q]),(0,c.useEffect)(()=>{(async()=>{if(q)try{var e,i;let t=await fetch("/api/customer/stripe/fetch-session?session_id=".concat(q)),r=await t.json(),n=null==r?void 0:null===(e=r.session)||void 0===e?void 0:e.invoice;if(!n)throw Error("Invoice ID not found in session data.");let o=await b.Z.post("/api/customer/stripe/get-receipt",{receiptId:n});R(null==o?void 0:null===(i=o.data)||void 0===i?void 0:i.url),Q(!0)}catch(e){console.error("Error fetching receipt:",e)}finally{U(!1)}})()},[q]),(0,c.useEffect)(()=>{let e=(0,g.getCookie)("dbuser")||localStorage.getItem("dbuser"),i=e?JSON.parse(e):void 0,t=(()=>{var e;let i=null===(e=localStorage)||void 0===e?void 0:e.getItem("cart");return i?JSON.parse(i):[]})(),r=null==i?void 0:i.firebase_id,n=null==i?void 0:i.customer_id;if(t.length>0&&r&&n){let e=[],i=[];for(var o of t){var l;let t=null==o?void 0:null===(l=o.videos)||void 0===l?void 0:l.map(e=>null==e?void 0:e.id);if(null==t?void 0:t.length)for(var a of t)e.push({receipt_url:H,videoId:null!=a?a:"",purchase_date:Date.now(),purchase_price:o.price,asset_download_link:"#",receipt:H,price_id:null==o?void 0:o.price_id,price:null==o?void 0:o.price,name:null==o?void 0:o.name,stripeSubscriptionDetail:o.stripeSubscriptionDetail});else i.push({receipt_url:H,videoId:null!=a?a:"",purchase_date:Date.now(),purchase_price:o.price,asset_download_link:"#",receipt:H,price_id:null==o?void 0:o.price_id,price:null==o?void 0:o.price,name:null==o?void 0:o.name,stripeSubscriptionDetail:o.stripeSubscriptionDetail})}z({id:q,videos:e,cart:i}),(async()=>{await C(),await X(null)})()}},[q]),(0,c.useEffect)(()=>{Y.query.canceled&&U(!1)},[Y.query.canceled]),L||(G||q)&&!Y.query.canceled)?!G||q?(0,r.BX)(s.Z,{metadata:E,ogmd:T,shared:D,children:[P&&(0,r.tZ)(p.Z,{banner:P}),(0,r.tZ)(I,{children:L?(0,r.tZ)(_.Z,{message:"Getting receipt..."}):(0,r.BX)(r.HY,{children:[(0,r.tZ)(k,{children:L?(0,r.tZ)(m,{type:"success",children:"Loading your purchase details..."}):A?(0,r.BX)(m,{type:"error",children:["There was an error: ",A]}
1):G?F?(0,r.tZ)(m,{type:"success",children:"Thank you for your purchase! Your order has been successfully placed."}):(0,r.tZ)(r.HY,{}):(0,r.tZ)(m,{type:"error",children:"There was an error processing your order. Please try again later or call us at 1-800-555-5555."})}),(null==M?void 0:null===(i=M.videos)||void 0===i?void 0:i.length)>0?M.videos.map(e=>(0,r.tZ)(w.Z,{item:{...e,receipt:H},sessionId:q,activeChannels:B},e.videoId)):(null==M?void 0:null===(t=M.cart)||void 0===t?void 0:t.length)?null===(n=M.cart)||void 0===n?void 0:n.map(e=>{var i;return(0,r.BX)("div",{className:" p-[20px] w-full flex items-center gap-[32px] bg-white border border-border rounded-[16px] shadow",children:[(0,r.tZ)("div",{className:" shrink-0 w-[130px] h-[130px] rounded-[8px] overflow-hidden relative",children:(0,r.tZ)(l(),{src:(null===(i=Z.j.find(i=>i.id===e.price_id))||void 0===i?void 0:i.img)||"",alt:"Plan Image",className:" object-cover rounded-[8px]",fill:!0})}),(0,r.tZ)("div",{className:"w-full flex justify-between",children:(0,r.BX)("div",{className:" max-w-[75%]",children:[(0,r.tZ)("h3",{className:" inline text-[22px] text-navi-gray-main",children:e.name}),(0,r.BX)("p",{className:" mt-[8px] text-[22px] font-bold text-navi-pink-main",children:["$",e.price," USD"]})]})})]},null==e?void 0:e.price_id)}):"",A&&(0,r.BX)(r.HY,{children:[(0,r.tZ)(l(),{priority:!0,src:"/navisavi.png",alt:"Navi Savi Logo",width:244,height:42}),(0,r.tZ)(S,{href:"/",children:"Return to the home page"})]}),G&&(0,r.tZ)(S,{href:"/dashboard/settings/purchase-history",children:"Go to purchase history"})]})})]}):void 0:(0,r.BX)(s.Z,{metadata:E,ogmd:T,shared:D,hideFooterTop:!0,children:[P&&(0,r.tZ)(p.Z,{banner:P}),(0,r.BX)(I,{children:[(0,r.tZ)(k,{children:(0,r.tZ)(m,{type:"error",children:"There was an error processing your order. Please try again later or call us at 1-800-555-5555."})}),(0,r.tZ)(S,{href:"/",children:"Return to the home page"})]})]})}}},function(e){e.O(0,[4577,9332,9184,7636,4097,1292,8674,2888,9774,179],function(){return e(e.s=2135)}),_N_E=e.O()}]);
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.