@daffodil/product-composite 0.83.0 → 0.85.0

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.
@@ -16,11 +16,11 @@ class DaffCompositeProductInMemoryDriverModule {
16
16
  ],
17
17
  };
18
18
  }
19
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
20
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, imports: [CommonModule] }); }
21
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, imports: [CommonModule] }); }
19
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
20
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, imports: [CommonModule] }); }
21
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, imports: [CommonModule] }); }
22
22
  }
23
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, decorators: [{
23
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, decorators: [{
24
24
  type: NgModule,
25
25
  args: [{
26
26
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-composite-driver-in-memory.mjs","sources":["../../../libs/product-composite/driver/in-memory/src/in-memory.module.ts","../../../libs/product-composite/driver/in-memory/src/daffodil-product-composite-driver-in-memory.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffProductExtraFactoryTypes } from '@daffodil/product/testing';\nimport { DaffCompositeProductFactory } from '@daffodil/product-composite/testing';\n\n/**\n * Module for providing the composite product factory to the product kind factory.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCompositeProductInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffCompositeProductInMemoryDriverModule> {\n return {\n ngModule: DaffCompositeProductInMemoryDriverModule,\n providers: [\n provideDaffProductExtraFactoryTypes(DaffCompositeProductFactory),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AASA;;AAEG;MAMU,wCAAwC,CAAA;AACnD,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,wCAAwC;AAClD,YAAA,SAAS,EAAE;gBACT,mCAAmC,CAAC,2BAA2B,CAAC;AACjE,aAAA;SACF;;iIAPQ,wCAAwC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAxC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wCAAwC,YAHjD,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wCAAwC,YAHjD,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGH,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBALpD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-product-composite-driver-in-memory.mjs","sources":["../../../libs/product-composite/driver/in-memory/src/in-memory.module.ts","../../../libs/product-composite/driver/in-memory/src/daffodil-product-composite-driver-in-memory.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffProductExtraFactoryTypes } from '@daffodil/product/testing';\nimport { DaffCompositeProductFactory } from '@daffodil/product-composite/testing';\n\n/**\n * Module for providing the composite product factory to the product kind factory.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCompositeProductInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffCompositeProductInMemoryDriverModule> {\n return {\n ngModule: DaffCompositeProductInMemoryDriverModule,\n providers: [\n provideDaffProductExtraFactoryTypes(DaffCompositeProductFactory),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AASA;;AAEG;MAMU,wCAAwC,CAAA;AACnD,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,wCAAwC;AAClD,YAAA,SAAS,EAAE;gBACT,mCAAmC,CAAC,2BAA2B,CAAC;AACjE,aAAA;SACF;;kIAPQ,wCAAwC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAxC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wCAAwC,YAHjD,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wCAAwC,YAHjD,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAGH,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBALpD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;;;;"}
@@ -9,11 +9,11 @@ import { MockMagentoCoreProduct } from '@daffodil/product/driver/magento/testing
9
9
  class MockMagentoBundledProductItemOption {
10
10
  constructor(simpleFactory) {
11
11
  this.simpleFactory = simpleFactory;
12
- this.uid = faker.datatype.uuid();
13
- this.label = faker.random.word();
14
- this.quantity = faker.datatype.number({ min: 1, max: 20 });
12
+ this.uid = faker.string.uuid();
13
+ this.label = faker.lorem.word();
14
+ this.quantity = faker.number.int({ min: 1, max: 20 });
15
15
  this.is_default = faker.datatype.boolean();
16
- this.position = faker.datatype.number({ min: 1, max: 10 });
16
+ this.position = faker.number.int({ min: 1, max: 10 });
17
17
  this.product = this.createProduct();
18
18
  }
19
19
  createProduct() {
@@ -27,10 +27,10 @@ class MagentoBundledProductItemOptionFactory extends DaffModelFactory {
27
27
  constructor(simpleFactory) {
28
28
  super(MockMagentoBundledProductItemOption, simpleFactory);
29
29
  }
30
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MagentoBundledProductItemOptionFactory, deps: [{ token: i1.MagentoSimpleProductFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
31
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MagentoBundledProductItemOptionFactory, providedIn: 'root' }); }
30
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoBundledProductItemOptionFactory, deps: [{ token: i1.MagentoSimpleProductFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
31
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoBundledProductItemOptionFactory, providedIn: 'root' }); }
32
32
  }
33
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MagentoBundledProductItemOptionFactory, decorators: [{
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoBundledProductItemOptionFactory, decorators: [{
34
34
  type: Injectable,
35
35
  args: [{
36
36
  providedIn: 'root',
@@ -41,13 +41,13 @@ class MockMagentoBundledProductItem {
41
41
  constructor(optionFactory) {
42
42
  this.optionFactory = optionFactory;
43
43
  this.required = faker.datatype.boolean();
44
- this.title = faker.random.word();
45
- this.type = faker.random.word();
44
+ this.title = faker.lorem.word();
45
+ this.type = faker.lorem.word();
46
46
  this.options = this.createOptions();
47
- this.option_id = faker.datatype.number({ min: 1, max: 9999 });
47
+ this.option_id = faker.number.int({ min: 1, max: 9999 });
48
48
  }
49
49
  createOptions() {
50
- return this.optionFactory.createMany(faker.datatype.number({ min: 1, max: 5 }));
50
+ return this.optionFactory.createMany(faker.number.int({ min: 1, max: 5 }));
51
51
  }
52
52
  }
53
53
  /**
@@ -57,10 +57,10 @@ class MagentoBundledProductItemFactory extends DaffModelFactory {
57
57
  constructor(optionFactory) {
58
58
  super(MockMagentoBundledProductItem, optionFactory);
59
59
  }
60
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MagentoBundledProductItemFactory, deps: [{ token: MagentoBundledProductItemOptionFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
61
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MagentoBundledProductItemFactory, providedIn: 'root' }); }
60
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoBundledProductItemFactory, deps: [{ token: MagentoBundledProductItemOptionFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
61
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoBundledProductItemFactory, providedIn: 'root' }); }
62
62
  }
63
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MagentoBundledProductItemFactory, decorators: [{
63
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoBundledProductItemFactory, decorators: [{
64
64
  type: Injectable,
65
65
  args: [{
66
66
  providedIn: 'root',
@@ -75,7 +75,7 @@ class MockMagentoBundledProduct extends MockMagentoCoreProduct {
75
75
  this.items = this.createBundleItems();
76
76
  }
77
77
  createBundleItems() {
78
- return this.bundleItemFactory.createMany(faker.datatype.number({ min: 1, max: 5 }));
78
+ return this.bundleItemFactory.createMany(faker.number.int({ min: 1, max: 5 }));
79
79
  }
80
80
  }
81
81
  /**
@@ -85,10 +85,10 @@ class MagentoBundledProductFactory extends DaffModelFactory {
85
85
  constructor(bundleItemFactory) {
86
86
  super(MockMagentoBundledProduct, bundleItemFactory);
87
87
  }
88
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MagentoBundledProductFactory, deps: [{ token: MagentoBundledProductItemFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
89
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MagentoBundledProductFactory, providedIn: 'root' }); }
88
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoBundledProductFactory, deps: [{ token: MagentoBundledProductItemFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
89
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoBundledProductFactory, providedIn: 'root' }); }
90
90
  }
91
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MagentoBundledProductFactory, decorators: [{
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MagentoBundledProductFactory, decorators: [{
92
92
  type: Injectable,
93
93
  args: [{
94
94
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-composite-driver-magento-testing.mjs","sources":["../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle-item-option.factory.ts","../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle-item.factory.ts","../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle.factory.ts","../../../libs/product-composite/driver/magento/testing/src/daffodil-product-composite-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoSimpleProduct } from '@daffodil/product/driver/magento';\nimport { MagentoSimpleProductFactory } from '@daffodil/product/driver/magento/testing';\nimport { MagentoBundledProductItemOption } from '@daffodil/product-composite/driver/magento';\n\n\nexport class MockMagentoBundledProductItemOption implements MagentoBundledProductItemOption {\n constructor(\n private simpleFactory: MagentoSimpleProductFactory,\n ) {}\n\n uid = faker.datatype.uuid();\n label = faker.random.word();\n quantity = faker.datatype.number({ min: 1, max: 20 });\n is_default = faker.datatype.boolean();\n position = faker.datatype.number({ min: 1, max: 10 });\n product = this.createProduct();\n\n protected createProduct(): MagentoSimpleProduct {\n return this.simpleFactory.create();\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductItemOptionFactory extends DaffModelFactory<MagentoBundledProductItemOption> {\n constructor(\n simpleFactory: MagentoSimpleProductFactory,\n ) {\n super(MockMagentoBundledProductItemOption, simpleFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n MagentoBundledProductItem,\n MagentoBundledProductItemOption,\n} from '@daffodil/product-composite/driver/magento';\n\nimport { MagentoBundledProductItemOptionFactory } from './bundle-item-option.factory';\n\n\nexport class MockMagentoBundledProductItem implements MagentoBundledProductItem {\n constructor(\n private optionFactory: MagentoBundledProductItemOptionFactory,\n ) {}\n required = faker.datatype.boolean();\n title = faker.random.word();\n type = faker.random.word();\n options = this.createOptions();\n option_id = faker.datatype.number({ min: 1, max: 9999 });\n\n protected createOptions(): MagentoBundledProductItemOption[] {\n return this.optionFactory.createMany(faker.datatype.number({ min: 1, max: 5 }));\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductItemFactory extends DaffModelFactory<MagentoBundledProductItem> {\n constructor(\n optionFactory: MagentoBundledProductItemOptionFactory,\n ) {\n super(MockMagentoBundledProductItem, optionFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoProductTypeEnum } from '@daffodil/product/driver/magento';\nimport { MockMagentoCoreProduct } from '@daffodil/product/driver/magento/testing';\nimport {\n MagentoBundledProduct,\n MagentoBundledProductItem,\n} from '@daffodil/product-composite/driver/magento';\n\nimport { MagentoBundledProductItemFactory } from './bundle-item.factory';\n\n\nexport class MockMagentoBundledProduct extends MockMagentoCoreProduct implements MagentoBundledProduct {\n constructor(\n private bundleItemFactory: MagentoBundledProductItemFactory,\n ) {\n super();\n }\n\n __typename = MagentoProductTypeEnum.BundledProduct;\n items = this.createBundleItems();\n\n protected createBundleItems(): MagentoBundledProductItem[] {\n return this.bundleItemFactory.createMany(faker.datatype.number({ min: 1, max: 5 }));\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductFactory extends DaffModelFactory<MagentoBundledProduct> {\n constructor(\n bundleItemFactory: MagentoBundledProductItemFactory,\n ) {\n super(MockMagentoBundledProduct, bundleItemFactory);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.MagentoBundledProductItemOptionFactory","i1.MagentoBundledProductItemFactory"],"mappings":";;;;;;;;MASa,mCAAmC,CAAA;AAC9C,IAAA,WAAA,CACU,aAA0C,EAAA;QAA1C,IAAa,CAAA,aAAA,GAAb,aAAa;AAGvB,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE;AAC3B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE;AAC3B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;AACrD,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE;AAC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CAAC,iBAAiB,EAAE;;IAEtB,iBAAiB,GAAA;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;;AAEtF;AAED;;AAEG;AAIG,MAAO,4BAA6B,SAAQ,gBAAuC,CAAA;AACvF,IAAA,WAAA,CACE,iBAAmD,EAAA;AAEnD,QAAA,KAAK,CAAC,yBAAyB,EAAE,iBAAiB,CAAC;;iIAJ1C,4BAA4B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAC,gCAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA5B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,cAF3B,MAAM,EAAA,CAAA,CAAA;;2FAEP,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBAHxC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AClCD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-product-composite-driver-magento-testing.mjs","sources":["../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle-item-option.factory.ts","../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle-item.factory.ts","../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle.factory.ts","../../../libs/product-composite/driver/magento/testing/src/daffodil-product-composite-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoSimpleProduct } from '@daffodil/product/driver/magento';\nimport { MagentoSimpleProductFactory } from '@daffodil/product/driver/magento/testing';\nimport { MagentoBundledProductItemOption } from '@daffodil/product-composite/driver/magento';\n\n\nexport class MockMagentoBundledProductItemOption implements MagentoBundledProductItemOption {\n constructor(\n private simpleFactory: MagentoSimpleProductFactory,\n ) {}\n\n uid = faker.string.uuid();\n label = faker.lorem.word();\n quantity = faker.number.int({ min: 1, max: 20 });\n is_default = faker.datatype.boolean();\n position = faker.number.int({ min: 1, max: 10 });\n product = this.createProduct();\n\n protected createProduct(): MagentoSimpleProduct {\n return this.simpleFactory.create();\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductItemOptionFactory extends DaffModelFactory<MagentoBundledProductItemOption> {\n constructor(\n simpleFactory: MagentoSimpleProductFactory,\n ) {\n super(MockMagentoBundledProductItemOption, simpleFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n MagentoBundledProductItem,\n MagentoBundledProductItemOption,\n} from '@daffodil/product-composite/driver/magento';\n\nimport { MagentoBundledProductItemOptionFactory } from './bundle-item-option.factory';\n\n\nexport class MockMagentoBundledProductItem implements MagentoBundledProductItem {\n constructor(\n private optionFactory: MagentoBundledProductItemOptionFactory,\n ) {}\n required = faker.datatype.boolean();\n title = faker.lorem.word();\n type = faker.lorem.word();\n options = this.createOptions();\n option_id = faker.number.int({ min: 1, max: 9999 });\n\n protected createOptions(): MagentoBundledProductItemOption[] {\n return this.optionFactory.createMany(faker.number.int({ min: 1, max: 5 }));\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductItemFactory extends DaffModelFactory<MagentoBundledProductItem> {\n constructor(\n optionFactory: MagentoBundledProductItemOptionFactory,\n ) {\n super(MockMagentoBundledProductItem, optionFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoProductTypeEnum } from '@daffodil/product/driver/magento';\nimport { MockMagentoCoreProduct } from '@daffodil/product/driver/magento/testing';\nimport {\n MagentoBundledProduct,\n MagentoBundledProductItem,\n} from '@daffodil/product-composite/driver/magento';\n\nimport { MagentoBundledProductItemFactory } from './bundle-item.factory';\n\n\nexport class MockMagentoBundledProduct extends MockMagentoCoreProduct implements MagentoBundledProduct {\n constructor(\n private bundleItemFactory: MagentoBundledProductItemFactory,\n ) {\n super();\n }\n\n __typename = MagentoProductTypeEnum.BundledProduct;\n items = this.createBundleItems();\n\n protected createBundleItems(): MagentoBundledProductItem[] {\n return this.bundleItemFactory.createMany(faker.number.int({ min: 1, max: 5 }));\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductFactory extends DaffModelFactory<MagentoBundledProduct> {\n constructor(\n bundleItemFactory: MagentoBundledProductItemFactory,\n ) {\n super(MockMagentoBundledProduct, bundleItemFactory);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.MagentoBundledProductItemOptionFactory","i1.MagentoBundledProductItemFactory"],"mappings":";;;;;;;;MASa,mCAAmC,CAAA;AAC9C,IAAA,WAAA,CACU,aAA0C,EAAA;QAA1C,IAAa,CAAA,aAAA,GAAb,aAAa;AAGvB,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE;AACzB,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;AAC1B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE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AAA,UAAU,GAAG,sBAAsB,CAAC,cAAc;AAClD,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,CAAC,iBAAiB,EAAE;;IAEtB,iBAAiB,GAAA;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;;AAEjF;AAED;;AAEG;AAIG,MAAO,4BAA6B,SAAQ,gBAAuC,CAAA;AACvF,IAAA,WAAA,CACE,iBAAmD,EAAA;AAEnD,QAAA,KAAK,CAAC,yBAAyB,EAAE,iBAAiB,CAAC;;kIAJ1C,4BAA4B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAC,gCAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA5B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,cAF3B,MAAM,EAAA,CAAA,CAAA;;4FAEP,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBAHxC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AClCD;;AAEG;;;;"}
@@ -2,7 +2,7 @@ import { gql } from 'apollo-angular';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
4
  import { NgModule } from '@angular/core';
5
- import { MagentoProductStockStatusEnum, provideDaffProductMagentoExtraProductFragments, provideDaffProductMagentoExtraProductTransforms, MagentoProductTypeEnum, provideDaffProductMagentoExtraProductPreviewTransforms } from '@daffodil/product/driver/magento';
5
+ import { MagentoProductStockStatusEnum, provideDaffProductMagentoExtraProductFragments, provideDaffProductMagentoExtraProductTransforms, provideDaffProductMagentoExtraProductPreviewTransforms, MagentoProductTypeEnum } from '@daffodil/product/driver/magento';
6
6
  import { DaffProductTypeEnum } from '@daffodil/product';
7
7
 
8
8
  const magentoBundledProductFragment = gql `
@@ -122,11 +122,11 @@ class DaffCompositeProductMagentoDriverModule {
122
122
  ],
123
123
  };
124
124
  }
125
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
126
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, imports: [CommonModule] }); }
127
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, imports: [CommonModule] }); }
125
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
126
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, imports: [CommonModule] }); }
127
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, imports: [CommonModule] }); }
128
128
  }
129
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, decorators: [{
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, decorators: [{
130
130
  type: NgModule,
131
131
  args: [{
132
132
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-composite-driver-magento.mjs","sources":["../../../libs/product-composite/driver/magento/src/fragments/bundled-product.ts","../../../libs/product-composite/driver/magento/src/transforms/bundled-product-transformers.ts","../../../libs/product-composite/driver/magento/src/composite-product-driver.module.ts","../../../libs/product-composite/driver/magento/src/models/bundled-product.ts","../../../libs/product-composite/driver/magento/src/daffodil-product-composite-driver-magento.ts"],"sourcesContent":["import { gql } from 'apollo-angular';\n\nexport const magentoBundledProductFragment = gql`\nfragment magentoBundledProduct on BundleProduct {\n\titems {\n\t\toption_id\n\t\trequired\n\t\ttitle\n\t\ttype\n\t\toptions {\n\t\t\tuid\n\t\t\tis_default\n\t\t\tlabel\n\t\t\tquantity\n position\n\t\t\tproduct {\n\t\t\t\tstock_status\n\t\t\t\tprice_range {\n\t\t\t\t\tmaximum_price {\n\t\t\t\t\t\tregular_price {\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\tcurrency\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdiscount {\n\t\t\t\t\t\t\tamount_off\n\t\t\t\t\t\t\tpercent_off\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n`;\n","import {\n DaffProductDiscount,\n DaffProductTypeEnum,\n DaffProduct,\n} from '@daffodil/product';\nimport { MagentoProductStockStatusEnum } from '@daffodil/product/driver/magento';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n DaffCompositeProductItemInputEnum,\n} from '@daffodil/product-composite';\n\nimport {\n MagentoBundledProduct,\n MagentoBundledProductItem,\n MagentoBundledProductItemOption,\n MagentoBundledProductItemOptionProduct,\n} from '../models/bundled-product';\n\n/**\n * Transforms the magento MagentoProduct from the magento product query into a DaffProduct.\n *\n * @param response the response from a magento product query.\n */\nexport function transformMagentoBundledProduct(\n daffProduct: DaffProduct,\n { items }: MagentoBundledProduct,\n): DaffCompositeProduct {\n return {\n ...daffProduct,\n ...items.length > 0 ? {\n price: 0,\n discount: {\n amount: 0,\n percent: 0,\n },\n } : {},\n type: DaffProductTypeEnum.Composite,\n items: items.map(transformMagentoBundledProductItem),\n };\n}\n\nfunction transformMagentoBundledProductItem(item: MagentoBundledProductItem): DaffCompositeProductItem {\n return {\n id: item.option_id.toString(),\n required: item.required,\n title: item.title,\n input_type: <DaffCompositeProductItemInputEnum>item.type,\n options: Array.from(item.options).sort((a, b) => a.position - b.position).map(transformMagentoBundledProductItemOption),\n };\n}\n\nfunction transformMagentoBundledProductItemOption(option: MagentoBundledProductItemOption): DaffCompositeProductItemOption {\n return {\n id: option.uid.toString(),\n type: DaffProductTypeEnum.Simple,\n url: null,\n name: option.label,\n price: getPrice(option.product),\n images: [],\n thumbnail: null,\n discount: getDiscount(option.product),\n quantity: option.quantity,\n is_default: option.is_default,\n in_stock: option.product.stock_status === MagentoProductStockStatusEnum.InStock,\n };\n}\n\n/**\n * A function for null checking an object.\n */\nfunction getPrice(product: MagentoBundledProductItemOptionProduct): number {\n return product.price_range?.maximum_price?.regular_price?.value || null;\n}\n\nfunction getDiscount(product: MagentoBundledProductItemOptionProduct): DaffProductDiscount {\n return product.price_range?.maximum_price?.discount\n ? {\n amount: product.price_range.maximum_price.discount.amount_off,\n percent: product.price_range.maximum_price.discount.percent_off,\n } : { amount: null, percent: null };\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n provideDaffProductMagentoExtraProductTransforms,\n MagentoProductTypeEnum,\n provideDaffProductMagentoExtraProductFragments,\n provideDaffProductMagentoExtraProductPreviewTransforms,\n} from '@daffodil/product/driver/magento';\n\nimport { magentoBundledProductFragment } from './fragments/bundled-product';\nimport { MagentoBundledProduct } from './public_api';\nimport { transformMagentoBundledProduct } from './transforms/bundled-product-transformers';\n\n/**\n * A module that provides the product fragment for composite products along with a composite product transformer.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCompositeProductMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffCompositeProductMagentoDriverModule> {\n return {\n ngModule: DaffCompositeProductMagentoDriverModule,\n providers: [\n ...provideDaffProductMagentoExtraProductFragments(magentoBundledProductFragment),\n ...provideDaffProductMagentoExtraProductTransforms<MagentoBundledProduct>(\n (daffProduct, magentoProduct) =>\n magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct\n ? transformMagentoBundledProduct(daffProduct, magentoProduct)\n : daffProduct,\n ),\n // stub out composite fields for a preview\n ...provideDaffProductMagentoExtraProductPreviewTransforms<MagentoBundledProduct>(\n (daffProduct, magentoProduct) =>\n magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct\n ? {\n ...daffProduct,\n items: [],\n price: 0,\n discount: {\n amount: 0,\n percent: 0,\n },\n }\n : daffProduct,\n ),\n ],\n };\n }\n}\n","import {\n MagentoProduct,\n MagentoProductStockStatusEnum,\n} from '@daffodil/product/driver/magento';\n\nexport enum MagentoPriceTypeEnum {\n fixed = 'FIXED',\n percent = 'PERCENT',\n dynamic = 'DYNAMIC'\n}\n\nexport interface MagentoBundledProduct extends MagentoProduct {\n items: MagentoBundledProductItem[];\n}\n\nexport interface MagentoBundledProductItem {\n required: boolean;\n title: string;\n type: string;\n options: MagentoBundledProductItemOption[];\n option_id?: number;\n}\n\nexport interface MagentoBundledProductItemOption {\n uid: string;\n label: string;\n quantity: number;\n is_default: boolean;\n position: number;\n product: MagentoBundledProductItemOptionProduct;\n}\n\nexport interface MagentoBundledProductItemOptionProduct {\n stock_status?: MagentoProductStockStatusEnum;\n price_range: {\n maximum_price: {\n regular_price: {\n value: number;\n currency: any;\n };\n discount: {\n amount_off: number;\n percent_off: number;\n };\n };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEO,MAAM,6BAA6B,GAAG,GAAG,CA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AACR,wBAAA,QAAQ,EAAE;AACR,4BAAA,MAAM,EAAE,CAAC;AACT,4BAAA,OAAO,EAAE,CAAC;AACX,yBAAA;AACF;sBACC,WAAW,CAClB;AACF,aAAA;SACF;;iIA5BQ,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAvC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGH,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBALnD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ICnBW;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,GAI/B,EAAA,CAAA,CAAA;;ACTD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-product-composite-driver-magento.mjs","sources":["../../../libs/product-composite/driver/magento/src/fragments/bundled-product.ts","../../../libs/product-composite/driver/magento/src/transforms/bundled-product-transformers.ts","../../../libs/product-composite/driver/magento/src/composite-product-driver.module.ts","../../../libs/product-composite/driver/magento/src/models/bundled-product.ts","../../../libs/product-composite/driver/magento/src/daffodil-product-composite-driver-magento.ts"],"sourcesContent":["import { gql } from 'apollo-angular';\n\nexport const magentoBundledProductFragment = gql`\nfragment magentoBundledProduct on BundleProduct {\n\titems {\n\t\toption_id\n\t\trequired\n\t\ttitle\n\t\ttype\n\t\toptions {\n\t\t\tuid\n\t\t\tis_default\n\t\t\tlabel\n\t\t\tquantity\n position\n\t\t\tproduct {\n\t\t\t\tstock_status\n\t\t\t\tprice_range {\n\t\t\t\t\tmaximum_price {\n\t\t\t\t\t\tregular_price {\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\tcurrency\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdiscount {\n\t\t\t\t\t\t\tamount_off\n\t\t\t\t\t\t\tpercent_off\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n`;\n","import {\n DaffProductDiscount,\n DaffProductTypeEnum,\n DaffProduct,\n} from '@daffodil/product';\nimport { MagentoProductStockStatusEnum } from '@daffodil/product/driver/magento';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n DaffCompositeProductItemInputEnum,\n} from '@daffodil/product-composite';\n\nimport {\n MagentoBundledProduct,\n MagentoBundledProductItem,\n MagentoBundledProductItemOption,\n MagentoBundledProductItemOptionProduct,\n} from '../models/bundled-product';\n\n/**\n * Transforms the magento MagentoProduct from the magento product query into a DaffProduct.\n *\n * @param response the response from a magento product query.\n */\nexport function transformMagentoBundledProduct(\n daffProduct: DaffProduct,\n { items }: MagentoBundledProduct,\n): DaffCompositeProduct {\n return {\n ...daffProduct,\n ...items.length > 0 ? {\n price: 0,\n discount: {\n amount: 0,\n percent: 0,\n },\n } : {},\n type: DaffProductTypeEnum.Composite,\n items: items.map(transformMagentoBundledProductItem),\n };\n}\n\nfunction transformMagentoBundledProductItem(item: MagentoBundledProductItem): DaffCompositeProductItem {\n return {\n id: item.option_id.toString(),\n required: item.required,\n title: item.title,\n input_type: <DaffCompositeProductItemInputEnum>item.type,\n options: Array.from(item.options).sort((a, b) => a.position - b.position).map(transformMagentoBundledProductItemOption),\n };\n}\n\nfunction transformMagentoBundledProductItemOption(option: MagentoBundledProductItemOption): DaffCompositeProductItemOption {\n return {\n id: option.uid.toString(),\n type: DaffProductTypeEnum.Simple,\n url: null,\n name: option.label,\n price: getPrice(option.product),\n images: [],\n thumbnail: null,\n discount: getDiscount(option.product),\n quantity: option.quantity,\n is_default: option.is_default,\n in_stock: option.product.stock_status === MagentoProductStockStatusEnum.InStock,\n };\n}\n\n/**\n * A function for null checking an object.\n */\nfunction getPrice(product: MagentoBundledProductItemOptionProduct): number {\n return product.price_range?.maximum_price?.regular_price?.value || null;\n}\n\nfunction getDiscount(product: MagentoBundledProductItemOptionProduct): DaffProductDiscount {\n return product.price_range?.maximum_price?.discount\n ? {\n amount: product.price_range.maximum_price.discount.amount_off,\n percent: product.price_range.maximum_price.discount.percent_off,\n } : { amount: null, percent: null };\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n provideDaffProductMagentoExtraProductTransforms,\n MagentoProductTypeEnum,\n provideDaffProductMagentoExtraProductFragments,\n provideDaffProductMagentoExtraProductPreviewTransforms,\n} from '@daffodil/product/driver/magento';\n\nimport { magentoBundledProductFragment } from './fragments/bundled-product';\nimport { MagentoBundledProduct } from './public_api';\nimport { transformMagentoBundledProduct } from './transforms/bundled-product-transformers';\n\n/**\n * A module that provides the product fragment for composite products along with a composite product transformer.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCompositeProductMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffCompositeProductMagentoDriverModule> {\n return {\n ngModule: DaffCompositeProductMagentoDriverModule,\n providers: [\n ...provideDaffProductMagentoExtraProductFragments(magentoBundledProductFragment),\n ...provideDaffProductMagentoExtraProductTransforms<MagentoBundledProduct>(\n (daffProduct, magentoProduct) =>\n magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct\n ? transformMagentoBundledProduct(daffProduct, magentoProduct)\n : daffProduct,\n ),\n // stub out composite fields for a preview\n ...provideDaffProductMagentoExtraProductPreviewTransforms<MagentoBundledProduct>(\n (daffProduct, magentoProduct) =>\n magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct\n ? {\n ...daffProduct,\n items: [],\n price: 0,\n discount: {\n amount: 0,\n percent: 0,\n },\n }\n : daffProduct,\n ),\n ],\n };\n }\n}\n","import {\n MagentoProduct,\n MagentoProductStockStatusEnum,\n} from '@daffodil/product/driver/magento';\n\nexport enum MagentoPriceTypeEnum {\n fixed = 'FIXED',\n percent = 'PERCENT',\n dynamic = 'DYNAMIC'\n}\n\nexport interface MagentoBundledProduct extends MagentoProduct {\n items: MagentoBundledProductItem[];\n}\n\nexport interface MagentoBundledProductItem {\n required: boolean;\n title: string;\n type: string;\n options: MagentoBundledProductItemOption[];\n option_id?: number;\n}\n\nexport interface MagentoBundledProductItemOption {\n uid: string;\n label: string;\n quantity: number;\n is_default: boolean;\n position: number;\n product: MagentoBundledProductItemOptionProduct;\n}\n\nexport interface MagentoBundledProductItemOptionProduct {\n stock_status?: MagentoProductStockStatusEnum;\n price_range: {\n maximum_price: {\n regular_price: {\n value: number;\n currency: any;\n };\n discount: {\n amount_off: number;\n percent_off: number;\n };\n };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEO,MAAM,6BAA6B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkBhD;;;;AAIG;SACa,8BAA8B,CAC5C,WAAwB,EACxB,EAAE,KAAK,EAAyB,EAAA;IAEhC,OAAO;AACL,QAAA,GAAG,WAAW;AACd,QAAA,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG;AACp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AA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAvC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAGH,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBALnD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ICnBW;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,GAI/B,EAAA,CAAA,CAAA;;ACTD;;AAEG;;;;"}
@@ -16,11 +16,11 @@ class DaffCompositeProductTestingDriverModule {
16
16
  ],
17
17
  };
18
18
  }
19
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
20
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductTestingDriverModule, imports: [CommonModule] }); }
21
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductTestingDriverModule, imports: [CommonModule] }); }
19
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
20
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductTestingDriverModule, imports: [CommonModule] }); }
21
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductTestingDriverModule, imports: [CommonModule] }); }
22
22
  }
23
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductTestingDriverModule, decorators: [{
23
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductTestingDriverModule, decorators: [{
24
24
  type: NgModule,
25
25
  args: [{
26
26
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-composite-driver-testing.mjs","sources":["../../../libs/product-composite/driver/testing/src/testing.module.ts","../../../libs/product-composite/driver/testing/src/daffodil-product-composite-driver-testing.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffProductExtraFactoryTypes } from '@daffodil/product/testing';\nimport { DaffCompositeProductFactory } from '@daffodil/product-composite/testing';\n\n/**\n * Module for providing the composite product factory to the product kind factory.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCompositeProductTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffCompositeProductTestingDriverModule> {\n return {\n ngModule: DaffCompositeProductTestingDriverModule,\n providers: [\n provideDaffProductExtraFactoryTypes(DaffCompositeProductFactory),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AASA;;AAEG;MAMU,uCAAuC,CAAA;AAClD,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,uCAAuC;AACjD,YAAA,SAAS,EAAE;gBACT,mCAAmC,CAAC,2BAA2B,CAAC;AACjE,aAAA;SACF;;iIAPQ,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAvC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGH,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBALnD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-product-composite-driver-testing.mjs","sources":["../../../libs/product-composite/driver/testing/src/testing.module.ts","../../../libs/product-composite/driver/testing/src/daffodil-product-composite-driver-testing.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffProductExtraFactoryTypes } from '@daffodil/product/testing';\nimport { DaffCompositeProductFactory } from '@daffodil/product-composite/testing';\n\n/**\n * Module for providing the composite product factory to the product kind factory.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCompositeProductTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffCompositeProductTestingDriverModule> {\n return {\n ngModule: DaffCompositeProductTestingDriverModule,\n providers: [\n provideDaffProductExtraFactoryTypes(DaffCompositeProductFactory),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AASA;;AAEG;MAMU,uCAAuC,CAAA;AAClD,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,uCAAuC;AACjD,YAAA,SAAS,EAAE;gBACT,mCAAmC,CAAC,2BAA2B,CAAC;AACjE,aAAA;SACF;;kIAPQ,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAvC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAGH,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBALnD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Injectable, Inject, NgModule } from '@angular/core';
2
+ import { InjectionToken, inject, Inject, Injectable, NgModule } from '@angular/core';
3
3
  import { DaffBase64ServiceToken, createConfigInjectionToken } from '@daffodil/core';
4
4
  import * as i1 from '@ngrx/effects';
5
5
  import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
@@ -40,10 +40,10 @@ class DaffProductCompositeQueryParamService {
40
40
  get() {
41
41
  return (new URL(this.document.location.toString())).searchParams.get(this.config.compositeSelectionQueryParam);
42
42
  }
43
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductCompositeQueryParamService, deps: [{ token: DOCUMENT }, { token: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
44
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductCompositeQueryParamService }); }
43
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffProductCompositeQueryParamService, deps: [{ token: DOCUMENT }, { token: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
44
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffProductCompositeQueryParamService }); }
45
45
  }
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductCompositeQueryParamService, decorators: [{
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffProductCompositeQueryParamService, decorators: [{
47
47
  type: Injectable
48
48
  }], ctorParameters: () => [{ type: undefined, decorators: [{
49
49
  type: Inject,
@@ -98,10 +98,10 @@ class DaffProductCompositePageEffects {
98
98
  return of(...applyActions);
99
99
  })));
100
100
  }
101
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductCompositePageEffects, deps: [{ token: i1.Actions }, { token: DaffProductCompositeQueryParamService }, { token: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
102
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductCompositePageEffects }); }
101
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffProductCompositePageEffects, deps: [{ token: i1.Actions }, { token: DaffProductCompositeQueryParamService }, { token: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
102
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffProductCompositePageEffects }); }
103
103
  }
104
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductCompositePageEffects, decorators: [{
104
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffProductCompositePageEffects, decorators: [{
105
105
  type: Injectable
106
106
  }], ctorParameters: () => [{ type: i1.Actions }, { type: DaffProductCompositeQueryParamService }, { type: undefined, decorators: [{
107
107
  type: Inject,
@@ -117,13 +117,13 @@ class DaffProductCompositeRoutingModule {
117
117
  ],
118
118
  };
119
119
  }
120
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductCompositeRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
121
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffProductCompositeRoutingModule, imports: [i1.EffectsFeatureModule] }); }
122
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductCompositeRoutingModule, providers: [
120
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffProductCompositeRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
121
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.11", ngImport: i0, type: DaffProductCompositeRoutingModule, imports: [i1.EffectsFeatureModule] }); }
122
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffProductCompositeRoutingModule, providers: [
123
123
  DaffProductCompositeQueryParamService,
124
124
  ], imports: [EffectsModule.forFeature([DaffProductCompositePageEffects])] }); }
125
125
  }
126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductCompositeRoutingModule, decorators: [{
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffProductCompositeRoutingModule, decorators: [{
127
127
  type: NgModule,
128
128
  args: [{
129
129
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-composite-routing.mjs","sources":["../../../libs/product-composite/routing/src/config/default.ts","../../../libs/product-composite/routing/src/config/token.ts","../../../libs/product-composite/routing/src/services/query-param.service.ts","../../../libs/product-composite/routing/src/effects/product-page.effects.ts","../../../libs/product-composite/routing/src/module.ts","../../../libs/product-composite/routing/src/daffodil-product-composite-routing.ts"],"sourcesContent":["import {\n InjectionToken,\n inject,\n} from '@angular/core';\n\nimport {\n DaffBase64Service,\n DaffBase64ServiceToken,\n} from '@daffodil/core';\n\nimport { DaffProductCompositeRoutingConfig } from './interface';\n\n/**\n * The default configuration for the {@link DaffProductCompositeRoutingConfig}.\n */\nexport const daffProductCompositeRoutingConfigDefaultFactory = (base64: DaffBase64Service): DaffProductCompositeRoutingConfig => ({\n compositeSelectionQueryParam: 'composite_selection',\n compositeSelectionQueryParamDecode: (queryParam: string) => JSON.parse(base64.decode(queryParam)),\n});\n\nexport const DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT = new InjectionToken<DaffProductCompositeRoutingConfig>(\n 'DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT',\n { factory: () => daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)) },\n);\n","import { createConfigInjectionToken } from '@daffodil/core';\n\nimport { DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT } from './default';\nimport { DaffProductCompositeRoutingConfig } from './interface';\n\nexport const {\n /**\n * The token used to provide @daffodil/product-composite/routing config data.\n */\n token: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n /**\n * Provides the {@link DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG} token.\n */\n provider: provideDaffProductCompositeRoutingConfig,\n} = createConfigInjectionToken<DaffProductCompositeRoutingConfig>(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT, 'DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG');\n","import { DOCUMENT } from '@angular/common';\nimport {\n Inject,\n Injectable,\n} from '@angular/core';\n\nimport {\n DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n DaffProductCompositeRoutingConfig,\n} from '../config/public_api';\n\n@Injectable()\nexport class DaffProductCompositeQueryParamService {\n\n constructor(\n @Inject(DOCUMENT) private document: any,\n @Inject(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG) private config: DaffProductCompositeRoutingConfig) {\n }\n\n /**\n * Get the value of the configured composite selection query param.\n */\n public get(): string {\n return (\n new URL((<any>this.document).location.toString())\n ).searchParams.get(this.config.compositeSelectionQueryParam);\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport {\n EMPTY,\n Observable,\n of,\n} from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\n\nimport { DaffProductTypeEnum } from '@daffodil/product';\nimport {\n DaffProductPageActionTypes,\n DaffProductPageLoadSuccess,\n} from '@daffodil/product/state';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n DaffProductCompositeSelectionPayload,\n} from '@daffodil/product-composite';\nimport { DaffCompositeProductApplyOption } from '@daffodil/product-composite/state';\n\nimport {\n DaffProductCompositeRoutingConfig,\n DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n} from '../config/public_api';\nimport { DaffProductCompositeQueryParamService } from '../services/query-param.service';\n\n/**\n * Builds the apply actions from the list of selected options.\n */\nfunction buildApplyActions<T extends DaffCompositeProduct = DaffCompositeProduct>(product: DaffCompositeProduct, itemId: DaffCompositeProductItem['id'], selectedOptions: DaffCompositeProductItemOption['id'][]): DaffCompositeProductApplyOption<T>[] {\n const selectionItem = product.items.find(({ id }) => id === itemId);\n\n return selectionItem\n ? selectedOptions.map(selectionOptionId => {\n // use the quantity of the referenced option\n const qty = selectionItem?.options.find(({ id }) => id === selectionOptionId)?.quantity;\n\n return new DaffCompositeProductApplyOption(product.id, itemId, selectionOptionId, qty);\n })\n : [];\n}\n\n/**\n * Handles composite product specific actions for the product page.\n */\n@Injectable()\nexport class DaffProductCompositePageEffects<T extends DaffCompositeProduct = DaffCompositeProduct> {\n constructor(\n private actions$: Actions,\n private paramGetter: DaffProductCompositeQueryParamService,\n @Inject(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG) private config: DaffProductCompositeRoutingConfig,\n ) {}\n\n /**\n * Applies composite item options based on the value of the configured query param.\n */\n preselectCompositeOptions$: Observable<typeof EMPTY | DaffCompositeProductApplyOption<T>> = createEffect(() => this.actions$.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction),\n switchMap((action: DaffProductPageLoadSuccess<T>) => {\n const queryParam = this.paramGetter.get();\n\n // get the product corresponding to the current product page\n const product: DaffCompositeProduct = action.payload.products.filter(({ id }) => id === action.payload.id)[0];\n\n // if we don't have a query param set or if the product isn't composite,\n // we have nothing to do\n if (!queryParam || product?.type !== DaffProductTypeEnum.Composite) {\n return EMPTY;\n }\n\n let selection: DaffProductCompositeSelectionPayload;\n\n try {\n selection = this.config.compositeSelectionQueryParamDecode(queryParam, product);\n } catch (error) {\n return EMPTY;\n }\n\n const applyActions = Object.keys(selection).reduce<DaffCompositeProductApplyOption<T>[]>(\n (actions, itemId) => actions.concat(buildApplyActions(product, itemId, selection[itemId])),\n [],\n );\n\n // dispatch each of the apply actions into the action stream\n return of(...applyActions);\n }),\n ));\n}\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\n\nimport {\n DaffProductCompositeRoutingConfig,\n provideDaffProductCompositeRoutingConfig,\n} from './config/public_api';\nimport { DaffProductCompositePageEffects } from './effects/public_api';\nimport { DaffProductCompositeQueryParamService } from './services/query-param.service';\n\n@NgModule({\n imports: [\n EffectsModule.forFeature([DaffProductCompositePageEffects]),\n ],\n providers: [\n DaffProductCompositeQueryParamService,\n ],\n})\nexport class DaffProductCompositeRoutingModule {\n static withConfig(config?: DaffProductCompositeRoutingConfig): ModuleWithProviders<DaffProductCompositeRoutingModule> {\n return {\n ngModule: DaffProductCompositeRoutingModule,\n providers: [\n provideDaffProductCompositeRoutingConfig(config),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAYA;;AAEG;MACU,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A,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iCAAiC,EAJjC,SAAA,EAAA;YACT,qCAAqC;AACtC,SAAA,EAAA,OAAA,EAAA,CAJC,aAAa,CAAC,UAAU,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;2FAMlD,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAR7C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,aAAa,CAAC,UAAU,CAAC,CAAC,+BAA+B,CAAC,CAAC;AAC5D,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,qCAAqC;AACtC,qBAAA;AACF,iBAAA;;;ACpBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-product-composite-routing.mjs","sources":["../../../libs/product-composite/routing/src/config/default.ts","../../../libs/product-composite/routing/src/config/token.ts","../../../libs/product-composite/routing/src/services/query-param.service.ts","../../../libs/product-composite/routing/src/effects/product-page.effects.ts","../../../libs/product-composite/routing/src/module.ts","../../../libs/product-composite/routing/src/daffodil-product-composite-routing.ts"],"sourcesContent":["import {\n InjectionToken,\n inject,\n} from '@angular/core';\n\nimport {\n DaffBase64Service,\n DaffBase64ServiceToken,\n} from '@daffodil/core';\n\nimport { DaffProductCompositeRoutingConfig } from './interface';\n\n/**\n * The default configuration for the {@link DaffProductCompositeRoutingConfig}.\n */\nexport const daffProductCompositeRoutingConfigDefaultFactory = (base64: DaffBase64Service): DaffProductCompositeRoutingConfig => ({\n compositeSelectionQueryParam: 'composite_selection',\n compositeSelectionQueryParamDecode: (queryParam: string) => JSON.parse(base64.decode(queryParam)),\n});\n\nexport const DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT = new InjectionToken<DaffProductCompositeRoutingConfig>(\n 'DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT',\n { factory: () => daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)) },\n);\n","import { createConfigInjectionToken } from '@daffodil/core';\n\nimport { DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT } from './default';\nimport { DaffProductCompositeRoutingConfig } from './interface';\n\nexport const {\n /**\n * The token used to provide @daffodil/product-composite/routing config data.\n */\n token: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n /**\n * Provides the {@link DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG} token.\n */\n provider: provideDaffProductCompositeRoutingConfig,\n} = createConfigInjectionToken<DaffProductCompositeRoutingConfig>(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT, 'DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG');\n","import { DOCUMENT } from '@angular/common';\nimport {\n Inject,\n Injectable,\n} from '@angular/core';\n\nimport {\n DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n DaffProductCompositeRoutingConfig,\n} from '../config/public_api';\n\n@Injectable()\nexport class DaffProductCompositeQueryParamService {\n\n constructor(\n @Inject(DOCUMENT) private document: any,\n @Inject(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG) private config: DaffProductCompositeRoutingConfig) {\n }\n\n /**\n * Get the value of the configured composite selection query param.\n */\n public get(): string {\n return (\n new URL((<any>this.document).location.toString())\n ).searchParams.get(this.config.compositeSelectionQueryParam);\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport {\n EMPTY,\n Observable,\n of,\n} from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\n\nimport { DaffProductTypeEnum } from '@daffodil/product';\nimport {\n DaffProductPageActionTypes,\n DaffProductPageLoadSuccess,\n} from '@daffodil/product/state';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n DaffProductCompositeSelectionPayload,\n} from '@daffodil/product-composite';\nimport { DaffCompositeProductApplyOption } from '@daffodil/product-composite/state';\n\nimport {\n DaffProductCompositeRoutingConfig,\n DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n} from '../config/public_api';\nimport { DaffProductCompositeQueryParamService } from '../services/query-param.service';\n\n/**\n * Builds the apply actions from the list of selected options.\n */\nfunction buildApplyActions<T extends DaffCompositeProduct = DaffCompositeProduct>(product: DaffCompositeProduct, itemId: DaffCompositeProductItem['id'], selectedOptions: DaffCompositeProductItemOption['id'][]): DaffCompositeProductApplyOption<T>[] {\n const selectionItem = product.items.find(({ id }) => id === itemId);\n\n return selectionItem\n ? selectedOptions.map(selectionOptionId => {\n // use the quantity of the referenced option\n const qty = selectionItem?.options.find(({ id }) => id === selectionOptionId)?.quantity;\n\n return new DaffCompositeProductApplyOption(product.id, itemId, selectionOptionId, qty);\n })\n : [];\n}\n\n/**\n * Handles composite product specific actions for the product page.\n */\n@Injectable()\nexport class DaffProductCompositePageEffects<T extends DaffCompositeProduct = DaffCompositeProduct> {\n constructor(\n private actions$: Actions,\n private paramGetter: DaffProductCompositeQueryParamService,\n @Inject(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG) private config: DaffProductCompositeRoutingConfig,\n ) {}\n\n /**\n * Applies composite item options based on the value of the configured query param.\n */\n preselectCompositeOptions$: Observable<typeof EMPTY | DaffCompositeProductApplyOption<T>> = createEffect(() => this.actions$.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction),\n switchMap((action: DaffProductPageLoadSuccess<T>) => {\n const queryParam = this.paramGetter.get();\n\n // get the product corresponding to the current product page\n const product: DaffCompositeProduct = action.payload.products.filter(({ id }) => id === action.payload.id)[0];\n\n // if we don't have a query param set or if the product isn't composite,\n // we have nothing to do\n if (!queryParam || product?.type !== DaffProductTypeEnum.Composite) {\n return EMPTY;\n }\n\n let selection: DaffProductCompositeSelectionPayload;\n\n try {\n selection = this.config.compositeSelectionQueryParamDecode(queryParam, product);\n } catch (error) {\n return EMPTY;\n }\n\n const applyActions = Object.keys(selection).reduce<DaffCompositeProductApplyOption<T>[]>(\n (actions, itemId) => actions.concat(buildApplyActions(product, itemId, selection[itemId])),\n [],\n );\n\n // dispatch each of the apply actions into the action stream\n return of(...applyActions);\n }),\n ));\n}\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\n\nimport {\n DaffProductCompositeRoutingConfig,\n provideDaffProductCompositeRoutingConfig,\n} from './config/public_api';\nimport { DaffProductCompositePageEffects } from './effects/public_api';\nimport { DaffProductCompositeQueryParamService } from './services/query-param.service';\n\n@NgModule({\n imports: [\n EffectsModule.forFeature([DaffProductCompositePageEffects]),\n ],\n providers: [\n DaffProductCompositeQueryParamService,\n ],\n})\nexport class DaffProductCompositeRoutingModule {\n static withConfig(config?: DaffProductCompositeRoutingConfig): ModuleWithProviders<DaffProductCompositeRoutingModule> {\n return {\n ngModule: DaffProductCompositeRoutingModule,\n providers: [\n provideDaffProductCompositeRoutingConfig(config),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAYA;;AAEG;MACU,+CAA+C,GAAG,CAAC,MAAyB,MAAyC;AAChI,IAAA,4BAA4B,EAAE,qBAAqB;AACnD,IAAA,kCAAkC,EAAE,CAAC,UAAkB,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAClG,CAAA;AAEY,MAAA,6CAA6C,GAAG,IAAI,cAAc,CAC7E,+CAA+C,EAC/C,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,EAAE;;ACjBvF,MAAA;AACX;;AAEG;AACH,KAAK,EAAE,qCAAqC;AAC5C;;AAEG;AACH,QAAQ,EAAE,wCAAwC,GACnD,GAAG,0BAA0B,CAAoC,6CAA6C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AA,SAAS,EAAE;wBACT,qCAAqC;AACtC,qBAAA;AACF,iBAAA;;;ACpBD;;AAEG;;;;"}
@@ -38,22 +38,22 @@ class MockDaffCompositeProductFacade {
38
38
  return false;
39
39
  }
40
40
  ;
41
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffCompositeProductFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
42
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffCompositeProductFacade, providedIn: 'root' }); }
41
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MockDaffCompositeProductFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
42
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MockDaffCompositeProductFacade, providedIn: 'root' }); }
43
43
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffCompositeProductFacade, decorators: [{
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MockDaffCompositeProductFacade, decorators: [{
45
45
  type: Injectable,
46
46
  args: [{ providedIn: 'root' }]
47
47
  }] });
48
48
 
49
49
  class DaffCompositeProductStateTestingModule {
50
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
51
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductStateTestingModule }); }
52
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductStateTestingModule, providers: [
50
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
51
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductStateTestingModule }); }
52
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductStateTestingModule, providers: [
53
53
  { provide: DaffCompositeProductFacade, useExisting: MockDaffCompositeProductFacade },
54
54
  ] }); }
55
55
  }
56
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductStateTestingModule, decorators: [{
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductStateTestingModule, decorators: [{
57
57
  type: NgModule,
58
58
  args: [{
59
59
  providers: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-composite-state-testing.mjs","sources":["../../../libs/product-composite/state/testing/src/mock-composite-product-facade.ts","../../../libs/product-composite/state/testing/src/product-testing.module.ts","../../../libs/product-composite/state/testing/src/daffodil-product-composite-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffPriceRange } from '@daffodil/product';\nimport {\n DaffCompositeProductItemOption,\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeConfigurationItem,\n} from '@daffodil/product-composite';\nimport { DaffCompositeProductFacadeInterface } from '@daffodil/product-composite/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCompositeProductFacade implements DaffCompositeProductFacadeInterface {\n getRequiredItemPricesForConfiguration(id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getOptionalItemPricesForConfiguration(id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getPricesAsCurrentlyConfigured(id: DaffCompositeProduct['id']): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getAppliedOptions(id: DaffCompositeProduct['id']): BehaviorSubject<Dictionary<DaffCompositeProductItemOption>> {\n return new BehaviorSubject({});\n }\n getDiscountAmount(id: DaffCompositeProduct['id']): BehaviorSubject<number> {\n return new BehaviorSubject(null);\n }\n getDiscountPercent(id: DaffCompositeProduct['id']): BehaviorSubject<number> {\n return new BehaviorSubject(null);\n }\n isItemRequired(id: DaffCompositeProduct['id'], item_id: DaffCompositeProductItem['id']): BehaviorSubject<boolean> {\n return new BehaviorSubject(false);\n }\n dispatch(action) {};\n hasDiscount(priceRange: DaffPriceRange): boolean {\n return false;\n };\n hasPriceRange(priceRange: DaffPriceRange): boolean {\n return false;\n };\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffCompositeProductFacade } from '@daffodil/product-composite/state';\n\nimport { MockDaffCompositeProductFacade } from './mock-composite-product-facade';\n\n@NgModule({\n providers: [\n { provide: DaffCompositeProductFacade, useExisting: MockDaffCompositeProductFacade },\n ],\n})\nexport class DaffCompositeProductStateTestingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAaA;;AAEG;MAEU,8BAA8B,CAAA;IACzC,qCAAqC,CAAC,EAA8B,EAAE,aAA0D,EAAA;AAC9H,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC;;IAElC,qCAAqC,C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tC,sCAAsC,EAAA,CAAA,CAAA;AAAtC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sCAAsC,EAJtC,SAAA,EAAA;AACT,YAAA,EAAE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,8BAA8B,EAAE;AACrF,SAAA,EAAA,CAAA,CAAA;;2FAEU,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBALlD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,8BAA8B,EAAE;AACrF,qBAAA;AACF,iBAAA;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-product-composite-state-testing.mjs","sources":["../../../libs/product-composite/state/testing/src/mock-composite-product-facade.ts","../../../libs/product-composite/state/testing/src/product-testing.module.ts","../../../libs/product-composite/state/testing/src/daffodil-product-composite-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffPriceRange } from '@daffodil/product';\nimport {\n DaffCompositeProductItemOption,\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeConfigurationItem,\n} from '@daffodil/product-composite';\nimport { DaffCompositeProductFacadeInterface } from '@daffodil/product-composite/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCompositeProductFacade implements DaffCompositeProductFacadeInterface {\n getRequiredItemPricesForConfiguration(id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getOptionalItemPricesForConfiguration(id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getPricesAsCurrentlyConfigured(id: DaffCompositeProduct['id']): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getAppliedOptions(id: DaffCompositeProduct['id']): BehaviorSubject<Dictionary<DaffCompositeProductItemOption>> {\n return new BehaviorSubject({});\n }\n getDiscountAmount(id: DaffCompositeProduct['id']): BehaviorSubject<number> {\n return new BehaviorSubject(null);\n }\n getDiscountPercent(id: DaffCompositeProduct['id']): BehaviorSubject<number> {\n return new BehaviorSubject(null);\n }\n isItemRequired(id: DaffCompositeProduct['id'], item_id: DaffCompositeProductItem['id']): BehaviorSubject<boolean> {\n return new BehaviorSubject(false);\n }\n dispatch(action) {};\n hasDiscount(priceRange: DaffPriceRange): boolean {\n return false;\n };\n hasPriceRange(priceRange: DaffPriceRange): boolean {\n return false;\n };\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffCompositeProductFacade } from '@daffodil/product-composite/state';\n\nimport { MockDaffCompositeProductFacade } from './mock-composite-product-facade';\n\n@NgModule({\n providers: [\n { provide: DaffCompositeProductFacade, useExisting: MockDaffCompositeProductFacade },\n ],\n})\nexport class DaffCompositeProductStateTestingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAaA;;AAEG;MAEU,8BAA8B,CAAA;IACzC,qCAAqC,CAAC,EAA8B,EAAE,aAA0D,EAAA;AAC9H,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC;;IAElC,qCAAqC,CAAC,EAA8B,EAAE,aAA0D,EAAA;AAC9H,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC;;AAElC,IAAA,8BAA8B,CAAC,EAA8B,EAAA;AAC3D,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC;;AAElC,IAAA,iBAAiB,CAAC,EAA8B,EAAA;AAC9C,QAAA,OAAO,IAAI,eAAe,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AE,0BAA0B,EAAE,WAAW,EAAE,8BAA8B,EAAE;AACrF,SAAA,EAAA,CAAA,CAAA;;4FAEU,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBALlD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,8BAA8B,EAAE;AACrF,qBAAA;AACF,iBAAA;;;ACVD;;AAEG;;;;"}
@@ -4,7 +4,7 @@ import * as i1 from '@ngrx/store';
4
4
  import { defaultMemoize, createFeatureSelector, createSelector, select, combineReducers, StoreModule } from '@ngrx/store';
5
5
  import { DaffProductTypeEnum, productPriceRangeHasDiscount, productPriceRangeHasPriceRange } from '@daffodil/product';
6
6
  import { daffAdd, daffMultiply, daffDivide, daffSubtract, createMultiInjectionToken, createSingleInjectionToken } from '@daffodil/core';
7
- import { getDaffProductEntitiesSelectors, DaffProductPageActionTypes, DaffProductActionTypes, DaffBestSellersActionTypes, DaffProductGridActionTypes, DaffProductLoadSuccess, DaffProductPageLoadSuccess, daffProductProvideMetaReducers } from '@daffodil/product/state';
7
+ import { getDaffProductEntitiesSelectors, DaffProductPageActionTypes, DaffProductActionTypes, DaffProductGridActionTypes, DaffProductLoadSuccess, DaffProductPageLoadSuccess, daffProductProvideMetaReducers } from '@daffodil/product/state';
8
8
  import { createEntityAdapter } from '@ngrx/entity';
9
9
  import { daffComposeReducers } from '@daffodil/core/state';
10
10
 
@@ -405,10 +405,10 @@ class DaffCompositeProductFacade {
405
405
  dispatch(action) {
406
406
  this.store.dispatch(action);
407
407
  }
408
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
409
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductFacade, providedIn: 'root' }); }
408
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
409
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductFacade, providedIn: 'root' }); }
410
410
  }
411
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductFacade, decorators: [{
411
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductFacade, decorators: [{
412
412
  type: Injectable,
413
413
  args: [{
414
414
  providedIn: 'root',
@@ -426,7 +426,6 @@ function daffCompositeProductEntitiesReducer(state = daffCompositeProductApplied
426
426
  const adapter = daffCompositeProductAppliedOptionsEntitiesAdapter();
427
427
  switch (action.type) {
428
428
  case DaffProductGridActionTypes.ProductGridLoadSuccessAction:
429
- case DaffBestSellersActionTypes.BestSellersLoadSuccessAction:
430
429
  return adapter.upsertProducts(state, ...action.payload);
431
430
  case DaffProductActionTypes.ProductLoadSuccessAction:
432
431
  case DaffProductPageActionTypes.ProductPageLoadSuccessAction:
@@ -523,13 +522,13 @@ provider: provideDaffProductCompositeReducers, } = createSingleInjectionToken('D
523
522
  * A module that provides the default reducers and effects for composite product redux state.
524
523
  */
525
524
  class DaffCompositeProductStateModule {
526
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
527
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductStateModule, imports: [i1.StoreFeatureModule] }); }
528
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductStateModule, providers: [
525
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
526
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductStateModule, imports: [i1.StoreFeatureModule] }); }
527
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductStateModule, providers: [
529
528
  ...daffProductProvideMetaReducers(daffProductCompositeEnsureItemsMetaReducer),
530
529
  ], imports: [StoreModule.forFeature(DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY, DAFF_PRODUCT_COMPOSITE_REDUCERS)] }); }
531
530
  }
532
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductStateModule, decorators: [{
531
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductStateModule, decorators: [{
533
532
  type: NgModule,
534
533
  args: [{
535
534
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-composite-state.mjs","sources":["../../../libs/product-composite/state/src/actions/composite-product.actions.ts","../../../libs/product-composite/state/src/reducers/composite-product-entities/composite-product-entities-reducer-adapter.ts","../../../libs/product-composite/state/src/reducers/composite-product-store-feature-key.ts","../../../libs/product-composite/state/src/selectors/feature.selector.ts","../../../libs/product-composite/state/src/selectors/composite-product-entities/composite-product-entities.selectors.ts","../../../libs/product-composite/state/src/selectors/composite-product/composite-product.selectors.ts","../../../libs/product-composite/state/src/selectors/all.selector.ts","../../../libs/product-composite/state/src/facades/composite-product/composite-product.facade.ts","../../../libs/product-composite/state/src/reducers/composite-product-entities/composite-product-entities.reducer.ts","../../../libs/product-composite/state/src/reducers/composite-product-reducers.ts","../../../libs/product-composite/state/src/reducers/injection-tokens/extra.token.ts","../../../libs/product-composite/state/src/helpers/ensure-items.ts","../../../libs/product-composite/state/src/reducers/ensure-items.meta-reducer.ts","../../../libs/product-composite/state/src/reducers/injection-tokens/reducers.token.ts","../../../libs/product-composite/state/src/composite-product-state.module.ts","../../../libs/product-composite/state/src/daffodil-product-composite-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\n/**\n * Action types for Composite Product Actions.\n */\nexport enum DaffCompositeProductActionTypes {\n CompositeProductApplyOptionAction = '[@daffodil/product-composite] Composite Product Apply Option Action'\n}\n\n/**\n * Applies a product option to a particular composite product.\n *\n * @param id - Id of the Composite Product\n * @param itemId - Id of the product item.\n * @param optionId - Id of the option of the product item that is chosen.\n */\nexport class DaffCompositeProductApplyOption<T extends DaffCompositeProduct = DaffCompositeProduct> implements Action {\n readonly type = DaffCompositeProductActionTypes.CompositeProductApplyOptionAction;\n\n constructor(public id: T['id'], public itemId: DaffCompositeProductItem['id'], public optionId: DaffCompositeProductItemOption['id'], public qty?: number) {}\n}\n\nexport type DaffCompositeProductActions<T extends DaffCompositeProduct = DaffCompositeProduct> =\n\t| DaffCompositeProductApplyOption<T>;\n","import {\n createEntityAdapter,\n EntityState,\n} from '@ngrx/entity';\nimport { defaultMemoize } from '@ngrx/store';\n\nimport { DaffProductTypeEnum } from '@daffodil/product';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeConfigurationItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductEntity } from './composite-product-entity';\n\n/**\n * Composite Product Item Options Adapter for changing/overwriting entity state.\n */\nexport class DaffCompositeProductAppliedOptionsEntitiesAdapter<T extends EntityState<DaffCompositeProductEntity> = EntityState<DaffCompositeProductEntity>> {\n /**\n * @docs-private\n */\n private _adapter = createEntityAdapter<DaffCompositeProductEntity>();\n\n /**\n * Gets the initial entity state.\n */\n getInitialState() {\n return this._adapter.getInitialState();\n }\n\n /**\n * Get the entity selectors.\n */\n getSelectors() {\n return this._adapter.getSelectors();\n }\n\n /**\n * Upserts the given composite products into state.\n */\n upsertProducts(state: T, ...products: DaffCompositeProduct[]): T {\n return this._adapter.upsertMany(\n this.mapOptionsEntities(products),\n state,\n );\n };\n\n /**\n * Apply the specified option for the given composite product item.\n */\n applyOption(state: T, productId: DaffCompositeProduct['id'], itemId: DaffCompositeProductItem['id'], optionId: DaffCompositeProductItemOption['id'], qty?: number) {\n return this._adapter.upsertOne(\n {\n id: productId,\n items: {\n ...state.entities[productId].items,\n [itemId]: {\n value: optionId,\n qty: qty ?? 1,\n },\n },\n },\n state,\n );\n }\n\n /**\n * @docs-private\n */\n private mapOptionsEntities(products: DaffCompositeProduct[]): DaffCompositeProductEntity[] {\n return products.filter(product => product.type === DaffProductTypeEnum.Composite)\n .map(product => this.buildCompositeProductAppliedOptionsEntity(product));\n }\n\n /**\n * @docs-private\n */\n private buildCompositeProductAppliedOptionsEntity(product: DaffCompositeProduct): DaffCompositeProductEntity {\n return {\n id: product.id,\n items: product.items.reduce((acc, item) => ({\n ...acc,\n [item.id]: this.getDefaultOption(item),\n }), {}),\n };\n }\n\n /**\n * Sets the default item option to the specified default option if it is in stock.\n * Does not set a default option if a default is not specified.\n * Does not set a default option but does set a default qty if the default is out of stock.\n *\n * @param item a DaffCompositeProductItem\n * @docs-private\n */\n private getDefaultOption(item: DaffCompositeProductItem): DaffCompositeConfigurationItem {\n const defaultOptionIndex = item.options.findIndex(option => option.is_default);\n\n if(defaultOptionIndex > -1) {\n return {\n value: item.options[defaultOptionIndex].in_stock ? item.options[defaultOptionIndex].id : null,\n qty: item.options[defaultOptionIndex].quantity,\n };\n } else {\n return { value: null, qty: null };\n }\n }\n}\n\n/**\n * Gets the composite product entity adapter singleton.\n */\nexport const daffCompositeProductAppliedOptionsEntitiesAdapter: () => DaffCompositeProductAppliedOptionsEntitiesAdapter = defaultMemoize(() => new DaffCompositeProductAppliedOptionsEntitiesAdapter()).memoized;\n","export const DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY = 'daffCompositeProduct';\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffCompositeProductReducersState } from '../reducers/composite-product-reducers-state.interface';\nimport { DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY } from '../reducers/composite-product-store-feature-key';\n\n/**\n * An interface for the composite product feature state.\n */\nexport interface DaffCompositeProductFeatureMemoizedSelector {\n selectCompositeProductState: MemoizedSelector<Record<string, any>, DaffCompositeProductReducersState>;\n}\n\n/**\n * A function that returns a selector for the composite product feature state.\n */\nexport const getDaffCompositeProductFeatureSelector = (() => {\n let cache;\n return (): DaffCompositeProductFeatureMemoizedSelector => cache = cache\n ? cache\n : { selectCompositeProductState: createFeatureSelector<DaffCompositeProductReducersState>(DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY) };\n})();\n","import {\n EntityState,\n Dictionary,\n} from '@ngrx/entity';\nimport {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\nimport { getDaffProductEntitiesSelectors } from '@daffodil/product/state';\nimport {\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n DaffCompositeProduct,\n} from '@daffodil/product-composite';\n\nimport { daffCompositeProductAppliedOptionsEntitiesAdapter } from '../../reducers/composite-product-entities/composite-product-entities-reducer-adapter';\nimport { DaffCompositeProductEntity } from '../../reducers/composite-product-entities/composite-product-entity';\nimport {\n DaffCompositeProductReducersState,\n DaffCompositeProductStateRootSlice,\n} from '../../reducers/composite-product-reducers-state.interface';\nimport { getDaffCompositeProductFeatureSelector } from '../feature.selector';\n\n/**\n * An interface for selectors related to the composite product applied options.\n */\nexport interface DaffCompositeProductEntitiesMemoizedSelectors<T extends DaffProduct = DaffProduct> {\n /**\n * The ngrx entities state for composite product applied options.\n */\n selectCompositeProductAppliedOptionsEntitiesState: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>>;\n /**\n * A selector for all composite product ids in state.\n */\n selectCompositeProductIds: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>['ids']>;\n /**\n * The ngrx entities for the composite product appllied options.\n */\n selectCompositeProductAppliedOptionsEntities: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>['entities']>;\n /**\n * The total number of composite products in state.\n */\n selectCompositeProductTotal: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n /**\n * Selects the applied options for a composite product.\n *\n * @param id the id of the composite product.\n */\n selectCompositeProductAppliedOptions: (id: T['id']) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, Dictionary<DaffCompositeProductItemOption>>;\n /**\n * Selects whether the particular item of a composite product is required in order for the product to be valid, i.e. addable to the cart.\n *\n * @param id the id of the composite product.\n * @param item_id the id of the composite product item.\n */\n selectIsCompositeProductItemRequired: (id: T['id'], item_id: DaffCompositeProductItem['id']) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, boolean>;\n}\n\nconst createCompositeProductAppliedOptionsEntitiesSelectors = <T extends DaffProduct>(): DaffCompositeProductEntitiesMemoizedSelectors<T> => {\n const {\n selectCompositeProductState,\n } = getDaffCompositeProductFeatureSelector();\n const {\n selectProduct,\n } = getDaffProductEntitiesSelectors<T>();\n const adapterSelectors = daffCompositeProductAppliedOptionsEntitiesAdapter().getSelectors();\n\n const selectCompositeProductAppliedOptionsEntitiesState = createSelector(\n selectCompositeProductState,\n (state: DaffCompositeProductReducersState) => state.compositeProductOptions,\n );\n\n const selectCompositeProductIds = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectIds,\n );\n\n const selectCompositeProductAppliedOptionsEntities = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectEntities,\n );\n\n const selectCompositeProductTotal = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectTotal,\n );\n\n const selectCompositeProductAppliedOptions = defaultMemoize((id: T['id']) => createSelector(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntitiesState,\n (product: T, appliedOptions) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n return (<DaffCompositeProduct><any>product).items.reduce((acc, item) => ({\n ...acc,\n [item.id]: appliedOptions.entities[product.id].items[item.id].value ? {\n ...item.options.find(option => option.id === appliedOptions.entities[product.id].items[item.id].value),\n quantity: appliedOptions.entities[product.id].items[item.id].qty,\n } : null,\n }), {});\n },\n )).memoized;\n\n const selectIsCompositeProductItemRequired = defaultMemoize((id: T['id'], item_id: DaffCompositeProductItem['id']) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const productItem = (<DaffCompositeProduct><any>product).items.find(item => item.id === item_id);\n\n return productItem ? productItem.required : null;\n },\n )).memoized;\n\n\n return {\n selectCompositeProductAppliedOptionsEntitiesState,\n selectCompositeProductIds,\n selectCompositeProductAppliedOptionsEntities,\n selectCompositeProductTotal,\n selectCompositeProductAppliedOptions,\n selectIsCompositeProductItemRequired,\n };\n};\n\n/**\n * A function that returns all selectors related to composite product applied option entities.\n * Returns {@link DaffCompositeProductEntitiesMemoizedSelectors}.\n */\nexport const getDaffCompositeProductEntitiesSelectors = (() => {\n let cache;\n return <T extends DaffProduct>(): DaffCompositeProductEntitiesMemoizedSelectors<T> => cache = cache\n ? cache\n : createCompositeProductAppliedOptionsEntitiesSelectors<T>();\n})();\n","import {\n Dictionary,\n EntityState,\n} from '@ngrx/entity';\nimport {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport {\n daffAdd,\n daffDivide,\n daffMultiply,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n DaffProductPrices,\n DaffPriceRange,\n} from '@daffodil/product';\nimport { getDaffProductEntitiesSelectors } from '@daffodil/product/state';\nimport {\n DaffCompositeProduct,\n DaffCompositeConfigurationItem,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductStateRootSlice } from '../../reducers/composite-product-reducers-state.interface';\nimport { DaffCompositeProductEntity } from '../../reducers/public_api';\nimport { getDaffCompositeProductEntitiesSelectors } from '../composite-product-entities/composite-product-entities.selectors';\n\n/**\n * An interface describing selectors unique to the composite product, such as pricing and discounts.\n */\nexport interface DaffCompositeProductMemoizedSelectors<T extends DaffProduct = DaffProduct> {\n /**\n * Get a DaffPriceRange for a composite product based on the configuration provided excluding unselected, optional item prices.\n */\n selectCompositeProductRequiredItemPricesForConfiguration: ( id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem> ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the broadest possible DaffPriceRange for a composite product based on the configuration provided including optional item prices.\n */\n selectCompositeProductOptionalItemPricesForConfiguration: ( id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem> ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the DaffPriceRange for a composite product based on the current configuration of selected item options in redux state and\n * excluding unselected, optional item prices.\n */\n selectCompositeProductPricesAsCurrentlyConfigured: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the discount amount for a composite product. This value will be undefined if all required options are not chosen.\n */\n selectCompositeProductDiscountAmount: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n /**\n * Get the discount percent for a composite product. This value will be undefined if all required options are not chosen.\n * Note: this percent is computed client-side and should be treated as an estimate rather than an exact value.\n */\n selectCompositeProductDiscountPercent: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n}\n\nconst createCompositeProductSelectors = <T extends DaffProduct>(): DaffCompositeProductMemoizedSelectors<T> => {\n\n const {\n selectProduct,\n } = getDaffProductEntitiesSelectors<T>();\n\n const {\n selectCompositeProductAppliedOptionsEntities,\n } = getDaffCompositeProductEntitiesSelectors();\n\n const selectCompositeProductRequiredItemPricesForConfiguration = defaultMemoize((id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const appliedOptions = configuration ? getAppliedOptionsForConfiguration(<DaffCompositeProduct><any>product, configuration) : {};\n return {\n minPrice: getMinPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n maxPrice: getMaxPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n };\n },\n )).memoized;\n\n const selectCompositeProductOptionalItemPricesForConfiguration = defaultMemoize((id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const appliedOptions = configuration ? getAppliedOptionsForConfiguration(<DaffCompositeProduct><any>product, configuration) : {};\n return {\n minPrice: getMinPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n maxPrice: getMaxPricesForConfigurationIncludingOptionalItems(<DaffCompositeProduct><any>product, appliedOptions),\n };\n },\n )).memoized;\n\n const selectCompositeProductPricesAsCurrentlyConfigured = defaultMemoize((id: T['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], DaffPriceRange>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) =>\n selectCompositeProductRequiredItemPricesForConfiguration(id, appliedOptionsEntities[id]?.items || null).projector(product),\n )).memoized;\n\n const selectCompositeProductDiscountAmount = defaultMemoize((id: DaffCompositeProduct['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], number>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n const appliedConfigurationItem = appliedOptionsEntities[product.id].items;\n if((<DaffCompositeProduct><any>product).items.filter(item => item.required && appliedConfigurationItem[item.id].value === null).length > 0) {\n return undefined;\n }\n const appliedOptions = getAppliedOptionsForConfiguration((<DaffCompositeProduct><any>product), appliedConfigurationItem);\n\n return (<DaffCompositeProduct><any>product).items.reduce((acc, item) =>\n appliedOptions[item.id]?.discount?.amount ? daffAdd(acc, daffMultiply(appliedOptions[item.id].discount.amount, appliedOptions[item.id].quantity)) : acc,\n product.discount.amount);\n },\n )).memoized;\n\n const selectCompositeProductDiscountPercent = defaultMemoize((id: DaffCompositeProduct['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], number>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n const appliedOptions = appliedOptionsEntities[product.id].items;\n if((<DaffCompositeProduct><any>product).items.filter(item => item.required && appliedOptions[item.id].value === null).length > 0) {\n return undefined;\n }\n\n const prices = getMinPricesForConfiguration(\n (<DaffCompositeProduct><any>product),\n getAppliedOptionsForConfiguration((<DaffCompositeProduct><any>product), appliedOptions),\n );\n\n return daffMultiply(\n daffDivide(\n daffSubtract(prices.originalPrice, prices.discountedPrice),\n prices.originalPrice,\n ),\n 100,\n );\n },\n )).memoized;\n\n return {\n selectCompositeProductRequiredItemPricesForConfiguration,\n selectCompositeProductOptionalItemPricesForConfiguration,\n selectCompositeProductPricesAsCurrentlyConfigured,\n selectCompositeProductDiscountAmount,\n selectCompositeProductDiscountPercent,\n };\n};\n\n/**\n * A function that returns all selectors related to the composite product feature.\n *\n * Returns {@link DaffCompositeProductMemoizedSelectors}.\n */\nexport const getDaffCompositeProductPriceSelectors = (() => {\n let cache;\n return <T extends DaffProduct = DaffProduct>(): DaffCompositeProductMemoizedSelectors<T> => cache = cache\n ? cache\n : createCompositeProductSelectors<T>();\n})();\n\n/**\n * The minimum price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMinimumRequiredCompositeItemPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.min(...item.options.map(option => option.price)), qty) : 0;\n}\n\n/**\n * The maximum price for an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMaximumRequiredCompositeItemPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.max(...item.options.map(option => option.price)), qty) : 0;\n}\n\n/**\n * The minimum discounted price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMinimumRequiredCompositeItemDiscountedPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.min(...item.options.map(getDiscountedPrice)), qty) : 0;\n}\n/**\n * The maximum discounted price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMaximumRequiredCompositeItemDiscountedPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.max(...item.options.map(getDiscountedPrice)), qty) : 0;\n}\n\n/**\n * Gets the minimum prices of a composite product for the configuration provided excluding unselected, optional item prices.\n *\n * @param product a DaffCompositeProduct\n * @param appliedOptions a Dictionary<DaffCompositeProductItemOption> that determines the current configuration of the composite product.\n */\nfunction getMinPricesForConfiguration(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n getMinimumRequiredCompositeItemDiscountedPrice(item, getOptionQty(appliedOptions[item.id])),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n getMinimumRequiredCompositeItemPrice(item, getOptionQty(appliedOptions[item.id])),\n ), product.price),\n };\n}\n\n/**\n * Gets the maximum prices of a composite product for the configuration provided excluding unselected, optional item prices.\n *\n * @param product a DaffCompositeProduct\n * @param appliedOptions a Dictionary<DaffCompositeProductItemOption> that determines the current configuration of the composite product.\n */\nfunction getMaxPricesForConfiguration(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n getMaximumRequiredCompositeItemDiscountedPrice(item, getOptionQty(appliedOptions[item.id])),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n getMaximumRequiredCompositeItemPrice(item, getOptionQty(appliedOptions[item.id])),\n ), product.price),\n };\n}\n\nfunction getDiscountedPrice(product: DaffProduct): number {\n return product.discount ? daffSubtract(product.price, product.discount.amount) : product.price;\n}\n\n/**\n * Gets the maximum prices of a composite product including optional item prices.\n *\n * @param product a DaffCompositeProduct\n */\nfunction getMaxPricesForConfigurationIncludingOptionalItems(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n appliedOptionHasQty(appliedOptions[item.id]) ?\n daffMultiply(Math.max(...item.options.map(getDiscountedPrice)), appliedOptions[item.id].quantity) :\n Math.max(...item.options.map(getDiscountedPrice)),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n appliedOptionHasQty(appliedOptions[item.id]) ?\n daffMultiply(Math.max(...item.options.map(option => option.price)), appliedOptions[item.id].quantity) :\n Math.max(...item.options.map(option => option.price)),\n ), product.price),\n };\n}\n\n/**\n * Takes a product and a set of option configurations and convert it into a dictionary of the full option objects.\n *\n * @param product a DaffCompositeProduct\n * @param configuration a Dictionary<DaffCompositeConfigurationItem> used to build the appliedOptions object.\n */\nfunction getAppliedOptionsForConfiguration(product: DaffCompositeProduct, configuration: Dictionary<DaffCompositeConfigurationItem>): Dictionary<DaffCompositeProductItemOption> {\n return product.items.reduce((acc, item) => ({\n ...acc,\n [item.id]: configuration[item.id] ? {\n ...item.options.find(option => option.id === configuration[item.id].value),\n quantity: (configuration[item.id].qty === null || configuration[item.id].qty === undefined) ? 1 : configuration[item.id].qty,\n } : null,\n }), {});\n}\n\nfunction appliedOptionHasId(appliedOption: DaffCompositeProductItemOption): boolean {\n return !!appliedOption?.id;\n}\n\nfunction getOptionQty(appliedOption: DaffCompositeProductItemOption): number {\n return appliedOptionHasQty(appliedOption) ? appliedOption.quantity : 1;\n}\n\nfunction appliedOptionHasQty(appliedOption: DaffCompositeProductItemOption): boolean {\n return appliedOption?.quantity !== null && appliedOption?.quantity !== undefined;\n}\n","import { DaffProduct } from '@daffodil/product';\n\nimport {\n DaffCompositeProductMemoizedSelectors,\n getDaffCompositeProductPriceSelectors,\n} from './composite-product/composite-product.selectors';\nimport {\n DaffCompositeProductEntitiesMemoizedSelectors,\n getDaffCompositeProductEntitiesSelectors,\n} from './composite-product-entities/composite-product-entities.selectors';\n\n/**\n * An interface for all selectors in the composite product feature area.\n */\nexport interface DaffCompositeProductAllSelectors<T extends DaffProduct = DaffProduct> extends\n DaffCompositeProductEntitiesMemoizedSelectors<T>,\n DaffCompositeProductMemoizedSelectors<T> { }\n\n/**\n * A function that returns all selectors in the composite product feature area.\n * Returns {@link DaffCompositeProductAllSelectors}.\n */\nexport const getDaffCompositeProductSelectors = <T extends DaffProduct>(): DaffCompositeProductAllSelectors<T> => ({\n ...getDaffCompositeProductEntitiesSelectors<T>(),\n ...getDaffCompositeProductPriceSelectors<T>(),\n});\n","import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffProduct,\n DaffPriceRange,\n productPriceRangeHasDiscount,\n productPriceRangeHasPriceRange,\n} from '@daffodil/product';\nimport {\n DaffCompositeConfigurationItem,\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductFacadeInterface } from './composite-product-facade.interface';\nimport { DaffCompositeProductStateRootSlice } from '../../reducers/composite-product-reducers-state.interface';\nimport { getDaffCompositeProductSelectors } from '../../selectors/public_api';\n\n/**\n * A facade for interacting with the composite product state.\n * Exposes many parts of the state for easy access and allows dispatching of actions.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductFacade<T extends DaffProduct = DaffProduct> implements DaffCompositeProductFacadeInterface {\n\n constructor(private store: Store<DaffCompositeProductStateRootSlice<T>>) {}\n\n compositeProductSelectors = getDaffCompositeProductSelectors<T>();\n\n hasDiscount = productPriceRangeHasDiscount;\n\n hasPriceRange = productPriceRangeHasPriceRange;\n\n getRequiredItemPricesForConfiguration(id: T['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductRequiredItemPricesForConfiguration(id, configuration)));\n }\n\n getOptionalItemPricesForConfiguration(id: T['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductOptionalItemPricesForConfiguration(id, configuration)));\n }\n\n getPricesAsCurrentlyConfigured(id: T['id']): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductPricesAsCurrentlyConfigured(id)));\n }\n\n getAppliedOptions(id: T['id']): Observable<Dictionary<DaffCompositeProductItemOption>> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductAppliedOptions(id)));\n }\n\n getDiscountAmount(id: T['id']): Observable<number> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductDiscountAmount(id)));\n }\n\n getDiscountPercent(id: T['id']): Observable<number> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductDiscountPercent(id)));\n }\n\n isItemRequired(id: T['id'], item_id: DaffCompositeProductItem['id']) {\n return this.store.pipe(select(this.compositeProductSelectors.selectIsCompositeProductItemRequired(id, item_id)));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { EntityState } from '@ngrx/entity';\n\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductPageActions,\n DaffProductPageActionTypes,\n DaffProductGridActionTypes,\n DaffProductGridActions,\n DaffBestSellersActions,\n DaffProductActions,\n DaffBestSellersActionTypes,\n DaffProductActionTypes,\n} from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\nimport { daffCompositeProductAppliedOptionsEntitiesAdapter } from './composite-product-entities-reducer-adapter';\nimport { DaffCompositeProductEntity } from './composite-product-entity';\nimport {\n DaffCompositeProductActions,\n DaffCompositeProductActionTypes,\n} from '../../actions/public_api';\n\n/**\n * Reducer function that catches actions and changes/overwrites composite product entities state.\n *\n * @param state current State of the redux store\n * @param action ProductGrid, BestSellers, Product, or Composite Product actions\n * @returns Product entities state\n */\nexport function daffCompositeProductEntitiesReducer<T extends DaffProduct, V extends DaffCompositeProduct>(\n state = daffCompositeProductAppliedOptionsEntitiesAdapter().getInitialState(),\n action: DaffProductGridActions<T> | DaffBestSellersActions<T> | DaffProductActions<T> | DaffProductPageActions<T> | DaffCompositeProductActions<V>): EntityState<DaffCompositeProductEntity> {\n const adapter = daffCompositeProductAppliedOptionsEntitiesAdapter();\n switch (action.type) {\n case DaffProductGridActionTypes.ProductGridLoadSuccessAction:\n case DaffBestSellersActionTypes.BestSellersLoadSuccessAction:\n return adapter.upsertProducts(state, ...(<V[]><unknown>action.payload));\n\n case DaffProductActionTypes.ProductLoadSuccessAction:\n case DaffProductPageActionTypes.ProductPageLoadSuccessAction:\n return adapter.upsertProducts(state, ...(<V[]><unknown>action.payload.products));\n\n case DaffCompositeProductActionTypes.CompositeProductApplyOptionAction:\n return adapter.applyOption(state, action.id, action.itemId, action.optionId, action.qty);\n\n default:\n return state;\n }\n}\n","import { ActionReducerMap } from '@ngrx/store';\n\nimport { daffCompositeProductEntitiesReducer } from './composite-product-entities/composite-product-entities.reducer';\nimport { DaffCompositeProductReducersState } from './composite-product-reducers-state.interface';\n\n/**\n * Returns state values from all composite product related reducers.\n */\nexport const daffCompositeProductReducers: ActionReducerMap<DaffCompositeProductReducersState> = {\n compositeProductOptions: daffCompositeProductEntitiesReducer,\n};\n","import { ActionReducer } from '@ngrx/store';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffCompositeProductReducersState } from '../composite-product-reducers-state.interface';\n\nexport const {\n /**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffProductCompositeProvideExtraReducers}.\n */\n token: DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS,\n\n /**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * @example\n * ```ts\n * providers: [\n * ...daffProductCompositeProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\n provider: daffProductCompositeProvideExtraReducers,\n} = createMultiInjectionToken<ActionReducer<DaffCompositeProductReducersState>>('DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS');\n","import { DaffProductTypeEnum } from '@daffodil/product';\nimport { DaffProductReducersState } from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\n/**\n * Maps a list of products, ensuring that the composite products have a list of items.\n * If the incoming items is empty or nully, the items from state are intentionally used instead.\n */\nexport function daffProductCompositeEnsureItems<T extends DaffCompositeProduct = DaffCompositeProduct>(state: DaffProductReducersState<T>, products: T[]): T[] {\n return products.map((product) =>\n product.type === DaffProductTypeEnum.Composite\n ? {\n ...product,\n items: product.items.length > 0\n ? product.items\n : state.products.entities[product.id]?.items ?? [],\n }\n : product,\n );\n}\n","import { ActionReducer } from '@ngrx/store';\n\nimport {\n DaffProductActionTypes,\n DaffProductActions,\n DaffProductLoadSuccess,\n DaffProductPageActionTypes,\n DaffProductPageActions,\n DaffProductPageLoadSuccess,\n DaffProductReducersState,\n} from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\nimport { daffProductCompositeEnsureItems } from '../helpers/public_api';\n\ntype Reducer = ActionReducer<DaffProductReducersState<DaffCompositeProduct>, DaffProductActions<DaffCompositeProduct> | DaffProductPageActions<DaffCompositeProduct>>;\n\nexport function daffProductCompositeEnsureItemsMetaReducer(reducer: Reducer): Reducer {\n return (state, action) => {\n switch (action.type) {\n case DaffProductPageActionTypes.ProductPageLoadSuccessAction:\n return reducer(state, new DaffProductPageLoadSuccess({\n ...action.payload,\n products: daffProductCompositeEnsureItems(state, action.payload.products),\n }));\n\n case DaffProductActionTypes.ProductLoadSuccessAction:\n return reducer(state, new DaffProductLoadSuccess({\n ...action.payload,\n products: daffProductCompositeEnsureItems(state, action.payload.products),\n }));\n\n default:\n return reducer(state, action);\n }\n };\n}\n","import { inject } from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\nimport { daffComposeReducers } from '@daffodil/core/state';\n\nimport { DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS } from './extra.token';\nimport { daffCompositeProductReducers } from '../composite-product-reducers';\nimport { DaffCompositeProductReducersState } from '../composite-product-reducers-state.interface';\n\nexport const {\n /**\n * An internal token to hold the Daffodil composite product reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\n token: DAFF_PRODUCT_COMPOSITE_REDUCERS,\n /**\n * Provider function for {@link DAFF_PRODUCT_COMPOSITE_REDUCERS}.\n */\n provider: provideDaffProductCompositeReducers,\n} = createSingleInjectionToken<ActionReducer<DaffCompositeProductReducersState>>(\n 'DAFF_PRODUCT_COMPOSITE_REDUCERS',\n {\n factory: () => daffComposeReducers([\n combineReducers(daffCompositeProductReducers),\n ...inject(DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\n\nimport { daffProductProvideMetaReducers } from '@daffodil/product/state';\n\nimport { daffProductCompositeEnsureItemsMetaReducer } from './reducers/ensure-items.meta-reducer';\nimport { DAFF_PRODUCT_COMPOSITE_REDUCERS } from './reducers/injection-tokens/reducers.token';\nimport { DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY } from './reducers/public_api';\n\n/**\n * A module that provides the default reducers and effects for composite product redux state.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY, DAFF_PRODUCT_COMPOSITE_REDUCERS),\n ],\n providers: [\n ...daffProductProvideMetaReducers(daffProductCompositeEnsureItemsMetaReducer),\n ],\n})\nexport class DaffCompositeProductStateModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAQA;;AAEG;IACS;AAAZ,CAAA,UAAY,+BAA+B,EAAA;AACzC,IAAA,+BAAA,CAAA,mCAAA,CAAA,GAAA,qEAAyG;AAC3G,CAAC,EAFW,+BAA+B,KAA/B,+BAA+B,GAE1C,EAAA,CAAA,CAAA;AAED;;;;;;AAMG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,EAAW,EAAS,MAAsC,EAAS,QAA8C,EAAS,GAAY,EAAA;QAAtI,IAAE,CAAA,EAAA,GAAF,EAAE;QAAkB,IAAM,CAAA,MAAA,GAAN,MAAM;QAAyC,IAAQ,CAAA,QAAA,GAAR,QAAQ;QAA+C,IAAG,CAAA,GAAA,GAAH,GAAG;AAFvI,QAAA,IAAA,CAAA,IAAI,GAAG,+BAA+B,CAAC,iCAAiC;;AAGlF;;ACVD;;AAEG;MACU,iDAAiD,CAAA;AAA9D,IAAA,WAAA,GAAA;AACE;;AAEG;QACK,IAAQ,CAAA,QAAA,GAAG,mBAAmB,EAA8B;;AAEpE;;AAEG;IACH,eAAe,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;;AAGxC;;AAEG;IACH,YAAY,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;;AAGrC;;AAEG;AACH,IAAA,cAAc,CAAC,KAAQ,EAAE,GAAG,QAAgC,EAAA;AAC1D,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAC7B,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EACjC,KAAK,CACN;;;AAGH;;AAEG;IACH,WAAW,CAAC,KAAQ,EAAE,SAAqC,EAAE,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,CAAA;kBAR3C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,wCAAwC,EAAE,+BAA+B,CAAC;AAClG,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,GAAG,8BAA8B,CAAC,0CAA0C,CAAC;AAC9E,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-product-composite-state.mjs","sources":["../../../libs/product-composite/state/src/actions/composite-product.actions.ts","../../../libs/product-composite/state/src/reducers/composite-product-entities/composite-product-entities-reducer-adapter.ts","../../../libs/product-composite/state/src/reducers/composite-product-store-feature-key.ts","../../../libs/product-composite/state/src/selectors/feature.selector.ts","../../../libs/product-composite/state/src/selectors/composite-product-entities/composite-product-entities.selectors.ts","../../../libs/product-composite/state/src/selectors/composite-product/composite-product.selectors.ts","../../../libs/product-composite/state/src/selectors/all.selector.ts","../../../libs/product-composite/state/src/facades/composite-product/composite-product.facade.ts","../../../libs/product-composite/state/src/reducers/composite-product-entities/composite-product-entities.reducer.ts","../../../libs/product-composite/state/src/reducers/composite-product-reducers.ts","../../../libs/product-composite/state/src/reducers/injection-tokens/extra.token.ts","../../../libs/product-composite/state/src/helpers/ensure-items.ts","../../../libs/product-composite/state/src/reducers/ensure-items.meta-reducer.ts","../../../libs/product-composite/state/src/reducers/injection-tokens/reducers.token.ts","../../../libs/product-composite/state/src/composite-product-state.module.ts","../../../libs/product-composite/state/src/daffodil-product-composite-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\n/**\n * Action types for Composite Product Actions.\n */\nexport enum DaffCompositeProductActionTypes {\n CompositeProductApplyOptionAction = '[@daffodil/product-composite] Composite Product Apply Option Action'\n}\n\n/**\n * Applies a product option to a particular composite product.\n *\n * @param id - Id of the Composite Product\n * @param itemId - Id of the product item.\n * @param optionId - Id of the option of the product item that is chosen.\n */\nexport class DaffCompositeProductApplyOption<T extends DaffCompositeProduct = DaffCompositeProduct> implements Action {\n readonly type = DaffCompositeProductActionTypes.CompositeProductApplyOptionAction;\n\n constructor(public id: T['id'], public itemId: DaffCompositeProductItem['id'], public optionId: DaffCompositeProductItemOption['id'], public qty?: number) {}\n}\n\nexport type DaffCompositeProductActions<T extends DaffCompositeProduct = DaffCompositeProduct> =\n\t| DaffCompositeProductApplyOption<T>;\n","import {\n createEntityAdapter,\n EntityState,\n} from '@ngrx/entity';\nimport { defaultMemoize } from '@ngrx/store';\n\nimport { DaffProductTypeEnum } from '@daffodil/product';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeConfigurationItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductEntity } from './composite-product-entity';\n\n/**\n * Composite Product Item Options Adapter for changing/overwriting entity state.\n */\nexport class DaffCompositeProductAppliedOptionsEntitiesAdapter<T extends EntityState<DaffCompositeProductEntity> = EntityState<DaffCompositeProductEntity>> {\n /**\n * @docs-private\n */\n private _adapter = createEntityAdapter<DaffCompositeProductEntity>();\n\n /**\n * Gets the initial entity state.\n */\n getInitialState() {\n return this._adapter.getInitialState();\n }\n\n /**\n * Get the entity selectors.\n */\n getSelectors() {\n return this._adapter.getSelectors();\n }\n\n /**\n * Upserts the given composite products into state.\n */\n upsertProducts(state: T, ...products: DaffCompositeProduct[]): T {\n return this._adapter.upsertMany(\n this.mapOptionsEntities(products),\n state,\n );\n };\n\n /**\n * Apply the specified option for the given composite product item.\n */\n applyOption(state: T, productId: DaffCompositeProduct['id'], itemId: DaffCompositeProductItem['id'], optionId: DaffCompositeProductItemOption['id'], qty?: number) {\n return this._adapter.upsertOne(\n {\n id: productId,\n items: {\n ...state.entities[productId].items,\n [itemId]: {\n value: optionId,\n qty: qty ?? 1,\n },\n },\n },\n state,\n );\n }\n\n /**\n * @docs-private\n */\n private mapOptionsEntities(products: DaffCompositeProduct[]): DaffCompositeProductEntity[] {\n return products.filter(product => product.type === DaffProductTypeEnum.Composite)\n .map(product => this.buildCompositeProductAppliedOptionsEntity(product));\n }\n\n /**\n * @docs-private\n */\n private buildCompositeProductAppliedOptionsEntity(product: DaffCompositeProduct): DaffCompositeProductEntity {\n return {\n id: product.id,\n items: product.items.reduce((acc, item) => ({\n ...acc,\n [item.id]: this.getDefaultOption(item),\n }), {}),\n };\n }\n\n /**\n * Sets the default item option to the specified default option if it is in stock.\n * Does not set a default option if a default is not specified.\n * Does not set a default option but does set a default qty if the default is out of stock.\n *\n * @param item a DaffCompositeProductItem\n * @docs-private\n */\n private getDefaultOption(item: DaffCompositeProductItem): DaffCompositeConfigurationItem {\n const defaultOptionIndex = item.options.findIndex(option => option.is_default);\n\n if(defaultOptionIndex > -1) {\n return {\n value: item.options[defaultOptionIndex].in_stock ? item.options[defaultOptionIndex].id : null,\n qty: item.options[defaultOptionIndex].quantity,\n };\n } else {\n return { value: null, qty: null };\n }\n }\n}\n\n/**\n * Gets the composite product entity adapter singleton.\n */\nexport const daffCompositeProductAppliedOptionsEntitiesAdapter: () => DaffCompositeProductAppliedOptionsEntitiesAdapter = defaultMemoize(() => new DaffCompositeProductAppliedOptionsEntitiesAdapter()).memoized;\n","export const DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY = 'daffCompositeProduct';\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffCompositeProductReducersState } from '../reducers/composite-product-reducers-state.interface';\nimport { DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY } from '../reducers/composite-product-store-feature-key';\n\n/**\n * An interface for the composite product feature state.\n */\nexport interface DaffCompositeProductFeatureMemoizedSelector {\n selectCompositeProductState: MemoizedSelector<Record<string, any>, DaffCompositeProductReducersState>;\n}\n\n/**\n * A function that returns a selector for the composite product feature state.\n */\nexport const getDaffCompositeProductFeatureSelector = (() => {\n let cache;\n return (): DaffCompositeProductFeatureMemoizedSelector => cache = cache\n ? cache\n : { selectCompositeProductState: createFeatureSelector<DaffCompositeProductReducersState>(DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY) };\n})();\n","import {\n EntityState,\n Dictionary,\n} from '@ngrx/entity';\nimport {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\nimport { getDaffProductEntitiesSelectors } from '@daffodil/product/state';\nimport {\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n DaffCompositeProduct,\n} from '@daffodil/product-composite';\n\nimport { daffCompositeProductAppliedOptionsEntitiesAdapter } from '../../reducers/composite-product-entities/composite-product-entities-reducer-adapter';\nimport { DaffCompositeProductEntity } from '../../reducers/composite-product-entities/composite-product-entity';\nimport {\n DaffCompositeProductReducersState,\n DaffCompositeProductStateRootSlice,\n} from '../../reducers/composite-product-reducers-state.interface';\nimport { getDaffCompositeProductFeatureSelector } from '../feature.selector';\n\n/**\n * An interface for selectors related to the composite product applied options.\n */\nexport interface DaffCompositeProductEntitiesMemoizedSelectors<T extends DaffProduct = DaffProduct> {\n /**\n * The ngrx entities state for composite product applied options.\n */\n selectCompositeProductAppliedOptionsEntitiesState: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>>;\n /**\n * A selector for all composite product ids in state.\n */\n selectCompositeProductIds: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>['ids']>;\n /**\n * The ngrx entities for the composite product appllied options.\n */\n selectCompositeProductAppliedOptionsEntities: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>['entities']>;\n /**\n * The total number of composite products in state.\n */\n selectCompositeProductTotal: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n /**\n * Selects the applied options for a composite product.\n *\n * @param id the id of the composite product.\n */\n selectCompositeProductAppliedOptions: (id: T['id']) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, Dictionary<DaffCompositeProductItemOption>>;\n /**\n * Selects whether the particular item of a composite product is required in order for the product to be valid, i.e. addable to the cart.\n *\n * @param id the id of the composite product.\n * @param item_id the id of the composite product item.\n */\n selectIsCompositeProductItemRequired: (id: T['id'], item_id: DaffCompositeProductItem['id']) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, boolean>;\n}\n\nconst createCompositeProductAppliedOptionsEntitiesSelectors = <T extends DaffProduct>(): DaffCompositeProductEntitiesMemoizedSelectors<T> => {\n const {\n selectCompositeProductState,\n } = getDaffCompositeProductFeatureSelector();\n const {\n selectProduct,\n } = getDaffProductEntitiesSelectors<T>();\n const adapterSelectors = daffCompositeProductAppliedOptionsEntitiesAdapter().getSelectors();\n\n const selectCompositeProductAppliedOptionsEntitiesState = createSelector(\n selectCompositeProductState,\n (state: DaffCompositeProductReducersState) => state.compositeProductOptions,\n );\n\n const selectCompositeProductIds = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectIds,\n );\n\n const selectCompositeProductAppliedOptionsEntities = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectEntities,\n );\n\n const selectCompositeProductTotal = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectTotal,\n );\n\n const selectCompositeProductAppliedOptions = defaultMemoize((id: T['id']) => createSelector(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntitiesState,\n (product: T, appliedOptions) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n return (<DaffCompositeProduct><any>product).items.reduce((acc, item) => ({\n ...acc,\n [item.id]: appliedOptions.entities[product.id].items[item.id].value ? {\n ...item.options.find(option => option.id === appliedOptions.entities[product.id].items[item.id].value),\n quantity: appliedOptions.entities[product.id].items[item.id].qty,\n } : null,\n }), {});\n },\n )).memoized;\n\n const selectIsCompositeProductItemRequired = defaultMemoize((id: T['id'], item_id: DaffCompositeProductItem['id']) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const productItem = (<DaffCompositeProduct><any>product).items.find(item => item.id === item_id);\n\n return productItem ? productItem.required : null;\n },\n )).memoized;\n\n\n return {\n selectCompositeProductAppliedOptionsEntitiesState,\n selectCompositeProductIds,\n selectCompositeProductAppliedOptionsEntities,\n selectCompositeProductTotal,\n selectCompositeProductAppliedOptions,\n selectIsCompositeProductItemRequired,\n };\n};\n\n/**\n * A function that returns all selectors related to composite product applied option entities.\n * Returns {@link DaffCompositeProductEntitiesMemoizedSelectors}.\n */\nexport const getDaffCompositeProductEntitiesSelectors = (() => {\n let cache;\n return <T extends DaffProduct>(): DaffCompositeProductEntitiesMemoizedSelectors<T> => cache = cache\n ? cache\n : createCompositeProductAppliedOptionsEntitiesSelectors<T>();\n})();\n","import {\n Dictionary,\n EntityState,\n} from '@ngrx/entity';\nimport {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport {\n daffAdd,\n daffDivide,\n daffMultiply,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n DaffProductPrices,\n DaffPriceRange,\n} from '@daffodil/product';\nimport { getDaffProductEntitiesSelectors } from '@daffodil/product/state';\nimport {\n DaffCompositeProduct,\n DaffCompositeConfigurationItem,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductStateRootSlice } from '../../reducers/composite-product-reducers-state.interface';\nimport { DaffCompositeProductEntity } from '../../reducers/public_api';\nimport { getDaffCompositeProductEntitiesSelectors } from '../composite-product-entities/composite-product-entities.selectors';\n\n/**\n * An interface describing selectors unique to the composite product, such as pricing and discounts.\n */\nexport interface DaffCompositeProductMemoizedSelectors<T extends DaffProduct = DaffProduct> {\n /**\n * Get a DaffPriceRange for a composite product based on the configuration provided excluding unselected, optional item prices.\n */\n selectCompositeProductRequiredItemPricesForConfiguration: ( id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem> ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the broadest possible DaffPriceRange for a composite product based on the configuration provided including optional item prices.\n */\n selectCompositeProductOptionalItemPricesForConfiguration: ( id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem> ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the DaffPriceRange for a composite product based on the current configuration of selected item options in redux state and\n * excluding unselected, optional item prices.\n */\n selectCompositeProductPricesAsCurrentlyConfigured: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the discount amount for a composite product. This value will be undefined if all required options are not chosen.\n */\n selectCompositeProductDiscountAmount: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n /**\n * Get the discount percent for a composite product. This value will be undefined if all required options are not chosen.\n * Note: this percent is computed client-side and should be treated as an estimate rather than an exact value.\n */\n selectCompositeProductDiscountPercent: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n}\n\nconst createCompositeProductSelectors = <T extends DaffProduct>(): DaffCompositeProductMemoizedSelectors<T> => {\n\n const {\n selectProduct,\n } = getDaffProductEntitiesSelectors<T>();\n\n const {\n selectCompositeProductAppliedOptionsEntities,\n } = getDaffCompositeProductEntitiesSelectors();\n\n const selectCompositeProductRequiredItemPricesForConfiguration = defaultMemoize((id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const appliedOptions = configuration ? getAppliedOptionsForConfiguration(<DaffCompositeProduct><any>product, configuration) : {};\n return {\n minPrice: getMinPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n maxPrice: getMaxPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n };\n },\n )).memoized;\n\n const selectCompositeProductOptionalItemPricesForConfiguration = defaultMemoize((id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const appliedOptions = configuration ? getAppliedOptionsForConfiguration(<DaffCompositeProduct><any>product, configuration) : {};\n return {\n minPrice: getMinPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n maxPrice: getMaxPricesForConfigurationIncludingOptionalItems(<DaffCompositeProduct><any>product, appliedOptions),\n };\n },\n )).memoized;\n\n const selectCompositeProductPricesAsCurrentlyConfigured = defaultMemoize((id: T['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], DaffPriceRange>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) =>\n selectCompositeProductRequiredItemPricesForConfiguration(id, appliedOptionsEntities[id]?.items || null).projector(product),\n )).memoized;\n\n const selectCompositeProductDiscountAmount = defaultMemoize((id: DaffCompositeProduct['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], number>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n const appliedConfigurationItem = appliedOptionsEntities[product.id].items;\n if((<DaffCompositeProduct><any>product).items.filter(item => item.required && appliedConfigurationItem[item.id].value === null).length > 0) {\n return undefined;\n }\n const appliedOptions = getAppliedOptionsForConfiguration((<DaffCompositeProduct><any>product), appliedConfigurationItem);\n\n return (<DaffCompositeProduct><any>product).items.reduce((acc, item) =>\n appliedOptions[item.id]?.discount?.amount ? daffAdd(acc, daffMultiply(appliedOptions[item.id].discount.amount, appliedOptions[item.id].quantity)) : acc,\n product.discount.amount);\n },\n )).memoized;\n\n const selectCompositeProductDiscountPercent = defaultMemoize((id: DaffCompositeProduct['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], number>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n const appliedOptions = appliedOptionsEntities[product.id].items;\n if((<DaffCompositeProduct><any>product).items.filter(item => item.required && appliedOptions[item.id].value === null).length > 0) {\n return undefined;\n }\n\n const prices = getMinPricesForConfiguration(\n (<DaffCompositeProduct><any>product),\n getAppliedOptionsForConfiguration((<DaffCompositeProduct><any>product), appliedOptions),\n );\n\n return daffMultiply(\n daffDivide(\n daffSubtract(prices.originalPrice, prices.discountedPrice),\n prices.originalPrice,\n ),\n 100,\n );\n },\n )).memoized;\n\n return {\n selectCompositeProductRequiredItemPricesForConfiguration,\n selectCompositeProductOptionalItemPricesForConfiguration,\n selectCompositeProductPricesAsCurrentlyConfigured,\n selectCompositeProductDiscountAmount,\n selectCompositeProductDiscountPercent,\n };\n};\n\n/**\n * A function that returns all selectors related to the composite product feature.\n *\n * Returns {@link DaffCompositeProductMemoizedSelectors}.\n */\nexport const getDaffCompositeProductPriceSelectors = (() => {\n let cache;\n return <T extends DaffProduct = DaffProduct>(): DaffCompositeProductMemoizedSelectors<T> => cache = cache\n ? cache\n : createCompositeProductSelectors<T>();\n})();\n\n/**\n * The minimum price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMinimumRequiredCompositeItemPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.min(...item.options.map(option => option.price)), qty) : 0;\n}\n\n/**\n * The maximum price for an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMaximumRequiredCompositeItemPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.max(...item.options.map(option => option.price)), qty) : 0;\n}\n\n/**\n * The minimum discounted price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMinimumRequiredCompositeItemDiscountedPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.min(...item.options.map(getDiscountedPrice)), qty) : 0;\n}\n/**\n * The maximum discounted price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMaximumRequiredCompositeItemDiscountedPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.max(...item.options.map(getDiscountedPrice)), qty) : 0;\n}\n\n/**\n * Gets the minimum prices of a composite product for the configuration provided excluding unselected, optional item prices.\n *\n * @param product a DaffCompositeProduct\n * @param appliedOptions a Dictionary<DaffCompositeProductItemOption> that determines the current configuration of the composite product.\n */\nfunction getMinPricesForConfiguration(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n getMinimumRequiredCompositeItemDiscountedPrice(item, getOptionQty(appliedOptions[item.id])),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n getMinimumRequiredCompositeItemPrice(item, getOptionQty(appliedOptions[item.id])),\n ), product.price),\n };\n}\n\n/**\n * Gets the maximum prices of a composite product for the configuration provided excluding unselected, optional item prices.\n *\n * @param product a DaffCompositeProduct\n * @param appliedOptions a Dictionary<DaffCompositeProductItemOption> that determines the current configuration of the composite product.\n */\nfunction getMaxPricesForConfiguration(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n getMaximumRequiredCompositeItemDiscountedPrice(item, getOptionQty(appliedOptions[item.id])),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n getMaximumRequiredCompositeItemPrice(item, getOptionQty(appliedOptions[item.id])),\n ), product.price),\n };\n}\n\nfunction getDiscountedPrice(product: DaffProduct): number {\n return product.discount ? daffSubtract(product.price, product.discount.amount) : product.price;\n}\n\n/**\n * Gets the maximum prices of a composite product including optional item prices.\n *\n * @param product a DaffCompositeProduct\n */\nfunction getMaxPricesForConfigurationIncludingOptionalItems(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n appliedOptionHasQty(appliedOptions[item.id]) ?\n daffMultiply(Math.max(...item.options.map(getDiscountedPrice)), appliedOptions[item.id].quantity) :\n Math.max(...item.options.map(getDiscountedPrice)),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n appliedOptionHasQty(appliedOptions[item.id]) ?\n daffMultiply(Math.max(...item.options.map(option => option.price)), appliedOptions[item.id].quantity) :\n Math.max(...item.options.map(option => option.price)),\n ), product.price),\n };\n}\n\n/**\n * Takes a product and a set of option configurations and convert it into a dictionary of the full option objects.\n *\n * @param product a DaffCompositeProduct\n * @param configuration a Dictionary<DaffCompositeConfigurationItem> used to build the appliedOptions object.\n */\nfunction getAppliedOptionsForConfiguration(product: DaffCompositeProduct, configuration: Dictionary<DaffCompositeConfigurationItem>): Dictionary<DaffCompositeProductItemOption> {\n return product.items.reduce((acc, item) => ({\n ...acc,\n [item.id]: configuration[item.id] ? {\n ...item.options.find(option => option.id === configuration[item.id].value),\n quantity: (configuration[item.id].qty === null || configuration[item.id].qty === undefined) ? 1 : configuration[item.id].qty,\n } : null,\n }), {});\n}\n\nfunction appliedOptionHasId(appliedOption: DaffCompositeProductItemOption): boolean {\n return !!appliedOption?.id;\n}\n\nfunction getOptionQty(appliedOption: DaffCompositeProductItemOption): number {\n return appliedOptionHasQty(appliedOption) ? appliedOption.quantity : 1;\n}\n\nfunction appliedOptionHasQty(appliedOption: DaffCompositeProductItemOption): boolean {\n return appliedOption?.quantity !== null && appliedOption?.quantity !== undefined;\n}\n","import { DaffProduct } from '@daffodil/product';\n\nimport {\n DaffCompositeProductMemoizedSelectors,\n getDaffCompositeProductPriceSelectors,\n} from './composite-product/composite-product.selectors';\nimport {\n DaffCompositeProductEntitiesMemoizedSelectors,\n getDaffCompositeProductEntitiesSelectors,\n} from './composite-product-entities/composite-product-entities.selectors';\n\n/**\n * An interface for all selectors in the composite product feature area.\n */\nexport interface DaffCompositeProductAllSelectors<T extends DaffProduct = DaffProduct> extends\n DaffCompositeProductEntitiesMemoizedSelectors<T>,\n DaffCompositeProductMemoizedSelectors<T> { }\n\n/**\n * A function that returns all selectors in the composite product feature area.\n * Returns {@link DaffCompositeProductAllSelectors}.\n */\nexport const getDaffCompositeProductSelectors = <T extends DaffProduct>(): DaffCompositeProductAllSelectors<T> => ({\n ...getDaffCompositeProductEntitiesSelectors<T>(),\n ...getDaffCompositeProductPriceSelectors<T>(),\n});\n","import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffProduct,\n DaffPriceRange,\n productPriceRangeHasDiscount,\n productPriceRangeHasPriceRange,\n} from '@daffodil/product';\nimport {\n DaffCompositeConfigurationItem,\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductFacadeInterface } from './composite-product-facade.interface';\nimport { DaffCompositeProductStateRootSlice } from '../../reducers/composite-product-reducers-state.interface';\nimport { getDaffCompositeProductSelectors } from '../../selectors/public_api';\n\n/**\n * A facade for interacting with the composite product state.\n * Exposes many parts of the state for easy access and allows dispatching of actions.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductFacade<T extends DaffProduct = DaffProduct> implements DaffCompositeProductFacadeInterface {\n\n constructor(private store: Store<DaffCompositeProductStateRootSlice<T>>) {}\n\n compositeProductSelectors = getDaffCompositeProductSelectors<T>();\n\n hasDiscount = productPriceRangeHasDiscount;\n\n hasPriceRange = productPriceRangeHasPriceRange;\n\n getRequiredItemPricesForConfiguration(id: T['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductRequiredItemPricesForConfiguration(id, configuration)));\n }\n\n getOptionalItemPricesForConfiguration(id: T['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductOptionalItemPricesForConfiguration(id, configuration)));\n }\n\n getPricesAsCurrentlyConfigured(id: T['id']): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductPricesAsCurrentlyConfigured(id)));\n }\n\n getAppliedOptions(id: T['id']): Observable<Dictionary<DaffCompositeProductItemOption>> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductAppliedOptions(id)));\n }\n\n getDiscountAmount(id: T['id']): Observable<number> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductDiscountAmount(id)));\n }\n\n getDiscountPercent(id: T['id']): Observable<number> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductDiscountPercent(id)));\n }\n\n isItemRequired(id: T['id'], item_id: DaffCompositeProductItem['id']) {\n return this.store.pipe(select(this.compositeProductSelectors.selectIsCompositeProductItemRequired(id, item_id)));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { EntityState } from '@ngrx/entity';\n\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductPageActions,\n DaffProductPageActionTypes,\n DaffProductGridActionTypes,\n DaffProductGridActions,\n DaffProductActions,\n DaffProductActionTypes,\n} from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\nimport { daffCompositeProductAppliedOptionsEntitiesAdapter } from './composite-product-entities-reducer-adapter';\nimport { DaffCompositeProductEntity } from './composite-product-entity';\nimport {\n DaffCompositeProductActions,\n DaffCompositeProductActionTypes,\n} from '../../actions/public_api';\n\n/**\n * Reducer function that catches actions and changes/overwrites composite product entities state.\n *\n * @param state current State of the redux store\n * @param action ProductGrid, BestSellers, Product, or Composite Product actions\n * @returns Product entities state\n */\nexport function daffCompositeProductEntitiesReducer<T extends DaffProduct, V extends DaffCompositeProduct>(\n state = daffCompositeProductAppliedOptionsEntitiesAdapter().getInitialState(),\n action: DaffProductGridActions<T> | DaffProductActions<T> | DaffProductPageActions<T> | DaffCompositeProductActions<V>): EntityState<DaffCompositeProductEntity> {\n const adapter = daffCompositeProductAppliedOptionsEntitiesAdapter();\n switch (action.type) {\n case DaffProductGridActionTypes.ProductGridLoadSuccessAction:\n return adapter.upsertProducts(state, ...(<V[]><unknown>action.payload));\n\n case DaffProductActionTypes.ProductLoadSuccessAction:\n case DaffProductPageActionTypes.ProductPageLoadSuccessAction:\n return adapter.upsertProducts(state, ...(<V[]><unknown>action.payload.products));\n\n case DaffCompositeProductActionTypes.CompositeProductApplyOptionAction:\n return adapter.applyOption(state, action.id, action.itemId, action.optionId, action.qty);\n\n default:\n return state;\n }\n}\n","import { ActionReducerMap } from '@ngrx/store';\n\nimport { daffCompositeProductEntitiesReducer } from './composite-product-entities/composite-product-entities.reducer';\nimport { DaffCompositeProductReducersState } from './composite-product-reducers-state.interface';\n\n/**\n * Returns state values from all composite product related reducers.\n */\nexport const daffCompositeProductReducers: ActionReducerMap<DaffCompositeProductReducersState> = {\n compositeProductOptions: daffCompositeProductEntitiesReducer,\n};\n","import { ActionReducer } from '@ngrx/store';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffCompositeProductReducersState } from '../composite-product-reducers-state.interface';\n\nexport const {\n /**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffProductCompositeProvideExtraReducers}.\n */\n token: DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS,\n\n /**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * @example\n * ```ts\n * providers: [\n * ...daffProductCompositeProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\n provider: daffProductCompositeProvideExtraReducers,\n} = createMultiInjectionToken<ActionReducer<DaffCompositeProductReducersState>>('DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS');\n","import { DaffProductTypeEnum } from '@daffodil/product';\nimport { DaffProductReducersState } from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\n/**\n * Maps a list of products, ensuring that the composite products have a list of items.\n * If the incoming items is empty or nully, the items from state are intentionally used instead.\n */\nexport function daffProductCompositeEnsureItems<T extends DaffCompositeProduct = DaffCompositeProduct>(state: DaffProductReducersState<T>, products: T[]): T[] {\n return products.map((product) =>\n product.type === DaffProductTypeEnum.Composite\n ? {\n ...product,\n items: product.items.length > 0\n ? product.items\n : state.products.entities[product.id]?.items ?? [],\n }\n : product,\n );\n}\n","import { ActionReducer } from '@ngrx/store';\n\nimport {\n DaffProductActionTypes,\n DaffProductActions,\n DaffProductLoadSuccess,\n DaffProductPageActionTypes,\n DaffProductPageActions,\n DaffProductPageLoadSuccess,\n DaffProductReducersState,\n} from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\nimport { daffProductCompositeEnsureItems } from '../helpers/public_api';\n\ntype Reducer = ActionReducer<DaffProductReducersState<DaffCompositeProduct>, DaffProductActions<DaffCompositeProduct> | DaffProductPageActions<DaffCompositeProduct>>;\n\nexport function daffProductCompositeEnsureItemsMetaReducer(reducer: Reducer): Reducer {\n return (state, action) => {\n switch (action.type) {\n case DaffProductPageActionTypes.ProductPageLoadSuccessAction:\n return reducer(state, new DaffProductPageLoadSuccess({\n ...action.payload,\n products: daffProductCompositeEnsureItems(state, action.payload.products),\n }));\n\n case DaffProductActionTypes.ProductLoadSuccessAction:\n return reducer(state, new DaffProductLoadSuccess({\n ...action.payload,\n products: daffProductCompositeEnsureItems(state, action.payload.products),\n }));\n\n default:\n return reducer(state, action);\n }\n };\n}\n","import { inject } from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\nimport { daffComposeReducers } from '@daffodil/core/state';\n\nimport { DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS } from './extra.token';\nimport { daffCompositeProductReducers } from '../composite-product-reducers';\nimport { DaffCompositeProductReducersState } from '../composite-product-reducers-state.interface';\n\nexport const {\n /**\n * An internal token to hold the Daffodil composite product reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\n token: DAFF_PRODUCT_COMPOSITE_REDUCERS,\n /**\n * Provider function for {@link DAFF_PRODUCT_COMPOSITE_REDUCERS}.\n */\n provider: provideDaffProductCompositeReducers,\n} = createSingleInjectionToken<ActionReducer<DaffCompositeProductReducersState>>(\n 'DAFF_PRODUCT_COMPOSITE_REDUCERS',\n {\n factory: () => daffComposeReducers([\n combineReducers(daffCompositeProductReducers),\n ...inject(DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\n\nimport { daffProductProvideMetaReducers } from '@daffodil/product/state';\n\nimport { daffProductCompositeEnsureItemsMetaReducer } from './reducers/ensure-items.meta-reducer';\nimport { DAFF_PRODUCT_COMPOSITE_REDUCERS } from './reducers/injection-tokens/reducers.token';\nimport { DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY } from './reducers/public_api';\n\n/**\n * A module that provides the default reducers and effects for composite product redux state.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY, DAFF_PRODUCT_COMPOSITE_REDUCERS),\n ],\n providers: [\n ...daffProductProvideMetaReducers(daffProductCompositeEnsureItemsMetaReducer),\n ],\n})\nexport class DaffCompositeProductStateModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAQA;;AAEG;IACS;AAAZ,CAAA,UAAY,+BAA+B,EAAA;AACzC,IAAA,+BAAA,CAAA,mCAAA,CAAA,GAAA,qEAAyG;AAC3G,CAAC,EAFW,+BAA+B,KAA/B,+BAA+B,GAE1C,EAAA,CAAA,CAAA;AAED;;;;;;AAMG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,EAAW,EAAS,MAAsC,EAAS,QAA8C,EAAS,GAAY,EAAA;QAAtI,IAAE,CAAA,EAAA,GAAF,EAAE;QAAkB,IAAM,CAAA,MAAA,GAAN,MAAM;QAAyC,IAAQ,CAAA,QAAA,GAAR,QAAQ;QAA+C,IAAG,CAAA,GAAA,GAAH,GAAG;AAFvI,QAAA,IAAA,CAAA,IAAI,GAAG,+BAA+B,CAAC,iCAAiC;;AAGlF;;ACVD;;AAEG;MACU,iDAAiD,CAAA;AAA9D,IAAA,WAAA,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AA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,CAAA;AAA/B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,EAJ/B,SAAA,EAAA;YACT,GAAG,8BAA8B,CAAC,0CAA0C,CAAC;AAC9E,SAAA,EAAA,OAAA,EAAA,CAJC,WAAW,CAAC,UAAU,CAAC,wCAAwC,EAAE,+BAA+B,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAMxF,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAR3C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,wCAAwC,EAAE,+BAA+B,CAAC;AAClG,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,GAAG,8BAA8B,CAAC,0CAA0C,CAAC;AAC9E,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
@@ -13,7 +13,7 @@ import { DaffCompositeProductItemInputEnum } from '@daffodil/product-composite';
13
13
  class MockCompositeProductItemOption extends MockProduct {
14
14
  constructor() {
15
15
  super(...arguments);
16
- this.quantity = faker.datatype.number({ min: 1, max: 9 });
16
+ this.quantity = faker.number.int({ min: 1, max: 9 });
17
17
  this.is_default = faker.datatype.boolean();
18
18
  }
19
19
  }
@@ -24,10 +24,10 @@ class DaffCompositeProductItemOptionFactory extends DaffModelFactory {
24
24
  constructor(imageFactory) {
25
25
  super(MockCompositeProductItemOption, imageFactory);
26
26
  }
27
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductItemOptionFactory, deps: [{ token: i1.DaffProductImageFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
28
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductItemOptionFactory, providedIn: 'root' }); }
27
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductItemOptionFactory, deps: [{ token: i1.DaffProductImageFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
28
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductItemOptionFactory, providedIn: 'root' }); }
29
29
  }
30
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductItemOptionFactory, decorators: [{
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductItemOptionFactory, decorators: [{
31
31
  type: Injectable,
32
32
  args: [{
33
33
  providedIn: 'root',
@@ -40,7 +40,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
40
40
  class MockCompositeProductItem {
41
41
  constructor(optionFactory) {
42
42
  this.optionFactory = optionFactory;
43
- this.id = faker.datatype.uuid();
43
+ this.id = faker.string.uuid();
44
44
  this.url = `/${faker.internet.domainWord()}.html`;
45
45
  this.required = faker.datatype.boolean();
46
46
  this.title = faker.commerce.productName();
@@ -62,10 +62,10 @@ class DaffCompositeProductItemFactory extends DaffModelFactory {
62
62
  constructor(optionFactory) {
63
63
  super(MockCompositeProductItem, optionFactory);
64
64
  }
65
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductItemFactory, deps: [{ token: DaffCompositeProductItemOptionFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
66
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductItemFactory, providedIn: 'root' }); }
65
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductItemFactory, deps: [{ token: DaffCompositeProductItemOptionFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
66
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductItemFactory, providedIn: 'root' }); }
67
67
  }
68
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductItemFactory, decorators: [{
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductItemFactory, decorators: [{
69
69
  type: Injectable,
70
70
  args: [{
71
71
  providedIn: 'root',
@@ -90,10 +90,10 @@ class DaffCompositeProductFactory extends DaffModelFactory {
90
90
  constructor(itemFactory, imageFactory) {
91
91
  super(MockCompositeProduct, itemFactory, imageFactory);
92
92
  }
93
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductFactory, deps: [{ token: DaffCompositeProductItemFactory }, { token: i1.DaffProductImageFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
94
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductFactory, providedIn: 'root' }); }
93
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductFactory, deps: [{ token: DaffCompositeProductItemFactory }, { token: i1.DaffProductImageFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
94
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductFactory, providedIn: 'root' }); }
95
95
  }
96
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffCompositeProductFactory, decorators: [{
96
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompositeProductFactory, decorators: [{
97
97
  type: Injectable,
98
98
  args: [{
99
99
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product-composite-testing.mjs","sources":["../../../libs/product-composite/testing/src/factories/composite-product-item-option.factory.ts","../../../libs/product-composite/testing/src/factories/composite-product-item.factory.ts","../../../libs/product-composite/testing/src/factories/composite-product.factory.ts","../../../libs/product-composite/testing/src/daffodil-product-composite-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n DaffProductImageFactory,\n MockProduct,\n} from '@daffodil/product/testing';\nimport { DaffCompositeProductItemOption } from '@daffodil/product-composite';\n\n/**\n * Mocked DaffCompositeProductItemOption object.\n */\nexport class MockCompositeProductItemOption extends MockProduct implements DaffCompositeProductItemOption {\n quantity = faker.datatype.number({ min: 1, max: 9 });\n is_default = faker.datatype.boolean();\n}\n\n/**\n * Factory for creating DaffCompositeProductItemOptions.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductItemOptionFactory extends DaffModelFactory<DaffCompositeProductItemOption>{\n constructor(\n imageFactory: DaffProductImageFactory,\n ) {\n super(MockCompositeProductItemOption, imageFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n DaffCompositeProductItem,\n DaffCompositeProductItemInputEnum,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductItemOptionFactory } from './composite-product-item-option.factory';\n\n/**\n * Mocked DaffCompositeProductItem object.\n */\nexport class MockCompositeProductItem implements DaffCompositeProductItem {\n id = faker.datatype.uuid();\n url = `/${faker.internet.domainWord()}.html`;\n required = faker.datatype.boolean();\n title = faker.commerce.productName();\n input_type = DaffCompositeProductItemInputEnum.select;\n options = [\n this.optionFactory.create({\n is_default: true,\n }),\n this.optionFactory.create({\n is_default: false,\n }),\n ];\n\n constructor(\n protected optionFactory: DaffCompositeProductItemOptionFactory,\n ) {}\n}\n\n/**\n * Factory for creating DaffCompositeProductItems.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductItemFactory extends DaffModelFactory<DaffCompositeProductItem>{\n constructor(\n optionFactory: DaffCompositeProductItemOptionFactory,\n ) {\n super(MockCompositeProductItem, optionFactory);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProductTypeEnum } from '@daffodil/product';\nimport {\n DaffProductImageFactory,\n MockProduct,\n} from '@daffodil/product/testing';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\nimport { DaffCompositeProductItemFactory } from './composite-product-item.factory';\n\n/**\n * Mocked DaffCompositeProduct object.\n */\nexport class MockCompositeProduct extends MockProduct implements DaffCompositeProduct {\n type = DaffProductTypeEnum.Composite;\n items = this.itemFactory.createMany(2);\n\n constructor(\n protected itemFactory: DaffCompositeProductItemFactory,\n imageFactory: DaffProductImageFactory,\n ) {\n super(imageFactory);\n }\n}\n\n/**\n * Factory for creating DaffCompositeProducts.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductFactory extends DaffModelFactory<DaffCompositeProduct>{\n constructor(\n itemFactory: DaffCompositeProductItemFactory,\n imageFactory: DaffProductImageFactory,\n ) {\n super(MockCompositeProduct, itemFactory, imageFactory);\n }\n}\n","/**\n * Generated bundle index. Do not ed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Y,CAAC;QAHT,IAAW,CAAA,WAAA,GAAX,WAAW;AAJvB,QAAA,IAAA,CAAA,IAAI,GAAG,mBAAmB,CAAC,SAAS;QACpC,IAAK,CAAA,KAAA,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC;;AAQvC;AAED;;AAEG;AAIG,MAAO,2BAA4B,SAAQ,gBAAsC,CAAA;IACrF,WACE,CAAA,WAA4C,EAC5C,YAAqC,EAAA;AAErC,QAAA,KAAK,CAAC,oBAAoB,EAAE,WAAW,EAAE,YAAY,CAAC;;iIAL7C,2BAA2B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAC,+BAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,EAAA,CAAA,uBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cAF1B,MAAM,EAAA,CAAA,CAAA;;2FAEP,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAHvC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AChCD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-product-composite-testing.mjs","sources":["../../../libs/product-composite/testing/src/factories/composite-product-item-option.factory.ts","../../../libs/product-composite/testing/src/factories/composite-product-item.factory.ts","../../../libs/product-composite/testing/src/factories/composite-product.factory.ts","../../../libs/product-composite/testing/src/daffodil-product-composite-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n DaffProductImageFactory,\n MockProduct,\n} from '@daffodil/product/testing';\nimport { DaffCompositeProductItemOption } from '@daffodil/product-composite';\n\n/**\n * Mocked DaffCompositeProductItemOption object.\n */\nexport class MockCompositeProductItemOption extends MockProduct implements DaffCompositeProductItemOption {\n quantity = faker.number.int({ min: 1, max: 9 });\n is_default = faker.datatype.boolean();\n}\n\n/**\n * Factory for creating DaffCompositeProductItemOptions.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductItemOptionFactory extends DaffModelFactory<DaffCompositeProductItemOption>{\n constructor(\n imageFactory: DaffProductImageFactory,\n ) {\n super(MockCompositeProductItemOption, imageFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n DaffCompositeProductItem,\n DaffCompositeProductItemInputEnum,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductItemOptionFactory } from './composite-product-item-option.factory';\n\n/**\n * Mocked DaffCompositeProductItem object.\n */\nexport class MockCompositeProductItem implements DaffCompositeProductItem {\n id = faker.string.uuid();\n url = `/${faker.internet.domainWord()}.html`;\n required = faker.datatype.boolean();\n title = faker.commerce.productName();\n input_type = DaffCompositeProductItemInputEnum.select;\n options = [\n this.optionFactory.create({\n is_default: true,\n }),\n this.optionFactory.create({\n is_default: false,\n }),\n ];\n\n constructor(\n protected optionFactory: DaffCompositeProductItemOptionFactory,\n ) {}\n}\n\n/**\n * Factory for creating DaffCompositeProductItems.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductItemFactory extends DaffModelFactory<DaffCompositeProductItem>{\n constructor(\n optionFactory: DaffCompositeProductItemOptionFactory,\n ) {\n super(MockCompositeProductItem, optionFactory);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProductTypeEnum } from '@daffodil/product';\nimport {\n DaffProductImageFactory,\n MockProduct,\n} from '@daffodil/product/testing';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\nimport { DaffCompositeProductItemFactory } from './composite-product-item.factory';\n\n/**\n * Mocked DaffCompositeProduct object.\n */\nexport class MockCompositeProduct extends MockProduct implements DaffCompositeProduct {\n type = DaffProductTypeEnum.Composite;\n items = this.itemFactory.createMany(2);\n\n constructor(\n protected itemFactory: DaffCompositeProductItemFactory,\n imageFactory: DaffProductImageFactory,\n ) {\n super(imageFactory);\n }\n}\n\n/**\n * Factory for creating DaffCompositeProducts.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductFactory extends DaffModelFactory<DaffCompositeProduct>{\n constructor(\n itemFactory: DaffCompositeProductItemFactory,\n imageFactory: DaffProductImageFactory,\n ) {\n super(MockCompositeProduct, itemFactory, imageFactory);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffCompositeProductItemOptionFactory","i1.DaffCompositeProductItemFactory","i2"],"mappings":";;;;;;;;;AAUA;;AAEG;AACG,MAAO,8BAA+B,SAAQ,WAAW,CAAA;AAA/D,IAAA,WAAA,GAAA;;AACE,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;AAC/C,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE;;AACtC;AAED;;AAEG;AAIG,MAAO,qCAAsC,SAAQ,gBAAgD,CAAA;AACzG,IAAA,WAAA,CACE,YAAqC,EAAA;AAErC,QAAA,KAAK,CAAC,8BAA8B,EAAE,YAAY,CAAC;;kIAJ1C,qCAAqC,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,uBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArC,uBAAA,SAAA,IAAA,CAAA,KAAA,GAA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A,CAAA,CAAA;;4FAEP,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAHvC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AChCD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@daffodil/product-composite","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/product-composite"]}}},"version":"0.83.0","description":"Interfaces built for daffodil/state","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"publishConfig":{"directory":"../../dist/product-composite"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^19.0.0","@angular/core":"^19.0.0","@daffodil/core":"0.83.0","@daffodil/product":"0.83.0","@ngrx/effects":"^19.0.0","@ngrx/entity":"^19.0.0","@ngrx/store":"^19.0.0","rxjs":"7.8.1"},"optionalDependencies":{"@apollo/client":"^3.12.6","@daffodil/driver":"0.83.0","@daffodil/product":"0.83.0","angular-in-memory-web-api":"^0.19.0","apollo-angular":"^8.0.0","@faker-js/faker":"^7.6.0"},"module":"fesm2022/daffodil-product-composite.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/daffodil-product-composite.mjs"},"./routing":{"types":"./routing/index.d.ts","default":"./fesm2022/daffodil-product-composite-routing.mjs"},"./state":{"types":"./state/index.d.ts","default":"./fesm2022/daffodil-product-composite-state.mjs"},"./testing":{"types":"./testing/index.d.ts","default":"./fesm2022/daffodil-product-composite-testing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","default":"./fesm2022/daffodil-product-composite-driver-in-memory.mjs"},"./driver/magento":{"types":"./driver/magento/index.d.ts","default":"./fesm2022/daffodil-product-composite-driver-magento.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","default":"./fesm2022/daffodil-product-composite-driver-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","default":"./fesm2022/daffodil-product-composite-state-testing.mjs"},"./driver/magento/testing":{"types":"./driver/magento/testing/index.d.ts","default":"./fesm2022/daffodil-product-composite-driver-magento-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}}
1
+ {"name":"@daffodil/product-composite","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/product-composite"]}}},"version":"0.85.0","description":"Interfaces built for daffodil/state","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"publishConfig":{"directory":"../../dist/product-composite"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^19.0.0","@angular/core":"^19.0.0","@daffodil/core":"0.85.0","@daffodil/product":"0.85.0","@ngrx/effects":"^19.0.0","@ngrx/entity":"^19.0.0","@ngrx/store":"^19.0.0","rxjs":"7.8.1"},"optionalDependencies":{"@apollo/client":"^3.12.6","@daffodil/driver":"0.85.0","@daffodil/product":"0.85.0","angular-in-memory-web-api":"^0.19.0","apollo-angular":"^10.0.3","@faker-js/faker":"^9.8.0"},"module":"fesm2022/daffodil-product-composite.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/daffodil-product-composite.mjs"},"./routing":{"types":"./routing/index.d.ts","default":"./fesm2022/daffodil-product-composite-routing.mjs"},"./state":{"types":"./state/index.d.ts","default":"./fesm2022/daffodil-product-composite-state.mjs"},"./testing":{"types":"./testing/index.d.ts","default":"./fesm2022/daffodil-product-composite-testing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","default":"./fesm2022/daffodil-product-composite-driver-in-memory.mjs"},"./driver/magento":{"types":"./driver/magento/index.d.ts","default":"./fesm2022/daffodil-product-composite-driver-magento.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","default":"./fesm2022/daffodil-product-composite-driver-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","default":"./fesm2022/daffodil-product-composite-state-testing.mjs"},"./driver/magento/testing":{"types":"./driver/magento/testing/index.d.ts","default":"./fesm2022/daffodil-product-composite-driver-magento-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}}
@@ -1,6 +1,6 @@
1
1
  import { EntityState } from '@ngrx/entity';
2
2
  import { DaffProduct } from '@daffodil/product';
3
- import { DaffProductPageActions, DaffProductGridActions, DaffBestSellersActions, DaffProductActions } from '@daffodil/product/state';
3
+ import { DaffProductPageActions, DaffProductGridActions, DaffProductActions } from '@daffodil/product/state';
4
4
  import { DaffCompositeProduct } from '@daffodil/product-composite';
5
5
  import { DaffCompositeProductEntity } from './composite-product-entity';
6
6
  import { DaffCompositeProductActions } from '../../actions/public_api';
@@ -11,4 +11,4 @@ import { DaffCompositeProductActions } from '../../actions/public_api';
11
11
  * @param action ProductGrid, BestSellers, Product, or Composite Product actions
12
12
  * @returns Product entities state
13
13
  */
14
- export declare function daffCompositeProductEntitiesReducer<T extends DaffProduct, V extends DaffCompositeProduct>(state: EntityState<DaffCompositeProductEntity>, action: DaffProductGridActions<T> | DaffBestSellersActions<T> | DaffProductActions<T> | DaffProductPageActions<T> | DaffCompositeProductActions<V>): EntityState<DaffCompositeProductEntity>;
14
+ export declare function daffCompositeProductEntitiesReducer<T extends DaffProduct, V extends DaffCompositeProduct>(state: EntityState<DaffCompositeProductEntity>, action: DaffProductGridActions<T> | DaffProductActions<T> | DaffProductPageActions<T> | DaffCompositeProductActions<V>): EntityState<DaffCompositeProductEntity>;