PageSourceSearch

https://delawvery-prod.web.app/_next/static/chunks/app/%5Blocale%5D/(home)/checkout/page-003ce140cc3d33d2.js

js delawvery-prod.web.app collected 2026-10-03 12:21:40 UTC 9,427 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3237,890,2828,1038,382,110,878],{17961:function(e,n,t){Promise.resolve().then(t.bind(t,58866))},33100:function(e,n,t){"use strict";var i=t(60891);n.Z=void 0;var a=i(t(19438)),l=t(3827);n.Z=(0,a.default)((0,l.jsx)("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt")},58866:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return w}});var i=t(3827),a=t(30982),l=t(64090),d=t(55954),r=t(87957),o=t(33100),s=t(47907),u=t(82670),c=t(97492),m=t(73667),p=t(29170);let v=e=>{let{nameOnOrder:n,email:t,nameOnReceipt:i,vatIdOnReceipt:a,receiptId:l,isApproved:d,utm:r,eventData:o,onSuccess:s}=e,{websiteAPI:u}=(0,c.h_)();return(0,m.useQuery)({queryFn:async()=>{let e=await u({method:"processOrder",body:{nameOnOrder:n,email:t,nameOnReceipt:i,vatIdOnReceipt:a,receiptId:l,utm:r}});if("SUCCESS"===e.data.status){var d,c,m;(null===(d=e.data.payload)||void 0===d?void 0:d.orderId)&&(0,p.Nf)("purchase",{...o,transaction_id:null===(c=e.data.payload)||void 0===c?void 0:c.orderId,delaw_event_id:null===(m=window.crypto)||void 0===m?void 0:m.randomUUID()}),await s(null==e?void 0:e.data)}return"FAILED"===e.data.status&&console.error(e.data.message),e},queryKey:["ProcessOrder"],refetchOnMount:!1,refetchOnWindowFocus:!1,enabled:!!l||d&&""!==n&&""!==t})};var x=t(65833),h=t(69297),g=t(94286),f=t(70389),O=t(36714),y=t(5279),j=t(57632),b=t(78758),I=t(41991),S=t(50682);let k=I.object().shape({nameOnOrder:I.string().required((0,S.i0)("checkout.validation.nameOnOrder")),email:I.string().email((0,S.i0)("checkout.validation.invalidEmail")).required((0,S.i0)("checkout.validation.email")),nameOnReceipt:I.string().required((0,S.i0)("checkout.validation.nameOnReceipt")),vatIdOnReceipt:I.string().nullable()}),R=e=>{var n,t,m,I,S;let{setIsProcessingOrder:R,isProcessingOrder:_}=e,w=(0,a.useTranslations)("checkout"),C=(0,s.useSearchParams)(),E=(0,y.tv)(),N=C.get("mode"),L=(0,p.k2)(),[T,W]=(0,l.useState)(null),[D,B]=(0,l.useState)(!1),[F,P]=(0,l.useState)(null),[M,q]=(0,l.useState)(null),[X,A]=(0,l.useState)(!1),Z=(0,l.useRef)(null),{isGuest:U,idToken:z}=(0,O.useAuth)(),{actions:V}=(0,d.Np)(),{data:Q,isLoading:G,isFetching:H}=(0,c.iQ)(),K=w((null==Q?void 0:null===(n=Q.paymentSettings)||void 0===n?void 0:n.paymentType)==="IMMEDIATE"?"continuePayment":"inviteUserSubmitButtonTitle"),Y=(0,l.useMemo)(()=>!!z&&!!Q&&Q&&z&&!(0,b.iC)(z)&&(0,b.LW)(Q),[z,Q]),J=(0,l.useMemo)(()=>!!N&&"sendOrderForExecution"===N,[N]),$=(0,u.cI)({resolver:(0,r.X)(k)}),{register:ee,handleSubmit:en,watch:et,formState:{errors:ei},reset:ea}=$,el=(0,l.useMemo)(()=>{var e,n,t,i,a,l,d,r;if(U){let e=(null===(r=V[0])||void 0===r?void 0:null===(d=r.data)||void 0===d?void 0:d.contactDetails)||null;return{nameOnOrder:(null==e?void 0:e.name)||"",email:(null==e?void 0:e.email)||"",nameOnReceipt:(null==e?void 0:e.name)||"",vatIdOnReceipt:null}}return{nameOnOrder:(null==Q?void 0:Q.accountName)||Q?(null==Q?void 0:Q.firstName)+" "+(null==Q?void 0:Q.lastName):"",email:(null==Q?void 0:null===(n=Q.paymentSettings)||void 0===n?void 0:null===(e=n.paymentSettings)||void 0===e?void 0:e.bookkeepingEmail)||(null==Q?void 0:null===(t=Q.paymentSettings)||void 0===t?void 0:t.bookkeepingEmail)||(null==Q?void 0:Q.email)||"",nameOnReceipt:(null==Q?void 0:Q.accountName)||(null==Q?void 0:Q.firstName)+" "+(null==Q?void 0:Q.lastName)||"",vatIdOnReceipt:(null==Q?void 0:null===(a=Q.paymentSettings)||void 0===a?void 0:null===(i=a.paymentSettings)||void 0===i?void 0:i.vatId)||(null==Q?void 0:null===(l=Q.paymentSettings)||void 0===l?void 0:l.vatId)||null}},[V,Q,U]);(0,l.useEffect)(()=>{el&&(J||!ed.email)&&(ea(el),A(!1))},[ea,el,J,Q]);let ed=et(),er=0,eo=0,es=V.map(e=>{let{type:n,data:t}=e,i=g.uZ.find(e=>e.name===n),{pricing:a}=(null==t?void 0:t.pricing)||{};return er+=(null==a?void 0:a.totalAfterDiscount)||(null==a?void 0:a.total)||0,eo+=(null==a?void 0:a.tolls)||0,(0,j.o)(i,a)[0]}),{mutateAsync:eu,isPending:ec}=(0,d.ce)(),em=(0,l.useCallback)(async e=>{let{payload:n}=e;(null==n?void 0:n.orderId)&&(await eu(),E.push({pathname:"/successOrder",query:{orderId:null==n?void 0:n.orderId}}))},[eu]),ep=(0,l.useCallback)(async e=>{let{payload:n,message:t}=e;"NO_PAYMENT"===t&&A(!0),(null==n?void 0:n.payment_url)&&((0,p.Nf)("add_payment_info",{value:er,currency:"ILS",items:es}),P(null==n?void 0:n.payment_url))},[]),{isLoading:ev,isFetching:ex,refetch:eh}=(0,d.x0)({nameOnOrder:ed.nameOnOrder||"",email:ed.email||"",nameOnReceipt:ed.nameOnReceipt||"",vatIdOnReceipt:ed.vatIdOnReceipt||null,onSuccess:ep,isFormSubmitted:Y&&"undefined undefined"!==ed.nameOnOrder&&"undefined undefined"!==ed.nameOnReceipt||!!T}),{isLoading:eg,isFetching:ef}=v({nameOnOrder:ed.nameOnOrder||"",email:ed.email||"",nameOnReceipt:ed.nameOnReceipt||"",vatIdOnReceipt:ed.vatIdOnReceipt||null,receiptId:M,utm:L,isApproved:X,eventData:{payment_type:M?"credit card":"invoice",payment_number:Q?(Q.numberOfOrders||0)+1:1,tax:eo,value:er,currency:"ILS",items:es},onSuccess:em});(0,l.useEffect)(()=>{let e=eg||ef;e&&R(e)},[ef,eg,R]),(0,l.useEffect)(()=>{(T||J)&&!F&&eh()},[T,J,el,eh]);let eO=()=>{$.reset(),B(!1),P(null)};(0,l.useEffect)(()=>
1{if(F)return F&&window.addEventListener("message",e),()=>{window.removeEventListener("message",e)};async function e(e){if("object"==typeof e.data&&e.data.event_type){if("payment_success"!=e.data.event_type){console.error(e.data);return}if("payment_success"===e.data.event_type){var n,t;let i=null===(t=e.data)||void 0===t?void 0:null===(n=t.payment_info)||void 0===n?void 0:n.docnum;if(!i)return;B(!0),q(Number(i))}}}},[F]);let ey={fullWidth:!0,disableBoxShadow:!0};return ev||ex||eg||ef||_||G||H||ec?(0,i.jsx)(f.kC,{alignItems:"center",justifyContent:"center",marginTop:"30%",children:(0,i.jsx)(f.D8,{})}):J||(null==z?void 0:null===(t=z.claims)||void 0===t?void 0:t.companyId)&&Q&&!(0,b.iC)(z)&&!(0,b.LW)(Q)?(0,i.jsx)(i.Fragment,{}):(0,i.jsxs)(f.kC,{column:!0,gap:"20px",children:[!Y&&(0,i.jsx)(f.W2,{column:!0,padding:"20px",flex:.5,height:"510px",children:(0,i.jsx)(u.RV,{...$,children:(0,i.jsxs)(f.kC,{component:"form",onSubmit:en(e=>{W(e),(0,p.Nf)("add_company_details",{value:er,currency:"ILS",items:es}),B(!0)}),sx:{flexDirection:"column"},children:[(0,i.jsxs)(f.kC,{justifyContent:"space-between",children:[(0,i.jsx)(f.ZT,{variant:"subtitle1",fontWeight:600,marginBottom:2,children:w("receiptDetails")}),F&&(0,i.jsx)(f.zx,{type:"button",sx:{gap:1},startIcon:(0,i.jsx)(o.Z,{}),variant:"text",color:"secondary",onClick:()=>eO(),children:w("reset")})]}),(0,i.jsxs)(f.rj,{container:!0,gap:{xs:0,md:10,lg:10},spacing:2,rowSpacing:{xs:4,md:4},children:[(0,i.jsx)(f.rj,{xs:12,md:4,children:(0,i.jsx)(x.Xn,{...ey,fullWidth:!0,required:!0,disabled:D||!!F,opacity:.5,error:!!ei.nameOnReceipt,helperText:null===(m=ei.nameOnReceipt)||void 0===m?void 0:m.message,title:w("nameOnReceipt"),...ee("nameOnReceipt")})}),(0,i.jsx)(f.rj,{xs:12,md:4,children:(0,i.jsx)(x.Xn,{...ey,fullWidth:!0,disabled:D||!!F,opacity:.5,error:!!ei.vatIdOnReceipt,helperText:null===(I=ei.vatIdOnReceipt)||void 0===I?void 0:I.message,title:w("vatIdOnReceipt"),...ee("vatIdOnReceipt")})})]}),(0,i.jsx)("br",{}),U&&(0,i.jsx)(f.rj,{container:!0,spacing:2,children:(0,i.jsx)(f.rj,{xs:12,md:4,children:(0,i.jsx)(x.Xn,{required:!0,...ey,fullWidth:!0,disabled:D,opacity:.5,error:!!ei.email,helperText:null===(S=ei.email)||void 0===S?void 0:S.message,title:w("email"),...ee("email")})})}),(0,i.jsx)(f.zx,{type:"submit",variant:"contained",disabled:D||!!F,fullWidth:!0,isLoading:G||H,sx:{backgroundColor:"#213D79",width:{xs:"100%",md:"170px",lg:"170px"},height:{xs:"45px",md:"58px",lg:"58px"},borderRadius:"12px",gap:"6px"},children:K})]})})}),(0,i.jsx)(f.W2,{width:"100%",marginBottom:"20px",children:F&&(0,i.jsx)(h.r,{title:"חשוב! נא לא לסגור את העמוד עד לקבלת אישור בדבר קליטת ההזמנה.",containerProps:{flex:1}})}),F&&(0,i.jsxs)(f.W2,{width:"100%",height:"500px",flex:.5,marginBottom:"20px",children:["(",(0,i.jsx)("iframe",{src:F,ref:Z,width:"100%",height:"500px",title:"Payment Details",style:{position:"relative",top:"0",left:"0",border:"none"},onLoad:()=>{window.scrollTo(0,document.body.scrollHeight)}}),")"]})]})};var _=t(17829);function w(e){let{searchParams:n}=e,t=(0,a.useTranslations)("checkout"),{actions:r,isLoading:o}=(0,d.Np)(),[s,u]=(0,l.useState)(!1),c=(0,l.useMemo)(()=>s,[s]),m=(0,y.tv)(),p=!(0,S.X0)(n.isBagOpen);return(0,l.useEffect)(()=>{c||o||(null==r?void 0:r.length)!==0||m.push(g._j.home)},[r,m,o,c]),(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(f.xu,{id:"checkout-container",sx:{display:"flex",flexDirection:"row-reverse",height:"calc(100vh - 80px)",width:"100%",bgcolor:"lightBlueBG.main"},children:[(0,i.jsx)(_.SideBar,{isBagOpen:p,isLoading:c}),(0,i.jsxs)(f.kC,{id:"checkout-container",column:!0,gap:"20px",width:"100%",children:[(0,i.jsx)(f.ZT,{marginX:{xs:"20px",md:"100px"},marginTop:"20px",fontWeight:700,fontSize:"3rem",children:t("title")}),(0,i.jsx)(f.kC,{flex:1,marginX:{md:"75px",lg:"75px"},marginBottom:"250px",paddingX:{md:"24px",lg:"24px"},column:!0,children:(0,i.jsx)(R,{setIsProcessingOrder:u,isProcessingOrder:c})})]})]})})}}},function(e){e.O(0,[5651,4358,7326,5400,8851,1544,1778,6990,6890,1349,2971,5468,1744],function(){return e(e.s=17961)}),_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.