var environmentSettingsConfig = this.environmentSettingsConfig || {}; environmentSettingsConfig.Partner = 'ta2'; environmentSettingsConfig.FacebookAppID = '1733130803580520'; environmentSettingsConfig.StripeKey = 'pk_live_e9RxsARzhKBITp7QuRnnT3Vj'; environmentSettingsConfig.GlobalDomain = 'play.tennis.com.au'; environmentSettingsConfig.Genders = [{"Text":"Male","Value":0,"Abbreviation":"M"},{"Text":"Female","Value":1,"Abbreviation":"F"},{"Text":"Non-Binary","Value":2,"Abbreviation":"NB"},{"Text":"I use a different term","Value":3,"Abbreviation":"DT"},{"Text":"Prefer not to say","Value":4,"Abbreviation":"P"}]; environmentSettingsConfig.SubCategorySessions = [{"sessionId":2010,"name":"Adult"},{"sessionId":2020,"name":"Junior"},{"sessionId":2030,"name":"Mini"},{"sessionId":2040,"name":"Individual"},{"sessionId":2050,"name":"Disability"},{"sessionId":2060,"name":"Holiday Camps"},{"sessionId":2990,"name":"Other"},{"sessionId":3010,"name":"Sanctioned Tournament"},{"sessionId":3020,"name":"Event"},{"sessionId":3030,"name":"League Fixture"},{"sessionId":3040,"name":"Fun Tournament"},{"sessionId":3990,"name":"Other"},{"sessionId":4010,"name":"Team Practice"},{"sessionId":4020,"name":"Club Night"},{"sessionId":4990,"name":"Other"},{"sessionId":5030,"name":"Non-venue Event/Tournament"},{"sessionId":5990,"name":"Other"}]; environmentSettingsConfig.VenueMode = window.location.hostname == environmentSettingsConfig.GlobalDomain ? 'subdirectory' : 'domain'; environmentSettingsConfig.GlobalFeatures = { "Version": 638399769925835270, "DefaultModules": { "Venues": false, "CoachingOrganisations": true, "Regions": false, "Authorities": false }, "Account": { "UserPhoneNumberIsRequired": false, "AccountMerge": false, "SocialAccountMerge": false, "AccountMergeEnabled": false }, "Booking": { "AdminOnlyBookingSheetColours": false, "AppPromo": true, "CheckInContacts": false, "NewDayBookingAvailabilityTime": false, "NoShowCharges": false, "ResourceFormat": false, "ResponsibilityCategory": true, "SessionMaxBookingSlots": false, "CourtProperties": false, "CalendarEntry": true, "MembershipRequired": false, "ResourceCategories": false, "HideResourceLighting": false, "HideResourceSurface": false, "BookingEngineV2": false, "EnableGroupBooking": false, "OffloadBulkUpdates": true }, "Membership": { "DisableInstallments": false, "DirectDebitPayment": false, "CreditCardPayment": true, "DisableGiftAidOption": true, "GuardianMandatory": true, "AutoPaymentDateOfPurchasePackages": false, "AutoPaymentFixedDatePackages": false, "NewMembershipRegistrationProcess": true, "GetGoCardlessVerificationStatus": false, "RestrictMemberImport": true, "MembershipAddons": true, "PauseMembership": false, "ChangeInstalmentCost": false }, "Coaching": { "OptimisedSearch": false, "RunningFields": false, "CoachingTeam": true, "CoursePaymentRequests": true, "CoachingReports": true, "SessionPaymentRequests": true, "TennisForKidsLive": false, "DelayParticipantOrders": false, "DelayCoachOrders": false, "RecurringSessions": true, "MembershipRequired": false, "EnqueueBookings": false, "EnableSchemeSearchFilter": false, "EnableThemeSearchFilter": false, "EnableBookingOpeningTimeRestrictedSchemeFeature": true, "OfflineCoachingPayments": true, "JuniorSafePlay": true, "AdultSafePlay": false, "Lessons": true, "EnableBookingCourtInProgramming": false, "DisableHolidayCamps": false, "DisableAddCategory": false, "EnableResources": true, "OneOffCourseFeatures": { "BulkDiscountsEnabled": false, "MultipleSessionsEnabled": false, "CreateSessionsAutomatically": true, "PublishToPlayTennisAu": false }, "SeriesFeatures": { "BulkDiscountsEnabled": true, "MultipleSessionsEnabled": true, "CreateSessionsAutomatically": true, "PublishToPlayTennisAu": true }, "OpenCourtSessionsLive": true, "EnableThemeForCustomCourses": true, "EnableCancellationWindowForCourses": false, "CoachingRegisterAdministrator": true, "ArchiveCategories": true, "EnableCoachingReminderEmails": false, "EnableDataSharing": false, "DisablePrefixForSchemeNames": true }, "Competition": { "SocialLeagues": false }, "Contacts": { "Bios": false, "Photos": false, "Social": false, "Mentors": false, "Delete": true, "Unsubscribe": true, "RestrictUnregistered": false, "EmailAttachments": true, "VenueContactRelationships": true, "BulkDeleteContacts": true, "ContactLookupsV2": true, "ContactForm": false, "LockPersonalDetailsWhenUserConnected": false, "ContactNotes": true }, "Venue": { "DeliveryAddress": false, "PrivacyPolicy": false, "SocialAccountsDisabled": false, "CanEditJuniorAge": true, "SubDomainCreation": false, "Facilities": false, "AddTraditionalLocation": false, "AddNonTraditionalLocation": false, "LinkedLocations": false, "Waiver": true }, "Website": { "Multilingual": false, "NoCoachingCourseSearch": false, "NoSubPages": false, "SectionHeros": true, "ConsentsOptOutByDefault": true, "VenueConsentsOptOutByDefault": true, "GuardianMandatory": false, "Activation": false, "NationalCourtBookingLive": false, "EnableClassificationLogoImages": false, "PasswordConfirmation": false, "AcceptPrivacyPolicyOnRegister": false, "NewLocationsLookup": false, "Appcues": false, "FooterNavigation": false, "Affiliations": false, "DisableVenues": false, "ActivityVideosWebpage": false, "MoreCustomPages": true, "MembersOnlyPages": false, "GoogleAnalytics": true, "Favicons": false, "MorePartnerLogos": false, "Calendar": false, "FontSelection": false, "NavigationSelection": false, "EnableCovid19Notice": false }, "Events": { "GBTWAccess": false, "CustomEventName": true }, "DiscountsAndCredits": { "CoachingCredits": true, "BookingCredits": false } }; environmentSettingsConfig.CurrentVenueUrlSegment = 'morphettvaletennisclub'; environmentSettingsConfig.CurrentVenueIanaTimeZone = 'Australia/Adelaide'; environmentSettingsConfig.ErrorsVerboseConsole = false; environmentSettingsConfig.ErrorsVerboseHtml = false; environmentSettingsConfig.ShortDateFormat = 'dd/MM/yyyy'; environmentSettingsConfig.ShortTimeFormat = 'HH:mm'; environmentSettingsConfig.ResourceItems = { Booking : { CourtLower : "court", CourtUpper : "Court", CourtsLower : "courts", CourtsUpper : "Courts", BookingLower : "participant", BookingUpper : "Booking", BookingsLower : "bookings", BookingsUpper : "Bookings", BookedLower : "booked", BookedUpper : "Booked", BookLower : "book", BookUpper : "Book", CourtBookingsLower : "court bookings", CourtBookingsUpper : "Court bookings" }, Classification : { Level1 : "National", Level2 : "State", Level3 : "County" }, Coaching : { BookingLower : "participant", ClassesLower : "sessions", ClassesUpper : "Sessions", ClassLower : "session", ClassUpper : "Session", CoachLower : "coach", CoachUpper : "Contact", CoachesUpper : "Coaching team", CoachingLower : "programs", CoachingUpper : "Programs", CostUnit : "", CourseCodeShort : "reference", CourseCodeLong : "Your reference", CourseLower : "program", CoursesLower : "programs", CoursesUpper : "Programs", CourseUpper : "Program", HolidayCamp : "Holiday camp", HolidayCamps : "Holiday camps", Interval : "Interval", PlayerLower : "player", PlayersLower : "players", PlayersUpper : "Players", PlayerUpper : "Player", SessionsLower : "sessions", ProgrammeLower : "program", ProgrammesLower : "programs", ProgrammesUpper : "Programs", ProgrammeUpper : "Program", SessionName : "course", SessionVenue : "Venue", TeamName : "Coaching team", TitleRoot : "Coaching / Programmes / ", PageDefaultView : "List", UtrRatingMin : "1", UtrRatingMax : "16.5", BasketCourseName : "course", BasketSessionName : "session", AddNewBooking : "Add new participant", AddNewCampBooking : "Add new camp booking", ThemeUpper : "Theme", SchemeContactSourceOrganiser : "Organiser site", LeadCoach : "Lead coach", StartDate : "Start date", SessionThemeUpper : "Theme", SkillLevelUpper : "Skill level", CapacityUpper : "Capacity", CostUpper : "Cost", NameUpper : "Name", EndDate : "End date", DefaultSessionTags : "Default session tags", PublicCourseDescriptionHeader : "Notes from the coach", ValidateAgeMinMaxErrorMessage : "[MinimumAge]-[MaximumAge] year olds only", ValidateAgeMinErrorMessage : "[MinimumAge] year olds and over only", ValidateAgeMaxErrorMessage : "[MaximumAge] year olds and under only", CourseDateLabelUpper : "When", DefaultDescriptionLabel : "Additional Information", DefaultConfirmationLabel : "Additional Confirmation", DefaultReminderEmailsLabel : "Reminder Email Information", DescriptionLabel : "", ConfirmationLabel : "Additional Confirmation", PriceSuffix : "", DefaultThemesLabel : "Default Theme", CoachingPaymentMethod_Cash : "Offline", AddCoachModalExternalCode : "My Tennis ID", AddCoachModalExternalCodeTooltip : "Enter the My Tennis ID here to link this coach with their TA record", AddCoachModalExternalCodeNotRecognisedMessage : "Please add a valid My Tennis ID", RegistrationUpper : "Registration", RegistrationsUpper : "Registrations", RegistrationLower : "registration", RegistrationsLower : "registrations", RegistrationWindow : "Registration Window", RegistrationOpens : "Registration Opens", RegistrationCloses : "Registration Closes", WaiverUpper : "Provider Waiver", WaiverLower : "provider waiver" }, Common : { ChequeLabel : "Cheque", ColourLabel : "Colour", DocumentRegion : "aus", PlatformName : "Book a Court", PlatformLat : "53.5500", PlatformLng : "-2.36967", PlatformZoom : "5", PlatformCountryRestriction : "uk", TownLabel : "City", PostcodeLabel : "Postcode", DistanceUnit : "kilometres", CurrencySymbol : "$", CurrencyCode : "AUD", PublicJavaScriptShortDateFormat : "dd/mm/yy", AdminJavaScriptShortDateFormat : "dd/mm/yyyy", MomentJsLongDateFormat : "llll", MomentJsShortDateFormat : "DD/MM/YYYY", JavaScriptTimeFormat : "HH:mm:ss", SmsName : "SMS", MembershipName : "Membership", MemberName : "Member", PartnerLocale : "en-GB", CountyLabel : "State", GDPRGuardianConsentLabel : "I confirm I am the Parent or Guardian of this player, or have the permission of the Parent or Guardian to book on behalf of this player.", GDPRGuardianConsentToolTip : "In order to make a booking you must be ?0? years old; be the parent or guardian of the player under ?0? years old, or have permission from the parent or guardian of the player.", GDPRGuardianConsentValidation : "Consent required - edit details", ProgrammeLower : "program", ProgrammeUpper : "Program", ProgrammesLower : "programs", ProgrammesUpper : "Programs", FloodlitLabel : "Floodlit", StripeCosts : "For information on fees, visit \u003ca href=\"http://support.tennis.com.au\" target=\"_blank\"\u003esupport.tennis.com.au\u003c/a\u003e", GoCardlessCosts : "GoCardless will deduct 3% from the total cost prior to distributing the fees to your nominated bank account.", GoCardlessIntro : "Accepting membership payments on-line via direct debit couldn\u0027t be easier with our payment provider GoCardless. On-line collection will save you time in administration and improve the cash flow of your organisation. GoCardless processes in excess of $10 billion of transactions each year and enables a secure and easy way for your members to pay.", OperatorNameLong : "Sportlabs Technology Ltd", OperatorName : "ClubSpark", OperatorLogoDark : "~/Content/Public/ClubSpark/Common/Shared/img/core/CS_logo@1x.png", OperatorWebsite : "http://www.clubspark.com", OperatorWebsiteText : "ClubSpark.com", OperatorPoweredText : "Site powered by", RegisterLinkText : "Register", OptimisationLower : "optimisation", AdminDateFormat : "dd/MM/yyyy", CancelledLower : "cancelled", CancelledUpper : "Cancelled", CancellingLower : "canceling", SchemeCategoryThemeValidation : "Theme preference required", TermsAndConditionsPrefix : "Please tick this box to confirm you agree to our", FreeUpper : "Free" }, Contacts : { CoachingRole : "Programs administrator", CoachingRegisterRole : "Programs register administrator", GoverningBodyNumber : "My Tennis ID", ResponsibleLower : "contact", ResponsibleUpper : "Contact", ResponsiblesLower : "contacts", ResponsiblesUpper : "Contacts", RolesDescription : "Organisation", MentalHealthChampionUpper : "" }, Emails : { Salutation : "Hi" }, Home : { Heading : "Where would you like to go?" }, RegularExpressions : { PersonName : "^[a-zA-Z\\-\\'\\&\\ \\.]+$", Postcode : "^\\d{4}$", PhoneNumber : "^\\d{10}$" }, Terms : { MinimumUserAge : "13", AssociationScope : "Tennis Australia and its regional associations", InvolvementScope : "Tennis Australia", UseOfPersonalInformationScope : "Sportlabs Technology Ltd" }, Venue : { CoachingOrganisationLower : "coaching organisation", CoachingOrganisationUpper : "Coaching organisation", CoachingOrganisationModuleStatusName : "coaching organisation", OrganisationUpper : "Organisation", OrganisationLower : "organisation", OrganisationsLower : "organisations", OrganisationsUpper : "Organisations", VenueLower : "venue", VenueUpper : "Venue", VenuesLower : "venues", VenuesUpper : "Venues", VenueClassification : "Classification", VenueEventDefaltName : "Course details", AcceptInvitationAgreeTermsAndConditionsPrefix : "Please tick this box to confirm you agree to the", PrivacyPolicyConsentPrefix : "Please tick this box to confirm you have read and accepted" }, Region : { RegionLower : "region", RegionUpper : "Region", RegionsLower : "regions", RegionsUpper : "Regions" }, Events : { EventLower : "event", EventUpper : "Event", EventsLower : "events", EventsUpper : "Events", ChangeLabel : "Change" }, MembershipEmails : { LoginTextForAccount : "\u003cbr /\u003e\u003cbr /\u003e\u003cspan style=\"width: 19px; display: inline-block;\"\u003e\u003cimg align=\"center\" src=\"https://clubspark.zone/Content/Public/ClubSpark/Common/Global/img/account/{0}.png\"\u003e\u003c/span\u003e\u0026nbsp;\u0026nbsp;You will need to login with your existing ClubSpark account ({1})." }, AdminWebsite : { HeroPhotoGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 1400px x 650px", GalleryGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 600px by 400px", NewsArticleGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 1180px by 600px", SubSectionPhotoGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 1400px x 450px", NewsArticleTextGuidance : "For best viewing please upload images that are 1180px wide. Height can be variable" }, SchemesEmails : { SchemeSessionsBookingUserSubject : "[#scheme#] / Booking Confirmation", SchemeSessionsBookingAdminSubject : "[#scheme#] / Booking Confirmation", SchemeSessionFullNotificationSubject : "[#scheme#] / [#course-type#] Full" } }; var AuthHandler = function(config) { var cache; var redirectUrl = config.zoneRoot + 'oauth2-redirect.html'; var authorizeUrl = config.authRoot + 'issue/oauth2/authorize'; this.withToken = function (args) { args = args || {}; if (typeof args === "function") args = { success: args }; args.success = args.success || function() {}; args.error = args.error || function() {}; args.scope = args.scope || "token"; /* Attempt to load the current oauth token from localStorage */ /* var tokenCache = localStorage.getItem('oauth2.token'); */ var tokenCache = cache; var adminToken = null; if (tokenCache != null) adminToken = JSON.parse(tokenCache); var now = Math.floor(Date.now() / 1000); /* If token expires within next 60 seconds, we'll request a new one anyways */ if (adminToken != null && adminToken.expires_after < now + 60) adminToken = null; if (adminToken == null) { window.addEventListener('message', function (event) { if (event.data.action == 'oauth2.callback') { if (event.data.isValid) { var token = { expires_after: now + event.data.expires_in, access_token: event.data.access_token }; /* Store the token in cache */ /* localStorage.setItem('oauth2.token', JSON.stringify(token)); */ cache = JSON.stringify(token); args.success(token.access_token); } else { args.error(event.data); } } }, { once: true, capture: false }); var nonce = btoa(Date.now()); var authorizePayload = { tokenType: 'csa', response_type: 'token', client_id: 'clubspark-ui', redirect_uri: redirectUrl, scope: config.scopeRoot + args.scope, state: nonce, realm: config.webRoot, }; var implicitUrl = authorizeUrl + '?' + $.param(authorizePayload); /* Get iframe for sso */ var iframe = $('iframe[name="oauth2"]'); if (iframe.length == 0) { iframe = $('