1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[991],{13840:(e,t,o)=>{"use strict";o.d(t,{A:()=>r});var n=o(37876),s=o(14232);function r(e){let{numSteps:t,currentStep:o,disabledSteps:r=[],onStepClicked:a}=e,[l,c]=(0,s.useState)((o-1)/(t-1)*100||1),[i,d]=(0,s.useState)([]),u=e=>{for(let t=0;t<r.length;t++)if(r[t]===e)return!0;return!1};return(0,s.useEffect)(()=>{let e=[];for(let s=0;s<t;s++){let t=u(s+1),r=s+1<=o;e.push((0,n.jsx)("button",{onClick:()=>{r&&!t&&a({stepNo:s+1})},className:"number-circle "+(r?"green":"orange")+(!t&&r?" cursor-pointer":""),style:{opacity:u(s+1)?.5:1},children:s+1},s))}d(e),c((o-1)/(t-1)*100)},[o]),(0,n.jsxs)("div",{className:"checkout-progress-bar",children:[(0,n.jsx)("div",{className:"bg-strip",children:l?(0,n.jsx)("div",{className:"bg-strip-on",style:{width:l+"%"}}):(0,n.jsx)("div",{className:"bg-strip-on",style:{width:"0%"}})}),(0,n.jsx)("div",{className:"circles-holder",children:i})]})}o(84652)},17085:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>m});var n=o(37876),s=o(14232),r=o(31777);o(10896),o(84652);var a=o(87117),l=o(13840),c=o(72747);o(5541);var i=o(89099);o(866);var d=o(44129),u=o(46357);function m(){var e;(0,r.wA)();let t=(0,i.useRouter)(),{basket_uuid:o,status:m,"cko-payment-id":p}=t.query;console.log("router.query: ",null==t?void 0:t.query);let[h,f]=(0,s.useState)("loading"),[v,y]=(0,s.useState)("Processing Payment..."),[g,k]=(0,s.useState)(!1),[x,b]=(0,s.useState)({title:"Payment Failed",description:"No Money has been taken from your account, you may go back to checkout to try again.",buttons:[{text:"Back to Checkout",className:"modal-button",onClick:()=>t.replace("/checkout/payment/"+o)}],backgroundColor:"#fff"}),N=null==(e=(0,r.d4)(e=>e.basketData).deliveryCollectionState)?void 0:e.deliverySelected,j=(0,s.useRef)(0);return(0,s.useEffect)(()=>{let e,n=async()=>{var n;let s=await a.A.getPaymentStatus(o,m);console.log("orderStatus: ",s),(null==s||null==(n=s.data)?void 0:n.order_id)&&(clearInterval(e),y("Order Created"),f("success"),setTimeout(()=>{t.replace("/order/"+s.data.order_id)},1e3)),"failure"===m&&(f("failure"),b({title:s.data.reason,description:"No Money has been taken from your account, you may go back to checkout to try again.",buttons:[{text:"Back to Checkout",className:"modal-button",onClick:()=>t.replace("/checkout/payment/"+o)}],backgroundColor:"#fff"}),setTimeout(()=>{k(!0)},1e3))},s=()=>{let e=Date.now();e-j.current<1e3||(j.current=e,n())},r=()=>{"visible"===document.visibilityState&&s()};if(n(),"success"===m){(0,u.cH)(o),e=setInterval(()=>{(0,u.Nt)()||(console.log("Socket disconnected, checking order status..."),n())},1e4),document.addEventListener("visibilitychange",r),window.addEventListener("focus",s);let a=(0,u.aL)(o=>{y(o.event),o.order_id&&(clearInterval(e),y("Order Created"),f("success"),setTimeout(()=>{t.replace("/order/"+o.order_id)},1e3))});return()=>{clearInterval(e),document.removeEventListener("visibilitychange",r),window.removeEventListener("focus",s),a(),(0,u.G1)()}}y("Payment Failed"),f("failed")},[o,m]),(0,n.jsxs)("section",{className:"section-background",children:[(0,n.jsxs)("div",{className:"main-grid checkout-main",children:[(0,n.jsx)(l.A,{numSteps:N?4:3,currentStep:N?4:3,onStepClicked:()=>{}}),(0,n.jsxs)("div",{className:"order-complete",style:{overflowY:"auto",minHeight:420},children:["success"===m&&(0,n.jsx)("p",{style:{color:"#000",marginTop:-350,position:"absolute"},children:"Please wait. Your payment is processing. Do not close or refresh this page."}),(0,n.jsxs)("span",{className:"finalising-order",style:{textAlign:"center"},children:[(0,n.jsx)(c.A,{status:h}),(0,n.jsx)("h1",{children:v})]})]})]}),(0,n.jsx)(d.A,{visible:g,config:x,onClose:()=>k(!1)})]})}},44129:(e,t,o)=>{"use strict";o.d(t,{A:()=>i});var n=o(37876),s=o(89099),r=o(31777),a=o(88380),l=o(53456),c=o(25256);function i(e){let{visible:t,config:o={},onClose:i}=e;(0,s.useRouter)();let p=(0,r.wA)();if(!t)return null;let{title:h="Alert",description:f="",overrideContent:v,buttons:y=[],backgroundColor:g="#fff"}=o;return(0,n.jsx)("div",{className:"modal-overlay",style:d,children:(0,n.jsxs)("div",{className:"modal-content",style:{...u,backgroundColor:g},role:"dialog","aria-modal":"true",children:[h&&(0,n.jsx)("h2",{children:h}),v?(0,n.jsx)("div",{className:"modal-override",children:v}):f&&(0,n.jsx)("p",{className:"modal-description",dangerouslySetInnerHTML:{__html:f}}),y.length>0&&(0,n.jsx)("div",{className:"modal-buttons",style:m,children:y.map((e,t)=>(0,n.jsx)(a.A,{className:e.className||"",onClick:()=>(e=>{if(e.onClick&&e.onClick(),e.route){window.location.href=e.route,i&&i();return}if("SET_CHECKOUT_STEP"===e.actionType){p((0,l.HM)(e.actionPayload)),i&&i();return}if(e.actionId)return void(0,c.NY)(e.actionId);i&&e.onClick&&i()})(e),children:e.text||"OK"},t))})]})})}let d={position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},u={padding:"20px",borderRadius:"10px",width:"400px",maxWidth:"90%",textAlign:"center",boxShadow:"0 4px 12px rgba(0,0,0,0.2)"},m={display:"flex",justifyContent:"center",gap:"12px",marginTop:"20px"}},46357:(e,t,o)=>{"use strict";o.d(t,{G1:()=>d,Nt:()=>i,aL:()=>c,cH:()=>a,gz:()=>l});var n=o(12692);let s=null,r=null,a=e=>((null==s?void 0:s.connected)&&r===e||(d(),r=e,(s=(0,n.io)("https://kukd-socket.kukd.com",{transports:["websocket"],query:{device_id:"Order ".concat(e),order_id:e}})).on("connect",()=>{}),s.on("disconnect",()=>{}),s.on("connect_error",e=>{console.log("socket error: ",e)})),s),l=e=>(s||console.log("socket not connected"),s.on("order update",e),()=>{null==s||s.off("order update",e)}),c=e=>(s||console.log("socket not connected"),s.on("payment update",e),()=>{null==s||s.off("payment update",e)}),i=()=>!!(null==s?void 0:s.connected),d=()=>{s&&(s.disconnect(),s=null,r=null)}},63334:(e,t,o)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout/payment/status/[basket_uuid]",function(){return o(17085)}])},72747:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(37876),s=o(14232),r=o(31777);o(84652);let a=e=>{let{status:t}=e;(0,r.wA)();
1let[o,a]=(0,s.useState)("loading");return(0,s.useEffect)(()=>{t&&a(t)},[t,o]),(0,n.jsx)("div",{className:"circle-loader "+o,children:(0,n.jsx)("div",{className:"status draw"})})}}},e=>{e.O(0,[692,636,593,792],()=>e(e.s=63334)),_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.