intelica-library-components 1.1.102 → 1.1.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Injectable, signal, Pipe, Component, TemplateRef, ContentChild, Input, Directive, EventEmitter, ContentChildren, Output, HostListener, forwardRef, ViewChild, PLATFORM_ID, Inject, DestroyRef, output, input, effect, Optional, Host, InjectionToken } from '@angular/core';
2
+ import { Injectable, inject, signal, Pipe, Component, TemplateRef, ContentChild, Input, Directive, EventEmitter, ContentChildren, Output, HostListener, forwardRef, ViewChild, PLATFORM_ID, Inject, DestroyRef, output, input, effect, Optional, Host, InjectionToken } from '@angular/core';
3
3
  import { getCookie, setCookie, Cookies } from 'typescript-cookie';
4
4
  import * as i1$4 from '@angular/common/http';
5
5
  import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
@@ -71,8 +71,27 @@ function GetCookieAttributes(environment) {
71
71
  return { domain: domain, path: "/", secure: secure };
72
72
  }
73
73
 
74
+ class GoogleTaskManagerService {
75
+ loadGTM(id) {
76
+ const w = window;
77
+ w["dataLayer"] = w["dataLayer"] || [];
78
+ w["dataLayer"].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
79
+ const script = document.createElement("script");
80
+ script.async = true;
81
+ script.src = `https://www.googletagmanager.com/gtm.js?id=${id}`;
82
+ document.head.insertBefore(script, document.head.firstChild);
83
+ }
84
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GoogleTaskManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
85
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GoogleTaskManagerService, providedIn: "root" });
86
+ }
87
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GoogleTaskManagerService, decorators: [{
88
+ type: Injectable,
89
+ args: [{ providedIn: "root" }]
90
+ }] });
91
+
74
92
  class ConfigService {
75
93
  Http = inject(HttpClient);
94
+ googleTaskManagerService = inject(GoogleTaskManagerService);
76
95
  environment;
77
96
  SessionInformation = null;
78
97
  userDataSubject = new BehaviorSubject("");
@@ -82,6 +101,8 @@ class ConfigService {
82
101
  if (getCookie("data") != undefined)
83
102
  this.SessionInformation = JSON.parse(getCookie("data") ?? "");
84
103
  this.environment = await this.Http.get(environment).toPromise();
104
+ if (this.environment?.environment === "development" && this.environment?.gtmId)
105
+ this.googleTaskManagerService.loadGTM(this.environment.gtmId);
85
106
  }
86
107
  SetSessionInformation() {
87
108
  this.SessionInformation = JSON.parse(getCookie("data") ?? "");
@@ -8466,24 +8487,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
8466
8487
  args: [{ providedIn: "root" }]
8467
8488
  }] });
8468
8489
 
8469
- class GoogleTaskManagerService {
8470
- loadGTM(id) {
8471
- const w = window;
8472
- w["dataLayer"] = w["dataLayer"] || [];
8473
- w["dataLayer"].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
8474
- const script = document.createElement("script");
8475
- script.async = true;
8476
- script.src = `https://www.googletagmanager.com/gtm.js?id=${id}`;
8477
- document.head.insertBefore(script, document.head.firstChild);
8478
- }
8479
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GoogleTaskManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
8480
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GoogleTaskManagerService, providedIn: "root" });
8481
- }
8482
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GoogleTaskManagerService, decorators: [{
8483
- type: Injectable,
8484
- args: [{ providedIn: "root" }]
8485
- }] });
8486
-
8487
8490
  /**
8488
8491
  * Función de comparación genérica para ordenar objetos por un campo específico.
8489
8492
  *