1!function(){try{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]="39c9b166-10c9-42cd-98a2-564c6a380bb1",e._sentryDebugIdIdentifier="sentry-dbid-39c9b166-10c9-42cd-98a2-564c6a380bb1")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2429],{2429:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>th,useTournamentsTableProps:()=>en});var i=n(23798),s=n(21462),r=n(8759),a=n(65360),l=n(45137),o=n(46001),d=n.n(o),c=n(1840),u=n(71328);let p=e=>(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,i.jsx)("path",{d:"M7.98269 11.3311C7.6138 10.9503 7.00604 10.9406 6.62522 11.3095C6.24439 11.6784 6.23471 12.2862 6.6036 12.667L9.50971 15.6671C9.6878 15.851 9.93194 15.9561 10.1879 15.9592C10.4438 15.9622 10.6904 15.8629 10.8728 15.6833L16.9667 9.68314C17.3445 9.31115 17.3492 8.70333 16.9772 8.32553C16.6052 7.94774 15.9974 7.94302 15.6196 8.31501L10.2154 13.6361L7.98269 11.3311Z",fill:"#3DCA85"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.7992 11.9992C22.7992 17.9639 17.9639 22.7992 11.9992 22.7992C6.03454 22.7992 1.19922 17.9639 1.19922 11.9992C1.19922 6.03454 6.03454 1.19922 11.9992 1.19922C17.9639 1.19922 22.7992 6.03454 22.7992 11.9992ZM20.9992 11.9992C20.9992 16.9698 16.9698 20.9992 11.9992 20.9992C7.02866 20.9992 2.99922 16.9698 2.99922 11.9992C2.99922 7.02866 7.02866 2.99922 11.9992 2.99922C16.9698 2.99922 20.9992 7.02866 20.9992 11.9992Z",fill:"#3DCA85"})]});var h=n(67150),m=n(18294),x=n(91656),g=n(14156),f=n(86946),y=n(87673),b=n(1091),j=n(57581),C=n(27946),v=n(72735);let w=e=>{let{description:t=""}=e,n=(0,c.o)("TournamentRanking"),s=(0,b.t)();return(0,i.jsxs)("div",{className:n(),children:[(0,i.jsx)("div",{className:n("titleContainer"),children:(0,i.jsx)("h3",{className:d()(n("title"),"bodyBold1"),children:s.formatMessage({id:"roc-front.front.tournaments.tournament_description.title",defaultMessage:"Description"})})}),(0,i.jsx)("div",{className:d()(n("description"),"body3"),children:t})]})};var N=n(39788),P=n(91383),k=n(30207),S=n(90763);let T=e=>{let{freeSpinsCount:t}=e,n=(0,c.o)("TournamentPrizePool"),s=(0,b.t)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:n("amount"),children:` + ${t}`}),(0,i.jsx)("span",{className:n("currency"),children:s.formatMessage({id:"roc-front.front.tournament.bonus.fs",defaultMessage:"FS"})})]})},B=e=>{let{tournament:t}=e,n=(0,c.o)("TournamentPrizePool"),s=(0,b.t)(),{rounding:r,roundingWithInsertion:a}=(0,P.W)(),{prizeFundSum:l,extraPrizeFundSum:o,bonusPrizeFundSum:u,isProgressiveFund:p,prizes:h}=(0,k.MN)(t),m={1:(0,i.jsx)(f.I,{name:"gold_prize",className:n("prize")}),2:(0,i.jsx)(f.I,{name:"silver_prize",className:n("prize")}),3:(0,i.jsx)(f.I,{name:"bronze_prize",className:n("prize")}),4:(0,i.jsx)(f.I,{name:"rest_prize",className:n("prize")})};return h.length?(0,i.jsxs)("div",{className:n(),children:[(0,i.jsx)("div",{className:n("titleContainer"),children:(0,i.jsxs)("div",{className:n("title-with-tooltip"),children:[(0,i.jsx)("h3",{className:d()(n("title"),"bodyBold1"),children:s.formatMessage({id:"roc-front.front.tournaments.tournament_prize_pool.title",defaultMessage:"Prize Pool"})}),(0,i.jsx)(N.m,{content:o?s.formatMessage({id:"roc-front.front.tournament.tournament_extra_prize_pool.tooltip",defaultMessage:"Guaranteed prize fund + Extra prize fund"}):s.formatMessage({id:"roc-front.front.tournament.tournament_prize_pool.tooltip",defaultMessage:"Guaranteed prize fund"}),children:(0,i.jsx)(f.I,{name:"info",className:n("info")})})]})}),l&&(0,i.jsx)(i.Fragment,{children:o?(0,i.jsxs)("div",{className:n("extra-prize-container"),children:[(0,i.jsx)(f.I,{name:"reward",className:n("reward")}),(0,i.jsxs)("div",{className:d()(n("extra-prize-amounts"),"bodyBold2"),children:[(0,i.jsx)("span",{className:n("amount"),children:(0,S.ej)(r(l.amount,l.currencyCode))}),(0,i.jsx)("span",{className:n("currency"),children:l.currencyCode}),(0,i.jsx)("br",{}),(0,i.jsxs)("span",{className:n("amount"),children:[a(" +",o.amount,o.currencyCode)," "]}),(0,i.jsx)("span",{className:n("currency"),children:o.currencyCode}),!!(null==u?void 0:u.freeSpinsCount)&&(0,i.jsx)(T,{freeSpinsCount:u.freeSpinsCount})]})]}):(0,i.jsxs)("div",{className:n("extra-prize-container"),children:[(0,i.jsx)(f.I,{name:"reward",className:n("reward")}),(0,i.jsxs)("div",{className:d()(n("extra-prize-amounts"),"bodyBold2"),children:[p?(0,i.jsx)("span",{children:s.formatMessage({id:"roc-front.front.tournaments.tournament_prize_pool.min.title",defaultMessage:"min. {amount}"},{amount:(0,S.ej)(r(l.amount,l.currencyCode))})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:d()(n("amount"),"bodyBold2"),children:`${(0,S.ej)(r(l.amount,l.currencyCode))} `}),(0,i.jsx)("span",{className:n("currency"),children:l.currencyCode})]}),!!(null==u?void 0:u.freeSpinsCount)&&(0,i.jsx)(T,{freeSpinsCount:u.freeSpinsCount})]})]})}),(0,i.jsx)("div",{children:h.slice(0,4).map(e=>{var t,l;let o=m[e.place];
1return p?(0,i.jsxs)("div",{className:d()(n("place"),"radiusCard"),children:[(0,i.jsxs)("div",{className:n("placeNumber-wrap"),children:[o,(0,i.jsx)("p",{className:d()(n("placeNumber"),"body4"),children:e.place})]}),(0,i.jsxs)("div",{className:n("wrapper"),children:[(0,i.jsxs)("div",{className:n("perWrapper"),children:[(0,i.jsxs)("p",{className:n("percent"),children:[e.percent,"% "]}),(0,i.jsx)("p",{className:n("text"),children:s.formatMessage({id:"roc-front.front.tournaments.tournament_prize_pool.percent",defaultMessage:"of prize fund*"})})]}),(0,i.jsxs)("div",{className:d()(n("perWrapper",{extra:!!(e.extraPrize||e.bonusPrize)}),"bodyBold4"),children:[e.extraPrize&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:d()(n("amount")),children:a(" +",e.extraPrize.amount,e.extraPrize.currencyCode)}),(0,i.jsx)("span",{className:d()(n("currency")),children:e.extraPrize.currencyCode})]}),!!(null==(t=e.bonusPrize)?void 0:t.freeSpinsCount)&&(0,i.jsx)(T,{freeSpinsCount:e.bonusPrize.freeSpinsCount})]}),(0,i.jsx)("p",{className:n("minText"),children:s.formatMessage({id:"roc-front.front.tournaments.tournament_prize_pool.min",defaultMessage:"*MIN. {amount} {currencyCode}"},{amount:r(e.amount,e.currencyCode),currencyCode:e.currencyCode})})]})]},e.place):(0,i.jsxs)("div",{className:d()(n("place"),"radiusCard"),children:[(0,i.jsxs)("div",{className:n("placeNumber-wrap"),children:[o,(0,i.jsx)("p",{className:d()(n("placeNumber")),children:e.place})]}),(0,i.jsxs)("div",{className:n("amount-wrap"),children:[(0,i.jsx)("div",{className:n("place-row"),children:(0,i.jsxs)("p",{className:d()(n("amount"),"bodyBold4"),children:[(0,S.ej)(r(e.amount,e.currencyCode)),(0,i.jsx)("span",{className:d()(n("currency")),children:e.currencyCode})]})}),(0,i.jsxs)("div",{className:n("place-row",{extra:!!(e.extraPrize||e.bonusPrize)}),children:[e.extraPrize&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:d()(n("amount")),children:a(" +",e.extraPrize.amount,e.extraPrize.currencyCode)}),(0,i.jsx)("span",{className:d()(n("currency")),children:e.extraPrize.currencyCode})]}),!!(null==(l=e.bonusPrize)?void 0:l.freeSpinsCount)&&(0,i.jsx)(T,{freeSpinsCount:e.bonusPrize.freeSpinsCount})]})]})]},e.place)})})]}):null};var M=n(7702),I=n(70101),O=function(e){return e.Info="info",e.PrizePool="prizePool",e.Ranking="ranking",e}({});let G=e=>{let{onSubscribe:t,onUnsubscribe:n,isSubscribed:r,tournament:a,title:l="",description:o="",maskNickNames:u=!1}=e,p=(0,c.o)("TournamentsDetails"),h=(0,b.t)(),{isSmallDesktop:N}=(0,j.G)("max-width",-1),{switcherButtons:P,showRanking:k,isTournamentDescription:S,subscribeHandler:T,activeTab:G}=((e,t,n)=>{let[i,r]=(0,s.useState)("info"),a=(0,M.a)(),l=(0,I.r)(),o=(0,s.useCallback)(()=>{if(a)return void n(e.id);l.push("/user/login")},[e,a,n,l]),d=!!t,c=![x.me.Published,x.me.Cancelled].includes(e.status),u=(0,s.useMemo)(()=>!c&&d?"description":c?"leaderboard":"",[d,c]);return{switcherButtons:[{icon:"info",onClick:()=>r("info"),isActive:"info"===i},{icon:"prizepool",onClick:()=>r("prizePool"),isActive:"prizePool"===i},{icon:u,onClick:()=>r("ranking"),isActive:"ranking"===i}],correctIcon:u,showRanking:c,isTournamentDescription:d,subscribeHandler:o,activeTab:i}})(a,o,t),{data:R}=(0,C.H)(),{globalSystemSettings:Y}=R,{tournaments:W}=Y,{hideSubscribeCancelButton:z=!1}=W,_=!(z&&a.subscriptionType===x.tp.AUTO);return(0,i.jsxs)("div",{className:p("",{hideDescription:!S&&!k}),children:[(0,i.jsxs)("div",{className:p("tournament"),children:[a.icon&&(0,i.jsx)("img",{className:p("tournamentImage"),src:a.icon,alt:""}),(0,i.jsx)("h3",{className:d()(p("title"),"title6"),children:l}),(0,i.jsxs)("div",{className:p("buttons"),children:[r&&a.status!==x.me.Cancelled&&a.status!==x.me.Finished&&a.status!==x.me.Hide&&_&&(0,i.jsx)(g.$,{className:p("button"),onClick:()=>n(a.id),type:"secondary",title:h.formatMessage({id:"roc-front.front.tournament.button.cancel",defaultMessage:"Cancel"})}),(0,i.jsx)(y.z,{type:r?"primary":"secondary",title:h.formatMessage({id:"roc-front.front.tournament.button.more",defaultMessage:"Learn more"}),href:`/tournaments/${a.id}`,wrapperClassName:p("button")}),!r&&_&&a.status!==x.me.Cancelled&&a.status!==x.me.Finished&&(0,i.jsx)(g.$,{className:p("button"),onClick:T,type:"primary",rightIconName:"arrow-long-right",title:h.formatMessage({id:"roc-front.front.tournament.button.join_now",defaultMessage:"Join now"})})]}
1),N&&(0,i.jsx)("div",{className:d()(p("switcher"),"radiusCard"),children:P.map(e=>{let{icon:t,onClick:n,isActive:s}=e;return(0,i.jsx)("div",{className:d()(p("switcherButton",{active:s}),"radiusCard"),onClick:n,children:(0,i.jsx)(f.I,{className:p("switcherIcon",{active:s}),name:t})},t)})})]}),(0,i.jsxs)("div",{className:p("data"),children:[(!N||N&&G===O.Info)&&(0,i.jsx)(v.i,{showTitle:!0,tournament:a}),(!N||N&&G===O.PrizePool)&&(0,i.jsx)(B,{tournament:a}),(!N||N&&G===O.Ranking)&&(0,i.jsx)(i.Fragment,{children:k?(0,i.jsx)(m.W,{showTitle:!0,maskNickNames:u,tournament:a}):(0,i.jsx)(i.Fragment,{children:S&&(0,i.jsx)(w,{description:o})})})]})]})};var R=n(72712),Y=n(33489),W=n(67486);let z=()=>{let e=(0,r.wA)(),{isAuth:t}=(0,r.d4)(R.y.auth.selector.state),{isFetching:n,isFetched:i,data:a,error:l}=(0,r.d4)(Y.N.getPlayerGroups.selector.state),{isFetching:o,isFetched:d,data:c,error:p}=(0,r.d4)(Y.N.getGuestGroups.selector.state),h=(0,u.bU)(),m=t?i:d,x=t?n:o,g=null==a?void 0:a.list,f=null==c?void 0:c.list,y=(0,s.useMemo)(()=>h||!t?f||[]:g||[],[f,t,h,g]),{activeAccountCode:b}=(0,W.L)(),j=(0,s.useCallback)(()=>{if((h||!t)&&!o&&!p)return void e(Y.N.getGuestGroups.thunk.request({}));t&&!n&&b&&!l&&e(Y.N.getPlayerGroups.thunk.request({filter:{currencyCode:b,onlySubscribed:0}}))},[b,e,p,l,o,t,h,n]);return(0,s.useEffect)(()=>l?void console.error(l):p?void console.error(p):void(!y.length&&!x&&!m&&j()),[y.length,j,x,m,l,p]),{fetchGroups:j,groupsById:(0,s.useMemo)(()=>y?y.reduce((e,t)=>(e[t.id]=t,e),{}):{},[y]),groupsList:y,isFetched:m,isFetching:x}},_=e=>{let t=(0,r.d4)(Y.N.getPlayerTournaments.selector.getStateByKey(e)),{isFetched:n,isFetching:i,data:a}=t;return{data:a,isFetched:n,isFetching:i,playerTournamentsById:(0,s.useMemo)(()=>{var e;return((null==t||null==(e=t.data)?void 0:e.list)||[]).reduce((e,t)=>(e[t.id]=t,e),{})},[t])}};var U=n(90844),L=n.n(U);let A=e=>({tableHeaders:{briefAboutTournamentIconAlt:e.formatMessage({id:"roc-front.widgets.tournaments_table.headers.brief_tournament_icon_alt",defaultMessage:"Tournament Icon"}),briefAboutTournamentTitle:e.formatMessage({id:"roc-front.widgets.tournaments_table.headers.brief_tournament_title",defaultMessage:"Tournament"}),detailsTitle:e.formatMessage({id:"roc-front.widgets.tournaments_table.headers.details_title",defaultMessage:"Details"}),groupTitle:e.formatMessage({id:"roc-front.widgets.tournaments_table.headers.group_title",defaultMessage:"Group"}),groupIconAlt:e.formatMessage({id:"roc-front.widgets.tournaments_table.headers.group_icon_alt",defaultMessage:"Group Icon"}),prizePool:e.formatMessage({id:"roc-front.widgets.tournaments_table.headers.prize_pool_title",defaultMessage:"Prize Pool"}),date:e.formatMessage({id:"roc-front.widgets.tournaments_table.headers.time_title",defaultMessage:"Time"})},emptyStub:{title:e.formatMessage({id:"roc-front.widgets.tournaments_table.empty_block.title",defaultMessage:"Oh, we have no tournaments"}),description:e.formatMessage({id:"roc-front.widgets.tournaments_table.empty_block.description",defaultMessage:"It seems that we haven't added anything. Please check this page a bit later."})}}),D=L()(()=>n.e(55437).then(n.bind(n,55437)),{loadableGenerated:{webpack:()=>[55437]}}),F=e=>{let{title:t,tournamentIcon:n,className:r=""}=e,a=(0,c.o)("TournamentsTable"),l=(0,b.t)(),{tableHeaders:o}=(0,s.useMemo)(()=>A(l),[l]);return(0,i.jsxs)("div",{className:r,children:[(0,i.jsx)("div",{className:d()(a("listBriefTitle",{withTitle:!!t}),"bodyBold2"),children:t||o.briefAboutTournamentTitle}),(0,i.jsx)("div",{className:a("listBriefImg"),children:n?(0,i.jsx)("img",{src:n,alt:o.briefAboutTournamentIconAlt}):(0,i.jsx)(D,{})})]})},E=e=>{let{flipped:t}=e;return(0,i.jsx)("svg",{style:{transform:t?"rotate(180deg)":"",transition:"0.5s all"},width:"12",height:"6",viewBox:"0 0 12 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.176368 0.162613C0.412571 -0.0532467 0.796737 -0.0543406 1.03443 0.16017L6.03392 4.67215L10.9656 0.221394C11.2033 0.00688343 11.5874 0.00797682 11.8236 0.223838C12.0598 0.439698 12.0586 0.788582 11.8209 1.00309L6.4616 5.83983C6.22497 6.05339 5.84287 6.05339 5.60624 5.83983L0.179058 0.94187C-0.0586314 0.727359 -0.0598357 0.378474 0.176368 0.162613Z"})})},H=e=>{let{expanded:t=!1,className:n}=e,r=(0,b.t)(),{tableHeaders:a}=(0,s.useMemo)(()=>A(r),[r]);return(0,i.jsxs)("button",{className:n,children:[(0,i.jsx)("div",{children:a.detailsTitle}),(0,i.jsx)("div",{children:(0,i.jsx)(E,{flipped:t})})]})},K=e=>{let{className:t}=e;return(0,i.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",xmlns:"http://www.w3.org/2000/svg",fill:"var(--primary-solid)",className:t,children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.788 17.777C34.3355 20.2508 34.3355 24.2616 31.788 26.7355C29.2404 29.2093 25.11 29.2093 22.5624 26.7355L21.8385 26.0325L24.8976 33.1705C25.0107 33.4344 24.8171 33.728 24.5299 33.728H15.469C15.1818 33.728 14.9882 33.4344 15.1013 33.1705L18.16 26.0334L17.4371 26.7355C14.8895 29.2093 10.759 29.2093 8.21147 26.7355C5.66389 24.2617 5.66388 20.2508 8.21147 17.777L19.5817 6.73596C19.8145 6.50989 20.1849 6.50989 20.4177 6.73596L31.788 17.777Z"})})},q=e=>{let{groupImage:t,className:n="",title:r}=e,a=(0,b.t)(),l=(0,c.o)("TournamentsTable"),{tableHeaders:o}=(0,s.useMemo)(()=>A(a),[a]);return(0,i.jsxs)("div",{className:n,children:[(0,i.jsx)("div",{className:d()(l("listLabel",["groupLabel"]),"body2"),children:o.groupTitle}),r&&(0,i.jsx)("div",{className:d()(l("groupName"),"body2"),children:r}),(0,i.jsx)("div",{className:l("groupIcon"),children:t?(0,i.jsx)("img",{src:t,alt:o.groupIconAlt}):(0,i.jsx)(K,{})})]})},$=e=>{let{tournament:t}=e,n=(0,c.o)("TournamentsTable"),{rounding:r}=(0,P.W)(),a=(0,b.t)(),{tableHeaders:l}=(0,s.useMemo)(()=>
1A(a),[a]),{prizeFundSum:o,exchangedPrizeFundSum:u,extraPrizeFundSum:p,exchangedExtraPrizeFundSum:h}=(0,k.MN)(t);return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:d()(n("listLabel"),"body2"),children:l.prizePool}),(0,i.jsxs)("div",{className:n("prizePoolWrapper"),children:[o&&u&&(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:n("amount"),children:r(u.amount_to,u.currency_to)}),(0,i.jsx)("span",{className:n("currency"),children:u.currency_to})]}),(0,i.jsxs)("div",{className:n("cryptoWrapper"),children:[(0,i.jsx)("span",{className:n("cryptoAmount"),children:r(o.amount,o.currencyCode)}),(0,i.jsx)("span",{className:n("cryptoCurrency"),children:o.currencyCode})]})]}),p&&h&&(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:n("amount"),children:`+ ${r(h.amount_to,h.currency_to)}`}),(0,i.jsx)("span",{className:n("currency"),children:h.currency_to})]}),(0,i.jsxs)("div",{className:n("cryptoWrapper"),children:[(0,i.jsx)("span",{className:n("cryptoAmount"),children:r(p.amount,p.currencyCode)}),(0,i.jsx)("span",{className:n("cryptoCurrency"),children:p.currencyCode})]})]}),!u&&(0,i.jsxs)(i.Fragment,{children:[o&&(0,i.jsxs)("div",{className:d()(n("prizePool"),"body2"),children:[(0,i.jsx)("span",{className:n("amount"),children:r(o.amount,o.currencyCode)}),(0,i.jsx)("span",{className:n("currencySymbol"),children:o.currencyCode})]}),p&&(0,i.jsxs)("div",{className:d()(n("prizePool"),"body2"),children:[(0,i.jsxs)("span",{className:n("amount"),children:[" + ",r(p.amount,p.currencyCode)]}),(0,i.jsx)("span",{className:n("currencySymbol"),children:p.currencyCode})]})]})]})]})};var Z=n(68415),V=n(23149);let X=e=>{let{className:t="",endDate:n,startDate:r,status:a}=e,l=(0,c.o)("TournamentsTable"),o=[x.me.Finished,x.me.Cancelled].includes(a),u=(0,b.t)(),{tableHeaders:p}=(0,s.useMemo)(()=>A(u),[u]);return(0,i.jsxs)("div",{className:d()("body2",t),children:[a===x.me.Finished&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:l("listLabel"),children:p.date}),(0,i.jsx)("div",{className:l("listLabel"),children:(0,Z.GP)(new Date(n),"dd.MM.yy | HH:mm")})]}),!o&&(0,i.jsx)(V.X,{startDate:r,endDate:n,status:a,labelClassName:d()(l("listLabel"),"body2")})]})},J=e=>{let{tournament:t,onSubscriptionHandler:n,onUnsubscriptionHandler:r,widgetId:a,setExpanded:l,expanded:o}=e,{id:u,status:m,startDate:x,endDate:g}=t,f=(0,c.o)("TournamentsTable"),y=(0,s.useMemo)(()=>o===u,[o,u]),{groupsById:b}=z(),j=b[t.groupId[0]],C=(0,s.useCallback)(()=>{null==n||n(t)},[n,t]),v=(0,s.useCallback)(()=>{null==r||r(t)},[r,t]),{playerTournamentsById:w}=_(a),N=(0,s.useMemo)(()=>!!w[u],[w,u]),{tournamentTranslation:P}=(0,k.Vr)(null==t?void 0:t.tournamentTranslates);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("li",{onClick:()=>l(y?null:u),"data-testid":"listItem",className:f("listItemVisibleInfo",{selected:y}),children:[N&&(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"body2",children:(0,i.jsx)(h.s,{id:"roc-front.front.tournaments.tournament_participation",defaultMessage:"Participation"})}),(0,i.jsx)("div",{children:(0,i.jsx)(p,{})})]}),(0,i.jsx)(F,{title:null==P?void 0:P.title,className:f("briefAboutImg"),tournamentIcon:t.icon}),(0,i.jsx)($,{tournament:t}),(0,i.jsx)(X,{endDate:g,startDate:x,status:m}),(0,i.jsx)(q,{className:f("groupImg"),title:null==j?void 0:j.translatedTitle,groupImage:null==j?void 0:j.translatedImage}),(0,i.jsx)(H,{className:d()(f("listItemExpandButton"),"buttonTypo","radiusCard"),expanded:y})]}),(0,i.jsx)("li",{className:f("listItemExpandableInfo"),children:(0,i.jsx)("div",{"data-testid":"tournamentDetails",className:f("expandableContent",{expanded:y}),children:(0,i.jsx)(G,{tournament:t,isSubscribed:N,onSubscribe:C,onUnsubscribe:v,title:null==P?void 0:P.title,description:null==P?void 0:P.description})})})]})},Q=e=>{let{tournaments:t,onSubscriptionHandler:n,onUnsubscriptionHandler:r,widgetId:a}
1=e,l=(0,c.o)("TournamentsTable"),o=(0,u.bU)(),[p,h]=(0,s.useState)(()=>o?1:null);return(0,i.jsx)("ul",{className:d()(l("list"),"radiusCard"),children:t.map(e=>(0,i.jsx)(J,{expanded:p,setExpanded:h,widgetId:a,tournament:e,onSubscriptionHandler:n,onUnsubscriptionHandler:r},e.id))})},ee=s.createContext({tournamentsStatuses:[],defaultTab:"",showTournamentGroups:!1,defaultStatusId:"",showNickNames:!0}),et=e=>{let{children:t,...n}=e;return(0,i.jsx)(ee.Provider,{value:{...n},children:t})},en=()=>s.useContext(ee);var ei=n(72499),es=n(46296),er=n(20176),ea=n(83509),el=n(92399),eo=n(73364),ed=n(87787),ec=n(38130),eu=n(64835),ep=n(59674),eh=n(40305),em=n(83213),ex=n(82799),eg=n(19670),ef=n(9586);let ey={type:ef.Y.BLOCK,width:"190px",height:"52px"},eb={type:ef.Y.BLOCK,width:"240px",height:"40px"},ej={type:ef.Y.BLOCK,width:"80px",height:"40px"},eC={type:ef.Y.GROUP,height:"40px",direction:"row",gap:"16px",justifyContent:"flex-end",children:[eb,ej]},ev={type:ef.Y.GROUP,padding:"12px",inverseBg:!0,justifyContent:"center",gap:"12px",direction:"column",children:[{type:ef.Y.BLOCK,width:"40px",height:"40px",alignment:"center"},{type:ef.Y.BLOCK,width:"114px",height:"24px"}]},ew={type:ef.Y.GROUP,justifyContent:"space-between",gap:"16px",children:[ey,eC]},eN={type:ef.Y.GROUP,justifyContent:"space-between",gap:"16px",children:[{...ey,height:"48px"},eC]},eP={type:ef.Y.GROUP,justifyContent:"space-between",children:[{type:ef.Y.BLOCK,width:"184px",height:"40px"},{type:ef.Y.BLOCK,width:"80px",height:"40px"}]},ek={type:ef.Y.GROUP,direction:"column",gap:"40px",children:[ew]},eS={...ek,gap:"24px",children:[eN,{type:ef.Y.BLOCK,height:"40px"}]},eT={...ek,gap:"24px",children:[eP,{type:ef.Y.BLOCK,height:"40px"},{type:ef.Y.BLOCK,height:"40px"}]},eB={type:ef.Y.GROUP,direction:"row",gap:"12px",width:"138px",height:"108px",groupWithBg:!0,children:[ev]},eM={type:ef.Y.GROUP,direction:"row",gap:"16px",children:[...Array(10).fill(eB)]},eI={...eM,gap:"20px",children:[...Array(8).fill(eB)]},eO={...eM,gap:"16px",children:[...Array(6).fill(eB)]},eG={...eM,gap:"16px",children:[...[,,,].fill(eB)]},eR={type:ef.Y.GROUP,direction:"column",gap:"24px",children:[ek,eM]},eY={...eR,children:[ek,eI]},eW={...eR,children:[eS,eO]},ez={...eR,gap:"12px",children:[eT,eG]},e_={blocks:[{type:ef.Y.GROUP,children:{largeDesktop:[eR],desktop:[eY],tablet:[eW],mobile:[ez]}}]},eU={pagination:!1,autoplay:!1,slidesPerView:"auto",spaceBetween:8,scrollbar:!0,mousewheel:{forceToAxis:!0},breakpoints:{1440:{spaceBetween:12}}};var eL=n(76705),eA=n(78746);let eD=e=>{let{onStatusChange:t,statuses:n,selectedStatus:r}
1=e,a=(0,c.o)("TournamentsGroup"),[l,o]=(0,s.useState)(!1),u=(0,s.useRef)(null),p=(0,s.useCallback)(()=>o(e=>!e),[]);(0,eL.A)(u,()=>o(!1));let{translateText:h}=(0,eA.v)(),m=(0,b.t)(),x=(0,s.useCallback)(e=>{o(!1),null==t||t(e)},[t]);return(0,i.jsxs)("div",{ref:u,className:a("filterByStatus"),children:[(0,i.jsxs)("div",{className:d()(a("filterByStatusDropdown",{active:l}),"radiusCard"),onClick:p,children:[(0,i.jsx)("p",{className:d()(a("selectedFilter"),"body3"),children:r?h(r.title):m.formatMessage({id:"roc-front.front.tournaments.tournament_status.all",defaultMessage:"All statuses"})}),(0,i.jsx)("div",{className:a("arrowIcon"),children:(0,i.jsx)(f.I,{name:"arrow-down"})})]}),l&&(0,i.jsx)("div",{className:d()(a("filterByStatusDropdownBody"),"radiusCard"),children:n.filter(e=>!!h(e.title)&&e.isVisible).map(e=>(0,i.jsx)("p",{className:d()(a("filterByStatusDropdownItem",{active:r===e}),"body3"),onClick:()=>x(e),children:h(e.title)},e.id))})]})};var eF=n(14951);let eE=e=>{let{activeTab:t,onTabChange:n}=e,r=(0,c.o)("TournamentsGroup"),a=(0,b.t)(),[l,o]=(0,s.use
1State)(t||eF.O.All),u=(0,s.useCallback)(()=>{let e=l===eF.O.All?eF.O.Subscribed:eF.O.All;o(e),null==n||n(e)},[l,n]);return(0,i.jsxs)("div",{"data-testid":"TournamentGroupTabs",className:d()(r("tabs"),"radiusCard"),children:[(0,i.jsx)("p",{className:d()(r("tab",{active:l===eF.O.All}),"subtitle3","radiusCard"),onClick:u,children:a.formatMessage({id:"roc-front.front.tournament_group.tabs.all",defaultMessage:"All tournaments"})}),(0,i.jsx)("p",{className:d()(r("tab",{active:l===eF.O.Subscribed}),"subtitle3","radiusCard"),onClick:u,children:a.formatMessage({id:"roc-front.front.tournament_group.tabs.my_tournaments",defaultMessage:"My tournaments"})})]})},eH=e=>{let{onGroupSelect:t,groups:n,activeGroupId:s,activeTab:r,onTabChange:a,onStatusChange:l,hideSlider:o,statuses:u,selectedStatus:p}=e,h=(0,c.o)("TournamentsGroup"),m=(0,M.a)();return(0,i.jsx)("div",{className:h(),"data-testid":"TournamentsGroup",children:(0,i.jsx)(es.E,{isLoading:!1,blocks:e_.blocks,children:(0,i.jsx)(ex.A,{type:eg.I.TOURNAMENT,ignoreBaseTitleClassName:!0,titleClassName:d()(h("title"),"title2"),intlTitle:(0,eh.zR)({id:"roc-front.front.tournament_group.title",defaultMessage:"Tournaments"}),showTitle:!0,showScroll:!0,classNames:{slider:h("swiperWrapperSlider",{hideSlider:o}),topSection:h("swiperWrapperTopSection"),wrapper:h("swiperWrapper"),topSectionHalf:h("swiperTopSectionHalf")},swiperNavigationClassNames:{wrapper:h("swiperNavigationWrapper",{hideSlider:o})},showButton:!1,customControls:(0,i.jsxs)("div",{className:h("controls"),children:[m&&(0,i.jsx)(eE,{activeTab:r,onTabChange:a}),(0,i.jsx)(eD,{selectedStatus:p,onStatusChange:l,statuses:u})]}),settings:eU,children:!o&&n.map(e=>{let{id:n,translatedImage:r,translatedTitle:a}=e;return(0,i.jsx)(em.qr,{"data-testid":"GroupSlide",children:(0,i.jsxs)("div",{className:d()(h("slide",{active:null==s?void 0:s.includes(n)}),"radiusCard"),onClick:()=>null==t?void 0:t(n),children:[(0,i.jsx)("div",{className:h("slideImage"),children:r?(0,i.jsx)("img",{src:r,alt:""}):(0,i.jsx)(K,{})}),(0,i.jsx)("p",{className:d()(h("slideTitle"),"body3"),children:a})]})},n)})})})})},eK=()=>{let e=(0,c.o)("TournamentsTable"),{emptyStub:{title:t,description:n}}=A((0,b.t)());return(0,i.jsxs)("div",{className:d()(e("emptyContainer"),"radiusCard"),children:[(0,i.jsx)("div",{className:e("emptyIcon"),children:(0,i.jsx)(f.I,{name:"empty"})}),(0,i.jsxs)("div",{className:e("emptyTextContainer"),children:[(0,i.jsx)("h3",{className:d()(e("emptyTitle"),"title2"),children:t}),(0,i.jsx)("p",{className:d()(e("emptyDescription"),"body2"),children:n})]})]})},eq=e=>{let{className:t=""}=e,n=(0,c.o)("TournamentsTable"),r=(0,b.t)(),{tableHeaders:a}=(0,s.useMemo)(()=>A(r),[r]);return(0,i.jsx)("thead",{className:t,children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{className:d()(n("tableHeaderGroupCell"),"bodyBold3"),children:a.groupTitle}),(0,i.jsx)("td",{className:d()(n("tableHeaderTournamentCell"),"bodyBold3"),children:a.briefAboutTournamentTitle}),(0,i.jsx)("td",{className:d()(n("tableHeaderPrizePoolCell"),"bodyBold3"),children:a.prizePool}),(0,i.jsx)("td",{className:d()(n("tableHeaderTimeCell"),"bodyBold3"),children:a.date}),(0,i.jsx)("td",{className:d()(n("tableHeaderActionCell"),"bodyBold3"),children:"\xa0"})]})})},e$=e=>(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.4356 7.93363C11.3784 7.32277 10.2217 7.16147 9.27499 7.70872C8.32863 8.25577 7.89038 9.3385 7.89038 10.5596V13.9196C7.89038 15.1407 8.32863 16.2235 9.27499 16.7705C10.2217 17.3178 11.3792 17.156 12.4365 16.5451L15.3361 14.8653C16.3933 14.2543 17.1104 13.3327 17.1104 12.2396C17.1104 11.1465 16.3928 10.2246 15.3356 9.61363L12.4356 7.93363ZM9.59038 10.5596C9.59038 9.70072 9.88713 9.31845 10.1258 9.18051C10.364 9.04278 10.8426 8.97669 11.5851 9.4056L14.4851 11.0856C15.2277 11.5146 15.4104 11.9629 15.4104 12.2396C15.4104 12.5163 15.2268 12.9651 14.4843 13.3941L11.5847 15.0739C10.8422 15.5027 10.364 15.4364 10.1258 15.2987C9.88713 15.1608 9.59038 14.7785 9.59038 13.9196V10.5596Z",fill:"#4870FF"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9703 1.09961C5.95041 1.09961 1.07031 5.9797 1.07031 11.9996C1.07031 18.0195 5.95041 22.8996 11.9703 22.8996C17.9902 22.8996 22.8703 18.0195 22.8703 11.9996C22.8703 5.9797 17.9902 1.09961 11.9703 1.09961ZM2.87031 11.9996C2.87031 6.97382 6.94452 2.89961 11.9703 2.89961C16.9961 2.89961 21.0703 6.97382 21.0703 11.9996C21.0703 17.0254 16.9961 21.0996 11.9703 21.0996C6.94452 21.0996 2.87031 17.0254 2.87031 11.9996Z",fill:"#4870FF"})]}),eZ=e=>{let{id:t,expanded:n,subscribed:s,done:r,className:a=""}=e,l=(0,I.r)(),o=(0,c.o)("TournamentsTable");return(0,i.jsxs)("td",{className:a,children:[s&&(0,i.jsx)(p,{}),!s&&!r&&(0,i.jsx)("div",{className:o("playIcon"),onClick:e=>{e.stopPropagation(),l.push(`/tournaments/${t}`)},children:(0,i.jsx)(e$,{})}),(0,i.jsx)("button",{children:(0,i.jsx)(E,{flipped:n})})]})},eV=L()(()=>n.e(55437).then(n.bind(n,55437)),{loadableGenerated:{webpack:()=>[55437]}}),eX=e=>{let{className:t,image:n}=e,r=(0,b.t)(),{tableHeaders:a}=(0,s.useMemo)(()=>A(r),[r]);return n?(0,i.jsx)("img",{src:n,alt:a.briefAboutTournamentIconAlt,className:t}):(0,i.jsx)(eV,{className:t})},eJ=e=>{let{className:t="",icon:n="",title:s=""}=e,r=(0,c.o)("TournamentsTable");return(0,i.jsx)("td",{className:t,children:(0,i.jsxs)("div",{className:r("exp
1andableContentTournamentInfo"),children:[(0,i.jsx)("div",{className:r("expandableContentTournamentIcon"),children:(0,i.jsx)(eX,{image:n})}),(0,i.jsx)("div",{className:d()(r("expandableContentTournamentTitle"),"bodyBold3"),children:s})]})})},eQ=e=>{let{image:t="",className:n=""}=e,r=(0,b.t)(),{tableHeaders:a}=(0,s.useMemo)(()=>A(r),[r]);return(0,i.jsx)("td",{className:n,children:t?(0,i.jsx)("img",{src:t,alt:a.groupIconAlt}):(0,i.jsx)(K,{})})},e0=e=>{let{prizeFundSum:t,extraPrizeFundSum:n,bonusPrizeFundSum:s,className:r=""}=e,a=(0,c.o)("TournamentsTable"),{rounding:l}=(0,P.W)(),o=(0,b.t)();return(0,i.jsx)("td",{className:r,children:!!(null==t?void 0:t.amount)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:d()(a("prizePool"),"bodyBold3"),children:[(0,i.jsx)("span",{children:(+l(t.amount,t.currencyCode)).toLocaleString("fr-FR")}),(0,i.jsx)("span",{className:d()(a("currencySymbol"),"bodyBold3"),children:t.currencyCode})]}),n&&(0,i.jsxs)("div",{className:d()(a("prizePool"),"bodyBold3"),children:[(0,i.jsxs)("span",{children:[" + ",(+l(n.amount,n.currencyCode)).toLocaleString("fr-FR")]}),(0,i.jsx)("span",{className:d()(a("currencySymbol"),"bodyBold3"),children:n.currencyCode}),!!(null==s?void 0:s.freeSpinsCount)&&(0,i.jsxs)("div",{className:d()(a("fs"),"bodyBold3"),children:[(0,i.jsxs)("span",{children:[" + ",s.freeSpinsCount]})," ",(0,i.jsx)("span",{className:a("currency"),children:o.formatMessage({id:"roc-front.front.tournament.bonus.fs",defaultMessage:"FS"})})]})]})]})})};var e1=n(90136),e2=n(59677),e9=n.n(e2);let e4=e=>{let{done:t,endDate:n,startDate:s,status:r,className:a=""}=e,l=(0,e1.C)(e9()),o=(0,Z.GP)(new Date(n),"dd.MM.yy | HH:mm");return(0,i.jsx)("td",{className:a,children:(0,i.jsxs)("span",{children:[t&&(0,i.jsx)("span",{className:"bodyBold3",children:o}),!t&&(0,i.jsx)(V.X,{startDate:s,endDate:n,status:r,labelClassName:"bodyBold4",valueClassName:"bodyBold4",classNames:{wrapper:l("tournamentTimer"),bodyClassName:"bodyBold4",bodyBoldClassName:"bodyBold4"}})]})})},e3=e=>{let{onSubscriptionHandler:t,onUnsubscriptionHandler:n,tournament:r,widgetId:a,setExpanded:l,expanded:o}=e,d=(0,c.o)("TournamentsTable"),{showNickNames:u}=en(),{tournamentTranslation:p,prizeFundSum:h,extraPrizeFundSum:m,bonusPrizeFundSum:g}=(0,k.MN)(r),{groupsById:f}=z(),{playerTournamentsById:y}=_(a),b=(0,s.useMemo)(()=>o===r.id,[o,r]),j=(0,s.useMemo)(()=>!!y[r.id],[y,r]),C=(0,s.useMemo)(()=>[x.me.Finished,x.me.Cancelled].includes(r.status),[r]),v=(0,s.useMemo)(()=>f[r.groupId[0]],[f,r]),w=(0,s.useCallback)(()=>l(b?null:r.id),[l,b,r]),N=(0,s.useCallback)(()=>{t(r)},[t,r]),P=(0,s.useCallback)(()=>{n(r)},[n,r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("tbody",{"data-testid":"tournamentTableRow",onClick:w,className:d("tableVisibleBody",{selected:b}),children:(0,i.jsxs)("tr",{children:[(0,i.jsx)(eQ,{className:d("groupCellImage"),image:null==v?void 0:v.translatedImage}),(0,i.jsx)(eJ,{className:d("expandableContentTournament"),icon:r.icon,title:null==p?void 0:p.title}),(0,i.jsx)(e0,{prizeFundSum:h,extraPrizeFundSum:m,bonusPrizeFundSum:g}),(0,i.jsx)(e4,{done:C,status:r.status,startDate:r.startDate,endDate:r.endDate}),(0,i.jsx)(eZ,{id:r.id,expanded:b,subscribed:j,done:C,className:d("tableActionsCell",{expanded:b})})]})}),(0,i.jsx)("tbody",{className:d("tableExpandableBody"),children:(0,i.jsx)("tr",{children:(0,i.jsx)("td",{colSpan:5,children:(0,i.jsx)("div",{"data-testid":"tournamentDetails",className:d("expandableContent",{expanded:b}),children:(0,i.jsx)(G,{tournament:r,isSubscribed:j,onSubscribe:N,onUnsubscribe:P,maskNickNames:!u,title:null==p?void 0:p.title,description:null==p?void 0:p.description})})})})})]})},e8=e=>{let{tournaments:t,onSubscriptionHandler:n,onUnsubscriptionHandler:r,widgetId:a}
1=e,l=(0,c.o)("TournamentsTable"),o=(0,u.bU)(),[p,h]=(0,s.useState)(()=>o?1:null);return(0,i.jsxs)("table",{className:d()(l("table"),"radiusCard"),children:[(0,i.jsx)(eq,{className:l("tableHeader")}),t.map(e=>(0,i.jsx)(e3,{expanded:p,setExpanded:h,widgetId:a,tournament:e,onSubscriptionHandler:n,onUnsubscriptionHandler:r},e.id))]})},e7={height:"40px",width:"40px"},e6={height:"24px",width:"114px",flexShrink:1};var e5=n(58822),te=n.n(e5),tt=n(77039),tn=n.n(tt),ti=n(74678),ts=n(97202),tr=n(97453),ta=n(56609),tl=n(24498),to=n(33304),td=n(79102),tc=n(27503);let tu={pageNumber:0,pageSize:10,total:0,pageCount:0},tp=eF.O.All;n(18015);let th=e=>{var t,n;let{paginationType:o=a.Os.Standard,widgetId:d,props:u}=e,{showTournamentGroups:p,tournamentsStatuses:h,defaultTab:m,defaultStatusId:g,showNickNames:f}=u,y=(0,c.o)("TournamentsTable"),v=(0,b.t)(),w=(0,s.useRef)(null),{isAuth:N}=(0,r.d4)(R.y.auth.selector.state),{initialDatePickerValues:P,onChangePagination:k,loadMore:S,data:T,isFetching:B,isFetched:M,onSubscriptionHandler:O,onUnsubscriptionHandler:G,subscriptionTournament:_,onCloseSubscriptionModalHandler:U,isSubscriptionModalOpen:L,isUnsubscriptionModalOpen:A,setUnsubscriptionModalOpen:D,isSubscriptionSuccessModalOpen:F,setSubscriptionSuccessModalOpen:E,isNotEnoughMoneyModalOpen:H,onCloseNotEnoughMoneyHandler:K,onNotEnoughMoneyHandler:q,onSubscribedHandler:$,onUnsubscribedHandler:Z,switchFilterStatuses:V,onApplyDatePicker:X,setGroupsFilter:J,activeTab:ee,setActiveTab:en,activeStatus:eh,groupsFilter:em,isGamesTournamentModalOpen:ex,tournamentCurrency:eg}=(e=>{var t;let{widgetId:n,isAccumulated:i,getSubscribed:a,myTournamentsTabActiveByDefault:l,tournamentsStatuses:o,defaultStatusId:d}=e,c=(0,r.wA)(),u=(0,I.r)(),p=(0,b.t)(),[h,m]=(0,s.useState)([]),[g,f]=(0,s.useState)(""),[y,j]=(0,s.useState)(""),[v]=(0,ts.K)(),w=(0,s.useMemo)(()=>null==o?void 0:o.find(e=>e.id===d),[d,o]),[N,P]=(0,s.useState)(),k=u.query.isGameActiveStatus,S=u.query.id,T=(0,s.useMemo)(()=>({showPeriodFilter:!0,listOfStatuses:[x.me.Active,x.me.Published],id:"",isVisible:!0,title:{en:p.formatMessage({id:"roc-front.front.tournaments.options.in_progress_upcoming",defaultMessage:"In progress & upcoming"})}}),[p]);(0,s.useEffect)(()=>{P(w)},[w]),(0,s.useEffect)(()=>{k&&P(T)},[T,k,u.query.status]);let B=(0,s.useMemo)(()=>g&&y?{values:[te()(g),te()(y)],formatString:[te()().format(g),te()().format(y)]}:void 0,[g,y]),{activeAccountCode:M}=(0,W.L)(),{gameFiatCurrencyCode:O}=(0,td.b)(),G=(0,r.d4)(Y.N.getGuestTournaments.selector.getStateByKey(n)),z=(0,r.d4)(Y.N.getAllPlayerTournaments.selector.getStateByKey(n)),_=(0,r.d4)(Y.N.getPlayerTournaments.selector.getStateByKey(n)),U=(0,s.useMemo)(()=>G.error||z.error||_.error,[z.error,G.error,_.error]),{isFetching:L,isFetched:A}=(0,s.useMemo)(()=>[G,z,_].reduce((e,t)=>{let{isFetching:n,isFetched:i}=t;return{isFetching:e.isFetching||n,isFetched:e.isFetched||i}},{isFetching:!1,isFetched:!1}
1),[z,G,_]),[D,F]=(0,s.useState)(tu),{isAuth:E}=(0,r.d4)(R.y.auth.selector.state),H=(0,s.useMemo)(()=>{if(E){var e;return l?eF.O.Subscribed:(null==(e=u.query)?void 0:e.tab)?u.query.tab:eF.O.All}return null},[E,l,u.query.tab]),[K,q]=(0,s.useState)(H);(0,s.useEffect)(()=>{q(H)},[H,E]);let $=(0,s.useCallback)(()=>{F(tu)},[]),Z=(0,s.useCallback)(()=>{c(Y.N.getAllPlayerTournaments.action.reset({widgetId:n})),c(Y.N.getPlayerTournaments.action.reset({widgetId:n})),c(Y.N.getGuestTournaments.action.reset({widgetId:n}))},[n,c]),V=(0,s.useCallback)(e=>{P(e),$()},[$]),X=(0,s.useCallback)(()=>{if(U)return void console.error("An error occurred while fetching tournaments",U);if(!M&&E)return;let e=K!==tp;e&&(tp=K);let t=e?{...tu}:D,s={pageSize:t.pageSize,pageNumber:t.pageNumber,filter:{statuses:null==N?void 0:N.listOfStatuses}};if(S&&k&&(s.filter.ids=S,s.filter.statuses=[x.me.Published,x.me.Active]),M&&!S&&(s.filter.currencyCode=M),h.length?s.filter.groupId=h:delete s.filter.groupId,g&&(s.filter.activeFrom=g),y&&(s.filter.activeTo=y),g&&y&&(s.filter.activeFrom=g,s.filter.activeTo=y),E)switch(K){case eF.O.All:a&&c((0,ta.I)(s,n,i)),c((0,tl.J)(s,n,i));break;case eF.O.Subscribed:c((0,ta.I)(s,n,i))}else c((0,to.R)(s,n,i))},[U,M,E,K,D,S,k,h,g,y,a,c,n,i,N]),J=(0,s.useCallback)(e=>{let{values:t}=e,[n,i]=null!=t?t:[];f((null==n?void 0:n.toISOString())||""),j((null==i?void 0:i.toISOString())||"")},[]),Q=(0,s.useMemo)(()=>{switch(K){case eF.O.All:return z;case eF.O.Subscribed:return _;default:return G}},[K,z,_,G]),ee=Q.data,et=null==ee?void 0:ee.list,en=Q.error;(0,s.useEffect)(()=>{X()},[c,X]);let ei=(0,s.useMemo)(()=>et?Object.values(null==et?void 0:et.reduce((e,t)=>{let{tournamentCurrencies:n}=t;return n.forEach(t=>e[t]=t),e},{})):[],[et]),[es,er]=(0,s.useState)(et),ea=(0,r.d4)(Y.N.tournamentsCurrencyModal.selector.isOpen);(0,s.useEffect)(()=>{if(!(E&&k)||!(et instanceof Array))return er(et);let e=null==et?void 0:et.filter(e=>{let{tournamentCurrencies:t}=e;return t.includes(M)});er(e),(null==e?void 0:e.length)||!A||c(Y.N.tournamentsCurrencyModal.action.open())},[M,c,et,A,E,k]);let el=(0,s.useCallback)(()=>{F({...D,pageNumber:D.pageNumber+1})},[D]),{data:{globalSystemSettings:eo}}=(0,C.H)(),[ed,{currentData:ec}]=(0,tr.n)(),[eu,{currentData:ep}]=(0,tr.cu)(),eh=(0,s.useCallback)(()=>{if(ee){let e=ee.list.filter(e=>![x.me.Published,x.me.Cancelled].includes(e.status)).map(e=>e.id),{tournaments:t}=eo,{showPrizePlacesOnly:n,showOnlyActiveParticipants:i}=t||{},s=E?ep:ec,r={tournamentIds:e.filter(e=>!(null==s?void 0:s[e])),count:4,onlyWithPrizes:!!n,onlyWithPoints:!!i};E&&r.tournamentIds.length&&eu(r,!0),!E&&r.tournamentIds.length&&ed(r,!0)}},[ec,ep,ee,ed,eu,eo,E]);(0,s.useEffect)(()=>{eh()},[ee,c,eh]);let em=(0,s.useCallback)(async()=>{if(ee){let e=ee.list.reduce((e,t)=>([t.eventRestrictions.providerIds,t.eventRestrictions.gameGroupIds,t.eventRestrictions.gameIds,t.eventPermissions.providerIds,t.eventPermissions.gameGroupIds,t.eventPermissions.gameIds].some(e=>e.length)&&e.push(t.id),e),[]);if(e.length>0){let t={operatingSystem:[tc.Ro],device:[tc.j7],currencyCode:O,tournamentLegacyIds:e};await v({...t,type:ti.zY.Included}),await v({...t,type:ti.zY.Excluded})}}},[O,v,ee]);(0,s.useEffect)(()=>{m(e=>e.length?[]:e)},[K]),(0,s.useEffect)(()=>{Z()},[K,c,Z]),(0,s.useEffect)(()=>{em()},[em]);let[ex,eg]=(0,s.useState)(null),[ef,ey]=(0,s.useState)(!1),[eb,ej]=(0,s.useState)(!1),[eC,ev]=(0,s.useState)(!1),[ew,eN]=(0,s.useState)(!1),eP=(0,s.useCallback)(e=>{eg(e),ey(!0)},[]),ek=(0,s.useCallback)(e=>{eg(e),ej(!0)},[]),eS=(0,s.useCallback)(()=>{eg(null),ey(!1)},[]),eT=(0,s.useCallback)(()=>{ey(!1),eN(!0)},[]),eB=(0,s.useCallback)(()=>{eN(!1),eg(null)},[]),eM=(0,s.useCallback)(()=>{ey(!1),ev(!0),eg(null),Z(),X()},[X,Z]),eI=(0,s.useCallback)(()=>{ej(!1),eg(null),Z(),X()},[X,Z]);return{initialDatePickerValues:B,onChangePagination:(e,t)=>{F({...D,pageSize:t,pageNumber:e-1})},loadMore:el,data:{list:es,pagination:null!=(t=null==ee?void 0:ee.pagination)?t:D},error:en,isFetching:L,isFetched:A,onSubscriptionHandler:eP,onUnsubscriptionHandler:ek,subscriptionTournament:ex,onCloseSubscriptionModalHandler:eS,isSubscriptionModalOpen:ef,isUnsubscriptionModalOpen:eb,setUnsubscriptionModalOpen:ej,isSubscriptionSuccessModalOpen:eC,setSubscriptionSuccessModalOpen:ev,isNotEnoughMoneyModalOpen:ew,onCloseNotEnoughMoneyHandler:eB,onNotEnoughMoneyHandler:eT,onSubscribedHandler:eM,onUnsubscribedHandler:eI,switchFilterStatuses:V,onApplyDatePicker:J,setGroupsFilter:e=>{tn()(e.sort(),h.sort())?(Z(),m([])):(i&&Z(),F(tu),m(e))},activeTab:K,setActiveTab:q,activeStatus:N,groupsFilter:h,isGamesTournamentModalOpen:ea,tournamentCurrency:ei}})({widgetId:d,isAccumulated:o===a.Os.LoadMore,getSubscribed:N,myTournamentsTabActiveByDefault:"My tournaments"===m,tournamentsStatuses:h,defaultStatusId:g}),{isTablet:ey}=(0,j.G)("max-width",-1),{groupsList:eb}=z(),ej=M&&!(null==T||null==(t=T.list)?void 0:t.length),eC=M&&!!(null==T||null==(n=T.list)?void 0:n.length),{tournamentId:ev}=(0,l.Y)();return ev?(0,i.jsx)(ei.R,{}):(0,i.jsx)(et,{...u,children:(0,i.jsx)("div",{ref:w,className:y(),children:(0,i.jsxs)(es.E,{isLoading:!T||B,blocks:(e=>({blocks:[{type:ef.Y.GROUP,display:"flex",direction:"column",gap:"32px",children:{largeDesktop:[{t
1ype:ef.Y.GROUP,display:"flex",width:"100%",justifyContent:"space-between",children:[{height:"52px",width:"300px"},{height:"40px",width:"330px"}]},{type:ef.Y.GROUP,display:"grid",gap:"22px",gridTemplateColumns:"repeat(10, minmax(auto, 100%))",width:"100%",children:Array(e).fill({type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,height:"108px",direction:"column",alignItems:"center",justifyContent:"space-around",children:[e7,e6]})},{type:ef.Y.GROUP,display:"flex",direction:"column",width:"100%",children:Array(e).fill({type:ef.Y.GROUP,width:"100%",height:"72px",padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid var(--base-divider)",children:[{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"84px",flexShrink:0,children:[{height:"40px",width:"40px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"138px",flexShrink:0,children:[{height:"24px",width:"90px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"flex-start",fixedWidth:!0,width:"100%",flexGrow:1,children:[{height:"24px",width:"180px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"flex-start",flexShrink:0,fixedWidth:!0,width:"228px",flexGrow:1,children:[{height:"24px",width:"180px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"72px",flexShrink:0,children:[{height:"24px",width:"24px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"72px",flexShrink:0,children:[{height:"24px",width:"24px"}]}]})}],middleDesktop:[{type:ef.Y.GROUP,display:"flex",width:"100%",justifyContent:"space-between",children:[{height:"52px",width:"300px"},{height:"40px",width:"330px"}]},{type:ef.Y.GROUP,display:"grid",gap:"22px",gridTemplateColumns:"repeat(6, minmax(auto, 100%))",width:"100%",children:Array(6).fill({type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,height:"108px",direction:"column",alignItems:"center",justifyContent:"space-around",children:[e7,e6]})},{type:ef.Y.GROUP,display:"flex",direction:"column",width:"100%",children:Array(e).fill({type:ef.Y.GROUP,width:"100%",height:"72px",padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid var(--base-divider)",children:[{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"84px",flexShrink:0,children:[{height:"40px",width:"40px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"138px",flexShrink:0,children:[{height:"24px",width:"90px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"flex-start",fixedWidth:!0,width:"100%",flexGrow:1,children:[{height:"24px",width:"180px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"flex-start",flexShrink:0,fixedWidth:!0,width:"228px",flexGrow:1,children:[{height:"24px",width:"180px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"72px",flexShrink:0,children:[{height:"24px",width:"24px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"72px",flexShrink:0,children:[{height:"24px",width:"24px"}]}]})}],desktop:[{type:ef.Y.GROUP,display:"flex",width:"100%",justifyContent:"space-between",children:[{height:"52px",width:"300px"},{height:"40px",width:"330px"}]},{type:ef.Y.GROUP,display:"grid",gap:"22px",gridTemplateColumns:"repeat(5, minmax(auto, 100%))",width:"100%",children:[,,,,,].fill({type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,height:"108px",direction:"column",alignItems:"center",justifyContent:"space-around",children:[e7,e6]})},{type:ef.Y.GROUP,display:"flex",direction:"column",width:"100%",children:Array(e).fill({type:ef.Y.GROUP,width:"100%",height:"72px",padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid var(--base-divider)",children:[{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"84px",flexShrink:0,children:[{height:"40px",width:"40px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"flex-start",fixedWidth:!0,width:"100%",flexGrow:1,children:[{height:"24px",width:"90px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"flex-start",flexShrink:0,fixedWidth:!0,width:"228px",flexGrow:1,children:[{height:"24px",width:"180px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"72px",flexShrink:0,children:[{height:"24px",width:"24px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"72px",flexShrink:0,children:[{height:"24px",width:"24px"}]}]})}],tablet:[{type:ef.Y.GROUP,display:"flex",width:"100%",justifyContent:"space-between",children:[{height:"52px",width:"150px"},{height:"40px",width:"150px"}]},{type:ef.Y.GROUP,display:"grid",gap:"22px",gridTemplateColumns:"repeat(5, minmax(auto, 100%))",width:"100%",children:[,,,,,].fill({type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,height:"108px",direction:"column",alignItems:"center",justifyContent:"space-around",children:[e7,e6]})},{type:ef.Y.GROUP,display:"flex",direction:"column",width:"100%",children:Array(e).fill({type:ef.Y.GROUP,width:"100%",height:"72px",padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid var(--base-divider)",children:[{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"84px",flexShrink:0,children:[{height:"40px",width:"40px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"flex-start",fixedWidth:!0,width:"100%",flexGrow:1,children:[{height:"24px",width:"90px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"flex-start",flexShrink:0,fixedWidth:!0,width:"100px",flexGrow:1,children:[{height:"24px",width:"180px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"72px",flexShrink:0,children:[{height:"24px",width:"24px"}]},{type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,direction:"column",alignItems:"center",fixedWidth:!0,width:"72px",flexShrink:0,children:[{height:"24px",width:"24px"}]}]})}],mobile:[{type:ef.Y.GROUP,display:"flex",width:"100%",gap:"22px",justifyContent:"space-between",children:[{height:"52px",width:"150px"},{height:"40px",width:"150px"}]},{type:ef.Y.GROUP,display:"grid",gap:"22px",gridTemplateColumns:"repeat(2, minmax(auto, 100%))",width:"100%",children:[,,].fill({type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,height:"108px",direction:"column",alignItems:"center",justifyContent:"space-around",children:[e7,e6]})},{type:ef.Y.GROUP,display:"flex",direction:"column",width:"100%",children:Array(e).fill({type:ef.Y.GROUP,width:"100%",padding:"0 8px",groupWithBg:!0,alignItems:"center",direction:"column",justifyContent:"space-between",borderBottom:"1px solid var(--base-divider)",children:[,,,,,].fill({type:ef.Y.GROUP,padding:"0 8px",groupWithBg:!0,alignItems:"center",justifyContent:"space-between",height:"40px",children:[{height:"24px",width:"120px"},{height:"24px",width:"24px"}]})})}]}}]}))(10).blocks,children:[(0,i.jsx)(ed.d,{isOpen:F,onClose:()=>E(!1)}),(0,i.jsx)(ec.U,{isOpen:H,onClose:K,data:_}),(0,i.jsx)(ep.R,{data:_,isOpen:L,onClose:U,onNotEnoughMoney:q,onSubscribed:$}),(0,i.jsx)(eu.o,{data:_,isOpen:A,onClose:()=>D(!1),onUnsubscribed:Z}),ex&&(0,i.jsx)(er.L,{currencies:eg,visible:ex}),(0,i.jsx)(eH,{onStatusChange:V,groups:eb||[],hideSlider:!p,statuses:h,onGroupSelect:e=>J(e?[e]:[]),activeTab:ee,onTabChange:en,activeGroupId:em,selectedStatus:eh}),(null==eh?void 0:eh.showPeriodFilter)&&(0,i.jsx)("div",{className:y("filters"),children:(0,i.jsx)(ea.B,{initialValues:P,onApply:X,className:y("datePicker")})}),ej&&(0,i.jsx)(eK,{}),eC&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:y("listWrapper"),children:ey?(0,i.jsx)(Q,{widgetId:d,tournaments:null==T?void 0:T.list,onSubscriptionHandler:O,onUnsubscriptionHandler:G}):(0,i.jsx)(e8,{tournaments:null==T?void 0:T.list,onSubscriptionHandler:O,onUnsubscriptionHandler:G,widgetId:d})}),o===a.Os.Standard&&(0,i.jsx)(el.d,{pagination:T.pagination,onChange:k,withPerPageSelect:!1}),o===a.Os.LoadMore&&(0,i.jsx)(eo.e,{ref:w,loadMore:S,fetching:B,pagination:T.pagination,dataListName:v.formatMessage({id:"roc-front.front.load_more.data_list_name.tournaments",defaultMessage:"tournaments"})})]})]})})})}},27451:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});let i=(0,n(55307).zk)();function s(e){if(!e)return;let t=e.getBoundingClientRect(),n=document.body,s=document.documentElement,r=(null==i?void 0:i.scrollY)||s.scrollTop||n.scrollTop,a=(null==i?void 0:i.scrollX)||s.scrollLeft||n.scrollLeft,l=s.clientTop||n.clientTop||0,o=s.clientLeft||n.clientLeft||0;return{top:Math.round((null==t?void 0:t.top)+r-l),left:Math.round((null==t?void 0:t.left)+a-o)}}}
1,39788:(e,t,n)=>{"use strict";n.d(t,{A:()=>p,m:()=>g});var i=n(23798),s=n(75809),r=n(46001),a=n.n(r),l=n(21462),o=n(8759),d=n(72712),c=n(1840),u=n(93790);let p=e=>{let{tooltipText:t,element:n,className:s,title:r,event:o="hover"}=e,d=(0,c.o)("Popover"),{isBottomPosition:p,wrapperRef:h,popoverRef:m,show:x,buttonRef:g,onMouseEnter:f,onTouchToggle:y,onMouseLeave:b}=(()=>{let e=(0,l.useRef)(null),t=(0,l.useRef)(null),n=(0,l.useRef)(null),[i,s]=(0,l.useState)(!0),[r,a]=(0,l.useState)(!1),o=()=>{let{isBottom:e}=(()=>{var e,n;if(!t.current)return{isBottom:!0};let i=null==(e=t.current)?void 0:e.getBoundingClientRect();return{isBottom:((null==(n=document.querySelector(".Header"))?void 0:n.clientHeight)||0)<i.top}})();s(e)};return(0,u.W)({ref:e,handler:()=>a(!1),buttonRef:n}),(0,l.useEffect)(()=>{r||s(!0)},[r]),{onMouseLeave:()=>{a(!1)},setShow:a,onMouseEnter:()=>{o(),a(!0)},onTouchToggle:()=>{o(),a(!r)},isBottomPosition:i,wrapperRef:e,popoverRef:t,show:r,buttonRef:n}})();return(0,i.jsxs)("div",{className:d("main"),ref:h,onMouseEnter:"hover"===o?f:()=>{},onMouseLeave:"hover"===o?b:()=>{},onClick:e=>{e.preventDefault(),e.stopPropagation(),y()},children:[(0,i.jsx)("span",{ref:g,className:a()(d("icon"),s),children:n}),(0,i.jsx)("span",{className:a()(d("wrapper",{show:x})),children:(0,i.jsxs)("span",{ref:m,className:a()(d("textPopover",{bodyDown:!p}),"body4","radiusButton"),children:[r&&(0,i.jsx)("span",{className:d("titlePopover"),children:r}),(0,i.jsx)("span",{children:t})]})})]})},h=s.Kq,m=s.bL,x=s.l9,g=e=>{var t,n,r,u;let{children:p,content:g,className:f,title:y,contentProps:b,arrowProps:j,tooltipTriggerProps:C,openControl:v,container:w,classNames:N={}}=e,P=(0,c.o)("Tooltip"),[k,S]=(0,l.useState)(!1),{portalsContainerId:T}=(0,o.d4)(d.y.technical.selector.state),B=null!=(n=null==v?void 0:v.setOpen)?n:S,M=null!=(r=null==v?void 0:v.open)?r:k,I=g?`${g}`.split("\n").map((e,t)=>(0,i.jsxs)(l.Fragment,{children:[e,(0,i.jsx)("br",{})]},t)):"";return(0,i.jsx)(h,{children:(0,i.jsxs)(m,{open:M,children:[(0,i.jsx)(x,{asChild:!0,onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),onFocus:()=>B(!0),onBlur:()=>B(!1),...C,children:(0,i.jsx)("span",{className:a()(P("icon"),f,N.icon),children:p})}),(0,i.jsx)(s.ZL,{style:{zIndex:999},container:null!=(u=null!=w?w:null==(t=document)?void 0:t.getElementById(T))?u:null,children:(0,i.jsxs)(s.UC,{sideOffset:6,...b,className:a()(P("content"),"labelMTypo","radiusButton",null==b?void 0:b.className),children:[y&&(0,i.jsx)("span",{className:P("titlePopover"),children:y}),(0,i.jsx)("span",{children:"object"==typeof g?g:I}),(0,i.jsx)(s.i3,{width:12,height:8,...j,className:a()(P("arrow"),null==j?void 0:j.className)})]})})]})})}},59677:e=>{e.exports={tournamentTimer:"TimeCell__tournamentTimer--0ecdbd"}},73364:(e,t,n)=>{"use strict";n.d(t,{e:()=>k});var i=n(23798),s=n(46001),r=n.n(s),a=n(21462),l=n(14156),o=n(1840),d=n(1091),c=n(46296),u=n(9586);let p={type:u.Y.BLOCK,width:"183px",height:"4px",fixedWidth:!0},h={type:u.Y.BLOCK,height:"4px"},m={type:u.Y.BLOCK,width:"183px",height:"24px",fixedWidth:!0},x={type:u.Y.BLOCK,width:"183px",height:"22px",fixedWidth:!0},g={type:u.Y.BLOCK,height:"20px"},f={type:u.Y.BLOCK,width:"183px",height:"24px",fixedWidth:!0},y={type:u.Y.BLOCK,height:"24px"},b={type:u.Y.BLOCK,width:"183px",height:"40px",fixedWidth:!0},j={type:u.Y.BLOCK,height:"40px"};var C=n(59245),v=n.n(C),w=n(57581),N=n(55307),P=n(27451);let k=(0,a.forwardRef)((e,t)=>{let{loadMore:n,fetching:s,pagination:C,dataListName:k,showSkeleton:S=!1,backToTopSettings:T}=e,B=(0,o.o)("LoadMore"),M=(0,d.t)(),{hasMore:I,showBackToTop:O,showProgressBar:G,progressBarWidthPercent:R,loadedDataAmount:Y,handleLoadMoreClick:W,handleBackToTopClick:z}=(e=>{let{loadMore:t,pagination:n,containerRef:i,backToTopSettings:s={dontWaitFirstClick:!1}}=e,[r,l]=(0,a.useState)(!1),[o,d]=(0,a.useState)(0),{isAnyPhone:c}=(0,w.q)(),u=!!n&&n.pageCount>0,p=u?Math.min(Math.ceil((n.pageNumber+1)*n.pageSize/n.total*100),100):0,h=u?Math.min((n.pageNumber+1)*n.pageSize,n.total):0,m=async()=>{await t();let e=o+1;d(e),(null==i?void 0:i.current)&&setTimeout(()=>x(e),500)},x=(0,a.useCallback)(function(){var e,t,n,r,a;let d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;if(!i.current)return;
1let c=null!=(r=null==(e=(0,N.zk)())?void 0:e.innerHeight)?r:0,u=(0,P.A)(i.current).top,p=null==(t=i.current)?void 0:t.clientHeight;l((s.dontWaitFirstClick||d>=1)&&p>c&&(null!=(a=null==(n=(0,N.zk)())?void 0:n.scrollY)?a:0)<u+p)},[s.dontWaitFirstClick,i,o]);return(0,a.useEffect)(()=>{if(!(null==i?void 0:i.current))return;let e=v()(()=>x(),1e3);return document.addEventListener("scroll",e),()=>{document.removeEventListener("scroll",e),e.cancel()}},[i,x]),{hasMore:!!n&&n.pageCount-(n.pageNumber+1)>0,showBackToTop:r,showProgressBar:u,progressBarWidthPercent:p,loadedDataAmount:h,handleLoadMoreClick:m,handleBackToTopClick:()=>{var e,t;i.current&&(null==(t=(0,N.zk)())||t.scrollTo({top:(0,P.A)(i.current).top-(null==(e=i.current)?void 0:e.offsetTop)-(c?74:64),behavior:"smooth"}))}}})({loadMore:n,pagination:C,containerRef:t,backToTopSettings:T});return(0,i.jsx)("div",{className:B("loadMoreContainer"),children:(0,i.jsx)(c.E,{isLoading:S,breakpointsDirection:"max-width",breakpointsCorrection:-1,blocks:(e=>{let t=t=>[{type:u.Y.GROUP,display:"flex",direction:"column",alignItems:"center",gap:"16px",children:[{type:u.Y.GROUP,display:"flex",direction:"column",alignItems:"center",gap:"8px",children:[{largeDesktop:p,desktop:p,tablet:h,mobile:h}[t],{largeDesktop:m,desktop:x,tablet:g,mobile:g}[t]]},{type:u.Y.GROUP,display:"flex",direction:"column",alignItems:"center",gap:"12px",children:[...e?[{largeDesktop:f,desktop:f,tablet:y,mobile:y}[t]]:[],{largeDesktop:b,desktop:b,tablet:j,mobile:j}[t]]}]}];return[{type:u.Y.GROUP,children:{largeDesktop:t("largeDesktop"),desktop:t("desktop"),tablet:t("tablet"),mobile:t("mobile")}}]})(O),children:C&&(0,i.jsxs)(i.Fragment,{children:[G&&(0,i.jsxs)("div",{className:B("progressContainer"),children:[(0,i.jsx)("div",{className:r()(B("progressBarContainer"),"radiusCard"),children:(0,i.jsx)("div",{style:{width:`${R}%`},className:r()(B("progressBarStripe"),"radiusCard")})}),(0,i.jsx)("p",{className:r()(B("progressText"),"body3"),children:M.formatMessage({id:"roc-front.front.load_more.progress_bar_text",defaultMessage:"Displaying {loadedDataAmount} of {totalAmount} {dataListName}"},{loadedDataAmount:Y,totalAmount:C.total,dataListName:k})})]}),(0,i.jsxs)("div",{className:B("buttonsContainer",{hidden:!O&&!I}),children:[(0,i.jsx)(l.$,{className:r()("radiusButton",B("backToTopButton",{hidden:!O})),title:M.formatMessage({id:"roc-front.front.load_more.back_to_top",defaultMessage:"Back to top"}),type:"secondary",onClick:z}),I&&(0,i.jsx)(l.$,{className:r()("radiusButton",B("loadMoreButton")),title:M.formatMessage({id:"roc-front.front.load_more.progress_bar_text.button",defaultMessage:"Load more"}),type:"primary",onClick:W,isLoading:s})]})]})})})})},92399:(e,t,n)=>{"use strict";n.d(t,{d:()=>C});var i=n(23798),s=n(46001),r=n.n(s),a=n(8563),l=n(29944),o=n(21462),d=n(1840),c=n(1091),u=n(57581),p=n(55307),h=n(27451),m=n(46296),x=n(9586);let g={type:x.Y.BLOCK,width:"40px",height:"40px",fixedWidth:!0,flexShrink:1},f={type:x.Y.BLOCK,width:"24px",height:"24px",fixedWidth:!0,flexShrink:0},y={type:x.Y.BLOCK,width:"150px",minWidth:"0px",height:"40px",fixedWidth:!0,flexShrink:1},b={type:x.Y.BLOCK,width:"90px",minWidth:"0px",height:"40px",fixedWidth:!0,flexShrink:0},j={type:x.Y.GROUP,display:"flex",direction:"row",gap:"8px",justifyContent:"center",alignItems:"center",fixedWidth:!0,width:"auto",minWidth:"0px",flexShrink:1,children:[...[,,,].fill(g),f,g]},C=e=>{let{pagination:t,onChange:n,showSkeleton:s=!1,showSizeChanger:g=!1,scrollToTop:f=!0,withPerPageSelect:C=!0,scrollBlockRef:v,classNames:w={}}=e,N=(0,d.o)("Pagination"),P=(0,c.t)(),{isAnyPhone:k}=(0,u.q)(),S=(0,o.useMemo)(()=>({items_per_page:`/ ${P.formatMessage({id:"roc-front.front.pagination.per_page",defaultMessage:"page"})}`}),[P]),T=(0,o.useCallback)((e,t)=>{var i,s,r,a;if(f&&!v&&(null==(i=(0,p.zk)())||i.scrollTo(0,0)),null==v?void 0:v.current){let e=k?74:64;null==(a=(0,p.zk)())||a.scrollTo({top:((null==(s=(0,h.A)(v.current))?void 0:s.top)||0)-(null==(r=v.current)?void 0:r.offsetTop)-e,behavior:"smooth"})}n(e,t)},[k,n,v,f]);return(0,i.jsx)(m.E,{isLoading:s,blocks:(e=>{let t=t=>[{type:x.Y.GROUP,display:"flex",direction:"row",alignItems:"center",...e?({largeDesktop:{justifyContent:"flex-end",gap:"48px"},tablet:{justifyContent:"center",gap:"48px"},mobile:{justifyContent:"center",gap:"8px"}})[t]:{justifyContent:"center"},children:[j,...e?[{largeDesktop:y,tablet:y,mobile:b}[t]]:[]]}];return[{type:x.Y.GROUP,children:{largeDesktop:t("largeDesktop"),tablet:t("tablet"),mobile:t("mobile")}}]})(g),breakpointsDirection:"max-width",breakpointsCorrection:-1,children:t&&t.pageCount>1&&(0,i.jsx)(a.A,{"data-testid":"pagination",current:t.pageNumber+1,showSizeChanger:g,locale:S,pageSizeOptions:["4","8","16","32"],onShowSizeChange:n,showLessItems:!0,selectComponentClass:C?l.Ay:void 0,pageSize:t.pageSize,total:t.total,onChange:T,className:r()(N(),"radiusButton",{showSizeChanger:g},w.wrapper)})})}}}]);
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.