1"use strict";(self.webpackChunkeventzee=self.webpackChunkeventzee||[]).push([[904],{38706:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ja});var a=n(9950),l=(n(34226),n(28862)),o=n(30507),s=n(72047),i=n(95672),r=n(60908),d=n(94982),c=n(95196),u=n(2267),h=n(84162),p=n(31453),m=n(73233),g=n(16369),v=n(58036),x=n(94039),f=n(32972),b=n(19946),C=n(63497),A=n(8499),j=n(27166),y=n(12672),w=n(70858),k=n(75813),S=n(10220),E=n(18297),P=n(30026),T=n(74824),I=n(39474),M=n(48783),L=n(73880),B=n(77916),R=n(43140),U=n(58975),F=n(27143),D=n(70360),N=n(29345),W=n(69994),z=n(87092),$=n(14602),O=n(46888),V=n(32018),q=n(39884),G=n(87650),Q=n(12630),H=n(7692),_=n(91738),J=n(39022),Y=n(14566),K=n(95535),X=n(45014),Z=n(93929),ee=n(28728),te=n.n(ee),ne=n(29312),ae=n(55510),le=n(79206),oe=n(53186),se=n(97226),ie=n(84580),re=n(29206),de=n(68168),ce=n(81788),ue=n(25741),he=n(81270),pe=n(39886),me=n(21590),ge=n(99690),ve=n(43486),xe=n(15310),fe=n(96534),be=n(9330),Ce=n(11607),Ae=n(61196),je=n(96502),ye=n(41019),we=n(31838),ke=n(94571),Se=n(27546),Ee=n(44414);const Pe=240,Te=(0,W.A)((e=>(0,z.A)({root:{display:"flex",minWidth:"100vw",maxWidth:"100vw",overflowX:"hidden"},drawer:{[e.breakpoints.up("sm")]:{width:Pe,flexShrink:0}},appBar:{[e.breakpoints.up("sm")]:{width:"calc(100% - 240px)",marginLeft:Pe},paddingTop:"env(safe-area-inset-top)"},menuButton:{marginRight:e.spacing(2),[e.breakpoints.up("sm")]:{display:"none"}},toolbar:e.mixins.toolbar,tabbar:{height:"48px"},fabbar:{height:"72px"},drawerPaper:{width:Pe,paddingTop:"env(safe-area-inset-top)",paddingLeft:"env(safe-area-inset-left)",paddingBottom:"env(safe-area-inset-bottom)"},content:{flexGrow:1,overflow:"hidden",paddingTop:"env(safe-area-inset-top)",paddingLeft:"env(safe-area-inset-left)",paddingRight:"env(safe-area-inset-right)",paddingBottom:"env(safe-area-inset-bottom)",minHeight:"100vh",maxWidth:"100%"},bottom:{position:"fixed",bottom:0,width:"100%",zIndex:e.zIndex.appBar,[e.breakpoints.up("sm")]:{marginLeft:Pe,width:"calc(100% - 240px)"},height:"auto",paddingBottom:"env(safe-area-inset-bottom)"},fabsDiv:{maxHeight:"72px","& > *":{margin:e.spacing(1)}}})));function Ie(e){var t,n,o,s;const i=Te(),r=(0,$.A)(),c=(0,d.A)(r.breakpoints.up("md")),[u,h]=a.useState(!1),p=()=>{h(!u)},m=(0,Ae.A)({target:void 0,disableHysteresis:!0,threshold:100}),g=e.drawer?(0,Ee.jsxs)("div",{children:[(0,Ee.jsx)("div",{className:i.toolbar,style:{display:"flex",justifyContent:"center",alignItems:"center"},children:e.image?(0,Ee.jsx)("img",{src:e.image,alt:"logo",style:{width:"90%"}}):null}),e.drawer.map(((t,n)=>(0,Ee.jsxs)(a.Fragment,{children:[(0,Ee.jsx)(ae.A,{}),(0,Ee.jsx)(ie.A,{children:t.filter((e=>!!e)).map(((t,a)=>(0,Ee.jsxs)(re.A,{button:!0,onClick:()=>{u&&p(),e.handleDrawerClose&&e.handleDrawerClose(),e.handleClick&&e.handleClick(t.value)},selected:t.selected,children:[(0,Ee.jsx)(de.A,{children:(0,Ee.jsx)(me.A,{badgeContent:t.badge||0,color:"secondary",children:t.icon})}),(0,Ee.jsx)(ce.A,{primary:t.label||t.value})]},`drawer-${n}-${a}`)))})]},`drawer-section-${n}`)))]}):null,v=(0,Ee.jsx)(fe.A,{in:m,children:(0,Ee.jsx)("div",{onClick:e=>{const t=(e.target.ownerDocument||document).querySelector("#back-to-top-anchor");t&&t.scrollIntoView({behavior:"smooth",block:"center"})},role:"presentation",children:(0,Ee.jsx)(xe.A,{color:"secondary",size:"small","aria-label":"scroll back to top",style:{marginBottom:e.fab||e.speedDial?r.spacing(1):0},children:(0,Ee.jsx)(Ce.A,{})})})}),x=(0,Ee.jsx)(fe.A,{in:!!e.fab,mountOnEnter:!0,unmountOnExit:!0,children:(0,Ee.jsx)("div",{id:"fab",onClick:()=>{e.handleClick&&e.fab&&e.handleClick(e.fab.value)},role:"presentation",children:(0,Ee.jsx)(xe.A,{color:"primary",children:(null===(t=e.fab)||void 0===t?void 0:t.icon)||(0,Ee.jsx)(A.A,{})})})}),[f,b]=a.useState(!1),C=e.speedDial?(0,Ee.jsx)(we.A,{ariaLabel:"SpeedDial",icon:(0,Ee.jsx)(ke.A,{}),onClose:()=>{b(!1)},onOpen:()=>{b(!0)},open:f,direction:"up",hidden:!e.speedDial,children:null===(n=e.speedDial)||void 0===n?void 0:n.map((t=>(0,Ee.jsx)(Se.A,{icon:t.icon,tooltipTitle:t.label||t.value,tooltipOpen:!0,onClick:()=>{b(!1),e.handleClick&&e.handleClick(t.value)}},t.value)))}):null,j=e.tabs&&e.tabs.length>0?(0,Ee.jsx)(ye.A,{value:(null===(o=e.tabs.find((e=>!!e.selected)))||void 0===o?void 0:o.value)||e.tabs[0].value,onChange:(t,n)=>{e.handleClick&&e.handleClick(n)},variant:e.tabs.length>3?"scrollable":c?"standard":"fullWidth",scrollButtons:"auto",children:e.tabs.map(((e,t)=>(0,Ee.jsx)(je.A,{label:(0,Ee.jsx)(me.A,{badgeContent:e.badge||0,color:"secondary",children:e.label||e.value}),value:e.value},`tab-${t}`)))}):null,y=e.bottom?(0,Ee.jsx)(ge.A,{value:null===(s=e.bottom.find((e=>!!e.selected)))||void 0===s?void 0:s.value,onChange:(t,n)=>{e.handleClick&&e.handleClick(n)},showLabels:!0,children:e.bottom.map(((e,t)=>(0,a.createElement)(ve.A,{...e,label:e.label||e.value,key:`bottom-${t}`,icon:(0,Ee.jsx)(me.A,{badgeContent:e.badge||0,color:"secondary",children:e.icon})}
1)))}):null;return(0,Ee.jsxs)("div",{className:i.root,children:[(0,Ee.jsx)(l.Ay,{}),(0,Ee.jsx)(be.A,{appear:!1,direction:"down",in:!m,children:(0,Ee.jsxs)(ne.A,{position:"fixed",className:i.appBar,children:["string"!==typeof e.title&&e.title?e.title:(0,Ee.jsxs)(he.A,{children:[(0,Ee.jsx)(se.A,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:p,className:i.menuButton,children:(0,Ee.jsx)(ue.A,{})}),(0,Ee.jsx)(pe.A,{variant:"h6",noWrap:!0,children:e.title})]}),j]})}),(0,Ee.jsxs)("nav",{className:i.drawer,"aria-label":"mailbox folders",children:[(0,Ee.jsx)(oe.A,{smUp:!0,implementation:"css",children:(0,Ee.jsx)(le.Ay,{variant:"temporary",anchor:"rtl"===r.direction?"right":"left",open:void 0!==e.drawerOpen?e.drawerOpen:u,onClose:()=>{p(),e.handleDrawerClose&&e.handleDrawerClose()},classes:{paper:i.drawerPaper},ModalProps:{keepMounted:!0},children:g})}),(0,Ee.jsx)(oe.A,{xsDown:!0,implementation:"css",children:(0,Ee.jsx)(le.Ay,{classes:{paper:i.drawerPaper},variant:"permanent",open:!0,children:g})})]}),(0,Ee.jsxs)("main",{className:i.content,children:[(0,Ee.jsx)("div",{id:"back-to-top-anchor",className:i.toolbar}),j?(0,Ee.jsx)("div",{className:i.tabbar}):null,e.children,(0,Ee.jsx)("div",{className:i.fabbar}),y?(0,Ee.jsx)("div",{className:i.toolbar}):null]}),(0,Ee.jsxs)("div",{className:i.bottom,children:[(0,Ee.jsxs)(X.A,{m:1,className:i.fabsDiv,display:"flex",alignItems:"flex-end",justifyContent:"flex-end",children:[v,x,C]}),y]})]})}var Me=n(37751),Le=n(68035),Be=n(94087),Re=n(16714),Ue=n(87112);const Fe=(0,W.A)((e=>(0,z.A)({grow:{flexGrow:1},menuButton:{marginRight:e.spacing(2),[e.breakpoints.up("sm")]:{display:"none"}},title:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},search:{position:"relative",borderRadius:e.shape.borderRadius,backgroundColor:(0,Me.Rv)(e.palette.common.white,.15),"&:hover":{backgroundColor:(0,Me.Rv)(e.palette.common.white,.25)},marginRight:e.spacing(2),marginLeft:0,width:"100%",[e.breakpoints.up("sm")]:{marginLeft:e.spacing(3),width:"auto"}},searchIcon:{padding:e.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},inputRoot:{color:"inherit"},inputInput:{padding:e.spacing(1,1,1,0),paddingLeft:`calc(1em + ${e.spacing(4)}px)`,transition:e.transitions.create("width"),width:"100%",[e.breakpoints.up("md")]:{width:"20ch"}},sectionDesktop:{display:"flex"},sectionMobile:{display:"flex"}})));function De(e){var t,n;const l=Fe(),[o,s]=a.useState(null),[i,r]=a.useState(null),c=(0,$.A)(),u=(0,d.A)(c.breakpoints.up("md")),h=(null===(t=e.items)||void 0===t?void 0:t.slice(0,u?3:1))||[],p=(null===(n=e.items)||void 0===n?void 0:n.slice(h.length))||[],m=Boolean(o),g=Boolean(i),[v,x]=a.useState([]),f=()=>{r(null)},b=()=>{x([]),s(null),f()},C=(0,Ee.jsx)(Be.A,{anchorEl:o,anchorOrigin:{vertical:"top",horizontal:"right"},id:"primary-search-account-menu",keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:m,onClose:b,children:v.map(((t,n)=>(0,Ee.jsx)(q.A,{onClick:()=>{b(),e.handleItemClick&&e.handleItemClick(t.value)},disabled:t.disabled||!1,children:(0,Ee.jsx)(me.A,{badgeContent:t.badge||0,color:"secondary",children:t.label||t.value})},`menu-item-${n}`)))}),A="primary-search-account-menu-mobile",j=(0,Ee.jsx)(Be.A,{anchorEl:i,anchorOrigin:{vertical:"top",horizontal:"right"},id:A,keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:g,onClose:f,children:p?p.map(((t,n)=>(0,Ee.jsxs)(q.A,{onClick:n=>{t.nested?(x(t.nested),s(n.currentTarget)):e.handleItemClick&&e.handleItemClick(t.value)},disabled:t.disabled||!1,children:[(0,Ee.jsx)(se.A,{"aria-label":t.label,color:"inherit",children:(0,Ee.jsx)(me.A,{badgeContent:t.badge||0,color:"secondary",children:t.icon||null})}),(0,Ee.jsx)("p",{children:t.label||t.value})]},`mobile-menu-item-${n}`))):null}),[y,w]=a.useState("");return a.useEffect((()=>{e.handleInputChange&&e.handleInputChange(y)}),[e,y]),(0,Ee.jsxs)("div",{className:l.grow,children:[(0,Ee.jsxs)(he.A,{style:{backgroundColor:c.palette.secondary.main},children:[(0,Ee.jsx)(se.A,{edge:"start",className:l.menuButton,color:"inherit","aria-label":"open drawer",id:"open-drawer-button",onClick:()=>{e.handleDrawerButton&&e.handleDrawerButton()},children:(0,Ee.jsx)(ue.A,{})}),(0,Ee.jsx)(pe.A,{className:e.handleInputChange||e.children?l.title:"",variant:"h6",noWrap:!0,children:e.title||null}),e.children||e.handleInputChange&&(0,Ee.jsxs)("div",{className:l.search,children:[(0,Ee.jsx)("div",{className:l.searchIcon,
1children:void 0!==e.inputIcon?e.inputIcon:(0,Ee.jsx)(Re.default,{})}),(0,Ee.jsx)(Le.A,{placeholder:void 0!==e.inputPlaceholder?e.inputPlaceholder:"Search\u2026",classes:{root:l.inputRoot,input:l.inputInput},value:y,inputProps:{"aria-label":"search"},onChange:t=>{const n=t.target.value;w(n),e.handleInputChange&&e.handleInputChange(n)}})]})||null,(0,Ee.jsx)("div",{className:l.grow}),(0,Ee.jsx)("div",{className:l.sectionDesktop,children:h.length>0?h.map(((t,n)=>(0,Ee.jsx)(se.A,{"aria-label":t.label,color:"inherit",onClick:n=>{t.nested?(x(t.nested),s(n.currentTarget)):e.handleItemClick&&e.handleItemClick(t.value)},disabled:t.disabled||!1,children:(0,Ee.jsx)(me.A,{badgeContent:t.badge||0,color:"secondary",children:t.icon||null})},`icon-button-${n}`))):null}),(0,Ee.jsx)("div",{className:l.sectionMobile,children:p.length>0?(0,Ee.jsx)(se.A,{"aria-label":"show more","aria-controls":A,"aria-haspopup":"true",onClick:e=>{r(e.currentTarget)},color:"inherit",children:(0,Ee.jsx)(Ue.A,{})}):null})]}),j,C]})}var Ne=n(52816),We=n(18028),ze=n(43510),$e=n(77766),Oe=n(55550),Ve=n(96918);function qe(e){var t;return(0,Ee.jsxs)(We.A,{open:e.open,onClose:e.handleClose,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e.title?(0,Ee.jsx)(Ve.A,{id:"alert-dialog-title",children:e.title}):null,(0,Ee.jsx)($e.A,{children:(0,Ee.jsx)(Oe.A,{id:"alert-dialog-description",children:e.content})}),e.buttons&&e.buttons.length>0?(0,Ee.jsx)(ze.A,{children:null===(t=e.buttons)||void 0===t?void 0:t.map(((t,n,a)=>(0,Ee.jsx)(Ne.A,{autoFocus:n===a.length-1,onClick:()=>{t.handleClick(),e.handleClose&&e.handleClose()},color:n===a.length-1?"primary":"secondary",children:t.text},`button-${n}`)))}):null]})}var Ge=n(13144);const Qe=(0,W.A)((e=>(0,z.A)({appBar:{position:"fixed"},title:{marginLeft:e.spacing(2),flex:1},toolbar:{paddingTop:"env(safe-area-inset-top)"},iPhoneTop:{width:"100%",paddingTop:`calc(env(safe-area-inset-top) - ${e.spacing(1)}px)`},iPhoneBottom:{width:"100%",paddingBottom:"env(safe-area-inset-bottom)"}}))),He=a.forwardRef((function(e,t){return(0,Ee.jsx)(be.A,{direction:"left",ref:t,...e})}));function _e(e){const t=Qe();return(0,Ee.jsxs)(We.A,{fullScreen:!0,open:e.open,onClose:e.handleClose,TransitionComponent:He,children:[(0,Ee.jsx)(ne.A,{className:t.appBar,children:(0,Ee.jsxs)(he.A,{className:t.toolbar,children:[(0,Ee.jsx)(se.A,{edge:"start",color:"inherit",onClick:e.handleClose,"aria-label":"close",children:"arrow"===e.closeIcon?(0,Ee.jsx)(j.A,{}):(0,Ee.jsx)(Ge.default,{})}),(0,Ee.jsx)(pe.A,{variant:"h6",className:t.title,children:e.title})]})}),(0,Ee.jsx)(he.A,{}),(0,Ee.jsx)("div",{className:t.iPhoneTop}),e.children,(0,Ee.jsx)("div",{className:t.iPhoneBottom})]})}const Je=(0,n(33720).A)((e=>(0,z.A)({root:{margin:0,padding:e.spacing(2),display:"flex",alignItems:"center",paddingTop:`calc(${e.spacing(2)}px + env(safe-area-inset-top))`},title:{flexGrow:1},closeButton:{color:e.palette.grey[500]}})))((e=>{const{children:t,classes:n,onClose:a,...l}=e;return(0,Ee.jsxs)(Ve.A,{disableTypography:!0,className:n.root,...l,children:[(0,Ee.jsx)(pe.A,{className:n.title,variant:"h6",children:t}),a?(0,Ee.jsx)(se.A,{"aria-label":"close",className:n.closeButton,onClick:a,children:(0,Ee.jsx)(Ge.default,{})}):null]})})),Ye=(0,W.A)((e=>(0,z.A)({dialogActions:{paddingBottom:"env(safe-area-inset-bottom)"},dialogContent:{padding:e.spacing(1),paddingBottom:"env(safe-area-inset-bottom)"}})));function Ke(e){const t=(0,$.A)(),n=Ye(),a=(0,d.A)(t.breakpoints.down("sm"));return(0,Ee.jsxs)(We.A,{fullScreen:a,open:e.open,scroll:"paper",onClose:e.handleClose,"aria-labelledby":"responsive-dialog-title",children:[(0,Ee.jsx)(Je,{id:"responsive-dialog-title",onClose:e.handleClose,children:e.title}),(0,Ee.jsx)($e.A,{dividers:!0,className:n.dialogContent,children:e.content}),e.buttons&&e.buttons.length>0?(0,Ee.jsx)(ze.A,{className:n.dialogActions,children:e.buttons.map(((e,t,n)=>(0,Ee.jsx)(Ne.A,{autoFocus:t===n.length-1,onClick:e.handleClick,color:t===n.length-1?"primary":"secondary",children:e.text},`button-${t}`)))}):null]})}function Xe(e){var t,n;
1const[l,o]=a.useState(""),[s,i]=a.useState({});return(0,Ee.jsxs)(We.A,{open:e.open,onClose:e.handleClose,"aria-labelledby":"form-dialog-title",children:[e.title?(0,Ee.jsx)(Ve.A,{id:"form-dialog-title",children:e.title}):null,(0,Ee.jsxs)($e.A,{children:[(0,Ee.jsx)(Oe.A,{children:e.content}),(0,Ee.jsx)(V.A,{autoFocus:!0,margin:"dense",id:"name",label:"Email Address",type:"email",fullWidth:!0,value:l,onChange:e=>{const t=e.target.value;o(t||"")}}),e.checkboxes&&e.checkboxes.length>0?null===(t=e.checkboxes)||void 0===t?void 0:t.map((e=>(0,Ee.jsxs)(X.A,{display:"flex",flexDirection:"column",marginTop:4,marginBottom:2,children:[(0,Ee.jsx)(Y.A,{control:(0,Ee.jsx)(K.A,{checked:!!s[e.value],onChange:t=>{const n={...s};n[e.value]=t.target.checked,i(n)},color:"primary"}),label:e.text}),e.helper?(0,Ee.jsx)(pe.A,{color:"textSecondary",variant:"caption",children:e.helper}):null]}))):null]}),e.buttons&&e.buttons.length>0?(0,Ee.jsx)(ze.A,{children:null===(n=e.buttons)||void 0===n?void 0:n.map(((t,n,a)=>(0,Ee.jsx)(Ne.A,{autoFocus:n===a.length-1,onClick:()=>{t.handleClick(l),e.handleClose&&e.handleClose()},color:n===a.length-1?"primary":"secondary",children:t.text},`button-${n}`)))}):null]})}var Ze=n(30082),et=n(10607),tt=n(95888),nt=n(84494),at=n(24910),lt=n(42146),ot=n(92284),st=n(73816),it=n(80892),rt=n(46493),dt=n(65604);let ct=null;ct="pk_live_eDyREF6y2uC5iJiBeEG4AdJB";const ut=!1,ht=!ut;let pt=Promise.resolve(null);window.cordova||!ct||ut||(async()=>{const e=await n.e(269).then(n.bind(n,44269));pt=e.loadStripe(ct)})();const mt=(0,W.A)((e=>(0,z.A)({root:{},grid:{flexGrow:1},media:{paddingTop:"56.25%"},buyButton:{marginLeft:"auto"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"}})));function gt(e){const t=mt(),[n,l]=a.useState([]),[o,s]=a.useState(e.email||null),[i,r]=a.useState(null),[d,c]=a.useState(null);a.useEffect((()=>{e.showAddOns?e.shop.getAddOnCatalog().then((e=>l(e))):e.shop.getEventCatalog().then((e=>l(e)))}),[e.shop,e.showAddOns]);const[u,h]=a.useState(!1),[p,m]=a.useState(!1),[g,v]=a.useState(""),[x,f]=a.useState(!1),[b,C]=a.useState(!1),[A,j]=a.useState(!1),[y,w]=a.useState(null),[k,S]=a.useState(null),E=a.useCallback((e=>{v(e),m(!0)}),[]),P=a.useCallback((()=>{s(null),c(null),w(null),S(null),r(null)}),[]),T=a.useCallback((t=>{(async()=>{if(t){const e=n.find((e=>e.productId===t));S(e||null)}if(!o||!d)return void C(!0);h(!0);const a=await e.shop.checkoutWithVoucher(d,o,t||void 0);h(!1),P(),null!==a&&void 0!==a&&a.success?E((null===a||void 0===a?void 0:a.message)||"Voucher redeemed, you'll receive an email shortly."):E((null===a||void 0===a?void 0:a.message)||"Could not redeem the voucher.")})().then((()=>{})).catch((e=>{console.error(e)}))}),[e.shop,E,o,d,P,n]),I=a.useCallback((t=>{(async()=>{const a=n.find((e=>e.productId===t));if(S(a||null),!a)return void E("Error: product not found.");if(!o||!i)return void f(!0);h(!0);const l=await e.shop.checkout(t,o,i);l.clientSecret?(w(l.clientSecret),j(!0)):E(l.message||"Could not initiate the purchase."),h(!1)})().then((()=>{})).catch((e=>{console.error(e)}))}),[e.shop,n,E,o,i]),M=ut?(0,Ee.jsx)(wt,{open:!(!A||!o),product:k,email:o||"",eventName:e.eventName,clientSecret:y||"",handleClose:()=>{j(!1),P()},handleResult:(e,t)=>{j(!1),m(!0),v(e?"Purchase successful, you'll receive an email shortly.":t||"Could not process payment."),P()}}):(0,Ee.jsx)(dt.Elements,{stripe:pt,children:(0,Ee.jsx)(yt,{open:!(!A||!o),product:k,email:o||"",eventName:e.eventName,clientSecret:y||"",handleClose:()=>{j(!1),P()},handleResult:(e,t)=>{j(!1),m(!0),v(e?"Purchase successful, you'll receive an email shortly.":t||"Could not process payment."),P()}})});return(0,Ee.jsxs)(X.A,{className:t.root,m:2,children:[e.websiteTheme||window.cordova||n.length>0?null:(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)(X.A,{marginBottom:2,children:(0,Ee.jsxs)(Z.A,{severity:"info",children:["The Shop will be available soon. For now, please use the"," ",(0,Ee.jsx)(ot.A,{rel:"noreferrer",target:"_system",onClick:()=>{window.open("https://eventzeeapp.com/contact/","_system")},children:"Contact Form"})," ","to reach out to us."]})}),(0,Ee.jsx)(X.A,{marginBottom:2,children:(0,Ee.jsx)(et.A,{container:!0,spacing:1,className:t.grid,children:[{title:"FREE TRIAL",price:"",info:[{text:"Up to 2 users, 1 admin"},{text:"License for 1 event, up to 30 days"},{text:"Unlimited challenges"},{text:"All challenge types, including Quiz, Text, Photo, Video, Info, QR Code, and GPS"},{text:"Challenges Library"},{text:"Announcements and in-app messaging"},{text:"Leaderboard and activity feed"},{text:"Custom branding/color theme options"}]},{title:"BASIC50",price:"$399",info:[{text:"Up to 50 users, 5 admins"},{text:"License for 1 event, up to 30 days "},{text:"Unlimited challenges"},{text:"All challenge types, including Quiz, Text, Photo, Video, Info, QR Code, and GPS"},{text:"Challenge Library"},{text:"Announcements and in-app messaging"},{text:"Leaderboard and activity feed"},{text:"Custom branding/color theme options"},{text:"Customer success manager",bold:!0},{text:"Custom event join code",bold:!0},{text:"Create custom badges to mark achievements",bold:!0}]},{title:"BASIC100",price:"$699",info:[{text:"Up to 100 users, 10 admins"},{text:"License for 1 event, up to 30 days "},{text:"Unlimited challenges"},{text:"All challenge types, including Quiz, Text, Photo, Video, Info, QR Code, and GPS"},{text:"Challenge Library"},{text:"Announcements and in-app messaging"},{text:"Leaderboard and activity feed"},{text:"Custom branding/color theme options"},{text:"Customer success manager",bold:!0},{text:"Custom event join code",bold:!0},{text:"Create custom badges to mark achievements",bold:!0}]},{title:"ADVANCED",price:"",info:[{text:"All features of BASIC100, plus additional options including:"},{text:"Additional user counts beyond 100 with special tiered pricing.",bold:!0},{text:"Annual License available which provides unlimited events and unlimited users for a 12 month period.",bold:!0},{text:"Custom design services from an experienced game design team to help make your event engaging and fun!",bold:!0},{text:"Admin assistance with entering and editing challenges.",bold:!0},{text:"Customer success team",bold:!0}]}].map(((e,t)=>(0,Ee.jsx)(et.A,{item:!0,xs:12,sm:3,md:3,lg:3,xl:3,children:(0,Ee.jsx)(vt,{...e})},`pricing-${t}`)))})})]}),(0,Ee.jsxs)(et.A,{container:!0,spacing:1,className:t.grid,children:[n.map((t=>(0,Ee.jsx)(et.A,{item:!0,xs:12,sm:6,md:4,lg:3,xl:2,children:(0,Ee.jsx)(ft,{handlePurchase:I,handleRedeem:T,product:t,websiteTheme:e.websiteTheme})},t.productId))),ht?null:(0,Ee.jsx)(et.A,{item:!0,xs:12,sm:6,md:4,lg:3,xl:2,children:(0,Ee.jsx)(xt,{handleRedeem:T,websiteTheme:e.websiteTheme})},"voucher")]}),(0,Ee.jsx)(Ct,{open:x,email:e.email,handleClose:()=>{f(!1),P()}
1,handleContinue:(e,t,n)=>{f(!1),e&&t&&k&&(s(e),c(n||null),r(t),I(k.productId))}}),(0,Ee.jsx)(At,{open:b,email:e.email,handleClose:()=>{C(!1),P()},handleContinue:(e,t)=>{C(!1),e&&t&&(s(e),c(t||null),r(null),T(null===k||void 0===k?void 0:k.productId))}}),M,(0,Ee.jsx)(bt,{open:p,message:g,handleClose:()=>{m(!1)}}),(0,Ee.jsx)(st.A,{className:t.backdrop,open:u,children:(0,Ee.jsx)(it.A,{color:"inherit"})})]})}function vt(e){const t=mt();return(0,Ee.jsxs)(tt.A,{style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[(0,Ee.jsxs)(at.A,{children:[(0,Ee.jsxs)(X.A,{display:"flex",flexDirection:"row",justifyContent:"space-between",children:[(0,Ee.jsx)(pe.A,{gutterBottom:!0,variant:"h5",component:"h2",style:{display:"inline"},children:e.title}),(0,Ee.jsx)(pe.A,{gutterBottom:!0,variant:"h5",component:"h2",color:"secondary",style:{display:"inline"},children:e.price})]}),(0,Ee.jsx)(ie.A,{children:e.info.map(((e,t)=>(0,Ee.jsx)(re.A,{dense:!0,disableGutters:!0,children:(0,Ee.jsx)(ce.A,{primary:e.text,primaryTypographyProps:{color:e.bold?"secondary":"textPrimary",style:{fontWeight:e.bold?"bold":void 0}}})},`pricing-${t}`)))})]}),"FREE TRIAL"!==e.title?(0,Ee.jsx)(nt.A,{children:(0,Ee.jsx)(Ne.A,{className:t.buyButton,startIcon:(0,Ee.jsx)(F.A,{}),color:"primary",variant:"contained",fullWidth:!0,onClick:()=>{window.open("https://eventzeeapp.com/contact/","_system")},children:"Contact Us"})}):null]})}function xt(e){const t=mt(),n=(0,$.A)();return(0,Ee.jsxs)(tt.A,{children:[e.websiteTheme?(0,Ee.jsx)(pe.A,{gutterBottom:!0,variant:"h5",component:"h2",style:{padding:n.spacing(1),background:n.palette.primary.main,color:n.palette.background.paper,fontWeight:"bold"},children:"Redeem Voucher"}):null,(0,Ee.jsx)(at.A,{children:(0,Ee.jsx)(pe.A,{variant:"body2",color:"textSecondary",component:"p",children:"If you have purchased or received a Voucher code you can redeem it here."})}),(0,Ee.jsx)(nt.A,{disableSpacing:!0,children:(0,Ee.jsx)(Ne.A,{className:t.buyButton,startIcon:(0,Ee.jsx)(F.A,{}),color:"primary",variant:"contained",onClick:()=>{e.handleRedeem()},children:"Use Voucher"})})]})}function ft(e){const t=mt(),n=(0,$.A)(),a="$"+(parseInt(e.product.price+"",10)/100).toFixed(2);return(0,Ee.jsxs)(tt.A,{children:[(0,Ee.jsx)(lt.A,{className:t.media,image:e.product.imageUrl,title:e.product.title}),e.websiteTheme?(0,Ee.jsx)(pe.A,{gutterBottom:!0,variant:"h5",component:"h2",style:{padding:n.spacing(1),background:n.palette.primary.main,color:n.palette.background.paper,fontWeight:"bold"},children:e.product.title}):null,(0,Ee.jsxs)(at.A,{children:[e.websiteTheme?null:(0,Ee.jsx)(pe.A,{gutterBottom:!0,variant:"h5",component:"h2",children:e.product.title}),(0,Ee.jsx)(pe.A,{variant:"body2",color:"textSecondary",component:"p",children:(0,Ee.jsx)(Ze.UserHTML,{htmlString:e.product.description})})]}),(0,Ee.jsxs)(nt.A,{children:[(0,Ee.jsx)(Ne.A,{className:t.buyButton,startIcon:(0,Ee.jsx)(F.A,{}),color:"secondary",variant:"contained",onClick:()=>{e.handleRedeem(e.product.productId)},children:"Voucher"}),(0,Ee.jsx)(Ne.A,{className:t.buyButton,startIcon:(0,Ee.jsx)(R.A,{}),color:"primary",variant:"contained",onClick:()=>{e.handlePurchase(e.product.productId)},children:`${a}`})]})]})}function bt(e){return(0,Ee.jsxs)(We.A,{open:e.open,onClose:e.handleClose,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,children:[(0,Ee.jsx)(Ve.A,{id:"alert-dialog-title",children:"Shop"}),(0,Ee.jsx)($e.A,{children:(0,Ee.jsx)(Oe.A,{id:"alert-dialog-description",children:e.message})}),(0,Ee.jsx)(ze.A,{children:(0,Ee.jsx)(Ne.A,{onClick:e.handleClose,color:"primary",autoFocus:!0,children:"Okay"})})]})}function Ct(e){const[t,n]=a.useState(e.email||""),[l,o]=a.useState(""),[s,i]=a.useState(""),[r,d]=a.useState(""),[c,u]=a.useState(""),[h,p]=a.useState("");return(0,Ee.jsxs)(We.A,{open:e.open,onClose:e.handleClose,"aria-labelledby":"form-dialog-title",children:[(0,Ee.jsx)(Ve.A,{id:"form-dialog-title",children:"Billing"}),(0,Ee.jsx)($e.A,{children:(0,Ee.jsx)(V.A,{autoFocus:!e.email,margin:"dense",id:"email",label:"Email Address",disabled:!!e.email,type:"email",fullWidth:!0,helperText:"Your purchase will be associated with this email address.",value:t||"",onChange:e=>{n(e.target.value)}})}),(0,Ee.jsxs)($e.A,{children:[(0,Ee.jsx)(V.A,{autoFocus:!!e.email,margin:"dense",id:"name",label:"Name",fullWidth:!0,value:l||"",onChange:e=>{o(e.target.value)}}),(0,Ee.jsx)(V.A,{margin:"dense",id:"address1",label:"Address Line 1",fullWidth:!0,value:s||"",onChange:e=>{i(e.target.value)}}),(0,Ee.jsx)(V.A,{margin:"dense",label:"Address Line 2",id:"address2",fullWidth:!0,value:r||"",onChange:e=>{d(e.target.value)}}),(0,Ee.jsxs)(et.A,{container:!0,spacing:1,children:[(0,Ee.jsx)(et.A,{item:!0,xs:12,sm:6,children:(0,Ee.jsx)(V.A,{margin:"dense",id:"state",label:"State/Province/Region",fullWidth:!0,value:c||"",onChange:e=>{u(e.target.value)}})}),(0,Ee.jsx)(et.A,{item:!0,xs:12,sm:6,children:(0,Ee.jsx)(V.A,{margin:"dense",id:"postal-code",label:"Postal Code",fullWidth:!0,value:h||"",onChange:e=>{p(e.target.value)}})})]})]}),(0,Ee.jsx)(ze.A,{children:(0,Ee.jsx)(Ne.A,{disabled:!t,onClick:()=>{t&&e.handleContinue(t,{name:l,address1:s,address2:r,state:c,postalCode:h})},color:"primary",children:"Next"})})]})}
1function At(e){const[t,n]=a.useState(e.email||""),[l,o]=a.useState("");return(0,Ee.jsxs)(We.A,{open:e.open,onClose:e.handleClose,"aria-labelledby":"form-dialog-title",children:[(0,Ee.jsx)(Ve.A,{id:"form-dialog-title",children:"Redeem Voucher"}),(0,Ee.jsx)($e.A,{children:(0,Ee.jsx)(V.A,{autoFocus:!e.email,id:"email",label:"Email Address",disabled:!!e.email,type:"email",fullWidth:!0,helperText:"This product will be associated with this email address.",value:t||"",onChange:e=>{n(e.target.value)}})}),(0,Ee.jsx)($e.A,{children:(0,Ee.jsx)(V.A,{id:"voucher",autoFocus:!!e.email,label:"Voucher Code",fullWidth:!0,helperText:"The voucher is an 8 character code.",value:l||"",onChange:e=>{o(e.target.value)}})}),(0,Ee.jsx)(ze.A,{children:(0,Ee.jsx)(Ne.A,{disabled:!t,onClick:()=>{t&&l&&e.handleContinue(t,l)},color:"primary",children:"Redeem"})})]})}const jt=(0,W.A)((e=>(0,z.A)({wrapper:{position:"relative",margin:e.spacing(1)},buttonProgress:{color:rt.A[500],position:"absolute",top:"50%",left:"50%",marginTop:-12,marginLeft:-12}})));function yt(e){var t,n;const l=jt(),o=(0,$.A)(),s="$"+(parseInt(((null===(t=e.product)||void 0===t?void 0:t.price)||0)+"",10)/100).toFixed(2),i=(0,dt.useStripe)(),r=(0,dt.useElements)(),[d,c]=a.useState(!1);return(0,Ee.jsxs)(We.A,{open:e.open,onClose:e.handleClose,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,children:[(0,Ee.jsx)(Ve.A,{id:"alert-dialog-title",children:"Payment"}),(0,Ee.jsxs)($e.A,{children:[(0,Ee.jsx)(pe.A,{color:"textPrimary",variant:"body1",children:null===(n=e.product)||void 0===n?void 0:n.title}),e.eventName?(0,Ee.jsx)(pe.A,{color:"textSecondary",variant:"body2",children:e.eventName}):null,(0,Ee.jsx)(pe.A,{color:"textSecondary",variant:"caption",children:e.email})]}),(0,Ee.jsx)($e.A,{style:{background:"white",padding:o.spacing(2),marginTop:o.spacing(1)},children:(0,Ee.jsx)(dt.CardElement,{options:{}})}),(0,Ee.jsx)(ze.A,{children:(0,Ee.jsxs)("div",{className:l.wrapper,children:[(0,Ee.jsx)(Ne.A,{size:"large",disabled:d||!i,onClick:async t=>{if(t.preventDefault(),!i||!r)return;const n=r.getElement(dt.CardElement);if(!n)return;c(!0);const a=await i.confirmCardPayment(e.clientSecret,{payment_method:{card:n}});var l;(c(!1),a.error)?(console.log(a.error.message),e.handleResult(!1,a.error.message)):"succeeded"===(null===(l=a.paymentIntent)||void 0===l?void 0:l.status)?e.handleResult(!0):e.handleResult(!1)},variant:"contained",style:{width:"100%"},children:`Pay ${s}`}),d&&(0,Ee.jsx)(it.A,{size:24,className:l.buttonProgress})]})})]})}function wt(e){var t,n;const l=jt(),o="$"+(parseInt(((null===(t=e.product)||void 0===t?void 0:t.price)||0)+"",10)/100).toFixed(2),[s,i]=a.useState(!1);return(0,Ee.jsxs)(We.A,{open:e.open,onClose:e.handleClose,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,children:[(0,Ee.jsx)(Ve.A,{id:"alert-dialog-title",children:"Payment"}),(0,Ee.jsxs)($e.A,{children:[(0,Ee.jsx)(pe.A,{color:"textPrimary",variant:"body1",children:null===(n=e.product)||void 0===n?void 0:n.title}),e.eventName?(0,Ee.jsx)(pe.A,{color:"textSecondary",variant:"body2",children:e.eventName}):null,(0,Ee.jsx)(pe.A,{color:"textSecondary",variant:"caption",children:e.email})]}),(0,Ee.jsx)($e.A,{children:(0,Ee.jsx)(pe.A,{children:"Development mode."})}),(0,Ee.jsx)(ze.A,{children:(0,Ee.jsxs)("div",{className:l.wrapper,children:[(0,Ee.jsx)(Ne.A,{id:"development-pay",size:"large",disabled:s,onClick:async t=>{t.preventDefault(),i(!0),i(!1),e.handleResult(!0)},variant:"contained",style:{width:"100%"},children:`Pay ${o}`}),s&&(0,Ee.jsx)(it.A,{size:24,className:l.buttonProgress})]})})]})}const kt=n.p+"static/media/Admin_Tool_Logo.ffc8ed2314990508bedb.png";n.p;function St(e){const[t,n]=a.useState(!1),[l,o]=a.useState(!1);a.useEffect((()=>{e.admin.isSuperUser().then((e=>{o(e)})).catch((()=>{o(!1)}))}),[e.admin]);const[s,i]=a.useState(null),[r,d]=a.useState([]);a.useEffect((()=>{e.editPlayers.onPlayersUpdated((e=>{d(e)}))}),[e]),a.useEffect((()=>{e.auth.getCurrentUser().then((e=>{i((null===e||void 0===e?void 0:e.email)||"")}))}),[e]);const[W,z]=a.useState("Event Hub"),[$,O]=a.useState("Event Hub"),[V,q]=a.useState(null),[G,Q]=a.use
1State(!1),[H,_]=a.useState(0),[J,Y]=a.useState(0),[K,X]=a.useState(null),[Z,ee]=a.useState(null),[ne,ae]=a.useState(null),[le,oe]=a.useState(null),[se,ie]=a.useState(void 0),[re,de]=a.useState(null),[ce,ue]=a.useState(null),[he,pe]=a.useState([]),[me,ge]=a.useState(null),[ve,xe]=a.useState(!1),[fe,be]=a.useState(void 0),[Ce,Ae]=a.useState([]);a.useEffect((()=>{e.reports.onReportListUpdated((e=>Ae(e)))}),[e.reports]);const[je,ye]=a.useState(null),[we,ke]=a.useState(null),[Se,Pe]=a.useState(!1),[Te,Me]=a.useState(""),[Le,Be]=a.useState([]),[Re,Ue]=a.useState(!1),[Fe,Ne]=a.useState(null);a.useEffect((()=>{Ne(e.editEvent.getEventId()),e.admin.updateTemplateEvents(),Ue(!0),(async()=>{const t=await e.events.getAdminEvents("only current");Be(t);const n=await e.events.getAdminEvents("only info");Be(n);const a=await e.events.getAdminEvents("everything");Be(a),Ue(!1)})()}),[e.events,null===je||void 0===je?void 0:je.eventId]);const[We,ze]=a.useState(!0);a.useEffect((()=>{e.events.hasAdminPermission().then((e=>{ze(!e)})).catch((()=>{ze(!0)}))}),[null===je||void 0===je?void 0:je.eventId,e.events]);const[$e,Oe]=a.useState(!1),[Ve,Ge]=a.useState(void 0),Qe=a.useCallback(((e,t)=>{Ge({title:e.title,content:e.content,buttons:[{text:e.cancelButton||"Cancel",handleClick:()=>{t(!1)}},{text:e.okButton||"Okay",handleClick:()=>{t(!0)}}]}),Oe(!0)}),[]),He=a.useCallback(((e,t)=>{Ge({title:e.title,content:e.content,buttons:[{text:e.okButton||"Okay",handleClick:()=>{t()}}]}),Oe(!0)}),[]),[_e,Je]=a.useState(null),Ye=a.useCallback((async()=>{const t=await e.export.fetchChallengeStats();return Je(t),t}),[e.export]),[Ke,et]=a.useState(null),tt=a.useCallback((async()=>{const t=await e.export.fetchBadgeStats();return et(t),t}),[e.export]),[nt,at]=a.useState(null),lt=a.useCallback((async()=>{const t=await e.export.fetchPlayerStats();return at(t),t}),[e.export]),[ot,st]=a.useState(null),it=a.useCallback((async()=>{const t=await e.export.fetchTeamStats();return st(t),t}),[e.export]),[rt,dt]=a.useState([]),ct=a.useCallback((async()=>{const t=await e.shop.getVoucherBatches();dt(t)}),[e.shop]),[ut,ht]=a.useState([]),pt=a.useCallback((async()=>{const t=await e.editEmployeeCodes.getCodes();ht(t)}),[e.editEmployeeCodes]);a.useEffect((()=>{"Employee Referral Program"===W&&pt()}),[W]);const[mt,gt]=a.useState(void 0),[vt,xt]=a.useState(null);a.useEffect((()=>{switch(xt(null),q(null),W){case"Event Hub":Me(""),gt("Event Title or Code");break;case"User Media":e.userMedia.setFilter(null),gt("Username or Challenge");break;case"Players":e.editPlayers.setPlayerFilter(null),gt("Username");break;case"Review":e.review.setFilter(null),gt("Username");break;case"Export":q("Export-Challenges")}}),[e,W]);const ft=a.useCallback((t=>{switch(xt(t),W){case"Event Hub":Me(t);break;case"User Media":e.userMedia.setFilter(t||null);break;case"Players":e.editPlayers.setPlayerFilter(t||null);break;case"Review":e.review.setFilter(t||null)}}),[Me,e.editPlayers.setPlayerFilter,e.userMedia.setFilter,e.review.setFilter,W]),[bt,Ct]=a.useState(!1),[At,jt]=a.useState(""),[yt,wt]=a.useState("all"),St=a.useCallback((e=>{const t="players-"+(new Date).toLocaleDateString()+".csv",n=[];if(null!==nt){const e=["uid","username","email","points","challenges","photos","videos"];n.push(e);for(const t of nt){const e=[t.uid,t.username,t.email,t.points,t.challenges,t.photos,t.videos];n.push(e)}}Lt(t,n)}),[nt]),It=a.useCallback((()=>{const e="teams-"+(new Date).toLocaleDateString()+".csv",t=[];if(null!==ot){const e=["Team ID","Name","Num Members","Score","Bonus"];for(const t in ot.challengeData){const n=ot.challengeData[t];e.push(n.title),e.push("Completed")}t.push(e);for(const n in ot.teamData){const e=ot.teamData[n],a=[];a.push(n),a.push(e.name),a.push(e.numMembers),a.push(e.totalPoints),a.push(e.bonusPoints||0);for(const t in ot.challengeData){const n=e.completed[t];a.push((null===n||void 0===n?void 0:n.points)||""),a.push((null===n||void 0===n?void 0:n.members)||0)}t.push(a)}}Lt(e,t)}),[ot]),cn=a.useCallback((async e=>{const t="challenges-"+(new Date).toLocaleDateString()+".csv",n=[];if(null!==_e){const e=["uid","username","email","joined","timeElapsed"];for(const t in _e.challengeData){const n=_e.challengeData[t];e.push(n.title),e.push("datetime"),e.push("points"),e.push("likes"),e.push("content")}e.push("bonus"),e.push("total"),e.push("likes(total)"),e.push("challenges"),e.push("photos"),e.push("videos"),n.push(e);for(const t in _e.playerData){var a,l,o;const e=_e.playerData[t],s=[];s.push(t),s.push(e.username),s.push(e.email),s.push(e.date.toLocaleDateString()),s.push(e.secondsToFinish||"n/a");for(const t in _e.challengeData){const n=e.completed[t];s.push(((null===n||void 0===n?void 0:n.approved)?"approved":(null===n||void 0===n?void 0:n.rejected)&&"rejected")||""),s.push(null!==n&&void 0!==n&&n.date?n.date.toLocaleStr
1ing():""),s.push(null!==n&&void 0!==n&&n.points?n.points+"":""),s.push((null===n||void 0===n?void 0:n.likes)||0),s.push((null===n||void 0===n?void 0:n.content)||"")}s.push(e.bonus||0),s.push(e.score),s.push(e.totalLikes),s.push((null===nt||void 0===nt||null===(a=nt.find((e=>e.uid===t)))||void 0===a?void 0:a.challenges)||0),s.push((null===nt||void 0===nt||null===(l=nt.find((e=>e.uid===t)))||void 0===l?void 0:l.photos)||0),s.push((null===nt||void 0===nt||null===(o=nt.find((e=>e.uid===t)))||void 0===o?void 0:o.videos)||0),n.push(s)}}const s=Lt(e?null:t,n);if(!e||!_e)return;let i=1;for(const h in _e.playerData){const e=_e.playerData[h];for(const t in _e.challengeData){const n=_e.challengeData[t],a=e.completed[t];("photo"===n.type||"video"===n.type||"write"===n.type)&&(i+=null!==a&&void 0!==a&&a.content?1:0)}}Ct(!0);const r=new(te());r.file("data.csv",s);let d=1;jt(`${Math.min(100,d/i*100).toFixed(0)}% completed`);for(const h in _e.playerData){const e=_e.playerData[h],t=r.folder(h);for(const n in _e.challengeData){const a=_e.challengeData[n],l=e.completed[n];if("photo"===a.type){const e=(null===l||void 0===l?void 0:l.content)||"";if(e){const a=await fetch(e);if(200===a.status){const l=await a.blob(),o=e.substring(e.lastIndexOf("."));null===t||void 0===t||t.file(n+o,l)}d++}}else if("video"===a.type){const e=(null===l||void 0===l?void 0:l.content)||"";if(e){const a=await fetch(e);if(200===a.status){const l=await a.blob(),o=e.substring(e.lastIndexOf("."));null===t||void 0===t||t.file(n+o,l)}d++}}else if("write"===a.type){const e=(null===l||void 0===l?void 0:l.content)||"";e&&(null===t||void 0===t||t.file(n+".txt",e),d++)}jt(`${Math.min(100,d/i*100).toFixed(0)}% completed`)}}const c=await r.generateAsync({type:"blob",compression:"DEFLATE"}),u=document.createElement("a");if(void 0!==u.download){const e=URL.createObjectURL(c);u.setAttribute("href",e),u.setAttribute("download",((null===je||void 0===je?void 0:je.title)||(null===je||void 0===je?void 0:je.eventId)||"challenges")+"-"+(new Date).toLocaleDateString()+".zip"),u.style.visibility="hidden",document.body.appendChild(u),u.click(),document.body.removeChild(u)}Ct(!1)}),[_e,nt,null===je||void 0===je?void 0:je.eventId,null===je||void 0===je?void 0:je.title]),un=a.useCallback((()=>{const e="badges-"+(new Date).toLocaleDateString()+".csv",t=[];if(null!==Ke){const e=Object.keys(Ke.badgeData||{});e.sort(((e,t)=>(Ke.badgeData[e].index||0)-(Ke.badgeData[t].index||0)));const n=e.map((e=>Ke.badgeData[e].title||"")),a=["uid","username","email"].concat(n);t.push(a);const l=Ke?Object.keys(Ke.playerData):[];for(const o of l){const n=[o,Ke.playerData[o].username,Ke.playerData[o].email];for(const t of e){const e=Ke.playerData[o].collected.findIndex((e=>e.id===t));n.push(e>=0?Ke.playerData[o].collected[e].date.toLocaleString():"")}t.push(n)}}Lt(e,t)}),[Ke]),hn=a.useCallback((()=>{const e="referral-codes-"+(new Date).toLocaleDateString()+".csv",t=[];if(null!==ut){const e=["Code","Name","Created At","Referrals"];t.push(e);for(const n of ut){const e=[n.code,n.name,n.createdAt,n.usageCount];t.push(e)}}Lt(e,t)}),[ut]),pn=a.useCallback((t=>{"CSV"===t?"Export-Teams"===V?It():"Export-Challenges"===V?Qe({title:"Download Media Files?",content:"Bundle all submitted photos and videos in a .zip file as well? It may take a few minutes.",okButton:"Include Media",cancelButton:"Just the Challenge Data"},(e=>{cn(e)})):"Export-Badges"===V?un():"Export-Players"===V?St():"Employee Referral Program"===W&&hn():"Approve All"===t?Qe({title:"Confirm",content:"Approve all submitted content?",okButton:"Approve All",cancelButton:"Cancel"},(t=>{t&&(Ct(!0),jt("This may take a while..."),e.review.approveAll((e=>{jt(`${e} items approved`)})).then((()=>{Ct(!1)})).catch((()=>{Ct(!1)})))})):"View All"===t?(wt("all"),e.review.setType("all")):"Only Photo"===t?(wt("photo"),e.review.setType("photo")):"Only Video"===t?(wt("video"),e.review.setType("video")):"Only Text"===t&&(wt("write"),e.review.setType("write"))}),[V,e.review,Qe,St,un,cn,It,hn]);let mn;"Export"!==W&&"Employee Referral Program"!==W||window.cordova?"Review"===W&&(mn=[{value:"Approve All",icon:(0,Ee.jsx)(M.A,{}),disabled:!!vt||bt},{value:"Filter Reviews",icon:(0,Ee.jsx)(B.default,{}),disabled:bt,nested:[{value:"View All",disabled:"all"===yt},{value:"Only Photo",disabled:"photo"===yt},{value:"Only Video",disabled:"video"===yt},{value:"Only Text",disabled:"write"===yt}]}]):mn=[{value:"CSV",icon:(0,Ee.jsx)(g.default,{}),disabled:bt}];const gn=(0,Ee.jsx)(De,{title:$,handleDrawerButton:()=>{Q(!0)},inputPlaceholder:mt,handleInputChange:"Event Hub"===W||"User Media"===W||"Players"===W||"Review"===W?ft:void 0,items:mn,handleItem
1Click:pn});a.useEffect((()=>{e.editEvent.onEventUpdated((t=>{ye(t),ke(e.editEvent.getLimits()),Pe(e.editEvent.isTeamEvent())}))}),[e.editEvent]);const vn=((null===we||void 0===we?void 0:we.maxPlayers)||0)>0&&((null===we||void 0===we?void 0:we.maxPlayers)||0)<=2&&!l;a.useEffect((()=>{vn&&He({title:"Take the next step and upgrade your event!",content:"You can remove the trial limitations and increase the maximum number of players allowed in your event using the Shop section on the main menu."},(()=>{}))}),[vn,null===je||void 0===je?void 0:je.eventId]);const xn=0===Le.length?[[{value:"Event Hub",icon:(0,Ee.jsx)(x.A,{}),badge:0}],[{value:"Help",icon:(0,Ee.jsx)(p.default,{})},{value:"Exit",icon:(0,Ee.jsx)(f.A,{color:"primary"})}]]:[[{value:"Event Hub",icon:(0,Ee.jsx)(x.A,{}),badge:0}],[{value:"Review",icon:(0,Ee.jsx)(m.A,{}),badge:J},We?void 0:{value:"Messages",icon:(0,Ee.jsx)(v.A,{}),badge:H},We?void 0:{value:"User Media",label:"Approved Submissions",icon:(0,Ee.jsx)(g.default,{})},We?void 0:{value:"Reports",label:"Player Conduct",icon:(0,Ee.jsx)(D.A,{}),badge:Ce.reduce(((e,t)=>e+(t.blocked?0:1)),0)},We?void 0:{value:"Activity",icon:(0,Ee.jsx)(E.A,{})},We?void 0:{value:"Export",label:"Data Report",icon:(0,Ee.jsx)(I.A,{})}].filter((e=>void 0!==e)),We?[]:[we||l?{value:"Limits",icon:(0,Ee.jsx)(S.A,{})}:void 0,!we&&!l||window.cordova?void 0:{value:"AddOns",label:"Shop",icon:(0,Ee.jsx)(R.A,{})}].filter((e=>void 0!==e)),We?[]:[{value:"Event",icon:(0,Ee.jsx)(c.A,{})},null!==we&&void 0!==we&&we.noThemeCustomization&&!l?void 0:{value:"Theme",icon:(0,Ee.jsx)(U.A,{})},Se?{value:"Teams",icon:(0,Ee.jsx)(w.A,{})}:void 0,{value:"Announcements",icon:(0,Ee.jsx)(h.A,{})},{value:"Players",icon:(0,Ee.jsx)(C.A,{})}].filter((e=>void 0!==e)),We?[]:[null!==we&&void 0!==we&&we.noEditChallenges&&!l?void 0:{value:"Challenges",icon:(0,Ee.jsx)(u.A,{})},{value:"Badges",icon:(0,Ee.jsx)(k.A,{})},{value:"Validate Badge Voucher",icon:(0,Ee.jsx)(N.A,{})}].filter((e=>void 0!==e)),We?[]:[l?{value:"Delete Event",icon:(0,Ee.jsx)(b.A,{})}:void 0,null!==we&&void 0!==we&&we.noAdminInvites&&!l?void 0:{value:"Invite Admin",icon:(0,Ee.jsx)(L.A,{})},l&&!window.cordova?{value:"Vouchers",icon:(0,Ee.jsx)(F.A,{})}:void 0,void 0].filter((e=>void 0!==e)),We?[]:[null!==we&&void 0!==we&&we.noViewSlideshow&&!l?void 0:{value:"Slideshow",icon:(0,Ee.jsx)(y.A,{})},{value:"Leaderboard",icon:(0,Ee.jsx)(P.A,{})},Se?{value:"Team Leaderboard",icon:(0,Ee.jsx)(T.A,{})}:void 0].filter((e=>void 0!==e)),[{value:"Help",icon:(0,Ee.jsx)(p.default,{})},{value:"Exit",icon:(0,Ee.jsx)(f.A,{color:"primary"})}].filter((e=>void 0!==e))].filter((e=>e.length>0));xn.forEach((e=>e.forEach((e=>e&&(e.selected=e.value===W)))));const fn=a.useCallback((e=>{z(e),O(e);for(const t of xn)for(const n of t)if(n.value===e&&n.label)return void O(n.label)}),[z,O,xn]),bn="Export"===W?[{value:"Export-Challenges",label:"Challenges",selected:"Export-Challenges"===V},Se?{value:"Export-Teams",label:"Teams",selected:"Export-Teams"===V}:void 0,{value:"Export-Badges",label:"Badges",selected:"Export-Badges"===V}].filter((e=>!!e)):void 0,[Cn,An]=a.useState(!1),jn=a.useCallback((e=>{Cn?Qe({title:"Confirm",content:"Continue without saving changes?"},(t=>{t&&(An(!1),e())})):e()}),[Qe,Cn]),yn=a.useMemo((()=>(0,Ee.jsx)(Et,{open:"Event Hub"===W,handleEventClicked:async t=>{await e.events.handlePlay(t)},domain:e.events,events:Le,playing:Fe,filter:Te,loading:Re})),[W,Le,Fe,Te,Re]),wn=a.useMemo((()=>(0,Ee.jsx)(an,{open:"Messages"===W,handleUserClicked:e=>{X(e)},supportAdmin:e.supportAdmin,handleBadgeChanged:e=>{_(e)}})),[e.supportAdmin,W]),kn=a.useMemo((()=>(0,Ee.jsx)(ln,{open:"Review"===W,review:e.review,handleReviewSelected:e=>{ee(e)},handleBadgeChanged:e=>{Y(e)}})),[e.review,W]),Sn=a.useCallback((e=>{fn("Players");const t=r.find((t=>t.uid===e))||r.find((t=>t.username===e));t&&ge(t)}),[r]),En=a.useMemo((()=>(0,Ee.jsx)(Ot,{open:"Reports"===W,reportList:Ce,reportsDomain:e.reports,showConfirmPopup:Qe,showAlertPopup:He,setLoading:n,handleViewPlayer:Sn})),[e.reports,Ce,He,Qe,W,Sn]),[Pn,Tn]=a.useState([]);a.useEffect((()=>{"User Media"===W?e.userMedia.onUserMediaUpdated((e=>{Tn([...e])})):(e.userMedia.onUserMediaUpdated(null),Tn([]))}),[e.userMedia.onUserMediaUpdated,W,Tn]);const In=a.useMemo((()=>(0,Ee.jsx)(nn,{open:"User Media"===W,userMedia:e.userMedia,userMediaList:Pn,handleUserMediaClicked:e=>{ae(e)}})),[e.userMedia,W,Pn,ae]),Mn=a.useMemo((()=>(0,Ee.jsx)(Pt,{open:"Limits"===W,editEvent:e.editEvent,isSuperUser:l,isTeamEvent:Se,limits:we,handleContentChanged:An})),[Se,l,we,e.editEvent,W]),Ln=a.useMemo((()=>(0,Ee.jsx)(Tt,{open:"AddOns"===W,shop:e.shop,email:s||void 0}
1)),[W,e.shop,s]),[Bn,Rn]=a.useState(!1),Un=a.useMemo((()=>(0,Ee.jsx)(Zt,{open:"Event"===W,canCustomizeJoinCodes:!vn,eventInfo:je,isSuperUser:l,isTrialEvent:vn,editEvent:e.editEvent,uploader:e.platform.uploadFile,showAlertPopup:He,showConfirmPopup:Qe,handleContentChanged:An,handleEditWhitelist:()=>{Rn(!0)}})),[e.editEvent,e.platform.uploadFile,W,je,Qe,l]),Fn=a.useMemo((()=>(0,Ee.jsx)(en,{open:Bn,emails:(null===je||void 0===je?void 0:je.whitelist)||[],handleClose:()=>{Rn(!1)},handleListPlayer:e.editEvent.handleListPlayer,handleUnlistPlayer:e.editEvent.handleUnlistPlayer,showConfirmPopup:Qe})),[Bn,null===je||void 0===je?void 0:je.whitelist,e.editEvent.handleListPlayer,e.editEvent.handleUnlistPlayer,Qe]),Dn=a.useMemo((()=>(0,Ee.jsx)(tn,{open:"Theme"===W,eventInfo:je,editEvent:e.editEvent,uploader:e.platform.uploadFile,handleContentChanged:An})),[W,je,e.editEvent,e.platform.uploadFile]),Nn=a.useMemo((()=>(0,Ee.jsx)(Xt,{open:"Announcements"===W,editAnnouncements:e.editAnnouncements,uploader:e.platform.uploadFile})),[e.editAnnouncements,e.platform.uploadFile,W]),Wn=a.useMemo((()=>(0,Ee.jsx)($t,{open:"Activity"===W,activity:e.activity})),[e.activity,W]),zn=a.useMemo((()=>(0,Ee.jsx)(Jt,{open:"Players"===W,players:r,editPlayers:e.editPlayers,handlePlayerClicked:e=>{ge(e)},handleMessageClicked:e=>{fn("Messages"),X(e.uid)},showConfirmPopup:Qe})),[e.editPlayers,W,Qe,r]),$n=a.useMemo((()=>(0,Ee.jsx)(Kt,{open:"Challenges"===W,editChallenges:e.editChallenges,handleChallengeClick:e=>{"multiple"!==e.type||se&&se===e.challengeId?oe(e):ie(e.challengeId)},selectedMultipleChallengeId:se||void 0})),[e.editChallenges,se,W]),On=a.useMemo((()=>(0,Ee.jsx)(Ht,{open:"Teams"===W,handleTeamSelected:e=>{de(e)},editTeams:e.editTeams})),[e.editTeams,W]),Vn=a.useMemo((()=>(0,Ee.jsx)(Vt,{open:"Badges"===W,disabled:(null===we||void 0===we?void 0:we.noEditBadges)&&!l||!1,editBadges:e.editBadges,handleBadgeSelected:(e,t)=>{ue(e),pe(t)}})),[e.editBadges,W]),qn=a.useMemo((()=>(0,Ee.jsx)(Gt,{open:"Validate Badge Voucher"===W,disabled:((null===we||void 0===we?void 0:we.noEditBadges)||!(null!==we&&void 0!==we&&we.advancedBadgeFeatures))&&!l,editBadges:e.editBadges,showAlertPopup:He,cordovaQRScanner:e.platform.cordovaQRScanner})),[e.editBadges,W,He]),Gn=a.useMemo((()=>(0,Ee.jsx)(Qt,{open:"Employee Referral Program"===W,referralCodes:ut,handleDelete:async t=>{const n=e.editEmployeeCodes.deleteCode(t);return await pt(),n},showConfirmPopup:Qe})),[e.editEmployeeCodes,W,Qe,ut]),Qn=a.useMemo((()=>(0,Ee.jsx)(Ft,{open:"Leaderboard"===W,leaderboard:e.leaderboard})),[e.leaderboard,W]),Hn=a.useMemo((()=>(0,Ee.jsx)(Dt,{open:"Team Leaderboard"===W,teamLeaderboard:e.teamLeaderboard})),[e.teamLeaderboard,W]),_n=a.useMemo((()=>(0,Ee.jsx)(Rt,{open:"Export"===W&&"Export-Challenges"===V,export:{fetchChallengeStats:Ye,fetchBadgeStats:tt,fetchTeamStats:it,fetchPlayerStats:lt}})),[Ye,it,tt,lt,W,V]),Jn=a.useMemo((()=>(0,Ee.jsx)(Bt,{open:"Export"===W&&"Export-Teams"===V,export:{fetchChallengeStats:Ye,fetchBadgeStats:tt,fetchTeamStats:it,fetchPlayerStats:lt}})),[Ye,it,tt,lt,W,V]),Yn=a.useMemo((()=>(0,Ee.jsx)(Ut,{open:"Export"===W&&"Export-Badges"===V,export:{fetchChallengeStats:Ye,fetchBadgeStats:tt,fetchTeamStats:it,fetchPlayerStats:lt}})),[Ye,it,tt,lt,W,V]),Kn=a.useMemo((()=>(0,Ee.jsx)(zt,{open:"Vouchers"===W,voucherBatches:rt,fetchVoucherBatches:ct,handleExportBatch:e=>{const t=rt.find((t=>t.batch===e));if(!t)return;const n=`vouchers-${(new Date).toLocaleDateString()}.csv`,a=[];a.push(["Voucher","Used"]);for(const l of t.vouchers)a.push([l.voucher,l.used?"USED":""]);Lt(n,a)}})),[W,ct,rt]),Xn=a.useMemo((()=>(0,Ee.jsx)(on,{supportMessageUid:K,handleClose:()=>{X(null)},supportAdmin:e.supportAdmin})),[e.supportAdmin,K]),Zn=a.useMemo((()=>(0,Ee.jsx)(Yt,{player:me,review:e.review,editPlayers:e.editPlayers,handleClose:()=>{ge(null)},showAlertPopup:He,showConfirmPopup:Qe,admin:e.admin,superUser:l})),[e.editPlayers,e.review,e.admin,me,Qe,He,l]),ea=a.useMemo((()=>(0,Ee.jsx)(sn,{feedIsDisabled:(null===je||void 0===je?void 0:je.disableFeed)||!1,selectedReview:Z,handleClose:()=>{ee(null)},showConfirmPopup:Qe,review:e.review})),[e.review,Z,Qe,null===je||void 0===je?void 0:je.disableFeed]),ta=a.useMemo((()=>(0,Ee.jsx)(dn,{selectedUserMedia:ne,cancelReview:async(t,n,a)=>{const l=await e.review.cancelReview(t,n,a),o=Pn.map((e=>e.eventId===(null===ne||void 0===ne?void 0:ne.eventId)&&e.challengeId===(null===ne||void 0===ne?void 0:ne.challengeId)&&e.username===(null===ne||void 0===ne?void 0:ne.username)?{...e,reviewCanceled:!0}:e));return Tn(o),ae(null),l},showConfirmPopup:Qe,handleClose:()=>{ae(null)}})),[ne,Qe,e.review,Pn]),[na,aa]=a.useState({});a.useEffect((()=>{le&&e.editChallenges.getChallengeTemplates().then((e=>aa(e)))}),[e.editChallenges.getChallengeTemplates,le]);const la=a.useMemo((()=>{let t=(null===le||void 0===le?void 0:le.type)||"";return"route"===(null===le||void 0===le?void 0:le.type)&&null!==le&&void 0!==le&&le.route&&(t="explore"),(0,Ee.jsx)(rn,{challenge:le,editChallenges:e.editChallenges,showConfirmPopup:Qe,handleClose:()=>{jn((()=>{oe(null)}))},uploader:e.platform.uploadFile,handleContentChanged:e=>{An(e)},isSuperUser:l,templates:na[t||""]||{public:[],private:[]},onApplyTemplate:e=>{const n=na[t||""]||{public:[],private:[]},a=n.private.find((t=>t.challengeId===e))||n.public.find((t=>t.challengeId===e));if(a){const t={...a,inChallengeLibrary:!1,challengeId:(null===le||void 0===le?void 0:le.challengeId)||a.challengeId,parent:(null===le||void 0===le?void 0:le.parent)||void 0,templateId:e};oe(null),setTimeout((()=>{oe(t)}),1)}}})}),[e.editChallenges,le,e.platform.uploadFile,Qe,jn,l,na]),oa=a.useMemo((()=>(0,Ee.jsx)(_t,{editTeams:e.editTeams,team:re,handleClose:()=>{jn((()=>{de(null)}))},showConfirmPopup:Qe,uploader:e.platform.uploadFile,handleContentChanged:An,handleViewPlayer:Sn})),[e.editTeams,e.platform.uploadFile,re,Qe,jn,Sn]),sa=a.useMemo((()=>(0,Ee.jsx)(qt,{editBadges:e.editBadges,disabled:(null===we||void 0===we?void 0:we.noEditBadges)&&!l||!1,badge:ce,challenges:he,handleClose:()=>{jn((()=>{ue(null)}))},showConfirmPopup:Qe,uploader:e.platform.uploadFile,handleContentChanged:An,advancedBadgeFeatures:(null===we||void 0===we?void 0:we.advancedBadgeFeatures)||l})),[e.editBadges,e.platform.uploadFile,ce,he,Qe,jn,l,null===we||void 0===we?void 0:we.advancedBadgeFeatures]),ia=a.useMemo((()=>(0,Ee.jsx)(qe,{title:"Alert",content:"Are you sure?",handleClose:()=>{Oe(!1)},...Ve,open:$e})),[Ve,$e]),ra=a.useMemo((()=>(0,Ee.jsx)(Xe,{title:"Input",content:"Enter email address:",handleClose:()=>{xe(!1)}
1,...fe,open:ve})),[fe,ve]),[da,ca]=a.useState(!1),ua=a.useMemo((()=>(0,Ee.jsx)(Mt,{open:da,getTemplateEvents:e.admin.getTemplateEvents,onCancel:()=>{ca(!1)},onDone:(t,a)=>{n(!0),e.admin.createEvent(t,a||void 0).then((e=>{ca(!1),n(!1),e.success?fn("Challenges"):He({title:"Error",content:e.message||"Unknown"},(()=>{}))})).catch((()=>{n(!1)}))},isSuperUser:l})),[e.admin,da,He,l]),[ha,pa]=a.useState(!1),ma=a.useMemo((()=>(0,Ee.jsx)(Nt,{open:ha,getFullCatalog:e.shop.getFullCatalog,onCancel:()=>{pa(!1)},onDone:(t,n,a)=>{pa(!1),e.shop.generateVouchers(a,"",t,n).then((()=>{ct()})).catch((()=>{}))}})),[ct,e.shop,ha]),[ga,va]=a.useState(!1),xa=a.useMemo((()=>(0,Ee.jsx)(Wt,{open:ga,onCancel:()=>{va(!1)},onDone:t=>{va(!1),e.editEmployeeCodes.createCode(t).then((()=>{pt()})).catch((()=>{}))}})),[e.editEmployeeCodes,ga]);a.useEffect((()=>{switch(W){case"Event Hub":ba({value:"Create Event",icon:(0,Ee.jsx)(A.A,{})}),Aa(void 0);break;case"Announcements":ba({value:"Add Announcement",icon:(0,Ee.jsx)(A.A,{})}),Aa(void 0);break;case"Challenges":ba(se?{value:"Multiple Back",icon:(0,Ee.jsx)(j.A,{})}:void 0);let e=[{value:"Add GPS",label:"GPS",icon:Ze.coloredIcons.gps},{value:"Add QR",label:"QR",icon:Ze.coloredIcons.qr},{value:"Add Video",label:"Video",icon:Ze.coloredIcons.video},{value:"Add Photo",label:"Photo",icon:Ze.coloredIcons.photo},{value:"Add Info",label:"Info",icon:Ze.coloredIcons.info},{value:"Add Quiz",label:"Quiz",icon:Ze.coloredIcons.quiz},{value:"Add Poll",label:"Poll",icon:Ze.coloredIcons.poll},{value:"Add Route",label:"Route",icon:Ze.coloredIcons.route},{value:"Add Explore",label:"Explore",icon:Ze.coloredIcons.explore},{value:"Add Text",label:"Text",icon:Ze.coloredIcons.write}].filter((e=>!!e));se||e.push({value:"Add Multiple",label:"Group",icon:Ze.coloredIcons.multiple}),Aa(e);break;case"Teams":ba({value:"Add Team",icon:(0,Ee.jsx)(A.A,{})}),Aa(void 0);break;case"Badges":null!==we&&void 0!==we&&we.noEditBadges&&!l?ba(void 0):ba({value:"Add Badge",icon:(0,Ee.jsx)(A.A,{})}),Aa(void 0);break;case"Vouchers":ba({value:"Add Vouchers",icon:(0,Ee.jsx)(A.A,{})}),Aa(void 0);break;case"Employee Referral Program":ba({value:"Create Referral Code",icon:(0,Ee.jsx)(A.A,{})}),Aa(void 0);break;default:ba(void 0),Aa(void 0)}}),[W,se]);const[fa,ba]=a.useState(void 0),[Ca,Aa]=a.useState(void 0);return(0,Ee.jsxs)(a.Fragment,{children:[(0,Ee.jsxs)(Ie,{title:gn,image:kt,drawer:xn,tabs:bn,fab:fa,speedDial:Ca,handleClick:t=>{switch(t){case"Event Hub":case"Review":case"Event":case"Messages":case"Limits":case"AddOns":case"User Media":case"Theme":case"Vouchers":case"Activity":case"Challenges":case"Badges":case"Validate Badge Voucher":case"Employee Referral Program":case"Announcements":case"Players":case"Teams":case"Leaderboard":case"Team Leaderboard":case"Export":case"Reports":jn((()=>{fn(t)}));break;
1case"Export-Challenges":case"Export-Badges":case"Export-Teams":q(t);break;case"Add Announcement":n(!0),e.editAnnouncements.createAnnouncement().then((()=>{n(!1),window.scrollTo(0,0)})).catch((()=>{n(!1)}));break;case"Add Team":n(!0),e.editTeams.createTeam({}).then((()=>{n(!1),window.scrollTo(0,0)})).catch((()=>{n(!1)}));break;case"Add Badge":e.editBadges.createBadge({}).then((()=>{}));break;case"Add Vouchers":pa(!0);break;case"Create Referral Code":va(!0);break;case"Create Event":ca(!0);break;case"Delete Event":Qe({title:"Confirm",content:"Delete event permanently?",okButton:"Delete",cancelButton:"Cancel"},(t=>{t&&(n(!0),e.admin.deleteEvent().then((e=>{n(!1),e.success?window.location.reload():He({title:"Error",content:e.message||"Unknown"},(()=>{}))})).catch((()=>{n(!1),He({title:"Error",content:"Could not delete event."},(()=>{}))})))}));break;case"Invite Admin":l=[{text:"Limit role to minor admin",value:"minor",helper:"Minor admins can only help with reviewing submissions."}],o=(t,a)=>{t&&(n(!0),(null!==a&&void 0!==a&&a.minor?e.admin.inviteMinor:e.admin.inviteAdmin)(t).then((e=>{n(!1);const a=null!==e&&void 0!==e&&e.success?"Success":"Error";let l=(null===e||void 0===e?void 0:e.message)||`${t} is now an admin.`;e.success||(l="Cannot invite more admins."===(null===e||void 0===e?void 0:e.message)?"Cannot invite additional admin, trial event limits permit one admin per event. To upgrade your account, please visit the Shop tab.":`Could not invite ${t}. Please make sure that the email address is correct and that it is associated with an Eventzee account.`),He({title:a,content:l},(()=>{}))})).catch((()=>{n(!1),He({title:"Error",content:`Could not invite ${t}. Please make sure that the email address is correct and that it is associated with an Eventzee account.`},(()=>{}))})))},be({title:(a={title:"Invite Admin",content:"Enter email address to invite:"}).title,content:a.content,buttons:[{text:a.cancelButton||"Cancel",handleClick:e=>{}},{text:a.okButton||"Submit",handleClick:e=>{o(e)}}],checkboxes:l}),xe(!0);break;case"Slideshow":const s=e.editEvent.getEventId();let i=`${window.location.toString().replace(window.location.hash,"")}#slideshow&eventId=${s}`;window.cordova&&(i=`https://eventzee-app.web.app/#slideshow&eventId=${s}`),window.open(i,"_system");break;case"Add GPS":n(!0),e.editChallenges.createChallenge({type:"gps",parent:se}).then((()=>{n(!1)})).catch((()=>{n(!1)}));break;case"Add QR":n(!0),e.editChallenges.createChallenge({type:"qr",parent:se}).then((()=>{n(!1)})).catch((()=>{n(!1)}));break;case"Add Video":n(!0),e.editChallenges.createChallenge({type:"video",parent:se}).then((()=>{n(!1)})).catch((()=>{n(!1)}));break;case"Add Photo":n(!0),e.editChallenges.createChallenge({type:"photo",parent:se}).then((()=>{n(!1)})).catch((()=>{n(!1)}));break;case"Add Info":n(!0),e.editChallenges.createChallenge({type:"info",parent:se}).then((()=>{n(!1)})).catch((()=>{n(!1)}));break;case"Add Quiz":n(!0),e.editChallenges.createChallenge({type:"quiz",parent:se}).then((()=>{n(!1)})).catch((()=>{n(!1)}));break;case"Add Text":n(!0),e.editChallenges.createChallenge({type:"write",parent:se}).then((()=>{n(!1)})).catch((()=>{n(!1)}));break;case"Add Poll":n(!0),e.editChallenges.createChallenge({type:"poll",parent:se}).then((()=>{n(!1)})).catch((()=>{n(!1)}));break;case"Add Route":n(!0),e.editChallenges.createChallenge({type:"route",parent:se}).then((()=>{n(!1)})).catch((()=>{n(!1)}));break;case"Add Explore":n(!0),e.editChallenges.createChallenge({type:"route",parent:se,route:{boundary:{type:"FeatureCollection",features:[]}}}).then((()=>{n(!1)})).catch((()=>{n(!1)}));break;case"Add Multiple":n(!0),e.editChallenges.createChallenge({type:"multiple"}).then((()=>{n(!1)})).catch((()=>{n(!1)}));break;case"Multiple Back":ie(void 0);break;case"Exit":jn((()=>{e.handleExitAdmin()}));break;case"Help":let r="https://eventzee.freshdesk.com/support/solutions/articles/48001178762-eventzee-app-admin-tool-overview";r="https://eventzee.freshdesk.com/support/solutions/articles/48001178762-eventzee-app-admin-tool-overview",window.open(r,"_system")}var a,l,o},drawerOpen:G,handleDrawerClose:()=>{Q(!1)},children:[yn,In,Mn,Ln,Un,Dn,Nn,zn,$n,Wn,kn,wn,On,Vn,qn,Gn,Qn,Hn,_n,Yn,Jn,Kn,En]}),ea,Xn,ta,la,oa,Zn,sa,Fn,ua,ma,xa,ia,ra,(0,Ee.jsx)(Ze.FullscreenLoading,{open:bt||t,text:bt?At:""})]})}function Et(e){return e.open?(0,Ee.jsx)(Ze.EventHub,{loading:e.loading,events:e.events,handleEventClicked:async t=>{await e.handleEventClicked(t)},nowPlayingEventId:e.playing||"",filter:e.filter}):null}function Pt(e){return e.open?(0,Ee.jsx)(Ze.EditLimits,{updateLimits:e.editEvent.updateLimits,isSuperUser:e.isSuperUser,isTeamEvent:e.isTeamEvent,limits:e.limits,handleContentChanged:e.handleContentChanged}):null}function Tt(e){return e.open?(0,Ee.jsx)(gt,{shop:e.shop,email:e.email,showAddOns:!0}):null}const It=(0,W.A)((e=>(0,z.A)({formControl:{margin:e.spacing(1),minWidth:120,maxWidth:"100%"},selectEmpty:{marginTop:e.spacing(2)}})));function Mt(e){const t=It(),[n,l]=a.useState(!1),[o,s]=a.useState(null),i=e.getTemplateEvents(),r=(0,Ee.jsxs)(X.A,{children:[(0,Ee.jsx)(X.A,{marginBottom:2,children:(0,Ee.jsx)(Z.A,{severity:"info",children:'Need a little help getting started? You can choose a template with pre-designed challenges from the drop down menu below to populate your event with some example challenges from our extensive library. If you\'d like to start with a blank event, tap the "Create" button below to start setting up your event.'})}),e.isSuperUser?(0,Ee.jsxs)(Q.A,{component:"fieldset",className:t.formControl,children:[(0,Ee.jsx)(_.A,{component:"legend",children:"Settings"}),(0,Ee.jsx)(J.A,{children:(0,Ee.jsx)(Y.A,{control:(0,Ee.jsx)(K.A,{checked:n,onChange:t=>{l(e.isSuperUser&&t.target.checked||!1)},name:"isTeamEvent",disabled:!e.isSuperUser}),label:"Team Event",disabled:!!o})}),(0,Ee.jsx)(G.A,{children:"Only applicable if no template is selected"})]}):null,(0,Ee.jsxs)(Q.A,{className:t.formControl,children:[(0,Ee.jsx)(O.A,{id:"demo-simple-select-helper-label",children:"Template Event"}),(0,Ee.jsxs)(H.A,{labelId:"demo-simple-select-helper-label",id:"demo-simple-select-helper",value:o||"",onChange:e=>{s(e.target.value||null)},children:[(0,Ee.jsx)(q.A,{value:"",children:(0,Ee.jsx)("em",{children:"None"})}),i.map((e=>(0,Ee.jsx)(q.A,{value:e.eventId,children:e.title},e.eventId)))]}),(0,Ee.jsx)(G.A,{children:"Choose a template event to start with pre-existing content"})]})]});return(0,Ee.jsx)(qe,{open:e.open,title:"Create Event",content:r,buttons:[{text:"Cancel",handleClick:()=>{e.onCancel()}},{text:"Create",handleClick:()=>{e.onDone(n,o||null)}}]})}function Lt(e,t){const n=function(e){let t="";for(let n=0;n<e.length;n++){let a=null!==e[n]&&e[n].toString?e[n].toString():"";
1e[n]instanceof Date&&(a=e[n].toLocaleString());let l=a.replace(/"/g,'""');l.search(/("|,|\n)/g)>=0&&(l='"'+l+'"'),n>0&&(t+=","),t+=l}return t+"\n"};let a="";for(let l=0;l<t.length;l++)a+=n(t[l]);if(e){let t=new Blob([a],{type:"text/csv;charset=utf-8;"});const n=document.createElement("a");if(void 0!==n.download){const a=URL.createObjectURL(t);n.setAttribute("href",a),n.setAttribute("download",e),n.style.visibility="hidden",document.body.appendChild(n),n.click(),document.body.removeChild(n)}}return a}function Bt(e){return e.open?(0,Ee.jsx)(Ze.ExportTeams,{...e.export}):null}function Rt(e){return e.open?(0,Ee.jsx)(Ze.ExportChallenges,{...e.export}):null}function Ut(e){return e.open?(0,Ee.jsx)(Ze.ExportBadges,{...e.export}):null}function Ft(e){const[t,n]=a.useState([]);return a.useEffect((()=>{e.leaderboard.onLeaderboardUpdated((e=>{n(e)}))}),[e.leaderboard]),e.open?(0,Ee.jsx)(Ze.Leaderboard,{entries:t}):null}function Dt(e){const[t,n]=a.useState([]);return a.useEffect((()=>{e.teamLeaderboard.onLeaderboardUpdated((e=>{n(e)}))}),[e.teamLeaderboard]),e.open?(0,Ee.jsx)(Ze.Leaderboard,{entries:t}):null}function Nt(e){const t=(0,$.A)(),n=It(),[l,o]=a.useState(100),[s,i]=a.useState(null),[r,d]=a.useState(null),[c,u]=a.useState(null);a.useEffect((()=>{c||e.getFullCatalog().then((e=>u(e)))}),[c,e]);const h=Array.from(new Set((null===c||void 0===c?void 0:c.map((e=>e.price)))||[])),p=(0,Ee.jsxs)(X.A,{display:"flex",flexDirection:"column",children:[(0,Ee.jsx)(Q.A,{component:"fieldset",className:n.formControl,children:(0,Ee.jsx)(V.A,{id:"numVouchers",label:"Num. Vouchers",fullWidth:!0,helperText:"Number of vouchers to generate",value:l,onChange:e=>{const t=parseInt(e.target.value,10)||100;o(t)}})}),(0,Ee.jsx)(pe.A,{variant:"subtitle1",color:"textPrimary",style:{marginTop:t.spacing(3)},children:"Target Products"}),(0,Ee.jsxs)(Q.A,{className:n.formControl,children:[(0,Ee.jsx)(O.A,{id:"demo-simple-select-helper-label",children:"Specific Product"}),(0,Ee.jsxs)(H.A,{labelId:"demo-simple-select-helper-label",id:"demo-simple-select-helper",value:s||"",onChange:e=>{d(null),i(e.target.value||null)},children:[(0,Ee.jsx)(q.A,{value:"",children:"None"},"product-none"),(c||[]).map((e=>(0,Ee.jsx)(q.A,{value:e.productId,children:e.title},e.productId)))]}),(0,Ee.jsx)(G.A,{children:"Select a product to associate with this voucher batch"})]}),(0,Ee.jsx)(pe.A,{align:"center",variant:"button",children:"or"}),(0,Ee.jsxs)(Q.A,{className:n.formControl,children:[(0,Ee.jsx)(O.A,{id:"demo-simple-select-helper-label-2",children:"Price Point"}),(0,Ee.jsxs)(H.A,{labelId:"demo-simple-select-helper-label-2",id:"demo-simple-select-helper-2",value:r||"",onChange:e=>{i(null),d(e.target.value||null)},children:[(0,Ee.jsx)(q.A,{value:"",children:"None"},"price-none"),h.map((e=>(0,Ee.jsx)(q.A,{value:e,children:e},e)))]}),(0,Ee.jsx)(G.A,{children:"Select a price point to match this voucher batch"})]})]});return(0,Ee.jsx)(qe,{open:e.open,title:"Generate Vouchers",content:p,buttons:[{text:"Cancel",handleClick:()=>{e.onCancel()}},{text:"Create",handleClick:()=>{(s||r)&&e.onDone(s||void 0,r||void 0,l)}}]})}function Wt(e){const t=It(),[n,l]=a.useState(""),o=(0,Ee.jsx)(X.A,{display:"flex",flexDirection:"column",children:(0,Ee.jsx)(Q.A,{component:"fieldset",className:t.formControl,children:(0,Ee.jsx)(V.A,{id:"name",label:"Employee Name",fullWidth:!0,helperText:"The name of the employee or another unique identifier for the new referral code that will be created.",value:n,onChange:e=>{l(e.target.value)}})})});return(0,Ee.jsx)(qe,{open:e.open,title:"Create Referral Code",content:o,buttons:[{text:"Cancel",handleClick:()=>{e.onCancel()}},{text:"Create",handleClick:()=>{n&&e.onDone(n)}}]})}function zt(e){const t=e.fetchVoucherBatches;return a.useEffect((()=>{e.open&&t()}),[t,e.open]),e.open?(0,Ee.jsx)(Ze.EditVoucherList,{batches:e.voucherBatches,handleExportBatch:e.handleExportBatch}):null}function $t(e){const[t,n]=a.useState([]);return a.useEffect((()=>{e.activity.onActivityUpdated((e=>{n(e)}))})),e.open?(0,Ee.jsx)(Ze.Activity,{entries:t}):null}function Ot(e){return e.open?(0,Ee.jsx)(Ze.EditReports,{reportList:e.reportList,handleBlock:t=>{e.showConfirmPopup({title:"Block Player?",content:`Messages and Feed entries from ${t} will be blocked for everyone.`},(n=>{n&&(e.setLoading(!0),e.reportsDomain.blockPlayer(t).then((n=>{e.setLoading(!1),n.success?e.showAlertPopup({title:"Success",content:`${t} is now blocked`},(()=>{})):e.showAlertPopup({title:"Error",content:n.error||`Could not block ${t}.`},(()=>{}))})))}))},handleUnblock:t=>{e.showConfirmPopup({title:"Unblock Player?",content:`Messages and Feed entries from ${t} will be visible to everyone.`},(n=>{n&&(e.setLoading(!0),e.reportsDomain.unblockPlayer(t).then((n=>{e.setLoading(!1),n.success?e.showAlertPopup({title:"Success",content:`${t} is now unblocked`},(()=>{})):e.showAlertPopup({title:"Error",content:n.error||`Could not unblock ${t}.`},(()=>{}))})))}))},handleClear:t=>{e.showConfirmPopup({title:"Confirm",content:"Remove this report from the list permanently?"},(n=>{n&&(e.setLoading(!0),e.reportsDomain.clearReport(t).then((t=>
1{e.setLoading(!1),t.success||e.showAlertPopup({title:"Error",content:t.error||"Could not clear report."},(()=>{}))})))}))},handleView:e.handleViewPlayer}):null}function Vt(e){const[t,n]=a.useState([]),[l,o]=a.useState([]);return a.useEffect((()=>(e.editBadges.onBadgesUpdated(((e,t)=>{n(e),o(t)})),()=>{e.editBadges.onBadgesUpdated(null)})),[e.editBadges]),e.open?(0,Ee.jsx)(Ze.EditBadgeList,{...e.editBadges,disabled:e.disabled,badges:t,handleBadgeClick:n=>{const a=t.find((e=>e.id===n));a&&e.handleBadgeSelected(a,l)}}):null}function qt(e){return(0,Ee.jsx)(Ke,{handleClose:e.handleClose,title:"Edit Badge",open:null!==e.badge,buttons:[],content:e.badge?(0,Ee.jsx)(Ze.EditBadgeDetails,{handleContentChanged:e.handleContentChanged,uploader:e.uploader,updateBadge:e.editBadges.updateBadge,deleteBadge:e.editBadges.deleteBadge,showConfirmPopup:e.showConfirmPopup,badge:e.badge,challenges:e.challenges,handleClose:e.handleClose,disabled:e.disabled,advancedBadgeFeatures:e.advancedBadgeFeatures}):null})}function Gt(e){return e.open?(0,Ee.jsx)(Ze.ValidateBadgeVoucher,{...e.editBadges,disabled:e.disabled,showAlertPopup:e.showAlertPopup,cordovaQRScanner:e.cordovaQRScanner}):null}function Qt(e){return e.open?(0,Ee.jsx)(Ze.EditEmployeeCodes,{referralCodes:e.referralCodes,handleDelete:e.handleDelete,handleView:e=>{},showConfirmPopup:e.showConfirmPopup}):null}function Ht(e){const[t,n]=a.useState([]);return a.useEffect((()=>(e.editTeams.onTeamsUpdated((e=>{n(e)})),()=>{e.editTeams.onTeamsUpdated(null)})),[e]),e.open?(0,Ee.jsx)(Ze.EditTeamList,{teams:t,handleTeamClicked:n=>{const a=t.find((e=>e.teamId===n));e.handleTeamSelected(a||null)}}):null}function _t(e){return(0,Ee.jsx)(Ke,{handleClose:e.handleClose,title:"Edit Team",open:null!==e.team,buttons:[],content:e.team?(0,Ee.jsx)(Ze.EditTeamDetails,{...e.editTeams,uploader:e.uploader,showConfirmPopup:e.showConfirmPopup,team:e.team,handleContentChanged:e.handleContentChanged,handleClose:e.handleClose,handleViewPlayer:e.handleViewPlayer}):null})}function Jt(e){const t=e.players;return e.open?(0,Ee.jsx)(Ze.EditPlayerList,{players:t,handlePlayerClicked:n=>{const a=t.find((e=>e.uid===n.uid&&n.uid));a&&e.handlePlayerClicked(a)},handleMessageClicked:n=>{const a=t.find((e=>e.uid===n.uid&&n.uid));a&&e.handleMessageClicked(a)}}):null}function Yt(e){return(0,Ee.jsx)(Ke,{handleClose:e.handleClose,title:"Player Details",open:null!==e.player,buttons:[],content:e.player?(0,Ee.jsx)(Ze.EditPlayerDetails,{...e.review,...e.editPlayers,...e.admin,player:e.player,showAlertPopup:e.showAlertPopup,showConfirmPopup:e.showConfirmPopup,handleClose:e.handleClose,superUser:e.superUser}):null})}function Kt(e){return e.open?(0,Ee.jsx)(Ze.EditChallengeList,{...e.editChallenges,handleChallengeClick:e.handleChallengeClick,selectedMultipleChallengeId:e.selectedMultipleChallengeId}):null}function Xt(e){return e.open?(0,Ee.jsx)(Ze.EditAnnouncements,{...e.editAnnouncements,uploader:e.uploader}):null}function Zt(e){return e.open?(0,Ee.jsx)(Ze.EditEventDetails,{canCustomizeJoinCodes:e.canCustomizeJoinCodes,handleContentChanged:e.handleContentChanged,eventInfo:e.eventInfo,isSuperUser:e.isSuperUser,isTrialEvent:e.isTrialEvent,...e.editEvent,uploader:e.uploader,showAlertPopup:e.showAlertPopup,showConfirmPopup:e.showConfirmPopup,handleEditWhitelist:e.handleEditWhitelist}):null}function en(e){return(0,Ee.jsx)(Ke,{handleClose:e.handleClose,title:"Edit Whitelist",open:e.open,buttons:[],content:(0,Ee.jsx)(Ze.EditWhitelist,{emails:e.emails,handleListPlayer:e.handleListPlayer,handleUnlistPlayer:e.handleUnlistPlayer,showConfirmPopup:e.showConfirmPopup})})}function tn(e){return e.open?(0,Ee.jsx)(Ze.EditTheme,{handleContentChanged:e.handleContentChanged,eventInfo:e.eventInfo,...e.editEvent,uploader:e.uploader}):null}function nn(e){return e.open?(0,Ee.jsx)(Ze.UserMediaList,{...e.userMedia,items:e.userMediaList,handleItemClick:t=>{e.handleUserMediaClicked(t)}}):null}function an(e){const[t,n]=a.useState([]);return a.useEffect((()=>(e.supportAdmin.onSupportListUpdated((t=>{n(t);const a=t.reduce(((e,t)=>e+(t.unread?1:0)),0);e.handleBadgeChanged(a)})),()=>{e.supportAdmin.onSupportListUpdated(null)})),[e]),e.open?(0,Ee.jsx)(Ze.SupportList,{messages:t,handleThreadClicked:t=>{e.supportAdmin.markSupportListEntryAsRead(t).then((()=>{})),e.handleUserClicked(t.fromUid)}}):null}function ln(e){const[t,n]=a.useState([]);return a.useEffect((()=>(e.review.onReviewsUpdated((t=>{n(t);const a=t.length;e.handleBadgeChanged(a)})),()=>{e.review.onReviewsUpdated(null)})),[e]),e.open?(0,Ee.jsx)(Ze.ReviewList,{reviews:t,handleReviewClick:t=>{e.handleReviewSelected(t)}}):null}function on(e){const[t,n]=a.useState([]);a.useEffect((()=>
1(e.supportMessageUid?e.supportAdmin.onSupportMessagesUpdated(e.supportMessageUid,(e=>{n(e)})):e.supportAdmin.onSupportMessagesUpdated(null,null),()=>{e.supportAdmin.onSupportMessagesUpdated(null,null)})),[e.supportMessageUid,e.supportAdmin]);const[l,o]=a.useState(null);return a.useEffect((()=>{l&&l.scrollIntoView()}),[l]),(0,Ee.jsxs)(_e,{open:null!==e.supportMessageUid,handleClose:e.handleClose,title:"Support",children:[(0,Ee.jsx)(Ze.SupportChat,{postMessage:async t=>{null!==e.supportMessageUid&&e.supportAdmin.postSupportMessage(e.supportMessageUid,t)},messages:t}),(0,Ee.jsx)("div",{id:"scroll-to-bottom",ref:e=>{o(e)}})]})}function sn(e){var t;const[n,l]=a.useState(0),[o,s]=a.useState(""),[i,r]=a.useState(!1),[d,c]=a.useState(!1),u=null===(t=e.selectedReview)||void 0===t?void 0:t.id;return a.useEffect((()=>{s(""),r(!1),l(0)}),[u]),(0,Ee.jsx)(Ke,{handleClose:e.handleClose,title:"Review",open:null!==e.selectedReview,buttons:[{text:"Approve",handleClick:()=>{e.showConfirmPopup({title:"Confirm",content:`Do you want to approve this submission and award ${n} points?`},(t=>{t&&e.selectedReview&&(e.review.markReviewed(e.selectedReview.id,!0,n,o,i,d),e.handleClose())}))}},{text:"Reject",handleClick:()=>{e.showConfirmPopup({title:"Confirm",content:"Do you want to reject this submission? The player may try again later."},(t=>{t&&e.selectedReview&&(e.review.markReviewed(e.selectedReview.id,!1,0,o),e.handleClose())}))}}],content:(0,Ee.jsx)(Ze.ReviewDetails,{review:e.selectedReview,feedIsDisabled:e.feedIsDisabled,handleSkipFeed:e=>c(e),handlePointsChanged:e=>{l(e)},handleReviewNotesChanged:e=>{s(e)},handleNotesArePublicChanged:e=>{r(e)}})})}function rn(e){return(0,Ee.jsx)(Ke,{handleClose:e.handleClose,title:"Edit Challenge",open:null!==e.challenge,buttons:[],content:e.challenge?(0,Ee.jsx)(Ze.EditChallengeDetails,{handleContentChanged:e.handleContentChanged,uploader:e.uploader,updateChallenge:e.editChallenges.updateChallenge,deleteChallenge:e.editChallenges.deleteChallenge,getClassificationCategories:e.editChallenges.getClassificationCategories,getRandomPools:e.editChallenges.getRandomPools,showConfirmPopup:e.showConfirmPopup,challenge:e.challenge,handleClose:e.handleClose,isSuperUser:e.isSuperUser,templates:e.templates,onApplyTemplate:e.onApplyTemplate}):null})}function dn(e){return(0,Ee.jsx)(Ke,{handleClose:e.handleClose,title:"User Media",open:null!==e.selectedUserMedia,buttons:[],content:e.selectedUserMedia?(0,Ee.jsx)(Ze.UserMediaDetails,{item:e.selectedUserMedia,cancelReview:e.cancelReview,showConfirmPopup:e.showConfirmPopup}):null})}var cn=n(77882),un=n(11647),hn=n(87167),pn=n(84851),mn=n(28404),gn=n(55263),vn=n(49687),xn=n(65849),fn=n(89921),bn=n(14437),Cn=n(83004),An=n(80507),jn=n(77890),yn=n(44839),wn=n(19879);const kn=JSON.parse('{"v":"5.7.14","fr":10,"ip":0,"op":6,"w":540,"h":540,"nm":"Click","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":3,"s":[100]},{"t":6,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[270,270,0],"ix":2,"l":2},"a":{"a":0,"k":[-13.874,21.344,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"t":6,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[172.885,172.885],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.61568627451,0.61568627451,0.61568627451,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-13.874,21.344],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":50,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":3,"s":[100]},{"t":6,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[270,270,0],"ix":2,"l":2},"a":{"a":0,"k":[-13.874,21.344,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"t":6,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[172.885,172.885],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.823529411765,0.823529411765,0.823529411765,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-13.874,21.344],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":50,"st":0,"bm":0}],"markers":[]}');var Sn=n(23134),En=n.n(Sn),Pn=n(4750),Tn=n(22579),In=n(69499),Mn=n(4997);n.p,n.p,n.p;const Ln="md",Bn={mdUp:!0},Rn={smDown:!0},Un=!1,Fn=(0,W.A)((e=>(0,z.A)({root:{display:"flex",minWidth:"100vw",maxWidth:"100vw",overflowX:"hidden"},main:{flexGrow:1,paddingTop:"env(safe-area-inset-top)",paddingLeft:"env(safe-area-inset-left)",paddingRight:"env(safe-area-inset-right)",paddingBottom:"env(safe-area-inset-bottom)",minHeight:"100vh",maxWidth:"100%"}})));function Dn(e){const t=Fn(),n=(0,$.A)(),o=(0,d.A)(n.breakpoints.up(Ln)),s=e.navigation||[],[i,r]=a.useState(!1),c=(null===s||void 0===s?void 0:s.reduce(((e,t)=>{const n=t.isAction||t.tabs&&t.tabs.some((e=>e.isAction));return e.length<4&&!t.drawerOnly&&!n&&!o&&e.push(t),e}),[]))||[],u=(null===s||void 0===s?void 0:s.filter((e=>(c.indexOf(e)<0||e.bothBottomBarAndDrawer)&&!e.hidden)))||[],h=u.reduce(((e,t)=>e+(t.badge||0)+t.tabs.reduce(((e,t)=>e+(t.badge||0)),0)),0),p=s.find((t=>t.value===e.currentPage)),m=p&&(null===p||void 0===p?void 0:p.tabs.filter((e=>!e.isAction)))||[],g=s.find((t=>t.value===e.currentPage)),v=p&&p.tabs&&p.tabs.find((t=>t.value===e.currentTab)),x=v&&v.fab||g&&g.fab,[f,b]=a.useState(null),[C,A]=a.useState(null);return a.useEffect((()=>{e.disableAutoScroll&&C&&C.scrollIntoView?C.scrollIntoView():!e.disableAutoScroll&&f&&f.scrollIntoView&&f.scrollIntoView({block:"center"})}),[e.currentPage,e.currentTab,e.disableAutoScroll,f,C]),(0,Ee.jsxs)("div",{className:t.root,children:[(0,Ee.jsx)(l.Ay,{}),(0,Ee.jsx)(_n,{title:e.title,tabItems:m,drawerWidth:240,disableAutoScroll:e.disableAutoScroll,desktop:o,selectedTab:(null===v||void 0===v?void 0:v.value)||"",drawerButtonBadge:h,handleTabChange:t=>{e.handleNavigation&&e.handleNavigation((null===g||void 0===g?void 0:g.value)||"",t)},handleDrawerToggle:()=>{r(!i)},showInput:e.showInput,inputPlaceholder:e.inputPlaceholder,inputIcon:e.inputIcon,config:e.menuConfig,handleInputChange:e.handleInputChange,handleMenuClick:e.handleMenuClick}),u.length>0?(0,Ee.jsx)(Vn,{items:u,open:i,image:e.image,drawerWidth:240,currentPage:(null===g||void 0===g?void 0:g.value)||"",currentTab:(null===v||void 0===v?void 0:v.value)||"",dividerAtIndex:o?4:null,handleClose:()=>{r(!1)},handleNavigation:(t,n)=>{e.handleNavigation&&(r(!1),e.handleNavigation(t,n))},handleAction:(t,n)=>{e.handleAction&&(r(!1),e.handleAction(t,n))}}):null,(0,Ee.jsxs)("main",{className:t.main,style:e.mainStyle,children:[(0,Ee.jsx)(he.A,{variant:o&&Un?"dense":"regular",id:"back-to-top-anchor",ref:e=>{b(e||null)}}),m.length>0?(0,Ee.jsx)(he.A,{variant:"dense"}):null,e.children,(0,Ee.jsx)("div",{style:{height:"80px"}})," ",c.length>0?(0,Ee.jsx)(he.A,{variant:"regular"}):null,(0,Ee.jsx)("div",{id:"scroll-to-bottom",ref:e=>{A(e)}})]}),c.length>0?(0,Ee.jsx)($n,{items:c,currentPage:(null===g||void 0===g?void 0:g.value)||"",drawerWidth:240,handleClick:t=>{var n;const a=s.find((e=>e.value===t)),l=a&&a.value||null,o=a&&a.tabs&&(null===(n=a.tabs.find((e=>!e.isAction)))||void 0===n?void 0:n.value)||null;e.handleNavigation&&e.handleNavigation(l,o)}}):null,e.disableAutoScroll?null:(0,Ee.jsx)(Gn,{bottomBarSpace:c.length>0?56:0,fabSpace:x?72:0}),(0,Ee.jsx)(Wn,{items:s,selectedPage:(null===g||void 0===g?void 0:g.value)||"",selectedTab:(null===v||void 0===v?void 0:v.value)||"",bottomBarHeight:c.length>0?56:0,handleClick:()=>{e.handleFab&&e.handleFab((null===g||void 0===g?void 0:g.value)||"",(null===v||void 0===v?void 0:v.value)||"")}})]})}const Nn=(0,W.A)((e=>(0,z.A)({fab:t=>({position:"fixed",bottom:e.spacing(2)+t.bottomBarHeight,right:e.spacing(2),zIndex:e.zIndex.appBar,marginBottom:"env(safe-area-inset-bottom)",marginRight:"env(safe-area-inset-right)"})})));function Wn(e){const t=Nn(e),n=(0,$.A)(),l={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},o=[];for(const a of e.items)if(a.fab&&o.push({nav:a.value,tab:null,icon:a.fab}),a.tabs)for(const e of a.tabs)e.fab&&o.push({nav:a.value,tab:e.value,icon:e.fab});return(0,Ee.jsx)(a.Fragment,{children:o.map(((n,a)=>(0,Ee.jsx)(fe.A,{in:e.selectedPage===n.nav&&e.selectedTab===n.tab,timeout:l,style:{transitionDelay:`${e.selectedPage===n.nav&&e.selectedTab===n.tab?l.exit:0}ms`},unmountOnExit:!0,children:(0,Ee.jsx)(xe.A,{"aria-label":"floating-button-action",className:t.fab,color:"primary",onClick:e.handleClick,children:n.icon||""})},`fab-${a}`)))})}const zn=(0,W.A)((e=>(0,z.A)({bottomNavigation:t=>({position:"fixed",bottom:0,width:"100%",zIndex:e.zIndex.appBar,[e.breakpoints.up(Ln)]:{marginLeft:t.drawerWidth,width:`calc(100% - ${t.drawerWidth}px)`},borderTop:`solid 1px ${e.palette.primary.main}`,height:"auto",paddingBottom:"env(safe-area-inset-bottom)"})})));function $n(e){const t=zn(e);return(0,Ee.jsx)(ge.A,{showLabels:e.items.length<=4||!1,value:e.currentPage,onChange:(t,n)=>{e.handleClick(n)},className:t.bottomNavigation,children:e.items.map(((e,t)=>{const n=(e.tabs||[]).reduce(((e,t)=>e+(t.badge||0)),e.badge||0);return(0,Ee.jsx)(ve.A,{label:e.primary,value:e.value,icon:(0,Ee.jsx)(me.A,{badgeContent:n,color:"secondary",children:e.icon||void 0})},`bottom-nav-${t}`)}))})}
1const On=(0,W.A)((e=>(0,z.A)({drawer:t=>({[e.breakpoints.up(Ln)]:{width:t.drawerWidth,flexShrink:0}}),nestedDrawerItem:{paddingLeft:e.spacing(4)},toolbar:e.mixins.toolbar,drawerPaper:e=>({width:e.drawerWidth,paddingTop:"env(safe-area-inset-top)",paddingLeft:"env(safe-area-inset-left)"})})));function Vn(e){const t=On(e),n=(0,$.A)(),[l,o]=a.useState([]),s=(0,d.A)(n.breakpoints.up(Ln));if(e.items.length<=0)return null;let i=e.items[0].isAction||e.items[0].tabs.some((e=>e.isAction));const r=(0,Ee.jsxs)("div",{children:[(0,Ee.jsx)("div",{className:t.toolbar,style:{display:"flex",justifyContent:"center",alignItems:"center"},children:e.image?(0,Ee.jsx)("img",{src:e.image,alt:"logo",style:{width:"90%"}}):null}),(0,Ee.jsx)(ae.A,{}),(0,Ee.jsx)(ie.A,{children:e.items.map(((r,d)=>{const c=r.tabs||[],u=r.isAction||r.tabs.some((e=>e.isAction)),h=u!==i||d===e.dividerAtIndex?(0,Ee.jsx)(ae.A,{}):null;i=u;if(r.tabs.length>0&&u){const i=c.reduce(((e,t)=>e+(t.badge||0)),r.badge||0);return(0,Ee.jsxs)(a.Fragment,{children:[h,(0,Ee.jsxs)(re.A,{button:!0,selected:e.currentPage===r.value&&!l.includes(d),onClick:e=>{const t=d;l.includes(t)?o([]):o([t])},children:[r.icon?(0,Ee.jsx)(me.A,{badgeContent:i,color:"secondary",children:r.icon}):null,(0,Ee.jsx)(ce.A,{style:{marginLeft:n.spacing(4)},primary:r.primary,secondary:r.secondary}),l.includes(d)?(0,Ee.jsx)(Tn.A,{}):(0,Ee.jsx)(In.A,{})]},`item-${d}`),(0,Ee.jsx)(Pn.A,{in:l.includes(d),timeout:"auto",unmountOnExit:!0,children:(0,Ee.jsx)(ie.A,{dense:s&&Un,component:"div",disablePadding:!0,children:c.map(((a,o)=>(0,Ee.jsxs)(re.A,{button:!0,selected:e.currentPage===r.value&&e.currentTab===a.value&&l.includes(d),onClick:()=>{a.isAction?e.handleAction(r.value,a.value):e.handleNavigation(r.value,a.value)},className:t.nestedDrawerItem,children:[a.icon?(0,Ee.jsx)(me.A,{badgeContent:a.badge||0,color:"secondary",children:a.icon}):null,(0,Ee.jsx)(ce.A,{primary:a.primary,secondary:a.secondary,style:{marginLeft:n.spacing(4)}})]},`tab-${o}`)))})},`collapse-${d}`)]},`frag-${d}`)}{const t=c.reduce(((e,t)=>e+(t.badge||0)),r.badge||0);return(0,Ee.jsxs)(a.Fragment,{children:[h,(0,Ee.jsxs)(re.A,{button:!0,selected:e.currentPage===r.value&&null===e.currentTab,onClick:()=>{r.isAction?e.handleAction(r.value,null):e.handleNavigation(r.value,null)},children:[r.icon?(0,Ee.jsx)(me.A,{badgeContent:t,color:"secondary",children:r.icon}):null,(0,Ee.jsx)(ce.A,{style:{marginLeft:n.spacing(4)},primary:r.primary,secondary:r.secondary})]},`item-${d}`)]},`frag-${d}`)}}))})]});return(0,Ee.jsxs)("nav",{className:t.drawer,"aria-label":"side menu",children:[(0,Ee.jsx)(oe.A,{...Bn,implementation:"css",children:(0,Ee.jsx)(le.Ay,{variant:"temporary",anchor:"rtl"===n.direction?"right":"left",open:e.open,onClose:e.handleClose,classes:{paper:t.drawerPaper},ModalProps:{keepMounted:!0},children:r})}),(0,Ee.jsx)(oe.A,{...Rn,implementation:"css",children:(0,Ee.jsx)(le.Ay,{classes:{paper:t.drawerPaper},variant:"permanent",open:!0,children:r})})]})}const qn=(0,W.A)((e=>(0,z.A)({scrollTop:t=>({position:"fixed",zIndex:e.zIndex.appBar,bottom:e.spacing(2)+(t.bottomBarSpace?56:0)+(t.fabSpace?6:0),right:e.spacing(2)+(t.fabSpace?72:0),marginBottom:"env(safe-area-inset-bottom)",marginRight:"env(safe-area-inset-right)"})})));function Gn(e){const t=qn(e),n=(0,Ae.A)({target:void 0,disableHysteresis:!0,threshold:100});return(0,Ee.jsx)(fe.A,{in:n,children:(0,Ee.jsx)("div",{onClick:e=>{const t=(e.target.ownerDocument||document).querySelector("#back-to-top-anchor");t&&t.scrollIntoView({behavior:"smooth",block:"center"})},role:"presentation",className:t.scrollTop,children:(0,Ee.jsx)(xe.A,{color:"secondary",size:"small","aria-label":"scroll back to top",children:(0,Ee.jsx)(Ce.A,{})})})})}function Qn(e){const{children:t}=e,n=(0,Ae.A)({target:void 0,disableHysteresis:!0,threshold:100});return(0,Ee.jsx)(be.A,{appear:!1,direction:"down",in:!n,children:t})}const Hn=(0,W.A)((e=>(0,z.A)({appBar:t=>({backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",paddingTop:"env(safe-area-inset-top)",marginLeft:t.drawerWidth,[e.breakpoints.up(Ln)]:{width:`calc(100% - ${t.drawerWidth}px)`}}),tabs:{}})));function _n(e){const t=Hn(e),n=(0,$.A)();let a=Mn.Tj.imageUrl||"";let l=n.palette.getContrastText(n.palette.primary.main);Mn.Tj.header&&Mn.Tj.imageUrl&&(l=Mn.Tj.header);const o=(0,Ee.jsxs)(ne.A,{position:"fixed",className:t.appBar,style:{backgroundColor:n.palette.primary.main,backgroundImage:`url("${a}")`,color:l},children:[(0,Ee.jsx)(Yn,{...e}),e.tabItems.length>0?(0,Ee.jsx)(ye.A,{className:t.tabs,value:e.selectedTab||e.tabItems[0].value,onChange:(t,n)=>{e.handleTabChange(n)},variant:e.tabItems.length>3?"scrollable":e.desktop?"standard":"fullWidth",scrollButtons:"auto",children:e.tabItems.map(((e,t)=>(0,Ee.jsx)(je.A,{label:(0,Ee.jsx)(me.A,{badgeContent:e.badge||0,color:"secondary",children:e.primary}),value:e.value},`tab-${t}`)))}):null]});return e.disableAutoScroll?o:(0,Ee.jsx)(Qn,{children:o})}const Jn=(0,W.A)((e=>(0,z.A)({toolbar:{},grow:{flexGrow:1},menuButton:{marginRight:e.spacing(2),[e.breakpoints.up(Ln)]:{display:"none"}},title:{display:"none",[e.breakpoints.up(Ln)]:{display:"block"}},search:{position:"relative",borderRadius:e.shape.borderRadius,backgroundColor:(0,Me.Rv)(e.palette.common.white,.15),"&:hover":{backgroundColor:(0,Me.Rv)(e.palette.common.white,.25)},marginRight:e.spacing(2),marginLeft:0,width:"100%",[e.breakpoints.up(Ln)]:{marginLeft:e.spacing(3),width:"auto"}},searchIcon:{width:e.spacing(7),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},inputRoot:{color:"inherit"},inputInput:{padding:e.spacing(1,1,1,7),transition:e.transitions.create("width"),width:"100%",[e.breakpoints.up(Ln)]:{width:200}},menuItems:{display:"flex"}})));function Yn(e){const t=(0,$.A)(),n=Jn(),l=(0,d.A)(t.breakpoints.up(Ln)),o=e.config||[],s=l||!e.showInput?3:1,[i,r]=a.useState(null),[c,u]=a.useState(null),[h,p]=a.use
1State(null),m=Boolean(i),g=Boolean(c),v=[],x=[];let f=0;for(const a of o)if(v.length<s)v.push(a);else{x.push(a);f+=(a.items||[]).reduce(((e,t)=>e+(t.badge||0)),a.badge||0)}const b=()=>{u(null)},C=()=>{r(null),b()},A="primary-search-account-menu",j=o.find((e=>e.value===h)),y=h&&j?(0,Ee.jsx)(Be.A,{anchorEl:i,anchorOrigin:{vertical:"top",horizontal:"right"},id:A,keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:m,onClose:C,children:(j.items||[]).map(((n,a)=>(0,Ee.jsxs)(q.A,{onClick:()=>{C(),e.handleMenuClick&&e.handleMenuClick(n.value)},style:{backgroundColor:n.highlight?t.palette.secondary.main:""},children:[(0,Ee.jsx)(se.A,{"aria-label":n.primary,color:"inherit",children:(0,Ee.jsx)(me.A,{badgeContent:n.badge||0,color:"secondary",children:n.icon})}),n.primary]},`menu-${a}`)))}):null,w="primary-search-account-more-menu",k=(0,Ee.jsx)(Be.A,{anchorEl:c,anchorOrigin:{vertical:"top",horizontal:"right"},id:w,keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:g,onClose:b,children:x.map(((t,n)=>{if(t.items&&0!==t.items.length){const e=t.items.reduce(((e,t)=>e+(t.badge||0)),t.badge||0);return(0,Ee.jsxs)(q.A,{onClick:e=>{p(t.value),r(e.currentTarget)},children:[(0,Ee.jsx)(se.A,{"aria-label":t.primary,"aria-controls":"primary-search-account-menu","aria-haspopup":"true",color:"inherit",children:(0,Ee.jsx)(me.A,{badgeContent:e||0,color:"secondary",children:t.icon})}),t.primary]},`menu-extra-${n}`)}return(0,Ee.jsxs)(q.A,{onClick:n=>{e.handleMenuClick&&e.handleMenuClick(t.value)},children:[(0,Ee.jsx)(se.A,{"aria-label":t.primary,color:"inherit",children:(0,Ee.jsx)(me.A,{badgeContent:t.badge||0,color:"secondary",children:t.icon})}),t.primary]},`menu-extra-${n}`)}))});return(0,Ee.jsxs)(a.Fragment,{children:[(0,Ee.jsxs)(he.A,{variant:l&&Un?"dense":"regular",className:n.toolbar,children:[(0,Ee.jsx)(se.A,{edge:"start",className:n.menuButton,color:"inherit","aria-label":"open drawer",id:"open-drawer",onClick:e.handleDrawerToggle,children:(0,Ee.jsx)(me.A,{badgeContent:e.drawerButtonBadge,color:"secondary",children:(0,Ee.jsx)(ue.A,{})})}),(0,Ee.jsx)(pe.A,{className:n.title,variant:"h6",noWrap:!0,children:e.title}),e.showInput?(0,Ee.jsxs)("div",{className:n.search,children:[(0,Ee.jsx)("div",{className:n.searchIcon,children:e.inputIcon||(0,Ee.jsx)(Re.default,{})}),(0,Ee.jsx)(Le.A,{placeholder:e.inputPlaceholder,classes:{root:n.inputRoot,input:n.inputInput},inputProps:{"aria-label":"search"},onChange:t=>{e.handleInputChange&&e.handleInputChange(t.target.value)}})]}):null,(0,Ee.jsx)("div",{className:n.grow}),(0,Ee.jsxs)("div",{className:n.menuItems,children:[v.map(((t,n)=>{const a=(t.items||[]).reduce(((e,t)=>e+(t.badge||0)),t.badge||0);return(0,Ee.jsx)(se.A,{"aria-label":t.primary,color:"inherit",edge:"end","aria-controls":A,"aria-haspopup":"true",onClick:n=>{t.items&&t.items.length>0?(p(t.value),r(n.currentTarget)):e.handleMenuClick&&e.handleMenuClick(t.value)},children:(0,Ee.jsx)(me.A,{badgeContent:a||0,color:"secondary",children:t.icon})},`icon-button-${n}`)})),x.length>0?(0,Ee.jsx)(se.A,{"aria-label":"show more","aria-controls":w,"aria-haspopup":"true",onClick:e=>{u(e.currentTarget)},color:"inherit",children:(0,Ee.jsx)(me.A,{badgeContent:f,color:"secondary",children:(0,Ee.jsx)(Ue.A,{})})},"icon-button-more"):null]})]}),k,y]})}var Kn=n(60399),Xn=n(34156);const Zn=(0,W.A)((e=>(0,z.A)({root:{display:"flex"},close:{padding:e.spacing(.5)},snack:{marginBottom:"env(safe-area-inset-bottom)"}})));function ea(e){var t,n,l,o,s,i,r,d,c,u,h,p,m;const g=Zn(),v=()=>{e.snack&&e.snack.handleClose()};return(0,Ee.jsxs)(a.Fragment,{children:[(0,Ee.jsx)(aa,{title:(null===(t=e.modal)||void 0===t?void 0:t.title)||"",open:!!e.modal,onClose:()=>{e.modal&&e.modal.handleClose()},children:(null===(n=e.modal)||void 0===n?void 0:n.content)||(0,Ee.jsx)("div",{})}),(0,Ee.jsx)(la,{open:!!e.alert,title:(null===(l=e.alert)||void 0===l?void 0:l.title)||"",text:null===(o=e.alert)||void 0===o?void 0:o.text,okButtonText:(null===(s=e.alert)||void 0===s?void 0:s.okButton)||"",cancelButtonText:null===(i=e.alert)||void 0===i?void 0:i.cancelButton,callback:null===(r=e.alert)||void 0===r?void 0:r.handleClose,children:(null===(d=e.alert)||void 0===d?void 0:d.content)||null}),(0,Ee.jsx)(Kn.A,{anchorOrigin:{vertical:"bottom",horizontal:"center"},open:!!e.snack,autoHideDuration:(null===(c=e.snack)||void 0===c?void 0:c.autoHide)||6e3,onClose:v,ContentProps:{"aria-describedby":"message-id"},message:(0,Ee.jsx)("span",{id:"message-id",children:(null===(u=e.snack)||void 0===u?void 0:u.message)||""}),action:[(0,Ee.jsx)(se.A,{"aria-label":"close",color:"inherit",className:g.close,onClick:v,children:(0,Ee.jsx)(Ge.default,{})},"close")],children:null!==(h=e.snack)&&void 0!==h&&h.type?(0,Ee.jsxs)(Z.A,{elevation:6,variant:"filled",onClose:v,severity:e.snack.type,className:g.snack,children:[null!==(p=e.snack)&&void 0!==p&&p.title?(0,Ee.jsx)(Xn.A,{children:e.snack.title}):null,(null===(m=e.snack)||void 0===m?void 0:m.message)||""]}):void 0}),(0,Ee.jsx)(sa,{open:!!e.loading})]})}const ta=(0,W.A)((e=>(0,z.A)({appBar:{position:"fixed"},toolbar:{paddingTop:"env(safe-area-inset-top)"},dialog:{backgroundColor:e.palette.background.default},iPhoneTop:{width:"100%",paddingTop:`calc(env(safe-area-inset-top) - ${e.spacing(1)}px)`},iPhoneBottom:{width:"100%",paddingBottom:"env(safe-area-inset-bottom)"},title:{marginLeft:e.spacing(2),flex:1}}))),na=a.forwardRef((function(e,t){return(0,Ee.jsx)(be.A,{direction:"left",ref:t,...e})}));function aa(e){const t=ta(),n=(0,$.A)();return(0,Ee.jsxs)(We.A,{className:t.dialog,fullScreen:!0,open:e.open,onClose:e.onClose,TransitionComponent:na,PaperProps:{style:{backgroundColor:n.palette.background.default}},children:[(0,Ee.jsx)(ne.A,{className:t.appBar,children:(0,Ee.jsxs)(he.A,{className:t.toolbar,children:[(0,Ee.jsx)(se.A,{edge:"start",color:"inherit",onClick:e.onClose,"aria-label":"close",children:(0,Ee.jsx)(j.A,{})}),(0,Ee.jsx)(pe.A,{variant:"h6",className:t.title,children:e.title}),e.action?(0,Ee.jsx)(Ne.A,{color:"inherit",onClick:e.action.onAction,children:e.action.text}):null]})}),(0,Ee.jsx)(he.A,{}),(0,Ee.jsx)("div",{className:t.iPhoneTop}),e.children,(0,Ee.jsx)("div",{className:t.iPhoneBottom})]})}function la(e){const[t,n]=a.useState(e.open);return a.useEffect((()=>{n(e.open)}),[e.open]),(0,Ee.jsxs)(We.A,{open:t,onClose:()=>{e.callback?e.callback(!1):n(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,maxWidth:"sm",children:[(0,Ee.jsx)(Ve.A,{id:"alert-dialog-title",children:e.title}),(0,Ee.jsxs)($e.A,{children:[e.text?(0,Ee.jsx)(Oe.A,{id:"alert-dialog-description",children:e.text}):null,e.children||null]}),(0,Ee.jsxs)(ze.A,{children:[e.cancelButtonText?(0,Ee.jsx)(Ne.A,{onClick:()=>{e.callback?e.callback(!1):n(!1)},children:e.cancelButtonText}):null,(0,Ee.jsx)(Ne.A,{onClick:()=>{e.callback?e.callback(!0):n(!1)},autoFocus:!0,children:e.okButtonText})]})]})}const oa=(0,W.A)((e=>(0,z.A)({backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"}})));function sa(e){const t=oa();return(0,Ee.jsx)("div",{children:(0,Ee.jsx)(st.A,{className:t.backdrop,open:e.open,onClick:()=>{},children:(0,Ee.jsx)(it.A,{color:"inherit"})})})}var ia=n(99230);const ra=n.p+"static/media/Player_Logo.9e7a045b21763f9aac3c.png";function da(e){const t=(0,$.A)(),n=window.innerWidth>
1600&&!window.cordova,[l,o]=a.useState(!1),s=e.myUserId,[i,r]=a.useState("");a.useEffect((()=>{e.profile.getPublicProfile().then((e=>r(e.username)))}),[e.profile,s]);const d=async(t,n)=>{if(await e.challenges.hasUserUnlockedChallenge(t))return!0;if(!n)return!1;return await e.challenges.unlockChallenge(t,n)},[h,g]=a.useState([]);a.useEffect((()=>{e.announcements.onAnnouncementsUpdated((e=>{g(e)}))}),[e.announcements]);const[x,f]=a.useState(null),[b,j]=a.useState([]),[y,w]=a.useReducer(((e,t)=>e.concat(t.add).filter((e=>!t.remove.find((t=>t.id===e.id))))),[]);a.useEffect((()=>{e.badges.onBadgesUpdated(((e,t)=>{j(e),w({add:t,remove:[]})}))}),[e.badges]);const[S,E]=a.useState(null),[T,I]=a.useState(null),[M,L]=a.useState("challenges"),[R,U]=a.useState("current"),F=e.currentEvent,D=e.eventList,[N,W]=a.useState(null),[z,O]=a.useState(!1),[V,q]=a.useState(!1),[G,Q]=a.useState([]),[H,_]=a.useState([]),[J,Y]=a.useState(0),[K,ee]=a.useState([]),[te,ne]=a.useState(0),[ae,le]=a.useState(null),oe=a.useCallback(((e,t)=>{le({message:e,type:t})}),[]);a.useEffect((()=>{var t;F?(oe(`Now playing ${F.title}`,"success"),e.teams.onTeamUpdated((t=>{W(t?{...t}:null),q(e.teamManagement.isTeamManager())})),null!==(t=F.publicTeamManagement)&&void 0!==t&&t.enabled?(O(!0),q(e.teamManagement.isTeamManager()),e.teamManagement.onTeamListUpdated((e=>{Q(e)})),e.teamManagement.onRequestListUpdated(((e,t)=>{ee(e),ne(t)})),e.teamManagement.onInviteListUpdated(((e,t)=>{_(e),Y(t)}))):(Q([]),_([]),Y(0),ee([]),ne(0),e.teamManagement.onTeamListUpdated(null),e.teamManagement.onInviteListUpdated(null),e.teamManagement.onRequestListUpdated(null))):(W(null),O(!1),q(!1),Q([]),_([]),Y(0),ee([]),ne(0),e.teamManagement.onTeamListUpdated(null),e.teamManagement.onInviteListUpdated(null),e.teamManagement.onRequestListUpdated(null))}),[F,e.teams,e.teamManagement,oe]);const[se,ie]=a.useState(null),[re,de]=a.useState(null),[ce,ue]=a.useState(null),[he,pe]=a.useState(null),[me,ge]=a.useState([]);a.useEffect((()=>{ge([...se||[],...re||[]])}),[se,re]);const[ve,xe]=a.useState(null),[fe,be]=a.useState(null),Ce=me.find((e=>e.challengeId===ve))||null,[Ae,je]=a.useState(null);a.useEffect((()=>{ye()}),[]);const ye=a.useCallback((async()=>{const t=await e.platform.backgroundGeolocation.isRunning();je((null===t||void 0===t?void 0:t.challengeId)||null)}),[je,e.platform.backgroundGeolocation]),we=a.useCallback((async t=>{if(!s)return!1;const n=e.events.getEventPlaying();if(!n)return!1;const a=await e.platform.backgroundGeolocation.start(n,t,s);return await ye(),a}),[e.platform.backgroundGeolocation,se,e.events.getEventPlaying,s,ye]),ke=a.useCallback((async()=>{const t=await e.platform.backgroundGeolocation.stop();return await ye(),t}),[e.platform.backgroundGeolocation,ye]),Se=a.useCallback((async t=>{const n=await e.events.joinEvent(t);n.success?(L("challenges"),U("current")):n.error?oe(n.error.msg,"error"):oe("Unknown error!","warning")}),[e.events,oe]),Pe=a.useCallback((async t=>{try{const n=await e.teams.joinTeam(t);n.success?(L("challenges"),U("current"),oe(n.success.msg,"success")):n.error?oe(n.error.msg,"error"):oe("Unknown error!","warning")}catch(n){oe(n.message,"error")}}),[e.teams,oe]),Te=async t=>{await e.events.handlePlay(t),L("challenges"),U("current")},[Ie,Me]=a.useState({points:0,photos:0,videos:0,challenges:0,rank:0}),[Le,Be]=a.useState({points:0,photos:0,videos:0,challenges:0,rank:0});a.useEffect((()=>{e.badges.getEventStats().then((e=>Me(e))),e.badges.getGlobalStats().then((e=>Be(e)))}),[se,re,e.badges,b]);const[Ue,Fe]=a.useState([]),[De,Ne]=a.useState(0),[We,ze]=a.useState([]),[$e,Oe]=a.useState(0),[Ve,qe]=a.useState([]),[Ge,Qe]=a.useState(0),[He,_e]=a.useState(0),[Je,Ye]=a.useState(null),[Ke,Xe]=a.useState(!1),[tt,nt]=a.useState([]);a.useEffect((()=>{if(T&&T.feed){const t=Ue.find((e=>{var t;return e.entryId===(null===(t=T.feed)||void 0===t?void 0:t.entryId)}));if(!t)return;t.likes===T.feed.likes&&t.didLike===T.feed.didLike||I({...T,feed:{...T.feed,...t,toggleFeedEntryLike:null!==F&&void 0!==F&&F.isTeamEvent?e.teamFeed.toggleFeedEntryLike:e.feed.toggleFeedEntryLike}})}}),[Ue,T,e.feed.toggleFeedEntryLike,e.teamFeed.toggleFeedEntryLike,F]);const[at,lt]=a.useState(e.prefillCode),[ot,st]=a.useState(!1),[it,rt]=a.useState(!1);a.useEffect((()=>{st(!1),rt(!1),e.events.hasAdminPermission().then((e=>st(e))),e.events.hasMinorPermission().then((e=>rt(e))),at&&(Se(at),lt(void 0))}),[e.events,Se,at,F]);const dt=a.useCallback(((e,t,n)=>{ie([...e]),de([...t]),ue([...n]),pe([...e,...t].filter((e=>"poll"===e.type)));const a=e.filter((e=>!!e.imageUrl)).map((e=>e.imageUrl));Ca.preload(a)}),[]),ct=a.useCallback(((e,t)=>{null!==F&&void 0!==F&&F.isTeamEvent||(F?(Fe(e.map((e=>({...e,canShare:!F.disableFeedShareForOthers||e.username===i})))),Ne(t)):(Fe([]),Ne(0)))}),[F,i]),ut=a.useCallback(((e,t)=>{null!==F&&void 0!==F&&F.isTeamEvent&&(F?(Fe(e.map((e=>({...e,canShare:!F.disableFeedShareForOthers||e.username===i})))),Ne(t)):(Fe([]),Ne(0)))}),[F,i]),ht=(e,t)=>
1{qe(e),Qe(t)},pt=a.useCallback((e=>{null!==F&&void 0!==F&&F.isTeamEvent||nt(F?e:[])}),[F]),mt=a.useCallback(((e,t)=>{null!==F&&void 0!==F&&F.isTeamEvent||(F?(ze(e),Oe(t)):(ze([]),Oe(0)))}),[F]),gt=a.useCallback((e=>{null!==F&&void 0!==F&&F.isTeamEvent&&nt(F?e:[])}),[F]),vt=a.useCallback(((e,t)=>{null!==F&&void 0!==F&&F.isTeamEvent&&(F?(ze(e),Oe(t)):(ze([]),Oe(0)))}),[F]);a.useEffect((()=>{e.challenges.onChallengesUpdated(dt),e.support.onSupportMessagesUpdated(ht)}),[e,dt]),a.useEffect((()=>{null!==F&&void 0!==F&&F.isTeamEvent?(e.teamMessages.onMessagesUpdated(vt),e.teamFeed.onFeedUpdated(ut)):(e.messages.onMessagesUpdated(mt),e.feed.onFeedUpdated(ct))}),[e,null===F||void 0===F?void 0:F.isTeamEvent,ct,mt,vt,ut]);const[xt,ft]=a.useState(!1),[bt,Ct]=a.useState(!1),[At,jt]=a.useState(""),[yt,wt]=a.useState(""),[kt,St]=a.useState(""),Et=[];null!==F&&void 0!==F&&F.disableFeed||null!==F&&void 0!==F&&F.hideFeed||Et.push({value:"feed",primary:"Feed",icon:(0,Ee.jsx)(mn.A,{}),badge:De}),null!==F&&void 0!==F&&F.disableChat||Et.push({value:"messages",primary:null!==F&&void 0!==F&&F.isTeamEvent?"Team":"Chat",icon:(0,Ee.jsx)(pn.A,{}),badge:$e,fab:null!==F&&void 0!==F&&F.isTeamEvent&&!N||!F?void 0:(0,Ee.jsx)(A.A,{})}),null!==F&&void 0!==F&&F.hideLeaderboard||Et.push({value:"leaderboard",primary:"Leaderboard",icon:(0,Ee.jsx)(P.A,{})}),null!==he&&void 0!==he&&he.length&&Et.push({value:"polls",primary:"Polls"});const Pt=[{value:"info",primary:"Info"},{value:"stats",primary:"Player"}];null!==F&&void 0!==F&&F.isTeamEvent&&Pt.push({value:"team",primary:"Team",badge:te+J});const Tt=[{value:"current",primary:"Current"},{value:"completed",primary:"Completed"}];null!==ce&&void 0!==ce&&ce.length&&Tt.push({value:"map",primary:"Places"});const It=[{value:"event",primary:"Event",icon:(0,Ee.jsx)(xn.A,{}),tabs:Pt,badge:h.length,drawerOnly:!1,bothBottomBarAndDrawer:e.embeddedInBrellaApp},{value:"profile",icon:(0,Ee.jsx)(vn.A,{}),primary:"Profile",tabs:[],drawerOnly:!0},{value:"events",icon:(0,Ee.jsx)(c.A,{}),primary:"My Events",tabs:[],drawerOnly:!0},{value:"gallery",icon:(0,Ee.jsx)(m.A,{}),primary:"My Photos",tabs:[],drawerOnly:!0},{value:"challenges",primary:"Challenges",icon:(0,Ee.jsx)(u.A,{}),tabs:Tt},{value:"badges",icon:(0,Ee.jsx)(k.A,{}),primary:"My Badges",tabs:[],drawerOnly:!0},{value:"community",primary:"Social",icon:(0,Ee.jsx)(C.A,{}),tabs:Et},{value:"settings",primary:"Settings",icon:(0,Ee.jsx)(hn.A,{}),tabs:[],drawerOnly:!0},{value:"rulesandterms",primary:"Terms of Service",icon:(0,Ee.jsx)(Cn.A,{}),tabs:[],drawerOnly:!0},{value:"messages",primary:"Messages",icon:(0,Ee.jsx)(v.A,{}),tabs:[{value:"admin",primary:"Admin",badge:Ge,icon:(0,Ee.jsx)(gn.A,{}),fab:(0,Ee.jsx)(A.A,{})},null!==F&&void 0!==F&&F.disableDirectChat?{value:"",primary:""}:{value:"direct",primary:"Players",badge:He,icon:(0,Ee.jsx)(pn.A,{}),fab:(0,Ee.jsx)(An.A,{})}].filter((e=>!!e.value)),drawerOnly:!0},{value:"help",primary:"Help",icon:(0,Ee.jsx)(p.default,{}),tabs:[],isAction:!0,drawerOnly:!0},{value:"contact",primary:"Contact Us",icon:(0,Ee.jsx)(fn.A,{}),tabs:[],isAction:!0,drawerOnly:!0}].filter((e=>!!e));(ot||it)&&It.push({value:"admin",primary:"Admin",icon:(0,Ee.jsx)(bn.A,{color:"primary"}),tabs:[],isAction:!0,drawerOnly:!0}),a.useEffect((()=>{"challenges"!==M&&(jt(""),wt("")),"events"!==M&&St("")}),[M]);let Mt="Eventzee";Mt="Eventzee";const Lt={title:"",image:(t.palette.type,ra),inputIcon:(0,Ee.jsx)(Re.default,{}),inputPlaceholder:"Search...",showInput:"challenges"===M||"events"===M,handleInputChange:e=>{"challenges"===M?jt(e):"events"===M&&St(e)},disableAutoScroll:"community"===M&&"messages"===R||"messages"===M&&"admin"===R,handleMenuClick:e=>{if(console.log(`Menu click ${e}`),"support"===e)L("messages"),U("admin");else if("filter-all"===e)wt("");else if(e.startsWith("filter-")){const t=e.replace("filter-","");wt(t)}},handleFab:(e,t)=>{console.log(`Fab ${e} - ${t}`),"community"===M&&"messages"===t?ft(!0):"messages"===M&&"messages"===t||"messages"===M&&"admin"===t?Ct(!0):"messages"===M&&"direct"===t&&(Ye(null),Xe(!0))},handleAction:(t,n)=>{if(console.log(`Action ${t} - ${n}`),"help"===t){let e="https://www.freezetag.com";e="https://eventzee.freshdesk.com/support/solutions/articles/48001143044-eventzee-app-faq/",window.open(e,"_system")}else"contact"===t?an(!0):"admin"===t&&(ot||it)&&e.handleEnterAdmin()},handleNavigation:(e,t)=>{console.log(`Navigation ${e} - ${t}`),e&&L(e),U(t)},navigation:It,menuConfig:"challenges"===M?[{value:"filter-types",icon:(0,Ee.jsx)(B.default,{}),primary:"Filter",items:[{value:"filter-all",primary:"All",icon:(0,Ee.jsx)(jn.A,{}),highlight:!yt},me.some((e=>"photo"===e.type))?{value:"filter-photo",primary:"Photo",icon:Mn.Pt.photo,highlight:"photo"===yt}:void 0,me.some((e=>"video"===e.type))?{value:"filter-video",primary:"Video",icon:Mn.Pt.video,highlight:"video"===yt}:void 0,me.some((e=>"write"===e.type))?{value:"filter-write",primary:"Text",icon:Mn.Pt.write,highlight:"write"===yt}:void 0,me.some((e=>"poll"===e.type))?{value:"filter-poll",primary:"Poll",icon:Mn.Pt.poll,highlight:"poll"===yt}:void 0,me.some((e=>"route"===e.type))?{value:"filter-route",primary:"Route",icon:Mn.Pt.route,highlight:"route"===yt}:void 0,void 0,me.some((e=>"gps"===e.type))?{value:"filter-gps",primary:"GPS",icon:Mn.Pt.gps,highlight:"gps"===yt}:void 0,me.some((e=>
1"quiz"===e.type))?{value:"filter-quiz",primary:"Quiz",icon:Mn.Pt.quiz,highlight:"quiz"===yt}:void 0,me.some((e=>"qr"===e.type))?{value:"filter-qr",primary:"QR",icon:Mn.Pt.qr,highlight:"qr"===yt}:void 0,me.some((e=>"info"===e.type))?{value:"filter-info",primary:"Info",icon:Mn.Pt.info,highlight:"info"===yt}:void 0].filter((e=>!!e))}]:[{value:"support",icon:(0,Ee.jsx)(v.A,{}),primary:"Support",badge:Ge+He}],currentPage:M,currentTab:R||void 0,mainStyle:"challenges"===M&&"map"===R||"map"===M||"routes"===M?{maxHeight:"100vh",maxWidth:"100vw",overflow:"hidden",position:"absolute",top:0,left:0,right:0,bottom:0}:void 0},Bt=a.useCallback((()=>new Promise((t=>{const n=e=>{if(e){let n=decodeURI(e);if(0===n.indexOf("https://")){const e=En()(n,{},!0).query;null!==e&&void 0!==e&&e.qrcode&&void 0!==(null===e||void 0===e?void 0:e.qrcode)&&(n=e.qrcode)}t(n)}else t(null)};e.platform.cordovaQRScanner(n)||E((()=>n))}))),[e.platform]),[Rt,Ut]=a.useState(void 0),Ft=a.useCallback(((e,t,n,a)=>{Ut({okButton:"OK",title:e,text:t,content:a,handleClose:e=>{n(),Ut(void 0)}})}),[]),Dt=a.useCallback(((e,t,n)=>{Ut({okButton:"OK",cancelButton:"Cancel",title:e,text:t,handleClose:e=>{n(e),Ut(void 0)}})}),[]),Nt=a.useCallback(((t,n)=>{Dt("Block Player?",`Messages and Feed entries from ${t} will be blocked.`,(a=>{a&&(o(!0),e.block.blockPlayer(t,n).then((e=>{o(!1),e.success?Ft("Success",`${t} is now blocked`,(()=>{})):Ft("Error",e.error||`Could not block ${t}.`,(()=>{}))})))}))}),[e.block,Dt,Ft]),Wt=a.useCallback((t=>{Dt("Unblock Player?",`Messages and Feed entries from ${t} will be visible again.`,(n=>{n&&(o(!0),e.block.unblockPlayer(t).then((e=>{o(!1),e.success?Ft("Success",`${t} is now unblocked`,(()=>{})):Ft("Error",e.error||`Could not unblock ${t}.`,(()=>{}))})))}))}),[e.block,Dt,Ft]),zt=a.useCallback(((t,n,a,l)=>{Dt("Report Player?",`Content from ${t} will be reported as inappropriate.`,(s=>{s&&(o(!0),e.block.reportPlayer(t,n,a,l).then((e=>{o(!1),e.success?Ft("Success",`${t} was reported.`,(()=>{})):Ft("Error",e.error||`Could not report ${t}.`,(()=>{}))})))}))}),[e.block,Dt,Ft]),$t=a.useCallback((t=>{Dt("Delete Message?",`The message with ID ${t} will be deleted permanently.`,(n=>{n&&(o(!0),e.messages.deleteMessage({messageId:t}).then((e=>{o(!1),e?Ft("Success",`Message ${t} was deleted.`,(()=>{})):Ft("Error",`Could not delete message ${t}.`,(()=>{}))})))}))}),[e.messages,Dt,Ft]),Ot=(t,n,a,l)=>{e.platform.share(t,n,a,l)||navigator.share&&(l&&l.length>0&&(a=l[0]),navigator.share({title:t,text:n,url:a}))};let Vt=!1,qt=null;if(F){const e=new Date;F.startDate>e?qt=(0,Ee.jsx)(X.A,{m:2,marginTop:2,children:(0,Ee.jsx)(Z.A,{severity:"info",children:"This event has not started yet."})}):F.endDate<e&&(Vt=!0,qt=(0,Ee.jsx)(X.A,{m:2,marginTop:2,children:(0,Ee.jsx)(Z.A,{severity:"warning",children:"This event has already ended."})}))}const Gt=a.useMemo((()=>(0,Ee.jsx)(xa,{open:"messages"===M&&"direct"===R,directMessages:e.directMessages,handleBadgeChanged:e=>{_e(e)},handleDirectMessageClicked:e=>{Ye(e||null),Xe(!0)},showOptions:{onBlock:Nt,onReport:zt}})),[e.directMessages,M,R,Nt,zt]),Qt=a.useMemo((()=>F&&!Vt?null:(0,Ee.jsxs)(X.A,{m:1,children:[n?null:(0,Ee.jsx)(Ze.DemoEvent,{joinEvent:Se}),n?(0,Ee.jsx)(Ze.TrialEvent,{onAdmin:()=>{e.handleEnterAdmin()}}):null,(0,Ee.jsx)(Ze.JoinEvent,{joinEvent:Se,scanQR:Bt,alwaysExpanded:!0,hideScanButton:!0,showTour:!(null!==D&&void 0!==D&&D.length)&&"challenges"===M&&!0})]})),[F,D,M,Se,Bt,Vt]),Ht=a.useMemo((()=>N||null===F||void 0===F||!F.isTeamEvent?null:z?(0,Ee.jsx)(va,{teamManagement:e.teamManagement,teamList:G,inviteList:H,requestList:K,showAlert:Ft,showConfirm:Dt,uploadFile:e.platform.uploadFile,mediaCapture:e.platform.mediaCapture,camera:e.platform.camera,showTour:!1}):(0,Ee.jsx)(X.A,{m:1,marginTop:1,children:(0,Ee.jsx)(Ze.JoinTeam,{joinTeam:Pe,scanQR:Bt,showTour:!N&&F.isTeamEvent&&0===(null===D||void 0===D?void 0:D.filter((e=>e.isTeamEvent)).length)&&"challenges"===M})})),[N,M,Pe,Bt,F,D,z,e.teamManagement,G,H,K,e.platform.uploadFile,e.platform.mediaCapture,e.platform.camera,Dt,Ft]),_t=a.useMemo((()=>N&&null!==F&&void 0!==F&&F.isTeamEvent?(0,Ee.jsx)(ma,{teamManagement:e.teamManagement,inviteList:H,requestList:K,isTeamManager:V,currentTeam:N,showAlert:Ft,showConfirm:Dt,showTour:!1}):null),[N,F,V,e.teamManagement,H,K,Ft,Dt]),Jt=F&&!Vt?e.events.getLimitDateForCurrentEvent():null,Yt=a.useMemo((()=>Jt?(0,Ee.jsx)(X.A,{m:1,marginTop:2,children:(0,Ee.jsx)(Ze.EventTimer,{dateLimit:Jt})}):null),[Jt]);a.useEffect((()=>{const e=(re||[]).length,t=new Date;F&&Jt&&e<=0&&t>Jt&&Ft("Time Limit","In this event you have a limited amount of time to complete all the challenges!",(()=>{}))}),[F,Jt,re,Ft]);const Kt=null!==S?{title:"QR Scanner",handleClose:()=>{S&&S(null),E(null)},content:(0,Ee.jsx)(ia.A,{onResult:e=>{S&&S(e),E(null)}})}:null!==Ce?function(e,t,n,a,l,o,s,i,r,d,c,u,h,p,m){var g;switch(e.type){case"gps":return{title:"GPS Challenge",handleClose:s,content:(0,Ee.jsx)(Ze.GPSChallenge,{...e,teamInfo:o||void 0,handleCheckLocation:n.handleCheckLocation,handleChallengeStarted:i,handleChallengeCompleted:r,handleChallengeFailed:d,isPlayerWithinTheEventTimeLimit:n.isPlayerWithinTheEventTimeLimit,showSnack:u,showAlert:h})};case"info":return{title:"Info",handleClose:s,content:(0,Ee.jsx)(Ze.InfoChallenge,{...e,teamInfo:o||void 0,handleAcknowledge:n.handleAcknowledge,handleChallengeStarted:i,handleChallengeCompleted:r,handleChallengeFailed:d,isPlayerWithinTheEventTimeLimit:n.isPlayerWithinTheEventTimeLimit})};case"write":return{title:"Text Challenge",handleClose:s,content:(0,Ee.jsx)(Ze.WriteChallenge,{...e,teamInfo:o||void 0,handleWrite:n.handleWrite,handleChallengeStarted:i,handleChallengeCompleted:r,handleChallengeFailed:d,isPlayerWithinTheEventTimeLimit:n.isPlayerWithinTheEventTimeLimit})};case"multiple":return{title:"Challenge Group",handleClose:s,content:(0,Ee.jsx)(Ze.MultipleChallenge,{...e,childId:t,teamInfo:o||void 0,uploadFile:l.uploadFile,mediaCapture:l.mediaCapture,camera:l.camera,getCurrentUser:a.getCurrentUser,handleChallengeStarted:i,handleChallengeCompleted:r,handleChallengeFailed:d,handleAcknowledge:n.handleAcknowledge,handleCheckLocation:n.handleCheckLocation,handleTakePhoto:n.handleTakePhoto,scanQR:c,handleScanQR:n.handleScanQR,handleStartQuiz:n.handleStartQuiz,handleSubmitAnswer:n.handleSubmitAnswer,handleSubmitPoll:n.handleSubmitPoll,onPollResults:n.onPollResults,handleStartRoute:n.handleStartRoute,handleContinueRoute:n.handleContinueRoute,handleEndRoute:n.handleEndRoute,handleSubmitRoute:n.handleSubmitRoute,getRouteProgress:n.getRouteProgress,onRouteProgress:n.onRouteProgress,handleWrite:n.handleWrite,handleShootVideo:n.handleShootVideo,isPlayerWithinTheEventTimeLimit:n.isPlayerWithinTheEventTimeLimit,showSnack:u,showAlert:h,checkUnlockedOrUnlockChallengeWithPassword:p,trackingRouteForChallengeId:m,trackingRouteForThisChallenge:!1,trackingRouteForAnotherChallenge:!1})};case"photo":return{title:"Photo Challenge",handleClose:s,content:(0,Ee.jsx)(Ze.PhotoChallenge,{...e,teamInfo:o||void 0,uploadFile:l.uploadFile,mediaCapture:l.mediaCapture,camera:l.camera,getCurrentUser:a.getCurrentUser,handleTakePhoto:n.handleTakePhoto,handleChallengeStarted:i,handleChallengeCompleted:r,handleChallengeFailed:d,isPlayerWithinTheEventTimeLimit:n.isPlayerWithinTheEventTimeLimit,showSnack:u,showAlert:h})};case"qr":return{title:"QR Scan Challenge",handleClose:s,content:(0,Ee.jsx)(Ze.QRChallenge,{...e,teamInfo:o||void 0,scanQR:c,handleScanQR:n.handleScanQR,handleChallengeStarted:i,handleChallengeCompleted:r,handleChallengeFailed:d,isPlayerWithinTheEventTimeLimit:n.isPlayerWithinTheEventTimeLimit,showAlert:h})};case"quiz":return{title:"Quiz Challenge",handleClose:s,content:(0,Ee.jsx)(Ze.QuizChallenge,{...e,teamInfo:o||void 0,handleStartQuiz:n.handleStartQuiz,handleSubmitAnswer:n.handleSubmitAnswer,handleChallengeStarted:i,handleChallengeCompleted:r,handleChallengeFailed:d,isPlayerWithinTheEventTimeLimit:n.isPlayerWithinTheEventTimeLimit})};case"video":return{title:"Video Challenge",handleClose:s,content:(0,Ee.jsx)(Ze.VideoChallenge,{...e,teamInfo:o||void 0,uploadFile:l.uploadFile,mediaCapture:l.mediaCapture,camera:l.camera,getCurrentUser:a.getCurrentUser,handleShootVideo:n.handleShootVideo,handleChallengeStarted:i,handleChallengeCompleted:r,handleChallengeFailed:d,isPlayerWithinTheEventTimeLimit:n.isPlayerWithinTheEventTimeLimit,showSnack:u,showAlert:h})};case"poll":return{title:"Poll Challenge",handleClose:s,content:(0,Ee.jsx)(Ze.PollChallenge,{...e,teamInfo:o||void 0,handleChallengeStarted:i,handleChallengeCompleted:r,handleChallengeFailed:d,isPlayerWithinTheEventTimeLimit:n.isPlayerWithinTheEventTimeLimit,handleSubmitPoll:n.handleSubmitPoll,onPollResults:n.onPollResults})};case"route":return{title:(null!==(g=e.route)&&void 0!==g&&g.boundary?"Explore":"Route")+" Challenge",handleClose:s,content:(0,Ee.jsx)(Ze.RouteChallenge,{...e,teamInfo:o||void 0,handleChallengeStarted:i,handleChallengeCompleted:r,handleChallengeFailed:d,isPlayerWithinTheEventTimeLimit:n.isPlayerWithinTheEventTimeLimit,handleStartRoute:n.handleStartRoute,handleContinueRoute:n.handleContinueRoute,handleEndRoute:n.handleEndRoute,handleSubmitRoute:n.handleSubmitRoute,getRouteProgress:n.getRouteProgress,onRouteProgress:n.onRouteProgress,trackingRouteForThisChallenge:m===e.challengeId,trackingRouteForAnotherChallenge:null!==m&&m!==e.challengeId,showSnack:u})};default:return{title:"Warning",handleClose:s,content:(0,Ee.jsx)(X.A,{m:1,children:(0,Ee.jsx)(Z.A,{severity:"info",children:"Nothing here yet."})})}}}(Ce,fe,{...e.challenges,handleStartRoute:async t=>{const n=await e.challenges.handleStartRoute(t);return n.success?await we(t)?{success:!0}:{success:!1,error:"Could not start tracking route."}:{success:!1,error:"Could not start tracking route: "+n.error}},handleContinueRoute:async t=>{const n=await we(t);if(!n)return{success:!1,error:"Could not continue tracking route."};const a=await e.challenges.handleContinueRoute(t);return a.success||await ke(),{success:n&&a.success,error:a.error}},handleEndRoute:async t=>{const n=await ke();if(!n)return{success:!1,error:"Could not stop tracking route."};const a=await e.challenges.handleEndRoute(t);return{success:n&&a.success,error:a.error}},handleSubmitRoute:async t=>{const n=await e.challenges.handleSubmitRoute(t);return{success:n.success,error:n.error}}},e.auth,e.platform,N,(()=>{xe(null),be(null)}),(()=>{}),(e=>{if("multiple"!==e.type){var t,n;
1let s,i,r=(null===(t=e.share)||void 0===t?void 0:t.title)||void 0;var a;if("photo"===e.type)i=(null===(a=e.completed)||void 0===a?void 0:a.photoUrl)||void 0;else if("video"===e.type){var l;i=(null===(l=e.completed)||void 0===l?void 0:l.videoUrl)||void 0}else if("write"===e.type){var o;s=(null===(o=e.completed)||void 0===o?void 0:o.text)||void 0}const d={open:!1,handleShare:e.share?()=>{Ot(r,s,void 0,i?[i]:void 0)}:void 0,handleClose:()=>{Zt(!1)},text:e.successMsg,type:"route"!==e.type?e.type:null!==(n=e.route)&&void 0!==n&&n.boundary?"explore":"route"};tn(d),Zt(!0)}}),((e,t)=>{if("gps"===e.type){const n=(0,Ee.jsx)(Ze.UserHTML,{htmlString:t||e.errorMsg});Ft("","",(()=>{}),n)}else if("route"===e.type){const n=(0,Ee.jsx)(Ze.UserHTML,{htmlString:t||e.errorMsg});Ft("","",(()=>{}),n)}else if("multiple"!==e.type){const n=(0,Ee.jsx)(Ze.UserHTML,{htmlString:t||e.errorMsg});Ft("","",(()=>{}),n)}}),Bt,oe,Ft,d,Ae):null!==T?{title:"",handleClose:()=>{I(null)},content:(0,Ee.jsx)(Ze.MediaViewer,{...T})}:void 0;e.platform.onBackButton((()=>{Rt?Rt.handleClose&&Rt.handleClose(!1):Kt&&Kt.handleClose()}));const[Xt,Zt]=a.useState(!1),[en,tn]=a.useState(void 0),[nn,an]=a.use
1State(!1);return(0,Ee.jsxs)(a.Fragment,{children:[(0,Ee.jsx)(Dn,{...Lt,children:(()=>{if("event"===M){if(!F)return Qt;if("info"===R||!R)return(0,Ee.jsxs)(a.Fragment,{children:[Yt,(0,Ee.jsx)(X.A,{m:1,marginTop:1,children:(0,Ee.jsxs)(et.A,{container:!0,spacing:1,style:{flexGrow:1},children:[h.map((t=>(0,Ee.jsx)(et.A,{item:!0,xs:12,sm:6,lg:4,xl:3,children:(0,Ee.jsx)(Ze.Announcement,{...t,handleMarkAsRead:t=>e.announcements.markAnnouncementAsRead(t)})}))),(0,Ee.jsx)(et.A,{item:!0,xs:12,sm:12,lg:6,xl:4,children:(0,Ee.jsx)(Ze.EventPlaying,{...F,handleShare:()=>{var e,t,n;let a=null===(e=F.share)||void 0===e?void 0:e.title,l=null===(t=F.share)||void 0===t?void 0:t.text,o=null===(n=F.share)||void 0===n?void 0:n.url;Ot(a,l,o)}})})]})}),Vt?Qt:null]});if("stats"===R)return(0,Ee.jsx)(X.A,{m:1,marginTop:1,children:(0,Ee.jsxs)(et.A,{container:!0,spacing:1,style:{flexGrow:1},children:[(0,Ee.jsx)(et.A,{item:!0,xs:12,children:(0,Ee.jsx)(Ze.UserInfo,{uploadFile:e.platform.uploadFile,mediaCapture:e.platform.mediaCapture,camera:e.platform.camera,getCurrentUser:e.auth.getCurrentUser,updatePublicProfile:e.profile.updatePublicProfile,getPublicProfile:e.profile.getPublicProfile})}),(0,Ee.jsx)(et.A,{item:!0,xs:12,children:(0,Ee.jsx)(Ze.Stats,{type:"event",...Ie,handleChallengesClicked:()=>{L("challenges"),U("current")},handlePhotosClicked:()=>{L("gallery"),U("")},handlePointsClicked:()=>{L("community"),U("leaderboard")}})})]})});if("team"===R)return Ht||_t}else{if("map"===M)return(0,Ee.jsxs)(a.Fragment,{children:[Yt,qt,Vt?Qt:null,Ht||(0,Ee.jsx)(Ze.ChallengeMap,{challenges:ce||[],handleChallengeClick:(e,t)=>{xe(e),be(t||null)},showTour:!1})]});if("routes"===M)return(0,Ee.jsxs)(a.Fragment,{children:[Yt,qt,Vt?Qt:null,Ht||(0,Ee.jsx)(Ze.ChallengeMap,{challenges:(me||[]).filter((e=>{var t;return"route"===e.type&&(null===(t=e.route)||void 0===t?void 0:t.boundary)})),handleChallengeClick:(e,t)=>{xe(e),be(t||null)},showTour:!1})]});if("challenges"===M){const t=(re||[]).some((e=>"multiple"===e.type?(e.challenges||[]).some((e=>e.completed)):e.completed))||(se||[]).some((e=>"multiple"===e.type&&(e.challenges||[]).some((e=>e.completed))));if(null===se||null===re||!(se.length>0||re.length>0))return F?F.isTeamEvent&&Ht||qt:Qt;if("current"===R||!R)return(0,Ee.jsxs)(X.A,{m:0,children:[Yt,qt,Vt?Qt:null,Ht||(0,Ee.jsx)(Ze.Challenges,{challenges:e.challenges.filterChallenges(se,At,yt),handleChallengeClick:e=>{xe(e),be(null)},showTour:0===(null===D||void 0===D?void 0:D.length)&&se.length>
10&&!t,challengeListBackground:(null===F||void 0===F?void 0:F.challengeListBackground)||!1,checkUnlockedOrUnlockChallengeWithPassword:d})]});if("completed"===R)return(0,Ee.jsxs)(X.A,{m:0,children:[qt,Vt?Qt:null,Ht||(0,Ee.jsx)(Ze.Challenges,{challenges:e.challenges.filterChallenges(re,At,yt),handleChallengeClick:e=>{xe(e),be(null)},checkUnlockedOrUnlockChallengeWithPassword:d})]});if("map"===R)return(0,Ee.jsxs)(a.Fragment,{children:[Yt,qt,Vt?Qt:null,Ht||(0,Ee.jsx)(Ze.ChallengeMap,{challenges:ce||[],handleChallengeClick:(e,t)=>{xe(e),be(t||null)},showTour:!1})]})}else{if(!("community"!==M||"feed"!==R&&R))return F?(null!==F&&void 0!==F&&F.isTeamEvent?e.teamFeed.onFeedUpdated(ut):e.feed.onFeedUpdated(ct),(0,Ee.jsxs)(X.A,{m:0,children:[Ht,(0,Ee.jsx)(Ze.Feed,{feed:Ue,markFeedAsRead:F.isTeamEvent?e.teamFeed.markFeedAsRead:e.feed.markFeedAsRead,fetchMoreFeed:F.isTeamEvent?e.teamFeed.fetchMoreFeed:e.feed.fetchMoreFeed,resumeLiveUpdates:F.isTeamEvent?e.teamFeed.resumeLiveUpdates:e.feed.resumeLiveUpdates,hasMoreFeed:F.isTeamEvent?e.teamFeed.hasMoreFeed:e.feed.hasMoreFeed,share:Ot,showOptions:{onBlock:Nt,onReport:zt},toggleFeedEntryLike:null!==F&&void 0!==F&&F.isTeamEvent?e.teamFeed.toggleFeedEntryLike:e.feed.toggleFeedEntryLike,handleEntryClicked:t=>{I({player:{username:t.username,imageUrl:t.imageUrl},feed:{...t,toggleFeedEntryLike:F.isTeamEvent?e.teamFeed.toggleFeedEntryLike:e.feed.toggleFeedEntryLike},type:t.content.type,date:t.date,imageUrl:t.content.imageUrl,text:t.content.text,route:t.content.route,share:Ot})}})]})):Qt;if("community"===M&&"messages"===R)return F?(null!==F&&void 0!==F&&F.isTeamEvent?e.teamMessages.onMessagesUpdated(vt):e.messages.onMessagesUpdated(mt),Ht||(0,Ee.jsx)(X.A,{m:0,children:(0,Ee.jsx)(Ze.Chat,{postMessage:F.isTeamEvent?e.teamMessages.postMessage:e.messages.postMessage,markAsRead:F.isTeamEvent?e.teamMessages.markMessagesAsRead:e.messages.markMessagesAsRead,messages:We,inputOpen:xt,onInputClose:()=>{ft(!1)},context:"messages",showOptions:{onBlock:Nt,onReport:zt,onDelete:$t},hasAdminPermission:ot})})):Qt;if("community"===M&&"leaderboard"===R)return F?(null!==F&&void 0!==F&&F.isTeamEvent?e.teamLeaderboard.onLeaderboardUpdated(gt):e.leaderboard.onLeaderboardUpdated(pt),Ht||(0,Ee.jsxs)(X.A,{m:0,children:[F.leaderboardBanner?(0,Ee.jsx)(yn.A,{src:F.leaderboardBanner.imageUrl,aspectRatio:F.leaderboardBanner.aspectRatio,imageStyle:{objectFit:"cover"}}):null,(0,Ee.jsx)(Ze.Leaderboard,{entries:tt,isTeamEvent:null===F||void 0===F?void 0:F.isTeamEvent})]})):Qt;if("community"===M&&"polls"===R)return(0,Ee.jsx)(X.A,{m:0,children:(0,Ee.jsx)(Ze.PollResultsList,{onPollResults:e.challenges.onPollResults,pollChallengeIds:(null===he||void 0===he?void 0:he.map((e=>e.challengeId)))||[],pollChallengeTitles:(null===he||void 0===he?void 0:he.map((e=>e.title||"")))||[]})});if("badges"===M)return(0,Ee.jsx)(X.A,{m:1,children:(0,Ee.jsx)(Ze.BadgeList,{badges:b,handleBadgeClick:e=>{const t=b.find((t=>t.id===e.id));f(t||null)}})});if("events"===M)return(0,Ee.jsx)(X.A,{m:1,marginTop:1,children:(0,Ee.jsx)(Ze.Events,{nowPlaying:e.events.filterEvents(F?[F]:[],kt)[0]||void 0,events:e.events.filterEvents(D||[],kt),handlePlay:Te,handleShare:async e=>{const t=null===D||void 0===D?void 0:D.find((t=>t.eventId===e));if(t){var n,a,l;let e=null===(n=t.share)||void 0===n?void 0:n.title,o=null===(a=t.share)||void 0===a?void 0:a.text,s=null===(l=t.share)||void 0===l?void 0:l.url;Ot(e,o,s)}},joinEvent:Se,scanQR:Bt})});if("profile"===M)return(0,Ee.jsx)(X.A,{m:1,children:(0,Ee.jsxs)(et.A,{container:!0,spacing:1,children:[(0,Ee.jsx)(et.A,{item:!0,xs:12,children:(0,Ee.jsx)(Ze.LinkCredentials,{...e.auth,showConfirm:Dt,showAlert:e=>{Ft("Alert",e,(()=>{}))}})}),(0,Ee.jsx)(et.A,{item:!0,xs:12,children:(0,Ee.jsx)(Ze.UserInfo,{uploadFile:e.platform.uploadFile,mediaCapture:e.platform.mediaCapture,camera:e.platform.camera,getCurrentUser:e.auth.getCurrentUser,updatePublicProfile:e.profile.updatePublicProfile,getPublicProfile:e.profile.getPublicProfile})}),null,(0,Ee.jsx)(et.A,{item:!0,xs:12,children:(0,Ee.jsx)(Ze.Stats,{type:"global",...Le,handleChallengesClicked:()=>{L("challenges"),U("current")},handlePhotosClicked:()=>{L("gallery"),U("")},handlePointsClicked:()=>{L("community"),U("leaderboard")}})})]})});if("gallery"===M)return(0,Ee.jsx)(X.A,{m:0,children:(0,Ee.jsx)(Ze.Photos,{getPhotos:e.profile.getPhotos,handlePhotoClick:e=>{I({...e,share:Ot})}})});if(!("messages"!==M||R&&"admin"!==R))return(0,Ee.jsx)(X.A,{m:0,children:(0,Ee.jsx)(Ze.Chat,{postMessage:e.support.postSupportMessage,messages:Ve,markAsRead:e.support.markSupportMessagesAsRead,inputOpen:bt,onInputClose:()=>{Ct(!1)},context:"support",showOptions:{onBlock:Nt,onReport:zt,onDelete:$t},hasAdminPermission:ot})});if("messages"===M&&"direct"===R)return Gt;if("settings"===M)return(0,Ee.jsx)(X.A,{m:1,children:(0,Ee.jsxs)(et.A,{container:!0,spacing:1,children:[(0,Ee.jsx)(et.A,{item:!0,xs:12,children:(0,Ee.jsx)(Ze.LinkCredentials,{...e.auth,showConfirm:Dt,showAlert:e=>{Ft("Alert",e,(()=>{}))}})}),(0,Ee.jsx)(et.A,{item:!0,xs:12,children:(0,Ee.jsx)(Ze.Settings,{...e.profile,...e.auth,...e.profile,showConfirm:Dt,onBlockedListUpdated:e.block.onBlockedListUpdated,unblockPlayer:Wt})})]})});if("rulesandterms"===M)return(0,Ee.jsx)(Ze.RulesAndTerms,{})}}return(0,Ee.jsx)(X.A,{m:2,style:{marginTop:t.spacing(2)},children:(0,Ee.jsx)(Z.A,{severity:"info",children:"Nothing here yet."})})})()}),Ae?(0,Ee.jsx)(ca,{onClick:()=>{let e=null,t=null;for(const n of se||[]){if("multiple"===n.type){for(const a of n.challenges||[])if(a.challengeId===Ae){t=a.challengeId,e=n.challengeId;break}}else n.challengeId===Ae&&(e=n.challengeId,t=null);if(e)break}e&&(xe(e),be(t))}}):null,(0,Ee.jsx)(Ze.BadgeDetails,{open:null!==x,badge:x,handleClose:()=>{f(null)}}),(0,Ee.jsx)(fa,{directMessages:e.directMessages,players:e.players,open:Ke,uid:Je,handleClose:()=>{Xe(!1),Ye(null)}}),(0,Ee.jsx)(ea,{modal:Kt,snack:(()=>
1{if(ae)return{...ae,handleClose:()=>{le(null)}}})(),alert:Rt}),en?(0,Ee.jsx)(Ze.ChallengeComplete,{...en,open:Xt}):null,(0,Ee.jsx)(ba,{open:nn,callback:e=>{if("technical"===e){let e="Eventzee",t="[email protected]";e="Eventzee",window.open(`mailto:${t}?subject=${e}`,"_system")}else"general"===e&&(L("messages"),U("admin"));an(!1)}}),(0,Ee.jsx)(Ze.BadgeDetails,{open:y.length>0&&!x&&!Ce,badge:y[0],isAwardedNotification:!0,handleClose:()=>{w({add:[],remove:[y[0]]})}}),(0,Ee.jsx)(Ze.FullscreenLoading,{open:l})]})}function ca(e){const t=(0,$.A)();return(0,Ee.jsx)(X.A,{id:"route-tracking-info",style:{position:"fixed",bottom:"72px",display:"flex",alignItems:"center",justifyContent:"center",width:"100%"},onClick:e.onClick,children:(0,Ee.jsx)(un.A,{icon:(0,Ee.jsx)(ha,{}),label:"GPS",clickable:!0,color:"primary",style:{backgroundColor:t.palette.secondary.main}})})}const ua=(0,W.A)((e=>(0,z.A)({animation:{"& *":{fill:e.palette.text.secondary,stroke:e.palette.text.primary}}})));function ha(e){const t=ua(),n={loop:!0,autoplay:!0,animationData:kn,rendererSettings:{preserveAspectRatio:"xMidYMid slice",className:t.animation}};return(0,Ee.jsx)(wn.A,{options:n,height:45,width:45})}const pa=(0,W.A)((e=>(0,z.A)({root:{backgroundColor:e.palette.background.paper,margin:e.spacing(1),padding:e.spacing(1)}})));function ma(e){const t=pa(),n=e.currentTeam;return(0,Ee.jsxs)(cn.A,{className:t.root,children:[(0,Ee.jsx)(Ze.TeamInfoName,{team:n}),e.isTeamManager?(0,Ee.jsx)(Ze.ManagePublicTeam,{...e.teamManagement,inviteList:e.inviteList,requestList:e.requestList,showAlert:e.showAlert,showConfirm:e.showConfirm,showTour:e.showTour}):null,(0,Ee.jsx)(Ze.TeamInfoMembers,{...e.teamManagement,team:n,showAlert:e.showAlert,showConfirm:e.showConfirm,showTour:e.showTour,isTeamManager:e.isTeamManager})]})}const ga=(0,W.A)((e=>(0,z.A)({root:{backgroundColor:e.palette.background.paper,margin:e.spacing(1),padding:e.spacing(1)}})));function va(e){const t=ga(),[n,l]=a.useState("join");return"join"===n||e.requestList.length>0?(0,Ee.jsx)(cn.A,{className:t.root,children:(0,Ee.jsx)(Ze.JoinPublicTeam,{onCreateNew:()=>{0===e.requestList.length&&l("create")},...e.teamManagement,showAlert:e.showAlert,showConfirm:e.showConfirm,teamList:e.teamList,inviteList:e.inviteList,requestList:e.requestList,showTour:e.showTour})}):"create"===n?(0,Ee.jsx)(cn.A,{className:t.root,children:(0,Ee.jsx)(Ze.CreatePublicTeam,{onChooseExisting:()=>{l("join")},...e.teamManagement,showAlert:e.showAlert,showConfirm:e.showConfirm,uploadFile:e.uploadFile,mediaCapture:e.mediaCapture,camera:e.camera,showTour:e.showTour})}):null}function xa(e){const[t,n]=a.useState([]);return a.useEffect((()=>{e.directMessages.onDirectListUpdated((t=>{n(t);const a=t.reduce(((e,t)=>e+(t.unread?1:0)),0);e.handleBadgeChanged(a)}))}),[e]),e.open?(0,Ee.jsx)(Ze.DirectList,{messages:t,handleThreadClicked:t=>{e.directMessages.markDirectListEntryAsRead(t).then((()=>{})),e.handleDirectMessageClicked(t.uid)},showOptions:e.showOptions}):null}function fa(e){const[t,n]=a.useState(e.uid||null);a.useEffect((()=>{n(e.uid||null)}),[e.uid]);const l=t?(0,Ee.jsx)(Ze.DirectChat,{...e.directMessages,uid:t}):(0,Ee.jsx)(Ze.DirectSearch,{...e.players,handlePlayerSelected:e=>{n(e||null)}}),[o,s]=a.useState(null);a.useEffect((()=>{o&&o.scrollIntoView()}),[o]);const i=t?e.players.getPlayerUsername(t):"";return(0,Ee.jsxs)(_e,{open:e.open,handleClose:e.handleClose,title:i||"Direct Message",closeIcon:"arrow",children:[l,(0,Ee.jsx)("div",{id:"scroll-to-bottom",ref:e=>{s(e)}})]})}function ba(e){return(0,Ee.jsxs)(We.A,{open:e.open,onClose:()=>{e.callback("")},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,maxWidth:"sm",children:[(0,Ee.jsx)(Ve.A,{id:"alert-dialog-title",children:"Contact"}),(0,Ee.jsx)($e.A,{children:(0,Ee.jsxs)(Oe.A,{id:"alert-dialog-description",children:["Do you need ",(0,Ee.jsx)("b",{children:"technical support"})," (app malfunctioning or bug reports) or do you require ",(0,Ee.jsx)("b",{children:"general assistance"})," related to an event or a"," ","challenge"," ","(questions about scoring, photo/video approval, etc.)?"]})}),(0,Ee.jsxs)(ze.A,{children:[(0,Ee.jsx)(Ne.A,{onClick:()=>{e.callback("technical")}
1,color:"primary",children:"Tech Support"}),(0,Ee.jsx)(Ne.A,{onClick:()=>{e.callback("general")},color:"primary",autoFocus:!0,children:"General Assistance"})]})]})}const Ca=new class{constructor(){this.images=void 0,this.images={}}preload(e){const t=e.filter((e=>!!e)).filter((e=>!this.images[e||""])).slice(0,10);for(const n of t){if(!n)continue;const e=document.createElement("img");e.src=n,this.images[n]=e}}};var Aa=n(77994),ja=n(56212),ya=n(58139);n.p;const wa=n.p+"static/media/signup-eventzee.fbf25b09cd73ff71e63a.jpg";n.p,n.p,n.p,n.p,n.p,n.p;function ka(){const e="1.0.392".split(".")[2];return(0,Ee.jsxs)("div",{children:[(0,Ee.jsxs)(pe.A,{variant:"subtitle2",color:"textSecondary",align:"center",children:["Build ",e]}),(0,Ee.jsxs)(pe.A,{variant:"body2",color:"textSecondary",align:"center",children:["Copyright \xa9 ",(0,Ee.jsx)(ot.A,{color:"inherit",href:"http://www.freezetag.com/",children:"Freeze Tag, Inc."})," ",(new Date).getFullYear(),"."]})]})}let Sa=wa;const Ea=(0,W.A)((e=>(0,z.A)({root:{backgroundImage:`url("${Sa}")`,backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[e.breakpoints.up("sm")]:{justifyContent:"center"}},logo:{width:"50%",marginTop:e.spacing(1)},paper:{marginLeft:e.spacing(2),marginRight:e.spacing(2),padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",background:(0,Me.Rv)(e.palette.background.paper,.975),maxWidth:e.breakpoints.width("sm")},form:{width:"100%",marginTop:e.spacing(1)},submit:{margin:e.spacing(2,0,2)},wrapper:{position:"relative",width:"100%",maxWidth:e.breakpoints.width("sm")},buttonProgress:{color:rt.A[500],position:"absolute",top:"50%",left:"50%",marginTop:-12,marginLeft:-12}})));function Pa(e){const t=Ea({}),n=(0,$.A)(),[l,o]=a.useState(!1),[s,i]=a.useState(!1),r=!(!e.continueWithFacebook||!e.linkWithFacebook),d=!(!e.continueWithApple||!e.linkWithApple);if(!r&&!d)return null;return(0,Ee.jsxs)(X.A,{mt:0,width:"100%",display:"flex",flexDirection:"column",alignItems:"center",children:[(0,Ee.jsx)(pe.A,{variant:"button",align:"center",children:"Or"}),d?(0,Ee.jsxs)("div",{className:t.wrapper,children:[(0,Ee.jsx)(Ne.A,{startIcon:(0,Ee.jsx)(ja.A,{}),fullWidth:!0,variant:"contained",style:{backgroundColor:"#000000",color:"white",marginTop:n.spacing(1),marginBottom:n.spacing(1),textTransform:"none"},onClick:async()=>{i(!0),await new Promise((e=>window.setTimeout(e,2e3))),i(!1)},children:"Continue with Apple"}),s&&(0,Ee.jsx)(it.A,{size:24,className:t.buttonProgress})]}):null,r?(0,Ee.jsxs)("div",{className:t.wrapper,children:[(0,Ee.jsx)(Ne.A,{startIcon:(0,Ee.jsx)(Aa.A,{}),fullWidth:!0,variant:"contained",style:{backgroundColor:"#4267b2",color:"white",marginTop:n.spacing(1),marginBottom:n.spacing(1),textTransform:"none"},onClick:async()=>{if(e.continueWithFacebook&&e.linkWithFacebook){o(!0);try{await e.continueWithFacebook()||e.showAlert&&e.showAlert("Login Failed")}catch(t){if("email already registered"===t.message&&e.showPasswordForm){const t=await e.showPasswordForm();if(t&&e.linkWithFacebook)try{await e.linkWithFacebook(t)||e.showAlert&&e.showAlert("Facebook Link Failed")}catch(n){e.showAlert&&e.showAlert(n.message)}}else e.showAlert&&e.showAlert(t.message)}o(!1)}},children:"Continue with Facebook"}),l&&(0,Ee.jsx)(it.A,{size:24,className:t.buttonProgress})]}):null]})}function Ta(e){const t=Ea({}),[n,l]=a.useState(""),[o,s]=a.useState(""),[i,r]=a.useState(!1),d=e.validateEmail(n),c=e.validatePassword(o);return(0,Ee.jsx)(cn.A,{className:t.paper,children:(0,Ee.jsxs)("form",{className:t.form,noValidate:!0,children:[(0,Ee.jsx)(V.A,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",type:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>{l(e.target.value)},error:null!==d&&n.length>0,helperText:d}),(0,Ee.jsx)(V.A,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>{s(e.target.value)},error:null!==c&&o.length>0,helperText:c}),(0,Ee.jsx)(Ne.A,{color:"primary",fullWidth:!0,onClick:()=>{e.showEmailForm&&e.showEmailForm().then((t=>{t&&e.recover(t).then((()=>{e.showAlert&&e.showAlert("Password recovery email sent.","Success")})).catch((t=>
1{e.showAlert&&e.showAlert(t.message)}))}))},children:"Forgot password?"}),(0,Ee.jsxs)("div",{className:t.wrapper,children:[(0,Ee.jsx)(Ne.A,{fullWidth:!0,variant:"contained",color:"primary",type:"button",id:"signin",className:t.submit,disabled:i||null!==d||null!==c,onClick:()=>{r(!0),e.login(n,o,!0).then((t=>{t||(r(!1),e.showAlert&&e.showAlert("Login Failed"))})).catch((t=>{r(!1),e.showAlert&&e.showAlert(t.message)}))},children:"Sign In"}),i&&(0,Ee.jsx)(it.A,{size:24,className:t.buttonProgress})]}),(0,Ee.jsx)(Ne.A,{color:"secondary",fullWidth:!0,onClick:()=>{e.onSignUp()},children:"Don't have an account? Sign Up"}),(0,Ee.jsx)(Pa,{...e}),(0,Ee.jsx)(X.A,{mt:1,children:(0,Ee.jsx)(ka,{})})]})})}function Ia(e){const t=Ea({}),[n,l]=a.useState(""),[o,s]=a.useState(""),[i,r]=a.useState(""),[d,c]=a.useState(""),[u,h]=a.useState(!1),p=e.validateUsername(i),m=e.validateEmail(n),g=e.validatePassword(o);let v="https://www.freezetag.com",x="https://www.freezetag.com";return v="https://towntrek.freshdesk.com/support/solutions/articles/157000300561-towntrek-app-terms-of-service",x="https://eventzee.freshdesk.com/en/support/solutions/articles/48001143289-eventzee-app-privacy-policy",(0,Ee.jsx)(cn.A,{className:t.paper,children:(0,Ee.jsxs)("form",{className:t.form,noValidate:!0,children:[(0,Ee.jsx)(V.A,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",type:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>{l(e.target.value)},error:null!==m&&n.length>0,helperText:m}),(0,Ee.jsx)(V.A,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"username",label:"Username",type:"text",id:"username",onChange:e=>{r(e.target.value)},error:null!==p&&i.length>0,helperText:p}),(0,Ee.jsx)(V.A,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>{s(e.target.value)},error:null!==g&&o.length>0,helperText:g}),null,(0,Ee.jsx)(X.A,{mt:1,children:(0,Ee.jsxs)(pe.A,{variant:"subtitle2",align:"center",children:["I agree to the"," ",(0,Ee.jsx)(ot.A,{rel:"noreferrer",target:"_system",onClick:()=>{window.open(v,"_system")},children:"Terms of Service"})," ","and"," ",(0,Ee.jsx)(ot.A,{rel:"noreferrer",target:"_system",onClick:()=>{window.open(x,"_system")},children:"Privacy Policy"})]})}),(0,Ee.jsxs)("div",{className:t.wrapper,children:[(0,Ee.jsx)(Ne.A,{fullWidth:!0,variant:"contained",color:"primary",type:"button",id:"signup",className:t.submit,disabled:u||null!==g||null!==m||null!==p,onClick:()=>{let t=null;o.length<6&&(t="Password should be at least 6 characters long."),i.length<3&&(t="Username should be at least 3 characters long."),t?e.showAlert&&e.showAlert(t):(h(!0),e.signup(i,n,o,d).then((t=>{t||(h(!1),e.showAlert&&e.showAlert("Login Failed"))})).catch((t=>{h(!1),e.showAlert&&e.showAlert(t.message)})))},children:"I Agree & Sign Up"}),u&&(0,Ee.jsx)(it.A,{size:24,className:t.buttonProgress})]}),(0,Ee.jsx)(Ne.A,{id:"sign-in-button",fullWidth:!0,color:"secondary",onClick:()=>{e.onSignIn()},children:"Already have an account? Sign In"}),window.cordova||e.hideGuestLoginLink?null:(0,Ee.jsxs)(a.Fragment,{children:[(0,Ee.jsx)(pe.A,{align:"center",color:"textSecondary",variant:"body2",children:"OR"}),(0,Ee.jsx)(Ne.A,{id:"play-as-guest-button",fullWidth:!0,color:"secondary",onClick:()=>{e.onAnonymous()},children:"Play as a Guest"})]}),(0,Ee.jsx)(Pa,{...e}),(0,Ee.jsx)(X.A,{mt:1,children:(0,Ee.jsx)(ka,{})})]})})}function Ma(e){const t=Ea(),n=(0,$.A)(),[l,o]=a.useState(e.prefillCode||""),[s,i]=a.useState(""),[r,d]=a.useState(!1);return(0,Ee.jsx)(cn.A,{className:t.paper,children:(0,Ee.jsxs)("form",{className:t.form,noValidate:!0,children:[(0,Ee.jsx)(V.A,{variant:"outlined",required:!0,fullWidth:!0,margin:"normal",label:"Username",autoFocus:!0,t
1ype:"text",id:"username",value:s,onChange:e=>{i(e.target.value)}}),(0,Ee.jsx)(V.A,{variant:"outlined",fullWidth:!0,margin:"normal",id:"code",type:"text",label:"Optional: Event Code",value:l,onChange:e=>{o(e.target.value)},helperText:"If you already have a code to join an event enter it here to get started right away!"}),(0,Ee.jsxs)(X.A,{display:"flex",justifyContent:"flex-end",alignItems:"center",children:[(0,Ee.jsx)(pe.A,{color:"textSecondary",style:{marginRight:n.spacing(1),marginLeft:n.spacing(1)},children:"or scan an event QR code"}),(0,Ee.jsx)(Ne.A,{startIcon:(0,Ee.jsx)(ya.A,{}),variant:"contained",color:"secondary",type:"button",disabled:r,onClick:()=>{e.scanQR((e=>{e&&o(e)}))},children:"Scan"})]}),(0,Ee.jsxs)("div",{className:t.wrapper,children:[(0,Ee.jsx)(Ne.A,{fullWidth:!0,id:"play",variant:"contained",color:"primary",type:"button",className:t.submit,disabled:r,onClick:()=>{d(!0),e.guestSignup(s,l||void 0).then((t=>{t||(d(!1),e.showAlert&&e.showAlert("Guest Login Failed"))})).catch((t=>{d(!1),e.showAlert&&e.showAlert(t.message)}))},children:"Play"}),r&&(0,Ee.jsx)(it.A,{size:24,className:t.buttonProgress})]}),(0,Ee.jsx)(pe.A,{variant:"body2",color:"textSecondary",align:"center",children:"OR"}),(0,Ee.jsx)(Ne.A,{color:"secondary",fullWidth:!0,id:"from-simple-to-signup",onClick:()=>{e.onSignUp()},children:"Create account"}),(0,Ee.jsx)(X.A,{mt:1,children:(0,Ee.jsx)(ka,{})})]})})}function La(e){const t=Ea({});let n="SignUp";e.prefillCode&&(n="Anonymous");const[l,o]=a.useState(n),[s,i]=a.useState(null),[r,d]=a.useState(null),[c,u]=a.useState(null),h=a.useCallback((t=>{const n=e=>{if(e){let n=decodeURI(e);if(0===n.indexOf("https://")){const e=En()(n,{},!0).query;null!==e&&void 0!==e&&e.qrcode&&void 0!==(null===e||void 0===e?void 0:e.qrcode)&&(n=e.qrcode)}t(n)}else t(null)};e.platform.cordovaQRScanner(n)||u((()=>n))}),[e.platform,u]),p=()=>new Promise((e=>{i({title:"Password Reset",content:"Please enter your email address to reset your password.",label:"Email address",type:"email",button:"Submit",callback:t=>{i(null),e(t)}})})),m=()=>new Promise((e=>{i({title:"Link Facebook Account",content:"Please enter the password for the existing account.",label:"Password",type:"password",button:"Submit",callback:t=>{i(null),e(t)}})})),g=(e,t)=>new Promise((n=>{d({title:t||"Error",text:e,okButtonText:"OK",callback:e=>{d(null),n(e)}})}));let v=null;return"SignIn"===l?v=(0,Ee.jsx)(Ta,{...e,onSignUp:()=>{o("SignUp")},showEmailForm:p,showPasswordForm:m,showAlert:g}):"SignUp"===l?v=(0,Ee.jsx)(Ia,{...e,onSignIn:()=>{o("SignIn")},onAnonymous:()=>{o("Anonymous")},showAlert:g,showPasswordForm:m}):"Anonymous"===l&&(v=(0,Ee.jsx)(Ma,{...e,onSignUp:()=>{o("SignUp")},scanQR:h,showAlert:g,showPasswordForm:m,prefillCode:e.prefillCode})),(0,Ee.jsxs)("div",{className:t.root,children:[v,(0,Ee.jsx)(Ba,{open:!!c,handleClose:()=>{u(null)},handleScan:e=>{e&&c&&(c(e),u(null))}}),(0,Ee.jsx)(Ra,{open:s}),(0,Ee.jsx)(Ua,{open:r})]})}function Ba(e){const t=(0,$.A)(),n=(0,d.A)(t.breakpoints.down("sm"));return(0,Ee.jsxs)(We.A,{fullScreen:n,open:e.open,onClose:e.handleClose,children:[(0,Ee.jsx)(Ve.A,{id:"responsive-dialog-title",children:"QR Scanner"}),(0,Ee.jsx)($e.A,{dividers:!0,children:(0,Ee.jsx)(ia.A,{onResult:t=>{e.open&&t&&e.handleScan(t)}})}),(0,Ee.jsx)(ze.A,{children:(0,Ee.jsx)(Ne.A,{onClick:e.handleClose,children:"Cancel"})})]})}function Ra(e){var t,n,l,o,s;const[i,r]=a.useState("");return(0,Ee.jsxs)(We.A,{open:null!==e.open,onClose:()=>{e.open&&e.open.callback(null)},"aria-labelledby":"form-dialog-title",fullWidth:!0,maxWidth:"sm",children:[(0,Ee.jsx)(Ve.A,{id:"form-dialog-title",children:(null===(t=e.open)||void 0===t?void 0:t.title)||""}),(0,Ee.jsxs)($e.A,{children:[(0,Ee.jsx)(Oe.A,{children:(null===(n=e.open)||void 0===n?void 0:n.content)||""}),(0,Ee.jsx)(V.A,{autoFocus:!0,margin:"dense",id:"name",label:(null===(l=e.open)||void 0===l?void 0:l.label)||"Input",type:null===(o=e.open)||void 0===o?void 0:o.type,fullWidth:!0,onChange:e=>{r(e.target.value)},value:i})]}),(0,Ee.jsxs)(ze.A,{children:[(0,Ee.jsx)(Ne.A,{onClick:()=>{e.open&&e.open.callback(null)},color:"primary",children:"Cancel"}),(0,Ee.jsx)(Ne.A,{onClick:()=>{e.open&&e.open.callback(i||null)},color:"primary",children:(null===(s=e.open)||void 0===s?void 0:s.button)||"Submit"})]})]})}function Ua(e){return(0,Ee.jsxs)(We.A,{open:null!==e.open,onClose:()=>{e.open&&e.open.callback(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,maxWidth:"sm",children:[(0,Ee.jsx)(Ve.A,{id:"alert-dialog-title",children:e.open&&e.open.title||""}),(0,Ee.jsx)($e.A,{children:(0,Ee.jsx)(Oe.A,{id:"alert-dialog-description",children:e.open&&e.open.text||""})}),(0,Ee.jsxs)(ze.A,{children:[(0,Ee.jsx)(Ne.A,{onClick:()=>{e.open&&e.open.callback(!1)},color:"primary",children:e.open&&e.open.cancelButtonText||""}),(0,Ee.jsx)(Ne.A,{onClick:()=>{e.open&&e.open.callback(!0)}
1,color:"primary",autoFocus:!0,children:e.open&&e.open.okButtonText||""})]})]})}var Fa=n(1438),Da=n(47807),Na=n(61278),Wa=n(73094),za=n(4175),$a=n(53343),Oa=n(6695),Va=n(11862),qa=n(99032);const Ga=(0,W.A)((e=>(0,z.A)({root:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:"100vh",maxHeight:"100vh"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",height:50,paddingLeft:e.spacing(4),paddingRight:e.spacing(4),backgroundColor:e.palette.background.default,flexShrink:0},slide:{flexGrow:1,position:"relative",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},media:{position:"absolute",width:"100%",height:"100%",objectFit:"contain",imageOrientation:"from-image"},textPaper:{display:"flex",alignItems:"center",padding:e.spacing(4)},title:{flexGrow:1},control:{flexShrink:0},user:{position:"absolute",bottom:e.spacing(1),right:e.spacing(2)},team:{position:"absolute",bottom:e.spacing(1),left:e.spacing(2)}})));function Qa(e){const t=Ga(),n=(0,$.A)(),[l,o]=a.useState([]),[s,i]=a.useState(!0),[r,d]=a.useState(0),c=l.length,u=l[r];a.useEffect((()=>{if(!e.eventId)return;const t=e.eventId;e.slideshow.onSlideshowUpdated(t,(e=>{o(e)}))}),[e.slideshow,e.eventId]);const[h,p]=a.useState(!1),m=a.useCallback((()=>{d((e=>e<c-1?e+1:0))}),[c]);a.useEffect((()=>{let e=0;return"photo"!==(null===u||void 0===u?void 0:u.type)&&"write"!==(null===u||void 0===u?void 0:u.type)||(e=window.setTimeout((()=>{s||m()}),5e3)),()=>{e&&window.clearTimeout(e)}}),[u,m,s]);let g=null;if("photo"===(null===u||void 0===u?void 0:u.type))g=(0,Ee.jsx)("img",{alt:"large view",src:u.mediaUrl,className:t.media});else if("video"===(null===u||void 0===u?void 0:u.type)){var v;g=(0,Ee.jsxs)("video",{className:t.media,controls:!h,autoPlay:!0,onEnded:()=>{s||m()},children:[(0,Ee.jsx)("source",{src:(null===(v=u.mediaUrl)||void 0===v?void 0:v.substr(0,u.mediaUrl.lastIndexOf(".")))+".webm",type:"video/webm"}),(0,Ee.jsx)("source",{src:u.mediaUrl})]},u.mediaUrl)}else"write"===(null===u||void 0===u?void 0:u.type)&&(g=(0,Ee.jsx)(cn.A,{elevation:3,className:t.textPaper,children:(0,Ee.jsx)(pe.A,{variant:"h4",children:u.text})}));return(0,Ee.jsx)(qa.A,{enabled:h,onChange:e=>p(e),children:(0,Ee.jsxs)("div",{className:t.root,children:[(0,Ee.jsxs)(cn.A,{square:!0,elevation:0,className:t.header,children:[(0,Ee.jsx)(pe.A,{noWrap:!0,className:t.title,children:(null===u||void 0===u?void 0:u.title)||(null===u||void 0===u?void 0:u.description)||""}),(0,Ee.jsx)(se.A,{className:t.control,onClick:()=>{i((e=>(e&&m(),!e)))},children:s?(0,Ee.jsx)(Oa.A,{}):(0,Ee.jsx)(Va.A,{})}),(0,Ee.jsx)(se.A,{className:t.control,onClick:()=>{p(!h)},children:h?(0,Ee.jsx)($a.A,{}):(0,Ee.jsx)(za.A,{})})]}),(0,Ee.jsxs)("div",{className:t.slide,children:[g,(0,Ee.jsxs)("div",{className:t.user,children:[null!==u&&void 0!==u&&u.teamName&&null!==u&&void 0!==u&&u.teamImageUrl?(0,Ee.jsx)(un.A,{avatar:(0,Ee.jsx)(Wa.A,{alt:"Team Avatar",src:(null===u||void 0===u?void 0:u.teamImageUrl)||""}),label:(null===u||void 0===u?void 0:u.teamName)||"Anonymous",style:{marginRight:n.spacing(1)}}):null,(0,Ee.jsx)(un.A,{avatar:(0,Ee.jsx)(Wa.A,{alt:"Avatar",src:(null===u||void 0===u?void 0:u.avatarUrl)||""}),label:(null===u||void 0===u?void 0:u.username)||"Anonymous"})]})]}),h?null:(0,Ee.jsx)(Fa.A,{steps:c,position:"static",variant:"text",activeStep:r,nextButton:(0,Ee.jsxs)(Ne.A,{size:"small",onClick:m,disabled:r===c-1,children:["Next","rtl"===n.direction?(0,Ee.jsx)(Da.A,{}):(0,Ee.jsx)(Na.default,{})]}),backButton:(0,Ee.jsxs)(Ne.A,{size:"small",onClick:()=>{d((e=>e>0?e-1:c-1))},disabled:0===r,children:["rtl"===n.direction?(0,Ee.jsx)(Na.default,{}):(0,Ee.jsx)(Da.A,{}),"Back"]})})]})})}const Ha=(0,W.A)((e=>(0,z.A)({root:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:"100vh",maxHeight:"100vh"}})));function _a(e){const t=Ha(),[n,l]=a.useState(null);return a.useEffect((()=>{e.eventId&&e.challengeMap.getMapChallenges(e.eventId).then((e=>l(e)))}),[e.challengeMap,e.eventId]),(0,Ee.jsx)(X.A,{className:t.root,children:(0,Ee.jsx)(Ze.ChallengeMap,{challenges:n||[],isStandaloneMapPage:!0})})}function Ja(e){const[t,n]=a.useState(null),[c,u]=a.useState(null);a.useEffect((()=>{e.events.onEventsUpdated(((e,t,a)=>{const l=[...t,...a];n(e?{...e}:null),u(l)}))}),[e.events]);
1const[h,p]=a.useState(null),m=window.innerWidth>600&&!window.cordova,[g,v]=a.useState((e.queryParams.shop?"shop":e.queryParams.admin&&"admin")||"client");a.useEffect((()=>{e.queryParams.shop?v("shop"):e.queryParams.admin?v("admin"):e.queryParams.client||e.embeddedInBrellaApp?v("client"):v(m?"admin":"client")}),[e.queryParams]);let x=(0,d.A)("(prefers-color-scheme: dark)");const f=e.queryParams.eventId||void 0,b=e.queryParams.slideshow&&f||void 0,C=e.queryParams.map&&f||void 0;b&&(x=!0);let A=i.default[400],j=r.A[400],y=i.default[400],w=r.A[400];A="#3173b0",j="#52b093",y="#3173b0",w="#52b093",Ze.colors.setDefaultTheme(),Ze.colors.updateDarkTheme((null===t||void 0===t?void 0:t.darkTheme)||{}),Ze.colors.updateLightTheme((null===t||void 0===t?void 0:t.lightTheme)||{}),Ze.colors.setMode(x?"dark":"light"),"shop"===g?(A="#6E3C8C",j="#6AC03F",x=!1):null!==t&&void 0!==t&&t.darkTheme&&x?(y=t.darkTheme.primary,w=t.darkTheme.secondary):null!==t&&void 0!==t&&t.lightTheme&&!x&&(A=t.lightTheme.primary,j=t.lightTheme.secondary);const[k,S]=a.useState((0,o.D)({palette:{primary:{dark:y,light:A,main:x?y:A},secondary:{main:x?w:j,light:j,dark:w},type:x?"dark":"light"}}));a.useEffect((()=>{S((0,o.D)({palette:{primary:{dark:y,light:A,main:x?y:A},secondary:{main:x?w:j,light:j,dark:w},type:x?"dark":"light"}}))}),[A,j,y,w,x]),a.useEffect((()=>{e.auth.getCurrentUser().then((e=>{p(e)}))}),[e]);let E=null;return b?E=(0,Ee.jsx)(Qa,{...e,eventId:b}):C?E=(0,Ee.jsx)(_a,{...e,eventId:C}):"shop"===g?E=(0,Ee.jsx)(gt,{...e,websiteTheme:!0}):null===h?E=(0,Ee.jsx)(La,{...e,prefillCode:e.queryParams.code||void 0,hideGuestLoginLink:!!e.queryParams.join&&!0}):"client"===g?E=(0,Ee.jsx)(da,{...e,handleEnterAdmin:()=>{v("admin")},prefillCode:e.queryParams.code||void 0,currentEvent:t,eventList:c,myUserId:h.id}):"admin"===g&&(E=(0,Ee.jsx)(St,{...e,handleExitAdmin:()=>{v("client")}})),(0,Ee.jsxs)(s.A,{theme:k,children:[(0,Ee.jsx)(l.Ay,{}),E]})}}}]);
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.