{ "version": 3, "sources": ["src/app/core/services/seo.service.ts"], "sourcesContent": ["import { Injectable } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { TranslateService } from '@ngx-translate/core';\nimport { take } from 'rxjs';\n\n@Injectable()\nexport class SeoService {\n constructor(\n private title: Title,\n private translateService: TranslateService\n ) {}\n\n public setSeoParams(seo: string | undefined): void {\n if (seo) {\n this.updateTitle(`SEO.TITLE.${seo}`);\n } else {\n this.setDefaultTitle();\n }\n }\n public setDefaultTitle(): void {\n this.updateTitle('SEO.TITLE.DEFAULT');\n }\n\n public updateTitle(titleLocale: string): void {\n if (titleLocale) {\n this.translateService\n .stream(titleLocale)\n .pipe(take(1))\n .subscribe((title) => {\n const updatedTitle = (newValue = ''): void => {\n this.title.setTitle(newValue);\n };\n if (title) {\n updatedTitle(title);\n }\n });\n }\n }\n}\n"], "mappings": "sEAMA,IAAaA,GAAU,IAAA,CAAjB,IAAOA,EAAP,MAAOA,CAAU,CACrBC,YACUC,EACAC,EAAkC,CADlC,KAAAD,MAAAA,EACA,KAAAC,iBAAAA,CACP,CAEIC,aAAaC,EAAuB,CACrCA,EACF,KAAKC,YAAY,aAAaD,OAAAA,EAAK,EAEnC,KAAKE,gBAAe,CAExB,CACOA,iBAAe,CACpB,KAAKD,YAAY,mBAAmB,CACtC,CAEOA,YAAYE,EAAmB,CAChCA,GACF,KAAKL,iBACFM,OAAOD,CAAW,EAClBE,KAAKC,EAAK,CAAC,CAAC,EACZC,UAAWV,GAAS,CAIfA,IAHiBW,CAACC,EAAW,KAAY,CAC3C,KAAKZ,MAAMa,SAASD,CAAQ,CAC9B,GAEeZ,CAAK,CAEtB,CAAC,CAEP,yCA/BWF,GAAUgB,EAAAC,CAAA,EAAAD,EAAAE,CAAA,CAAA,CAAA,wBAAVlB,EAAUmB,QAAVnB,EAAUoB,SAAA,CAAA,EAAjB,IAAOpB,EAAPqB,SAAOrB,CAAU,GAAA", "names": ["SeoService", "constructor", "title", "translateService", "setSeoParams", "seo", "updateTitle", "setDefaultTitle", "titleLocale", "stream", "pipe", "take", "subscribe", "updatedTitle", "newValue", "setTitle", "\u0275\u0275inject", "Title", "TranslateService", "factory", "\u0275fac", "_SeoService"] }