1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7214],{56576:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/competitions",function(){return t(61275)}])},61275:function(e,n,t){"use strict";t.r(n);var i=t(67862),l=t(52322),r=t(94049),o=t(18549),s=t(24240),a=t(23654),c=t(44781),d=t(76385),x=t(40489),p=t(97729),u=t.n(p),m=t(2784),h=t(59889),f=t(80835),g=t(58497);function v(){let e=(0,i._)(["\n padding: 12px;\n\n \n\n .label-text {\n color: #828282;\n font-size: 18px;\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n }\n\n .value-text {\n color: #fff;\n font-size: 32px;\n font-style: normal;\n font-weight: 500;\n line-height: normal;\n }\n\n .sub-header {\n font-size: 1.5rem;\n font-style: normal;\n font-weight: 500;\n line-height: normal;\n }\n"]);return v=function(){return e},e}function j(){let e=(0,i._)(["\n display: flex;\n flex-direction: column;\n gap: 24px;\n \n\n .year-wrapper {\n display: flex;\n padding: 12px 24px;\n align-items: center;\n gap: 10px;\n cursor: pointer;\n\n &.selected {\n background: rgba(255, 255, 255, 0.05);\n border-radius: 12px;\n\n .year-text {\n color: #fff;\n }\n }\n\n :hover {\n background: rgba(255, 255, 255, 0.05);\n border-radius: 12px;\n }\n\n .year-text {\n color: #a7a7a7;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: normal;\n }\n }\n"]);return j=function(){return e},e}(0,c.ZP)(a.Z)(v());let w=(0,c.ZP)("div")(j());n.default=()=>{let[e,n]=(0,m.useState)(null),[t,i]=(0,m.useState)(!1),[a,c]=(0,m.useState)([]),[p,v]=(0,m.useState)([]),[j,y]=(0,m.useState)([]),{width:b}=(0,o.iP)(),Z=async()=>{(0,h.j)({method:"POST",secure:!0,url:"getCompetitions/"},t=>{if(null==t?void 0:t.ok){var i,l;let r=t.ok;console.log("DATA",r),c(null!==(i=r.upcoming_competitions)&&void 0!==i?i:[]),v(null!==(l=r.year_competitions)&&void 0!==l?l:[]);let o=Array.from(new Set(r.year_competitions.map(e=>new Date(e.end_date).getFullYear()))).sort((e,n)=>n-e);y(o),null===e&&o.length>0&&n(o[0])}})},N=e=>{n(e),i(!1)};m.useEffect(()=>{t||(Z(),i(!0))},[t]);let _=p.filter(n=>new Date(n.end_date).getFullYear()===e);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(u(),{children:[(0,l.jsx)("title",{children:"Competitions | ".concat(r.Wg.firm_name)}),(0,l.jsx)("meta",{name:"description",content:"Join trading competitions on ".concat(r.Wg.firm_name,". Compete with other traders and win prizes!")}),(0,l.jsx)("link",{rel:"canonical",href:(0,g.Z)("/competitions")})]}),(0,l.jsxs)(w,{className:"max-w-7xl xxxl:max-w-screen-2xl ml-0",children:[(0,l.jsxs)(s.Z,{sx:{display:"flex",flexDirection:"column",mb:4},children:[(0,l.jsx)(s.Z,{className:"flex items-center mb-6",children:(0,l.jsx)(d.Z,{variant:"h4",component:"h1",sx:{fontWeight:500},children:"Competitions"})}),(0,l.jsxs)(d.Z,{sx:{fontSize:"16px"},variant:"caption",children:["Join our tournaments to win real prizes, hone your skills, and compete against other traders. ",(0,l.jsx)("br",{}),"New competitions are added regularly, don't miss out!"]})]}),a.length>0&&(0,l.jsx)(s.Z,{sx:{display:"flex",flexDirection:"column"},children:(0,l.jsx)(d.Z,{className:"sub-header",children:"Current"})}),(0,l.jsx)("div",{className:(0,x.Z)("grid gap-4",b>668?"grid-cols-2":"grid-cols-1"),children:a.map((e,n)=>(0,l.jsx)(f.Z,{competition:e,dimensions:b},n))}),(0,l.jsx)(s.Z,{sx:{display:"flex",flexDirection:"column"},children:(0,l.jsx)(d.Z,{className:"sub-header",children:"Finished"})}),(0,l.jsx)("div",{className:"flex items-center gap-2",children:j&&j.map(n=>(0,l.jsx)("div",{className:"year-wrapper ".concat(e===n?"selected":""),onClick:()=>N(n),children:(0,l.jsx)(d.Z,{className:"year-text",children:n})},n))}),(0,l.jsxs)("div",{className:(0,x.Z)("grid gap-4",b>568?b>980?"grid-cols-3":"grid-cols-2":"grid-cols-1"),children:[null==_?void 0:_.map((e,n)=>(0,l.jsx)(f.Z,{competition:e,dimensions:b},n)),(null==_?void 0:_.length)===0&&(0,l.jsx)(d.Z,{sx:{ml:1,mt:3},variant:"caption",children:"Competitions will display here once they have ended."})]})]})]})}},38145:function(e,n,t){"use strict";t.d(n,{_:function(){return i},g:function(){return l}});let i=(e,n)=>({fontSize:"calc(".concat(e,"px / ").concat(n,")")}),l=function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1.2;return{lineHeight:"".concat(e/n*t,"px")}}},80835:function(e,n,t){"use strict";var i=t(67862),l=t(52322),r=t(41440),o=t(94049),s=t(87724),a=t(23654),c=t(44781),d=t(76385),x=t(40489),p=t(36234),u=t(2784),m=t(38145),h=t(70700),f=t(84484);function g(){let e=(0,i._)(["\n .rules-btn {\n display: flex;\n height: 58px;\n padding: 0px 32px;\n justify-content: center;\n align-items: center;\n gap: 8px;\n flex: 1 0 0;\n border-radius: 16px;\n background: rgba(255, 255, 255, 0.05);\n white-space: nowrap;\n text-transform: capitalize;\n\n :hover {\n background: rgba(255, 255, 255, 0.1);\n }\n }\n\n .register-btn {\n display: flex;\n height: 58px;\n padding: 0px 32px;\n justify-content: center;\n align-items: center;\n gap: 8px;\n flex: 1 0 0;\n text-transform: capitalize;\n }\n\n .countdown-wrapper {\n display: flex;\n padding: 12px 16px;\n justify-content: center;\n align-items: flex-start;\n gap: 8px;\n align-self: stretch;\n border-radius: 12px;\n background: rgba(255, 255, 255, 0.05);\n width: 100%;\n\n > div {\n :not(:last-child) {\n ::after {\n content: ':';\n color: #828282;\n font-size: 14px;\n font-weight: 400;\n position: absolute;\n right: -5px;\n top: 50%;\n transform: translateY(-50%);\n }\n }\n }\n\n .countdown-item {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 4px;\n position: relative;\n width: 100%;\n height: 100%;\n padding: 0px 8px;\n white-space: nowrap;\n\n .countdown-item-value {\n min-width: 33px;\n }\n }\n }\n\n .month-text {\n color: rgba(255, 255, 255, 0.1);\n }\n"]);return g=function(){return e},e}let v={Active:{color:"success",label:"Active"},Ended:{color:"secondary",label:"Ended"},Upcoming:{color:"warning",label:"Upcoming"}},j=(0,c.ZP)(a.Z)(g());n.Z=e=>{let{admin:n=!1,competition:t,handleEditClick:i,dimensions:a}=e,{end_date:c,id:g,name:w,participants_count:y,prize_description:b,start_date:Z}=t,{user:N}=(0,s.aF)(),_=(null==N?void 0:N.role)==="staff",k=Date.now()>p.ou.fromISO(c).toMillis(),S=Date.now()<p.ou.fromISO(Z).toMillis(),z=k?"Ended":S?"Upcoming":"Active",C=k?null:S?Z:c,[E,O]=u.useState(0),[D,F]=u.useState(0),[P,A]=u.useState(0),[I,T]=u.useState(0);u.useEffect(()=>{let e=()=>
1{let e=p.ou.now().setZone("America/New_York"),n=C?p.ou.fromISO(C).setZone("America/New_York"):null;if(!n)return;let t=n.diff(e,["days","hours","minutes","seconds"]);O(t.days),F(t.hours),A(t.minutes),T(Math.floor(t.seconds))};e();let n=setInterval(()=>{e()},1e3);return()=>clearInterval(n)},[C]);let J="/competitions/".concat(null==t?void 0:t.id);return(0,l.jsxs)(j,{isStaff:_,className:(0,x.Z)("flex w-full p-8 xxxl:max-w-max",a>(_?1050:1150)?"gap-4 items-center flex-row":"flex-col gap-6"),children:[(0,l.jsx)("div",{className:(0,x.Z)("mx-auto flex flex-col justify-end items-start rounded-full relative overflow-hidden",a>1300?"w-[140px] min-w-[140px] h-[140px]":a>(_?1050:1150)?"w-[92px] min-w-[92px] h-[92px]":"w-[140px] min-w-[140px] h-[140px]","px-4 pt-0 pb-0"),style:{background:"linear-gradient(90deg, #3a82f7 0%, rgba(58, 130, 247, 0) 100%), rgba(255, 255, 255, 0.1)"},children:(0,l.jsx)(d.Z,{className:"month-text text-right font-lexend font-medium leading-none absolute right-5 xl:right-10 xl:-bottom-8",style:a>1300?{...(0,m._)(a,12)}:{fontSize:"5rem"},children:p.ou.fromFormat(c.split("T")[0],"yyyy-MM-dd").toFormat("MM")})}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 justify-between xxxl:h-full",children:[(0,l.jsx)("div",{className:"flex",children:(0,l.jsx)(r.XN,{className:"flex",color:v[z].color,label:v[z].label,size:"small",skin:"light"})}),(0,l.jsx)(d.Z,{color:"text.primary",variant:"body1",children:(0,o._p)(w)}),(0,l.jsx)(d.Z,{color:"text.secondary",variant:"body2",children:b}),(0,l.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,l.jsx)(r.JO,{color:"#7e8990",icon:"heroicons:users"}),(0,l.jsxs)(d.Z,{color:"text.primary",variant:"body2",children:[(0,o.b1)(y)," contestants"]})]})]}),k?(0,l.jsx)("div",{className:"flex flex-col items-start justify-center",children:(0,l.jsx)("div",{className:"grid grid-cols-1 gap-2",children:(0,l.jsx)(r.OQ,{className:"register-btn",color:"primary",sx:{border:"none !important"},href:J,variant:"outlined",children:"View"})})}):(0,l.jsxs)("div",{className:"flex flex-col gap-2 justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[(0,l.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,l.jsx)(r.JO,{color:"#7e8990",icon:"heroicons:calendar"}),(0,l.jsxs)(d.Z,{variant:"body2",children:[S?"Start":"End"," date"]}),(0,l.jsx)(d.Z,{color:"text.primary",variant:"body2",children:p.ou.fromISO(S?Z:c).toFormat("dd LLLL")})]}),(0,l.jsxs)("div",{className:"countdown-wrapper",children:[(0,l.jsx)("div",{className:"countdown-item",children:(0,l.jsxs)(d.Z,{className:"countdown-item-value",children:[(0,o.vX)(E)," d"]})}),(0,l.jsx)("div",{className:"countdown-item",children:(0,l.jsxs)(d.Z,{className:"countdown-item-value",children:[(0,o.vX)(D)," h"]})}),(0,l.jsx)("div",{className:"countdown-item",children:(0,l.jsxs)(d.Z,{className:"countdown-item-value",children:[(0,o.vX)(P)," m"]})}),(0,l.jsx)("div",{className:"countdown-item",children:(0,l.jsxs)(d.Z,{className:"countdown-item-value",children:[(0,o.vX)(I)," s"]})})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,l.jsx)(f.Z,{admin:n,competition:t,handleEditClick:i}),(0,l.jsx)(h.Z,{admin:n,competition:t})]})]})]})}},70700:function(e,n,t){"use strict";t.d(n,{S:function(){return g}});var i=t(67862),l=t(52322),r=t(41440),o=t(94049),s=t(87724),a=t(94668),c=t(44258),d=t(3),x=t(44781),p=t(76385),u=t(2784),m=t(61646);function h(){let e=(0,i._)(["\n display: flex;\n height: 58px;\n padding: 0px 32px;\n justify-content: center;\n align-items: center;\n gap: 8px;\n flex: 1 0 0;\n text-transform: capitalize;\n"]);return h=function(){return e},e}let f=e=>{let{rule:n}=e;return(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(r.JO,{color:"#D8AE5E",icon:"heroicons:check"}),(0,l.jsx)(p.Z,{color:"text.primary",variant:"body2",children:n})]})};n.Z=e=>{var n;let{admin:t=!1,competition:i,onCompPage:x=!1}=e,[h,v]=u.useState(!1),{trackCheckoutEvent:j}=(0,s.Kw)(),w=e=>{j("click",{plan_id:null==i?void 0:i.competition_plan,competition_id:null==i?void 0:i.id,step:"agree_to_rules"}),setTimeout(()=>{window.location.href=e},500)},y=()=>{v(!1)},b="/competitions/".concat(null==i?void 0:i.id),Z="/challenge?id=".concat(null==i?void 0:i.competition_plan,"&platform=Tradovate&competition=").concat(null==i?void 0:i.id),N=null==i?void 0:i.reg_open_date,_=!N||Date.now()>new Date(N).getTime();return(0,l.jsxs)(l.Fragment,{children:[(t||(null==i?void 0:i.registered))&&(0,l.jsx)(g,{className:"register-btn !border-none",color:"primary",endIcon:x?(0,l.jsx)(r.JO,{icon:"heroicons:check"}):null,href:b,variant:"outlined",children:x?"Registered":"View"}),!t&&!(null==i?void 0:i.registered)&&_&&(0,l.jsx)(g,{className:"register-btn",color:"primary",onClick:()=>{j("click",{plan_id:null==i?void 0:i.competition_plan,competition_id:null==i?void 0:i.id,step:"initiate_register"}),v(!0)},variant:"outlined",children:"Register"}
1),!t&&!(null==i?void 0:i.registered)&&!_&&(0,l.jsx)(l.Fragment,{children:x?(0,l.jsxs)(g,{className:"register-btn",color:"primary",variant:"outlined",children:["Registration Opens ",N?new Date(N).toLocaleDateString():""]}):(0,l.jsx)(g,{className:"register-btn",color:"primary",href:b,variant:"outlined",children:"View"})}),(0,l.jsxs)(r.Vq,{fullWidth:!0,maxWidth:"sm",onClose:y,open:h,children:[(0,l.jsxs)(a.Z,{className:"w-full",sx:{pb:{sm:12.5,xs:5},pl:{sm:11,xs:4},position:"relative",pr:{sm:12,xs:5},pt:{sm:12.5,xs:8}},children:[(0,l.jsx)(c.Z,{onClick:y,size:"small",sx:{position:"absolute",right:"1rem",top:"1rem"},children:(0,l.jsx)(r.JO,{icon:"mdi:close"})}),(0,l.jsxs)(p.Z,{variant:"h6",children:["Register for ",(0,o._p)(null==i?void 0:i.name)]}),(0,l.jsx)(p.Z,{variant:"caption",children:'In order to participate in the competition, you must agree to the rules. Please read the following rules carefully and click "I agree" to continue.'}),(0,l.jsx)("div",{className:"flex flex-col gap-2 mt-4",children:null==i?void 0:null===(n=i.rules)||void 0===n?void 0:n.map((e,n)=>(0,l.jsx)(f,{rule:e},n))})]}),(0,l.jsx)(d.Z,{children:(0,l.jsx)(m.Z,{color:"primary",onClick:()=>{w(Z)},variant:"contained",children:"I agree, Continue"})})]})]})};let g=(0,x.ZP)(m.Z)(h())},84484:function(e,n,t){"use strict";var i=t(67862),l=t(52322),r=t(41440),o=t(94049),s=t(87724),a=t(94668),c=t(44781),d=t(76385),x=t(2784),p=t(539);function u(){let e=(0,i._)(["\n .rules-btn {\n display: flex;\n height: 58px;\n padding: 0px 32px;\n justify-content: center;\n align-items: center;\n gap: 8px;\n flex: 1 0 0;\n border-radius: 16px;\n background: rgba(255, 255, 255, 0.05);\n white-space: nowrap;\n text-transform: capitalize;\n\n :hover {\n background: rgba(255, 255, 255, 0.1);\n }\n }\n"]);return u=function(){return e},e}let m=e=>{let{rule:n}=e;return(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(r.JO,{color:"#D8AE5E",icon:"heroicons:check"}),(0,l.jsx)(d.Z,{color:"text.primary",variant:"body2",children:n})]})};n.Z=e=>{var n;let{admin:t=!1,competition:i,handleEditClick:r}=e,[c,u]=x.useState(!1),{trackCheckoutEvent:f}=(0,s.Kw)(),g=()=>{f("click",{plan_id:null==i?void 0:i.competition_plan,competition_id:null==i?void 0:i.id,step:"rules"}),u(!0)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(h,{className:"rules-btn",onClick:t?()=>{r&&r(i)}:()=>g(),variant:"contained",children:(0,l.jsx)(d.Z,{color:"primary",variant:"caption",children:t?"Edit":"View rules"})}),(0,l.jsx)(p.v,{onClose:()=>{u(!1)},open:c,title:"Rules for ".concat((0,o._p)(null==i?void 0:i.name)),children:(0,l.jsxs)(a.Z,{className:"w-full",children:[(0,l.jsx)(d.Z,{variant:"caption",children:"The following rules apply to the competition. Please read them carefully before registering."}),(0,l.jsx)("div",{className:"flex flex-col gap-2 mt-4",children:null==i?void 0:null===(n=i.rules)||void 0===n?void 0:n.map((e,n)=>(0,l.jsx)(m,{rule:e},n))})]})})]})};let h=(0,c.ZP)(r.zx)(u())}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=56576)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.