mealz-components 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{h as l}from"./lit-element-BKlYWoBt.js";class a extends l{createRenderRoot(){return this}moveComponentFilesToHeader(o){this.moveTag(o,`script[src$="${o}.min.js"]`),this.moveTag(o,`link[href$="${o}.css"]`)}moveTag(o,r){const s=document.querySelector(`mealz-${o}`),t=document.head,e=s.querySelectorAll(r),n=t.querySelectorAll(r);if(n.length===0&&e.length>0)e[0].parentNode.removeChild(e[0]),t.appendChild(e[0]);else if(n&&e.length>0){for(const c of n)if(c.src!==e[0].src){e[0].parentNode.removeChild(e[0]),t.appendChild(e[0]);break}}}}export{a as N};
@@ -0,0 +1 @@
1
+ .mealz-catalog-home{display:flex;justify-content:space-between;width:100%;position:relative;background-color:var(--miam-ds-color-neutral-white)}.mealz-catalog-home .mealz-catalog-home__content{width:100%}.mealz-catalog-home .mealz-catalog-home__content .mealz-catalog-home__header{display:flex;width:100%;height:250px}.mealz-catalog-home .mealz-catalog-home__content .mealz-catalog-home__header-left{display:flex;justify-content:center;align-items:center;flex:1;max-width:548px}.mealz-catalog-home .mealz-catalog-home__content .mealz-catalog-home__header-left h1{font-size:40px;line-height:42px;font-weight:900}.mealz-catalog-home .mealz-catalog-home__content .mealz-catalog-home__header-right{flex:1;background-repeat:no-repeat;background-size:cover;background-image:url(https://storage.googleapis.com/assets.miam.tech/pictures/catalog_settings/coursesu/2-banner/2-banner_1200x215.jpg)}.mealz-catalog-home .mealz-catalog-home__content .mealz-catalog-home__categories .mealz-catalog-home__category .mealz-catalog-home__category__header{width:fit-content;margin-bottom:4px;font-size:24px;line-height:34px;font-weight:700;cursor:pointer}.mealz-catalog-home .mealz-catalog-home__content .mealz-catalog-home__categories .mealz-catalog-home__category .mealz-catalog-home__category__header:hover{text-decoration:underline}.mealz-catalog-home .mealz-catalog-home__content .mealz-catalog-home__categories .mealz-catalog-home__category .mealz-catalog-home__category__header-bottom{display:flex;justify-content:space-between}.mealz-catalog-home .mealz-catalog-home__content .mealz-catalog-home__categories .mealz-catalog-home__category .mealz-catalog-home__category__header-bottom .mealz-catalog-home__category__subtitle{margin:0;color:var(--miam-ds-color-neutral-500)}.mealz-catalog-home .mealz-catalog-home__content .mealz-catalog-home__categories .mealz-catalog-home__category .mealz-catalog-home__category__header-bottom .mealz-catalog-home__category__link{display:flex;align-items:center;color:var(--miam-ds-color-primary);cursor:pointer;white-space:nowrap;margin-left:16px;margin-right:4px}.mealz-catalog-home .mealz-catalog-home__content .mealz-catalog-home__categories .mealz-catalog-home__category .mealz-catalog-home__category__header-bottom .mealz-catalog-home__category__link:hover{text-decoration:underline}.mealz-catalog-home .mealz-catalog-home__content .mealz-catalog-home__categories .mealz-catalog-home__category .mealz-catalog-home__category__content{position:relative;overflow:hidden;padding:16px 0;width:100%;height:var(--mealz-recipe-card-height, 500px);box-sizing:content-box;display:flex;flex-direction:row;flex-wrap:wrap;transition-duration:.5s;gap:16px}
@@ -0,0 +1 @@
1
+ import{t as s}from"../../assets/lit-element-BKlYWoBt.js";import{N as n}from"../../assets/no-shadow-element-BOwc8s7s.js";var p=Object.defineProperty,f=Object.getOwnPropertyDescriptor,h=(c,o,t,a)=>{for(var e=a>1?void 0:a?f(o,t):o,l=c.length-1,m;l>=0;l--)(m=c[l])&&(e=(a?m(o,t,e):m(e))||e);return a&&e&&p(o,t,e),e};let r=class extends n{connectedCallback(){super.connectedCallback(),this.moveComponentFilesToHeader("catalog-home")}render(){}};r=h([s("mealz-catalog-home")],r);customElements.get("mealz-catalog-home")||customElements.define("mealz-catalog-home",r);
@@ -0,0 +1 @@
1
+ @import"https://unpkg.com/miam-ds@1.2.4/miam-ds.min.css";.mealz-my-meals-button{cursor:pointer;width:400px;position:fixed;left:50%;bottom:16px;transform:translate(-50%);z-index:1;display:inline-flex;min-height:48px;padding:0 16px;justify-content:space-between;align-items:center;gap:12px;border-radius:1000px;background:var(--miam-color-primary-900, #10323f);box-shadow:0 8px 16px #0003}@media (max-width: 607px){.mealz-my-meals-button{width:auto;z-index:2}}.mealz-my-meals-button.hidden{display:none}.mealz-my-meals-button .mealz-my-meals-button__text{font-weight:700;color:var(--miam-ds-color-neutral-white, #fff);white-space:nowrap}.mealz-my-meals-button .mealz-my-meals-button__second__icon{transform:rotate(-90deg)}
@@ -0,0 +1 @@
1
+ import{t as u}from"../../assets/lit-element-BKlYWoBt.js";import{N as c}from"../../assets/no-shadow-element-BOwc8s7s.js";var l=Object.defineProperty,m=Object.getOwnPropertyDescriptor,b=(t,e,i,n)=>{for(var s=n>1?void 0:n?m(e,i):e,o=t.length-1,r;o>=0;o--)(r=t[o])&&(s=(n?r(e,i,s):r(s))||s);return n&&s&&l(e,i,s),s};let a=class extends c{constructor(){super(...arguments),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.miam.basket.recipeCount().subscribe(t=>{this.recipesCount=t,this.updateDOM()}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe())}render(){this.button=this.querySelector(".mealz-my-meals-button"),this.button&&this.button.addEventListener("click",t=>{t.stopPropagation(),this.toggle()})}toggle(){window.miam.basket.openPreview()}updateDOM(){var e;this.recipesCount?this.button.classList.remove("hidden"):this.button.classList.add("hidden");const t=(e=this.button.querySelector(".mealz-my-meals-button__text"))==null?void 0:e.firstElementChild;t&&(t.innerHTML=`${this.recipesCount||0}`)}};a=b([u("mealz-my-meals-button")],a);customElements.get("mealz-my-meals-button")||customElements.define("mealz-my-meals-button",a);
@@ -1 +1 @@
1
- @import"https://unpkg.com/miam-ds@1.2.4/miam-ds.min.css";.mealz-like-button__icon img{display:none}.mealz-like-button__icon .active{display:block}
1
+ .mealz-like-button__icon img{display:none}.mealz-like-button__icon .active{display:block}
@@ -1 +1 @@
1
- import{t as a}from"../assets/lit-element-BKlYWoBt.js";import{N as c}from"../assets/no-shadow-element-BdZPYRaG.js";var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(e,s,l,i)=>{for(var t=i>1?void 0:i?d(s,l):s,n=e.length-1,o;n>=0;n--)(o=e[n])&&(t=(i?o(s,l,t):o(t))||t);return i&&t&&u(s,l,t),t};let r=class extends c{constructor(){super(...arguments),this.liked=null,this.recipeLikeId="",this.recipeId=""}connectedCallback(){super.connectedCallback(),console.debug("[MealzComponents] loading like button")}render(){this.button=this.querySelector(".mealz-like-button"),this.button&&(this.getInitialStatus(),this.button.addEventListener("click",e=>{e.stopPropagation(),this.toggle()}))}getInitialStatus(){var t;const e=(t=this.attributes["starting-data"])==null?void 0:t.value;if(!e)return;const{id:s,recipeId:l,liked:i}=JSON.parse(e);this.recipeLikeId=s,this.recipeId=l,this.liked=i!==void 0?i:!1,this.removeAttribute("starting-data")}async toggle(){window.mealzInternal.recipes.updateRecipeLike(this.recipeLikeId,this.recipeId,this.liked),this.liked=!this.liked,this.updateDOM()}updateDOM(){this.button.querySelector(".mealz-like-button__icon").classList.toggle("fill",this.liked),this.button.querySelectorAll(".mealz-like-button__icon img").forEach(e=>e.classList.toggle("active"))}};r=h([a("mealz-like-button")],r);customElements.get("mealz-like-button")||customElements.define("mealz-like-button",r);
1
+ import{t as a}from"../assets/lit-element-BKlYWoBt.js";import{N as c}from"../assets/no-shadow-element-BOwc8s7s.js";var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(e,s,l,i)=>{for(var t=i>1?void 0:i?d(s,l):s,r=e.length-1,o;r>=0;r--)(o=e[r])&&(t=(i?o(s,l,t):o(t))||t);return i&&t&&u(s,l,t),t};let n=class extends c{constructor(){super(...arguments),this.liked=null,this.recipeLikeId="",this.recipeId=""}connectedCallback(){super.connectedCallback(),this.moveComponentFilesToHeader("like-button")}render(){this.button=this.querySelector(".mealz-like-button"),this.button&&(this.getInitialStatus(),this.button.addEventListener("click",e=>{e.stopPropagation(),this.toggle()}))}getInitialStatus(){var t;const e=(t=this.attributes["starting-data"])==null?void 0:t.value;if(!e)return;const{id:s,recipeId:l,liked:i}=JSON.parse(e);this.recipeLikeId=s,this.recipeId=l,this.liked=i!==void 0?i:!1,this.removeAttribute("starting-data")}async toggle(){window.mealzInternal.recipes.updateRecipeLike(this.recipeLikeId,this.recipeId,this.liked),this.liked=!this.liked,this.updateDOM()}updateDOM(){this.button.querySelector(".mealz-like-button__icon").classList.toggle("fill",this.liked),this.button.querySelectorAll(".mealz-like-button__icon img").forEach(e=>e.classList.toggle("active"))}};n=h([a("mealz-like-button")],n);customElements.get("mealz-like-button")||customElements.define("mealz-like-button",n);
@@ -1 +1 @@
1
- @import"https://unpkg.com/miam-ds@1.2.4/miam-ds.min.css";.mealz-recipe-card{--mealz-recipe-card-width: 308px;--mealz-recipe-card-height: 500px;--mealz-price-font-size: 20px;--mealz-price-subline-font-size: 16px;--mealz-cta-button-padding: 8px;--mealz-bottom-padding: 12px;--mealz-top-margin: 12px;--mealz-bottom-height: 64px;--mealz-recipe-card-direction: column}.mealz-recipe-card.horizontal{--mealz-recipe-card-width: 100%;--mealz-recipe-card-height: 188px;--mealz-recipe-card-direction: row;--mealz-bottom-padding: 8px;--mealz-top-margin: 8px}.mealz-recipe-card.vertical-small{--mealz-recipe-card-width: 163px;--mealz-recipe-card-height: 272px;--mealz-price-font-size: 16px;--mealz-price-subline-font-size: 14px;--mealz-bottom-padding: 8px;--mealz-bottom-height: 56px;--mealz-top-margin: 8px}.mealz-recipe-card{position:relative;display:flex;width:var(--mealz-recipe-card-width, 308px);height:var(--mealz-recipe-card-height, 500px);flex-direction:column;align-items:flex-start;flex-shrink:0;border-radius:8px;overflow:hidden;cursor:pointer}.mealz-recipe-card .mealz-recipe-card__container{display:flex;flex-direction:var(--mealz-recipe-card-direction, column);height:100%;width:100%;flex-shrink:0;align-self:stretch}.mealz-recipe-card .mealz-recipe-card__container:hover .mealz-recipe-card__top .mealz-recipe-card__picture img{transform:scale(1.1)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top{position:relative;flex:1;height:calc(100% - var(--mealz-bottom-height, 64px))}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__picture{width:100%;height:100%;overflow:hidden}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__picture img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .2s}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__gradient{position:absolute;width:100%;height:100%;top:0;left:0;background:linear-gradient(180deg,#0000 43.67%,#0006 91.33%)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content{position:absolute;width:100%;height:100%;top:0;left:0;display:flex;flex-direction:column;justify-content:space-between;align-items:stretch}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding:var(--mealz-bottom-padding, 12px);box-sizing:border-box}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__title{color:var(--miam-ds-color-neutral-white, #FFF);text-shadow:0px 2px 8px rgba(0,0,0,.15);text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter{display:flex;padding:4px 8px;align-items:center;gap:4px;border-radius:100px;background:var(--miam-ds-color-neutral-white, #FFF);color:var(--miam-ds-color-neutral-black, #3F3735);height:fit-content;flex-shrink:0}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter span{line-height:100%}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter img{width:16px;height:16px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container{display:flex;flex-direction:row-reverse;justify-content:space-between;margin:var(--mealz-top-margin, 12px)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .miam-recipe-card__actions__icon.hidden{display:none}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__like .miam-like-button{border-radius:48px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__like .miam-like-button.miam-ds-button.primary.reverse.square.small .miam-like-button__icon{height:16px;width:16px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__sponsor-container{display:flex;padding:8px 12px;background-color:#fff;border-radius:100px;width:auto;height:auto;box-sizing:border-box}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__sponsor-container .mealz-recipe-card__sponsor-picture{width:auto;height:auto;max-width:80px;max-height:40px;object-fit:contain}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom{display:flex;width:100%;height:var(--mealz-bottom-height, 64px);flex-direction:column;align-items:flex-start;justify-content:center;box-sizing:border-box;padding:var(--mealz-bottom-padding, 12px);border-radius:0 0 8px 8px;background-color:var(--miam-ds-color-neutral-white, #FFF);border-right:1px solid var(--miam-ds-color-neutral-200, #D9DDE1);border-bottom:1px solid var(--miam-ds-color-neutral-200, #D9DDE1);border-left:1px solid var(--miam-ds-color-neutral-200, #D9DDE1)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions{display:flex;justify-content:space-between;align-items:center;align-self:stretch}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__infos{display:flex;flex-direction:column;align-items:flex-start}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta{display:flex;flex-direction:row;gap:16px;align-items:center}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta .mealz-recipe-card__cta-button{padding:var(--mealz-cta-button-padding, 12px 16px)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time{display:flex;flex-direction:row;color:var(--miam-ds-color-text-disabled, #8C96A2);gap:12px;margin-bottom:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__difficulty,.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__time{display:flex}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__difficulty img,.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__time img{margin-right:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__price{color:var(--miam-ds-color-primary-500, #24748F);line-height:100%;margin-right:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__actions__replace{display:flex;flex:1;justify-content:space-between;align-items:center}.mealz-recipe-card.horizontal{border:1px solid var(--miam-ds-color-neutral-200, #D9DDE1)}.mealz-recipe-card.horizontal .mealz-recipe-card__top{flex:inherit;height:inherit;width:50%}.mealz-recipe-card.horizontal .mealz-recipe-card__top .mealz-recipe-card__gradient{display:none}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom{height:inherit;justify-content:space-between;border:none}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom .mealz-recipe-card__actions{flex-wrap:wrap}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta{flex:1;justify-content:flex-end}.mealz-recipe-card.horizontal.variant-3 .mealz-recipe-card__content .mealz-recipe-card__top-container{flex-direction:inherit}.mealz-recipe-card.horizontal.variant-2 .mealz-recipe-card__content .mealz-recipe-card__top-container .miam-recipe-card__actions__icon.hidden{display:inherit}
1
+ .mealz-recipe-card{--mealz-recipe-card-width: 308px;--mealz-recipe-card-height: 500px;--mealz-price-font-size: 20px;--mealz-price-subline-font-size: 16px;--mealz-cta-button-padding: 8px;--mealz-bottom-padding: 12px;--mealz-top-margin: 12px;--mealz-bottom-height: 64px;--mealz-recipe-card-direction: column}.mealz-recipe-card.horizontal{--mealz-recipe-card-width: 100%;--mealz-recipe-card-height: 188px;--mealz-recipe-card-direction: row;--mealz-bottom-padding: 8px;--mealz-top-margin: 8px}.mealz-recipe-card.vertical-small{--mealz-recipe-card-width: 163px;--mealz-recipe-card-height: 272px;--mealz-price-font-size: 16px;--mealz-price-subline-font-size: 14px;--mealz-bottom-padding: 8px;--mealz-bottom-height: 56px;--mealz-top-margin: 8px}.mealz-recipe-card{position:relative;display:flex;width:var(--mealz-recipe-card-width, 308px);height:var(--mealz-recipe-card-height, 500px);flex-direction:column;align-items:flex-start;flex-shrink:0;border-radius:8px;overflow:hidden;cursor:pointer}.mealz-recipe-card .mealz-recipe-card__container{display:flex;flex-direction:var(--mealz-recipe-card-direction, column);height:100%;width:100%;flex-shrink:0;align-self:stretch}.mealz-recipe-card .mealz-recipe-card__container:hover .mealz-recipe-card__top .mealz-recipe-card__picture img{transform:scale(1.1)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top{position:relative;flex:1;height:calc(100% - var(--mealz-bottom-height, 64px))}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__picture{width:100%;height:100%;overflow:hidden}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__picture img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .2s}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__gradient{position:absolute;width:100%;height:100%;top:0;left:0;background:linear-gradient(180deg,#0000 43.67%,#0006 91.33%)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content{position:absolute;width:100%;height:100%;top:0;left:0;display:flex;flex-direction:column;justify-content:space-between;align-items:stretch}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding:var(--mealz-bottom-padding, 12px);box-sizing:border-box}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__title{color:var(--miam-ds-color-neutral-white, #FFF);text-shadow:0px 2px 8px rgba(0,0,0,.15);text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter{display:flex;padding:4px 8px;align-items:center;gap:4px;border-radius:100px;background:var(--miam-ds-color-neutral-white, #FFF);color:var(--miam-ds-color-neutral-black, #3F3735);height:fit-content;flex-shrink:0}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter span{line-height:100%}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter img{width:16px;height:16px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container{display:flex;flex-direction:row-reverse;justify-content:space-between;margin:var(--mealz-top-margin, 12px)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .miam-recipe-card__actions__icon.hidden{display:none}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__like .miam-like-button{border-radius:48px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__like .miam-like-button.miam-ds-button.primary.reverse.square.small .miam-like-button__icon{height:16px;width:16px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__sponsor-container{display:flex;padding:8px 12px;background-color:#fff;border-radius:100px;width:auto;height:auto;box-sizing:border-box}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__sponsor-container .mealz-recipe-card__sponsor-picture{width:auto;height:auto;max-width:80px;max-height:40px;object-fit:contain}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom{display:flex;width:100%;height:var(--mealz-bottom-height, 64px);flex-direction:column;align-items:flex-start;justify-content:center;box-sizing:border-box;padding:var(--mealz-bottom-padding, 12px);border-radius:0 0 8px 8px;background-color:var(--miam-ds-color-neutral-white, #FFF);border-right:1px solid var(--miam-ds-color-neutral-200, #D9DDE1);border-bottom:1px solid var(--miam-ds-color-neutral-200, #D9DDE1);border-left:1px solid var(--miam-ds-color-neutral-200, #D9DDE1)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions{display:flex;justify-content:space-between;align-items:center;align-self:stretch}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__infos{display:flex;flex-direction:column;align-items:flex-start}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta{display:flex;flex-direction:row;gap:16px;align-items:center}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta .mealz-recipe-card__cta-button{padding:var(--mealz-cta-button-padding, 12px 16px)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time{display:flex;flex-direction:row;color:var(--miam-ds-color-text-disabled, #8C96A2);gap:12px;margin-bottom:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__difficulty,.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__time{display:flex}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__difficulty img,.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__time img{margin-right:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__price{color:var(--miam-ds-color-primary-500, #24748F);line-height:100%;margin-right:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__actions__replace{display:flex;flex:1;justify-content:space-between;align-items:center}.mealz-recipe-card.horizontal{border:1px solid var(--miam-ds-color-neutral-200, #D9DDE1)}.mealz-recipe-card.horizontal .mealz-recipe-card__top{flex:inherit;height:inherit;width:50%}.mealz-recipe-card.horizontal .mealz-recipe-card__top .mealz-recipe-card__gradient{display:none}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom{height:inherit;justify-content:space-between;border:none}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom .mealz-recipe-card__actions{flex-wrap:wrap}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta{flex:1;justify-content:flex-end}.mealz-recipe-card.horizontal.variant-3 .mealz-recipe-card__content .mealz-recipe-card__top-container{flex-direction:inherit}.mealz-recipe-card.horizontal.variant-2 .mealz-recipe-card__content .mealz-recipe-card__top-container .miam-recipe-card__actions__icon.hidden{display:inherit}
@@ -1 +1 @@
1
- import{t as d}from"../assets/lit-element-BKlYWoBt.js";import{N as n}from"../assets/no-shadow-element-BdZPYRaG.js";var l=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u=(e,t,s,i)=>{for(var r=i>1?void 0:i?o(t,s):t,a=e.length-1,c;a>=0;a--)(c=e[a])&&(r=(i?c(t,s,r):c(r))||r);return i&&r&&l(t,s,r),r};let p=class extends n{connectedCallback(){super.connectedCallback(),console.debug("[MealzComponents] loading recipe card"),window.mealzInternal.recipes.guestsUpdated().subscribe(async({recipeId:e,guests:t})=>{this.updatedRecipeId=e,this.updatedGuests=t,this.updateDOM()})}render(){this.recipeCardTop=this.querySelector(".mealz-recipe-card__top"),this.recipeCardCta=this.querySelector(".mealz-recipe-card__cta"),!(!this.recipeCardTop||!this.recipeCardCta)&&(this.getInitialStatus(),this.recipeCardTop.addEventListener("click",()=>this.recipeCardTopClick()),this.recipeCardCta.addEventListener("click",()=>this.recipeCardCtaClick()))}getInitialStatus(){var i;const e=(i=this.attributes["starting-data"])==null?void 0:i.value;if(!e)return;const{id:t,guests:s}=JSON.parse(e);this.recipeId=t,this.guests=s,this.removeAttribute("starting-data")}recipeCardTopClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests)}recipeCardCtaClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests)}updateDOM(){if(this.recipeId!==this.updatedRecipeId)return;const e=this.querySelector(".mealz-recipe-card__counter span");e&&(this.guests=this.updatedGuests,e.innerHTML=this.guests.toString())}};p=u([d("mealz-recipe-card")],p);customElements.get("mealz-recipe-card")||customElements.define("mealz-recipe-card",p);
1
+ import{t as p}from"../assets/lit-element-BKlYWoBt.js";import{N as d}from"../assets/no-shadow-element-BOwc8s7s.js";var o=Object.defineProperty,h=Object.getOwnPropertyDescriptor,l=(e,t,s,r)=>{for(var i=r>1?void 0:r?h(t,s):t,c=e.length-1,a;c>=0;c--)(a=e[c])&&(i=(r?a(t,s,i):a(i))||i);return r&&i&&o(t,s,i),i};let n=class extends d{constructor(){super(...arguments),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.moveComponentFilesToHeader("recipe-card"),this.listenInView(),this.subscriptions.push(window.mealzInternal.recipes.guestsUpdated().subscribe(async({recipeId:e,guests:t})=>{this.updatedRecipeId=e,this.updatedGuests=t,this.updateDOM()}))}disconnectedCallback(){var e;super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe()),(e=this.inViewObserver)==null||e.unobserve(this)}render(){this.recipeCardTop=this.querySelector(".mealz-recipe-card__top"),this.recipeCardCta=this.querySelector(".mealz-recipe-card__cta"),!(!this.recipeCardTop||!this.recipeCardCta)&&(this.getInitialStatus(),this.recipeCardTop.addEventListener("click",()=>this.recipeCardTopClick()),this.recipeCardCta.addEventListener("click",()=>this.recipeCardCtaClick()))}listenInView(){const e={threshold:0};this.inViewObserver=new IntersectionObserver(t=>this.handleIntersection(t),e),this.inViewObserver.observe(this)}handleIntersection(e){e.forEach(t=>{var s;t.isIntersecting&&(this.recipePricing=this.querySelector("mealz-recipe-pricing"),this.recipePricing&&((s=this.recipePricing)==null||s.fetchPrice(this.posId,"DEFAULT",this.guests),this.inViewObserver.unobserve(this)))})}getInitialStatus(){var i;const e=(i=this.attributes["starting-data"])==null?void 0:i.value;if(!e)return;const{id:t,guests:s,posId:r}=JSON.parse(e);this.posId=r,this.recipeId=t,this.guests=s,this.removeAttribute("starting-data")}recipeCardTopClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests)}recipeCardCtaClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests)}updateDOM(){if(this.recipeId!==this.updatedRecipeId)return;const e=this.querySelector(".mealz-recipe-card__counter span");e&&(this.guests=this.updatedGuests,e.innerHTML=this.guests.toString())}};n=l([p("mealz-recipe-card")],n);customElements.get("mealz-recipe-card")||customElements.define("mealz-recipe-card",n);
@@ -0,0 +1 @@
1
+ mealz-recipe-card-cta .miam-ds-button.secondary:hover:not(.loading):not(.disabled):not([disabled]){background-color:transparent;color:var(--miam-ds-color-primary)}mealz-recipe-card-cta .mealz-recipe-card-cta:not(.in-basket) img.in-basket{display:none}mealz-recipe-card-cta .mealz-recipe-card-cta.in-basket img:not(.in-basket){display:none}
@@ -0,0 +1 @@
1
+ import{t as p}from"../assets/lit-element-BKlYWoBt.js";import{N as l}from"../assets/no-shadow-element-BOwc8s7s.js";var o=Object.defineProperty,d=Object.getOwnPropertyDescriptor,u=(e,s,i,a)=>{for(var t=a>1?void 0:a?d(s,i):s,r=e.length-1,c;r>=0;r--)(c=e[r])&&(t=(a?c(s,i,t):c(t))||t);return a&&t&&o(s,i,t),t};let n=class extends l{constructor(){super(...arguments),this.subscriptions=[]}async connectedCallback(){super.connectedCallback(),this.moveComponentFilesToHeader("recipe-card-cta"),this.subscriptions.push(window.mealzInternal.basket.recipePricesInBasket$().subscribe(e=>{this.updateDOM(e.map(s=>s.id).includes(this.recipeId))}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}render(){this.recipeCta=this.querySelector(".mealz-recipe-card-cta"),this.recipeCta&&this.getInitialStatus()}getInitialStatus(){var e;this.recipeId=(e=this.attributes["starting-data"])==null?void 0:e.value}updateDOM(e){e?(this.recipeCta.classList.replace("primary","secondary"),this.recipeCta.classList.add("in-basket")):(this.recipeCta.classList.replace("secondary","primary"),this.recipeCta.classList.remove("in-basket"))}};n=u([p("mealz-recipe-card-cta")],n);customElements.get("mealz-recipe-card-cta")||customElements.define("mealz-recipe-card-cta",n);
@@ -1 +1 @@
1
- @import"https://unpkg.com/miam-ds@1.2.4/miam-ds.min.css";.mealz-recipe-pricing{max-width:70px}.mealz-recipe-pricing .mealz-recipe-pricing__wrapper .mealz-recipe-pricing__wrapper__subline{color:#1f354380;font-weight:500;line-height:100%}.mealz-recipe-pricing__loading{width:70px;height:24px;border-radius:.25rem;animation:skeleton-loading 1s linear infinite alternate}@keyframes skeleton-loading{0%{background-color:#c2cfd6}to{background-color:#f0f3f5}}.hidden{display:none}.active{display:block}
1
+ .mealz-recipe-pricing{max-width:70px}.mealz-recipe-pricing .mealz-recipe-pricing__wrapper .mealz-recipe-pricing__wrapper__subline{color:#1f354380;font-weight:500;line-height:100%}.mealz-recipe-pricing__loading{width:70px;height:24px;border-radius:.25rem;animation:skeleton-loading 1s linear infinite alternate}@keyframes skeleton-loading{0%{background-color:#c2cfd6}to{background-color:#f0f3f5}}.hidden{display:none}.active{display:block}
@@ -1 +1 @@
1
- import{t as a}from"../assets/lit-element-BKlYWoBt.js";import{N as l}from"../assets/no-shadow-element-BdZPYRaG.js";var o=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h=(e,i,t,s)=>{for(var r=s>1?void 0:s?u(i,t):i,c=e.length-1,n;c>=0;c--)(n=e[c])&&(r=(s?n(i,t,r):n(r))||r);return s&&r&&o(i,t,r),r};let p=class extends l{constructor(){super(...arguments),this.formattedPrice="",this.subscriptions=[]}connectedCallback(){super.connectedCallback(),console.debug("[MealzComponents] loading recipe pricing"),this.subscriptions.push(window.mealzInternal.recipes.guestsUpdated().subscribe(e=>{e.recipeId===this.recipeId&&(this.serves=e.guests)}),window.mealzInternal.basket.recipePricesInBasket$().subscribe(e=>{this.recipePricingValue=e.find(t=>t.id===this.recipeId);const i=this.recipePricingValue?(this.recipePricingValue.price/this.serves).toString():this.pricePerServe;this.applyCurrencyDisplay(i),this.showPrice()}))}disconnectedCallback(){this.subscriptions.forEach(e=>e.unsubscribe())}render(){this.recipePricing=this.querySelector(".mealz-recipe-pricing"),this.recipePricing&&this.getInitialStatus()}getInitialStatus(){var r;const e=(r=this.attributes["starting-data"])==null?void 0:r.value;if(!e)return;const{recipeId:i,pricePerServe:t,serves:s}=JSON.parse(e);this.recipeId=i,this.pricePerServe=t.toString(),this.serves=s,this.applyCurrencyDisplay(this.pricePerServe)}applyCurrencyDisplay(e){let i=parseFloat(e);this.formattedPrice=i.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2}),this.updateDOM()}showPrice(){let e=this.recipePricing.querySelector(".mealz-recipe-pricing__loading"),i=this.recipePricing.querySelector(".mealz-recipe-pricing__wrapper");e.classList.contains("active")&&(e.classList.replace("active","hidden"),i.classList.replace("hidden","active"))}updateDOM(){const e=this.recipePricing.querySelector(".mealz-recipe-pricing__wrapper__price");e&&(e.innerHTML=this.formattedPrice+" €")}};p=h([a("mealz-recipe-pricing")],p);customElements.get("mealz-recipe-pricing")||customElements.define("mealz-recipe-pricing",p);
1
+ import{t as n}from"../assets/lit-element-BKlYWoBt.js";import{N as l}from"../assets/no-shadow-element-BOwc8s7s.js";var o=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u=(e,r,t,s)=>{for(var i=s>1?void 0:s?h(r,t):r,a=e.length-1,c;a>=0;a--)(c=e[a])&&(i=(s?c(r,t,i):c(i))||i);return s&&i&&o(r,t,i),i};let p=class extends l{constructor(){super(...arguments),this.formattedPrice="",this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.moveComponentFilesToHeader("recipe-pricing"),this.subscriptions.push(window.mealzInternal.recipes.guestsUpdated().subscribe(e=>{e.recipeId===this.recipeId&&(this.serves=e.guests)}),window.mealzInternal.basket.recipePricesInBasket$().subscribe(e=>{this.recipePricingValue=e.find(t=>t.id===this.recipeId);const r=this.recipePricingValue?(this.recipePricingValue.price/this.serves).toString():this.pricePerServe;this.applyCurrencyDisplay(r),this.showPrice()}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}fetchPrice(e,r,t){var a;const s=JSON.parse((a=this.attributes["starting-data"])==null?void 0:a.value);let i=this.recipePricing.querySelector(".mealz-recipe-pricing__wrapper");s.pricePerServe===null&&(i==null||i.classList.replace("active","hidden"),this.subscriptions.push(window.mealzInternal.recipes.fetchPricing(this.recipeId,e,r,t).subscribe(c=>{c!=null&&c.price_per_serve&&(i==null||i.classList.replace("hidden","active"),this.applyCurrencyDisplay(c.price_per_serve))})))}render(){this.recipePricing=this.querySelector(".mealz-recipe-pricing"),this.recipePricing&&this.getInitialStatus()}getInitialStatus(){var i;const e=(i=this.attributes["starting-data"])==null?void 0:i.value;if(!e)return;const{recipeId:r,pricePerServe:t,serves:s}=JSON.parse(e);this.recipeId=r,this.pricePerServe=(t==null?void 0:t.toString())??null,this.serves=s,this.applyCurrencyDisplay(this.pricePerServe)}applyCurrencyDisplay(e){let r=parseFloat(e);this.formattedPrice=r.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2}),this.updateDOM()}showPrice(){let e=this.recipePricing.querySelector(".mealz-recipe-pricing__loading"),r=this.recipePricing.querySelector(".mealz-recipe-pricing__wrapper");e.classList.contains("active")&&(e.classList.replace("active","hidden"),r.classList.replace("hidden","active"))}updateDOM(){const e=this.recipePricing.querySelector(".mealz-recipe-pricing__wrapper__price");e&&(e.innerHTML=this.formattedPrice+" €")}};p=u([n("mealz-recipe-pricing")],p);customElements.get("mealz-recipe-pricing")||customElements.define("mealz-recipe-pricing",p);
@@ -1,8 +1,8 @@
1
- import{u,f as m,i as g,h as f,k as n,t as b}from"../assets/lit-element-BKlYWoBt.js";/**
1
+ import{u,f as m,i as g,h as b,k as n,t as f}from"../assets/lit-element-BKlYWoBt.js";/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const _={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:m},x=(t=_,e,s)=>{const{kind:i,metadata:o}=s;let a=globalThis.litPropertyMetadata.get(o);if(a===void 0&&globalThis.litPropertyMetadata.set(o,a=new Map),a.set(s.name,t),i==="accessor"){const{name:l}=s;return{set(d){const h=e.get.call(this);e.set.call(this,d),this.requestUpdate(l,h,t)},init(d){return d!==void 0&&this.P(l,void 0,t),d}}}if(i==="setter"){const{name:l}=s;return function(d){const h=this[l];e.call(this,d),this.requestUpdate(l,h,t)}}throw Error("Unsupported decorator location: "+i)};function c(t){return(e,s)=>typeof s=="object"?x(t,e,s):((i,o,a)=>{const l=o.hasOwnProperty(a);return o.constructor.createProperty(a,l?{...i,wrapped:!0}:i),l?Object.getOwnPropertyDescriptor(o,a):void 0})(t,e,s)}/**
5
+ */const _={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:m},x=(t=_,e,s)=>{const{kind:i,metadata:o}=s;let a=globalThis.litPropertyMetadata.get(o);if(a===void 0&&globalThis.litPropertyMetadata.set(o,a=new Map),a.set(s.name,t),i==="accessor"){const{name:r}=s;return{set(d){const h=e.get.call(this);e.set.call(this,d),this.requestUpdate(r,h,t)},init(d){return d!==void 0&&this.P(r,void 0,t),d}}}if(i==="setter"){const{name:r}=s;return function(d){const h=this[r];e.call(this,d),this.requestUpdate(r,h,t)}}throw Error("Unsupported decorator location: "+i)};function c(t){return(e,s)=>typeof s=="object"?x(t,e,s):((i,o,a)=>{const r=o.hasOwnProperty(a);return o.constructor.createProperty(a,r?{...i,wrapped:!0}:i),r?Object.getOwnPropertyDescriptor(o,a):void 0})(t,e,s)}/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
@@ -14,80 +14,90 @@ import{u,f as m,i as g,h as f,k as n,t as b}from"../assets/lit-element-BKlYWoBt.
14
14
  * @license
15
15
  * Copyright 2017 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
- */function y(t,e){return(s,i,o)=>{const a=l=>{var d;return((d=l.renderRoot)==null?void 0:d.querySelector(t))??null};return w(s,i,{get(){return a(this)}})}}class L{get extId(){return this.attributes["ext-id"]}}var C=Object.defineProperty,S=Object.getOwnPropertyDescriptor,p=(t,e,s,i)=>{for(var o=i>1?void 0:i?S(e,s):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&C(e,s,o),o};let r=class extends f{constructor(){var t,e,s,i,o,a;super(...arguments),this.selectedRadius=25,this.radiusOption=[10,25,50],this.getByAddress=(e=(t=window.miam)==null?void 0:t.pos)==null?void 0:e.getByAddress,this.getByCoordinates=(i=(s=window.miam)==null?void 0:s.pos)==null?void 0:i.getByCoordinates,this.getAffiliateSuppliers=(a=(o=window.miam)==null?void 0:o.supplier)==null?void 0:a.getAffiliateSuppliers,this._posList=[],this._markers=[],this._searchingPos=!1,this._searchSubmitted=!1,this._previousSearchMethod=()=>{},this._suppliers=[],this._selectedSuppliers=[],this._showPosList=!1}set geolocationCoordinates(t){var e,s;this._geolocationCoordinates=t,(e=t==null?void 0:t.coords)!=null&&e.latitude&&((s=t==null?void 0:t.coords)!=null&&s.longitude)&&this.getPosByCoordinates()}get geolocationCoordinates(){return this._geolocationCoordinates}_nameOfStore(t){return`${t.supplier.attributes.name} - ${t.attributes.name}`}connectedCallback(){super.connectedCallback(),console.debug("[MealzComponents] loading store locator"),this.initLeaflet(),this.fetchSuppliers()}disconnectedCallback(){super.disconnectedCallback(),this._leafletCss.remove(),this._miamDs.remove(),this._leafletJs.remove()}render(){if(this.show)return this.posSelectionTemplate()}firstUpdated(){this.loadMap(),this.geolocationTimeout(),this.listenFormSubmit()}posSelectionTemplate(){return n`
18
- <div class="wrapper miam-ds-body">
19
- <div class="pos-selection">
20
- <div class="title">
21
- <button @click=${()=>this.dispatchShow(!1)}><</button>
22
- <span>Sélectionner un magasin</span>
23
- </div>
24
- <form id="store-locator-form">
25
- <div class="address-input-container">
26
- ${this.geolocButtonTemplate()}
27
- <input required class="address-input" type="text" name="address" placeholder="Votre code postal ou ville">
28
- <button type="submit" class="miam-ds-button primary search-address-button">OK</button>
29
- </div>
30
- ${this.selectRadiusTemplate()}
31
- ${this.selectSupplierTemplate()}
32
- </form>
33
- ${this.posListTemplate()}
34
- ${this._posList.length>0?n`
35
- <div id="mobile-buttons-wrapper" class="mobile-buttons-wrapper__see-list">
36
- <button @click=${()=>this.togglePosList(this._showPosList)} class="miam-ds-button primary hide-pos-button">
37
- ${this.getButtonLabel()}
38
- </button>
39
- </div>`:""}
17
+ */function y(t,e){return(s,i,o)=>{const a=r=>{var d;return((d=r.renderRoot)==null?void 0:d.querySelector(t))??null};return w(s,i,{get(){return a(this)}})}}class L{get extId(){return this.attributes["ext-id"]}}var C=Object.defineProperty,S=Object.getOwnPropertyDescriptor,p=(t,e,s,i)=>{for(var o=i>1?void 0:i?S(e,s):e,a=t.length-1,r;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&C(e,s,o),o};let l=class extends b{constructor(){var t,e,s,i,o,a;super(...arguments),this.selectedRadius=25,this.radiusOption=[10,25,50],this.getByAddress=(e=(t=window.miam)==null?void 0:t.pos)==null?void 0:e.getByAddress,this.getByCoordinates=(i=(s=window.miam)==null?void 0:s.pos)==null?void 0:i.getByCoordinates,this.getAffiliateSuppliers=(a=(o=window.miam)==null?void 0:o.supplier)==null?void 0:a.getAffiliateSuppliers,this._posList=[],this._markers=[],this._searchingPos=!1,this._searchSubmitted=!1,this._previousSearchMethod=()=>{},this._suppliers=[],this._selectedSuppliers=[],this._showPosList=!1,this.subscriptions=[]}set geolocationCoordinates(t){var e,s;this._geolocationCoordinates=t,(e=t==null?void 0:t.coords)!=null&&e.latitude&&((s=t==null?void 0:t.coords)!=null&&s.longitude)&&this.getPosByCoordinates()}get geolocationCoordinates(){return this._geolocationCoordinates}_nameOfStore(t){return`${t.supplier.attributes.name} - ${t.attributes.name}`}connectedCallback(){super.connectedCallback(),console.debug("[MealzComponents] loading store locator"),this.initLeaflet(),this.fetchSuppliers()}disconnectedCallback(){this.subscriptions.forEach(t=>t.unsubscribe()),super.disconnectedCallback(),this._leafletCss.remove(),this._miamDs.remove(),this._leafletJs.remove()}render(){if(this.show)return this.posSelectionTemplate()}firstUpdated(){this.loadMap(),this.geolocationTimeout(),this.listenFormSubmit()}posSelectionTemplate(){return n`
18
+ <div class="wrapper miam-ds-body">
19
+ <div class="pos-selection">
20
+ <div class="title">
21
+ <button @click=${()=>this.dispatchShow(!1)}><</button>
22
+ <span>Sélectionner un magasin</span>
23
+ </div>
24
+ <form id="store-locator-form">
25
+ <div class="address-input-container">
26
+ ${this.geolocButtonTemplate()}
27
+ <input required class="address-input" type="text" name="address"
28
+ placeholder="Votre code postal ou ville">
29
+ <button type="submit" class="miam-ds-button primary search-address-button">OK</button>
30
+ </div>
31
+ ${this.selectRadiusTemplate()}
32
+ ${this.selectSupplierTemplate()}
33
+ </form>
34
+ ${this.posListTemplate()}
35
+ ${this._posList.length>0?n`
36
+ <div id="mobile-buttons-wrapper" class="mobile-buttons-wrapper__see-list">
37
+ <button @click=${()=>this.togglePosList(this._showPosList)}
38
+ class="miam-ds-button primary hide-pos-button">
39
+ ${this.getButtonLabel()}
40
+ </button>
41
+ </div>`:""}
42
+ </div>
40
43
  </div>
41
- </div>
42
44
  ${this.posMapTemplate()}
43
- </div>
44
- `}geolocButtonTemplate(){var e,s,i,o;let t;if(this.geolocationCoordinates===void 0)t=n`<div class="miam-ds-loader"></div>`;else if((s=(e=this.geolocationCoordinates)==null?void 0:e.coords)!=null&&s.longitude&&((o=(i=this.geolocationCoordinates)==null?void 0:i.coords)!=null&&o.latitude))t=n`<img title="Votre position" class="geolocation-icon" src="https://storage.googleapis.com/assets.miam.tech/generic/icons/locate-primary.svg" alt="Geolocaliser"/>`;else return n``;return n`
45
- <button type="button" ?disabled=${this.geolocationCoordinates===void 0} class="miam-ds-button square ghost locate-button" @click=${this.setGeolocation}>
45
+ </div>
46
+ `}geolocButtonTemplate(){var e,s,i,o;let t;if(this.geolocationCoordinates===void 0)t=n`
47
+ <div class="miam-ds-loader"></div>`;else if((s=(e=this.geolocationCoordinates)==null?void 0:e.coords)!=null&&s.longitude&&((o=(i=this.geolocationCoordinates)==null?void 0:i.coords)!=null&&o.latitude))t=n`<img title="Votre position" class="geolocation-icon"
48
+ src="https://storage.googleapis.com/assets.miam.tech/generic/icons/locate-primary.svg"
49
+ alt="Geolocaliser"/>`;else return n``;return n`
50
+ <button type="button" ?disabled=${this.geolocationCoordinates===void 0}
51
+ class="miam-ds-button square ghost locate-button" @click=${this.setGeolocation}>
46
52
  ${t}
47
53
  </button>
48
54
  `}selectRadiusTemplate(){return n`
49
- <div class="select-radius miam-ds-dropdown">
50
- <select @change=${this.radiusChanged}>
51
- ${this.radiusOption.map(t=>n`<option ?selected=${t===this.selectedRadius} value=${t}>${t} km</option>`)}
52
- </select>
53
- </div>`}radiusChanged(t){this.selectedRadius=parseInt(t.target.value),this._showPosList=!0,this._previousSearchMethod(!0)}posMapTemplate(){return n`
54
- <div id="map"></div>
55
+ <div class="select-radius miam-ds-dropdown">
56
+ <select @change=${this.radiusChanged}>
57
+ ${this.radiusOption.map(t=>n`
58
+ <option ?selected=${t===this.selectedRadius} value=${t}>${t} km
59
+ </option>`)}
60
+ </select>
61
+ </div>`}radiusChanged(t){this.selectedRadius=parseInt(t.target.value),this._showPosList=!0,this._previousSearchMethod(!0)}posMapTemplate(){return n`
62
+ <div id="map"></div>
55
63
  `}selectSupplierTemplate(){return n`
56
64
  <div class="select-supplier miam-ds-dropdown">
57
65
  <select @change=${this.supplierSelected}>
58
66
  <option ?selected=${this._selectedSuppliers.length<1} value="${null}">Toutes les enseignes</option>
59
67
  ${this._suppliers.map(t=>n`
60
- <option ?selected=${t===this._selectedSuppliers[0]} value=${t.id}>
61
- ${t.name}
62
- </option>`)}
68
+ <option ?selected=${t===this._selectedSuppliers[0]} value=${t.id}>
69
+ ${t.name}
70
+ </option>`)}
63
71
  </select>
64
72
  </div>`}supplierSelected(t){t.target.value?this._selectedSuppliers[0]=t.target.value:this._selectedSuppliers=[],this._previousSearchMethod(!0)}posListTemplate(){if(this._searchingPos)return n`
65
73
  <div class="pos-loader">
66
74
  <div class="miam-ds-loader"></div>
67
75
  </div>
68
76
  `;if(this._posList.length<1&&this._searchSubmitted)return n`
69
- <div class="no-pos-found">
70
- <b>Aucun magasin trouvé à proximité.</b>
71
- <span>Essayez une autre adresse.</span>
72
- </div>
77
+ <div class="no-pos-found">
78
+ <b>Aucun magasin trouvé à proximité.</b>
79
+ <span>Essayez une autre adresse.</span>
80
+ </div>
73
81
  `;if(this._posList.length<1)return;const t=this.shadowRoot.querySelector(".pos-selection");return t&&t.classList.toggle("pos-selection__height",this._showPosList),n`
74
- <div id="pos-list" class="${this._showPosList?"pos-list__visible":"pos-list__hidden"}">
75
- ${this._posList.map(e=>n`
76
- <div class="pos-item">
77
- <div class="top">
78
- <img src="${e.supplier.attributes.logo}" alt="${e.supplier.attributes.name}"/>
79
- <div class="top-right">
80
- <div class="name">${this._nameOfStore(e)}</div>
81
- <div class="address">${e.attributes.address}</div>
82
- </div>
83
- </div>
84
- <div class="bottom">
85
- <button @click=${()=>this.dispatchPos(e)} class="miam-ds-button primary select-pos-button">Sélectionner</button>
86
- </div>
87
- </div>
88
- `)}
89
- </div>
90
- `}getButtonLabel(){if(this._showPosList)return"Voir la carte";const t=this._posList.length;return t===1?"Voir le magasin":`Voir les ${t} magasins`}setAddress(t=!1){if(!this._addressInput.value||this._addressInput.value.length<3||this._searchingPos||!t&&this._prevAddress===this._addressInput.value+", France")return;const e=this.shadowRoot.getElementById("pos-list");e&&e.style.display==="none"&&this.togglePosList(!0),this._previousSearchMethod=this.setAddress,this._prevAddress=this._addressInput.value+", France",this._searchingPos=!0,this.requestUpdate(),this.getByAddress(this._prevAddress,this.selectedRadius,this._selectedSuppliers).subscribe(s=>{this.setPosList(s),this.setNewLocation(),this._searchingPos=!1,this._searchSubmitted=!0,this.requestUpdate()})}setGeolocation(t=!1){const e=this.shadowRoot.getElementById("pos-list");e&&e.style.display==="none"&&this.togglePosList(!0),this._prevAddress="",this._previousSearchMethod=this.setGeolocation,this.getPosByCoordinates()}getPosByCoordinates(){this._searchingPos=!0,this.requestUpdate(),this.getByCoordinates(this.geolocationCoordinates.coords.latitude,this.geolocationCoordinates.coords.longitude,this.selectedRadius,this._selectedSuppliers).subscribe(t=>{this._addressInput.value="",this.setPosList(t),this._searchingPos=!1,this.setNewLocation(),this._searchSubmitted=!0,this.requestUpdate()})}setPosList(t){this._posList=t.data.map(e=>{const s=Object.assign(new L,e);return s.supplier=t.included.find(i=>i.id===s.relationships.supplier.data.id),s})}dispatchPos(t){const e={detail:{posId:t.id,posExtId:t.extId,supplierId:t.supplier.id,supplierName:t.supplier.attributes.name,posName:this._nameOfStore(t)},bubbles:!0,composed:!0};console.debug("[MealzComponents] dispatchEvent posIdChange",e),this.dispatchEvent(new CustomEvent("posIdChange",e))}dispatchShow(t){const e={detail:{show:t},bubbles:!0,composed:!0};console.debug("[MealzComponents] dispatchEvent showChange",e),this.dispatchEvent(new CustomEvent("showChange",e))}initLeaflet(){this._leafletCss=document.createElement("link"),this._leafletCss.setAttribute("rel","stylesheet"),this._leafletCss.setAttribute("href","https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),this._leafletCss.setAttribute("integrity","sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="),this._leafletCss.setAttribute("crossorigin",""),this._leafletJs=document.createElement("script"),this._leafletJs.setAttribute("src","https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"),this._leafletJs.setAttribute("integrity","sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="),this._leafletJs.setAttribute("crossorigin",""),this._miamDs=document.createElement("link"),this._miamDs.setAttribute("rel","stylesheet"),this._miamDs.setAttribute("href","https://unpkg.com/miam-ds@1.2.4/miam-ds.min.css"),this.shadowRoot.appendChild(this._miamDs),this.shadowRoot.appendChild(this._leafletCss),document.head.appendChild(this._leafletJs)}waitForLeaflet(t){let i=50;console.debug("[Map] Checking for window.L");const o=setInterval(()=>{window.L!==void 0||i===0?(clearInterval(o),window.L!==void 0?(console.debug("[Map] window.L is defined"),t(!0)):(console.error("[Map] Failed to load Leaflet after",50*100,"ms"),t(!1))):i--},100)}initMap(){this._map&&(this._map.off(),this._map.remove()),this.setNewLocation(),window.L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png",{maxZoom:19,attribution:"Map tiles by Carto, under CC BY 3.0. Data by OpenStreetMap, under ODbL."}).addTo(this._map)}loadMap(){this.waitForLeaflet(t=>{t&&this.initMap()})}fetchSuppliers(){this.getAffiliateSuppliers().subscribe(t=>{this._suppliers=t.map(e=>({id:e.id,name:e.attributes.name})),this.requestUpdate()})}setNewLocation(){var e;const t=this.shadowRoot.getElementById("map");t&&(this._map?(this._markers.forEach(s=>{this._map.removeLayer(s)}),this._markers=[],this._map.panTo(this.getCoordinates())):this._map=(e=window.L)==null?void 0:e.map(t).setView(this.getCoordinates(),13),this.addMarkers())}getCoordinates(){return this._posList.length<1?[48.866667,2.333333]:[this._posList[0].attributes.latitude,this._posList[0].attributes.longitude]}addMarkers(){this._posList.length>0&&this._posList.forEach((t,e)=>{this._markers.push(window.L.marker([t.attributes.latitude,t.attributes.longitude],{icon:this.buildIcon(t.supplier)}).addTo(this._map));let s=window.L.popup({content:`
82
+ <div id="pos-list" class="${this._showPosList?"pos-list__visible":"pos-list__hidden"}">
83
+ ${this._posList.map(e=>n`
84
+ <div class="pos-item">
85
+ <div class="top">
86
+ <img src="${e.supplier.attributes.logo}" alt="${e.supplier.attributes.name}"/>
87
+ <div class="top-right">
88
+ <div class="name">${this._nameOfStore(e)}</div>
89
+ <div class="address">${e.attributes.address}</div>
90
+ </div>
91
+ </div>
92
+ <div class="bottom">
93
+ <button @click=${()=>this.dispatchPos(e)}
94
+ class="miam-ds-button primary select-pos-button">Sélectionner
95
+ </button>
96
+ </div>
97
+ </div>
98
+ `)}
99
+ </div>
100
+ `}getButtonLabel(){if(this._showPosList)return"Voir la carte";const t=this._posList.length;return t===1?"Voir le magasin":`Voir les ${t} magasins`}setAddress(t=!1){if(!this._addressInput.value||this._addressInput.value.length<3||this._searchingPos||!t&&this._prevAddress===this._addressInput.value+", France")return;const e=this.shadowRoot.getElementById("pos-list");e&&e.style.display==="none"&&this.togglePosList(!0),this._previousSearchMethod=this.setAddress,this._prevAddress=this._addressInput.value+", France",this._searchingPos=!0,this.requestUpdate(),this.subscriptions.push(this.getByAddress(this._prevAddress,this.selectedRadius,this._selectedSuppliers).subscribe(s=>{this.setPosList(s),this.setNewLocation(),this._searchingPos=!1,this._searchSubmitted=!0,this.requestUpdate()}))}setGeolocation(t=!1){const e=this.shadowRoot.getElementById("pos-list");e&&e.style.display==="none"&&this.togglePosList(!0),this._prevAddress="",this._previousSearchMethod=this.setGeolocation,this.getPosByCoordinates()}getPosByCoordinates(){this._searchingPos=!0,this.requestUpdate(),this.subscriptions.push(this.getByCoordinates(this.geolocationCoordinates.coords.latitude,this.geolocationCoordinates.coords.longitude,this.selectedRadius,this._selectedSuppliers).subscribe(t=>{this._addressInput.value="",this.setPosList(t),this._searchingPos=!1,this.setNewLocation(),this._searchSubmitted=!0,this.requestUpdate()}))}setPosList(t){this._posList=t.data.map(e=>{const s=Object.assign(new L,e);return s.supplier=t.included.find(i=>i.id===s.relationships.supplier.data.id),s})}dispatchPos(t){const e={detail:{posId:t.id,posExtId:t.extId,supplierId:t.supplier.id,supplierName:t.supplier.attributes.name,posName:this._nameOfStore(t)},bubbles:!0,composed:!0};console.debug("[MealzComponents] dispatchEvent posIdChange",e),this.dispatchEvent(new CustomEvent("posIdChange",e))}dispatchShow(t){const e={detail:{show:t},bubbles:!0,composed:!0};console.debug("[MealzComponents] dispatchEvent showChange",e),this.dispatchEvent(new CustomEvent("showChange",e))}initLeaflet(){this._leafletCss=document.createElement("link"),this._leafletCss.setAttribute("rel","stylesheet"),this._leafletCss.setAttribute("href","https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),this._leafletCss.setAttribute("integrity","sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="),this._leafletCss.setAttribute("crossorigin",""),this._leafletJs=document.createElement("script"),this._leafletJs.setAttribute("src","https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"),this._leafletJs.setAttribute("integrity","sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="),this._leafletJs.setAttribute("crossorigin",""),this._miamDs=document.createElement("link"),this._miamDs.setAttribute("rel","stylesheet"),this._miamDs.setAttribute("href","https://unpkg.com/miam-ds@1.2.4/miam-ds.min.css"),this.shadowRoot.appendChild(this._miamDs),this.shadowRoot.appendChild(this._leafletCss),document.head.appendChild(this._leafletJs)}waitForLeaflet(t){let i=50;console.debug("[Map] Checking for window.L");const o=setInterval(()=>{window.L!==void 0||i===0?(clearInterval(o),window.L!==void 0?(console.debug("[Map] window.L is defined"),t(!0)):(console.error("[Map] Failed to load Leaflet after",50*100,"ms"),t(!1))):i--},100)}initMap(){this._map&&(this._map.off(),this._map.remove()),this.setNewLocation(),window.L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png",{maxZoom:19,attribution:"Map tiles by Carto, under CC BY 3.0. Data by OpenStreetMap, under ODbL."}).addTo(this._map)}loadMap(){this.waitForLeaflet(t=>{t&&this.initMap()})}fetchSuppliers(){this.subscriptions.push(this.getAffiliateSuppliers().subscribe(t=>{this._suppliers=t.map(e=>({id:e.id,name:e.attributes.name})),this.requestUpdate()}))}setNewLocation(){var e;const t=this.shadowRoot.getElementById("map");t&&(this._map?(this._markers.forEach(s=>{this._map.removeLayer(s)}),this._markers=[],this._map.panTo(this.getCoordinates())):this._map=(e=window.L)==null?void 0:e.map(t).setView(this.getCoordinates(),13),this.addMarkers())}getCoordinates(){return this._posList.length<1?[48.866667,2.333333]:[this._posList[0].attributes.latitude,this._posList[0].attributes.longitude]}addMarkers(){this._posList.length>0&&this._posList.forEach((t,e)=>{this._markers.push(window.L.marker([t.attributes.latitude,t.attributes.longitude],{icon:this.buildIcon(t.supplier)}).addTo(this._map));let s=window.L.popup({content:`
91
101
  <div class="pos-item">
92
102
  <div class="top">
93
103
  <img class="pos-img" src="${t.supplier.attributes.logo}" alt="${t.supplier.attributes.name}"/>
@@ -100,7 +110,7 @@ import{u,f as m,i as g,h as f,k as n,t as b}from"../assets/lit-element-BKlYWoBt.
100
110
  <button id="select" class="miam-ds-button primary select-pos-button">Sélectionner</button>
101
111
  </div>
102
112
  </div>
103
- `});this._markers[e].bindPopup(s).on("popupopen",i=>{i.target.getPopup().getElement().querySelector("#select").addEventListener("click",()=>{this.dispatchPos(t)})})})}buildIcon(t){return window.L.icon({iconUrl:t.attributes.logo||"https://cdn-icons-png.flaticon.com/512/3515/3515146.png",shadowUrl:"https://storage.googleapis.com/assets.miam.tech/mealz-components/store-locator/marker.svg",iconSize:[32,32],shadowSize:[44,53],iconAnchor:[16,45],shadowAnchor:[22,45],popupAnchor:[0,-55]})}togglePosList(t){const e=this.shadowRoot.getElementById("pos-list"),s=this.shadowRoot.getElementById("mobile-buttons-wrapper");!e||!s||(t?(e.style.display="none",s.className="mobile-buttons-wrapper__see-list"):(e.style.display="flex",s.className="mobile-buttons-wrapper__see-map"),this._showPosList=!this._showPosList,this.requestUpdate())}geolocationTimeout(){setTimeout(()=>{this.geolocationCoordinates===void 0&&(this.geolocationCoordinates={})},2e4)}listenFormSubmit(){this.shadowRoot.getElementById("store-locator-form").addEventListener("submit",e=>{e.preventDefault(),this.setAddress()})}};r.styles=[g`
113
+ `});this._markers[e].bindPopup(s).on("popupopen",i=>{i.target.getPopup().getElement().querySelector("#select").addEventListener("click",()=>{this.dispatchPos(t)})})})}buildIcon(t){return window.L.icon({iconUrl:t.attributes.logo||"https://cdn-icons-png.flaticon.com/512/3515/3515146.png",shadowUrl:"https://storage.googleapis.com/assets.miam.tech/mealz-components/store-locator/marker.svg",iconSize:[32,32],shadowSize:[44,53],iconAnchor:[16,45],shadowAnchor:[22,45],popupAnchor:[0,-55]})}togglePosList(t){const e=this.shadowRoot.getElementById("pos-list"),s=this.shadowRoot.getElementById("mobile-buttons-wrapper");!e||!s||(t?(e.style.display="none",s.className="mobile-buttons-wrapper__see-list"):(e.style.display="flex",s.className="mobile-buttons-wrapper__see-map"),this._showPosList=!this._showPosList,this.requestUpdate())}geolocationTimeout(){setTimeout(()=>{this.geolocationCoordinates===void 0&&(this.geolocationCoordinates={})},2e4)}listenFormSubmit(){this.shadowRoot.getElementById("store-locator-form").addEventListener("submit",e=>{e.preventDefault(),this.setAddress()})}};l.styles=[g`
104
114
  :host {
105
115
  display: block;
106
116
  height: 100%;
@@ -417,4 +427,4 @@ import{u,f as m,i as g,h as f,k as n,t as b}from"../assets/lit-element-BKlYWoBt.
417
427
  top: 0;
418
428
  }
419
429
  }
420
- `];p([c({type:Boolean})],r.prototype,"show",2);p([c({type:Number})],r.prototype,"selectedRadius",2);p([c({type:Array})],r.prototype,"radiusOption",2);p([c({type:GeolocationPosition})],r.prototype,"geolocationCoordinates",1);p([c()],r.prototype,"getByAddress",2);p([c()],r.prototype,"getByCoordinates",2);p([c()],r.prototype,"getAffiliateSuppliers",2);p([v()],r.prototype,"_geolocationCoordinates",2);p([y("input")],r.prototype,"_addressInput",2);r=p([b("mealz-store-locator")],r);customElements.get("mealz-store-locator")||customElements.define("mealz-store-locator",r);
430
+ `];p([c({type:Boolean})],l.prototype,"show",2);p([c({type:Number})],l.prototype,"selectedRadius",2);p([c({type:Array})],l.prototype,"radiusOption",2);p([c({type:GeolocationPosition})],l.prototype,"geolocationCoordinates",1);p([c()],l.prototype,"getByAddress",2);p([c()],l.prototype,"getByCoordinates",2);p([c()],l.prototype,"getAffiliateSuppliers",2);p([v()],l.prototype,"_geolocationCoordinates",2);p([y("input")],l.prototype,"_addressInput",2);l=p([f("mealz-store-locator")],l);customElements.get("mealz-store-locator")||customElements.define("mealz-store-locator",l);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mealz-components",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.4.0",
5
5
  "main": "./dist/mealz-components.js",
6
6
  "module": "./dist/mealz-components.js",
7
7
  "exports": {
@@ -1 +0,0 @@
1
- import{h as e}from"./lit-element-BKlYWoBt.js";class r extends e{createRenderRoot(){return this}}export{r as N};
@@ -1 +0,0 @@
1
- @import"https://unpkg.com/miam-ds@1.2.4/miam-ds.min.css";mealz-recipe-card-cta .miam-ds-button.secondary:hover:not(.loading):not(.disabled):not([disabled]){background-color:transparent;color:var(--miam-ds-color-primary)}
@@ -1 +0,0 @@
1
- import{t as l}from"../assets/lit-element-BKlYWoBt.js";import{N as p}from"../assets/no-shadow-element-BdZPYRaG.js";var o=Object.defineProperty,d=Object.getOwnPropertyDescriptor,m=(e,a,i,s)=>{for(var t=s>1?void 0:s?d(a,i):a,r=e.length-1,c;r>=0;r--)(c=e[r])&&(t=(s?c(a,i,t):c(t))||t);return s&&t&&o(a,i,t),t};let n=class extends p{async connectedCallback(){super.connectedCallback(),console.debug("[MealzComponents] loading recipe cta"),window.mealzInternal.basket.recipesAddedToBasket$().subscribe(async e=>{e.includes(this.recipeId)&&this.updateDOM()})}render(){this.recipeCta=this.querySelector(".mealz-recipe-card-cta"),this.recipeCta&&this.getInitialStatus()}getInitialStatus(){var e;this.recipeId=(e=this.attributes["starting-data"])==null?void 0:e.value}updateDOM(){const e=this.recipeCta.querySelector("img");e&&(this.recipeCta.classList.replace("primary","secondary"),this.recipeCta.classList.add("in-basket"),e.src="https://storage.googleapis.com/assets.miam.tech/generic/icons/InCart_primary.svg",e.alt="see ingredients")}};n=m([l("mealz-recipe-card-cta")],n);customElements.get("mealz-recipe-card-cta")||customElements.define("mealz-recipe-card-cta",n);