1"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[7991],{7991(e,t,r){r.r(t),r.d(t,{AbandonedBetslipHandler:()=>w,default:()=>B});var n=r(9950),s=r(10300),u=r(79707),a=r(1510),c=r(36821),d=r(86929),l=r(78955),o=r(96690),i=r(57093),E=r(76764),f=r(72431);var p=r(78817),b=r(76418),v=r(14848),D=r(75123),A=r(60031),T=r(29746),N=r(14542),O=r(27838);const w=()=>{const[e,t]=n.useState(!1),w=(0,s.d4)(e=>e.userData.authentication),B=(0,s.d4)(e=>e.bets.pendingBets),I=(0,s.d4)(e=>e.bets.betBuilder.totalOddsUpdate||e.bets.betBuilder.totalOddsUpdate),k=(0,s.d4)(e=>e.userData.user?e.userData.user.oddsTypeId:void 0),m=n.useRef(null),C=n.useRef(B),L=n.useRef(I),h=n.useRef(k),y=n.useMemo(()=>B.filter(e=>!e.ticketId).length,[B]),S=n.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),g=n.useCallback(async()=>{const e=C.current,t=e&&e.filter(e=>!e.ticketId);if(t&&t.length&&(0,A.GT)()){const n=t.length===e.length&&L.current||void 0,{odds:s}=(0,p.lF)((0,v.Gf)(t)),a=n||s||void 0,{getSportNameByID:l}=await Promise.resolve().then(r.bind(r,25604)),i=t.map(e=>{var t;const r=(0,T.J)(e.eventId);return{sport:l(e.sportId),competition:null!==(t=null===r||void 0===r?void 0:r.competition.name)&&void 0!==t?t:"",event:r?(0,N.y3)(r):"",odds:(0,v.WY)(e).oddsString}}),E=a?(0,D.XV)(a,(0,b.OJ)(a),h.current||d.PM.DECIMAL):void 0,f={[u.m.TICKET_ODDS]:E,[u.m.BET_LIST]:i},A=JSON.stringify(f);(0,o.W3)(u.p.ABANDONED_BETSLIP,f),(0,O.dh)(c.N.ABANDONED_BETSLIP,A)}},[]),R=n.useCallback(()=>{S();const e=()=>{g(),window.removeEventListener(l.qH.BEFOREUNLOAD,R)};try{const{type:t}=window.performance.getEntriesByType(l.wX.NAVIGATION)[0];t===l.Jj.RELOAD?window.removeEventListener(l.qH.BEFOREUNLOAD,R):e()}catch(t){e()}},[g,S]),U=n.useCallback(()=>window.addEventListener(l.qH.BEFOREUNLOAD,R),[R]),H=n.useCallback(()=>window.removeEventListener(l.qH.BEFOREUNLOAD,R),[R]),_=n.useCallback(()=>{S(),H(),g()},[g,H,S]),F=n.useCallback(async()=>{m.current&&(S(),H(),await g()),t(!1),(0,O.Sb)(void 0)},[g,H,S]),P=n.useCallback(e=>{e?(H(),U()):H()},[U,H]),q=n.useCallback(e=>{if(e){const e=f.rs&&f.rs>=0?f.rs*i.Vn:E.rl.ABANDONED_BETSLIP;S(),m.current=setTimeout(()=>_(),e)}else S()},[S,_]);return n.useEffect(()=>{e&&q(y)},[y,e,q]),n.useEffect(()=>{e&&P(y)},[e,y,P]),n.useEffect(()=>{e&&w===a.j2.UNAUTHENTICATED&&F()},[w,e,F]),n.useEffect(()=>{w===a.j2.AUTHENTICATED&&t(!0)},[w]),n.useEffect(()=>{C.current&&(C.current=B)},[B]),n.useEffect(()=>{L.current&&(L.current=I)},[I]),n.useEffect(()=>{h.current&&(h.current=k)},[k]),null},B=w}}]);
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.