oraculo-ui 0.1.48 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +6 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +755 -744
- package/dist/index.es.js.map +1 -1
- package/dist/templates/OraculoPageLandingPreview.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),P=require("@mui/material"),E=require("react"),ue=require("@splidejs/react-splide"),Le=require("@mui/material/Box"),ze=require("@mui/material/Typography"),We=require("@mui/material/Stack"),q=require("@mui/icons-material"),Ae=require("@mui/icons-material/ChevronLeftRounded"),Me=require("@mui/icons-material/ChevronRightRounded"),Ge=require("@mui/material/useMediaQuery"),re=require("firebase/firestore"),D=t=>t&&t.__esModule?t:{default:t},De=D(E),_=D(Le),W=D(ze),F=D(We),pe=D(Ae),me=D(Me),He=D(Ge);function N({children:t,onClick:r,href:s,target:n,rel:c,type:o="button",disabled:a=!1,variant:p="primary",size:m,fullWidth:b=!1,fullHeight:g=!1,className:y="",ariaLabel:i,leftIcon:d,rightIcon:l,iconOnly:u}){const j=!!t&&t!==!0,R=(!!d?1:0)+(!!l?1:0)==1,T=u!=null?u:R&&!j,O=["orc-btn",p==="secondary"?"orc-btn--secondary":p==="tertiary"?"orc-btn--tertiary":"orc-btn--primary",m?`orc-btn--${m}`:"",b?"orc-btn--full":"",g?"orc-btn--fullHeight":"",T?"orc-btn--iconOnly":"",y].filter(Boolean).join(" "),$=e.jsxs(e.Fragment,{children:[d&&e.jsx("span",{className:"orc-btn__icon",children:d}),!T&&e.jsx("span",{className:"orc-btn__label",children:t}),l&&e.jsx("span",{className:"orc-btn__icon",children:l})]}),f=a?!0:void 0;return s?e.jsx(P.Link,{href:s,target:n,rel:c,"aria-label":i,"aria-disabled":f,tabIndex:f?-1:void 0,className:O,onClick:f?x=>x.preventDefault():r,children:$}):e.jsx("button",{type:o,onClick:r,disabled:!!f,"aria-label":i,className:O,children:$})}function A({title:t,iconUrl:r,size:s="md",className:n=""}){const o=["orc-section-title",s?`orc-section-title--${s}`:"",n].filter(Boolean).join(" ");return e.jsxs("div",{className:o,children:[r&&e.jsx("img",{src:r,alt:"",className:"orc-section-title__icon"}),e.jsx("h2",{className:"orc-section-title__title",children:t})]})}const te=({total:t,active:r,onSelect:s,className:n=""})=>{if(t<=1)return null;const c=["orc-dots",n].filter(Boolean).join(" ");return e.jsx("div",{className:c,role:"tablist",children:Array.from({length:t}).map((o,a)=>e.jsx("span",{className:"orc-dots__cell",children:e.jsx("button",{type:"button",role:"tab","aria-selected":a===r,"aria-label":`Ir al slide ${a+1}`,className:"orc-dots__dot"+(a===r?" orc-dots__dot--active":""),onClick:()=>s==null?void 0:s(a)})},a))})};function z({children:t,minWidth:r=32,spacing:s=2,justify:n="stretch",columns:c=null}){const o=c||`repeat(auto-fit, minmax(${r}px, 1fr))`,a=typeof s=="number"?`${s*8}px`:s;return e.jsx("div",{style:{display:"grid",gridTemplateColumns:o,justifyItems:n,gap:a,height:"inherit"},children:t})}function Z({src:t,alt:r}){return e.jsx(P.Box,{sx:{position:"relative",width:{xs:80,md:160},height:{xs:48,md:96},display:"inline-block"},children:e.jsx(P.Box,{component:"img",src:t,alt:r,sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"contain"}})})}function qe({title:t,subtitle:r}){return e.jsxs("div",{className:"oli-font",style:{display:"flex",alignItems:"center",gap:"6px",color:"#fff"},children:[e.jsx("span",{style:{fontWeight:700,fontSize:"12px",lineHeight:"16px"},children:t}),r&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[e.jsxs("svg",{width:"4",height:"4",viewBox:"0 0 5 5",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0},children:[" ",e.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"white"})," "]}),e.jsx("span",{style:{fontWeight:400,fontSize:"12px",lineHeight:"16px"},children:r})]})]})}function xe({text:t,color:r="#ff3b3b",textColor:s="#fff"}){return e.jsx("span",{className:"oli-font",style:{backgroundColor:r,color:s,borderRadius:"8px",padding:"4px 8px",fontSize:"12px",lineHeight:"16px",fontWeight:700,width:"41px",height:"16px",textAlign:"center"},children:t})}function fe({live:t,time:r}){return e.jsxs("div",{className:"oli-font",style:{display:"flex",alignItems:"center",gap:"8px"},children:[t&&e.jsx(xe,{text:"En vivo"}),r&&e.jsx("span",{style:{fontSize:"14px",fontWeight:400,lineHeight:"18px",paddingTop:"4px"},children:r})]})}function ge({title:t,subtitle:r,live:s=!1,time:n=""}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",color:"#FFFFFF"},children:[e.jsx(qe,{title:t,subtitle:r}),e.jsx(fe,{live:s,time:n})]})}const Xe="oraculo__OraculoEventLabel-module__label___c64Xw",Je={label:Xe};function oe({text:t}){return e.jsx("span",{className:Je.label,children:t})}const Ke="oraculo__OraculoEventLeague-module__container___rdk4F",Ye={container:Ke};function he({title:t}){return e.jsx("div",{className:Ye.container,children:t.toUpperCase()})}const Qe="oraculo__OraculoEventScore-module__scoreWrapper___fWwEr",Ve="oraculo__OraculoEventScore-module__name___r4uL6",Ze="oraculo__OraculoEventScore-module__score___Xl03M",et="oraculo__OraculoEventScore-module__normal___cCNFz",tt="oraculo__OraculoEventScore-module__small___fVt8E",H={scoreWrapper:Qe,name:Ve,score:Ze,normal:et,small:tt};function ne({text:t,name:r,size:s="normal"}){return e.jsxs("div",{className:`${H.scoreWrapper} ${H[s]}`,children:[e.jsx("div",{className:`${H.score} ${H[s]}`,children:t}),r&&e.jsx("span",{className:`${H.name} ${H[s]}`,children:r})]})}const ot="oraculo__OraculoEventTeamInfo-module__team___UfpUs",nt="oraculo__OraculoEventTeamInfo-module__logo___fKCl3",st="oraculo__OraculoEventTeamInfo-module__name___4ikm-",at="oraculo__OraculoEventTeamInfo-module__regular___ag826",rt="oraculo__OraculoEventTeamInfo-module__compact___RCNOs",K={team:ot,logo:nt,name:st,regular:at,compact:rt};function J({name:t,logo:r,size:s="regular"}){return e.jsxs("div",{className:`oli-font ${K.team} ${K[s]}`,children:[e.jsx("img",{src:r,alt:t,className:K.logo}),e.jsx("span",{className:K.name,children:t})]})}const it=ue.Splide,ct=ue.SplideSlide,M=E.forwardRef(({items:t=[],renderItem:r,perPage:s=1,gap:n="0px",breakpoints:c,options:o={},className:a="",onMove:p,useIndexAsKey:m=!1},b)=>{const g=E.useRef(null);E.useImperativeHandle(b,()=>({next:()=>{var l;return(l=g.current)==null?void 0:l.go(">")},prev:()=>{var l;return(l=g.current)==null?void 0:l.go("<")},go:l=>{var u;return(u=g.current)==null?void 0:u.go(l)}}));const y=E.useCallback(l=>{const u=l.index,j=l.length,I=l.options.perPage||1,w=u===0,R=u>=j-I;p==null||p({index:u,isStart:w,isEnd:R,total:j})},[p]),i=E.useCallback(l=>{y(l)},[y]),d={type:"slide",trimSpace:!1,drag:!0,pagination:!1,arrows:!1,rewind:!1,focus:"start",autoWidth:!1,perPage:s,gap:n,breakpoints:c,...o};return e.jsx("div",{className:a,style:{width:"100%"},children:e.jsx(it,{ref:g,options:d,onMove:y,onMounted:i,children:t.map((l,u)=>{var j;return e.jsx(ct,{children:r(l,u)},m?u:(j=l.id)!=null?j:u)})})})}),X=({imageUrl:t,onClick:r,size:s="sm",fillParent:n=!1})=>{const c=s==="lg"?{w:280,h:352}:{w:152,h:168},o=p=>{p.stopPropagation(),r==null||r()},a=n?{width:"100%",height:"100%"}:{width:`${c.w}px`,height:`${c.h}px`};return e.jsxs(_.default,{onClick:r,role:"button",sx:{position:"relative",borderRadius:"12px",overflow:"hidden",boxSizing:"border-box",transition:"transform .15s ease, box-shadow .15s ease",...a,"&:hover":{transform:"translateY(-2px)",boxShadow:8,cursor:"pointer"},"&:hover .oraculo-game-card-overlay":{opacity:1},"&:hover .oraculo-game-card-btn":{opacity:1,transform:"translate(-50%, -50%) scale(1)",pointerEvents:"auto"}},children:[e.jsx("img",{src:t,alt:"Juego de casino",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",display:"block",borderRadius:"inherit"}}),e.jsx(_.default,{className:"oraculo-game-card-overlay",sx:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.45)",opacity:0,transition:"opacity .15s ease",pointerEvents:"none",zIndex:1}}),e.jsx(_.default,{className:"oraculo-game-card-btn",sx:{position:"absolute",top:"50%",left:"50%",zIndex:2,transform:"translate(-50%, -50%) scale(0.95)",opacity:0,transition:"opacity .15s ease, transform .15s ease",pointerEvents:"none"},children:e.jsx(N,{variant:"primary",size:"md",onClick:o,children:"JUGAR"})})]})};function ve({imageUrl:t,orden:r=1,onClick:s,sizes:n={xs:{w:104,h:112,r:18,font:48},md:{w:186,h:264,r:22.6,font:64}}}){var g,y,i,d;const c=(l,u)=>{var j,I,w,R;return{xs:(I=(j=n.xs)==null?void 0:j[l])!=null?I:u,md:(R=(w=n.md)==null?void 0:w[l])!=null?R:u}},o=c("w",186),a=c("h",264),p=c("r",22.6),m=c("font",64),b={xs:Math.round(((y=(g=n.xs)==null?void 0:g.font)!=null?y:64)*.28),md:Math.round(((d=(i=n.md)==null?void 0:i.font)!=null?d:64)*.28)};return e.jsxs(_.default,{sx:{position:"relative",width:"100%",maxWidth:{xs:`${o.xs}px`,md:`${o.md}px`},aspectRatio:{xs:`${o.xs}/${a.xs}`,md:`${o.md}/${a.md}`},borderRadius:{xs:`${p.xs}px`,md:`${p.md}px`},boxSizing:"border-box",overflow:"visible",pb:{xs:`${b.xs}px`,md:`${b.md}px`}},children:[e.jsx(_.default,{sx:{position:"absolute",inset:0,borderRadius:"inherit",overflow:"hidden"},children:e.jsx(X,{imageUrl:t,onClick:s,size:"lg",fillParent:!0})}),e.jsx(_.default,{component:"span",sx:{position:"absolute",left:8,bottom:{xs:`-${b.xs}px`,md:`-${b.md}px`},fontFamily:"secondary",fontSize:{xs:`${m.xs}px`,md:`${m.md}px`},lineHeight:1,color:"#3CC666",WebkitTextStroke:"1px #9ee86e",zIndex:3,userSelect:"none"},children:r})]})}const be=({logo:t,provider:r,providerName:s,machine:n,onClick:c})=>{var o;return e.jsxs(_.default,{onClick:c,sx:{flex:"0 0 auto",position:"relative",borderRadius:"20px",overflow:"hidden",width:{xs:100,md:180},height:{xs:200,md:380},transition:"width .50s ease, transform .28s ease",willChange:"width, transform",cursor:"pointer",zIndex:0,"&:hover":{zIndex:2,width:{md:260,xs:110}},"&:hover .orc-live-provider-label":{opacity:1}},children:[e.jsx(_.default,{component:"img",src:t,alt:`Juego ${n!=null?n:""}`,sx:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",display:"block"}}),e.jsx(_.default,{className:"orc-live-provider-label",sx:{position:"absolute",left:"50%",top:{xs:"75%",md:"80%"},transform:"translate(-50%, -50%)",zIndex:3,opacity:0,transition:"opacity .25s ease",pointerEvents:"none"},children:e.jsx(W.default,{sx:{color:"#fff",fontWeight:700,fontSize:{xs:11,md:14},textTransform:"capitalize"},children:(o=r!=null?r:s)!=null?o:""})})]})},Y=12,se=({items:t,layout:r="grid",onClick:s})=>{var n;if(r==="mosaic"){const c=t[0],o=t.slice(1,5);return e.jsxs(_.default,{sx:{display:"grid",gridTemplateRows:{xs:"repeat(2, 112px)",md:"repeat(2, 168px)"},gridTemplateColumns:{xs:"184px",md:"280px"},gridAutoFlow:"column",gridAutoColumns:{xs:"104px",md:"152px"},columnGap:`${Y}px`,rowGap:`${Y}px`,alignItems:"stretch",justifyItems:"stretch"},children:[c&&e.jsx(_.default,{sx:{width:{xs:184,md:280},height:{xs:234,md:352},gridRow:"1 / span 2",overflow:"hidden",borderRadius:2},children:e.jsx(X,{imageUrl:`https://olimpo.bet${(n=c.imageUrl)!=null?n:""}`,size:"lg",fillParent:!0,onClick:()=>s==null?void 0:s(c,0)})}),o.map((a,p)=>{var m;return e.jsx(_.default,{sx:{width:{xs:104,md:152},height:{xs:112,md:168},overflow:"hidden",borderRadius:2},children:e.jsx(X,{imageUrl:`https://olimpo.bet${(m=a.imageUrl)!=null?m:""}`,size:"sm",fillParent:!0,onClick:()=>s==null?void 0:s(a,p+1)})},a.id)})]})}return e.jsx(_.default,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 104px)",md:"repeat(2, 152px)"},gridTemplateRows:{xs:"repeat(2, 112px)",md:"repeat(2, 168px)"},gap:`${Y}px`,gridAutoFlow:"column"},children:t.map((c,o)=>{var a,p;return e.jsx(_.default,{sx:{overflow:"hidden",borderRadius:2},children:e.jsx(X,{imageUrl:`https://olimpo.bet${(a=c.imageUrl)!=null?a:""}`,size:"sm",fillParent:!0,onClick:()=>s==null?void 0:s(c,o)})},(p=c.id)!=null?p:o)})})},ee=({title:t,amount:r,subtitle:s,buttonText:n,onButtonClick:c,backgroundImage:o,alt:a,className:p="",variant:m="small"})=>{const b=r?r.slice(0,2):"",g=r?r.slice(2):"",y=m==="large";return e.jsxs(_.default,{className:p,sx:{position:"relative",width:"100%",maxWidth:{xs:328,lg:y?618:456},mx:"auto"},children:[o&&e.jsx(_.default,{sx:{position:"relative",width:"100%",aspectRatio:{xs:"328 / 188",lg:y?"618 / 346":"456 / 272"},borderRadius:"14px",overflow:"hidden"},children:e.jsx(_.default,{component:"img",src:o,alt:a!=null?a:"Fondo promocional",sx:{width:"100%",height:"100%",objectFit:"cover",objectPosition:{xs:"50% 0%",lg:"45% 0%"},display:"block"}})}),e.jsx(_.default,{sx:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"flex-end",color:"#e7f8ff",textAlign:"center",pl:"14%",pr:{xs:"14%",lg:"15%"}},children:e.jsxs(_.default,{sx:{maxWidth:"60%",display:"flex",flexDirection:"column",alignItems:"center"},children:[t&&e.jsx(W.default,{sx:{fontSize:{xs:12,lg:20},fontWeight:400,color:"#e7f8ff"},children:t}),r&&e.jsxs(_.default,{component:"p",sx:{fontFamily:'"secondary", sans-serif',lineHeight:{xs:.9,lg:.87},m:"4px 0",background:"linear-gradient(175deg, #EDC421 -12.56%, #FFFABF 17.99%, #EDC421 49.74%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",WebkitTextStroke:"0.5px #fff8c1",filter:"drop-shadow(0px 4px 0px #8D4406) drop-shadow(0px 4px 4px rgba(28, 28, 28, 0.4))",display:"flex",alignItems:"baseline",justifyContent:"center"},children:[e.jsx(_.default,{component:"span",sx:{fontSize:{xs:35,lg:48},mr:.5},children:b}),e.jsx(_.default,{component:"span",sx:{fontSize:{xs:52,lg:77}},children:g})]}),s&&e.jsx(W.default,{sx:{pb:"20px",fontSize:14,fontWeight:600,color:"#e7f8ff"},children:s}),n&&e.jsx(N,{onClick:c,children:n})]})})]})},je=({text:t,buttonLabel:r="Conoce más",onClick:s,imgAlt:n="Club Olimpo",imgSrcMobile:c,imgSrcDesktopBg:o,imgSrcDesktopLogo:a})=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"orc-co-bgMobile",children:e.jsx("img",{src:c,alt:n,className:"orc-co-bgMobileImg"})}),e.jsxs("div",{className:"orc-co-bgDesktop",children:[o&&e.jsx("div",{className:"orc-co-fillHost",children:e.jsx("img",{src:o,alt:`${n} fondo`,className:"orc-co-bgDesktopImg"})}),a&&e.jsx("div",{className:"orc-co-logo",children:e.jsx("img",{src:a,alt:`${n} logo`,className:"orc-co-logoImg"})}),e.jsxs("div",{className:"orc-co-desktopContent",children:[e.jsx("p",{className:"orc-co-captionDesktop",children:t}),e.jsx(N,{onClick:s,variant:"primary",size:"md",children:r})]})]}),e.jsxs("div",{className:"orc-co-bottom",children:[e.jsx("p",{className:"orc-co-caption",children:t}),e.jsx(N,{onClick:s,variant:"primary",size:"md",children:r})]})]}),lt="oraculo__OraculoEventCombinadasCard-module__card___ulQeY",dt="oraculo__OraculoEventCombinadasCard-module__combinadas___Gxrld",ut="oraculo__OraculoEventCombinadasCard-module__apuestaItem___YnYMy",pt="oraculo__OraculoEventCombinadasCard-module__lineContainer___G5rbU",mt="oraculo__OraculoEventCombinadasCard-module__circle___eehm-",xt="oraculo__OraculoEventCombinadasCard-module__line___Eb2pK",ft="oraculo__OraculoEventCombinadasCard-module__apuestaText___b5s7S",gt="oraculo__OraculoEventCombinadasCard-module__cuotaTotal___Lohvu",G={card:lt,combinadas:dt,apuestaItem:ut,lineContainer:pt,circle:mt,line:xt,apuestaText:ft,cuotaTotal:gt};function ye({event:t}){var n;function r(c){var g;const o=(g=c.betoffers)!=null?g:[],a=c.homeName,p=c.awayName,m=o.map(y=>{var u,j,I,w;let i=y.outcomes[0],d="",l=i!=null&&i.line?i.line/1e3:"";return["Más de","Mas de","Over"].includes(i==null?void 0:i.label)?(d=`Más de ${l}`,i!=null&&i.participant&&(d=`${i.participant} - ${d}`)):["Menos de","Menos"].includes(i==null?void 0:i.label)?(d=`Menos de ${l}`,i!=null&&i.participant&&(d=`${i.participant} - ${d}`)):["Sí","No"].includes(i==null?void 0:i.label)?(d=i==null?void 0:i.label,i!=null&&i.participant&&(d=`${i.participant} - ${d}`)):["1X","12","X2"].includes(i==null?void 0:i.label)?i.label==="1X"?d=`${a} o Empate`:i.label==="12"?d=`${a} o ${p}`:i.label==="X2"&&(d=`${p} o Empate`):(i!=null&&i.participant?d=i.participant:d=(u=i==null?void 0:i.label)!=null?u:"",l!==""&&d===i.label&&(d=`${i.label} ${l}`)),{id:(j=i==null?void 0:i.id)!=null?j:0,value:d,label:y.criterion.label,odds:(I=i==null?void 0:i.odds)!=null?I:0,bl:(w=i==null?void 0:i.label)!=null?w:0}}),b=m.reduce((y,i)=>y+i.odds,0)/1e3;return{outcomes:m,total:b.toFixed(2)}}const s=r(t);return e.jsxs("div",{className:G.card,children:[e.jsx("div",{className:G.combinadas,children:e.jsxs(F.default,{direction:"column",spacing:.5,useFlexGap:!0,children:[e.jsx(A,{title:t.name,iconUrl:"/assets/img/home/Combinadas/pelota.png",size:"xs"}),e.jsx("img",{src:"/assets/img/home/Combinadas/line.png"}),e.jsx(F.default,{direction:"column",spacing:.5,useFlexGap:!0,children:s.outcomes.map((c,o)=>e.jsxs("div",{className:G.apuestaItem,children:[e.jsxs("div",{className:G.lineContainer,children:[e.jsx("div",{className:G.circle}),o<s.outcomes.length-1&&e.jsx("div",{className:G.line})]}),e.jsxs("div",{className:G.apuestaText,children:[e.jsx("strong",{children:c.value})," ","| ",c.label]})]},o))})]})}),e.jsxs("button",{onClick:()=>{var c,o;return console.log((o=(c=s==null?void 0:s.outcomes)==null?void 0:c.map(a=>a==null?void 0:a.id))!=null?o:[])},className:G.cuotaTotal,children:[e.jsxs("span",{children:["Cuota total: ",e.jsx("strong",{children:(((n=t.combinadoTotal)!=null?n:0)/1e3).toFixed(2)})]}),e.jsx("img",{src:"/assets/img/home/Combinadas/cuotaTotal.svg",alt:"cuota total"})]})]})}function Se({event:t,liveData:r,betOffers:s,fondo:n="/assets/img/home/EnVivo/fondo.png"}){var c,o,a,p,m,b,g,y,i,d,l;return e.jsx("div",{style:{backgroundImage:`url(${n})`,backgroundSize:"cover",height:"160px",width:"296px",padding:"12px 16px",borderRadius:"16px"},children:e.jsxs(F.default,{direction:"column",spacing:1,useFlexGap:!0,children:[e.jsxs(F.default,{direction:"column",spacing:1.5,useFlexGap:!0,children:[e.jsx(ge,{title:(c=t.path[0].name)!=null?c:"",subtitle:t.group,live:!0,time:(a=(o=r==null?void 0:r.matchClock)==null?void 0:o.minute)!=null?a:""}),e.jsx("div",{style:{padding:"0 4px"},children:e.jsxs(z,{spacing:1.5,columns:"1fr auto 1fr",children:[e.jsx(J,{name:t.homeName,logo:"/assets/img/home/EnVivo/Juventus.png"}),e.jsx(ne,{text:((m=(p=r==null?void 0:r.score)==null?void 0:p.home)!=null?m:0)+":"+((g=(b=r==null?void 0:r.score)==null?void 0:b.away)!=null?g:0),name:"En vivo"}),e.jsx(J,{name:t.awayName,logo:"/assets/img/home/EnVivo/Racing.png"})]})})]}),e.jsxs(F.default,{direction:"column",spacing:1,useFlexGap:!0,children:[e.jsx(z,{spacing:1,children:((i=(y=s==null?void 0:s[0])==null?void 0:y.outcomes)!=null?i:[]).map((u,j)=>e.jsx(oe,{text:u.label.toUpperCase()},j))}),e.jsx(z,{spacing:2,children:((l=(d=s==null?void 0:s[0])==null?void 0:d.outcomes)!=null?l:[]).map((u,j)=>e.jsx(N,{variant:"primary",disabled:u.odds==null,onClick:()=>{console.log(u.id)},children:u.odds===void 0?"X":(u.odds/1e3).toFixed(2)},j))})]})]})})}const ht="oraculo__OraculoEventDate-module__date___xhIlh",vt={date:ht};function bt({text:t}){return e.jsx("div",{className:`oli-font ${vt.date}`,children:t})}const jt="oraculo__OraculoEventSemanaCard-module__cardContainer___4JuDe",yt="oraculo__OraculoEventSemanaCard-module__cardBackground___vfalD",St="oraculo__OraculoEventSemanaCard-module__jugadas___W8b7H",Q={cardContainer:jt,cardBackground:yt,jugadas:St};function _e({event:t}){var s,n,c,o,a,p,m;function r(b){const g=new Date(b),y=g.toLocaleDateString("es-ES",{weekday:"short"}).toUpperCase(),i=g.getDate().toString().padStart(2,"0"),d=(g.getMonth()+1).toString().padStart(2,"0");let l=g.toLocaleTimeString("es-PE",{hour:"numeric",minute:"2-digit",hour12:!0}).toUpperCase();return l=l.replace(/\./g,"").replace(/A\s*M/i,"AM").replace(/P\s*M/i,"PM"),`${y} ${i}/${d} | ${l}`}return e.jsxs("div",{className:Q.cardContainer,children:[e.jsx(he,{title:(s=t.group)!=null?s:""}),e.jsx("div",{className:Q.cardBackground,children:e.jsxs(F.default,{direction:"column",spacing:{xs:.5,md:1},useFlexGap:!0,children:[e.jsxs(F.default,{direction:"column",spacing:1,useFlexGap:!0,children:[e.jsxs(z,{spacing:1,columns:"1fr auto 1fr",children:[e.jsx(J,{name:t.awayName,logo:"/assets/img/home/EventoSemana/Flamengo.png",size:"compact"}),e.jsx(ne,{text:"vs.",name:"",size:"small"}),e.jsx(J,{name:t.homeName,logo:"/assets/img/home/EventoSemana/RealMadrid.png",size:"compact"})]}),e.jsx(bt,{text:r(t.start)})]}),e.jsxs(F.default,{direction:"column",spacing:{xs:.5,md:1},useFlexGap:!0,children:[e.jsx(z,{spacing:1,children:((o=(c=(n=t==null?void 0:t.outcome)==null?void 0:n[0])==null?void 0:c.outcomes)!=null?o:[]).map((b,g)=>e.jsx(oe,{text:b.label.toUpperCase()},g))}),e.jsx("div",{className:Q.jugadas,children:e.jsx(z,{spacing:1,children:((m=(p=(a=t==null?void 0:t.outcome)==null?void 0:a[0])==null?void 0:p.outcomes)!=null?m:[]).map((b,g)=>e.jsx(N,{variant:"primary",fullHeight:!0,onClick:()=>{console.log(b.id)},children:(b.odds/1e3).toFixed(2)},g))})})]})]})})]})}function we({items:t,title:r="Destacados",iconUrl:s,onViewMore:n,className:c=""}){const o=E.useRef(null),[a,p]=E.useState({isStart:!0,isEnd:!1}),m=()=>{var d;(d=o.current)==null||d.prev()},b=()=>{var d;(d=o.current)==null||d.next(),console.log("items: ",t)},g=()=>{n==null||n()},y=d=>{if(!d||typeof window=="undefined")return;const u=`https://www.olimpo.bet/promociones/${encodeURIComponent(d)}`;window.location.href=u},i=c||void 0;return e.jsxs("section",{className:i,style:{width:"100%"},children:[e.jsxs("header",{style:{display:"grid",gridTemplateColumns:"1fr auto auto",alignItems:"center",columnGap:12,rowGap:8,marginBottom:16},children:[e.jsx(A,{title:r,iconUrl:s,size:"md"}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx(N,{ariaLabel:"Anterior",variant:"secondary",iconOnly:!0,leftIcon:e.jsx(q.ChevronLeftRounded,{}),onClick:m,disabled:a.isStart}),e.jsx(N,{ariaLabel:"Siguiente",variant:"secondary",iconOnly:!0,rightIcon:e.jsx(q.ChevronRightRounded,{}),onClick:b,disabled:a.isEnd})]}),e.jsx(N,{variant:"secondary",onClick:g,children:"Ver más"})]}),e.jsx(M,{ref:o,items:t,perPage:3,gap:"16px",options:{autoWidth:!1},breakpoints:{768:{perPage:1.15,focus:"start"},1024:{perPage:2.5,focus:"start"}},renderItem:d=>e.jsx("div",{style:{textAlign:"center",marginTop:16,cursor:"pointer"},onClick:()=>y(d.promotion),children:e.jsx("img",{src:`https://olimpo.bet${d.image!==""?d.image:d.summary_image}`,alt:d.title,style:{width:"100%",height:"150px",borderRadius:8,display:"block"}})},`${d.title}-${d.image}`),onMove:({isStart:d,isEnd:l})=>p({isStart:d,isEnd:l})})]})}const _t=t=>{var i,d,l,u,j,I;if(typeof window=="undefined")return;const r=(d=(i=t.name)!=null?i:t.web_name)!=null?d:"",s=(l=t.provider)!=null?l:"",n=(u=t.machine)!=null?u:"",c=(j=t.external_id)!=null?j:"",o=(I=t.type)!=null?I:"",a=encodeURIComponent(String(s)),p=encodeURIComponent(String(n)),m=encodeURIComponent(String(r)),b=encodeURIComponent(String(c)),g=encodeURIComponent(String(o)),y=`https://www.olimpo.bet/casino?${p}?provider=${a}&name=${m}&external_id=${b}&type=${g}`;window.location.href=y};function ae({items:t,title:r="Top Juegos",iconUrl:s,onCardClick:n}){const c=E.useMemo(()=>t.map((o,a)=>{var p;return{...o,orden:(p=o.orden)!=null?p:a+1,_originalIndex:a}}).sort((o,a)=>o.orden!=null&&a.orden!=null?o.orden-a.orden:o._originalIndex-a._originalIndex),[t]);return e.jsx("section",{style:{width:"100%"},children:e.jsxs(F.default,{direction:"column",spacing:2,useFlexGap:!0,children:[e.jsx(A,{title:r,iconUrl:s,size:"md"}),e.jsx(_.default,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(3, minmax(0, 1fr))",md:"repeat(6, minmax(0, 1fr))"},gap:{xs:1.5,md:2},justifyItems:"center",width:"100%"},children:c.slice(0,6).map(o=>{var a;return e.jsx(ve,{imageUrl:`https://olimpo.bet${(a=o.logo)!=null?a:""}`,orden:o.orden,onClick:()=>{n?n(o):_t(o)}},o.machine)})})]})})}const wt=(t,r)=>{var s,n;return(n=(s=t.orden)!=null?s:t.machine)!=null?n:r},Ct=t=>{var i,d,l,u,j,I;if(typeof window=="undefined")return;const r=(d=(i=t.name)!=null?i:t.web_name)!=null?d:"",s=(l=t.provider)!=null?l:"",n=(u=t.machine)!=null?u:"",c=(j=t.external_id)!=null?j:"",o=(I=t.type)!=null?I:"Live",a=encodeURIComponent(String(s)),p=encodeURIComponent(String(n)),m=encodeURIComponent(String(r)),b=encodeURIComponent(String(c)),g=encodeURIComponent(String(o)),y=`https://www.olimpo.bet/casino-en-vivo?${p}?provider=${a}&name=${m}&external_id=${b}&type=${g}`;window.location.href=y},Ce=({items:t,title:r="Casino en vivo",subtitle:s="Disfruta la emoción en tus juegos favoritos y gana en tiempo real.",backgroundMobileUrl:n="",backgroundDesktopUrl:c="",onCardClick:o,onViewMore:a,className:p})=>e.jsxs(_.default,{className:p,sx:{position:"relative",color:"white",overflow:"hidden"},children:[e.jsx(_.default,{sx:{position:"absolute",inset:0,backgroundImage:{xs:`
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),P=require("@mui/material"),E=require("react"),pe=require("@splidejs/react-splide"),Le=require("@mui/material/Box"),ze=require("@mui/material/Typography"),We=require("@mui/material/Stack"),q=require("@mui/icons-material"),Ae=require("@mui/icons-material/ChevronLeftRounded"),Ge=require("@mui/icons-material/ChevronRightRounded"),De=require("@mui/material/useMediaQuery"),ie=require("firebase/firestore"),D=t=>t&&t.__esModule?t:{default:t},He=D(E),S=D(Le),z=D(ze),M=D(We),me=D(Ae),xe=D(Ge),qe=D(De);function R({children:t,onClick:r,href:n,target:a,rel:l,type:o="button",disabled:s=!1,variant:p="primary",size:m,fullWidth:b=!1,fullHeight:h=!1,className:y="",ariaLabel:i,leftIcon:d,rightIcon:c,iconOnly:u}){const j=!!t&&t!==!0,N=(!!d?1:0)+(!!c?1:0)==1,T=u!=null?u:N&&!j,O=["orc-btn",p==="secondary"?"orc-btn--secondary":p==="tertiary"?"orc-btn--tertiary":"orc-btn--primary",m?`orc-btn--${m}`:"",b?"orc-btn--full":"",h?"orc-btn--fullHeight":"",T?"orc-btn--iconOnly":"",y].filter(Boolean).join(" "),$=e.jsxs(e.Fragment,{children:[d&&e.jsx("span",{className:"orc-btn__icon",children:d}),!T&&e.jsx("span",{className:"orc-btn__label",children:t}),c&&e.jsx("span",{className:"orc-btn__icon",children:c})]}),x=s?!0:void 0;return n?e.jsx(P.Link,{href:n,target:a,rel:l,"aria-label":i,"aria-disabled":x,tabIndex:x?-1:void 0,className:O,onClick:x?f=>f.preventDefault():r,children:$}):e.jsx("button",{type:o,onClick:r,disabled:!!x,"aria-label":i,className:O,children:$})}function W({title:t,iconUrl:r,size:n="md",className:a=""}){const o=["orc-section-title",n?`orc-section-title--${n}`:"",a].filter(Boolean).join(" ");return e.jsxs("div",{className:o,children:[r&&e.jsx("img",{src:r,alt:"",className:"orc-section-title__icon"}),e.jsx("h2",{className:"orc-section-title__title",children:t})]})}const oe=({total:t,active:r,onSelect:n,className:a=""})=>{if(t<=1)return null;const l=["orc-dots",a].filter(Boolean).join(" ");return e.jsx("div",{className:l,role:"tablist",children:Array.from({length:t}).map((o,s)=>e.jsx("span",{className:"orc-dots__cell",children:e.jsx("button",{type:"button",role:"tab","aria-selected":s===r,"aria-label":`Ir al slide ${s+1}`,className:"orc-dots__dot"+(s===r?" orc-dots__dot--active":""),onClick:()=>n==null?void 0:n(s)})},s))})};function L({children:t,minWidth:r=32,spacing:n=2,justify:a="stretch",columns:l=null}){const o=l||`repeat(auto-fit, minmax(${r}px, 1fr))`,s=typeof n=="number"?`${n*8}px`:n;return e.jsx("div",{style:{display:"grid",gridTemplateColumns:o,justifyItems:a,gap:s,height:"inherit"},children:t})}function ee({src:t,alt:r}){return e.jsx(P.Box,{sx:{position:"relative",width:{xs:80,md:160},height:{xs:48,md:96},display:"inline-block"},children:e.jsx(P.Box,{component:"img",src:t,alt:r,sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"contain"}})})}function Ve({title:t,subtitle:r}){return e.jsxs("div",{className:"oli-font",style:{display:"flex",alignItems:"center",gap:"6px",color:"#fff"},children:[e.jsx("span",{style:{fontWeight:700,fontSize:"12px",lineHeight:"16px"},children:t}),r&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[e.jsxs("svg",{width:"4",height:"4",viewBox:"0 0 5 5",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0},children:[" ",e.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"white"})," "]}),e.jsx("span",{style:{fontWeight:400,fontSize:"12px",lineHeight:"16px"},children:r})]})]})}function fe({text:t,color:r="#ff3b3b",textColor:n="#fff"}){return e.jsx("span",{className:"oli-font",style:{backgroundColor:r,color:n,borderRadius:"8px",padding:"4px 8px",fontSize:"12px",lineHeight:"16px",fontWeight:700,width:"41px",height:"16px",textAlign:"center"},children:t})}function ge({live:t,time:r}){return e.jsxs("div",{className:"oli-font",style:{display:"flex",alignItems:"center",gap:"8px"},children:[t&&e.jsx(fe,{text:"En vivo"}),r&&e.jsx("span",{style:{fontSize:"14px",fontWeight:400,lineHeight:"18px",paddingTop:"4px"},children:r})]})}function he({title:t,subtitle:r,live:n=!1,time:a=""}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",color:"#FFFFFF"},children:[e.jsx(Ve,{title:t,subtitle:r}),e.jsx(ge,{live:n,time:a})]})}const Xe="oraculo__OraculoEventLabel-module__label___c64Xw",Je={label:Xe};function ne({text:t}){return e.jsx("span",{className:Je.label,children:t})}const Ke="oraculo__OraculoEventLeague-module__container___rdk4F",Ye={container:Ke};function ve({title:t}){return e.jsx("div",{className:Ye.container,children:t.toUpperCase()})}const Qe="oraculo__OraculoEventScore-module__scoreWrapper___fWwEr",Ze="oraculo__OraculoEventScore-module__name___r4uL6",et="oraculo__OraculoEventScore-module__score___Xl03M",tt="oraculo__OraculoEventScore-module__normal___cCNFz",ot="oraculo__OraculoEventScore-module__small___fVt8E",H={scoreWrapper:Qe,name:Ze,score:et,normal:tt,small:ot};function se({text:t,name:r,size:n="normal"}){return e.jsxs("div",{className:`${H.scoreWrapper} ${H[n]}`,children:[e.jsx("div",{className:`${H.score} ${H[n]}`,children:t}),r&&e.jsx("span",{className:`${H.name} ${H[n]}`,children:r})]})}const nt="oraculo__OraculoEventTeamInfo-module__team___UfpUs",st="oraculo__OraculoEventTeamInfo-module__logo___fKCl3",at="oraculo__OraculoEventTeamInfo-module__name___4ikm-",rt="oraculo__OraculoEventTeamInfo-module__regular___ag826",it="oraculo__OraculoEventTeamInfo-module__compact___RCNOs",J={team:nt,logo:st,name:at,regular:rt,compact:it};function X({name:t,logo:r,size:n="regular"}){return e.jsxs("div",{className:`oli-font ${J.team} ${J[n]}`,children:[e.jsx("img",{src:r,alt:t,className:J.logo}),e.jsx("span",{className:J.name,children:t})]})}const ct=pe.Splide,lt=pe.SplideSlide,A=E.forwardRef(({items:t=[],renderItem:r,perPage:n=1,gap:a="0px",breakpoints:l,options:o={},className:s="",onMove:p,useIndexAsKey:m=!1},b)=>{const h=E.useRef(null);E.useImperativeHandle(b,()=>({next:()=>{var c;return(c=h.current)==null?void 0:c.go(">")},prev:()=>{var c;return(c=h.current)==null?void 0:c.go("<")},go:c=>{var u;return(u=h.current)==null?void 0:u.go(c)}}));const y=E.useCallback(c=>{const u=c.index,j=c.length,I=c.options.perPage||1,w=u===0,N=u>=j-I;p==null||p({index:u,isStart:w,isEnd:N,total:j})},[p]),i=E.useCallback(c=>{y(c)},[y]),d={type:"slide",trimSpace:!1,drag:!0,pagination:!1,arrows:!1,rewind:!1,focus:"start",autoWidth:!1,perPage:n,gap:a,breakpoints:l,...o};return e.jsx("div",{className:s,style:{width:"100%"},children:e.jsx(ct,{ref:h,options:d,onMove:y,onMounted:i,children:t.map((c,u)=>{var j;return e.jsx(lt,{children:r(c,u)},m?u:(j=c.id)!=null?j:u)})})})}),V=({imageUrl:t,onClick:r,size:n="sm",fillParent:a=!1})=>{const l=n==="lg"?{w:280,h:352}:{w:152,h:168},o=p=>{p.stopPropagation(),r==null||r()},s=a?{width:"100%",height:"100%"}:{width:`${l.w}px`,height:`${l.h}px`};return e.jsxs(S.default,{onClick:r,role:"button",sx:{position:"relative",borderRadius:"12px",overflow:"hidden",boxSizing:"border-box",transition:"transform .15s ease, box-shadow .15s ease",...s,"&:hover":{transform:"translateY(-2px)",boxShadow:8,cursor:"pointer"},"&:hover .oraculo-game-card-overlay":{opacity:1},"&:hover .oraculo-game-card-btn":{opacity:1,transform:"translate(-50%, -50%) scale(1)",pointerEvents:"auto"}},children:[e.jsx("img",{src:t,alt:"Juego de casino",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",display:"block",borderRadius:"inherit"}}),e.jsx(S.default,{className:"oraculo-game-card-overlay",sx:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.45)",opacity:0,transition:"opacity .15s ease",pointerEvents:"none",zIndex:1}}),e.jsx(S.default,{className:"oraculo-game-card-btn",sx:{position:"absolute",top:"50%",left:"50%",zIndex:2,transform:"translate(-50%, -50%) scale(0.95)",opacity:0,transition:"opacity .15s ease, transform .15s ease",pointerEvents:"none"},children:e.jsx(R,{variant:"primary",size:"md",onClick:o,children:"JUGAR"})})]})};function be({imageUrl:t,orden:r=1,onClick:n,sizes:a={xs:{w:104,h:112,r:18,font:48},md:{w:186,h:264,r:22.6,font:64}}}){var h,y,i,d;const l=(c,u)=>{var j,I,w,N;return{xs:(I=(j=a.xs)==null?void 0:j[c])!=null?I:u,md:(N=(w=a.md)==null?void 0:w[c])!=null?N:u}},o=l("w",186),s=l("h",264),p=l("r",22.6),m=l("font",64),b={xs:Math.round(((y=(h=a.xs)==null?void 0:h.font)!=null?y:64)*.28),md:Math.round(((d=(i=a.md)==null?void 0:i.font)!=null?d:64)*.28)};return e.jsxs(S.default,{sx:{position:"relative",width:"100%",maxWidth:{xs:`${o.xs}px`,md:`${o.md}px`},aspectRatio:{xs:`${o.xs}/${s.xs}`,md:`${o.md}/${s.md}`},borderRadius:{xs:`${p.xs}px`,md:`${p.md}px`},boxSizing:"border-box",overflow:"visible",pb:{xs:`${b.xs}px`,md:`${b.md}px`}},children:[e.jsx(S.default,{sx:{position:"absolute",inset:0,borderRadius:"inherit",overflow:"hidden"},children:e.jsx(V,{imageUrl:t,onClick:n,size:"lg",fillParent:!0})}),e.jsx(S.default,{component:"span",sx:{position:"absolute",left:8,bottom:{xs:`-${b.xs}px`,md:`-${b.md}px`},fontFamily:"secondary",fontSize:{xs:`${m.xs}px`,md:`${m.md}px`},lineHeight:1,color:"#3CC666",WebkitTextStroke:"1px #9ee86e",zIndex:3,userSelect:"none"},children:r})]})}const je=({logo:t,provider:r,providerName:n,machine:a,onClick:l})=>{var o;return e.jsxs(S.default,{onClick:l,sx:{flex:"0 0 auto",position:"relative",borderRadius:"20px",overflow:"hidden",width:{xs:100,md:180},height:{xs:200,md:380},transition:"width .50s ease, transform .28s ease",willChange:"width, transform",cursor:"pointer",zIndex:0,"&:hover":{zIndex:2,width:{md:260,xs:110}},"&:hover .orc-live-provider-label":{opacity:1}},children:[e.jsx(S.default,{component:"img",src:t,alt:`Juego ${a!=null?a:""}`,sx:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",display:"block"}}),e.jsx(S.default,{className:"orc-live-provider-label",sx:{position:"absolute",left:"50%",top:{xs:"75%",md:"80%"},transform:"translate(-50%, -50%)",zIndex:3,opacity:0,transition:"opacity .25s ease",pointerEvents:"none"},children:e.jsx(z.default,{sx:{color:"#fff",fontWeight:700,fontSize:{xs:11,md:14},textTransform:"capitalize"},children:(o=r!=null?r:n)!=null?o:""})})]})},K=12,ae=({items:t,layout:r="grid",onClick:n})=>{var a;if(r==="mosaic"){const l=t[0],o=t.slice(1,5);return e.jsxs(S.default,{sx:{display:"grid",gridTemplateRows:{xs:"repeat(2, 112px)",md:"repeat(2, 168px)"},gridTemplateColumns:{xs:"184px",md:"280px"},gridAutoFlow:"column",gridAutoColumns:{xs:"104px",md:"152px"},columnGap:`${K}px`,rowGap:`${K}px`,alignItems:"stretch",justifyItems:"stretch"},children:[l&&e.jsx(S.default,{sx:{width:{xs:184,md:280},height:{xs:234,md:352},gridRow:"1 / span 2",overflow:"hidden",borderRadius:2},children:e.jsx(V,{imageUrl:`https://olimpo.bet${(a=l.imageUrl)!=null?a:""}`,size:"lg",fillParent:!0,onClick:()=>n==null?void 0:n(l,0)})}),o.map((s,p)=>{var m;return e.jsx(S.default,{sx:{width:{xs:104,md:152},height:{xs:112,md:168},overflow:"hidden",borderRadius:2},children:e.jsx(V,{imageUrl:`https://olimpo.bet${(m=s.imageUrl)!=null?m:""}`,size:"sm",fillParent:!0,onClick:()=>n==null?void 0:n(s,p+1)})},s.id)})]})}return e.jsx(S.default,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 104px)",md:"repeat(2, 152px)"},gridTemplateRows:{xs:"repeat(2, 112px)",md:"repeat(2, 168px)"},gap:`${K}px`,gridAutoFlow:"column"},children:t.map((l,o)=>{var s,p;return e.jsx(S.default,{sx:{overflow:"hidden",borderRadius:2},children:e.jsx(V,{imageUrl:`https://olimpo.bet${(s=l.imageUrl)!=null?s:""}`,size:"sm",fillParent:!0,onClick:()=>n==null?void 0:n(l,o)})},(p=l.id)!=null?p:o)})})},te=({title:t,amount:r,subtitle:n,buttonText:a,onButtonClick:l,backgroundImage:o,alt:s,className:p="",variant:m="small"})=>{const b=r?r.slice(0,2):"",h=r?r.slice(2):"",y=m==="large";return e.jsxs(S.default,{className:p,sx:{position:"relative",width:"100%",maxWidth:{xs:328,lg:y?618:456},mx:"auto"},children:[o&&e.jsx(S.default,{sx:{position:"relative",width:"100%",aspectRatio:{xs:"328 / 188",lg:y?"618 / 346":"456 / 272"},borderRadius:"14px",overflow:"hidden"},children:e.jsx(S.default,{component:"img",src:o,alt:s!=null?s:"Fondo promocional",sx:{width:"100%",height:"100%",objectFit:"cover",objectPosition:{xs:"50% 0%",lg:"45% 0%"},display:"block"}})}),e.jsx(S.default,{sx:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"flex-end",color:"#e7f8ff",textAlign:"center",pl:"14%",pr:{xs:"14%",lg:"15%"}},children:e.jsxs(S.default,{sx:{maxWidth:"60%",display:"flex",flexDirection:"column",alignItems:"center"},children:[t&&e.jsx(z.default,{sx:{fontSize:{xs:12,lg:20},fontWeight:400,color:"#e7f8ff"},children:t}),r&&e.jsxs(S.default,{component:"p",sx:{fontFamily:'"secondary", sans-serif',lineHeight:{xs:.9,lg:.87},m:"4px 0",background:"linear-gradient(175deg, #EDC421 -12.56%, #FFFABF 17.99%, #EDC421 49.74%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",WebkitTextStroke:"0.5px #fff8c1",filter:"drop-shadow(0px 4px 0px #8D4406) drop-shadow(0px 4px 4px rgba(28, 28, 28, 0.4))",display:"flex",alignItems:"baseline",justifyContent:"center"},children:[e.jsx(S.default,{component:"span",sx:{fontSize:{xs:35,lg:48},mr:.5},children:b}),e.jsx(S.default,{component:"span",sx:{fontSize:{xs:52,lg:77}},children:h})]}),n&&e.jsx(z.default,{sx:{pb:"20px",fontSize:14,fontWeight:600,color:"#e7f8ff"},children:n}),a&&e.jsx(R,{onClick:l,children:a})]})})]})},ye=({text:t,buttonLabel:r="Conoce más",onClick:n,imgAlt:a="Club Olimpo",imgSrcMobile:l,imgSrcDesktopBg:o,imgSrcDesktopLogo:s})=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"orc-co-bgMobile",children:e.jsx("img",{src:l,alt:a,className:"orc-co-bgMobileImg"})}),e.jsxs("div",{className:"orc-co-bgDesktop",children:[o&&e.jsx("div",{className:"orc-co-fillHost",children:e.jsx("img",{src:o,alt:`${a} fondo`,className:"orc-co-bgDesktopImg"})}),s&&e.jsx("div",{className:"orc-co-logo",children:e.jsx("img",{src:s,alt:`${a} logo`,className:"orc-co-logoImg"})}),e.jsxs("div",{className:"orc-co-desktopContent",children:[e.jsx("p",{className:"orc-co-captionDesktop",children:t}),e.jsx(R,{onClick:n,variant:"primary",size:"md",children:r})]})]}),e.jsxs("div",{className:"orc-co-bottom",children:[e.jsx("p",{className:"orc-co-caption",children:t}),e.jsx(R,{onClick:n,variant:"primary",size:"md",children:r})]})]}),dt="oraculo__OraculoEventCombinadasCard-module__card___ulQeY",ut="oraculo__OraculoEventCombinadasCard-module__combinadas___Gxrld",pt="oraculo__OraculoEventCombinadasCard-module__apuestaItem___YnYMy",mt="oraculo__OraculoEventCombinadasCard-module__lineContainer___G5rbU",xt="oraculo__OraculoEventCombinadasCard-module__circle___eehm-",ft="oraculo__OraculoEventCombinadasCard-module__line___Eb2pK",gt="oraculo__OraculoEventCombinadasCard-module__apuestaText___b5s7S",ht="oraculo__OraculoEventCombinadasCard-module__cuotaTotal___Lohvu",G={card:dt,combinadas:ut,apuestaItem:pt,lineContainer:mt,circle:xt,line:ft,apuestaText:gt,cuotaTotal:ht};function _e({event:t}){var a;function r(l){var h;const o=(h=l.betoffers)!=null?h:[],s=l.homeName,p=l.awayName,m=o.map(y=>{var u,j,I,w;let i=y.outcomes[0],d="",c=i!=null&&i.line?i.line/1e3:"";return["Más de","Mas de","Over"].includes(i==null?void 0:i.label)?(d=`Más de ${c}`,i!=null&&i.participant&&(d=`${i.participant} - ${d}`)):["Menos de","Menos"].includes(i==null?void 0:i.label)?(d=`Menos de ${c}`,i!=null&&i.participant&&(d=`${i.participant} - ${d}`)):["Sí","No"].includes(i==null?void 0:i.label)?(d=i==null?void 0:i.label,i!=null&&i.participant&&(d=`${i.participant} - ${d}`)):["1X","12","X2"].includes(i==null?void 0:i.label)?i.label==="1X"?d=`${s} o Empate`:i.label==="12"?d=`${s} o ${p}`:i.label==="X2"&&(d=`${p} o Empate`):(i!=null&&i.participant?d=i.participant:d=(u=i==null?void 0:i.label)!=null?u:"",c!==""&&d===i.label&&(d=`${i.label} ${c}`)),{id:(j=i==null?void 0:i.id)!=null?j:0,value:d,label:y.criterion.label,odds:(I=i==null?void 0:i.odds)!=null?I:0,bl:(w=i==null?void 0:i.label)!=null?w:0}}),b=m.reduce((y,i)=>y+i.odds,0)/1e3;return{outcomes:m,total:b.toFixed(2)}}const n=r(t);return e.jsxs("div",{className:G.card,children:[e.jsx("div",{className:G.combinadas,children:e.jsxs(M.default,{direction:"column",spacing:.5,useFlexGap:!0,children:[e.jsx(W,{title:t.name,iconUrl:"/assets/img/home/Combinadas/pelota.png",size:"xs"}),e.jsx("img",{src:"/assets/img/home/Combinadas/line.png"}),e.jsx(M.default,{direction:"column",spacing:.5,useFlexGap:!0,children:n.outcomes.map((l,o)=>e.jsxs("div",{className:G.apuestaItem,children:[e.jsxs("div",{className:G.lineContainer,children:[e.jsx("div",{className:G.circle}),o<n.outcomes.length-1&&e.jsx("div",{className:G.line})]}),e.jsxs("div",{className:G.apuestaText,children:[e.jsx("strong",{children:l.value})," ","| ",l.label]})]},o))})]})}),e.jsxs("button",{onClick:()=>{var l,o;return console.log((o=(l=n==null?void 0:n.outcomes)==null?void 0:l.map(s=>s==null?void 0:s.id))!=null?o:[])},className:G.cuotaTotal,children:[e.jsxs("span",{children:["Cuota total: ",e.jsx("strong",{children:(((a=t.combinadoTotal)!=null?a:0)/1e3).toFixed(2)})]}),e.jsx("img",{src:"/assets/img/home/Combinadas/cuotaTotal.svg",alt:"cuota total"})]})]})}function Se({event:t,liveData:r,betOffers:n,fondo:a="/assets/img/home/EnVivo/fondo.png"}){var l,o,s,p,m,b,h,y,i,d,c;return e.jsx("div",{style:{backgroundImage:`url(${a})`,backgroundSize:"cover",height:"160px",width:"296px",padding:"12px 16px",borderRadius:"16px"},children:e.jsxs(M.default,{direction:"column",spacing:1,useFlexGap:!0,children:[e.jsxs(M.default,{direction:"column",spacing:1.5,useFlexGap:!0,children:[e.jsx(he,{title:(l=t.path[0].name)!=null?l:"",subtitle:t.group,live:!0,time:(s=(o=r==null?void 0:r.matchClock)==null?void 0:o.minute)!=null?s:""}),e.jsx("div",{style:{padding:"0 4px"},children:e.jsxs(L,{spacing:1.5,columns:"1fr auto 1fr",children:[e.jsx(X,{name:t.homeName,logo:"/assets/img/home/EnVivo/Juventus.png"}),e.jsx(se,{text:((m=(p=r==null?void 0:r.score)==null?void 0:p.home)!=null?m:0)+":"+((h=(b=r==null?void 0:r.score)==null?void 0:b.away)!=null?h:0),name:"En vivo"}),e.jsx(X,{name:t.awayName,logo:"/assets/img/home/EnVivo/Racing.png"})]})})]}),e.jsxs(M.default,{direction:"column",spacing:1,useFlexGap:!0,children:[e.jsx(L,{spacing:1,children:((i=(y=n==null?void 0:n[0])==null?void 0:y.outcomes)!=null?i:[]).map((u,j)=>e.jsx(ne,{text:u.label.toUpperCase()},j))}),e.jsx(L,{spacing:2,children:((c=(d=n==null?void 0:n[0])==null?void 0:d.outcomes)!=null?c:[]).map((u,j)=>e.jsx(R,{variant:"primary",disabled:u.odds==null,onClick:()=>{console.log(u.id)},children:u.odds===void 0?"X":(u.odds/1e3).toFixed(2)},j))})]})]})})}const vt="oraculo__OraculoEventDate-module__date___xhIlh",bt={date:vt};function jt({text:t}){return e.jsx("div",{className:`oli-font ${bt.date}`,children:t})}const yt="oraculo__OraculoEventSemanaCard-module__cardContainer___4JuDe",_t="oraculo__OraculoEventSemanaCard-module__cardBackground___vfalD",St="oraculo__OraculoEventSemanaCard-module__jugadas___W8b7H",Y={cardContainer:yt,cardBackground:_t,jugadas:St};function we({event:t}){var n,a,l,o,s,p,m;function r(b){const h=new Date(b),y=h.toLocaleDateString("es-ES",{weekday:"short"}).toUpperCase(),i=h.getDate().toString().padStart(2,"0"),d=(h.getMonth()+1).toString().padStart(2,"0");let c=h.toLocaleTimeString("es-PE",{hour:"numeric",minute:"2-digit",hour12:!0}).toUpperCase();return c=c.replace(/\./g,"").replace(/A\s*M/i,"AM").replace(/P\s*M/i,"PM"),`${y} ${i}/${d} | ${c}`}return e.jsxs("div",{className:Y.cardContainer,children:[e.jsx(ve,{title:(n=t.group)!=null?n:""}),e.jsx("div",{className:Y.cardBackground,children:e.jsxs(M.default,{direction:"column",spacing:{xs:.5,md:1},useFlexGap:!0,children:[e.jsxs(M.default,{direction:"column",spacing:1,useFlexGap:!0,children:[e.jsxs(L,{spacing:1,columns:"1fr auto 1fr",children:[e.jsx(X,{name:t.awayName,logo:"/assets/img/home/EventoSemana/Flamengo.png",size:"compact"}),e.jsx(se,{text:"vs.",name:"",size:"small"}),e.jsx(X,{name:t.homeName,logo:"/assets/img/home/EventoSemana/RealMadrid.png",size:"compact"})]}),e.jsx(jt,{text:r(t.start)})]}),e.jsxs(M.default,{direction:"column",spacing:{xs:.5,md:1},useFlexGap:!0,children:[e.jsx(L,{spacing:1,children:((o=(l=(a=t==null?void 0:t.outcome)==null?void 0:a[0])==null?void 0:l.outcomes)!=null?o:[]).map((b,h)=>e.jsx(ne,{text:b.label.toUpperCase()},h))}),e.jsx("div",{className:Y.jugadas,children:e.jsx(L,{spacing:1,children:((m=(p=(s=t==null?void 0:t.outcome)==null?void 0:s[0])==null?void 0:p.outcomes)!=null?m:[]).map((b,h)=>e.jsx(R,{variant:"primary",fullHeight:!0,onClick:()=>{console.log(b.id)},children:(b.odds/1e3).toFixed(2)},h))})})]})]})})]})}function Ce({items:t,title:r="Destacados",iconUrl:n,onViewMore:a,className:l=""}){const o=E.useRef(null),[s,p]=E.useState({isStart:!0,isEnd:!1}),m=()=>{var d;(d=o.current)==null||d.prev()},b=()=>{var d;(d=o.current)==null||d.next(),console.log("items: ",t)},h=()=>{window.location.href="https://www.olimpo.bet/promociones"},y=d=>{if(!d||typeof window=="undefined")return;const u=`https://www.olimpo.bet/promociones/${encodeURIComponent(d)}`;window.location.href=u},i=l||void 0;return e.jsxs("section",{className:i,style:{width:"100%"},children:[e.jsxs("header",{style:{display:"grid",gridTemplateColumns:"1fr auto auto",alignItems:"center",columnGap:12,rowGap:8,marginBottom:16},children:[e.jsx(W,{title:r,iconUrl:n,size:"md"}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx(R,{ariaLabel:"Anterior",variant:"secondary",iconOnly:!0,leftIcon:e.jsx(q.ChevronLeftRounded,{}),onClick:m,disabled:s.isStart}),e.jsx(R,{ariaLabel:"Siguiente",variant:"secondary",iconOnly:!0,rightIcon:e.jsx(q.ChevronRightRounded,{}),onClick:b,disabled:s.isEnd})]}),e.jsx(R,{variant:"secondary",onClick:h,children:"Ver más"})]}),e.jsx(A,{ref:o,items:t,perPage:3,gap:"16px",options:{autoWidth:!1},breakpoints:{768:{perPage:1.15,focus:"start"},1024:{perPage:2.5,focus:"start"}},renderItem:d=>e.jsx("div",{style:{textAlign:"center",marginTop:16,cursor:"pointer"},onClick:()=>y(d.promotion),children:e.jsx("img",{src:`https://olimpo.bet${d.image!==""?d.image:d.summary_image}`,alt:d.title,style:{width:"100%",height:"150px",borderRadius:8,display:"block"}})},`${d.title}-${d.image}`),onMove:({isStart:d,isEnd:c})=>p({isStart:d,isEnd:c})})]})}const wt=t=>{var i,d,c,u,j,I;if(typeof window=="undefined")return;const r=(d=(i=t.name)!=null?i:t.web_name)!=null?d:"",n=(c=t.provider)!=null?c:"",a=(u=t.machine)!=null?u:"",l=(j=t.external_id)!=null?j:"",o=(I=t.type)!=null?I:"",s=encodeURIComponent(String(n)),p=encodeURIComponent(String(a)),m=encodeURIComponent(String(r)),b=encodeURIComponent(String(l)),h=encodeURIComponent(String(o)),y=`https://www.olimpo.bet/casino?${p}?provider=${s}&name=${m}&external_id=${b}&type=${h}`;window.location.href=y};function re({items:t,title:r="Top Juegos",iconUrl:n,onCardClick:a}){const l=E.useMemo(()=>t.map((o,s)=>{var p;return{...o,orden:(p=o.orden)!=null?p:s+1,_originalIndex:s}}).sort((o,s)=>o.orden!=null&&s.orden!=null?o.orden-s.orden:o._originalIndex-s._originalIndex),[t]);return e.jsx("section",{style:{width:"100%"},children:e.jsxs(M.default,{direction:"column",spacing:2,useFlexGap:!0,children:[e.jsx(W,{title:r,iconUrl:n,size:"md"}),e.jsx(S.default,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(3, minmax(0, 1fr))",md:"repeat(6, minmax(0, 1fr))"},gap:{xs:1.5,md:2},justifyItems:"center",width:"100%"},children:l.slice(0,6).map(o=>{var s;return e.jsx(be,{imageUrl:`https://olimpo.bet${(s=o.logo)!=null?s:""}`,orden:o.orden,onClick:()=>{a?a(o):wt(o)}},o.machine)})})]})})}const Ct=(t,r)=>{var n,a;return(a=(n=t.orden)!=null?n:t.machine)!=null?a:r},Et=t=>{var i,d,c,u,j,I;if(typeof window=="undefined")return;const r=(d=(i=t.name)!=null?i:t.web_name)!=null?d:"",n=(c=t.provider)!=null?c:"",a=(u=t.machine)!=null?u:"",l=(j=t.external_id)!=null?j:"",o=(I=t.type)!=null?I:"Live",s=encodeURIComponent(String(n)),p=encodeURIComponent(String(a)),m=encodeURIComponent(String(r)),b=encodeURIComponent(String(l)),h=encodeURIComponent(String(o)),y=`https://www.olimpo.bet/casino-en-vivo?${p}?provider=${s}&name=${m}&external_id=${b}&type=${h}`;window.location.href=y},Ee=({items:t,title:r="Casino en vivo",subtitle:n="Disfruta la emoción en tus juegos favoritos y gana en tiempo real.",backgroundMobileUrl:a="",backgroundDesktopUrl:l="",onCardClick:o,onViewMore:s,className:p})=>e.jsxs(S.default,{className:p,sx:{position:"relative",color:"white",overflow:"hidden"},children:[e.jsx(S.default,{sx:{position:"absolute",inset:0,backgroundImage:{xs:`
|
|
2
2
|
linear-gradient(to bottom, #121212 0%, rgba(18,18,18,0) 10%),
|
|
3
3
|
linear-gradient(to top, #121212 0%, rgba(18,18,18,0) 10%),
|
|
4
|
-
url('${
|
|
4
|
+
url('${a}')
|
|
5
5
|
`,md:`
|
|
6
6
|
linear-gradient(to bottom, #121212 0%, rgba(18,18,18,0) 10%),
|
|
7
7
|
linear-gradient(to top, #121212 0%, rgba(18,18,18,0) 10%),
|
|
8
|
-
url('${
|
|
9
|
-
`},backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",zIndex:0}}),e.jsxs(
|
|
8
|
+
url('${l}')
|
|
9
|
+
`},backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",zIndex:0}}),e.jsxs(S.default,{sx:{position:"relative",zIndex:1,maxWidth:1200,height:{xs:"450px",md:"550px"},mx:"auto",px:{xs:2.5,md:6},display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:{xs:"center",md:"center"},justifyContent:"center",gap:{xs:0,md:15},textAlign:{xs:"center",md:"left"}},children:[e.jsxs(M.default,{spacing:3,sx:{maxWidth:{md:280}},children:[e.jsx(z.default,{variant:"h4",sx:{fontWeight:800,fontSize:{xs:24,md:40},WebkitTextStroke:"0.5px rgba(255, 255, 255, .5)",textShadow:"0 0 2px rgba(255, 255, 255, .95),0 0 4px rgba(255, 255, 255, .6),0 1px 0 #898989"},children:r}),e.jsx(z.default,{sx:{fontSize:{xs:14,md:18},color:"rgba(255,255,255,0.9)",marginX:{xs:4,md:0},lineHeight:1.5},children:n}),e.jsx(S.default,{sx:{display:{xs:"none",md:"block"}},children:e.jsx(R,{variant:"primary",size:"md",onClick:()=>s==null?void 0:s(),children:"Ver más"})})]}),e.jsx(S.default,{sx:{display:"flex",gap:{xs:2,md:3},justifyContent:"center",overflowX:{xs:"auto",md:"visible"},py:{xs:3,md:0},alignItems:"center"},children:(t!=null?t:[]).slice(0,3).map((m,b)=>{var h;return e.jsx(je,{logo:`https://olimpo.bet${(h=m.logo)!=null?h:""}`,provider:m.provider,providerName:m.web_name,machine:m.machine,onClick:()=>{o?o(m,b):Et(m)}},Ct(m,b))})}),e.jsx(S.default,{sx:{display:{xs:"block",md:"none"}},children:e.jsx(R,{variant:"primary",size:"lg",onClick:()=>s==null?void 0:s(),children:"Ver más"})})]})]}),Oe=(t,r)=>{var n,a;return(a=(n=t.orden)!=null?n:t.machine)!=null?a:r},Ot=t=>{var i,d,c,u,j;if(typeof window=="undefined")return;const r=(i=t.name)!=null?i:"",n=(d=t.provider)!=null?d:"",a=(c=t.machine)!=null?c:"",l=(u=t.external_id)!=null?u:"",o=(j=t.type)!=null?j:"Casino",s=encodeURIComponent(String(n)),p=encodeURIComponent(String(a)),m=encodeURIComponent(String(r)),b=encodeURIComponent(String(l)),h=encodeURIComponent(String(o)),y=`https://www.olimpo.bet/casino?${p}?provider=${s}&name=${m}&external_id=${b}&type=${h}`;window.location.href=y},It=(t,r=!0,n=4)=>{const a=t.map((s,p)=>{var m;return{id:Oe(s,p),imageUrl:(m=s.logo)!=null?m:""}});if(!a.length)return[];const l=[];let o=0;if(r){const s=Math.min(a.length,5);l.push({id:"mosaic-0",kind:"mosaic",items:a.slice(0,s)}),o=s}for(;o<a.length;){const s=Math.min(o+n,a.length);l.push({id:`grid-${o}`,kind:"grid",items:a.slice(o,s)}),o=s}return l},Ie=({items:t,title:r="Casino",iconUrl:n="/assets/img/home/Casino/diamante.svg",onItemClick:a,onViewMore:l,mosaicFirst:o=!0,gridSize:s=4})=>{const p=E.useRef(null),[m,b]=E.useState({isStart:!0,isEnd:!1}),h=It(t,o,s),y=()=>{var c;(c=p.current)==null||c.prev()},i=()=>{var c;(c=p.current)==null||c.next()},d=()=>{window.location.href="https://www.olimpo.bet/casino"};return e.jsx("section",{children:e.jsxs(M.default,{direction:"column",spacing:2,useFlexGap:!0,children:[e.jsxs(S.default,{sx:{display:"grid",gridTemplateColumns:"1fr auto auto",alignItems:"center",columnGap:1.5,rowGap:1},children:[e.jsx(W,{title:r,iconUrl:n,size:"md"}),e.jsxs(S.default,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[e.jsx(R,{ariaLabel:"Anterior",variant:"secondary",iconOnly:!0,leftIcon:e.jsx(me.default,{}),onClick:y,disabled:m.isStart}),e.jsx(R,{ariaLabel:"Siguiente",variant:"secondary",iconOnly:!0,rightIcon:e.jsx(xe.default,{}),onClick:i,disabled:m.isEnd})]}),e.jsx(S.default,{sx:{justifySelf:"end"},children:e.jsx(R,{variant:"secondary",onClick:d,children:"Ver más"})})]}),e.jsx(A,{ref:p,items:h,perPage:1,gap:"0px",options:{autoWidth:!0,gap:"12px",trimSpace:!1,pagination:!1,arrows:!1,drag:!0,focus:"start"},renderItem:c=>e.jsx("div",{style:{alignSelf:"start"},children:e.jsx(ae,{items:c.items,layout:c.kind==="mosaic"?"mosaic":"grid",onClick:u=>{const j=t.find((I,w)=>Oe(I,w)===u.id);j&&(a?a(j):Ot(j))}})}),onMove:({isStart:c,isEnd:u})=>b({isStart:c,isEnd:u})})]})})},$e=(t,r)=>{var n,a;return(a=(n=t.orden)!=null?n:t.machine)!=null?a:r},$t=t=>{var i,d,c,u,j;if(typeof window=="undefined")return;const r=(i=t.name)!=null?i:"",n=(d=t.provider)!=null?d:"",a=(c=t.machine)!=null?c:"",l=(u=t.external_id)!=null?u:"",o=(j=t.type)!=null?j:"Virtuales",s=encodeURIComponent(String(n)),p=encodeURIComponent(String(a)),m=encodeURIComponent(String(r)),b=encodeURIComponent(String(l)),h=encodeURIComponent(String(o)),y=`https://www.olimpo.bet/juegos-virtuales?${p}?provider=${s}&name=${m}&external_id=${b}&type=${h}`;window.location.href=y},kt=(t,r=!0,n=4)=>{const a=t.map((s,p)=>{var m;return{id:$e(s,p),imageUrl:(m=s.logo)!=null?m:""}});if(!a.length)return[];const l=[];let o=0;if(r){const s=Math.min(a.length,5);l.push({id:"mosaic-0",kind:"mosaic",items:a.slice(0,s)}),o=s}for(;o<a.length;){const s=Math.min(o+n,a.length);l.push({id:`grid-${o}`,kind:"grid",items:a.slice(o,s)}),o=s}return l},ke=({items:t,title:r="Virtuales",iconUrl:n="/assets/img/home/Virtuales/virtuales.svg",onItemClick:a,onViewMore:l,mosaicFirst:o=!0,gridSize:s=4})=>{const p=E.useRef(null),[m,b]=E.useState({isStart:!0,isEnd:!1}),h=kt(t,o,s),y=()=>{var c;(c=p.current)==null||c.prev()},i=()=>{var c;(c=p.current)==null||c.next()},d=()=>{window.location.href="https://www.olimpo.bet/virtuales"};return e.jsx("section",{children:e.jsxs(M.default,{direction:"column",spacing:2,useFlexGap:!0,children:[e.jsxs(S.default,{sx:{display:"grid",gridTemplateColumns:"1fr auto auto",alignItems:"center",columnGap:1.5,rowGap:1},children:[e.jsx(W,{title:r,iconUrl:n,size:"md"}),e.jsxs(S.default,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[e.jsx(R,{ariaLabel:"Anterior",variant:"secondary",iconOnly:!0,leftIcon:e.jsx(me.default,{}),onClick:y,disabled:m.isStart}),e.jsx(R,{ariaLabel:"Siguiente",variant:"secondary",iconOnly:!0,rightIcon:e.jsx(xe.default,{}),onClick:i,disabled:m.isEnd})]}),e.jsx(S.default,{sx:{justifySelf:"end"},children:e.jsx(R,{variant:"secondary",onClick:d,children:"Ver más"})})]}),e.jsx(A,{ref:p,items:h,perPage:1,gap:"0",options:{autoWidth:!0,gap:"12px",trimSpace:!1,pagination:!1,arrows:!1,drag:!0,focus:"start",perMove:1},renderItem:c=>e.jsx("div",{style:{alignSelf:"start"},children:e.jsx(ae,{items:c.items,layout:c.kind==="mosaic"?"mosaic":"grid",onClick:u=>{const j=t.find((I,w)=>$e(I,w)===u.id);j&&(a?a(j):$t(j))}})}),onMove:({isStart:c,isEnd:u})=>b({isStart:c,isEnd:u})})]})})},Nt=t=>({position:"relative",py:8,color:"#fff",backgroundImage:`
|
|
10
10
|
linear-gradient(to bottom,#121212 0%, rgba(18,18,18,0) 10%),
|
|
11
11
|
linear-gradient(to top, #121212 0%, rgba(18,18,18,0) 10%),
|
|
12
12
|
linear-gradient(to left, #121212 0%, rgba(18,18,18,0) 10%),
|
|
13
13
|
linear-gradient(to right, #121212 0%, rgba(18,18,18,0) 10%),
|
|
14
14
|
url("${t}")
|
|
15
|
-
`,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"cover"}),
|
|
15
|
+
`,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"cover"}),ce={textAlign:"center",lineHeight:1.1,mb:1.5},le={display:"inline-block",fontWeight:600,fontSize:24},de={display:"inline-block",fontSize:24,lineHeight:1.1,WebkitTextStroke:"0.3px rgba(255, 255, 255, .5)",textShadow:`
|
|
16
16
|
0 0 2px rgba(255, 255, 255, .95),
|
|
17
17
|
0 0 6px rgba(255, 255, 255, .6),
|
|
18
18
|
0 1px 0 rgba(137, 137, 137, .85)
|
|
19
|
-
`},ke=({headline:t,headline2:r,items:s,backgroundImageUrl:n})=>{const c=t,o=r,a=He.default("(max-width: 767px)"),p=s.length>1,m=n!=null?n:"",b=kt(m),g=E.useRef(null),[y,i]=E.useState({isStart:!0,isEnd:!1}),[d,l]=E.useState(0);return a?e.jsxs(_.default,{component:"section",sx:{...b,textAlign:"center"},children:[(c||o)&&e.jsxs(_.default,{sx:ie,children:[c&&e.jsx(W.default,{component:"span",sx:ce,children:c}),o&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(W.default,{component:"span",sx:le,children:o})]})]}),e.jsxs(_.default,{children:[e.jsx(M,{ref:g,items:s,perPage:1,gap:"12px",breakpoints:{480:{perPage:1,gap:"8px",padding:{left:"8px",right:"8px"}},768:{perPage:1,gap:"12px",padding:{left:"8px",right:"8px"}}},options:{autoWidth:!1},renderItem:u=>e.jsx(ee,{...u,onButtonClick:s[0].onButtonClick}),onMove:({index:u,isStart:j,isEnd:I})=>{i({isStart:j,isEnd:I}),l(u)}}),p&&e.jsx(te,{total:s.length,active:d,onSelect:u=>{var j;l(u),(j=g.current)==null||j.go(u)}})]})]}):e.jsx(_.default,{component:"section",sx:b,children:e.jsxs(_.default,{sx:{maxWidth:1200,mx:5,px:2,display:"grid",gridTemplateColumns:"200px auto",alignItems:"center"},children:[(c||o)&&e.jsx(_.default,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",minHeight:"100%"},children:e.jsxs(_.default,{sx:{...ie,textAlign:"left",mb:0},children:[c&&e.jsx(W.default,{component:"span",sx:ce,children:c}),o&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(W.default,{component:"span",sx:le,children:o})]})]})}),e.jsx(_.default,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flexWrap:"nowrap",gap:4},children:s.map((u,j)=>e.jsx(ee,{onButtonClick:u.onButtonClick,...u},j))})]})})},Re=({className:t="",fullBleed:r=!0,items:s,selectedIndex:n=0,ariaLabel:c})=>{const o=E.useRef(null),a=E.useRef(null);if(!s)return null;const p=()=>{window.location.href="https://www.olimpo.bet/conoce-club-olimpo"},m=Array.isArray(s)?s[n]:s;E.useLayoutEffect(()=>{if(!o.current||!a.current||typeof ResizeObserver=="undefined")return;const g=o.current,y=a.current,i=()=>{g.style.setProperty("--orc-co-bottomH",`${y.offsetHeight+16}px`)},d=new ResizeObserver(i);return d.observe(y),i(),()=>d.disconnect()},[]);const b=["orc-co-wrap",r?"orc-co-fullBleed":"",t].filter(Boolean).join(" ");return e.jsx("section",{ref:o,className:b,"aria-label":c||m.imgAlt||"Club Olimpo",children:e.jsx("div",{ref:a,children:e.jsx(je,{text:m.text,onClick:p,imgAlt:m.imgAlt,imgSrcMobile:m.imgMobile,imgSrcDesktopBg:m.imgDesktopBg,imgSrcDesktopLogo:m.imgDesktopLogo})})})},Rt="oraculo__OraculoSeccionEventoCombinadas-module__controls___Zsta4",Nt={controls:Rt};function Ne({items:t,title:r="Combinadas del Olimpo",iconUrl:s,onViewMore:n,className:c=""}){const o=E.useRef(null),[a,p]=E.useState({isStart:!0,isEnd:!1}),[m,b]=E.useState([]),g=()=>{var w;(w=o.current)==null||w.prev()},y=()=>{var w;(w=o.current)==null||w.next(),console.log("items: ",t)},i=()=>{n==null||n()};function d(w,R,T){const O=[];for(const $ of T){const f=u([$]),x=R.reduce((h,v)=>{h[v.eventId]||(h[v.eventId]=[]);const C=v.outcomes.filter(k=>f.has(k.id));return C.length>0&&h[v.eventId].push({...v,outcomes:C}),h},{}),S=l($);w.forEach(h=>{if(h.id!==$.prePackCouponRows[0].eventId)return;const v=f;let C=null;for(const k of S)if([...k.requiredOutcomeIds].every(U=>v.has(U))){C=k.decimal;break}O.push({...h,combinadoTotal:C,betoffers:x[h.id]||[],couponId:$.id})})}return O}function l(w){var T;const R=[];for(const O of w.prePackCouponRows)if(O.type==="BET_BUILDER"&&((T=O.group)!=null&&T.groups)){const $=new Set;O.group.groups.forEach(f=>{var x;(x=f.outcomes)==null||x.forEach(S=>$.add(S.id))}),R.push({requiredOutcomeIds:$,decimal:O.odds.decimal})}return R}function u(w){var T;const R=new Set;for(const O of w)for(const $ of O.prePackCouponRows)$.type==="BET_BUILDER"&&((T=$.group)!=null&&T.groups)&&$.group.groups.forEach(f=>{var x;(x=f.outcomes)==null||x.forEach(S=>R.add(S.id))}),$.type==="SIMPLE"&&$.outcome&&R.add($.outcome.id);return R}async function j(){var w,R,T;try{const O=(T=(R=(w=t==null?void 0:t.group)==null?void 0:w.groups)==null?void 0:R[0])==null?void 0:T.id;if(!O){console.error("Could not extract group ID");return}const $=`https://us1.offering-api.kambicdn.com/offering/v2018/nexuspe/prepackcoupon/eventgroup/${O}.json?lang=es_PE&market=PE&client_id=200&channel_id=1&ncid=1764283566783&prePackCouponTags=CUSTOM`,x=await(await fetch($)).json();b(d(x.events,x.betOffers,x.prePackCoupons))}catch(O){console.error("loadDataEventSpecial error:",O)}}E.useEffect(()=>{t&&j()},[t]);const I=c||void 0;return e.jsx("section",{className:I,style:{width:"100%"},children:e.jsxs(F.default,{direction:"column",spacing:1.5,useFlexGap:!0,children:[e.jsxs(z,{spacing:1.5,columns:"1fr auto auto",justify:"start",children:[e.jsx(A,{title:r,iconUrl:s,size:"md"}),e.jsxs("div",{className:Nt.controls,children:[e.jsxs(z,{spacing:1,columns:"auto auto",children:[e.jsx(N,{ariaLabel:"Anterior",variant:"secondary",iconOnly:!0,leftIcon:e.jsx(q.ChevronLeftRounded,{}),onClick:g,disabled:a.isStart}),e.jsx(N,{ariaLabel:"Siguiente",variant:"secondary",iconOnly:!0,rightIcon:e.jsx(q.ChevronRightRounded,{}),onClick:y,disabled:a.isEnd})]}),e.jsx(N,{variant:"secondary",onClick:i,children:"Ver más"})]})]}),e.jsx(M,{ref:o,items:m,perPage:3.72,gap:"16px",options:{autoWidth:!0},useIndexAsKey:!0,breakpoints:{768:{perPage:1.2,gap:"12px",padding:{left:"0px",right:"0px"}}},renderItem:w=>e.jsx(ye,{event:w}),onMove:({isStart:w,isEnd:R})=>p({isStart:w,isEnd:R})})]})})}function Te({items:t,title:r="En vivo",iconUrl:s,onViewMore:n,className:c=""}){var i,d;console.log("wefwef",t);const o=E.useRef(null),[a,p]=E.useState({isStart:!0,isEnd:!1}),m=()=>{var l;(l=o.current)==null||l.prev()},b=()=>{var l;(l=o.current)==null||l.next(),console.log("items: ",t)},g=()=>{n==null||n()},y=c||void 0;return e.jsxs("section",{className:y,style:{width:"100%"},children:[e.jsxs(z,{spacing:1.5,columns:"1fr auto auto",justify:"start",children:[e.jsx(A,{title:r,iconUrl:s,size:"md"}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx(N,{ariaLabel:"Anterior",variant:"secondary",iconOnly:!0,leftIcon:e.jsx(q.ChevronLeftRounded,{}),onClick:m,disabled:a.isStart}),e.jsx(N,{ariaLabel:"Siguiente",variant:"secondary",iconOnly:!0,rightIcon:e.jsx(q.ChevronRightRounded,{}),onClick:b,disabled:a.isEnd})]}),e.jsx(N,{variant:"secondary",onClick:g,children:"Ver más"})]}),e.jsx(M,{ref:o,items:(d=(i=t==null?void 0:t.events)==null?void 0:i.filter(l=>l.event.sport==="FOOTBALL").sort((l,u)=>new Date(u.event.start).getTime()-new Date(l.event.start).getTime()))!=null?d:[],perPage:3.395,gap:"16px",options:{autoWidth:!0},breakpoints:{768:{perPage:1,gap:"8px",focus:"center",padding:{left:"16px",right:"16px"}},1024:{perPage:2.5,gap:"10px",padding:{right:"16px"}}},renderItem:l=>e.jsx(Se,{...l}),onMove:({isStart:l,isEnd:u})=>p({isStart:l,isEnd:u})})]})}const Tt="oraculo__OraculoSeccionEventoSemana-module__wrapper___eqVq-",Pt="oraculo__OraculoSeccionEventoSemana-module__container___5yFQs",Ft="oraculo__OraculoSeccionEventoSemana-module__buttonWrapper___-6IDT",V={wrapper:Tt,container:Pt,buttonWrapper:Ft};function Pe({items:t,title:r="En vivo",iconUrl:s,onViewMore:n,className:c=""}){const o=new Date;o.toISOString();const a=new Date(o);a.setDate(a.getDate()+7),a.toISOString();const p=E.useRef(null),[m,b]=E.useState({isStart:!0,isEnd:!1}),[g,y]=E.useState([]),i=()=>{n==null||n()};async function d(){try{const I=t.events.map(O=>{var $;return($=O.event)==null?void 0:$.id}),w=I.map(O=>`id=${O}`).join("&"),T=`https://us1.offering-api.kambicdn.com/offering/v2018/nexuspe/betoffer/selected/combined_layout/event/${I[0]}?${w}&lang=es_PE&market=PE`;l(T)}catch(I){console.error(I)}}async function l(I){try{const R=await(await fetch(I)).json(),T=R.events.map($=>$.event),O=R.events.flatMap($=>$.betOffers||[]);y(u(T,O))}catch(w){console.error(w)}}function u(I,w){const T=w.filter(O=>{var $;return(($=O.betOfferType)==null?void 0:$.id)===2}).reduce((O,$)=>(O[$.eventId]||(O[$.eventId]=[]),O[$.eventId].push($),O),{});return I.filter(O=>T[O.id]).map(O=>({...O,outcome:T[O.id]}))}E.useEffect(()=>{t&&t.events.length>0&&d()},[t]);const j=c||void 0;return e.jsx("section",{className:j,style:{width:"100%"},children:e.jsxs("div",{className:V.wrapper,children:[e.jsx("div",{className:V.container,children:e.jsxs(F.default,{direction:"column",spacing:1.5,useFlexGap:!0,children:[e.jsx(A,{title:"Eventos de la semana"}),e.jsx("div",{className:V.buttonWrapper,children:e.jsx(N,{variant:"secondary",size:"lg",fullWidth:!0,onClick:()=>{i()},children:"Ver más"})})]})}),e.jsx("div",{style:{minWidth:0},children:e.jsx(M,{ref:p,items:g,perPage:3.5,gap:"16px",options:{autoWidth:!0},breakpoints:{1024:{perPage:1.4,gap:"8px",focus:"center",padding:{left:"8px",right:"8px"}}},renderItem:I=>e.jsx(_e,{event:I}),onMove:({isStart:I,isEnd:w})=>b({isStart:I,isEnd:w})})})]})})}const Bt=[{desktopSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoDesktop.png",mobileSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoMisiones.png",fallbackSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoMisiones.jpg"},{desktopSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoDesktop.png",mobileSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoMisiones.png",fallbackSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoMisiones.jpg"}],Ut=[{id:1,label:"APUESTAS",icon:"https://stg-www.contodobet.com/static/img/landing/Banner/icon1.svg",onclick:()=>console.log("APUESTAS")},{id:2,label:"EXPLORAR",icon:"https://stg-www.contodobet.com/static/img/landing/Banner/icon2.svg",onclick:()=>console.log("EXPLORAR")},{id:3,label:"TOP JUEGOS",icon:"https://stg-www.contodobet.com/static/img/landing/Banner/icon3.svg",onclick:()=>console.log("TOP JUEGOS")},{id:4,label:"MISIONES",icon:"https://stg-www.contodobet.com/static/img/landing/Banner/icon4.svg",onclick:()=>console.log("MISIONES")}];function Fe({backgrounds:t=Bt,items:r=Ut}){const[s,n]=E.useState(0),c=t.length||1;return e.jsxs(P.Box,{component:"section",sx:{position:"relative",overflow:"visible",pb:{xs:7,sm:8}},children:[e.jsxs(P.Box,{sx:{position:"relative",height:{xs:300,sm:360,md:420},borderRadius:0,overflow:"hidden"},children:[e.jsx(M,{items:t,perPage:1,gap:"0px",options:{type:"loop",pagination:!1,arrows:!1,drag:!0,focus:"center"},onMove:({index:o})=>n(o),renderItem:o=>{var a;return e.jsxs(P.Box,{sx:{position:"relative",height:{xs:300,sm:360,md:420}},children:[e.jsxs(P.Box,{component:"picture",sx:{position:"absolute",inset:0,lineHeight:0},children:[e.jsx("source",{srcSet:o.desktopSrc,media:"(min-width:800px)"}),e.jsx("source",{srcSet:o.mobileSrc,media:"(max-width:799px)"}),e.jsx(P.Box,{component:"img",src:(a=o.fallbackSrc)!=null?a:o.desktopSrc,alt:"","aria-hidden":!0,loading:"lazy",sx:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})]}),e.jsx(P.Box,{sx:{position:"absolute",inset:0,pointerEvents:"none","&::before":{content:'""',position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.75) 100%)"}}})]})}}),e.jsx(P.Box,{sx:{position:"absolute",left:0,right:0,bottom:72,display:"flex",justifyContent:"center",zIndex:2},children:e.jsx(te,{total:c,active:s})})]}),e.jsx(P.Box,{sx:{position:"absolute",bottom:{xs:36,sm:38},left:"50%",transform:"translateX(-50%)",width:"90%",backgroundColor:"#363636",borderRadius:2,py:1.5,px:1,display:"flex",justifyContent:"space-around",alignItems:"center",boxShadow:"0 10px 24px rgba(0,0,0,.35)",zIndex:3},children:r.map(o=>e.jsxs(P.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",color:"#FFFFFF",minWidth:68,cursor:o.onclick?"pointer":"default"},onClick:()=>{var a;return(a=o.onclick)==null?void 0:a.call(o)},children:[o.icon&&e.jsx(P.Box,{component:"img",src:o.icon,alt:o.label||`icon-${o.id}`,sx:{width:{xs:28,md:32},height:{xs:28,md:32},mb:{xs:.5,md:0},mr:{xs:0,md:4},objectFit:"contain"}}),e.jsx(P.Typography,{sx:{fontSize:12,fontWeight:600,color:"#E0E0E0",textAlign:{xs:"center",md:"left"}},children:o.label})]},o.id))})]})}const Lt=[[{src:"https://stg-www.contodobet.com/static/img/landing/MediosPago/IBK.svg",alt:"Interbank"},{src:"https://stg-www.contodobet.com/static/img/landing/MediosPago/Yape.svg",alt:"Yape"}],[{src:"https://stg-www.contodobet.com/static/img/landing/MediosPago/tupay.svg",alt:"Tupay"},{src:"https://stg-www.contodobet.com/static/img/landing/MediosPago/monnet.svg",alt:"Monnet"},{src:"https://stg-www.contodobet.com/static/img/landing/MediosPago/niubiz.svg",alt:"Niubiz"}]];function Be({title:t="Medios de pago",rows:r=Lt}){const s=r.flat();return e.jsxs(P.Box,{component:"section","aria-labelledby":"mp-title",sx:{color:"#fff"},children:[e.jsx(P.Typography,{id:"mp-title",variant:"h6",sx:{fontWeight:800,fontSize:{xs:20,md:32},textAlign:"center",mb:1.5},children:t}),e.jsx(P.Box,{sx:{width:"288px",height:"2px",mx:"auto",mb:3,opacity:.95,filter:"blur(0.2px)",background:"linear-gradient(90deg, rgba(0,0,0,0) 0%, #1dd75b 18%, #23d46b 50%, #1dd75b 82%, rgba(0,0,0,0) 100%)"}}),e.jsx(P.Box,{sx:{display:{xs:"block",md:"none"}},children:r.map((n,c)=>e.jsx(P.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:2.5,flexWrap:"wrap",children:n.map(o=>e.jsx(Z,{...o},`${o.src}-${o.alt}`))},c))}),e.jsx(P.Box,{sx:{mt:3,display:{xs:"none",md:"grid"},gap:{xs:2.5,md:2.75},justifyItems:"center",alignItems:"center",gridTemplateColumns:{md:"repeat(auto-fit, 160px)"},justifyContent:{md:"center"}},children:s.map(n=>e.jsx(Z,{...n},`${n.src}-${n.alt}`))})]})}const zt={OraculoSeccionDestacados:we,OraculoSeccionTopJuegos:ae,OraculoSeccionCasinoEnVivo:Ce,OraculoSeccionCasino:Oe,OraculoSeccionVirtuales:$e,OraculoSeccionClubOlimpo:Re,OraculoSeccionBonoBienvenida:ke,OraculoSeccionBanners:Fe,OraculoSeccionMediosPago:Be,OraculoSeccionEventoEnVivo:Te,OraculoSeccionEventoSemana:Pe,OraculoSeccionEventoCombinadas:Ne},Wt=t=>typeof t=="function"||t&&typeof t=="object"&&"$$typeof"in t,At=t=>/^OraculoSeccion[A-Z]/.test(t),Mt=Object.fromEntries(Object.entries(zt).filter(([t,r])=>At(t)&&Wt(r)));class de extends Error{constructor(r,s,n){super(`HTTP ${r} ${n}`),this.status=r,this.url=s,this.statusText=n,this.name="HttpError"}}const Ue=({sectionsOverride:t,docId:r="home",db:s})=>{const[n,c]=E.useState([]),[o,a]=E.useState(!1),[p,m]=E.useState({}),[b,g]=E.useState({}),[y,i]=E.useState({});E.useEffect(()=>{if(t||!s)return;a(!0);const f=re.onSnapshot(re.doc(s,"landings",r),x=>{var S;try{let h=x.exists()?((S=x.data())==null?void 0:S.sections)||[]:[];h=h.slice().sort((v,C)=>{var k,B;return((k=v.order)!=null?k:0)-((B=C.order)!=null?B:0)}).map((v,C)=>({...v,order:C+1})),c(h),console.log("fetched: ",h)}catch(h){console.error("Error procesando landings/"+r,h)}finally{a(!1)}},x=>{console.error("Error escuchando landings/"+r,x),a(!1)});return()=>f()},[t,r,s]),E.useEffect(()=>{(t?t.slice():n.slice()).map(S=>S.componentKey).filter(S=>!!S).length},[t,n]);const d=async f=>{const x=(f.apiUrl||"").trim();if(!x)return;const S=f.apiMethod||"GET",h=f.apiParams||[];let v=x,C,k;if(S==="GET"){const U=new URL(x,typeof window=="undefined"?"http://localhost":window.location.origin);for(const L of h)L.key&&U.searchParams.append(L.key,L.value);v=U.toString()}else{const U=new URLSearchParams;for(const L of h)L.key&&U.append(L.key,L.value);C=U.toString(),k={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}const B=await fetch(v,{method:S,headers:k,body:C});if(!B.ok)throw new de(B.status,v,B.statusText);return B.json()},l=E.useMemo(()=>t?t.slice():n.slice(),[t,n]),u=De.default.useRef(new Set);E.useEffect(()=>{const f=l.map(x=>({s:x,url:(x.apiUrl||"").trim()})).filter(({url:x})=>!!x);if(f.length)for(const{s:x,url:S}of f){const h=`${x.id}|${S}`;u.current.has(h)||(u.current.add(h),g(v=>({...v,[x.id]:!0})),i(v=>({...v,[x.id]:""})),(async()=>{try{const v=await d(x);m(C=>({...C,[x.id]:v}))}catch(v){let C="Error desconocido";v instanceof de?C=`Error HTTP ${v.status} (${v.statusText}) en ${v.url}`:v instanceof SyntaxError?C="Respuesta no es JSON válido":v instanceof TypeError?C="Fallo de red / CORS / conexión":typeof v=="string"&&(C=v.toString()),i(k=>({...k,[x.id]:C}))}finally{g(v=>({...v,[x.id]:!1}))}})())}},[l]);const j=E.useMemo(()=>l.filter(f=>f.visible).sort((f,x)=>f.order-x.order),[l]),I=f=>Array.isArray(f)?f.map(x=>{const S={};for(const h of x.fields||[]){const v=(h.type||"string").toLowerCase();if(v==="number"){const C=String(h.value||"").trim();if(C!==""){const k=Number(C);Number.isNaN(k)||(S[h.name]=k)}}else if(v==="boolean")S[h.name]=String(h.value).toLowerCase()==="true";else if(v==="function"){const C=String(h.value||"").trim();if(C)try{const k=new Function(C);S[h.name]=k}catch(k){console.error(`❌ Error creando función en item '${h.name}':`,k)}}else S[h.name]=h.value}return S}):[],w=f=>{const x={};if(!Array.isArray(f))return x;for(const S of f){if(!S.name)continue;const h=(S.type||"string").toLowerCase();if(h==="number"){const v=String(S.value||"").trim();if(v!==""){const C=Number(v);Number.isNaN(C)||(x[S.name]=C)}}else if(h==="boolean")x[S.name]=String(S.value).toLowerCase()==="true";else if(h==="function"){const v=String(S.value||"").trim();if(v)try{const C=new Function(v);x[S.name]=C}catch(C){console.error(`❌ Error creando función en item '${S.name}':`,C)}}else x[S.name]=S.value}return x},R=(f,x,S)=>{const h=S?{...S}:{};if(x){const L=(x.variableName||"items").trim()||"items";return h[L]=x.arr||[],h}const v=f,C=Array.isArray(v),k=!C&&typeof v=="object"&&v!==null?v:void 0,B=k&&Array.isArray(k.lobby||k.items)?k.lobby||k.items:void 0,U=L=>C?v:B||L;return h.items=U(B||[]),h},T=f=>{var C;const x=!!((C=f.apiUrl)!=null&&C.trim()),S=x?p[f.id]:void 0;let h=f.props?{...f.props}:{};const v=w(f.manualScalarFields);if(["OraculoSeccionEventoEnVivo","OraculoSeccionEventoSemana","OraculoSeccionEventoCombinadas"].includes(f.componentKey))return console.log(S),{items:S,...h,...v};if(h={...h,...v},x)h=R(S,null,h);else if(f.dataMode==="manual"){const k=I(f.manualItems);h=R(null,{arr:k,variableName:f.variableName},h)}return h},O=(f,x,S)=>{const h={loading:"bg-blue-100 text-blue-800",error:"bg-red-100 text-red-800",component:"bg-yellow-100 text-yellow-800"};return e.jsx("div",{className:`mx-4 p-4 rounded ${h[x]}`,children:S},f)},$=f=>{var U;const x=f.componentKey,S=Mt[x];if(!S)return console.warn(`No hay componente registrado para "${x}"`),O(f.id,"component",`Componente "${x}" no encontrado`);const h=!!((U=f.apiUrl)!=null&&U.trim()),v=h?p[f.id]:void 0,C=h?!!b[f.id]:!1,k=h?y[f.id]:"";if(h){if(C&&!v)return O(f.id,"loading",`Cargando datos desde ${f.apiUrl}...`);if(k&&!v)return O(f.id,"error",`Error cargando ${f.apiUrl}: ${k}`)}const B=T(f);return e.jsx("div",{style:{paddingLeft:16,paddingRight:16,width:"100%",boxSizing:"border-box"},children:e.jsx(S,{...B})},f.id)};return o&&!t?e.jsx("div",{className:"text-xs text-gray-400",children:"Cargando preview..."}):!o&&!t&&n.length===0?e.jsx("div",{className:"text-xs text-gray-500",children:"Sin secciones (Firestore)"}):e.jsx(P.Container,{className:"oli-font",maxWidth:!1,disableGutters:!0,sx:{backgroundColor:"#121212",position:"relative",pb:5,pt:5,width:"100%",maxWidth:"100%",overflowX:"hidden"},children:e.jsx(P.Stack,{direction:"column",spacing:8,useFlexGap:!0,children:j.map($)})})};exports.OraculoButton=N;exports.OraculoCarousel=M;exports.OraculoCarouselDots=te;exports.OraculoClubOlimpoVisual=je;exports.OraculoEventCombinadasCard=ye;exports.OraculoEventEnVivoCard=Se;exports.OraculoEventHeader=ge;exports.OraculoEventLabel=oe;exports.OraculoEventLeague=he;exports.OraculoEventScore=ne;exports.OraculoEventSemanaCard=_e;exports.OraculoEventStatus=fe;exports.OraculoEventStatusBadge=xe;exports.OraculoEventTeamInfo=J;exports.OraculoGameCard=X;exports.OraculoGameRankCard=ve;exports.OraculoGameSlide=se;exports.OraculoGridGroup=z;exports.OraculoLiveCasinoCard=be;exports.OraculoLogoMediosPago=Z;exports.OraculoPageLandingPreview=Ue;exports.OraculoSeccionBanners=Fe;exports.OraculoSeccionBonoBienvenida=ke;exports.OraculoSeccionCasino=Oe;exports.OraculoSeccionCasinoEnVivo=Ce;exports.OraculoSeccionClubOlimpo=Re;exports.OraculoSeccionDestacados=we;exports.OraculoSeccionEventoCombinadas=Ne;exports.OraculoSeccionEventoEnVivo=Te;exports.OraculoSeccionEventoSemana=Pe;exports.OraculoSeccionMediosPago=Be;exports.OraculoSeccionTopJuegos=ae;exports.OraculoSeccionVirtuales=$e;exports.OraculoSectionTitle=A;exports.OraculoTopJuegoItem=ae;exports.OraculoWelcomeBanner=ee;exports.default=Ue;
|
|
19
|
+
`},Ne=({headline:t,headline2:r,items:n,backgroundImageUrl:a})=>{const l=t,o=r,s=qe.default("(max-width: 767px)"),p=n.length>1,m=a!=null?a:"",b=Nt(m),h=E.useRef(null),[y,i]=E.useState({isStart:!0,isEnd:!1}),[d,c]=E.useState(0);return s?e.jsxs(S.default,{component:"section",sx:{...b,textAlign:"center"},children:[(l||o)&&e.jsxs(S.default,{sx:ce,children:[l&&e.jsx(z.default,{component:"span",sx:le,children:l}),o&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(z.default,{component:"span",sx:de,children:o})]})]}),e.jsxs(S.default,{children:[e.jsx(A,{ref:h,items:n,perPage:1,gap:"12px",breakpoints:{480:{perPage:1,gap:"8px",padding:{left:"8px",right:"8px"}},768:{perPage:1,gap:"12px",padding:{left:"8px",right:"8px"}}},options:{autoWidth:!1},renderItem:u=>e.jsx(te,{...u,onButtonClick:n[0].onButtonClick}),onMove:({index:u,isStart:j,isEnd:I})=>{i({isStart:j,isEnd:I}),c(u)}}),p&&e.jsx(oe,{total:n.length,active:d,onSelect:u=>{var j;c(u),(j=h.current)==null||j.go(u)}})]})]}):e.jsx(S.default,{component:"section",sx:b,children:e.jsxs(S.default,{sx:{maxWidth:1200,mx:5,px:2,display:"grid",gridTemplateColumns:"200px auto",alignItems:"center"},children:[(l||o)&&e.jsx(S.default,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",minHeight:"100%"},children:e.jsxs(S.default,{sx:{...ce,textAlign:"left",mb:0},children:[l&&e.jsx(z.default,{component:"span",sx:le,children:l}),o&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(z.default,{component:"span",sx:de,children:o})]})]})}),e.jsx(S.default,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flexWrap:"nowrap",gap:4},children:n.map((u,j)=>e.jsx(te,{onButtonClick:u.onButtonClick,...u},j))})]})})},Re=({className:t="",fullBleed:r=!0,items:n,selectedIndex:a=0,ariaLabel:l})=>{const o=E.useRef(null),s=E.useRef(null);if(!n)return null;const p=()=>{window.location.href="https://www.olimpo.bet/conoce-club-olimpo"},m=Array.isArray(n)?n[a]:n;E.useLayoutEffect(()=>{if(!o.current||!s.current||typeof ResizeObserver=="undefined")return;const h=o.current,y=s.current,i=()=>{h.style.setProperty("--orc-co-bottomH",`${y.offsetHeight+16}px`)},d=new ResizeObserver(i);return d.observe(y),i(),()=>d.disconnect()},[]);const b=["orc-co-wrap",r?"orc-co-fullBleed":"",t].filter(Boolean).join(" ");return e.jsx("section",{ref:o,className:b,"aria-label":l||m.imgAlt||"Club Olimpo",children:e.jsx("div",{ref:s,children:e.jsx(ye,{text:m.text,onClick:p,imgAlt:m.imgAlt,imgSrcMobile:m.imgMobile,imgSrcDesktopBg:m.imgDesktopBg,imgSrcDesktopLogo:m.imgDesktopLogo})})})},Rt="oraculo__OraculoSeccionEventoCombinadas-module__controls___Zsta4",Tt={controls:Rt};function Te({items:t,title:r="Combinadas del Olimpo",iconUrl:n,onViewMore:a,className:l=""}){const o=E.useRef(null),[s,p]=E.useState({isStart:!0,isEnd:!1}),[m,b]=E.useState([]),h=()=>{var w;(w=o.current)==null||w.prev()},y=()=>{var w;(w=o.current)==null||w.next(),console.log("items: ",t)},i=()=>{a==null||a()};function d(w,N,T){const O=[];for(const $ of T){const x=u([$]),f=N.reduce((g,v)=>{g[v.eventId]||(g[v.eventId]=[]);const C=v.outcomes.filter(k=>x.has(k.id));return C.length>0&&g[v.eventId].push({...v,outcomes:C}),g},{}),_=c($);w.forEach(g=>{if(g.id!==$.prePackCouponRows[0].eventId)return;const v=x;let C=null;for(const k of _)if([...k.requiredOutcomeIds].every(B=>v.has(B))){C=k.decimal;break}O.push({...g,combinadoTotal:C,betoffers:f[g.id]||[],couponId:$.id})})}return O}function c(w){var T;const N=[];for(const O of w.prePackCouponRows)if(O.type==="BET_BUILDER"&&((T=O.group)!=null&&T.groups)){const $=new Set;O.group.groups.forEach(x=>{var f;(f=x.outcomes)==null||f.forEach(_=>$.add(_.id))}),N.push({requiredOutcomeIds:$,decimal:O.odds.decimal})}return N}function u(w){var T;const N=new Set;for(const O of w)for(const $ of O.prePackCouponRows)$.type==="BET_BUILDER"&&((T=$.group)!=null&&T.groups)&&$.group.groups.forEach(x=>{var f;(f=x.outcomes)==null||f.forEach(_=>N.add(_.id))}),$.type==="SIMPLE"&&$.outcome&&N.add($.outcome.id);return N}async function j(){var w,N,T;try{const O=(T=(N=(w=t==null?void 0:t.group)==null?void 0:w.groups)==null?void 0:N[0])==null?void 0:T.id;if(!O){console.error("Could not extract group ID");return}const $=`https://us1.offering-api.kambicdn.com/offering/v2018/nexuspe/prepackcoupon/eventgroup/${O}.json?lang=es_PE&market=PE&client_id=200&channel_id=1&ncid=1764283566783&prePackCouponTags=CUSTOM`,f=await(await fetch($)).json();b(d(f.events,f.betOffers,f.prePackCoupons))}catch(O){console.error("loadDataEventSpecial error:",O)}}E.useEffect(()=>{t&&j()},[t]);const I=l||void 0;return e.jsx("section",{className:I,style:{width:"100%"},children:e.jsxs(M.default,{direction:"column",spacing:1.5,useFlexGap:!0,children:[e.jsxs(L,{spacing:1.5,columns:"1fr auto auto",justify:"start",children:[e.jsx(W,{title:r,iconUrl:n,size:"md"}),e.jsxs("div",{className:Tt.controls,children:[e.jsxs(L,{spacing:1,columns:"auto auto",children:[e.jsx(R,{ariaLabel:"Anterior",variant:"secondary",iconOnly:!0,leftIcon:e.jsx(q.ChevronLeftRounded,{}),onClick:h,disabled:s.isStart}),e.jsx(R,{ariaLabel:"Siguiente",variant:"secondary",iconOnly:!0,rightIcon:e.jsx(q.ChevronRightRounded,{}),onClick:y,disabled:s.isEnd})]}),e.jsx(R,{variant:"secondary",onClick:i,children:"Ver más"})]})]}),e.jsx(A,{ref:o,items:m,perPage:3.72,gap:"16px",options:{autoWidth:!0},useIndexAsKey:!0,breakpoints:{768:{perPage:1.2,gap:"12px",padding:{left:"0px",right:"0px"}}},renderItem:w=>e.jsx(_e,{event:w}),onMove:({isStart:w,isEnd:N})=>p({isStart:w,isEnd:N})})]})})}function Pe({items:t,title:r="En vivo",iconUrl:n,onViewMore:a,className:l=""}){var i,d;console.log("wefwef",t);const o=E.useRef(null),[s,p]=E.useState({isStart:!0,isEnd:!1}),m=()=>{var c;(c=o.current)==null||c.prev()},b=()=>{var c;(c=o.current)==null||c.next(),console.log("items: ",t)},h=()=>{a==null||a()},y=l||void 0;return e.jsxs("section",{className:y,style:{width:"100%"},children:[e.jsxs(L,{spacing:1.5,columns:"1fr auto auto",justify:"start",children:[e.jsx(W,{title:r,iconUrl:n,size:"md"}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx(R,{ariaLabel:"Anterior",variant:"secondary",iconOnly:!0,leftIcon:e.jsx(q.ChevronLeftRounded,{}),onClick:m,disabled:s.isStart}),e.jsx(R,{ariaLabel:"Siguiente",variant:"secondary",iconOnly:!0,rightIcon:e.jsx(q.ChevronRightRounded,{}),onClick:b,disabled:s.isEnd})]}),e.jsx(R,{variant:"secondary",onClick:h,children:"Ver más"})]}),e.jsx(A,{ref:o,items:(d=(i=t==null?void 0:t.events)==null?void 0:i.filter(c=>c.event.sport==="FOOTBALL").sort((c,u)=>new Date(u.event.start).getTime()-new Date(c.event.start).getTime()))!=null?d:[],perPage:3.395,gap:"16px",options:{autoWidth:!0},breakpoints:{768:{perPage:1,gap:"8px",focus:"center",padding:{left:"16px",right:"16px"}},1024:{perPage:2.5,gap:"10px",padding:{right:"16px"}}},renderItem:c=>e.jsx(Se,{...c}),onMove:({isStart:c,isEnd:u})=>p({isStart:c,isEnd:u})})]})}const Pt="oraculo__OraculoSeccionEventoSemana-module__wrapper___eqVq-",Ft="oraculo__OraculoSeccionEventoSemana-module__container___5yFQs",Bt="oraculo__OraculoSeccionEventoSemana-module__buttonWrapper___-6IDT",Q={wrapper:Pt,container:Ft,buttonWrapper:Bt};function Fe({items:t,title:r="En vivo",iconUrl:n,onViewMore:a,className:l=""}){const o=new Date;o.toISOString();const s=new Date(o);s.setDate(s.getDate()+7),s.toISOString();const p=E.useRef(null),[m,b]=E.useState({isStart:!0,isEnd:!1}),[h,y]=E.useState([]),i=()=>{a==null||a()};async function d(){try{const I=t.events.map(O=>{var $;return($=O.event)==null?void 0:$.id}),w=I.map(O=>`id=${O}`).join("&"),T=`https://us1.offering-api.kambicdn.com/offering/v2018/nexuspe/betoffer/selected/combined_layout/event/${I[0]}?${w}&lang=es_PE&market=PE`;c(T)}catch(I){console.error(I)}}async function c(I){try{const N=await(await fetch(I)).json(),T=N.events.map($=>$.event),O=N.events.flatMap($=>$.betOffers||[]);y(u(T,O))}catch(w){console.error(w)}}function u(I,w){const T=w.filter(O=>{var $;return(($=O.betOfferType)==null?void 0:$.id)===2}).reduce((O,$)=>(O[$.eventId]||(O[$.eventId]=[]),O[$.eventId].push($),O),{});return I.filter(O=>T[O.id]).map(O=>({...O,outcome:T[O.id]}))}E.useEffect(()=>{t&&t.events.length>0&&d()},[t]);const j=l||void 0;return e.jsx("section",{className:j,style:{width:"100%"},children:e.jsxs("div",{className:Q.wrapper,children:[e.jsx("div",{className:Q.container,children:e.jsxs(M.default,{direction:"column",spacing:1.5,useFlexGap:!0,children:[e.jsx(W,{title:"Eventos de la semana"}),e.jsx("div",{className:Q.buttonWrapper,children:e.jsx(R,{variant:"secondary",size:"lg",fullWidth:!0,onClick:()=>{i()},children:"Ver más"})})]})}),e.jsx("div",{style:{minWidth:0},children:e.jsx(A,{ref:p,items:h,perPage:3.5,gap:"16px",options:{autoWidth:!0},breakpoints:{1024:{perPage:1.4,gap:"8px",focus:"center",padding:{left:"8px",right:"8px"}}},renderItem:I=>e.jsx(we,{event:I}),onMove:({isStart:I,isEnd:w})=>b({isStart:I,isEnd:w})})})]})})}const Mt=[{desktopSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoDesktop.png",mobileSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoMisiones.png",fallbackSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoMisiones.jpg"},{desktopSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoDesktop.png",mobileSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoMisiones.png",fallbackSrc:"https://stg-www.contodobet.com/static/img/landing/Banner/FondoMisiones.jpg"}],Z=t=>`${window.location.origin}${t}`,Ut=[{id:1,label:"APUESTAS",icon:"https://stg-www.contodobet.com/static/img/landing/Banner/icon1.svg",onclick:()=>Z("https://www.olimpo.bet/#home")},{id:2,label:"EXPLORAR",icon:"https://stg-www.contodobet.com/static/img/landing/Banner/icon2.svg",onclick:()=>console.log("EXPLORAR")},{id:3,label:"TOP JUEGOS",icon:"https://stg-www.contodobet.com/static/img/landing/Banner/icon3.svg",onclick:()=>Z("https://www.olimpo.bet/casino")},{id:4,label:"MISIONES",icon:"https://stg-www.contodobet.com/static/img/landing/Banner/icon4.svg",onclick:()=>Z("https://www.olimpo.bet/misiones")}];function Be({backgrounds:t=Mt,items:r=Ut}){const[n,a]=E.useState(0),l=t.length||1;return e.jsxs(P.Box,{component:"section",sx:{position:"relative",overflow:"visible"},children:[e.jsxs(P.Box,{sx:{position:"relative",height:{xs:300,sm:360,md:420},borderRadius:0,overflow:"hidden"},children:[e.jsx(A,{items:t,perPage:1,gap:"0px",options:{type:"loop",pagination:!1,arrows:!1,drag:!0,focus:"center"},onMove:({index:o})=>a(o),renderItem:o=>{var s;return e.jsxs(P.Box,{sx:{position:"relative",height:{xs:300,sm:360,md:420}},children:[e.jsxs(P.Box,{component:"picture",sx:{position:"absolute",inset:0,lineHeight:0},children:[e.jsx("source",{srcSet:o.desktopSrc,media:"(min-width:800px)"}),e.jsx("source",{srcSet:o.mobileSrc,media:"(max-width:799px)"}),e.jsx(P.Box,{component:"img",src:(s=o.fallbackSrc)!=null?s:o.desktopSrc,alt:"","aria-hidden":!0,loading:"lazy",sx:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})]}),e.jsx(P.Box,{sx:{position:"absolute",inset:0,pointerEvents:"none","&::before":{content:'""',position:"absolute",left:0,right:0,bottom:0,top:"40%",background:"linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(18,18,18,0.85) 80%, #121212 100%)"}}})]})}}),e.jsx(P.Box,{sx:{position:"absolute",left:0,right:0,bottom:72,display:"flex",justifyContent:"center",zIndex:2},children:e.jsx(oe,{total:l,active:n})})]}),e.jsx(P.Box,{sx:{position:"absolute",bottom:{xs:10,sm:10},left:"50%",transform:"translateX(-50%)",width:{xs:"92%",sm:"88%",md:"80%"},maxWidth:900,backgroundColor:"#363636",borderRadius:2,py:{xs:.8,md:1.2},px:{xs:1.5,md:2},display:"flex",justifyContent:"space-around",alignItems:"center",boxShadow:"0 10px 24px rgba(0,0,0,.35)",zIndex:3},children:r.map(o=>e.jsxs(P.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:"center",gap:{xs:.5,md:1},color:"#FFFFFF",minWidth:0,cursor:o.onclick?"pointer":"default",whiteSpace:"nowrap"},onClick:()=>{var s;return(s=o.onclick)==null?void 0:s.call(o)},children:[o.icon&&e.jsx(P.Box,{component:"img",src:o.icon,alt:o.label||`icon-${o.id}`,sx:{width:{xs:20,sm:22,md:24},height:{xs:20,sm:22,md:24},objectFit:"contain"}}),e.jsx(P.Typography,{sx:{fontSize:{xs:10,sm:11,md:12},fontWeight:600,color:"#E0E0E0",textAlign:"center"},children:o.label})]},o.id))})]})}const Lt=[[{src:"https://stg-www.contodobet.com/static/img/landing/MediosPago/IBK.svg",alt:"Interbank"},{src:"https://stg-www.contodobet.com/static/img/landing/MediosPago/Yape.svg",alt:"Yape"}],[{src:"https://stg-www.contodobet.com/static/img/landing/MediosPago/tupay.svg",alt:"Tupay"},{src:"https://stg-www.contodobet.com/static/img/landing/MediosPago/monnet.svg",alt:"Monnet"},{src:"https://stg-www.contodobet.com/static/img/landing/MediosPago/niubiz.svg",alt:"Niubiz"}]];function Me({title:t="Medios de pago",rows:r=Lt}){const n=r.flat();return e.jsxs(P.Box,{component:"section","aria-labelledby":"mp-title",sx:{color:"#fff"},children:[e.jsx(P.Typography,{id:"mp-title",variant:"h6",sx:{fontWeight:800,fontSize:{xs:20,md:32},textAlign:"center",mb:1.5},children:t}),e.jsx(P.Box,{sx:{width:"288px",height:"2px",mx:"auto",mb:3,opacity:.95,filter:"blur(0.2px)",background:"linear-gradient(90deg, rgba(0,0,0,0) 0%, #1dd75b 18%, #23d46b 50%, #1dd75b 82%, rgba(0,0,0,0) 100%)"}}),e.jsx(P.Box,{sx:{display:{xs:"block",md:"none"}},children:r.map((a,l)=>e.jsx(P.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:2.5,flexWrap:"wrap",children:a.map(o=>e.jsx(ee,{...o},`${o.src}-${o.alt}`))},l))}),e.jsx(P.Box,{sx:{mt:3,display:{xs:"none",md:"grid"},gap:{xs:2.5,md:2.75},justifyItems:"center",alignItems:"center",gridTemplateColumns:{md:"repeat(auto-fit, 160px)"},justifyContent:{md:"center"}},children:n.map(a=>e.jsx(ee,{...a},`${a.src}-${a.alt}`))})]})}const zt={OraculoSeccionDestacados:Ce,OraculoSeccionTopJuegos:re,OraculoSeccionCasinoEnVivo:Ee,OraculoSeccionCasino:Ie,OraculoSeccionVirtuales:ke,OraculoSeccionClubOlimpo:Re,OraculoSeccionBonoBienvenida:Ne,OraculoSeccionBanners:Be,OraculoSeccionMediosPago:Me,OraculoSeccionEventoEnVivo:Pe,OraculoSeccionEventoSemana:Fe,OraculoSeccionEventoCombinadas:Te},Wt=t=>typeof t=="function"||t&&typeof t=="object"&&"$$typeof"in t,At=t=>/^OraculoSeccion[A-Z]/.test(t),Gt=Object.fromEntries(Object.entries(zt).filter(([t,r])=>At(t)&&Wt(r)));class ue extends Error{constructor(r,n,a){super(`HTTP ${r} ${a}`),this.status=r,this.url=n,this.statusText=a,this.name="HttpError"}}const Ue=({sectionsOverride:t,docId:r="home",db:n})=>{const[a,l]=E.useState([]),[o,s]=E.useState(!1),[p,m]=E.useState({}),[b,h]=E.useState({}),[y,i]=E.useState({});E.useEffect(()=>{if(t||!n)return;s(!0);const x=ie.onSnapshot(ie.doc(n,"landings",r),f=>{var _;try{let g=f.exists()?((_=f.data())==null?void 0:_.sections)||[]:[];g=g.slice().sort((v,C)=>{var k,F;return((k=v.order)!=null?k:0)-((F=C.order)!=null?F:0)}).map((v,C)=>({...v,order:C+1})),l(g),console.log("fetched: ",g)}catch(g){console.error("Error procesando landings/"+r,g)}finally{s(!1)}},f=>{console.error("Error escuchando landings/"+r,f),s(!1)});return()=>x()},[t,r,n]),E.useEffect(()=>{(t?t.slice():a.slice()).map(_=>_.componentKey).filter(_=>!!_).length},[t,a]);const d=async x=>{const f=(x.apiUrl||"").trim();if(!f)return;const _=x.apiMethod||"GET",g=x.apiParams||[];let v=f,C,k;if(_==="GET"){const B=new URL(f,typeof window=="undefined"?"http://localhost":window.location.origin);for(const U of g)U.key&&B.searchParams.append(U.key,U.value);v=B.toString()}else{const B=new URLSearchParams;for(const U of g)U.key&&B.append(U.key,U.value);C=B.toString(),k={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}const F=await fetch(v,{method:_,headers:k,body:C});if(!F.ok)throw new ue(F.status,v,F.statusText);return F.json()},c=E.useMemo(()=>t?t.slice():a.slice(),[t,a]),u=He.default.useRef(new Set);E.useEffect(()=>{const x=c.map(f=>({s:f,url:(f.apiUrl||"").trim()})).filter(({url:f})=>!!f);if(x.length)for(const{s:f,url:_}of x){const g=`${f.id}|${_}`;u.current.has(g)||(u.current.add(g),h(v=>({...v,[f.id]:!0})),i(v=>({...v,[f.id]:""})),(async()=>{try{const v=await d(f);m(C=>({...C,[f.id]:v}))}catch(v){let C="Error desconocido";v instanceof ue?C=`Error HTTP ${v.status} (${v.statusText}) en ${v.url}`:v instanceof SyntaxError?C="Respuesta no es JSON válido":v instanceof TypeError?C="Fallo de red / CORS / conexión":typeof v=="string"&&(C=v.toString()),i(k=>({...k,[f.id]:C}))}finally{h(v=>({...v,[f.id]:!1}))}})())}},[c]);const j=E.useMemo(()=>c.filter(x=>x.visible).sort((x,f)=>x.order-f.order),[c]),I=x=>Array.isArray(x)?x.map(f=>{const _={};for(const g of f.fields||[]){const v=(g.type||"string").toLowerCase();if(v==="number"){const C=String(g.value||"").trim();if(C!==""){const k=Number(C);Number.isNaN(k)||(_[g.name]=k)}}else if(v==="boolean")_[g.name]=String(g.value).toLowerCase()==="true";else if(v==="function"){const C=String(g.value||"").trim();if(C)try{const k=new Function(C);_[g.name]=k}catch(k){console.error(`❌ Error creando función en item '${g.name}':`,k)}}else _[g.name]=g.value}return _}):[],w=x=>{const f={};if(!Array.isArray(x))return f;for(const _ of x){if(!_.name)continue;const g=(_.type||"string").toLowerCase();if(g==="number"){const v=String(_.value||"").trim();if(v!==""){const C=Number(v);Number.isNaN(C)||(f[_.name]=C)}}else if(g==="boolean")f[_.name]=String(_.value).toLowerCase()==="true";else if(g==="function"){const v=String(_.value||"").trim();if(v)try{const C=new Function(v);f[_.name]=C}catch(C){console.error(`❌ Error creando función en item '${_.name}':`,C)}}else f[_.name]=_.value}return f},N=(x,f,_)=>{const g=_?{..._}:{};if(f){const U=(f.variableName||"items").trim()||"items";return g[U]=f.arr||[],g}const v=x,C=Array.isArray(v),k=!C&&typeof v=="object"&&v!==null?v:void 0,F=k&&Array.isArray(k.lobby||k.items)?k.lobby||k.items:void 0,B=U=>C?v:F||U;return g.items=B(F||[]),g},T=x=>{var C;const f=!!((C=x.apiUrl)!=null&&C.trim()),_=f?p[x.id]:void 0;let g=x.props?{...x.props}:{};const v=w(x.manualScalarFields);if(["OraculoSeccionEventoEnVivo","OraculoSeccionEventoSemana","OraculoSeccionEventoCombinadas"].includes(x.componentKey))return console.log(_),{items:_,...g,...v};if(g={...g,...v},f)g=N(_,null,g);else if(x.dataMode==="manual"){const k=I(x.manualItems);if(g=N(null,{arr:k,variableName:x.variableName},g),x.variableName2&&x.manualItems2){const F=I(x.manualItems2),B=(x.variableName2||"items2").trim()||"items2";g[B]=F}}return g},O=(x,f,_)=>{const g={loading:"bg-blue-100 text-blue-800",error:"bg-red-100 text-red-800",component:"bg-yellow-100 text-yellow-800"};return e.jsx("div",{className:`mx-4 p-4 rounded ${g[f]}`,children:_},x)},$=x=>{var B;const f=x.componentKey,_=Gt[f];if(!_)return console.warn(`No hay componente registrado para "${f}"`),O(x.id,"component",`Componente "${f}" no encontrado`);const g=!!((B=x.apiUrl)!=null&&B.trim()),v=g?p[x.id]:void 0,C=g?!!b[x.id]:!1,k=g?y[x.id]:"";if(g){if(C&&!v)return O(x.id,"loading",`Cargando datos desde ${x.apiUrl}...`);if(k&&!v)return O(x.id,"error",`Error cargando ${x.apiUrl}: ${k}`)}const F=T(x);return e.jsx("div",{style:{paddingLeft:16,paddingRight:16,width:"100%",boxSizing:"border-box"},children:e.jsx(_,{...F})},x.id)};return o&&!t?e.jsx("div",{className:"text-xs text-gray-400",children:"Cargando preview..."}):!o&&!t&&a.length===0?e.jsx("div",{className:"text-xs text-gray-500",children:"Sin secciones (Firestore)"}):e.jsx(P.Container,{className:"oli-font",maxWidth:!1,disableGutters:!0,sx:{backgroundColor:"#121212",position:"relative",pb:5,pt:5,width:"100%",maxWidth:"100%",overflowX:"hidden"},children:e.jsx(P.Stack,{direction:"column",spacing:8,useFlexGap:!0,children:j.map($)})})};exports.OraculoButton=R;exports.OraculoCarousel=A;exports.OraculoCarouselDots=oe;exports.OraculoClubOlimpoVisual=ye;exports.OraculoEventCombinadasCard=_e;exports.OraculoEventEnVivoCard=Se;exports.OraculoEventHeader=he;exports.OraculoEventLabel=ne;exports.OraculoEventLeague=ve;exports.OraculoEventScore=se;exports.OraculoEventSemanaCard=we;exports.OraculoEventStatus=ge;exports.OraculoEventStatusBadge=fe;exports.OraculoEventTeamInfo=X;exports.OraculoGameCard=V;exports.OraculoGameRankCard=be;exports.OraculoGameSlide=ae;exports.OraculoGridGroup=L;exports.OraculoLiveCasinoCard=je;exports.OraculoLogoMediosPago=ee;exports.OraculoPageLandingPreview=Ue;exports.OraculoSeccionBanners=Be;exports.OraculoSeccionBonoBienvenida=Ne;exports.OraculoSeccionCasino=Ie;exports.OraculoSeccionCasinoEnVivo=Ee;exports.OraculoSeccionClubOlimpo=Re;exports.OraculoSeccionDestacados=Ce;exports.OraculoSeccionEventoCombinadas=Te;exports.OraculoSeccionEventoEnVivo=Pe;exports.OraculoSeccionEventoSemana=Fe;exports.OraculoSeccionMediosPago=Me;exports.OraculoSeccionTopJuegos=re;exports.OraculoSeccionVirtuales=ke;exports.OraculoSectionTitle=W;exports.OraculoTopJuegoItem=re;exports.OraculoWelcomeBanner=te;exports.default=Ue;
|
|
20
20
|
//# sourceMappingURL=index.cjs.js.map
|