{"version":3,"file":"angulartics2-hubspot.js","sources":["ng://angulartics2/hubspot/hubspot.ts","ng://angulartics2/hubspot/angulartics2-hubspot.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { Angulartics2 } from 'angulartics2';\n\ndeclare var _hsq: any;\n\n@Injectable({ providedIn: 'root' })\nexport class Angulartics2Hubspot {\n\n constructor(\n private angulartics2: Angulartics2\n ) {\n this.angulartics2.setUserProperties\n .subscribe((x) => this.setUserProperties(x));\n }\n\n startTracking(): void {\n this.angulartics2.pageTrack\n .pipe(this.angulartics2.filterDeveloperMode())\n .subscribe((x) => this.pageTrack(x.path));\n this.angulartics2.eventTrack\n .pipe(this.angulartics2.filterDeveloperMode())\n .subscribe((x) => this.eventTrack(x.action, x.properties));\n }\n\n pageTrack(path: string) {\n if (typeof _hsq !== 'undefined') {\n _hsq.push(['setPath', path]);\n _hsq.push(['trackPageView']);\n }\n }\n\n eventTrack(action: string, properties: any) {\n if (typeof _hsq !== 'undefined') {\n _hsq.push(['trackEvent', properties]);\n }\n }\n\n setUserProperties(properties: any) {\n if (typeof _hsq !== 'undefined') {\n _hsq.push(['identify', properties]);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './hubspot';\n"],"names":[],"mappings":";;;;;IASE,6BACU,YAA0B;QADpC,iBAKC;QAJS,iBAAY,GAAZ,YAAY,CAAc;QAElC,IAAI,CAAC,YAAY,CAAC,iBAAiB;aAChC,SAAS,CAAC,UAAC,CAAC,IAAK,OAAA,KAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC;KAChD;IAED,2CAAa,GAAb;QAAA,iBAOC;QANC,IAAI,CAAC,YAAY,CAAC,SAAS;aACxB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;aAC7C,SAAS,CAAC,UAAC,CAAC,IAAK,OAAA,KAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAA,CAAC,CA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