var environmentSettingsConfig = this.environmentSettingsConfig || {}; environmentSettingsConfig.Partner = 'runtogether'; environmentSettingsConfig.FacebookAppID = '1759298600949297'; environmentSettingsConfig.StripeKey = 'pk_live_N3Cu88jt4Y8nPuIhkvGJpzzO'; environmentSettingsConfig.GlobalDomain = 'groups.runtogether.co.uk'; environmentSettingsConfig.Genders = [{"Text":"Male","Value":0},{"Text":"Female","Value":1},{"Text":"Prefer not to say","Value":2},{"Text":"Non binary","Value":3},{"Text":"Other","Value":4}]; 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.ResourceItems = { Booking : { CourtLower : "court", CourtUpper : "Court", CourtsLower : "courts", CourtsUpper : "Courts", BookingLower : "booking", BookingUpper : "Booking", BookingsLower : "bookings", BookingsUpper : "Bookings", BookedLower : "booked", BookedUpper : "Booked", BookLower : "book", BookUpper : "Book", CourtBookingsLower : "court bookings", CourtBookingsUpper : "Court bookings" }, Classification : { Level1 : "National administrator", Level2 : "Regional", Level3 : "County" }, Coaching : { ClassesLower : "sessions", ClassesUpper : "Sessions", ClassLower : "session", ClassUpper : "Session", CoachLower : "run leader", CoachUpper : "Run leader", CoachesUpper : "Coaching team", CoachingLower : "runs", CoachingUpper : "Runs", CostUnit : "per session", CourseCodeShort : "code", CourseCodeLong : "Code", CourseLower : "run", CoursesLower : "runs", CoursesUpper : "Runs", CourseUpper : "Run", HolidayCamp : "Holiday camp", HolidayCamps : "Holiday camps", PlayerLower : "runner", PlayersLower : "runners", PlayersUpper : "Runners", PlayerUpper : "Runner", SessionName : "course", SessionVenue : "Location", TeamName : "Coaching team", TitleRoot : "" }, Common : { ColourLabel : "Colour", DocumentRegion : "uk", PlatformName : "RunTogether", TownLabel : "Town", PostcodeLabel : "Postcode", DistanceUnit : "miles", CurrencySymbol : "£", CurrencyCode : "GBP", PublicJavaScriptShortDateFormat : "dd/mm/yy", AdminJavaScriptShortDateFormat : "dd/mm/yyyy", SmsName : "SMS", MembershipName : "Membership", MemberName : "Member", CountyLabel : "County", GDPRGuardianConsentLabel : "I confirm I am the Parent or Guardian of this runner, or have the permission of the Parent or Guardian to book on behalf of this runner.", GDPRGuardianConsentToolTip : "In order to make a booking you must be ?0? years old; be the parent or guardian of the runner under ?0? years old, or have permission from the parent or guardian of the runner.", GDPRGuardianConsentValidation : "Consent required - edit details", ProgrammeLower : "programme", ProgrammeUpper : "Programme", ProgrammesLower : "programmes", ProgrammesUpper : "Programmes", FloodlitLabel : "Floodlit", StripeCosts : "Stripe will deduct 25p per transaction + 2.8% for UK cards and 4.3% for international cards or American Express. This covers support costs, transactional costs, as well as Stripe's additional fees.", StripeCostsNote : "Please note: If the purchaser is not using a standard UK card the Stripe fee proportion will increase to 2.5% +20p for European cards and 3.25% +20p for International cards. It is not possible within Stripe to block payments from these cards but you should be aware of these charges for accounting purposes.", GoCardlessCosts : "We have a special arrangement with GoCardless who will only charge 1.0% and capped to a maximum of £2.00 per transaction (minimum of 20p). In addition Sportlabs charge 0.8% (uncapped) per transaction in order to provide and support this service. A maximum of 1.8% is deducted automatically when a user makes a payment.", GoCardlessIntro : "It only takes a few minutes to complete the form on the GoCardless site. Once registered you'll be asked to connect your account to ClubSpark and as soon as you've done this we'll be able to help you to automatically keep track of payments made via GoCardless (for one-off payments and monthly Direct Debits)." }, Contacts : { CoachingRole : "Run administrator", GoverningBodyNumber : "England Athletics Number", ResponsibleLower : "leader", ResponsibleUpper : "Leader", ResponsiblesLower : "leaders", ResponsiblesUpper : "Leaders", RolesDescription : "Group", MentalHealthChampionUpper : "Mental Health Champion" }, Emails : { Salutation : "Hi" }, Home : { Heading : "Welcome to RunTogether" }, RegularExpressions : { Postcode : "^(GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\\d[\\dA-Z]?[ ]?\\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\\d{1,4})$", PhoneNumber : "^0(\\d ?){10}$" }, Terms : { MinimumUserAge : "16", AssociationScope : "", InvolvementScope : "", UseOfPersonalInformationScope : "Sportlabs Technology Ltd" }, Venue : { CoachingOrganisationLower : "coaching organisation", CoachingOrganisationUpper : "Coaching organisation", OrganisationUpper : "Organisation", OrganisationLower : "organisation", OrganisationsLower : "organisations", OrganisationsUpper : "Organisations", VenueLower : "group", VenueUpper : "Group", VenuesLower : "venues", VenuesUpper : "Venues", VenueClassification : "Classification" } }; environmentSettingsConfig.GlobalFeatures = {"Version":637804268340239229,"Booking":{"AdminOnlyBookingSheetColours":false,"AppPromo":false,"CheckInContacts":false,"NewDayBookingAvailabilityTime":false,"NoShowCharges":false,"ResourceFormat":false,"ResponsibilityCategory":false,"SessionMaxBookingSlots":false,"CourtProperties":false,"CalendarEntry":false,"MembershipRequired":false,"ResourceCategories":false},"Membership":{"DisableInstallments":false,"DirectDebitPayment":false,"CreditCardPayment":false,"DisableGiftAidOption":false,"GuardianMandatory":false,"AutoPaymentDateOfPurchasePackages":false,"AutoPaymentFixedDatePackages":false},"Coaching":{"OptimisedSearch":false,"RunningFields":true,"CoachingTeam":false,"CoursePaymentRequests":false,"CoachingReports":false,"SessionPaymentRequests":false,"TennisForKidsLive":false,"DelayParticipantOrders":false,"DelayCoachOrders":false,"RecurringSessions":false,"MembershipRequired":false,"EnqueueBookings":false,"DisableHolidayCamps":true,"DisableAddCategory":true},"Contacts":{"Bios":true,"Photos":true,"Social":true,"Mentors":false,"Delete":true,"Unsubscribe":true,"RestrictUnregistered":false,"EmailAttachments":true,"VenueContactRelationships":true,"BulkDeleteContacts":true,"ContactLookupsV2":false,"ContactForm":false},"Venue":{"DeliveryAddress":false,"PrivacyPolicy":false,"SocialAccountsDisabled":false,"CanEditJuniorAge":false},"Website":{"Multilingual":false,"NoCoachingCourseSearch":true,"NoSubPages":true,"SectionHeros":false,"ConsentsOptOutByDefault":true,"VenueConsentsOptOutByDefault":true,"GuardianMandatory":true,"Activation":false,"NationalCourtBookingLive":false,"PasswordConfirmation":false},"Events":{"GBTWAccess":false}}; 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 = $('