PageSourceSearch

https://smarkets.com/_next/static/chunks/7205-90cfeb7cd87a4478.js

js smarkets.com collected 2026-10-01 12:12:36 UTC 32,996 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0b2bd035-bfbf-4644-8fb3-887770256d27",e._sentryDebugIdIdentifier="sentry-dbid-0b2bd035-bfbf-4644-8fb3-887770256d27")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7205],{4534:e=>{e.exports={intervalList:"IntervalPicker_intervalList__11U3d",intervalItem:"IntervalPicker_intervalItem__kHHXQ",active:"IntervalPicker_active__dM0hv"}},18230:(e,t,n)=>{"use strict";n.d(t,{Di:()=>x,Fg:()=>m,Fn:()=>s,P1:()=>c,Qt:()=>i,TL:()=>d,Wz:()=>f,Xx:()=>o,b7:()=>v,cz:()=>u,os:()=>h});var r=n(56380),l=n.n(r);let a=["var(--primary-green)","var(--black)","var(--primary-purple)","var(--primary-blue)","var(--primary-orange)","var(--primary-yellow)","var(--primary-pink)"],i=l()(function(e){return e<a.length?a[e]:"hsl(".concat((137.5*e%360).toFixed(1),", ").concat(60+13*e%20,"%, ").concat(e%2==0?50:60,"%)")}),s=200,o={top:21,bottom:24,left:0,right:40},c=1.75,u=1.25,d=.35,h=l()(e=>{let t=v(e);return e=>t(new Date(e))}),m=6,f=6,g=new Intl.DateTimeFormat(void 0,{dateStyle:"short"}),p=new Intl.DateTimeFormat(void 0,{timeStyle:"short"}),v=l()(e=>{if(!e)return e=>g.format(e);let[t,n]=e;return n-t<=864e5?e=>p.format(e):e=>g.format(e)}),x=e=>"".concat(e).concat(e>0?"%":"")},34562:e=>{e.exports={container:"ExecutionsChart_container__RAHpt",chart:"ExecutionsChart_chart__vYurl",gridLine:"ExecutionsChart_gridLine__xQ_d4",emptyChart:"ExecutionsChart_emptyChart__yx8hx",chartInfo:"ExecutionsChart_chartInfo__eGlJz",legendContainer:"ExecutionsChart_legendContainer__QMdvc"}},37205:(e,t,n)=>{"use strict";n.d(t,{default:()=>eP});var r=n(73365),l=n(1521),a=n(34801),i=n.n(a),s=n(22169),o=n.n(s),c=n(66302),u=n.n(c),d=n(12009),h=n(21474),m=n(24895),f=n(29277),g=n(84689);function p(e){let{eventId:t,marketId:n,contractIds:r,params:l}=e;return[m.O.EXECUTIONS_TIME_SERIES,t,n,r.slice().sort().join(","),...l?[JSON.stringify(l)]:[]]}let v=function(e){let{eventId:t,marketId:n,contractIds:r,params:l}=e,a=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return(0,g.I)({queryKey:p({eventId:t,marketId:n,contractIds:r,params:l}),queryFn:()=>(0,f.Al)(t,n,r,l),staleTime:0,enabled:a})};var x=n(5957),_=n(83551),M=n(90283);M.tL.CURRENT_AFFAIRS,M.tL.POLITICS;let b={[M.qO.LIVE]:!0,[M.qO.ENDED]:!0,[M.qO.SETTLED]:!0};M.tL.CRICKET,M.tL.GOLF;var k=n(79554),I=n(56380),y=n.n(I),w=n(76211),C=n(74709),L=n(80011);function S(e){return 1e3*Math.round(e/1e3)}let E=(e,t)=>t-e-3e5>0,j=y()(function(e,t,n,r,l){let a={source:{eventType:e,eventState:t,eventCreatedDatetime:n,eventStartDatetime:r},intervals:[]},i=new Date(n),s=new Date(r),o=new Date(l||S(Date.now()));return a.intervals.push(...((e,t,n,r)=>{let l=[],a=new Date(n),i=w.c9.fromISO(r),s=a.getTime();return E(s,i.minus({months:12}).toMillis())&&l.push("M12"),E(s,i.minus({months:6}).toMillis())&&l.push("M6"),E(s,i.minus({months:1}).toMillis())&&l.push("M1"),E(s,i.minus({days:7}).toMillis())&&l.push("d7"),E(s,i.minus({hours:24}).toMillis())&&l.push("h24"),e.domain===M.tL.HORSE_RACING&&(E(s,i.minus({hours:6}).toMillis())&&l.push("h6"),E(s,i.minus({hours:1}).toMillis())&&l.push("h1")),e.domain===M.tL.FOOTBALL&&e.scope===M.jP.SINGLE_EVENT&&E(s,i.minus({minutes:150}).toMillis())&&l.push("m150"),b[t]&&(e.domain===M.tL.HORSE_RACING?l.push("m10"):(e.domain!==M.tL.FOOTBALL||e.scope!==M.jP.SINGLE_EVENT)&&E(s,i.minus({hours:4}).toMillis())&&l.push("h4")),l})(e,t,i.toISOString(),o.toISOString())),b[t]&&+s<Date.now()&&E(i.getTime(),s.getTime())&&(a.intervals.splice(1,0,"PRE_MATCH"),a.intervals.push("IN_PLAY")),a.intervals=a.intervals.slice(-3),a.intervals.reverse(),a.intervals.push("ALL"),a},function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let[r,...l]=t;return"".concat(r.domain,", ").concat(r.scope,", ").concat(l.join(", "))});function N(e){return new Date(e.endsWith("Z")?e:"".concat(e,"Z"))}function A(e,t,n){return!e&&!t||!!e&&e===n||!!t&&t===n}let T={ALL:"excw.graphs.interval.ALL",PRE_MATCH:"excw.graphs.interval.PRE_MATCH",IN_PLAY:"excw.graphs.interval.IN_PLAY",M12:"excw.graphs.interval.M12",M6:"excw.graphs.interval.M6",M1:"excw.graphs.interval.M1",d7:"excw.graphs.interval.d7",h24:"excw.graphs.interval.h24",h6:"excw.graphs.interval.h6",h4:"excw.graphs.interval.h4",h1:"excw.graphs.interval.h1",m150:"excw.graphs.interval.m150",m10:"excw.graphs.interval.m10"},P=new Set([M.tL.BOXING]),O=new Set([M.tL.AMERICAN_FOOTBALL,M.tL.BASEBALL,M.tL.BASKETBALL,M.tL.DARTS,M.tL.HANDBALL,M.tL.ICE_HOCKEY,M.tL.VOLLEYBALL]),D=new Set([M.tL.CRICKET,M.tL.FOOTBALL,M.tL.RUGBY_LEAGUE,M.tL.RUGBY_UNION,M.tL.TENNIS]),R=new Set([M.tL.GREYHOUND_RACING,M.tL.HORSE_RACING,M.tL.MOTORSPORTS,M.tL.SAILING]);var F=n(18230);
1let H=function(e){let{contracts:t,eventType:n,eventState:r,eventCreatedDatetime:a,eventStartDatetime:i}=e,s=(0,l.useMemo)(()=>{var e;return null!=(e=function(e){if(!e)return null;let t=null;for(let n of e){let e=n.outcome_timestamp,r=n.state_or_outcome;if(!C._c[r])return null;(null===t||e&&new Date(e)>new Date(t))&&(t=e)}return t}(t))?e:void 0},[t]),o=(0,l.useMemo)(()=>{let{intervals:e}=j(n,r,a,i,null!=s?s:new Date().toISOString());return e},[n,a,i,r,s]),[c,u]=(0,l.useState)("ALL");return{chartInterval:c,setChartInterval:u,availableIntervals:o,contractEndDatetime:s}};var B=n(64447),G=n(92704),z=n(78927),W=n(66642),X=n(92499),Y=n(73323),V=n(74635),Q=n(21784);let q=function(){let e=(0,l.useRef)(new Map),[,t]=(0,l.useReducer)(e=>e+1,0),n=(0,l.useCallback)(n=>{let r=e.current,l=new Set;for(let e of n){l.add(e.id);let t=r.get(e.id);t?t.start(e.top):(t=new Q.tQ(e.top,{config:{tension:70,friction:14}}),r.set(e.id,t))}for(let[e]of r)l.has(e)||r.delete(e);t()},[]);return{updateLabelPositions:n,getY:(0,l.useCallback)((t,n)=>{let r=e.current.get(t);return r?r.get():n},[]),snapToPositions:(0,l.useCallback)(()=>{for(let t of e.current.values())t.set(t.goal);t()},[])}},U=function(e){let{selectedContractIds:t,contractsById:n,contractsIndexMap:a,chartData:i,closestYByContractId:s,latestPriceByContractId:o,highlightedContract:c,hoveredContract:u,cursorXPx:d,innerWidth:h,innerHeight:m,throttledCursorPosition:f,xScale:g,yScale:p,hasInteracted:v}=e,{updateLabelPositions:x,getY:_,snapToPositions:M}=q(),b=null!=f&&v,k=(0,l.useMemo)(()=>{let e=[];for(let n of t){let t,r=i[n];r&&(b&&(t=null==s?void 0:s[n]),null==t&&(t=null==o?void 0:o[n]),null!=t&&e.push({id:n,yVal:t,data:r,center:p(t)}))}return e.sort((e,t)=>e.center-t.center),e},[t,i,b,s,o,p]),I=(0,l.useMemo)(()=>{let e=[];for(let t of k){let n=t.center-19;if(n<0&&(n=0),e.length){let t=e[e.length-1].top+38;n<t&&(n=t)}n>m-38&&(n=m-38),e.push({id:t.id,top:n,yVal:t.yVal,data:t.data})}for(let t=e.length-2;t>=0;t--){let n=e[t],r=e[t+1].top-38;n.top>r&&(n.top=r)}if(e.length&&e[0].top<0){let t=-e[0].top;for(let n of e)n.top+=t}return e},[k,m]),y=(0,l.useCallback)((e,t)=>{if(6*e.length<=t)return e;let n=Math.max(1,Math.floor((t-6)/6));return e.length<=n?e:e.slice(0,n)+"…"},[]);return(0,l.useEffect)(()=>{x(I.map(e=>({id:e.id,top:e.top}))),b||M()},[I,x,M,b]),(0,r.jsx)(r.Fragment,{children:I.map(e=>{var t;let{id:l,top:i,yVal:s,data:o}=e,f=Math.min((null!=d&&v?d:g(new Date(o[o.length-1].x)))+6,h-2),p=(null==(t=n[l])?void 0:t.name)||"";if(p){let e=h-f-4;e>0&&(p=y(p,e))}let x=_(l,i)+1+10,M=x+18,b=m-1;if(M>b){let e=M-b;if(x-=e,M-=e,x<0){let e=-x;x+=e,(M+=e)>b&&(M=b)}}let k=(0,F.Qt)(a[l]),I=A(c,u,l);return(0,r.jsxs)("text",{style:{pointerEvents:"none"},children:[(0,r.jsx)("tspan",{x:f,y:x,fontSize:10,fontFamily:"Inter",fontWeight:"400",fill:k,fillOpacity:I?1:.5,paintOrder:"stroke",stroke:"var(--white)",strokeWidth:3,strokeLinejoin:"round",strokeLinecap:"round",textAnchor:"start",children:p}),(0,r.jsxs)("tspan",{x:f,y:M,fontSize:14,fontFamily:"Inter",fontWeight:"500",fill:k,fillOpacity:I?1:.5,paintOrder:"stroke",stroke:"var(--white)",strokeWidth:4,strokeLinejoin:"round",strokeLinecap:"round",textAnchor:"start",children:[Math.round(10*s)/10,"%"]})]},l)})})},Z=function(e){let{cursorXPx:t,seriesWidth:n,innerHeight:l,hasInteracted:a,cursorLabelText:i,innerWidth:s}=e;return(0,r.jsxs)(r.Fragment,{children:[null!=t&&a&&(0,r.jsx)("rect",{x:t,y:-1,width:n-(t-1),height:l+2,fill:"var(--white)",fillOpacity:.6,pointerEvents:"none"}),null!=t&&a&&(0,r.jsx)("line",{x1:t,x2:t,y1:0,y2:l,stroke:"var(--dark-grey-1)",strokeWidth:2,strokeOpacity:.6,pointerEvents:"none"}),null!=t&&i&&a&&(0,r.jsx)("text",{x:Math.max(24,Math.min(t,s-24)),y:-6,textAnchor:"middle",fontSize:10,fontFamily:"Inter",fontWeight:400,fill:"var(--dark-grey-1)",children:i})]})};var J=n(34562),K=n.n(J);function $(e){let{height:t,width:n}=e;return(0,r.jsx)("div",{style:{height:t,width:n}})}let ee=function(e){let{width:t,height:n,domainXInMs:a,preprocessedData:i,chartData:s,selectedContractIds:o,contractsById:c,contractsIndexMap:u,latestPriceByContractId:d,highlightedContract:h,hoveredContract:m,disableCursor:f=!1,interval:g}=e,[p,v]=(0,l.useState)(null);(0,l.useEffect)(()=>{(null==i?void 0:i.maxPrice)!=null&&v(e=>Math.max(e||0,i.maxPrice))},[i]);
1let{adjustedDomainXInMs:x,xScale:M,yScale:b,yTickValues:k,xTickValues:I,innerWidth:y,innerHeight:w,seriesWidth:C}=function(e){let{width:t,height:n,domainXInMs:r,preprocessedData:a,chartData:i,selectedContractIds:s,maxPriceSeen:o,interval:c}=e,u=(0,l.useMemo)(()=>{if(!a)return[];let{minPrice:e,maxPrice:t}=a;null!=o&&(t=Math.max(t,o)),e=(0,L.n)(e),t=(0,L.n)(t);let n=5*Math.floor(e/5),r=(5*Math.ceil(t/5)-n)/(F.Wz-1);return Array.from({length:F.Wz},(e,t)=>Math.round(n+t*r))},[a,o]),d=t?t-F.Xx.left-F.Xx.right:0,h=Math.round(.2*d),m=Math.max(0,d-h),f=n-F.Xx.top-F.Xx.bottom,g=(0,l.useMemo)(()=>i?function(e){let{domainXInMs:t,chartData:n,selectedContractIds:r,interval:l}=e,a=t[0];if("ALL"===l||"PRE_MATCH"===l){let e=r.flatMap(e=>{var t,r;let l=null==(r=n[e])||null==(t=r[0])?void 0:t.x;return"number"==typeof l?[l]:[]}).sort((e,t)=>e-t),t=r.length>1&&e.length>1?e[1]:e[0];null!=t&&t>a&&(a=t)}let i=t[1];for(let e of r){let t=n[e];if(null==t?void 0:t.length){let e=t[t.length-1].x;e>i&&(i=e)}}return[a,i]}({domainXInMs:r,chartData:i,selectedContractIds:s,interval:c}):r,[r,i,s,c]),p=(0,l.useMemo)(()=>(0,Y.A)({domain:[g[0],g[1]].map(e=>new Date(e)),range:[0,m]}),[g,m]),v=Math.max(2,Math.floor(m/60)),x=(0,l.useMemo)(()=>{let e=p.ticks(2*F.Fg).filter(e=>p(e)>=30);if(e.length<=v)return e;let t=Math.ceil(e.length/v);return e.filter((e,n)=>n%t==0)},[p,v]),[_,M]=(0,l.useMemo)(()=>{let e=u.length?u[0]:0,t=u.length?u[u.length-1]:1;if(!u.length){let n=1/0,r=-1/0;for(let e of s){let t=i[e];if(t)for(let e of t)e.y<n&&(n=e.y),e.y>r&&(r=e.y)}isFinite(n)&&isFinite(r)&&n!==1/0&&(e=Math.floor(n),t=Math.ceil(r))}return null!=o&&(t=Math.max(t,Math.ceil((0,L.n)(o)))),[e,t]},[u,s,i,o]);return{adjustedDomainXInMs:g,xScale:p,yScale:(0,l.useMemo)(()=>(0,V.A)({domain:[_,M],range:[f,0],nice:!1,clamp:!0}),[_,M,f]),yTickValues:u,xTickValues:x,innerWidth:d,innerHeight:f,seriesWidth:m}}({width:t,height:n,domainXInMs:a,preprocessedData:i,chartData:s,selectedContractIds:o,maxPriceSeen:p,interval:g}),S=(0,l.useMemo)(()=>(function(e,t){let n=!1,r={...e};for(let l of(0,_.H)(e)){let a=e[l],i=a[0];i&&!(i.x<=t)&&(n=!0,r[l]=[{x:t,y:i.y},...a])}return n?r:e})(s,x[0]),[s,x]),{cursorPosition:E,throttledCursorPosition:j,cursorLabelText:N,cursorXPx:T,setCursorXPx:P,hasInteractedRef:O,latestDataTsRef:D,handlePointerMove:R,handlePointerLeave:H}=function(e){let{domainXInMs:t,disableCursor:n=!1}=e,[r,a]=(0,l.useState)(null),[i,s]=(0,l.useState)(null),[o,c]=(0,l.useState)(null),u=(0,l.useRef)(!1),d=(0,l.useRef)(null),h=(0,l.useCallback)(e=>{a(null!=e?e.getTime():null)},[a]),m=(0,l.useRef)(null),f=(0,l.useRef)(0);(0,l.useEffect)(()=>()=>{m.current&&cancelAnimationFrame(m.current)},[]),(0,l.useEffect)(()=>{if(null==r)return void s(null);let e=Date.now();if(e-f.current>=32)f.current=e,s(r);else{let e=requestAnimationFrame(()=>{r!==i&&(f.current=Date.now(),s(r))});return()=>{cancelAnimationFrame(e)}}},[r,i]);let g=(0,l.useMemo)(()=>r?(0,F.os)(t)(r):null,[r,t]),p=(0,l.useCallback)((e,t,r)=>{if(n)return;let l=(0,X.A)(e);if(!l)return;let a=l.x-F.Xx.left;if(a<0||a>r)return;let i=t.invert(a);m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{u.current=!0;let e=d.current;if(null!=e&&i.getTime()>e){null==h||h(null),s(null);return}null==h||h(i)})},[n,h]);return{cursorPosition:r,throttledCursorPosition:i,cursorLabelText:g,cursorXPx:o,setCursorXPx:c,hasInteractedRef:u,latestDataTsRef:d,handlePointerMove:p,handlePointerLeave:(0,l.useCallback)(()=>{m.current&&cancelAnimationFrame(m.current),null==h||h(null),s(null)},[h])}}({domainXInMs:x,disableCursor:f}),Q=(0,l.useMemo)(()=>{if(!S||null==E)return null;let e={};for(let t of o){let n=S[t];if(!(null==n?void 0:n.length))continue;let r=function(e,t){if(!e.length)return null;let n=0,r=e.length-1;for(;n<r;){let l=Math.floor((n+r)/2);e[l].x<t?n=l+1:r=l}let l=n>0?e[n-1]:e[0],a=e[n]||e[e.length-1];return Math.abs(l.x-t)<=Math.abs(a.x-t)?l.y:a.y}(n,E);null!=r&&(e[t]=r)}return e},[S,o,E]);(0,l.useEffect)(()=>{let e=-1/0;for(let t of o){let n=S[t];if(null==n?void 0:n.length){let t=n[n.length-1].x;t>e&&(e=t)}}D.current=e===-1/0?null:e},[S,o,D]);let q="chart-clip-".concat(o[0]||"default");return(0,l.useEffect)(()=>{null==E?P(null):P(M(new Date(E)))}
1,[E,M,P]),(0,r.jsxs)("svg",{width:t,height:n,className:K().chartSvg,children:[(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:q,children:(0,r.jsx)("rect",{x:0,y:0,width:y,height:w})})}),(0,r.jsxs)(G.A,{left:F.Xx.left,top:F.Xx.top,children:[k.map(e=>{let t=b(e);return(0,r.jsx)("line",{x1:0,x2:y,y1:t,y2:t,className:K().gridLine,pointerEvents:"none"},e)}),(0,r.jsx)("g",{clipPath:"url(#".concat(q,")"),children:o.map(e=>{let t=S[e];if(!t)return null;let n=A(h,m,e);return(0,r.jsx)(B.A,{data:t,x:e=>M(new Date(e.x)),y:e=>b(e.y),stroke:(0,F.Qt)(u[e]),strokeWidth:n?F.P1:F.cz,strokeOpacity:n?1:F.TL,fill:"none",curve:void 0},e)})}),(0,r.jsx)(Z,{cursorXPx:T,seriesWidth:C,innerHeight:w,hasInteracted:O.current,cursorLabelText:N,innerWidth:y}),(0,r.jsx)(U,{selectedContractIds:o,contractsById:c,contractsIndexMap:u,chartData:S,closestYByContractId:Q,latestPriceByContractId:d,highlightedContract:h,hoveredContract:m,cursorXPx:T,innerWidth:y,innerHeight:w,throttledCursorPosition:j,xScale:M,yScale:b,hasInteracted:O.current}),(0,r.jsx)(z.A,{top:w,scale:M,tickValues:I,tickFormat:e=>(0,F.b7)(x)(e),tickLabelProps:{fill:"var(--grey-2)",fontSize:10,fontFamily:"Inter",textAnchor:"middle",dy:10},stroke:"transparent",tickStroke:"transparent",tickLength:0}),(0,r.jsx)(W.A,{left:y,scale:b,tickValues:k,tickFormat:e=>(0,F.Di)(e),tickLabelProps:{fill:"var(--grey-2)",fontSize:10,fontFamily:"Inter",dx:8},stroke:"transparent",tickStroke:"transparent",tickLength:0}),(0,r.jsx)("rect",{x:0,y:0,width:y,height:w,fill:"transparent",onPointerMove:e=>{R(e,M,y)},onPointerLeave:H})]})]})};var et=n(2452),en=n(55425),er=n(76923),el=n(92037),ea=n(60474),ei=n(239),es=n(85199),eo=n(42462),ec=n.n(eo);function eu(e){let{name:t,contractId:n,marketId:l,latestPrice:a,oddsFormat:i}=e,s=(0,el.Gy)(n,l,void 0===a),o=(0,ea.TZ)(s,"buy"),c=a?"".concat(a,"%"):o?(0,ei.EX)({price:o,oddsFormat:"percent",side:"buy",prettified:!0,currency:void 0}):en.k;return(0,r.jsxs)("span",{className:ec().contractName,children:["".concat(t,", "),c]})}let ed=l.memo(function(e){let{contractIds:t,contractsById:n,contractsIndexMap:a,selectedContractIds:i,latestPriceByContractId:s,onSelect:o,onClear:c,onSelectTopContracts:u}=e,[d,h]=(0,l.useState)(!1),m=(0,es.h8)(),f=new Set(i);return(0,r.jsxs)(et.bL,{open:d,onOpenChange:h,children:[(0,r.jsx)(et.l9,{asChild:!0,children:(0,r.jsx)("button",{className:ec().trigger,"aria-label":"Select contracts trigger",children:(0,r.jsx)(er.A,{className:ec().sliderIcon})})}),(0,r.jsx)(et.ZL,{children:(0,r.jsxs)(et.UC,{className:ec().popover,sideOffset:8,align:"end",side:"top",children:[t.length>=3&&(0,r.jsxs)("div",{className:ec().popoverHeader,children:[(0,r.jsx)("button",{className:ec().titleButton,disabled:i.length>=4,onClick:u,children:(0,r.jsx)(k.FormattedMessage,{id:"excw.graphs.contracts-picker.selectTopX",values:{numContracts:Math.min(t.length,4)}})}),(0,r.jsx)("button",{className:ec().clearButton,disabled:!i.length,onClick:c,children:(0,r.jsx)(k.FormattedMessage,{id:"ui.clear"})})]}),(0,r.jsx)("div",{className:ec().contractList,children:t.map(e=>{let t=n[e];if(!t)return null;let l=!f.has(t.id)&&i.length>=4,c=null==s?void 0:s[t.id];return(0,r.jsxs)("button",{className:ec().contractItem,disabled:l,onClick:()=>{o(t.id)},"aria-label":"Select contract ".concat(t.name),children:[(0,r.jsxs)("div",{className:ec().contractInfo,children:[(0,r.jsx)("span",{className:ec().contractColorDot,style:{background:(0,F.Qt)(a[t.id])}}),(0,r.jsx)(eu,{name:t.name,contractId:t.id,marketId:t.market_id,latestPrice:c,oddsFormat:m})]}),(0,r.jsx)("input",{type:"checkbox",className:ec().checkbox,checked:f.has(t.id),disabled:l,readOnly:!0,"aria-label":"Toggle selection for ".concat(t.name)})]},t.id)})})]})})]})});var eh=n(4534),em=n.n(eh);let ef=l.memo(function(e){let{intervals:t,eventType:n,selectedInterval:l,onIntervalChange:a}=e;return(0,r.jsx)("div",{className:em().intervalList,children:t.map(e=>(0,r.jsx)("button",{className:i()(em().intervalItem,l===e&&em().active),onClick:()=>{a(e)},children:(0,r.jsx)(k.FormattedMessage,{id:function(e,t){let{domain:n,scope:r}=t;if(r===M.jP.SINGLE_EVENT){if("PRE_MATCH"===e){if(O.has(n))return"excw.graphs.interval.PRE_GAME";if(D.has(n))return"excw.graphs.interval.PRE_MATCH";if(R.has(n))return"excw.graphs.interval.PRE_RACE";if(P.has(n))return"excw.graphs.interval.PRE_FIGHT"}if("IN_PLAY"===e){if(O.has(n))return"excw.graphs.interval.IN_GAME";if(D.has(n))return"excw.graphs.interval.IN_MATCH";if(R.has(n))return"excw.graphs.interval.IN_RACE";if(P.has(n))return"excw.graphs.interval.IN_FIGHT"}}return"PRE_MATCH"===e?"excw.graphs.interval.PRE_START":"IN_PLAY"===e?"excw.graphs.interval.IN_PLAY":T[e]}(e,n),defaultMessage:e})},e))})}),eg=function(e){let[t,n]=(0,l.useState)(!1);return(0,l.useEffect)(()=>
1{(null==e?void 0:e.current)&&(e.current.onpointerenter=()=>{n(!0)},e.current.onpointerleave=()=>{n(!1)})},[e]),t};var ep=n(91696),ev=n.n(ep);function ex(e){let{item:t,isHighlighted:n,hasHighlightedItem:a,onHighlightItem:s,setHoveredContract:o}=e,c=(0,l.useRef)(null),u=eg(c);(0,l.useEffect)(()=>{o&&o(u?t.id:null)},[u,o,t.id]);let d=n||u;return(0,r.jsxs)("button",{ref:c,className:i()(ev().legendItem,a&&!d&&ev().dimmed,d&&ev().highlighted),disabled:!s,onClick:()=>{null==s||s(t)},children:[(0,r.jsx)("div",{className:ev().legendSymbol,style:{backgroundColor:t.color}}),(0,r.jsx)("div",{className:ev().legendItemText,children:t.name})]})}let e_=l.memo(function(e){let{items:t,highlightedItem:n,onHighlightItem:l,setHoveredContract:a}=e;return t.length?(0,r.jsx)("div",{className:ev().legend,children:t.map(e=>(0,r.jsx)(ex,{item:e,isHighlighted:n===e.id,hasHighlightedItem:!!n,onHighlightItem:l,setHoveredContract:a},e.id))}):null});var eM=n(15804),eb=n(63983);function ek(e,t){let n=null!=e,r=null!=t;return n!==r?n?-1:1:n&&r?e-t:0}function eI(e){return[...e].sort((e,t)=>ek(e.display_order,t.display_order)||ek((0,C.cn)(e),(0,C.cn)(t))||(e.name||"").localeCompare(t.name||"",void 0,{numeric:!0})||String(e.id).localeCompare(String(t.id),void 0,{numeric:!0}))}function ey(e,t){let n=new Set(e.map(e=>{let{id:t}=e;return t})),r=new Map(e.map(e=>[e.id,e]));return t.flatMap(e=>{var t;return n.has(e.id)?[null!=(t=r.get(e.id))?t:e]:[]})}function ew(e){var t;let n=null!=(t=null==e?void 0:e.buckets)?t:[];return{bucketCount:n.length,totalNumTrades:n.reduce((e,t)=>{var n;return e+Number(null!=(n=t.num_trades)?n:0)},0),totalVolumeBks:n.reduce((e,t)=>{var n;return e+Number(null!=(n=t.volume_bks)?n:0)},0),hasBefore:!!(null==e?void 0:e.before),hasAfter:!!(null==e?void 0:e.after)}}function eC(e){let t=ew(e);return t.bucketCount>0||t.hasBefore||t.hasAfter}function eL(e,t){var n,r,l,a;return(null==(r=t[e.id])||null==(n=r.op)?void 0:n[0])||(null==(a=t[e.id])||null==(l=a.bp)?void 0:l[0])||0}function eS(e,t){let n=new Map(e.map((e,t)=>[e.id,t]));return[...e].sort((e,r)=>{var l,a;return eL(r,t)-eL(e,t)||(null!=(l=n.get(e.id))?l:0)-(null!=(a=n.get(r.id))?a:0)})}var eE=n(35473);let ej=new Map,eN=new Map;function eA(e,t){(0,eE.S)()||eN.set(e,t)}async function eT(e){let{eventId:t,marketId:n,contractIds:r,params:l}=e,a=await Promise.all((function(e,t){let n=[];for(let t=0;t<e.length;t+=20)n.push(e.slice(t,t+20));return n})(r,20).map(e=>(0,f.Al)(t,n,e,l))),i=a[0];return(0,d.e)(i),{...i,contracts:a.flatMap(e=>e.contracts)}}let eP=function(e){let t=t=>{let n=(0,l.useRef)(null),[a,i]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{i(null!==e.offsetParent)};t(),"ResizeObserver"in window&&new ResizeObserver(()=>{t()}).observe(e)},[]),(0,r.jsx)("div",{className:t.containerClassName,ref:n,children:a?(0,r.jsx)(e,{...t}):null})};return t.displayName="withNonHiddenParent(".concat(e.displayName||e.name||"Component",")"),t}(function(e){let{eventId:t,eventCreatedDatetime:n,eventStartDatetime:a,eventState:s,eventType:c,marketId:m,contracts:f,height:g=F.Fn,className:M}=e,b=(0,h.jE)(),I=(0,l.useMemo)(()=>u()(f,"id"),[f]),y=function(e){if(!(0,eE.S)())return eN.get(e)}(m),[C,E]=(0,l.useState)(()=>null!=y?y:[]),j=(0,l.useMemo)(()=>(function(e,t){if(!(null==t?void 0:t.length))return eI(e);let n=new Map(t.map((e,t)=>[e,t])),r=[],l=[];for(let t of e)(n.has(t.id)?r:l).push(t);return r.sort((e,t)=>{var r,l;return(null!=(r=n.get(e.id))?r:0)-(null!=(l=n.get(t.id))?l:0)}),[...r,...eI(l)]})(f,C),[f,C]),A=(0,l.useMemo)(()=>j.map(e=>{let{id:t}=e;return t}),[j]),T=(0,l.useMemo)(()=>{let e={};return j.forEach((t,n)=>{e[t.id]=n}),e},[j]),P=function(e){if(!(0,eE.S)())return ej.get(e)}(m),O=!!(null==P?void 0:P.some(e=>!!I[e])),[D,R]=(0,l.useState)(()=>O&&null!=P?P:[]),B=(0,l.useMemo)(()=>D.filter(e=>!!I[e]),[D,I]),G=(0,l.useRef)(O),[z,W]=(0,l.useState)(m);z!==m&&(W(m),G.current=O,R(O&&null!=P?P:[]),E(null!=y?y:[])),(0,l.useEffect)(()=>{G.current&&((0,eE.S)()||ej.set(m,D))},[m,D]);let X=(0,l.useMemo)(()=>[m],[m]),Y=(0,el.ux)(),V=(0,l.useCallback)(e=>{R(t=>{let n=t.filter(e=>!!I[e]).length;return t.includes(e)?t.filter(t=>t!==e):n<4?[...t,e]:t})},[I]),Q=(0,l.useCallback)(()=>{R([])},[]),q=(0,l.useCallback)(()=>{Y(X,A).then(e=>{R((function(e){let{chartOrderedContracts:t,prices:n,limit:r}=e;return ey(eS(t,n).slice(0,r),t)})({chartOrderedContracts:j,prices:e,limit:4}).map(e=>{let{id:t}=e;return t}))})},[Y,X,A,j]),{chartInterval:U,setChartInterval:Z,availableIntervals:J,contractEndDatetime:et}=H({contracts:f,eventType:c,eventState:s,eventCreatedDatetime:n,eventStartDatetime:a}),{timestampMin:en,timestampMax:er}=(0,l.useMemo)(()=>{let{startDate:e,endDate:t}=function(e,t){var n;let{eventCreatedDatetime:r,eventStartDatetime:l,contractEndDatetime:a}=t,i=w.c9.fromISO(r),s=a?w.c9.fromISO(a):(n=w.c9.local(),w.c9.fromMillis(S(n.toMillis()),{zone:n.zone}));switch(e){case"ALL":break;case"PRE_MATCH":s=w.c9.fromISO(l);break;case"IN_PLAY":i=w.c9.fromISO(l);break;case"M12":i=s.minus({months:12});break;case"M6":i=s.minus({months:6});break;case"M1":i=s.minus({months:1});break;case"d7":i=s.minus({days:7});break;case"h24":i=s.minus({hours:24});break;case"h6":i=s.minus({hours:6});break;case"h4":i=s.minus({hours:4});break;case"h1":i=s.minus({hours:1});break;case"m150":i=s.minus({minutes:150});break;case"m10":i=s.minus({minutes:10})}return{startDate:i.toJSDate(),endDate:s.toJSDate()}}(U,{eventCreatedDatetime:n,eventStartDatetime:a,contractEndDatetime:et});return{timestampMin:e.toISOString(),timestampMax:t.toISOString()}},[U,n,a,et]),ea=(0,l.useMemo)(()=>[new Date(en).getTime(),new Date(er).getTime()],[en,er]),ei=(0,l.useMemo)(()=>({data_points:150,timestamp_min:en,timestamp_max:er}),[en,er]),{data:es,isLoading:eo}=v({eventId:t,marketId:m,contractIds:B,params:ei},B.length>0);(0,l.useEffect)(()=>
1{if(G.current||!A.length)return;let e=!1;return Promise.all([Y(X,A),eT({eventId:t,marketId:m,contractIds:A,params:ei})]).then(n=>{let[r,l]=n;if(e)return;let a=u()(l.contracts,"contract_id"),i=eS(j,r),s=i.map(e=>{let{id:t}=e;return t}),o=ey(function(e){let{contracts:t,prices:n,executionContractsById:r}=e,l=eS(t,n),a=l.slice(0,3).filter(e=>eC(r[e.id])),i=new Set(a.map(e=>{let{id:t}=e;return t})),s=3-a.length;if(s>0){let e=(function(e,t){let n=new Map(e.map((e,t)=>[e.id,t]));return[...e].sort((e,r)=>{var l,a;let i=ew(t[e.id]),s=ew(t[r.id]);return s.totalVolumeBks-i.totalVolumeBks||s.totalNumTrades-i.totalNumTrades||s.bucketCount-i.bucketCount||(null!=(l=n.get(e.id))?l:0)-(null!=(a=n.get(r.id))?a:0)})})(t,r).filter(e=>!i.has(e.id)&&eC(r[e.id])).slice(0,s);a.push(...e),e.forEach(e=>i.add(e.id))}return a.length<3&&a.push(...l.filter(e=>!i.has(e.id)).slice(0,3-a.length)),a}({contracts:j,prices:r,executionContractsById:a}),i).map(e=>{let{id:t}=e;return t});b.setQueryData(p({eventId:t,marketId:m,contractIds:o,params:ei}),function(e,t){let n=new Set(t);return{...e,contracts:e.contracts.filter(e=>n.has(e.contract_id))}}(l,o)),G.current=!0,E(s),eA(m,s),R(o)}).catch(()=>{if(e)return;let t=j.slice(0,3);G.current=!0,E(A),eA(m,A),R(t.map(e=>{let{id:t}=e;return t}))}),()=>{e=!0}},[t,m,A,ei,j,Y,X,b]);let ec=(0,x.A)(es),eu=eo&&ec?ec:es,eh=(0,l.useMemo)(()=>{var e;return(null==eu||null==(e=eu.contracts)?void 0:e.length)?function(e,t){let{contracts:n,bucket_size_ms:r,interval_start:l,interval_end:a}=e,i=N(l);i.setMilliseconds(i.getMilliseconds()+r);let s=N(a),o=s>new Date?new Date(+function(e,t,n){let r=+t,l=Math.floor((e-r)/n);return l?new Date(r+l*n):t}(Date.now(),i,r)+r):s,c=0,h=100,m=u()(t,"id"),f={},g={startDate:i,endDate:o,timeInterval:r};for(let e of n){let t=m[e.contract_id],n={buckets:e.buckets.slice(),low:null,high:null};e.before&&n.buckets.unshift(e.before),e.after&&n.buckets.push(e.after),function(e,t,n){let{timeInterval:r,endDate:l}=n,a=null==t?void 0:t.outcome_timestamp,i=a?new Date(a).getTime():1/0,s=e[e.length-1];if(!s)return;(0,d.e)(s.timestamp),(0,d.e)(s.ohlc);let o=N(s.timestamp),c=+o+r;if(c<+l&&c<i){let t=+o;for(;t+r<+l&&t<i;)t+=r;let n=s.ohlc[3];e.push({ohlc:[n,n,n,n],num_trades:0,volume_bks:0,volume_qty:0,timestamp:new Date(t).toISOString()})}for(let t=0;t<e.length;t++){var u;let n=e[t];(0,d.e)(n.timestamp),(null==(u=n.timestamp)?void 0:u.endsWith("Z"))||(n.timestamp+="Z");let l=new Date(n.timestamp);if(l.setMilliseconds(l.getMilliseconds()+r),t>0){let n=l-r,a=e[t-1];if((0,d.e)(a.timestamp),(0,d.e)(a.ohlc),n-new Date(a.timestamp).getTime()>=r){let l=a.ohlc[3],i={timestamp:new Date(n-r).toISOString(),num_trades:0,volume_qty:0,volume_bks:0,ohlc:[l,l,l,l]};e.splice(t,0,i),t++}}}}(n.buckets,t,g);let r=Math.min(...n.buckets.map(e=>e.ohlc[2]||e.ohlc[3])),l=Math.max(...n.buckets.map(e=>e.ohlc[1]||e.ohlc[3]));n.low=isFinite(r)?r:null,n.high=isFinite(l)?l:null,r<h&&(h=r),l>c&&(c=l),f[e.contract_id]=n}return{data:f,minPrice:h,maxPrice:c}}(eu,f):null},[eu,f]),em=(0,l.useMemo)(()=>{if(null==eh)return null;let e=function(e){let t={},n=-1/0;for(let r of(0,_.H)(e.data)){let l=e.data[r].buckets;if(!l.length)continue;let a=l.map(e=>{(0,d.e)(e.timestamp),(0,d.e)(e.ohlc);let t=new Date(e.timestamp).getTime();return t>n&&(n=t),{x:t,y:(0,L.n)(e.ohlc[3])}});t[r]=a}for(let e of(0,_.H)(t)){let r=t[e];if(r.length&&r[r.length-1].x<n){let e=r[r.length-1].y;r.push({x:n,y:e})}}return t}(eh);
1return o()(e)?null:e},[eh]),eg=(0,l.useMemo)(()=>(null==eu?void 0:eu.bucket_size_ms)||5*eb.iW,[eu]),{executions:ep,clearExecutions:ev}=function(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],{subscribe:r,unsubscribe:a}=(0,eM.L3)(),i=(0,eM.vS)(),[s,o]=(0,l.useState)([]),c=(0,l.useRef)(new Set);(0,l.useEffect)(()=>{c.current=new Set(t)},[t]),(0,l.useEffect)(()=>{if(n&&e){let t={"markets/execution":[e]};return r(t),()=>{a(t)}}},[r,a,e,n]);let u=(0,l.useCallback)(e=>{let t=String(e.contract);c.current.has(t)&&o(t=>[...t,e])},[]);return(0,l.useEffect)(()=>{if(n){let e=i(e=>{"channel"in e&&"markets/execution"===e.channel&&u(e)});return()=>{e()}}},[n,u,i]),{executions:s,clearExecutions:(0,l.useCallback)(()=>{o([])},[])}}(m,B,!eo),[ex,ek]=(0,l.useState)(null),eL=(0,l.useRef)(0);(0,l.useEffect)(()=>{ek(em),eL.current=0,ev()},[em,ev]),(0,l.useEffect)(()=>{let e=(null!=ep?ep:[]).slice(eL.current);0!==e.length&&(ek(t=>{let n=null!=t?t:{};for(let t of e)n=function(e,t,n,r,l){let a={...e},i=a[t];if(!(null==i?void 0:i.length))return a[t]=[{x:n,y:(0,L.n)(r)}],a;let s=i[i.length-1];Math.floor(n/l)*l==Math.floor(s.x/l)*l?a[t]=[...i.slice(0,-1),{x:s.x,y:(0,L.n)(r)}]:a[t]=[...i,{x:n,y:(0,L.n)(r)}];let o=Math.max(...Object.values(a).map(e=>{var t;return(null==(t=e[e.length-1])?void 0:t.x)||0}));for(let e of(0,_.H)(a)){if(e===t)continue;let n=a[e];n.length&&n[n.length-1].x<o&&(a[e]=[...n,{x:o,y:n[n.length-1].y}])}return a}(n,String(t.contract),t.timestamp,t.value[0],eg);return n}),eL.current=ep.length)},[ep,eg]);let eP=!!ex,eO=(0,l.useRef)(null),eD=(0,l.useRef)(null),[eR,eF]=(0,l.useState)();(0,l.useEffect)(()=>{eO.current&&(eD.current&&eD.current.disconnect(),eD.current=new window.ResizeObserver(e=>{let t=e[0];(null==t?void 0:t.contentRect)&&eF(t.contentRect.width)}),eD.current.observe(eO.current),eF(eO.current.offsetWidth))},[eO]),(0,l.useEffect)(()=>()=>{eD.current&&eD.current.disconnect()},[]);let[eH,eB]=(0,l.useState)(null),[eG,ez]=(0,l.useState)(null),eW=(0,l.useMemo)(()=>{if(!ex)return null;let e={};for(let n of(0,_.H)(ex)){var t;let r=ex[n],l=null==(t=r[r.length-1])?void 0:t.y;e[n]=l}return e},[ex]),eX=(0,l.useMemo)(()=>B.flatMap(e=>{let t=I[e];return t?[{id:e,name:t.name,color:(0,F.Qt)(T[e])}]:[]}),[B,T,I]),eY=(0,l.useCallback)(e=>{eB(t=>t===e.id?null:e.id)},[eB]),eV=(0,l.useCallback)(e=>{J.includes(e)?Z(e):console.warn("Interval ".concat(e," is not available for the current event bounds."))},[J,Z]),eQ=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ef,{intervals:J,eventType:c,selectedInterval:U,onIntervalChange:eV}),(0,r.jsxs)("div",{className:K().legendContainer,children:[(0,r.jsx)(e_,{items:eX,highlightedItem:eH,onHighlightItem:eY,setHoveredContract:ez}),(0,r.jsx)(ed,{contractIds:A,contractsById:I,contractsIndexMap:T,selectedContractIds:B,latestPriceByContractId:eW,onSelect:V,onClear:Q,onSelectTopContracts:q})]})]});return G.current&&!B.length?(0,r.jsxs)("div",{className:i()(K().container,M),children:[(0,r.jsx)("div",{className:K().emptyChart,style:{height:F.Fn},children:(0,r.jsx)(k.FormattedMessage,{id:"excw.graphs.no-contracts-selected"})}),(0,r.jsx)("div",{className:K().chartInfo,children:eQ})]}):G.current&&(eP||!eo)?eP?((0,d.e)(eh),(0,r.jsxs)("div",{className:i()(K().container,M),children:[(0,r.jsx)("div",{className:K().chart,ref:eO,children:(0,r.jsx)(ee,{width:eR,domainXInMs:ea,preprocessedData:eh,chartData:ex,eventId:t,selectedContractIds:B,contractsById:I,contractsIndexMap:T,latestPriceByContractId:eW,highlightedContract:eH,hoveredContract:eG,disableCursor:eo,height:g,interval:U})}),(0,r.jsxs)("div",{className:K().chartInfo,children:[eQ," "]})]})):(0,r.jsxs)("div",{className:i()(K().container,M),children:[(0,r.jsx)("div",{className:K().emptyChart,style:{height:F.Fn},children:(0,r.jsx)(k.FormattedMessage,{id:"excw.graphs.data-unavailable"})}),(0,r.jsx)("div",{className:K().chartInfo,children:eQ})]}):(0,r.jsxs)("div",{className:i()(K().container,M),children:[(0,r.jsx)("div",{className:K().emptyChart,ref:eO,children:(0,r.jsx)($,{height:g,width:eR})}),(0,r.jsx)("div",{className:K().chartInfo,style:{pointerEvents:"none"},children:eQ})]})})},42462:e=>{e.exports={trigger:"ContractsPicker_trigger__ahZ4X",sliderIcon:"ContractsPicker_sliderIcon__cGpLo",popover:"ContractsPicker_popover__hcX3h",popoverHeader:"ContractsPicker_popoverHeader__YzxW8",titleButton:"ContractsPicker_titleButton__H6J13",clearButton:"ContractsPicker_clearButton__0IH6q",contractList:"ContractsPicker_contractList__o0zIb",contractItem:"ContractsPicker_contractItem__6pzMv",contractInfo:"ContractsPicker_contractInfo__Vnrjl",contractColorDot:"ContractsPicker_contractColorDot__ongsO",contractName:"ContractsPicker_contractName__bBwAF",checkbox:"ContractsPicker_checkbox__1MG5b"}}
1,76923:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r,l=n(1521);function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}let i=function(e){return l.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),r||(r=l.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8h12m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0m-6 8h12M9 16a3 3 0 1 1-6 0 3 3 0 0 1 6 0"})))}},80011:(e,t,n)=>{"use strict";function r(e){return e/100}n.d(t,{n:()=>r})},91696:e=>{e.exports={legend:"Legend_legend__J821f",legendItem:"Legend_legendItem__lVu4l",highlighted:"Legend_highlighted__LNjSK",dimmed:"Legend_dimmed__P_9CQ",legendSymbol:"Legend_legendSymbol__Ui5t_",legendItemText:"Legend_legendItemText__M7TTO"}}}]);

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.