ng-easycommerce-v18 0.3.18-beta.3 → 0.3.18-beta.4

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.
@@ -466,7 +466,7 @@ class CoreConstantsService {
466
466
  */
467
467
  window;
468
468
  constructor() {
469
- if (isPlatformBrowser(this.platformId)) {
469
+ if (isPlatformBrowser(this.platformId) && typeof window !== 'undefined') {
470
470
  this.window = window;
471
471
  }
472
472
  }
@@ -505,7 +505,7 @@ class CoreConstantsService {
505
505
  */
506
506
  get FRONTEND_URL() {
507
507
  // Verificar si estamos en el navegador
508
- if (isPlatformBrowser(this.platformId)) {
508
+ if (isPlatformBrowser(this.platformId) && typeof window !== 'undefined') {
509
509
  // Primero intenta leer de window.__env (configurado por Docker/CI)
510
510
  const windowEnv = this.window?.__env;
511
511
  if (windowEnv?.frontendUrl) {
@@ -526,7 +526,7 @@ class CoreConstantsService {
526
526
  }
527
527
  }
528
528
  // Para SSR, intentar construir desde el document si está disponible
529
- if (this.document?.location) {
529
+ if (typeof document !== 'undefined' && this.document?.location) {
530
530
  return `${this.document.location.protocol}//${this.document.location.host}`;
531
531
  }
532
532
  // Intentar obtener desde environment
@@ -606,7 +606,7 @@ class CoreConstantsService {
606
606
  * Retorna `true` si la vista es mobile, `false` caso contrario.
607
607
  * @returns {boolean}
608
608
  */
609
- mobileScreen = () => this.window && this.window?.innerWidth < 750 || false;
609
+ mobileScreen = () => isPlatformBrowser(this.platformId) && typeof window !== 'undefined' && this.window && this.window?.innerWidth < 750 || false;
610
610
  /**
611
611
  * Contiene los valores para la moneda actual
612
612
  */
@@ -1459,7 +1459,7 @@ class GoogleAnalyticsService {
1459
1459
  * @param gtm_id id provisto por Google Tag Manager.
1460
1460
  */
1461
1461
  initialize(gtm_id) {
1462
- if (typeof document !== 'undefined' && !document.getElementById('google_tag_manager')) {
1462
+ if (isPlatformBrowser(this.platformId) && this.document && !this.document.getElementById('google_tag_manager')) {
1463
1463
  console.log('hay elemento');
1464
1464
  const declaration = this.renderer.createElement('script');
1465
1465
  declaration.async = true;
@@ -1467,8 +1467,8 @@ class GoogleAnalyticsService {
1467
1467
  declaration.src = `https://www.googletagmanager.com/gtag/js?id=${gtm_id}`;
1468
1468
  const initialization = this.renderer.createElement('script');
1469
1469
  initialization.text = `window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '${gtm_id}')`;
1470
- this.renderer.appendChild(this.document?.head, initialization);
1471
- this.renderer.appendChild(this.document?.head, declaration);
1470
+ this.renderer.appendChild(this.document.head, initialization);
1471
+ this.renderer.appendChild(this.document.head, declaration);
1472
1472
  this.enabled = true;
1473
1473
  }
1474
1474
  setTimeout(() => this.startListeningPageViews(gtm_id), 1000);
@@ -1728,6 +1728,7 @@ class GTMService {
1728
1728
  window;
1729
1729
  rendererFactory = inject(RendererFactory2);
1730
1730
  document = null;
1731
+ platformId = inject(PLATFORM_ID);
1731
1732
  /**
1732
1733
  * Servicio de ruteo de angular.
1733
1734
  */
@@ -1736,7 +1737,7 @@ class GTMService {
1736
1737
  * Configuración de Google Tag Manager.
1737
1738
  */
1738
1739
  config = { id: null };
1739
- platformId = inject(PLATFORM_ID);
1740
+ // private platformId: any = inject(PLATFORM_ID) // Eliminada duplicidad, ya está declarada arriba
1740
1741
  constructor() {
1741
1742
  this.renderer = this.rendererFactory.createRenderer(null, null);
1742
1743
  if (isPlatformBrowser(this.platformId)) {
@@ -1769,12 +1770,15 @@ class GTMService {
1769
1770
  */
1770
1771
  addGtmToDom() {
1771
1772
  return new Promise((resolve, reject) => {
1773
+ if (!isPlatformBrowser(this.platformId) || !this.document) {
1774
+ // No manipular el DOM en SSR
1775
+ return resolve(false);
1776
+ }
1772
1777
  if (this.isLoaded) {
1773
1778
  return resolve(this.isLoaded);
1774
1779
  }
1775
- //const doc = this.browserGlobals.documentRef();
1776
1780
  this.pushOnDataLayer({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
1777
- const gtmScript = this.document?.createElement('script'); //doc.createElement('script');
1781
+ const gtmScript = this.document.createElement('script');
1778
1782
  if (gtmScript) {
1779
1783
  gtmScript.id = 'GTMscript';
1780
1784
  gtmScript.async = true;
@@ -1785,7 +1789,7 @@ class GTMService {
1785
1789
  gtmScript.addEventListener('error', () => {
1786
1790
  return reject(false);
1787
1791
  });
1788
- this.document?.head.insertBefore(gtmScript, this.document.head.firstChild);
1792
+ this.document.head.insertBefore(gtmScript, this.document.head.firstChild);
1789
1793
  }
1790
1794
  });
1791
1795
  }
@@ -1802,7 +1806,7 @@ class GTMService {
1802
1806
  initialize(config) {
1803
1807
  this.config = config || this.config;
1804
1808
  this.addGtmToDom().then(() => {
1805
- this.router.events.forEach(item => {
1809
+ this.router.events.forEach((item) => {
1806
1810
  if (item instanceof NavigationEnd) {
1807
1811
  const gtmTag = {
1808
1812
  event: 'page',
@@ -2176,9 +2180,6 @@ class MetricoolPixelService {
2176
2180
  */
2177
2181
  renderer;
2178
2182
  constructor() {
2179
- if (isPlatformBrowser(this.platformId)) {
2180
- this.document = document;
2181
- }
2182
2183
  this.renderer = this.rendererFactory.createRenderer(null, null);
2183
2184
  }
2184
2185
  /**
@@ -2186,20 +2187,22 @@ class MetricoolPixelService {
2186
2187
  * @param pixel_hash hash provisto por Metricool Pixel.
2187
2188
  */
2188
2189
  initialize = (pixel_hash) => {
2189
- let new_analityc_script = this.renderer.createElement('script');
2190
- new_analityc_script.type = 'text/javascript';
2191
- new_analityc_script.text = `
2192
- function loadScript(a) {
2193
- var b = document.getElementsByTagName("head")[0], c = document.createElement("script");
2194
- c.type = "text/javascript",
2195
- c.src = "https://tracker.metricool.com/resources/be.js",
2196
- c.onreadystatechange = a,
2197
- c.onload = a, b.appendChild(c)
2198
- } loadScript(function () {
2199
- beTracker.t({ hash: "${pixel_hash}" })
2200
- });
2201
- `;
2202
- this.renderer.appendChild(this.document?.body, new_analityc_script);
2190
+ if (isPlatformBrowser(this.platformId) && this.document) {
2191
+ let new_analityc_script = this.renderer.createElement('script');
2192
+ new_analityc_script.type = 'text/javascript';
2193
+ new_analityc_script.text = `
2194
+ function loadScript(a) {
2195
+ var b = document.getElementsByTagName("head")[0], c = document.createElement("script");
2196
+ c.type = "text/javascript",
2197
+ c.src = "https://tracker.metricool.com/resources/be.js",
2198
+ c.onreadystatechange = a,
2199
+ c.onload = a, b.appendChild(c)
2200
+ } loadScript(function () {
2201
+ beTracker.t({ hash: "${pixel_hash}" })
2202
+ });
2203
+ `;
2204
+ this.renderer.appendChild(this.document.body, new_analityc_script);
2205
+ }
2203
2206
  };
2204
2207
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MetricoolPixelService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2205
2208
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MetricoolPixelService, providedIn: 'root' });
@@ -6612,7 +6615,7 @@ class HeaderEcComponent extends MenuEcComponent {
6612
6615
  }
6613
6616
  }
6614
6617
  isHomeFunction() {
6615
- if (isPlatformBrowser(this.platformId)) {
6618
+ if (isPlatformBrowser(this.platformId) && typeof document !== 'undefined') {
6616
6619
  const headerElement = document.querySelector('header');
6617
6620
  if (headerElement) {
6618
6621
  if (this.router.url !== '/home') {
@@ -6644,7 +6647,7 @@ class HeaderEcComponent extends MenuEcComponent {
6644
6647
  }
6645
6648
  };
6646
6649
  borrarInput(inputId) {
6647
- if (isPlatformBrowser(this.platformId)) {
6650
+ if (isPlatformBrowser(this.platformId) && typeof document !== 'undefined') {
6648
6651
  if (inputId) {
6649
6652
  const input = document.getElementById(inputId);
6650
6653
  if (input) {
@@ -6666,7 +6669,7 @@ class HeaderEcComponent extends MenuEcComponent {
6666
6669
  this.getCollectionSearch();
6667
6670
  }
6668
6671
  setupMobileMenu() {
6669
- if (!isPlatformBrowser(this.platformId))
6672
+ if (!isPlatformBrowser(this.platformId) || typeof document === 'undefined')
6670
6673
  return;
6671
6674
  // console.log('setupMobileMenu called');
6672
6675
  const menuMobile = document.querySelector('.menuMobile');
@@ -6703,7 +6706,7 @@ class HeaderEcComponent extends MenuEcComponent {
6703
6706
  });
6704
6707
  }
6705
6708
  setupSearchInputs() {
6706
- if (!isPlatformBrowser(this.platformId))
6709
+ if (!isPlatformBrowser(this.platformId) || typeof document === 'undefined')
6707
6710
  return;
6708
6711
  const inputs = ['searchInput1', 'searchInput2'];
6709
6712
  inputs.forEach(id => {
@@ -7579,26 +7582,12 @@ class BlockProductsEcComponent extends BlockEcComponent {
7579
7582
  * Esta función puede ser movida al componente base para reutilización.
7580
7583
  */
7581
7584
  initializeSwiperWithCustomNavigation() {
7582
- if (!isPlatformBrowser(this.platformId))
7585
+ if (!isPlatformBrowser(this.platformId) || typeof document === 'undefined')
7583
7586
  return;
7584
7587
  const prevButton = document.getElementById(`${this.meta?.code}-prev`);
7585
7588
  const nextButton = document.getElementById(`${this.meta?.code}-next`);
7586
7589
  const swiperElement = document.getElementById(this.meta?.code);
7587
7590
  if (prevButton && nextButton && swiperElement) {
7588
- // console.log('Configurando navegación personalizada para:', this.meta?.code);
7589
- const swiperConfig = this.getSwiperConfiguration();
7590
- // Verificar si el Swiper ya está inicializado
7591
- if (!swiperElement.swiper) {
7592
- this.initializeNewSwiper(swiperElement, swiperConfig);
7593
- }
7594
- else {
7595
- this.updateExistingSwiper(swiperElement);
7596
- }
7597
- // Configurar los event listeners para los botones
7598
- this.setupNavigationEventListeners(prevButton, nextButton, swiperElement);
7599
- // console.log('Event listeners configurados para los botones de navegación');
7600
- }
7601
- else {
7602
7591
  // console.log('No se pudieron encontrar los elementos:', {
7603
7592
  // prevButton: !!prevButton,
7604
7593
  // nextButton: !!nextButton,
@@ -7929,8 +7918,10 @@ class MagnizoomEcComponent {
7929
7918
  this.document = inject(DOCUMENT); // Solo se inyecta en el navegador
7930
7919
  }
7931
7920
  afterRender(() => {
7932
- this.initContext();
7933
- this.loadImage(this.imageSrc);
7921
+ if (isPlatformBrowser(this.platformId)) {
7922
+ this.initContext();
7923
+ this.loadImage(this.imageSrc);
7924
+ }
7934
7925
  });
7935
7926
  }
7936
7927
  ngOnInit() {
@@ -7942,7 +7933,7 @@ class MagnizoomEcComponent {
7942
7933
  this.context = this.canvas.getContext('2d');
7943
7934
  }
7944
7935
  loadImage(src) {
7945
- if (this.document) {
7936
+ if (isPlatformBrowser(this.platformId) && this.document) {
7946
7937
  this.image = this.document.createElement('img');
7947
7938
  this.image.onload = () => {
7948
7939
  this.lensSize = { width: this.image.width / 2, height: this.image.height / 2 };
@@ -8553,10 +8544,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
8553
8544
  }] } });
8554
8545
 
8555
8546
  class LoginFormEcComponent {
8547
+ platformId;
8556
8548
  _authService = inject(AuthService);
8557
8549
  _formBuilder = inject(FormBuilder);
8558
8550
  _toastService = inject(ToastService);
8559
8551
  _router = inject(Router);
8552
+ constructor(platformId) {
8553
+ this.platformId = platformId;
8554
+ }
8560
8555
  showPassword = false;
8561
8556
  /**
8562
8557
  * Parametro para indicar si tras loguear
@@ -8601,20 +8596,23 @@ class LoginFormEcComponent {
8601
8596
  this._toastService.show('login-success');
8602
8597
  this.loggedIn = true;
8603
8598
  if (this.inCart) {
8604
- // Si se está en el carrito, se cierra el modal de login
8605
- const modal = document.getElementById('modalInvitado');
8606
- if (modal) {
8607
- const modalInstance = window.bootstrap?.Modal?.getInstance(modal);
8608
- if (modalInstance) {
8609
- modalInstance.hide();
8610
- }
8611
- else {
8612
- const closeButton = modal.querySelector('[data-bs-dismiss="modal"]');
8613
- if (closeButton) {
8614
- closeButton.click();
8599
+ // Solo manipula el DOM si está en el navegador
8600
+ if (isPlatformBrowser(this.platformId)) {
8601
+ const modal = document.getElementById('modalInvitado');
8602
+ if (modal) {
8603
+ const modalInstance = window.bootstrap?.Modal?.getInstance(modal);
8604
+ if (modalInstance) {
8605
+ modalInstance.hide();
8606
+ }
8607
+ else {
8608
+ const closeButton = modal.querySelector('[data-bs-dismiss="modal"]');
8609
+ if (closeButton) {
8610
+ closeButton.click();
8611
+ }
8615
8612
  }
8616
8613
  }
8617
8614
  }
8615
+ // La navegación funciona en SSR y browser
8618
8616
  this._router.navigateByUrl('/checkout');
8619
8617
  }
8620
8618
  else {
@@ -8649,13 +8647,16 @@ class LoginFormEcComponent {
8649
8647
  togglePassword() {
8650
8648
  this.showPassword = !this.showPassword;
8651
8649
  }
8652
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginFormEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
8650
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginFormEcComponent, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
8653
8651
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LoginFormEcComponent, isStandalone: true, selector: "app-login-form-ec", inputs: { redirect: "redirect", redirectTo: "redirectTo", inCart: "inCart" }, outputs: { ready: "ready" }, ngImport: i0, template: "<div class=\"d-flex flex-column position-relative\">\r\n <h1 class=\"right-line ff-ubuntu-light mb-4\"><span>Ingresar</span></h1>\r\n <p class=\"ff-ubuntu-light font-sm pr-4 mb-4\">\r\n Si ya est\u00E1s registrado. Ingresa en tu cuenta con tu email y la\r\n contrase\u00F1a adecuada.\r\n </p>\r\n <div class=\"w-md-50 w-100 text-center\">\r\n <form [formGroup]=\"loginForm()\" (submit)=\"login($event)\">\r\n <input class=\"form-control mb-4 radius-0\" type=\"email\" formControlName=\"username\"\r\n placeholder=\"Correo Electr\u00F3nico\">\r\n <input class=\"form-control mb-4 radius-0\" type=\"password\" formControlName=\"password\"\r\n placeholder=\"Contrase\u00F1a\">\r\n\r\n <div class=\"row d-flex flex-column\">\r\n <div class=\"col-12 mb-4\">\r\n <button type=\"submit\"\r\n class=\"bg-gray border-0 px-4 py-2 color-white ff-ubuntu-light\">INGRESAR</button>\r\n </div>\r\n <div class=\"col-12 d-flex justify-content-center align-items-center\">\r\n <a [routerLink]=\"'/auth/forgot-password'\" class=\"font-md ff-ubuntu-light\">\r\n \u00BFOlvid\u00F3 su contrase\u00F1a?\r\n </a>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n @if(loading){\r\n <app-loading-section-ec></app-loading-section-ec>\r\n }\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: LoadingSectionEcComponent, selector: "app-loading-section-ec" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
8654
8652
  }
8655
8653
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginFormEcComponent, decorators: [{
8656
8654
  type: Component,
8657
8655
  args: [{ selector: 'app-login-form-ec', standalone: true, imports: [LoadingSectionEcComponent, ReactiveFormsModule, RouterLink, JsonPipe], template: "<div class=\"d-flex flex-column position-relative\">\r\n <h1 class=\"right-line ff-ubuntu-light mb-4\"><span>Ingresar</span></h1>\r\n <p class=\"ff-ubuntu-light font-sm pr-4 mb-4\">\r\n Si ya est\u00E1s registrado. Ingresa en tu cuenta con tu email y la\r\n contrase\u00F1a adecuada.\r\n </p>\r\n <div class=\"w-md-50 w-100 text-center\">\r\n <form [formGroup]=\"loginForm()\" (submit)=\"login($event)\">\r\n <input class=\"form-control mb-4 radius-0\" type=\"email\" formControlName=\"username\"\r\n placeholder=\"Correo Electr\u00F3nico\">\r\n <input class=\"form-control mb-4 radius-0\" type=\"password\" formControlName=\"password\"\r\n placeholder=\"Contrase\u00F1a\">\r\n\r\n <div class=\"row d-flex flex-column\">\r\n <div class=\"col-12 mb-4\">\r\n <button type=\"submit\"\r\n class=\"bg-gray border-0 px-4 py-2 color-white ff-ubuntu-light\">INGRESAR</button>\r\n </div>\r\n <div class=\"col-12 d-flex justify-content-center align-items-center\">\r\n <a [routerLink]=\"'/auth/forgot-password'\" class=\"font-md ff-ubuntu-light\">\r\n \u00BFOlvid\u00F3 su contrase\u00F1a?\r\n </a>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n @if(loading){\r\n <app-loading-section-ec></app-loading-section-ec>\r\n }\r\n</div>" }]
8658
- }], propDecorators: { redirect: [{
8656
+ }], ctorParameters: () => [{ type: Object, decorators: [{
8657
+ type: Inject,
8658
+ args: [PLATFORM_ID]
8659
+ }] }], propDecorators: { redirect: [{
8659
8660
  type: Input
8660
8661
  }], redirectTo: [{
8661
8662
  type: Input
@@ -9083,30 +9084,34 @@ class PasswordResetEcComponent extends ComponentHelper {
9083
9084
  };
9084
9085
  sendToLogin = () => this.router.navigateByUrl('/auth/login');
9085
9086
  showPassword = () => {
9086
- const passwordInput = document.getElementById('contraseña1');
9087
- const showIcon = document.getElementById('show1');
9088
- const hideIcon = document.getElementById('hide1');
9089
- if (passwordInput.type === 'password') {
9090
- passwordInput.type = 'text';
9091
- }
9092
- else {
9093
- passwordInput.type = 'password';
9087
+ if (typeof document !== 'undefined') {
9088
+ const passwordInput = document.getElementById('contraseña1');
9089
+ const showIcon = document.getElementById('show1');
9090
+ const hideIcon = document.getElementById('hide1');
9091
+ if (passwordInput && passwordInput.type === 'password') {
9092
+ passwordInput.type = 'text';
9093
+ }
9094
+ else if (passwordInput) {
9095
+ passwordInput.type = 'password';
9096
+ }
9097
+ showIcon?.classList.toggle('d-none');
9098
+ hideIcon?.classList.toggle('d-none');
9094
9099
  }
9095
- showIcon?.classList.toggle('d-none');
9096
- hideIcon?.classList.toggle('d-none');
9097
9100
  };
9098
9101
  showPassword2 = () => {
9099
- const passwordInput = document.getElementById('contraseña2');
9100
- const showIcon = document.getElementById('show2');
9101
- const hideIcon = document.getElementById('hide2');
9102
- if (passwordInput.type === 'password') {
9103
- passwordInput.type = 'text';
9104
- }
9105
- else {
9106
- passwordInput.type = 'password';
9102
+ if (typeof document !== 'undefined') {
9103
+ const passwordInput = document.getElementById('contraseña2');
9104
+ const showIcon = document.getElementById('show2');
9105
+ const hideIcon = document.getElementById('hide2');
9106
+ if (passwordInput && passwordInput.type === 'password') {
9107
+ passwordInput.type = 'text';
9108
+ }
9109
+ else if (passwordInput) {
9110
+ passwordInput.type = 'password';
9111
+ }
9112
+ showIcon?.classList.toggle('d-none');
9113
+ hideIcon?.classList.toggle('d-none');
9107
9114
  }
9108
- showIcon?.classList.toggle('d-none');
9109
- hideIcon?.classList.toggle('d-none');
9110
9115
  };
9111
9116
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PasswordResetEcComponent, deps: [{ token: AuthService }, { token: ToastService }, { token: i2.ActivatedRoute }, { token: i2.Router }, { token: i1$4.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
9112
9117
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: PasswordResetEcComponent, isStandalone: true, selector: "app-password-reset-ec", usesInheritance: true, ngImport: i0, template: "<div class=\"container\">\r\n <div class=\"row justify-content-center py-5\">\r\n <div class=\"col-12 col-md-6 col-lg-4\">\r\n @if(!ready){\r\n <form [formGroup]=\"formGroup\" (submit)=\"sendNewPassword($event)\">\r\n <div class=\"mb-4 text-center\">\r\n <h3>{{ 'set-new-password' | translate }}</h3>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{ 'set-password' | translate }}</label>\r\n <div class=\"input-group\">\r\n <input type=\"password\" formControlName=\"first\" class=\"form-control\" id=\"contrase\u00F1a1\" />\r\n <button class=\"btn btn-outline-secondary btn-password\" type=\"button\" (click)=\"showPassword()\">\r\n <i id=\"show1\" class=\"fas fa-eye i-show-password\"></i>\r\n <i id=\"hide1\" class=\"fas fa-eye-slash d-none i-show-password\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{ 'repeat-password' | translate }}</label>\r\n <div class=\"input-group\">\r\n <input type=\"password\" formControlName=\"second\" class=\"form-control\" id=\"contrase\u00F1a2\" />\r\n <button class=\"btn btn-outline-secondary btn-password\" type=\"button\" (click)=\"showPassword2()\">\r\n <i id=\"show2\" class=\"fas fa-eye i-show-password\"></i>\r\n <i id=\"hide2\" class=\"fas fa-eye-slash d-none i-show-password\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"mt-4 text-center\">\r\n <button type=\"submit\" class=\"comprar w-100\">{{ 'update' | translate }}</button>\r\n </div>\r\n @if(loading){\r\n <app-loading-inline-ec></app-loading-inline-ec>\r\n }\r\n </form>\r\n }@else {<div class=\"row justify-content-center mt-5 mb-5\">\r\n <div class=\"text-center\">\r\n <div class=\"mb-4\">\r\n <h3>{{ 'updated-password' | translate }}</h3>\r\n </div>\r\n <div class=\"mb-4\">\r\n <h5>{{ 'updated-password-detail' | translate }}</h5>\r\n </div>\r\n <button class=\"comprar\" (click)=\"sendToLogin()\">{{ 'login' | translate }}</button>\r\n </div>\r\n </div>}\r\n\r\n\r\n\r\n </div>\r\n </div>\r\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "component", type: LoadingInlineEcComponent, selector: "app-loading-inline-ec", inputs: ["type"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
@@ -9202,7 +9207,9 @@ class FiltersEcComponent {
9202
9207
  });
9203
9208
  }
9204
9209
  // close = () => {
9205
- // this.document.getElementById("filtros").classList.remove('in');
9210
+ // if (typeof document !== 'undefined') {
9211
+ // this.document.getElementById("filtros").classList.remove('in');
9212
+ // }
9206
9213
  // return true;
9207
9214
  // };
9208
9215
  close = () => {
@@ -9212,7 +9219,9 @@ class FiltersEcComponent {
9212
9219
  return true;
9213
9220
  };
9214
9221
  scrollUp = () => {
9215
- window.scroll(0, 0);
9222
+ if (typeof window !== 'undefined') {
9223
+ window.scroll(0, 0);
9224
+ }
9216
9225
  return true;
9217
9226
  };
9218
9227
  hasAppliedFilters() {
@@ -9414,9 +9423,12 @@ class ProductDetailEcComponent {
9414
9423
  this._meta.updateTag({ property: 'og:type', content: 'product' });
9415
9424
  }
9416
9425
  decodeHtml(html) {
9417
- const txt = document.createElement('textarea');
9418
- txt.innerHTML = html;
9419
- return txt.value;
9426
+ if (typeof document !== 'undefined') {
9427
+ const txt = document.createElement('textarea');
9428
+ txt.innerHTML = html;
9429
+ return txt.value;
9430
+ }
9431
+ return html;
9420
9432
  }
9421
9433
  sanitizedHtml(html) {
9422
9434
  const decodedHtml = this.decodeHtml(html);
@@ -9466,9 +9478,11 @@ class ProductDetailEcComponent {
9466
9478
  goToSection(section) {
9467
9479
  this.showFormContact = true;
9468
9480
  setTimeout(() => {
9469
- const element = document.getElementById(section);
9470
- if (element) {
9471
- element.scrollIntoView({ behavior: 'smooth' });
9481
+ if (typeof document !== 'undefined') {
9482
+ const element = document.getElementById(section);
9483
+ if (element) {
9484
+ element.scrollIntoView({ behavior: 'smooth' });
9485
+ }
9472
9486
  }
9473
9487
  }, 500);
9474
9488
  }
@@ -10527,7 +10541,9 @@ class DecidirEcComponent extends ComponentHelper {
10527
10541
  }
10528
10542
  ngOnDestroy() {
10529
10543
  // Remover el listener de mensajes
10530
- window.removeEventListener('message', this.handleIframeMessage, false);
10544
+ if (typeof window !== 'undefined') {
10545
+ window.removeEventListener('message', this.handleIframeMessage, false);
10546
+ }
10531
10547
  // console.log("SE DESTROZA");
10532
10548
  }
10533
10549
  ngOnChanges() {
@@ -10607,11 +10623,13 @@ class DecidirEcComponent extends ComponentHelper {
10607
10623
  this.url = this.sanitizer.bypassSecurityTrustResourceUrl('assets/decidirFormEc.html');
10608
10624
  this.loading = false;
10609
10625
  // Escuchar mensajes del iframe para manejar la comunicación
10610
- window.addEventListener('message', this.handleIframeMessage.bind(this), false);
10626
+ if (typeof window !== 'undefined') {
10627
+ window.addEventListener('message', this.handleIframeMessage.bind(this), false);
10628
+ }
10611
10629
  };
10612
10630
  handleIframeMessage = (event) => {
10613
10631
  // Verificar el origen por seguridad
10614
- if (event.origin !== window.location.origin) {
10632
+ if (typeof window !== 'undefined' && event.origin !== window.location.origin) {
10615
10633
  return;
10616
10634
  }
10617
10635
  if (event.data && event.data.type === 'DECIDIR_PAYMENT') {
@@ -10653,8 +10671,10 @@ class DecidirEcComponent extends ComponentHelper {
10653
10671
  });
10654
10672
  };
10655
10673
  resizeIframe = (obj) => {
10656
- obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
10657
- obj.style.width = obj.contentWindow.document.body.scrollWidth + 'px';
10674
+ if (obj && obj.contentWindow && typeof obj.contentWindow.document !== 'undefined') {
10675
+ obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
10676
+ obj.style.width = obj.contentWindow.document.body.scrollWidth + 'px';
10677
+ }
10658
10678
  };
10659
10679
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DecidirEcComponent, deps: [{ token: i0.Renderer2 }, { token: ConnectionService }, { token: ToastService }, { token: CoreConstantsService }, { token: ApiConstantsService }, { token: CartService }, { token: i2.ActivatedRoute }, { token: i1$5.DomSanitizer }, { token: ParametersService }], target: i0.ɵɵFactoryTarget.Component });
10660
10680
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DecidirEcComponent, isStandalone: true, selector: "app-decidir-ec", inputs: { paymentServiceInst: "paymentServiceInst", method: "method", total_amount: "total_amount", allData: "allData", user_data: "user_data" }, outputs: { ready: "ready" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"text-center\">\r\n <h3>Continuar con el pago en Decidir</h3>\r\n @if (method) {\r\n <p class=\"px-5\">{{ method.description }}</p>\r\n <p class=\"px-5\">{{ method.instructions }}</p>\r\n }\r\n @if (!loading) {\r\n <button class=\"btn btn-outline-secondary comprar\" (click)=\"openModal()\">Pagar</button>\r\n } @else {\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center mt-2\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n }\r\n </div>\r\n\r\n@if (showModal) {\r\n<div class=\"modal-backdrop\" (click)=\"clickClose()\">\r\n <div class=\"modal-dialog modal-lg\" (click)=\"$event.stopPropagation()\">\r\n <div class=\"modal-content\">\r\n\r\n <div class=\"modal-body\">\r\n <div class=\"payment-container\">\r\n \r\n <!-- Iframe del formulario de decidir -->\r\n <div class=\"iframe-container\">\r\n <iframe [src]=\"url\" frameborder=\"0\" class=\"payment-iframe\"></iframe>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n}\r\n", styles: [".modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#0009;display:flex;justify-content:center;align-items:center;z-index:1050;backdrop-filter:blur(2px)}.modal-dialog{max-width:90%;max-height:90%;width:800px;background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 20px 60px #0000004d;animation:modalFadeIn .3s ease-out}.modal-dialog.modal-lg{max-width:900px;width:90%}@keyframes modalFadeIn{0%{opacity:0;transform:scale(.9) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}.modal-content{display:flex;flex-direction:column;height:100%;border:none;border-radius:16px;background:#fff}.modal-header{padding:1.5rem 2rem;border-bottom:1px solid #e9ecef;background:linear-gradient(135deg,#f8f9fa,#e9ecef);display:flex;justify-content:space-between;align-items:center;position:relative}.modal-header:after{content:\"\";position:absolute;bottom:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent 0%,#dee2e6 50%,transparent 100%)}.modal-header .modal-title{margin:0;font-size:1.5rem;font-weight:700;color:#2c3e50;text-shadow:0 1px 2px rgba(0,0,0,.1)}.modal-header .btn-close{background:none;border:none;font-size:1.8rem;color:#6c757d;cursor:pointer;padding:0;width:35px;height:35px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all .3s ease;position:relative}.modal-header .btn-close:hover{background-color:#dc3545;color:#fff;transform:rotate(90deg);box-shadow:0 4px 12px #dc35454d}.modal-header .btn-close:active{transform:rotate(90deg) scale(.95)}.modal-body{padding:0;flex:1;overflow:hidden;background:#fff}.payment-container{height:100%;display:flex;flex-direction:column;background:#fff}.cards-accepted{padding:1.5rem 2rem;text-align:center;border-bottom:1px solid #e9ecef;background:linear-gradient(135deg,#fff,#f8f9fa);position:relative}.cards-accepted:after{content:\"\";position:absolute;bottom:0;left:5%;right:5%;height:1px;background:linear-gradient(90deg,transparent 0%,#dee2e6 50%,transparent 100%)}.cards-accepted .cards-img{height:45px;max-width:100%;object-fit:contain;filter:drop-shadow(0 2px 4px rgba(0,0,0,.1));transition:transform .2s ease}.cards-accepted .cards-img:hover{transform:scale(1.05)}.iframe-container{flex:1;padding:1.5rem;background:#fff;position:relative}.iframe-container:before{content:\"\";position:absolute;top:0;left:1.5rem;right:1.5rem;height:1px;background:linear-gradient(90deg,transparent 0%,#e9ecef 50%,transparent 100%)}.payment-iframe{width:100%;height:620px;border:none;border-radius:12px;background:#fff;box-shadow:inset 0 2px 8px #0000000d}.half-width{width:49%!important}.ml-1{margin-left:1%}#card-form{height:450px}.iframeStyle{height:520px;width:100%}@media only screen and (max-width: 1024px){.modal-dialog,.modal-dialog.modal-lg{max-width:95%;width:95%}.payment-iframe{height:650px}.modal-header{padding:1rem 1.5rem}.modal-header .modal-title{font-size:1.125rem}.cards-accepted{padding:.75rem 1.5rem}}@media only screen and (max-width: 680px){.modal-dialog{max-width:98%;width:98%;margin:1rem;max-height:calc(100vh - 2rem)}.modal-dialog.modal-lg{max-width:98%;width:98%}.payment-iframe{height:550px}.modal-header{padding:1rem}.modal-header .modal-title{font-size:1rem}.modal-header .btn-close{width:28px;height:28px;font-size:1.25rem}.cards-accepted{padding:.5rem 1rem}.cards-accepted .cards-img{height:35px}.iframe-container{padding:.5rem}}@media only screen and (max-width: 480px){.modal-dialog{margin:.5rem;max-height:calc(100vh - 1rem);border-radius:8px}.modal-content{border-radius:8px}.payment-iframe{height:500px}.cards-accepted .cards-img{height:30px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: LoadingFullEcComponent, selector: "app-loading-full-ec" }] });
@@ -12073,11 +12093,13 @@ class StoresEcComponent extends ComponentHelper {
12073
12093
  });
12074
12094
  const center = bounds.getCenter();
12075
12095
  const style = [{ "elementType": "geometry", "stylers": [{ "color": "#212121" }] }, { "elementType": "labels.icon", "stylers": [{ "visibility": "off" }] }, { "elementType": "labels.text.fill", "stylers": [{ "color": "#757575" }] }, { "elementType": "labels.text.stroke", "stylers": [{ "color": "#212121" }] }, { "featureType": "administrative", "elementType": "geometry", "stylers": [{ "color": "#757575" }] }, { "featureType": "administrative.country", "elementType": "labels.text.fill", "stylers": [{ "color": "#9e9e9e" }] }, { "featureType": "administrative.locality", "elementType": "labels.text.fill", "stylers": [{ "color": "#bdbdbd" }] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{ "color": "#757575" }] }, { "featureType": "poi.business", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [{ "color": "#181818" }] }, { "featureType": "poi.park", "elementType": "labels.text.fill", "stylers": [{ "color": "#616161" }] }, { "featureType": "poi.park", "elementType": "labels.text.stroke", "stylers": [{ "color": "#1b1b1b" }] }, { "featureType": "road", "elementType": "geometry.fill", "stylers": [{ "color": "#2c2c2c" }] }, { "featureType": "road", "elementType": "labels.icon", "stylers": [{ "visibility": "off" }] }, { "featureType": "road", "elementType": "labels.text.fill", "stylers": [{ "color": "#8a8a8a" }] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{ "color": "#373737" }] }, { "featureType": "road.arterial", "elementType": "labels", "stylers": [{ "visibility": "off" }] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{ "color": "#3c3c3c" }] }, { "featureType": "road.highway", "elementType": "labels", "stylers": [{ "visibility": "off" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry", "stylers": [{ "color": "#4e4e4e" }] }, { "featureType": "road.local", "stylers": [{ "visibility": "off" }] }, { "featureType": "road.local", "elementType": "labels.text.fill", "stylers": [{ "color": "#616161" }] }, { "featureType": "transit", "stylers": [{ "visibility": "off" }] }, { "featureType": "transit", "elementType": "labels.text.fill", "stylers": [{ "color": "#757575" }] }, { "featureType": "water", "elementType": "geometry", "stylers": [{ "color": "#000000" }] }, { "featureType": "water", "elementType": "labels.text.fill", "stylers": [{ "color": "#3d3d3d" }] }];
12076
- this.map = new google.maps.Map(document.getElementById('map'), {
12077
- zoom: 12,
12078
- center: center, // Centrar el mapa en el centro calculado
12079
- styles: style // Aplica los estilos personalizados
12080
- });
12096
+ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
12097
+ this.map = new google.maps.Map(document.getElementById('map'), {
12098
+ zoom: 12,
12099
+ center: center, // Centrar el mapa en el centro calculado
12100
+ styles: style // Aplica los estilos personalizados
12101
+ });
12102
+ }
12081
12103
  this.locations.forEach(location => {
12082
12104
  const marker = new google.maps.Marker({
12083
12105
  position: { lat: location.lat, lng: location.lng },
@@ -12091,8 +12113,12 @@ class StoresEcComponent extends ComponentHelper {
12091
12113
  marker.set('id', location.id); // Associate marker with its ID
12092
12114
  this.markers.push(marker);
12093
12115
  marker.addListener('click', () => {
12094
- const elemento = document.getElementById(location.id);
12095
- const contenedor = document.getElementById('home');
12116
+ let elemento = null;
12117
+ let contenedor = null;
12118
+ if (typeof document !== 'undefined') {
12119
+ elemento = document.getElementById(location.id);
12120
+ contenedor = document.getElementById('home');
12121
+ }
12096
12122
  if (elemento && contenedor) {
12097
12123
  contenedor.scrollTo({
12098
12124
  top: elemento.offsetTop - contenedor.offsetTop + contenedor.scrollTop,
@@ -12120,7 +12146,10 @@ class StoresEcComponent extends ComponentHelper {
12120
12146
  showStoreOnMap(storeCode) {
12121
12147
  this.stopBounce();
12122
12148
  const marker = this.markers.find(m => m.get('id') === storeCode);
12123
- const elemento = document.getElementById(storeCode);
12149
+ let elemento = null;
12150
+ if (typeof document !== 'undefined') {
12151
+ elemento = document.getElementById(storeCode);
12152
+ }
12124
12153
  if (this.ultimoElementoSeleccionado !== null) {
12125
12154
  // Quitar la clase del último elemento seleccionado
12126
12155
  this.ultimoElementoSeleccionado.classList.remove('selected');