1import{a as ye}from"./chunk-AF6G7XUW.js";import{a as T,b as he,c as fe}from"./chunk-ZFKCQM6D.js";import{a as ce,b as me}from"./chunk-QQ4XRSBZ.js";import"./chunk-RHFYWNHQ.js";import"./chunk-ZB44PIZA.js";import"./chunk-YBFQQSLW.js";import{a as pe,b as ge}from"./chunk-SKKZGEFJ.js";import{b as ue}from"./chunk-BK5GEWNM.js";import"./chunk-IWH6QETE.js";import"./chunk-WR7JO7XW.js";import"./chunk-HEXCNDVV.js";import"./chunk-MB6YAV2B.js";import"./chunk-4NM77DS2.js";import"./chunk-ADMKBOBN.js";import"./chunk-LCPPMNQ3.js";import"./chunk-BT6MT7GL.js";import"./chunk-5D7LV4AS.js";import"./chunk-XPLYBCSC.js";import"./chunk-UD33NWAA.js";import"./chunk-BFPYKIIC.js";import"./chunk-7TB77G3Z.js";import"./chunk-PUWYUIPV.js";import"./chunk-4CVZBQNN.js";import{Zb as ae,qc as se}from"./chunk-PXZNPNHI.js";import"./chunk-KWNDGQWR.js";import"./chunk-2ZFY6MCW.js";import"./chunk-KQ7PEKEE.js";import"./chunk-KVMIYEBS.js";import"./chunk-DLHY2JKF.js";import"./chunk-WLMRFXCZ.js";import"./chunk-WN3UI2QV.js";import"./chunk-YVLOHBDK.js";import"./chunk-Z3AXU4EF.js";import"./chunk-TP3A6IN2.js";import"./chunk-XNFXA3ZT.js";import"./chunk-QLTRNXEK.js";import"./chunk-TEFEWVO6.js";import"./chunk-ZB64W4XA.js";import"./chunk-SVABVB5X.js";import"./chunk-CMY6WAF3.js";import"./chunk-FUY7HSJY.js";import"./chunk-JTYXZXFU.js";import"./chunk-7MK6I7GJ.js";import"./chunk-3HFTO6XY.js";import"./chunk-XNSH6ILV.js";import"./chunk-IZKA562T.js";import"./chunk-BROSYERN.js";import"./chunk-Y2KCFOCP.js";import"./chunk-Z52L74DH.js";import{j as le,q as de}from"./chunk-QH3IRCHN.js";import"./chunk-PLEH3NAH.js";import"./chunk-GXCJ5QS4.js";import{b as U}from"./chunk-4D5SN44G.js";import"./chunk-22ACI5KU.js";import"./chunk-FXUQQQIE.js";import"./chunk-FSUBAQYH.js";import{a as oe}from"./chunk-7CVCGK4Q.js";import"./chunk-FWW3IJT2.js";import"./chunk-B6LCWWQX.js";import"./chunk-HYGNXZJR.js";import"./chunk-B6XXRKU5.js";import{a as A}from"./chunk-6Q5DDO7R.js";import"./chunk-RW2MVE4O.js";import"./chunk-3ZVRFUA4.js";import"./chunk-H4PCL6BZ.js";import{a as X}from"./chunk-NXTJBJRP.js";import"./chunk-U22BTVEZ.js";import{$d as ee,Ef as _,Eg as re,Ff as te,Gb as Z,cg as ie,kh as ne,ua as Q}from"./chunk-X5J6QTCG.js";import{$ as P,$a as p,Ad as k,E as b,Fa as d,H as V,Ib as e,Jb as z,Ka as m,Ma as j,Na as I,Nf as w,Th as J,U as $,_ as O,ba as H,bb as u,d as L,db as B,di as W,eb as N,fa as h,fb as R,fi as G,ga as f,gb as y,hb as a,ib as s,jb as Y,k as g,nb as E,ob as F,pj as K,qb as x,sb as v,tb as c,u as D,xd as q}from"./chunk-SMW7PHYX.js";import"./chunk-BMIYOSOG.js";function Pe(n,i){if(n&1&&(e(0,` 2`),Y(1,"app-site-banners",4),e(2,` 3`)),n&2){let o=c(2);d(),y("displayOption",o.bannerDisplayOption)("clubID",o.clubID)("isUserLoggedIn",o.isUserLoggedIn)("extraTopClearance",!0)}}function Ie(n,i){if(n&1&&(e(0,` 4`),p(1,Pe,3,4),a(2,"app-page",3),e(3,` 5`),s(),e(4,` 6`)),n&2){let o=c();d(),u(o.clubID?1:-1),d(),y("pageBuilderPage",o.pageBuilderPage)("players",o.players)("isUserLoggedIn",o.isUserLoggedIn)}}function we(n,i){n&1&&(e(0,` 7 `),a(1,"p",8),e(2,`Add a player to your account to see what programs are available to you at 8 your club. If the 9 player 10 is over 13 years of age, you can also allow them to create their own login. You can also add players at 11 any 12 point`),s(),e(3,` 13 `))}function Ae(n,i){if(n&1){let o=x();e(0,` 14 `),a(1,"h1",5),e(2,"Add a player"),s(),e(3,` 15 `),p(4,we,4,0),a(5,"h2",6),e(6,"Player Information"),s(),e(7,` 16 `),a(8,"app-add-player",7),v("cancel",function(){h(o);let r=c();return r.showSelectPlayer=!0,f(r.showAddFirstPlayer=!1)})("add",function(r){h(o);let l=c();return f(l.playerAdded(r))}),e(9,` 17 `),s(),e(10,` 18 `)}if(n&2){let o=c();d(4),u(o.token?-1:4),d(4),y("horizontalForm",!1)("allowAddPlayerLogin",!(o.invite!=null&&o.invite.program.isAdultProgram))("createFromClubUser",o.invite==null?null:o.invite.program.isAdultProgram)("player",o.player)("showCancelButton",!1)}}function De(n,i){if(n&1){let o=x();e(0,` 19 `),a(1,"div",13),e(2,` 20 `),a(3,"div",14),e(4,` 21 `),a(5,"div",15),e(6,` 22 `),a(7,"div",13),e(8,` 23 `),a(9,"span",16),e(10),s(),e(11,` 24 `),s(),e(12,` 25 `),a(13,"div",17),e(14,` 26 `),a(15,"button",18),v("click",function(){let r=h(o).$implicit,l=c(2);return f(l.register(r.playerID))}),e(16,"Select"),s(),e(17,` 27 `),s(),e(18,` 28 `),s(),e(19,` 29 `),s(),e(20,` 30 `),s(),e(21,` 31 `)}if(n&2){let o=i.$implicit;d(10),z(o.user.fullName)}}function Ee(n,i){if(n&1){let o=x();e(0,` 32 `),a(1,"h1",5),e(2,"Select a player to register"),s(),e(3,` 33 `),a(4,"div",9),e(5,` 34 `),a(6,"div",10),e(7,` 35 `),a(8,"div",11),e(9,` 36 `),N(10,De,22,1,null,null,B),s(),e(12,` 37 `),s(),e(13,` 38 `),s(),e(14,` 39 `),a(15,"div"),e(16,` 40 `),a(17,"button",12),v("click",function(){h(o);let r=c();return r.showSelectPlayer=!1,f(r.showAddFirstPlayer=!0)}),e(18,`Add new 41 player`),s(),e(19,` 42 `),s(),e(20,` 43 `)}if(n&2){let o=c();d(10),R(o.players)}}function Fe(n,i){if(n&1){let o=x();e(0,` 44 `),a(1,"div",19),e(2,` 45 `),a(3,"div",20),e(4,` 46 `),a(5,"a",21),v("click",function(){h(o);let r=c();return f(r.skipAddFirstPlayer())}
46),e(6,"Skip this step, and add player later"),s(),e(7,` 47 `),s(),e(8,` 48 `),s(),e(9,` 49 `)}}var xe=(()=>{let i=class i{constructor(t,r,l,C,S,Ce,Se){this.userService=t,this.siteDataService=r,this.playerService=l,this.authService=C,this.pageService=S,this.teamService=Ce,this.router=Se,this.loading=!0,this.showAddFirstPlayer=!1,this.showSelectPlayer=!1,this.isUserLoggedIn=!1,this.clubName="",this.unsubscribe$=new L}ngOnInit(){this.authService.isAuthenticated().pipe(V(1),b(t=>(this.isUserLoggedIn=t,D({clubSettings:this.siteDataService.getClubSettings(),homePage:this.pageService.getHomePageFull(),clubUser:this.isUserLoggedIn?this.userService.getClubUser():g(null),clubFieldOptions:this.isUserLoggedIn?this.siteDataService.getClubFieldOptions():g(null)}))),b(t=>(t.clubSettings?.club?.name&&(this.clubName=t.clubSettings.club.name),t.clubSettings?.club?.clubID&&(this.clubID=t.clubSettings.club.clubID),this.pageBuilderPage=t.homePage,t.clubUser&&(this.userService.loggedInClubUser=t.clubUser),t.clubFieldOptions&&(this.clubFieldOptions=t.clubFieldOptions),this.isUserLoggedIn?(this.token=localStorage.getItem(w),D({players:this.userService.getCurrentUserPlayers(),invite:this.token?this.teamService.getInvite(this.token):g(null)})):g(null)))).subscribe(t=>{this.isUserLoggedIn&&(t.players&&(this.players=t.players),t.invite?this.invite=t.invite:localStorage.removeItem(w),(!this.userService.loggedInClubUser.user.visitedAddPlayer||this.token)&&(this.authService.getUser().subscribe(r=>{this.user=r}),this.authService.userHasPermissions(this.user,[J.FullMemberAccess])?!this.userService.loggedInClubUser.user.visitedAddPlayer&&!this.invite?.program.isAdultProgram&&(!this.players||this.players?.length===0)?this.showAddFirstPlayer=!0:this.invite&&this.invite?.program.isAdultProgram&&this.userService.loggedInClubUser.isPlayer?this.register(this.players.find(r=>r.userID===this.userService.loggedInClubUser.user.userID).playerID):this.invite?this.invite?.program.isAdultProgram?(this.skipAddFirstPlayer(!1),this.player={firstName:this.userService.loggedInClubUser.user.firstName,lastName:this.userService.loggedInClubUser.user.lastName,email:this.userService.loggedInClubUser.user.email,cellPhone:this.userService.loggedInClubUser.user.cellPhone},this.showAddFirstPlayer=!0):this.showSelectPlayer=!0:!this.userService.loggedInClubUser.user.visitedAddPlayer&&this.players?.length>0&&this.skipAddFirstPlayer():this.skipAddFirstPlayer(!0))),this.siteDataService.hideSiteLoader(),this.loading=!1}),this.playerService.playerAdded$.pipe($(this.unsubscribe$)).subscribe(t=>{this.playerAdded(t)})}get bannerDisplayOption(){return this.isUserLoggedIn?T.LoggedInDashboardOnly:T.PublicHomepageOnly}playerAdded(t){this.players||(this.players=[]),this.players.some(r=>r.playerID===t.playerID)||(this.players.push(t),this.players=[...this.players]),this.showAddFirstPlayer&&(this.userService.loggedInClubUser.user.visitedAddPlayer?g(null):this.userService.saveVisitedAddPlayer()).subscribe({next:()=>{this.userService.loggedInClubUser.user.visitedAddPlayer||(this.userService.loggedInClubUser.user.visitedAddPlayer=!0,this.userService.setUser(this.userService.loggedInClubUser.user)),this.showAddFirstPlayer=!1,this.token?this.invite?.program.isAdultProgram?this.register(t.playerID):this.showSelectPlayer=!0:this.redirectToRegistration()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem with saving data.")}})}skipAddFirstPlayer(t=!0){this.userService.saveVisitedAddPlayer().subscribe({next:()=>{this.userService.loggedInClubUser.user.visitedAddPlayer=!0,t&&(this.showAddFirstPlayer=!1,this.token?this.showSelectPlayer=!0:this.redirectToRegistration())},error:r=>{this.siteDataService.showSiteErrorAlert(`There was a problem processing your request. ${r.error}`)}})}redirectToRegistration(){let t=localStorage.getItem("createAccountRegistrationID");t&&(localStorage.removeItem("createAccountRegistrationID"),this.router.navigate([`/registrations/${t}`]))}register(t){let r;this.teamService.createTeamInvitationAssignment(this.token,t).pipe(b(l=>(r=l,this.playerService.getPlayerUnacceptedInvites(t)))).subscribe({next:l=>{localStorage.removeItem(w);let C=l.find(S=>S.programID===r.programID&&S.teamID===r.teamID);C?this.router.navigate(["/players",t,"registrations",C.registrationID,"teams",r.teamID,"register"]):this.showSelectPlayer=!1}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};i.\u0275fac=function(r){return new(r||i)(m(Q),m(K),m(_),m(W),m(A),m(oe),m(q))},i.\u0275cmp=j({type:i,selectors:[["ng-component"]],standalone:!1,decls:15,vars:9,consts:[["styleClass","fullPageDialog",3,"visible","showHeader","closable","modal","draggable"],["body",""],["footer",""],["data-testid","member-dashboard",3,"pageBuilderPage","players","isUserLoggedIn"],[3,"displayOption","clubID","isUserLoggedIn","extraTopClearance"],[1,"fw-500","center","text-largest","text-navy","mb-4"],[1,"text-header-3"],[3,"cancel","add","horizontalForm","allowAddPlayerLogin","createFromClubUser","player","showCancelButton"],[1,"mb-4"],[1,"row","mb-3"],[1,"col-md-12"],[1,"row","my-0"],[1,"btn","btn-add",3,"click"],[1,"col"],[1,"border-all","border-radius","py-2","px-3"],[1,"row","align-items-center"],[1,"player-header-name"],[1,"col-auto"],[1,"btn","btn-secondary","btn-wrap-ok","btn-sm",3,"click"],[1,"row"],[1,"col","right"],[3,"click"]],template:function(r,l){r&1&&
49(p(0,Ie,5,4),a(1,"p-dialog",0),e(2,` 50 `),a(3,"app-auth"),e(4,` 51 `),E(5,1),e(6,` 52 `),p(7,Ae,11,6),p(8,Ee,21,0),F(),e(9,` 53 `),E(10,2),e(11,` 54 `),p(12,Fe,10,0),F(),e(13,` 55 `),s(),e(14,` 56`),s()),r&2&&(u(!l.loading&&!l.showAddFirstPlayer&&!l.showSelectPlayer?0:-1),d(),y("visible",l.showAddFirstPlayer||l.showSelectPlayer)("showHeader",!1)("closable",!1)("modal",!0)("draggable",!1),d(6),u(l.showAddFirstPlayer?7:-1),d(),u(l.showSelectPlayer?8:-1),d(4),u(l.showAddFirstPlayer&&!l.token?12:-1))},dependencies:[Z,le,pe,ce,he],encapsulation:2});let n=i;return n})();var ve=(()=>{let i=class i{constructor(t){this.webAPI=t}};i.\u0275fac=function(r){return new(r||i)(H(G))},i.\u0275prov=O({token:i,factory:i.\u0275fac});let n=i;return n})();var _e=(()=>{let i=class i{};i.\u0275fac=function(r){return new(r||i)},i.\u0275mod=I({type:i}),i.\u0275inj=P({imports:[k.forChild([{path:"calendar",canActivate:[U],component:ae,data:{userDashboard:!1}},{path:"",canActivate:[U],component:xe,data:{MetaPage:"HomePage",userDashboard:!0}}]),k]});let n=i;return n})();var Rt=(()=>{let i=class i{};i.\u0275fac=function(r){return new(r||i)},i.\u0275mod=I({type:i}),i.\u0275inj=P({providers:[ve,X,te,_,A],imports:[ne,ee,_e,ye,ie,se,ue,de,re,ge,me,fe]});let n=i;return n})();export{Rt as HomePageModule};
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.