var environmentSettingsConfig = this.environmentSettingsConfig || {}; environmentSettingsConfig.AdminJavaScriptShortDateFormat = 'dd/MM/yyyy'; environmentSettingsConfig.AdminDateFormat = 'dd/MM/yyyy'; environmentSettingsConfig.PublicJavaScriptShortDateFormat = "dd/MM/yyyy"; environmentSettingsConfig.CurrentVenueIanaTimeZone = 'Australia/Sydney'; environmentSettingsConfig.CurrentLocale = 'en-GB'; environmentSettingsConfig.CurrentVenueUrlSegment = 'toowoombaregionaltenniscentre'; environmentSettingsConfig.ErrorsVerboseConsole = false; environmentSettingsConfig.ErrorsVerboseHtml = false; environmentSettingsConfig.FacebookAppID = '1733130803580520'; environmentSettingsConfig.Genders = [{"Text":"Male","Value":0},{"Text":"Female","Value":1},{"Text":"Non-binary","Value":2},{"Text":"I use a different term","Value":3},{"Text":"Prefer not to say","Value":4}]; environmentSettingsConfig.GlobalDomain = 'play.tennis.com.au'; environmentSettingsConfig.GlobalFeatures = { "Version": 638653044069386277, "DefaultModules": { "Venues": true, "CoachingOrganisations": true, "Regions": false, "Authorities": false }, "Account": { "UserPhoneNumberIsRequired": false, "PasswordlessSignInEnabled": false, "HideGlobalRegistrationLink": false, "AccountMerge": false, "SocialAccountMerge": false, "AccountMergeEnabled": false, "EnableStripeExpressOnboarding": 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, "BookingReminderEmails": false }, "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": true, "RunningFields": false, "CoachingTeam": true, "CoachingReports": true, "DelayParticipantOrders": false, "DelayCoachOrders": false, "RecurringSessions": true, "MembershipRequired": false, "EnqueueBookings": false, "EnableSchemeSearchFilter": false, "EnableThemeSearchFilter": false, "EnableBookingOpeningTimeRestrictedSchemeFeature": true, "OfflineCoachingPayments": true, "Lessons": true, "EnableBookingCourtInProgramming": false, "DisableAddCategory": false, "EnableResources": true, "OneOffCourseFeatures": { "BulkDiscountsEnabled": false, "MultipleSessionsEnabled": false, "CreateSessionsAutomatically": true, "PublishToPlayTennisAu": false }, "SeriesFeatures": { "BulkDiscountsEnabled": true, "MultipleSessionsEnabled": true, "CreateSessionsAutomatically": true, "PublishToPlayTennisAu": true }, "OpenCourtSessionsLive": false, "EnableThemeForCustomCourses": true, "EnableCancellationWindowForCourses": false, "CoachingRegisterAdministrator": true, "ArchiveCategories": true, "EnableCoachingReminderEmails": false, "DisablePrefixForSchemeNames": true, "EnableElasticSearchCoaching": true, "EnableAdministratorSchemeSessionsV2": true, "EnableElasticSearchCamps": false, "WaitingList": true }, "Competition": { "UsePersonExternalID": false, "BulkPaymentRequests": false, "DisableRefereeSearch": false, "DisableTournamentDirectorSearch": false, "HideLevelNames": false }, "Contacts": { "Bios": false, "Photos": false, "Social": false, "Mentors": false, "Delete": true, "Unsubscribe": true, "RestrictUnregistered": false, "EmailAttachments": true, "VenueContactRelationships": true, "BulkDeleteContacts": true, "ContactLookupsV2": true, "ContactLookupsV3": true, "ContactLookupsV3_VenueAdminContacts_Print": true, "ContactLookupsV3_VenueAdminContacts_Export": true, "ContactLookupsV3_VenueAdminContacts_Lookup": true, "ContactLookupsV3_VenueAdminContacts_Delete": false, "ContactLookupsV3_VenueAdminContacts_Recipients": false, "ContactLookupsV3_VenueAdminMembership_Lookup": false, "ContactLookupsV3_VenueAdminMembership_Export": false, "ContactLookupsV3_VenueAdminMembership_Print": false, "ContactLookupsV3_VenueAdminMembership_Move": false, "ContactLookupsV3_VenueAdminMembership_Recipients": false, "ContactLookupsV3_VenueAdminMembership_ChangeCosts": false, "ContactLookupsV3_VenueAdminMembership_RequestPayment": false, "ContactLookupsV3_Api_SendEmails": false, "ContactLookupsV3_Api_VenueContacts_Lookup": true, "ContactLookupsV3_Handler_MembershipPackage": false, "ContactLookupsV3_Handler_MembershipRenewalRequests": false, "ContactLookupsV3_Handler_AddTagsToVenueContacts": false, "ContactLookupsV3_Handler_DeleteTagsFromVenueContacts": false, "ContactLookupsV3_Compare": false, "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, "MultiBookingSheets": false }, "Website": { "Multilingual": false, "NoCoachingCourseSearch": false, "NoSubPages": false, "SectionHeros": true, "ConsentsOptOutByDefault": true, "VenueConsentsOptOutByDefault": true, "GuardianMandatory": false, "Activation": false, "EnableClassificationLogoImages": false, "PasswordConfirmation": false, "AcceptPrivacyPolicyOnRegister": false, "NewLocationsLookup": false, "Appcues": true, "FooterNavigation": false, "Affiliations": false, "DisableVenues": false, "ActivityVideosWebpage": false, "MyGameNavigation": false, "MoreCustomPages": true, "MembersOnlyPages": true, "GoogleAnalytics": true, "Favicons": true, "MorePartnerLogos": false, "Calendar": false, "FontSelection": false, "NavigationSelection": false, "EnableCovid19Notice": false }, "DiscountsAndCredits": { "CoachingCredits": true, "BookingCredits": false }, "Payments": { "PaymentReports": false, "MultipleStripeAccounts": false, "CreatePayment": false } }; environmentSettingsConfig.Partner = 'solo'; environmentSettingsConfig.PortalUrlSegment = 'portal'; environmentSettingsConfig.ShortDateFormat = 'dd/MM/yyyy'; environmentSettingsConfig.ShortTimeFormat = 'HH:mm'; environmentSettingsConfig.StripeExpressKey = 'pk_live_e9RxsARzhKBITp7QuRnnT3Vj'; environmentSettingsConfig.StripeKey = 'pk_live_e9RxsARzhKBITp7QuRnnT3Vj'; 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":5010,"name":"LTA Event"},{"sessionId":5020,"name":"LTA Coaching Qualification"},{"sessionId":5030,"name":"Non-venue Event/Tournament"},{"sessionId":5990,"name":"Other"}]; environmentSettingsConfig.TenantID = '00000001-0012-0000-0000-000000000000'; environmentSettingsConfig.VenueMode = window.location.hostname == environmentSettingsConfig.GlobalDomain ? 'subdirectory' : 'domain'; environmentSettingsConfig.AppSettings = { "Account" : { "List" : { }, "Content" : { }, "Setting" : { "EnableRelatedPlayerVenueConsents" : "", } }, "Booking" : { "Content" : { "BookingLower" : "booking", "BookingUpper" : "Booking", "BookingsLower" : "bookings", "BookingsUpper" : "Bookings", "CourtUpper" : "Resource", "CourtsLower" : "resources", }, "Setting" : { } }, "Coaching" : { "Content" : { "CoachingUpper" : "Programs", }, "Dictionary" : { }, "Enum" : { }, "List" : { }, "Setting" : { "UtrRatingMax" : "16.5", "UtrRatingMin" : "1", }, "FA" : { }, "ECB" : { } }, "Contacts" : { "Content" : { }, "List" : { }, "Setting" : { } }, "Checklists" : { "Settings" : { } }, "Dbs" : { "Settings" : { } }, "Events" : { "Content" : { }, "Setting" : { } }, "Global" : { "Content" : { "ChequeLabel" : "Cheque", "ColourLabel" : "Colour", "DocumentRegion" : "uk", "GuardianUpper" : "Guardian", "OrganisationLower" : "venue", "PlatformCountryRestriction" : "uk", "PlatformLat" : "53.55", "PlatformLng" : "-2.36967", "PlatformName" : "ClubSpark", "PlatformZoom" : "5", "PostcodeLabel" : "Postcode", }, "Dictionary" : { }, "Enum" : { }, "List" : { }, "Regex" : { "EmailAddress" : "", "PersonName" : "", "PhoneNumber" : "^\\d{10}$", "Postcode" : "^\\d{4}$" }, "Setting" : { "AdminJavaScriptDateZebraDatePickerFormat" : "Y-m-d", "DisableOrderCancellation" : "", "JavaScriptTimeFormat" : "HH:mm:ss", "MinimumUserAge" : "13", "MomentJsLongDateFormat" : "llll", "MomentJsMediumDateFormat" : "D MMM YYYY", "MomentJsShortDateFormat" : "DD/MM/YYYY", } }, "Membership" : { "Content" : { }, "Setting" : { } }, "Venue" : { "Data" : { } }, "Localisation" : { }, "Payments" : { "Content" : { }, "Setting" : { "CurrencyCode" : "AUD", "CurrencySymbol" : "$", "OrdersAllowCancellation" : "false", "OrdersAllowDeliveryAddressEditing" : "false" } }, "Reporting" : { "Setting" : { } }, "Tournaments" : { "Content" : { }, "Setting" : { } }, "WebsiteManager" : { "Content" : { }, "Setting" : { } }, "GlobalFeatures" : { "DefaultModules" : { }, "Account" : { }, "Competition" : { }, "Booking" : { }, "Coaching" : { }, "Membership" : { }, "Events" : { }, "Contacts" : { }, "Venue" : { }, "Website" : { } }, "VenueProfile" : { "Content" : { }, "Setting" : { } }, "Content" : { "Booking" : { }, "Classification" : { }, "Coaching" : { }, "Common" : { }, "Emails" : { }, "GlobalFeatures" : { }, "Home" : { }, "RegularExpressions" : { }, "Terms" : { }, "Venue" : { }, "Region" : { }, "Events" : { }, "MembershipEmails" : { }, "AdminWebsite" : { }, "SchemesEmails" : { }, "Tournaments" : { }, "AddPlayer" : { } } }; environmentSettingsConfig.AppSettings = { "Account" : { "List" : { }, "Content" : { }, "Setting" : { "EnableRelatedPlayerVenueConsents" : "", } }, "Booking" : { "Content" : { "BookingLower" : "booking", "BookingUpper" : "Booking", "BookingsLower" : "bookings", "BookingsUpper" : "Bookings", "CourtUpper" : "Resource", "CourtsLower" : "resources", }, "Setting" : { } }, "Coaching" : { "Content" : { "CoachingUpper" : "Programs", }, "Dictionary" : { }, "Enum" : { }, "List" : { }, "Setting" : { "UtrRatingMax" : "16.5", "UtrRatingMin" : "1", }, "FA" : { }, "ECB" : { } }, "Contacts" : { "Content" : { }, "List" : { }, "Setting" : { } }, "Checklists" : { "Settings" : { } }, "Dbs" : { "Settings" : { } }, "Events" : { "Content" : { }, "Setting" : { } }, "Global" : { "Content" : { "ChequeLabel" : "Cheque", "ColourLabel" : "Colour", "DocumentRegion" : "uk", "GuardianUpper" : "Guardian", "OrganisationLower" : "venue", "PlatformCountryRestriction" : "uk", "PlatformLat" : "53.55", "PlatformLng" : "-2.36967", "PlatformName" : "ClubSpark", "PlatformZoom" : "5", "PostcodeLabel" : "Postcode", }, "Dictionary" : { }, "Enum" : { }, "List" : { }, "Regex" : { "EmailAddress" : "", "PersonName" : "", "PhoneNumber" : "^\\d{10}$", "Postcode" : "^\\d{4}$" }, "Setting" : { "AdminJavaScriptDateZebraDatePickerFormat" : "Y-m-d", "DisableOrderCancellation" : "", "JavaScriptTimeFormat" : "HH:mm:ss", "MinimumUserAge" : "13", "MomentJsLongDateFormat" : "llll", "MomentJsMediumDateFormat" : "D MMM YYYY", "MomentJsShortDateFormat" : "DD/MM/YYYY", } }, "Membership" : { "Content" : { }, "Setting" : { } }, "Venue" : { "Data" : { } }, "Localisation" : { }, "Payments" : { "Content" : { }, "Setting" : { "CurrencyCode" : "AUD", "CurrencySymbol" : "$", "OrdersAllowCancellation" : "false", "OrdersAllowDeliveryAddressEditing" : "false" } }, "Reporting" : { "Setting" : { } }, "Tournaments" : { "Content" : { }, "Setting" : { } }, "WebsiteManager" : { "Content" : { }, "Setting" : { } }, "GlobalFeatures" : { "DefaultModules" : { }, "Account" : { }, "Competition" : { }, "Booking" : { }, "Coaching" : { }, "Membership" : { }, "Events" : { }, "Contacts" : { }, "Venue" : { }, "Website" : { } }, "VenueProfile" : { "Content" : { }, "Setting" : { } }, "Content" : { "Booking" : { }, "Classification" : { }, "Coaching" : { }, "Common" : { }, "Emails" : { }, "GlobalFeatures" : { }, "Home" : { }, "RegularExpressions" : { }, "Terms" : { }, "Venue" : { }, "Region" : { }, "Events" : { }, "MembershipEmails" : { }, "AdminWebsite" : { }, "SchemesEmails" : { }, "Tournaments" : { }, "AddPlayer" : { } } }; 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 = $('