@colijnit/product 257.1.0 → 257.1.1

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.
@@ -6,6 +6,7 @@ import { ArticleListObject } from '@colijnit/articleapi/build/model/article-list
6
6
  import { ProductEventService } from '../../service/product-event.service';
7
7
  import { CatalogDefinition } from '@colijnit/articleapi/build/model/catalog-definition.bo';
8
8
  import { ExternalSourceArticleAddInterface } from '@colijnit/articleapi/build/interface/external-source-article-add.interface';
9
+ import { ExternalCatalogStartupInfo } from '@colijnit/articleapi/build/model/external-catalog-startup-info';
9
10
  export declare class ProductExternalSourceComponent implements OnInit, OnDestroy {
10
11
  private _sanitizer;
11
12
  private _productConnectorService;
@@ -14,20 +15,35 @@ export declare class ProductExternalSourceComponent implements OnInit, OnDestroy
14
15
  catalogDefinition: CatalogDefinition;
15
16
  set externalSource(value: ExternalSource);
16
17
  get externalSource(): ExternalSource;
18
+ set externalCatalogStartupInfo(value: ExternalCatalogStartupInfo);
19
+ get externalCatalogStartupInfo(): ExternalCatalogStartupInfo;
17
20
  options: {};
18
21
  addToCart: EventEmitter<ExternalSourceArticleAddInterface>;
19
22
  addToQuote: EventEmitter<ExternalSourceArticleAddInterface>;
20
23
  alternativeClick: EventEmitter<ArticleListObject>;
24
+ configuratorFinished: EventEmitter<string>;
21
25
  showClass(): boolean;
22
26
  showProduct: boolean;
27
+ showConfigurator: boolean;
28
+ showSource: boolean;
23
29
  safeUrl: SafeResourceUrl;
24
30
  loaded: boolean;
25
31
  externalUrl: string;
26
32
  externalSettings: any;
33
+ token: string;
34
+ variant: string;
27
35
  private _externalSource;
36
+ private _externalCatalogStartupInfo;
28
37
  private _subs;
29
38
  constructor(_sanitizer: DomSanitizer, _productConnectorService: ProductConnectorService, _appEventService: ProductEventService);
30
39
  ngOnInit(): void;
31
40
  ngOnDestroy(): void;
41
+ handleConfigurationFinished(variantString: string): void;
32
42
  private _prepareExternalSource;
43
+ private _prepareCatFarm;
44
+ private _prepareConfigurator;
45
+ private _prepareSource;
46
+ private switchToProduct;
47
+ private switchToConfigurator;
48
+ private switchToSource;
33
49
  }
@@ -1,17 +1,20 @@
1
- import { ElementRef, Renderer2 } from '@angular/core';
1
+ import { ElementRef, EventEmitter, OnDestroy, Renderer2 } from '@angular/core';
2
2
  import { ProductScriptLoaderService } from '../../service/product-script-loader.service';
3
- export declare class ProductHdComponent {
3
+ export declare class ProductHdComponent implements OnDestroy {
4
4
  private _scriptLoader;
5
5
  private _renderer;
6
6
  set content(child: any);
7
7
  set sku(value: string);
8
8
  get sku(): string;
9
- showClass: boolean;
10
9
  token: string;
11
10
  variant: string;
11
+ configuratorFinished: EventEmitter<string>;
12
+ configurationError: EventEmitter<any>;
13
+ showClass: boolean;
12
14
  hdeConfigurator: ElementRef;
13
15
  private _sku;
14
16
  constructor(_scriptLoader: ProductScriptLoaderService, _renderer: Renderer2);
17
+ ngOnDestroy(): void;
15
18
  handleConfigurationFinished(event: CustomEvent): void;
16
19
  handleError(event: CustomEvent): void;
17
20
  private _prepareAttributes;
@@ -33,6 +33,7 @@ export declare class IoneProductComponent implements OnInit, OnChanges, OnDestro
33
33
  onAddToQuote: EventEmitter<string>;
34
34
  openStockEvent: EventEmitter<void>;
35
35
  settingsLoaded: boolean;
36
+ showHD: boolean;
36
37
  private _settings;
37
38
  private _subs;
38
39
  constructor(_dictionary: DictionaryService, _jsonUtils: JsonUtilsService, _ione: ProductConnectorService, _changeDetector: ChangeDetectorRef, _appEventService: ProductEventService, _settingsService: ProductSettingsService);
@@ -1,7 +1,9 @@
1
1
  import { Renderer2 } from '@angular/core';
2
2
  export declare class ProductScriptLoaderService {
3
3
  private platformId;
4
+ private _scriptsOrLinksElements;
4
5
  constructor(platformId: any);
5
6
  loadScript(url: string, renderer: Renderer2): Promise<void>;
7
+ unloadScripts(renderer: Renderer2): void;
6
8
  addStyleSheet(url: string, renderer: Renderer2): Promise<void>;
7
9
  }
@@ -31,8 +31,8 @@
31
31
  function Version() {
32
32
  this.name = "@colijnit/product";
33
33
  this.description = "Product detail page project for iOne";
34
- this.symVer = "257.1.0";
35
- this.publishDate = "1/14/2025, 12:10:32 PM";
34
+ this.symVer = "257.1.1";
35
+ this.publishDate = "20-1-2025 16:08:00";
36
36
  }
37
37
  return Version;
38
38
  }());
@@ -1323,6 +1323,7 @@
1323
1323
  this.onAddToQuote = new i0.EventEmitter();
1324
1324
  this.openStockEvent = new i0.EventEmitter();
1325
1325
  this.settingsLoaded = false;
1326
+ this.showHD = false;
1326
1327
  this._subs = [];
1327
1328
  this._subs.push(
1328
1329
  // this._dictionary.dictionaryLoaded.subscribe(d => this.upAndLoaded = true),
@@ -1389,7 +1390,7 @@
1389
1390
  IoneProductComponent.decorators = [
1390
1391
  { type: i0.Component, args: [{
1391
1392
  selector: 'app-ione-product',
1392
- template: "\n <app-product-page *ngIf=\"settingsLoaded\"\n [createFrozenArticle]=\"handleAddArticleInternally\"\n [isReturn]=\"isReturn\"\n (openStockEvent)=\"openStock()\"\n [sku]=\"sku\"\n [showRelatedProductsPopup]=\"showRelatedProductsPopup\"\n ></app-product-page>\n<!--\n <co-product-hd [sku]=\"'8f108aa9-f6cb-4d86-7826-08d87757dac1'\"></co-product-hd>\n-->\n ",
1393
+ template: "\n <app-product-page *ngIf=\"settingsLoaded\"\n [createFrozenArticle]=\"handleAddArticleInternally\"\n [isReturn]=\"isReturn\"\n (openStockEvent)=\"openStock()\"\n [sku]=\"sku\"\n [showRelatedProductsPopup]=\"showRelatedProductsPopup\"\n ></app-product-page>\n<!-- <co-button [label]=\"'click'\" (click)=\"showHD = !showHD\"></co-button>\n <co-product-hd [sku]=\"'657946ca-e1e1-41fd-7ae0-08dbf7df0cef'\" *ngIf=\"showHD\"></co-product-hd>-->\n ",
1393
1394
  encapsulation: i0.ViewEncapsulation.Emulated,
1394
1395
  styles: [""]
1395
1396
  },] }
@@ -3305,6 +3306,7 @@
3305
3306
  var ProductScriptLoaderService = /** @class */ (function () {
3306
3307
  function ProductScriptLoaderService(platformId) {
3307
3308
  this.platformId = platformId;
3309
+ this._scriptsOrLinksElements = [];
3308
3310
  }
3309
3311
  ProductScriptLoaderService.prototype.loadScript = function (url, renderer) {
3310
3312
  var _this = this;
@@ -3326,8 +3328,15 @@
3326
3328
  script.onload = function () { return resolve(); };
3327
3329
  script.onerror = function (error) { return reject("Error loading script: " + url); };
3328
3330
  renderer.appendChild(document.head, script);
3331
+ _this._scriptsOrLinksElements.push(script);
3329
3332
  });
3330
3333
  };
3334
+ ProductScriptLoaderService.prototype.unloadScripts = function (renderer) {
3335
+ for (var i = this._scriptsOrLinksElements.length - 1; i >= 0; i--) {
3336
+ renderer.removeChild(document.head, this._scriptsOrLinksElements[i]);
3337
+ this._scriptsOrLinksElements.pop();
3338
+ }
3339
+ };
3331
3340
  ProductScriptLoaderService.prototype.addStyleSheet = function (url, renderer) {
3332
3341
  var _this = this;
3333
3342
  return new Promise(function (resolve, reject) {
@@ -3347,6 +3356,7 @@
3347
3356
  link.onload = function () { return resolve(); };
3348
3357
  link.onerror = function (error) { return reject("Error loading styleSheet: " + url); };
3349
3358
  renderer.appendChild(document.head, link);
3359
+ _this._scriptsOrLinksElements.push(link);
3350
3360
  });
3351
3361
  };
3352
3362
  return ProductScriptLoaderService;
@@ -3365,9 +3375,10 @@
3365
3375
  function ProductHdComponent(_scriptLoader, _renderer) {
3366
3376
  this._scriptLoader = _scriptLoader;
3367
3377
  this._renderer = _renderer;
3378
+ this.variant = '';
3379
+ this.configuratorFinished = new i0.EventEmitter();
3380
+ this.configurationError = new i0.EventEmitter();
3368
3381
  this.showClass = true;
3369
- this.token = "eyJhbGciOiJSUzI1NiIsImtpZCI6IkYxOThERkVEOEUwQTQ1MzY3M0M1MUE2Rjk1QUVDQzU3RTM0NjM4RkRSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6IjhaamY3WTRLUlRaenhScHZsYTdNVi1OR09QMCJ9.eyJuYmYiOjE3MzIxOTkyOTUsImV4cCI6MTcz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- this.variant = "";
3371
3382
  }
3372
3383
  Object.defineProperty(ProductHdComponent.prototype, "content", {
3373
3384
  set: function (child) {
@@ -3388,11 +3399,19 @@
3388
3399
  enumerable: false,
3389
3400
  configurable: true
3390
3401
  });
3402
+ ProductHdComponent.prototype.ngOnDestroy = function () {
3403
+ this._scriptLoader.unloadScripts(this._renderer);
3404
+ };
3391
3405
  ProductHdComponent.prototype.handleConfigurationFinished = function (event) {
3392
- console.log(event.detail);
3406
+ if (event.detail.variant && typeof event.detail.variant === 'string') {
3407
+ this.configuratorFinished.emit(event.detail.variant);
3408
+ }
3409
+ else {
3410
+ this.configuratorFinished.emit(this.variant);
3411
+ }
3393
3412
  };
3394
3413
  ProductHdComponent.prototype.handleError = function (event) {
3395
- console.error(event.detail);
3414
+ this.configurationError.emit(event.detail.status);
3396
3415
  };
3397
3416
  ProductHdComponent.prototype._prepareAttributes = function () {
3398
3417
  if (this.hdeConfigurator && this.hdeConfigurator.nativeElement && this.token && (this.sku || this.variant)) {
@@ -3430,7 +3449,7 @@
3430
3449
  case 3:
3431
3450
  i++;
3432
3451
  return [3 /*break*/, 1];
3433
- case 4: return [4 /*yield*/, this._scriptLoader.addStyleSheet("https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/styles.css", this._renderer)];
3452
+ case 4: return [4 /*yield*/, this._scriptLoader.addStyleSheet('https://hde-cdn.azureedge.net/libs/components/Configurator/1.0.33/styles.css', this._renderer)];
3434
3453
  case 5:
3435
3454
  _a.sent();
3436
3455
  return [2 /*return*/];
@@ -3443,7 +3462,7 @@
3443
3462
  ProductHdComponent.decorators = [
3444
3463
  { type: i0.Component, args: [{
3445
3464
  selector: 'co-product-hd',
3446
- template: "\n <hde-configurator #hdeConfigurator\n apiurl=\"https://bmsproductconfigurator-acceptance.azurewebsites.net/api/configurator/\"\n productVariantCommandApiUrl=\"https://bmsproductvariantcommand-acceptance.azurewebsites.net/\"\n productVariantQueryApiUrl=\"https://bmsproductvariantquery-acceptance.azurewebsites.net/\"\n language=\"nl\"\n localizationApiUrl=\"https://hde-cdn.azureedge.net/libs/BMS.DST.Localization/\"\n localizationFileExtension=\".json\"\n (configurationFinished)=\"handleConfigurationFinished($event)\"\n (configurationFailed)=\"handleError($event)\"\n >\n <hde-progress-bar></hde-progress-bar>\n </hde-configurator>\n ",
3465
+ template: "\n <hde-configurator #hdeConfigurator\n apiurl=\"https://bmsproductconfigurator-acceptance.azurewebsites.net/api/configurator/\"\n productVariantCommandApiUrl=\"https://bmsproductvariantcommand-acceptance.azurewebsites.net/\"\n productVariantQueryApiUrl=\"https://bmsproductvariantquery-acceptance.azurewebsites.net/\"\n language=\"nl\"\n localizationApiUrl=\"https://hde-cdn.azureedge.net/libs/BMS.DST.Localization/\"\n localizationFileExtension=\".json\"\n (configurationFinished)=\"handleConfigurationFinished($event)\"\n (configurationFailed)=\"handleError($event)\"\n >\n <hde-progress-bar></hde-progress-bar>\n </hde-configurator>\n ",
3447
3466
  encapsulation: i0.ViewEncapsulation.None
3448
3467
  },] }
3449
3468
  ];
@@ -3454,6 +3473,10 @@
3454
3473
  ProductHdComponent.propDecorators = {
3455
3474
  content: [{ type: i0.ViewChild, args: ['hdeConfigurator', { read: i0.ElementRef },] }],
3456
3475
  sku: [{ type: i0.Input }],
3476
+ token: [{ type: i0.Input }],
3477
+ variant: [{ type: i0.Input }],
3478
+ configuratorFinished: [{ type: i0.Output }],
3479
+ configurationError: [{ type: i0.Output }],
3457
3480
  showClass: [{ type: i0.HostBinding, args: ['class.co-product-hd',] }]
3458
3481
  };
3459
3482
 
@@ -3480,41 +3503,6 @@
3480
3503
  },] }
3481
3504
  ];
3482
3505
 
3483
- var IoneProductModule = /** @class */ (function () {
3484
- function IoneProductModule() {
3485
- }
3486
- return IoneProductModule;
3487
- }());
3488
- IoneProductModule.decorators = [
3489
- { type: i0.NgModule, args: [{
3490
- imports: [
3491
- // BrowserAnimationsModule,
3492
- common.CommonModule,
3493
- ProductPageModule,
3494
- ProductHdModule
3495
- ],
3496
- declarations: [
3497
- IoneProductComponent
3498
- ],
3499
- exports: [
3500
- IoneProductComponent
3501
- ],
3502
- schemas: [
3503
- i0.CUSTOM_ELEMENTS_SCHEMA,
3504
- i0.NO_ERRORS_SCHEMA
3505
- ],
3506
- bootstrap: [
3507
- IoneProductComponent
3508
- ],
3509
- providers: [
3510
- ProductSettingsService,
3511
- ProductConnectorService,
3512
- ProductEventService,
3513
- ProductConnectorAdapterService
3514
- ]
3515
- },] }
3516
- ];
3517
-
3518
3506
  var ProductExternalSourceComponent = /** @class */ (function () {
3519
3507
  function ProductExternalSourceComponent(_sanitizer, _productConnectorService, _appEventService) {
3520
3508
  this._sanitizer = _sanitizer;
@@ -3523,9 +3511,14 @@
3523
3511
  this.addToCart = new i0.EventEmitter();
3524
3512
  this.addToQuote = new i0.EventEmitter();
3525
3513
  this.alternativeClick = new i0.EventEmitter();
3514
+ this.configuratorFinished = new i0.EventEmitter();
3526
3515
  this.showProduct = false;
3516
+ this.showConfigurator = false;
3517
+ this.showSource = false;
3527
3518
  this.loaded = false;
3528
3519
  this.externalSettings = {};
3520
+ this.token = ""; //= "eyJhbGciOiJSUzI1NiIsImtpZCI6IkYxOThERkVEOEUwQTQ1MzY3M0M1MUE2Rjk1QUVDQzU3RTM0NjM4RkRSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6IjhaamY3WTRLUlRaenhScHZsYTdNVi1OR09QMCJ9.eyJuYmYiOjE3MzIxOTkyOTUsImV4cCI6MTczMjIwMjg5NSwiaXNzIjoiaHR0cHM6Ly9ibXNpZGVudGl0eS1hY2NlcHRhbmNlLmF6dXJld2Vic2l0ZXMubmV0IiwiYXVkIjpbImNhdGFsb2dxdWVyeWFwaSIsImNvbmZpZ3VyYXRvcmFwaSIsInByb2R1Y3R2YXJpYW50Y29tbWFuZGFwaSIsInByb2R1Y3R2YXJpYW50cXVlcnlhcGkiXSwiY2xpZW50X2lkIjoiaW1wZXJzb25hdGlvbi5jbGllbnQiLCJzdWIiOi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Y3RwcmljZS5zZXR0aW5ncy5yZWFkIiwic2VsbGVyLnByb2R1Y3RwcmljZS5zZXR0aW5ncy53cml0ZSIsImNvbmZpZ3VyYXRvci5wdXJjaGFzZXByaWNlLnJlYWQiLCJzdG9jay5mYWJyaWMucmVhZCJdLCJuYW1lIjoiUm9iaW4iLCJmYW1pbHlfbmFtZSI6ImRlIFdpbnRlciAoQ29saWpuLUlUKSIsInJvbGUiOlsic2VsbGVyIiwiZGVhbGVyX21hbmFnZXIiXSwiaWF0IjoxNzMyMTk5Mjk1LCJzY29wZSI6WyJjYXRhbG9ncXVlcnlhcGkiLCJjb25maWd1cmF0b3JhcGkiLCJwcm9kdWN0dmFyaWFudGNvbW1hbmRhcGkiLCJwcm9kdWN0dmFyaWFudHF1ZXJ5YXBpIl0sImFtciI6WyJpbXBlcnNvbmF0aW9uIl19.rbguVPnkXXDzsM6QKgXulhrF41jIjCuGDV13ig1GC8MewLCJ7wA038OSwT26sx2mCexjvuGYt45YScfPwfTkDy3ErPmHRods64X1dJWZnf-23NTP2iI32K_1vMZH5GOGbMzuFtbKAFQv4hgFAxoyWqFVWyJvuOtQcWyZStROyPHwjAnpnj-x1cVQpOhbO-kQUFvy_VUrPpF3aYVCcO2cFirQTXR6kxSGcYGGcsPY-_eiAd93UdG2EM6xLAocDLaFV72CQI6XEs0WQG1f4SqvH52v3OTkgWBLgYV35gpyIe0-2nazGL0R8pTNuDqrOb7OGmuTRMoTIiRi67-wTxx8cQ";
3521
+ this.variant = "";
3529
3522
  this._subs = [];
3530
3523
  }
3531
3524
  Object.defineProperty(ProductExternalSourceComponent.prototype, "externalSource", {
@@ -3540,6 +3533,19 @@
3540
3533
  enumerable: false,
3541
3534
  configurable: true
3542
3535
  });
3536
+ Object.defineProperty(ProductExternalSourceComponent.prototype, "externalCatalogStartupInfo", {
3537
+ get: function () {
3538
+ return this._externalCatalogStartupInfo;
3539
+ },
3540
+ set: function (value) {
3541
+ this._externalCatalogStartupInfo = value;
3542
+ this.externalSource = value.externalSource;
3543
+ this.loaded = false;
3544
+ this._prepareExternalSource();
3545
+ },
3546
+ enumerable: false,
3547
+ configurable: true
3548
+ });
3543
3549
  ProductExternalSourceComponent.prototype.showClass = function () {
3544
3550
  return true;
3545
3551
  };
@@ -3564,9 +3570,11 @@
3564
3570
  ProductExternalSourceComponent.prototype.ngOnDestroy = function () {
3565
3571
  this._subs.forEach(function (s) { return s.unsubscribe(); });
3566
3572
  };
3573
+ ProductExternalSourceComponent.prototype.handleConfigurationFinished = function (variantString) {
3574
+ this.configuratorFinished.emit(variantString);
3575
+ };
3567
3576
  ProductExternalSourceComponent.prototype._prepareExternalSource = function () {
3568
3577
  return __awaiter(this, void 0, void 0, function () {
3569
- var bundleSettings;
3570
3578
  return __generator(this, function (_a) {
3571
3579
  switch (_a.label) {
3572
3580
  case 0:
@@ -3576,7 +3584,29 @@
3576
3584
  this.externalUrl = undefined;
3577
3585
  this.externalSettings = {};
3578
3586
  if (!(this.externalSource.type === 'CATF')) return [3 /*break*/, 2];
3579
- return [4 /*yield*/, this._productConnectorService.getProductBundleSettings(this.externalSource.url, parseInt(this.externalSource.schema, 0))];
3587
+ return [4 /*yield*/, this._prepareCatFarm()];
3588
+ case 1:
3589
+ _a.sent();
3590
+ return [3 /*break*/, 3];
3591
+ case 2:
3592
+ if (this.externalSource.type === 'HTDL') {
3593
+ this._prepareConfigurator();
3594
+ }
3595
+ else {
3596
+ this._prepareSource();
3597
+ }
3598
+ _a.label = 3;
3599
+ case 3: return [2 /*return*/];
3600
+ }
3601
+ });
3602
+ });
3603
+ };
3604
+ ProductExternalSourceComponent.prototype._prepareCatFarm = function () {
3605
+ return __awaiter(this, void 0, void 0, function () {
3606
+ var bundleSettings;
3607
+ return __generator(this, function (_a) {
3608
+ switch (_a.label) {
3609
+ case 0: return [4 /*yield*/, this._productConnectorService.getProductBundleSettings(this.externalSource.url, parseInt(this.externalSource.schema, 0))];
3580
3610
  case 1:
3581
3611
  bundleSettings = _a.sent();
3582
3612
  this.externalSettings = JSON.parse(bundleSettings);
@@ -3591,26 +3621,49 @@
3591
3621
  this.externalSettings.password = this.externalSource.password;
3592
3622
  }
3593
3623
  // finally show the catalog
3594
- this.showProduct = true;
3595
- return [3 /*break*/, 3];
3596
- case 2:
3597
- this.externalUrl = this.externalSource.url;
3598
- this.safeUrl = this._sanitizer.bypassSecurityTrustResourceUrl(this.externalUrl);
3599
- this.showProduct = false;
3600
- _a.label = 3;
3601
- case 3:
3624
+ this.switchToProduct();
3602
3625
  this.loaded = true;
3603
3626
  return [2 /*return*/];
3604
3627
  }
3605
3628
  });
3606
3629
  });
3607
3630
  };
3631
+ ProductExternalSourceComponent.prototype._prepareConfigurator = function () {
3632
+ if (this.externalCatalogStartupInfo) {
3633
+ this.token = this.externalCatalogStartupInfo.token;
3634
+ this.sku = "657946ca-e1e1-41fd-7ae0-08dbf7df0cef"; // this.externalCatalogStartupInfo.externalGoodId;
3635
+ this.variant = this.externalCatalogStartupInfo.flattenedGoodId;
3636
+ this.switchToConfigurator();
3637
+ this.loaded = true;
3638
+ }
3639
+ };
3640
+ ProductExternalSourceComponent.prototype._prepareSource = function () {
3641
+ this.externalUrl = this.externalSource.url;
3642
+ this.safeUrl = this._sanitizer.bypassSecurityTrustResourceUrl(this.externalUrl);
3643
+ this.switchToSource();
3644
+ this.loaded = true;
3645
+ };
3646
+ ProductExternalSourceComponent.prototype.switchToProduct = function () {
3647
+ this.showProduct = true;
3648
+ this.showConfigurator = false;
3649
+ this.showSource = false;
3650
+ };
3651
+ ProductExternalSourceComponent.prototype.switchToConfigurator = function () {
3652
+ this.showProduct = false;
3653
+ this.showConfigurator = true;
3654
+ this.showSource = false;
3655
+ };
3656
+ ProductExternalSourceComponent.prototype.switchToSource = function () {
3657
+ this.showProduct = false;
3658
+ this.showConfigurator = false;
3659
+ this.showSource = true;
3660
+ };
3608
3661
  return ProductExternalSourceComponent;
3609
3662
  }());
3610
3663
  ProductExternalSourceComponent.decorators = [
3611
3664
  { type: i0.Component, args: [{
3612
3665
  selector: 'co-product-external-source',
3613
- template: "\n <ng-container *ngIf=\"loaded\">\n <ng-container *ngIf=\"showProduct\">\n <app-product-page\n [sku]=\"sku\"\n [settings]=\"externalSettings\"\n [externalSource]=\"externalSource\"\n ></app-product-page>\n </ng-container>\n <ng-container *ngIf=\"!showProduct\">\n <iframe width=\"100%\" height=\"100%\" [src]=\"safeUrl\" frameborder=\"0\" allowfullscreen></iframe>\n </ng-container>\n </ng-container>\n ",
3666
+ template: "\n <ng-container *ngIf=\"loaded\">\n <ng-container *ngIf=\"showProduct\">\n <app-product-page\n [sku]=\"sku\"\n [settings]=\"externalSettings\"\n [externalSource]=\"externalSource\"\n ></app-product-page>\n </ng-container>\n <ng-container *ngIf=\"showSource\">\n <iframe width=\"100%\" height=\"100%\" [src]=\"safeUrl\" frameborder=\"0\" allowfullscreen></iframe>\n </ng-container>\n <ng-container *ngIf=\"showConfigurator\">\n <co-product-hd width=\"100%\" height=\"100%\"\n [sku]=\"sku\"\n [variant]=\"variant\"\n [token]=\"token\"\n (configuratorFinished)=\"handleConfigurationFinished($event)\"></co-product-hd>\n </ng-container>\n </ng-container>\n ",
3614
3667
  providers: [
3615
3668
  ProductSettingsService,
3616
3669
  ProductConnectorAdapterService,
@@ -3628,10 +3681,12 @@
3628
3681
  sku: [{ type: i0.Input }],
3629
3682
  catalogDefinition: [{ type: i0.Input }],
3630
3683
  externalSource: [{ type: i0.Input }],
3684
+ externalCatalogStartupInfo: [{ type: i0.Input }],
3631
3685
  options: [{ type: i0.Input }],
3632
3686
  addToCart: [{ type: i0.Output }],
3633
3687
  addToQuote: [{ type: i0.Output }],
3634
3688
  alternativeClick: [{ type: i0.Output }],
3689
+ configuratorFinished: [{ type: i0.Output }],
3635
3690
  showClass: [{ type: i0.HostBinding, args: ['class.co-product-external-source',] }]
3636
3691
  };
3637
3692
 
@@ -3644,7 +3699,8 @@
3644
3699
  { type: i0.NgModule, args: [{
3645
3700
  imports: [
3646
3701
  common.CommonModule,
3647
- ProductPageModule
3702
+ ProductPageModule,
3703
+ ProductHdModule
3648
3704
  ],
3649
3705
  declarations: [
3650
3706
  ProductExternalSourceComponent
@@ -3655,6 +3711,43 @@
3655
3711
  },] }
3656
3712
  ];
3657
3713
 
3714
+ var IoneProductModule = /** @class */ (function () {
3715
+ function IoneProductModule() {
3716
+ }
3717
+ return IoneProductModule;
3718
+ }());
3719
+ IoneProductModule.decorators = [
3720
+ { type: i0.NgModule, args: [{
3721
+ imports: [
3722
+ //BrowserAnimationsModule,
3723
+ common.CommonModule,
3724
+ ProductPageModule,
3725
+ ProductHdModule,
3726
+ ProductExternalSourceModule,
3727
+ corecomponents_v12.ButtonModule
3728
+ ],
3729
+ declarations: [
3730
+ IoneProductComponent
3731
+ ],
3732
+ exports: [
3733
+ IoneProductComponent
3734
+ ],
3735
+ schemas: [
3736
+ i0.CUSTOM_ELEMENTS_SCHEMA,
3737
+ i0.NO_ERRORS_SCHEMA
3738
+ ],
3739
+ bootstrap: [
3740
+ IoneProductComponent
3741
+ ],
3742
+ providers: [
3743
+ ProductSettingsService,
3744
+ ProductConnectorService,
3745
+ ProductEventService,
3746
+ ProductConnectorAdapterService
3747
+ ]
3748
+ },] }
3749
+ ];
3750
+
3658
3751
  /**
3659
3752
  * Generated bundle index. Do not edit.
3660
3753
  */