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/JR,SAASa,EAAgCnD,EAAUkD,GAK3ClD,EAAS+B,IAiDjB,SAASqB,IAGL,cAGQC,UAAc,OAAiBA,kBAG3BC,QAAY,OAAiBA,gBAG7BC,KAAS,OAAiBA,aAG1BC,MAAU,OAAiBA,cAK3BC,QAAY,KAC4B,qBAA5CT,OAAOxB,UAAUkC,SAAS9C,KAAK6C,QAC3C,CAvEuCL,KAGnCpB,EAAkB,OAAM2B,KAAKC,QAAQC,WAChCxG,QAAKyG,KAAS,KACf,IAAIC,EACJ,IAGIA,KAAWC,OAAahE,EAC5B,OAEI+D,EAAW,IACf,CACA,MAAME,EAAQF,GAAUE,MACxB,GAAa,MAATA,EACA,OAAOC,IAEX,MAAMC,EAAWF,EAAMnC,KAAamC,EAAMnC,GAAW,IAC/CsC,EAA0B,IAAIlE,IAEpCiE,SAASE,KAAK,WAIVrC,EAAkB,KACdoC,EAAwBhE,OACxBgE,EAAwB/D,UAAS,EAEzC,GACO+D,KACV,EAKDN,KAAS,IAAMF,QAAQC,YAClBtG,UAAU,MAKM2F,EAASoB,UAAepB,EAASqB,UAAapJ,OAAS,IAEpEqJ,QAAQC,KAsCpB,SAASC,EAAc1E,GACnB,MAAQ,WACJA,EAASrE,YAAYiH,kyCAqC7B,CA7EyB8B,CAAc1E,GAAS,IAG5CA,EAAS+B,IAAqB,EAClC,CA0GuBoB,CAAgCnD,EAAUkD,GAClDV,EAAOnF,QAAKsH,KAAUzB,GAAS,CAE9C","names":["MetricBaseAbstract","ngOnInit","this","codes","length","onRunMetric","static","t","core","lG2","inputs","GaMetricComponent","constructor","metrica","super","runGA","i0","i1","Xpm","selectors","standalone","features","decls","vars","template","rf","ctx","encapsulation","GtagMetricComponent","runGTM","YaMetricComponent","router","runYAM","hitYandex","window","location","href","events","pipe","untilDestroyed","subscribe","event","NavigationEnd","i2","__decorate","UntilDestroy","metricCodes_r2","yam","ga","gtag","MetricFooterComponent_ng_container_0_ng_container_1_app_ya_metric_1_Template","MetricFooterComponent_ng_container_0_ng_container_1_app_ga_metric_2_Template","MetricFooterComponent_ng_container_0_ng_container_1_app_gtag_metric_3_Template","MetricFooterComponent_ng_container_0_ng_container_1_Template","ctx_r0","metricCodes$","MetricFooterComponent","configRepository","environmentType","environment","type","environmentTypes","EnvironmentTypes","currentEnvironment","combineLatest","yandexAnalyticsCodes$","googleAnalyticsCodes$","googleTagManagerCodes$","consts","MetricFooterComponent_ng_container_0_Template","prod","NgIf","AsyncPipe","NG_PIPE_DEF","ɵNG_PIPE_DEF","DESTROY","Symbol","DECORATOR_APPLIED","getSymbol","destroyMethodName","createSubjectOnTheInstance","instance","symbol","Subject","completeSubjectOnTheInstance","next","complete","unsubscribe","property","Subscription","decorateNgOnDestroy","ngOnDestroy","options","call","arrayName","unsubscribeIfPropertyIsArrayLike","Array","isArray","forEach","checkProperties","blackList","includes","isPipe","target","decorateProviderDirectiveOrComponent","prototype","decoratePipe","def","ɵpipe","onDestroy","markAsDecorated","CLEANUP","CheckerHasBeenSet","runOutsideAngular","fn","Zone","ɵglobal","root","run","NG_DEV_MODE","ngDevMode","source","overrideNonDirectiveInstanceMethod","originalDestroy","Error","name","apply","arguments","ensureClassIsDecorated","Object","getPrototypeOf","destroy$","setupSubjectUnsubscribedChecker","isAngularInTestMode","__karma__","jasmine","jest","Mocha","process","toString","from","Promise","resolve","mergeMap","lContext","ɵgetLContext","lView","EMPTY","lCleanup","cleanupHasBeenExecuted$","push","observed","observers","console","warn","createMessage","takeUntil"],"sourceRoot":"webpack:///","sources":["./src/app/shared/components/metric/metric-base.abstract.ts","./src/app/shared/components/metric/ga-metric/ga-metric.component.ts","./src/app/shared/components/metric/gtag-metric/gtag-metric.component.ts","./src/app/shared/components/metric/ya-metric/ya-metric.component.ts","./src/app/components/metric-footer/metric-footer.component.html","./src/app/components/metric-footer/metric-footer.component.ts","./node_modules/@ngneat/until-destroy/fesm2020/ngneat-until-destroy.mjs"],"sourcesContent":["import { Directive, Input, OnInit } from '@angular/core';\n\n@Directive()\nexport abstract class MetricBaseAbstract implements OnInit {\n @Input() codes: string[] | undefined | null;\n\n protected abstract onRunMetric(codes: string[]): void;\n\n ngOnInit(): void {\n if(this.codes && !!this.codes.length) {\n this.onRunMetric(this.codes);\n }\n }\n}\n","import { Component } from '@angular/core';\n\nimport { MetricService } from '../metric.service';\nimport { MetricBaseAbstract } from '../metric-base.abstract';\n\n@Component({\n selector: 'app-ga-metric',\n templateUrl: './ga-metric.component.html',\n standalone: true\n})\nexport class GaMetricComponent extends MetricBaseAbstract {\n constructor(\n private metrica: MetricService\n ) {super()}\n\n protected override onRunMetric(codes: string[]): void {\n this.metrica.runGA(codes);\n }\n}\n","import { Component } from '@angular/core';\n\nimport { MetricService } from '../metric.service';\nimport { MetricBaseAbstract } from '../metric-base.abstract';\n\n@Component({\n selector: 'app-gtag-metric',\n templateUrl: './gtag-metric.component.html',\n standalone: true\n})\nexport class GtagMetricComponent extends MetricBaseAbstract {\n constructor(\n private metrica: MetricService\n ) {super()}\n\n protected override onRunMetric(codes: string[]): void {\n this.metrica.runGTM(codes);\n }\n}\n","import { Component } from '@angular/core';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\n\nimport { MetricService } from '../metric.service';\nimport { MetricBaseAbstract } from '../metric-base.abstract';\n\n@UntilDestroy()\n@Component({\n selector: 'app-ya-metric',\n templateUrl: './ya-metric.component.html',\n standalone: true\n})\nexport class YaMetricComponent extends MetricBaseAbstract {\n constructor(\n private metrica: MetricService,\n private router: Router\n ) {super()}\n\n protected override onRunMetric(codes: string[]): void {\n this.metrica.runYAM(codes);\n this.metrica.hitYandex(window.location.href);\n\n this.router.events.pipe(untilDestroyed(this)).subscribe(event => {\n if (event instanceof NavigationEnd) {\n this.metrica.hitYandex(window.location.href)\n }\n });\n }\n}\n","\n \n \n \n \n \n\n","import { AsyncPipe,NgIf } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { combineLatest, Observable } from 'rxjs';\n\nimport { environment } from '../../../environments/environment';\nimport { EnvironmentTypes } from '../../../environments/environment-types';\nimport { GaMetricComponent } from '../../shared/components/metric/ga-metric/ga-metric.component';\nimport { GtagMetricComponent } from '../../shared/components/metric/gtag-metric/gtag-metric.component';\nimport { YaMetricComponent } from '../../shared/components/metric/ya-metric/ya-metric.component';\nimport { ConfigRepository } from '../../shared/repositories/config.repository';\n\ninterface MetricCodes {\n yam: string[] | undefined | null\n ga: string[] | undefined | null\n gtag: string[] | undefined | null\n}\n\n@Component({\n selector: 'app-metric-footer',\n templateUrl: './metric-footer.component.html',\n standalone: true,\n imports: [NgIf, YaMetricComponent, GaMetricComponent, GtagMetricComponent, AsyncPipe]\n})\nexport class MetricFooterComponent {\n constructor(\n private configRepository: ConfigRepository,\n ) { }\n\n environmentType = environment.type;\n environmentTypes = EnvironmentTypes;\n\n currentEnvironment: EnvironmentTypes = environment.type;\n\n metricCodes$: Observable = combineLatest({\n yam: this.configRepository.yandexAnalyticsCodes$,\n ga: this.configRepository.googleAnalyticsCodes$,\n gtag: this.configRepository.googleTagManagerCodes$,\n });\n}\n","import { Subject, Subscription, from, EMPTY } from 'rxjs';\nimport { ɵNG_PIPE_DEF, ɵgetLContext, ɵglobal } from '@angular/core';\nimport { mergeMap, takeUntil } from 'rxjs/operators';\n\nconst NG_PIPE_DEF = ɵNG_PIPE_DEF;\nfunction isPipe(target) {\n return !!target[NG_PIPE_DEF];\n}\n\n/**\n * Applied to instances and stores `Subject` instance when\n * no custom destroy method is provided.\n */\nconst DESTROY = Symbol('__destroy');\n/**\n * Applied to definitions and informs that class is decorated\n */\nconst DECORATOR_APPLIED = Symbol('__decoratorApplied');\n/**\n * If we use the `untilDestroyed` operator multiple times inside the single\n * instance providing different `destroyMethodName`, then all streams will\n * subscribe to the single subject. If any method is invoked, the subject will\n * emit and all streams will be unsubscribed. We wan't to prevent this behavior,\n * thus we store subjects under different symbols.\n */\nfunction getSymbol(destroyMethodName) {\n if (typeof destroyMethodName === 'string') {\n return Symbol(`__destroy__${destroyMethodName}`);\n }\n else {\n return DESTROY;\n }\n}\nfunction markAsDecorated(type) {\n // Store this property on the prototype if it's an injectable class, component or directive.\n // We will be able to handle class extension this way.\n type.prototype[DECORATOR_APPLIED] = true;\n}\nfunction createSubjectOnTheInstance(instance, symbol) {\n if (!instance[symbol]) {\n instance[symbol] = new Subject();\n }\n}\nfunction completeSubjectOnTheInstance(instance, symbol) {\n if (instance[symbol]) {\n instance[symbol].next();\n instance[symbol].complete();\n // We also have to re-assign this property thus in the future\n // we will be able to create new subject on the same instance.\n instance[symbol] = null;\n }\n}\n\nfunction unsubscribe(property) {\n if (property instanceof Subscription) {\n property.unsubscribe();\n }\n}\nfunction unsubscribeIfPropertyIsArrayLike(property) {\n Array.isArray(property) && property.forEach(unsubscribe);\n}\nfunction decorateNgOnDestroy(ngOnDestroy, options) {\n return function () {\n // Invoke the original `ngOnDestroy` if it exists\n ngOnDestroy && ngOnDestroy.call(this);\n // It's important to use `this` instead of caching instance\n // that may lead to memory leaks\n completeSubjectOnTheInstance(this, getSymbol());\n // Check if subscriptions are pushed to some array\n if (options.arrayName) {\n unsubscribeIfPropertyIsArrayLike(this[options.arrayName]);\n }\n // Loop through the properties and find subscriptions\n if (options.checkProperties) {\n for (const property in this) {\n if (options.blackList?.includes(property)) {\n continue;\n }\n unsubscribe(this[property]);\n }\n }\n };\n}\nfunction decorateProviderDirectiveOrComponent(type, options) {\n type.prototype.ngOnDestroy = decorateNgOnDestroy(type.prototype.ngOnDestroy, options);\n}\nfunction decoratePipe(type, options) {\n const def = type.ɵpipe;\n def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);\n}\nfunction UntilDestroy(options = {}) {\n return (type) => {\n if (isPipe(type)) {\n decoratePipe(type, options);\n }\n else {\n decorateProviderDirectiveOrComponent(type, options);\n }\n markAsDecorated(type);\n };\n}\n\n// `LView` is an array where each index matches the specific data structure.\n// The 7th element in an `LView` is an array of cleanup listeners. They are\n// invoked when the view is removed (similar to `ComponentRef.onDestroy`).\nconst CLEANUP = 7;\nconst CheckerHasBeenSet = Symbol('CheckerHasBeenSet');\nfunction setupSubjectUnsubscribedChecker(instance, destroy$) {\n // This function is used within the `untilDestroyed` operator and setups a function that\n // listens for the view removal and checks if the `destroy$` subject has any observers (usually `takeUntil`).\n // Note: this code will not be shipped into production since it's guarded with `ngDevMode`,\n // this means it'll exist only in development mode.\n if (instance[CheckerHasBeenSet] || isAngularInTestMode()) {\n return;\n }\n runOutsideAngular(() => from(Promise.resolve())\n .pipe(mergeMap(() => {\n let lContext;\n try {\n // The `ɵgetLContext` might not work for a pipe, because it's not a component nor a directive,\n // which means there's no `RNode` for an instance.\n lContext = ɵgetLContext(instance);\n }\n catch {\n lContext = null;\n }\n const lView = lContext?.lView;\n if (lView == null) {\n return EMPTY;\n }\n const lCleanup = lView[CLEANUP] || (lView[CLEANUP] = []);\n const cleanupHasBeenExecuted$ = new Subject();\n // Note: this function is named for debugging purposes.\n lCleanup.push(function untilDestroyedLCleanup() {\n // We leave the Angular zone, so RxJS will also call subsequent `next` functions\n // outside of the Angular zone, which is done to avoid scheduling a microtask (through\n // `asapScheduler`) within the Angular zone.\n runOutsideAngular(() => {\n cleanupHasBeenExecuted$.next();\n cleanupHasBeenExecuted$.complete();\n });\n });\n return cleanupHasBeenExecuted$;\n }), \n // We can't use `observeOn(asapScheduler)` because this might break the app's change detection.\n // RxJS schedulers coalesce tasks and then flush the queue, which means our task might be scheduled\n // within the root zone, and then all of the tasks (that were set up by developers in the Angular zone)\n // will also be flushed in the root zone.\n mergeMap(() => Promise.resolve()))\n .subscribe(() => {\n // Note: The `observed` property is available only in RxJS@7.2.0, which will throw\n // an error in lower versions. We have integration test with RxJS@6 to ensure we don't\n // import operators from `rxjs`; that's why it's wrapped into braces. The `observers`\n // property is also being deprecated.\n const observed = destroy$['observed'] ?? destroy$['observers'].length > 0;\n if (observed) {\n console.warn(createMessage(instance));\n }\n }));\n instance[CheckerHasBeenSet] = true;\n}\nfunction isAngularInTestMode() {\n // Gets whether the code is currently running in a test environment.\n // We don't use `declare const` because it might cause conflicts with the real typings.\n return (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (typeof __karma__ !== 'undefined' && !!__karma__) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (typeof jasmine !== 'undefined' && !!jasmine) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (typeof jest !== 'undefined' && !!jest) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (typeof Mocha !== 'undefined' && !!Mocha) ||\n // Jest is not defined in ESM mode since it must be access only by importing from `@jest/globals`.\n // There's no way to check if we're in Jest ESM mode or not, but we can check if the `process` is defined.\n // Note: it's required to check for `[object process]` because someone might be running unit tests with\n // Webpack and shimming `process`.\n (typeof process !== 'undefined' &&\n Object.prototype.toString.call(process) === '[object process]'));\n}\nfunction runOutsideAngular(fn) {\n // We cannot inject the `NgZone` class when running the checker. The `__ngContext__` is read\n // for the first time within a microtask which triggers change detection; we want to avoid that.\n // The `Zone` is always available globally when the `zone.js` is imported. Otherwise, it may be\n // nooped through bootstrap options. The `NgZone.runOutsideAngular` calls `Zone.root.run`, so we're\n // safe calling that function directly.\n const Zone = ɵglobal.Zone;\n const isNgZoneEnabled = !!Zone && typeof Zone.root?.run === 'function';\n return isNgZoneEnabled ? Zone.root.run(fn) : fn();\n}\nfunction createMessage(instance) {\n return `\n The ${instance.constructor.name} still has subscriptions that haven't been unsubscribed.\n This may happen if the class extends another class decorated with @UntilDestroy().\n The child class implements its own ngOnDestroy() method but doesn't call super.ngOnDestroy().\n Let's look at the following example:\n @UntilDestroy()\n @Directive()\n export abstract class BaseDirective {}\n @Component({ template: '' })\n export class ConcreteComponent extends BaseDirective implements OnDestroy {\n constructor() {\n super();\n someObservable$.pipe(untilDestroyed(this)).subscribe();\n }\n ngOnDestroy(): void {\n // Some logic here...\n }\n }\n The BaseDirective.ngOnDestroy() will not be called since Angular will call ngOnDestroy()\n on the ConcreteComponent, but not on the BaseDirective.\n One of the solutions is to declare an empty ngOnDestroy method on the BaseDirective:\n @UntilDestroy()\n @Directive()\n export abstract class BaseDirective {\n ngOnDestroy(): void {}\n }\n @Component({ template: '' })\n export class ConcreteComponent extends BaseDirective implements OnDestroy {\n constructor() {\n super();\n someObservable$.pipe(untilDestroyed(this)).subscribe();\n }\n ngOnDestroy(): void {\n // Some logic here...\n super.ngOnDestroy();\n }\n }\n `;\n}\n\nconst NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;\nfunction overrideNonDirectiveInstanceMethod(instance, destroyMethodName, symbol) {\n const originalDestroy = instance[destroyMethodName];\n if (NG_DEV_MODE && typeof originalDestroy !== 'function') {\n throw new Error(`${instance.constructor.name} is using untilDestroyed but doesn't implement ${destroyMethodName}`);\n }\n createSubjectOnTheInstance(instance, symbol);\n instance[destroyMethodName] = function () {\n // eslint-disable-next-line prefer-rest-params\n originalDestroy.apply(this, arguments);\n completeSubjectOnTheInstance(this, symbol);\n // We have to re-assign this property back to the original value.\n // If the `untilDestroyed` operator is called for the same instance\n // multiple times, then we will be able to get the original\n // method again and not the patched one.\n instance[destroyMethodName] = originalDestroy;\n };\n}\nfunction untilDestroyed(instance, destroyMethodName) {\n return (source) => {\n const symbol = getSymbol(destroyMethodName);\n // If `destroyMethodName` is passed then the developer applies\n // this operator to something non-related to Angular DI system\n if (typeof destroyMethodName === 'string') {\n overrideNonDirectiveInstanceMethod(instance, destroyMethodName, symbol);\n }\n else {\n NG_DEV_MODE && ensureClassIsDecorated(instance);\n createSubjectOnTheInstance(instance, symbol);\n }\n const destroy$ = instance[symbol];\n NG_DEV_MODE && setupSubjectUnsubscribedChecker(instance, destroy$);\n return source.pipe(takeUntil(destroy$));\n };\n}\nfunction ensureClassIsDecorated(instance) {\n const prototype = Object.getPrototypeOf(instance);\n const missingDecorator = !(DECORATOR_APPLIED in prototype);\n if (missingDecorator) {\n throw new Error('untilDestroyed operator cannot be used inside directives or ' +\n 'components or providers that are not decorated with UntilDestroy decorator');\n }\n}\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { UntilDestroy, untilDestroyed };\n"],"x_google_ignoreList":[6]}