1import{j as e,r as m,R as U,e as q}from"./components-5FRlAwVN.js";import{A as S,B as v,g as z,c as M,h as w,u as se,F as te,e as le,f as D,C as Z,R as ne,n as re,m as oe}from"./FormBuilder-iq3ihBX7.js";import{t as T,aC as G,S as k,B as V,u as L,c as ce,aD as W,g as ie}from"./constants-BFwIr2YJ.js";import{S as ae,u as K,$ as de,h as F,K as me,M as xe,N as he,H as ue,F as pe}from"./Header-CLeW4wUd.js";import{L as fe}from"./Loading-C-Zq5orZ.js";import{c as be,u as ge}from"./data-BruIVX5J.js";import{k as C,D as je,n as ve,u as we,d as Ne}from"./index.esm-0H8z1t3D.js";import{g as ye}from"./metatag-DVJ6bIwf.js";import{P as Bs}from"./_main-DtqwUkdC.js";import"./gsap-ByPAgKVh.js";import"./_flatRest-CHuGhrKI.js";import"./frame-C4Zmg7kX.js";import"./PageNotFound-Bga2focV.js";const Se=({data:t})=>e.jsxs("div",{className:"block lg:flex",children:[e.jsx("div",{className:"mb-8 w-full lg:mb-0 lg:w-[30%]",children:e.jsx("h4",{className:"m-0 text-subtitle font-bold text-black-300",children:t==null?void 0:t.title})}),e.jsxs("div",{className:"w-full lg:flex lg:w-[70%] lg:pl-8",children:[e.jsx("div",{className:"mb-2.5 pr-12 lg:mb-0",children:e.jsx(S,{className:"text-caption text-black-300",content:t==null?void 0:t.description})}),e.jsx("div",{className:"flex items-center",children:e.jsx(v,{className:"whitespace-nowrap",color:"red",size:"small",children:t==null?void 0:t.btnText})})]})]}),ke=t=>m.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},m.createElement("path",{d:"M5.25 5.25L12 12M12 12L5.25 18.75M12 12L18.75 18.75M12 12L18.75 5.25",stroke:"black",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Ee="_root_2hnco_1",Ce={root:Ee},De=({data:t})=>{var d;const{data:s}=E(),[l,r]=U.useState(!1),[o,n]=U.useState(!1),c=()=>{(async()=>{r(!0),alert("TODO: Add your logic here"),r(!1),n(!1)})()};return e.jsxs("div",{className:"block lg:flex",children:[e.jsxs("div",{className:"mb-8 w-full lg:mb-0 lg:w-[30%]",children:[e.jsx("h4",{className:"m-0 mb-2.5 text-subtitle font-bold text-black-300",children:t==null?void 0:t.title}),e.jsx(S,{className:"text-body2 text-black-300 lg:text-caption",content:(d=t==null?void 0:t.description)==null?void 0:d.replace("{EMAIL}",(s==null?void 0:s.email)||"")})]}),e.jsxs("div",{className:"w-full lg:flex lg:w-[70%] lg:pl-8",children:[e.jsxs("div",{className:"mb-2.5 pr-12 lg:mb-0",children:[e.jsx("div",{className:"mb-2 text-body1 font-bold lg:mb-7",children:t==null?void 0:t.subtitle}),e.jsx(S,{className:"text-caption text-black-300",content:s!=null&&s.isPromoted?t==null?void 0:t.noteUnsubscribe:t==null?void 0:t.noteSubscribe})]}),e.jsx("div",{className:"flex items-center",children:e.jsx(v,{size:"small",disabled:l,onClick:()=>s&&n(!0),children:s!=null&&s.isPromoted?t==null?void 0:t.btnUnsubscribeText:t==null?void 0:t.btnSubscribeText})})]}),e.jsx(z,{isOpen:o,onBackClick:()=>n(!1),onKeyEcs:()=>n(!1),children:e.jsxs("div",{className:Ce.root,children:[e.jsx(ke,{className:"absolute right-3 top-3 h-8 w-8 cursor-pointer rounded-full bg-[#E4E8EE] p-2 xl:right-4 xl:top-4 xl:h-12 xl:w-12 xl:p-3",onClick:()=>n(!1)}),e.jsxs("div",{className:"flex flex-col items-center rounded-3xl bg-white px-5 pb-8 pt-14 text-center xl:px-48 xl:pb-15 xl:pt-24",children:[e.jsx("div",{className:"mb-6 text-h2 xl:mb-9",children:t==null?void 0:t.popupTitle}),e.jsx("div",{className:"mb-20 text-subtitle font-medium leading-7 xl:mb-36",children:t==null?void 0:t.popupDescription}),e.jsxs("div",{className:"flex w-full gap-5 mobile-xl:w-auto",children:[e.jsx(v,{className:"flex-1 xl:min-w-[10.6rem]",onClick:()=>n(!1),children:t==null?void 0:t.popupBtnTextLeft}),e.jsx(v,{className:"flex-1 xl:min-w-[10.6rem]",variant:"outline",color:"blue",onClick:()=>s&&c(),children:t==null?void 0:t.popupBtnTextRight})]})]})]})})]})},_e=t=>m.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},m.createElement("path",{d:"M23.9987 10.6663H22.6654V7.99967C22.6654 4.31967 19.6787 1.33301 15.9987 1.33301C12.3187 1.33301 9.33203 4.31967 9.33203 7.99967V10.6663H7.9987C6.53203 10.6663 5.33203 11.8663 5.33203 13.333V26.6663C5.33203 28.133 6.53203 29.333 7.9987 29.333H23.9987C25.4654 29.333 26.6654 28.133 26.6654 26.6663V13.333C26.6654 11.8663 25.4654 10.6663 23.9987 10.6663ZM11.9987 7.99967C11.9987 5.78634 13.7854 3.99967 15.9987 3.99967C18.212 3.99967 19.9987 5.78634 19.9987 7.99967V10.6663H11.9987V7.99967ZM23.9987 26.6663H7.9987V13.333H23.9987V26.6663ZM15.9987 22.6663C17.4654 22.6663 18.6654 21.4663 18.6654 19.9997C18.6654 18.533 17.4654 17.333 15.9987 17.333C14.532 17.333 13.332 18.533 13.332 19.9997C13.332 21.4663 14.532 22.6663 15.9987 22.6663Z",fill:"white"})),Te="_avatar_ckilg_1",P={avatar:Te,"avatar--selected":"_avatar--selected_ckilg_1","avatar--locked":"_avatar--locked_ckilg_1","check-selected":"_check-selected_ckilg_31"},Me=({value:t,onChange:s,data:l,avatars:r,isOpen:o,onClose:n})=>{const[c,d]=m.useState();return m.useEffect(()=>{d(t)},[t]),e.jsx(z,{isOpen:o,portal:!0,classes:{root:"fixed bottom-0 left-0 right-0 top-0 z-10",content:"w-[90%] max-w-5xl h-auto max-h-2/3 bg-white"},children:e.jsxs("div",{className:"flex flex-col items-center px-16 pb-16 pt-20",children:[e.jsx("div",{className:"absolute right-4 top-4 flex h-11 w-11 cursor-pointer items-center justify-center rounded-full bg-gray-300/85",onClick:()=>n==null?void 0:n(),children:e.jsx(ae,{className:"h-4 w-4"})}),e.jsx("div",{className:"max-w-4/5 mb-16 text-center text-h2 font-bold",children:l==null?void 0:l.title}),e.jsx("div",{className:"mb-16 flex flex-wrap justify-center",children:r==null?void 0:r.map((a,i)=>e.jsxs("div",{onClick:()=>!(a!=null&&a.locked)&&d(a),className:M(P.avatar,{[P["avatar--selected"]]:(c==null?void 0:c.name)===a.name,[P["avatar--locked"]]:a==null?void 0:a.locked}),children:[(c==null?void 0:c.name)===a.name&&e.jsx("div",{className:P["check-selected"]}),(a==null?void 0:a.locked)&&e.jsx(_e,{className:" absolute left-1/2 top-1/2 z-1 -translate-x-1/2 -translate-y-1/2"}),e.jsx(w,{className:" block h-auto w-full rounded-full",src:a.url,width:105,height:105,alt:a.name})]},`avatar-${i}`))}),e.jsx(v,{onClick:()=>c&&(s==null?void 0:s(c)),children:l==null?void 0:l.btnSaveText})]})})},A={"profile-form":"_profile-form_1ljvf_4","profile-form--editing":"_profile-form--editing_1ljvf_1"},Pe=({data:t})=>{const s=se(),{isDirty:l}=s.formState,[r,o]=m.useState(!1),[n,c]=m.useState(!1),{data:d,mutate:a}=E(),i=J(),[x,g]=m.useState(),[N,j]=m.useState(!1),[f,y]=m.useState();m.useEffect(()=>{d&&(g(d),y(d.avatar))},[d,i]),m.useEffect(()=>
1{x&&!l&&!r&&Object.keys(x).forEach(h=>{h!=="avatar"&&s.setValue(h,x[h])})},[x,s,l,r]);const u=async h=>{o(!0),(await T.request(T.put("/api/profile",JSON.stringify({formData:h})))).status===200?(a(void 0,{revalidate:!0}),c(!1)):alert("Failed to save profile data"),o(!1)},p=h=>{y(h),j(!1)};m.useEffect(()=>{var h;f&&((h=x==null?void 0:x.avatar)==null?void 0:h.name)!==f.name&&(async $=>{o(!0),(await T.request(T.put("/api/profile",JSON.stringify({avatar:$.name})))).status===200?(a(void 0,{revalidate:!0}),c(!1)):alert("Failed to save profile data"),o(!1)})(f)},[f,x,a]);const b=()=>{c(!1),s.reset(),Object.keys(x||{}).forEach(h=>{h!=="avatar"&&s.setValue(h,x[h])})};return e.jsxs("div",{className:"block lg:flex",children:[e.jsxs("div",{className:"mb-8 w-full lg:mb-0 lg:w-[30%]",children:[e.jsx("h4",{className:"m-0 mb-2.5 text-subtitle font-bold text-black-300",children:t==null?void 0:t.title}),e.jsx(S,{className:"lg:text-caption text-body2 text-black-300",content:t==null?void 0:t.description})]}),e.jsxs("div",{className:"w-full lg:w-[70%] lg:pl-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("div",{className:"mb-4 text-body1 font-bold",children:t==null?void 0:t.avatarText}),e.jsxs("div",{className:"flex items-center lg:items-start",children:[e.jsx("div",{className:"h-[105px] w-[105px]",children:e.jsx(w,{className:" block h-full w-full rounded-full",src:f==null?void 0:f.url,width:105,height:105,alt:(f==null?void 0:f.name)||"Avatar"})}),e.jsx(v,{className:" ml-14 lg:ml-5 lg:mt-2",size:"small",variant:"outline",color:"blue",onClick:()=>j(!0),disabled:r,children:t==null?void 0:t.btnCustomizeAvatar})]})]}),e.jsxs("div",{className:M(A.form,A["form--editing"]),children:[e.jsxs("div",{className:"flex flex-wrap justify-between",children:[e.jsx("div",{className:"mb-7 mr-3 text-body1 font-bold",children:t==null?void 0:t.profileText}),!n&&e.jsx(v,{size:"small",variant:"outline",onClick:()=>c(!0),disabled:r,children:t==null?void 0:t.btnEditProfile})]}),e.jsx("div",{className:M(A["profile-form"],{[A["profile-form--editing"]]:n}),children:e.jsx(te,{...s,children:e.jsxs("form",{onSubmit:s.handleSubmit(u),children:[e.jsx(le,{config:t==null?void 0:t.formFields,disabled:r||!n}),e.jsxs("div",{className:`mt-6 justify-end ${n?"flex":"hidden"}`,children:[e.jsx(v,{className:"mr-2",size:"small",variant:"outline",color:"blue",disabled:r,onClick:h=>{b(),h.preventDefault()},children:t==null?void 0:t.btnCancelText}),e.jsx(v,{size:"small",disabled:!l||r,onClick:s.handleSubmit(u),children:t==null?void 0:t.btnSaveText})]})]})})})]})]}),e.jsx(Me,{isOpen:N,data:t==null?void 0:t.popupAvatar,value:f,onChange:p,onClose:()=>j(!1),avatars:i})]})},Ae="_root_4d17x_1",X={root:Ae,"setting-box":"_setting-box_4d17x_4"},Fe=t=>{var o;const s=$e(),{data:l}=E(),r=s==null?void 0:s.settings;return e.jsxs("div",{className:X.root,children:[(r==null?void 0:r.css)&&e.jsx("style",{children:r.css}),e.jsxs("div",{className:"mb-7 lg:mb-10",children:[e.jsx("h3",{className:"mb-3 mt-0 text-h3 text-black-300 ",children:s==null?void 0:s.title}),e.jsx(S,{className:"text-caption text-black-300",content:(o=s==null?void 0:s.signinText)==null?void 0:o.replace("{EMAIL}",(l==null?void 0:l.email)||"")})]}),e.jsx(I,{className:"mb-8",children:e.jsx(Pe,{data:s==null?void 0:s.profile})}),e.jsx(I,{className:"mb-8",children:e.jsx(De,{data:s==null?void 0:s.newsletter})}),e.jsx(I,{children:e.jsx(Se,{data:s==null?void 0:s.deleteAccount})})]})},I=({children:t,className:s})=>e.jsx("div",{className:M(`w-full max-w-5xl rounded-3xl bg-white p-5 lg:p-10 ${X["setting-box"]}`,s),children:t}),Le=async()=>{const t=await D.request(D.get(`${G}graphql`,{mock:"dashboard/account-settings"}));if(t.status===200)return{accountSettings:t.data};throw new Response(null,{status:404,statusText:"Not Found"})},$e=()=>{const{data:t}=k("accountSettings");return t},Ie=t=>{const{data:s,isShow:l=!1,parentRef:r,onClose:o,setOnShowPopup:n}=t;return!r||!s||s.length===0?null:e.jsxs(Z,{open:l,anchorElm:r,autoHide:o,placement:"right-start",className:"z-4 -ml-1 max-h-120 w-[18rem] cursor-default select-text overflow-auto bg-white p-4 shadow-[0_0_40px_0_#1A1A1A33]",children:[s.length!=1&&s.map((c,d)=>e.jsx(w,{src:c.logo.url,alt:c.shortTitle,width:40,height:40,className:"mr-1 h-10 w-10"},d)),s.map((c,d)=>e.jsx(Y,{data:c,onShowPopup:n},d))]})},Be={},Re=t=>{const{eventInDate:s}=t,l=V("tablet-xl"),r=[...s].splice(0,2),o=[...s].slice(2);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`hidden max-h-28 flex-1 flex-col gap-0.5 overflow-auto lg:flex ${Be["scroll-list"]}`,children:[s.length>1&&r.map((n,c)=>e.jsx("div",{className:"relative cursor-pointer text-white",children:e.jsxs("div",{className:"mt-0.5 flex items-center gap-2 rounded-[3px] p-0.5 text-body3",style:{background:n.tag.color},children:[e.jsx(w,{className:"h-5 w-5 rounded border-1 border-solid border-[#
1E6E6E6]",src:n.logo.url,alt:n.shortTitle,height:22,width:22}),l&&e.jsx("div",{className:"line-clamp-1 text-start",children:n==null?void 0:n.shortTitle}),l&&e.jsx("div",{className:"line-clamp-1 min-w-[22%] text-start",children:R(new Date(n.startTime))})]})},c)),s.length===1&&e.jsxs("div",{className:"mt-0.5 flex items-center p-0.5 text-body3 text-white",children:[e.jsx(w,{className:"h-full w-1/2 border-1 border-solid border-[#E6E6E6]",src:s[0].logo.url,alt:s[0].shortTitle,height:22,width:22}),e.jsx("div",{className:"flex h-full w-1/2 items-center justify-center p-2 text-small font-extrabold",style:{background:s[0].tag.color},children:s[0].shortTitle})]}),o.length>0&&e.jsx("div",{className:"mt-0.5 flex items-center gap-2 rounded-[3px] bg-[#E6E6E6] p-1 text-body3",children:l&&e.jsxs("div",{className:"line-clamp-1 text-start font-semibold",children:["+ ",o.length," ",o.length>1?"events":"event"]})})]}),e.jsxs("div",{className:"flex items-center justify-center gap-0.5 lg:hidden",children:[s.length>0?r.map((n,c)=>e.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:n.tag.color}},c)):e.jsx("span",{className:"h-2 w-2 rounded-full"}),o.length>2&&e.jsx("span",{className:"h-2 w-2 leading-[7px]",children:"+"})]})]})},Oe=m.memo(Re),ze={"day-event":"_day-event_4aw3a_21"},Ve=t=>{const{data:s=[],date:l,showMonth:r=!1,isCurrMonth:o=!0,handleSetEventId:n,currDate:c}=t,d=V("tablet-xl"),[a,i]=m.useState(null),[x,g]=m.useState(!1),N=L(),j=s.filter(h=>{const _=new Date(h.startTime);return C(l,_)}),f=C(new Date,l),y=r?He(l,N):"",u=()=>g(!0),p=()=>g(!1),b=c?C(l,c):!1;return e.jsxs("div",{ref:i,onMouseEnter:u,onMouseLeave:p,className:M(`relative flex aspect-square w-full cursor-pointer flex-col items-center justify-center rounded-full border-1 border-solid border-[#E6E6E6] text-start hover:bg-[#E2F4FF] lg:aspect-auto lg:w-auto lg:items-start lg:justify-start lg:rounded-none ${!o&&d?"bg-neutral-100":"bg-white"} ${f&&!d?"bg-[#E2F4FF]":""}`,{[`h-full border-none ${ze["day-event"]}`]:!d},{"border-1 border-solid border-[#BABABA]":b&&!d&&o},{"h-28":d}),children:[e.jsx("div",{className:`text-body1 font-bold lg:pl-1 ${f?"text-[#0095F3]":""}`,children:y+" "+l.getDate().toString()}),e.jsx(Oe,{eventInDate:j}),d&&e.jsx(Ie,{data:j,onClose:p,isShow:x,parentRef:a,setOnShowPopup:n}),f&&d&&e.jsx("div",{className:"absolute bottom-0 right-0 h-1 w-full bg-[#0095F3]"})]})},He=(t,s)=>t.toLocaleDateString(s,{month:"short"}),R=(t,s="en-US")=>t?new Date(t).toLocaleTimeString(s,{minute:"2-digit",hour:"2-digit",hour12:!1}):void 0,Ue=(t,s="en-US")=>t?new Date(t).toLocaleDateString(s,{month:"short",day:"numeric",weekday:"short"}):void 0,qe=t=>{const{data:s,onShowPopup:l}=t,r=L(),o=K();if(!s)return;const n=new Date(s.startTime),c=new Date(s.endTime);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"[&>hr]:last:hidden",children:[e.jsxs("div",{className:"flex cursor-pointer items-center gap-4",onClick:()=>l(s.id),children:[e.jsx(w,{className:"h-10 w-10 rounded border-1 border-solid border-[#E6E6E6] lg:hidden",src:s.logo.url,alt:s.shortTitle,height:22,width:22}),e.jsxs("div",{children:[e.jsx("h3",{className:"m-0 text-body1 font-bold",style:{color:s.tag.color},children:s.title}),e.jsxs("div",{className:"text-body2 font-semibold leading-6",children:[e.jsx("span",{children:Ue(n)}),e.jsx("span",{className:"text-body1 font-bold",children:" ⢠"}),e.jsxs("span",{children:[R(n)," - ",R(c)]})]}),e.jsxs("div",{className:"text-body2",children:[(o==null?void 0:o["release-time"])??"Release time",": ",Ze(n,r)]})]})]}),e.jsx("hr",{className:"my-2"})]})})},Y=m.memo(qe),Ze=(t,s="en-US")=>{if(!t)return;const l=new Date(t);return l.toLocaleTimeString(s,{hour:"2-digit",timeZoneName:"short"})+" / "+l.toLocaleTimeString(s,{hour:"2-digit",timeZone:"GMT",timeZoneName:"short"}).replace("UTC","GMT")},Ge="_content_1t8mh_1",We={content:Ge},Ke=t=>{const{data:s,activeEventId:l}=t,r=K(),o=L(),[n,c]=m.useState(),[d,a]=m.useState("");return m.useEffect(()=>{if(l&&n&&s){const i=s.findIndex(x=>x.id===l);i===0?a("start"):i===s.length-1&&a("end"),n.slideTo(i||0,0)}},[n]),e.jsxs(e.Fragment,{children:[e.jsx(de,{sliderRef:c,options:{align:"start",loop:!1},on:{slideChange:i=>{i.isStart?a("start"):i.isEnd?a("end"):a("")}},children:s==null?void 0:s.map((i,x)=>e.jsxs("div",{className:"flex h-full max-h-[85vh] flex-col px-8 pb-8 pt-10 lg:px-20 lg:pb-9 lg:pt-12",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{ratio:1/1,className:"h-14 w-14 overflow-hidden rounded-2xl border-1 border-solid border-[#
1E6E6E6] lg:h-20 lg:w-20",children:e.jsx(w,{className:"object-cover",src:i.logo.url,alt:i.shortTitle,height:82,width:82})}),e.jsx("div",{className:"text-h3 font-bold",children:i.title})]}),e.jsx("div",{className:"mt-2 text-body1 font-bold uppercase text-blue",children:Xe(new Date(i.startTime),new Date(i.endTime),o)}),e.jsx("div",{className:"my-2 inline w-fit rounded-2xl px-4 py-1.5 text-body2 font-bold uppercase text-white",style:{background:i.tag.color},children:i.tag.name}),e.jsx(S,{className:`max-h-[20rem] flex-1 overflow-auto ${We.content}`,content:i.description}),e.jsx(v,{href:i.url,className:"mt-6 w-fit",variant:"primary",color:"main",children:(r==null?void 0:r["read-more"])||"Read More"})]},x))}),(n==null?void 0:n.enable)&&e.jsxs(e.Fragment,{children:[d!=="start"&&e.jsx(F,{className:"absolute left-0 top-1/2 h-8 w-8 -translate-y-1/2 rotate-180 transform cursor-pointer p-1 transition-all hover:scale-110 active:scale-95 lg:left-4",onClick:()=>n==null?void 0:n.slidePrev()}),d!=="end"&&e.jsx(F,{className:"absolute right-0 top-1/2 h-8 w-8 -translate-y-1/2 transform cursor-pointer p-1 transition-all hover:scale-110 active:scale-95 lg:right-4",onClick:()=>n==null?void 0:n.slideNext()})]})]})},Xe=(t,s,l="en-US")=>{const r=o=>o.toLocaleDateString(l,{month:"short",day:"numeric",weekday:"short"})+" AT "+o.toLocaleTimeString(l,{minute:"2-digit",hour:"2-digit",hour12:!1});return`${r(t)} - ${r(s)}`},Ye={show:{opacity:1,scale:1},hide:{opacity:0,scale:.5}},Je=t=>{const{data:s,eventId:l,onClose:r}=t;if(!s)return null;const o=s.find(n=>n.id===l);return e.jsx(re,{children:l&&e.jsx(z,{classes:{mask:"bg-black/95 pb-5"},isOpen:!!l,onBackClick:r,onKeyEcs:r,children:e.jsxs(oe.div,{className:"relative w-[42rem] overflow-hidden rounded-3xl bg-white",variants:Ye,animate:"show",initial:"hide",exit:"hide",transition:{duration:.3},children:[e.jsx(Ke,{data:s,activeEventId:o==null?void 0:o.id}),e.jsx("div",{className:"absolute right-4 top-4 z-3 h-7 w-7 cursor-pointer p-1 transition-all hover:scale-110 active:scale-95",onClick:r,children:e.jsx(me,{className:"h-full w-full"})})]})})})},Qe=m.memo(Je),es=t=>{const s=ls(),[l,r]=m.useState(new Date),[o,n]=m.useState(null),c=L(),[d,a]=m.useState(""),i=V("tablet-xl"),[x,g]=m.useState((s==null?void 0:s.calendar)||[]),N=ws();m.useEffect(()=>{N&&r(new Date(N.time))},[N]);const j=[...x].reduce((u,p)=>{const b=[...u];return new Date(p.startTime).getMonth()===l.getMonth()&&(p.tag.color||(p.tag.color=ns((s==null?void 0:s.randomColors)||[])),b.push(p)),b},[]);m.useEffect(()=>{if(j)return;(()=>{T.get(W,{headers:{"api-key":"WAx6B5ZTExrEXbCzX2WjZzTcEynN5qqdm2qP"},params:{lang:c||"en",month:l.getMonth()+1,year:l.getFullYear()}}).then(p=>{if(p.status===200){const b=p.data.result;g(h=>[...h,...b])}})})()},[c,j,l]);let f=["S","M","T","W","T","F","S"];i&&(f=["Sun","Mon","Tues","Wed","Thu","Fri","Sat"]);const y=o&&(j==null?void 0:j.filter(u=>{const p=new Date(u.startTime);return C(o,p)}));return e.jsxs("div",{className:"flex w-full flex-1 flex-col 2xl:max-w-[63rem]",children:[e.jsx("div",{className:"w-full flex-1 justify-center overflow-hidden rounded-3xl border-1 border-solid border-blue shadow-[0px_0px_50px_0px_#E3E9EC]",children:e.jsx(je,{mode:"single",className:"m-0 w-full",month:l,onMonthChange:u=>r(u),onDayClick:u=>n(u),classNames:{table:"w-full bg-white",month:"w-full",day:"overflow-hidden border-solid h-12 border-none lg:h-28 font-medium w-full relative rounded-full lg:rounded-none lg:block flex justify-center items-center",day_selected:"bg-transparent",button:"cursor-default"},showOutsideDays:!0,components:{Caption:ss,DayContent(u){const p=u.date,b=u.displayMonth,h=ve(p,b),_=new Date(b.getFullYear(),b.getMonth()+1,1),$=C(p,_),H=new Date(b.getFullYear(),b.getMonth(),0),Q=C(p,H),ee=$||Q;return e.jsx(Ve,{handleSetEventId:a,data:j,date:u.date,showMonth:ee,isCurrMonth:h,currDate:o})},Head(){return e.jsx("thead",{children:e.jsx("tr",{children:f.map((u,p)=>e.jsx("th",{className:"w-[calc(100%/7)] py-3 text-center font-normal lg:py-5",children:u},p))})})}}})}),!i&&y&&e.jsxs("div",{className:`z-4 mx-auto mt-6 max-h-120 w-full cursor-default select-text overflow-auto rounded-2xl bg-white p-4 2 shadow-[0px_0px_50px_0px_#E3E9EC]`,children:[y.length===0&&e.jsx("div",{className:"text-body2",children:"No event"}),y.map((u,p)=>e.jsx(Y,{data:u,onShowPopup:()=>a(u.id)},p))]}),y&&e.jsx(Qe,{data:y,eventId:d,onClose:()=>a("")})]})};function ss(t){const{goToMonth:s,nextMonth:l,previousMonth:r}=we();return e.jsxs("div",{className:"m-0 flex items-center justify-around ga
2p-8 bg-blue py-2 text-white lg:justify-center lg:py-4",children:[e.jsx(F,{className:"user-select-none rotate-180 cursor-pointer hover:scale-105 active:scale-95",onClick:()=>r&&s(r)}),e.jsx("div",{className:"min-w-28 text-center text-subtitle2 font-bold",children:Ne(t.displayMonth,"MMM yyy")}),e.jsx(F,{className:"user-select-none cursor-pointer hover:scale-105 active:scale-95",onClick:()=>l&&s(l)})]})}const ts=async({locale:t})=>{const s=new Date().getMonth()+1,l=new Date().getFullYear(),r=await D.request(D.get(W,{params:{lang:t,months:[s-1,s,s+1],year:l},mock:"dashboard/events"}));return r.status===200?{dashboardEvent:r.data}:null},ls=()=>{const{data:t}=k("dashboardEvent");return t},ns=t=>t[Math.floor(ce()*t.length)],rs=t=>{const{data:s}=t;return e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"mb-4 mt-0 text-subtitle font-bold",children:s==null?void 0:s.title}),e.jsx(w,{className:"max-h-[250px] max-w-[330px] object-cover",src:s==null?void 0:s.character.url,alt:(s==null?void 0:s.title)||"Character",height:250,width:333}),e.jsx(S,{className:"ck-content mt-4 text-start [&>ul]:ml-5",content:s==null?void 0:s.description}),e.jsxs("div",{className:"mt-5 flex flex-col items-center justify-around gap-4 sm:flex-row",children:[e.jsx(v,{href:s==null?void 0:s.learnMoreUrl,variant:"secondary",className:"w-full max-w-[230px] text-black transition-all sm:w-1/2",children:s==null?void 0:s.learnMoreText}),e.jsx(v,{href:s==null?void 0:s.becomePlayerUrl,className:"w-full max-w-[230px] sm:w-1/2",children:s==null?void 0:s.becomePlayerText})]})]})},os={"list-submission":"_list-submission_1hdhd_1"},cs=t=>{const{data:s}=t,{data:l}=E(),{data:r}=js();return e.jsxs("div",{className:"text-body1",children:[e.jsx("h3",{className:"mb-5 mt-0",children:s==null?void 0:s.title}),e.jsx(S,{className:"mb-5 font-medium",content:s==null?void 0:s.description}),e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"my-1 font-bold",children:s==null?void 0:s.emailText}),e.jsx("span",{className:"font-medium",children:l==null?void 0:l.email})]}),e.jsx("hr",{}),e.jsx("div",{className:`max-h-[400px] overflow-auto ${os["list-submission"]}`,children:r==null?void 0:r.map((o,n)=>{var c;return e.jsxs("div",{className:"[&>hr]:last:hidden",children:[e.jsx("h4",{className:"my-1 text-subtitle2 font-bold",children:o.title}),e.jsx("p",{className:"m-0 mb-1 mt-3 text-sm font-bold",children:s==null?void 0:s.submissionDateText}),e.jsx("span",{className:" font-medium",children:is(new Date(o.submissionDate))}),e.jsx("p",{className:"text- m-0 mb-2 mt-3 text-sm font-bold",children:s==null?void 0:s.statusText}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(w,{className:"h-5 w-5",src:(c=o.status.icon)==null?void 0:c.url,alt:"icon",height:20,width:20}),e.jsx("span",{className:"font-medium",children:o.status.name})]}),e.jsx("hr",{})]},n)})})]})},is=t=>t.toLocaleDateString("en-US",{day:"2-digit",month:"short",year:"numeric"}),as=t=>{const{data:s}=t,{data:l}=E(),r=(l==null?void 0:l.role)==="guest",o=(l==null?void 0:l.role)==="admin"||(l==null?void 0:l.role)==="moderator";return e.jsx("div",{className:"w-full xl:w-auto 2xl:max-w-[35%]",children:e.jsxs("div",{className:"rounded-3xl bg-white p-6 shadow-[0px_0px_50px_0px_#E3E9EC] lg:mx-0 lg:px-10 lg:py-8 ",children:[o&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"m-0 text-subtitle font-bold text-black-400",children:s==null?void 0:s.title}),s==null?void 0:s.items.map((n,c)=>
2e.jsxs("div",{className:"mt-4 flex max-w-none gap-4 rounded-2xl bg-neutral-100 p-1.5 pr-6 lg:mt-6 2xl:max-w-96",children:[e.jsx(w,{src:n.thumbnail.url,alt:n.title,width:100,height:100,className:"h-20 w-20 rounded-2xl lg:h-28 lg:w-28"}),e.jsxs("div",{className:"flex h-28 flex-col justify-between",children:[e.jsx("div",{className:"m-0 text-body1 font-bold",children:n.title}),e.jsxs("a",{href:n.downloadLink,target:"_blank",rel:"noreferrer noopener",className:"mb-2 flex items-center gap-4 text-body1 font-bold uppercase text-blue",children:[e.jsx("span",{children:n.downloadText}),e.jsx(xe,{})]})]})]},c))]}),r&&e.jsx(e.Fragment,{children:l!=null&&l.isJoinPlayerMod?e.jsx(cs,{data:s==null?void 0:s.submissionContent}):e.jsx(rs,{data:s==null?void 0:s.becomePlayerMod})})]})})},ds={"popper-create-event":"_popper-create-event_1kgxy_1"},O=t=>{const s=hs(),[l,r]=m.useState(),[o,n]=m.useState(!1),c=s==null?void 0:s.settings,{data:d}=E();return e.jsxs("div",{className:"px-4 xl:px-12",children:[(c==null?void 0:c.css)&&e.jsx("style",{children:c.css}),e.jsxs("div",{className:"mb-6 flex justify-between",children:[e.jsx("h1",{className:"m-0 text-h3 text-black-300",children:s==null?void 0:s.title}),(d==null?void 0:d.role)==="admin"&&e.jsxs(v,{className:"min-w-32",ref:r,variant:"outline",size:"small",onClick:()=>n(!0),children:["+ ",s==null?void 0:s.createEventText," ",e.jsx(he,{className:"ml-1 h-2 w-2 rotate-180 rounded-sm [&>path]:fill-current"})]}),e.jsx(Z,{anchorElm:l,open:o,autoHide:()=>n(!1),placement:"bottom-end",modifiers:[{name:"offset",options:{offset:[0,5]}}],children:e.jsx("div",{className:`min-w-48 rounded-lg bg-white px-4 py-2 shadow-lg ${ds["popper-create-event"]}`,children:s==null?void 0:s.createLinks.map((a,i)=>e.jsx("a",{href:a.url,className:"block border-b-1 border-solid border-gray-300 p-3 text-body1 font-semibold last:border-none",children:a.title},i))})})]}),e.jsxs("div",{className:"flex flex-col justify-center gap-10 2xl:flex-row",children:[e.jsx(es,{}),e.jsx(as,{data:s==null?void 0:s.resources})]})]})},ms=async t=>be(t,xs,ts),xs=async()=>{const t=await D.request(D.get(`${G}graphql`,{mock:"dashboard/main"}));if(t.status===200)return{dashboardMain:t.data};throw new Response(null,{status:404,statusText:"Not Found"})},hs=()=>{const{data:t}=k("dashboardMain");return t},us=({data:t})=>{var r;const l=[{color:"#00FFE0",role:"Moderator"},{color:"#FF9A00",role:"Admin"},{color:"transparent",role:""}].find(o=>o.role===(t==null?void 0:t.role));return e.jsx("div",{className:"w-full border-b-1 border-solid border-gray-200 px-4 py-8",children:e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"h-32 w-32 rounded-full p-1.5",style:{border:`4px solid ${l==null?void 0:l.color}`},children:e.jsx(w,{src:(r=t==null?void 0:t.avatar)==null?void 0:r.url,alt:"avatar",width:110,height:110,className:"h-full w-full rounded-full object-cover"})}),e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("p",{className:"my-2 text-h3 font-bold text-black-300",children:t==null?void 0:t.displayName}),(t==null?void 0:t.role)!==""&&e.jsx("p",{className:"my-1 w-fit rounded-3xl px-2 py-1 text-body1 font-bold",style:{background:`${l==null?void 0:l.color}`},children:t==null?void 0:t.role})]})]})})},B={"nav-item":"_nav-item_1csmz_1","nav-active":"_nav-active_1csmz_7"},ps=({data:t,paramValue:s,setParamValue:l})=>{const[r,o]=q(),n=m.useRef(null),[c,d]=m.useState(!0),a=i=>{s!==i&&(i?(o({content:i}),window.history.replaceState(null,"",`${window.location.pathname}?content=${i}`)):(o({}),window.history.replaceState(null,"",window.location.pathname)),l(i||""))};return e.jsx(e.Fragment,{children:e.jsxs("div",{className:`relative flex h-full w-full flex-col items-center justify-between pt-6 ${B["navbar-wrapper"]}`,children:[e.jsx("div",{className:"flex w-full flex-col items-center justify-center gap-1 px-4",children:t==null?void 0:t.navList.map(i=>e.jsxs("div",{className:`relative flex w-56 cursor-pointer gap-2.5 rounded-lg px-6 py-4 text-black-300 ${B["nav-item"]} ${s===i.key&&B["nav-active"]}`,onClick:()=>{a(i.key)},ref:i.key==="discord-server"?n:null,children:[e.jsx(w,{src:i.icon.url,alt:"icon",width:24,height:24,className:"h-6 w-6"}),e.jsx("div",{className:"whitespace-nowrap",children:i.text})]},i.key))}),e.jsx("div",{className:"relative w-full border-t-1 border-solid border-gray-200 p-4",children:e.jsxs("div",{className:"flex cursor-pointer items-center gap-2.5 px-6 text-body1 font-medium uppercase text-red-500",onClick:()=>{},children:[e.jsx(w,{src:t==null?void 0:t.logoutIcon.url,alt:"logout-icon",width:24,height:24,className:"h-6 w-6"}),e.jsx("div",{children:t==null?void 0:t.logoutText})]})})]})})},fs={},bs=[{key:"",component:e.jsx(O,{}),loader:ms},{key:"account-settings",component:e.jsx(Fe,{}),loader:Le}],gs=t=>{const s=vs(),{data:l}=E(),r=s==null?void 0:s.settings,[o]=q(),[n,c]=m.useState(o.get("content")||""),d=x=>{c(x)},a=s==null?void 0:s.navBar.navList.map(x=>{const g=bs.find(N=>N.key===x.key);return g?{...x,...g}:x}),i=x=>{if(!x)return e.jsx(O,{});const g=a==null?void 0:a.find(N=>N.key===x);return(g==null?void 0:g.component)||e.jsx(O,{})};return e.jsxs("div",{className:fs.root,children:[(r==null?void 0:r.css)&&e.jsx("style",{children:r.css}),e.jsx(ue,{signup:!0,support:!0,share:!0}),e.jsxs("div",{className:"relative flex min-h-screen w-full pt-16",children:[e.jsxs("div",{className:"hidden flex-col items-center border-r-1 border-solid border-gray-200 bg-[#F9FBFC] lg:flex",children:[e.jsx(us,{data:l}),e.jsx(ps,{data:s==null?void 0:s.navBar,setParamValue:d,paramValue:n})]}),s?e.jsx("div",{className:"w-full bg-[#FAFAFB] px-2 pb-16 pt-8 lg:px-10",children:i(n)}):e.jsx(fe,{classes:{root:"relative flex justify-center items-center w-full"}})]}),e.jsx(pe,{})]})},J=()=>{const{data:t}=k("accountAvatars");return t},E=()=>{const t=J(),{data:s,mutate:l}=k("accountProfile",{url:"/api/profile",mock:"dashboard/account-settings/profile"});return{data:m.useMemo(()=>
2{if(t&&s){const o={...s};return o.avatar=t.find(n=>n.name===s.avatar),o}return s},[t,s]),mutate:l}},js=()=>{const{data:t,mutate:s}=k("submission",{url:"/api/submission",mock:"dashboard/submission"});return{data:t,mutate:s}},vs=()=>{const{data:t}=k("dashboard");return t},ws=()=>{const{data:t}=k("serverTime");return t},Fs=t=>{const s=ie(t.data,["dashboard","metatags"]);return ye(t,s||"")};function Ls(){return ge(),e.jsx(gs,{})}export{Bs as ErrorBoundary,Ls as default,Fs as meta};
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.