mealz-components 2.4.0 → 2.4.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 (112) hide show
  1. package/dist/assets/{OperatorSubscriber-DF1TYu__.js → OperatorSubscriber-BaYaQC1O.js} +1 -1
  2. package/dist/assets/{accordion-Ba11uzYA.js → accordion-DJLqKUJq.js} +1 -1
  3. package/dist/assets/args-BozZ6oU-.js +1 -0
  4. package/dist/assets/{async-D5WN8Wfc.js → async-CFBGA-Dz.js} +1 -1
  5. package/dist/assets/combineLatest-BmqPE0OB.js +1 -0
  6. package/dist/assets/{debounceTime-D7R6Z3Am.js → debounceTime-B4DpnstH.js} +1 -1
  7. package/dist/assets/delay-BNnJ-6LE.js +1 -0
  8. package/dist/assets/{distinctUntilChanged-VvZTmHoN.js → distinctUntilChanged-91AVuO2B.js} +1 -1
  9. package/dist/assets/empty-0eVnsLmk.js +1 -0
  10. package/dist/assets/executeSchedule-CEDvgTzM.js +1 -0
  11. package/dist/assets/{filter-DQ4vwAGj.js → filter-BZ75lS5D.js} +1 -1
  12. package/dist/assets/from-CAidt5N1.js +1 -0
  13. package/dist/assets/{innerFrom-FMZwm2mb.js → innerFrom-BgPDnAsH.js} +1 -1
  14. package/dist/assets/isScheduler-C5PGPVU1.js +1 -0
  15. package/dist/assets/{map-DHslluWD.js → map-BVOhpQm0.js} +1 -1
  16. package/dist/assets/mapOneOrManyArgs-COA1aRZM.js +1 -0
  17. package/dist/assets/merge-Cm-mm3_Q.js +1 -0
  18. package/dist/assets/mergeAll-BdUAXyrs.js +1 -0
  19. package/dist/assets/{mergeMap-g-JGW99j.js → mergeMap-Dw_YYHwH.js} +1 -1
  20. package/dist/assets/{no-shadow-element-Dz9jgDtr.js → no-shadow-element-YPHUv5PR.js} +1 -1
  21. package/dist/assets/of-DiALp3BZ.js +1 -0
  22. package/dist/assets/{price-CHipCs2z.js → price-DAxY_7sk.js} +1 -1
  23. package/dist/assets/{product-card-c_0I2Lp_.js → product-card-HetVhdJ3.js} +1 -1
  24. package/dist/assets/{promotion-badge-CzwsPJJq.js → promotion-badge-8Arhhb-p.js} +1 -1
  25. package/dist/assets/{property-Bx8Yvr4_.js → property-_7ObQ3dl.js} +1 -1
  26. package/dist/assets/skip-zbH-ayby.js +1 -0
  27. package/dist/assets/{skipWhile-BzDgmir5.js → skipWhile-BZVFq1Cg.js} +1 -1
  28. package/dist/assets/{state-C5zM4-Pq.js → state-W5mtSPAs.js} +1 -1
  29. package/dist/assets/{switchMap-6Z80ObHE.js → switchMap-Dk_0Nhlo.js} +1 -1
  30. package/dist/assets/{take-ByPtGQky.js → take-CozE9iSG.js} +1 -1
  31. package/dist/assets/{tap-K_D6lo97.js → tap-C8CJ3R2H.js} +1 -1
  32. package/dist/assets/timer-D82-ik89.js +1 -0
  33. package/dist/assets/{unsafe-html-uboinnys.js → unsafe-html-CY0Np4--.js} +1 -1
  34. package/dist/assets/{viewport-listener-DrFhSZNW.js → viewport-listener-CDsKFDz1.js} +1 -1
  35. package/dist/basket-transfer-modal/basket-transfer-modal.min.js +1 -1
  36. package/dist/catalog/basket-preview/basket-preview.min.js +3 -3
  37. package/dist/catalog/catalog-category/catalog-category.min.js +1 -1
  38. package/dist/catalog/catalog-favorites/catalog-favorites.min.js +1 -1
  39. package/dist/catalog/catalog-history/catalog-history.min.js +1 -1
  40. package/dist/catalog/catalog-home/catalog-home.min.js +1 -1
  41. package/dist/catalog/catalog-list/catalog-list.min.js +1 -1
  42. package/dist/catalog/catalog-load-more.min.js +1 -1
  43. package/dist/catalog/catalog-tabs/catalog-tabs.min.js +1 -1
  44. package/dist/catalog/catalog-toolbar/catalog-toolbar.min.js +1 -1
  45. package/dist/catalog/my-meals-button/my-meals-button.min.js +1 -1
  46. package/dist/counter/counter.min.js +1 -1
  47. package/dist/drawer/drawer.min.js +1 -1
  48. package/dist/drawer-view-swapper/drawer-view-swapper.min.js +24 -24
  49. package/dist/history-drawer/history-drawer.min.js +1 -1
  50. package/dist/history-order/history-order.min.js +1 -1
  51. package/dist/history-order-expanded/history-order-expanded.min.js +1 -1
  52. package/dist/last-order-badge/last-order-badge.min.js +2 -2
  53. package/dist/last-order-modal/last-order-modal.min.js +1 -1
  54. package/dist/like-button/like-button.min.js +1 -1
  55. package/dist/modal/modal.min.js +1 -1
  56. package/dist/no-supplier-add-to-cart-cta/no-supplier-add-to-cart-cta.min.js +1 -1
  57. package/dist/onboarding/onboarding.min.js +2 -2
  58. package/dist/order-again/order-again.min.js +1 -1
  59. package/dist/planner/helpers/menu-title.min.js +1 -0
  60. package/dist/planner/helpers/open-onboarding-modal.min.js +1 -1
  61. package/dist/planner/planner-abandon-modal/planner-abandon-modal.min.js +1 -1
  62. package/dist/planner/planner-budget-edit-modal/planner-budget-edit-modal.min.js +1 -1
  63. package/dist/planner/planner-budget-gauge/planner-budget-gauge.min.js +1 -1
  64. package/dist/planner/planner-catalog/planner-catalog.min.js +2 -2
  65. package/dist/planner/planner-current-menu/planner-current-menu.min.js +1 -1
  66. package/dist/planner/planner-current-menu-modal/planner-current-menu-modal.min.js +1 -1
  67. package/dist/planner/planner-dashboard/planner-dashboard.min.js +1 -1
  68. package/dist/planner/planner-form/planner-form.min.js +9 -9
  69. package/dist/planner/planner-menu-option/planner-menu-option.min.js +1 -1
  70. package/dist/planner/planner-onboarding/planner-onboarding.min.js +1 -1
  71. package/dist/planner/planner-onboarding-modal/planner-onboarding-modal.min.js +1 -1
  72. package/dist/planner/planner-open-catalog-modal/planner-open-catalog-modal.min.js +1 -1
  73. package/dist/planner/planner-quick-menu/planner-quick-menu.min.js +1 -1
  74. package/dist/planner/planner-recipe-card/planner-recipe-card.min.js +1 -1
  75. package/dist/planner/planner-recipe-list/planner-recipe-list.css +1 -1
  76. package/dist/planner/planner-recipe-list/planner-recipe-list.min.js +1 -1
  77. package/dist/planner/planner-recipe-suggestion/planner-recipe-suggestion.css +1 -1
  78. package/dist/planner/planner-recipe-suggestion/planner-recipe-suggestion.min.js +1 -1
  79. package/dist/planner/planner-welcome-modal/planner-welcome-modal.min.js +1 -1
  80. package/dist/planner/to-basket-loader/to-basket-loader.min.js +1 -1
  81. package/dist/planner-entry/planner-entry.min.js +1 -1
  82. package/dist/preferences/preferences.min.js +21 -21
  83. package/dist/price/price.min.js +1 -1
  84. package/dist/recipe-card/recipe-card.min.js +1 -1
  85. package/dist/recipe-card-cta/recipe-card-cta.css +1 -1
  86. package/dist/recipe-card-cta/recipe-card-cta.min.js +1 -1
  87. package/dist/recipe-details/details-footer/details-footer.css +1 -1
  88. package/dist/recipe-details/recipe-details.css +1 -1
  89. package/dist/recipe-details/recipe-details.min.js +93 -93
  90. package/dist/recipe-pricing/recipe-pricing.min.js +1 -1
  91. package/dist/replace-item/replace-item-card/replace-item-card.min.js +1 -1
  92. package/dist/replace-item/replace-item.min.js +1 -1
  93. package/dist/replace-item-planner/replace-item-card-planner/replace-item-card-planner.min.js +1 -1
  94. package/dist/replace-item-planner/replace-item-planner.min.js +1 -1
  95. package/dist/select/select.min.js +1 -1
  96. package/dist/slider-tabs/slider-tabs.min.js +1 -1
  97. package/dist/store-indicator/store-indicator.min.js +1 -1
  98. package/dist/store-locator/store-locator.min.js +1 -1
  99. package/dist/store-locator-drawer/store-locator-drawer.min.js +1 -1
  100. package/dist/supplier-selector/supplier-selector.min.js +1 -1
  101. package/package.json +1 -1
  102. package/dist/assets/combineLatest-BN0_WcEG.js +0 -1
  103. package/dist/assets/delay-wUm-cx7a.js +0 -1
  104. package/dist/assets/empty-Bs9kqCuA.js +0 -1
  105. package/dist/assets/executeSchedule-C0acKsif.js +0 -1
  106. package/dist/assets/from-BTlWkhKh.js +0 -1
  107. package/dist/assets/mapOneOrManyArgs-Bdu6mo6S.js +0 -1
  108. package/dist/assets/merge-tdU3EgEI.js +0 -1
  109. package/dist/assets/mergeAll-DTkL1sF8.js +0 -1
  110. package/dist/assets/of-hd4MpK5g.js +0 -1
  111. package/dist/assets/skip-BuAl4dWz.js +0 -1
  112. package/dist/assets/timer-C3uKg-qK.js +0 -1
@@ -1,19 +1,19 @@
1
- import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";import{_ as re,n as L,p as X,b as ne,c as le,q as oe,N as m,D as c,k as a}from"../assets/no-shadow-element-Dz9jgDtr.js";import{t as g}from"../assets/custom-element-BhZVzxrc.js";import{n as p}from"../assets/property-Bx8Yvr4_.js";import{P as ce}from"../assets/price-CHipCs2z.js";import{m as l}from"../assets/mealz-sdk-E_fNZM-c.js";import{m as Z}from"../assets/merge-tdU3EgEI.js";import{m as h}from"../assets/map-DHslluWD.js";import{t as B}from"../assets/take-ByPtGQky.js";import{c as ee}from"../assets/capitalize-DUAqYmp4.js";import"../counter/counter.min.js";import{G as te}from"../assets/product-card-c_0I2Lp_.js";import"../price/price.min.js";import"../assets/promotion-badge-CzwsPJJq.js";import"../assets/accordion-Ba11uzYA.js";import"../store-indicator/store-indicator.min.js";import"../last-order-badge/last-order-badge.min.js";import"../order-again/order-again.min.js";import"../like-button/like-button.min.js";import{L as de}from"../last-order-modal/last-order-modal.min.js";import{a as pe}from"../assets/unsafe-html-uboinnys.js";import{M as ue}from"../planner/planner-onboarding/planner-onboarding.min.js";import{o as se,c as he}from"../assets/OperatorSubscriber-DF1TYu__.js";import{i as H}from"../assets/innerFrom-FMZwm2mb.js";import{f as Q}from"../assets/filter-DQ4vwAGj.js";import{t as z}from"../assets/tap-K_D6lo97.js";import{s as Y}from"../assets/switchMap-6Z80ObHE.js";import{c as J}from"../assets/combineLatest-BN0_WcEG.js";import{d as me}from"../assets/async-D5WN8Wfc.js";import"../assets/viewport-listener-DrFhSZNW.js";import"../assets/debounceTime-D7R6Z3Am.js";import"../assets/skipWhile-BzDgmir5.js";import"../assets/mergeAll-DTkL1sF8.js";import"../assets/mergeMap-g-JGW99j.js";import"../assets/executeSchedule-C0acKsif.js";import"../assets/empty-Bs9kqCuA.js";import"../assets/from-BTlWkhKh.js";import"../assets/delay-wUm-cx7a.js";import"../assets/timer-C3uKg-qK.js";import"../store-locator/store-locator.min.js";import"../assets/state-C5zM4-Pq.js";import"../assets/query-BApjzB0v.js";import"../onboarding/onboarding.min.js";import"../onboarding/events.min.js";import"../onboarding/analytics/onboarding-analytics.min.js";import"../assets/responsive-C7Qf71r3.js";import"../assets/mapOneOrManyArgs-Bdu6mo6S.js";var ge=function(e){re(t,e);function t(s,r,i){s===void 0&&(s=1/0),r===void 0&&(r=1/0),i===void 0&&(i=me);var n=e.call(this)||this;return n._bufferSize=s,n._windowTime=r,n._timestampProvider=i,n._buffer=[],n._infiniteTimeWindow=!0,n._infiniteTimeWindow=r===1/0,n._bufferSize=Math.max(1,s),n._windowTime=Math.max(1,r),n}return t.prototype.next=function(s){var r=this,i=r.isStopped,n=r._buffer,o=r._infiniteTimeWindow,d=r._timestampProvider,v=r._windowTime;i||(n.push(s),!o&&n.push(d.now()+v)),this._trimBuffer(),e.prototype.next.call(this,s)},t.prototype._subscribe=function(s){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(s),i=this,n=i._infiniteTimeWindow,o=i._buffer,d=o.slice(),v=0;v<d.length&&!s.closed;v+=n?1:2)s.next(d[v]);return this._checkFinalizedStatuses(s),r},t.prototype._trimBuffer=function(){var s=this,r=s._bufferSize,i=s._timestampProvider,n=s._buffer,o=s._infiniteTimeWindow,d=(o?1:2)*r;if(r<1/0&&d<n.length&&n.splice(0,n.length-d),!o){for(var v=i.now(),k=0,u=1;u<n.length&&n[u]<=v;u+=2)k=u;k&&n.splice(0,k+1)}},t}(L);function ve(e){e===void 0&&(e={});var t=e.connector,s=t===void 0?function(){return new L}:t,r=e.resetOnError,i=r===void 0?!0:r,n=e.resetOnComplete,o=n===void 0?!0:n,d=e.resetOnRefCountZero,v=d===void 0?!0:d;return function(k){var u,f,I,T=0,S=!1,x=!1,C=function(){f==null||f.unsubscribe(),f=void 0},D=function(){C(),u=I=void 0,S=x=!1},ae=function(){var P=u;D(),P==null||P.unsubscribe()};return se(function(P,K){T++,!x&&!S&&C();var R=I=I??s();K.add(function(){T--,T===0&&!x&&!S&&(f=A(ae,v))}),R.subscribe(K),!u&&T>0&&(u=new X({next:function(O){return R.next(O)},error:function(O){x=!0,C(),f=A(D,i,O),R.error(O)},complete:function(){S=!0,C(),f=A(D,o),R.complete()}}),H(P).subscribe(u))})(k)}}function A(e,t){for(var s=[],r=2;r<arguments.length;r++)s[r-2]=arguments[r];if(t===!0){e();return}if(t!==!1){var i=new X({next:function(){i.unsubscribe(),e()}});return H(t.apply(void 0,ne([],le(s)))).subscribe(i)}}function be(e,t,s){var r,i=!1;return r=e,ve({connector:function(){return new ge(r,t,s)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function w(e){return se(function(t,s){H(e).subscribe(he(s,function(){return s.complete()},oe)),!s.closed&&t.subscribe(s)})}var _e=Object.defineProperty,fe=Object.getOwnPropertyDescriptor,y=(e,t,s,r)=>{for(var i=r>1?void 0:r?fe(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=(r?o(t,s,i):o(i))||i);return r&&i&&_e(t,s,i),i};let b=class extends m{constructor(){super(),this.noPosDisplay=!1,this.noSupplier=!1,this.recipeId="",this.plannerMode=!1,this.guests=0,this.recipe=null,this.analyticsPath="",this.subscriptions=[],this.remainingBasketEntries=[],this.recipePrice={remaining:0,inBasket:0,total:0,totalPerGuest:0},this.priceService=ce.getInstance(),this.allIngredientsToBasketLoading=!1,this.ingredientToBasketLoading=!1,this.updateIngredientFromBasketLoading=!1,this.productsLoading=!1,this.inMenu=!1,this.menuUpdateLoading=!1,this.styleURL=new URL("./recipe-details/details-footer/details-footer.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.priceService.initFormatter(),this.analyticsPath=`/recipes/${this.recipeId}/shopping`,this.subscriptions.push(Z(l.recipes.remainingBasketEntries$.pipe(h(e=>{this.remainingBasketEntries=e})),l.recipes.recipePrice$.pipe(h(e=>{const t=e.remaining+e.inBasket;this.recipePrice={...e,total:t,totalPerGuest:0}})),l.recipes.allIngredientsToBasketLoading$.pipe(h(e=>{this.allIngredientsToBasketLoading=e})),l.recipes.ingredientToBasketLoading$.pipe(h(e=>{this.ingredientToBasketLoading=e})),l.recipes.updateIngredientFromBasketLoading$.pipe(h(e=>{this.updateIngredientFromBasketLoading=e})),l.recipes.productsLoading$.pipe(h(e=>{this.productsLoading=e})),l.planner.plannerRecipePrice$.pipe(h(e=>{this.recipePrice.totalPerGuest=this.guests>0?e/this.guests:e}))).subscribe(()=>this.requestUpdate())),this.subscribeIsRecipeInMenu()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe()),this.isRecipeInMenuSub&&(this.isRecipeInMenuSub.unsubscribe(),this.isRecipeInMenuSub=void 0)}updated(e){super.updated(e),e.has("recipeId")&&this.subscribeIsRecipeInMenu()}subscribeIsRecipeInMenu(){this.recipeId&&(this.isRecipeInMenuSub&&this.isRecipeInMenuSub.unsubscribe(),this.isRecipeInMenuSub=l.planner.isRecipeInMenu$(this.recipeId).pipe(h(e=>{this.inMenu=e})).subscribe(()=>this.requestUpdate()))}closeRecipeDetails(e=!1){l.recipes.displayedRecipe$.next(null),e&&l.basket.basketPreviewState$.next({isOpen:!0,activeTabIndex:l.basket.basketPreviewState$.getValue().activeTabIndex})}continueShopping(){this.closeRecipeDetails(),this.sendContinueEvent()}addToMenu(){var r,i;this.menuUpdateLoading=!0,this.requestUpdate();const e=document.querySelector("mealz-planner-recipe-suggestion"),t=!!e&&!!e.recipeId&&e.recipeId===this.recipeId,s=document.querySelector("mealz-planner-current-menu");if(!s){const n=(i=(r=l.recipes)==null?void 0:r.productsPlannerByCategory$)==null?void 0:i.value,o=(n==null?void 0:n.toPickProducts)||[];l.planner.addRecipeToMenu(this.recipeId,this.guests,!!l.pos.currentPos().value,o).pipe(B(1)).subscribe(()=>{this.inMenu=!0;const d=document.querySelector("mealz-planner-recipe-list");d==null||d.addRecipeCardToList(this.recipeId),this.menuUpdateLoading=!1,this.requestUpdate(),this.closeRecipeDetails()});return}if(t){e.addRecipeFromDetails$(this.guests).subscribe({next:()=>{this.inMenu=!0,this.menuUpdateLoading=!1,this.requestUpdate(),this.closeRecipeDetails()},error:()=>{this.menuUpdateLoading=!1,this.requestUpdate()}});return}s.addRecipe(this.recipeId,this.guests).pipe(B(1)).subscribe({next:()=>{this.inMenu=!0,e==null||e.addAndSelectNewSuggestion(this.recipe||void 0),this.menuUpdateLoading=!1,this.requestUpdate(),this.closeRecipeDetails()},error:()=>{this.menuUpdateLoading=!1,this.requestUpdate()}})}removeFromMenu(){this.menuUpdateLoading=!0,this.requestUpdate();const e=document.querySelector("mealz-planner-recipe-suggestion");if(!e){l.planner.removeRecipeFromMenu(this.recipeId).pipe(B(1)).subscribe(()=>{this.inMenu=!1,this.menuUpdateLoading=!1,this.requestUpdate()});return}e.removeRecipe(this.recipeId).subscribe(()=>{this.inMenu=!1,this.menuUpdateLoading=!1,this.requestUpdate()})}addAllIngredients(){l.recipes.addAllIngredientsToBasket({originPath:this.analyticsPath,props:{}}),this.sendAddAllEvent(),this.recipePrice.inBasket===0&&this.sendAddRecipeEvent()}render(){if(this.noPosDisplay&&!this.plannerMode)return c;const e=this.remainingBasketEntries.length>0&&!this.plannerMode,t=this.plannerMode&&this.noPosDisplay,s=this.plannerMode&&!this.inMenu;return a`
1
+ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";import{_ as re,n as D,p as X,b as ne,c as oe,q as le,N as m,D as c,k as r}from"../assets/no-shadow-element-YPHUv5PR.js";import{t as g}from"../assets/custom-element-BhZVzxrc.js";import{n as p}from"../assets/property-_7ObQ3dl.js";import{P as ce}from"../assets/price-DAxY_7sk.js";import{m as o}from"../assets/mealz-sdk-E_fNZM-c.js";import{m as Z}from"../assets/merge-Cm-mm3_Q.js";import{m as h}from"../assets/map-BVOhpQm0.js";import{t as U}from"../assets/take-CozE9iSG.js";import{c as ee}from"../assets/capitalize-DUAqYmp4.js";import"../counter/counter.min.js";import{G as te}from"../assets/product-card-HetVhdJ3.js";import"../price/price.min.js";import"../assets/promotion-badge-8Arhhb-p.js";import"../assets/accordion-DJLqKUJq.js";import"../store-indicator/store-indicator.min.js";import"../last-order-badge/last-order-badge.min.js";import"../order-again/order-again.min.js";import"../like-button/like-button.min.js";import{L as de}from"../last-order-modal/last-order-modal.min.js";import{a as pe}from"../assets/unsafe-html-CY0Np4--.js";import{M as ue}from"../planner/planner-onboarding/planner-onboarding.min.js";import{o as se,c as he}from"../assets/OperatorSubscriber-BaYaQC1O.js";import{i as H}from"../assets/innerFrom-BgPDnAsH.js";import{f as Q}from"../assets/filter-BZ75lS5D.js";import{t as z}from"../assets/tap-C8CJ3R2H.js";import{s as Y}from"../assets/switchMap-Dk_0Nhlo.js";import{c as J}from"../assets/combineLatest-BmqPE0OB.js";import{d as me}from"../assets/async-CFBGA-Dz.js";import"../assets/viewport-listener-CDsKFDz1.js";import"../assets/debounceTime-B4DpnstH.js";import"../assets/skipWhile-BZVFq1Cg.js";import"../assets/mergeAll-BdUAXyrs.js";import"../assets/mergeMap-Dw_YYHwH.js";import"../assets/executeSchedule-CEDvgTzM.js";import"../assets/empty-0eVnsLmk.js";import"../assets/args-BozZ6oU-.js";import"../assets/isScheduler-C5PGPVU1.js";import"../assets/from-CAidt5N1.js";import"../assets/delay-BNnJ-6LE.js";import"../assets/timer-D82-ik89.js";import"../store-locator/store-locator.min.js";import"../assets/state-W5mtSPAs.js";import"../assets/query-BApjzB0v.js";import"../onboarding/onboarding.min.js";import"../onboarding/events.min.js";import"../onboarding/analytics/onboarding-analytics.min.js";import"../assets/responsive-C7Qf71r3.js";import"../assets/mapOneOrManyArgs-COA1aRZM.js";var ge=function(e){re(t,e);function t(s,a,i){s===void 0&&(s=1/0),a===void 0&&(a=1/0),i===void 0&&(i=me);var n=e.call(this)||this;return n._bufferSize=s,n._windowTime=a,n._timestampProvider=i,n._buffer=[],n._infiniteTimeWindow=!0,n._infiniteTimeWindow=a===1/0,n._bufferSize=Math.max(1,s),n._windowTime=Math.max(1,a),n}return t.prototype.next=function(s){var a=this,i=a.isStopped,n=a._buffer,l=a._infiniteTimeWindow,d=a._timestampProvider,v=a._windowTime;i||(n.push(s),!l&&n.push(d.now()+v)),this._trimBuffer(),e.prototype.next.call(this,s)},t.prototype._subscribe=function(s){this._throwIfClosed(),this._trimBuffer();for(var a=this._innerSubscribe(s),i=this,n=i._infiniteTimeWindow,l=i._buffer,d=l.slice(),v=0;v<d.length&&!s.closed;v+=n?1:2)s.next(d[v]);return this._checkFinalizedStatuses(s),a},t.prototype._trimBuffer=function(){var s=this,a=s._bufferSize,i=s._timestampProvider,n=s._buffer,l=s._infiniteTimeWindow,d=(l?1:2)*a;if(a<1/0&&d<n.length&&n.splice(0,n.length-d),!l){for(var v=i.now(),k=0,u=1;u<n.length&&n[u]<=v;u+=2)k=u;k&&n.splice(0,k+1)}},t}(D);function ve(e){e===void 0&&(e={});var t=e.connector,s=t===void 0?function(){return new D}:t,a=e.resetOnError,i=a===void 0?!0:a,n=e.resetOnComplete,l=n===void 0?!0:n,d=e.resetOnRefCountZero,v=d===void 0?!0:d;return function(k){var u,f,I,T=0,w=!1,S=!1,C=function(){f==null||f.unsubscribe(),f=void 0},L=function(){C(),u=I=void 0,w=S=!1},ae=function(){var P=u;L(),P==null||P.unsubscribe()};return se(function(P,K){T++,!S&&!w&&C();var x=I=I??s();K.add(function(){T--,T===0&&!S&&!w&&(f=A(ae,v))}),x.subscribe(K),!u&&T>0&&(u=new X({next:function(R){return x.next(R)},error:function(R){S=!0,C(),f=A(L,i,R),x.error(R)},complete:function(){w=!0,C(),f=A(L,l),x.complete()}}),H(P).subscribe(u))})(k)}}function A(e,t){for(var s=[],a=2;a<arguments.length;a++)s[a-2]=arguments[a];if(t===!0){e();return}if(t!==!1){var i=new X({next:function(){i.unsubscribe(),e()}});return H(t.apply(void 0,ne([],oe(s)))).subscribe(i)}}function be(e,t,s){var a,i=!1;return a=e,ve({connector:function(){return new ge(a,t,s)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function O(e){return se(function(t,s){H(e).subscribe(he(s,function(){return s.complete()},le)),!s.closed&&t.subscribe(s)})}var _e=Object.defineProperty,fe=Object.getOwnPropertyDescriptor,y=(e,t,s,a)=>{for(var i=a>1?void 0:a?fe(t,s):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(i=(a?l(t,s,i):l(i))||i);return a&&i&&_e(t,s,i),i};let b=class extends m{constructor(){super(),this.noPosDisplay=!1,this.noSupplier=!1,this.recipeId="",this.plannerMode=!1,this.guests=0,this.recipe=null,this.analyticsPath="",this.subscriptions=[],this.remainingBasketEntries=[],this.recipePrice={remaining:0,inBasket:0,total:0,totalPerGuest:0},this.priceService=ce.getInstance(),this.allIngredientsToBasketLoading=!1,this.ingredientToBasketLoading=!1,this.updateIngredientFromBasketLoading=!1,this.productsLoading=!1,this.inMenu=!1,this.menuUpdateLoading=!1,this.styleURL=new URL("./recipe-details/details-footer/details-footer.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.priceService.initFormatter(),this.analyticsPath=`/recipes/${this.recipeId}/shopping`,this.subscriptions.push(Z(o.recipes.remainingBasketEntries$.pipe(h(e=>{this.remainingBasketEntries=e})),o.recipes.recipePrice$.pipe(h(e=>{const t=e.remaining+e.inBasket;this.recipePrice={...e,total:t,totalPerGuest:0}})),o.recipes.allIngredientsToBasketLoading$.pipe(h(e=>{this.allIngredientsToBasketLoading=e})),o.recipes.ingredientToBasketLoading$.pipe(h(e=>{this.ingredientToBasketLoading=e})),o.recipes.updateIngredientFromBasketLoading$.pipe(h(e=>{this.updateIngredientFromBasketLoading=e})),o.recipes.productsLoading$.pipe(h(e=>{this.productsLoading=e})),o.planner.plannerRecipePrice$.pipe(h(e=>{this.recipePrice.totalPerGuest=this.guests>0?e/this.guests:e}))).subscribe(()=>this.requestUpdate())),this.subscribeIsRecipeInMenu()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe()),this.isRecipeInMenuSub&&(this.isRecipeInMenuSub.unsubscribe(),this.isRecipeInMenuSub=void 0)}updated(e){super.updated(e),e.has("recipeId")&&this.subscribeIsRecipeInMenu()}subscribeIsRecipeInMenu(){this.recipeId&&(this.isRecipeInMenuSub&&this.isRecipeInMenuSub.unsubscribe(),this.isRecipeInMenuSub=o.planner.isRecipeInMenu$(this.recipeId).pipe(h(e=>{this.inMenu=e})).subscribe(()=>this.requestUpdate()))}closeRecipeDetails(e=!1){o.recipes.displayedRecipe$.next(null),e&&o.basket.basketPreviewState$.next({isOpen:!0,activeTabIndex:o.basket.basketPreviewState$.getValue().activeTabIndex})}continueShopping(){this.closeRecipeDetails(),this.sendContinueEvent()}addToMenu(){var a,i;this.menuUpdateLoading=!0,this.requestUpdate();const e=document.querySelector("mealz-planner-recipe-suggestion"),t=!!e&&!!e.recipeId&&e.recipeId===this.recipeId,s=document.querySelector("mealz-planner-current-menu");if(!s){const n=(i=(a=o.recipes)==null?void 0:a.productsPlannerByCategory$)==null?void 0:i.value,l=(n==null?void 0:n.toPickProducts)||[];o.planner.addRecipeToMenu(this.recipeId,this.guests,!!o.pos.currentPos().value,l).pipe(U(1)).subscribe(()=>{this.inMenu=!0;const d=document.querySelector("mealz-planner-recipe-list");d==null||d.addRecipeCardToList(this.recipeId),this.menuUpdateLoading=!1,this.requestUpdate(),this.closeRecipeDetails()});return}if(t){e.addRecipeFromDetails$(this.guests).subscribe({next:()=>{this.inMenu=!0,this.menuUpdateLoading=!1,this.requestUpdate(),this.closeRecipeDetails()},error:()=>{this.menuUpdateLoading=!1,this.requestUpdate()}});return}s.addRecipe(this.recipeId,this.guests).pipe(U(1)).subscribe({next:()=>{this.inMenu=!0,e==null||e.addAndSelectNewSuggestion(this.recipe||void 0),this.menuUpdateLoading=!1,this.requestUpdate(),this.closeRecipeDetails()},error:()=>{this.menuUpdateLoading=!1,this.requestUpdate()}})}removeFromMenu(){this.menuUpdateLoading=!0,this.requestUpdate();const e=document.querySelector("mealz-planner-recipe-suggestion");if(!e){o.planner.removeRecipeFromMenu(this.recipeId).pipe(U(1)).subscribe(()=>{this.inMenu=!1,this.menuUpdateLoading=!1,this.requestUpdate()});return}e.removeRecipe(this.recipeId).subscribe(()=>{this.inMenu=!1,this.menuUpdateLoading=!1,this.requestUpdate()})}addAllIngredients(){o.recipes.addAllIngredientsToBasket({originPath:this.analyticsPath,props:{}}),this.sendAddAllEvent(),this.recipePrice.inBasket===0&&this.sendAddRecipeEvent()}render(){if(this.noPosDisplay&&!this.plannerMode)return c;const e=this.remainingBasketEntries.length>0&&!this.plannerMode,t=this.plannerMode&&this.noPosDisplay,s=this.plannerMode&&!this.inMenu;return r`
2
2
  <div class="mealz-recipe-details__footer">
3
- ${this.productsLoading&&!this.plannerMode?c:a`
3
+ ${this.productsLoading&&!this.plannerMode?c:r`
4
4
  <!-- ADD TO BASKET CTA -->
5
- ${e||t||s?this.renderAddToBasketButton():a`
5
+ ${e||t||s?this.renderAddToBasketButton():r`
6
6
  <div class="mealz-recipe-details__recipe-is-in-basket-cta-container">
7
7
  ${this.renderBasketActions()}
8
8
  </div>
9
9
  `}
10
10
  `}
11
11
  ${this.noPosDisplay?c:this.renderPrice()}
12
- </div>`}renderAddToBasketButton(){const e=this.remainingBasketEntries.length;return this.allIngredientsToBasketLoading||this.menuUpdateLoading?a`
12
+ </div>`}renderAddToBasketButton(){const e=this.remainingBasketEntries.length;return this.allIngredientsToBasketLoading||this.menuUpdateLoading?r`
13
13
  <button class="mealz-recipe-details__add-to-basket-cta mealz-ds-button primary">
14
14
  <div class="mealz-ds-loader"></div>
15
15
  </button>
16
- `:this.plannerMode?a`
16
+ `:this.plannerMode?r`
17
17
  <button
18
18
  class="mealz-recipe-details__add-to-basket-cta mealz-ds-button primary"
19
19
  @click=${()=>this.addToMenu()}
@@ -21,7 +21,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
21
21
  <span class="mealz-ds-text size-s weight-xl">Ajouter au menu</span>
22
22
  <img src="https://storage.googleapis.com/assets.miam.tech/generic/icons/Pot-add_white.svg" alt="add to menu icon" />
23
23
  </button>
24
- `:a`
24
+ `:r`
25
25
  <button
26
26
  class="mealz-recipe-details__add-to-basket-cta mealz-ds-text mealz-ds-button size-m weight-xl primary"
27
27
  @click=${()=>this.addAllIngredients()}
@@ -42,20 +42,20 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
42
42
  </div>
43
43
  </div>
44
44
  </button>
45
- `}renderBasketActions(){return this.menuUpdateLoading?a`
45
+ `}renderBasketActions(){return this.menuUpdateLoading?r`
46
46
  <button class="mealz-ds-button">
47
47
  <div class="mealz-ds-loader"></div>
48
48
  </button>
49
- `:this.plannerMode?a`
49
+ `:this.plannerMode?r`
50
50
  <!-- REMOVE FROM MENU CTA -->
51
- <button class="mealz-ds-button" @click=${()=>this.removeFromMenu()}>
51
+ <button class="mealz-ds-button secondary mealz-recipe-details__remove-from-menu-cta" @click=${()=>this.removeFromMenu()}>
52
52
  <img alt="remove icon"
53
- src="https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_Black.svg"/>
53
+ src="https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg"/>
54
54
  <span class="mealz-ds-text size-s weight-xl">
55
55
  Retirer du menu
56
56
  </span>
57
57
  </button>
58
- `:a`
58
+ `:r`
59
59
  <!-- CONTINUE CTA -->
60
60
  <button
61
61
  class="mealz-ds-button secondary mealz-recipe-details__continue-shopping-cta ${this.noSupplier?"mobile-hidden":""}"
@@ -66,7 +66,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
66
66
  </button>
67
67
 
68
68
  <!-- VIEW BASKET CTA (ONLY IF NO SUPPLIER MODE) -->
69
- ${this.noSupplier?a`
69
+ ${this.noSupplier?r`
70
70
  <button
71
71
  @click=${()=>this.closeRecipeDetails(!0)}
72
72
  class="mealz-ds-button mealz-ds-text size-m weight-xl primary mealz-recipe-details__see-basket-cta">
@@ -78,7 +78,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
78
78
  src="https://storage.googleapis.com/assets.miam.tech/generic/icons/Basket.svg"/>
79
79
  </button>
80
80
  `:c}
81
- `}renderPrice(){if(this.recipePrice.inBasket<=0&&!this.plannerMode)return c;const e=this.ingredientToBasketLoading||this.updateIngredientFromBasketLoading||this.productsLoading,t=this.plannerMode?this.recipePrice.totalPerGuest:this.recipePrice.inBasket;return a`
81
+ `}renderPrice(){if(this.recipePrice.inBasket<=0&&!this.plannerMode)return c;const e=this.ingredientToBasketLoading||this.updateIngredientFromBasketLoading||this.productsLoading,t=this.plannerMode?this.recipePrice.totalPerGuest:this.recipePrice.inBasket;return r`
82
82
  <div class="mealz-recipe-details__price">
83
83
  <div
84
84
  class="mealz-recipe-details__price-label ${this.plannerMode?"":"primary"} mealz-ds-text size-l weight-xxl">
@@ -91,7 +91,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
91
91
  ${this.plannerMode?"par personne":"dans votre panier"}
92
92
  </span>
93
93
  </div>
94
- `}sendAddAllEvent(){l.analytics.sendEvent("entry.add-all",this.analyticsPath,{recipe_id:this.recipeId,entry_count:this.remainingBasketEntries.length})}sendAddRecipeEvent(){l.analytics.sendEvent("recipe.add",this.analyticsPath,{recipe_id:this.recipeId})}sendContinueEvent(){l.analytics.sendEvent("recipe.continue",this.analyticsPath,{recipe_id:this.recipeId})}};y([p({type:Boolean})],b.prototype,"noPosDisplay",2);y([p({type:Boolean})],b.prototype,"noSupplier",2);y([p({type:String})],b.prototype,"recipeId",2);y([p({type:Boolean})],b.prototype,"plannerMode",2);y([p({type:Number})],b.prototype,"guests",2);y([p({attribute:!1})],b.prototype,"recipe",2);b=y([g("mealz-details-footer")],b);customElements.get("mealz-details-footer")||customElements.define("mealz-details-footer",b);var ze=Object.getOwnPropertyDescriptor,ye=(e,t,s,r)=>{for(var i=r>1?void 0:r?ze(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=o(i)||i);return i};let N=class extends m{constructor(){super(),this.tags=[],this.displayTags=!1,this.subscriptions=[],this.styleURL=new URL("./recipe-details/details-infos/details-infos.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(l.recipes.displayedRecipe$.subscribe(e=>{e&&(this.recipe=e.recipe,this.tags=e.recipe.relationships.tags.data.map(t=>t.attributes.name),this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}toggleTags(){this.displayTags=!this.displayTags,this.requestUpdate()}noTimePlaceholder(){return a`<span class="mealz-recipe-details-infos__no-time-placeholder">0 min</span>`}noDataPlaceholder(){return a`<span class="mealz-recipe-details-infos__no-data-placeholder">-</span>`}getRecipeDifficultyIntoClassName(){switch(this.recipe.attributes.difficulty){case 1:return"easy";case 2:return"medium";case 3:return"hard";default:return"no-difficulty-defined"}}getRecipeDifficultyIntoText(){switch(this.recipe.attributes.difficulty){case 1:return a`<span class="mealz-ds-text">Facile</span>`;case 2:return a`<span class="mealz-ds-text">Moyen</span>`;case 3:return a`<span class="mealz-ds-text">Difficile</span>`;default:return c}}renderPreparationTime(){return a`
94
+ `}sendAddAllEvent(){o.analytics.sendEvent("entry.add-all",this.analyticsPath,{recipe_id:this.recipeId,entry_count:this.remainingBasketEntries.length})}sendAddRecipeEvent(){o.analytics.sendEvent("recipe.add",this.analyticsPath,{recipe_id:this.recipeId})}sendContinueEvent(){o.analytics.sendEvent("recipe.continue",this.analyticsPath,{recipe_id:this.recipeId})}};y([p({type:Boolean})],b.prototype,"noPosDisplay",2);y([p({type:Boolean})],b.prototype,"noSupplier",2);y([p({type:String})],b.prototype,"recipeId",2);y([p({type:Boolean})],b.prototype,"plannerMode",2);y([p({type:Number})],b.prototype,"guests",2);y([p({attribute:!1})],b.prototype,"recipe",2);b=y([g("mealz-details-footer")],b);customElements.get("mealz-details-footer")||customElements.define("mealz-details-footer",b);var ze=Object.getOwnPropertyDescriptor,ye=(e,t,s,a)=>{for(var i=a>1?void 0:a?ze(t,s):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(i=l(i)||i);return i};let N=class extends m{constructor(){super(),this.tags=[],this.displayTags=!1,this.subscriptions=[],this.styleURL=new URL("./recipe-details/details-infos/details-infos.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(o.recipes.displayedRecipe$.subscribe(e=>{e&&(this.recipe=e.recipe,this.tags=e.recipe.relationships.tags.data.map(t=>t.attributes.name),this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}toggleTags(){this.displayTags=!this.displayTags,this.requestUpdate()}noTimePlaceholder(){return r`<span class="mealz-recipe-details-infos__no-time-placeholder">0 min</span>`}noDataPlaceholder(){return r`<span class="mealz-recipe-details-infos__no-data-placeholder">-</span>`}getRecipeDifficultyIntoClassName(){switch(this.recipe.attributes.difficulty){case 1:return"easy";case 2:return"medium";case 3:return"hard";default:return"no-difficulty-defined"}}getRecipeDifficultyIntoText(){switch(this.recipe.attributes.difficulty){case 1:return r`<span class="mealz-ds-text">Facile</span>`;case 2:return r`<span class="mealz-ds-text">Moyen</span>`;case 3:return r`<span class="mealz-ds-text">Difficile</span>`;default:return c}}renderPreparationTime(){return r`
95
95
  <!-- PREPARATION TIME -->
96
96
  <div
97
97
  class="
@@ -103,9 +103,9 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
103
103
  >
104
104
  <img alt="preparation time icon"
105
105
  src="https://storage.googleapis.com/assets.miam.tech/generic/icons/knife-primary.svg"/>
106
- ${this.recipe.preparationTime?a`<span class="mealz-ds-text">${this.recipe.preparationTime}</span>`:this.noTimePlaceholder()}
106
+ ${this.recipe.preparationTime?r`<span class="mealz-ds-text">${this.recipe.preparationTime}</span>`:this.noTimePlaceholder()}
107
107
  </div>
108
- `}renderCookingTime(){return a`
108
+ `}renderCookingTime(){return r`
109
109
  <!-- COOKING TIME -->
110
110
  <div class="
111
111
  mealz-ds-badge
@@ -115,11 +115,11 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
115
115
  ${this.recipe.cookingTime==="-"?"no-cooking-time-defined":""}"
116
116
  >
117
117
  <img alt="cooking time icon" src="https://storage.googleapis.com/assets.miam.tech/generic/icons/pan-primary.svg"/>
118
- ${this.recipe.cookingTime?a`<span class="mealz-ds-text">${this.recipe.cookingTime}</span>`:this.noTimePlaceholder()}
118
+ ${this.recipe.cookingTime?r`<span class="mealz-ds-text">${this.recipe.cookingTime}</span>`:this.noTimePlaceholder()}
119
119
  </div>
120
- `}renderRecipeDifficulty(){return a`
120
+ `}renderRecipeDifficulty(){return r`
121
121
  <!-- RECIPE DIFFICULTY -->
122
- ${this.recipe.difficulty?a`
122
+ ${this.recipe.difficulty?r`
123
123
  <div class="
124
124
  mealz-ds-badge
125
125
  size-l
@@ -130,9 +130,9 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
130
130
  src="https://storage.googleapis.com/assets.miam.tech/generic/icons/chef-hat-primary.svg"/>
131
131
  ${this.getRecipeDifficultyIntoText()}
132
132
  </div>
133
- `:c}`}renderMoreTags(){return a`
133
+ `:c}`}renderMoreTags(){return r`
134
134
  <!-- MORE INFO -->
135
- ${this.displayTags?this.renderTags():a`
135
+ ${this.displayTags?this.renderTags():r`
136
136
  <div
137
137
  class="mealz-ds-badge size-l mealz-recipe-details-infos__badge more-info"
138
138
  @click=${()=>this.toggleTags()}
@@ -143,21 +143,21 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
143
143
  />
144
144
  </div>
145
145
  `}
146
- `}renderTags(){return a`
146
+ `}renderTags(){return r`
147
147
  <!-- TAGS -->
148
- ${this.tags.map(e=>a`
148
+ ${this.tags.map(e=>r`
149
149
  <div class="mealz-ds-badge size-l mealz-recipe-details-infos__badge tag">
150
150
  <span class="mealz-ds-text">${e}</span>
151
151
  </div>
152
152
  `)}
153
- `}render(){return a`
153
+ `}render(){return r`
154
154
  <div class="mealz-recipe-details-infos__container ${this.displayTags?"tags-displayed":""}">
155
155
  ${this.renderPreparationTime()}
156
156
  ${this.renderCookingTime()}
157
157
  ${this.renderRecipeDifficulty()}
158
158
  ${this.renderMoreTags()}
159
159
  </div>
160
- `}};N=ye([g("mealz-details-infos")],N);customElements.get("mealz-details-infos")||customElements.define("mealz-details-infos",N);var $e=Object.getOwnPropertyDescriptor,ke=(e,t,s,r)=>{for(var i=r>1?void 0:r?$e(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=o(i)||i);return i};let q=class extends m{constructor(){super(),this.steps=[],this.subscriptions=[],this.styleURL=new URL("./recipe-details/details-steps/details-steps.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(l.recipes.displayedRecipe$.subscribe(e=>{e&&(this.steps=e.recipe.relationships["recipe-steps"].data.sort((t,s)=>t.attributes["step-number"]-s.attributes["step-number"]).map(t=>t.attributes.description),this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}render(){return a`
160
+ `}};N=ye([g("mealz-details-infos")],N);customElements.get("mealz-details-infos")||customElements.define("mealz-details-infos",N);var $e=Object.getOwnPropertyDescriptor,ke=(e,t,s,a)=>{for(var i=a>1?void 0:a?$e(t,s):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(i=l(i)||i);return i};let q=class extends m{constructor(){super(),this.steps=[],this.subscriptions=[],this.styleURL=new URL("./recipe-details/details-steps/details-steps.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(o.recipes.displayedRecipe$.subscribe(e=>{e&&(this.steps=e.recipe.relationships["recipe-steps"].data.sort((t,s)=>t.attributes["step-number"]-s.attributes["step-number"]).map(t=>t.attributes.description),this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}render(){return r`
161
161
  <div class="mealz-details-steps">
162
162
  <!-- HEADER -->
163
163
  <div class="mealz-ds-text weight-xxl mealz-details-steps__header">
@@ -166,7 +166,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
166
166
  </div>
167
167
  <!-- LIST -->
168
168
  <div class="mealz-details-steps__list">
169
- ${this.steps.map((e,t)=>a`
169
+ ${this.steps.map((e,t)=>r`
170
170
  <div class="mealz-details-steps__step">
171
171
  <!-- INDEX -->
172
172
  <div class="mealz-details-steps__step__idx">
@@ -180,16 +180,16 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
180
180
  `)}
181
181
  </div>
182
182
  </div>
183
- `}};q=ke([g("mealz-details-steps")],q);customElements.get("mealz-details-steps")||customElements.define("mealz-details-steps",q);var Ie=Object.getOwnPropertyDescriptor,Pe=(e,t,s,r)=>{for(var i=r>1?void 0:r?Ie(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=o(i)||i);return i};let G=class extends m{constructor(){super(),this.ingredients=[],this.subscriptions=[],this.styleURL=new URL("./recipe-details/details-ingredients/details-ingredients.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(l.recipes.displayedRecipe$.subscribe(e=>{e&&(this.ingredients=e.recipe.relationships.ingredients.data,this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}render(){var e,t;return a`
183
+ `}};q=ke([g("mealz-details-steps")],q);customElements.get("mealz-details-steps")||customElements.define("mealz-details-steps",q);var Ie=Object.getOwnPropertyDescriptor,Pe=(e,t,s,a)=>{for(var i=a>1?void 0:a?Ie(t,s):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(i=l(i)||i);return i};let G=class extends m{constructor(){super(),this.ingredients=[],this.subscriptions=[],this.styleURL=new URL("./recipe-details/details-ingredients/details-ingredients.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(o.recipes.displayedRecipe$.subscribe(e=>{e&&(this.ingredients=e.recipe.relationships.ingredients.data,this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}render(){var e,t;return r`
184
184
  <div class="mealz-details-ingredients">
185
185
  <!-- HEADER -->
186
186
  <div class="mealz-ds-text weight-xxl mealz-details-ingredients__header">
187
187
  <span>${(e=this.ingredients)==null?void 0:e.length}</span>
188
- ${((t=this.ingredients)==null?void 0:t.length)>1?a`<span>ingrédients</span>`:a`<span>ingrédient</span>`}
188
+ ${((t=this.ingredients)==null?void 0:t.length)>1?r`<span>ingrédients</span>`:r`<span>ingrédient</span>`}
189
189
  </div>
190
190
  <!-- LIST -->
191
191
  <div class="mealz-details-ingredients__list">
192
- ${this.ingredients.map(s=>a`
192
+ ${this.ingredients.map(s=>r`
193
193
  <div class="mealz-details-ingredients__item">
194
194
  <!-- PICTURE -->
195
195
  <div class="mealz-ds-avatar mealz-details-ingredients__picture_container">
@@ -209,7 +209,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
209
209
  `)}
210
210
  </div>
211
211
  </div>
212
- `}ingredientPicture(e){return e.picture||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}};G=Pe([g("mealz-details-ingredients")],G);customElements.get("mealz-details-ingredients")||customElements.define("mealz-details-ingredients",G);var Ee=Object.defineProperty,Te=Object.getOwnPropertyDescriptor,$=(e,t,s,r)=>{for(var i=r>1?void 0:r?Te(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=(r?o(t,s,i):o(i))||i);return r&&i&&Ee(t,s,i),i};const M=["unavailable"],Se=["ticked","unselected"];let _=class extends m{constructor(){super(),this.subscriptions=[],this.guestObserverService=te.getInstance(),this.modifiedIngQty=0,this.analyticsPath="/meals-planner/current",this.styleURL=new URL("./product-card/product-card-planner.css",this.getBaseURL())}get status(){var e;return(e=this.product)==null?void 0:e.status}set status(e){this.product.status=e,this.requestUpdate()}get productImage(){var e;return((e=this.product.item)==null?void 0:e.attributes.image)||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}get ingredientPicture(){return this.product.ingredient.picture||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}get isSponsored(){var e,t,s;return((s=(t=(e=this.product)==null?void 0:e.item)==null?void 0:t.attributes)==null?void 0:s.sponsored)===!0}connectedCallback(){super.connectedCallback(),this.listenGuestsChange(),this.calculateQty()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}listenGuestsChange(){this.subscriptions.push(this.guestObserverService.guests$.subscribe(e=>{this.currentGuests=e,this.calculateQty()}))}calculateQty(){const e=this.product.ingredient.attributes.quantity/this.initialGuests;this.modifiedIngQty=Number((e*this.currentGuests).toFixed(2)),this.requestUpdate()}openReplaceItemView(){l.planner.openReplaceItemView(this.product),this.replaceItemViewEvent()}onCheckboxChange(e){e.target.checked?(this.status="ticked",l.planner.selectProduct(+this.product.item.id,this.product.ingredient.relationships.definition.data.id),this.addItemEvent()):(this.status="unselected",l.planner.unselectProduct(+this.product.item.id,this.product.ingredient.relationships.definition.data.id),this.deleteItemEvent()),this.requestUpdate()}render(){return a`
212
+ `}ingredientPicture(e){return e.picture||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}};G=Pe([g("mealz-details-ingredients")],G);customElements.get("mealz-details-ingredients")||customElements.define("mealz-details-ingredients",G);var Ee=Object.defineProperty,Te=Object.getOwnPropertyDescriptor,$=(e,t,s,a)=>{for(var i=a>1?void 0:a?Te(t,s):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(i=(a?l(t,s,i):l(i))||i);return a&&i&&Ee(t,s,i),i};const M=["unavailable"],we=["ticked","unselected"];let _=class extends m{constructor(){super(),this.subscriptions=[],this.guestObserverService=te.getInstance(),this.modifiedIngQty=0,this.analyticsPath="/meals-planner/current",this.styleURL=new URL("./product-card/product-card-planner.css",this.getBaseURL())}get status(){var e;return(e=this.product)==null?void 0:e.status}set status(e){this.product.status=e,this.requestUpdate()}get productImage(){var e;return((e=this.product.item)==null?void 0:e.attributes.image)||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}get ingredientPicture(){return this.product.ingredient.picture||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}get isSponsored(){var e,t,s;return((s=(t=(e=this.product)==null?void 0:e.item)==null?void 0:t.attributes)==null?void 0:s.sponsored)===!0}connectedCallback(){super.connectedCallback(),this.listenGuestsChange(),this.calculateQty()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}listenGuestsChange(){this.subscriptions.push(this.guestObserverService.guests$.subscribe(e=>{this.currentGuests=e,this.calculateQty()}))}calculateQty(){const e=this.product.ingredient.attributes.quantity/this.initialGuests;this.modifiedIngQty=Number((e*this.currentGuests).toFixed(2)),this.requestUpdate()}openReplaceItemView(){o.planner.openReplaceItemView(this.product),this.replaceItemViewEvent()}onCheckboxChange(e){e.target.checked?(this.status="ticked",o.planner.selectProduct(+this.product.item.id,this.product.ingredient.relationships.definition.data.id),this.addItemEvent()):(this.status="unselected",o.planner.unselectProduct(+this.product.item.id,this.product.ingredient.relationships.definition.data.id),this.deleteItemEvent()),this.requestUpdate()}render(){return r`
213
213
  <div class="mealz-product-card-planner
214
214
  ${this.status==="ticked"?"added":""}
215
215
  ${M.includes(this.status)||this.oftenIgnored?"disabled":""}
@@ -220,10 +220,10 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
220
220
  ${this.oftenIgnored?"disabled":""}
221
221
  ${this.status==="unavailable"?"unavailable":""}"
222
222
  >
223
- ${Se.includes(this.status)&&!this.oftenIgnored?this.renderEnabledProductCard():this.renderDisabledOrUnavailableProduct()}
223
+ ${we.includes(this.status)&&!this.oftenIgnored?this.renderEnabledProductCard():this.renderDisabledOrUnavailableProduct()}
224
224
  </div>
225
225
  </div>
226
- `}renderEnabledProductCard(){return a`
226
+ `}renderEnabledProductCard(){return r`
227
227
  <mealz-promotion-badge .priceData="${this.product.price}"></mealz-promotion-badge>
228
228
  <div class="mealz-product-card-planner__selected-product">
229
229
  <div class="mealz-product-card-planner__picture-column">
@@ -257,7 +257,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
257
257
  </div>
258
258
  </div>
259
259
  ${this.renderFooterActions()}
260
- `}renderHeader(){return a`
260
+ `}renderHeader(){return r`
261
261
  <div
262
262
  class="mealz-product-card-planner__header
263
263
  ${this.status==="ticked"?"added":""}
@@ -281,7 +281,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
281
281
  <span>${this.product.ingredient.attributes.unit}</span>
282
282
  </span>
283
283
  </div>
284
- `}renderFooterActions(){return a`
284
+ `}renderFooterActions(){return r`
285
285
  <div class="mealz-product-card-planner__footer__actions">
286
286
  <button
287
287
  @click="${()=>this.openReplaceItemView()}"
@@ -290,7 +290,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
290
290
  <span>Remplacer</span>
291
291
  </button>
292
292
  </div>
293
- `}renderCTA(){return a`
293
+ `}renderCTA(){return r`
294
294
  <div class="mealz-product-card-planner__checkbox mealz-ds-checkbox">
295
295
  <input
296
296
  type="checkbox"
@@ -298,8 +298,8 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
298
298
  @change="${e=>this.onCheckboxChange(e)}"
299
299
  >
300
300
  </div>
301
- `}renderDisabledOrUnavailableProduct(){return a`
302
- ${this.oftenIgnored?a`
301
+ `}renderDisabledOrUnavailableProduct(){return r`
302
+ ${this.oftenIgnored?r`
303
303
  <span class="mealz-ds-text mealz-product-card-planner__disabled-text">
304
304
  Cet ingrédient ne sera pas ajouté à votre panier
305
305
  </span>
@@ -309,7 +309,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
309
309
  <span>Ajouter un produit</span>
310
310
  </button>
311
311
  `:""}
312
- ${this.status==="unavailable"&&!this.oftenIgnored?a`
312
+ ${this.status==="unavailable"&&!this.oftenIgnored?r`
313
313
  <img class="mealz-ds-avatar" src="${this.ingredientPicture}" alt="ingredient picture">
314
314
  <mealz-unavailable-badge></mealz-unavailable-badge>
315
315
  <button
@@ -318,7 +318,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
318
318
  <span>Remplacer</span>
319
319
  </button>
320
320
  `:""}
321
- `}addItemEvent(){l.analytics.sendEvent("planner.item.add",this.analyticsPath,{recipe_id:this.recipeId,item_id:this.product.item.id})}deleteItemEvent(){l.analytics.sendEvent("planner.item.delete",this.analyticsPath,{recipe_id:this.recipeId,item_id:this.product.item.id})}replaceItemViewEvent(){l.analytics.sendEvent("planner.item.replace",this.analyticsPath,{recipe_id:this.recipeId,item_id:this.product.item.id})}};$([p({type:Object})],_.prototype,"product",2);$([p({type:String})],_.prototype,"recipeId",2);$([p({type:Number})],_.prototype,"initialGuests",2);$([p({type:Number})],_.prototype,"currentGuests",2);$([p({type:Boolean})],_.prototype,"oftenIgnored",2);_=$([g("mealz-product-card-planner")],_);customElements.get("mealz-product-card-planner")||customElements.define("mealz-product-card-planner",_);var xe=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,ie=(e,t,s,r)=>{for(var i=r>1?void 0:r?Ce(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=(r?o(t,s,i):o(i))||i);return r&&i&&xe(t,s,i),i};let U=class extends m{constructor(){super(),this.styleURL=new URL("./legal-notice/legal-notice.css",this.getBaseURL())}get containsAlcohol(){var t;return(((t=this.tags)==null?void 0:t.data)||[]).some(s=>s.id==="ingredient_category_alcool")}render(){return this.containsAlcohol?a`
321
+ `}addItemEvent(){o.analytics.sendEvent("planner.item.add",this.analyticsPath,{recipe_id:this.recipeId,item_id:this.product.item.id})}deleteItemEvent(){o.analytics.sendEvent("planner.item.delete",this.analyticsPath,{recipe_id:this.recipeId,item_id:this.product.item.id})}replaceItemViewEvent(){o.analytics.sendEvent("planner.item.replace",this.analyticsPath,{recipe_id:this.recipeId,item_id:this.product.item.id})}};$([p({type:Object})],_.prototype,"product",2);$([p({type:String})],_.prototype,"recipeId",2);$([p({type:Number})],_.prototype,"initialGuests",2);$([p({type:Number})],_.prototype,"currentGuests",2);$([p({type:Boolean})],_.prototype,"oftenIgnored",2);_=$([g("mealz-product-card-planner")],_);customElements.get("mealz-product-card-planner")||customElements.define("mealz-product-card-planner",_);var Se=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,ie=(e,t,s,a)=>{for(var i=a>1?void 0:a?Ce(t,s):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(i=(a?l(t,s,i):l(i))||i);return a&&i&&Se(t,s,i),i};let B=class extends m{constructor(){super(),this.styleURL=new URL("./legal-notice/legal-notice.css",this.getBaseURL())}get containsAlcohol(){var t;return(((t=this.tags)==null?void 0:t.data)||[]).some(s=>s.id==="ingredient_category_alcool")}render(){return this.containsAlcohol?r`
322
322
  <div class="mealz-products-picker__legal-notices">
323
323
  <span class="mealz-ds-text weight-xxl mealz-products-picker__legal-notices-header">Mentions légales</span>
324
324
  <div class="mealz-products-picker__legal-notices-content">
@@ -330,7 +330,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
330
330
  </span>
331
331
  </div>
332
332
  </div>
333
- `:c}};ie([p()],U.prototype,"tags",2);U=ie([g("mealz-legal-notice")],U);customElements.get("mealz-legal-notice")||customElements.define("mealz-legal-notice",U);var Re=Object.getOwnPropertyDescriptor,Oe=(e,t,s,r)=>{for(var i=r>1?void 0:r?Re(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=o(i)||i);return i};let F=class extends m{constructor(){super(),this.styleURL=[new URL("./product-card/product-card-skeleton/product-card-skeleton.css",this.getBaseURL()),new URL("./product-card/product-card.css",this.getBaseURL())]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){return a`
333
+ `:c}};ie([p()],B.prototype,"tags",2);B=ie([g("mealz-legal-notice")],B);customElements.get("mealz-legal-notice")||customElements.define("mealz-legal-notice",B);var xe=Object.getOwnPropertyDescriptor,Re=(e,t,s,a)=>{for(var i=a>1?void 0:a?xe(t,s):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(i=l(i)||i);return i};let F=class extends m{constructor(){super(),this.styleURL=[new URL("./product-card/product-card-skeleton/product-card-skeleton.css",this.getBaseURL()),new URL("./product-card/product-card.css",this.getBaseURL())]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){return r`
334
334
  <!-- PRODUCT CARD -->
335
335
  <div class="mealz-product-card skeleton">
336
336
  <!-- HEADER -->
@@ -373,9 +373,9 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
373
373
  </div>
374
374
  </div>
375
375
  </div>
376
- `}};F=Oe([g("mealz-products-card-skeleton")],F);customElements.get("mealz-products-card-skeleton")||customElements.define("mealz-products-card-skeleton",F);var we=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,W=(e,t,s,r)=>{for(var i=r>1?void 0:r?Le(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=(r?o(t,s,i):o(i))||i);return r&&i&&we(t,s,i),i};let E=class extends m{constructor(){super(),this.inBasket=!1,this.plannerMode=!1,this.numberUnavailableProducts=0,this.subscriptions=[],this.noSupplier=l.supplier.isNoSupplier(),this.hasEmittedReady=!1,this.styleURL=new URL("./products-picker/products-picker.css",this.getBaseURL())}get totalProducts(){return this.recipe.relationships.ingredients.data.length}connectedCallback(){super.connectedCallback(),this.resetProducts(),this.listenToProducts(),this.subscriptions.push(l.recipes.displayedRecipe$.subscribe(e=>{e&&(this.recipe=e.recipe,this.analyticsPath=`/recipes/${this.recipe.id}/shopping`,this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.resetProducts(),this.subscriptions.forEach(e=>e.unsubscribe())}resetProducts(){this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.numberUnavailableProducts=0,this.requestUpdate()}listenToProducts(){const e=this.plannerMode?l.recipes.productsPlannerByCategory$:l.recipes.productsByCategory$;this.subscriptions.push(e.subscribe(t=>{this.productsByCategory=t,this.plannerMode?this.numberUnavailableProducts=[...t.oftenIgnoredProducts,...t.toPickProducts].filter(s=>s.status==="unavailable").length:this.numberUnavailableProducts=[...t.oftenIgnoredProducts,...t.toPickProducts].filter(s=>s.basketEntry.status==="out_of_stock").length,this.requestUpdate(),this.notifyReadyIfRendered()}))}async notifyReadyIfRendered(){if(this.hasEmittedReady)return;if(await this.updateComplete,this.querySelector(".mealz-product-card-planner__checkbox")||this.querySelector(".mealz-product-card__checkbox")){this.hasEmittedReady=!0;const t=new CustomEvent("products-picker-ready",{bubbles:!0,composed:!0});this.dispatchEvent(t)}}scrollToFirstUnavailable(){const e=document.querySelector(this.plannerMode?".mealz-products-picker":".mealz-products-picker__container");if(e){const t=e.querySelector(this.plannerMode?".mealz-product-card-planner.unavailable":".mealz-product-card__container.out_of_stock");t&&t.scrollIntoView({behavior:"smooth",block:"center"})}}isAlreadyOnCatalogPage(){return window.location.href.includes(l.router.getCatalogUrl())}closeRecipeModal(){}currentPath(){return""}guestsChange(e){const t=new CustomEvent("guestChange",{bubbles:!0,composed:!0,detail:{value:e.detail.value}});this.dispatchEvent(t)}render(){var e,t,s;return a`
376
+ `}};F=Re([g("mealz-products-card-skeleton")],F);customElements.get("mealz-products-card-skeleton")||customElements.define("mealz-products-card-skeleton",F);var Oe=Object.defineProperty,De=Object.getOwnPropertyDescriptor,W=(e,t,s,a)=>{for(var i=a>1?void 0:a?De(t,s):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(i=(a?l(t,s,i):l(i))||i);return a&&i&&Oe(t,s,i),i};let E=class extends m{constructor(){super(),this.inBasket=!1,this.plannerMode=!1,this.numberUnavailableProducts=0,this.subscriptions=[],this.noSupplier=o.supplier.isNoSupplier(),this.hasEmittedReady=!1,this.styleURL=new URL("./products-picker/products-picker.css",this.getBaseURL())}get totalProducts(){return this.recipe.relationships.ingredients.data.length}connectedCallback(){super.connectedCallback(),this.resetProducts(),this.listenToProducts(),this.subscriptions.push(o.recipes.displayedRecipe$.subscribe(e=>{e&&(this.recipe=e.recipe,this.analyticsPath=`/recipes/${this.recipe.id}/shopping`,this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.resetProducts(),this.subscriptions.forEach(e=>e.unsubscribe())}resetProducts(){this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.numberUnavailableProducts=0,this.requestUpdate()}listenToProducts(){const e=this.plannerMode?o.recipes.productsPlannerByCategory$:o.recipes.productsByCategory$;this.subscriptions.push(e.subscribe(t=>{this.productsByCategory=t,this.plannerMode?this.numberUnavailableProducts=[...t.oftenIgnoredProducts,...t.toPickProducts].filter(s=>s.status==="unavailable").length:this.numberUnavailableProducts=[...t.oftenIgnoredProducts,...t.toPickProducts].filter(s=>s.basketEntry.status==="out_of_stock").length,this.requestUpdate(),this.notifyReadyIfRendered()}))}async notifyReadyIfRendered(){if(this.hasEmittedReady)return;if(await this.updateComplete,this.querySelector(".mealz-product-card-planner__checkbox")||this.querySelector(".mealz-product-card__checkbox")){this.hasEmittedReady=!0;const t=new CustomEvent("products-picker-ready",{bubbles:!0,composed:!0});this.dispatchEvent(t)}}scrollToFirstUnavailable(){const e=document.querySelector(this.plannerMode?".mealz-products-picker":".mealz-products-picker__container");if(e){const t=e.querySelector(this.plannerMode?".mealz-product-card-planner.unavailable":".mealz-product-card__container.out_of_stock");t&&t.scrollIntoView({behavior:"smooth",block:"center"})}}isAlreadyOnCatalogPage(){return window.location.href.includes(o.router.getCatalogUrl())}closeRecipeModal(){}currentPath(){return""}guestsChange(e){const t=new CustomEvent("guestChange",{bubbles:!0,composed:!0,detail:{value:e.detail.value}});this.dispatchEvent(t)}render(){var e,t,s;return r`
377
377
  <div class="mealz-products-picker">
378
- ${this.inBasket&&this.plannerMode?a`
378
+ ${this.inBasket&&this.plannerMode?r`
379
379
  <div class="mealz-products-picker__overlay">
380
380
  <div class="mealz-products-picker__overlay-text">
381
381
  <span class="mealz-ds-text">
@@ -388,50 +388,50 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
388
388
  ${this.renderHeader()}
389
389
  <div class="mealz-products-picker__list">
390
390
  <!-- TO PICK PRODUCTS -->
391
- ${((e=this.productsByCategory)==null?void 0:e.toPickProducts.length)>0?this.productsByCategory.toPickProducts.map(r=>{var i,n,o,d;return this.plannerMode?a`
391
+ ${((e=this.productsByCategory)==null?void 0:e.toPickProducts.length)>0?this.productsByCategory.toPickProducts.map(a=>{var i,n,l,d;return this.plannerMode?r`
392
392
  <mealz-product-card-planner
393
- .product="${r}"
393
+ .product="${a}"
394
394
  .recipeId="${this.recipe.id}"
395
395
  .oftenIgnored="${!1}"
396
396
  .initialGuests="${((i=this.recipe)==null?void 0:i.attributes["number-of-guests"])||4}"
397
397
  .currentGuests="${this.recipe.modifiedGuests||((n=this.recipe)==null?void 0:n.attributes["number-of-guests"])||4}"
398
398
  ></mealz-product-card-planner>
399
- `:a`
399
+ `:r`
400
400
  <mealz-product-card
401
- .product="${r}"
401
+ .product="${a}"
402
402
  .recipeId="${this.recipe.id}"
403
- .initialGuests="${((o=this.recipe)==null?void 0:o.attributes["number-of-guests"])||4}"
403
+ .initialGuests="${((l=this.recipe)==null?void 0:l.attributes["number-of-guests"])||4}"
404
404
  .currentGuests="${this.recipe.modifiedGuests||((d=this.recipe)==null?void 0:d.attributes["number-of-guests"])||4}"
405
405
  ></mealz-product-card>
406
- `}):Array(this.totalProducts).fill(a`
406
+ `}):Array(this.totalProducts).fill(r`
407
407
  <mealz-products-card-skeleton></mealz-products-card-skeleton>
408
408
  `)}
409
409
  </div>
410
410
  <!-- OFTEN IGNORED PRODUCTS -->
411
411
  <div class="mealz-products-picker__secondary-list">
412
- ${((s=(t=this.productsByCategory)==null?void 0:t.oftenIgnoredProducts)==null?void 0:s.length)>0?a`
412
+ ${((s=(t=this.productsByCategory)==null?void 0:t.oftenIgnoredProducts)==null?void 0:s.length)>0?r`
413
413
  <mealz-accordion
414
414
  .noStyling=${!0}
415
- .titleSlot=${a`
415
+ .titleSlot=${r`
416
416
  <span class="mealz-ds-text weight-xl">
417
417
  Déjà dans le placard
418
418
  </span>
419
419
  `}
420
- .contentSlot=${a`
420
+ .contentSlot=${r`
421
421
  <div class="mealz-products-picker__list">
422
- ${this.productsByCategory.oftenIgnoredProducts.map(r=>{var i,n,o,d;return this.plannerMode?a`
422
+ ${this.productsByCategory.oftenIgnoredProducts.map(a=>{var i,n,l,d;return this.plannerMode?r`
423
423
  <mealz-product-card-planner
424
- .product=${r}
424
+ .product=${a}
425
425
  .recipeId=${this.recipe.id}
426
426
  .oftenIgnored=${!0}
427
427
  .initialGuests=${((i=this.recipe)==null?void 0:i.attributes["number-of-guests"])||4}
428
428
  .currentGuests=${this.recipe.modifiedGuests||((n=this.recipe)==null?void 0:n.attributes["number-of-guests"])||4}
429
429
  ></mealz-product-card-planner>
430
- `:a`
430
+ `:r`
431
431
  <mealz-product-card
432
- .product=${r}
432
+ .product=${a}
433
433
  .recipeId=${this.recipe.id}
434
- .initialGuests=${((o=this.recipe)==null?void 0:o.attributes["number-of-guests"])||4}
434
+ .initialGuests=${((l=this.recipe)==null?void 0:l.attributes["number-of-guests"])||4}
435
435
  .currentGuests=${this.recipe.modifiedGuests||((d=this.recipe)==null?void 0:d.attributes["number-of-guests"])||4}
436
436
  ></mealz-product-card>
437
437
  `})}
@@ -443,15 +443,15 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
443
443
  </div>
444
444
  ${this.noSupplier?c:this.renderLowerContent()}
445
445
  </div>
446
- `}renderHeader(){var e;return a`
446
+ `}renderHeader(){var e;return r`
447
447
  <div class="mealz-products-picker__header">
448
- ${this.totalProducts>0?a`
448
+ ${this.totalProducts>0?r`
449
449
  <div class="mealz-products-picker__header-text mealz-ds-text weight-xxl">
450
450
  <div class="mealz-products-picker__number-of-products">
451
451
  <span>${this.totalProducts}</span>
452
- ${this.totalProducts>1?a`<span>ingrédients</span>`:a`<span>ingrédient</span>`}
452
+ ${this.totalProducts>1?r`<span>ingrédients</span>`:r`<span>ingrédient</span>`}
453
453
  </div>
454
- ${this.numberUnavailableProducts>0?a`
454
+ ${this.numberUnavailableProducts>0?r`
455
455
  <mealz-unavailable-badge
456
456
  .numberUnavailable="${this.numberUnavailableProducts}"
457
457
  @clicked="${()=>this.scrollToFirstUnavailable()}">
@@ -460,7 +460,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
460
460
  </div>
461
461
  `:c}
462
462
  <!-- GUEST COUNTER FOR NO SUPPLIER MODE-->
463
- ${this.noSupplier?a`
463
+ ${this.noSupplier?r`
464
464
  <mealz-counter
465
465
  .floating="${!0}"
466
466
  .value="${(e=this.recipe)==null?void 0:e.modifiedGuests}"
@@ -478,27 +478,27 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
478
478
  </select>
479
479
  </div> -->
480
480
  </div>
481
- `}renderLowerContent(){return a`
481
+ `}renderLowerContent(){return r`
482
482
  <!-- MORE RECIPE IDEAS -->
483
483
  <div class="mealz-products-picker__more">
484
- ${!this.isAlreadyOnCatalogPage()&&!this.plannerMode?a`
484
+ ${!this.isAlreadyOnCatalogPage()&&!this.plannerMode?r`
485
485
  <a class="mealz-products-picker__more-anchor"
486
- href="${l.router.getCatalogUrl()}"
486
+ href="${o.router.getCatalogUrl()}"
487
487
  @click="${this.sendHomeDisplayEvent}">
488
488
  <button class="mealz-products-picker__go-to-catalog-button mealz-ds-button secondary">
489
489
  <span class="mealz-ds-text weight-l size-s">Voir plus d'idées repas</span>
490
490
  </button>
491
491
  </a>
492
- `:a`
492
+ `:r`
493
493
  <button class="mealz-products-picker__close-modal-button mealz-ds-button secondary" @click="${this.closeRecipeModal}">
494
494
  <span class="mealz-ds-text weight-l size-s">Voir plus d'idées repas</span>
495
495
  </button>
496
496
  `}
497
497
  </div>
498
498
  <mealz-legal-notice .tags="${this.recipe.relationships.tags}"></mealz-legal-notice>
499
- `}sendHomeDisplayEvent(){l.analytics.sendEvent("home.display",this.analyticsPath,{})}};W([p({type:Boolean})],E.prototype,"inBasket",2);W([p({type:Boolean})],E.prototype,"plannerMode",2);E=W([g("mealz-products-picker")],E);customElements.get("mealz-products-picker")||customElements.define("mealz-products-picker",E);var Ue=Object.getOwnPropertyDescriptor,De=(e,t,s,r)=>{for(var i=r>1?void 0:r?Ue(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=o(i)||i);return i};let j=class extends m{constructor(){super(),this.invalidPos=!1,this.subscriptions=[],this.styleURL=new URL("./recipe-details/no-pos-selected/no-pos-selected.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.listenIfPosInvalid()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}listenIfPosInvalid(){this.subscriptions.push(l.recipes.invalidPosDisplay$.subscribe(e=>{this.invalidPos=e,this.requestUpdate()}))}callPosSelector(){const e=new CustomEvent("posSelected",{bubbles:!0,composed:!0});this.dispatchEvent(e)}openStoreLocator(){window.mealzInternal.noSupplier.displaySupplierSelector$.next(!0)}render(){return a`
499
+ `}sendHomeDisplayEvent(){o.analytics.sendEvent("home.display",this.analyticsPath,{})}};W([p({type:Boolean})],E.prototype,"inBasket",2);W([p({type:Boolean})],E.prototype,"plannerMode",2);E=W([g("mealz-products-picker")],E);customElements.get("mealz-products-picker")||customElements.define("mealz-products-picker",E);var Be=Object.getOwnPropertyDescriptor,Le=(e,t,s,a)=>{for(var i=a>1?void 0:a?Be(t,s):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(i=l(i)||i);return i};let V=class extends m{constructor(){super(),this.invalidPos=!1,this.subscriptions=[],this.styleURL=new URL("./recipe-details/no-pos-selected/no-pos-selected.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.listenIfPosInvalid()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}listenIfPosInvalid(){this.subscriptions.push(o.recipes.invalidPosDisplay$.subscribe(e=>{this.invalidPos=e,this.requestUpdate()}))}callPosSelector(){const e=new CustomEvent("posSelected",{bubbles:!0,composed:!0});this.dispatchEvent(e)}openStoreLocator(){window.mealzInternal.noSupplier.displaySupplierSelector$.next(!0)}render(){return r`
500
500
  <div class="mealz-no-pos-selected">
501
- ${this.invalidPos?a`
501
+ ${this.invalidPos?r`
502
502
  <!-- INVALID POS -->
503
503
  <img
504
504
  class="mealz-no-pos-selected__picture"
@@ -513,7 +513,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
513
513
  Vous pouvez sélectionner un autre magasin ou consulter la fiche recette
514
514
  </span>
515
515
  </div>
516
- `:a`
516
+ `:r`
517
517
  <!-- NO POS SELECTED -->
518
518
  <img
519
519
  class="mealz-no-pos-selected__picture"
@@ -536,13 +536,13 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
536
536
  Sélectionner un magasin
537
537
  </button>
538
538
  </div>
539
- `}};j=De([g("mealz-no-pos-selected")],j);customElements.get("mealz-no-pos-selected")||customElements.define("mealz-no-pos-selected",j);var Be=Object.getOwnPropertyDescriptor,Ae=(e,t,s,r)=>{for(var i=r>1?void 0:r?Be(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=o(i)||i);return i};let V=class extends m{constructor(){super(),this.activeTabIndex=0,this.destroy$=new L,this.remainingBasketEntries=[],this.guestObserverService=te.getInstance(),this.isSticky=!1,this.styleURL=new URL("./recipe-details/recipe-details.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.destroy$=new L,this.handleNoSupplierMode(),Z(l.recipes.displayedRecipe$.pipe(w(this.destroy$),Q(e=>!!e),z(e=>{e.recipe!==null&&(this.recipe=e.recipe,this.sponsor=e.recipe.relationships.sponsors.data[0],this.analyticsPath=`/recipes/${this.recipe.id}/shopping`,this.plannerMode=!!e.planner,this.getLikeButton(),this.checkSponsorStorytelling(),this.pageview(),this.listenToCloseEvent(),this.setStickyObserver())}),Y(e=>e.recipe===null?[]:this.listenToRecipeInBasket())),this.listenPosStatus(),this.listenRemainingBasketEntries(),this.listenLastOrderDate(),this.listenToLoadingStates(),this.listenToAddAllToBasket()).pipe(w(this.destroy$)).subscribe({next:()=>this.requestUpdate(),error:e=>console.error("Recipe details error:",e)}),this.addEventListener("products-picker-ready",()=>this.startRecipeDetailsOnboardingIfNeeded())}disconnectedCallback(){super.disconnectedCallback(),this.destroy$.next(),this.destroy$.complete(),this.topObserver&&this.topObserver.disconnect(),this.stickyTimeout&&clearTimeout(this.stickyTimeout)}setStickyObserver(){this.topObserver||this.updateComplete.then(()=>{const e=this.querySelector(".mealz-recipe-details__sticky-anchor");e&&(this.topObserver=new IntersectionObserver(([t])=>{this.stickyTimeout&&clearTimeout(this.stickyTimeout),this.stickyTimeout=window.setTimeout(()=>{const s=!t.isIntersecting;this.isSticky!==s&&(this.isSticky=s,this.requestUpdate())},150)},{threshold:0}),this.topObserver.observe(e))})}startRecipeDetailsOnboardingIfNeeded(){localStorage.getItem("_miam/recipeDetailsOnboarding")==="true"||!this.plannerMode||this.updateComplete.then(()=>{this.scrollJustAfterImage();let t=document.querySelector("mealz-planner-onboarding");t?t.type="recipe-details":(t=new ue,t.type="recipe-details",document.body.appendChild(t)),t.launchOnboardingTour()})}scrollJustAfterImage(){const e=this.querySelector(".mealz-recipe-details__tabs");if(!e)return;const t=document.querySelector(".mealz-drawer__content-container");if(t){const s=e.getBoundingClientRect(),r=t.getBoundingClientRect();t.scrollTop+=s.top-r.top;return}e.scrollIntoView({behavior:"smooth",block:"start"})}handleNoSupplierMode(){this.noSupplier=!!l.supplier.isNoSupplier(),this.requestUpdate()}close(){this.sendCloseEvent(),l.recipes.displayedRecipe$.next(null)}listenToCloseEvent(){const e=document.querySelector("mealz-drawer");e&&e.addEventListener("drawerClosed",()=>{this.sendCloseEvent()})}selectTab(e){this.activeTabIndex=e,this.activeTabIndex===1&&this.sendCookingDisplayEvent(),this.requestUpdate()}getLikeButton(){this.noSupplier||l.user.isAuthenticated().pipe(w(this.destroy$),Q(e=>e),Y(()=>l.html.like(this.recipe.id))).subscribe({next:e=>{this.likeButtonHTML=e,this.requestUpdate()},error:e=>console.error("Like button error:",e)})}checkSponsorStorytelling(){this.sponsor&&l.sponsor.hasStorytelling(this.sponsor.id).pipe(w(this.destroy$)).subscribe({next:e=>{this.hasSponsorStorytelling=e,this.requestUpdate()},error:e=>console.error("Sponsor storytelling error:",e)})}listenPosStatus(){return J({noPosDisplay:l.recipes.noPosDisplay$,invalidPosDisplay:l.recipes.invalidPosDisplay$}).pipe(z(({noPosDisplay:e,invalidPosDisplay:t})=>{this.noPosDisplay=e,this.invalidPosDisplay=t,this.activeTabIndex=e?1:0}),h(()=>{}))}listenLastOrderDate(){return l.recipes.orderHistoryDate$.pipe(z(e=>{this.orderHistoryDate=e}))}listenToLoadingStates(){return J([l.recipes.ingredientToBasketLoading$,l.recipes.updateIngredientFromBasketLoading$]).pipe(h(([e,t])=>e||t),z(e=>{this.basketIsUpdating=e}),be(1))}listenRemainingBasketEntries(){return l.recipes.remainingBasketEntries$.pipe(z(e=>{this.remainingBasketEntries=e}))}listenToAddAllToBasket(){return l.recipes.allIngredientsToBasketLoading$.pipe(z(e=>{e&&(this.selectTab(0),setTimeout(()=>{this.scrollToPicker()},50))}))}listenToRecipeInBasket(){return l.recipes.isRecipeInBasket(this.recipe.id).pipe(z(e=>{this.inBasket=e}))}scrollToPicker(){const e=this.querySelector(".mealz-products-picker");if(e){const t=this.querySelector(".mealz-recipe-details__title-container"),s=(t==null?void 0:t.offsetHeight)||0;e.style.scrollMarginTop=`${s}px`,e.scrollIntoView({behavior:"instant",block:"start"})}}scrollToReplacedItem(e){var s,r;const t=this.querySelectorAll("mealz-product-card-planner");for(const i of Array.from(t)){const n=i;if(((r=(s=n.product)==null?void 0:s.item)==null?void 0:r.id)===e){n.scrollIntoView({behavior:"instant",block:"center"});break}}}openLastOrderModal(){this.sendOrderedDisplayEvent();const e=new de;e.recipeId=this.recipe.id,e.addEventListener("orderAgain",()=>this.orderAgain()),e.displayLastOrderModal(this.orderHistoryDate)}orderAgain(){l.recipes.addAllIngredientsToBasket({originPath:this.analyticsPath,props:{}})}updateGuests(e){if(this.recipe.modifiedGuests===e.detail.value)return;this.recipe.modifiedGuests=e.detail.value,this.guestObserverService.updateGuests(this.recipe.modifiedGuests);const t={originPath:this.analyticsPath,props:{}};this.plannerMode?l.planner.updateGuests(this.recipe.modifiedGuests,t):l.recipes.updateGuests(t),this.requestUpdate()}render(){return a`
539
+ `}};V=Le([g("mealz-no-pos-selected")],V);customElements.get("mealz-no-pos-selected")||customElements.define("mealz-no-pos-selected",V);var Ue=Object.getOwnPropertyDescriptor,Ae=(e,t,s,a)=>{for(var i=a>1?void 0:a?Ue(t,s):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(i=l(i)||i);return i};let j=class extends m{constructor(){super(),this.activeTabIndex=0,this.destroy$=new D,this.remainingBasketEntries=[],this.guestObserverService=te.getInstance(),this.isSticky=!1,this.hasBackNavigation=!1,this.drawerViewSwapper=null,this.styleURL=new URL("./recipe-details/recipe-details.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.destroy$=new D,this.handleNoSupplierMode(),Z(o.recipes.displayedRecipe$.pipe(O(this.destroy$),Q(e=>!!e),z(e=>{e.recipe!==null&&(this.recipe=e.recipe,this.sponsor=e.recipe.relationships.sponsors.data[0],this.analyticsPath=`/recipes/${this.recipe.id}/shopping`,this.plannerMode=!!e.planner,this.getLikeButton(),this.checkSponsorStorytelling(),this.pageview(),this.listenToCloseEvent(),this.setStickyObserver())}),Y(e=>e.recipe===null?[]:this.listenToRecipeInBasket())),this.listenPosStatus(),this.listenRemainingBasketEntries(),this.listenLastOrderDate(),this.listenToLoadingStates(),this.listenToAddAllToBasket()).pipe(O(this.destroy$)).subscribe({next:()=>this.requestUpdate(),error:e=>console.error("Recipe details error:",e)}),this.addEventListener("products-picker-ready",()=>this.startRecipeDetailsOnboardingIfNeeded()),this.setupDrawerBackNavigationIndicator()}disconnectedCallback(){super.disconnectedCallback(),this.destroy$.next(),this.destroy$.complete(),this.topObserver&&this.topObserver.disconnect(),this.stickyTimeout&&clearTimeout(this.stickyTimeout),this.drawerViewSwapper&&this.onActiveViewsChanged&&this.drawerViewSwapper.removeEventListener("mealz-active-views-changed",this.onActiveViewsChanged)}setupDrawerBackNavigationIndicator(){const e=this.closest("mealz-drawer-view-swapper");this.drawerViewSwapper=e??document.querySelector("mealz-drawer-view-swapper"),this.drawerViewSwapper&&(this.updateBackNavigationFromActiveViews(this.drawerViewSwapper.getActiveViewNames()),this.onActiveViewsChanged=t=>{const s=t==null?void 0:t.detail;s!=null&&s.activeViews&&this.updateBackNavigationFromActiveViews(s.activeViews)},this.drawerViewSwapper.addEventListener("mealz-active-views-changed",this.onActiveViewsChanged))}updateBackNavigationFromActiveViews(e){const t=Array.isArray(e)&&e.length>1;this.hasBackNavigation!==t&&(this.hasBackNavigation=t,this.requestUpdate())}getRecipeDetailsCloseIcon(){return this.hasBackNavigation?{src:"https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg",alt:"back button",className:"mealz-recipe-details__close-icon is-back"}:{src:"https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg",alt:"modal close button",className:"mealz-recipe-details__close-icon"}}getRecipeDetailsStickyCloseIcon(){return this.hasBackNavigation?{src:"https://storage.googleapis.com/assets.miam.tech/generic/icons/ArrowLeft_dark.svg",alt:"back button",className:"mealz-recipe-details__close-icon before-title is-back"}:{src:"https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_Black.svg",alt:"modal close button",className:"mealz-recipe-details__close-icon"}}setStickyObserver(){this.topObserver||this.updateComplete.then(()=>{const e=this.querySelector(".mealz-recipe-details__sticky-anchor");e&&(this.topObserver=new IntersectionObserver(([t])=>{this.stickyTimeout&&clearTimeout(this.stickyTimeout),this.stickyTimeout=window.setTimeout(()=>{const s=!t.isIntersecting;this.isSticky!==s&&(this.isSticky=s,this.requestUpdate())},150)},{threshold:0}),this.topObserver.observe(e))})}startRecipeDetailsOnboardingIfNeeded(){localStorage.getItem("_miam/recipeDetailsOnboarding")==="true"||!this.plannerMode||this.updateComplete.then(()=>{this.scrollJustAfterImage();let t=document.querySelector("mealz-planner-onboarding");t?t.type="recipe-details":(t=new ue,t.type="recipe-details",document.body.appendChild(t)),t.launchOnboardingTour()})}scrollJustAfterImage(){const e=this.querySelector(".mealz-recipe-details__tabs");if(!e)return;const t=document.querySelector(".mealz-drawer__content-container");if(t){const s=e.getBoundingClientRect(),a=t.getBoundingClientRect();t.scrollTop+=s.top-a.top;return}e.scrollIntoView({behavior:"smooth",block:"start"})}handleNoSupplierMode(){this.noSupplier=!!o.supplier.isNoSupplier(),this.requestUpdate()}close(){this.sendCloseEvent(),o.recipes.displayedRecipe$.next(null)}listenToCloseEvent(){const e=document.querySelector("mealz-drawer");e&&e.addEventListener("drawerClosed",()=>{this.sendCloseEvent()})}selectTab(e){this.activeTabIndex=e,this.activeTabIndex===1&&this.sendCookingDisplayEvent(),this.requestUpdate()}getLikeButton(){this.noSupplier||o.user.isAuthenticated().pipe(O(this.destroy$),Q(e=>e),Y(()=>o.html.like(this.recipe.id))).subscribe({next:e=>{this.likeButtonHTML=e,this.requestUpdate()},error:e=>console.error("Like button error:",e)})}checkSponsorStorytelling(){this.sponsor&&o.sponsor.hasStorytelling(this.sponsor.id).pipe(O(this.destroy$)).subscribe({next:e=>{this.hasSponsorStorytelling=e,this.requestUpdate()},error:e=>console.error("Sponsor storytelling error:",e)})}listenPosStatus(){return J({noPosDisplay:o.recipes.noPosDisplay$,invalidPosDisplay:o.recipes.invalidPosDisplay$}).pipe(z(({noPosDisplay:e,invalidPosDisplay:t})=>{this.noPosDisplay=e,this.invalidPosDisplay=t,this.activeTabIndex=e?1:0}),h(()=>{}))}listenLastOrderDate(){return o.recipes.orderHistoryDate$.pipe(z(e=>{this.orderHistoryDate=e}))}listenToLoadingStates(){return J([o.recipes.ingredientToBasketLoading$,o.recipes.updateIngredientFromBasketLoading$]).pipe(h(([e,t])=>e||t),z(e=>{this.basketIsUpdating=e}),be(1))}listenRemainingBasketEntries(){return o.recipes.remainingBasketEntries$.pipe(z(e=>{this.remainingBasketEntries=e}))}listenToAddAllToBasket(){return o.recipes.allIngredientsToBasketLoading$.pipe(z(e=>{e&&(this.selectTab(0),setTimeout(()=>{this.scrollToPicker()},50))}))}listenToRecipeInBasket(){return o.recipes.isRecipeInBasket(this.recipe.id).pipe(z(e=>{this.inBasket=e}))}scrollToPicker(){const e=this.querySelector(".mealz-products-picker");if(e){const t=this.querySelector(".mealz-recipe-details__title-container"),s=(t==null?void 0:t.offsetHeight)||0;e.style.scrollMarginTop=`${s}px`,e.scrollIntoView({behavior:"instant",block:"start"})}}scrollToReplacedItem(e){var s,a;const t=this.querySelectorAll("mealz-product-card-planner");for(const i of Array.from(t)){const n=i;if(((a=(s=n.product)==null?void 0:s.item)==null?void 0:a.id)===e){n.scrollIntoView({behavior:"instant",block:"center"});break}}}openLastOrderModal(){this.sendOrderedDisplayEvent();const e=new de;e.recipeId=this.recipe.id,e.addEventListener("orderAgain",()=>this.orderAgain()),e.displayLastOrderModal(this.orderHistoryDate)}orderAgain(){o.recipes.addAllIngredientsToBasket({originPath:this.analyticsPath,props:{}})}updateGuests(e){if(this.recipe.modifiedGuests===e.detail.value)return;this.recipe.modifiedGuests=e.detail.value,this.guestObserverService.updateGuests(this.recipe.modifiedGuests);const t={originPath:this.analyticsPath,props:{}};this.plannerMode?o.planner.updateGuests(this.recipe.modifiedGuests,t):o.recipes.updateGuests(t),this.requestUpdate()}render(){const e=this.getRecipeDetailsCloseIcon(),t=this.getRecipeDetailsStickyCloseIcon();return r`
540
540
  <div class="mealz-recipe-details">
541
541
  <!-- IF IS LOADING -->
542
- ${this.recipe?c:a`
542
+ ${this.recipe?c:r`
543
543
  <div class="mealz-ds-loader mealz-recipe-details__loader"></div>`}
544
544
  <!-- IF IS NOT LOADING AND RECIPE EXISTS -->
545
- ${this.recipe?a`
545
+ ${this.recipe?r`
546
546
  <div class="mealz-recipe-details__container">
547
547
  <!-- BANNER CONTAINER -->
548
548
  <div class="mealz-recipe-details__picture ${this.noSupplier?"no-supplier":""}">
@@ -554,9 +554,9 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
554
554
  <button
555
555
  class="mealz-recipe-details__close-button mealz-ds-button square primary reverse"
556
556
  @click="${()=>this.close()}">
557
- <img class="mealz-recipe-details__close-icon"
558
- src="https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg"
559
- alt="modal close button"/>
557
+ <img class=${e.className}
558
+ src=${e.src}
559
+ alt=${e.alt}/>
560
560
  </button>
561
561
  </div>
562
562
  <!-- GUEST COUNTER -->
@@ -566,7 +566,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
566
566
  .min=${1}
567
567
  .debounce=${300}
568
568
  .disabled=${this.basketIsUpdating}
569
- @valueChange=${e=>this.updateGuests(e)}
569
+ @valueChange=${s=>this.updateGuests(s)}
570
570
  ></mealz-counter>
571
571
  </div>
572
572
  <!-- PICTURE / VIDEO -->
@@ -575,7 +575,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
575
575
  src="${this.recipe.attributes["media-url"]}"
576
576
  class="mealz-recipe-details__picture-img">
577
577
  <!-- Filigrane logo -->
578
- ${this.recipe.attributes["filigrane-logo-url"]?a`
578
+ ${this.recipe.attributes["filigrane-logo-url"]?r`
579
579
  <div class="mealz-recipe-details__picture__filigrane">
580
580
  <img alt="filigrane logo" src=${this.recipe.filigraneLogoUrl}>
581
581
  </div>`:c}
@@ -586,7 +586,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
586
586
  <hr class="mealz-recipe-details__sponsor-separator">
587
587
  </div>
588
588
  <!-- LAST ORDER BADGE -->
589
- ${this.orderHistoryDate?a`
589
+ ${this.orderHistoryDate?r`
590
590
  <div class="mealz-recipe-details__last-order-badge">
591
591
  <mealz-last-order-badge
592
592
  .orderHistoryDate=${this.orderHistoryDate}
@@ -614,19 +614,19 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
614
614
  <button @click="${()=>this.close()}"
615
615
  class="mealz-recipe-details__close-button mealz-ds-button square small">
616
616
  <img
617
- alt="modal close button"
618
- class="mealz-recipe-details__close-icon"
619
- src="https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_Black.svg"/>
617
+ alt=${t.alt}
618
+ class=${t.className}
619
+ src=${t.src}/>
620
620
  </button>
621
621
  </div>
622
622
  </div>
623
623
  </div>
624
624
  <!-- STORE INDICATOR -->
625
- ${this.noSupplier?a`
625
+ ${this.noSupplier?r`
626
626
  <mealz-store-indicator .analyticsPath=${this.analyticsPath}></mealz-store-indicator>`:c}
627
627
  </div>
628
628
  <!-- RECIPE BASIC INFORMATIONS + TABS -->
629
- ${this.noSupplier?c:a`
629
+ ${this.noSupplier?c:r`
630
630
  <!-- RECIPE BASIC INFORMATIONS -->
631
631
  <mealz-details-infos class="mealz-recipe-details__infos"></mealz-details-infos>
632
632
  <!-- TABS TO SWITCH BETWEEN BASKET AND INSTRUCTIONS -->
@@ -635,7 +635,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
635
635
  <mealz-slider-tabs
636
636
  .tabs=${["Je fais mes courses","Je cuisine"]}
637
637
  .selectedTabIndex=${this.activeTabIndex}
638
- @tabChanged="${e=>{var t;return this.selectTab((t=e.detail)==null?void 0:t.selectedTab)}}"
638
+ @tabChanged="${s=>{var a;return this.selectTab((a=s.detail)==null?void 0:a.selectedTab)}}"
639
639
  ></mealz-slider-tabs>
640
640
  </div>
641
641
  `}
@@ -644,7 +644,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
644
644
  ${this.renderTabContent()}
645
645
  </div>
646
646
  <!-- FOOTER -->
647
- ${this.activeTabIndex===0&&!this.noPosDisplay||this.plannerMode?a`
647
+ ${this.activeTabIndex===0&&!this.noPosDisplay||this.plannerMode?r`
648
648
  <mealz-details-footer
649
649
  .noPosDisplay=${this.noPosDisplay}
650
650
  .noSupplier=${this.noSupplier}
@@ -656,14 +656,14 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
656
656
  </div>
657
657
  `:c}
658
658
  </div>
659
- `}renderTabContent(){return a`
659
+ `}renderTabContent(){return r`
660
660
  <div class="mealz-recipe-details__products-tab ${this.activeTabIndex===0?"":"hidden"}">
661
- ${!this.noPosDisplay&&!this.invalidPosDisplay?a`
661
+ ${!this.noPosDisplay&&!this.invalidPosDisplay?r`
662
662
  <mealz-products-picker
663
663
  .inBasket=${this.inBasket}
664
664
  .plannerMode=${this.plannerMode}
665
665
  @guestChange=${e=>this.updateGuests(e)}
666
- ></mealz-products-picker>`:a`
666
+ ></mealz-products-picker>`:r`
667
667
  <mealz-no-pos-selected
668
668
  .noPos=${this.noPosDisplay}
669
669
  .invalidPos=${this.invalidPosDisplay}
@@ -677,14 +677,14 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
677
677
  <!-- RECIPE INSTRUCTIONS -->
678
678
  <mealz-details-steps></mealz-details-steps>
679
679
  <!-- ORDER AGAIN -->
680
- ${this.orderHistoryDate&&this.remainingBasketEntries.length>0&&!this.plannerMode?a`
680
+ ${this.orderHistoryDate&&this.remainingBasketEntries.length>0&&!this.plannerMode?r`
681
681
  <mealz-order-again .recipeId=${this.recipe.id} @orderAgain=${()=>this.orderAgain()}></mealz-order-again>
682
682
  `:c}
683
683
  </div>
684
- `}renderAddonLink(){var e;return a`
684
+ `}renderAddonLink(){var e;return r`
685
685
  <div class="mealz-addon-link">
686
686
  <div class="mealz-addon-link__info">
687
- ${this.recipe.attributes["informational-sentence"]?a`<span class="mealz-ds-text size-s weight-l">${this.recipe.attributes["informational-sentence"]}</span>`:a`
687
+ ${this.recipe.attributes["informational-sentence"]?r`<span class="mealz-ds-text size-s weight-l">${this.recipe.attributes["informational-sentence"]}</span>`:r`
688
688
  <span class="mealz-ds-text size-s weight-l">
689
689
  <span>Cette recette vous est proposée par notre partenaire</span>
690
690
  <span class="mealz-addon-link__sponsor-name">
@@ -692,16 +692,16 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
692
692
  </span>
693
693
  </span>
694
694
  `}
695
- ${(e=this.recipe.attributes)!=null&&e["informational-page-html"]||this.hasSponsorStorytelling?a`
695
+ ${(e=this.recipe.attributes)!=null&&e["informational-page-html"]||this.hasSponsorStorytelling?r`
696
696
  <span class="mealz-addon-link__link mealz-ds-text size-s weight-xl" @click=${()=>this.showRecipeAddon()}>
697
697
  En savoir plus
698
698
  </span>
699
699
  `:c}
700
700
  </div>
701
- ${this.sponsor.attributes["logo-url"]?a`
701
+ ${this.sponsor.attributes["logo-url"]?r`
702
702
  <div class="mealz-addon-link__logo">
703
703
  <img src="${this.sponsor.attributes["logo-url"]}" alt="${this.sponsor.attributes.name} logo" />
704
704
  </div>
705
705
  `:c}
706
706
  </div>
707
- `}showRecipeAddon(){this.sendSponsorDisplayEvent();const e=document.querySelector("mealz-drawer-view-swapper");e&&e.displayRecipeAddon$.next(!0)}pageview(){l.analytics.sendEvent("pageview",this.analyticsPath,{})}sendSponsorDisplayEvent(){l.analytics.sendEvent("sponsor.display",this.analyticsPath,{recipe_id:this.recipe.id})}sendCloseEvent(){l.analytics.sendEvent("recipe.close",this.analyticsPath,{recipe_id:this.recipe.id})}sendCookingDisplayEvent(){l.analytics.sendEvent("recipe.cooking.display",this.analyticsPath,{recipe_id:this.recipe.id})}sendOrderedDisplayEvent(){l.analytics.sendEvent("recipe.ordered.display",this.analyticsPath,{recipe_id:this.recipe.id})}};V=Ae([g("mealz-recipe-details")],V);customElements.get("mealz-recipe-details")||customElements.define("mealz-recipe-details",V);
707
+ `}showRecipeAddon(){this.sendSponsorDisplayEvent();const e=document.querySelector("mealz-drawer-view-swapper");e&&e.displayRecipeAddon$.next(!0)}pageview(){o.analytics.sendEvent("pageview",this.analyticsPath,{})}sendSponsorDisplayEvent(){o.analytics.sendEvent("sponsor.display",this.analyticsPath,{recipe_id:this.recipe.id})}sendCloseEvent(){o.analytics.sendEvent("recipe.close",this.analyticsPath,{recipe_id:this.recipe.id})}sendCookingDisplayEvent(){o.analytics.sendEvent("recipe.cooking.display",this.analyticsPath,{recipe_id:this.recipe.id})}sendOrderedDisplayEvent(){o.analytics.sendEvent("recipe.ordered.display",this.analyticsPath,{recipe_id:this.recipe.id})}};j=Ae([g("mealz-recipe-details")],j);customElements.get("mealz-recipe-details")||customElements.define("mealz-recipe-details",j);