ng-miam 3.5.17 → 3.6.2

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.
Files changed (51) hide show
  1. package/bundles/ng-miam.umd.js +1482 -689
  2. package/bundles/ng-miam.umd.js.map +1 -1
  3. package/bundles/ng-miam.umd.min.js +2 -2
  4. package/bundles/ng-miam.umd.min.js.map +1 -1
  5. package/esm2015/lib/_components/abstracts/abstract-recipe-card.component.js +19 -11
  6. package/esm2015/lib/_components/recipe-pricing/recipe-pricing.component.js +14 -15
  7. package/esm2015/lib/_services/basket-entries.service.js +1 -1
  8. package/esm2015/lib/_services/baskets.service.js +48 -14
  9. package/esm2015/lib/_services/context.service.js +90 -71
  10. package/esm2015/lib/_services/groceries-lists.service.js +81 -54
  11. package/esm2015/lib/_services/recipes.service.js +11 -10
  12. package/esm2015/lib/_utils/synchro-basket/basket-handler.js +124 -0
  13. package/esm2015/lib/_utils/synchro-basket/basket-handling/baskets-comparator.js +72 -0
  14. package/esm2015/lib/_utils/synchro-basket/basket-handling/comparison-item.js +98 -0
  15. package/esm2015/lib/_utils/synchro-basket/basket-handling/comparison-map.js +236 -0
  16. package/esm2015/lib/_utils/synchro-basket/basket-handling/index.js +4 -0
  17. package/esm2015/lib/_utils/synchro-basket/basket-wrapper.js +46 -0
  18. package/esm2015/lib/_utils/synchro-basket/index.js +4 -0
  19. package/esm2015/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.js +7 -5
  20. package/esm2015/lib/_web-components/basket-preview/basket-preview-line/basket-preview-line.component.js +4 -4
  21. package/esm2015/lib/_web-components/basket-preview/replace-item/replace-item.component.js +3 -3
  22. package/esm2015/lib/_web-components/catalog-recipe-card/catalog-recipe-card.component.js +116 -98
  23. package/esm2015/lib/_web-components/list-scan/basket-preview/basket-preview.component.js +2 -2
  24. package/esm2015/lib/_web-components/list-scan/ingredients-list/ingredients-list.component.js +3 -3
  25. package/esm2015/lib/_web-components/loader/loader.component.js +7 -25
  26. package/esm2015/lib/_web-components/recipe-card/recipe-card.component.js +115 -94
  27. package/esm2015/lib/_web-components/recipe-catalog/recipe-catalog.component.js +1 -1
  28. package/esm2015/lib/_web-components/recipe-details/recipe-details.component.js +303 -275
  29. package/esm2015/lib/_web-components/recipe-helper/recipe-helper.component.js +6 -8
  30. package/esm2015/lib/_web-components/recipe-modal/recipe-modal.component.js +6 -4
  31. package/esm2015/lib/_web-components/recipe-stepper/recipe-stepper.component.js +2 -2
  32. package/esm2015/lib/_web-components/suggestion-card/suggestion-card.component.js +21 -16
  33. package/fesm2015/ng-miam.js +1396 -679
  34. package/fesm2015/ng-miam.js.map +1 -1
  35. package/lib/_components/abstracts/abstract-recipe-card.component.d.ts +3 -1
  36. package/lib/_components/recipe-pricing/recipe-pricing.component.d.ts +3 -3
  37. package/lib/_services/baskets.service.d.ts +18 -3
  38. package/lib/_services/context.service.d.ts +44 -34
  39. package/lib/_services/groceries-lists.service.d.ts +13 -3
  40. package/lib/_utils/synchro-basket/basket-handler.d.ts +56 -0
  41. package/lib/_utils/synchro-basket/basket-handling/baskets-comparator.d.ts +38 -0
  42. package/lib/_utils/synchro-basket/basket-handling/comparison-item.d.ts +31 -0
  43. package/lib/_utils/synchro-basket/basket-handling/comparison-map.d.ts +76 -0
  44. package/lib/_utils/synchro-basket/basket-handling/index.d.ts +3 -0
  45. package/lib/_utils/synchro-basket/basket-wrapper.d.ts +31 -0
  46. package/lib/_utils/synchro-basket/index.d.ts +3 -0
  47. package/lib/_web-components/loader/loader.component.d.ts +1 -2
  48. package/lib/_web-components/recipe-card/recipe-card.component.d.ts +4 -0
  49. package/lib/_web-components/recipe-details/recipe-details.component.d.ts +8 -2
  50. package/lib/_web-components/recipe-helper/recipe-helper.component.d.ts +1 -3
  51. package/package.json +1 -1
@@ -377,6 +377,613 @@
377
377
  return value;
378
378
  }
379
379
 
380
+ // Interface to translate products between Miam and Cora
381
+ // This is where the special conditions related to PFT products are handled,
382
+ // as well as the quantities updates are calculated
383
+ var ComparisonItem = /** @class */ (function () {
384
+ function ComparisonItem(basketWrapper) {
385
+ this.miamQuantity = 0;
386
+ this.miamTargetQuantity = 0;
387
+ this.miamBasketEntryIds = {};
388
+ this._retailerProducts = [];
389
+ this._basketWrapper = basketWrapper;
390
+ }
391
+ Object.defineProperty(ComparisonItem.prototype, "retailerQuantity", {
392
+ get: function () {
393
+ var quantities = this._retailerProducts.map(function (retailerProduct) { return retailerProduct.quantity; });
394
+ // make the sum
395
+ return quantities.reduce(function (a, b) { return parseInt(a) + parseInt(b); }, 0);
396
+ },
397
+ enumerable: false,
398
+ configurable: true
399
+ });
400
+ ComparisonItem.prototype.clearRetailerProduct = function () {
401
+ this._retailerProducts = [];
402
+ };
403
+ Object.defineProperty(ComparisonItem.prototype, "miamBasketEntryIdsToStr", {
404
+ // only for logging purpose
405
+ get: function () {
406
+ var _this = this;
407
+ var res = '';
408
+ Object.keys(this.miamBasketEntryIds).forEach(function (beId) {
409
+ var qty = _this.miamBasketEntryIds[beId];
410
+ res += beId + ": " + qty + ", ";
411
+ });
412
+ return res;
413
+ },
414
+ enumerable: false,
415
+ configurable: true
416
+ });
417
+ Object.defineProperty(ComparisonItem.prototype, "firstBasketEntryId", {
418
+ get: function () {
419
+ return Object.keys(this.miamBasketEntryIds)[0];
420
+ },
421
+ enumerable: false,
422
+ configurable: true
423
+ });
424
+ ComparisonItem.prototype.removeFirstMiamEntry = function (qtyToRemove) {
425
+ var firstKey = Object.keys(this.miamBasketEntryIds)[0];
426
+ var quantity = this.miamBasketEntryIds[firstKey];
427
+ if (quantity > qtyToRemove) {
428
+ this.miamBasketEntryIds[firstKey] = quantity - qtyToRemove;
429
+ return [firstKey, qtyToRemove];
430
+ }
431
+ else {
432
+ delete this.miamBasketEntryIds[firstKey];
433
+ return [firstKey, quantity];
434
+ }
435
+ };
436
+ // --------------------------------------------------------------------------------------------
437
+ // --- COMING FROM Retailer -----------------------------------------------------------------------
438
+ // --------------------------------------------------------------------------------------------
439
+ /**
440
+ * _retailerProducts is a array for some retailer (like cora)
441
+ * so to have the moset standart code we turn it into an array
442
+ * even if it's not needed
443
+ * @param {array<{id:string, quantity:quantity}>} retailerProduct
444
+ */
445
+ ComparisonItem.prototype.addOrUpdateRetailerProduct = function (retailerProduct) {
446
+ if (this._retailerProducts.length === 0 || this.retailerQuantity === 0) {
447
+ this._retailerProducts = [retailerProduct];
448
+ return;
449
+ }
450
+ var existingRetailerProduct = this._retailerProducts[0];
451
+ existingRetailerProduct.quantity = retailerProduct.quantity;
452
+ return;
453
+ };
454
+ // --------------------------------------------------------------------------------------------
455
+ // --- COMING FROM MIAM -----------------------------------------------------------------------
456
+ // --------------------------------------------------------------------------------------------
457
+ ComparisonItem.prototype.createRetailerProducts = function (basketEntry, targetQuantity) {
458
+ if (basketEntry.selectedItem) {
459
+ this._retailerProducts = [{ id: basketEntry.selectedItem.attributes['ext-id'], quantity: targetQuantity }];
460
+ }
461
+ return this._retailerProducts;
462
+ };
463
+ /**
464
+ * transforms product (and potentially additional parameters such as quantity)
465
+ * @param retailerProduct product of retailer format
466
+ * @returns miam format ({id: string, quantity: number})
467
+ */
468
+ // eslint-disable-next-line no-unused-vars
469
+ ComparisonItem.prototype.mapProductToEntry = function (retailerProduct) {
470
+ throw new Error('You must implement \'mapProductToEntry\' for this retailer');
471
+ };
472
+ // will update cora quantity according to quantityDiff = compItem.miamTargetQuantity - compItem.miamQuantity
473
+ // could be a simple update or a delete (or partial delete for pft items)
474
+ // NB : compItem.miamTargetQuantity === 0 does NOT mean a total delete, for exemple if coraQuantity > miamQuantity
475
+ ComparisonItem.prototype.updateRetailerProducts = function () {
476
+ var quantityDiff = this.miamTargetQuantity - this.miamQuantity;
477
+ if (quantityDiff === 0 || this._retailerProducts.length === 0) { // here length of cora product should never be 0 but security check it
478
+ return [];
479
+ }
480
+ var item = this._retailerProducts[0];
481
+ // TODO quantity / quantite ??
482
+ item.quantity += quantityDiff;
483
+ if (item.quantity <= 0) {
484
+ // no more cora product, in this case miamQuantity should have been coraQuantity and miamTargetQuantity 0
485
+ this.clearRetailerProduct();
486
+ }
487
+ return [item];
488
+ };
489
+ return ComparisonItem;
490
+ }());
491
+
492
+ // Controller that handles the events coming from Cora or Miam
493
+ // This is where we define the comparison objects for each product, depending on what updates happened in Cora or Miam
494
+ // The "resolve" functions return an array of products to be updated (removed / added). Three possible cases :
495
+ // - products to be removed from Miam
496
+ // - products to be added to Cora
497
+ // - products to be removed from Cora
498
+ var ComparisonMap = /** @class */ (function () {
499
+ /**
500
+ *
501
+ * @param retailerBasket
502
+ * @param miamBasket
503
+ * @param comparisonItemType
504
+ */
505
+ function ComparisonMap(basketWrapper, retailerBasket, miamBasket, comparisonItemType) {
506
+ if (comparisonItemType === void 0) { comparisonItemType = ComparisonItem; }
507
+ this._extIdToComparisonItem = {};
508
+ this._comparisonItemType = comparisonItemType;
509
+ this._basketWrapper = basketWrapper;
510
+ this.addEntryInMapFromRetailer(retailerBasket);
511
+ this._setFromMiam(miamBasket);
512
+ }
513
+ /**
514
+ *
515
+ * @param extId
516
+ * @returns
517
+ */
518
+ ComparisonMap.prototype._fetchComparisonItem = function (extId) {
519
+ var compItem = this._extIdToComparisonItem[extId];
520
+ if (!compItem) {
521
+ compItem = new this._comparisonItemType(this._basketWrapper);
522
+ this._extIdToComparisonItem[extId] = compItem;
523
+ }
524
+ return compItem;
525
+ };
526
+ /**
527
+ *
528
+ */
529
+ ComparisonMap.prototype.cleanNullProducts = function () {
530
+ var _this = this;
531
+ Object.keys(this._extIdToComparisonItem).forEach(function (extId) {
532
+ var compItem = _this._extIdToComparisonItem[extId];
533
+ if (compItem.miamQuantity === 0 && compItem.retailerQuantity === 0) {
534
+ delete _this._extIdToComparisonItem[extId];
535
+ }
536
+ });
537
+ };
538
+ // --------------------------------------------------------------------------------------------
539
+ // --- COMING FROM Retailer-----------------------------------------------------------------------
540
+ // --------------------------------------------------------------------------------------------
541
+ /**
542
+ * add / update / delete compraisonItem to _extIdToComparisonItem
543
+ * @param {*} retailerBasket
544
+ */
545
+ ComparisonMap.prototype.updateMapFromRetailer = function (retailerBasket) {
546
+ this.addEntryInMapFromRetailer(retailerBasket);
547
+ this.deleteEntrieInMapFromRetailer(retailerBasket);
548
+ };
549
+ /**
550
+ *
551
+ * @param {*} retailerBasket
552
+ */
553
+ ComparisonMap.prototype.addEntryInMapFromRetailer = function (retailerBasket) {
554
+ var _this = this;
555
+ retailerBasket.forEach(function (retailerEntrie) {
556
+ var compItem = _this._fetchComparisonItem(retailerEntrie.id);
557
+ compItem.addOrUpdateRetailerProduct(retailerEntrie);
558
+ });
559
+ };
560
+ /**
561
+ *
562
+ * @param {*} retailerBasket
563
+ */
564
+ ComparisonMap.prototype.deleteEntrieInMapFromRetailer = function (retailerBasket) {
565
+ var _this = this;
566
+ Object.keys(this._extIdToComparisonItem).forEach(function (extId) {
567
+ _this.checkIfEntryIsToDeleteFromMap(extId, retailerBasket);
568
+ });
569
+ };
570
+ /**
571
+ * if there is no more item with given extId
572
+ * on Retailer's basket we have to remove it
573
+ * @param extId to check
574
+ * @param retailerBasket current retailer's basket
575
+ */
576
+ ComparisonMap.prototype.checkIfEntryIsToDeleteFromMap = function (extId, retailerBasket) {
577
+ var compItem = this._extIdToComparisonItem[extId];
578
+ var itemInRetailerBasket = retailerBasket.find(function (retailerEntrie) { return retailerEntrie.id === extId; });
579
+ if (!itemInRetailerBasket) {
580
+ compItem.clearRetailerProduct();
581
+ }
582
+ };
583
+ /**
584
+ * Retailler can only delete miam's entries
585
+ * @returns
586
+ */
587
+ ComparisonMap.prototype.resolveFromRetailer = function () {
588
+ var _this = this;
589
+ var toRemoveFromMiam = [];
590
+ Object.keys(this._extIdToComparisonItem).forEach(function (extId) {
591
+ var compItem = _this._extIdToComparisonItem[extId];
592
+ var quantityDelta = compItem.miamQuantity - compItem.retailerQuantity;
593
+ if (quantityDelta > 0) {
594
+ toRemoveFromMiam = __spread(toRemoveFromMiam, _this.getQuantityToRemove(compItem, quantityDelta));
595
+ compItem.miamQuantity = compItem.retailerQuantity;
596
+ }
597
+ });
598
+ return toRemoveFromMiam;
599
+ };
600
+ /**
601
+ * while there is still qty to remove
602
+ * remove qunatity from the next basket entry
603
+ * @param {Object} compItem
604
+ * @param {number}
605
+ * @returns an array of entries to remove from miam
606
+ */
607
+ ComparisonMap.prototype.getQuantityToRemove = function (compItem, stillToRemove) {
608
+ var _a;
609
+ var toRemoveFromMiam = [];
610
+ while (stillToRemove > 0) {
611
+ var beId = void 0;
612
+ var quantityRemoved = void 0;
613
+ _a = __read(compItem.removeFirstMiamEntry(stillToRemove), 2), beId = _a[0], quantityRemoved = _a[1];
614
+ if (beId == undefined || quantityRemoved == undefined) {
615
+ stillToRemove = 0;
616
+ }
617
+ else {
618
+ stillToRemove -= quantityRemoved;
619
+ toRemoveFromMiam.push({ id: beId, qty: quantityRemoved });
620
+ }
621
+ }
622
+ return toRemoveFromMiam;
623
+ };
624
+ // --------------------------------------------------------------------------------------------
625
+ // --- COMING FROM MIAM -----------------------------------------------------------------------
626
+ // --------------------------------------------------------------------------------------------
627
+ /**
628
+ *
629
+ * @param {*} miamBasket
630
+ */
631
+ ComparisonMap.prototype.setTargetFromMiam = function (miamBasket) {
632
+ console.debug("set target from miam", miamBasket);
633
+ // loop on comparison map and update targetQuantity according to miamB
634
+ this._updateTargetFromMiam(miamBasket);
635
+ // add those missing in comparison item
636
+ this._addTargetFromMiam(miamBasket);
637
+ };
638
+ /**
639
+ *
640
+ * @param {*} miamBasket
641
+ * @returns
642
+ */
643
+ ComparisonMap.prototype.resolveFromMiam = function (miamBasket) {
644
+ var _this = this;
645
+ console.debug("resolve from Miam basket", miamBasket);
646
+ var toPushToRetailer = [];
647
+ Object.keys(this._extIdToComparisonItem).forEach(function (extId) {
648
+ toPushToRetailer = __spread(toPushToRetailer, _this.createOrUpdate(extId, miamBasket));
649
+ });
650
+ return toPushToRetailer;
651
+ };
652
+ /**
653
+ *
654
+ */
655
+ ComparisonMap.prototype.createOrUpdate = function (extId, miamBasket) {
656
+ var compItem = this._extIdToComparisonItem[extId];
657
+ var itemsToPush;
658
+ if (compItem.retailerQuantity === 0 && compItem.miamTargetQuantity !== 0) {
659
+ // it is a creation
660
+ // if there is more than one basket id for this product, arbitrary take the first
661
+ // it will result at the same cora creation anyway
662
+ var basketEntry = miamBasket.find(function (be) { return be.id == compItem.firstBasketEntryId; });
663
+ itemsToPush = compItem.createRetailerProducts(basketEntry, compItem.miamTargetQuantity);
664
+ }
665
+ else {
666
+ itemsToPush = compItem.updateRetailerProducts();
667
+ }
668
+ compItem.miamQuantity = compItem.miamTargetQuantity;
669
+ return itemsToPush;
670
+ };
671
+ ComparisonMap.prototype._setFromMiam = function (miamBasket) {
672
+ var _this = this;
673
+ miamBasket.forEach(function (basketEntry) {
674
+ // TODO : retirer si on a que des basketEntry actives ?
675
+ var extId = basketEntry.selectedItem &&
676
+ basketEntry.selectedItem.attributes["ext-id"];
677
+ if (!extId) {
678
+ return;
679
+ }
680
+ var compItem = _this._fetchComparisonItem(extId);
681
+ // may already exist if two different ingredients matched same item
682
+ compItem.miamQuantity += basketEntry.attributes.quantity;
683
+ compItem.miamBasketEntryIds[basketEntry.id] =
684
+ basketEntry.attributes.quantity;
685
+ });
686
+ };
687
+ // loop on comparison map and update targetQuantity according to miamB
688
+ ComparisonMap.prototype._updateTargetFromMiam = function (miamBasket) {
689
+ var _this = this;
690
+ Object.keys(this._extIdToComparisonItem).forEach(function (extId) {
691
+ var compItem = _this._extIdToComparisonItem[extId];
692
+ // you can have différent ingredients (ie different be) matching the same product
693
+ var miamBasketEntries = miamBasket.filter(function (basketEntry) {
694
+ return (basketEntry.selectedItem &&
695
+ basketEntry.selectedItem.attributes["ext-id"] === extId);
696
+ });
697
+ if (miamBasketEntries.length > 0) {
698
+ var quantities = miamBasketEntries.map(function (be) { return be.attributes.quantity; });
699
+ compItem.miamTargetQuantity = quantities.reduce(function (a, b) { return parseInt(a) + parseInt(b); }, 0);
700
+ compItem.miamBasketEntryIds = miamBasketEntries.reduce(function (map, be) {
701
+ map[be.id] = parseInt(be.attributes.quantity);
702
+ return map;
703
+ }, {});
704
+ }
705
+ else {
706
+ compItem.miamTargetQuantity = 0;
707
+ compItem.miamBasketEntryIds = {};
708
+ }
709
+ });
710
+ };
711
+ // add comparisonItem and target quantity according to those in miamB missing in comparisonMap
712
+ ComparisonMap.prototype._addTargetFromMiam = function (miamBasket) {
713
+ var _this = this;
714
+ // ---
715
+ miamBasket.forEach(function (basketEntry) {
716
+ // TODO : retirer si on a que des basketEntry actives ?
717
+ var extId = basketEntry.selectedItem &&
718
+ basketEntry.selectedItem.attributes["ext-id"];
719
+ if (!extId) {
720
+ return;
721
+ }
722
+ if (_this._extIdToComparisonItem[extId]) {
723
+ return;
724
+ }
725
+ var compItem = _this._fetchComparisonItem(extId);
726
+ // here in fact the target quantity is useless as we we will need to create a product, we can use basketEntry.quantity
727
+ compItem.miamTargetQuantity += basketEntry.attributes.quantity;
728
+ compItem.miamBasketEntryIds[basketEntry.id] =
729
+ basketEntry.attributes.quantity;
730
+ });
731
+ };
732
+ return ComparisonMap;
733
+ }());
734
+
735
+ /**
736
+ *
737
+ */
738
+ var BasketsComparator = /** @class */ (function () {
739
+ /**
740
+ *
741
+ * @param {*} existingRetailerBasket
742
+ * @param {*} firstMiamBasket
743
+ * @param {*} comparisonMapClass
744
+ */
745
+ function BasketsComparator(basketWrapper, existingRetailerBasket, firstMiamBasket, comparisonMapClass) {
746
+ if (comparisonMapClass === void 0) { comparisonMapClass = ComparisonMap; }
747
+ this.isProcessingRetailerEvent = true;
748
+ this._basketWrapper = basketWrapper;
749
+ this._comparisonMap = new comparisonMapClass(basketWrapper, existingRetailerBasket, firstMiamBasket);
750
+ var toRemoveFromMiam = this._comparisonMap.resolveFromRetailer();
751
+ this.sendUpdateToMiam(toRemoveFromMiam);
752
+ }
753
+ /**
754
+ *
755
+ * @param {*} basket
756
+ */
757
+ BasketsComparator.prototype.updateReceivedFromMiam = function (basket) {
758
+ this._comparisonMap.setTargetFromMiam(basket);
759
+ var toPushToRetailer = this._comparisonMap.resolveFromMiam(basket);
760
+ this._comparisonMap.cleanNullProducts();
761
+ this.sendUpdateToRetailer(toPushToRetailer);
762
+ };
763
+ /**
764
+ *
765
+ * @param {*} retailerBasket
766
+ */
767
+ BasketsComparator.prototype.updateReceivedFromRetailer = function (retailerBasket) {
768
+ this.isProcessingRetailerEvent = true;
769
+ this._comparisonMap.updateMapFromRetailer(retailerBasket);
770
+ var toRemoveFromMiam = this._comparisonMap.resolveFromRetailer();
771
+ this._comparisonMap.cleanNullProducts();
772
+ this.sendUpdateToMiam(toRemoveFromMiam);
773
+ };
774
+ /**
775
+ *
776
+ * @param {*} entriesToRemove
777
+ * @returns
778
+ */
779
+ BasketsComparator.prototype.sendUpdateToMiam = function (entriesToRemove) {
780
+ var _this = this;
781
+ console.debug('will remove from miam', entriesToRemove);
782
+ if (entriesToRemove.length === 0) {
783
+ console.debug('stop processing retailer event');
784
+ this.isProcessingRetailerEvent = false;
785
+ return;
786
+ }
787
+ window.miam.basket.removeEntries(entriesToRemove).subscribe(function () {
788
+ console.debug('stop processing retailer event');
789
+ _this.isProcessingRetailerEvent = false;
790
+ });
791
+ };
792
+ /**
793
+ *
794
+ * @param {*} itemsToAdd
795
+ * @returns
796
+ */
797
+ BasketsComparator.prototype.sendUpdateToRetailer = function (itemsToAdd) {
798
+ var _this = this;
799
+ console.debug('will update retailer', itemsToAdd);
800
+ if (itemsToAdd.length === 0) {
801
+ return;
802
+ }
803
+ this._basketWrapper.pushProductsToBasket(itemsToAdd.map(function (item) {
804
+ return _this._basketWrapper.mapComparableProductToProduct(item);
805
+ }));
806
+ };
807
+ return BasketsComparator;
808
+ }());
809
+
810
+ /**
811
+ * Instantiate listener on retailer and Miam
812
+ */
813
+ var BasketHandler = /** @class */ (function () {
814
+ function BasketHandler(wrapper) {
815
+ this.basketWrapper = wrapper;
816
+ }
817
+ /**
818
+ * Handle payment first if necessary then start basket synchronization
819
+ */
820
+ BasketHandler.prototype.initBasketProcess = function () {
821
+ var _this = this;
822
+ this.firstMiamBasketReceived = false;
823
+ this.handlePayment(function () {
824
+ _this.handleBasketSync();
825
+ });
826
+ };
827
+ /**
828
+ * Handle Payment and confirm basket
829
+ * @param callback to call after payment handling
830
+ */
831
+ BasketHandler.prototype.handlePayment = function (callback) {
832
+ if (this.basketWrapper.hasPayment()) {
833
+ var total = this.basketWrapper.paymentTotal();
834
+ var token = localStorage.getItem('_miam/basketToken');
835
+ if (token) {
836
+ // Miam basket that was confirmed on miam.tech => validate payment
837
+ localStorage.removeItem('_miam/basketToken');
838
+ this.sendMiamOrder(total, token);
839
+ callback();
840
+ }
841
+ else {
842
+ // Local Miam basket (with entries OR NOT) => confirm it and validate payment only if total received from miam > 0
843
+ this.confirmBasket(total, callback);
844
+ }
845
+ }
846
+ else {
847
+ callback();
848
+ }
849
+ };
850
+ /**
851
+ * Used only for basket pushed from miam.tech
852
+ * @param total price of order
853
+ * @param token of the basket
854
+ */
855
+ BasketHandler.prototype.sendMiamOrder = function (total, token) {
856
+ console.debug('[Miam] payment detected', total, token);
857
+ window.miam.basket.paid(total * 100); // need to pass the total in cents for analytics event
858
+ if (token) {
859
+ console.log('[Miam] Send payment notification', token);
860
+ window.miam.supplier.notifyBasketUpdated(token, 'PAID', total);
861
+ }
862
+ };
863
+ /**
864
+ * Confirm basket and notify API
865
+ * @param total price of order
866
+ * @param callback to be called after payment handling
867
+ */
868
+ BasketHandler.prototype.confirmBasket = function (total, callback) {
869
+ var _this = this;
870
+ window.miam.basket.confirm().subscribe(function (basket) {
871
+ if (basket && basket.token && basket.totalPrice > 0) {
872
+ var token = basket.token;
873
+ console.log('[Miam] Send confirmation notification', token);
874
+ window.miam.supplier.notifyBasketUpdated(token, 'CONFIRMED');
875
+ _this.sendMiamOrder(total, token);
876
+ }
877
+ callback();
878
+ });
879
+ };
880
+ /**
881
+ * To implement for each retailer
882
+ */
883
+ BasketHandler.prototype.listenToRetailer = function (callback) {
884
+ this.basketWrapper.listenToRetailerBasket(callback);
885
+ };
886
+ /**
887
+ * Start listening on Miam's basket
888
+ * need to be call with bind(this) to keep object ref
889
+ * else this will be global 'this' which means window
890
+ * @param callback to call when basket is updated
891
+ */
892
+ BasketHandler.prototype.listenToMiam = function (callback) {
893
+ var _this = this;
894
+ window.miam.basket.entries$.subscribe(function (miamBasket) {
895
+ console.debug('Miam basket received', miamBasket, _this.firstMiamBasketReceived);
896
+ if (!_this.firstMiamBasketReceived && miamBasket.length === 0) {
897
+ // Skip first empty array received
898
+ _this.firstMiamBasketReceived = true;
899
+ return;
900
+ }
901
+ else {
902
+ callback(miamBasket);
903
+ }
904
+ });
905
+ };
906
+ /**
907
+ * Start basket synchronization
908
+ */
909
+ BasketHandler.prototype.handleBasketSync = function () {
910
+ var _this = this;
911
+ this.listenToMiam(function (miamBasket) {
912
+ // Comparison should be initialized when first Miam basket is received, based on existing Retailer basket
913
+ if (!_this.comparator) {
914
+ var existingRetailerBasket = _this.basketWrapper.getBasketProducts();
915
+ _this.comparator = new BasketsComparator(_this.basketWrapper, existingRetailerBasket, miamBasket);
916
+ // We listen to Retailer basket updates only after the first basket is received from Miam
917
+ _this.listenToRetailer(_this.retailerBasketChangeCallBack.bind(_this));
918
+ return;
919
+ }
920
+ if (_this.comparator.isProcessingRetailerEvent) {
921
+ console.debug('skipping retailer is processing');
922
+ return;
923
+ }
924
+ // When comparison is already initialized, we just update it
925
+ _this.comparator.updateReceivedFromMiam(miamBasket);
926
+ });
927
+ };
928
+ /**
929
+ * Callback to be called after each basket change on retailer's side
930
+ * @param retailerBasket basket of the retailer (format : {id: string, quantity: number })
931
+ */
932
+ BasketHandler.prototype.retailerBasketChangeCallBack = function (retailerBasket) {
933
+ this.comparator.updateReceivedFromRetailer(retailerBasket);
934
+ };
935
+ return BasketHandler;
936
+ }());
937
+
938
+ var BasketWrapper = /** @class */ (function () {
939
+ function BasketWrapper() {
940
+ }
941
+ /**
942
+ * @returns true if payment occured
943
+ */
944
+ BasketWrapper.prototype.hasPayment = function () {
945
+ throw new Error('You must implement \'hasPayment\' for this retailer');
946
+ };
947
+ /**
948
+ * @returns payment total when a payment occured
949
+ */
950
+ BasketWrapper.prototype.paymentTotal = function () {
951
+ throw new Error('You must implement \'paymentTotal\' for this retailer');
952
+ };
953
+ /**
954
+ * Here we listen to Retailer basket change and then call the given
955
+ * @param basketChangedCallBack implemented in basket handler
956
+ */
957
+ // eslint-disable-next-line no-unused-vars
958
+ BasketWrapper.prototype.listenToRetailerBasket = function (basketChangedCallBack) {
959
+ throw new Error('You must implement \'lisentToRetailerBasket\' for this retailer');
960
+ };
961
+ /**
962
+ * @return a list of articles in retailer's basket in RETAILER format
963
+ */
964
+ BasketWrapper.prototype.getBasketProducts = function () {
965
+ throw new Error('You must implement \'getBasketProducts\' for this retailer');
966
+ };
967
+ /**
968
+ * This call retailer function for adding programaticaly product to cart
969
+ * @param retailerProducts format use by retailer to add product in his cart
970
+ */
971
+ // eslint-disable-next-line no-unused-vars
972
+ BasketWrapper.prototype.pushProductsToBasket = function (retailerProducts) {
973
+ throw new Error('You must implement \'pushProductsToBasket\' for this retailer');
974
+ };
975
+ /**
976
+ * transform object to needed format to push on retailer basket
977
+ * @param injectEntry in miam format ({id: string, quantity: number})
978
+ * @returns product to retailer format
979
+ */
980
+ // eslint-disable-next-line no-unused-vars
981
+ BasketWrapper.prototype.mapComparableProductToProduct = function (comparableProduct) {
982
+ throw new Error('You must implement \'mapComparableProductToProduct\' for this retailer');
983
+ };
984
+ return BasketWrapper;
985
+ }());
986
+
380
987
  var PointOfSale = /** @class */ (function (_super) {
381
988
  __extends(PointOfSale, _super);
382
989
  function PointOfSale() {
@@ -694,39 +1301,68 @@
694
1301
  _this.analyticsService = analyticsService;
695
1302
  _this.resource = GroceriesList;
696
1303
  _this.type = 'groceries-lists';
697
- _this.list$ = new rxjs.BehaviorSubject(null);
698
1304
  // Unused in sdk at the moment but any client app can subscribe on it to know when a recipe has been added
699
1305
  _this.recipeWasAdded$ = new rxjs.BehaviorSubject([]);
700
1306
  // Unused in sdk at the moment but any client app can subscribe on it to know when a recipe has been added
701
1307
  _this.recipeWasDeleted$ = new rxjs.BehaviorSubject([]);
1308
+ // Singleton instance of GroceriesList
1309
+ _this._list$ = new rxjs.BehaviorSubject(null);
702
1310
  _this.saveOperationType = '';
1311
+ // Observe the fetching of the recipe so calls to list$ are delayed instead of calling refreshCurrentList dozens of times
1312
+ _this.listIsFetching = false;
703
1313
  _this.register();
704
- _this.refreshCurrentList();
705
1314
  return _this;
706
1315
  }
1316
+ Object.defineProperty(GroceriesListsService.prototype, "list$", {
1317
+ /**
1318
+ * We want list$ to be a singleton that always returns the same list, so it is fetched only when necessary.
1319
+ * At any point in time the list can be fetched via the refreshCurrentList function (if we want to fetch it on startup to save time later)
1320
+ * But if refreshCurrentList is not called, the list will only be fetched the 1st time it is needed
1321
+ */
1322
+ get: function () {
1323
+ if (this._list$.value || this.listIsFetching) {
1324
+ return this._list$;
1325
+ }
1326
+ return this.refreshCurrentList();
1327
+ },
1328
+ enumerable: false,
1329
+ configurable: true
1330
+ });
1331
+ GroceriesListsService.prototype.takeFirstList = function () {
1332
+ return this.list$.pipe(operators.skipWhile(function (l) { return !l; }), operators.take(1));
1333
+ };
1334
+ // Check if recipe with id = recipeId is in the GroceriesList
1335
+ GroceriesListsService.prototype.recipeIsInList = function (recipeId) {
1336
+ return this._list$.pipe(operators.skipWhile(function (l) { return !l; }), operators.take(1), operators.map(function (list) { return (list.hasRecipe(recipeId)); }));
1337
+ };
1338
+ GroceriesListsService.prototype.guestsForRecipe = function (recipe) {
1339
+ var _a;
1340
+ return (_a = this._list$.value) === null || _a === void 0 ? void 0 : _a.guestsForRecipe(recipe);
1341
+ };
707
1342
  GroceriesListsService.prototype.refreshCurrentList = function () {
708
1343
  var _this = this;
709
1344
  console.log('[Miam] refreshing gl');
1345
+ this.listIsFetching = true;
710
1346
  var cachedListId = localStorage.getItem('_miam/listId');
711
1347
  // adding this uuid will force request to be sent even if one is still in process
712
1348
  // think about making a queue to process request in order
713
- var base_route = 'current?uniq_token=' + uuid.v4();
714
- var endpoint = (cachedListId === null || cachedListId === void 0 ? void 0 : cachedListId.toString().match(/^[0-9]+$/)) ? base_route + '&merge_with=' + cachedListId : base_route;
1349
+ var baseRoute = 'current?uniq_token=' + uuid.v4();
1350
+ var endpoint = (cachedListId === null || cachedListId === void 0 ? void 0 : cachedListId.toString().match(/^[0-9]+$/)) ? baseRoute + '&merge_with=' + cachedListId : baseRoute;
715
1351
  // alway keep only the last subscription, that will make forget the last calls
716
1352
  if (this.currentSubscription) {
717
1353
  this.currentSubscription.unsubscribe();
718
1354
  }
719
1355
  this.currentSubscription = this.get(endpoint).pipe(operators.skipWhile(function (l) { return l.is_loading; }), operators.tap(function (l) { return _this.assignList(l); })).subscribe();
720
- return this.list$;
1356
+ return this._list$;
721
1357
  };
722
1358
  GroceriesListsService.prototype.resetList = function () {
723
1359
  var _this = this;
724
1360
  return this.get('reset').pipe(operators.skipWhile(function (l) { return l.is_loading; }), operators.tap(function (l) { return _this.assignList(l); }));
725
1361
  };
726
1362
  GroceriesListsService.prototype.appendRecipeToList = function (recipeId, guests, origin, openBasket) {
1363
+ var _this = this;
727
1364
  if (openBasket === void 0) { openBasket = false; }
728
- var list = this.list$.value;
729
- if (list) {
1365
+ return this.takeFirstList().pipe(operators.switchMap(function (list) {
730
1366
  if (!list.hasRecipe(recipeId)) {
731
1367
  // append to list
732
1368
  list.attributes['append-recipes'] = true;
@@ -735,68 +1371,73 @@
735
1371
  Object.assign(info, { guests: guests });
736
1372
  }
737
1373
  list.attributes['recipes-infos'] = [info];
738
- this.saveOperationType = 'ADD';
739
- this.analyticsService.sendEvent('add-recipe', origin);
1374
+ _this.saveOperationType = 'ADD';
1375
+ _this.analyticsService.sendEvent('add-recipe', origin);
740
1376
  }
741
1377
  else if (guests) {
742
1378
  // update guests number
743
1379
  var info = list.recipeInfos.find(function (i) { return i.id === recipeId; });
744
1380
  if (info.guests.toString() === guests.toString()) {
745
1381
  // Avoid saving the list if nothing changed
746
- return this.list$;
1382
+ return _this._list$;
747
1383
  }
748
1384
  info.guests = guests.toString();
749
1385
  }
750
- return this.saveList(list, openBasket);
751
- }
752
- return rxjs.of(null);
1386
+ return _this.saveList(list, openBasket);
1387
+ }));
753
1388
  };
754
1389
  GroceriesListsService.prototype.removeRecipeFromList = function (recipeId) {
755
- var list = this.list$.value;
756
- if (list.attributes['recipes-infos']) {
757
- list.attributes['recipes-infos'] = list.attributes['recipes-infos'].filter(function (info) {
758
- return info.id !== recipeId;
759
- });
760
- this.analyticsService.sendEvent('remove-recipe');
761
- this.saveOperationType = 'REMOVE';
762
- return this.saveList(list);
763
- }
764
- return rxjs.of(null);
1390
+ var _this = this;
1391
+ return this.takeFirstList().pipe(operators.switchMap(function (list) {
1392
+ if (list.attributes['recipes-infos']) {
1393
+ list.attributes['recipes-infos'] = list.attributes['recipes-infos'].filter(function (info) {
1394
+ return info.id !== recipeId;
1395
+ });
1396
+ _this.analyticsService.sendEvent('remove-recipe');
1397
+ _this.saveOperationType = 'REMOVE';
1398
+ return _this.saveList(list);
1399
+ }
1400
+ return rxjs.of(null);
1401
+ }));
765
1402
  };
766
1403
  GroceriesListsService.prototype.updateRecipeGuests = function (recipeId, guests) {
767
- var list = this.list$.value;
768
- if (list.attributes['recipes-infos']) {
769
- var recipeInfo = list.attributes['recipes-infos'].find(function (info) {
770
- return info.id === recipeId;
771
- });
772
- recipeInfo.guests = guests;
773
- this.analyticsService.sendEvent('change-guests');
774
- this.saveOperationType = 'GUESTS';
775
- this.saveList(list).subscribe();
776
- }
777
- return this.list$;
1404
+ var _this = this;
1405
+ return this.takeFirstList().pipe(operators.switchMap(function (list) {
1406
+ if (list.attributes['recipes-infos']) {
1407
+ var recipeInfo = list.attributes['recipes-infos'].find(function (info) {
1408
+ return info.id === recipeId;
1409
+ });
1410
+ recipeInfo.guests = guests;
1411
+ _this.analyticsService.sendEvent('change-guests');
1412
+ _this.saveOperationType = 'GUESTS';
1413
+ return _this.saveList(list);
1414
+ }
1415
+ return _this._list$;
1416
+ }));
778
1417
  };
779
1418
  GroceriesListsService.prototype.removeRecipesFromList = function () {
780
- var list = this.list$.value;
781
- list.attributes['recipes-infos'] = [];
782
- this.analyticsService.sendEvent('remove-all-recipes');
783
- this.saveOperationType = 'REMOVE';
784
- this.saveList(list).subscribe();
785
- return this.list$;
1419
+ var _this = this;
1420
+ return this.takeFirstList().pipe(operators.switchMap(function (list) {
1421
+ list.attributes['recipes-infos'] = [];
1422
+ _this.analyticsService.sendEvent('remove-all-recipes');
1423
+ _this.saveOperationType = 'REMOVE';
1424
+ return _this.saveList(list);
1425
+ }));
786
1426
  };
787
1427
  GroceriesListsService.prototype.addEntriesFromPicture = function (file, include) {
788
1428
  var _this = this;
789
1429
  if (include === void 0) { include = []; }
790
- var list = this.list$.value;
791
- var url = [environment.miamAPI, 'api/v1/groceries-lists', list.id, 'add_entries_from_picture'].join('/');
792
- var formData = new FormData();
793
- formData.append('picture', file);
794
- formData.append('include', include.join(','));
795
- return this.http.patch(url, formData).pipe(operators.map(function (response) {
796
- var l = _this.new();
797
- l.fill(response);
798
- _this.list$.next(l);
799
- return l;
1430
+ return this.takeFirstList().pipe(operators.switchMap(function (list) {
1431
+ var url = [environment.miamAPI, 'api/v1/groceries-lists', list.id, 'add_entries_from_picture'].join('/');
1432
+ var formData = new FormData();
1433
+ formData.append('picture', file);
1434
+ formData.append('include', include.join(','));
1435
+ return _this.http.patch(url, formData).pipe(operators.map(function (response) {
1436
+ var l = _this.new();
1437
+ l.fill(response);
1438
+ _this._list$.next(l);
1439
+ return l;
1440
+ }));
800
1441
  }));
801
1442
  };
802
1443
  GroceriesListsService.prototype.saveList = function (list, openBasket) {
@@ -804,7 +1445,7 @@
804
1445
  if (openBasket === void 0) { openBasket = false; }
805
1446
  delete (list.attributes['recipes-ids']);
806
1447
  return list.save().pipe(operators.skipWhile(function (l) { return l.is_loading; }), operators.tap(function () {
807
- _this.list$.next(list);
1448
+ _this._list$.next(list);
808
1449
  if (_this.saveOperationType === 'ADD') {
809
1450
  _this.recipeWasAdded$.next(list.recipeInfos);
810
1451
  }
@@ -815,7 +1456,7 @@
815
1456
  if (openBasket) {
816
1457
  window.open(_this.miamBasketURL + "/" + list.id, '_blank');
817
1458
  }
818
- }));
1459
+ }), operators.map(function (l) { return l.data; }));
819
1460
  };
820
1461
  GroceriesListsService.prototype.assignList = function (l) {
821
1462
  // When a CORS error happens the response is a GL with an id equal to the request URL
@@ -827,7 +1468,8 @@
827
1468
  else {
828
1469
  localStorage.setItem('_miam/listId', l.id);
829
1470
  }
830
- this.list$.next(l);
1471
+ this._list$.next(l);
1472
+ this.listIsFetching = false;
831
1473
  }
832
1474
  };
833
1475
  return GroceriesListsService;
@@ -2483,15 +3125,16 @@
2483
3125
  }
2484
3126
  RecipesService.prototype.loadRecipes = function () {
2485
3127
  var _this = this;
2486
- var list = this.listsService.list$.value;
2487
- if (!list) {
2488
- return rxjs.of(null);
2489
- }
2490
- else if (list.attributes['recipes-infos'].length === 0) {
2491
- return rxjs.of([]);
2492
- }
2493
- return rxjs.forkJoin(list.attributes['recipes-infos'].map(function (info) {
2494
- return _this.getOrFetch(info.id).pipe(operators.skipWhile(function (r) { return r.is_loading; }), operators.tap(function (r) { return r.modifiedGuests = info.guests; }));
3128
+ return this.listsService.takeFirstList().pipe(operators.switchMap(function (list) {
3129
+ if (!list) {
3130
+ return rxjs.of(null);
3131
+ }
3132
+ else if (list.attributes['recipes-infos'].length === 0) {
3133
+ return rxjs.of([]);
3134
+ }
3135
+ return rxjs.forkJoin(list.attributes['recipes-infos'].map(function (info) {
3136
+ return _this.getOrFetch(info.id).pipe(operators.skipWhile(function (r) { return r.is_loading; }), operators.tap(function (r) { return r.modifiedGuests = info.guests; }));
3137
+ }));
2495
3138
  }));
2496
3139
  };
2497
3140
  // TODO: REMOVE UNUSED
@@ -2665,15 +3308,46 @@
2665
3308
  _this.analyticsService = analyticsService;
2666
3309
  _this.resource = Basket;
2667
3310
  _this.type = 'baskets';
2668
- _this.basket$ = new rxjs.BehaviorSubject(null);
2669
- _this.basketPreview$ = new rxjs.BehaviorSubject(null);
3311
+ _this._basket$ = new rxjs.BehaviorSubject(null);
3312
+ _this._basketPreview$ = new rxjs.BehaviorSubject(null);
2670
3313
  _this.basketStats$ = new rxjs.BehaviorSubject({ totalPrice: 0, recipesCount: 0, entriesCount: 0 });
3314
+ _this.basketIsFetching = false;
3315
+ _this.basketPreviewIsCalculating = false;
2671
3316
  _this._entries$ = new rxjs.BehaviorSubject([]);
2672
3317
  _this.register();
2673
- _this.loadBasket().subscribe();
2674
- _this.loadPreview();
2675
3318
  return _this;
2676
3319
  }
3320
+ Object.defineProperty(BasketsService.prototype, "basket$", {
3321
+ /**
3322
+ * We want basket$ to be a singleton that always returns the same basket, so it is fetched only when necessary.
3323
+ * At any point in time the basket can be fetched via the initBasket function (if we want to fetch it on startup to save time later)
3324
+ * But if initBasket is not called, the basket will only be fetched the 1st time it is needed.
3325
+ */
3326
+ get: function () {
3327
+ if (!this._basket$.value && !this.basketIsFetching) {
3328
+ this.basketIsFetching = true;
3329
+ this.initBasket();
3330
+ }
3331
+ return this._basket$;
3332
+ },
3333
+ enumerable: false,
3334
+ configurable: true
3335
+ });
3336
+ Object.defineProperty(BasketsService.prototype, "basketPreview$", {
3337
+ /**
3338
+ * basketPreview$ should also be a singleton, and as well as basket$ it will be calculated for the first time only when necessary
3339
+ * or if loadPreview is called before
3340
+ */
3341
+ get: function () {
3342
+ if (!this._basketPreview$.value && !this.basketPreviewIsCalculating) {
3343
+ this.basketPreviewIsCalculating = true;
3344
+ this.initBasket();
3345
+ }
3346
+ return this._basketPreview$;
3347
+ },
3348
+ enumerable: false,
3349
+ configurable: true
3350
+ });
2677
3351
  // Fetch related baskets, filtering on a point of sale
2678
3352
  BasketsService.prototype.fetchForListAndPos = function (listId, posId) {
2679
3353
  var _this = this;
@@ -2688,9 +3362,12 @@
2688
3362
  return baskets.data[0];
2689
3363
  }));
2690
3364
  };
2691
- BasketsService.prototype.loadBasket = function () {
2692
- var _this = this;
2693
- return rxjs.combineLatest([this.listsService.list$, this.posService.pos$]).pipe(operators.skipWhile(function (results) { return !results[0] || !results[1]; }), operators.switchMap(function (results) { return _this.fetchForListAndPos(results[0].id, results[1].id); }), operators.tap(function (basket) { return _this.basket$.next(basket); }));
3365
+ BasketsService.prototype.initBasket = function () {
3366
+ this.loadBasket().subscribe();
3367
+ this.loadPreview().subscribe();
3368
+ };
3369
+ BasketsService.prototype.reloadBasket = function () {
3370
+ return this.loadBasket().pipe(operators.take(1));
2694
3371
  };
2695
3372
  // Set basket as confirmed, and returns only once the new current list is returned
2696
3373
  BasketsService.prototype.confirmBasket = function () {
@@ -2709,10 +3386,10 @@
2709
3386
  _this.analyticsService.sendEvent('push-basket', null, (total * 100));
2710
3387
  }
2711
3388
  // set basket as undefined as it because inconsistent while we reset the list. then wait for new one
2712
- _this.basket$.next(undefined);
3389
+ _this._basket$.next(undefined);
2713
3390
  return _this.listsService.resetList();
2714
3391
  }), operators.switchMap(function () {
2715
- return _this.basket$;
3392
+ return _this._basket$;
2716
3393
  }), operators.skipWhile(function (b) { return !b; }), operators.map(function () { return confirmedBasket; }));
2717
3394
  };
2718
3395
  BasketsService.prototype.basketEntries = function () {
@@ -2747,18 +3424,26 @@
2747
3424
  });
2748
3425
  return rxjs.forkJoin(saveObservables).pipe(operators.switchMap(function () { return _this.listsService.refreshCurrentList(); }), operators.take(1));
2749
3426
  };
3427
+ BasketsService.prototype.loadBasket = function () {
3428
+ var _this = this;
3429
+ return rxjs.combineLatest([this.listsService.list$, this.posService.pos$]).pipe(operators.skipWhile(function (results) { return !results[0] || !results[1]; }), operators.switchMap(function (results) { return _this.fetchForListAndPos(results[0].id, results[1].id); }), operators.tap(function (basket) {
3430
+ _this._basket$.next(basket);
3431
+ _this.basketIsFetching = false;
3432
+ }));
3433
+ };
2750
3434
  BasketsService.prototype.loadPreview = function () {
2751
3435
  var _this = this;
2752
- this.basket$.pipe(operators.skipWhile(function (b) { return !b; }), operators.switchMap(function () { return _this.recipesService.loadRecipes(); }), operators.switchMap(function (recipes) {
2753
- var basket = _this.basket$.value;
3436
+ return this.basket$.pipe(operators.skipWhile(function (b) { return !b; }), operators.switchMap(function () { return _this.recipesService.loadRecipes(); }), operators.switchMap(function (recipes) {
3437
+ var basket = _this._basket$.value;
2754
3438
  return _this.fetchBasketEntries(basket).pipe(operators.map(function (entries) {
2755
3439
  var lineEntries = _this.groupBasketEntries(recipes, entries);
2756
3440
  var lines = _this.recipesAndLineEntriesToBasketPreviewLine(recipes, lineEntries);
2757
- _this.basketPreview$.next(lines);
3441
+ _this._basketPreview$.next(lines);
3442
+ _this.basketPreviewIsCalculating = false;
2758
3443
  _this.basketStats$.next(_this.buildStats(lines));
3444
+ return lines;
2759
3445
  }));
2760
- })).subscribe();
2761
- return this.basketPreview$;
3446
+ }));
2762
3447
  };
2763
3448
  BasketsService.prototype.fetchBasketEntries = function (basket) {
2764
3449
  var _this = this;
@@ -3443,39 +4128,68 @@
3443
4128
  this.displayIngredientPicturesOnRecipeCards = false;
3444
4129
  this.defaultIngredientPicture = 'https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg';
3445
4130
  this.isSmallScreen$ = new rxjs.BehaviorSubject(false);
4131
+ this.basketWrapper = new BasketWrapper();
3446
4132
  this.miam = {
3447
- user: {
3448
- setToken: function (token, forbidProfiling) {
3449
- if (forbidProfiling === void 0) { forbidProfiling = false; }
3450
- localStorage.setItem('_miam/userToken', token);
3451
- localStorage.removeItem('_miam/userId');
3452
- _this.userService.toggleIsLogged(true);
3453
- _this.listsService.refreshCurrentList();
3454
- return _this.userService.setUserInfo(forbidProfiling);
4133
+ analytics: {
4134
+ init: function (gaKey, optimizeKey) {
4135
+ if (optimizeKey === void 0) { optimizeKey = null; }
4136
+ return _this.analyticsService.init(gaKey, optimizeKey);
3455
4137
  },
3456
- loadWithExtId: function (id, forbidProfiling) {
3457
- if (forbidProfiling === void 0) { forbidProfiling = false; }
3458
- localStorage.setItem('_miam/userId', id);
3459
- localStorage.removeItem('_miam/userToken');
3460
- _this.userService.toggleIsLogged(true);
3461
- _this.listsService.refreshCurrentList();
3462
- return _this.userService.setUserInfo(forbidProfiling);
4138
+ setAbTestKey: function (key) {
4139
+ _this.analyticsService.abTestkey = key;
4140
+ }
4141
+ },
4142
+ basket: {
4143
+ stats$: this.basketsService.basketStats$,
4144
+ entries$: this.basketsService.activeBasketEntries(),
4145
+ confirm: function () { return _this.basketsService.confirmBasket(); },
4146
+ paid: function (price) {
4147
+ if (price === void 0) { price = 0; }
4148
+ console.log('[Miam] send payment analytics event');
4149
+ _this.analyticsService.sendEvent('pay-basket', null, price);
3463
4150
  },
3464
- reset: function () {
3465
- localStorage.removeItem('_miam/userToken');
3466
- localStorage.removeItem('_miam/userId');
3467
- _this.userService.toggleIsLogged(false);
3468
- console.log('[Miam] will refresh list after reset');
3469
- _this.listsService.refreshCurrentList();
3470
- _this.userService.resetUserInfo();
4151
+ removeEntries: function (entries) { return _this.basketsService.removeBasketEntries(entries); },
4152
+ initBasketSynchro: function () {
4153
+ _this.basketHandler = new BasketHandler(_this.basketWrapper);
4154
+ _this.basketHandler.initBasketProcess();
4155
+ }
4156
+ },
4157
+ basketMapper: {
4158
+ hasPayment: function (callback) { return _this.basketWrapper.hasPayment = callback; },
4159
+ paymentTotal: function (callback) { return _this.basketWrapper.paymentTotal = callback; },
4160
+ listenToRetailerBasket: function (callback) {
4161
+ _this.basketWrapper.listenToRetailerBasket = callback;
3471
4162
  },
3472
- device: this.mediaMatcher,
3473
- isSmallScreen$: this.isSmallScreen$.asObservable()
4163
+ getBasketProducts: function (callback) { return _this.basketWrapper.getBasketProducts = callback; },
4164
+ pushProductsToBasket: function (callback) { return _this.basketWrapper.pushProductsToBasket = callback; },
4165
+ mapComparableProductToProduct: function (callback) {
4166
+ _this.basketWrapper.mapComparableProductToProduct = callback;
4167
+ },
4168
+ },
4169
+ features: {
4170
+ enableVideoRecipes: function () {
4171
+ _this.videoRecipesEnabled = true;
4172
+ // Inject youtube script
4173
+ var tag = document.createElement('script');
4174
+ tag.src = 'https://www.youtube.com/iframe_api';
4175
+ document.body.appendChild(tag);
4176
+ },
4177
+ enableArticlesInCatalog: function () {
4178
+ _this.articlesInCatalogEnabled = true;
4179
+ },
4180
+ enableUserPreferences: function () {
4181
+ _this.userService.preferencesActivated$.next(true);
4182
+ }
4183
+ },
4184
+ hook: {
4185
+ setHookCallback: function (callback) {
4186
+ _this.hookCallback = callback;
4187
+ }
3474
4188
  },
3475
4189
  list: {
3476
4190
  reset: function () { return _this.listsService.resetList().subscribe(); },
3477
4191
  addRecipe: function (recipeId, guests) { return _this.listsService.appendRecipeToList(recipeId, guests, 'client'); },
3478
- hasRecipe: function (recipeId) { return _this.listsService.list$.pipe(operators.map(function (list) { return list.hasRecipe(recipeId); })); }
4192
+ hasRecipe: function (recipeId) { return _this.listsService.recipeIsInList(recipeId); }
3479
4193
  },
3480
4194
  pos: {
3481
4195
  load: function (posId) {
@@ -3486,30 +4200,7 @@
3486
4200
  },
3487
4201
  pos$: this.posService.pos$
3488
4202
  },
3489
- supplier: {
3490
- load: function (supplierId) {
3491
- _this.suppliersService.loadSupplier(supplierId.toString());
3492
- },
3493
- notifyBasketUpdated: function (basketToken, status, price) {
3494
- if (price === void 0) { price = null; }
3495
- _this.suppliersService.notifyBasketUpdated(basketToken, status, price).subscribe();
3496
- }
3497
- },
3498
- basket: {
3499
- stats$: this.basketsService.basketStats$,
3500
- entries$: this.basketsService.activeBasketEntries(),
3501
- confirm: function () { return _this.basketsService.confirmBasket(); },
3502
- paid: function (price) {
3503
- if (price === void 0) { price = 0; }
3504
- console.log('[Miam] send payment analytics event');
3505
- _this.analyticsService.sendEvent('pay-basket', null, price);
3506
- },
3507
- removeEntries: function (entries) { return _this.basketsService.removeBasketEntries(entries); }
3508
- },
3509
4203
  recipes: {
3510
- provider: {
3511
- load: function (id) { return _this.recipesProvidersService.loadCachedProvider(id); }
3512
- },
3513
4204
  display: function (id, previewAllowed, previewMode) {
3514
4205
  if (previewAllowed === void 0) { previewAllowed = true; }
3515
4206
  if (previewMode === void 0) { previewMode = false; }
@@ -3519,46 +4210,52 @@
3519
4210
  search: function (provider, query) {
3520
4211
  return _this.recipesService.all({ remotefilter: { recipe_provider_id: provider, search: query } }).pipe(operators.skipWhile(function (result) { return !result; }), operators.map(function (response) { return response['data']; }));
3521
4212
  },
3522
- setDefaultIngredientPicture: function (url) {
3523
- _this.defaultIngredientPicture = url;
3524
- },
3525
4213
  shouldDisplayIngredientPicturesOnRecipeCards: function (should) {
3526
4214
  _this.displayIngredientPicturesOnRecipeCards = should;
3527
4215
  },
4216
+ setDefaultIngredientPicture: function (url) {
4217
+ _this.defaultIngredientPicture = url;
4218
+ },
3528
4219
  setSuggestionsPrimaryButtonActions: function (display, addToBasket) {
3529
4220
  if (display === void 0) { display = true; }
3530
4221
  if (addToBasket === void 0) { addToBasket = true; }
3531
4222
  _this.recipesService.suggestionsPrimaryButtonActions = { display: display, addToBasket: addToBasket };
3532
4223
  }
3533
4224
  },
3534
- analytics: {
3535
- init: function (gaKey, optimizeKey) {
3536
- if (optimizeKey === void 0) { optimizeKey = null; }
3537
- return _this.analyticsService.init(gaKey, optimizeKey);
4225
+ supplier: {
4226
+ load: function (supplierId) {
4227
+ _this.suppliersService.loadSupplier(supplierId.toString());
3538
4228
  },
3539
- setAbTestKey: function (key) {
3540
- _this.analyticsService.abTestkey = key;
3541
- }
3542
- },
3543
- hook: {
3544
- setHookCallback: function (callback) {
3545
- _this.hookCallback = callback;
4229
+ notifyBasketUpdated: function (basketToken, status, price) {
4230
+ if (price === void 0) { price = null; }
4231
+ _this.suppliersService.notifyBasketUpdated(basketToken, status, price).subscribe();
3546
4232
  }
3547
4233
  },
3548
- features: {
3549
- enableVideoRecipes: function () {
3550
- _this.videoRecipesEnabled = true;
3551
- // Inject youtube script
3552
- var tag = document.createElement('script');
3553
- tag.src = 'https://www.youtube.com/iframe_api';
3554
- document.body.appendChild(tag);
4234
+ user: {
4235
+ setToken: function (token, forbidProfiling, initBasket) {
4236
+ if (forbidProfiling === void 0) { forbidProfiling = false; }
4237
+ if (initBasket === void 0) { initBasket = false; }
4238
+ localStorage.setItem('_miam/userToken', token);
4239
+ localStorage.removeItem('_miam/userId');
4240
+ return _this.logUser(forbidProfiling, initBasket);
3555
4241
  },
3556
- enableArticlesInCatalog: function () {
3557
- _this.articlesInCatalogEnabled = true;
4242
+ loadWithExtId: function (id, forbidProfiling, initBasket) {
4243
+ if (forbidProfiling === void 0) { forbidProfiling = false; }
4244
+ if (initBasket === void 0) { initBasket = false; }
4245
+ localStorage.setItem('_miam/userId', id);
4246
+ localStorage.removeItem('_miam/userToken');
4247
+ return _this.logUser(forbidProfiling, initBasket);
3558
4248
  },
3559
- enableUserPreferences: function () {
3560
- _this.userService.preferencesActivated$.next(true);
3561
- }
4249
+ reset: function () {
4250
+ localStorage.removeItem('_miam/userToken');
4251
+ localStorage.removeItem('_miam/userId');
4252
+ _this.userService.toggleIsLogged(false);
4253
+ console.log('[Miam] will refresh list after reset');
4254
+ _this.listsService.refreshCurrentList();
4255
+ _this.userService.resetUserInfo();
4256
+ },
4257
+ device: this.mediaMatcher,
4258
+ isSmallScreen$: this.isSmallScreen$.asObservable()
3562
4259
  },
3563
4260
  /**
3564
4261
  * Override two times 'll not be considered
@@ -3576,8 +4273,8 @@
3576
4273
  _this.icons.push({ icon: icon, url: url });
3577
4274
  }
3578
4275
  };
3579
- this.isSmallScreen$.next(this.mediaMatcher.matchMedia(SMALL_SCREEN_BP).matches);
3580
- this.breakpointObserver.observe(SMALL_SCREEN_BP).subscribe(function (BPChange) { return _this.isSmallScreen$.next(BPChange.matches); });
4276
+ this.isSmallScreen$.next(!this.mediaMatcher.matchMedia(SMALL_SCREEN_BP).matches);
4277
+ this.breakpointObserver.observe(SMALL_SCREEN_BP).subscribe(function (BPChange) { return _this.isSmallScreen$.next(!BPChange.matches); });
3581
4278
  this.icons = [];
3582
4279
  this.CORSIssues = new rxjs.BehaviorSubject(false);
3583
4280
  Object.assign(window, { miam: this.miam });
@@ -3592,6 +4289,14 @@
3592
4289
  var findicon = this.icons.find(function (el) { return el.icon.toString() === exports.Icon[icon]; });
3593
4290
  return findicon ? findicon.url : '';
3594
4291
  };
4292
+ ContextService.prototype.logUser = function (forbidProfiling, initBasket) {
4293
+ this.userService.toggleIsLogged(true);
4294
+ // if initBasket is set to false, the basket & list will not be initialised until the first time they are needed
4295
+ if (initBasket) {
4296
+ this.basketsService.initBasket(); // The basket needs the GL so both will be initialized here
4297
+ }
4298
+ return this.userService.setUserInfo(forbidProfiling);
4299
+ };
3595
4300
  return ContextService;
3596
4301
  }());
3597
4302
  ContextService.ɵfac = function ContextService_Factory(t) { return new (t || ContextService)(i0.ɵɵinject(PointOfSalesService), i0.ɵɵinject(GroceriesListsService), i0.ɵɵinject(BasketsService), i0.ɵɵinject(UserService), i0.ɵɵinject(RecipeProviderService), i0.ɵɵinject(AnalyticsService), i0.ɵɵinject(RecipesService), i0.ɵɵinject(i1$2.MediaMatcher), i0.ɵɵinject(SuppliersService), i0.ɵɵinject(i1$2.BreakpointObserver)); };
@@ -6768,9 +7473,10 @@
6768
7473
  }
6769
7474
  }
6770
7475
  var RecipePricingComponent = /** @class */ (function () {
6771
- function RecipePricingComponent(recipesService, posService, cdr, basketsService) {
7476
+ function RecipePricingComponent(recipesService, posService, list, cdr, basketsService) {
6772
7477
  this.recipesService = recipesService;
6773
7478
  this.posService = posService;
7479
+ this.list = list;
6774
7480
  this.cdr = cdr;
6775
7481
  this.basketsService = basketsService;
6776
7482
  this.loading = true;
@@ -6780,16 +7486,19 @@
6780
7486
  this.subscriptions.push(this.initPricing().subscribe());
6781
7487
  };
6782
7488
  RecipePricingComponent.prototype.ngOnChanges = function (changes) {
7489
+ var _this = this;
6783
7490
  // If the recipe is in basket, we ignore the change => pricing will be updated when the new basket preview is ready
6784
7491
  // After the shallow copy with events of the recipe, ngOnChanges is called again because the recipe object is different
6785
7492
  // So if changes contains only a recipe and no serves, we also avoid re-fetching
6786
- if (!this.isRecipeInBasket() && changes.serves) {
6787
- this.loading = true;
6788
- if (this.onChangesSubscription) {
6789
- this.onChangesSubscription.unsubscribe();
7493
+ this.list.recipeIsInList(this.recipe.id).subscribe(function (recipeIsInList) {
7494
+ if (!recipeIsInList && changes.serves) {
7495
+ _this.loading = true;
7496
+ if (_this.onChangesSubscription) {
7497
+ _this.onChangesSubscription.unsubscribe();
7498
+ }
7499
+ _this.onChangesSubscription = _this.fetchPricing().subscribe();
6790
7500
  }
6791
- this.onChangesSubscription = this.fetchPricing().subscribe();
6792
- }
7501
+ });
6793
7502
  };
6794
7503
  RecipePricingComponent.prototype.ngOnDestroy = function () {
6795
7504
  this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
@@ -6797,11 +7506,6 @@
6797
7506
  this.onChangesSubscription.unsubscribe();
6798
7507
  }
6799
7508
  };
6800
- RecipePricingComponent.prototype.isRecipeInBasket = function () {
6801
- var _this = this;
6802
- var _a;
6803
- return !!((_a = this.basketsService.basketPreview$.value) === null || _a === void 0 ? void 0 : _a.find(function (l) { var _a, _b, _c; return l.isRecipe && ((_a = l.id) === null || _a === void 0 ? void 0 : _a.toString()) === ((_c = (_b = _this.recipe) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.toString()); }));
6804
- };
6805
7509
  // Will execute every time the pos is changed or the basket preview is recalculated
6806
7510
  RecipePricingComponent.prototype.initPricing = function () {
6807
7511
  var _this = this;
@@ -6853,7 +7557,7 @@
6853
7557
  };
6854
7558
  return RecipePricingComponent;
6855
7559
  }());
6856
- RecipePricingComponent.ɵfac = function RecipePricingComponent_Factory(t) { return new (t || RecipePricingComponent)(i0.ɵɵdirectiveInject(RecipesService), i0.ɵɵdirectiveInject(PointOfSalesService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(BasketsService)); };
7560
+ RecipePricingComponent.ɵfac = function RecipePricingComponent_Factory(t) { return new (t || RecipePricingComponent)(i0.ɵɵdirectiveInject(RecipesService), i0.ɵɵdirectiveInject(PointOfSalesService), i0.ɵɵdirectiveInject(GroceriesListsService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(BasketsService)); };
6857
7561
  RecipePricingComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RecipePricingComponent, selectors: [["ng-miam-recipe-pricing"]], inputs: { recipe: "recipe", serves: "serves" }, features: [i0.ɵɵNgOnChangesFeature], decls: 2, vars: 1, consts: [[1, "miam-recipe-pricing"], ["class", "miam-recipe-pricing__wrapper", 4, "ngIf"], [1, "miam-recipe-pricing__wrapper"], [1, "miam-recipe-pricing__wrapper__price"], [1, "miam-recipe-pricing__wrapper__subline"]], template: function RecipePricingComponent_Template(rf, ctx) {
6858
7562
  if (rf & 1) {
6859
7563
  i0.ɵɵelementStart(0, "div", 0);
@@ -6875,7 +7579,7 @@
6875
7579
  encapsulation: i0.ViewEncapsulation.None,
6876
7580
  changeDetection: i0.ChangeDetectionStrategy.OnPush
6877
7581
  }]
6878
- }], function () { return [{ type: RecipesService }, { type: PointOfSalesService }, { type: i0.ChangeDetectorRef }, { type: BasketsService }]; }, { recipe: [{
7582
+ }], function () { return [{ type: RecipesService }, { type: PointOfSalesService }, { type: GroceriesListsService }, { type: i0.ChangeDetectorRef }, { type: BasketsService }]; }, { recipe: [{
6879
7583
  type: i0.Input
6880
7584
  }], serves: [{
6881
7585
  type: i0.Input
@@ -7829,36 +8533,17 @@
7829
8533
  }], null, null);
7830
8534
  })();
7831
8535
 
7832
- function LoaderComponent_div_0_Template(rf, ctx) {
7833
- if (rf & 1) {
7834
- i0.ɵɵelementStart(0, "div", 2);
7835
- i0.ɵɵelement(1, "div", 3);
7836
- i0.ɵɵelementEnd();
7837
- }
7838
- }
7839
- function LoaderComponent_div_1_Template(rf, ctx) {
7840
- if (rf & 1) {
7841
- i0.ɵɵelement(0, "div", 3);
7842
- }
7843
- }
7844
8536
  var LoaderComponent = /** @class */ (function () {
7845
8537
  function LoaderComponent() {
7846
- this.wide = false;
7847
8538
  }
7848
8539
  return LoaderComponent;
7849
8540
  }());
7850
8541
  LoaderComponent.ɵfac = function LoaderComponent_Factory(t) { return new (t || LoaderComponent)(); };
7851
- LoaderComponent.ɵcmp = i0.ɵɵdefineComponent({ type: LoaderComponent, selectors: [["ng-miam-loader"]], inputs: { wide: "wide" }, decls: 2, vars: 2, consts: [["class", "wide-container", 4, "ngIf"], ["class", "loader", 4, "ngIf"], [1, "wide-container"], [1, "loader"]], template: function LoaderComponent_Template(rf, ctx) {
8542
+ LoaderComponent.ɵcmp = i0.ɵɵdefineComponent({ type: LoaderComponent, selectors: [["ng-miam-loader"]], decls: 1, vars: 0, consts: [[1, "loader"]], template: function LoaderComponent_Template(rf, ctx) {
7852
8543
  if (rf & 1) {
7853
- i0.ɵɵtemplate(0, LoaderComponent_div_0_Template, 2, 0, "div", 0);
7854
- i0.ɵɵtemplate(1, LoaderComponent_div_1_Template, 1, 0, "div", 1);
7855
- }
7856
- if (rf & 2) {
7857
- i0.ɵɵproperty("ngIf", ctx.wide);
7858
- i0.ɵɵadvance(1);
7859
- i0.ɵɵproperty("ngIf", !ctx.wide);
8544
+ i0.ɵɵelement(0, "div", 0);
7860
8545
  }
7861
- }, directives: [i8.NgIf], styles: [".loader{-webkit-animation:spin .5s linear infinite;animation:spin .5s linear infinite;border:var(--m-loader-thickness) solid var(--m-color-grey);border-radius:var(--m-border-radius-circle);border-top:var(--m-loader-thickness) solid var(--m-color-ternary);height:var(--m-loader-size);width:var(--m-loader-size)}@-webkit-keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"], encapsulation: 2 });
8546
+ }, styles: [".loader{-webkit-animation:spin .5s linear infinite;animation:spin .5s linear infinite;border:var(--m-loader-thickness) solid var(--m-color-grey);border-radius:var(--m-border-radius-circle);border-top:var(--m-loader-thickness) solid var(--m-color-ternary);height:var(--m-loader-size);width:var(--m-loader-size)}@-webkit-keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"], encapsulation: 2 });
7862
8547
  /*@__PURE__*/ (function () {
7863
8548
  i0.ɵsetClassMetadata(LoaderComponent, [{
7864
8549
  type: i0.Component,
@@ -7868,9 +8553,7 @@
7868
8553
  encapsulation: i0.ViewEncapsulation.None,
7869
8554
  styleUrls: ['./loader.component.scss']
7870
8555
  }]
7871
- }], function () { return []; }, { wide: [{
7872
- type: i0.Input
7873
- }] });
8556
+ }], function () { return []; }, null);
7874
8557
  })();
7875
8558
 
7876
8559
  var LoaderModule = /** @class */ (function () {
@@ -8404,7 +9087,7 @@
8404
9087
  this.line.record.attributes.quantity = count;
8405
9088
  this.line.record.updateTotalPrice();
8406
9089
  this.analyticsService.sendEvent('change-item-quantity');
8407
- this.subscriptions.push(this.line.record.save().pipe(operators.switchMap(function () { return _this.basketsService.loadBasket(); }), operators.take(1)).subscribe());
9090
+ this.subscriptions.push(this.line.record.save().pipe(operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe());
8408
9091
  };
8409
9092
  BasketPreviewLineComponent.prototype.toggleExpanded = function (event) {
8410
9093
  if (!this.line.hasEntries() ||
@@ -8429,7 +9112,7 @@
8429
9112
  // Remove related groceries entry (update status to "deleted") and reload list
8430
9113
  var gEntry = entry.relationships['groceries-entry'].data;
8431
9114
  gEntry.attributes.status = 'deleted';
8432
- this.subscriptions.push(gEntry.save().pipe(operators.switchMap(function () { return _this.basketsService.loadBasket(); }), operators.take(1)).subscribe());
9115
+ this.subscriptions.push(gEntry.save().pipe(operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe());
8433
9116
  };
8434
9117
  BasketPreviewLineComponent.prototype.changeProduct = function (line) {
8435
9118
  var _a;
@@ -8466,7 +9149,7 @@
8466
9149
  var _this = this;
8467
9150
  var gEntry = entry.relationships['groceries-entry'].data;
8468
9151
  gEntry.attributes.status = 'active';
8469
- this.subscriptions.push(gEntry.save().pipe(operators.switchMap(function () { return _this.basketsService.loadBasket(); }), operators.take(1)).subscribe());
9152
+ this.subscriptions.push(gEntry.save().pipe(operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe());
8470
9153
  };
8471
9154
  BasketPreviewLineComponent.prototype.trackByItemId = function (index, line) {
8472
9155
  return line ? line.record['selected-item-id'] + '-' + line.record.attributes.quantity : null;
@@ -8702,7 +9385,7 @@
8702
9385
  var _this = this;
8703
9386
  this.line.record.selectItem(item.id);
8704
9387
  this.analyticsService.sendEvent('replace-item');
8705
- this.line.record.save().pipe(operators.switchMap(function () { return _this.basketsService.loadBasket(); }), operators.take(1)).subscribe();
9388
+ this.line.record.save().pipe(operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe();
8706
9389
  this.selected.emit(this.line.id);
8707
9390
  };
8708
9391
  ReplaceItemComponent.prototype.initLine = function () {
@@ -8804,7 +9487,7 @@
8804
9487
  if (rf & 1) {
8805
9488
  var _r12_1 = i0.ɵɵgetCurrentView();
8806
9489
  i0.ɵɵelementStart(0, "button", 14);
8807
- i0.ɵɵlistener("click", function BasketPreviewBlockComponent_div_0_ng_container_2_h3_1_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r12_1); var ctx_r11 = i0.ɵɵnextContext(4); return ctx_r11.listsService.removeRecipesFromList(); });
9490
+ i0.ɵɵlistener("click", function BasketPreviewBlockComponent_div_0_ng_container_2_h3_1_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r12_1); var ctx_r11 = i0.ɵɵnextContext(4); return ctx_r11.listsService.removeRecipesFromList().subscribe(); });
8808
9491
  i0.ɵɵelement(1, "ng-miam-icon", 15);
8809
9492
  i0.ɵɵelementStart(2, "span");
8810
9493
  i0.ɵɵtext(3, "Retirer tous les repas");
@@ -9003,7 +9686,9 @@
9003
9686
  _this.cdr.detectChanges();
9004
9687
  }),
9005
9688
  this.blockStates.subscribe(function (newState) { return _this.handelblockState(newState); }),
9006
- this.basketsService.basketPreview$.pipe(operators.skipWhile(function (preview) { var _a; return !preview || preview.length === 0 || preview.length !== ((_a = _this.listsService.list$.value) === null || _a === void 0 ? void 0 : _a.recipeInfos.length); }), operators.map(function (preview) { return (preview && _this.recipeId) ? preview.filter(function (line) { return line.id === _this.recipeId; }) : preview; }), operators.tap(function (preview) { return _this.refreshPreview(preview); })).subscribe(function () {
9689
+ this.listsService.takeFirstList().pipe(operators.switchMap(function (list) {
9690
+ return _this.basketsService.basketPreview$.pipe(operators.skipWhile(function (preview) { return !preview || preview.length === 0 || preview.length !== list.recipeInfos.length; }), operators.map(function (preview) { return (preview && _this.recipeId) ? preview.filter(function (line) { return line.id === _this.recipeId; }) : preview; }), operators.tap(function (preview) { return _this.refreshPreview(preview); }));
9691
+ })).subscribe(function () {
9007
9692
  _this.loading.next(false);
9008
9693
  _this.cdr.detectChanges();
9009
9694
  }),
@@ -9021,7 +9706,7 @@
9021
9706
  this.listsService.removeRecipeFromList(line.id).subscribe();
9022
9707
  };
9023
9708
  BasketPreviewBlockComponent.prototype.updateRecipe = function (line) {
9024
- this.listsService.updateRecipeGuests(line.id, line.count);
9709
+ this.listsService.updateRecipeGuests(line.id, line.count).subscribe();
9025
9710
  this.guestCountChanged.emit(line.count);
9026
9711
  };
9027
9712
  BasketPreviewBlockComponent.prototype.closeOverlay = function () {
@@ -9295,6 +9980,8 @@
9295
9980
  this.analyticsService = analyticsService;
9296
9981
  this.element = element;
9297
9982
  this.headerText = '';
9983
+ this.displayPricing = true;
9984
+ this.displayAddedOnPicture = true;
9298
9985
  this.hovered = false;
9299
9986
  this.icon = exports.Icon;
9300
9987
  this.skeleton = Skeleton;
@@ -9328,16 +10015,18 @@
9328
10015
  };
9329
10016
  AbstractRecipeCardComponent.prototype.addRecipeActionOK = function (display) {
9330
10017
  var _this = this;
9331
- if (!this.groceriesListsService.list$.value.hasRecipe(this.recipe.id)) {
9332
- this.recipeEventsService.sendEvent(this.recipe, this.recipeEventsService.ACTION_ADDED);
9333
- }
9334
- this.subscriptions.push(this.groceriesListsService.appendRecipeToList(this.recipe.id, this.recipe.modifiedGuests, this.cardType)
9335
- .subscribe(function (l) {
9336
- _this.toggleButtonLoader(false);
10018
+ this.subscriptions.push(this.groceriesListsService.recipeIsInList(this.recipe.id).subscribe(function (recipeIsInList) {
10019
+ if (!recipeIsInList) {
10020
+ _this.recipeEventsService.sendEvent(_this.recipe, _this.recipeEventsService.ACTION_ADDED);
10021
+ }
10022
+ _this.subscriptions.push(_this.groceriesListsService.appendRecipeToList(_this.recipe.id, _this.recipe.modifiedGuests, _this.cardType)
10023
+ .subscribe(function (l) {
10024
+ _this.toggleButtonLoader(false);
10025
+ }));
10026
+ if (display) {
10027
+ _this.recipeService.displayObject(_this.recipe, { guests: +_this.recipe.modifiedGuests, previewMode: true });
10028
+ }
9337
10029
  }));
9338
- if (display) {
9339
- this.recipeService.displayObject(this.recipe, { guests: +this.recipe.modifiedGuests, previewMode: true });
9340
- }
9341
10030
  };
9342
10031
  AbstractRecipeCardComponent.prototype.addRecipeActionKO = function () {
9343
10032
  sessionStorage.setItem('_miam/cached-recipe', JSON.stringify(this.recipe));
@@ -9404,89 +10093,104 @@
9404
10093
  return AbstractRecipeCardComponent;
9405
10094
  }());
9406
10095
  AbstractRecipeCardComponent.ɵfac = function AbstractRecipeCardComponent_Factory(t) { return new (t || AbstractRecipeCardComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(RecipesService), i0.ɵɵdirectiveInject(RecipeEventsService), i0.ɵɵdirectiveInject(GroceriesListsService), i0.ɵɵdirectiveInject(UserService), i0.ɵɵdirectiveInject(PointOfSalesService), i0.ɵɵdirectiveInject(ContextService), i0.ɵɵdirectiveInject(AnalyticsService), i0.ɵɵdirectiveInject(i0.ElementRef)); };
9407
- AbstractRecipeCardComponent.ɵcmp = i0.ɵɵdefineComponent({ type: AbstractRecipeCardComponent, selectors: [["ng-component"]], inputs: { headerText: "headerText" }, outputs: { hide: "hide" }, decls: 0, vars: 0, template: function AbstractRecipeCardComponent_Template(rf, ctx) { }, encapsulation: 2 });
10096
+ AbstractRecipeCardComponent.ɵcmp = i0.ɵɵdefineComponent({ type: AbstractRecipeCardComponent, selectors: [["ng-component"]], inputs: { headerText: "headerText", displayPricing: "displayPricing", displayAddedOnPicture: "displayAddedOnPicture" }, outputs: { hide: "hide" }, decls: 0, vars: 0, template: function AbstractRecipeCardComponent_Template(rf, ctx) { }, encapsulation: 2 });
9408
10097
  /*@__PURE__*/ (function () {
9409
10098
  i0.ɵsetClassMetadata(AbstractRecipeCardComponent, [{
9410
10099
  type: i0.Component,
9411
10100
  args: [{ template: '' }]
9412
10101
  }], function () { return [{ type: i0.ChangeDetectorRef }, { type: RecipesService }, { type: RecipeEventsService }, { type: GroceriesListsService }, { type: UserService }, { type: PointOfSalesService }, { type: ContextService }, { type: AnalyticsService }, { type: i0.ElementRef }]; }, { headerText: [{
9413
10102
  type: i0.Input
10103
+ }], displayPricing: [{
10104
+ type: i0.Input
10105
+ }], displayAddedOnPicture: [{
10106
+ type: i0.Input
9414
10107
  }], hide: [{
9415
10108
  type: i0.Output
9416
10109
  }] });
9417
10110
  })();
9418
10111
 
9419
- function RecipeCardComponent_div_0_div_4_div_3_Template(rf, ctx) {
10112
+ function RecipeCardComponent_div_0_div_4_ng_container_3_div_1_Template(rf, ctx) {
9420
10113
  if (rf & 1) {
9421
10114
  i0.ɵɵelementStart(0, "div", 37);
9422
- i0.ɵɵtext(1, "D\u00E9j\u00E0 ajout\u00E9e");
10115
+ i0.ɵɵtext(1, " D\u00E9j\u00E0 ajout\u00E9e ");
9423
10116
  i0.ɵɵelementEnd();
9424
10117
  }
9425
10118
  }
9426
- function RecipeCardComponent_div_0_div_4_div_5_Template(rf, ctx) {
10119
+ function RecipeCardComponent_div_0_div_4_ng_container_3_Template(rf, ctx) {
10120
+ if (rf & 1) {
10121
+ i0.ɵɵelementContainerStart(0);
10122
+ i0.ɵɵtemplate(1, RecipeCardComponent_div_0_div_4_ng_container_3_div_1_Template, 2, 0, "div", 36);
10123
+ i0.ɵɵpipe(2, "async");
10124
+ i0.ɵɵelementContainerEnd();
10125
+ }
10126
+ if (rf & 2) {
10127
+ var ctx_r22 = i0.ɵɵnextContext(3);
10128
+ i0.ɵɵadvance(1);
10129
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(2, 1, ctx_r22.groceriesListsService.recipeIsInList(ctx_r22.recipe == null ? null : ctx_r22.recipe.id)));
10130
+ }
10131
+ }
10132
+ function RecipeCardComponent_div_0_div_4_div_4_Template(rf, ctx) {
9427
10133
  if (rf & 1) {
9428
10134
  i0.ɵɵelementStart(0, "div", 38);
9429
10135
  i0.ɵɵelement(1, "ng-miam-icon", 39);
9430
10136
  i0.ɵɵelementEnd();
9431
10137
  }
9432
10138
  if (rf & 2) {
9433
- var ctx_r22 = i0.ɵɵnextContext(3);
10139
+ var ctx_r23 = i0.ɵɵnextContext(3);
9434
10140
  i0.ɵɵadvance(1);
9435
- i0.ɵɵproperty("iconName", ctx_r22.icon.Video)("width", 100)("height", 100);
10141
+ i0.ɵɵproperty("iconName", ctx_r23.icon.Video)("width", 100)("height", 100);
9436
10142
  }
9437
10143
  }
9438
- function RecipeCardComponent_div_0_div_4_ng_miam_like_button_7_Template(rf, ctx) {
10144
+ function RecipeCardComponent_div_0_div_4_ng_miam_like_button_6_Template(rf, ctx) {
9439
10145
  if (rf & 1) {
9440
10146
  i0.ɵɵelement(0, "ng-miam-like-button", 40);
9441
10147
  }
9442
10148
  if (rf & 2) {
9443
- var ctx_r23 = i0.ɵɵnextContext(3);
9444
- i0.ɵɵproperty("recipe", ctx_r23.recipe);
10149
+ var ctx_r24 = i0.ɵɵnextContext(3);
10150
+ i0.ɵɵproperty("recipe", ctx_r24.recipe);
9445
10151
  }
9446
10152
  }
9447
- function RecipeCardComponent_div_0_div_4_img_11_Template(rf, ctx) {
10153
+ function RecipeCardComponent_div_0_div_4_img_10_Template(rf, ctx) {
9448
10154
  if (rf & 1) {
9449
10155
  i0.ɵɵelement(0, "img", 41);
9450
10156
  }
9451
10157
  if (rf & 2) {
9452
- var ctx_r24 = i0.ɵɵnextContext(3);
9453
- i0.ɵɵproperty("src", ctx_r24.recipe.filigraneLogoUrl, i0.ɵɵsanitizeUrl);
10158
+ var ctx_r25 = i0.ɵɵnextContext(3);
10159
+ i0.ɵɵproperty("src", ctx_r25.recipe.filigraneLogoUrl, i0.ɵɵsanitizeUrl);
9454
10160
  }
9455
10161
  }
9456
10162
  function RecipeCardComponent_div_0_div_4_Template(rf, ctx) {
9457
10163
  if (rf & 1) {
9458
- var _r26_1 = i0.ɵɵgetCurrentView();
9459
- i0.ɵɵelementStart(0, "div", 28);
9460
- i0.ɵɵlistener("click", function RecipeCardComponent_div_0_div_4_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r26_1); var ctx_r25 = i0.ɵɵnextContext(2); return ctx_r25.openRecipe(); });
9461
- i0.ɵɵelement(1, "img", 29);
9462
- i0.ɵɵelement(2, "div", 30);
9463
- i0.ɵɵtemplate(3, RecipeCardComponent_div_0_div_4_div_3_Template, 2, 0, "div", 31);
9464
- i0.ɵɵpipe(4, "async");
9465
- i0.ɵɵtemplate(5, RecipeCardComponent_div_0_div_4_div_5_Template, 2, 3, "div", 32);
9466
- i0.ɵɵelementStart(6, "div", 33);
9467
- i0.ɵɵtemplate(7, RecipeCardComponent_div_0_div_4_ng_miam_like_button_7_Template, 1, 1, "ng-miam-like-button", 34);
9468
- i0.ɵɵpipe(8, "async");
9469
- i0.ɵɵelementStart(9, "ng-miam-icon", 35);
9470
- i0.ɵɵlistener("click", function RecipeCardComponent_div_0_div_4_Template_ng_miam_icon_click_9_listener($event) { i0.ɵɵrestoreView(_r26_1); var ctx_r27 = i0.ɵɵnextContext(2); return ctx_r27.openCalendar($event); });
10164
+ var _r28_1 = i0.ɵɵgetCurrentView();
10165
+ i0.ɵɵelementStart(0, "div", 27);
10166
+ i0.ɵɵlistener("click", function RecipeCardComponent_div_0_div_4_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r28_1); var ctx_r27 = i0.ɵɵnextContext(2); return ctx_r27.openRecipe(); });
10167
+ i0.ɵɵelement(1, "img", 28);
10168
+ i0.ɵɵelement(2, "div", 29);
10169
+ i0.ɵɵtemplate(3, RecipeCardComponent_div_0_div_4_ng_container_3_Template, 3, 3, "ng-container", 30);
10170
+ i0.ɵɵtemplate(4, RecipeCardComponent_div_0_div_4_div_4_Template, 2, 3, "div", 31);
10171
+ i0.ɵɵelementStart(5, "div", 32);
10172
+ i0.ɵɵtemplate(6, RecipeCardComponent_div_0_div_4_ng_miam_like_button_6_Template, 1, 1, "ng-miam-like-button", 33);
10173
+ i0.ɵɵpipe(7, "async");
10174
+ i0.ɵɵelementStart(8, "ng-miam-icon", 34);
10175
+ i0.ɵɵlistener("click", function RecipeCardComponent_div_0_div_4_Template_ng_miam_icon_click_8_listener($event) { i0.ɵɵrestoreView(_r28_1); var ctx_r29 = i0.ɵɵnextContext(2); return ctx_r29.openCalendar($event); });
9471
10176
  i0.ɵɵelementEnd();
9472
- i0.ɵɵelementStart(10, "ng-miam-icon", 35);
9473
- i0.ɵɵlistener("click", function RecipeCardComponent_div_0_div_4_Template_ng_miam_icon_click_10_listener($event) { i0.ɵɵrestoreView(_r26_1); var ctx_r28 = i0.ɵɵnextContext(2); return ctx_r28.shareRecipe($event); });
10177
+ i0.ɵɵelementStart(9, "ng-miam-icon", 34);
10178
+ i0.ɵɵlistener("click", function RecipeCardComponent_div_0_div_4_Template_ng_miam_icon_click_9_listener($event) { i0.ɵɵrestoreView(_r28_1); var ctx_r30 = i0.ɵɵnextContext(2); return ctx_r30.shareRecipe($event); });
9474
10179
  i0.ɵɵelementEnd();
9475
10180
  i0.ɵɵelementEnd();
9476
- i0.ɵɵtemplate(11, RecipeCardComponent_div_0_div_4_img_11_Template, 1, 1, "img", 36);
10181
+ i0.ɵɵtemplate(10, RecipeCardComponent_div_0_div_4_img_10_Template, 1, 1, "img", 35);
9477
10182
  i0.ɵɵelementEnd();
9478
10183
  }
9479
10184
  if (rf & 2) {
9480
10185
  var ctx_r3 = i0.ɵɵnextContext(2);
9481
- var tmp_1_0 = null;
9482
10186
  i0.ɵɵadvance(1);
9483
10187
  i0.ɵɵproperty("src", ctx_r3.recipe == null ? null : ctx_r3.recipe.attributes["media-url"], i0.ɵɵsanitizeUrl);
9484
10188
  i0.ɵɵadvance(2);
9485
- i0.ɵɵproperty("ngIf", (tmp_1_0 = i0.ɵɵpipeBind1(4, 7, ctx_r3.groceriesListsService.list$)) == null ? null : tmp_1_0.hasRecipe(ctx_r3.recipe == null ? null : ctx_r3.recipe.id));
9486
- i0.ɵɵadvance(2);
10189
+ i0.ɵɵproperty("ngIf", ctx_r3.recipe && ctx_r3.displayAddedOnPicture);
10190
+ i0.ɵɵadvance(1);
9487
10191
  i0.ɵɵproperty("ngIf", ctx_r3.contextService.videoRecipesEnabled && (ctx_r3.recipe == null ? null : ctx_r3.recipe.videoId));
9488
10192
  i0.ɵɵadvance(2);
9489
- i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(8, 9, ctx_r3.userService.isLogged$));
10193
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(7, 7, ctx_r3.userService.isLogged$));
9490
10194
  i0.ɵɵadvance(2);
9491
10195
  i0.ɵɵproperty("iconName", ctx_r3.icon.Calendar);
9492
10196
  i0.ɵɵadvance(1);
@@ -9506,10 +10210,10 @@
9506
10210
  }
9507
10211
  function RecipeCardComponent_div_0_div_8_Template(rf, ctx) {
9508
10212
  if (rf & 1) {
9509
- var _r30_1 = i0.ɵɵgetCurrentView();
10213
+ var _r32_1 = i0.ɵɵgetCurrentView();
9510
10214
  i0.ɵɵelementStart(0, "div");
9511
10215
  i0.ɵɵelementStart(1, "div", 43);
9512
- i0.ɵɵlistener("click", function RecipeCardComponent_div_0_div_8_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r30_1); var ctx_r29 = i0.ɵɵnextContext(2); return ctx_r29.openRecipe(); });
10216
+ i0.ɵɵlistener("click", function RecipeCardComponent_div_0_div_8_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r32_1); var ctx_r31 = i0.ɵɵnextContext(2); return ctx_r31.openRecipe(); });
9513
10217
  i0.ɵɵtext(2);
9514
10218
  i0.ɵɵelementEnd();
9515
10219
  i0.ɵɵelementStart(3, "div", 44);
@@ -9576,9 +10280,9 @@
9576
10280
  i0.ɵɵelementContainerEnd();
9577
10281
  }
9578
10282
  if (rf & 2) {
9579
- var ctx_r31 = i0.ɵɵnextContext(3);
10283
+ var ctx_r33 = i0.ɵɵnextContext(3);
9580
10284
  i0.ɵɵadvance(1);
9581
- i0.ɵɵproperty("width", 32)("height", 16)("iconName", ctx_r31.icon.DifficultyLow);
10285
+ i0.ɵɵproperty("width", 32)("height", 16)("iconName", ctx_r33.icon.DifficultyLow);
9582
10286
  }
9583
10287
  }
9584
10288
  function RecipeCardComponent_div_0_div_14_ng_container_3_Template(rf, ctx) {
@@ -9588,9 +10292,9 @@
9588
10292
  i0.ɵɵelementContainerEnd();
9589
10293
  }
9590
10294
  if (rf & 2) {
9591
- var ctx_r32 = i0.ɵɵnextContext(3);
10295
+ var ctx_r34 = i0.ɵɵnextContext(3);
9592
10296
  i0.ɵɵadvance(1);
9593
- i0.ɵɵproperty("width", 32)("height", 16)("iconName", ctx_r32.icon.DifficultyMedium);
10297
+ i0.ɵɵproperty("width", 32)("height", 16)("iconName", ctx_r34.icon.DifficultyMedium);
9594
10298
  }
9595
10299
  }
9596
10300
  function RecipeCardComponent_div_0_div_14_ng_container_4_Template(rf, ctx) {
@@ -9600,9 +10304,9 @@
9600
10304
  i0.ɵɵelementContainerEnd();
9601
10305
  }
9602
10306
  if (rf & 2) {
9603
- var ctx_r33 = i0.ɵɵnextContext(3);
10307
+ var ctx_r35 = i0.ɵɵnextContext(3);
9604
10308
  i0.ɵɵadvance(1);
9605
- i0.ɵɵproperty("width", 32)("height", 16)("iconName", ctx_r33.icon.DifficultyHight);
10309
+ i0.ɵɵproperty("width", 32)("height", 16)("iconName", ctx_r35.icon.DifficultyHight);
9606
10310
  }
9607
10311
  }
9608
10312
  function RecipeCardComponent_div_0_div_14_ng_container_5_Template(rf, ctx) {
@@ -9656,9 +10360,9 @@
9656
10360
  i0.ɵɵelementEnd();
9657
10361
  }
9658
10362
  if (rf & 2) {
9659
- var ctx_r35 = i0.ɵɵnextContext(3);
10363
+ var ctx_r37 = i0.ɵɵnextContext(3);
9660
10364
  i0.ɵɵadvance(1);
9661
- i0.ɵɵtextInterpolate1(" + ", ctx_r35.recipe.modifiedIngredients.length - 2, " ");
10365
+ i0.ɵɵtextInterpolate1(" + ", ctx_r37.recipe.modifiedIngredients.length - 2, " ");
9662
10366
  }
9663
10367
  }
9664
10368
  function RecipeCardComponent_div_0_div_22_Template(rf, ctx) {
@@ -9685,10 +10389,10 @@
9685
10389
  }
9686
10390
  function RecipeCardComponent_div_0_div_23_Template(rf, ctx) {
9687
10391
  if (rf & 1) {
9688
- var _r37_1 = i0.ɵɵgetCurrentView();
10392
+ var _r39_1 = i0.ɵɵgetCurrentView();
9689
10393
  i0.ɵɵelementStart(0, "div", 59);
9690
10394
  i0.ɵɵelementStart(1, "ng-miam-counter-input", 60);
9691
- i0.ɵɵlistener("counterChange", function RecipeCardComponent_div_0_div_23_Template_ng_miam_counter_input_counterChange_1_listener($event) { i0.ɵɵrestoreView(_r37_1); var ctx_r36 = i0.ɵɵnextContext(2); return ctx_r36.updateGuests($event); });
10395
+ i0.ɵɵlistener("counterChange", function RecipeCardComponent_div_0_div_23_Template_ng_miam_counter_input_counterChange_1_listener($event) { i0.ɵɵrestoreView(_r39_1); var ctx_r38 = i0.ɵɵnextContext(2); return ctx_r38.updateGuests($event); });
9692
10396
  i0.ɵɵelementEnd();
9693
10397
  i0.ɵɵelementEnd();
9694
10398
  }
@@ -9707,18 +10411,29 @@
9707
10411
  i0.ɵɵproperty("type", ctx_r17.skeleton == null ? null : ctx_r17.skeleton.IconWithInfo);
9708
10412
  }
9709
10413
  }
9710
- function RecipeCardComponent_div_0_ng_miam_icon_32_Template(rf, ctx) {
10414
+ function RecipeCardComponent_div_0_div_27_Template(rf, ctx) {
9711
10415
  if (rf & 1) {
9712
- i0.ɵɵelement(0, "ng-miam-icon", 61);
9713
- i0.ɵɵpipe(1, "async");
10416
+ i0.ɵɵelementStart(0, "div", 61);
10417
+ i0.ɵɵelement(1, "ng-miam-recipe-pricing", 62);
10418
+ i0.ɵɵelementEnd();
9714
10419
  }
9715
10420
  if (rf & 2) {
9716
10421
  var ctx_r18 = i0.ɵɵnextContext(2);
9717
- var tmp_2_0 = null;
9718
- i0.ɵɵproperty("width", 24)("height", 24)("iconName", ((tmp_2_0 = i0.ɵɵpipeBind1(1, 3, ctx_r18.groceriesListsService.list$)) == null ? null : tmp_2_0.hasRecipe(ctx_r18.recipe == null ? null : ctx_r18.recipe.id)) ? ctx_r18.icon.CheckList : ctx_r18.icon.Cart);
10422
+ i0.ɵɵadvance(1);
10423
+ i0.ɵɵproperty("recipe", ctx_r18.recipe)("serves", ctx_r18.recipe == null ? null : ctx_r18.recipe.modifiedGuests);
10424
+ }
10425
+ }
10426
+ function RecipeCardComponent_div_0_ng_miam_icon_31_Template(rf, ctx) {
10427
+ if (rf & 1) {
10428
+ i0.ɵɵelement(0, "ng-miam-icon", 63);
10429
+ i0.ɵɵpipe(1, "async");
10430
+ }
10431
+ if (rf & 2) {
10432
+ var ctx_r19 = i0.ɵɵnextContext(2);
10433
+ i0.ɵɵproperty("width", 24)("height", 24)("iconName", i0.ɵɵpipeBind1(1, 3, ctx_r19.groceriesListsService.recipeIsInList(ctx_r19.recipe == null ? null : ctx_r19.recipe.id)) ? ctx_r19.icon.CheckList : ctx_r19.icon.Cart);
9719
10434
  }
9720
10435
  }
9721
- function RecipeCardComponent_div_0_ng_template_33_Template(rf, ctx) {
10436
+ function RecipeCardComponent_div_0_ng_template_32_Template(rf, ctx) {
9722
10437
  if (rf & 1) {
9723
10438
  i0.ɵɵelement(0, "ng-miam-loader");
9724
10439
  }
@@ -9726,14 +10441,14 @@
9726
10441
  var _c1$6 = function (a0, a1) { return { "in-basket": a0, "loading": a1 }; };
9727
10442
  function RecipeCardComponent_div_0_Template(rf, ctx) {
9728
10443
  if (rf & 1) {
9729
- var _r39_1 = i0.ɵɵgetCurrentView();
10444
+ var _r41_1 = i0.ɵɵgetCurrentView();
9730
10445
  i0.ɵɵelementStart(0, "div", 2);
9731
10446
  i0.ɵɵelementStart(1, "div", 3);
9732
10447
  i0.ɵɵelementStart(2, "span");
9733
10448
  i0.ɵɵtext(3);
9734
10449
  i0.ɵɵelementEnd();
9735
10450
  i0.ɵɵelementEnd();
9736
- i0.ɵɵtemplate(4, RecipeCardComponent_div_0_div_4_Template, 12, 11, "div", 4);
10451
+ i0.ɵɵtemplate(4, RecipeCardComponent_div_0_div_4_Template, 11, 9, "div", 4);
9737
10452
  i0.ɵɵtemplate(5, RecipeCardComponent_div_0_ng_template_5_Template, 1, 1, "ng-template", null, 5, i0.ɵɵtemplateRefExtractor);
9738
10453
  i0.ɵɵelementStart(7, "div", 6);
9739
10454
  i0.ɵɵtemplate(8, RecipeCardComponent_div_0_div_8_Template, 6, 4, "div", 7);
@@ -9748,7 +10463,7 @@
9748
10463
  i0.ɵɵelementStart(18, "div", 15);
9749
10464
  i0.ɵɵelementStart(19, "div", 16);
9750
10465
  i0.ɵɵelementStart(20, "div", 17);
9751
- i0.ɵɵlistener("click", function RecipeCardComponent_div_0_Template_div_click_20_listener() { i0.ɵɵrestoreView(_r39_1); var ctx_r38 = i0.ɵɵnextContext(); return ctx_r38.toggleHelper(); });
10466
+ i0.ɵɵlistener("click", function RecipeCardComponent_div_0_Template_div_click_20_listener() { i0.ɵɵrestoreView(_r41_1); var ctx_r40 = i0.ɵɵnextContext(); return ctx_r40.toggleHelper(); });
9752
10467
  i0.ɵɵelement(21, "ng-miam-icon", 18);
9753
10468
  i0.ɵɵelementEnd();
9754
10469
  i0.ɵɵtemplate(22, RecipeCardComponent_div_0_div_22_Template, 6, 3, "div", 19);
@@ -9757,15 +10472,13 @@
9757
10472
  i0.ɵɵtemplate(24, RecipeCardComponent_div_0_ng_template_24_Template, 1, 1, "ng-template", null, 21, i0.ɵɵtemplateRefExtractor);
9758
10473
  i0.ɵɵelementEnd();
9759
10474
  i0.ɵɵelementStart(26, "div", 22);
9760
- i0.ɵɵelementStart(27, "div", 23);
9761
- i0.ɵɵelement(28, "ng-miam-recipe-pricing", 24);
9762
- i0.ɵɵelementEnd();
9763
- i0.ɵɵelementStart(29, "div");
9764
- i0.ɵɵelementStart(30, "button", 25);
9765
- i0.ɵɵlistener("click", function RecipeCardComponent_div_0_Template_button_click_30_listener() { i0.ɵɵrestoreView(_r39_1); var ctx_r40 = i0.ɵɵnextContext(); return ctx_r40.clickPrimary(); });
9766
- i0.ɵɵpipe(31, "async");
9767
- i0.ɵɵtemplate(32, RecipeCardComponent_div_0_ng_miam_icon_32_Template, 2, 5, "ng-miam-icon", 26);
9768
- i0.ɵɵtemplate(33, RecipeCardComponent_div_0_ng_template_33_Template, 1, 0, "ng-template", null, 27, i0.ɵɵtemplateRefExtractor);
10475
+ i0.ɵɵtemplate(27, RecipeCardComponent_div_0_div_27_Template, 2, 2, "div", 23);
10476
+ i0.ɵɵelementStart(28, "div");
10477
+ i0.ɵɵelementStart(29, "button", 24);
10478
+ i0.ɵɵlistener("click", function RecipeCardComponent_div_0_Template_button_click_29_listener() { i0.ɵɵrestoreView(_r41_1); var ctx_r42 = i0.ɵɵnextContext(); return ctx_r42.clickPrimary(); });
10479
+ i0.ɵɵpipe(30, "async");
10480
+ i0.ɵɵtemplate(31, RecipeCardComponent_div_0_ng_miam_icon_31_Template, 2, 5, "ng-miam-icon", 25);
10481
+ i0.ɵɵtemplate(32, RecipeCardComponent_div_0_ng_template_32_Template, 1, 0, "ng-template", null, 26, i0.ɵɵtemplateRefExtractor);
9769
10482
  i0.ɵɵelementEnd();
9770
10483
  i0.ɵɵelementEnd();
9771
10484
  i0.ɵɵelementEnd();
@@ -9778,9 +10491,8 @@
9778
10491
  var _r7 = i0.ɵɵreference(10);
9779
10492
  var _r12 = i0.ɵɵreference(16);
9780
10493
  var _r16 = i0.ɵɵreference(25);
9781
- var _r19 = i0.ɵɵreference(34);
10494
+ var _r20 = i0.ɵɵreference(33);
9782
10495
  var ctx_r0 = i0.ɵɵnextContext();
9783
- var tmp_20_0 = null;
9784
10496
  i0.ɵɵadvance(3);
9785
10497
  i0.ɵɵtextInterpolate1(" ", ctx_r0.headerText, "");
9786
10498
  i0.ɵɵadvance(1);
@@ -9799,12 +10511,12 @@
9799
10511
  i0.ɵɵproperty("ngIf", ctx_r0.contextService.displayIngredientPicturesOnRecipeCards && (ctx_r0.recipe == null ? null : ctx_r0.recipe.modifiedIngredients == null ? null : ctx_r0.recipe.modifiedIngredients.length) > 1);
9800
10512
  i0.ɵɵadvance(1);
9801
10513
  i0.ɵɵproperty("ngIf", ctx_r0.recipe)("ngIfElse", _r16);
9802
- i0.ɵɵadvance(5);
9803
- i0.ɵɵproperty("recipe", ctx_r0.recipe)("serves", ctx_r0.recipe == null ? null : ctx_r0.recipe.modifiedGuests);
10514
+ i0.ɵɵadvance(4);
10515
+ i0.ɵɵproperty("ngIf", ctx_r0.recipe && ctx_r0.displayPricing);
9804
10516
  i0.ɵɵadvance(2);
9805
- i0.ɵɵproperty("disabled", !ctx_r0.recipe)("ngClass", i0.ɵɵpureFunction2(25, _c1$6, (tmp_20_0 = i0.ɵɵpipeBind1(31, 23, ctx_r0.groceriesListsService.list$)) == null ? null : tmp_20_0.hasRecipe(ctx_r0.recipe == null ? null : ctx_r0.recipe.id), ctx_r0.addButtonLoading));
10517
+ i0.ɵɵproperty("disabled", !ctx_r0.recipe)("ngClass", i0.ɵɵpureFunction2(24, _c1$6, i0.ɵɵpipeBind1(30, 22, ctx_r0.groceriesListsService.recipeIsInList(ctx_r0.recipe == null ? null : ctx_r0.recipe.id)), ctx_r0.addButtonLoading));
9806
10518
  i0.ɵɵadvance(2);
9807
- i0.ɵɵproperty("ngIf", !ctx_r0.addButtonLoading)("ngIfElse", _r19);
10519
+ i0.ɵɵproperty("ngIf", !ctx_r0.addButtonLoading)("ngIfElse", _r20);
9808
10520
  }
9809
10521
  }
9810
10522
  function RecipeCardComponent_ng_template_1_Template(rf, ctx) {
@@ -9869,30 +10581,40 @@
9869
10581
  this.cdr.detectChanges();
9870
10582
  };
9871
10583
  RecipeCardComponent.prototype._updateBasket = function () {
10584
+ var _this = this;
9872
10585
  // If recipe already in basket, update the number of guests so that the pricing gets updated as well
9873
10586
  // (display = false so that the recipe details don't show up)
9874
- if (this.groceriesListsService.list$.value.hasRecipe(this.recipeId)) {
9875
- this.addRecipe(false);
9876
- }
10587
+ this.subscriptions.push(this.groceriesListsService.recipeIsInList(this.recipeId).subscribe(function (recipeIsInList) {
10588
+ if (recipeIsInList) {
10589
+ _this.addRecipe(false);
10590
+ }
10591
+ }));
9877
10592
  };
10593
+ /**
10594
+ * Add recipe to list on primary button click and emit true if the recipe is added, false if recipe is not added
10595
+ * so lib users can decide that primaryButtonClicked$.emit(false) removes the recipe for example
10596
+ */
9878
10597
  RecipeCardComponent.prototype.clickPrimary = function () {
10598
+ var _this = this;
9879
10599
  if (!this.addButtonLoading) {
9880
- var wasAdded = !this.groceriesListsService.list$.value.hasRecipe(this.recipe.id);
9881
- if (this.cardType !== 'suggestion-card') {
9882
- this.addRecipe();
9883
- }
9884
- else { // customizable actions for suggestions
9885
- if (this.recipeService.suggestionsPrimaryButtonActions.addToBasket) {
9886
- // If recipe is added we still want to diplay details
9887
- this.addRecipe(this.recipeService.suggestionsPrimaryButtonActions.display || !wasAdded);
10600
+ this.subscriptions.push(this.groceriesListsService.recipeIsInList(this.recipe.id).subscribe(function (recipeIsInList) {
10601
+ var wasAdded = !recipeIsInList;
10602
+ if (_this.cardType !== 'suggestion-card') {
10603
+ _this.addRecipe();
9888
10604
  }
9889
- else {
9890
- if (this.recipeService.suggestionsPrimaryButtonActions.display) {
9891
- this.openRecipe();
10605
+ else { // customizable actions for suggestions
10606
+ if (_this.recipeService.suggestionsPrimaryButtonActions.addToBasket) {
10607
+ // If recipe is added we still want to diplay details
10608
+ _this.addRecipe(_this.recipeService.suggestionsPrimaryButtonActions.display || !wasAdded);
10609
+ }
10610
+ else {
10611
+ if (_this.recipeService.suggestionsPrimaryButtonActions.display) {
10612
+ _this.openRecipe();
10613
+ }
9892
10614
  }
9893
10615
  }
9894
- }
9895
- this.primaryButtonClicked$.emit(wasAdded);
10616
+ _this.primaryButtonClicked$.emit(!recipeIsInList); // !recipeIsInList = add action, so we emit true
10617
+ }));
9896
10618
  }
9897
10619
  };
9898
10620
  RecipeCardComponent.prototype.loadRecipe = function () {
@@ -9911,15 +10633,15 @@
9911
10633
  return RecipeCardComponent;
9912
10634
  }(AbstractRecipeCardComponent));
9913
10635
  RecipeCardComponent.ɵfac = function RecipeCardComponent_Factory(t) { return new (t || RecipeCardComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(RecipesService), i0.ɵɵdirectiveInject(RecipeEventsService), i0.ɵɵdirectiveInject(GroceriesListsService), i0.ɵɵdirectiveInject(UserService), i0.ɵɵdirectiveInject(PointOfSalesService), i0.ɵɵdirectiveInject(ContextService), i0.ɵɵdirectiveInject(AnalyticsService), i0.ɵɵdirectiveInject(i0.ElementRef)); };
9914
- RecipeCardComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RecipeCardComponent, selectors: [["ng-miam-recipe-card"]], inputs: { recipeId: "recipeId", recipe: "recipe" }, outputs: { removedFromFavorite: "removedFromFavorite", displayed: "displayed", guestsChanged: "guestsChanged" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 3, vars: 1, consts: [["class", "miam-recipe-card", 4, "ngIf"], ["cors", ""], [1, "miam-recipe-card"], [1, "miam-recipe-card__header"], ["class", "miam-recipe-card__picture", 3, "click", 4, "ngIf", "ngIfElse"], ["pictSkeleton", ""], [1, "miam-recipe-card__attributes"], [4, "ngIf", "ngIfElse"], ["textSkeleton", ""], [1, "miam-recipe-card__attributes__infos"], ["class", "miam-recipe-card__attributes__info recipe__ingredients", 4, "ngIf", "ngIfElse"], ["class", "miam-recipe-card__attributes__info recipe__total__time", 4, "ngIf", "ngIfElse"], ["class", "miam-recipe-card__attributes__info recipe__difficulty", 3, "ngClass", 4, "ngIf", "ngIfElse"], ["skeletonInfo", ""], [1, "miam-recipe-card__attributes__control"], [1, "miam-recipe-card__control__left__col"], [1, "miam-recipe-card__left__col__custom"], [1, "miam-recipe-card__help", 3, "click"], ["primaryColor", "var(--m-color-primary)", 3, "width", "height", "iconName"], ["class", "miam-recipe-card__ingredients__pictures", 4, "ngIf"], ["class", "miam-recipe-card__left__col__counter", 4, "ngIf", "ngIfElse"], ["skeletoncounter", ""], [1, "miam-recipe-card__control__right__col"], [1, "miam-recipe-card__right__col__price"], [3, "recipe", "serves"], [1, "m-button-fab-primary", 3, "disabled", "ngClass", "click"], ["primaryColor", "#fff", 3, "width", "height", "iconName", 4, "ngIf", "ngIfElse"], ["addLoader", ""], [1, "miam-recipe-card__picture", 3, "click"], ["loading", "lazy", 3, "src"], [1, "miam-recipe-card__picture__gradient"], ["class", "miam-recipe-card__picture__tag", 4, "ngIf"], ["class", "miam-recipe-card__picture__video", 4, "ngIf"], [1, "miam-recipe-card__picture__actions"], ["class", "miam-recipe-card__actions__icon miam-noPadding", 3, "recipe", 4, "ngIf"], ["primaryColor", "var(--m-color-primary)", 1, "miam-recipe-card__actions__icon", 3, "iconName", "click"], ["class", "miam-recipe-card__picture__sponsor", 3, "src", 4, "ngIf"], [1, "miam-recipe-card__picture__tag"], [1, "miam-recipe-card__picture__video"], ["primaryColor", "black", 3, "iconName", "width", "height"], [1, "miam-recipe-card__actions__icon", "miam-noPadding", 3, "recipe"], [1, "miam-recipe-card__picture__sponsor", 3, "src"], [3, "type"], [1, "miam-recipe-card__attributes__title", 3, "click"], [1, "miam-recipe-card__attributes__ingredients"], [1, "miam-recipe-card__attributes__info", "recipe__ingredients"], [3, "iconName"], [1, "miam-recipe-card__info__label"], [1, "miam-recipe-card__attributes__info", "recipe__total__time"], [1, "miam-recipe-card__attributes__info", "recipe__difficulty", 3, "ngClass"], [3, "ngSwitch"], [4, "ngSwitchCase"], [4, "ngSwitchDefault"], ["primaryColor", "var(--m-color-secondary)", 3, "width", "height", "iconName"], [1, "miam-recipe-card__ingredients__pictures"], [1, "miam-recipe-card__ingredients__picture"], [3, "src"], ["class", "miam-recipe-card__ingredients__more", 4, "ngIf"], [1, "miam-recipe-card__ingredients__more"], [1, "miam-recipe-card__left__col__counter"], [3, "counter", "counterChange"], ["primaryColor", "#fff", 3, "width", "height", "iconName"]], template: function RecipeCardComponent_Template(rf, ctx) {
10636
+ RecipeCardComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RecipeCardComponent, selectors: [["ng-miam-recipe-card"]], inputs: { recipeId: "recipeId", recipe: "recipe" }, outputs: { removedFromFavorite: "removedFromFavorite", displayed: "displayed", guestsChanged: "guestsChanged" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 3, vars: 1, consts: [["class", "miam-recipe-card", 4, "ngIf"], ["cors", ""], [1, "miam-recipe-card"], [1, "miam-recipe-card__header"], ["class", "miam-recipe-card__picture", 3, "click", 4, "ngIf", "ngIfElse"], ["pictSkeleton", ""], [1, "miam-recipe-card__attributes"], [4, "ngIf", "ngIfElse"], ["textSkeleton", ""], [1, "miam-recipe-card__attributes__infos"], ["class", "miam-recipe-card__attributes__info recipe__ingredients", 4, "ngIf", "ngIfElse"], ["class", "miam-recipe-card__attributes__info recipe__total__time", 4, "ngIf", "ngIfElse"], ["class", "miam-recipe-card__attributes__info recipe__difficulty", 3, "ngClass", 4, "ngIf", "ngIfElse"], ["skeletonInfo", ""], [1, "miam-recipe-card__attributes__control"], [1, "miam-recipe-card__control__left__col"], [1, "miam-recipe-card__left__col__custom"], [1, "miam-recipe-card__help", 3, "click"], ["primaryColor", "var(--m-color-primary)", 3, "width", "height", "iconName"], ["class", "miam-recipe-card__ingredients__pictures", 4, "ngIf"], ["class", "miam-recipe-card__left__col__counter", 4, "ngIf", "ngIfElse"], ["skeletoncounter", ""], [1, "miam-recipe-card__control__right__col"], ["class", "miam-recipe-card__right__col__price", 4, "ngIf"], [1, "m-button-fab-primary", 3, "disabled", "ngClass", "click"], ["primaryColor", "#fff", 3, "width", "height", "iconName", 4, "ngIf", "ngIfElse"], ["addLoader", ""], [1, "miam-recipe-card__picture", 3, "click"], ["loading", "lazy", 3, "src"], [1, "miam-recipe-card__picture__gradient"], [4, "ngIf"], ["class", "miam-recipe-card__picture__video", 4, "ngIf"], [1, "miam-recipe-card__picture__actions"], ["class", "miam-recipe-card__actions__icon miam-noPadding", 3, "recipe", 4, "ngIf"], ["primaryColor", "var(--m-color-primary)", 1, "miam-recipe-card__actions__icon", 3, "iconName", "click"], ["class", "miam-recipe-card__picture__sponsor", 3, "src", 4, "ngIf"], ["class", "miam-recipe-card__picture__tag", 4, "ngIf"], [1, "miam-recipe-card__picture__tag"], [1, "miam-recipe-card__picture__video"], ["primaryColor", "black", 3, "iconName", "width", "height"], [1, "miam-recipe-card__actions__icon", "miam-noPadding", 3, "recipe"], [1, "miam-recipe-card__picture__sponsor", 3, "src"], [3, "type"], [1, "miam-recipe-card__attributes__title", 3, "click"], [1, "miam-recipe-card__attributes__ingredients"], [1, "miam-recipe-card__attributes__info", "recipe__ingredients"], [3, "iconName"], [1, "miam-recipe-card__info__label"], [1, "miam-recipe-card__attributes__info", "recipe__total__time"], [1, "miam-recipe-card__attributes__info", "recipe__difficulty", 3, "ngClass"], [3, "ngSwitch"], [4, "ngSwitchCase"], [4, "ngSwitchDefault"], ["primaryColor", "var(--m-color-secondary)", 3, "width", "height", "iconName"], [1, "miam-recipe-card__ingredients__pictures"], [1, "miam-recipe-card__ingredients__picture"], [3, "src"], ["class", "miam-recipe-card__ingredients__more", 4, "ngIf"], [1, "miam-recipe-card__ingredients__more"], [1, "miam-recipe-card__left__col__counter"], [3, "counter", "counterChange"], [1, "miam-recipe-card__right__col__price"], [3, "recipe", "serves"], ["primaryColor", "#fff", 3, "width", "height", "iconName"]], template: function RecipeCardComponent_Template(rf, ctx) {
9915
10637
  if (rf & 1) {
9916
- i0.ɵɵtemplate(0, RecipeCardComponent_div_0_Template, 35, 28, "div", 0);
10638
+ i0.ɵɵtemplate(0, RecipeCardComponent_div_0_Template, 34, 27, "div", 0);
9917
10639
  i0.ɵɵtemplate(1, RecipeCardComponent_ng_template_1_Template, 1, 0, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
9918
10640
  }
9919
10641
  if (rf & 2) {
9920
10642
  i0.ɵɵproperty("ngIf", ctx.isloaded);
9921
10643
  }
9922
- }, directives: [i8.NgIf, IconComponent, RecipePricingComponent, i8.NgClass, LikeButtonComponent, SkeletonComponent, i8.NgSwitch, i8.NgSwitchCase, i8.NgSwitchDefault, CounterInputComponent, LoaderComponent, CORSOverlayComponent], pipes: [i8.AsyncPipe, CapitalizeFirstLetterPipe], styles: [".miam-flex-column,.miam-recipe-card .miam-recipe-card__attributes,.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__actions{display:flex;flex-direction:column;justify-content:space-around}.miam-flex-row{align-items:center;display:flex;flex-direction:row;justify-content:space-between;margin:auto}.miam-recipe-card{background-color:var(--m-color-white);border-radius:var(--m-border-radius);box-shadow:var(--m-shadow-small);display:flex;flex-direction:column;height:100%;min-height:470px;position:relative;width:320px}.miam-recipe-card .miam-recipe-card__header{display:none}.miam-recipe-card .miam-recipe-card__picture{-webkit-tap-highlight-color:transparent;cursor:pointer;height:240px;position:relative}.miam-recipe-card .miam-recipe-card__picture img{-o-object-fit:cover;object-fit:cover;transition:var(--m-default-transition);z-index:var(--m-z-index-position-absolute-low)}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__gradient,.miam-recipe-card .miam-recipe-card__picture img{border-top-left-radius:var(--m-border-radius);border-top-right-radius:var(--m-border-radius);height:100%;position:absolute;width:100%}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__gradient{background:linear-gradient(180deg,transparent 57.92%,rgba(0,0,0,.75) 100%,rgba(0,0,0,.75) 0);content:\"\"}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__video{left:calc(50% - 50px);position:absolute;top:calc(50% - 50px)}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__tag{background-color:var(--m-color-primary-light);border-radius:5px;bottom:16px;color:var(--m-color-primary);font-weight:500;left:16px;padding:8px;position:absolute;text-transform:uppercase}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__actions{position:absolute;right:16px;top:8px;z-index:var(--m-z-index-position-absolute-high)}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__actions .miam-recipe-card__actions__icon{-o-object-fit:contain;background-color:var(--m-color-white);border-radius:var(--m-border-radius-circle);box-shadow:var(--m-shadow-small);margin:0 0 16px;object-fit:contain;padding:8px;width:-webkit-max-content;width:-moz-max-content;width:max-content}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__actions .miam-recipe-card__actions__icon .icon-container{margin:0}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__actions .miam-recipe-card__actions__icon.miam-noPadding{padding:0}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__sponsor{-o-object-fit:contain;bottom:16px;height:auto;max-height:72px;max-width:96px;object-fit:contain;position:absolute;right:16px;width:auto}.miam-recipe-card .miam-recipe-card__attributes{flex:1 1;justify-content:space-between;padding:8px 16px 16px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__title{-webkit-box-orient:vertical;-webkit-line-clamp:2;-webkit-tap-highlight-color:transparent;color:var(--m-color-slate);cursor:pointer;display:-webkit-box;font-size:20px;font-weight:700;font-weight:500;letter-spacing:normal;line-height:30;line-height:1.5;margin:0 8px 8px 0;overflow:hidden;text-align:left;text-overflow:ellipsis;transition:var(--m-default-transition)}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__title:hover{color:var(--m-color-primary);text-decoration:underline}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__ingredients{-webkit-box-orient:vertical;-webkit-line-clamp:1;color:var(--m-color-grey-text);display:-webkit-box;font-size:14px;font-weight:300;overflow:hidden;text-overflow:ellipsis}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__infos{display:flex;flex-direction:row;padding:8px 0}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__infos .miam-recipe-card__attributes__info{display:flex;flex-direction:row;margin:0 16px 0 0}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__infos .miam-recipe-card__attributes__info.recipe__ingredients{display:none}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__infos .miam-recipe-card__attributes__info .miam-recipe-card__info__label{font-size:14px;margin-left:8px;text-transform:capitalize}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control{align-items:center;display:flex;justify-content:space-between}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col{display:flex;flex-direction:column-reverse}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col .miam-recipe-card__left__col__counter{align-items:center;display:flex}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col .miam-recipe-card__left__col__counter ng-miam-counter-input .miam-counter-input__icon{margin-right:8px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col .miam-recipe-card__left__col__custom{align-items:flex-end;display:flex;height:48px;justify-content:flex-start}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col .miam-recipe-card__left__col__custom .icon-container{cursor:pointer}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__right__col{align-items:center;display:flex;flex-direction:column;min-width:60px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__right__col .miam-recipe-card__right__col__price{height:48px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__right__col button .loader{border:var(--m-loader-thickness) solid transparent;border-top:var(--m-loader-thickness) solid var(--m-color-white);height:24px;width:24px}@media (max-width:1023px){.miam-recipe-card{min-height:unset}.miam-recipe-card .miam-recipe-card__picture{height:164px}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__gradient{background:linear-gradient(0deg,rgba(0,0,0,.2),rgba(0,0,0,.2))}.miam-recipe-card .miam-recipe-card__attributes{padding:8px 16px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__title{color:#fff;font-weight:700;height:72px;margin-left:calc(15% - 16px);position:absolute;text-align:center;top:52px;width:70%}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__ingredients{display:none}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col{flex-direction:row;justify-content:space-between;width:100%}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col .miam-recipe-card__left__col__counter{align-items:flex-end;padding-bottom:4px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__right__col{margin-top:12px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__right__col .miam-recipe-card__right__col__price{height:48px;position:absolute;top:172px}}"], encapsulation: 2, changeDetection: 0 });
10644
+ }, directives: [i8.NgIf, IconComponent, i8.NgClass, LikeButtonComponent, SkeletonComponent, i8.NgSwitch, i8.NgSwitchCase, i8.NgSwitchDefault, CounterInputComponent, RecipePricingComponent, LoaderComponent, CORSOverlayComponent], pipes: [i8.AsyncPipe, CapitalizeFirstLetterPipe], styles: [".miam-flex-column,.miam-recipe-card .miam-recipe-card__attributes,.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__actions{display:flex;flex-direction:column;justify-content:space-around}.miam-flex-row{align-items:center;display:flex;flex-direction:row;justify-content:space-between;margin:auto}.miam-recipe-card{background-color:var(--m-color-white);border-radius:var(--m-border-radius);box-shadow:var(--m-shadow-small);display:flex;flex-direction:column;height:100%;min-height:470px;position:relative;width:320px}.miam-recipe-card .miam-recipe-card__header{display:none}.miam-recipe-card .miam-recipe-card__picture{-webkit-tap-highlight-color:transparent;cursor:pointer;height:240px;position:relative}.miam-recipe-card .miam-recipe-card__picture img{-o-object-fit:cover;object-fit:cover;transition:var(--m-default-transition);z-index:var(--m-z-index-position-absolute-low)}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__gradient,.miam-recipe-card .miam-recipe-card__picture img{border-top-left-radius:var(--m-border-radius);border-top-right-radius:var(--m-border-radius);height:100%;position:absolute;width:100%}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__gradient{background:linear-gradient(180deg,transparent 57.92%,rgba(0,0,0,.75) 100%,rgba(0,0,0,.75) 0);content:\"\"}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__video{left:calc(50% - 50px);position:absolute;top:calc(50% - 50px)}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__tag{background-color:var(--m-color-primary-light);border-radius:5px;bottom:16px;color:var(--m-color-primary);font-weight:500;left:16px;padding:8px;position:absolute;text-transform:uppercase}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__actions{position:absolute;right:16px;top:8px;z-index:var(--m-z-index-position-absolute-high)}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__actions .miam-recipe-card__actions__icon{-o-object-fit:contain;background-color:var(--m-color-white);border-radius:var(--m-border-radius-circle);box-shadow:var(--m-shadow-small);display:none;margin:0 0 16px;object-fit:contain;padding:8px;width:-webkit-max-content;width:-moz-max-content;width:max-content}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__actions .miam-recipe-card__actions__icon .icon-container{margin:0}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__actions .miam-recipe-card__actions__icon.miam-noPadding{padding:0}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__actions ng-miam-like-button.miam-recipe-card__actions__icon{display:initial}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__sponsor{-o-object-fit:contain;bottom:16px;height:auto;max-height:72px;max-width:96px;object-fit:contain;position:absolute;right:16px;width:auto}.miam-recipe-card .miam-recipe-card__attributes{flex:1 1;justify-content:space-between;padding:8px 16px 16px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__title{-webkit-box-orient:vertical;-webkit-line-clamp:2;-webkit-tap-highlight-color:transparent;color:var(--m-color-slate);cursor:pointer;display:-webkit-box;font-size:20px;font-weight:700;font-weight:500;letter-spacing:normal;line-height:30;line-height:1.5;margin:0 8px 8px 0;overflow:hidden;text-align:left;text-overflow:ellipsis;transition:var(--m-default-transition)}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__title:hover{color:var(--m-color-primary);text-decoration:underline}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__ingredients{-webkit-box-orient:vertical;-webkit-line-clamp:1;color:var(--m-color-grey-text);display:-webkit-box;font-size:14px;font-weight:300;overflow:hidden;text-overflow:ellipsis}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__infos{display:flex;flex-direction:row;padding:8px 0}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__infos .miam-recipe-card__attributes__info{display:flex;flex-direction:row;margin:0 16px 0 0}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__infos .miam-recipe-card__attributes__info.recipe__ingredients{display:none}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__infos .miam-recipe-card__attributes__info .miam-recipe-card__info__label{font-size:14px;margin-left:8px;text-transform:capitalize}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control{align-items:center;display:flex;justify-content:space-between}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col{display:flex;flex-direction:column-reverse}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col .miam-recipe-card__left__col__counter{align-items:center;display:flex}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col .miam-recipe-card__left__col__counter ng-miam-counter-input .miam-counter-input__icon{margin-right:8px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col .miam-recipe-card__left__col__custom{align-items:flex-end;display:flex;height:48px;justify-content:flex-start}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col .miam-recipe-card__left__col__custom .icon-container{cursor:pointer}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__right__col{align-items:center;display:flex;flex-direction:column;min-width:60px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__right__col .miam-recipe-card__right__col__price{height:48px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__right__col button .loader{border:var(--m-loader-thickness) solid transparent;border-top:var(--m-loader-thickness) solid var(--m-color-white);height:24px;width:24px}@media (max-width:1023px){.miam-recipe-card{min-height:unset}.miam-recipe-card .miam-recipe-card__picture{height:164px}.miam-recipe-card .miam-recipe-card__picture .miam-recipe-card__picture__gradient{background:linear-gradient(0deg,rgba(0,0,0,.2),rgba(0,0,0,.2))}.miam-recipe-card .miam-recipe-card__attributes{padding:8px 16px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__title{color:#fff;font-weight:700;height:72px;margin-left:calc(15% - 16px);position:absolute;text-align:center;top:52px;width:70%}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__ingredients{display:none}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col{flex-direction:row;justify-content:space-between;width:100%}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__left__col .miam-recipe-card__left__col__counter{align-items:flex-end;padding-bottom:4px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__right__col{margin-top:12px}.miam-recipe-card .miam-recipe-card__attributes .miam-recipe-card__attributes__control .miam-recipe-card__control__right__col .miam-recipe-card__right__col__price{height:48px;position:absolute;top:172px}}"], encapsulation: 2, changeDetection: 0 });
9923
10645
  /*@__PURE__*/ (function () {
9924
10646
  i0.ɵsetClassMetadata(RecipeCardComponent, [{
9925
10647
  type: i0.Component,
@@ -9970,7 +10692,7 @@
9970
10692
  function CatalogRecipeCardComponent_div_4_div_3_Template(rf, ctx) {
9971
10693
  if (rf & 1) {
9972
10694
  i0.ɵɵelementStart(0, "div");
9973
- i0.ɵɵelement(1, "img", 34);
10695
+ i0.ɵɵelement(1, "img", 32);
9974
10696
  i0.ɵɵelementEnd();
9975
10697
  }
9976
10698
  if (rf & 2) {
@@ -9981,8 +10703,8 @@
9981
10703
  }
9982
10704
  function CatalogRecipeCardComponent_div_4_div_5_Template(rf, ctx) {
9983
10705
  if (rf & 1) {
9984
- i0.ɵɵelementStart(0, "div", 35);
9985
- i0.ɵɵelement(1, "ng-miam-icon", 36);
10706
+ i0.ɵɵelementStart(0, "div", 33);
10707
+ i0.ɵɵelement(1, "ng-miam-icon", 34);
9986
10708
  i0.ɵɵelementEnd();
9987
10709
  }
9988
10710
  if (rf & 2) {
@@ -9991,19 +10713,32 @@
9991
10713
  i0.ɵɵproperty("iconName", ctx_r18.icon.Video)("width", 80)("height", 80);
9992
10714
  }
9993
10715
  }
9994
- function CatalogRecipeCardComponent_div_4_div_6_Template(rf, ctx) {
10716
+ function CatalogRecipeCardComponent_div_4_ng_container_6_div_1_Template(rf, ctx) {
9995
10717
  if (rf & 1) {
9996
- i0.ɵɵelementStart(0, "div", 37);
9997
- i0.ɵɵtext(1, "D\u00E9j\u00E0 ajout\u00E9e");
10718
+ i0.ɵɵelementStart(0, "div", 36);
10719
+ i0.ɵɵtext(1, " D\u00E9j\u00E0 ajout\u00E9e ");
9998
10720
  i0.ɵɵelementEnd();
9999
10721
  }
10000
10722
  }
10001
- function CatalogRecipeCardComponent_div_4_ng_container_8_Template(rf, ctx) {
10723
+ function CatalogRecipeCardComponent_div_4_ng_container_6_Template(rf, ctx) {
10002
10724
  if (rf & 1) {
10003
- var _r26_1 = i0.ɵɵgetCurrentView();
10004
10725
  i0.ɵɵelementContainerStart(0);
10005
- i0.ɵɵelementStart(1, "div", 38);
10006
- i0.ɵɵlistener("click", function CatalogRecipeCardComponent_div_4_ng_container_8_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r26_1); var ctx_r25 = i0.ɵɵnextContext(2); return ctx_r25.openRecipe(); });
10726
+ i0.ɵɵtemplate(1, CatalogRecipeCardComponent_div_4_ng_container_6_div_1_Template, 2, 0, "div", 35);
10727
+ i0.ɵɵpipe(2, "async");
10728
+ i0.ɵɵelementContainerEnd();
10729
+ }
10730
+ if (rf & 2) {
10731
+ var ctx_r19 = i0.ɵɵnextContext(2);
10732
+ i0.ɵɵadvance(1);
10733
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(2, 1, ctx_r19.groceriesListsService.recipeIsInList(ctx_r19.recipe == null ? null : ctx_r19.recipe.id)));
10734
+ }
10735
+ }
10736
+ function CatalogRecipeCardComponent_div_4_ng_container_7_Template(rf, ctx) {
10737
+ if (rf & 1) {
10738
+ var _r27_1 = i0.ɵɵgetCurrentView();
10739
+ i0.ɵɵelementContainerStart(0);
10740
+ i0.ɵɵelementStart(1, "div", 37);
10741
+ i0.ɵɵlistener("click", function CatalogRecipeCardComponent_div_4_ng_container_7_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r27_1); var ctx_r26 = i0.ɵɵnextContext(2); return ctx_r26.openRecipe(); });
10007
10742
  i0.ɵɵtext(2);
10008
10743
  i0.ɵɵelementEnd();
10009
10744
  i0.ɵɵelementContainerEnd();
@@ -10014,18 +10749,18 @@
10014
10749
  i0.ɵɵtextInterpolate1(" ", ctx_r20.recipe == null ? null : ctx_r20.recipe.attributes["title"], " ");
10015
10750
  }
10016
10751
  }
10017
- function CatalogRecipeCardComponent_div_4_ng_template_9_Template(rf, ctx) {
10752
+ function CatalogRecipeCardComponent_div_4_ng_template_8_Template(rf, ctx) {
10018
10753
  if (rf & 1) {
10019
- i0.ɵɵelement(0, "ng-miam-skeleton", 39);
10754
+ i0.ɵɵelement(0, "ng-miam-skeleton", 38);
10020
10755
  }
10021
10756
  if (rf & 2) {
10022
10757
  var ctx_r22 = i0.ɵɵnextContext(2);
10023
10758
  i0.ɵɵproperty("type", ctx_r22.skeleton.Text);
10024
10759
  }
10025
10760
  }
10026
- function CatalogRecipeCardComponent_div_4_ng_miam_like_button_12_Template(rf, ctx) {
10761
+ function CatalogRecipeCardComponent_div_4_ng_miam_like_button_11_Template(rf, ctx) {
10027
10762
  if (rf & 1) {
10028
- i0.ɵɵelement(0, "ng-miam-like-button", 40);
10763
+ i0.ɵɵelement(0, "ng-miam-like-button", 39);
10029
10764
  }
10030
10765
  if (rf & 2) {
10031
10766
  var ctx_r23 = i0.ɵɵnextContext(2);
@@ -10034,53 +10769,50 @@
10034
10769
  }
10035
10770
  function CatalogRecipeCardComponent_div_4_Template(rf, ctx) {
10036
10771
  if (rf & 1) {
10037
- var _r28_1 = i0.ɵɵgetCurrentView();
10038
- i0.ɵɵelementStart(0, "div", 21);
10039
- i0.ɵɵlistener("click", function CatalogRecipeCardComponent_div_4_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r28_1); var ctx_r27 = i0.ɵɵnextContext(); return ctx_r27.openRecipe(); });
10040
- i0.ɵɵelementStart(1, "div", 22);
10041
- i0.ɵɵelement(2, "img", 23);
10042
- i0.ɵɵtemplate(3, CatalogRecipeCardComponent_div_4_div_3_Template, 2, 1, "div", 24);
10772
+ var _r29_1 = i0.ɵɵgetCurrentView();
10773
+ i0.ɵɵelementStart(0, "div", 20);
10774
+ i0.ɵɵlistener("click", function CatalogRecipeCardComponent_div_4_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r29_1); var ctx_r28 = i0.ɵɵnextContext(); return ctx_r28.openRecipe(); });
10775
+ i0.ɵɵelementStart(1, "div", 21);
10776
+ i0.ɵɵelement(2, "img", 22);
10777
+ i0.ɵɵtemplate(3, CatalogRecipeCardComponent_div_4_div_3_Template, 2, 1, "div", 23);
10043
10778
  i0.ɵɵpipe(4, "async");
10044
10779
  i0.ɵɵelementEnd();
10045
- i0.ɵɵtemplate(5, CatalogRecipeCardComponent_div_4_div_5_Template, 2, 3, "div", 25);
10046
- i0.ɵɵtemplate(6, CatalogRecipeCardComponent_div_4_div_6_Template, 2, 0, "div", 26);
10047
- i0.ɵɵpipe(7, "async");
10048
- i0.ɵɵtemplate(8, CatalogRecipeCardComponent_div_4_ng_container_8_Template, 3, 1, "ng-container", 27);
10049
- i0.ɵɵtemplate(9, CatalogRecipeCardComponent_div_4_ng_template_9_Template, 1, 1, "ng-template", null, 28, i0.ɵɵtemplateRefExtractor);
10050
- i0.ɵɵelementStart(11, "div", 29);
10051
- i0.ɵɵtemplate(12, CatalogRecipeCardComponent_div_4_ng_miam_like_button_12_Template, 1, 1, "ng-miam-like-button", 30);
10052
- i0.ɵɵpipe(13, "async");
10053
- i0.ɵɵelementStart(14, "div", 31, 32);
10054
- i0.ɵɵlistener("click", function CatalogRecipeCardComponent_div_4_Template_div_click_14_listener($event) { i0.ɵɵrestoreView(_r28_1); var ctx_r29 = i0.ɵɵnextContext(); return ctx_r29.toggleMoreActions($event); });
10055
- i0.ɵɵelement(16, "ng-miam-icon", 33);
10780
+ i0.ɵɵtemplate(5, CatalogRecipeCardComponent_div_4_div_5_Template, 2, 3, "div", 24);
10781
+ i0.ɵɵtemplate(6, CatalogRecipeCardComponent_div_4_ng_container_6_Template, 3, 3, "ng-container", 23);
10782
+ i0.ɵɵtemplate(7, CatalogRecipeCardComponent_div_4_ng_container_7_Template, 3, 1, "ng-container", 25);
10783
+ i0.ɵɵtemplate(8, CatalogRecipeCardComponent_div_4_ng_template_8_Template, 1, 1, "ng-template", null, 26, i0.ɵɵtemplateRefExtractor);
10784
+ i0.ɵɵelementStart(10, "div", 27);
10785
+ i0.ɵɵtemplate(11, CatalogRecipeCardComponent_div_4_ng_miam_like_button_11_Template, 1, 1, "ng-miam-like-button", 28);
10786
+ i0.ɵɵpipe(12, "async");
10787
+ i0.ɵɵelementStart(13, "div", 29, 30);
10788
+ i0.ɵɵlistener("click", function CatalogRecipeCardComponent_div_4_Template_div_click_13_listener($event) { i0.ɵɵrestoreView(_r29_1); var ctx_r30 = i0.ɵɵnextContext(); return ctx_r30.toggleMoreActions($event); });
10789
+ i0.ɵɵelement(15, "ng-miam-icon", 31);
10056
10790
  i0.ɵɵelementEnd();
10057
10791
  i0.ɵɵelementEnd();
10058
10792
  i0.ɵɵelementEnd();
10059
10793
  }
10060
10794
  if (rf & 2) {
10061
- var _r21 = i0.ɵɵreference(10);
10795
+ var _r21 = i0.ɵɵreference(9);
10062
10796
  var ctx_r0 = i0.ɵɵnextContext();
10063
- var tmp_1_0 = null;
10064
- var tmp_3_0 = null;
10065
10797
  i0.ɵɵadvance(2);
10066
10798
  i0.ɵɵproperty("src", ctx_r0.recipe.attributes["media-url"], i0.ɵɵsanitizeUrl);
10067
10799
  i0.ɵɵadvance(1);
10068
- i0.ɵɵproperty("ngIf", !((tmp_1_0 = i0.ɵɵpipeBind1(4, 8, ctx_r0.groceriesListsService.list$)) == null ? null : tmp_1_0.hasRecipe(ctx_r0.recipe == null ? null : ctx_r0.recipe.id)) && ctx_r0.recipe.filigraneLogoUrl);
10800
+ i0.ɵɵproperty("ngIf", !i0.ɵɵpipeBind1(4, 8, ctx_r0.groceriesListsService.recipeIsInList(ctx_r0.recipe == null ? null : ctx_r0.recipe.id)) && ctx_r0.recipe.filigraneLogoUrl);
10069
10801
  i0.ɵɵadvance(2);
10070
10802
  i0.ɵɵproperty("ngIf", ctx_r0.contextService.videoRecipesEnabled && (ctx_r0.recipe == null ? null : ctx_r0.recipe.videoId));
10071
10803
  i0.ɵɵadvance(1);
10072
- i0.ɵɵproperty("ngIf", (tmp_3_0 = i0.ɵɵpipeBind1(7, 10, ctx_r0.groceriesListsService.list$)) == null ? null : tmp_3_0.hasRecipe(ctx_r0.recipe == null ? null : ctx_r0.recipe.id));
10073
- i0.ɵɵadvance(2);
10804
+ i0.ɵɵproperty("ngIf", ctx_r0.recipe && ctx_r0.displayAddedOnPicture);
10805
+ i0.ɵɵadvance(1);
10074
10806
  i0.ɵɵproperty("ngIf", ctx_r0.recipe)("ngIfElse", _r21);
10075
10807
  i0.ɵɵadvance(4);
10076
- i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(13, 12, ctx_r0.userService.isLogged$));
10808
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(12, 10, ctx_r0.userService.isLogged$));
10077
10809
  i0.ɵɵadvance(4);
10078
10810
  i0.ɵɵproperty("iconName", ctx_r0.actionsOpened ? ctx_r0.icon.Clear : ctx_r0.icon.HorizontalDots);
10079
10811
  }
10080
10812
  }
10081
10813
  function CatalogRecipeCardComponent_ng_template_5_Template(rf, ctx) {
10082
10814
  if (rf & 1) {
10083
- i0.ɵɵelement(0, "ng-miam-skeleton", 39);
10815
+ i0.ɵɵelement(0, "ng-miam-skeleton", 38);
10084
10816
  }
10085
10817
  if (rf & 2) {
10086
10818
  var ctx_r2 = i0.ɵɵnextContext();
@@ -10089,10 +10821,10 @@
10089
10821
  }
10090
10822
  function CatalogRecipeCardComponent_div_10_Template(rf, ctx) {
10091
10823
  if (rf & 1) {
10092
- var _r31_1 = i0.ɵɵgetCurrentView();
10093
- i0.ɵɵelementStart(0, "div", 41);
10094
- i0.ɵɵelementStart(1, "ng-miam-counter-input", 42);
10095
- i0.ɵɵlistener("counterChange", function CatalogRecipeCardComponent_div_10_Template_ng_miam_counter_input_counterChange_1_listener($event) { i0.ɵɵrestoreView(_r31_1); var ctx_r30 = i0.ɵɵnextContext(); return ctx_r30.updateGuests($event); });
10824
+ var _r32_1 = i0.ɵɵgetCurrentView();
10825
+ i0.ɵɵelementStart(0, "div", 40);
10826
+ i0.ɵɵelementStart(1, "ng-miam-counter-input", 41);
10827
+ i0.ɵɵlistener("counterChange", function CatalogRecipeCardComponent_div_10_Template_ng_miam_counter_input_counterChange_1_listener($event) { i0.ɵɵrestoreView(_r32_1); var ctx_r31 = i0.ɵɵnextContext(); return ctx_r31.updateGuests($event); });
10096
10828
  i0.ɵɵelementEnd();
10097
10829
  i0.ɵɵelementEnd();
10098
10830
  }
@@ -10104,26 +10836,26 @@
10104
10836
  }
10105
10837
  function CatalogRecipeCardComponent_div_11_div_5_Template(rf, ctx) {
10106
10838
  if (rf & 1) {
10107
- i0.ɵɵelementStart(0, "div", 47);
10839
+ i0.ɵɵelementStart(0, "div", 46);
10108
10840
  i0.ɵɵtext(1);
10109
10841
  i0.ɵɵelementEnd();
10110
10842
  }
10111
10843
  if (rf & 2) {
10112
- var ctx_r32 = i0.ɵɵnextContext(2);
10844
+ var ctx_r33 = i0.ɵɵnextContext(2);
10113
10845
  i0.ɵɵadvance(1);
10114
- i0.ɵɵtextInterpolate1(" + ", ctx_r32.recipe.modifiedIngredients.length - 2, " ");
10846
+ i0.ɵɵtextInterpolate1(" + ", ctx_r33.recipe.modifiedIngredients.length - 2, " ");
10115
10847
  }
10116
10848
  }
10117
10849
  function CatalogRecipeCardComponent_div_11_Template(rf, ctx) {
10118
10850
  if (rf & 1) {
10119
- i0.ɵɵelementStart(0, "div", 43);
10120
- i0.ɵɵelementStart(1, "div", 44);
10121
- i0.ɵɵelement(2, "img", 45);
10851
+ i0.ɵɵelementStart(0, "div", 42);
10852
+ i0.ɵɵelementStart(1, "div", 43);
10853
+ i0.ɵɵelement(2, "img", 44);
10122
10854
  i0.ɵɵelementEnd();
10123
- i0.ɵɵelementStart(3, "div", 44);
10124
- i0.ɵɵelement(4, "img", 45);
10855
+ i0.ɵɵelementStart(3, "div", 43);
10856
+ i0.ɵɵelement(4, "img", 44);
10125
10857
  i0.ɵɵelementEnd();
10126
- i0.ɵɵtemplate(5, CatalogRecipeCardComponent_div_11_div_5_Template, 2, 1, "div", 46);
10858
+ i0.ɵɵtemplate(5, CatalogRecipeCardComponent_div_11_div_5_Template, 2, 1, "div", 45);
10127
10859
  i0.ɵɵelementEnd();
10128
10860
  }
10129
10861
  if (rf & 2) {
@@ -10138,43 +10870,54 @@
10138
10870
  }
10139
10871
  function CatalogRecipeCardComponent_ng_template_12_Template(rf, ctx) {
10140
10872
  if (rf & 1) {
10141
- i0.ɵɵelement(0, "ng-miam-skeleton", 39);
10873
+ i0.ɵɵelement(0, "ng-miam-skeleton", 38);
10142
10874
  }
10143
10875
  if (rf & 2) {
10144
10876
  var ctx_r6 = i0.ɵɵnextContext();
10145
10877
  i0.ɵɵproperty("type", ctx_r6.skeleton == null ? null : ctx_r6.skeleton.IconWithInfo);
10146
10878
  }
10147
10879
  }
10148
- function CatalogRecipeCardComponent_ng_miam_recipe_pricing_16_Template(rf, ctx) {
10880
+ function CatalogRecipeCardComponent_div_15_ng_miam_recipe_pricing_1_Template(rf, ctx) {
10881
+ if (rf & 1) {
10882
+ i0.ɵɵelement(0, "ng-miam-recipe-pricing", 49);
10883
+ }
10884
+ if (rf & 2) {
10885
+ var ctx_r34 = i0.ɵɵnextContext(2);
10886
+ i0.ɵɵproperty("recipe", ctx_r34.recipe)("serves", ctx_r34.recipe == null ? null : ctx_r34.recipe.modifiedGuests);
10887
+ }
10888
+ }
10889
+ function CatalogRecipeCardComponent_div_15_Template(rf, ctx) {
10149
10890
  if (rf & 1) {
10150
- i0.ɵɵelement(0, "ng-miam-recipe-pricing", 48);
10891
+ i0.ɵɵelementStart(0, "div", 47);
10892
+ i0.ɵɵtemplate(1, CatalogRecipeCardComponent_div_15_ng_miam_recipe_pricing_1_Template, 1, 2, "ng-miam-recipe-pricing", 48);
10893
+ i0.ɵɵelementEnd();
10151
10894
  }
10152
10895
  if (rf & 2) {
10153
10896
  var ctx_r7 = i0.ɵɵnextContext();
10154
- i0.ɵɵproperty("recipe", ctx_r7.recipe)("serves", ctx_r7.recipe == null ? null : ctx_r7.recipe.modifiedGuests);
10897
+ i0.ɵɵadvance(1);
10898
+ i0.ɵɵproperty("ngIf", ctx_r7.isPriceDisplayed);
10155
10899
  }
10156
10900
  }
10157
- function CatalogRecipeCardComponent_ng_miam_icon_19_Template(rf, ctx) {
10901
+ function CatalogRecipeCardComponent_ng_miam_icon_18_Template(rf, ctx) {
10158
10902
  if (rf & 1) {
10159
- i0.ɵɵelement(0, "ng-miam-icon", 49);
10903
+ i0.ɵɵelement(0, "ng-miam-icon", 50);
10160
10904
  i0.ɵɵpipe(1, "async");
10161
10905
  }
10162
10906
  if (rf & 2) {
10163
10907
  var ctx_r8 = i0.ɵɵnextContext();
10164
- var tmp_2_0 = null;
10165
- i0.ɵɵproperty("width", 24)("height", 24)("iconName", ((tmp_2_0 = i0.ɵɵpipeBind1(1, 3, ctx_r8.groceriesListsService.list$)) == null ? null : tmp_2_0.hasRecipe(ctx_r8.recipe == null ? null : ctx_r8.recipe.id)) ? ctx_r8.icon.CheckList : ctx_r8.icon.Cart);
10908
+ i0.ɵɵproperty("width", 24)("height", 24)("iconName", i0.ɵɵpipeBind1(1, 3, ctx_r8.groceriesListsService.recipeIsInList(ctx_r8.recipe == null ? null : ctx_r8.recipe.id)) ? ctx_r8.icon.CheckList : ctx_r8.icon.Cart);
10166
10909
  }
10167
10910
  }
10168
- function CatalogRecipeCardComponent_ng_template_20_Template(rf, ctx) {
10911
+ function CatalogRecipeCardComponent_ng_template_19_Template(rf, ctx) {
10169
10912
  if (rf & 1) {
10170
10913
  i0.ɵɵelement(0, "ng-miam-loader");
10171
10914
  }
10172
10915
  }
10173
- function CatalogRecipeCardComponent_div_23_Template(rf, ctx) {
10916
+ function CatalogRecipeCardComponent_div_22_Template(rf, ctx) {
10174
10917
  if (rf & 1) {
10175
- i0.ɵɵelementStart(0, "div", 50);
10176
- i0.ɵɵelement(1, "ng-miam-icon", 51);
10177
- i0.ɵɵelementStart(2, "span", 52);
10918
+ i0.ɵɵelementStart(0, "div", 51);
10919
+ i0.ɵɵelement(1, "ng-miam-icon", 52);
10920
+ i0.ɵɵelementStart(2, "span", 53);
10178
10921
  i0.ɵɵtext(3);
10179
10922
  i0.ɵɵelementEnd();
10180
10923
  i0.ɵɵelementEnd();
@@ -10187,24 +10930,24 @@
10187
10930
  i0.ɵɵtextInterpolate2("", ctx_r11.isMobile ? "" : "Temps n\u00E9cessaire : ", "", ctx_r11.recipe == null ? null : ctx_r11.recipe.totalTime, "");
10188
10931
  }
10189
10932
  }
10190
- function CatalogRecipeCardComponent_ng_template_24_Template(rf, ctx) {
10933
+ function CatalogRecipeCardComponent_ng_template_23_Template(rf, ctx) {
10191
10934
  if (rf & 1) {
10192
- i0.ɵɵelement(0, "ng-miam-skeleton", 39);
10935
+ i0.ɵɵelement(0, "ng-miam-skeleton", 38);
10193
10936
  }
10194
10937
  if (rf & 2) {
10195
10938
  var ctx_r13 = i0.ɵɵnextContext();
10196
10939
  i0.ɵɵproperty("type", ctx_r13.skeleton == null ? null : ctx_r13.skeleton.IconWithInfo);
10197
10940
  }
10198
10941
  }
10199
- function CatalogRecipeCardComponent_ng_miam_actions_popin_26_Template(rf, ctx) {
10942
+ function CatalogRecipeCardComponent_ng_miam_actions_popin_25_Template(rf, ctx) {
10200
10943
  if (rf & 1) {
10201
- var _r34_1 = i0.ɵɵgetCurrentView();
10202
- i0.ɵɵelementStart(0, "ng-miam-actions-popin", 53);
10203
- i0.ɵɵlistener("close", function CatalogRecipeCardComponent_ng_miam_actions_popin_26_Template_ng_miam_actions_popin_close_0_listener() { i0.ɵɵrestoreView(_r34_1); var ctx_r33 = i0.ɵɵnextContext(); return ctx_r33.closeMoreActions(); })("actionTriggered", function CatalogRecipeCardComponent_ng_miam_actions_popin_26_Template_ng_miam_actions_popin_actionTriggered_0_listener($event) { i0.ɵɵrestoreView(_r34_1); var ctx_r35 = i0.ɵɵnextContext(); return ctx_r35.actionTriggered.emit($event); });
10944
+ var _r36_1 = i0.ɵɵgetCurrentView();
10945
+ i0.ɵɵelementStart(0, "ng-miam-actions-popin", 54);
10946
+ i0.ɵɵlistener("close", function CatalogRecipeCardComponent_ng_miam_actions_popin_25_Template_ng_miam_actions_popin_close_0_listener() { i0.ɵɵrestoreView(_r36_1); var ctx_r35 = i0.ɵɵnextContext(); return ctx_r35.closeMoreActions(); })("actionTriggered", function CatalogRecipeCardComponent_ng_miam_actions_popin_25_Template_ng_miam_actions_popin_actionTriggered_0_listener($event) { i0.ɵɵrestoreView(_r36_1); var ctx_r37 = i0.ɵɵnextContext(); return ctx_r37.actionTriggered.emit($event); });
10204
10947
  i0.ɵɵelementEnd();
10205
10948
  }
10206
10949
  }
10207
- function CatalogRecipeCardComponent_ng_template_27_Template(rf, ctx) {
10950
+ function CatalogRecipeCardComponent_ng_template_26_Template(rf, ctx) {
10208
10951
  if (rf & 1) {
10209
10952
  i0.ɵɵelement(0, "ng-miam-cors-overlay");
10210
10953
  }
@@ -10240,7 +10983,10 @@
10240
10983
  };
10241
10984
  CatalogRecipeCardComponent.prototype.ngOnInit = function () {
10242
10985
  var _this = this;
10243
- this.subscriptions.push(this.groceriesListsService.list$.pipe(operators.skipWhile(function (l) { return !l; })).subscribe(function () { return _this.cdr.detectChanges(); }));
10986
+ // Refresh view each time groceriesList changes
10987
+ this.subscriptions.push(this.groceriesListsService.list$
10988
+ .pipe(operators.skipWhile(function (l) { return !l; }))
10989
+ .subscribe(function () { return _this.cdr.detectChanges(); }));
10244
10990
  if (this.recipe) {
10245
10991
  this.recipe = this.recipe.shallowCopyWithEvents(this.recipeEventsService.ORIGIN_CATALOG, this.eventsGroupId);
10246
10992
  this.recipeEventsService.enqueueEvent(this.recipe, this.recipeEventsService.ACTION_PROPOSED);
@@ -10274,10 +11020,14 @@
10274
11020
  this.observer.observe(this.element.nativeElement);
10275
11021
  };
10276
11022
  CatalogRecipeCardComponent.prototype.updateGuests = function (count) {
11023
+ var _this = this;
10277
11024
  this.recipe.modifiedGuests = count;
10278
- if (this.groceriesListsService.list$.value.hasRecipe(this.recipe.id)) {
10279
- this.addRecipe(false);
10280
- }
11025
+ this.subscriptions.push(this.groceriesListsService.recipeIsInList(this.recipe.id).subscribe(function (recipeIsInList) {
11026
+ if (recipeIsInList) {
11027
+ _this.addRecipe(false);
11028
+ _this.cdr.detectChanges();
11029
+ }
11030
+ }));
10281
11031
  this.cdr.detectChanges();
10282
11032
  };
10283
11033
  CatalogRecipeCardComponent.prototype.toggleMoreActions = function (event) {
@@ -10308,7 +11058,7 @@
10308
11058
  if (rf & 1) {
10309
11059
  i0.ɵɵlistener("scroll", function CatalogRecipeCardComponent_scroll_HostBindingHandler() { return ctx.onScroll(); }, false, i0.ɵɵresolveWindow);
10310
11060
  }
10311
- }, outputs: { actionTriggered: "actionTriggered" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 29, vars: 19, consts: [[1, "miam-catalog-recipe-card"], [1, "miam-catalog-recipe-card__header"], ["class", "miam-catalog-card__picture", 3, "click", 4, "ngIf", "ngIfElse"], ["pictSkeleton", ""], [1, "miam-catalog-card__attributes"], [1, "miam-catalog-recipe-card__attributes__control"], [1, "miam-catalog-recipe-card__control__left__col"], ["class", "miam-catalog-recipe-card__left__col__counter", 4, "ngIf", "ngIfElse"], ["class", "miam-recipe-card__ingredients__pictures", 4, "ngIf"], ["skeletoncounter", ""], [1, "miam-catalog-recipe-card__control__right__col"], [1, "miam-catalog-recipe-card__right__col__price"], [3, "recipe", "serves", 4, "ngIf"], [1, "m-button-fab-primary", 3, "disabled", "ngClass", "click"], ["primaryColor", "#fff", 3, "width", "height", "iconName", 4, "ngIf", "ngIfElse"], ["addLoader", ""], [1, "miam-catalog-card__attributes__infos"], ["class", "miam-catalog-card__attributes__info ", 4, "ngIf", "ngIfElse"], ["skeletonInfo", ""], [3, "close", "actionTriggered", 4, "ngIf"], ["cors", ""], [1, "miam-catalog-card__picture", 3, "click"], [1, "miam-catalog-card__picture__gradient"], ["loading", "lazy", 1, "miam-catalog-card__picture__img", 3, "src"], [4, "ngIf"], ["class", "miam-catalog-recipe-card__picture__video", 4, "ngIf"], ["class", "miam-catalog-recipe-card__picture__tag", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["textSkeleton", ""], [1, "miam-catalog-recipe-card__picture__actions"], ["class", "miam-catalog-recipe-card__actions__icon miam-noPadding", 3, "recipe", 4, "ngIf"], [1, "miam-catalog-recipe-card__actions__icon", 3, "click"], ["miamMoreActions", ""], ["primaryColor", "var(--m-color-primary)", 3, "iconName"], [1, "miam-catalog-card__picture__sponsor", 3, "src"], [1, "miam-catalog-recipe-card__picture__video"], ["primaryColor", "black", 3, "iconName", "width", "height"], [1, "miam-catalog-recipe-card__picture__tag"], [1, "miam-catalog-recipe-card__attributes__title", 3, "click"], [3, "type"], [1, "miam-catalog-recipe-card__actions__icon", "miam-noPadding", 3, "recipe"], [1, "miam-catalog-recipe-card__left__col__counter"], [3, "counter", "counterChange"], [1, "miam-recipe-card__ingredients__pictures"], [1, "miam-recipe-card__ingredients__picture"], [3, "src"], ["class", "miam-recipe-card__ingredients__more", 4, "ngIf"], [1, "miam-recipe-card__ingredients__more"], [3, "recipe", "serves"], ["primaryColor", "#fff", 3, "width", "height", "iconName"], [1, "miam-catalog-card__attributes__info"], [3, "iconName"], [1, "miam-catalog-card__info__label"], [3, "close", "actionTriggered"]], template: function CatalogRecipeCardComponent_Template(rf, ctx) {
11061
+ }, outputs: { actionTriggered: "actionTriggered" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 28, vars: 19, consts: [[1, "miam-catalog-recipe-card"], [1, "miam-catalog-recipe-card__header"], ["class", "miam-catalog-card__picture", 3, "click", 4, "ngIf", "ngIfElse"], ["pictSkeleton", ""], [1, "miam-catalog-card__attributes"], [1, "miam-catalog-recipe-card__attributes__control"], [1, "miam-catalog-recipe-card__control__left__col"], ["class", "miam-catalog-recipe-card__left__col__counter", 4, "ngIf", "ngIfElse"], ["class", "miam-recipe-card__ingredients__pictures", 4, "ngIf"], ["skeletoncounter", ""], [1, "miam-catalog-recipe-card__control__right__col"], ["class", "miam-catalog-recipe-card__right__col__price", 4, "ngIf"], [1, "m-button-fab-primary", 3, "disabled", "ngClass", "click"], ["primaryColor", "#fff", 3, "width", "height", "iconName", 4, "ngIf", "ngIfElse"], ["addLoader", ""], [1, "miam-catalog-card__attributes__infos"], ["class", "miam-catalog-card__attributes__info ", 4, "ngIf", "ngIfElse"], ["skeletonInfo", ""], [3, "close", "actionTriggered", 4, "ngIf"], ["cors", ""], [1, "miam-catalog-card__picture", 3, "click"], [1, "miam-catalog-card__picture__gradient"], ["loading", "lazy", 1, "miam-catalog-card__picture__img", 3, "src"], [4, "ngIf"], ["class", "miam-catalog-recipe-card__picture__video", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["textSkeleton", ""], [1, "miam-catalog-recipe-card__picture__actions"], ["class", "miam-catalog-recipe-card__actions__icon miam-noPadding", 3, "recipe", 4, "ngIf"], [1, "miam-catalog-recipe-card__actions__icon", 3, "click"], ["miamMoreActions", ""], ["primaryColor", "var(--m-color-primary)", 3, "iconName"], [1, "miam-catalog-card__picture__sponsor", 3, "src"], [1, "miam-catalog-recipe-card__picture__video"], ["primaryColor", "black", 3, "iconName", "width", "height"], ["class", "miam-catalog-recipe-card__picture__tag", 4, "ngIf"], [1, "miam-catalog-recipe-card__picture__tag"], [1, "miam-catalog-recipe-card__attributes__title", 3, "click"], [3, "type"], [1, "miam-catalog-recipe-card__actions__icon", "miam-noPadding", 3, "recipe"], [1, "miam-catalog-recipe-card__left__col__counter"], [3, "counter", "counterChange"], [1, "miam-recipe-card__ingredients__pictures"], [1, "miam-recipe-card__ingredients__picture"], [3, "src"], ["class", "miam-recipe-card__ingredients__more", 4, "ngIf"], [1, "miam-recipe-card__ingredients__more"], [1, "miam-catalog-recipe-card__right__col__price"], [3, "recipe", "serves", 4, "ngIf"], [3, "recipe", "serves"], ["primaryColor", "#fff", 3, "width", "height", "iconName"], [1, "miam-catalog-card__attributes__info"], [3, "iconName"], [1, "miam-catalog-card__info__label"], [3, "close", "actionTriggered"]], template: function CatalogRecipeCardComponent_Template(rf, ctx) {
10312
11062
  if (rf & 1) {
10313
11063
  i0.ɵɵelementStart(0, "div", 0);
10314
11064
  i0.ɵɵelementStart(1, "div", 1);
@@ -10316,7 +11066,7 @@
10316
11066
  i0.ɵɵtext(3);
10317
11067
  i0.ɵɵelementEnd();
10318
11068
  i0.ɵɵelementEnd();
10319
- i0.ɵɵtemplate(4, CatalogRecipeCardComponent_div_4_Template, 17, 14, "div", 2);
11069
+ i0.ɵɵtemplate(4, CatalogRecipeCardComponent_div_4_Template, 16, 12, "div", 2);
10320
11070
  i0.ɵɵtemplate(5, CatalogRecipeCardComponent_ng_template_5_Template, 1, 1, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
10321
11071
  i0.ɵɵelementStart(7, "div", 4);
10322
11072
  i0.ɵɵelementStart(8, "div", 5);
@@ -10326,32 +11076,29 @@
10326
11076
  i0.ɵɵtemplate(12, CatalogRecipeCardComponent_ng_template_12_Template, 1, 1, "ng-template", null, 9, i0.ɵɵtemplateRefExtractor);
10327
11077
  i0.ɵɵelementEnd();
10328
11078
  i0.ɵɵelementStart(14, "div", 10);
10329
- i0.ɵɵelementStart(15, "div", 11);
10330
- i0.ɵɵtemplate(16, CatalogRecipeCardComponent_ng_miam_recipe_pricing_16_Template, 1, 2, "ng-miam-recipe-pricing", 12);
11079
+ i0.ɵɵtemplate(15, CatalogRecipeCardComponent_div_15_Template, 2, 1, "div", 11);
11080
+ i0.ɵɵelementStart(16, "button", 12);
11081
+ i0.ɵɵlistener("click", function CatalogRecipeCardComponent_Template_button_click_16_listener() { return ctx.clickPrimary(); });
11082
+ i0.ɵɵpipe(17, "async");
11083
+ i0.ɵɵtemplate(18, CatalogRecipeCardComponent_ng_miam_icon_18_Template, 2, 5, "ng-miam-icon", 13);
11084
+ i0.ɵɵtemplate(19, CatalogRecipeCardComponent_ng_template_19_Template, 1, 0, "ng-template", null, 14, i0.ɵɵtemplateRefExtractor);
10331
11085
  i0.ɵɵelementEnd();
10332
- i0.ɵɵelementStart(17, "button", 13);
10333
- i0.ɵɵlistener("click", function CatalogRecipeCardComponent_Template_button_click_17_listener() { return ctx.clickPrimary(); });
10334
- i0.ɵɵpipe(18, "async");
10335
- i0.ɵɵtemplate(19, CatalogRecipeCardComponent_ng_miam_icon_19_Template, 2, 5, "ng-miam-icon", 14);
10336
- i0.ɵɵtemplate(20, CatalogRecipeCardComponent_ng_template_20_Template, 1, 0, "ng-template", null, 15, i0.ɵɵtemplateRefExtractor);
10337
11086
  i0.ɵɵelementEnd();
10338
11087
  i0.ɵɵelementEnd();
11088
+ i0.ɵɵelementStart(21, "div", 15);
11089
+ i0.ɵɵtemplate(22, CatalogRecipeCardComponent_div_22_Template, 4, 3, "div", 16);
11090
+ i0.ɵɵtemplate(23, CatalogRecipeCardComponent_ng_template_23_Template, 1, 1, "ng-template", null, 17, i0.ɵɵtemplateRefExtractor);
10339
11091
  i0.ɵɵelementEnd();
10340
- i0.ɵɵelementStart(22, "div", 16);
10341
- i0.ɵɵtemplate(23, CatalogRecipeCardComponent_div_23_Template, 4, 3, "div", 17);
10342
- i0.ɵɵtemplate(24, CatalogRecipeCardComponent_ng_template_24_Template, 1, 1, "ng-template", null, 18, i0.ɵɵtemplateRefExtractor);
10343
11092
  i0.ɵɵelementEnd();
11093
+ i0.ɵɵtemplate(25, CatalogRecipeCardComponent_ng_miam_actions_popin_25_Template, 1, 0, "ng-miam-actions-popin", 18);
10344
11094
  i0.ɵɵelementEnd();
10345
- i0.ɵɵtemplate(26, CatalogRecipeCardComponent_ng_miam_actions_popin_26_Template, 1, 0, "ng-miam-actions-popin", 19);
10346
- i0.ɵɵelementEnd();
10347
- i0.ɵɵtemplate(27, CatalogRecipeCardComponent_ng_template_27_Template, 1, 0, "ng-template", null, 20, i0.ɵɵtemplateRefExtractor);
11095
+ i0.ɵɵtemplate(26, CatalogRecipeCardComponent_ng_template_26_Template, 1, 0, "ng-template", null, 19, i0.ɵɵtemplateRefExtractor);
10348
11096
  }
10349
11097
  if (rf & 2) {
10350
11098
  var _r1 = i0.ɵɵreference(6);
10351
11099
  var _r5 = i0.ɵɵreference(13);
10352
- var _r9 = i0.ɵɵreference(21);
10353
- var _r12 = i0.ɵɵreference(25);
10354
- var tmp_8_0 = null;
11100
+ var _r9 = i0.ɵɵreference(20);
11101
+ var _r12 = i0.ɵɵreference(24);
10355
11102
  i0.ɵɵadvance(3);
10356
11103
  i0.ɵɵtextInterpolate1(" ", ctx.headerText, "");
10357
11104
  i0.ɵɵadvance(1);
@@ -10360,10 +11107,10 @@
10360
11107
  i0.ɵɵproperty("ngIf", ctx.recipe)("ngIfElse", _r5);
10361
11108
  i0.ɵɵadvance(1);
10362
11109
  i0.ɵɵproperty("ngIf", ctx.contextService.displayIngredientPicturesOnRecipeCards && (ctx.recipe == null ? null : ctx.recipe.modifiedIngredients == null ? null : ctx.recipe.modifiedIngredients.length) > 1);
10363
- i0.ɵɵadvance(5);
10364
- i0.ɵɵproperty("ngIf", ctx.isPriceDisplayed);
11110
+ i0.ɵɵadvance(4);
11111
+ i0.ɵɵproperty("ngIf", ctx.recipe && ctx.displayPricing);
10365
11112
  i0.ɵɵadvance(1);
10366
- i0.ɵɵproperty("disabled", !ctx.recipe)("ngClass", i0.ɵɵpureFunction2(16, _c1$7, (tmp_8_0 = i0.ɵɵpipeBind1(18, 14, ctx.groceriesListsService.list$)) == null ? null : tmp_8_0.hasRecipe(ctx.recipe == null ? null : ctx.recipe.id), ctx.addButtonLoading));
11113
+ i0.ɵɵproperty("disabled", !ctx.recipe)("ngClass", i0.ɵɵpureFunction2(16, _c1$7, i0.ɵɵpipeBind1(17, 14, ctx.groceriesListsService.recipeIsInList(ctx.recipe == null ? null : ctx.recipe.id)), ctx.addButtonLoading));
10367
11114
  i0.ɵɵadvance(2);
10368
11115
  i0.ɵɵproperty("ngIf", !ctx.addButtonLoading)("ngIfElse", _r9);
10369
11116
  i0.ɵɵadvance(4);
@@ -12758,7 +13505,7 @@
12758
13505
  i0.ɵɵadvance(2);
12759
13506
  i0.ɵɵproperty("ngIf", !ctx.creatingRecipe)("ngIfElse", _r2);
12760
13507
  }
12761
- }, styles: [".miam-recipe-catalog{display:flex;justify-content:space-between;width:100%}.miam-recipe-catalog .miam-recipe-catalog__content{width:calc(100% - 216px)}.miam-recipe-catalog .miam-recipe-catalog__content.filter-collapsed{overflow-x:hidden;width:100%}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories{display:flex;flex-direction:column;margin-top:40px;width:100%}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list{margin-top:40px;width:100%}.miam-recipe-catalog .miam-recipe-catalog__returnTop{-webkit-tap-highlight-color:transparent;background-color:var(--m-color-primary);border-radius:var(--m-border-radius-circle);bottom:24px;box-shadow:0 2px 10px -4px var(--m-color-grey-text-dark);cursor:pointer;padding:8px;position:fixed;right:56px;transform:rotate(-180deg);z-index:var(--m-z-index-position-absolute-high)}@media (min-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal{background-color:rgba(0,36,61,.75);bottom:0;left:0;overflow:auto;position:fixed;right:0;top:0;z-index:4000}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback{background-color:#fff;border-radius:12px;height:220px;left:50%;position:fixed;top:35%;transform:translateX(-45%);width:400px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__icon-cross{position:absolute;right:8px;top:8px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__title{color:#1177bc;font-family:Overlock;font-size:24px;height:28px;margin-top:40px;text-align:center}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__question{color:#202020;font-family:Roboto;font-size:16px;height:20px;margin-top:26px;text-align:center}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions{display:flex;justify-content:center;margin-left:-30px;margin-top:46px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions>.m-feedback-button{align-items:center;background-color:#fff;border:0 solid #fff;border-radius:25px;color:#676767;display:flex;font-weight:700;height:36px;justify-content:center;margin-left:24px;min-width:72px;padding:12px 16px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions>.m-feedback-button:hover{align-items:center;background-color:#1177bc;border:0 solid #1177bc;border-radius:25px;color:#fff;display:flex;font-weight:700;height:36px;justify-content:center;margin-left:24px;min-width:72px;padding:12px 16px}}@media (max-width:1022px){.miam-recipe-catalog{max-width:100vw}.miam-recipe-catalog .miam-recipe-catalog__returnTop{bottom:72px;right:24px}.miam-recipe-catalog .miam-recipe-catalog__content{width:100%}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__user-feedback{margin-top:55px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories,.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list{margin-top:60px}.miam-recipe-catalog .miam-recipe-catalog__content:not(.filter-collapsed){display:none}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal{background-color:rgba(0,36,61,.75);bottom:0;left:0;overflow:auto;position:fixed;right:0;top:0;z-index:4000}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback{background-color:#fff;border-radius:24px 24px 0 0;bottom:0;height:220px;position:fixed;width:100%}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__icon-cross{position:absolute;right:8px;top:8px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__title{color:#1177bc;font-family:Overlock;font-size:24px;height:28px;margin-top:40px;text-align:center}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__question{color:#202020;font-family:Roboto;font-size:16px;height:20px;margin-top:26px;text-align:center}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions{display:flex;justify-content:center;margin-left:-30px;margin-top:46px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions>.m-feedback-button{align-items:center;background-color:#fff;border:0 solid #fff;border-radius:25px;color:#676767;display:flex;font-weight:700;height:36px;justify-content:center;margin-left:24px;min-width:72px;padding:12px 16px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions>.m-feedback-button:hover{align-items:center;background-color:#1177bc;border:0 solid #1177bc;border-radius:25px;color:#fff;display:flex;font-weight:700;height:36px;justify-content:center;margin-left:24px;min-width:72px;padding:12px 16px}}"], encapsulation: 2, changeDetection: 0 });
13508
+ }, styles: [".miam-recipe-catalog{display:flex;justify-content:space-between;width:100%}.miam-recipe-catalog .miam-recipe-catalog__content{width:calc(100% - 216px)}.miam-recipe-catalog .miam-recipe-catalog__content.filter-collapsed{overflow-x:hidden;width:100%}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories{display:flex;flex-direction:column;margin-top:40px;width:100%}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list{margin-top:40px;width:100%}.miam-recipe-catalog .miam-recipe-catalog__returnTop{-webkit-tap-highlight-color:transparent;background-color:var(--m-color-primary);border-radius:var(--m-border-radius-circle);bottom:24px;box-shadow:0 2px 10px -4px var(--m-color-grey-text-dark);cursor:pointer;padding:8px;position:fixed;right:56px;transform:rotate(-180deg);z-index:var(--m-z-index-position-absolute-high)}@media (min-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal{background-color:rgba(0,36,61,.75);bottom:0;left:0;overflow:auto;position:fixed;right:0;top:0;z-index:4000}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback{background-color:#fff;border-radius:12px;height:220px;left:50%;position:fixed;top:35%;transform:translateX(-45%);width:400px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__icon-cross{cursor:pointer;position:absolute;right:8px;top:8px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__title{color:#1177bc;font-family:Overlock;font-size:24px;height:28px;margin-top:40px;text-align:center}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__question{color:#202020;font-family:Roboto;font-size:16px;height:20px;margin-top:26px;text-align:center}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions{display:flex;justify-content:center;margin-left:-30px;margin-top:46px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions>.m-feedback-button{align-items:center;background-color:#fff;border:0 solid #fff;border-radius:25px;color:#676767;display:flex;font-weight:700;height:36px;justify-content:center;margin-left:24px;min-width:72px;padding:12px 16px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions>.m-feedback-button:hover{align-items:center;background-color:#1177bc;border:0 solid #1177bc;border-radius:25px;color:#fff;display:flex;font-weight:700;height:36px;justify-content:center;margin-left:24px;min-width:72px;padding:12px 16px}}@media (max-width:1022px){.miam-recipe-catalog{max-width:100vw}.miam-recipe-catalog .miam-recipe-catalog__returnTop{bottom:72px;right:24px}.miam-recipe-catalog .miam-recipe-catalog__content{width:100%}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__user-feedback{margin-top:55px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories,.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list{margin-top:60px}.miam-recipe-catalog .miam-recipe-catalog__content:not(.filter-collapsed){display:none}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal{background-color:rgba(0,36,61,.75);bottom:0;left:0;overflow:auto;position:fixed;right:0;top:0;z-index:4000}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback{background-color:#fff;border-radius:24px 24px 0 0;bottom:0;height:220px;position:fixed;width:100%}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__icon-cross{position:absolute;right:8px;top:8px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__title{color:#1177bc;font-family:Overlock;font-size:24px;height:28px;margin-top:40px;text-align:center}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__question{color:#202020;font-family:Roboto;font-size:16px;height:20px;margin-top:26px;text-align:center}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions{display:flex;justify-content:center;margin-left:-30px;margin-top:46px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions>.m-feedback-button{align-items:center;background-color:#fff;border:0 solid #fff;border-radius:25px;color:#676767;display:flex;font-weight:700;height:36px;justify-content:center;margin-left:24px;min-width:72px;padding:12px 16px}.miam-recipe-catalog .miam-recipe-catalog__content__user-feedback__modal .miam-recipe-catalog__content__user-feedback .miam-recipe-catalog__content__user-feedback__actions>.m-feedback-button:hover{align-items:center;background-color:#1177bc;border:0 solid #1177bc;border-radius:25px;color:#fff;display:flex;font-weight:700;height:36px;justify-content:center;margin-left:24px;min-width:72px;padding:12px 16px}}"], encapsulation: 2, changeDetection: 0 });
12762
13509
  /*@__PURE__*/ (function () {
12763
13510
  i0.ɵsetClassMetadata(RecipeCatalogComponent, [{
12764
13511
  type: i0.Component,
@@ -13150,7 +13897,7 @@
13150
13897
  }
13151
13898
  this.subscriptions.push(rxjs.forkJoin(this.entries.map(function (e) { return e.delete(); })).pipe(
13152
13899
  // Reload the basket to make sure the injector receives the update
13153
- operators.switchMap(function () { return _this.basketsService.loadBasket(); })).subscribe(function () { return _this.closed.emit(); }));
13900
+ operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe(function () { return _this.closed.emit(); }));
13154
13901
  };
13155
13902
  // Save modified entries, reload basket, and move to next step
13156
13903
  ListScanIngredientsListComponent.prototype.confirm = function () {
@@ -13161,7 +13908,7 @@
13161
13908
  this.subscriptions.push(rxjs.forkJoin(this.entries.map(function (e) {
13162
13909
  e.status = 'active'; // force reactivation of entry in case the name has changed (and was unavailable before)
13163
13910
  return e.save();
13164
- })).pipe(operators.switchMap(function () { return _this.basketsService.loadBasket(); })).subscribe(function () { return _this.confirmed.emit(); }));
13911
+ })).pipe(operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe(function () { return _this.confirmed.emit(); }));
13165
13912
  };
13166
13913
  return ListScanIngredientsListComponent;
13167
13914
  }());
@@ -13314,7 +14061,7 @@
13314
14061
  this.cdr.detectChanges();
13315
14062
  var e = line.record.groceriesEntry;
13316
14063
  this.entries.splice(this.entries.indexOf(e), 1);
13317
- this.subscriptions.push(e.delete().pipe(operators.switchMap(function () { return _this.basketsService.loadBasket(); })).subscribe());
14064
+ this.subscriptions.push(e.delete().pipe(operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe());
13318
14065
  };
13319
14066
  ListScanBasketPreviewComponent.prototype.toggleReplacing = function (line) {
13320
14067
  // Recalculate basket entry price to avoid JS errors...
@@ -14321,7 +15068,7 @@
14321
15068
  var _c1$e = ["mainContainer"];
14322
15069
  function RecipeDetailsComponent_div_0_img_6_Template(rf, ctx) {
14323
15070
  if (rf & 1) {
14324
- i0.ɵɵelement(0, "img", 41);
15071
+ i0.ɵɵelement(0, "img", 40);
14325
15072
  }
14326
15073
  if (rf & 2) {
14327
15074
  var ctx_r5 = i0.ɵɵnextContext(2);
@@ -14330,26 +15077,39 @@
14330
15077
  }
14331
15078
  function RecipeDetailsComponent_div_0_div_7_Template(rf, ctx) {
14332
15079
  if (rf & 1) {
14333
- i0.ɵɵelement(0, "div", 42);
15080
+ i0.ɵɵelement(0, "div", 41);
14334
15081
  }
14335
15082
  }
14336
15083
  function RecipeDetailsComponent_div_0_youtube_player_8_Template(rf, ctx) {
14337
15084
  if (rf & 1) {
14338
- i0.ɵɵelement(0, "youtube-player", 43);
15085
+ i0.ɵɵelement(0, "youtube-player", 42);
14339
15086
  }
14340
15087
  if (rf & 2) {
14341
15088
  var ctx_r7 = i0.ɵɵnextContext(2);
14342
15089
  i0.ɵɵproperty("videoId", ctx_r7.recipe.videoId)("width", ctx_r7.playerWidth)("height", ctx_r7.playerHeight);
14343
15090
  }
14344
15091
  }
14345
- function RecipeDetailsComponent_div_0_div_9_Template(rf, ctx) {
15092
+ function RecipeDetailsComponent_div_0_ng_container_9_div_1_Template(rf, ctx) {
14346
15093
  if (rf & 1) {
14347
15094
  i0.ɵɵelementStart(0, "div", 44);
14348
15095
  i0.ɵɵtext(1, "D\u00E9j\u00E0 ajout\u00E9e");
14349
15096
  i0.ɵɵelementEnd();
14350
15097
  }
14351
15098
  }
14352
- function RecipeDetailsComponent_div_0_ng_miam_like_button_12_Template(rf, ctx) {
15099
+ function RecipeDetailsComponent_div_0_ng_container_9_Template(rf, ctx) {
15100
+ if (rf & 1) {
15101
+ i0.ɵɵelementContainerStart(0);
15102
+ i0.ɵɵtemplate(1, RecipeDetailsComponent_div_0_ng_container_9_div_1_Template, 2, 0, "div", 43);
15103
+ i0.ɵɵpipe(2, "async");
15104
+ i0.ɵɵelementContainerEnd();
15105
+ }
15106
+ if (rf & 2) {
15107
+ var ctx_r8 = i0.ɵɵnextContext(2);
15108
+ i0.ɵɵadvance(1);
15109
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(2, 1, ctx_r8.groceriesListsService.recipeIsInList(ctx_r8.recipe == null ? null : ctx_r8.recipe.id)));
15110
+ }
15111
+ }
15112
+ function RecipeDetailsComponent_div_0_ng_miam_like_button_11_Template(rf, ctx) {
14353
15113
  if (rf & 1) {
14354
15114
  i0.ɵɵelement(0, "ng-miam-like-button", 45);
14355
15115
  }
@@ -14358,7 +15118,7 @@
14358
15118
  i0.ɵɵproperty("recipe", ctx_r9.recipe)("width", 26)("height", 26);
14359
15119
  }
14360
15120
  }
14361
- function RecipeDetailsComponent_div_0_img_16_Template(rf, ctx) {
15121
+ function RecipeDetailsComponent_div_0_img_15_Template(rf, ctx) {
14362
15122
  if (rf & 1) {
14363
15123
  i0.ɵɵelement(0, "img", 46);
14364
15124
  }
@@ -14367,7 +15127,7 @@
14367
15127
  i0.ɵɵpropertyInterpolate("src", ctx_r10.recipe.filigraneLogoUrl, i0.ɵɵsanitizeUrl);
14368
15128
  }
14369
15129
  }
14370
- function RecipeDetailsComponent_div_0_div_23_Template(rf, ctx) {
15130
+ function RecipeDetailsComponent_div_0_div_22_Template(rf, ctx) {
14371
15131
  if (rf & 1) {
14372
15132
  i0.ɵɵelementStart(0, "div", 47);
14373
15133
  i0.ɵɵelementStart(1, "span");
@@ -14389,7 +15149,7 @@
14389
15149
  i0.ɵɵtextInterpolate(ctx_r11.recipe == null ? null : ctx_r11.recipe.preparationTime);
14390
15150
  }
14391
15151
  }
14392
- function RecipeDetailsComponent_div_0_div_24_Template(rf, ctx) {
15152
+ function RecipeDetailsComponent_div_0_div_23_Template(rf, ctx) {
14393
15153
  if (rf & 1) {
14394
15154
  i0.ɵɵelementStart(0, "div", 47);
14395
15155
  i0.ɵɵelementStart(1, "span");
@@ -14411,7 +15171,7 @@
14411
15171
  i0.ɵɵtextInterpolate(ctx_r12.recipe == null ? null : ctx_r12.recipe.cookingTime);
14412
15172
  }
14413
15173
  }
14414
- function RecipeDetailsComponent_div_0_div_25_Template(rf, ctx) {
15174
+ function RecipeDetailsComponent_div_0_div_24_Template(rf, ctx) {
14415
15175
  if (rf & 1) {
14416
15176
  i0.ɵɵelementStart(0, "div", 47);
14417
15177
  i0.ɵɵelementStart(1, "span");
@@ -14433,7 +15193,7 @@
14433
15193
  i0.ɵɵtextInterpolate(ctx_r13.recipe == null ? null : ctx_r13.recipe.restingTime);
14434
15194
  }
14435
15195
  }
14436
- function RecipeDetailsComponent_div_0_ng_container_35_Template(rf, ctx) {
15196
+ function RecipeDetailsComponent_div_0_ng_container_34_Template(rf, ctx) {
14437
15197
  if (rf & 1) {
14438
15198
  i0.ɵɵelementContainerStart(0);
14439
15199
  i0.ɵɵelement(1, "ng-miam-icon", 50);
@@ -14445,7 +15205,7 @@
14445
15205
  i0.ɵɵproperty("width", 56)("height", 16)("iconName", ctx_r14.icon.DifficultyLow);
14446
15206
  }
14447
15207
  }
14448
- function RecipeDetailsComponent_div_0_ng_container_36_Template(rf, ctx) {
15208
+ function RecipeDetailsComponent_div_0_ng_container_35_Template(rf, ctx) {
14449
15209
  if (rf & 1) {
14450
15210
  i0.ɵɵelementContainerStart(0);
14451
15211
  i0.ɵɵelement(1, "ng-miam-icon", 50);
@@ -14457,7 +15217,7 @@
14457
15217
  i0.ɵɵproperty("width", 56)("height", 16)("iconName", ctx_r15.icon.DifficultyMedium);
14458
15218
  }
14459
15219
  }
14460
- function RecipeDetailsComponent_div_0_ng_container_37_Template(rf, ctx) {
15220
+ function RecipeDetailsComponent_div_0_ng_container_36_Template(rf, ctx) {
14461
15221
  if (rf & 1) {
14462
15222
  i0.ɵɵelementContainerStart(0);
14463
15223
  i0.ɵɵelement(1, "ng-miam-icon", 50);
@@ -14469,412 +15229,430 @@
14469
15229
  i0.ɵɵproperty("width", 56)("height", 16)("iconName", ctx_r16.icon.DifficultyHight);
14470
15230
  }
14471
15231
  }
14472
- function RecipeDetailsComponent_div_0_ng_container_38_Template(rf, ctx) {
15232
+ function RecipeDetailsComponent_div_0_ng_container_37_Template(rf, ctx) {
14473
15233
  if (rf & 1) {
14474
15234
  i0.ɵɵelementContainer(0);
14475
15235
  }
14476
15236
  }
14477
- function RecipeDetailsComponent_div_0_button_51_ng_miam_icon_5_Template(rf, ctx) {
15237
+ function RecipeDetailsComponent_div_0_div_48_Template(rf, ctx) {
15238
+ if (rf & 1) {
15239
+ i0.ɵɵelementStart(0, "div", 51);
15240
+ i0.ɵɵelement(1, "ng-miam-recipe-pricing", 52);
15241
+ i0.ɵɵelementEnd();
15242
+ }
15243
+ if (rf & 2) {
15244
+ var ctx_r18 = i0.ɵɵnextContext(2);
15245
+ i0.ɵɵadvance(1);
15246
+ i0.ɵɵproperty("recipe", ctx_r18.recipe)("serves", ctx_r18.recipe == null ? null : ctx_r18.recipe.modifiedGuests);
15247
+ }
15248
+ }
15249
+ function RecipeDetailsComponent_div_0_button_49_ng_miam_icon_5_Template(rf, ctx) {
14478
15250
  if (rf & 1) {
14479
- i0.ɵɵelement(0, "ng-miam-icon", 54);
15251
+ i0.ɵɵelement(0, "ng-miam-icon", 56);
14480
15252
  i0.ɵɵpipe(1, "async");
14481
15253
  }
14482
15254
  if (rf & 2) {
14483
- var ctx_r25 = i0.ɵɵnextContext(3);
14484
- var tmp_2_0 = null;
14485
- i0.ɵɵproperty("width", 24)("height", 24)("iconName", ((tmp_2_0 = i0.ɵɵpipeBind1(1, 3, ctx_r25.groceriesListsService.list$)) == null ? null : tmp_2_0.hasRecipe(ctx_r25.recipe == null ? null : ctx_r25.recipe.id)) ? ctx_r25.icon.CheckList : ctx_r25.icon.Cart);
15255
+ var ctx_r28 = i0.ɵɵnextContext(3);
15256
+ i0.ɵɵproperty("width", 24)("height", 24)("iconName", i0.ɵɵpipeBind1(1, 3, ctx_r28.groceriesListsService.recipeIsInList(ctx_r28.recipe == null ? null : ctx_r28.recipe.id)) ? ctx_r28.icon.CheckList : ctx_r28.icon.Cart);
14486
15257
  }
14487
15258
  }
14488
- function RecipeDetailsComponent_div_0_button_51_ng_template_6_Template(rf, ctx) {
15259
+ function RecipeDetailsComponent_div_0_button_49_ng_template_6_Template(rf, ctx) {
14489
15260
  if (rf & 1) {
14490
15261
  i0.ɵɵelement(0, "ng-miam-loader");
14491
15262
  }
14492
15263
  }
14493
15264
  var _c2$2 = function (a0, a1) { return { "in-basket": a0, "loading": a1 }; };
14494
- function RecipeDetailsComponent_div_0_button_51_Template(rf, ctx) {
15265
+ function RecipeDetailsComponent_div_0_button_49_Template(rf, ctx) {
14495
15266
  if (rf & 1) {
14496
- var _r29_1 = i0.ɵɵgetCurrentView();
14497
- i0.ɵɵelementStart(0, "button", 51);
14498
- i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_button_51_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r29_1); var ctx_r28 = i0.ɵɵnextContext(2); return ctx_r28.clickPrimary(); });
15267
+ var _r32_1 = i0.ɵɵgetCurrentView();
15268
+ i0.ɵɵelementStart(0, "button", 53);
15269
+ i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_button_49_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r32_1); var ctx_r31 = i0.ɵɵnextContext(2); return ctx_r31.clickPrimary(); });
14499
15270
  i0.ɵɵpipe(1, "async");
14500
15271
  i0.ɵɵelementStart(2, "span");
14501
15272
  i0.ɵɵtext(3);
14502
15273
  i0.ɵɵpipe(4, "async");
14503
15274
  i0.ɵɵelementEnd();
14504
- i0.ɵɵtemplate(5, RecipeDetailsComponent_div_0_button_51_ng_miam_icon_5_Template, 2, 5, "ng-miam-icon", 52);
14505
- i0.ɵɵtemplate(6, RecipeDetailsComponent_div_0_button_51_ng_template_6_Template, 1, 0, "ng-template", null, 53, i0.ɵɵtemplateRefExtractor);
15275
+ i0.ɵɵtemplate(5, RecipeDetailsComponent_div_0_button_49_ng_miam_icon_5_Template, 2, 5, "ng-miam-icon", 54);
15276
+ i0.ɵɵtemplate(6, RecipeDetailsComponent_div_0_button_49_ng_template_6_Template, 1, 0, "ng-template", null, 55, i0.ɵɵtemplateRefExtractor);
14506
15277
  i0.ɵɵelementEnd();
14507
15278
  }
14508
15279
  if (rf & 2) {
14509
- var _r26 = i0.ɵɵreference(7);
14510
- var ctx_r18 = i0.ɵɵnextContext(2);
14511
- var tmp_0_0 = null;
14512
- var tmp_1_0 = null;
14513
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(8, _c2$2, (tmp_0_0 = i0.ɵɵpipeBind1(1, 4, ctx_r18.groceriesListsService.list$)) == null ? null : tmp_0_0.hasRecipe(ctx_r18.recipe == null ? null : ctx_r18.recipe.id), ctx_r18.addButtonLoading));
15280
+ var _r29 = i0.ɵɵreference(7);
15281
+ var ctx_r19 = i0.ɵɵnextContext(2);
15282
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(8, _c2$2, i0.ɵɵpipeBind1(1, 4, ctx_r19.groceriesListsService.recipeIsInList(ctx_r19.recipe == null ? null : ctx_r19.recipe.id)), ctx_r19.addButtonLoading));
14514
15283
  i0.ɵɵadvance(3);
14515
- i0.ɵɵtextInterpolate1(" ", ((tmp_1_0 = i0.ɵɵpipeBind1(4, 6, ctx_r18.groceriesListsService.list$)) == null ? null : tmp_1_0.hasRecipe(ctx_r18.recipe == null ? null : ctx_r18.recipe.id)) ? "Voir le d\u00E9tail" : "S\u00E9lectionner ce repas", " ");
15284
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 6, ctx_r19.groceriesListsService.recipeIsInList(ctx_r19.recipe == null ? null : ctx_r19.recipe.id)) ? "Voir le d\u00E9tail" : "S\u00E9lectionner ce repas", " ");
14516
15285
  i0.ɵɵadvance(2);
14517
- i0.ɵɵproperty("ngIf", !ctx_r18.addButtonLoading)("ngIfElse", _r26);
15286
+ i0.ɵɵproperty("ngIf", !ctx_r19.addButtonLoading)("ngIfElse", _r29);
14518
15287
  }
14519
15288
  }
14520
- function RecipeDetailsComponent_div_0_div_53_div_1_img_1_Template(rf, ctx) {
15289
+ function RecipeDetailsComponent_div_0_div_51_div_1_img_1_Template(rf, ctx) {
14521
15290
  if (rf & 1) {
14522
- i0.ɵɵelement(0, "img", 60);
15291
+ i0.ɵɵelement(0, "img", 62);
14523
15292
  }
14524
15293
  if (rf & 2) {
14525
- var tag_r31 = i0.ɵɵnextContext().$implicit;
14526
- i0.ɵɵproperty("src", tag_r31.attributes.icon, i0.ɵɵsanitizeUrl);
15294
+ var tag_r34 = i0.ɵɵnextContext().$implicit;
15295
+ i0.ɵɵproperty("src", tag_r34.attributes.icon, i0.ɵɵsanitizeUrl);
14527
15296
  }
14528
15297
  }
14529
- function RecipeDetailsComponent_div_0_div_53_div_1_Template(rf, ctx) {
15298
+ function RecipeDetailsComponent_div_0_div_51_div_1_Template(rf, ctx) {
14530
15299
  if (rf & 1) {
14531
- i0.ɵɵelementStart(0, "div", 57);
14532
- i0.ɵɵtemplate(1, RecipeDetailsComponent_div_0_div_53_div_1_img_1_Template, 1, 1, "img", 58);
14533
- i0.ɵɵelementStart(2, "span", 59);
15300
+ i0.ɵɵelementStart(0, "div", 59);
15301
+ i0.ɵɵtemplate(1, RecipeDetailsComponent_div_0_div_51_div_1_img_1_Template, 1, 1, "img", 60);
15302
+ i0.ɵɵelementStart(2, "span", 61);
14534
15303
  i0.ɵɵtext(3);
14535
15304
  i0.ɵɵelementEnd();
14536
15305
  i0.ɵɵelementEnd();
14537
15306
  }
14538
15307
  if (rf & 2) {
14539
- var tag_r31 = ctx.$implicit;
14540
- var ctx_r30 = i0.ɵɵnextContext(3);
15308
+ var tag_r34 = ctx.$implicit;
15309
+ var ctx_r33 = i0.ɵɵnextContext(3);
14541
15310
  i0.ɵɵadvance(1);
14542
- i0.ɵɵproperty("ngIf", ctx_r30.displayTagsIcons);
15311
+ i0.ɵɵproperty("ngIf", ctx_r33.displayTagsIcons);
14543
15312
  i0.ɵɵadvance(2);
14544
- i0.ɵɵtextInterpolate1(" ", tag_r31.name, " ");
15313
+ i0.ɵɵtextInterpolate1(" ", tag_r34.name, " ");
14545
15314
  }
14546
15315
  }
14547
- function RecipeDetailsComponent_div_0_div_53_Template(rf, ctx) {
15316
+ function RecipeDetailsComponent_div_0_div_51_Template(rf, ctx) {
14548
15317
  if (rf & 1) {
14549
- i0.ɵɵelementStart(0, "div", 55);
14550
- i0.ɵɵtemplate(1, RecipeDetailsComponent_div_0_div_53_div_1_Template, 4, 2, "div", 56);
15318
+ i0.ɵɵelementStart(0, "div", 57);
15319
+ i0.ɵɵtemplate(1, RecipeDetailsComponent_div_0_div_51_div_1_Template, 4, 2, "div", 58);
14551
15320
  i0.ɵɵelementEnd();
14552
15321
  }
14553
15322
  if (rf & 2) {
14554
- var ctx_r19 = i0.ɵɵnextContext(2);
15323
+ var ctx_r20 = i0.ɵɵnextContext(2);
14555
15324
  i0.ɵɵadvance(1);
14556
- i0.ɵɵproperty("ngForOf", ctx_r19.recipe.relationships.tags.data);
15325
+ i0.ɵɵproperty("ngForOf", ctx_r20.recipe.relationships.tags.data);
14557
15326
  }
14558
15327
  }
14559
- function RecipeDetailsComponent_div_0_ng_miam_addon_link_55_Template(rf, ctx) {
15328
+ function RecipeDetailsComponent_div_0_ng_miam_addon_link_53_Template(rf, ctx) {
14560
15329
  if (rf & 1) {
14561
- var _r35_1 = i0.ɵɵgetCurrentView();
14562
- i0.ɵɵelementStart(0, "ng-miam-addon-link", 61);
14563
- i0.ɵɵlistener("showAddon", function RecipeDetailsComponent_div_0_ng_miam_addon_link_55_Template_ng_miam_addon_link_showAddon_0_listener() { i0.ɵɵrestoreView(_r35_1); var ctx_r34 = i0.ɵɵnextContext(2); return ctx_r34.toggleAddon(); });
15330
+ var _r38_1 = i0.ɵɵgetCurrentView();
15331
+ i0.ɵɵelementStart(0, "ng-miam-addon-link", 63);
15332
+ i0.ɵɵlistener("showAddon", function RecipeDetailsComponent_div_0_ng_miam_addon_link_53_Template_ng_miam_addon_link_showAddon_0_listener() { i0.ɵɵrestoreView(_r38_1); var ctx_r37 = i0.ɵɵnextContext(2); return ctx_r37.toggleAddon(); });
14564
15333
  i0.ɵɵelementEnd();
14565
15334
  }
14566
15335
  if (rf & 2) {
14567
- var ctx_r20 = i0.ɵɵnextContext(2);
14568
- i0.ɵɵproperty("recipe", ctx_r20.recipe);
15336
+ var ctx_r21 = i0.ɵɵnextContext(2);
15337
+ i0.ɵɵproperty("recipe", ctx_r21.recipe);
14569
15338
  }
14570
15339
  }
14571
- function RecipeDetailsComponent_div_0_div_56_div_12_div_1_Template(rf, ctx) {
15340
+ function RecipeDetailsComponent_div_0_div_54_div_12_div_1_Template(rf, ctx) {
14572
15341
  if (rf & 1) {
14573
15342
  i0.ɵɵelementStart(0, "div");
14574
- i0.ɵɵelement(1, "img", 77);
15343
+ i0.ɵɵelement(1, "img", 78);
14575
15344
  i0.ɵɵelementEnd();
14576
15345
  }
14577
15346
  if (rf & 2) {
14578
- var ingredient_r38 = i0.ɵɵnextContext().$implicit;
14579
- var ctx_r40 = i0.ɵɵnextContext(3);
15347
+ var ingredient_r41 = i0.ɵɵnextContext().$implicit;
15348
+ var ctx_r43 = i0.ɵɵnextContext(3);
14580
15349
  i0.ɵɵadvance(1);
14581
- i0.ɵɵproperty("src", ctx_r40.ingredientPicture(ingredient_r38), i0.ɵɵsanitizeUrl);
15350
+ i0.ɵɵproperty("src", ctx_r43.ingredientPicture(ingredient_r41), i0.ɵɵsanitizeUrl);
14582
15351
  }
14583
15352
  }
14584
15353
  var _c3$1 = function (a0) { return { "checked": a0 }; };
14585
- function RecipeDetailsComponent_div_0_div_56_div_12_Template(rf, ctx) {
15354
+ function RecipeDetailsComponent_div_0_div_54_div_12_Template(rf, ctx) {
14586
15355
  if (rf & 1) {
14587
- i0.ɵɵelementStart(0, "div", 75);
14588
- i0.ɵɵtemplate(1, RecipeDetailsComponent_div_0_div_56_div_12_div_1_Template, 2, 1, "div", 76);
15356
+ i0.ɵɵelementStart(0, "div", 77);
15357
+ i0.ɵɵtemplate(1, RecipeDetailsComponent_div_0_div_54_div_12_div_1_Template, 2, 1, "div", 11);
14589
15358
  i0.ɵɵelementStart(2, "div");
14590
15359
  i0.ɵɵtext(3);
14591
15360
  i0.ɵɵpipe(4, "capitalizeFirstLetter");
14592
15361
  i0.ɵɵelementEnd();
14593
- i0.ɵɵelementStart(5, "div", 69);
15362
+ i0.ɵɵelementStart(5, "div", 71);
14594
15363
  i0.ɵɵtext(6);
14595
15364
  i0.ɵɵpipe(7, "readableFloatNumber");
14596
15365
  i0.ɵɵelementEnd();
14597
15366
  i0.ɵɵelementEnd();
14598
15367
  }
14599
15368
  if (rf & 2) {
14600
- var ingredient_r38 = ctx.$implicit;
14601
- var i_r39 = ctx.index;
14602
- var ctx_r36 = i0.ɵɵnextContext(3);
14603
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c3$1, ctx_r36.ingredientsChecked[i_r39]));
15369
+ var ingredient_r41 = ctx.$implicit;
15370
+ var i_r42 = ctx.index;
15371
+ var ctx_r39 = i0.ɵɵnextContext(3);
15372
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c3$1, ctx_r39.ingredientsChecked[i_r42]));
14604
15373
  i0.ɵɵadvance(1);
14605
- i0.ɵɵproperty("ngIf", ctx_r36.ingredientsPictures);
15374
+ i0.ɵɵproperty("ngIf", ctx_r39.ingredientsPictures);
14606
15375
  i0.ɵɵadvance(2);
14607
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 4, ingredient_r38.name), "");
15376
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 4, ingredient_r41.name), "");
14608
15377
  i0.ɵɵadvance(3);
14609
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(7, 6, ingredient_r38.qty, ingredient_r38.unit), "");
15378
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(7, 6, ingredient_r41.qty, ingredient_r41.unit), "");
14610
15379
  }
14611
15380
  }
14612
- function RecipeDetailsComponent_div_0_div_56_div_17_ng_miam_icon_6_Template(rf, ctx) {
15381
+ function RecipeDetailsComponent_div_0_div_54_div_17_ng_miam_icon_6_Template(rf, ctx) {
14613
15382
  if (rf & 1) {
14614
- i0.ɵɵelement(0, "ng-miam-icon", 82);
15383
+ i0.ɵɵelement(0, "ng-miam-icon", 83);
14615
15384
  }
14616
15385
  if (rf & 2) {
14617
- var ctx_r44 = i0.ɵɵnextContext(4);
14618
- i0.ɵɵproperty("height", 16)("width", 16)("iconName", ctx_r44.icon.CheckCircleFill);
15386
+ var ctx_r47 = i0.ɵɵnextContext(4);
15387
+ i0.ɵɵproperty("height", 16)("width", 16)("iconName", ctx_r47.icon.CheckCircleFill);
14619
15388
  }
14620
15389
  }
14621
- function RecipeDetailsComponent_div_0_div_56_div_17_Template(rf, ctx) {
15390
+ function RecipeDetailsComponent_div_0_div_54_div_17_Template(rf, ctx) {
14622
15391
  if (rf & 1) {
14623
- var _r46_1 = i0.ɵɵgetCurrentView();
14624
- i0.ɵɵelementStart(0, "div", 78);
14625
- i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_56_div_17_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r46_1); var i_r43 = ctx.index; var ctx_r45 = i0.ɵɵnextContext(3); return ctx_r45.changeActiveStep(i_r43); });
14626
- i0.ɵɵelementStart(1, "div", 79);
15392
+ var _r49_1 = i0.ɵɵgetCurrentView();
15393
+ i0.ɵɵelementStart(0, "div", 79);
15394
+ i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_54_div_17_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r49_1); var i_r46 = ctx.index; var ctx_r48 = i0.ɵɵnextContext(3); return ctx_r48.changeActiveStep(i_r46); });
15395
+ i0.ɵɵelementStart(1, "div", 80);
14627
15396
  i0.ɵɵelementStart(2, "strong");
14628
15397
  i0.ɵɵtext(3);
14629
15398
  i0.ɵɵelementEnd();
14630
15399
  i0.ɵɵelementEnd();
14631
- i0.ɵɵelementStart(4, "div", 80);
15400
+ i0.ɵɵelementStart(4, "div", 81);
14632
15401
  i0.ɵɵtext(5);
14633
15402
  i0.ɵɵelementEnd();
14634
- i0.ɵɵtemplate(6, RecipeDetailsComponent_div_0_div_56_div_17_ng_miam_icon_6_Template, 1, 3, "ng-miam-icon", 81);
15403
+ i0.ɵɵtemplate(6, RecipeDetailsComponent_div_0_div_54_div_17_ng_miam_icon_6_Template, 1, 3, "ng-miam-icon", 82);
14635
15404
  i0.ɵɵelementEnd();
14636
15405
  }
14637
15406
  if (rf & 2) {
14638
- var step_r42 = ctx.$implicit;
14639
- var i_r43 = ctx.index;
14640
- var ctx_r37 = i0.ɵɵnextContext(3);
14641
- i0.ɵɵclassProp("active", i_r43 === ctx_r37.activeStep)("miam-recipe-details__panel__done", i_r43 < ctx_r37.activeStep);
15407
+ var step_r45 = ctx.$implicit;
15408
+ var i_r46 = ctx.index;
15409
+ var ctx_r40 = i0.ɵɵnextContext(3);
15410
+ i0.ɵɵclassProp("active", i_r46 === ctx_r40.activeStep)("miam-recipe-details__panel__done", i_r46 < ctx_r40.activeStep);
14642
15411
  i0.ɵɵadvance(3);
14643
- i0.ɵɵtextInterpolate(i_r43 + 1);
15412
+ i0.ɵɵtextInterpolate(i_r46 + 1);
14644
15413
  i0.ɵɵadvance(2);
14645
- i0.ɵɵtextInterpolate(step_r42 == null ? null : step_r42.attributes == null ? null : step_r42.attributes.description);
15414
+ i0.ɵɵtextInterpolate(step_r45 == null ? null : step_r45.attributes == null ? null : step_r45.attributes.description);
14646
15415
  i0.ɵɵadvance(1);
14647
- i0.ɵɵproperty("ngIf", i_r43 <= ctx_r37.activeStep);
15416
+ i0.ɵɵproperty("ngIf", i_r46 <= ctx_r40.activeStep);
14648
15417
  }
14649
15418
  }
14650
- function RecipeDetailsComponent_div_0_div_56_Template(rf, ctx) {
15419
+ function RecipeDetailsComponent_div_0_div_54_Template(rf, ctx) {
14651
15420
  if (rf & 1) {
14652
- var _r48_1 = i0.ɵɵgetCurrentView();
14653
- i0.ɵɵelementStart(0, "div", 62);
14654
- i0.ɵɵelementStart(1, "div", 63);
14655
- i0.ɵɵelementStart(2, "div", 64);
15421
+ var _r51_1 = i0.ɵɵgetCurrentView();
15422
+ i0.ɵɵelementStart(0, "div", 64);
15423
+ i0.ɵɵelementStart(1, "div", 65);
15424
+ i0.ɵɵelementStart(2, "div", 66);
14656
15425
  i0.ɵɵtext(3, " Ingr\u00E9dients ");
14657
15426
  i0.ɵɵelementEnd();
14658
- i0.ɵɵelementStart(4, "div", 65);
14659
- i0.ɵɵelementStart(5, "div", 66);
14660
- i0.ɵɵelementStart(6, "ng-miam-counter-input", 67);
14661
- i0.ɵɵlistener("counterChange", function RecipeDetailsComponent_div_0_div_56_Template_ng_miam_counter_input_counterChange_6_listener($event) { i0.ɵɵrestoreView(_r48_1); var ctx_r47 = i0.ɵɵnextContext(2); return ctx_r47.updateGuests($event); });
15427
+ i0.ɵɵelementStart(4, "div", 67);
15428
+ i0.ɵɵelementStart(5, "div", 68);
15429
+ i0.ɵɵelementStart(6, "ng-miam-counter-input", 69);
15430
+ i0.ɵɵlistener("counterChange", function RecipeDetailsComponent_div_0_div_54_Template_ng_miam_counter_input_counterChange_6_listener($event) { i0.ɵɵrestoreView(_r51_1); var ctx_r50 = i0.ɵɵnextContext(2); return ctx_r50.updateGuests($event); });
14662
15431
  i0.ɵɵelementEnd();
14663
- i0.ɵɵelementStart(7, "span", 68);
15432
+ i0.ɵɵelementStart(7, "span", 70);
14664
15433
  i0.ɵɵtext(8);
14665
15434
  i0.ɵɵelementEnd();
14666
15435
  i0.ɵɵelementEnd();
14667
- i0.ɵɵelementStart(9, "span", 69);
15436
+ i0.ɵɵelementStart(9, "span", 71);
14668
15437
  i0.ɵɵtext(10, "Quantit\u00E9");
14669
15438
  i0.ɵɵelementEnd();
14670
15439
  i0.ɵɵelementEnd();
14671
- i0.ɵɵelementStart(11, "div", 70);
14672
- i0.ɵɵtemplate(12, RecipeDetailsComponent_div_0_div_56_div_12_Template, 8, 11, "div", 71);
15440
+ i0.ɵɵelementStart(11, "div", 72);
15441
+ i0.ɵɵtemplate(12, RecipeDetailsComponent_div_0_div_54_div_12_Template, 8, 11, "div", 73);
14673
15442
  i0.ɵɵelementEnd();
14674
15443
  i0.ɵɵelementEnd();
14675
- i0.ɵɵelementStart(13, "div", 72);
14676
- i0.ɵɵelementStart(14, "div", 64);
15444
+ i0.ɵɵelementStart(13, "div", 74);
15445
+ i0.ɵɵelementStart(14, "div", 66);
14677
15446
  i0.ɵɵtext(15, " Pr\u00E9paration ");
14678
15447
  i0.ɵɵelementEnd();
14679
- i0.ɵɵelementStart(16, "div", 73);
14680
- i0.ɵɵtemplate(17, RecipeDetailsComponent_div_0_div_56_div_17_Template, 7, 7, "div", 74);
15448
+ i0.ɵɵelementStart(16, "div", 75);
15449
+ i0.ɵɵtemplate(17, RecipeDetailsComponent_div_0_div_54_div_17_Template, 7, 7, "div", 76);
14681
15450
  i0.ɵɵelementEnd();
14682
15451
  i0.ɵɵelementEnd();
14683
15452
  i0.ɵɵelementEnd();
14684
15453
  }
14685
15454
  if (rf & 2) {
14686
- var ctx_r21 = i0.ɵɵnextContext(2);
15455
+ var ctx_r22 = i0.ɵɵnextContext(2);
14687
15456
  i0.ɵɵadvance(6);
14688
- i0.ɵɵproperty("counter", (ctx_r21.recipe == null ? null : ctx_r21.recipe.modifiedGuests) || ctx_r21.recipe.guests);
15457
+ i0.ɵɵproperty("counter", (ctx_r22.recipe == null ? null : ctx_r22.recipe.modifiedGuests) || ctx_r22.recipe.guests);
14689
15458
  i0.ɵɵadvance(2);
14690
- i0.ɵɵtextInterpolate1("Pour ", ctx_r21.recipe == null ? null : ctx_r21.recipe.modifiedGuests, " personnes");
15459
+ i0.ɵɵtextInterpolate1("Pour ", ctx_r22.recipe == null ? null : ctx_r22.recipe.modifiedGuests, " personnes");
14691
15460
  i0.ɵɵadvance(4);
14692
- i0.ɵɵproperty("ngForOf", ctx_r21.recipe == null ? null : ctx_r21.recipe.modifiedIngredients);
15461
+ i0.ɵɵproperty("ngForOf", ctx_r22.recipe == null ? null : ctx_r22.recipe.modifiedIngredients);
14693
15462
  i0.ɵɵadvance(5);
14694
- i0.ɵɵproperty("ngForOf", ctx_r21.steps);
15463
+ i0.ɵɵproperty("ngForOf", ctx_r22.steps);
14695
15464
  }
14696
15465
  }
14697
- function RecipeDetailsComponent_div_0_ng_template_57_ng_container_7_div_9_Template(rf, ctx) {
15466
+ function RecipeDetailsComponent_div_0_ng_template_55_ng_container_7_div_9_Template(rf, ctx) {
14698
15467
  if (rf & 1) {
14699
- i0.ɵɵelementStart(0, "div", 75);
15468
+ i0.ɵɵelementStart(0, "div", 77);
14700
15469
  i0.ɵɵelementStart(1, "div");
14701
15470
  i0.ɵɵtext(2);
14702
15471
  i0.ɵɵpipe(3, "capitalizeFirstLetter");
14703
15472
  i0.ɵɵelementEnd();
14704
- i0.ɵɵelementStart(4, "div", 69);
15473
+ i0.ɵɵelementStart(4, "div", 71);
14705
15474
  i0.ɵɵtext(5);
14706
15475
  i0.ɵɵpipe(6, "readableFloatNumber");
14707
15476
  i0.ɵɵelementEnd();
14708
15477
  i0.ɵɵelementEnd();
14709
15478
  }
14710
15479
  if (rf & 2) {
14711
- var ingredient_r54 = ctx.$implicit;
14712
- var i_r55 = ctx.index;
14713
- var ctx_r53 = i0.ɵɵnextContext(4);
14714
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c3$1, ctx_r53.ingredientsChecked[i_r55]));
15480
+ var ingredient_r57 = ctx.$implicit;
15481
+ var i_r58 = ctx.index;
15482
+ var ctx_r56 = i0.ɵɵnextContext(4);
15483
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c3$1, ctx_r56.ingredientsChecked[i_r58]));
14715
15484
  i0.ɵɵadvance(2);
14716
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 3, ingredient_r54.name), "");
15485
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 3, ingredient_r57.name), "");
14717
15486
  i0.ɵɵadvance(3);
14718
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(6, 5, ingredient_r54.qty, ingredient_r54.unit), "");
15487
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(6, 5, ingredient_r57.qty, ingredient_r57.unit), "");
14719
15488
  }
14720
15489
  }
14721
- function RecipeDetailsComponent_div_0_ng_template_57_ng_container_7_Template(rf, ctx) {
15490
+ function RecipeDetailsComponent_div_0_ng_template_55_ng_container_7_Template(rf, ctx) {
14722
15491
  if (rf & 1) {
14723
- var _r57_1 = i0.ɵɵgetCurrentView();
15492
+ var _r60_1 = i0.ɵɵgetCurrentView();
14724
15493
  i0.ɵɵelementContainerStart(0);
14725
- i0.ɵɵelementStart(1, "div", 65);
14726
- i0.ɵɵelementStart(2, "div", 66);
14727
- i0.ɵɵelementStart(3, "ng-miam-counter-input", 67);
14728
- i0.ɵɵlistener("counterChange", function RecipeDetailsComponent_div_0_ng_template_57_ng_container_7_Template_ng_miam_counter_input_counterChange_3_listener($event) { i0.ɵɵrestoreView(_r57_1); var ctx_r56 = i0.ɵɵnextContext(3); return ctx_r56.updateGuests($event); });
15494
+ i0.ɵɵelementStart(1, "div", 67);
15495
+ i0.ɵɵelementStart(2, "div", 68);
15496
+ i0.ɵɵelementStart(3, "ng-miam-counter-input", 69);
15497
+ i0.ɵɵlistener("counterChange", function RecipeDetailsComponent_div_0_ng_template_55_ng_container_7_Template_ng_miam_counter_input_counterChange_3_listener($event) { i0.ɵɵrestoreView(_r60_1); var ctx_r59 = i0.ɵɵnextContext(3); return ctx_r59.updateGuests($event); });
14729
15498
  i0.ɵɵelementEnd();
14730
- i0.ɵɵelementStart(4, "span", 68);
15499
+ i0.ɵɵelementStart(4, "span", 70);
14731
15500
  i0.ɵɵtext(5);
14732
15501
  i0.ɵɵelementEnd();
14733
15502
  i0.ɵɵelementEnd();
14734
- i0.ɵɵelementStart(6, "span", 69);
15503
+ i0.ɵɵelementStart(6, "span", 71);
14735
15504
  i0.ɵɵtext(7, "Quantit\u00E9");
14736
15505
  i0.ɵɵelementEnd();
14737
15506
  i0.ɵɵelementEnd();
14738
- i0.ɵɵelementStart(8, "div", 70);
14739
- i0.ɵɵtemplate(9, RecipeDetailsComponent_div_0_ng_template_57_ng_container_7_div_9_Template, 7, 10, "div", 71);
15507
+ i0.ɵɵelementStart(8, "div", 72);
15508
+ i0.ɵɵtemplate(9, RecipeDetailsComponent_div_0_ng_template_55_ng_container_7_div_9_Template, 7, 10, "div", 73);
14740
15509
  i0.ɵɵelementEnd();
14741
15510
  i0.ɵɵelementContainerEnd();
14742
15511
  }
14743
15512
  if (rf & 2) {
14744
- var ctx_r50 = i0.ɵɵnextContext(3);
15513
+ var ctx_r53 = i0.ɵɵnextContext(3);
14745
15514
  i0.ɵɵadvance(3);
14746
- i0.ɵɵproperty("counter", ctx_r50.recipe == null ? null : ctx_r50.recipe.modifiedGuests);
15515
+ i0.ɵɵproperty("counter", ctx_r53.recipe == null ? null : ctx_r53.recipe.modifiedGuests);
14747
15516
  i0.ɵɵadvance(2);
14748
- i0.ɵɵtextInterpolate1("Pour ", ctx_r50.recipe == null ? null : ctx_r50.recipe.modifiedGuests, " personnes");
15517
+ i0.ɵɵtextInterpolate1("Pour ", ctx_r53.recipe == null ? null : ctx_r53.recipe.modifiedGuests, " personnes");
14749
15518
  i0.ɵɵadvance(4);
14750
- i0.ɵɵproperty("ngForOf", ctx_r50.recipe == null ? null : ctx_r50.recipe.modifiedIngredients);
15519
+ i0.ɵɵproperty("ngForOf", ctx_r53.recipe == null ? null : ctx_r53.recipe.modifiedIngredients);
14751
15520
  }
14752
15521
  }
14753
- function RecipeDetailsComponent_div_0_ng_template_57_ng_template_8_div_1_ng_miam_icon_6_Template(rf, ctx) {
15522
+ function RecipeDetailsComponent_div_0_ng_template_55_ng_template_8_div_1_ng_miam_icon_6_Template(rf, ctx) {
14754
15523
  if (rf & 1) {
14755
- i0.ɵɵelement(0, "ng-miam-icon", 82);
15524
+ i0.ɵɵelement(0, "ng-miam-icon", 83);
14756
15525
  }
14757
15526
  if (rf & 2) {
14758
- var ctx_r61 = i0.ɵɵnextContext(5);
14759
- i0.ɵɵproperty("height", 16)("width", 16)("iconName", ctx_r61.icon.CheckCircleFill);
15527
+ var ctx_r64 = i0.ɵɵnextContext(5);
15528
+ i0.ɵɵproperty("height", 16)("width", 16)("iconName", ctx_r64.icon.CheckCircleFill);
14760
15529
  }
14761
15530
  }
14762
- function RecipeDetailsComponent_div_0_ng_template_57_ng_template_8_div_1_Template(rf, ctx) {
15531
+ function RecipeDetailsComponent_div_0_ng_template_55_ng_template_8_div_1_Template(rf, ctx) {
14763
15532
  if (rf & 1) {
14764
- var _r63_1 = i0.ɵɵgetCurrentView();
14765
- i0.ɵɵelementStart(0, "div", 78);
14766
- i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_ng_template_57_ng_template_8_div_1_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r63_1); var i_r60 = ctx.index; var ctx_r62 = i0.ɵɵnextContext(4); return ctx_r62.changeActiveStep(i_r60); });
14767
- i0.ɵɵelementStart(1, "div", 79);
15533
+ var _r66_1 = i0.ɵɵgetCurrentView();
15534
+ i0.ɵɵelementStart(0, "div", 79);
15535
+ i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_ng_template_55_ng_template_8_div_1_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r66_1); var i_r63 = ctx.index; var ctx_r65 = i0.ɵɵnextContext(4); return ctx_r65.changeActiveStep(i_r63); });
15536
+ i0.ɵɵelementStart(1, "div", 80);
14768
15537
  i0.ɵɵelementStart(2, "strong");
14769
15538
  i0.ɵɵtext(3);
14770
15539
  i0.ɵɵelementEnd();
14771
15540
  i0.ɵɵelementEnd();
14772
- i0.ɵɵelementStart(4, "div", 80);
15541
+ i0.ɵɵelementStart(4, "div", 81);
14773
15542
  i0.ɵɵtext(5);
14774
15543
  i0.ɵɵelementEnd();
14775
- i0.ɵɵtemplate(6, RecipeDetailsComponent_div_0_ng_template_57_ng_template_8_div_1_ng_miam_icon_6_Template, 1, 3, "ng-miam-icon", 81);
15544
+ i0.ɵɵtemplate(6, RecipeDetailsComponent_div_0_ng_template_55_ng_template_8_div_1_ng_miam_icon_6_Template, 1, 3, "ng-miam-icon", 82);
14776
15545
  i0.ɵɵelementEnd();
14777
15546
  }
14778
15547
  if (rf & 2) {
14779
- var step_r59 = ctx.$implicit;
14780
- var i_r60 = ctx.index;
14781
- var ctx_r58 = i0.ɵɵnextContext(4);
14782
- i0.ɵɵclassProp("active", i_r60 === ctx_r58.activeStep)("miam-recipe-details__panel__done", i_r60 < ctx_r58.activeStep);
15548
+ var step_r62 = ctx.$implicit;
15549
+ var i_r63 = ctx.index;
15550
+ var ctx_r61 = i0.ɵɵnextContext(4);
15551
+ i0.ɵɵclassProp("active", i_r63 === ctx_r61.activeStep)("miam-recipe-details__panel__done", i_r63 < ctx_r61.activeStep);
14783
15552
  i0.ɵɵadvance(3);
14784
- i0.ɵɵtextInterpolate(i_r60 + 1);
15553
+ i0.ɵɵtextInterpolate(i_r63 + 1);
14785
15554
  i0.ɵɵadvance(2);
14786
- i0.ɵɵtextInterpolate(step_r59 == null ? null : step_r59.attributes == null ? null : step_r59.attributes.description);
15555
+ i0.ɵɵtextInterpolate(step_r62 == null ? null : step_r62.attributes == null ? null : step_r62.attributes.description);
14787
15556
  i0.ɵɵadvance(1);
14788
- i0.ɵɵproperty("ngIf", i_r60 <= ctx_r58.activeStep);
15557
+ i0.ɵɵproperty("ngIf", i_r63 <= ctx_r61.activeStep);
14789
15558
  }
14790
15559
  }
14791
- function RecipeDetailsComponent_div_0_ng_template_57_ng_template_8_Template(rf, ctx) {
15560
+ function RecipeDetailsComponent_div_0_ng_template_55_ng_template_8_Template(rf, ctx) {
14792
15561
  if (rf & 1) {
14793
- i0.ɵɵelementStart(0, "div", 73);
14794
- i0.ɵɵtemplate(1, RecipeDetailsComponent_div_0_ng_template_57_ng_template_8_div_1_Template, 7, 7, "div", 74);
15562
+ i0.ɵɵelementStart(0, "div", 75);
15563
+ i0.ɵɵtemplate(1, RecipeDetailsComponent_div_0_ng_template_55_ng_template_8_div_1_Template, 7, 7, "div", 76);
14795
15564
  i0.ɵɵelementEnd();
14796
15565
  }
14797
15566
  if (rf & 2) {
14798
- var ctx_r52 = i0.ɵɵnextContext(3);
15567
+ var ctx_r55 = i0.ɵɵnextContext(3);
14799
15568
  i0.ɵɵadvance(1);
14800
- i0.ɵɵproperty("ngForOf", ctx_r52.steps);
15569
+ i0.ɵɵproperty("ngForOf", ctx_r55.steps);
14801
15570
  }
14802
15571
  }
14803
15572
  var _c4 = function (a0) { return { "active": a0 }; };
14804
- function RecipeDetailsComponent_div_0_ng_template_57_Template(rf, ctx) {
15573
+ function RecipeDetailsComponent_div_0_ng_template_55_Template(rf, ctx) {
14805
15574
  if (rf & 1) {
14806
- var _r65_1 = i0.ɵɵgetCurrentView();
14807
- i0.ɵɵelementStart(0, "div", 83, 84);
14808
- i0.ɵɵelementStart(2, "div", 85);
14809
- i0.ɵɵelementStart(3, "button", 86);
14810
- i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_ng_template_57_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r65_1); var _r49 = i0.ɵɵreference(1); var ctx_r64 = i0.ɵɵnextContext(2); ctx_r64.toggleShowIngredient(true); return _r49.scrollIntoView(); });
15575
+ var _r68_1 = i0.ɵɵgetCurrentView();
15576
+ i0.ɵɵelementStart(0, "div", 84, 85);
15577
+ i0.ɵɵelementStart(2, "div", 86);
15578
+ i0.ɵɵelementStart(3, "button", 87);
15579
+ i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_ng_template_55_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r68_1); var _r52 = i0.ɵɵreference(1); var ctx_r67 = i0.ɵɵnextContext(2); ctx_r67.toggleShowIngredient(true); return _r52.scrollIntoView(); });
14811
15580
  i0.ɵɵtext(4, "Ingredients");
14812
15581
  i0.ɵɵelementEnd();
14813
- i0.ɵɵelementStart(5, "button", 86);
14814
- i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_ng_template_57_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r65_1); var _r49 = i0.ɵɵreference(1); var ctx_r66 = i0.ɵɵnextContext(2); ctx_r66.toggleShowIngredient(false); return _r49.scrollIntoView(); });
15582
+ i0.ɵɵelementStart(5, "button", 87);
15583
+ i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_ng_template_55_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r68_1); var _r52 = i0.ɵɵreference(1); var ctx_r69 = i0.ɵɵnextContext(2); ctx_r69.toggleShowIngredient(false); return _r52.scrollIntoView(); });
14815
15584
  i0.ɵɵtext(6, "Pr\u00E9paration");
14816
15585
  i0.ɵɵelementEnd();
14817
15586
  i0.ɵɵelementEnd();
14818
- i0.ɵɵtemplate(7, RecipeDetailsComponent_div_0_ng_template_57_ng_container_7_Template, 10, 3, "ng-container", 87);
14819
- i0.ɵɵtemplate(8, RecipeDetailsComponent_div_0_ng_template_57_ng_template_8_Template, 2, 1, "ng-template", null, 88, i0.ɵɵtemplateRefExtractor);
15587
+ i0.ɵɵtemplate(7, RecipeDetailsComponent_div_0_ng_template_55_ng_container_7_Template, 10, 3, "ng-container", 88);
15588
+ i0.ɵɵtemplate(8, RecipeDetailsComponent_div_0_ng_template_55_ng_template_8_Template, 2, 1, "ng-template", null, 89, i0.ɵɵtemplateRefExtractor);
14820
15589
  i0.ɵɵelementEnd();
14821
15590
  }
14822
15591
  if (rf & 2) {
14823
- var _r51 = i0.ɵɵreference(9);
14824
- var ctx_r23 = i0.ɵɵnextContext(2);
15592
+ var _r54 = i0.ɵɵreference(9);
15593
+ var ctx_r24 = i0.ɵɵnextContext(2);
14825
15594
  i0.ɵɵadvance(3);
14826
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c4, ctx_r23.showIngredient));
15595
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c4, ctx_r24.showIngredient));
14827
15596
  i0.ɵɵadvance(2);
14828
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c4, !ctx_r23.showIngredient));
15597
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c4, !ctx_r24.showIngredient));
14829
15598
  i0.ɵɵadvance(2);
14830
- i0.ɵɵproperty("ngIf", ctx_r23.showIngredient)("ngIfElse", _r51);
15599
+ i0.ɵɵproperty("ngIf", ctx_r24.showIngredient)("ngIfElse", _r54);
15600
+ }
15601
+ }
15602
+ function RecipeDetailsComponent_div_0_div_59_Template(rf, ctx) {
15603
+ if (rf & 1) {
15604
+ i0.ɵɵelementStart(0, "div", 51);
15605
+ i0.ɵɵelement(1, "ng-miam-recipe-pricing", 52);
15606
+ i0.ɵɵelementEnd();
15607
+ }
15608
+ if (rf & 2) {
15609
+ var ctx_r25 = i0.ɵɵnextContext(2);
15610
+ i0.ɵɵadvance(1);
15611
+ i0.ɵɵproperty("recipe", ctx_r25.recipe)("serves", ctx_r25.recipe == null ? null : ctx_r25.recipe.modifiedGuests);
14831
15612
  }
14832
15613
  }
14833
- function RecipeDetailsComponent_div_0_button_63_ng_miam_icon_5_Template(rf, ctx) {
15614
+ function RecipeDetailsComponent_div_0_button_60_ng_miam_icon_5_Template(rf, ctx) {
14834
15615
  if (rf & 1) {
14835
- i0.ɵɵelement(0, "ng-miam-icon", 54);
15616
+ i0.ɵɵelement(0, "ng-miam-icon", 56);
14836
15617
  i0.ɵɵpipe(1, "async");
14837
15618
  }
14838
15619
  if (rf & 2) {
14839
- var ctx_r67 = i0.ɵɵnextContext(3);
14840
- var tmp_2_0 = null;
14841
- i0.ɵɵproperty("width", 24)("height", 24)("iconName", ((tmp_2_0 = i0.ɵɵpipeBind1(1, 3, ctx_r67.groceriesListsService.list$)) == null ? null : tmp_2_0.hasRecipe(ctx_r67.recipe == null ? null : ctx_r67.recipe.id)) ? ctx_r67.icon.CheckList : ctx_r67.icon.Cart);
15620
+ var ctx_r70 = i0.ɵɵnextContext(3);
15621
+ i0.ɵɵproperty("width", 24)("height", 24)("iconName", i0.ɵɵpipeBind1(1, 3, ctx_r70.groceriesListsService.recipeIsInList(ctx_r70.recipe == null ? null : ctx_r70.recipe.id)) ? ctx_r70.icon.CheckList : ctx_r70.icon.Cart);
14842
15622
  }
14843
15623
  }
14844
- function RecipeDetailsComponent_div_0_button_63_ng_template_6_Template(rf, ctx) {
15624
+ function RecipeDetailsComponent_div_0_button_60_ng_template_6_Template(rf, ctx) {
14845
15625
  if (rf & 1) {
14846
15626
  i0.ɵɵelement(0, "ng-miam-loader");
14847
15627
  }
14848
15628
  }
14849
- function RecipeDetailsComponent_div_0_button_63_Template(rf, ctx) {
15629
+ function RecipeDetailsComponent_div_0_button_60_Template(rf, ctx) {
14850
15630
  if (rf & 1) {
14851
- var _r71_1 = i0.ɵɵgetCurrentView();
14852
- i0.ɵɵelementStart(0, "button", 51);
14853
- i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_button_63_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r71_1); var ctx_r70 = i0.ɵɵnextContext(2); return ctx_r70.clickPrimary(); });
15631
+ var _r74_1 = i0.ɵɵgetCurrentView();
15632
+ i0.ɵɵelementStart(0, "button", 53);
15633
+ i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_button_60_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r74_1); var ctx_r73 = i0.ɵɵnextContext(2); return ctx_r73.clickPrimary(); });
14854
15634
  i0.ɵɵpipe(1, "async");
14855
15635
  i0.ɵɵelementStart(2, "span");
14856
15636
  i0.ɵɵtext(3);
14857
15637
  i0.ɵɵpipe(4, "async");
14858
15638
  i0.ɵɵelementEnd();
14859
- i0.ɵɵtemplate(5, RecipeDetailsComponent_div_0_button_63_ng_miam_icon_5_Template, 2, 5, "ng-miam-icon", 52);
14860
- i0.ɵɵtemplate(6, RecipeDetailsComponent_div_0_button_63_ng_template_6_Template, 1, 0, "ng-template", null, 53, i0.ɵɵtemplateRefExtractor);
15639
+ i0.ɵɵtemplate(5, RecipeDetailsComponent_div_0_button_60_ng_miam_icon_5_Template, 2, 5, "ng-miam-icon", 54);
15640
+ i0.ɵɵtemplate(6, RecipeDetailsComponent_div_0_button_60_ng_template_6_Template, 1, 0, "ng-template", null, 55, i0.ɵɵtemplateRefExtractor);
14861
15641
  i0.ɵɵelementEnd();
14862
15642
  }
14863
15643
  if (rf & 2) {
14864
- var _r68 = i0.ɵɵreference(7);
14865
- var ctx_r24 = i0.ɵɵnextContext(2);
14866
- var tmp_0_0 = null;
14867
- var tmp_1_0 = null;
14868
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(8, _c2$2, (tmp_0_0 = i0.ɵɵpipeBind1(1, 4, ctx_r24.groceriesListsService.list$)) == null ? null : tmp_0_0.hasRecipe(ctx_r24.recipe == null ? null : ctx_r24.recipe.id), ctx_r24.addButtonLoading));
15644
+ var _r71 = i0.ɵɵreference(7);
15645
+ var ctx_r26 = i0.ɵɵnextContext(2);
15646
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(8, _c2$2, i0.ɵɵpipeBind1(1, 4, ctx_r26.groceriesListsService.recipeIsInList(ctx_r26.recipe == null ? null : ctx_r26.recipe.id)), ctx_r26.addButtonLoading));
14869
15647
  i0.ɵɵadvance(3);
14870
- i0.ɵɵtextInterpolate1(" ", ((tmp_1_0 = i0.ɵɵpipeBind1(4, 6, ctx_r24.groceriesListsService.list$)) == null ? null : tmp_1_0.hasRecipe(ctx_r24.recipe == null ? null : ctx_r24.recipe.id)) ? "Voir le d\u00E9tail" : "S\u00E9lectionner ce repas", " ");
15648
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 6, ctx_r26.groceriesListsService.recipeIsInList(ctx_r26.recipe == null ? null : ctx_r26.recipe.id)) ? "Voir le d\u00E9tail" : "S\u00E9lectionner ce repas", " ");
14871
15649
  i0.ɵɵadvance(2);
14872
- i0.ɵɵproperty("ngIf", !ctx_r24.addButtonLoading)("ngIfElse", _r68);
15650
+ i0.ɵɵproperty("ngIf", !ctx_r26.addButtonLoading)("ngIfElse", _r71);
14873
15651
  }
14874
15652
  }
14875
15653
  function RecipeDetailsComponent_div_0_Template(rf, ctx) {
14876
15654
  if (rf & 1) {
14877
- var _r73_1 = i0.ɵɵgetCurrentView();
15655
+ var _r76_1 = i0.ɵɵgetCurrentView();
14878
15656
  i0.ɵɵelementStart(0, "div", 2, 3);
14879
15657
  i0.ɵɵelementStart(2, "div", 4);
14880
15658
  i0.ɵɵelementStart(3, "div", 5);
@@ -14882,91 +15660,85 @@
14882
15660
  i0.ɵɵtemplate(6, RecipeDetailsComponent_div_0_img_6_Template, 1, 1, "img", 8);
14883
15661
  i0.ɵɵtemplate(7, RecipeDetailsComponent_div_0_div_7_Template, 1, 0, "div", 9);
14884
15662
  i0.ɵɵtemplate(8, RecipeDetailsComponent_div_0_youtube_player_8_Template, 1, 3, "youtube-player", 10);
14885
- i0.ɵɵtemplate(9, RecipeDetailsComponent_div_0_div_9_Template, 2, 0, "div", 11);
14886
- i0.ɵɵpipe(10, "async");
14887
- i0.ɵɵelementStart(11, "div", 12);
14888
- i0.ɵɵtemplate(12, RecipeDetailsComponent_div_0_ng_miam_like_button_12_Template, 1, 3, "ng-miam-like-button", 13);
14889
- i0.ɵɵpipe(13, "async");
15663
+ i0.ɵɵtemplate(9, RecipeDetailsComponent_div_0_ng_container_9_Template, 3, 3, "ng-container", 11);
15664
+ i0.ɵɵelementStart(10, "div", 12);
15665
+ i0.ɵɵtemplate(11, RecipeDetailsComponent_div_0_ng_miam_like_button_11_Template, 1, 3, "ng-miam-like-button", 13);
15666
+ i0.ɵɵpipe(12, "async");
15667
+ i0.ɵɵelement(13, "ng-miam-icon", 14);
14890
15668
  i0.ɵɵelement(14, "ng-miam-icon", 14);
14891
- i0.ɵɵelement(15, "ng-miam-icon", 14);
14892
15669
  i0.ɵɵelementEnd();
14893
- i0.ɵɵtemplate(16, RecipeDetailsComponent_div_0_img_16_Template, 1, 1, "img", 15);
15670
+ i0.ɵɵtemplate(15, RecipeDetailsComponent_div_0_img_15_Template, 1, 1, "img", 15);
14894
15671
  i0.ɵɵelementEnd();
14895
- i0.ɵɵelementStart(17, "div", 16);
14896
- i0.ɵɵelementStart(18, "div", 17);
14897
- i0.ɵɵelement(19, "ng-miam-icon", 18);
14898
- i0.ɵɵelementStart(20, "span");
14899
- i0.ɵɵtext(21);
15672
+ i0.ɵɵelementStart(16, "div", 16);
15673
+ i0.ɵɵelementStart(17, "div", 17);
15674
+ i0.ɵɵelement(18, "ng-miam-icon", 18);
15675
+ i0.ɵɵelementStart(19, "span");
15676
+ i0.ɵɵtext(20);
14900
15677
  i0.ɵɵelementEnd();
14901
15678
  i0.ɵɵelementEnd();
14902
- i0.ɵɵelementStart(22, "div", 19);
15679
+ i0.ɵɵelementStart(21, "div", 19);
15680
+ i0.ɵɵtemplate(22, RecipeDetailsComponent_div_0_div_22_Template, 7, 4, "div", 20);
14903
15681
  i0.ɵɵtemplate(23, RecipeDetailsComponent_div_0_div_23_Template, 7, 4, "div", 20);
14904
15682
  i0.ɵɵtemplate(24, RecipeDetailsComponent_div_0_div_24_Template, 7, 4, "div", 20);
14905
- i0.ɵɵtemplate(25, RecipeDetailsComponent_div_0_div_25_Template, 7, 4, "div", 20);
14906
15683
  i0.ɵɵelementEnd();
14907
15684
  i0.ɵɵelementEnd();
14908
15685
  i0.ɵɵelementEnd();
14909
- i0.ɵɵelementStart(26, "div", 21);
14910
- i0.ɵɵelementStart(27, "div", 22);
14911
- i0.ɵɵelementStart(28, "span", 23);
14912
- i0.ɵɵtext(29);
14913
- i0.ɵɵpipe(30, "titlecase");
15686
+ i0.ɵɵelementStart(25, "div", 21);
15687
+ i0.ɵɵelementStart(26, "div", 22);
15688
+ i0.ɵɵelementStart(27, "span", 23);
15689
+ i0.ɵɵtext(28);
15690
+ i0.ɵɵpipe(29, "titlecase");
14914
15691
  i0.ɵɵelementEnd();
14915
- i0.ɵɵelementStart(31, "span", 24);
14916
- i0.ɵɵtext(32);
15692
+ i0.ɵɵelementStart(30, "span", 24);
15693
+ i0.ɵɵtext(31);
14917
15694
  i0.ɵɵelementEnd();
14918
- i0.ɵɵelementStart(33, "div", 25);
14919
- i0.ɵɵelementContainerStart(34, 26);
15695
+ i0.ɵɵelementStart(32, "div", 25);
15696
+ i0.ɵɵelementContainerStart(33, 26);
15697
+ i0.ɵɵtemplate(34, RecipeDetailsComponent_div_0_ng_container_34_Template, 2, 3, "ng-container", 27);
14920
15698
  i0.ɵɵtemplate(35, RecipeDetailsComponent_div_0_ng_container_35_Template, 2, 3, "ng-container", 27);
14921
15699
  i0.ɵɵtemplate(36, RecipeDetailsComponent_div_0_ng_container_36_Template, 2, 3, "ng-container", 27);
14922
- i0.ɵɵtemplate(37, RecipeDetailsComponent_div_0_ng_container_37_Template, 2, 3, "ng-container", 27);
14923
- i0.ɵɵtemplate(38, RecipeDetailsComponent_div_0_ng_container_38_Template, 1, 0, "ng-container", 28);
15700
+ i0.ɵɵtemplate(37, RecipeDetailsComponent_div_0_ng_container_37_Template, 1, 0, "ng-container", 28);
14924
15701
  i0.ɵɵelementContainerEnd();
14925
- i0.ɵɵelementStart(39, "span");
14926
- i0.ɵɵtext(40);
14927
- i0.ɵɵpipe(41, "titlecase");
14928
- i0.ɵɵelementEnd();
14929
- i0.ɵɵelementEnd();
14930
- i0.ɵɵelementStart(42, "div", 29);
14931
- i0.ɵɵtext(43);
14932
- i0.ɵɵelementStart(44, "div", 30);
14933
- i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_Template_div_click_44_listener() { i0.ɵɵrestoreView(_r73_1); var ctx_r72 = i0.ɵɵnextContext(); return ctx_r72.print(); });
14934
- i0.ɵɵelement(45, "ng-miam-icon", 14);
14935
- i0.ɵɵelementStart(46, "span");
14936
- i0.ɵɵtext(47, " Imprimer la recette ");
15702
+ i0.ɵɵelementStart(38, "span");
15703
+ i0.ɵɵtext(39);
15704
+ i0.ɵɵpipe(40, "titlecase");
14937
15705
  i0.ɵɵelementEnd();
14938
15706
  i0.ɵɵelementEnd();
15707
+ i0.ɵɵelementStart(41, "div", 29);
15708
+ i0.ɵɵtext(42);
15709
+ i0.ɵɵelementStart(43, "div", 30);
15710
+ i0.ɵɵlistener("click", function RecipeDetailsComponent_div_0_Template_div_click_43_listener() { i0.ɵɵrestoreView(_r76_1); var ctx_r75 = i0.ɵɵnextContext(); return ctx_r75.print(); });
15711
+ i0.ɵɵelement(44, "ng-miam-icon", 14);
15712
+ i0.ɵɵelementStart(45, "span");
15713
+ i0.ɵɵtext(46, " Imprimer la recette ");
14939
15714
  i0.ɵɵelementEnd();
14940
15715
  i0.ɵɵelementEnd();
14941
- i0.ɵɵelementStart(48, "div", 31);
14942
- i0.ɵɵelementStart(49, "div", 32);
14943
- i0.ɵɵelement(50, "ng-miam-recipe-pricing", 33);
14944
15716
  i0.ɵɵelementEnd();
14945
- i0.ɵɵtemplate(51, RecipeDetailsComponent_div_0_button_51_Template, 8, 11, "button", 34);
14946
15717
  i0.ɵɵelementEnd();
15718
+ i0.ɵɵelementStart(47, "div", 31);
15719
+ i0.ɵɵtemplate(48, RecipeDetailsComponent_div_0_div_48_Template, 2, 2, "div", 32);
15720
+ i0.ɵɵtemplate(49, RecipeDetailsComponent_div_0_button_49_Template, 8, 11, "button", 33);
14947
15721
  i0.ɵɵelementEnd();
14948
15722
  i0.ɵɵelementEnd();
14949
- i0.ɵɵelement(52, "div", 35);
14950
- i0.ɵɵtemplate(53, RecipeDetailsComponent_div_0_div_53_Template, 2, 1, "div", 36);
14951
- i0.ɵɵelementStart(54, "div");
14952
- i0.ɵɵtemplate(55, RecipeDetailsComponent_div_0_ng_miam_addon_link_55_Template, 1, 1, "ng-miam-addon-link", 37);
14953
15723
  i0.ɵɵelementEnd();
14954
- i0.ɵɵtemplate(56, RecipeDetailsComponent_div_0_div_56_Template, 18, 4, "div", 38);
14955
- i0.ɵɵtemplate(57, RecipeDetailsComponent_div_0_ng_template_57_Template, 10, 8, "ng-template", null, 39, i0.ɵɵtemplateRefExtractor);
14956
- i0.ɵɵelementStart(59, "div", 40);
14957
- i0.ɵɵelementStart(60, "div", 31);
14958
- i0.ɵɵelementStart(61, "div", 32);
14959
- i0.ɵɵelement(62, "ng-miam-recipe-pricing", 33);
15724
+ i0.ɵɵelement(50, "div", 34);
15725
+ i0.ɵɵtemplate(51, RecipeDetailsComponent_div_0_div_51_Template, 2, 1, "div", 35);
15726
+ i0.ɵɵelementStart(52, "div");
15727
+ i0.ɵɵtemplate(53, RecipeDetailsComponent_div_0_ng_miam_addon_link_53_Template, 1, 1, "ng-miam-addon-link", 36);
14960
15728
  i0.ɵɵelementEnd();
14961
- i0.ɵɵtemplate(63, RecipeDetailsComponent_div_0_button_63_Template, 8, 11, "button", 34);
15729
+ i0.ɵɵtemplate(54, RecipeDetailsComponent_div_0_div_54_Template, 18, 4, "div", 37);
15730
+ i0.ɵɵtemplate(55, RecipeDetailsComponent_div_0_ng_template_55_Template, 10, 8, "ng-template", null, 38, i0.ɵɵtemplateRefExtractor);
15731
+ i0.ɵɵelementStart(57, "div", 39);
15732
+ i0.ɵɵelementStart(58, "div", 31);
15733
+ i0.ɵɵtemplate(59, RecipeDetailsComponent_div_0_div_59_Template, 2, 2, "div", 32);
15734
+ i0.ɵɵtemplate(60, RecipeDetailsComponent_div_0_button_60_Template, 8, 11, "button", 33);
14962
15735
  i0.ɵɵelementEnd();
14963
15736
  i0.ɵɵelementEnd();
14964
15737
  i0.ɵɵelementEnd();
14965
15738
  }
14966
15739
  if (rf & 2) {
14967
- var _r22 = i0.ɵɵreference(58);
15740
+ var _r23 = i0.ɵɵreference(56);
14968
15741
  var ctx_r0 = i0.ɵɵnextContext();
14969
- var tmp_3_0 = null;
14970
15742
  i0.ɵɵadvance(6);
14971
15743
  i0.ɵɵproperty("ngIf", !ctx_r0.showVideo);
14972
15744
  i0.ɵɵadvance(1);
@@ -14974,9 +15746,9 @@
14974
15746
  i0.ɵɵadvance(1);
14975
15747
  i0.ɵɵproperty("ngIf", ctx_r0.showVideo && ctx_r0.playerWidth);
14976
15748
  i0.ɵɵadvance(1);
14977
- i0.ɵɵproperty("ngIf", (tmp_3_0 = i0.ɵɵpipeBind1(10, 40, ctx_r0.groceriesListsService.list$)) == null ? null : tmp_3_0.hasRecipe(ctx_r0.recipe == null ? null : ctx_r0.recipe.id));
14978
- i0.ɵɵadvance(3);
14979
- i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(13, 42, ctx_r0.userService.isLogged$));
15749
+ i0.ɵɵproperty("ngIf", ctx_r0.recipe && ctx_r0.displayAddedOnPicture);
15750
+ i0.ɵɵadvance(2);
15751
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(12, 38, ctx_r0.userService.isLogged$));
14980
15752
  i0.ɵɵadvance(2);
14981
15753
  i0.ɵɵproperty("width", 26)("height", 26)("iconName", ctx_r0.icon.Calendar);
14982
15754
  i0.ɵɵadvance(1);
@@ -14994,7 +15766,7 @@
14994
15766
  i0.ɵɵadvance(1);
14995
15767
  i0.ɵɵproperty("ngIf", (ctx_r0.recipe == null ? null : ctx_r0.recipe.restingTime) !== "-");
14996
15768
  i0.ɵɵadvance(4);
14997
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(30, 44, ctx_r0.recipe == null ? null : ctx_r0.recipe.recipeType == null ? null : ctx_r0.recipe.recipeType.attributes == null ? null : ctx_r0.recipe.recipeType.attributes.name));
15769
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(29, 40, ctx_r0.recipe == null ? null : ctx_r0.recipe.recipeType == null ? null : ctx_r0.recipe.recipeType.attributes == null ? null : ctx_r0.recipe.recipeType.attributes.name));
14998
15770
  i0.ɵɵadvance(3);
14999
15771
  i0.ɵɵtextInterpolate(ctx_r0.recipe == null ? null : ctx_r0.recipe.attributes["title"]);
15000
15772
  i0.ɵɵadvance(2);
@@ -15006,13 +15778,13 @@
15006
15778
  i0.ɵɵadvance(1);
15007
15779
  i0.ɵɵproperty("ngSwitchCase", "difficile");
15008
15780
  i0.ɵɵadvance(3);
15009
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(41, 46, ctx_r0.recipe == null ? null : ctx_r0.recipe.difficultyLabel));
15781
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(40, 42, ctx_r0.recipe == null ? null : ctx_r0.recipe.difficultyLabel));
15010
15782
  i0.ɵɵadvance(3);
15011
15783
  i0.ɵɵtextInterpolate1(" ", ctx_r0.recipe == null ? null : ctx_r0.recipe.attributes["description"], " ");
15012
15784
  i0.ɵɵadvance(2);
15013
15785
  i0.ɵɵproperty("width", 20)("height", 20)("iconName", ctx_r0.icon.Print);
15014
- i0.ɵɵadvance(5);
15015
- i0.ɵɵproperty("recipe", ctx_r0.recipe)("serves", ctx_r0.recipe == null ? null : ctx_r0.recipe.modifiedGuests);
15786
+ i0.ɵɵadvance(4);
15787
+ i0.ɵɵproperty("ngIf", ctx_r0.recipe && ctx_r0.displayPricing);
15016
15788
  i0.ɵɵadvance(1);
15017
15789
  i0.ɵɵproperty("ngIf", ctx_r0.previewAllowed);
15018
15790
  i0.ɵɵadvance(2);
@@ -15020,18 +15792,18 @@
15020
15792
  i0.ɵɵadvance(2);
15021
15793
  i0.ɵɵproperty("ngIf", (ctx_r0.recipe == null ? null : ctx_r0.recipe.sponsors == null ? null : ctx_r0.recipe.sponsors.length) > 0 || ctx_r0.recipe.informationalSentence);
15022
15794
  i0.ɵɵadvance(1);
15023
- i0.ɵɵproperty("ngIf", !ctx_r0.isMobile)("ngIfElse", _r22);
15024
- i0.ɵɵadvance(6);
15025
- i0.ɵɵproperty("recipe", ctx_r0.recipe)("serves", ctx_r0.recipe == null ? null : ctx_r0.recipe.modifiedGuests);
15795
+ i0.ɵɵproperty("ngIf", !ctx_r0.isMobile)("ngIfElse", _r23);
15796
+ i0.ɵɵadvance(5);
15797
+ i0.ɵɵproperty("ngIf", ctx_r0.recipe && ctx_r0.displayPricing);
15026
15798
  i0.ɵɵadvance(1);
15027
15799
  i0.ɵɵproperty("ngIf", ctx_r0.previewAllowed);
15028
15800
  }
15029
15801
  }
15030
15802
  function RecipeDetailsComponent_ng_template_1_Template(rf, ctx) {
15031
15803
  if (rf & 1) {
15032
- var _r75_1 = i0.ɵɵgetCurrentView();
15033
- i0.ɵɵelementStart(0, "ng-miam-recipe-addon", 89);
15034
- i0.ɵɵlistener("hideAddon", function RecipeDetailsComponent_ng_template_1_Template_ng_miam_recipe_addon_hideAddon_0_listener() { i0.ɵɵrestoreView(_r75_1); var ctx_r74 = i0.ɵɵnextContext(); return ctx_r74.toggleAddon(); });
15804
+ var _r78_1 = i0.ɵɵgetCurrentView();
15805
+ i0.ɵɵelementStart(0, "ng-miam-recipe-addon", 90);
15806
+ i0.ɵɵlistener("hideAddon", function RecipeDetailsComponent_ng_template_1_Template_ng_miam_recipe_addon_hideAddon_0_listener() { i0.ɵɵrestoreView(_r78_1); var ctx_r77 = i0.ɵɵnextContext(); return ctx_r77.toggleAddon(); });
15035
15807
  i0.ɵɵelementEnd();
15036
15808
  }
15037
15809
  if (rf & 2) {
@@ -15052,6 +15824,8 @@
15052
15824
  this.ingredientsPictures = false;
15053
15825
  this.displayTags = false;
15054
15826
  this.displayTagsIcons = false;
15827
+ this.displayPricing = true;
15828
+ this.displayAddedOnPicture = true;
15055
15829
  this.recipeAdded = new i0.EventEmitter();
15056
15830
  this.recipeChanged = new i0.EventEmitter();
15057
15831
  this.recipeError = new i0.EventEmitter();
@@ -15117,11 +15891,17 @@
15117
15891
  this.activeStep = index;
15118
15892
  this.cdr.detectChanges();
15119
15893
  };
15894
+ /**
15895
+ * Add recipe to list on primary button click and emit true if the recipe is added, false if recipe is not added
15896
+ * so lib users can decide that primaryButtonClicked$.emit(false) removes the recipe for example
15897
+ */
15120
15898
  RecipeDetailsComponent.prototype.clickPrimary = function () {
15899
+ var _this = this;
15121
15900
  if (!this.addButtonLoading) {
15122
- var wasAdded = !this.groceriesListsService.list$.value.hasRecipe(this.recipe.id);
15123
- this.addRecipe();
15124
- this.primaryButtonClicked$.emit(wasAdded);
15901
+ this.subscriptions.push(this.groceriesListsService.recipeIsInList(this.recipe.id).subscribe(function (recipeIsInList) {
15902
+ _this.addRecipe();
15903
+ _this.primaryButtonClicked$.emit(!recipeIsInList); // !recipeIsInList = add action, so we emit true
15904
+ }));
15125
15905
  }
15126
15906
  };
15127
15907
  RecipeDetailsComponent.prototype.addRecipe = function () {
@@ -15142,10 +15922,11 @@
15142
15922
  };
15143
15923
  RecipeDetailsComponent.prototype.addRecipeActionOK = function () {
15144
15924
  var _this = this;
15145
- if (!this.groceriesListsService.list$.value.hasRecipe(this.recipe.id)) {
15146
- this.recipeEventsService.sendEvent(this.recipe, this.recipeEventsService.ACTION_ADDED);
15147
- }
15148
- this.subscriptions.push(this.groceriesListsService.appendRecipeToList(this.recipe.id, this.recipe.modifiedGuests, 'details')
15925
+ this.subscriptions.push(this.groceriesListsService.recipeIsInList(this.recipe.id).subscribe(function (recipeIsInList) {
15926
+ if (!recipeIsInList) {
15927
+ _this.recipeEventsService.sendEvent(_this.recipe, _this.recipeEventsService.ACTION_ADDED);
15928
+ }
15929
+ }), this.groceriesListsService.appendRecipeToList(this.recipe.id, this.recipe.modifiedGuests, 'details')
15149
15930
  .subscribe(function (l) {
15150
15931
  _this.toggleButtonLoader(false);
15151
15932
  }));
@@ -15199,16 +15980,16 @@
15199
15980
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.topContainerImg = _t.first);
15200
15981
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.mainContainer = _t.first);
15201
15982
  }
15202
- }, inputs: { recipe: "recipe", forceIngredientsStepstoggle: "forceIngredientsStepstoggle", previewAllowed: "previewAllowed", ingredientsPictures: "ingredientsPictures", displayTags: "displayTags", displayTagsIcons: "displayTagsIcons" }, outputs: { recipeAdded: "recipeAdded", recipeChanged: "recipeChanged", recipeError: "recipeError" }, features: [i0.ɵɵNgOnChangesFeature], decls: 3, vars: 2, consts: [["class", "miam-recipe-details", 4, "ngIf", "ngIfElse"], ["addon", ""], [1, "miam-recipe-details"], ["mainContainer", ""], [1, "miam-recipe-details__top__container"], [1, "miam-recipe-details__top__left"], [1, "miam-recipe-details__top__container__img"], ["topContainerImg", ""], [3, "src", 4, "ngIf"], ["class", "miam-recipe-details__picture__gradient", 4, "ngIf"], [3, "videoId", "width", "height", 4, "ngIf"], ["class", "miam-recipe-details__picture__tag", 4, "ngIf"], [1, "miam-recipe-details__img__actions"], ["class", "miam-recipe-details__actions__icon miam-noPadding", 3, "recipe", "width", "height", 4, "ngIf"], ["primaryColor", "var(--m-color-primary)", 1, "miam-recipe-details__actions__icon", 3, "width", "height", "iconName"], ["class", "miam-recipe-details__picture__sponsor", 3, "src", 4, "ngIf"], [1, "miam-recipe-details__top__container__info"], [1, "miam-recipe-details__info__metrics", "miam-recipe-details__info__metrics__total"], ["primaryColor", "var(--m-color-primary)", 3, "width", "height", "iconName"], [1, "miam-recipe-details__info__times"], ["class", "miam-recipe-details__info__metrics", 4, "ngIf"], [1, "miam-recipe-details__top__container__infos"], [1, "miam-recipe-details__top__container__infos__top"], [1, "miam-recipe-details__infos__type"], [1, "miam-recipe-details__infos__title"], [1, "miam-recipe-details__infos__difficulty"], [3, "ngSwitch"], [4, "ngSwitchCase"], [4, "ngSwitchDefault"], [1, "miam-recipe-details__infos__description"], [1, "miam-recipe-details__description__action", 3, "click"], [1, "miam-recipe-details__infos__price__wrapper"], [1, "miam-recipe-details__infos__price"], [3, "recipe", "serves"], ["class", "miam-recipe-details__infos__action m-button-fab-primary", 3, "ngClass", "click", 4, "ngIf"], [1, "miam-recipe-details__mid__container"], ["class", "miam-recipe-details__tags__container", 4, "ngIf"], [3, "recipe", "showAddon", 4, "ngIf"], ["class", "miam-recipe-details__bottom__container", 4, "ngIf", "ngIfElse"], ["mobileContainer", ""], [1, "miam-recipe-details__bottom__container__action"], [3, "src"], [1, "miam-recipe-details__picture__gradient"], [3, "videoId", "width", "height"], [1, "miam-recipe-details__picture__tag"], [1, "miam-recipe-details__actions__icon", "miam-noPadding", 3, "recipe", "width", "height"], [1, "miam-recipe-details__picture__sponsor", 3, "src"], [1, "miam-recipe-details__info__metrics"], [1, "miam-recipe-details__metrics__row"], ["primaryColor", "var(--m-color-slate)", 3, "width", "height", "iconName"], [3, "width", "height", "iconName"], [1, "miam-recipe-details__infos__action", "m-button-fab-primary", 3, "ngClass", "click"], ["primaryColor", "#fff", 3, "width", "height", "iconName", 4, "ngIf", "ngIfElse"], ["addLoader", ""], ["primaryColor", "#fff", 3, "width", "height", "iconName"], [1, "miam-recipe-details__tags__container"], ["class", "miam-recipe-details__tag", 4, "ngFor", "ngForOf"], [1, "miam-recipe-details__tag"], ["class", "miam-recipe-details__tag__icon", 3, "src", 4, "ngIf"], [1, "miam-recipe-details__tag__name"], [1, "miam-recipe-details__tag__icon", 3, "src"], [3, "recipe", "showAddon"], [1, "miam-recipe-details__bottom__container"], [1, "miam-recipe-details__bottom__container__ingredients"], [1, "miam-recipe-details__bottom__container__header"], [1, "miam-recipe-details__ingredients__row"], [1, "miam-recipe-details__ingredients__counter"], [3, "counter", "counterChange"], [1, "miam-recipe-details__ingredients__counter__print"], [1, "miam-recipe-details__ingredients__row__qty"], [1, "miam-recipe-details__ingredients__list"], ["class", "miam-recipe-details__ingredients__row", 3, "ngClass", 4, "ngFor", "ngForOf"], [1, "miam-recipe-details__bottom__container__steps"], [1, "miam-recipe-details__steps__list"], ["class", "miam-recipe-details__steps__list__panel", 3, "active", "miam-recipe-details__panel__done", "click", 4, "ngFor", "ngForOf"], [1, "miam-recipe-details__ingredients__row", 3, "ngClass"], [4, "ngIf"], [1, "miam-recipe-details__ingredients__row__picture", 3, "src"], [1, "miam-recipe-details__steps__list__panel", 3, "click"], [1, "miam-recipe-details__panel__idx"], [1, "miam-recipe-details__panel__text"], ["class", "miam-recipe-details__panel__checkIcon", "primaryColor", "var(--m-color-secondary)", 3, "height", "width", "iconName", 4, "ngIf"], ["primaryColor", "var(--m-color-secondary)", 1, "miam-recipe-details__panel__checkIcon", 3, "height", "width", "iconName"], [1, "miam-recipe-details__mobile__container"], ["mobileContainerTop", ""], [1, "miam-recipe-details__mobile__header"], [1, "m-button-secondary", 3, "ngClass", "click"], [4, "ngIf", "ngIfElse"], ["stepsContainer", ""], [3, "recipe", "hideAddon"]], template: function RecipeDetailsComponent_Template(rf, ctx) {
15983
+ }, inputs: { recipe: "recipe", forceIngredientsStepstoggle: "forceIngredientsStepstoggle", previewAllowed: "previewAllowed", ingredientsPictures: "ingredientsPictures", displayTags: "displayTags", displayTagsIcons: "displayTagsIcons", displayPricing: "displayPricing", displayAddedOnPicture: "displayAddedOnPicture" }, outputs: { recipeAdded: "recipeAdded", recipeChanged: "recipeChanged", recipeError: "recipeError" }, features: [i0.ɵɵNgOnChangesFeature], decls: 3, vars: 2, consts: [["class", "miam-recipe-details", 4, "ngIf", "ngIfElse"], ["addon", ""], [1, "miam-recipe-details"], ["mainContainer", ""], [1, "miam-recipe-details__top__container"], [1, "miam-recipe-details__top__left"], [1, "miam-recipe-details__top__container__img"], ["topContainerImg", ""], [3, "src", 4, "ngIf"], ["class", "miam-recipe-details__picture__gradient", 4, "ngIf"], [3, "videoId", "width", "height", 4, "ngIf"], [4, "ngIf"], [1, "miam-recipe-details__img__actions"], ["class", "miam-recipe-details__actions__icon miam-noPadding", 3, "recipe", "width", "height", 4, "ngIf"], ["primaryColor", "var(--m-color-primary)", 1, "miam-recipe-details__actions__icon", 3, "width", "height", "iconName"], ["class", "miam-recipe-details__picture__sponsor", 3, "src", 4, "ngIf"], [1, "miam-recipe-details__top__container__info"], [1, "miam-recipe-details__info__metrics", "miam-recipe-details__info__metrics__total"], ["primaryColor", "var(--m-color-primary)", 3, "width", "height", "iconName"], [1, "miam-recipe-details__info__times"], ["class", "miam-recipe-details__info__metrics", 4, "ngIf"], [1, "miam-recipe-details__top__container__infos"], [1, "miam-recipe-details__top__container__infos__top"], [1, "miam-recipe-details__infos__type"], [1, "miam-recipe-details__infos__title"], [1, "miam-recipe-details__infos__difficulty"], [3, "ngSwitch"], [4, "ngSwitchCase"], [4, "ngSwitchDefault"], [1, "miam-recipe-details__infos__description"], [1, "miam-recipe-details__description__action", 3, "click"], [1, "miam-recipe-details__infos__price__wrapper"], ["class", "miam-recipe-details__infos__price", 4, "ngIf"], ["class", "miam-recipe-details__infos__action m-button-fab-primary", 3, "ngClass", "click", 4, "ngIf"], [1, "miam-recipe-details__mid__container"], ["class", "miam-recipe-details__tags__container", 4, "ngIf"], [3, "recipe", "showAddon", 4, "ngIf"], ["class", "miam-recipe-details__bottom__container", 4, "ngIf", "ngIfElse"], ["mobileContainer", ""], [1, "miam-recipe-details__bottom__container__action"], [3, "src"], [1, "miam-recipe-details__picture__gradient"], [3, "videoId", "width", "height"], ["class", "miam-recipe-details__picture__tag", 4, "ngIf"], [1, "miam-recipe-details__picture__tag"], [1, "miam-recipe-details__actions__icon", "miam-noPadding", 3, "recipe", "width", "height"], [1, "miam-recipe-details__picture__sponsor", 3, "src"], [1, "miam-recipe-details__info__metrics"], [1, "miam-recipe-details__metrics__row"], ["primaryColor", "var(--m-color-slate)", 3, "width", "height", "iconName"], [3, "width", "height", "iconName"], [1, "miam-recipe-details__infos__price"], [3, "recipe", "serves"], [1, "miam-recipe-details__infos__action", "m-button-fab-primary", 3, "ngClass", "click"], ["primaryColor", "#fff", 3, "width", "height", "iconName", 4, "ngIf", "ngIfElse"], ["addLoader", ""], ["primaryColor", "#fff", 3, "width", "height", "iconName"], [1, "miam-recipe-details__tags__container"], ["class", "miam-recipe-details__tag", 4, "ngFor", "ngForOf"], [1, "miam-recipe-details__tag"], ["class", "miam-recipe-details__tag__icon", 3, "src", 4, "ngIf"], [1, "miam-recipe-details__tag__name"], [1, "miam-recipe-details__tag__icon", 3, "src"], [3, "recipe", "showAddon"], [1, "miam-recipe-details__bottom__container"], [1, "miam-recipe-details__bottom__container__ingredients"], [1, "miam-recipe-details__bottom__container__header"], [1, "miam-recipe-details__ingredients__row"], [1, "miam-recipe-details__ingredients__counter"], [3, "counter", "counterChange"], [1, "miam-recipe-details__ingredients__counter__print"], [1, "miam-recipe-details__ingredients__row__qty"], [1, "miam-recipe-details__ingredients__list"], ["class", "miam-recipe-details__ingredients__row", 3, "ngClass", 4, "ngFor", "ngForOf"], [1, "miam-recipe-details__bottom__container__steps"], [1, "miam-recipe-details__steps__list"], ["class", "miam-recipe-details__steps__list__panel", 3, "active", "miam-recipe-details__panel__done", "click", 4, "ngFor", "ngForOf"], [1, "miam-recipe-details__ingredients__row", 3, "ngClass"], [1, "miam-recipe-details__ingredients__row__picture", 3, "src"], [1, "miam-recipe-details__steps__list__panel", 3, "click"], [1, "miam-recipe-details__panel__idx"], [1, "miam-recipe-details__panel__text"], ["class", "miam-recipe-details__panel__checkIcon", "primaryColor", "var(--m-color-secondary)", 3, "height", "width", "iconName", 4, "ngIf"], ["primaryColor", "var(--m-color-secondary)", 1, "miam-recipe-details__panel__checkIcon", 3, "height", "width", "iconName"], [1, "miam-recipe-details__mobile__container"], ["mobileContainerTop", ""], [1, "miam-recipe-details__mobile__header"], [1, "m-button-secondary", 3, "ngClass", "click"], [4, "ngIf", "ngIfElse"], ["stepsContainer", ""], [3, "recipe", "hideAddon"]], template: function RecipeDetailsComponent_Template(rf, ctx) {
15203
15984
  if (rf & 1) {
15204
- i0.ɵɵtemplate(0, RecipeDetailsComponent_div_0_Template, 64, 48, "div", 0);
15985
+ i0.ɵɵtemplate(0, RecipeDetailsComponent_div_0_Template, 61, 44, "div", 0);
15205
15986
  i0.ɵɵtemplate(1, RecipeDetailsComponent_ng_template_1_Template, 1, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
15206
15987
  }
15207
15988
  if (rf & 2) {
15208
15989
  var _r1 = i0.ɵɵreference(2);
15209
15990
  i0.ɵɵproperty("ngIf", ctx.showDetail)("ngIfElse", _r1);
15210
15991
  }
15211
- }, directives: [i8.NgIf, IconComponent, i8.NgSwitch, i8.NgSwitchCase, i8.NgSwitchDefault, RecipePricingComponent, i34.YouTubePlayer, LikeButtonComponent, i8.NgClass, LoaderComponent, i8.NgForOf, AddonLinkComponent, CounterInputComponent, RecipeAddonComponent], pipes: [i8.AsyncPipe, i8.TitleCasePipe, CapitalizeFirstLetterPipe, ReadableFloatNumberPipe], styles: [".miam-recipe-details{border-radius:var(--m-border-radius);display:inline-flex;flex-direction:row;flex-wrap:wrap;height:calc(80vh - 80px);margin:40px 8px;min-width:calc(100% - 32px);padding:0 16px}.miam-recipe-details::-webkit-scrollbar-button{height:20px}.miam-recipe-details::-webkit-scrollbar-track{background:var(--m-color-grey)}.miam-recipe-details::-webkit-scrollbar{cursor:-webkit-grab;height:7px;width:5px}.miam-recipe-details::-webkit-scrollbar-thumb{background:var(--m-color-primary);border-radius:5px}.miam-recipe-details .miam-recipe-details__top__container{display:flex;justify-content:space-evenly}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img{align-items:center;border-radius:var(--m-border-radius);display:flex;height:400px;overflow:hidden;position:relative;width:370px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img img{-o-object-fit:cover;-webkit-print-color-adjust:exact;display:block;height:100%;object-fit:cover;transform:translateX(-25%)}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__gradient{background:linear-gradient(180deg,transparent 57.92%,rgba(0,0,0,.75) 100%,rgba(0,0,0,.75) 0);border-top-left-radius:var(--m-border-radius);border-top-right-radius:var(--m-border-radius);display:block;height:100%;position:absolute;top:0;width:100%}@media print{.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__gradient{display:none}}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__tag{background-color:var(--m-color-primary-light);border-radius:5px;bottom:16px;color:var(--m-color-primary);font-weight:500;left:16px;padding:8px;position:absolute;text-transform:uppercase}@media print{.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__tag{display:none}}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions{display:flex;flex-direction:column;justify-content:space-evenly;position:absolute;right:16px;top:16px;z-index:var(--m-z-index-position-absolute-hight)}@media print{.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions{display:none}}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions .miam-recipe-details__actions__icon{-o-object-fit:contain;background-color:#fff;border-radius:var(--m-border-radius-circle);box-shadow:var(--m-shadow-small);margin:0 0 16px;object-fit:contain;padding:8px;width:-webkit-max-content;width:-moz-max-content;width:max-content}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions .miam-recipe-details__actions__icon.miam-noPadding{padding:0}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__sponsor{-o-object-fit:contain;bottom:16px;height:auto;max-height:72px;max-width:96px;object-fit:contain;position:absolute;right:16px;transform:none;width:auto}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos{display:flex;flex:1 1;flex-direction:column;justify-content:space-between;margin-left:40px;padding:16px;position:relative}@media (max-width:1022px){.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__infos__price__wrapper{display:none}}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top{display:flex;flex-direction:column;position:relative}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__type{color:var(--m-color-black);font-size:14px;line-height:1.14;padding-bottom:16px;text-align:left}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__title{color:var(--m-color-secondary);font-size:32px;font-weight:700;line-height:1.1;text-align:left}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__difficulty{display:flex;padding:16px 0}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__difficulty ng-miam-icon{margin-right:8px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__metrics{align-items:center;display:flex;flex-direction:column}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__metrics span{color:var(--m-color-black);font-size:14px;margin-left:12px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__metrics .miam-recipe-details__metrics__row{display:flex}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description{color:var(--m-color-grey-text-dark);display:flex;flex:1;flex-direction:column;font-size:17px;line-height:1.62;margin-bottom:24px;overflow-y:auto;text-align:left;word-break:break-word}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action{align-items:center;display:flex;margin-top:16px}@media print{.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action{display:none}}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action>*{cursor:pointer}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action>:hover{color:var(--m-color-primary);text-decoration:underline}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action ng-miam-icon{margin-right:10px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper{align-items:flex-end;display:flex;flex-direction:column;height:100%;justify-content:flex-start;max-height:225px;padding-left:16px;position:relative}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price{margin-bottom:4px;padding:4px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price .miam-recipe-pricing__wrapper{color:var(--m-color-primary);flex-direction:row}@media (max-width:1022px){.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price .miam-recipe-pricing__wrapper{display:flex;flex-direction:column}}@media print{.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price .miam-recipe-pricing__wrapper{display:none}}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__price{font-size:20px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__subline{font-size:14px;margin-left:12px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action{border-radius:20px;color:var(--m-color-white);font-size:16px;padding:8px 20px}@media print{.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action{display:none}}@media (min-width:1022px){.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action:hover{color:var(--m-color-primary)}}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action ng-miam-icon{margin-left:16px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action .loader{border:var(--m-loader-thickness) solid transparent;border-top:var(--m-loader-thickness) solid var(--m-color-white);height:24px;width:24px}.miam-recipe-details .miam-recipe-details__top__container__info{align-items:center;display:flex;flex-direction:column;gap:24px;justify-content:center;padding:16px 0;width:370px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__metrics{align-items:center;display:flex;justify-content:center}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__metrics span{color:var(--m-color-primary);font-size:19px;font-weight:700;margin-left:12px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times{align-items:center;display:flex;justify-content:space-evenly}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics{flex-direction:column;margin-right:24px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics span{color:var(--m-color-black);font-size:13px;font-weight:400;line-height:16px;margin-left:4px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics .miam-recipe-details__metrics__row{align-items:center;display:flex}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics .miam-recipe-details__metrics__row span{font-size:19px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics{align-items:center;display:flex;justify-content:center;z-index:0}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics ng-miam-icon{display:flex;justify-content:center;margin-right:4px;min-height:32px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics span{font-size:15px}.miam-recipe-details .miam-recipe-details__mid__container{border-bottom:1px dashed var(--m-color-primary);display:flex;padding-bottom:16px;width:100%}.miam-recipe-details .miam-recipe-details__tags__container{display:flex;flex-wrap:wrap;padding:20px;width:100%}.miam-recipe-details .miam-recipe-details__tags__container .miam-recipe-details__tag{background-color:var(--m-color-grey05);border-radius:var(--m-border-radius-pill);display:flex;margin:4px;padding:4px 8px}.miam-recipe-details .miam-recipe-details__tags__container .miam-recipe-details__tag .miam-recipe-details__tag__icon{height:16px;width:16px}.miam-recipe-details .miam-recipe-details__tags__container .miam-recipe-details__tag .miam-recipe-details__tag__name{font-size:16px}.miam-recipe-details .miam-recipe-details__bottom__container{display:flex;width:100%}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__header{border-bottom:1px solid var(--m-color-grey-text);color:var(--m-color-primary);display:block;font-size:20px;font-size:17px;font-weight:700;margin:24px 0;padding:16px 0 8px;position:relative}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__counter{align-items:center;display:flex}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__counter ng-miam-counter-input .miam-counter-input__icon{margin-right:16px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__counter .miam-recipe-details__ingredients__counter__print{display:none}@media print{.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__counter ng-miam-counter-input{display:none}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__counter .miam-recipe-details__ingredients__counter__print{display:block}}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__list{flex:1 1;overflow-y:auto;padding-bottom:40px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__list::-webkit-scrollbar-track{background:var(--m-color-grey)}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__list::-webkit-scrollbar{cursor:-webkit-grab;height:7px;width:5px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__list::-webkit-scrollbar-thumb{background:var(--m-color-primary);border-radius:5px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__row{color:var(--m-color-black);display:flex;font-size:14px;font-weight:700;height:40px;justify-content:space-between;padding-bottom:16px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__row .miam-recipe-details__ingredients__row__qty{color:var(--m-color-grey-text-dark);font-size:14px;font-weight:500;padding-right:10px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__ingredients{display:flex;flex:1;flex-direction:column;padding:0 40px 0 0}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps{display:flex;flex:1;flex-direction:column}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list{flex:1 1;overflow-y:auto;padding-bottom:40px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list::-webkit-scrollbar-track{background:var(--m-color-grey)}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list::-webkit-scrollbar{cursor:-webkit-grab;height:7px;width:5px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list::-webkit-scrollbar-thumb{background:var(--m-color-primary);border-radius:5px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel{-webkit-tap-highlight-color:transparent;align-items:center;background-color:var(--m-color-primary-text);border-radius:var(--m-border-radius);cursor:pointer;display:flex;flex-direction:row;margin:0 16px 8px 0;text-align:left;transition:var(--m-default-transition)}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__idx{color:var(--m-color-secondary);flex:0 0 auto;font-size:20px;margin-right:20px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__text{font-size:14px;word-break:break-word}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__checkIcon{flex:0 0 auto}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel.miam-recipe-details__panel__done{background-color:var(--m-color-secondary-light)}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel div{flex:1;margin:10px}.miam-recipe-details .miam-recipe-details__bottom__container__action{width:100%}@media print{.miam-recipe-details{height:unset}}@media (max-width:1022px){.miam-recipe-details{height:80vh;margin:0;min-width:100vw;overflow-y:auto;padding:0 0 80px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper{align-items:center;background-color:var(--m-color-white);bottom:0;flex-direction:row;height:unset;justify-content:space-between;left:0;padding:4px 16px;position:fixed;right:0}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-pricing__wrapper{flex-direction:column}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__subline{font-size:10px;margin-left:0}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action{padding:8px 10px}.miam-recipe-details .miam-recipe-details__top__container{flex-wrap:wrap}.miam-recipe-details .miam-recipe-details__top__container div .miam-recipe-details__top__left{position:-webkit-sticky;position:sticky;top:0;z-index:3}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__info__times{position:-webkit-sticky;position:sticky;top:0;z-index:1}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img{height:220px;position:-webkit-sticky;position:sticky;top:-5vh;width:100vw;z-index:3}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img img{height:unset;transform:none;width:100%}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__tag{bottom:unset;left:16px;top:16px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions{bottom:0;flex-direction:unset;left:8px;right:unset;top:unset}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions .miam-recipe-details__actions__icon{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:rgba(0,0,0,.65);background-color:unset;box-shadow:none;margin:0 4px 8px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos{flex:unset;margin-left:unset;padding:0 16px;width:100vw;z-index:0}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__type{display:none}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__title{font-size:24px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description{margin-bottom:16px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action{display:none}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__info{background-color:var(--m-color-white);width:unset;z-index:1}.miam-recipe-details .miam-recipe-details__mobile__container{display:flex;flex-direction:column;min-height:80vh;padding-bottom:50px;position:relative;width:100vw}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__mobile__header{background-color:var(--m-color-white);border-radius:32px 32px 0 0;display:flex;justify-content:space-evenly;padding:16px 0;position:-webkit-sticky;position:sticky;top:0;z-index:1}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__mobile__header button{margin-right:0}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__mobile__header button.active{background-color:var(--m-color-primary);color:var(--m-color-white)}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__row{align-items:center;color:var(--m-color-black);display:flex;font-size:14px;font-weight:700;justify-content:space-between;padding-bottom:16px;padding-right:16px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__row div{width:100%}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__row .miam-recipe-details__ingredients__row__qty{color:var(--m-color-grey-text-dark);font-size:14px;font-weight:500;margin-right:16px;padding-right:10px;text-align:end}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__counter{display:flex;justify-content:space-between;padding:16px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__counter .miam-recipe-details__ingredients__counter__print{display:none}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__list{display:flex;flex-direction:column}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__list .miam-recipe-details__ingredients__row{display:flex;font-size:16px;justify-content:space-between;padding:0 16px 16px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel{-webkit-tap-highlight-color:transparent;align-items:center;align-items:flex-start;background-color:transparent;border-radius:var(--m-border-radius);cursor:pointer;display:flex;flex-direction:row;margin:0 8px 32px;padding:0;position:relative;text-align:left;transition:var(--m-default-transition)}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel:not(:last-child):before{background-color:var(--m-color-grey);content:\"\";height:50%;left:29px;position:absolute;top:60px;width:1px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel.miam-recipe-details__panel__done{background-color:var(--miam-color-primary-light)}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__idx{align-items:center;background-color:var(--m-color-primary);border-radius:40px;color:#fff;display:flex;flex:0 0 auto;font-size:17px;font-weight:700;height:40px;justify-content:center;margin-right:20px;width:40px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__text{font-size:14px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__checkIcon{flex:0 0 auto}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel div{flex:1;margin:10px}.miam-recipe-details .miam-recipe-details__bottom__container__action{background:var(--m-color-white);bottom:0;left:0;padding:0 16px;position:fixed;right:0;width:100vw;z-index:4}}"], encapsulation: 2, changeDetection: 0 });
15992
+ }, directives: [i8.NgIf, IconComponent, i8.NgSwitch, i8.NgSwitchCase, i8.NgSwitchDefault, i34.YouTubePlayer, LikeButtonComponent, RecipePricingComponent, i8.NgClass, LoaderComponent, i8.NgForOf, AddonLinkComponent, CounterInputComponent, RecipeAddonComponent], pipes: [i8.AsyncPipe, i8.TitleCasePipe, CapitalizeFirstLetterPipe, ReadableFloatNumberPipe], styles: [".miam-recipe-details{border-radius:var(--m-border-radius);display:inline-flex;flex-direction:row;flex-wrap:wrap;height:calc(80vh - 80px);margin:40px 8px;min-width:calc(100% - 32px);padding:0 16px}.miam-recipe-details::-webkit-scrollbar-button{height:20px}.miam-recipe-details::-webkit-scrollbar-track{background:var(--m-color-grey)}.miam-recipe-details::-webkit-scrollbar{cursor:-webkit-grab;height:7px;width:5px}.miam-recipe-details::-webkit-scrollbar-thumb{background:var(--m-color-primary);border-radius:5px}.miam-recipe-details .miam-recipe-details__top__container{display:flex;justify-content:space-evenly}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img{align-items:center;border-radius:var(--m-border-radius);display:flex;height:400px;overflow:hidden;position:relative;width:370px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img img{-o-object-fit:cover;-webkit-print-color-adjust:exact;display:block;height:100%;object-fit:cover;transform:translateX(-25%)}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__gradient{background:linear-gradient(180deg,transparent 57.92%,rgba(0,0,0,.75) 100%,rgba(0,0,0,.75) 0);border-top-left-radius:var(--m-border-radius);border-top-right-radius:var(--m-border-radius);display:block;height:100%;position:absolute;top:0;width:100%}@media print{.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__gradient{display:none}}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__tag{background-color:var(--m-color-primary-light);border-radius:5px;bottom:16px;color:var(--m-color-primary);font-weight:500;left:16px;padding:8px;position:absolute;text-transform:uppercase}@media print{.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__tag{display:none}}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions{display:flex;flex-direction:column;justify-content:space-evenly;position:absolute;right:16px;top:16px;z-index:var(--m-z-index-position-absolute-hight)}@media print{.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions{display:none}}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions .miam-recipe-details__actions__icon{-o-object-fit:contain;background-color:#fff;border-radius:var(--m-border-radius-circle);box-shadow:var(--m-shadow-small);margin:0 0 16px;object-fit:contain;padding:8px;width:-webkit-max-content;width:-moz-max-content;width:max-content}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions .miam-recipe-details__actions__icon.miam-noPadding{padding:0}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__sponsor{-o-object-fit:contain;bottom:16px;height:auto;max-height:72px;max-width:96px;object-fit:contain;position:absolute;right:16px;transform:none;width:auto}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos{display:flex;flex:1 1;flex-direction:column;justify-content:space-between;margin-left:40px;padding:16px;position:relative}@media (max-width:1022px){.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__infos__price__wrapper{display:none}}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top{display:flex;flex-direction:column;position:relative}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__type{color:var(--m-color-black);font-size:14px;line-height:1.14;padding-bottom:16px;text-align:left}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__title{color:var(--m-color-secondary);font-size:32px;font-weight:700;line-height:1.1;text-align:left}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__difficulty{display:flex;padding:16px 0}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__difficulty ng-miam-icon{margin-right:8px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__metrics{align-items:center;display:flex;flex-direction:column}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__metrics span{color:var(--m-color-black);font-size:14px;margin-left:12px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__metrics .miam-recipe-details__metrics__row{display:flex}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description{color:var(--m-color-grey-text-dark);display:flex;flex:1;flex-direction:column;font-size:17px;line-height:1.62;margin-bottom:24px;overflow-y:auto;text-align:left;word-break:break-word}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action{align-items:center;display:flex;margin-top:16px}@media print{.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action{display:none}}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action>*{cursor:pointer}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action>:hover{color:var(--m-color-primary);text-decoration:underline}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action ng-miam-icon{margin-right:10px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper{align-items:flex-end;display:flex;flex-direction:column;height:100%;justify-content:flex-start;max-height:225px;padding-left:16px;position:relative}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price{margin-bottom:4px;padding:4px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price .miam-recipe-pricing__wrapper{color:var(--m-color-primary);flex-direction:row}@media (max-width:1022px){.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price .miam-recipe-pricing__wrapper{display:flex;flex-direction:column}}@media print{.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price .miam-recipe-pricing__wrapper{display:none}}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__price{font-size:20px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__price .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__subline{font-size:14px;margin-left:12px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action{border-radius:20px;color:var(--m-color-white);font-size:16px;padding:8px 20px}@media print{.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action{display:none}}@media (min-width:1022px){.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action:hover{color:var(--m-color-primary)}}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action ng-miam-icon{margin-left:16px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action .loader{border:var(--m-loader-thickness) solid transparent;border-top:var(--m-loader-thickness) solid var(--m-color-white);height:24px;width:24px}.miam-recipe-details .miam-recipe-details__top__container__info{align-items:center;display:flex;flex-direction:column;gap:24px;justify-content:center;padding:16px 0;width:370px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__metrics{align-items:center;display:flex;justify-content:center}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__metrics span{color:var(--m-color-primary);font-size:19px;font-weight:700;margin-left:12px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times{align-items:center;display:flex;justify-content:space-evenly}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics{flex-direction:column;margin-right:24px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics span{color:var(--m-color-black);font-size:13px;font-weight:400;line-height:16px;margin-left:4px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics .miam-recipe-details__metrics__row{align-items:center;display:flex}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics .miam-recipe-details__metrics__row span{font-size:19px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics{align-items:center;display:flex;justify-content:center;z-index:0}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics ng-miam-icon{display:flex;justify-content:center;margin-right:4px;min-height:32px}.miam-recipe-details .miam-recipe-details__top__container__info .miam-recipe-details__info__times .miam-recipe-details__info__metrics span{font-size:15px}.miam-recipe-details .miam-recipe-details__mid__container{border-bottom:1px dashed var(--m-color-primary);display:flex;padding-bottom:16px;width:100%}.miam-recipe-details .miam-recipe-details__tags__container{display:flex;flex-wrap:wrap;padding:20px;width:100%}.miam-recipe-details .miam-recipe-details__tags__container .miam-recipe-details__tag{background-color:var(--m-color-grey05);border-radius:var(--m-border-radius-pill);display:flex;margin:4px;padding:4px 8px}.miam-recipe-details .miam-recipe-details__tags__container .miam-recipe-details__tag .miam-recipe-details__tag__icon{height:16px;width:16px}.miam-recipe-details .miam-recipe-details__tags__container .miam-recipe-details__tag .miam-recipe-details__tag__name{font-size:16px}.miam-recipe-details .miam-recipe-details__bottom__container{display:flex;width:100%}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__header{border-bottom:1px solid var(--m-color-grey-text);color:var(--m-color-primary);display:block;font-size:20px;font-size:17px;font-weight:700;margin:24px 0;padding:16px 0 8px;position:relative}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__counter{align-items:center;display:flex}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__counter ng-miam-counter-input .miam-counter-input__icon{margin-right:16px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__counter .miam-recipe-details__ingredients__counter__print{display:none}@media print{.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__counter ng-miam-counter-input{display:none}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__counter .miam-recipe-details__ingredients__counter__print{display:block}}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__list{flex:1 1;overflow-y:auto;padding-bottom:40px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__list::-webkit-scrollbar-track{background:var(--m-color-grey)}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__list::-webkit-scrollbar{cursor:-webkit-grab;height:7px;width:5px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__list::-webkit-scrollbar-thumb{background:var(--m-color-primary);border-radius:5px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__row{color:var(--m-color-black);display:flex;font-size:14px;font-weight:700;height:40px;justify-content:space-between;padding-bottom:16px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__ingredients__row .miam-recipe-details__ingredients__row__qty{color:var(--m-color-grey-text-dark);font-size:14px;font-weight:500;padding-right:10px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__ingredients{display:flex;flex:1;flex-direction:column;padding:0 40px 0 0}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps{display:flex;flex:1;flex-direction:column}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list{flex:1 1;overflow-y:auto;padding-bottom:40px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list::-webkit-scrollbar-track{background:var(--m-color-grey)}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list::-webkit-scrollbar{cursor:-webkit-grab;height:7px;width:5px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list::-webkit-scrollbar-thumb{background:var(--m-color-primary);border-radius:5px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel{-webkit-tap-highlight-color:transparent;align-items:center;background-color:var(--m-color-primary-text);border-radius:var(--m-border-radius);cursor:pointer;display:flex;flex-direction:row;margin:0 16px 8px 0;text-align:left;transition:var(--m-default-transition)}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__idx{color:var(--m-color-secondary);flex:0 0 auto;font-size:20px;margin-right:20px}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__text{font-size:14px;word-break:break-word}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__checkIcon{flex:0 0 auto}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel.miam-recipe-details__panel__done{background-color:var(--m-color-secondary-light)}.miam-recipe-details .miam-recipe-details__bottom__container .miam-recipe-details__bottom__container__steps .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel div{flex:1;margin:10px}.miam-recipe-details .miam-recipe-details__bottom__container__action{width:100%}@media print{.miam-recipe-details{height:unset}}@media (max-width:1022px){.miam-recipe-details{height:80vh;margin:0;min-width:100vw;overflow-y:auto;padding:0 0 80px}.miam-recipe-details .miam-recipe-details__infos__price__wrapper{align-items:center;background-color:var(--m-color-white);bottom:0;flex-direction:row;height:unset;justify-content:space-between;left:0;padding:4px 16px;position:fixed;right:0}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-pricing__wrapper{flex-direction:column}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__subline{font-size:10px;margin-left:0}.miam-recipe-details .miam-recipe-details__infos__price__wrapper .miam-recipe-details__infos__action{padding:8px 10px}.miam-recipe-details .miam-recipe-details__top__container{flex-wrap:wrap}.miam-recipe-details .miam-recipe-details__top__container div .miam-recipe-details__top__left{position:-webkit-sticky;position:sticky;top:0;z-index:3}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__info__times{position:-webkit-sticky;position:sticky;top:0;z-index:1}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img{height:220px;position:-webkit-sticky;position:sticky;top:-5vh;width:100vw;z-index:3}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img img{height:unset;transform:none;width:100%}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__picture__tag{bottom:unset;left:16px;top:16px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions{bottom:0;flex-direction:unset;left:8px;right:unset;top:unset}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__img .miam-recipe-details__img__actions .miam-recipe-details__actions__icon{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:rgba(0,0,0,.65);background-color:unset;box-shadow:none;margin:0 4px 8px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos{flex:unset;margin-left:unset;padding:0 16px;width:100vw;z-index:0}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__type{display:none}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__title{font-size:24px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description{margin-bottom:16px}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__infos .miam-recipe-details__top__container__infos__top .miam-recipe-details__infos__description .miam-recipe-details__description__action{display:none}.miam-recipe-details .miam-recipe-details__top__container .miam-recipe-details__top__container__info{background-color:var(--m-color-white);width:unset;z-index:1}.miam-recipe-details .miam-recipe-details__mobile__container{display:flex;flex-direction:column;min-height:80vh;padding-bottom:50px;position:relative;width:100vw}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__mobile__header{background-color:var(--m-color-white);border-radius:32px 32px 0 0;display:flex;justify-content:space-evenly;padding:16px 0;position:-webkit-sticky;position:sticky;top:0;z-index:1}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__mobile__header button{margin-right:0}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__mobile__header button.active{background-color:var(--m-color-primary);color:var(--m-color-white)}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__row{align-items:center;color:var(--m-color-black);display:flex;font-size:14px;font-weight:700;justify-content:space-between;padding-bottom:16px;padding-right:16px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__row div{width:100%}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__row .miam-recipe-details__ingredients__row__qty{color:var(--m-color-grey-text-dark);font-size:14px;font-weight:500;margin-right:16px;padding-right:10px;text-align:end}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__counter{display:flex;justify-content:space-between;padding:16px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__counter .miam-recipe-details__ingredients__counter__print{display:none}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__list{display:flex;flex-direction:column}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__ingredients__list .miam-recipe-details__ingredients__row{display:flex;font-size:16px;justify-content:space-between;padding:0 16px 16px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel{-webkit-tap-highlight-color:transparent;align-items:center;align-items:flex-start;background-color:transparent;border-radius:var(--m-border-radius);cursor:pointer;display:flex;flex-direction:row;margin:0 8px 32px;padding:0;position:relative;text-align:left;transition:var(--m-default-transition)}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel:not(:last-child):before{background-color:var(--m-color-grey);content:\"\";height:50%;left:29px;position:absolute;top:60px;width:1px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel.miam-recipe-details__panel__done{background-color:var(--miam-color-primary-light)}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__idx{align-items:center;background-color:var(--m-color-primary);border-radius:40px;color:#fff;display:flex;flex:0 0 auto;font-size:17px;font-weight:700;height:40px;justify-content:center;margin-right:20px;width:40px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__text{font-size:14px}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel .miam-recipe-details__panel__checkIcon{flex:0 0 auto}.miam-recipe-details .miam-recipe-details__mobile__container .miam-recipe-details__steps__list .miam-recipe-details__steps__list__panel div{flex:1;margin:10px}.miam-recipe-details .miam-recipe-details__bottom__container__action{background:var(--m-color-white);bottom:0;left:0;padding:0 16px;position:fixed;right:0;width:100vw;z-index:4}}"], encapsulation: 2, changeDetection: 0 });
15212
15993
  /*@__PURE__*/ (function () {
15213
15994
  i0.ɵsetClassMetadata(RecipeDetailsComponent, [{
15214
15995
  type: i0.Component,
@@ -15231,6 +16012,10 @@
15231
16012
  type: i0.Input
15232
16013
  }], displayTagsIcons: [{
15233
16014
  type: i0.Input
16015
+ }], displayPricing: [{
16016
+ type: i0.Input
16017
+ }], displayAddedOnPicture: [{
16018
+ type: i0.Input
15234
16019
  }], recipeAdded: [{
15235
16020
  type: i0.Output
15236
16021
  }], recipeChanged: [{
@@ -15831,7 +16616,7 @@
15831
16616
  this.mediaMatcher = mediaMatcher;
15832
16617
  this.stringDetailLocation = 'dans l\'onglet Mes Repas';
15833
16618
  this.close = new i0.EventEmitter();
15834
- this.moreInfo = new i0.EventEmitter();
16619
+ // @Output() moreInfo = new EventEmitter();
15835
16620
  this.icon = exports.Icon;
15836
16621
  this.isMobile = false;
15837
16622
  this.isDisplayed = false;
@@ -15850,16 +16635,16 @@
15850
16635
  this.recipesService.toggleHelper();
15851
16636
  this.close.emit();
15852
16637
  };
15853
- RecipeHelperComponent.prototype.onMoreInfo = function () {
15854
- this.moreInfo.emit();
15855
- };
16638
+ // onMoreInfo() {
16639
+ // this.moreInfo.emit();
16640
+ // }
15856
16641
  RecipeHelperComponent.prototype.ngOnDestroy = function () {
15857
16642
  this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
15858
16643
  };
15859
16644
  return RecipeHelperComponent;
15860
16645
  }());
15861
16646
  RecipeHelperComponent.ɵfac = function RecipeHelperComponent_Factory(t) { return new (t || RecipeHelperComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(RecipesService), i0.ɵɵdirectiveInject(i1$2.MediaMatcher)); };
15862
- RecipeHelperComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RecipeHelperComponent, selectors: [["ng-miam-recipe-helper"]], inputs: { stringDetailLocation: "stringDetailLocation" }, outputs: { close: "close", moreInfo: "moreInfo" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "miam-shadow-overlay", 3, "click"], [1, "miam-recipe-helper"], [1, "miam-recipe-helper__header"], [3, "width", "height", "iconName", 4, "ngIf", "ngIfElse"], ["mobileIcon", ""], [1, "miam-recipe-helper__title"], [1, "miam-recipe-helper__description"], [1, "miam-recipe-helper__how"], [1, "miam-recipe-helper__step"], [1, "miam-recipe-helper__step__number"], [1, "miam-recipe-helper__step__description"], [1, "m-button-fab-primary", "miam-recipe-helper__step__icon"], ["primaryColor", "var(--m-color-white)", 3, "width", "height", "iconName"], [1, "miam-recipe-helper__actions"], [1, "m-button-secondary", 3, "click"], [3, "width", "height", "iconName"]], template: function RecipeHelperComponent_Template(rf, ctx) {
16647
+ RecipeHelperComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RecipeHelperComponent, selectors: [["ng-miam-recipe-helper"]], inputs: { stringDetailLocation: "stringDetailLocation" }, outputs: { close: "close" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "miam-shadow-overlay", 3, "click"], [1, "miam-recipe-helper"], [1, "miam-recipe-helper__header"], [3, "width", "height", "iconName", 4, "ngIf", "ngIfElse"], ["mobileIcon", ""], [1, "miam-recipe-helper__title"], [1, "miam-recipe-helper__description"], [1, "miam-recipe-helper__how"], [1, "miam-recipe-helper__step"], [1, "miam-recipe-helper__step__number"], [1, "miam-recipe-helper__step__description"], [1, "m-button-fab-primary", "miam-recipe-helper__step__icon"], ["primaryColor", "var(--m-color-white)", 3, "width", "height", "iconName"], [1, "miam-recipe-helper__actions"], [1, "m-button-secondary", 3, "click"], [3, "width", "height", "iconName"]], template: function RecipeHelperComponent_Template(rf, ctx) {
15863
16648
  if (rf & 1) {
15864
16649
  i0.ɵɵtemplate(0, RecipeHelperComponent_ng_container_0_Template, 41, 6, "ng-container", 0);
15865
16650
  }
@@ -15881,8 +16666,6 @@
15881
16666
  type: i0.Input
15882
16667
  }], close: [{
15883
16668
  type: i0.Output
15884
- }], moreInfo: [{
15885
- type: i0.Output
15886
16669
  }] });
15887
16670
  })();
15888
16671
 
@@ -16280,7 +17063,7 @@
16280
17063
  i0.ɵɵadvance(1);
16281
17064
  i0.ɵɵproperty("ngIf", ctx_r2.displayTags);
16282
17065
  i0.ɵɵadvance(5);
16283
- i0.ɵɵproperty("buttonText", (ctx_r2.recipeForm == null ? null : (tmp_6_0 = ctx_r2.recipeForm.get("attributes")) == null ? null : (tmp_6_1 = tmp_6_0.get("media-url")) == null ? null : tmp_6_1.value == null ? null : tmp_6_1.value.length) > 0 ? "Modifier la photo (2MB max)" : "Ajouter une photo (2MB max)")("formControl", ctx_r2.recipeForm == null ? null : (tmp_7_0 = ctx_r2.recipeForm.get("attributes")) == null ? null : tmp_7_0.get("media-url"))("imageUrl", ctx_r2.recipeForm == null ? null : (tmp_8_0 = ctx_r2.recipeForm.get("attributes")) == null ? null : (tmp_8_1 = tmp_8_0.get("media-url")) == null ? null : tmp_8_1.value)("photoMode", true);
17066
+ i0.ɵɵproperty("buttonText", (ctx_r2.recipeForm == null ? null : (tmp_6_0 = ctx_r2.recipeForm.get("attributes")) == null ? null : (tmp_6_1 = tmp_6_0.get("media-url")) == null ? null : tmp_6_1.value == null ? null : tmp_6_1.value.length) > 0 ? "Modifier la photo (2MB max)" : "Ajouter une photo (2MB max)")("formControl", ctx_r2.recipeForm == null ? null : (tmp_7_0 = ctx_r2.recipeForm.get("attributes")) == null ? null : tmp_7_0.get("media-url"))("imageUrl", ctx_r2.recipeForm == null ? null : (tmp_8_0 = ctx_r2.recipeForm.get("attributes")) == null ? null : (tmp_8_1 = tmp_8_0.get("media-url")) == null ? null : tmp_8_1.value)("photoMode", false);
16284
17067
  i0.ɵɵadvance(1);
16285
17068
  i0.ɵɵproperty("ngIf", ctx_r2.bigImageWarning);
16286
17069
  i0.ɵɵadvance(3);
@@ -17112,9 +17895,12 @@
17112
17895
  };
17113
17896
  // If the recipe is already in basket, update the number of guests (= append recipe to list again)
17114
17897
  RecipeModalComponent.prototype.recipeChanged = function () {
17115
- if (this.groceriesListsService.list$.value.hasRecipe(this.recipe.id)) {
17116
- this.groceriesListsService.appendRecipeToList(this.recipe.id, this.recipe.modifiedGuests, 'recipe-modal').subscribe();
17117
- }
17898
+ var _this = this;
17899
+ this.groceriesListsService.recipeIsInList(this.recipe.id).subscribe(function (recipeIsInList) {
17900
+ if (recipeIsInList) {
17901
+ _this.groceriesListsService.appendRecipeToList(_this.recipe.id, _this.recipe.modifiedGuests, 'recipe-modal').subscribe();
17902
+ }
17903
+ });
17118
17904
  this.recipesService.displayedRecipeChanged.emit();
17119
17905
  };
17120
17906
  return RecipeModalComponent;
@@ -17169,7 +17955,7 @@
17169
17955
  }
17170
17956
  if (rf & 2) {
17171
17957
  var ctx_r0 = i0.ɵɵnextContext();
17172
- i0.ɵɵproperty("recipe", ctx_r0.recipe)("headerText", ctx_r0.headerText);
17958
+ i0.ɵɵproperty("recipe", ctx_r0.recipe)("headerText", ctx_r0.headerText)("displayPricing", ctx_r0.displayPricing)("displayAddedOnPicture", ctx_r0.displayAddedOnPicture);
17173
17959
  }
17174
17960
  }
17175
17961
  /**
@@ -17203,19 +17989,19 @@
17203
17989
  // If recipe already in basket, update the number of guests so that the pricing gets updated as well
17204
17990
  // (display = false so that the recipe details don't show up)
17205
17991
  SuggestionCardComponent.prototype.guestsChanged = function () {
17206
- if (this.groceriesListsService.list$.value.hasRecipe(this.recipe.id)) {
17207
- this.addRecipe(false);
17208
- }
17992
+ var _this = this;
17993
+ this.subscriptions.push(this.groceriesListsService.recipeIsInList(this.recipe.id).subscribe(function (recipeIsInList) {
17994
+ if (recipeIsInList) {
17995
+ _this.addRecipe(false);
17996
+ }
17997
+ }));
17209
17998
  };
17210
17999
  SuggestionCardComponent.prototype.loadRecipe = function () {
17211
18000
  var _this = this;
17212
- this.subscriptions.push(rxjs.combineLatest([
17213
- this.groceriesListsService.list$,
17214
- this.fetchRecipes()
17215
- ]).pipe(operators.skipWhile(function (results) { return !results[0] || !results[1]; }), operators.catchError(function (err) {
18001
+ this.subscriptions.push(this.fetchRecipes().pipe(operators.skipWhile(function (results) { return !results; }), operators.catchError(function (err) {
17216
18002
  _this.hide.emit();
17217
18003
  return rxjs.of(err);
17218
- })).subscribe(function (results) { return _this.processResults(results[0], results[1]); }));
18004
+ })).subscribe(function (results) { return _this.processResults(results); }));
17219
18005
  };
17220
18006
  SuggestionCardComponent.prototype.fetchRecipes = function () {
17221
18007
  var _a, _b, _c;
@@ -17228,15 +18014,22 @@
17228
18014
  };
17229
18015
  // If the recipe is in basket, will show number of guests as defined in the basket
17230
18016
  // Otherwise, will show default number of guests for the recipe
17231
- SuggestionCardComponent.prototype.processResults = function (list, recipes) {
18017
+ SuggestionCardComponent.prototype.processResults = function (recipes) {
18018
+ var _this = this;
17232
18019
  var _a, _b;
17233
18020
  this.isEmpty = (!recipes || recipes.length === 0);
17234
- if (list && !this.isEmpty) {
18021
+ if (!this.isEmpty) {
17235
18022
  var recipeChanged = ((_a = this.recipe) === null || _a === void 0 ? void 0 : _a.id) !== ((_b = recipes[0]) === null || _b === void 0 ? void 0 : _b.id);
17236
18023
  // get the first recipe and shallow copy it to permit to send event and do not disturb any other component
17237
18024
  // if ressource is cached without copy another load will get the attributes
17238
18025
  this.recipe = recipes[0].shallowCopyWithEvents(this.recipeEventsService.ORIGIN_SUGGESTION, this.eventsGroupId);
17239
- this.recipe.modifiedGuests = list.guestsForRecipe(this.recipe) || +this.recipe.guests;
18026
+ // Update guests from list only if recipe is in list
18027
+ this.subscriptions.push(this.groceriesListsService.recipeIsInList(this.recipe.id).subscribe(function (isInList) {
18028
+ if (isInList) {
18029
+ _this.recipe.modifiedGuests = _this.groceriesListsService.guestsForRecipe(_this.recipe) || +_this.recipe.guests;
18030
+ _this.recipeCard.cdr.markForCheck();
18031
+ }
18032
+ }));
17240
18033
  this.initIngredientsString();
17241
18034
  this.recipeCard.cdr.markForCheck();
17242
18035
  if (recipeChanged) {
@@ -17264,9 +18057,9 @@
17264
18057
  if (rf & 1) {
17265
18058
  i0.ɵɵlistener("scroll", function SuggestionCardComponent_scroll_HostBindingHandler() { return ctx.onScroll(); }, false, i0.ɵɵresolveWindow);
17266
18059
  }
17267
- }, inputs: { randomModeEnable: "randomModeEnable", context: "context" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [[3, "recipe", "headerText", "guestsChanged", 4, "ngIf"], [3, "recipe", "headerText", "guestsChanged"], ["recipeCard", ""]], template: function SuggestionCardComponent_Template(rf, ctx) {
18060
+ }, inputs: { randomModeEnable: "randomModeEnable", context: "context" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [[3, "recipe", "headerText", "displayPricing", "displayAddedOnPicture", "guestsChanged", 4, "ngIf"], [3, "recipe", "headerText", "displayPricing", "displayAddedOnPicture", "guestsChanged"], ["recipeCard", ""]], template: function SuggestionCardComponent_Template(rf, ctx) {
17268
18061
  if (rf & 1) {
17269
- i0.ɵɵtemplate(0, SuggestionCardComponent_ng_miam_recipe_card_0_Template, 2, 2, "ng-miam-recipe-card", 0);
18062
+ i0.ɵɵtemplate(0, SuggestionCardComponent_ng_miam_recipe_card_0_Template, 2, 4, "ng-miam-recipe-card", 0);
17270
18063
  }
17271
18064
  if (rf & 2) {
17272
18065
  i0.ɵɵproperty("ngIf", !ctx.isEmpty);