{"version":3,"file":"chunk-g5qoegmc.js","sources":["packages/vanilla/tracking-feature/src/tracking.client-config.ts","packages/vanilla/tracking-feature/src/tracking-value-getters.service.ts","packages/vanilla/tracking-feature/src/tracking.models.ts","packages/vanilla/tracking-feature/src/data-layer-tracking.service.ts","packages/vanilla/tracking-feature/src/page-view-data-provider.ts","packages/vanilla/tracking-feature/src/page-view-tracking.service.ts","packages/vanilla/tracking-feature/src/data-layer-proxy.service.ts","packages/vanilla/tracking-feature/src/partytown.service.ts","packages/vanilla/tracking-feature/src/tag-manager.service.ts","packages/vanilla/tracking-feature/src/utm-service.ts","packages/vanilla/tracking-feature/src/tracking-bootstrap.service.ts","packages/vanilla/tracking-feature/src/tracking.feature.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { ClientConfigProductName, LazyClientConfig, LazyClientConfigBase, LazyClientConfigService } from '@frontend/vanilla/core';\n\nimport { ClientTagManager } from './tracking.models';\n\n@LazyClientConfig({ key: 'vnTracking', product: ClientConfigProductName.SF })\n@Injectable({\n providedIn: 'root',\n deps: [LazyClientConfigService],\n useFactory: trackingConfigFactory,\n})\nexport class TrackingConfig extends LazyClientConfigBase {\n isEnabled: boolean;\n dataLayerName: string;\n notTrackedQueryStrings: string[];\n tagManagerRenderers: string[];\n eventCallbackTimeoutInMilliseconds: number;\n dataLayerUpdateTimeoutInMilliseconds: number;\n pageViewDataProviderTimeout: number;\n clientTagManagers: ClientTagManager[];\n clientInjectionExcludes: string[];\n allowlist: string[];\n benchmarkThreshold: number;\n blocklist: string[];\n deviceBlockEnabled: boolean;\n deviceConcurrency: number;\n deviceMemory: number;\n enableLogging: boolean;\n enableOmitting: boolean;\n omitAll: boolean;\n omitPercentage: number;\n schedulerEnabled: boolean;\n trackingDelay: number;\n}\n\nexport function trackingConfigFactory(service: LazyClientConfigService) {\n return service.get(TrackingConfig);\n}\n","import { Injectable } from '@angular/core';\n\nimport {\n CookieName,\n CookieService,\n DeviceService,\n FrontendHelperService,\n NativeAppService,\n NavigationService,\n Page,\n ParsedUrl,\n UrlService,\n UserService,\n WindowRef,\n} from '@frontend/vanilla/core';\nimport { BalancePropertiesConfig } from '@frontend/vanilla/features/balance-properties';\nimport { firstValueFrom } from 'rxjs';\n\nimport { TrackingConfig } from './tracking.client-config';\n\n/**\n * @stable\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class TrackingValueGettersService {\n private referrer: string;\n private entryUrl: ParsedUrl;\n\n constructor(\n private trackingConfig: TrackingConfig,\n private user: UserService,\n private navigationService: NavigationService,\n private urlService: UrlService,\n private windowRef: WindowRef,\n private page: Page,\n private cookieService: CookieService,\n private deviceService: DeviceService,\n private nativeAppService: NativeAppService,\n private frontendHelperService: FrontendHelperService,\n private balancePropertiesConfig: BalancePropertiesConfig,\n ) {}\n\n accountId() {\n return this.user.accountId;\n }\n\n async userBalance() {\n if (this.user.isAuthenticated) {\n await firstValueFrom(this.balancePropertiesConfig.whenReady);\n return this.balancePropertiesConfig.balanceProperties.accountBalance;\n }\n return 0;\n }\n\n userCurrency() {\n return this.user.currency;\n }\n\n userCountry() {\n return this.user.country;\n }\n\n userGeoCountry() {\n return this.user.geoCountry;\n }\n\n userLoyalty() {\n return this.user.loyalty || '';\n }\n\n userCustomerId() {\n return this.user.customerId;\n }\n\n userSegmentId() {\n return this.user.segmentId;\n }\n\n userStage() {\n return this.user.lifeCycleStage || '';\n }\n\n userPrestage() {\n return this.user.eWarningVip || '';\n }\n\n userMicroSegmentId() {\n return this.user.microSegmentId;\n }\n\n userChurnRate() {\n return this.user.churnRate;\n }\n\n userFutureValue() {\n return this.user.futureValue;\n }\n\n userPotentialVip() {\n return this.user.potentialVip;\n }\n\n userAgent() {\n return this.windowRef.nativeWindow.navigator.userAgent;\n }\n\n isAuthenticated() {\n return !!this.user.username;\n }\n\n async hasPositiveBalance() {\n if (this.user.isAuthenticated) {\n await firstValueFrom(this.balancePropertiesConfig.whenReady);\n return this.balancePropertiesConfig.balanceProperties.accountBalance > 0;\n }\n return false;\n }\n\n locationAbsUrl() {\n return this.removeNotTrackedQueryStrings(this.navigationService.location.absUrl(), true);\n }\n\n locationHost() {\n return this.navigationService.location.host();\n }\n\n locationPathQueryAndFragment() {\n return TrackingValueGettersService.removeLeadingSlashes(this.removeNotTrackedQueryStrings(this.navigationService.location.url(), false));\n }\n\n browserScreenResolution() {\n if (this.windowRef.nativeWindow) {\n const { width, height } = this.deviceService.windowRect();\n return `${width}x${height}`;\n } else {\n return `${this.deviceService.displayWidth}x${this.deviceService.displayHeight}`;\n }\n }\n\n redirectedFrom() {\n return this.cookieService.get(CookieName.RedirexOriginal);\n }\n\n trackerID() {\n return this.cookieService.get(CookieName.TrackerId);\n }\n\n trackingAffiliate() {\n return this.cookieService.get(CookieName.TrackingAffiliate);\n }\n\n abTestGroup() {\n return this.cookieService.get(CookieName.MmcoreBwinvar);\n }\n\n pageName() {\n return this.getPageName();\n }\n\n pageReferrer() {\n return this.removeNotTrackedQueryStrings(this.referrer, true);\n }\n\n browserOrientation() {\n return this.deviceService.currentOrientation;\n }\n\n nativeMode() {\n return this.nativeAppService.nativeMode;\n }\n\n isTouch() {\n return this.deviceService.isTouch;\n }\n\n cpuCores() {\n return this.deviceService.cpuCores;\n }\n\n cpuMaxFrequency() {\n return this.deviceService.cpuMaxFrequency;\n }\n\n totalRam() {\n return this.deviceService.totalRam;\n }\n\n model() {\n return this.deviceService.model;\n }\n\n nightMode() {\n return `Night Mode ${parseInt(this.cookieService.get(CookieName.DarkMode)) > 0 ? 'ON' : 'OFF'}`;\n }\n\n userKnown() {\n return !!this.cookieService.get(CookieName.LastVisitor);\n }\n\n internalCampaign() {\n return this.navigationService.location.search.get('trid');\n }\n\n deviceId() {\n return this.cookieService.get(CookieName.DeviceId);\n }\n\n lang() {\n return this.page.languageCode;\n }\n\n culture() {\n return this.page.lang;\n }\n\n frontend() {\n return this.frontendHelperService.getFrontendDescription();\n }\n\n medium() {\n return this.getMedium();\n }\n\n domain() {\n return this.page.domain;\n }\n\n fullEntryUrl() {\n return this.entryUrl;\n }\n\n entryUrlReferrer() {\n return this.cookieService.get(CookieName.EntryUrlReferrer);\n }\n\n packageVersion(packageName: string) {\n const nativeWindow = this.windowRef.nativeWindow;\n if (nativeWindow.VERSIONS) {\n return nativeWindow.VERSIONS[packageName];\n }\n }\n\n setReferrer(referrer: string) {\n this.referrer = referrer;\n }\n\n setEntryUrl(entryUrl: string) {\n this.entryUrl = this.urlService.parse(entryUrl);\n }\n\n terminalId() {\n return this.cookieService.get(CookieName.TerminalId);\n }\n\n shopId() {\n return this.cookieService.get(CookieName.ShopId) || '0';\n }\n\n terminalType() {\n return this.nativeAppService.applicationName;\n }\n\n isTerminal() {\n return this.nativeAppService.isTerminal;\n }\n\n private removeNotTrackedQueryStrings(url: string, absolute: boolean): string {\n if (!url) {\n return '';\n }\n\n const parsedUrl = this.urlService.parse(url);\n for (const notTrackedQueryString of this.trackingConfig.notTrackedQueryStrings || []) {\n parsedUrl.search.delete(notTrackedQueryString);\n }\n return decodeURIComponent(absolute ? parsedUrl.absUrl() : parsedUrl.url());\n }\n\n private getPageName() {\n const langPrefix = `/${this.page.lang}`;\n const path = this.navigationService.location.path();\n const lowerCasePath = path.toLowerCase();\n let pageName: string;\n if (lowerCasePath.indexOf(langPrefix) === 0) {\n const result = path.substring(langPrefix.length);\n if (result === '') {\n pageName = '/';\n } else {\n pageName = result;\n }\n } else {\n pageName = path;\n }\n\n pageName = TrackingValueGettersService.removeLeadingSlashes(pageName);\n return pageName;\n }\n\n private getMedium() {\n if (this.nativeAppService.nativeMode === 'Unknown') {\n if (this.deviceService.isTablet) return 'tablet web';\n else if (this.deviceService.isMobile) return 'mobile web';\n else return 'desktop web';\n }\n\n let os = '';\n if (this.nativeAppService.isNativeApp || this.nativeAppService.isNativeWrapper) {\n if (this.deviceService.isiOS) os = 'ios';\n if (this.deviceService.isChrome) os = 'android';\n }\n\n return `${this.nativeAppService.nativeMode} ${os}`;\n }\n\n private static removeLeadingSlashes(input: string) {\n return input.replace(/^\\/*/, '');\n }\n}\n","/**\n * Represents a client-side tag manager script configured in {@link TrackingConfig}.\n *\n * @stable\n */\nexport interface ClientTagManager {\n name: string;\n script: string;\n}\n\n/**\n * @stable\n */\nexport interface TrackingServiceOptions {\n timeout: number;\n}\n\n/**\n * @stable\n */\nexport interface EventNames {\n pageView: string;\n userLogout: string;\n}\n\n/**\n * @internal\n */\nexport const eventNames: EventNames = {\n pageView: 'pageView',\n userLogout: 'Event.Logout',\n};\n\n/**\n * @internal\n */\nexport interface CommunicationType {\n id: string;\n name: string;\n selected: boolean;\n}\n\n/**\n * @internal\n */\nexport interface CommunicationSettings {\n settings: CommunicationType[];\n}\n\n/**\n * @internal\n */\nexport interface ContentItemTracking {\n event: string;\n data: { [key: string]: string };\n}\n","import { Injectable } from '@angular/core';\n\nimport {\n CookieName,\n CookieService,\n LocalStoreKey,\n LocalStoreService,\n Logger,\n MenuContentItem,\n SharedFeaturesApiService,\n TimerService,\n TrackingServiceProvider,\n TriggerEventPromiseResult,\n WebAnalyticsEventType,\n WebAnalyticsEvents,\n WebWorkerService,\n WindowEvent,\n WindowRef,\n WorkerType,\n} from '@frontend/vanilla/core';\nimport { isObject, mapKeys, pickBy } from 'lodash-es';\n\nimport { TrackingValueGettersService } from './tracking-value-getters.service';\nimport { TrackingConfig } from './tracking.client-config';\nimport { CommunicationSettings, CommunicationType, ContentItemTracking, TrackingServiceOptions, eventNames } from './tracking.models';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DataLayerTrackingService implements TrackingServiceProvider {\n constructor(\n private trackingValueGettersService: TrackingValueGettersService,\n private trackingConfig: TrackingConfig,\n private cookieService: CookieService,\n private windowRef: WindowRef,\n private apiService: SharedFeaturesApiService,\n private log: Logger,\n private timerService: TimerService,\n private localStoreService: LocalStoreService,\n webWorkerService: WebWorkerService,\n ) {\n // Create interval to update data layer when GTM script loads.\n webWorkerService.createWorker(WorkerType.DataLayerTrackingInterval, { interval: 500 }, () => {\n if (this.gtmLoaded) {\n this.processLocalStore();\n webWorkerService.removeWorker(WorkerType.DataLayerTrackingInterval);\n }\n });\n }\n\n private get gtmEnabled(): boolean {\n return this.trackingConfig.tagManagerRenderers.includes('GoogleTagManagerRenderer') && !!this.windowRef.nativeWindow.google_tag_manager;\n }\n\n private get gtmLoaded(): boolean {\n return (\n this.windowRef.nativeWindow.dataLayer?.some((x: { event: string }) => x.event === WindowEvent.VanillaGtmLoaded) &&\n this.windowRef.nativeWindow.dataLayer?.some((x: { event: string }) => x.event === WindowEvent.GtmLoad)\n );\n }\n\n async addInitialValues() {\n this.updateDataLayerEntryInfo();\n await this.updateUserValues();\n this.updateDataLayer({\n 'browser.userAgent': this.trackingValueGettersService.userAgent(),\n 'browser.isTouch': this.trackingValueGettersService.isTouch(),\n 'page.trackerID': this.trackingValueGettersService.trackerID(),\n 'page.redirectedFrom': this.trackingValueGettersService.redirectedFrom(),\n 'page.nightModeStatus': this.trackingValueGettersService.nightMode(),\n 'page.language': this.trackingValueGettersService.lang(),\n 'page.culture': this.trackingValueGettersService.culture(),\n 'page.frontend': this.trackingValueGettersService.frontend(),\n 'page.domain': this.trackingValueGettersService.domain(),\n 'page.medium': this.trackingValueGettersService.medium(),\n 'native.nativeMode': this.trackingValueGettersService.nativeMode(),\n 'user.profile.dvID': this.trackingValueGettersService.deviceId(),\n 'user.session.internalCampaign': this.trackingValueGettersService.internalCampaign(),\n 'device.cpuCores': this.trackingValueGettersService.cpuCores(),\n 'device.cpuMaxFrequency': this.trackingValueGettersService.cpuMaxFrequency(),\n 'device.totalRam': this.trackingValueGettersService.totalRam(),\n 'device.model': this.trackingValueGettersService.model(),\n 'page.trackingAffiliate': this.trackingValueGettersService.trackingAffiliate(),\n 'browser.orientation': this.trackingValueGettersService.browserOrientation(),\n 'browser.screenResolution': this.trackingValueGettersService.browserScreenResolution(),\n });\n\n this.updateDataLayerSessionId();\n }\n\n async updateUserValues() {\n this.updateDataLayer({\n 'user.profile.accountID': this.trackingValueGettersService.accountId(),\n 'user.profile.bal': await this.trackingValueGettersService.userBalance(),\n 'user.profile.currency': this.trackingValueGettersService.userCurrency(),\n 'user.profile.country': this.trackingValueGettersService.userCountry(),\n 'user.profile.loyaltyStatus': this.trackingValueGettersService.userLoyalty(),\n 'user.profile.opid': this.trackingValueGettersService.userCustomerId(),\n 'user.profile.vid': this.trackingValueGettersService.userSegmentId(),\n 'user.profile.stage': this.trackingValueGettersService.userStage(),\n 'user.profile.prestage': this.trackingValueGettersService.userPrestage(),\n 'user.profile.mid': this.trackingValueGettersService.userMicroSegmentId(),\n 'user.profile.chid': this.trackingValueGettersService.userChurnRate(),\n 'user.profile.fvid': this.trackingValueGettersService.userFutureValue(),\n 'user.profile.pvid': this.trackingValueGettersService.userPotentialVip(),\n 'user.session.geoIPCountry': this.trackingValueGettersService.userGeoCountry(),\n 'user.session.abTestGroup': this.trackingValueGettersService.abTestGroup(),\n 'user.hasPositiveBalance': await this.trackingValueGettersService.hasPositiveBalance(),\n 'user.isAuthenticated': this.trackingValueGettersService.isAuthenticated(),\n 'user.isExisting': this.trackingValueGettersService.userKnown(),\n 'browser.orientation': this.trackingValueGettersService.browserOrientation(),\n 'browser.screenResolution': this.trackingValueGettersService.browserScreenResolution(),\n });\n }\n\n async updateDataLayer(data?: any): Promise {\n return new Promise((resolve) => {\n if (isObject(data) && !Array.isArray(data)) {\n if (this.gtmLoaded) {\n if (!this.trackingConfig.schedulerEnabled && this.trackingConfig.dataLayerUpdateTimeoutInMilliseconds) {\n this.timerService.scheduleIdleCallback(() => {\n this.windowRef.nativeWindow[this.trackingConfig.dataLayerName].push(data);\n resolve();\n }, this.trackingConfig.dataLayerUpdateTimeoutInMilliseconds);\n } else {\n this.windowRef.nativeWindow[this.trackingConfig.dataLayerName].push(data);\n resolve();\n }\n } else {\n const tracking = this.getDataFromStore();\n tracking.push(data);\n\n this.localStoreService.set(LocalStoreKey.Tracking, JSON.stringify(tracking));\n resolve();\n }\n }\n });\n }\n\n async trackEvents(item: MenuContentItem, eventType: WebAnalyticsEventType) {\n if (item.webAnalytics) {\n try {\n const parsedValue: WebAnalyticsEvents = JSON.parse(item.webAnalytics);\n\n switch (eventType) {\n case WebAnalyticsEventType.load:\n const load = parsedValue?.load;\n\n if (load) {\n await this.triggerEvent(load.eventName, load.data);\n }\n break;\n case WebAnalyticsEventType.click:\n const click = parsedValue?.click;\n\n if (click) {\n if (click.data['component.URLClicked'] === 'link') {\n click.data['component.URLClicked'] = item.url;\n }\n await this.triggerEvent(click.eventName, click.data);\n }\n break;\n case WebAnalyticsEventType.close:\n const close = parsedValue?.close;\n\n if (close) {\n await this.triggerEvent(close.eventName, close.data);\n }\n break;\n }\n } catch (error) {\n this.log.errorRemote(\n `Failed to parse or track WebAnalytics data from item:${item.name}. Provided WebAnalytics data:${item.webAnalytics}`,\n error,\n );\n }\n }\n }\n\n async triggerEvent(eventName: string, data?: any, options?: TrackingServiceOptions): Promise {\n // GTM must be enabled, not only loaded to make sure it's injected into a page via Vanilla's data layer tracking implementation.\n const eventTimeout = this.gtmEnabled ? options?.timeout || this.trackingConfig.eventCallbackTimeoutInMilliseconds : 0;\n\n return this.runWithTimeout(\n new Promise((resolve, reject) => {\n if (eventName.indexOf('error.') === 0) {\n // \"error.*\" eventName is reserved for errors reporting\n return reject('The \"error.*\" eventName is reserved for errors reporting');\n }\n\n if (!data || Object.keys(data).length === 0) {\n return reject('Tracking data is required');\n }\n\n if (eventName === eventNames.userLogout) {\n this.updateUserValues();\n }\n\n data = {\n event: eventName,\n ...data,\n };\n\n if (this.gtmEnabled) {\n data = {\n eventCallback: resolve.bind(null, TriggerEventPromiseResult.Normal),\n eventTimeout,\n ...data,\n };\n }\n\n this.updateDataLayer(data);\n\n // Tracking cleanup\n this.cookieService.remove(CookieName.RedirexOriginal);\n\n // Resolve immediately when GTM is not present (other tag managers don't support event callback)\n if (!this.gtmEnabled) {\n resolve(TriggerEventPromiseResult.Normal);\n }\n }),\n eventTimeout,\n );\n }\n\n async reportErrorObject(error: any) {\n return this.updateDataLayer({\n event: 'error',\n error,\n });\n }\n\n reportError(errorDetail: any) {\n this.updateDataLayer({\n event: encodeURIComponent(`error.${JSON.stringify(errorDetail)}`),\n });\n }\n\n trackContentItemEvent(parameters: { [name: string]: string } | undefined, parameterName: string) {\n const tracking = this.getContentItemTracking(parameters, parameterName);\n\n if (tracking) {\n this.triggerEvent(tracking.event, tracking.data);\n }\n }\n\n setReferrer(referrer: string) {\n this.trackingValueGettersService.setReferrer(referrer);\n }\n\n /**\n * Gets user communication settings and trigger the tracking event `Event.Functionality.Cts`\n * with data formatted as follows: **Email:Yes|Post:No|SMS:Yes|Phone:No**\n */\n updateUserContactabilityStatus() {\n this.apiService.get('communicationsettings').subscribe((data: CommunicationSettings) => {\n const cts = data.settings.map((c: CommunicationType) => `${c.name}:${c.selected ? 'Yes' : 'No'}`).join('|');\n this.triggerEvent('Event.Functionality.Cts', { 'user.profile.cts': cts }); //Format to Send: Email:Yes|Post:No|SMS:Yes|Phone:No.\n });\n }\n\n getContentItemTracking(parameters: { [name: string]: string } | undefined, parameterName: string): ContentItemTracking | null {\n parameters = parameters || {};\n const event = parameters[parameterName];\n\n if (!event) {\n return null;\n }\n\n const trackingDataPrefix = parameterName + '.';\n const data = mapKeys(\n pickBy(parameters, (_: string, k: string) => k.startsWith(trackingDataPrefix)),\n (_: string, k: string) => k.replace(trackingDataPrefix, ''),\n );\n\n return { event, data };\n }\n\n private getDataFromStore(): any[] {\n const trackingData = this.localStoreService.get(LocalStoreKey.Tracking);\n\n return trackingData ? JSON.parse(trackingData) : [];\n }\n\n private processLocalStore() {\n const trackings = this.getDataFromStore();\n\n if (trackings.length > 0) {\n trackings.forEach((data: any) => this.updateDataLayer(data));\n\n this.localStoreService.remove(LocalStoreKey.Tracking);\n }\n }\n\n private runWithTimeout(promise: Promise, timeout: number): Promise {\n return new Promise((resolve, reject) => {\n const timeoutId = this.timerService.scheduleIdleCallback(() => resolve(TriggerEventPromiseResult.Timeout), timeout);\n\n promise.then(\n (result: TriggerEventPromiseResult) => {\n timeoutId();\n resolve(result);\n },\n (error: any) => {\n timeoutId();\n reject(error);\n },\n );\n });\n }\n\n private updateDataLayerEntryInfo() {\n const entryUrl = this.cookieService.get(CookieName.EntryUrl);\n\n if (entryUrl) {\n this.trackingValueGettersService.setEntryUrl(entryUrl);\n this.updateDataLayer({\n event: 'v8Launch',\n v8: {\n tech: {\n build: this.trackingValueGettersService.packageVersion('@frontend/vanilla'),\n label: this.trackingValueGettersService.domain(),\n },\n entry: {\n url: this.trackingValueGettersService.fullEntryUrl().absUrl(),\n path: this.trackingValueGettersService.fullEntryUrl().path(),\n referrer: this.trackingValueGettersService.entryUrlReferrer(),\n utms: {\n source: this.trackingValueGettersService.fullEntryUrl().search.get('utm_source'),\n medium: this.trackingValueGettersService.fullEntryUrl().search.get('utm_medium'),\n campaign: this.trackingValueGettersService.fullEntryUrl().search.get('utm_campaign'),\n content: this.trackingValueGettersService.fullEntryUrl().search.get('utm_content'),\n keyword: this.trackingValueGettersService.fullEntryUrl().search.get('utm_term'),\n },\n },\n },\n });\n }\n }\n\n private updateDataLayerSessionId() {\n if (this.windowRef.nativeWindow.hasOwnProperty('decibelInsight')) {\n this.windowRef.nativeWindow.decibelInsight('ready', () => {\n this.updateDataLayer({ 'user.decibelID': this.windowRef.nativeWindow.decibelInsight('getSessionId') });\n });\n } else {\n this.windowRef.nativeWindow._da_ready = () => {\n this.updateDataLayer({ 'user.decibelID': this.windowRef.nativeWindow.decibelInsight('getSessionId') });\n };\n }\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { PageViewContext, PageViewDataProvider, TrackingData } from '@frontend/vanilla/core';\nimport { Observable, of } from 'rxjs';\n\nimport { TrackingValueGettersService } from './tracking-value-getters.service';\n\n@Injectable()\nexport class DefaultPageViewDataProvider implements PageViewDataProvider {\n constructor(private valueGetters: TrackingValueGettersService) {}\n\n getData(context: PageViewContext = { navigationId: 0, utm: null }): Observable {\n let data: Record = {\n 'page.referrer': this.valueGetters.pageReferrer(),\n 'page.url': this.valueGetters.locationAbsUrl(),\n 'page.host': this.valueGetters.locationHost(),\n 'page.pathQueryAndFragment': this.valueGetters.locationPathQueryAndFragment(),\n 'page.name': this.valueGetters.pageName(),\n };\n\n if (this.valueGetters.isTerminal()) {\n data = {\n ...data,\n ...{\n 'page.terminalId': this.valueGetters.terminalId(),\n 'page.terminalType': this.valueGetters.terminalType(),\n 'page.shopId': this.valueGetters.shopId(),\n },\n };\n }\n\n if (context?.utm) {\n for (const key in context.utm) {\n if ((context.utm as any)[key]) {\n data[key.replace('utm_', 'utms.')] = (context.utm as any)[key];\n }\n }\n }\n\n return of(data);\n }\n}\n","import { Inject, Injectable } from '@angular/core';\n\nimport {\n PAGE_VIEW_DATA_PROVIDER,\n PageViewContext,\n PageViewDataProvider,\n ProductInjector,\n TrackingData,\n TrackingService,\n Utm,\n} from '@frontend/vanilla/core';\nimport { NEVER, Observable, combineLatest, of, race } from 'rxjs';\nimport { catchError, first, map, timeout } from 'rxjs/operators';\n\nimport { TrackingConfig } from './tracking.client-config';\nimport { eventNames } from './tracking.models';\n\nclass PageView {\n data: TrackingData | null;\n\n private dataCallback: (() => void) | undefined;\n\n constructor(dataSource: Observable) {\n dataSource.subscribe((data: TrackingData) => {\n this.data = data;\n\n if (this.dataCallback) {\n this.dataCallback();\n }\n });\n }\n\n onData(fn: () => void) {\n if (this.data) {\n fn();\n } else {\n this.dataCallback = fn;\n }\n }\n}\n\n@Injectable()\nexport class PageViewTrackingService {\n private pageViewQueue: PageView[] = [];\n\n constructor(\n private productInjector: ProductInjector,\n private trackingConfig: TrackingConfig,\n private trackingService: TrackingService,\n @Inject(PAGE_VIEW_DATA_PROVIDER) private currentDataProviders: PageViewDataProvider[],\n ) {}\n\n trackPageView(navigationId: number): void;\n trackPageView(utm: Utm): void;\n trackPageView(utm: Utm, navigationId: number): void;\n trackPageView(...args: any[]): void {\n const navigationId = this.toNumberOrDefault(args[0], this.toNumberOrDefault(args[1], 0));\n const context: PageViewContext = { navigationId, utm: args[0].utm_source === undefined ? {} : args[0] };\n const providers = Object.assign(this.productInjector.getMultiple(PAGE_VIEW_DATA_PROVIDER), this.currentDataProviders);\n const data = combineLatest(\n providers.map((p: PageViewDataProvider) => {\n return race(\n p.getData(context),\n NEVER.pipe(\n timeout(this.trackingConfig.pageViewDataProviderTimeout),\n catchError(() => of({})),\n ),\n ).pipe(first());\n }),\n ).pipe(\n map((data: TrackingData[]) => {\n return Object.assign({}, ...data);\n }),\n );\n const pageView = new PageView(data);\n this.pageViewQueue.push(pageView);\n\n pageView.onData(() => this.processPageViewQueue());\n }\n\n private processPageViewQueue() {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const pageView = this.pageViewQueue[0];\n\n if (!pageView || !pageView.data) {\n break;\n }\n this.trackingService.triggerEvent(eventNames.pageView, pageView.data);\n this.pageViewQueue.shift();\n }\n }\n\n private toNumberOrDefault = (v: any, d: number) => {\n const value = Number(v);\n\n return isNaN(value) ? d : v;\n };\n}\n","import { Injectable, inject } from '@angular/core';\n\nimport { TimerService, WindowEvent, WindowRef } from '@frontend/vanilla/core';\nimport { RxStrategyProvider } from '@rx-angular/cdk/render-strategies';\nimport { firstValueFrom } from 'rxjs';\n\nimport { TrackingConfig } from './tracking.client-config';\n\n@Injectable({ providedIn: 'root' })\nexport class DataLayerProxyService {\n private trackingConfig = inject(TrackingConfig);\n private timerService = inject(TimerService);\n private strategyProvider = inject(RxStrategyProvider);\n private windowRef = inject(WindowRef);\n\n private requiredEvents = [\n WindowEvent.VanillaGtmLoaded,\n WindowEvent.GtmLoad,\n 'webVital',\n 'gtm.js',\n 'webVital',\n 'OptanonLoaded',\n 'OneTrustLoaded',\n 'OneTrustGroupsUpdated',\n ];\n private patched = false;\n\n async patchDataLayer() {\n await firstValueFrom(this.trackingConfig.whenReady);\n\n if (\n !this.patched &&\n this.trackingConfig.isEnabled &&\n (this.trackingConfig.enableLogging || this.trackingConfig.schedulerEnabled || this.trackingConfig.enableOmitting)\n ) {\n this.windowRef.nativeWindow[this.trackingConfig.dataLayerName] = this.createDataLayerProxy(\n this.windowRef.nativeWindow[this.trackingConfig.dataLayerName],\n );\n this.patched = true;\n }\n }\n\n // this proxy is here to make sure the `requestIdleCallback` is always\n // wrapped around the most outer function call\n // all gtm containers apply monkey-patches to the dataLayer.push method\n // while respecting already applied patches\n // we end up in a chain of overridden function bodies\n // to make sure the `requestIdleCallback` is the most outer function\n // we use a Proxy that keeps track of overrides to the `push` method\n private createDataLayerProxy(origDataLayer = []) {\n const idleWrapper = (fn: Function) => {\n this.timerService.scheduleIdleCallback(() => {\n // make sure that tracking is executed after the render queue is empty\n this.strategyProvider\n .schedule(() => fn(), {\n patchZone: false,\n strategy: 'idle',\n })\n .subscribe();\n }, this.trackingConfig.trackingDelay);\n\n return origDataLayer.length + 1;\n };\n\n const { enableOmitting, schedulerEnabled, omitAll, enableLogging } = this.trackingConfig;\n const blockDevice = this.trackingConfig.deviceBlockEnabled && this.isLowTierDevice();\n const isNextCallSuppressed = this.isNextCallSuppressed.bind(this);\n const allowlist = new Set(...(this.trackingConfig.allowlist || []), ...this.requiredEvents);\n const blocklist = new Set(this.trackingConfig.blocklist || []);\n const window = this.windowRef.nativeWindow;\n const measureTask = measureTaskDuration;\n\n return new Proxy(origDataLayer, {\n set(target, key, newValue: unknown) {\n if (key === 'push') {\n target[key] = (...args: any) => {\n const eventName = args?.[0]?.event;\n\n const shouldBeOmitted =\n // check if omitting feature is enabled\n enableOmitting &&\n // not in allowlist\n !allowlist.has(eventName) &&\n // omit all OR in blocklist OR low tier device blocking enabled and device is slow OR percentage blocking enabled and event got in range\n (omitAll || blocklist.has(eventName) || blockDevice || isNextCallSuppressed());\n\n if (shouldBeOmitted) {\n return () => 0;\n }\n\n const callback: Function = () => {\n const work = (newValue as Function).bind(target, ...args);\n\n if (enableLogging || window.logTrackingPerformance) {\n return measureTask(work, args, eventName);\n }\n return work();\n };\n\n return schedulerEnabled ? idleWrapper(callback) : callback();\n };\n } else {\n target[key as any] = newValue;\n }\n\n return true;\n },\n });\n }\n\n private isLowTierDevice(): boolean {\n const deviceConcurrency = navigator.hardwareConcurrency;\n const minDeviceConcurrency = this.trackingConfig.deviceConcurrency;\n\n if (minDeviceConcurrency && deviceConcurrency && deviceConcurrency <= minDeviceConcurrency) {\n return true;\n }\n\n const minDeviceMemory = this.trackingConfig.deviceMemory;\n const deviceMemory = (navigator as { deviceMemory?: number }).deviceMemory;\n\n if (minDeviceMemory && deviceMemory && deviceMemory <= minDeviceMemory) {\n return true;\n }\n\n const benchmarkThreshold = this.trackingConfig.benchmarkThreshold;\n\n return !!(benchmarkThreshold && benchmark() > benchmarkThreshold);\n }\n\n private isNextCallSuppressed(): boolean {\n const omitPercentage = this.trackingConfig.omitPercentage;\n\n return !!omitPercentage && Math.random() * 100 <= omitPercentage;\n }\n}\n\nfunction isPrime(num: number): boolean {\n for (let i = 2, s = Math.sqrt(num); i <= s; i++) {\n if (num % i === 0) {\n return false;\n }\n }\n\n return num > 1;\n}\n\nfunction calculatePrimes(max: number): number[] {\n const primes: number[] = [];\n\n for (let i = 1; i < max; i++) {\n if (isPrime(i)) {\n primes.push(i);\n }\n }\n\n return primes;\n}\n\nfunction benchmark(): number {\n const start = performance.now();\n calculatePrimes(20000);\n\n return performance.now() - start;\n}\n\nfunction measureTaskDuration(work: Function, args: unknown, eventName: string) {\n const startTime = performance.now();\n const name = `${eventName || '[anonymous event]'}`;\n const startMark = `GTM Event ${name} start`;\n performance.mark(`GTM Event ${name} start`);\n const r = work();\n const endMark = `GTM Event ${name} end`;\n performance.mark(endMark);\n performance.measure(`GTM Event ${name}`, startMark, endMark);\n const endTime = performance.now();\n\n const runtime = Math.ceil(endTime - startTime);\n const color = runtime >= 100 ? 'red' : 'green';\n\n // eslint-disable-next-line no-console\n console.log(`Analytics tracking: ${name} took %c${runtime}ms`, `color: ${color}`, {\n withArgs: args,\n });\n\n return r;\n}\n","/* eslint-disable deprecation/deprecation */\nimport { Injectable, Injector, effect, inject } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { CookieService, DeviceService, NavigationService, WindowEvent, WindowRef } from '@frontend/vanilla/core';\nimport { Observable, fromEvent, interval, merge, startWith } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, map, switchMap } from 'rxjs/operators';\n\nconst eventQueueKey = '_ptEventsQueue';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PartytownService {\n private deviceService = inject(DeviceService);\n private injector = inject(Injector);\n private windowReference = inject(WindowRef);\n private navigationService = inject(NavigationService);\n private cookieService = inject(CookieService);\n private router = inject(Router);\n\n private nativeWindow = this.windowReference.nativeWindow;\n private document = this.nativeWindow.document;\n private navigator = this.nativeWindow.navigator;\n private performance = this.nativeWindow.performance;\n\n private readonly ptSharedStorage: {\n set: (key: string, value: any) => void;\n };\n\n private readonly ptWorkerLocation: {\n set: (location: Location) => void;\n };\n\n constructor() {\n this.ptWorkerLocation = this.nativeWindow.ptWorkerLocation = this.nativeWindow.ptWorkerLocation ?? {\n set: () => {},\n };\n this.ptSharedStorage = this.nativeWindow.ptSharedStorage = this.nativeWindow.ptSharedStorage ?? {\n set: () => {},\n };\n }\n\n createEventReplayQueue() {\n const dataLayer = this.nativeWindow.dataLayer || [];\n replayEvents(dataLayer);\n const origPush = dataLayer.push;\n\n dataLayer.push = (...args: any) => {\n addToQueue(JSON.stringify(args));\n return origPush.apply(dataLayer, args);\n };\n }\n\n createSharedStorage() {\n this.setStaticProps();\n\n this.createDimensionsEffect();\n\n this.subscribeToDynamicProps();\n }\n\n private getWindowOffsetUpdates() {\n return fromEvent(this.nativeWindow, 'scroll').pipe(debounceTime(1000));\n }\n\n private getVisibilityUpdates() {\n return new Observable((observer) => {\n const handler = () => observer.next(document.hidden);\n\n this.nativeWindow.addEventListener(WindowEvent.VisibilityChange, handler);\n\n return () => this.nativeWindow.removeEventListener(WindowEvent.VisibilityChange, handler);\n });\n }\n\n private setStaticProps() {\n // window props\n this.ptSharedStorage.set('window.opener', this.nativeWindow.opener);\n\n // document props\n this.ptSharedStorage.set('document.characterSet', this.document.characterSet);\n this.ptSharedStorage.set('document.referrer', this.document.referrer);\n this.ptSharedStorage.set('document.domain', this.document.domain);\n this.ptSharedStorage.set('document.prerendering', (this.document as any).prerendering);\n\n // navigator props\n this.ptSharedStorage.set('window.navigator.loadPurpose', (this.navigator as any).loadPurpose);\n this.ptSharedStorage.set('window.navigator.userLanguage', (this.navigator as any).userLanguage);\n this.ptSharedStorage.set('window.navigator.cookieEnabled', this.navigator.cookieEnabled);\n this.ptSharedStorage.set('window.navigator.cookieDeprecationLabel', (this.navigator as any).cookieDeprecationLabel);\n this.ptSharedStorage.set('window.navigator.vendor', this.navigator.vendor);\n this.ptSharedStorage.set('window.navigator.doNotTrack', this.navigator.doNotTrack);\n this.ptSharedStorage.set('window.navigator.maxTouchPoints', this.navigator.maxTouchPoints);\n this.ptSharedStorage.set('window.navigator.msDoNotTrack', (this.navigator as any)['msDoNotTrack']);\n\n // perf timings\n this.ptSharedStorage.set('performance.timeOrigin', this.performance.timeOrigin);\n this.ptSharedStorage.set('performancetiming.navigationStart', this.performance.timing.navigationStart);\n this.ptSharedStorage.set('performancetiming.redirectStart', this.performance.timing.redirectStart);\n this.ptSharedStorage.set('performancetiming.redirectEnd', this.performance.timing.redirectEnd);\n this.ptSharedStorage.set('performancetiming.fetchStart', this.performance.timing.fetchStart);\n this.ptSharedStorage.set('performancetiming.domainLookupStart', this.performance.timing.domainLookupStart);\n this.ptSharedStorage.set('performancetiming.domainLookupEnd', this.performance.timing.domainLookupEnd);\n this.ptSharedStorage.set('performancetiming.connectStart', this.performance.timing.connectStart);\n this.ptSharedStorage.set('performancetiming.secureConnectionStart', this.performance.timing.secureConnectionStart);\n this.ptSharedStorage.set('performancetiming.connectEnd', this.performance.timing.connectEnd);\n this.ptSharedStorage.set('performancetiming.requestStart', this.performance.timing.requestStart);\n this.ptSharedStorage.set('performancetiming.responseStart', this.performance.timing.responseStart);\n this.ptSharedStorage.set('performancetiming.responseEnd', this.performance.timing.responseEnd);\n this.ptSharedStorage.set('performancetiming.unloadEventStart', this.performance.timing.unloadEventStart);\n this.ptSharedStorage.set('performancetiming.unloadEventEnd', this.performance.timing.unloadEventEnd);\n this.ptSharedStorage.set('performancetiming.domLoading', this.performance.timing.domLoading);\n this.ptSharedStorage.set('performancetiming.domInteractive', this.performance.timing.domInteractive);\n this.ptSharedStorage.set('performancetiming.domContentLoadedEventStart', this.performance.timing.domContentLoadedEventStart);\n this.ptSharedStorage.set('performancetiming.domContentLoadedEventEnd', this.performance.timing.domContentLoadedEventEnd);\n this.ptSharedStorage.set('performancetiming.domComplete', this.performance.timing.domComplete);\n this.ptSharedStorage.set('performancetiming.loadEventStart', this.performance.timing.loadEventStart);\n this.ptSharedStorage.set('performancetiming.loadEventEnd', this.performance.timing.loadEventEnd);\n }\n\n private createDimensionsEffect() {\n effect(\n () => {\n const windowRect = this.deviceService.windowRect();\n const screenHeight = this.deviceService.visualViewportHeight();\n const screenWidth = this.deviceService.visualViewportWidth();\n\n // dimensions\n this.ptSharedStorage.set('screen.width', screenWidth);\n this.ptSharedStorage.set('screen.colorDepth', screen.colorDepth);\n this.ptSharedStorage.set('html.clientWidth', windowRect.width);\n this.ptSharedStorage.set('html.innerWidth', screenWidth);\n this.ptSharedStorage.set('html.scrollWidth', windowRect.width);\n this.ptSharedStorage.set('html.offsetWidth', windowRect.width);\n this.ptSharedStorage.set('html.offsetHeight', windowRect.height);\n this.ptSharedStorage.set('screen.height', screenHeight);\n this.ptSharedStorage.set('body.offsetHeight', windowRect.height);\n this.ptSharedStorage.set('body.scrollHeight', windowRect.height);\n this.ptSharedStorage.set('html.clientHeight', screenHeight);\n this.ptSharedStorage.set('html.innerHeight', screenHeight);\n this.ptSharedStorage.set('html.scrollHeight', windowRect.height);\n this.ptSharedStorage.set('window.innerWidth', windowRect.width);\n this.ptSharedStorage.set('window.innerHeight', windowRect.height);\n },\n { injector: this.injector },\n );\n }\n\n private subscribeToDynamicProps() {\n this.navigationService.locationChange\n .pipe(\n switchMap(() =>\n merge(\n // whenever queryParams change, update the route\n this.router.routerState.root.queryParamMap.pipe(startWith(this.router.routerState.root.snapshot.queryParamMap)),\n // We have to do polling here, as the angular router doesn't send us ANY\n // information that e.g. ?tab=score or ?market=5 changed\n // for the current hotfix state this is fine!\n interval(2500),\n ),\n ),\n startWith(true),\n map(() => this.nativeWindow.location.href),\n distinctUntilChanged(),\n )\n .subscribe(() => {\n this.ptWorkerLocation.set(this.nativeWindow.location);\n this.ptSharedStorage.set('document.title', document.title);\n this.ptSharedStorage.set('window.location', this.nativeWindow.location);\n });\n\n this.cookieService\n .getCookieUpdates()\n .pipe(debounceTime(100), startWith(document.cookie))\n .subscribe((value) => this.ptSharedStorage.set('document.cookie', value));\n\n this.getVisibilityUpdates()\n .pipe(startWith(document.hidden))\n .subscribe((value) => this.ptSharedStorage.set('document.hidden', value));\n\n this.getWindowOffsetUpdates()\n .pipe(startWith(true))\n .subscribe(() => {\n this.ptSharedStorage.set('window.pageYOffset', this.nativeWindow.pageYOffset);\n this.ptSharedStorage.set('window.scrollY', this.nativeWindow.scrollY);\n });\n\n this.getSnowplowCounterUpdates()\n .pipe(startWith(true))\n .subscribe(() => {\n this.ptSharedStorage.set('window.i', this.nativeWindow.i);\n });\n }\n\n private getSnowplowCounterUpdates() {\n const nativeWindow = this.nativeWindow;\n nativeWindow._i = nativeWindow.i;\n\n return new Observable((observer) => {\n Object.defineProperty(this.nativeWindow, 'i', {\n enumerable: true,\n configurable: true,\n get() {\n return nativeWindow._i;\n },\n set(value) {\n nativeWindow._i = value;\n observer.next(value);\n },\n });\n });\n }\n}\n\nconst getEventsQueue = (): string[] => {\n try {\n const savedEventsItem = localStorage.getItem(eventQueueKey);\n return savedEventsItem ? JSON.parse(savedEventsItem) : [];\n } catch (e) {\n console.error('Failed to parse events queue:', e);\n return [];\n }\n};\n\nconst addToQueue = (event: string) => {\n try {\n const eventsQueue = getEventsQueue();\n eventsQueue.push(event);\n localStorage.setItem(eventQueueKey, JSON.stringify(eventsQueue));\n } catch (e) {\n console.error('Failed to store event in a queue:', e);\n }\n};\n\nconst replayEvents = (dataLayer: unknown[]) => {\n try {\n const eventsQueue = getEventsQueue();\n\n eventsQueue.forEach((event) => {\n const parsedArgs = JSON.parse(event);\n dataLayer.push(...parsedArgs);\n });\n } catch (e) {\n console.error('Failed to restore events:', e);\n }\n\n localStorage.removeItem(eventQueueKey);\n};\n","import { Injectable, NgZone, inject } from '@angular/core';\n\nimport { WindowEvent, WindowRef } from '@frontend/vanilla/core';\nimport { fromEvent, take } from 'rxjs';\n\nimport { DataLayerProxyService } from './data-layer-proxy.service';\nimport { PartytownService } from './partytown.service';\nimport { TrackingConfig } from './tracking.client-config';\nimport { ClientTagManager } from './tracking.models';\n\n/**\n * @whatItDoes Injects all configured client-side tag manager scripts into the DOM.\n *\n * @description\n *\n * Client-side tag managers can be configured using TrackingConfig.\n *\n * @stable\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class TagManagerService {\n private document: Document;\n private windowReference: WindowRef;\n private partytownService = inject(PartytownService);\n\n /**\n * @internal\n */\n constructor(\n private trackingConfig: TrackingConfig,\n windowRef: WindowRef,\n private dataLayerProxy: DataLayerProxyService,\n private ngZone: NgZone,\n ) {\n this.document = windowRef.nativeWindow.document;\n this.windowReference = windowRef;\n }\n\n /** @internal */\n init() {\n if (!this.trackingConfig.isEnabled) {\n return;\n }\n\n const configured = this.trackingConfig.clientTagManagers || [];\n const excludes = this.trackingConfig.clientInjectionExcludes || [];\n\n configured.filter((current) => excludes.indexOf(current.name) === -1).forEach((current) => this.injectScript(current));\n }\n\n /** @stable */\n get availableClientTagManagers(): string[] {\n return (this.trackingConfig.clientTagManagers || []).map((t: ClientTagManager) => t.name);\n }\n\n /** Adds a tag manager init script for the given tag managerer renderer name to the script unless present.\n *\n * @stable\n */\n async load(rendererName: string, type?: string): Promise {\n const configured = this.trackingConfig.clientTagManagers || [];\n const tagManager = configured.find((current) => current.name === rendererName);\n\n if (!tagManager) {\n return Promise.reject(new Error(`Client TagManager \"${rendererName}\" does not exist.`));\n }\n\n const existing = this.document.querySelector('#' + tagManager.name);\n\n if (existing) {\n return Promise.resolve(existing);\n }\n\n await this.dataLayerProxy.patchDataLayer();\n return this.injectScript(tagManager, type);\n }\n\n private injectScript(tagManager: ClientTagManager, type = 'text/javascript'): Promise {\n const id = tagManager.name;\n const script = this.document.createElement('script');\n script.async = true;\n script.id = id;\n script.text = tagManager.script;\n script.type = type;\n\n const promise = new Promise((resolve, reject) => {\n script.onload = () => resolve(script);\n script.onerror = () => reject(new Error(`Client TagManager \"${id}\" failed to load.`));\n });\n\n this.document.body.appendChild(script);\n\n return promise;\n }\n\n public loadPartyTownGTM() {\n const isDisabledLocally = localStorage.getItem('partytown-disabled') === '1';\n const isServiceWorkerSupported = 'serviceWorker' in navigator;\n if (\n isServiceWorkerSupported &&\n !isDisabledLocally &&\n this.windowReference.nativeWindow.partytown &&\n this.windowReference.nativeWindow._ptReady\n ) {\n this.windowReference.nativeWindow._ptReady\n .then(() => {\n this.windowReference.nativeWindow.dataLayer = this.windowReference.nativeWindow.dataLayer ?? [];\n\n this.partytownService.createSharedStorage();\n\n this.ngZone.runOutsideAngular(() => {\n fromEvent(this.document, 'gtm_loaded')\n .pipe(take(1))\n .subscribe(() => {\n // tell tracking system gtm was loaded\n this.push({ event: WindowEvent.VanillaGtmLoaded });\n this.push({ event: WindowEvent.GtmLoad });\n if (this.windowReference.nativeWindow.partytown.enableEventReplay) {\n setTimeout(() => {\n this.partytownService.createEventReplayQueue();\n }, 5000);\n }\n });\n\n this.load('GoogleTagManagerRenderer', 'text/partytown');\n\n if (document.readyState === 'complete') {\n // we need to do that async, as the script injection also is async\n setTimeout(() => this.windowReference.nativeWindow.dispatchEvent(new CustomEvent('ptupdate')));\n } else {\n this.windowReference.nativeWindow.addEventListener('load', () => {\n setTimeout(() => {\n // notify partytown that we've added a new script\n this.windowReference.nativeWindow.dispatchEvent(new CustomEvent('ptupdate'));\n });\n });\n }\n });\n })\n .catch(() => {\n this.load('GoogleTagManagerRenderer');\n });\n } else {\n this.load('GoogleTagManagerRenderer');\n }\n }\n\n private push(payload: object) {\n if (this.windowReference.nativeWindow.dataLayer) {\n const dataLayer = this.windowReference.nativeWindow.dataLayer;\n // workaround to don't trigger dataLayer.push\n // since it is patched by partytown and unnecessarily propagates data to the worker\n dataLayer[dataLayer.length] = payload;\n }\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { UrlService, Utm } from '@frontend/vanilla/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UtmService {\n public static storageKey: string = 'utm';\n\n constructor(private urlService: UrlService) {}\n\n parseFromUrl(url: string): Utm {\n const queryParameters = this.urlService.parse(url).search;\n\n const utm: Utm = {\n utm_source: '',\n utm_medium: '',\n utm_campaign: '',\n utm_term: '',\n utm_content: '',\n utm_keyword: '',\n };\n\n queryParameters.keys().forEach((key) => {\n const value = queryParameters.get(key);\n if (key in utm && value !== null) {\n (utm as any)[key] = value;\n }\n });\n\n return utm;\n }\n}\n","import { Inject, Injectable } from '@angular/core';\n\nimport {\n DeviceService,\n LocationChangeEvent,\n NavigationService,\n OnFeatureInit,\n TRACKING_SERVICE_PROVIDER,\n TagManagerService as TagManagerCoreService,\n TrackingService,\n TrackingServiceProvider,\n UserEvent,\n UserLoginEvent,\n UserService,\n WindowRef,\n} from '@frontend/vanilla/core';\nimport { firstValueFrom } from 'rxjs';\nimport { first } from 'rxjs/operators';\n\nimport { PageViewTrackingService } from './page-view-tracking.service';\nimport { TagManagerService } from './tag-manager.service';\nimport { TrackingValueGettersService } from './tracking-value-getters.service';\nimport { TrackingConfig } from './tracking.client-config';\nimport { UtmService } from './utm-service';\n\n@Injectable()\nexport class TrackingBootstrapService implements OnFeatureInit {\n constructor(\n private navigationService: NavigationService,\n private windowRef: WindowRef,\n private pageViewTrackingService: PageViewTrackingService,\n private user: UserService,\n private trackingConfig: TrackingConfig,\n private tagManagerService: TagManagerService,\n private valueGetters: TrackingValueGettersService,\n private utmService: UtmService,\n private deviceService: DeviceService,\n private trackingService: TrackingService,\n private tagManagerCoreService: TagManagerCoreService,\n @Inject(TRACKING_SERVICE_PROVIDER) private trackingServiceProvider: TrackingServiceProvider,\n ) {}\n\n async onFeatureInit() {\n await firstValueFrom(this.trackingConfig.whenReady);\n if (!this.trackingConfig.isEnabled) {\n return;\n }\n\n this.tagManagerCoreService.set(this.tagManagerService);\n this.trackingService.set(this.trackingServiceProvider);\n\n await this.trackingService.addInitialValues();\n\n // Browser data\n this.trackingServiceProvider.updateDataLayer({\n 'browser.screenResolution': this.valueGetters.browserScreenResolution(),\n });\n\n this.deviceService.orientation.subscribe(() => {\n this.trackingServiceProvider.updateDataLayer({\n 'browser.orientation': this.valueGetters.browserOrientation(),\n });\n });\n\n this.trackingServiceProvider.setReferrer(this.windowRef.nativeWindow.document.referrer);\n this.pageViewTrackingService.trackPageView(this.utmService.parseFromUrl(this.windowRef.nativeWindow.location.href));\n this.navigationService.locationChange.subscribe((e: LocationChangeEvent) => {\n if (e.previousUrl === e.nextUrl) {\n return;\n }\n\n this.trackingServiceProvider.setReferrer(e.previousUrl);\n this.pageViewTrackingService.trackPageView(this.utmService.parseFromUrl(e.nextUrl), e.id);\n });\n\n this.user.events.pipe(first((e: UserEvent) => e instanceof UserLoginEvent)).subscribe(() => {\n this.trackingServiceProvider.updateUserContactabilityStatus();\n });\n this.tagManagerService.init();\n }\n}\n","import { PAGE_VIEW_DATA_PROVIDER, TRACKING_SERVICE_PROVIDER, runOnFeatureInit } from '@frontend/vanilla/core';\n\nimport { DataLayerTrackingService } from './data-layer-tracking.service';\nimport { DefaultPageViewDataProvider } from './page-view-data-provider';\nimport { PageViewTrackingService } from './page-view-tracking.service';\nimport { TrackingBootstrapService } from './tracking-bootstrap.service';\n\nexport function provide() {\n return [\n { provide: PAGE_VIEW_DATA_PROVIDER, useClass: DefaultPageViewDataProvider, multi: true },\n { provide: TRACKING_SERVICE_PROVIDER, useClass: DataLayerTrackingService },\n PageViewTrackingService,\n runOnFeatureInit(TrackingBootstrapService),\n ];\n}\n"],"names":["TrackingConfig","_a","LazyClientConfigBase","t","u","factory","r","trackingConfigFactory","ɵɵinject","LazyClientConfigService","__decorate","LazyClientConfig","key","product","ClientConfigProductName","SF","service","get","TrackingValueGettersService","constructor","trackingConfig","user","navigationService","urlService","windowRef","page","cookieService","deviceService","nativeAppService","frontendHelperService","balancePropertiesConfig","accountId","userBalance","__async","isAuthenticated","firstValueFrom","whenReady","balanceProperties","accountBalance","userCurrency","currency","userCountry","country","userGeoCountry","geoCountry","userLoyalty","loyalty","userCustomerId","customerId","userSegmentId","segmentId","userStage","lifeCycleStage","userPrestage","eWarningVip","userMicroSegmentId","microSegmentId","userChurnRate","churnRate","userFutureValue","futureValue","userPotentialVip","potentialVip","userAgent","nativeWindow","navigator","username","hasPositiveBalance","locationAbsUrl","removeNotTrackedQueryStrings","location","absUrl","locationHost","host","locationPathQueryAndFragment","removeLeadingSlashes","url","browserScreenResolution","width","height","windowRect","displayWidth","displayHeight","redirectedFrom","CookieName","RedirexOriginal","trackerID","TrackerId","trackingAffiliate","TrackingAffiliate","abTestGroup","MmcoreBwinvar","pageName","getPageName","pageReferrer","referrer","browserOrientation","currentOrientation","nativeMode","isTouch","cpuCores","cpuMaxFrequency","totalRam","model","nightMode","parseInt","DarkMode","userKnown","LastVisitor","internalCampaign","search","deviceId","DeviceId","lang","languageCode","culture","frontend","getFrontendDescription","medium","getMedium","domain","fullEntryUrl","entryUrl","entryUrlReferrer","EntryUrlReferrer","packageVersion","packageName","VERSIONS","setReferrer","setEntryUrl","parse","terminalId","TerminalId","shopId","ShopId","terminalType","applicationName","isTerminal","absolute","parsedUrl","notTrackedQueryString","notTrackedQueryStrings","delete","decodeURIComponent","langPrefix","path","lowerCasePath","toLowerCase","indexOf","result","substring","length","isTablet","isMobile","os","isNativeApp","isNativeWrapper","isiOS","isChrome","input","replace","UserService","NavigationService","UrlService","WindowRef","Page","CookieService","DeviceService","NativeAppService","FrontendHelperService","BalancePropertiesConfig","ɵfac","providedIn","_TrackingValueGettersService","eventNames","pageView","userLogout","DataLayerTrackingService","trackingValueGettersService","apiService","log","timerService","localStoreService","webWorkerService","createWorker","WorkerType","DataLayerTrackingInterval","interval","gtmLoaded","processLocalStore","removeWorker","gtmEnabled","tagManagerRenderers","includes","google_tag_manager","dataLayer","some","x","event","WindowEvent","VanillaGtmLoaded","GtmLoad","addInitialValues","updateDataLayerEntryInfo","updateUserValues","updateDataLayer","updateDataLayerSessionId","data","Promise","resolve","isObject","Array","isArray","schedulerEnabled","dataLayerUpdateTimeoutInMilliseconds","scheduleIdleCallback","dataLayerName","push","tracking","getDataFromStore","set","LocalStoreKey","Tracking","JSON","stringify","trackEvents","item","eventType","webAnalytics","parsedValue","WebAnalyticsEventType","load","triggerEvent","eventName","click","close","error","errorRemote","name","options","eventTimeout","timeout","eventCallbackTimeoutInMilliseconds","runWithTimeout","reject","Object","keys","__spreadValues","eventCallback","bind","TriggerEventPromiseResult","Normal","remove","reportErrorObject","reportError","errorDetail","encodeURIComponent","trackContentItemEvent","parameters","parameterName","getContentItemTracking","updateUserContactabilityStatus","subscribe","cts","settings","map","c","selected","join","trackingDataPrefix","mapKeys","pickBy","_","k","startsWith","trackingData","trackings","forEach","promise","timeoutId","Timeout","then","EntryUrl","v8","tech","build","label","entry","utms","source","campaign","content","keyword","hasOwnProperty","decibelInsight","_da_ready","SharedFeaturesApiService","Logger","TimerService","LocalStoreService","WebWorkerService","_DataLayerTrackingService","DefaultPageViewDataProvider","valueGetters","getData","context","navigationId","utm","__spreadProps","of","_DefaultPageViewDataProvider","PageView","dataSource","dataCallback","onData","fn","PageViewTrackingService","productInjector","trackingService","currentDataProviders","pageViewQueue","toNumberOrDefault","v","d","value","Number","isNaN","trackPageView","args","utm_source","undefined","providers","assign","getMultiple","PAGE_VIEW_DATA_PROVIDER","combineLatest","p","race","NEVER","pipe","pageViewDataProviderTimeout","catchError","first","processPageViewQueue","shift","ProductInjector","TrackingService","_PageViewTrackingService","DataLayerProxyService","inject","strategyProvider","RxStrategyProvider","requiredEvents","patched","patchDataLayer","isEnabled","enableLogging","enableOmitting","createDataLayerProxy","origDataLayer","idleWrapper","schedule","patchZone","strategy","trackingDelay","omitAll","blockDevice","deviceBlockEnabled","isLowTierDevice","isNextCallSuppressed","allowlist","Set","blocklist","window","measureTask","measureTaskDuration","Proxy","target","newValue","has","callback","work","logTrackingPerformance","deviceConcurrency","hardwareConcurrency","minDeviceConcurrency","minDeviceMemory","deviceMemory","benchmarkThreshold","benchmark","omitPercentage","Math","random","_DataLayerProxyService","start","performance","now","calculatePrimes","startTime","startMark","mark","endMark","measure","endTime","runtime","ceil","color","console","withArgs","eventQueueKey","PartytownService","injector","Injector","windowReference","router","Router","document","ptWorkerLocation","ptSharedStorage","createEventReplayQueue","replayEvents","origPush","addToQueue","apply","createSharedStorage","setStaticProps","createDimensionsEffect","subscribeToDynamicProps","getWindowOffsetUpdates","fromEvent","debounceTime","getVisibilityUpdates","Observable","observer","handler","next","hidden","addEventListener","VisibilityChange","removeEventListener","opener","characterSet","prerendering","loadPurpose","userLanguage","cookieEnabled","cookieDeprecationLabel","vendor","doNotTrack","maxTouchPoints","timeOrigin","timing","navigationStart","redirectStart","redirectEnd","fetchStart","domainLookupStart","domainLookupEnd","connectStart","secureConnectionStart","connectEnd","requestStart","responseStart","responseEnd","unloadEventStart","unloadEventEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd","effect","screenHeight","visualViewportHeight","screenWidth","visualViewportWidth","screen","colorDepth","locationChange","switchMap","merge","routerState","root","queryParamMap","startWith","snapshot","href","distinctUntilChanged","title","getCookieUpdates","cookie","pageYOffset","scrollY","getSnowplowCounterUpdates","i","_i","defineProperty","enumerable","configurable","_PartytownService","getEventsQueue","savedEventsItem","localStorage","getItem","e","eventsQueue","setItem","parsedArgs","removeItem","TagManagerService","dataLayerProxy","ngZone","partytownService","init","configured","clientTagManagers","excludes","clientInjectionExcludes","filter","current","injectScript","availableClientTagManagers","rendererName","type","tagManager","find","Error","existing","querySelector","id","script","createElement","async","text","onload","onerror","body","appendChild","loadPartyTownGTM","isDisabledLocally","partytown","_ptReady","runOutsideAngular","take","enableEventReplay","setTimeout","readyState","dispatchEvent","CustomEvent","catch","payload","NgZone","_TagManagerService","UtmService","parseFromUrl","queryParameters","utm_medium","utm_campaign","utm_term","utm_content","utm_keyword","_UtmService","storageKey","TrackingBootstrapService","pageViewTrackingService","tagManagerService","utmService","tagManagerCoreService","trackingServiceProvider","onFeatureInit","orientation","previousUrl","nextUrl","events","UserLoginEvent","TRACKING_SERVICE_PROVIDER","_TrackingBootstrapService","provide","useClass","multi","runOnFeatureInit"],"mappings":"6nBAYO,IAAMA,CAAc,CAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,IAAdA,CAANC,EAAAA,CAAAA,CAAA,cAA6BC,EAAoB,EAA3CF,CAAAA,CAAAA,CAAAA,SAAAA,CAAAA,CAAAA,IAAAA,CAAAA,IAAAA,CAAAA,CAAAA,OAAAA,SAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA,GAAAA,CAAAA,CAAAA,EAAAA,CAAAA,CAAc,CAAAG,CAAAA,EAAAA,CAAAA,EAAdH,CAAc,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,UAAA,CAAAI,CAAA,CAAA,CAAA,KAAA,CAAdJ,CAAcK,CAAAA,OAAAA,CAAA,SAAAF,CAAAA,CAAA,CAAA,IAAAG,CAAA,CAAA,IAAA,CAAA,OAAAH,CAAAA,CAAAA,CAAAA,CAAAA,IAAAA,CAAAA,CAAAA,CAAAA,CAFXI,EAAqBC,CAAAA,CAAAA,CAD1BC,EAAuB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CADlB,MAAM,CAAA,CAIfR,CAAAA,CAAAA,CAAAA,CAAMD,OAAAA,CAAAA,CAAcU,EAAA,CAAA,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