webc-miam 10.0.2 → 10.0.4

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.
package/main-es2015.js CHANGED
@@ -1 +1 @@
1
- (window.webpackJsonpWebcMiamV10=window.webpackJsonpWebcMiamV10||[]).push([[1],{0:function(e,t,i){e.exports=i("5Mvx")},"0LHn":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.abs=void 0;var n=i("wvHV"),r=i("MBFf"),s=i("X1CF");t.abs=function(e){return n.isNegative(e)?r.negate(e):s.parse(e)}},"4NgV":function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getUnitCount=void 0;var r=i("9a4g"),s=i("X1CF");t.getUnitCount=function(e){var t=n({},s.parse(e)),i=0;return r.UNITS.forEach((function(e){0!==t[e]&&i++})),i}},"5Mvx":function(e,t,i){"use strict";function n(e){return"function"==typeof e}i.r(t);let r=!1;const s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else r&&console.log("RxJS: Back to a better error behavior. Thank you. <3");r=e},get useDeprecatedSynchronousErrorHandling(){return r}};function o(e){setTimeout(()=>{throw e},0)}const a={closed:!0,next(e){},error(e){if(s.useDeprecatedSynchronousErrorHandling)throw e;o(e)},complete(){}},c=(()=>Array.isArray||(e=>e&&"number"==typeof e.length))();function l(e){return null!==e&&"object"==typeof e}const u=(()=>{function e(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((e,t)=>`${t+1}) ${e.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e})();let d=(()=>{class e{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:i,_ctorUnsubscribe:r,_unsubscribe:s,_subscriptions:o}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(let e=0;e<i.length;++e)i[e].remove(this);if(n(s)){r&&(this._unsubscribe=void 0);try{s.call(this)}catch(a){t=a instanceof u?h(a.errors):[a]}}if(c(o)){let e=-1,i=o.length;for(;++e<i;){const i=o[e];if(l(i))try{i.unsubscribe()}catch(a){t=t||[],a instanceof u?t=t.concat(h(a.errors)):t.push(a)}}}if(t)throw new u(t)}add(t){let i=t;if(!t)return e.EMPTY;switch(typeof t){case"function":i=new e(t);case"object":if(i===this||i.closed||"function"!=typeof i.unsubscribe)return i;if(this.closed)return i.unsubscribe(),i;if(!(i instanceof e)){const t=i;i=new e,i._subscriptions=[t]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}let{_parentOrParents:n}=i;if(null===n)i._parentOrParents=this;else if(n instanceof e){if(n===this)return i;i._parentOrParents=[n,this]}else{if(-1!==n.indexOf(this))return i;n.push(this)}const r=this._subscriptions;return null===r?this._subscriptions=[i]:r.push(i),i}remove(e){const t=this._subscriptions;if(t){const i=t.indexOf(e);-1!==i&&t.splice(i,1)}}}return e.EMPTY=function(e){return e.closed=!0,e}(new e),e})();function h(e){return e.reduce((e,t)=>e.concat(t instanceof u?t.errors:t),[])}const p=(()=>"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random())();class m extends d{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=a;break;case 1:if(!e){this.destination=a;break}if("object"==typeof e){e instanceof m?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new g(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new g(this,e,t,i)}}[p](){return this}static create(e,t,i){const n=new m(e,t,i);return n.syncErrorThrowable=!1,n}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class g extends m{constructor(e,t,i,r){let s;super(),this._parentSubscriber=e;let o=this;n(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==a&&(o=Object.create(t),n(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;s.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=s;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):o(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;o(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);s.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),s.useDeprecatedSynchronousErrorHandling)throw i;o(i)}}__tryOrSetError(e,t,i){if(!s.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(n){return s.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=n,e.syncErrorThrown=!0,!0):(o(n),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const f=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")();function _(e){return e}let v=(()=>{class e{constructor(e){this._isScalar=!1,e&&(this._subscribe=e)}lift(t){const i=new e;return i.source=this,i.operator=t,i}subscribe(e,t,i){const{operator:n}=this,r=function(e,t,i){if(e){if(e instanceof m)return e;if(e[p])return e[p]()}return e||t||i?new m(e,t,i):new m(a)}(e,t,i);if(r.add(n?n.call(r,this.source):this.source||s.useDeprecatedSynchronousErrorHandling&&!r.syncErrorThrowable?this._subscribe(r):this._trySubscribe(r)),s.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable&&(r.syncErrorThrowable=!1,r.syncErrorThrown))throw r.syncErrorValue;return r}_trySubscribe(e){try{return this._subscribe(e)}catch(t){s.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){const{closed:t,destination:i,isStopped:n}=e;if(t||n)return!1;e=i&&i instanceof m?i:null}return!0}(e)?e.error(t):console.warn(t)}}forEach(e,t){return new(t=b(t))((t,i)=>{let n;n=this.subscribe(t=>{try{e(t)}catch(r){i(r),n&&n.unsubscribe()}},i,t)})}_subscribe(e){const{source:t}=this;return t&&t.subscribe(e)}[f](){return this}pipe(...e){return 0===e.length?this:(0===(t=e).length?_:1===t.length?t[0]:function(e){return t.reduce((e,t)=>t(e),e)})(this);var t}toPromise(e){return new(e=b(e))((e,t)=>{let i;this.subscribe(e=>i=e,e=>t(e),()=>e(i))})}}return e.create=t=>new e(t),e})();function b(e){if(e||(e=s.Promise||Promise),!e)throw new Error("no Promise impl found");return e}const y=(()=>{function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e})();class w extends d{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class k extends m{constructor(e){super(e),this.destination=e}}let C=(()=>{class e extends v{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[p](){return new k(this)}lift(e){const t=new S(this,this);return t.operator=e,t}next(e){if(this.closed)throw new y;if(!this.isStopped){const{observers:t}=this,i=t.length,n=t.slice();for(let r=0;r<i;r++)n[r].next(e)}}error(e){if(this.closed)throw new y;this.hasError=!0,this.thrownError=e,this.isStopped=!0;const{observers:t}=this,i=t.length,n=t.slice();for(let r=0;r<i;r++)n[r].error(e);this.observers.length=0}complete(){if(this.closed)throw new y;this.isStopped=!0;const{observers:e}=this,t=e.length,i=e.slice();for(let n=0;n<t;n++)i[n].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(e){if(this.closed)throw new y;return super._trySubscribe(e)}_subscribe(e){if(this.closed)throw new y;return this.hasError?(e.error(this.thrownError),d.EMPTY):this.isStopped?(e.complete(),d.EMPTY):(this.observers.push(e),new w(this,e))}asObservable(){const e=new v;return e.source=this,e}}return e.create=(e,t)=>new S(e,t),e})();class S extends C{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):d.EMPTY}}function x(e){return e&&"function"==typeof e.schedule}function E(e,t){return function(i){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new I(e,t))}}class I{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new P(e,this.project,this.thisArg))}}class P extends m{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const D=e=>t=>{for(let i=0,n=e.length;i<n&&!t.closed;i++)t.next(e[i]);t.complete()};function T(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}const A=T(),R=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function O(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}const F=e=>{if(e&&"function"==typeof e[f])return n=e,e=>{const t=n[f]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)};if(R(e))return D(e);if(O(e))return i=e,e=>(i.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,o),e);if(e&&"function"==typeof e[A])return t=e,e=>{const i=t[A]();for(;;){let t;try{t=i.next()}catch(n){return e.error(n),e}if(t.done){e.complete();break}if(e.next(t.value),e.closed)break}return"function"==typeof i.return&&e.add(()=>{i.return&&i.return()}),e};{const t=l(e)?"an invalid object":`'${e}'`;throw new TypeError(`You provided ${t} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`)}var t,i,n};function B(e,t){return new v(i=>{const n=new d;let r=0;return n.add(t.schedule((function(){r!==e.length?(i.next(e[r++]),i.closed||n.add(this.schedule())):i.complete()}))),n})}function M(e,t){return t?function(e,t){if(null!=e){if(function(e){return e&&"function"==typeof e[f]}(e))return function(e,t){return new v(i=>{const n=new d;return n.add(t.schedule(()=>{const r=e[f]();n.add(r.subscribe({next(e){n.add(t.schedule(()=>i.next(e)))},error(e){n.add(t.schedule(()=>i.error(e)))},complete(){n.add(t.schedule(()=>i.complete()))}}))})),n})}(e,t);if(O(e))return function(e,t){return new v(i=>{const n=new d;return n.add(t.schedule(()=>e.then(e=>{n.add(t.schedule(()=>{i.next(e),n.add(t.schedule(()=>i.complete()))}))},e=>{n.add(t.schedule(()=>i.error(e)))}))),n})}(e,t);if(R(e))return B(e,t);if(function(e){return e&&"function"==typeof e[A]}(e)||"string"==typeof e)return function(e,t){if(!e)throw new Error("Iterable cannot be null");return new v(i=>{const n=new d;let r;return n.add(()=>{r&&"function"==typeof r.return&&r.return()}),n.add(t.schedule(()=>{r=e[A](),n.add(t.schedule((function(){if(i.closed)return;let e,t;try{const i=r.next();e=i.value,t=i.done}catch(n){return void i.error(n)}t?i.complete():(i.next(e),this.schedule())})))})),n})}(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}(e,t):e instanceof v?e:new v(F(e))}class L extends m{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class $ extends m{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function j(e,t){if(t.closed)return;if(e instanceof v)return e.subscribe(t);let i;try{i=F(e)(t)}catch(n){t.error(n)}return i}function z(e,t,i=Number.POSITIVE_INFINITY){return"function"==typeof t?n=>n.pipe(z((i,n)=>M(e(i,n)).pipe(E((e,r)=>t(i,e,n,r))),i)):("number"==typeof t&&(i=t),t=>t.lift(new N(e,i)))}class N{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new V(e,this.project,this.concurrent))}}class V extends ${constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)}_tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(n){return void this.destination.error(n)}this.active++,this._innerSub(t)}_innerSub(e){const t=new L(this),i=this.destination;i.add(t);const n=j(e,t);n!==t&&i.add(n)}_complete(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyComplete(){const e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function H(e=Number.POSITIVE_INFINITY){return z(_,e)}function U(e,t){return t?B(e,t):new v(D(e))}function q(...e){let t=Number.POSITIVE_INFINITY,i=null,n=e[e.length-1];return x(n)?(i=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(t=e.pop())):"number"==typeof n&&(t=e.pop()),null===i&&1===e.length&&e[0]instanceof v?e[0]:H(t)(U(e,i))}function G(){return function(e){return e.lift(new W(e))}}class W{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const n=new Z(e,i),r=t.subscribe(n);return n.closed||(n.connection=i.connect()),r}}class Z extends m{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,n=e._connection;this.connection=null,!n||i&&n!==i||n.unsubscribe()}}class Q extends v{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new d,e.add(this.source.subscribe(new K(this.getSubject(),this))),e.closed&&(this._connection=null,e=d.EMPTY)),e}refCount(){return G()(this)}}const Y=(()=>{const e=Q.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}})();class K extends k{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}function J(){return new C}function X(e){for(let t in e)if(e[t]===X)return t;throw Error("Could not find renamed property on target object.")}function ee(e,t){for(const i in t)t.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=t[i])}function te(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(te).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return""+e.overriddenName;if(e.name)return""+e.name;const t=e.toString();if(null==t)return""+t;const i=t.indexOf("\n");return-1===i?t:t.substring(0,i)}function ie(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const ne=X({__forward_ref__:X});function re(e){return e.__forward_ref__=re,e.toString=function(){return te(this())},e}function se(e){return oe(e)?e():e}function oe(e){return"function"==typeof e&&e.hasOwnProperty(ne)&&e.__forward_ref__===re}class ae extends Error{constructor(e,t){super(function(e,t){return`${e?`NG0${e}: `:""}${t}`}(e,t)),this.code=e}}function ce(e){return"string"==typeof e?e:null==e?"":String(e)}function le(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():ce(e)}function ue(e,t){const i=t?" in "+t:"";throw new ae("201",`No provider for ${le(e)} found${i}`)}function de(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function he(e){return{providers:e.providers||[],imports:e.imports||[]}}function pe(e){return me(e,fe)||me(e,ve)}function me(e,t){return e.hasOwnProperty(t)?e[t]:null}function ge(e){return e&&(e.hasOwnProperty(_e)||e.hasOwnProperty(be))?e[_e]:null}const fe=X({\u0275prov:X}),_e=X({\u0275inj:X}),ve=X({ngInjectableDef:X}),be=X({ngInjectorDef:X});var ye=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}({});let we;function ke(e){const t=we;return we=e,t}function Ce(e,t,i){const n=pe(e);return n&&"root"==n.providedIn?void 0===n.value?n.value=n.factory():n.value:i&ye.Optional?null:void 0!==t?t:void ue(te(e),"Injector")}function Se(e){return{toString:e}.toString()}var xe=function(e){return e[e.OnPush=0]="OnPush",e[e.Default=1]="Default",e}({}),Ee=function(e){return e[e.Emulated=0]="Emulated",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom",e}({});const Ie="undefined"!=typeof globalThis&&globalThis,Pe="undefined"!=typeof window&&window,De="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Te="undefined"!=typeof global&&global,Ae=Ie||Te||Pe||De,Re={},Oe=[],Fe=[],Be=X({\u0275cmp:X}),Me=X({\u0275dir:X}),Le=X({\u0275pipe:X}),$e=X({\u0275mod:X}),je=X({\u0275loc:X}),ze=X({\u0275fac:X}),Ne=X({__NG_ELEMENT_ID__:X});let Ve=0;function He(e){return Se(()=>{const t={},i={type:e.type,providersResolver:null,decls:e.decls,vars:e.vars,factory:null,template:e.template||null,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:e.exportAs||null,onPush:e.changeDetection===xe.OnPush,directiveDefs:null,pipeDefs:null,selectors:e.selectors||Fe,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||Ee.Emulated,id:"c",styles:e.styles||Fe,_:null,setInput:null,schemas:e.schemas||null,tView:null},n=e.directives,r=e.features,s=e.pipes;return i.id+=Ve++,i.inputs=Ze(e.inputs,t),i.outputs=Ze(e.outputs),r&&r.forEach(e=>e(i)),i.directiveDefs=n?()=>("function"==typeof n?n():n).map(Ue):null,i.pipeDefs=s?()=>("function"==typeof s?s():s).map(qe):null,i})}function Ue(e){return Ke(e)||function(e){return e[Me]||null}(e)}function qe(e){return function(e){return e[Le]||null}(e)}const Ge={};function We(e){const t={type:e.type,bootstrap:e.bootstrap||Fe,declarations:e.declarations||Fe,imports:e.imports||Fe,exports:e.exports||Fe,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null};return null!=e.id&&Se(()=>{Ge[e.id]=e.type}),t}function Ze(e,t){if(null==e)return Re;const i={};for(const n in e)if(e.hasOwnProperty(n)){let r=e[n],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),i[r]=n,t&&(t[r]=s)}return i}const Qe=He;function Ye(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null}}function Ke(e){return e[Be]||null}function Je(e,t){const i=e[$e]||null;if(!i&&!0===t)throw new Error(`Type ${te(e)} does not have '\u0275mod' property.`);return i}function Xe(e){return Array.isArray(e)&&"object"==typeof e[1]}function et(e){return Array.isArray(e)&&!0===e[1]}function tt(e){return 0!=(8&e.flags)}function it(e){return 2==(2&e.flags)}function nt(e){return 1==(1&e.flags)}function rt(e){return null!==e.template}function st(e,t){return e.hasOwnProperty(ze)?e[ze]:null}class ot{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function at(){return ct}function ct(e){return e.type.prototype.ngOnChanges&&(e.setInput=ut),lt}function lt(){const e=dt(this),t=null==e?void 0:e.current;if(t){const i=e.previous;if(i===Re)e.previous=t;else for(let e in t)i[e]=t[e];e.current=null,this.ngOnChanges(t)}}function ut(e,t,i,n){const r=dt(e)||function(e,t){return e.__ngSimpleChanges__=t}(e,{previous:Re,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[i],c=o[a];s[a]=new ot(c&&c.currentValue,t,o===Re),e[n]=t}function dt(e){return e.__ngSimpleChanges__||null}at.ngInherit=!0;let ht=void 0;function pt(){return void 0!==ht?ht:"undefined"!=typeof document?document:void 0}function mt(e){return!!e.listen}const gt={createRenderer:(e,t)=>pt()};function ft(e){for(;Array.isArray(e);)e=e[0];return e}function _t(e,t){return ft(t[e])}function vt(e,t){return ft(t[e.index])}function bt(e,t){return e.data[t]}function yt(e,t){return e[t]}function wt(e,t){const i=t[e];return Xe(i)?i:i[0]}function kt(e){const t=function(e){return e.__ngContext__||null}(e);return t?Array.isArray(t)?t:t.lView:null}function Ct(e){return 4==(4&e[2])}function St(e){return 128==(128&e[2])}function xt(e,t){return null==t?null:e[t]}function Et(e){e[18]=0}function It(e,t){e[5]+=t;let i=e,n=e[3];for(;null!==n&&(1===t&&1===i[5]||-1===t&&0===i[5]);)n[5]+=t,i=n,n=n[3]}const Pt={lFrame:Jt(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Dt(){return Pt.bindingsEnabled}function Tt(){return Pt.lFrame.lView}function At(){return Pt.lFrame.tView}function Rt(e){Pt.lFrame.contextLView=e}function Ot(){let e=Ft();for(;null!==e&&64===e.type;)e=e.parent;return e}function Ft(){return Pt.lFrame.currentTNode}function Bt(e,t){const i=Pt.lFrame;i.currentTNode=e,i.isParent=t}function Mt(){return Pt.lFrame.isParent}function Lt(){Pt.lFrame.isParent=!1}function $t(){return Pt.isInCheckNoChangesMode}function jt(e){Pt.isInCheckNoChangesMode=e}function zt(){const e=Pt.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function Nt(){return Pt.lFrame.bindingIndex}function Vt(){return Pt.lFrame.bindingIndex++}function Ht(e){const t=Pt.lFrame,i=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,i}function Ut(e,t){const i=Pt.lFrame;i.bindingIndex=i.bindingRootIndex=e,qt(t)}function qt(e){Pt.lFrame.currentDirectiveIndex=e}function Gt(){return Pt.lFrame.currentQueryIndex}function Wt(e){Pt.lFrame.currentQueryIndex=e}function Zt(e){const t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function Qt(e,t,i){if(i&ye.SkipSelf){let n=t,r=e;for(;n=n.parent,!(null!==n||i&ye.Host||(n=Zt(r),null===n)||(r=r[15],10&n.type)););if(null===n)return!1;t=n,e=r}const n=Pt.lFrame=Kt();return n.currentTNode=t,n.lView=e,!0}function Yt(e){const t=Kt(),i=e[1];Pt.lFrame=t,t.currentTNode=i.firstChild,t.lView=e,t.tView=i,t.contextLView=e,t.bindingIndex=i.bindingStartIndex,t.inI18n=!1}function Kt(){const e=Pt.lFrame,t=null===e?null:e.child;return null===t?Jt(e):t}function Jt(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function Xt(){const e=Pt.lFrame;return Pt.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const ei=Xt;function ti(){const e=Xt();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function ii(){return Pt.lFrame.selectedIndex}function ni(e){Pt.lFrame.selectedIndex=e}function ri(){const e=Pt.lFrame;return bt(e.tView,e.selectedIndex)}function si(){Pt.lFrame.currentNamespace="http://www.w3.org/2000/svg"}function oi(e,t){for(let i=t.directiveStart,n=t.directiveEnd;i<n;i++){const t=e.data[i].type.prototype,{ngAfterContentInit:n,ngAfterContentChecked:r,ngAfterViewInit:s,ngAfterViewChecked:o,ngOnDestroy:a}=t;n&&(e.contentHooks||(e.contentHooks=[])).push(-i,n),r&&((e.contentHooks||(e.contentHooks=[])).push(i,r),(e.contentCheckHooks||(e.contentCheckHooks=[])).push(i,r)),s&&(e.viewHooks||(e.viewHooks=[])).push(-i,s),o&&((e.viewHooks||(e.viewHooks=[])).push(i,o),(e.viewCheckHooks||(e.viewCheckHooks=[])).push(i,o)),null!=a&&(e.destroyHooks||(e.destroyHooks=[])).push(i,a)}}function ai(e,t,i){ui(e,t,3,i)}function ci(e,t,i,n){(3&e[2])===i&&ui(e,t,i,n)}function li(e,t){let i=e[2];(3&i)===t&&(i&=2047,i+=1,e[2]=i)}function ui(e,t,i,n){const r=null!=n?n:-1,s=t.length-1;let o=0;for(let a=void 0!==n?65535&e[18]:0;a<s;a++)if("number"==typeof t[a+1]){if(o=t[a],null!=n&&o>=n)break}else t[a]<0&&(e[18]+=65536),(o<r||-1==r)&&(di(e,i,t,a),e[18]=(4294901760&e[18])+a+2),a++}function di(e,t,i,n){const r=i[n]<0,s=i[n+1],o=e[r?-i[n]:i[n]];if(r){if(e[2]>>11<e[18]>>16&&(3&e[2])===t){e[2]+=2048;try{s.call(o)}finally{}}}else try{s.call(o)}finally{}}class hi{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function pi(e,t,i){const n=mt(e);let r=0;for(;r<i.length;){const s=i[r];if("number"==typeof s){if(0!==s)break;r++;const o=i[r++],a=i[r++],c=i[r++];n?e.setAttribute(t,a,c,o):t.setAttributeNS(o,a,c)}else{const o=s,a=i[++r];mi(o)?n&&e.setProperty(t,o,a):n?e.setAttribute(t,o,a):t.setAttribute(o,a),r++}}return r}function mi(e){return 64===e.charCodeAt(0)}function gi(e,t){if(null===t||0===t.length);else if(null===e||0===e.length)e=t.slice();else{let i=-1;for(let n=0;n<t.length;n++){const r=t[n];"number"==typeof r?i=r:0===i||fi(e,i,r,null,-1===i||2===i?t[++n]:null)}}return e}function fi(e,t,i,n,r){let s=0,o=e.length;if(-1===t)o=-1;else for(;s<e.length;){const i=e[s++];if("number"==typeof i){if(i===t){o=-1;break}if(i>t){o=s-1;break}}}for(;s<e.length;){const t=e[s];if("number"==typeof t)break;if(t===i){if(null===n)return void(null!==r&&(e[s+1]=r));if(n===e[s+1])return void(e[s+2]=r)}s++,null!==n&&s++,null!==r&&s++}-1!==o&&(e.splice(o,0,t),s=o+1),e.splice(s++,0,i),null!==n&&e.splice(s++,0,n),null!==r&&e.splice(s++,0,r)}function _i(e){return-1!==e}function vi(e){return 32767&e}function bi(e,t){let i=e>>16,n=t;for(;i>0;)n=n[15],i--;return n}let yi=!0;function wi(e){const t=yi;return yi=e,t}let ki=0;function Ci(e,t){const i=xi(e,t);if(-1!==i)return i;const n=t[1];n.firstCreatePass&&(e.injectorIndex=t.length,Si(n.data,e),Si(t,null),Si(n.blueprint,null));const r=Ei(e,t),s=e.injectorIndex;if(_i(r)){const e=vi(r),i=bi(r,t),n=i[1].data;for(let r=0;r<8;r++)t[s+r]=i[e+r]|n[e+r]}return t[s+8]=r,s}function Si(e,t){e.push(0,0,0,0,0,0,0,0,t)}function xi(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function Ei(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let i=0,n=null,r=t;for(;null!==r;){const e=r[1],t=e.type;if(n=2===t?e.declTNode:1===t?r[6]:null,null===n)return-1;if(i++,r=r[15],-1!==n.injectorIndex)return n.injectorIndex|i<<16}return-1}function Ii(e,t,i){!function(e,t,i){let n;"string"==typeof i?n=i.charCodeAt(0)||0:i.hasOwnProperty(Ne)&&(n=i[Ne]),null==n&&(n=i[Ne]=ki++);const r=255&n;t.data[e+(r>>5)]|=1<<r}(e,t,i)}function Pi(e,t,i){if(i&ye.Optional)return e;ue(t,"NodeInjector")}function Di(e,t,i,n){if(i&ye.Optional&&void 0===n&&(n=null),0==(i&(ye.Self|ye.Host))){const r=e[9],s=ke(void 0);try{return r?r.get(t,n,i&ye.Optional):Ce(t,n,i&ye.Optional)}finally{ke(s)}}return Pi(n,t,i)}function Ti(e,t,i,n=ye.Default,r){if(null!==e){const s=function(e){if("string"==typeof e)return e.charCodeAt(0)||0;const t=e.hasOwnProperty(Ne)?e[Ne]:void 0;return"number"==typeof t?t>=0?255&t:Ri:t}(i);if("function"==typeof s){if(!Qt(t,e,n))return n&ye.Host?Pi(r,i,n):Di(t,i,n,r);try{const e=s();if(null!=e||n&ye.Optional)return e;ue(i)}finally{ei()}}else if("number"==typeof s){let r=null,o=xi(e,t),a=-1,c=n&ye.Host?t[16][6]:null;for((-1===o||n&ye.SkipSelf)&&(a=-1===o?Ei(e,t):t[o+8],-1!==a&&Li(n,!1)?(r=t[1],o=vi(a),t=bi(a,t)):o=-1);-1!==o;){const e=t[1];if(Mi(s,o,e.data)){const e=Oi(o,t,i,r,n,c);if(e!==Ai)return e}a=t[o+8],-1!==a&&Li(n,t[1].data[o+8]===c)&&Mi(s,o,t)?(r=e,o=vi(a),t=bi(a,t)):o=-1}}}return Di(t,i,n,r)}const Ai={};function Ri(){return new $i(Ot(),Tt())}function Oi(e,t,i,n,r,s){const o=t[1],a=o.data[e+8],c=Fi(a,o,i,null==n?it(a)&&yi:n!=o&&0!=(3&a.type),r&ye.Host&&s===a);return null!==c?Bi(t,o,c,a):Ai}function Fi(e,t,i,n,r){const s=e.providerIndexes,o=t.data,a=1048575&s,c=e.directiveStart,l=s>>20,u=r?a+l:e.directiveEnd;for(let d=n?a:a+l;d<u;d++){const e=o[d];if(d<c&&i===e||d>=c&&e.type===i)return d}if(r){const e=o[c];if(e&&rt(e)&&e.type===i)return c}return null}function Bi(e,t,i,n){let r=e[i];const s=t.data;if(r instanceof hi){const o=r;o.resolving&&function(e,t){throw new ae("200","Circular dependency in DI detected for "+e)}(le(s[i]));const a=wi(o.canSeeViewProviders);o.resolving=!0;const c=o.injectImpl?ke(o.injectImpl):null;Qt(e,n,ye.Default);try{r=e[i]=o.factory(void 0,s,e,n),t.firstCreatePass&&i>=n.directiveStart&&function(e,t,i){const{ngOnChanges:n,ngOnInit:r,ngDoCheck:s}=t.type.prototype;if(n){const n=ct(t);(i.preOrderHooks||(i.preOrderHooks=[])).push(e,n),(i.preOrderCheckHooks||(i.preOrderCheckHooks=[])).push(e,n)}r&&(i.preOrderHooks||(i.preOrderHooks=[])).push(0-e,r),s&&((i.preOrderHooks||(i.preOrderHooks=[])).push(e,s),(i.preOrderCheckHooks||(i.preOrderCheckHooks=[])).push(e,s))}(i,s[i],t)}finally{null!==c&&ke(c),wi(a),o.resolving=!1,ei()}}return r}function Mi(e,t,i){return!!(i[t+(e>>5)]&1<<e)}function Li(e,t){return!(e&ye.Self||e&ye.Host&&t)}class $i{constructor(e,t){this._tNode=e,this._lView=t}get(e,t){return Ti(this._tNode,this._lView,e,void 0,t)}}function ji(e){return Se(()=>{const t=e.prototype.constructor,i=t[ze]||zi(t),n=Object.prototype;let r=Object.getPrototypeOf(e.prototype).constructor;for(;r&&r!==n;){const e=r[ze]||zi(r);if(e&&e!==i)return e;r=Object.getPrototypeOf(r)}return e=>new e})}function zi(e){return oe(e)?()=>{const t=zi(se(e));return t&&t()}:st(e)}function Ni(e,t,i){return Se(()=>{const n=function(e){return function(...t){if(e){const i=e(...t);for(const e in i)this[e]=i[e]}}}(t);function r(...e){if(this instanceof r)return n.apply(this,e),this;const t=new r(...e);return i.annotation=t,i;function i(e,i,n){const r=e.hasOwnProperty("__parameters__")?e.__parameters__:Object.defineProperty(e,"__parameters__",{value:[]}).__parameters__;for(;r.length<=n;)r.push(null);return(r[n]=r[n]||[]).push(t),e}}return i&&(r.prototype=Object.create(i.prototype)),r.prototype.ngMetadataName=e,r.annotationCls=r,r})}class Vi{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=de({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return"InjectionToken "+this._desc}}function Hi(e,t){e.forEach(e=>Array.isArray(e)?Hi(e,t):t(e))}function Ui(e,t,i){t>=e.length?e.push(i):e.splice(t,0,i)}function qi(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Gi(e,t){const i=[];for(let n=0;n<e;n++)i.push(t);return i}function Wi(e,t,i){let n=Qi(e,t);return n>=0?e[1|n]=i:(n=~n,function(e,t,i,n){let r=e.length;if(r==t)e.push(i,n);else if(1===r)e.push(n,e[0]),e[0]=i;else{for(r--,e.push(e[r-1],e[r]);r>t;)e[r]=e[r-2],r--;e[t]=i,e[t+1]=n}}(e,n,t,i)),n}function Zi(e,t){const i=Qi(e,t);if(i>=0)return e[1|i]}function Qi(e,t){return function(e,t,i){let n=0,r=e.length>>1;for(;r!==n;){const i=n+(r-n>>1),s=e[i<<1];if(t===s)return i<<1;s>t?r=i:n=i+1}return~(r<<1)}(e,t)}const Yi={},Ki=/\n/gm,Ji=X({provide:String,useValue:X});let Xi=void 0;function en(e){const t=Xi;return Xi=e,t}function tn(e,t=ye.Default){if(void 0===Xi)throw new Error("inject() must be called from an injection context");return null===Xi?Ce(e,void 0,t):Xi.get(e,t&ye.Optional?null:void 0,t)}function nn(e,t=ye.Default){return(we||tn)(se(e),t)}function rn(e){const t=[];for(let i=0;i<e.length;i++){const n=se(e[i]);if(Array.isArray(n)){if(0===n.length)throw new Error("Arguments array must have arguments.");let e=void 0,i=ye.Default;for(let t=0;t<n.length;t++){const r=n[t],s=r.__NG_DI_FLAG__;"number"==typeof s?-1===s?e=r.token:i|=s:e=r}t.push(nn(e,i))}else t.push(nn(n))}return t}function sn(e,t){return e.__NG_DI_FLAG__=t,e.prototype.__NG_DI_FLAG__=t,e}const on=sn(Ni("Inject",e=>({token:e})),-1),an=sn(Ni("Optional"),8),cn=sn(Ni("SkipSelf"),4);let ln,un;function dn(e){var t;return(null===(t=function(){if(void 0===ln&&(ln=null,Ae.trustedTypes))try{ln=Ae.trustedTypes.createPolicy("angular",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch(t){}return ln}())||void 0===t?void 0:t.createHTML(e))||e}function hn(e){var t;return(null===(t=function(){if(void 0===un&&(un=null,Ae.trustedTypes))try{un=Ae.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch(t){}return un}())||void 0===t?void 0:t.createHTML(e))||e}class pn{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see https://g.co/ng/security#xss)"}}class mn extends pn{getTypeName(){return"HTML"}}class gn extends pn{getTypeName(){return"Style"}}class fn extends pn{getTypeName(){return"Script"}}class _n extends pn{getTypeName(){return"URL"}}class vn extends pn{getTypeName(){return"ResourceURL"}}function bn(e){return e instanceof pn?e.changingThisBreaksApplicationSecurity:e}function yn(e,t){const i=wn(e);if(null!=i&&i!==t){if("ResourceURL"===i&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${i} (see https://g.co/ng/security#xss)`)}return i===t}function wn(e){return e instanceof pn&&e.getTypeName()||null}class kn{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{const t=(new window.DOMParser).parseFromString(dn(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class Cn{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const e=this.inertDocument.createElement("html");this.inertDocument.appendChild(e);const t=this.inertDocument.createElement("body");e.appendChild(t)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=dn(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=dn(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let n=t.length-1;0<n;n--){const i=t.item(n).name;"xmlns:ns1"!==i&&0!==i.indexOf("ns1:")||e.removeAttribute(i)}let i=e.firstChild;for(;i;)i.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(i),i=i.nextSibling}}const Sn=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,xn=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;function En(e){return(e=String(e)).match(Sn)||e.match(xn)?e:"unsafe:"+e}function In(e){const t={};for(const i of e.split(","))t[i]=!0;return t}function Pn(...e){const t={};for(const i of e)for(const e in i)i.hasOwnProperty(e)&&(t[e]=!0);return t}const Dn=In("area,br,col,hr,img,wbr"),Tn=In("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),An=In("rp,rt"),Rn=Pn(An,Tn),On=Pn(Dn,Pn(Tn,In("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Pn(An,In("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Rn),Fn=In("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Bn=In("srcset"),Mn=Pn(Fn,Bn,In("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),In("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),Ln=In("script,style,template");class $n{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let e=this.checkClobberedElement(t,t.nextSibling);if(e){t=e;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!On.hasOwnProperty(t))return this.sanitizedSomething=!0,!Ln.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r<i.length;r++){const e=i.item(r),t=e.name,s=t.toLowerCase();if(!Mn.hasOwnProperty(s)){this.sanitizedSomething=!0;continue}let o=e.value;Fn[s]&&(o=En(o)),Bn[s]&&(n=o,o=(n=String(n)).split(",").map(e=>En(e.trim())).join(", ")),this.buf.push(" ",t,'="',Nn(o),'"')}var n;return this.buf.push(">"),!0}endElement(e){const t=e.nodeName.toLowerCase();On.hasOwnProperty(t)&&!Dn.hasOwnProperty(t)&&(this.buf.push("</"),this.buf.push(t),this.buf.push(">"))}chars(e){this.buf.push(Nn(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+e.outerHTML);return t}}const jn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,zn=/([^\#-~ |!])/g;function Nn(e){return e.replace(/&/g,"&amp;").replace(jn,(function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"})).replace(zn,(function(e){return"&#"+e.charCodeAt(0)+";"})).replace(/</g,"&lt;").replace(/>/g,"&gt;")}let Vn;function Hn(e,t){let i=null;try{Vn=Vn||function(e){const t=new Cn(e);return function(){try{return!!(new window.DOMParser).parseFromString(dn(""),"text/html")}catch(e){return!1}}()?new kn(t):t}(e);let n=t?String(t):"";i=Vn.getInertBodyElement(n);let r=5,s=n;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,n=s,s=i.innerHTML,i=Vn.getInertBodyElement(n)}while(n!==s);return dn((new $n).sanitizeChildren(Un(i)||i))}finally{if(i){const e=Un(i)||i;for(;e.firstChild;)e.removeChild(e.firstChild)}}}function Un(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var qn=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}({});function Gn(e){const t=Zn();return t?hn(t.sanitize(qn.HTML,e)||""):yn(e,"HTML")?hn(bn(e)):Hn(pt(),ce(e))}function Wn(e){const t=Zn();return t?t.sanitize(qn.URL,e)||"":yn(e,"URL")?bn(e):En(ce(e))}function Zn(){const e=Tt();return e&&e[12]}function Qn(e){return e.ngDebugContext}function Yn(e){return e.ngOriginalError}function Kn(e,...t){e.error(...t)}class Jn{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),n=function(e){return e.ngErrorLogger||Kn}(e);n(this._console,"ERROR",e),t&&n(this._console,"ORIGINAL ERROR",t),i&&n(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?Qn(e)?Qn(e):this._findContext(Yn(e)):null}_findOriginalError(e){let t=Yn(e);for(;t&&Yn(t);)t=Yn(t);return t}}function Xn(e,t){e.__ngContext__=t}const er=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Ae))();function tr(e){return{name:"window",target:e.ownerDocument.defaultView}}function ir(e){return e instanceof Function?e():e}var nr=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}({});function rr(e,t){return(void 0)(e,t)}function sr(e){const t=e[3];return et(t)?t[3]:t}function or(e){return cr(e[13])}function ar(e){return cr(e[4])}function cr(e){for(;null!==e&&!et(e);)e=e[4];return e}function lr(e,t,i,n,r){if(null!=n){let s,o=!1;et(n)?s=n:Xe(n)&&(o=!0,n=n[0]);const a=ft(n);0===e&&null!==i?null==r?_r(t,i,a):fr(t,i,a,r||null,!0):1===e&&null!==i?fr(t,i,a,r||null,!0):2===e?function(e,t,i){const n=br(e,t);n&&function(e,t,i,n){mt(e)?e.removeChild(t,i,n):t.removeChild(i)}(e,n,t,i)}(t,a,o):3===e&&t.destroyNode(a),null!=s&&function(e,t,i,n,r){const s=i[7];s!==ft(i)&&lr(t,e,n,s,r);for(let o=10;o<i.length;o++){const r=i[o];xr(r[1],r,e,t,n,s)}}(t,e,s,i,r)}}function ur(e,t,i){return mt(e)?e.createElement(t,i):null===i?e.createElement(t):e.createElementNS(i,t)}function dr(e,t){const i=e[9],n=i.indexOf(t),r=t[3];1024&t[2]&&(t[2]&=-1025,It(r,-1)),i.splice(n,1)}function hr(e,t){if(e.length<=10)return;const i=10+t,n=e[i];if(n){const s=n[17];null!==s&&s!==e&&dr(s,n),t>0&&(e[i-1][4]=n[4]);const o=qi(e,10+t);xr(n[1],r=n,r[11],2,null,null),r[0]=null,r[6]=null;const a=o[19];null!==a&&a.detachView(o[1]),n[3]=null,n[4]=null,n[2]&=-129}var r;return n}function pr(e,t){if(!(256&t[2])){const i=t[11];mt(i)&&i.destroyNode&&xr(e,t,i,3,null,null),function(e){let t=e[13];if(!t)return mr(e[1],e);for(;t;){let i=null;if(Xe(t))i=t[13];else{const e=t[10];e&&(i=e)}if(!i){for(;t&&!t[4]&&t!==e;)Xe(t)&&mr(t[1],t),t=t[3];null===t&&(t=e),Xe(t)&&mr(t[1],t),i=t&&t[4]}t=i}}(t)}}function mr(e,t){if(!(256&t[2])){t[2]&=-129,t[2]|=256,function(e,t){let i;if(null!=e&&null!=(i=e.destroyHooks))for(let n=0;n<i.length;n+=2){const e=t[i[n]];if(!(e instanceof hi)){const t=i[n+1];if(Array.isArray(t))for(let i=0;i<t.length;i+=2){const n=e[t[i]],r=t[i+1];try{r.call(n)}finally{}}else try{t.call(e)}finally{}}}}(e,t),function(e,t){const i=e.cleanup,n=t[7];let r=-1;if(null!==i)for(let s=0;s<i.length-1;s+=2)if("string"==typeof i[s]){const e=i[s+1],o="function"==typeof e?e(t):ft(t[e]),a=n[r=i[s+2]],c=i[s+3];"boolean"==typeof c?o.removeEventListener(i[s],a,c):c>=0?n[r=c]():n[r=-c].unsubscribe(),s+=2}else{const e=n[r=i[s+1]];i[s].call(e)}if(null!==n){for(let e=r+1;e<n.length;e++)(0,n[e])();t[7]=null}}(e,t),1===t[1].type&&mt(t[11])&&t[11].destroy();const i=t[17];if(null!==i&&et(t[3])){i!==t[3]&&dr(i,t);const n=t[19];null!==n&&n.detachView(e)}}}function gr(e,t,i){return function(e,t,i){let n=t;for(;null!==n&&40&n.type;)n=(t=n).parent;if(null===n)return i[0];if(2&n.flags){const t=e.data[n.directiveStart].encapsulation;if(t===Ee.None||t===Ee.Emulated)return null}return vt(n,i)}(e,t.parent,i)}function fr(e,t,i,n,r){mt(e)?e.insertBefore(t,i,n,r):t.insertBefore(i,n,r)}function _r(e,t,i){mt(e)?e.appendChild(t,i):t.appendChild(i)}function vr(e,t,i,n,r){null!==n?fr(e,t,i,n,r):_r(e,t,i)}function br(e,t){return mt(e)?e.parentNode(t):t.parentNode}function yr(e,t,i){return wr(e,t,i)}let wr=function(e,t,i){return 40&e.type?vt(e,i):null};function kr(e,t,i,n){const r=gr(e,n,t),s=t[11],o=yr(n.parent||t[6],n,t);if(null!=r)if(Array.isArray(i))for(let a=0;a<i.length;a++)vr(s,r,i[a],o,!1);else vr(s,r,i,o,!1)}function Cr(e,t){return null!==t?e[16][6].projection[t.projection]:null}function Sr(e,t,i,n,r,s,o){for(;null!=i;){const a=n[i.index],c=i.type;if(o&&0===t&&(a&&Xn(ft(a),n),i.flags|=4),64!=(64&i.flags))if(8&c)Sr(e,t,i.child,n,r,s,!1),lr(t,e,r,a,s);else if(32&c){const o=rr(i,n);let c;for(;c=o();)lr(t,e,r,c,s);lr(t,e,r,a,s)}else 16&c?Er(e,t,n,i,r,s):lr(t,e,r,a,s);i=o?i.projectionNext:i.next}}function xr(e,t,i,n,r,s){Sr(i,n,e.firstChild,t,r,s,!1)}function Er(e,t,i,n,r,s){const o=i[16],a=o[6].projection[n.projection];if(Array.isArray(a))for(let c=0;c<a.length;c++)lr(t,e,r,a[c],s);else Sr(e,t,a,o[3],r,s,!0)}function Ir(e,t,i){mt(e)?e.setAttribute(t,"style",i):t.style.cssText=i}function Pr(e,t,i){mt(e)?""===i?e.removeAttribute(t,"class"):e.setAttribute(t,"class",i):t.className=i}function Dr(e,t,i){let n=e.length;for(;;){const r=e.indexOf(t,i);if(-1===r)return r;if(0===r||e.charCodeAt(r-1)<=32){const i=t.length;if(r+i===n||e.charCodeAt(r+i)<=32)return r}i=r+1}}function Tr(e,t,i){let n=0;for(;n<e.length;){let r=e[n++];if(i&&"class"===r){if(r=e[n],-1!==Dr(r.toLowerCase(),t,0))return!0}else if(1===r){for(;n<e.length&&"string"==typeof(r=e[n++]);)if(r.toLowerCase()===t)return!0;return!1}}return!1}function Ar(e){return 4===e.type&&"ng-template"!==e.value}function Rr(e,t,i){return t===(4!==e.type||i?e.value:"ng-template")}function Or(e,t,i){let n=4;const r=e.attrs||[],s=function(e){for(let i=0;i<e.length;i++)if(3===(t=e[i])||4===t||6===t)return i;var t;return e.length}(r);let o=!1;for(let a=0;a<t.length;a++){const c=t[a];if("number"!=typeof c){if(!o)if(4&n){if(n=2|1&n,""!==c&&!Rr(e,c,i)||""===c&&1===t.length){if(Fr(n))return!1;o=!0}}else{const l=8&n?c:t[++a];if(8&n&&null!==e.attrs){if(!Tr(e.attrs,l,i)){if(Fr(n))return!1;o=!0}continue}const u=Br(8&n?"class":c,r,Ar(e),i);if(-1===u){if(Fr(n))return!1;o=!0;continue}if(""!==l){let e;e=u>s?"":r[u+1].toLowerCase();const t=8&n?e:null;if(t&&-1!==Dr(t,l,0)||2&n&&l!==e){if(Fr(n))return!1;o=!0}}}}else{if(!o&&!Fr(n)&&!Fr(c))return!1;if(o&&Fr(c))continue;o=!1,n=c|1&n}}return Fr(n)||o}function Fr(e){return 0==(1&e)}function Br(e,t,i,n){if(null===t)return-1;let r=0;if(n||!i){let i=!1;for(;r<t.length;){const n=t[r];if(n===e)return r;if(3===n||6===n)i=!0;else{if(1===n||2===n){let e=t[++r];for(;"string"==typeof e;)e=t[++r];continue}if(4===n)break;if(0===n){r+=4;continue}}r+=i?1:2}return-1}return function(e,t){let i=e.indexOf(4);if(i>-1)for(i++;i<e.length;){const n=e[i];if("number"==typeof n)return-1;if(n===t)return i;i++}return-1}(t,e)}function Mr(e,t,i=!1){for(let n=0;n<t.length;n++)if(Or(e,t[n],i))return!0;return!1}function Lr(e,t){e:for(let i=0;i<t.length;i++){const n=t[i];if(e.length===n.length){for(let t=0;t<e.length;t++)if(e[t]!==n[t])continue e;return!0}}return!1}function $r(e,t){return e?":not("+t.trim()+")":t}function jr(e){let t=e[0],i=1,n=2,r="",s=!1;for(;i<e.length;){let o=e[i];if("string"==typeof o)if(2&n){const t=e[++i];r+="["+o+(t.length>0?'="'+t+'"':"")+"]"}else 8&n?r+="."+o:4&n&&(r+=" "+o);else""===r||Fr(o)||(t+=$r(s,r),r=""),n=o,s=s||!Fr(n);i++}return""!==r&&(t+=$r(s,r)),t}const zr={};function Nr(e){Vr(At(),Tt(),ii()+e,$t())}function Vr(e,t,i,n){if(!n)if(3==(3&t[2])){const n=e.preOrderCheckHooks;null!==n&&ai(t,n,i)}else{const n=e.preOrderHooks;null!==n&&ci(t,n,0,i)}ni(i)}function Hr(e,t){return e<<17|t<<2}function Ur(e){return e>>17&32767}function qr(e){return 2|e}function Gr(e){return(131068&e)>>2}function Wr(e,t){return-131069&e|t<<2}function Zr(e){return 1|e}function Qr(e,t){const i=e.contentQueries;if(null!==i)for(let n=0;n<i.length;n+=2){const r=i[n],s=i[n+1];if(-1!==s){const i=e.data[s];Wt(r),i.contentQueries(2,t[s],s)}}}function Yr(e,t,i,n,r,s,o,a,c,l){const u=t.blueprint.slice();return u[0]=r,u[2]=140|n,Et(u),u[3]=u[15]=e,u[8]=i,u[10]=o||e&&e[10],u[11]=a||e&&e[11],u[12]=c||e&&e[12]||null,u[9]=l||e&&e[9]||null,u[6]=s,u[16]=2==t.type?e[16]:u,u}function Kr(e,t,i,n,r){let s=e.data[t];if(null===s)s=function(e,t,i,n,r){const s=Ft(),o=Mt(),a=e.data[t]=function(e,t,i,n,r,s){return{type:i,index:n,insertBeforeIndex:null,injectorIndex:t?t.injectorIndex:-1,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,propertyBindings:null,flags:0,providerIndexes:0,value:r,attrs:s,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tViews:null,next:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,o?s:s&&s.parent,i,t,n,r);return null===e.firstChild&&(e.firstChild=a),null!==s&&(o?null==s.child&&null!==a.parent&&(s.child=a):null===s.next&&(s.next=a)),a}(e,t,i,n,r),Pt.lFrame.inI18n&&(s.flags|=64);else if(64&s.type){s.type=i,s.value=n,s.attrs=r;const e=function(){const e=Pt.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}();s.injectorIndex=null===e?-1:e.injectorIndex}return Bt(s,!0),s}function Jr(e,t,i,n){if(0===i)return-1;const r=t.length;for(let s=0;s<i;s++)t.push(n),e.blueprint.push(n),e.data.push(null);return r}function Xr(e,t,i){Yt(t);try{const n=e.viewQuery;null!==n&&Ps(1,n,i);const r=e.template;null!==r&&is(e,t,r,1,i),e.firstCreatePass&&(e.firstCreatePass=!1),e.staticContentQueries&&Qr(e,t),e.staticViewQueries&&Ps(2,e.viewQuery,i);const s=e.components;null!==s&&function(e,t){for(let i=0;i<t.length;i++)Cs(e,t[i])}(t,s)}catch(n){throw e.firstCreatePass&&(e.incompleteFirstPass=!0),n}finally{t[2]&=-5,ti()}}function es(e,t,i,n){const r=t[2];if(256==(256&r))return;Yt(t);const s=$t();try{Et(t),Pt.lFrame.bindingIndex=e.bindingStartIndex,null!==i&&is(e,t,i,2,n);const o=3==(3&r);if(!s)if(o){const i=e.preOrderCheckHooks;null!==i&&ai(t,i,null)}else{const i=e.preOrderHooks;null!==i&&ci(t,i,0,null),li(t,0)}if(function(e){for(let t=or(e);null!==t;t=ar(t)){if(!t[2])continue;const e=t[9];for(let t=0;t<e.length;t++){const i=e[t],n=i[3];0==(1024&i[2])&&It(n,1),i[2]|=1024}}}(t),function(e){for(let t=or(e);null!==t;t=ar(t))for(let e=10;e<t.length;e++){const i=t[e],n=i[1];St(i)&&es(n,i,n.template,i[8])}}(t),null!==e.contentQueries&&Qr(e,t),!s)if(o){const i=e.contentCheckHooks;null!==i&&ai(t,i)}else{const i=e.contentHooks;null!==i&&ci(t,i,1),li(t,1)}!function(e,t){const i=e.hostBindingOpCodes;if(null!==i)try{for(let e=0;e<i.length;e++){const n=i[e];if(n<0)ni(~n);else{const r=n,s=i[++e],o=i[++e];Ut(s,r),o(2,t[r])}}}finally{ni(-1)}}(e,t);const a=e.components;null!==a&&function(e,t){for(let i=0;i<t.length;i++)ks(e,t[i])}(t,a);const c=e.viewQuery;if(null!==c&&Ps(2,c,n),!s)if(o){const i=e.viewCheckHooks;null!==i&&ai(t,i)}else{const i=e.viewHooks;null!==i&&ci(t,i,2),li(t,2)}!0===e.firstUpdatePass&&(e.firstUpdatePass=!1),s||(t[2]&=-73),1024&t[2]&&(t[2]&=-1025,It(t[3],-1))}finally{ti()}}function ts(e,t,i,n){const r=t[10],s=!$t(),o=Ct(t);try{s&&!o&&r.begin&&r.begin(),o&&Xr(e,t,n),es(e,t,i,n)}finally{s&&!o&&r.end&&r.end()}}function is(e,t,i,n,r){const s=ii(),o=2&n;try{ni(-1),o&&t.length>20&&Vr(e,t,20,$t()),i(n,r)}finally{ni(s)}}function ns(e,t,i){if(tt(t)){const n=t.directiveEnd;for(let r=t.directiveStart;r<n;r++){const t=e.data[r];t.contentQueries&&t.contentQueries(1,i[r],r)}}}function rs(e,t,i){Dt()&&(function(e,t,i,n){const r=i.directiveStart,s=i.directiveEnd;e.firstCreatePass||Ci(i,t),Xn(n,t);const o=i.initialInputs;for(let a=r;a<s;a++){const n=e.data[a],s=rt(n);s&&vs(t,i,n);const c=Bi(t,e,a,i);Xn(c,t),null!==o&&bs(0,a-r,c,n,0,o),s&&(wt(i.index,t)[8]=c)}}(e,t,i,vt(i,t)),128==(128&i.flags)&&function(e,t,i){const n=i.directiveStart,r=i.directiveEnd,s=i.index,o=Pt.lFrame.currentDirectiveIndex;try{ni(s);for(let i=n;i<r;i++){const n=e.data[i],r=t[i];qt(i),null===n.hostBindings&&0===n.hostVars&&null===n.hostAttrs||ps(n,r)}}finally{ni(-1),qt(o)}}(e,t,i))}function ss(e,t,i=vt){const n=t.localNames;if(null!==n){let r=t.index+1;for(let s=0;s<n.length;s+=2){const o=n[s+1],a=-1===o?i(t,e):e[o];e[r++]=a}}}function os(e){const t=e.tView;return null===t||t.incompleteFirstPass?e.tView=as(1,null,e.template,e.decls,e.vars,e.directiveDefs,e.pipeDefs,e.viewQuery,e.schemas,e.consts):t}function as(e,t,i,n,r,s,o,a,c,l){const u=20+n,d=u+r,h=function(e,t){const i=[];for(let n=0;n<t;n++)i.push(n<e?null:zr);return i}(u,d),p="function"==typeof l?l():l;return h[1]={type:e,blueprint:h,template:i,queries:null,viewQuery:a,declTNode:t,data:h.slice().fill(null,u),bindingStartIndex:u,expandoStartIndex:d,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:"function"==typeof s?s():s,pipeRegistry:"function"==typeof o?o():o,firstChild:null,schemas:c,consts:p,incompleteFirstPass:!1}}function cs(e,t,i,n){const r=Ts(t);null===i?r.push(n):(r.push(i),e.firstCreatePass&&As(e).push(n,r.length-1))}function ls(e,t,i){for(let n in e)if(e.hasOwnProperty(n)){const r=e[n];(i=null===i?{}:i).hasOwnProperty(n)?i[n].push(t,r):i[n]=[t,r]}return i}function us(e,t,i,n,r,s,o,a){const c=vt(t,i);let l,u=t.inputs;var d;!a&&null!=u&&(l=u[n])?(Os(e,i,l,n,r),it(t)&&function(e,t){const i=wt(t,e);16&i[2]||(i[2]|=64)}(i,t.index)):3&t.type&&(n="class"===(d=n)?"className":"for"===d?"htmlFor":"formaction"===d?"formAction":"innerHtml"===d?"innerHTML":"readonly"===d?"readOnly":"tabindex"===d?"tabIndex":d,r=null!=o?o(r,t.value||"",n):r,mt(s)?s.setProperty(c,n,r):mi(n)||(c.setProperty?c.setProperty(n,r):c[n]=r))}function ds(e,t,i,n){let r=!1;if(Dt()){const s=function(e,t,i){const n=e.directiveRegistry;let r=null;if(n)for(let s=0;s<n.length;s++){const o=n[s];Mr(i,o.selectors,!1)&&(r||(r=[]),Ii(Ci(i,t),e,o.type),rt(o)?(ms(e,i),r.unshift(o)):r.push(o))}return r}(e,t,i),o=null===n?null:{"":-1};if(null!==s){r=!0,fs(i,e.data.length,s.length);for(let e=0;e<s.length;e++){const t=s[e];t.providersResolver&&t.providersResolver(t)}let n=!1,a=!1,c=Jr(e,t,s.length,null);for(let r=0;r<s.length;r++){const l=s[r];i.mergedAttrs=gi(i.mergedAttrs,l.hostAttrs),_s(e,i,t,c,l),gs(c,l,o),null!==l.contentQueries&&(i.flags|=8),null===l.hostBindings&&null===l.hostAttrs&&0===l.hostVars||(i.flags|=128);const u=l.type.prototype;!n&&(u.ngOnChanges||u.ngOnInit||u.ngDoCheck)&&((e.preOrderHooks||(e.preOrderHooks=[])).push(i.index),n=!0),a||!u.ngOnChanges&&!u.ngDoCheck||((e.preOrderCheckHooks||(e.preOrderCheckHooks=[])).push(i.index),a=!0),c++}!function(e,t){const i=t.directiveEnd,n=e.data,r=t.attrs,s=[];let o=null,a=null;for(let c=t.directiveStart;c<i;c++){const e=n[c],i=e.inputs,l=null===r||Ar(t)?null:ys(i,r);s.push(l),o=ls(i,c,o),a=ls(e.outputs,c,a)}null!==o&&(o.hasOwnProperty("class")&&(t.flags|=16),o.hasOwnProperty("style")&&(t.flags|=32)),t.initialInputs=s,t.inputs=o,t.outputs=a}(e,i)}o&&function(e,t,i){if(t){const n=e.localNames=[];for(let e=0;e<t.length;e+=2){const r=i[t[e+1]];if(null==r)throw new ae("301",`Export of name '${t[e+1]}' not found!`);n.push(t[e],r)}}}(i,n,o)}return i.mergedAttrs=gi(i.mergedAttrs,i.attrs),r}function hs(e,t,i,n,r,s){const o=s.hostBindings;if(o){let i=e.hostBindingOpCodes;null===i&&(i=e.hostBindingOpCodes=[]);const s=~t.index;(function(e){let t=e.length;for(;t>0;){const i=e[--t];if("number"==typeof i&&i<0)return i}return 0})(i)!=s&&i.push(s),i.push(n,r,o)}}function ps(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function ms(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function gs(e,t,i){if(i){if(t.exportAs)for(let n=0;n<t.exportAs.length;n++)i[t.exportAs[n]]=e;rt(t)&&(i[""]=e)}}function fs(e,t,i){e.flags|=1,e.directiveStart=t,e.directiveEnd=t+i,e.providerIndexes=t}function _s(e,t,i,n,r){e.data[n]=r;const s=r.factory||(r.factory=st(r.type)),o=new hi(s,rt(r),null);e.blueprint[n]=o,i[n]=o,hs(e,t,0,n,Jr(e,i,r.hostVars,zr),r)}function vs(e,t,i){const n=vt(t,e),r=os(i),s=e[10],o=Ss(e,Yr(e,r,null,i.onPush?64:16,n,t,s,s.createRenderer(n,i),null,null));e[t.index]=o}function bs(e,t,i,n,r,s){const o=s[t];if(null!==o){const e=n.setInput;for(let t=0;t<o.length;){const r=o[t++],s=o[t++],a=o[t++];null!==e?n.setInput(i,a,r,s):i[s]=a}}}function ys(e,t){let i=null,n=0;for(;n<t.length;){const r=t[n];if(0!==r)if(5!==r){if("number"==typeof r)break;e.hasOwnProperty(r)&&(null===i&&(i=[]),i.push(r,e[r],t[n+1])),n+=2}else n+=2;else n+=4}return i}function ws(e,t,i,n){return new Array(e,!0,!1,t,null,0,n,i,null,null)}function ks(e,t){const i=wt(t,e);if(St(i)){const e=i[1];80&i[2]?es(e,i,e.template,i[8]):i[5]>0&&function e(t){for(let n=or(t);null!==n;n=ar(n))for(let t=10;t<n.length;t++){const i=n[t];if(1024&i[2]){const e=i[1];es(e,i,e.template,i[8])}else i[5]>0&&e(i)}const i=t[1].components;if(null!==i)for(let n=0;n<i.length;n++){const r=wt(i[n],t);St(r)&&r[5]>0&&e(r)}}(i)}}function Cs(e,t){const i=wt(t,e),n=i[1];!function(e,t){for(let i=t.length;i<e.blueprint.length;i++)t.push(e.blueprint[i])}(n,i),Xr(n,i,i[8])}function Ss(e,t){return e[13]?e[14][4]=t:e[13]=t,e[14]=t,t}function xs(e){for(;e;){e[2]|=64;const t=sr(e);if(0!=(512&e[2])&&!t)return e;e=t}return null}function Es(e,t,i){const n=t[10];n.begin&&n.begin();try{es(e,t,e.template,i)}catch(r){throw Rs(t,r),r}finally{n.end&&n.end()}}function Is(e){!function(e){for(let t=0;t<e.components.length;t++){const i=e.components[t],n=kt(i),r=n[1];ts(r,n,r.template,i)}}(e[8])}function Ps(e,t,i){Wt(0),t(e,i)}const Ds=(()=>Promise.resolve(null))();function Ts(e){return e[7]||(e[7]=[])}function As(e){return e.cleanup||(e.cleanup=[])}function Rs(e,t){const i=e[9],n=i?i.get(Jn,null):null;n&&n.handleError(t)}function Os(e,t,i,n,r){for(let s=0;s<i.length;){const o=i[s++],a=i[s++],c=t[o],l=e.data[o];null!==l.setInput?l.setInput(c,r,n,a):c[a]=r}}function Fs(e,t,i){const n=_t(t,e);!function(e,t,i){mt(e)?e.setValue(t,i):t.textContent=i}(e[11],n,i)}function Bs(e,t,i){let n=i?e.styles:null,r=i?e.classes:null,s=0;if(null!==t)for(let o=0;o<t.length;o++){const e=t[o];"number"==typeof e?s=e:1==s?r=ie(r,e):2==s&&(n=ie(n,e+": "+t[++o]+";"))}i?e.styles=n:e.stylesWithoutHost=n,i?e.classes=r:e.classesWithoutHost=r}const Ms=new Vi("INJECTOR",-1);class Ls{get(e,t=Yi){if(t===Yi){const t=new Error(`NullInjectorError: No provider for ${te(e)}!`);throw t.name="NullInjectorError",t}return t}}const $s=new Vi("Set Injector scope."),js={},zs={},Ns=[];let Vs=void 0;function Hs(){return void 0===Vs&&(Vs=new Ls),Vs}function Us(e,t=null,i=null,n){return new qs(e,i,t||Hs(),n)}class qs{constructor(e,t,i,n=null){this.parent=i,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this._destroyed=!1;const r=[];t&&Hi(t,i=>this.processProvider(i,e,t)),Hi([e],e=>this.processInjectorType(e,[],r)),this.records.set(Ms,Zs(void 0,this));const s=this.records.get($s);this.scope=null!=s?s.value:null,this.source=n||("object"==typeof e?null:te(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=Yi,i=ye.Default){this.assertNotDestroyed();const n=en(this);try{if(!(i&ye.SkipSelf)){let t=this.records.get(e);if(void 0===t){const i=("function"==typeof(r=e)||"object"==typeof r&&r instanceof Vi)&&pe(e);t=i&&this.injectableDefInScope(i)?Zs(Gs(e),js):null,this.records.set(e,t)}if(null!=t)return this.hydrate(e,t)}return(i&ye.Self?Hs():this.parent).get(e,t=i&ye.Optional&&t===Yi?null:t)}catch(s){if("NullInjectorError"===s.name){if((s.ngTempTokenPath=s.ngTempTokenPath||[]).unshift(te(e)),n)throw s;return function(e,t,i,n){const r=e.ngTempTokenPath;throw t.__source&&r.unshift(t.__source),e.message=function(e,t,i,n=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.substr(2):e;let r=te(t);if(Array.isArray(t))r=t.map(te).join(" -> ");else if("object"==typeof t){let e=[];for(let i in t)if(t.hasOwnProperty(i)){let n=t[i];e.push(i+":"+("string"==typeof n?JSON.stringify(n):te(n)))}r=`{${e.join(", ")}}`}return`${i}${n?"("+n+")":""}[${r}]: ${e.replace(Ki,"\n ")}`}("\n"+e.message,r,i,n),e.ngTokenPath=r,e.ngTempTokenPath=null,e}(s,e,"R3InjectorError",this.source)}throw s}finally{en(n)}var r}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((t,i)=>e.push(te(i))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=se(e)))return!1;let n=ge(e);const r=null==n&&e.ngModule||void 0,s=void 0===r?e:r,o=-1!==i.indexOf(s);if(void 0!==r&&(n=ge(r)),null==n)return!1;if(null!=n.imports&&!o){let e;i.push(s);try{Hi(n.imports,n=>{this.processInjectorType(n,t,i)&&(void 0===e&&(e=[]),e.push(n))})}finally{}if(void 0!==e)for(let t=0;t<e.length;t++){const{ngModule:i,providers:n}=e[t];Hi(n,e=>this.processProvider(e,i,n||Ns))}}this.injectorDefTypes.add(s);const a=st(s)||(()=>new s);this.records.set(s,Zs(a,js));const c=n.providers;if(null!=c&&!o){const t=e;Hi(c,e=>this.processProvider(e,t,c))}return void 0!==r&&void 0!==e.providers}processProvider(e,t,i){let n=Ys(e=se(e))?e:se(e&&e.provide);const r=function(e,t,i){return Qs(e)?Zs(void 0,e.useValue):Zs(Ws(e),js)}(e);if(Ys(e)||!0!==e.multi)this.records.get(n);else{let t=this.records.get(n);t||(t=Zs(void 0,js,!0),t.factory=()=>rn(t.multi),this.records.set(n,t)),n=e,t.multi.push(e)}this.records.set(n,r)}hydrate(e,t){var i;return t.value===js&&(t.value=zs,t.value=t.factory()),"object"==typeof t.value&&t.value&&null!==(i=t.value)&&"object"==typeof i&&"function"==typeof i.ngOnDestroy&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){return!!e.providedIn&&("string"==typeof e.providedIn?"any"===e.providedIn||e.providedIn===this.scope:this.injectorDefTypes.has(e.providedIn))}}function Gs(e){const t=pe(e),i=null!==t?t.factory:st(e);if(null!==i)return i;if(e instanceof Vi)throw new Error(`Token ${te(e)} is missing a \u0275prov definition.`);if(e instanceof Function)return function(e){const t=e.length;if(t>0){const i=Gi(t,"?");throw new Error(`Can't resolve all parameters for ${te(e)}: (${i.join(", ")}).`)}const i=function(e){const t=e&&(e[fe]||e[ve]);if(t){const i=function(e){if(e.hasOwnProperty("name"))return e.name;const t=(""+e).match(/^function\s*([^\s(]+)/);return null===t?"":t[1]}(e);return console.warn(`DEPRECATED: DI is instantiating a token "${i}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${i}" class.`),t}return null}(e);return null!==i?()=>i.factory(e):()=>new e}(e);throw new Error("unreachable")}function Ws(e,t,i){let n=void 0;if(Ys(e)){const t=se(e);return st(t)||Gs(t)}if(Qs(e))n=()=>se(e.useValue);else if((r=e)&&r.useFactory)n=()=>e.useFactory(...rn(e.deps||[]));else if(function(e){return!(!e||!e.useExisting)}(e))n=()=>nn(se(e.useExisting));else{const t=se(e&&(e.useClass||e.provide));if(!function(e){return!!e.deps}(e))return st(t)||Gs(t);n=()=>new t(...rn(e.deps))}var r;return n}function Zs(e,t,i=!1){return{factory:e,value:t,multi:i?[]:void 0}}function Qs(e){return null!==e&&"object"==typeof e&&Ji in e}function Ys(e){return"function"==typeof e}const Ks=function(e,t,i){return function(e,t=null,i=null,n){const r=Us(e,t,i,n);return r._resolveInjectorDefTypes(),r}({name:i},t,e,i)};let Js=(()=>{class e{static create(e,t){return Array.isArray(e)?Ks(e,t,""):Ks(e.providers,e.parent,e.name||"")}}return e.THROW_IF_NOT_FOUND=Yi,e.NULL=new Ls,e.\u0275prov=de({token:e,providedIn:"any",factory:()=>nn(Ms)}),e.__NG_ELEMENT_ID__=-1,e})();function Xs(e,t){oi(kt(e)[1],Ot())}function eo(e){let t=Object.getPrototypeOf(e.type.prototype).constructor,i=!0;const n=[e];for(;t;){let r=void 0;if(rt(e))r=t.\u0275cmp||t.\u0275dir;else{if(t.\u0275cmp)throw new Error("Directives cannot inherit Components");r=t.\u0275dir}if(r){if(i){n.push(r);const t=e;t.inputs=to(e.inputs),t.declaredInputs=to(e.declaredInputs),t.outputs=to(e.outputs);const i=r.hostBindings;i&&ro(e,i);const s=r.viewQuery,o=r.contentQueries;if(s&&io(e,s),o&&no(e,o),ee(e.inputs,r.inputs),ee(e.declaredInputs,r.declaredInputs),ee(e.outputs,r.outputs),rt(r)&&r.data.animation){const t=e.data;t.animation=(t.animation||[]).concat(r.data.animation)}}const t=r.features;if(t)for(let n=0;n<t.length;n++){const r=t[n];r&&r.ngInherit&&r(e),r===eo&&(i=!1)}}t=Object.getPrototypeOf(t)}!function(e){let t=0,i=null;for(let n=e.length-1;n>=0;n--){const r=e[n];r.hostVars=t+=r.hostVars,r.hostAttrs=gi(r.hostAttrs,i=gi(i,r.hostAttrs))}}(n)}function to(e){return e===Re?{}:e===Fe?[]:e}function io(e,t){const i=e.viewQuery;e.viewQuery=i?(e,n)=>{t(e,n),i(e,n)}:t}function no(e,t){const i=e.contentQueries;e.contentQueries=i?(e,n,r)=>{t(e,n,r),i(e,n,r)}:t}function ro(e,t){const i=e.hostBindings;e.hostBindings=i?(e,n)=>{t(e,n),i(e,n)}:t}let so=null;function oo(){if(!so){const e=Ae.Symbol;if(e&&e.iterator)so=e.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;t<e.length;++t){const i=e[t];"entries"!==i&&"size"!==i&&Map.prototype[i]===Map.prototype.entries&&(so=i)}}}return so}class ao{constructor(e){this.wrapped=e}static wrap(e){return new ao(e)}static unwrap(e){return ao.isWrapped(e)?e.wrapped:e}static isWrapped(e){return e instanceof ao}}function co(e){return!!lo(e)&&(Array.isArray(e)||!(e instanceof Map)&&oo()in e)}function lo(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function uo(e,t,i){return e[t]=i}function ho(e,t,i){return!Object.is(e[t],i)&&(e[t]=i,!0)}function po(e,t,i,n){const r=ho(e,t,i);return ho(e,t+1,n)||r}function mo(e,t,i,n){const r=Tt();return ho(r,Vt(),t)&&(At(),function(e,t,i,n,r,s){const o=vt(e,t);!function(e,t,i,n,r,s,o){if(null==s)mt(e)?e.removeAttribute(t,r,i):t.removeAttribute(r);else{const a=null==o?ce(s):o(s,n||"",r);mt(e)?e.setAttribute(t,r,a,i):i?t.setAttributeNS(i,r,a):t.setAttribute(r,a)}}(t[11],o,s,e.value,i,n,r)}(ri(),r,e,t,i,n)),mo}function go(e,t,i,n){return ho(e,Vt(),i)?t+ce(i)+n:zr}function fo(e,t,i,n,r,s,o,a){const c=Tt(),l=At(),u=e+20,d=l.firstCreatePass?function(e,t,i,n,r,s,o,a,c){const l=t.consts,u=Kr(t,e,4,o||null,xt(l,a));ds(t,i,u,xt(l,c)),oi(t,u);const d=u.tViews=as(2,u,n,r,s,t.directiveRegistry,t.pipeRegistry,null,t.schemas,l);return null!==t.queries&&(t.queries.template(t,u),d.queries=t.queries.embeddedTView(u)),u}(u,l,c,t,i,n,r,s,o):l.data[u];Bt(d,!1);const h=c[11].createComment("");kr(l,c,h,d),Xn(h,c),Ss(c,c[u]=ws(h,c,h,d)),nt(d)&&rs(l,c,d),null!=o&&ss(c,d,a)}function _o(e){return yt(Pt.lFrame.contextLView,20+e)}function vo(e,t=ye.Default){const i=Tt();return null===i?nn(e,t):Ti(Ot(),i,se(e),t)}function bo(e,t,i){const n=Tt();return ho(n,Vt(),t)&&us(At(),ri(),n,e,t,n[11],i,!1),bo}function yo(e,t,i,n,r){const s=r?"class":"style";Os(e,i,t.inputs[s],s,n)}function wo(e,t,i,n){const r=Tt(),s=At(),o=20+e,a=r[11],c=r[o]=ur(a,t,Pt.lFrame.currentNamespace),l=s.firstCreatePass?function(e,t,i,n,r,s,o){const a=t.consts,c=Kr(t,e,2,r,xt(a,s));return ds(t,i,c,xt(a,o)),null!==c.attrs&&Bs(c,c.attrs,!1),null!==c.mergedAttrs&&Bs(c,c.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,c),c}(o,s,r,0,t,i,n):s.data[o];Bt(l,!0);const u=l.mergedAttrs;null!==u&&pi(a,c,u);const d=l.classes;null!==d&&Pr(a,c,d);const h=l.styles;null!==h&&Ir(a,c,h),64!=(64&l.flags)&&kr(s,r,c,l),0===Pt.lFrame.elementDepthCount&&Xn(c,r),Pt.lFrame.elementDepthCount++,nt(l)&&(rs(s,r,l),ns(s,l,r)),null!==n&&ss(r,l)}function ko(){let e=Ot();Mt()?Lt():(e=e.parent,Bt(e,!1));const t=e;Pt.lFrame.elementDepthCount--;const i=At();i.firstCreatePass&&(oi(i,e),tt(e)&&i.queries.elementEnd(e)),null!=t.classesWithoutHost&&function(e){return 0!=(16&e.flags)}(t)&&yo(i,t,Tt(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function(e){return 0!=(32&e.flags)}(t)&&yo(i,t,Tt(),t.stylesWithoutHost,!1)}function Co(e,t,i,n){wo(e,t,i,n),ko()}function So(e,t,i){const n=Tt(),r=At(),s=e+20,o=r.firstCreatePass?function(e,t,i,n,r){const s=t.consts,o=xt(s,n),a=Kr(t,e,8,"ng-container",o);return null!==o&&Bs(a,o,!0),ds(t,i,a,xt(s,r)),null!==t.queries&&t.queries.elementStart(t,a),a}(s,r,n,t,i):r.data[s];Bt(o,!0);const a=n[s]=n[11].createComment("");kr(r,n,a,o),Xn(a,n),nt(o)&&(rs(r,n,o),ns(r,o,n)),null!=i&&ss(n,o)}function xo(){let e=Ot();const t=At();Mt()?Lt():(e=e.parent,Bt(e,!1)),t.firstCreatePass&&(oi(t,e),tt(e)&&t.queries.elementEnd(e))}function Eo(e,t,i){So(e,t,i),xo()}function Io(){return Tt()}function Po(e){return!!e&&"function"==typeof e.then}function Do(e){return!!e&&"function"==typeof e.subscribe}const To=Do;function Ao(e,t,i=!1,n){const r=Tt(),s=At(),o=Ot();return function(e,t,i,n,r,s,o=!1,a){const c=nt(n),l=e.firstCreatePass&&As(e),u=Ts(t);let d=!0;if(3&n.type){const h=vt(n,t),p=a?a(h):Re,m=p.target||h,g=u.length,f=a?e=>a(ft(e[n.index])).target:n.index;if(mt(i)){let o=null;if(!a&&c&&(o=function(e,t,i,n){const r=e.cleanup;if(null!=r)for(let s=0;s<r.length-1;s+=2){const e=r[s];if(e===i&&r[s+1]===n){const e=t[7],i=r[s+2];return e.length>i?e[i]:null}"string"==typeof e&&(s+=2)}return null}(e,t,r,n.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,d=!1;else{s=Oo(n,t,0,s,!1);const e=i.listen(p.name||m,r,s);u.push(s,e),l&&l.push(r,f,g,g+1)}}else s=Oo(n,t,0,s,!0),m.addEventListener(r,s,o),u.push(s),l&&l.push(r,f,g,o)}else s=Oo(n,t,0,s,!1);const h=n.outputs;let p;if(d&&null!==h&&(p=h[r])){const e=p.length;if(e)for(let i=0;i<e;i+=2){const e=t[p[i]][p[i+1]].subscribe(s),o=u.length;u.push(s,e),l&&l.push(r,n.index,o,-(o+1))}}}(s,r,r[11],o,e,t,i,n),Ao}function Ro(e,t,i,n){try{return!1!==i(n)}catch(r){return Rs(e,r),!1}}function Oo(e,t,i,n,r){return function i(s){if(s===Function)return n;const o=2&e.flags?wt(e.index,t):t;0==(32&t[2])&&xs(o);let a=Ro(t,0,n,s),c=i.__ngNextListenerFn__;for(;c;)a=Ro(t,0,c,s)&&a,c=c.__ngNextListenerFn__;return r&&!1===a&&(s.preventDefault(),s.returnValue=!1),a}}function Fo(e=1){return function(e){return(Pt.lFrame.contextLView=function(e,t){for(;e>0;)t=t[15],e--;return t}(e,Pt.lFrame.contextLView))[8]}(e)}function Bo(e,t){let i=null;const n=function(e){const t=e.attrs;if(null!=t){const e=t.indexOf(5);if(0==(1&e))return t[e+1]}return null}(e);for(let r=0;r<t.length;r++){const s=t[r];if("*"!==s){if(null===n?Mr(e,s,!0):Lr(n,s))return r}else i=r}return i}function Mo(e){const t=Tt()[16][6];if(!t.projection){const i=t.projection=Gi(e?e.length:1,null),n=i.slice();let r=t.child;for(;null!==r;){const t=e?Bo(r,e):0;null!==t&&(n[t]?n[t].projectionNext=r:i[t]=r,n[t]=r),r=r.next}}}function Lo(e,t=0,i){const n=Tt(),r=At(),s=Kr(r,20+e,16,null,i||null);null===s.projection&&(s.projection=t),Lt(),64!=(64&s.flags)&&function(e,t,i){Er(t[11],0,t,i,gr(e,i,t),yr(i.parent||t[6],i,t))}(r,n,s)}function $o(e,t,i){return jo(e,"",t,"",i),$o}function jo(e,t,i,n,r){const s=Tt(),o=go(s,t,i,n);return o!==zr&&us(At(),ri(),s,e,o,s[11],r,!1),jo}function zo(e,t,i,n,r){const s=e[i+1],o=null===t;let a=n?Ur(s):Gr(s),c=!1;for(;0!==a&&(!1===c||o);){const i=e[a+1];No(e[a],t)&&(c=!0,e[a+1]=n?Zr(i):qr(i)),a=n?Ur(i):Gr(i)}c&&(e[i+1]=n?qr(s):Zr(s))}function No(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&Qi(e,t)>=0}function Vo(e,t,i){return Uo(e,t,i,!1),Vo}function Ho(e,t){return Uo(e,t,null,!0),Ho}function Uo(e,t,i,n){const r=Tt(),s=At(),o=Ht(2);s.firstUpdatePass&&function(e,t,i,n){const r=e.data;if(null===r[i+1]){const s=r[ii()],o=function(e,t){return t>=e.expandoStartIndex}(e,i);(function(e,t){return 0!=(e.flags&(t?16:32))})(s,n)&&null===t&&!o&&(t=!1),t=function(e,t,i,n){const r=function(e){const t=Pt.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}(e);let s=n?t.residualClasses:t.residualStyles;if(null===r)0===(n?t.classBindings:t.styleBindings)&&(i=Go(i=qo(null,e,t,i,n),t.attrs,n),s=null);else{const o=t.directiveStylingLast;if(-1===o||e[o]!==r)if(i=qo(r,e,t,i,n),null===s){let i=function(e,t,i){const n=i?t.classBindings:t.styleBindings;if(0!==Gr(n))return e[Ur(n)]}(e,t,n);void 0!==i&&Array.isArray(i)&&(i=qo(null,e,t,i[1],n),i=Go(i,t.attrs,n),function(e,t,i,n){e[Ur(i?t.classBindings:t.styleBindings)]=n}(e,t,n,i))}else s=function(e,t,i){let n=void 0;const r=t.directiveEnd;for(let s=1+t.directiveStylingLast;s<r;s++)n=Go(n,e[s].hostAttrs,i);return Go(n,t.attrs,i)}(e,t,n)}return void 0!==s&&(n?t.residualClasses=s:t.residualStyles=s),i}(r,s,t,n),function(e,t,i,n,r,s){let o=s?t.classBindings:t.styleBindings,a=Ur(o),c=Gr(o);e[n]=i;let l,u=!1;if(Array.isArray(i)){const e=i;l=e[1],(null===l||Qi(e,l)>0)&&(u=!0)}else l=i;if(r)if(0!==c){const t=Ur(e[a+1]);e[n+1]=Hr(t,a),0!==t&&(e[t+1]=Wr(e[t+1],n)),e[a+1]=131071&e[a+1]|n<<17}else e[n+1]=Hr(a,0),0!==a&&(e[a+1]=Wr(e[a+1],n)),a=n;else e[n+1]=Hr(c,0),0===a?a=n:e[c+1]=Wr(e[c+1],n),c=n;u&&(e[n+1]=qr(e[n+1])),zo(e,l,n,!0),zo(e,l,n,!1),function(e,t,i,n,r){const s=r?e.residualClasses:e.residualStyles;null!=s&&"string"==typeof t&&Qi(s,t)>=0&&(i[n+1]=Zr(i[n+1]))}(t,l,e,n,s),o=Hr(a,c),s?t.classBindings=o:t.styleBindings=o}(r,s,t,i,o,n)}}(s,e,o,n),t!==zr&&ho(r,o,t)&&function(e,t,i,n,r,s,o,a){if(!(3&t.type))return;const c=e.data,l=c[a+1];Zo(1==(1&l)?Wo(c,t,i,r,Gr(l),o):void 0)||(Zo(s)||function(e){return 2==(2&e)}(l)&&(s=Wo(c,null,i,r,a,o)),function(e,t,i,n,r){const s=mt(e);if(t)r?s?e.addClass(i,n):i.classList.add(n):s?e.removeClass(i,n):i.classList.remove(n);else{let t=-1===n.indexOf("-")?void 0:nr.DashCase;if(null==r)s?e.removeStyle(i,n,t):i.style.removeProperty(n);else{const o="string"==typeof r&&r.endsWith("!important");o&&(r=r.slice(0,-10),t|=nr.Important),s?e.setStyle(i,n,r,t):i.style.setProperty(n,r,o?"important":"")}}}(n,o,_t(ii(),i),r,s))}(s,s.data[ii()],r,r[11],e,r[o+1]=function(e,t){return null==e||("string"==typeof t?e+=t:"object"==typeof e&&(e=te(bn(e)))),e}(t,i),n,o)}function qo(e,t,i,n,r){let s=null;const o=i.directiveEnd;let a=i.directiveStylingLast;for(-1===a?a=i.directiveStart:a++;a<o&&(s=t[a],n=Go(n,s.hostAttrs,r),s!==e);)a++;return null!==e&&(i.directiveStylingLast=a),n}function Go(e,t,i){const n=i?1:2;let r=-1;if(null!==t)for(let s=0;s<t.length;s++){const o=t[s];"number"==typeof o?r=o:r===n&&(Array.isArray(e)||(e=void 0===e?[]:["",e]),Wi(e,o,!!i||t[++s]))}return void 0===e?null:e}function Wo(e,t,i,n,r,s){const o=null===t;let a=void 0;for(;r>0;){const t=e[r],s=Array.isArray(t),c=s?t[1]:t,l=null===c;let u=i[r+1];u===zr&&(u=l?Oe:void 0);let d=l?Zi(u,n):c===n?u:void 0;if(s&&!Zo(d)&&(d=Zi(t,n)),Zo(d)&&(a=d,o))return a;const h=e[r+1];r=o?Ur(h):Gr(h)}if(null!==t){let e=s?t.residualClasses:t.residualStyles;null!=e&&(a=Zi(e,n))}return a}function Zo(e){return void 0!==e}function Qo(e,t=""){const i=Tt(),n=At(),r=e+20,s=n.firstCreatePass?Kr(n,r,1,t,null):n.data[r],o=i[r]=function(e,t){return mt(e)?e.createText(t):e.createTextNode(t)}(i[11],t);kr(n,i,o,s),Bt(s,!1)}function Yo(e){return Ko("",e,""),Yo}function Ko(e,t,i){const n=Tt(),r=go(n,e,t,i);return r!==zr&&Fs(n,ii(),r),Ko}function Jo(e,t,i,n,r){const s=Tt(),o=function(e,t,i,n,r,s){const o=po(e,Nt(),i,r);return Ht(2),o?t+ce(i)+n+ce(r)+s:zr}(s,e,t,i,n,r);return o!==zr&&Fs(s,ii(),o),Jo}const Xo=void 0;var ea=["en",[["a","p"],["AM","PM"],Xo],[["AM","PM"],Xo,Xo],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Xo,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Xo,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Xo,"{1} 'at' {0}",Xo],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(e){let t=Math.floor(Math.abs(e)),i=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===i?1:5}];let ta={};function ia(e){const t=function(e){return e.toLowerCase().replace(/_/g,"-")}(e);let i=na(t);if(i)return i;const n=t.split("-")[0];if(i=na(n),i)return i;if("en"===n)return ea;throw new Error(`Missing locale data for the locale "${e}".`)}function na(e){return e in ta||(ta[e]=Ae.ng&&Ae.ng.common&&Ae.ng.common.locales&&Ae.ng.common.locales[e]),ta[e]}var ra=function(e){return e[e.LocaleId=0]="LocaleId",e[e.DayPeriodsFormat=1]="DayPeriodsFormat",e[e.DayPeriodsStandalone=2]="DayPeriodsStandalone",e[e.DaysFormat=3]="DaysFormat",e[e.DaysStandalone=4]="DaysStandalone",e[e.MonthsFormat=5]="MonthsFormat",e[e.MonthsStandalone=6]="MonthsStandalone",e[e.Eras=7]="Eras",e[e.FirstDayOfWeek=8]="FirstDayOfWeek",e[e.WeekendRange=9]="WeekendRange",e[e.DateFormat=10]="DateFormat",e[e.TimeFormat=11]="TimeFormat",e[e.DateTimeFormat=12]="DateTimeFormat",e[e.NumberSymbols=13]="NumberSymbols",e[e.NumberFormats=14]="NumberFormats",e[e.CurrencyCode=15]="CurrencyCode",e[e.CurrencySymbol=16]="CurrencySymbol",e[e.CurrencyName=17]="CurrencyName",e[e.Currencies=18]="Currencies",e[e.Directionality=19]="Directionality",e[e.PluralCase=20]="PluralCase",e[e.ExtraData=21]="ExtraData",e}({});let sa="en-US";function oa(e){var t,i;i="Expected localeId to be defined",null==(t=e)&&function(e,t,i,n){throw new Error("ASSERTION ERROR: "+e+` [Expected=> null != ${t} <=Actual]`)}(i,t),"string"==typeof e&&(sa=e.toLowerCase().replace(/_/g,"-"))}function aa(e,t,i,n,r){if(e=se(e),Array.isArray(e))for(let s=0;s<e.length;s++)aa(e[s],t,i,n,r);else{const s=At(),o=Tt();let a=Ys(e)?e:se(e.provide),c=Ws(e);const l=Ot(),u=1048575&l.providerIndexes,d=l.directiveStart,h=l.providerIndexes>>20;if(Ys(e)||!e.multi){const n=new hi(c,r,vo),p=ua(a,t,r?u:u+h,d);-1===p?(Ii(Ci(l,o),s,a),ca(s,e,t.length),t.push(a),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),i.push(n),o.push(n)):(i[p]=n,o[p]=n)}else{const p=ua(a,t,u+h,d),m=ua(a,t,u,u+h),g=p>=0&&i[p],f=m>=0&&i[m];if(r&&!f||!r&&!g){Ii(Ci(l,o),s,a);const u=function(e,t,i,n,r){const s=new hi(e,i,vo);return s.multi=[],s.index=t,s.componentProviders=0,la(s,r,n&&!i),s}(r?ha:da,i.length,r,n,c);!r&&f&&(i[m].providerFactory=u),ca(s,e,t.length,0),t.push(a),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),i.push(u),o.push(u)}else ca(s,e,p>-1?p:m,la(i[r?m:p],c,!r&&n));!r&&n&&f&&i[m].componentProviders++}}}function ca(e,t,i,n){const r=Ys(t);if(r||t.useClass){const s=(t.useClass||t).prototype.ngOnDestroy;if(s){const o=e.destroyHooks||(e.destroyHooks=[]);if(!r&&t.multi){const e=o.indexOf(i);-1===e?o.push(i,[n,s]):o[e+1].push(n,s)}else o.push(i,s)}}}function la(e,t,i){return i&&e.componentProviders++,e.multi.push(t)-1}function ua(e,t,i,n){for(let r=i;r<n;r++)if(t[r]===e)return r;return-1}function da(e,t,i,n){return pa(this.multi,[])}function ha(e,t,i,n){const r=this.multi;let s;if(this.providerFactory){const e=this.providerFactory.componentProviders,t=Bi(i,i[1],this.providerFactory.index,n);s=t.slice(0,e),pa(r,s);for(let i=e;i<t.length;i++)s.push(t[i])}else s=[],pa(r,s);return s}function pa(e,t){for(let i=0;i<e.length;i++)t.push((0,e[i])());return t}function ma(e,t=[]){return i=>{i.providersResolver=(i,n)=>function(e,t,i){const n=At();if(n.firstCreatePass){const r=rt(e);aa(i,n.data,n.blueprint,r,!0),aa(t,n.data,n.blueprint,r,!1)}}(i,n?n(e):e,t)}}class ga{}class fa{resolveComponentFactory(e){throw function(e){const t=Error(`No component factory found for ${te(e)}. Did you add it to @NgModule.entryComponents?`);return t.ngComponent=e,t}(e)}}let _a=(()=>{class e{}return e.NULL=new fa,e})();function va(...e){}function ba(e,t){return new wa(vt(e,t))}const ya=function(){return ba(Ot(),Tt())};let wa=(()=>{class e{constructor(e){this.nativeElement=e}}return e.__NG_ELEMENT_ID__=ya,e})();function ka(e){return e instanceof wa?e.nativeElement:e}class Ca{}let Sa=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>xa(),e})();const xa=function(){const e=Tt(),t=wt(Ot().index,e);return function(e){return e[11]}(Xe(t)?t:e)};let Ea=(()=>{class e{}return e.\u0275prov=de({token:e,providedIn:"root",factory:()=>null}),e})();class Ia{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const Pa=new Ia("11.2.14");class Da{constructor(){}supports(e){return co(e)}create(e){return new Aa(e)}}const Ta=(e,t)=>t;class Aa{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||Ta}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,n=0,r=null;for(;t||i;){const s=!i||t&&t.currentIndex<Ba(i,n,r)?t:i,o=Ba(s,n,r),a=s.currentIndex;if(s===i)n--,i=i._nextRemoved;else if(t=t._next,null==s.previousIndex)n++;else{r||(r=[]);const e=o-n,t=a-n;if(e!=t){for(let i=0;i<e;i++){const n=i<r.length?r[i]:r[i]=0,s=n+i;t<=s&&s<e&&(r[i]=n+1)}r[s.previousIndex]=t-e}}o!==a&&e(s,o,a)}}forEachPreviousItem(e){let t;for(t=this._previousItHead;null!==t;t=t._nextPrevious)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachMovedItem(e){let t;for(t=this._movesHead;null!==t;t=t._nextMoved)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}forEachIdentityChange(e){let t;for(t=this._identityChangesHead;null!==t;t=t._nextIdentityChange)e(t)}diff(e){if(null==e&&(e=[]),!co(e))throw new Error(`Error trying to diff '${te(e)}'. Only arrays and iterables are allowed`);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t,i,n,r=this._itHead,s=!1;if(Array.isArray(e)){this.length=e.length;for(let t=0;t<this.length;t++)i=e[t],n=this._trackByFn(t,i),null!==r&&Object.is(r.trackById,n)?(s&&(r=this._verifyReinsertion(r,i,n,t)),Object.is(r.item,i)||this._addIdentityChange(r,i)):(r=this._mismatch(r,i,n,t),s=!0),r=r._next}else t=0,function(e,t){if(Array.isArray(e))for(let i=0;i<e.length;i++)t(e[i]);else{const i=e[oo()]();let n;for(;!(n=i.next()).done;)t(n.value)}}(e,e=>{n=this._trackByFn(t,e),null!==r&&Object.is(r.trackById,n)?(s&&(r=this._verifyReinsertion(r,e,n,t)),Object.is(r.item,e)||this._addIdentityChange(r,e)):(r=this._mismatch(r,e,n,t),s=!0),r=r._next,t++}),this.length=t;return this._truncate(r),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,n){let r;return null===e?r=this._itTail:(r=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,r,n)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,n))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,r,n)):e=this._addAfter(new Ra(t,i),r,n),e}_verifyReinsertion(e,t,i,n){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==r?e=this._reinsertAfter(r,e._prev,n):e.currentIndex!=n&&(e.currentIndex=n,this._addToMoves(e,n)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const n=e._prevRemoved,r=e._nextRemoved;return null===n?this._removalsHead=r:n._nextRemoved=r,null===r?this._removalsTail=n:r._prevRemoved=n,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const n=null===t?this._itHead:t._next;return e._next=n,e._prev=t,null===n?this._itTail=e:n._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new Fa),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new Fa),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class Ra{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Oa{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class Fa{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new Oa,this.map.set(t,i)),i.add(e)}get(e,t){const i=this.map.get(e);return i?i.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Ba(e,t,i){const n=e.previousIndex;if(null===n)return n;let r=0;return i&&n<i.length&&(r=i[n]),n+t+r}class Ma{constructor(){}supports(e){return e instanceof Map||lo(e)}create(){return new La}}class La{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead}forEachItem(e){let t;for(t=this._mapHead;null!==t;t=t._next)e(t)}forEachPreviousItem(e){let t;for(t=this._previousMapHead;null!==t;t=t._nextPrevious)e(t)}forEachChangedItem(e){let t;for(t=this._changesHead;null!==t;t=t._nextChanged)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}diff(e){if(e){if(!(e instanceof Map||lo(e)))throw new Error(`Error trying to diff '${te(e)}'. Only maps and objects are allowed`)}else e=new Map;return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t=this._mapHead;if(this._appendAfter=null,this._forEach(e,(e,i)=>{if(t&&t.key===i)this._maybeAddToChanges(t,e),this._appendAfter=t,t=t._next;else{const n=this._getOrCreateRecordForKey(i,e);t=this._insertBeforeOrAppend(t,n)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let e=t;null!==e;e=e._nextRemoved)e===this._mapHead&&(this._mapHead=null),this._records.delete(e.key),e._nextRemoved=e._next,e.previousValue=e.currentValue,e.currentValue=null,e._prev=null,e._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const i=this._records.get(e);this._maybeAddToChanges(i,t);const n=i._prev,r=i._next;return n&&(n._next=r),r&&(r._prev=n),i._next=null,i._prev=null,i}const i=new $a(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class $a{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function ja(){return new za([new Da])}let za=(()=>{class e{constructor(e){this.factories=e}static create(t,i){if(null!=i){const e=i.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:i=>e.create(t,i||ja()),deps:[[e,new cn,new an]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(null!=t)return t;throw new Error(`Cannot find a differ supporting object '${e}' of type '${i=e,i.name||typeof i}'`);var i}}return e.\u0275prov=de({token:e,providedIn:"root",factory:ja}),e})();function Na(){return new Va([new Ma])}let Va=(()=>{class e{constructor(e){this.factories=e}static create(t,i){if(i){const e=i.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:i=>e.create(t,i||Na()),deps:[[e,new cn,new an]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(t)return t;throw new Error(`Cannot find a differ supporting object '${e}'`)}}return e.\u0275prov=de({token:e,providedIn:"root",factory:Na}),e})();class Ha{constructor(e,t){this._lView=e,this._cdRefInjectingView=t,this._appRef=null,this._attachedToViewContainer=!1}get rootNodes(){const e=this._lView,t=e[1];return function e(t,i,n,r,s=!1){for(;null!==n;){const o=i[n.index];if(null!==o&&r.push(ft(o)),et(o))for(let t=10;t<o.length;t++){const i=o[t],n=i[1].firstChild;null!==n&&e(i[1],i,n,r)}const a=n.type;if(8&a)e(t,i,n.child,r);else if(32&a){const e=rr(n,i);let t;for(;t=e();)r.push(t)}else if(16&a){const t=Cr(i,n);if(Array.isArray(t))r.push(...t);else{const n=sr(i[16]);e(n[1],n,t,r,!0)}}n=s?n.projectionNext:n.next}return r}(t,e,t.firstChild,[])}get context(){return this._lView[8]}get destroyed(){return 256==(256&this._lView[2])}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){const e=this._lView[3];if(et(e)){const t=e[8],i=t?t.indexOf(this):-1;i>-1&&(hr(e,i),qi(t,i))}this._attachedToViewContainer=!1}pr(this._lView[1],this._lView)}onDestroy(e){cs(this._lView[1],this._lView,null,e)}markForCheck(){xs(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Es(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(e,t,i){jt(!0);try{Es(e,t,i)}finally{jt(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){var e;this._appRef=null,xr(this._lView[1],e=this._lView,e[11],2,null,null)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class Ua extends Ha{constructor(e){super(e),this._view=e}detectChanges(){Is(this._view)}checkNoChanges(){!function(e){jt(!0);try{Is(e)}finally{jt(!1)}}(this._view)}get context(){return null}}const qa=Wa;let Ga=(()=>{class e{}return e.__NG_ELEMENT_ID__=qa,e.__ChangeDetectorRef__=!0,e})();function Wa(e=!1){return function(e,t,i){if(!i&&it(e)){const i=wt(e.index,t);return new Ha(i,i)}return 47&e.type?new Ha(t[16],t):null}(Ot(),Tt(),e)}const Za=[new Ma],Qa=new za([new Da]),Ya=new Va(Za),Ka=function(){return tc(Ot(),Tt())};let Ja=(()=>{class e{}return e.__NG_ELEMENT_ID__=Ka,e})();const Xa=Ja,ec=class extends Xa{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=Yr(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const n=this._declarationLView[19];return null!==n&&(i[19]=n.createEmbeddedView(t)),Xr(t,i,e),new Ha(i)}};function tc(e,t){return 4&e.type?new ec(t,e,ba(e,t)):null}class ic{}const nc=function(){return lc(Ot(),Tt())};let rc=(()=>{class e{}return e.__NG_ELEMENT_ID__=nc,e})();const sc=rc,oc=class extends sc{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return ba(this._hostTNode,this._hostLView)}get injector(){return new $i(this._hostTNode,this._hostLView)}get parentInjector(){const e=Ei(this._hostTNode,this._hostLView);if(_i(e)){const t=bi(e,this._hostLView),i=vi(e);return new $i(t[1].data[i+8],t)}return new $i(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=ac(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const n=e.createEmbeddedView(t||{});return this.insert(n,i),n}createComponent(e,t,i,n,r){const s=i||this.parentInjector;if(!r&&null==e.ngModule&&s){const e=s.get(ic,null);e&&(r=e)}const o=e.create(s,n,void 0,r);return this.insert(o.hostView,t),o}insert(e,t){const i=e._lView,n=i[1];if(et(i[3])){const t=this.indexOf(e);if(-1!==t)this.detach(t);else{const t=i[3],n=new oc(t,t[6],t[3]);n.detach(n.indexOf(e))}}const r=this._adjustIndex(t),s=this._lContainer;!function(e,t,i,n){const r=10+n,s=i.length;n>0&&(i[r-1][4]=t),n<s-10?(t[4]=i[r],Ui(i,10+n,t)):(i.push(t),t[4]=null),t[3]=i;const o=t[17];null!==o&&i!==o&&function(e,t){const i=e[9];t[16]!==t[3][3][16]&&(e[2]=!0),null===i?e[9]=[t]:i.push(t)}(o,t);const a=t[19];null!==a&&a.insertView(e),t[2]|=128}(n,i,s,r);const o=function e(t,i){const n=10+t+1;if(n<i.length){const t=i[n],r=t[1].firstChild;if(null!==r)return function t(i,n){if(null!==n){const r=n.type;if(3&r)return vt(n,i);if(4&r)return e(-1,i[n.index]);if(8&r){const r=n.child;if(null!==r)return t(i,r);{const t=i[n.index];return et(t)?e(-1,t):ft(t)}}if(32&r)return rr(n,i)()||ft(i[n.index]);{const e=Cr(i,n);return null!==e?Array.isArray(e)?e[0]:t(sr(i[16]),e):t(i,n.next)}}return null}(t,r)}return i[7]}(r,s),a=i[11],c=br(a,s[7]);return null!==c&&function(e,t,i,n,r,s){n[0]=r,n[6]=t,xr(e,n,i,1,r,s)}(n,s[6],a,i,c,o),e.attachToViewContainerRef(),Ui(cc(s),r,e),e}move(e,t){return this.insert(e,t)}indexOf(e){const t=ac(this._lContainer);return null!==t?t.indexOf(e):-1}remove(e){const t=this._adjustIndex(e,-1),i=hr(this._lContainer,t);i&&(qi(cc(this._lContainer),t),pr(i[1],i))}detach(e){const t=this._adjustIndex(e,-1),i=hr(this._lContainer,t);return i&&null!=qi(cc(this._lContainer),t)?new Ha(i):null}_adjustIndex(e,t=0){return null==e?this.length+t:e}};function ac(e){return e[8]}function cc(e){return e[8]||(e[8]=[])}function lc(e,t){let i;const n=t[e.index];if(et(n))i=n;else{let r;if(8&e.type)r=ft(n);else{const i=t[11];r=i.createComment("");const n=vt(e,t);fr(i,br(i,n),r,function(e,t){return mt(e)?e.nextSibling(t):t.nextSibling}(i,n),!1)}t[e.index]=i=ws(n,t,r,e),Ss(t,i)}return new oc(i,e,t)}const uc={};class dc extends _a{constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){const t=Ke(e);return new mc(t,this.ngModule)}}function hc(e){const t=[];for(let i in e)e.hasOwnProperty(i)&&t.push({propName:e[i],templateName:i});return t}const pc=new Vi("SCHEDULER_TOKEN",{providedIn:"root",factory:()=>er});class mc extends ga{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=e.selectors.map(jr).join(","),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return hc(this.componentDef.inputs)}get outputs(){return hc(this.componentDef.outputs)}create(e,t,i,n){const r=(n=n||this.ngModule)?function(e,t){return{get:(i,n,r)=>{const s=e.get(i,uc,r);return s!==uc||n===uc?s:t.get(i,n,r)}}}(e,n.injector):e,s=r.get(Ca,gt),o=r.get(Ea,null),a=s.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",l=i?function(e,t,i){if(mt(e))return e.selectRootElement(t,i===Ee.ShadowDom);let n="string"==typeof t?e.querySelector(t):t;return n.textContent="",n}(a,i,this.componentDef.encapsulation):ur(s.createRenderer(null,this.componentDef),c,function(e){const t=e.toLowerCase();return"svg"===t?"http://www.w3.org/2000/svg":"math"===t?"http://www.w3.org/1998/MathML/":null}(c)),u=this.componentDef.onPush?576:528,d={components:[],scheduler:er,clean:Ds,playerHandler:null,flags:0},h=as(0,null,null,1,0,null,null,null,null,null),p=Yr(null,h,d,u,null,null,s,a,o,r);let m,g;Yt(p);try{const e=function(e,t,i,n,r,s){const o=i[1];i[20]=e;const a=Kr(o,20,2,"#host",null),c=a.mergedAttrs=t.hostAttrs;null!==c&&(Bs(a,c,!0),null!==e&&(pi(r,e,c),null!==a.classes&&Pr(r,e,a.classes),null!==a.styles&&Ir(r,e,a.styles)));const l=n.createRenderer(e,t),u=Yr(i,os(t),null,t.onPush?64:16,i[20],a,n,l,null,null);return o.firstCreatePass&&(Ii(Ci(a,i),o,t.type),ms(o,a),fs(a,i.length,1)),Ss(i,u),i[20]=u}(l,this.componentDef,p,s,a);if(l)if(i)pi(a,l,["ng-version",Pa.full]);else{const{attrs:e,classes:t}=function(e){const t=[],i=[];let n=1,r=2;for(;n<e.length;){let s=e[n];if("string"==typeof s)2===r?""!==s&&t.push(s,e[++n]):8===r&&i.push(s);else{if(!Fr(r))break;r=s}n++}return{attrs:t,classes:i}}(this.componentDef.selectors[0]);e&&pi(a,l,e),t&&t.length>0&&Pr(a,l,t.join(" "))}if(g=bt(h,20),void 0!==t){const e=g.projection=[];for(let i=0;i<this.ngContentSelectors.length;i++){const n=t[i];e.push(null!=n?Array.from(n):null)}}m=function(e,t,i,n,r){const s=i[1],o=function(e,t,i){const n=Ot();e.firstCreatePass&&(i.providersResolver&&i.providersResolver(i),_s(e,n,t,Jr(e,t,1,null),i));const r=Bi(t,e,n.directiveStart,n);Xn(r,t);const s=vt(n,t);return s&&Xn(s,t),r}(s,i,t);if(n.components.push(o),e[8]=o,r&&r.forEach(e=>e(o,t)),t.contentQueries){const e=Ot();t.contentQueries(1,o,e.directiveStart)}const a=Ot();return!s.firstCreatePass||null===t.hostBindings&&null===t.hostAttrs||(ni(a.index),hs(i[1],a,0,a.directiveStart,a.directiveEnd,t),ps(t,o)),o}(e,this.componentDef,p,d,[Xs]),Xr(h,p,null)}finally{ti()}return new gc(this.componentType,m,ba(g,p),p,g)}}class gc extends class{}{constructor(e,t,i,n,r){super(),this.location=i,this._rootLView=n,this._tNode=r,this.instance=t,this.hostView=this.changeDetectorRef=new Ua(n),this.componentType=e}get injector(){return new $i(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const fc=new Map;class _c extends ic{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new dc(this);const i=Je(e),n=e[je]||null;n&&oa(n),this._bootstrapComponents=ir(i.bootstrap),this._r3Injector=Us(e,t,[{provide:ic,useValue:this},{provide:_a,useValue:this.componentFactoryResolver}],te(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Js.THROW_IF_NOT_FOUND,i=ye.Default){return e===Js||e===ic||e===Ms?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(e=>e()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class vc extends class{}{constructor(e){super(),this.moduleType=e,null!==Je(e)&&function(e){const t=new Set;!function e(i){const n=Je(i,!0),r=n.id;null!==r&&(function(e,t,i){if(t&&t!==i)throw new Error(`Duplicate module registered for ${e} - ${te(t)} vs ${te(t.name)}`)}(r,fc.get(r),i),fc.set(r,i));const s=ir(n.imports);for(const o of s)t.has(o)||(t.add(o),e(o))}(e)}(e)}create(e){return new _c(this.moduleType,e)}}function bc(e,t,i,n){return Sc(Tt(),zt(),e,t,i,n)}function yc(e,t,i,n,r){return xc(Tt(),zt(),e,t,i,n,r)}function wc(e,t,i,n,r,s){return function(e,t,i,n,r,s,o,a){const c=t+i;return function(e,t,i,n,r){const s=po(e,t,i,n);return ho(e,t+2,r)||s}(e,c,r,s,o)?uo(e,c+3,a?n.call(a,r,s,o):n(r,s,o)):Cc(e,c+3)}(Tt(),zt(),e,t,i,n,r,s)}function kc(e,t,i,n,r,s,o,a){const c=zt()+e,l=Tt(),u=function(e,t,i,n,r,s){const o=po(e,t,i,n);return po(e,t+2,r,s)||o}(l,c,i,n,r,s);return ho(l,c+4,o)||u?uo(l,c+5,a?t.call(a,i,n,r,s,o):t(i,n,r,s,o)):function(e,t){return e[t]}(l,c+5)}function Cc(e,t){const i=e[t];return i===zr?void 0:i}function Sc(e,t,i,n,r,s){const o=t+i;return ho(e,o,r)?uo(e,o+1,s?n.call(s,r):n(r)):Cc(e,o+1)}function xc(e,t,i,n,r,s,o){const a=t+i;return po(e,a,r,s)?uo(e,a+2,o?n.call(o,r,s):n(r,s)):Cc(e,a+2)}function Ec(e,t){const i=At();let n;const r=e+20;i.firstCreatePass?(n=function(e,t){if(t)for(let i=t.length-1;i>=0;i--){const n=t[i];if(e===n.name)return n}throw new ae("302",`The pipe '${e}' could not be found!`)}(t,i.pipeRegistry),i.data[r]=n,n.onDestroy&&(i.destroyHooks||(i.destroyHooks=[])).push(r,n.onDestroy)):n=i.data[r];const s=n.factory||(n.factory=st(n.type)),o=ke(vo);try{const e=wi(!1),t=s();return wi(e),function(e,t,i,n){i>=e.data.length&&(e.data[i]=null,e.blueprint[i]=null),t[i]=n}(i,Tt(),r,t),t}finally{ke(o)}}function Ic(e,t,i){const n=e+20,r=Tt(),s=yt(r,n);return Tc(r,Dc(r,n)?Sc(r,zt(),t,s.transform,i,s):s.transform(i))}function Pc(e,t,i,n){const r=e+20,s=Tt(),o=yt(s,r);return Tc(s,Dc(s,r)?xc(s,zt(),t,o.transform,i,n,o):o.transform(i,n))}function Dc(e,t){return e[1].data[t].pure}function Tc(e,t){return ao.isWrapped(t)&&(t=ao.unwrap(t),e[Nt()]=zr),t}function Ac(e){return t=>{setTimeout(e,void 0,t)}}const Rc=class extends C{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var n,r,s;let o=e,a=t||(()=>null),c=i;if(e&&"object"==typeof e){const t=e;o=null===(n=t.next)||void 0===n?void 0:n.bind(t),a=null===(r=t.error)||void 0===r?void 0:r.bind(t),c=null===(s=t.complete)||void 0===s?void 0:s.bind(t)}this.__isAsync&&(a=Ac(a),o&&(o=Ac(o)),c&&(c=Ac(c)));const l=super.subscribe({next:o,error:a,complete:c});return e instanceof d&&e.add(l),l}};function Oc(){return this._results[oo()]()}class Fc{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=oo(),i=Fc.prototype;i[t]||(i[t]=Oc)}get changes(){return this._changes||(this._changes=new Rc)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){this.dirty=!1;const i=function e(t,i){void 0===i&&(i=t);for(let n=0;n<t.length;n++){let r=t[n];Array.isArray(r)?(i===t&&(i=t.slice(0,n)),e(r,i)):i!==t&&i.push(r)}return i}(e);(this._changesDetected=!function(e,t,i){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],s=t[n];if(i&&(r=i(r),s=i(s)),s!==r)return!1}return!0}(this._results,i,t))&&(this._results=i,this.length=i.length,this.last=i[this.length-1],this.first=i[0])}notifyOnChanges(){!this._changes||!this._changesDetected&&this._emitDistinctChangesOnly||this._changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}class Bc{constructor(e){this.queryList=e,this.matches=null}clone(){return new Bc(this.queryList)}setDirty(){this.queryList.setDirty()}}class Mc{constructor(e=[]){this.queries=e}createEmbeddedView(e){const t=e.queries;if(null!==t){const i=null!==e.contentQueries?e.contentQueries[0]:t.length,n=[];for(let e=0;e<i;e++){const i=t.getByIndex(e);n.push(this.queries[i.indexInDeclarationView].clone())}return new Mc(n)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let t=0;t<this.queries.length;t++)null!==Gc(e,t).matches&&this.queries[t].setDirty()}}class Lc{constructor(e,t,i=null){this.predicate=e,this.flags=t,this.read=i}}class $c{constructor(e=[]){this.queries=e}elementStart(e,t){for(let i=0;i<this.queries.length;i++)this.queries[i].elementStart(e,t)}elementEnd(e){for(let t=0;t<this.queries.length;t++)this.queries[t].elementEnd(e)}embeddedTView(e){let t=null;for(let i=0;i<this.length;i++){const n=null!==t?t.length:0,r=this.getByIndex(i).embeddedTView(e,n);r&&(r.indexInDeclarationView=i,null!==t?t.push(r):t=[r])}return null!==t?new $c(t):null}template(e,t){for(let i=0;i<this.queries.length;i++)this.queries[i].template(e,t)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}}class jc{constructor(e,t=-1){this.metadata=e,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=t}elementStart(e,t){this.isApplyingToNode(t)&&this.matchTNode(e,t)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,t){this.elementStart(e,t)}embeddedTView(e,t){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,t),new jc(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&1!=(1&this.metadata.flags)){const t=this._declarationNodeIndex;let i=e.parent;for(;null!==i&&8&i.type&&i.index!==t;)i=i.parent;return t===(null!==i?i.index:-1)}return this._appliesToNextNode}matchTNode(e,t){const i=this.metadata.predicate;if(Array.isArray(i))for(let n=0;n<i.length;n++){const r=i[n];this.matchTNodeWithReadOption(e,t,zc(t,r)),this.matchTNodeWithReadOption(e,t,Fi(t,e,r,!1,!1))}else i===Ja?4&t.type&&this.matchTNodeWithReadOption(e,t,-1):this.matchTNodeWithReadOption(e,t,Fi(t,e,i,!1,!1))}matchTNodeWithReadOption(e,t,i){if(null!==i){const n=this.metadata.read;if(null!==n)if(n===wa||n===rc||n===Ja&&4&t.type)this.addMatch(t.index,-2);else{const i=Fi(t,e,n,!1,!1);null!==i&&this.addMatch(t.index,i)}else this.addMatch(t.index,i)}}addMatch(e,t){null===this.matches?this.matches=[e,t]:this.matches.push(e,t)}}function zc(e,t){const i=e.localNames;if(null!==i)for(let n=0;n<i.length;n+=2)if(i[n]===t)return i[n+1];return null}function Nc(e,t,i,n){return-1===i?function(e,t){return 11&e.type?ba(e,t):4&e.type?tc(e,t):null}(t,e):-2===i?function(e,t,i){return i===wa?ba(t,e):i===Ja?tc(t,e):i===rc?lc(t,e):void 0}(e,t,n):Bi(e,e[1],i,t)}function Vc(e,t,i,n){const r=t[19].queries[n];if(null===r.matches){const n=e.data,s=i.matches,o=[];for(let e=0;e<s.length;e+=2){const r=s[e];o.push(r<0?null:Nc(t,n[r],s[e+1],i.metadata.read))}r.matches=o}return r.matches}function Hc(e){const t=Tt(),i=At(),n=Gt();Wt(n+1);const r=Gc(i,n);if(e.dirty&&Ct(t)===(2==(2&r.metadata.flags))){if(null===r.matches)e.reset([]);else{const s=r.crossesNgTemplate?function e(t,i,n,r){const s=t.queries.getByIndex(n),o=s.matches;if(null!==o){const a=Vc(t,i,s,n);for(let t=0;t<o.length;t+=2){const n=o[t];if(n>0)r.push(a[t/2]);else{const s=o[t+1],a=i[-n];for(let t=10;t<a.length;t++){const i=a[t];i[17]===i[3]&&e(i[1],i,s,r)}if(null!==a[9]){const t=a[9];for(let i=0;i<t.length;i++){const n=t[i];e(n[1],n,s,r)}}}}}return r}(i,t,n,[]):Vc(i,t,r,n);e.reset(s,ka),e.notifyOnChanges()}return!0}return!1}function Uc(e,t,i){const n=At();n.firstCreatePass&&(function(e,t,i){null===e.queries&&(e.queries=new $c),e.queries.track(new jc(t,-1))}(n,new Lc(e,t,i)),2==(2&t)&&(n.staticViewQueries=!0)),function(e,t,i){const n=new Fc(4==(4&i));cs(e,t,n,n.destroy),null===t[19]&&(t[19]=new Mc),t[19].queries.push(new Bc(n))}(n,Tt(),t)}function qc(){return e=Tt(),t=Gt(),e[19].queries[t].queryList;var e,t}function Gc(e,t){return e.queries.getByIndex(t)}function Wc(e,t){return tc(e,t)}const Zc=new Vi("Application Initializer");let Qc=(()=>{class e{constructor(e){this.appInits=e,this.resolve=va,this.reject=va,this.initialized=!1,this.done=!1,this.donePromise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}runInitializers(){if(this.initialized)return;const e=[],t=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let i=0;i<this.appInits.length;i++){const t=this.appInits[i]();Po(t)&&e.push(t)}Promise.all(e).then(()=>{t()}).catch(e=>{this.reject(e)}),0===e.length&&t(),this.initialized=!0}}return e.\u0275fac=function(t){return new(t||e)(nn(Zc,8))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const Yc=new Vi("AppId"),Kc={provide:Yc,useFactory:function(){return`${Jc()}${Jc()}${Jc()}`},deps:[]};function Jc(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const Xc=new Vi("Platform Initializer"),el=new Vi("Platform ID"),tl=new Vi("appBootstrapListener");let il=(()=>{class e{log(e){console.log(e)}warn(e){console.warn(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const nl=new Vi("LocaleId"),rl=new Vi("DefaultCurrencyCode");class sl{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const ol=function(e){return new vc(e)},al=ol,cl=function(e){return Promise.resolve(ol(e))},ll=function(e){const t=ol(e),i=ir(Je(e).declarations).reduce((e,t)=>{const i=Ke(t);return i&&e.push(new mc(i)),e},[]);return new sl(t,i)},ul=ll,dl=function(e){return Promise.resolve(ll(e))};let hl=(()=>{class e{constructor(){this.compileModuleSync=al,this.compileModuleAsync=cl,this.compileModuleAndAllComponentsSync=ul,this.compileModuleAndAllComponentsAsync=dl}clearCache(){}clearCacheFor(e){}getModuleId(e){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const pl=(()=>Promise.resolve(0))();function ml(e){"undefined"==typeof Zone?pl.then(()=>{e&&e.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",e)}class gl{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Rc(!1),this.onMicrotaskEmpty=new Rc(!1),this.onStable=new Rc(!1),this.onError=new Rc(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched(),this._nesting=0,this._outer=this._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(this._inner=this._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(this._inner=this._inner.fork(Zone.longStackTraceZoneSpec)),this.shouldCoalesceEventChangeDetection=!i&&t,this.shouldCoalesceRunChangeDetection=i,this.lastRequestAnimationFrameId=-1,this.nativeRequestAnimationFrame=function(){let e=Ae.requestAnimationFrame,t=Ae.cancelAnimationFrame;if("undefined"!=typeof Zone&&e&&t){const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i);const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n)}return{nativeRequestAnimationFrame:e,nativeCancelAnimationFrame:t}}().nativeRequestAnimationFrame,function(e){const t=()=>{!function(e){-1===e.lastRequestAnimationFrameId&&(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(Ae,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,vl(e),_l(e)},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),vl(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(i,n,r,s,o,a)=>{try{return bl(e),i.invokeTask(r,s,o,a)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||e.shouldCoalesceRunChangeDetection)&&t(),yl(e)}},onInvoke:(i,n,r,s,o,a,c)=>{try{return bl(e),i.invoke(r,s,o,a,c)}finally{e.shouldCoalesceRunChangeDetection&&t(),yl(e)}},onHasTask:(t,i,n,r)=>{t.hasTask(n,r),i===n&&("microTask"==r.change?(e._hasPendingMicrotasks=r.microTask,vl(e),_l(e)):"macroTask"==r.change&&(e.hasPendingMacrotasks=r.macroTask))},onHandleError:(t,i,n,r)=>(t.handleError(n,r),e.runOutsideAngular(()=>e.onError.emit(r)),!1)})}(this)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!gl.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(gl.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,n){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+n,e,fl,va,va);try{return r.runTask(s,t,i)}finally{r.cancelTask(s)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const fl={};function _l(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function vl(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function bl(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function yl(e){e._nesting--,_l(e)}class wl{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Rc,this.onMicrotaskEmpty=new Rc,this.onStable=new Rc,this.onError=new Rc}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,n){return e.apply(t,i)}}let kl=(()=>{class e{constructor(e){this._ngZone=e,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),e.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{gl.assertNotInAngularZone(),ml(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())ml(()=>{for(;0!==this._callbacks.length;){let e=this._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb(this._didWork)}this._didWork=!1});else{let e=this.getPendingTasks();this._callbacks=this._callbacks.filter(t=>!t.updateCb||!t.updateCb(e)||(clearTimeout(t.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(e=>({source:e.source,creationLocation:e.creationLocation,data:e.data})):[]}addCallback(e,t,i){let n=-1;t&&t>0&&(n=setTimeout(()=>{this._callbacks=this._callbacks.filter(e=>e.timeoutId!==n),e(this._didWork,this.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:n,updateCb:i})}whenStable(e,t,i){if(i&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(e,t,i),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(e,t,i){return[]}}return e.\u0275fac=function(t){return new(t||e)(nn(gl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Cl=(()=>{class e{constructor(){this._applications=new Map,El.addToWindow(this)}registerApplication(e,t){this._applications.set(e,t)}unregisterApplication(e){this._applications.delete(e)}unregisterAllApplications(){this._applications.clear()}getTestability(e){return this._applications.get(e)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(e,t=!0){return El.findTestabilityInTree(this,e,t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();class Sl{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let xl,El=new Sl,Il=!0,Pl=!1;const Dl=new Vi("AllowMultipleToken");function Tl(e,t,i=[]){const n="Platform: "+t,r=new Vi(n);return(t=[])=>{let s=Al();if(!s||s.injector.get(Dl,!1))if(e)e(i.concat(t).concat({provide:r,useValue:!0}));else{const e=i.concat(t).concat({provide:r,useValue:!0},{provide:$s,useValue:"platform"});!function(e){if(xl&&!xl.destroyed&&!xl.injector.get(Dl,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");xl=e.get(Rl);const t=e.get(Xc,null);t&&t.forEach(e=>e())}(Js.create({providers:e,name:n}))}return function(e){const t=Al();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(r)}}function Al(){return xl&&!xl.destroyed?xl:null}let Rl=(()=>{class e{constructor(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(e,t){const i=function(e,t){let i;return i="noop"===e?new wl:("zone.js"===e?void 0:e)||new gl({enableLongStackTrace:(Pl=!0,Il),shouldCoalesceEventChangeDetection:!!(null==t?void 0:t.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==t?void 0:t.ngZoneRunCoalescing)}),i}(t?t.ngZone:void 0,{ngZoneEventCoalescing:t&&t.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:t&&t.ngZoneRunCoalescing||!1}),n=[{provide:gl,useValue:i}];return i.run(()=>{const t=Js.create({providers:n,parent:this.injector,name:e.moduleType.name}),r=e.create(t),s=r.injector.get(Jn,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return i.runOutsideAngular(()=>{const e=i.onError.subscribe({next:e=>{s.handleError(e)}});r.onDestroy(()=>{Bl(this._modules,r),e.unsubscribe()})}),function(e,t,i){try{const n=i();return Po(n)?n.catch(i=>{throw t.runOutsideAngular(()=>e.handleError(i)),i}):n}catch(n){throw t.runOutsideAngular(()=>e.handleError(n)),n}}(s,i,()=>{const e=r.injector.get(Qc);return e.runInitializers(),e.donePromise.then(()=>(oa(r.injector.get(nl,"en-US")||"en-US"),this._moduleDoBootstrap(r),r))})})}bootstrapModule(e,t=[]){const i=Ol({},t);return function(e,t,i){const n=new vc(i);return Promise.resolve(n)}(0,0,e).then(e=>this.bootstrapModuleFactory(e,i))}_moduleDoBootstrap(e){const t=e.injector.get(Fl);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(e=>t.bootstrap(e));else{if(!e.instance.ngDoBootstrap)throw new Error(`The module ${te(e.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);e.instance.ngDoBootstrap(t)}this._modules.push(e)}onDestroy(e){this._destroyListeners.push(e)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(e=>e.destroy()),this._destroyListeners.forEach(e=>e()),this._destroyed=!0}get destroyed(){return this._destroyed}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();function Ol(e,t){return Array.isArray(t)?t.reduce(Ol,e):Object.assign(Object.assign({},e),t)}let Fl=(()=>{class e{constructor(e,t,i,n,r){this._zone=e,this._injector=t,this._exceptionHandler=i,this._componentFactoryResolver=n,this._initStatus=r,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const s=new v(e=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{e.next(this._stable),e.complete()})}),o=new v(e=>{let t;this._zone.runOutsideAngular(()=>{t=this._zone.onStable.subscribe(()=>{gl.assertNotInAngularZone(),ml(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,e.next(!0))})})});const i=this._zone.onUnstable.subscribe(()=>{gl.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{e.next(!1)}))});return()=>{t.unsubscribe(),i.unsubscribe()}});this.isStable=q(s,o.pipe(e=>{return G()((t=J,function(e){let i;i="function"==typeof t?t:function(){return t};const n=Object.create(e,Y);return n.source=e,n.subjectFactory=i,n})(e));var t}))}bootstrap(e,t){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let i;i=e instanceof ga?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(i.componentType);const n=i.isBoundToModule?void 0:this._injector.get(ic),r=i.create(Js.NULL,[],t||i.selector,n),s=r.location.nativeElement,o=r.injector.get(kl,null),a=o&&r.injector.get(Cl);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),Bl(this.components,r),a&&a.unregisterApplication(s)}),this._loadComponent(r),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let e of this._views)e.detectChanges()}catch(e){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(e))}finally{this._runningTick=!1}}attachView(e){const t=e;this._views.push(t),t.attachToAppRef(this)}detachView(e){const t=e;Bl(this._views,t),t.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(tl,[]).concat(this._bootstrapListeners).forEach(t=>t(e))}ngOnDestroy(){this._views.slice().forEach(e=>e.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return e.\u0275fac=function(t){return new(t||e)(nn(gl),nn(Js),nn(Jn),nn(_a),nn(Qc))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();function Bl(e,t){const i=e.indexOf(t);i>-1&&e.splice(i,1)}const Ml=Tl(null,"core",[{provide:el,useValue:"unknown"},{provide:Rl,deps:[Js]},{provide:Cl,deps:[]},{provide:il,deps:[]}]),Ll=[{provide:Fl,useClass:Fl,deps:[gl,Js,Jn,_a,Qc]},{provide:pc,deps:[gl],useFactory:function(e){let t=[];return e.onStable.subscribe(()=>{for(;t.length;)t.pop()()}),function(e){t.push(e)}}},{provide:Qc,useClass:Qc,deps:[[new an,Zc]]},{provide:hl,useClass:hl,deps:[]},Kc,{provide:za,useFactory:function(){return Qa},deps:[]},{provide:Va,useFactory:function(){return Ya},deps:[]},{provide:nl,useFactory:function(e){return oa(e=e||"undefined"!=typeof $localize&&$localize.locale||"en-US"),e},deps:[[new on(nl),new an,new cn]]},{provide:rl,useValue:"USD"}];let $l=(()=>{class e{constructor(e){}}return e.\u0275fac=function(t){return new(t||e)(nn(Fl))},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:Ll}),e})(),jl=null;function zl(){return jl}const Nl=new Vi("DocumentToken"),Vl={ADP:[void 0,void 0,0],AFN:[void 0,void 0,0],ALL:[void 0,void 0,0],AMD:[void 0,void 0,2],AOA:[void 0,"Kz"],ARS:[void 0,"$"],AUD:["A$","$"],BAM:[void 0,"KM"],BBD:[void 0,"$"],BDT:[void 0,"\u09f3"],BHD:[void 0,void 0,3],BIF:[void 0,void 0,0],BMD:[void 0,"$"],BND:[void 0,"$"],BOB:[void 0,"Bs"],BRL:["R$"],BSD:[void 0,"$"],BWP:[void 0,"P"],BYN:[void 0,"\u0440.",2],BYR:[void 0,void 0,0],BZD:[void 0,"$"],CAD:["CA$","$",2],CHF:[void 0,void 0,2],CLF:[void 0,void 0,4],CLP:[void 0,"$",0],CNY:["CN\xa5","\xa5"],COP:[void 0,"$",2],CRC:[void 0,"\u20a1",2],CUC:[void 0,"$"],CUP:[void 0,"$"],CZK:[void 0,"K\u010d",2],DJF:[void 0,void 0,0],DKK:[void 0,"kr",2],DOP:[void 0,"$"],EGP:[void 0,"E\xa3"],ESP:[void 0,"\u20a7",0],EUR:["\u20ac"],FJD:[void 0,"$"],FKP:[void 0,"\xa3"],GBP:["\xa3"],GEL:[void 0,"\u20be"],GIP:[void 0,"\xa3"],GNF:[void 0,"FG",0],GTQ:[void 0,"Q"],GYD:[void 0,"$",2],HKD:["HK$","$"],HNL:[void 0,"L"],HRK:[void 0,"kn"],HUF:[void 0,"Ft",2],IDR:[void 0,"Rp",2],ILS:["\u20aa"],INR:["\u20b9"],IQD:[void 0,void 0,0],IRR:[void 0,void 0,0],ISK:[void 0,"kr",0],ITL:[void 0,void 0,0],JMD:[void 0,"$"],JOD:[void 0,void 0,3],JPY:["\xa5",void 0,0],KHR:[void 0,"\u17db"],KMF:[void 0,"CF",0],KPW:[void 0,"\u20a9",0],KRW:["\u20a9",void 0,0],KWD:[void 0,void 0,3],KYD:[void 0,"$"],KZT:[void 0,"\u20b8"],LAK:[void 0,"\u20ad",0],LBP:[void 0,"L\xa3",0],LKR:[void 0,"Rs"],LRD:[void 0,"$"],LTL:[void 0,"Lt"],LUF:[void 0,void 0,0],LVL:[void 0,"Ls"],LYD:[void 0,void 0,3],MGA:[void 0,"Ar",0],MGF:[void 0,void 0,0],MMK:[void 0,"K",0],MNT:[void 0,"\u20ae",2],MRO:[void 0,void 0,0],MUR:[void 0,"Rs",2],MXN:["MX$","$"],MYR:[void 0,"RM"],NAD:[void 0,"$"],NGN:[void 0,"\u20a6"],NIO:[void 0,"C$"],NOK:[void 0,"kr",2],NPR:[void 0,"Rs"],NZD:["NZ$","$"],OMR:[void 0,void 0,3],PHP:[void 0,"\u20b1"],PKR:[void 0,"Rs",2],PLN:[void 0,"z\u0142"],PYG:[void 0,"\u20b2",0],RON:[void 0,"lei"],RSD:[void 0,void 0,0],RUB:[void 0,"\u20bd"],RUR:[void 0,"\u0440."],RWF:[void 0,"RF",0],SBD:[void 0,"$"],SEK:[void 0,"kr",2],SGD:[void 0,"$"],SHP:[void 0,"\xa3"],SLL:[void 0,void 0,0],SOS:[void 0,void 0,0],SRD:[void 0,"$"],SSP:[void 0,"\xa3"],STD:[void 0,void 0,0],STN:[void 0,"Db"],SYP:[void 0,"\xa3",0],THB:[void 0,"\u0e3f"],TMM:[void 0,void 0,0],TND:[void 0,void 0,3],TOP:[void 0,"T$"],TRL:[void 0,void 0,0],TRY:[void 0,"\u20ba"],TTD:[void 0,"$"],TWD:["NT$","$",2],TZS:[void 0,void 0,2],UAH:[void 0,"\u20b4"],UGX:[void 0,void 0,0],USD:["$"],UYI:[void 0,void 0,0],UYU:[void 0,"$"],UYW:[void 0,void 0,4],UZS:[void 0,void 0,2],VEF:[void 0,"Bs",2],VND:["\u20ab",void 0,0],VUV:[void 0,void 0,0],XAF:["FCFA",void 0,0],XCD:["EC$","$"],XOF:["CFA",void 0,0],XPF:["CFPF",void 0,0],XXX:["\xa4"],YER:[void 0,void 0,0],ZAR:[void 0,"R"],ZMK:[void 0,void 0,0],ZMW:[void 0,"ZK"],ZWD:[void 0,void 0,0]};var Hl=function(e){return e[e.Decimal=0]="Decimal",e[e.Percent=1]="Percent",e[e.Currency=2]="Currency",e[e.Scientific=3]="Scientific",e}({}),Ul=function(e){return e[e.Zero=0]="Zero",e[e.One=1]="One",e[e.Two=2]="Two",e[e.Few=3]="Few",e[e.Many=4]="Many",e[e.Other=5]="Other",e}({}),ql=function(e){return e[e.Format=0]="Format",e[e.Standalone=1]="Standalone",e}({}),Gl=function(e){return e[e.Narrow=0]="Narrow",e[e.Abbreviated=1]="Abbreviated",e[e.Wide=2]="Wide",e[e.Short=3]="Short",e}({}),Wl=function(e){return e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e[e.Full=3]="Full",e}({}),Zl=function(e){return e[e.Decimal=0]="Decimal",e[e.Group=1]="Group",e[e.List=2]="List",e[e.PercentSign=3]="PercentSign",e[e.PlusSign=4]="PlusSign",e[e.MinusSign=5]="MinusSign",e[e.Exponential=6]="Exponential",e[e.SuperscriptingExponent=7]="SuperscriptingExponent",e[e.PerMille=8]="PerMille",e[e[1/0]=9]="Infinity",e[e.NaN=10]="NaN",e[e.TimeSeparator=11]="TimeSeparator",e[e.CurrencyDecimal=12]="CurrencyDecimal",e[e.CurrencyGroup=13]="CurrencyGroup",e}({});function Ql(e,t){return tu(ia(e)[ra.DateFormat],t)}function Yl(e,t){return tu(ia(e)[ra.TimeFormat],t)}function Kl(e,t){return tu(ia(e)[ra.DateTimeFormat],t)}function Jl(e,t){const i=ia(e),n=i[ra.NumberSymbols][t];if(void 0===n){if(t===Zl.CurrencyDecimal)return i[ra.NumberSymbols][Zl.Decimal];if(t===Zl.CurrencyGroup)return i[ra.NumberSymbols][Zl.Group]}return n}function Xl(e,t){return ia(e)[ra.NumberFormats][t]}function eu(e){if(!e[ra.ExtraData])throw new Error(`Missing extra locale data for the locale "${e[ra.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function tu(e,t){for(let i=t;i>-1;i--)if(void 0!==e[i])return e[i];throw new Error("Locale data API: locale data undefined")}function iu(e){const[t,i]=e.split(":");return{hours:+t,minutes:+i}}const nu=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,ru={},su=/((?:[^GyYMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var ou=function(e){return e[e.Short=0]="Short",e[e.ShortGMT=1]="ShortGMT",e[e.Long=2]="Long",e[e.Extended=3]="Extended",e}({}),au=function(e){return e[e.FullYear=0]="FullYear",e[e.Month=1]="Month",e[e.Date=2]="Date",e[e.Hours=3]="Hours",e[e.Minutes=4]="Minutes",e[e.Seconds=5]="Seconds",e[e.FractionalSeconds=6]="FractionalSeconds",e[e.Day=7]="Day",e}({}),cu=function(e){return e[e.DayPeriods=0]="DayPeriods",e[e.Days=1]="Days",e[e.Months=2]="Months",e[e.Eras=3]="Eras",e}({});function lu(e,t,i,n){let r=function(e){if(wu(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){const[t,i=1,n=1]=e.split("-").map(e=>+e);return uu(t,i-1,n)}const t=parseFloat(e);if(!isNaN(e-t))return new Date(t);let i;if(i=e.match(nu))return function(e){const t=new Date(0);let i=0,n=0;const r=e[8]?t.setUTCFullYear:t.setFullYear,s=e[8]?t.setUTCHours:t.setHours;e[9]&&(i=Number(e[9]+e[10]),n=Number(e[9]+e[11])),r.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));const o=Number(e[4]||0)-i,a=Number(e[5]||0)-n,c=Number(e[6]||0),l=Math.floor(1e3*parseFloat("0."+(e[7]||0)));return s.call(t,o,a,c,l),t}(i)}const t=new Date(e);if(!wu(t))throw new Error(`Unable to convert "${e}" into a date`);return t}(e);t=function e(t,i){const n=function(e){return ia(e)[ra.LocaleId]}(t);if(ru[n]=ru[n]||{},ru[n][i])return ru[n][i];let r="";switch(i){case"shortDate":r=Ql(t,Wl.Short);break;case"mediumDate":r=Ql(t,Wl.Medium);break;case"longDate":r=Ql(t,Wl.Long);break;case"fullDate":r=Ql(t,Wl.Full);break;case"shortTime":r=Yl(t,Wl.Short);break;case"mediumTime":r=Yl(t,Wl.Medium);break;case"longTime":r=Yl(t,Wl.Long);break;case"fullTime":r=Yl(t,Wl.Full);break;case"short":const i=e(t,"shortTime"),n=e(t,"shortDate");r=du(Kl(t,Wl.Short),[i,n]);break;case"medium":const s=e(t,"mediumTime"),o=e(t,"mediumDate");r=du(Kl(t,Wl.Medium),[s,o]);break;case"long":const a=e(t,"longTime"),c=e(t,"longDate");r=du(Kl(t,Wl.Long),[a,c]);break;case"full":const l=e(t,"fullTime"),u=e(t,"fullDate");r=du(Kl(t,Wl.Full),[l,u])}return r&&(ru[n][i]=r),r}(i,t)||t;let s,o=[];for(;t;){if(s=su.exec(t),!s){o.push(t);break}{o=o.concat(s.slice(1));const e=o.pop();if(!e)break;t=e}}let a=r.getTimezoneOffset();n&&(a=yu(n,a),r=function(e,t,i){const n=e.getTimezoneOffset();return function(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}(e,-1*(yu(t,n)-n))}(r,n));let c="";return o.forEach(e=>{const t=function(e){if(bu[e])return bu[e];let t;switch(e){case"G":case"GG":case"GGG":t=mu(cu.Eras,Gl.Abbreviated);break;case"GGGG":t=mu(cu.Eras,Gl.Wide);break;case"GGGGG":t=mu(cu.Eras,Gl.Narrow);break;case"y":t=pu(au.FullYear,1,0,!1,!0);break;case"yy":t=pu(au.FullYear,2,0,!0,!0);break;case"yyy":t=pu(au.FullYear,3,0,!1,!0);break;case"yyyy":t=pu(au.FullYear,4,0,!1,!0);break;case"Y":t=vu(1);break;case"YY":t=vu(2,!0);break;case"YYY":t=vu(3);break;case"YYYY":t=vu(4);break;case"M":case"L":t=pu(au.Month,1,1);break;case"MM":case"LL":t=pu(au.Month,2,1);break;case"MMM":t=mu(cu.Months,Gl.Abbreviated);break;case"MMMM":t=mu(cu.Months,Gl.Wide);break;case"MMMMM":t=mu(cu.Months,Gl.Narrow);break;case"LLL":t=mu(cu.Months,Gl.Abbreviated,ql.Standalone);break;case"LLLL":t=mu(cu.Months,Gl.Wide,ql.Standalone);break;case"LLLLL":t=mu(cu.Months,Gl.Narrow,ql.Standalone);break;case"w":t=_u(1);break;case"ww":t=_u(2);break;case"W":t=_u(1,!0);break;case"d":t=pu(au.Date,1);break;case"dd":t=pu(au.Date,2);break;case"E":case"EE":case"EEE":t=mu(cu.Days,Gl.Abbreviated);break;case"EEEE":t=mu(cu.Days,Gl.Wide);break;case"EEEEE":t=mu(cu.Days,Gl.Narrow);break;case"EEEEEE":t=mu(cu.Days,Gl.Short);break;case"a":case"aa":case"aaa":t=mu(cu.DayPeriods,Gl.Abbreviated);break;case"aaaa":t=mu(cu.DayPeriods,Gl.Wide);break;case"aaaaa":t=mu(cu.DayPeriods,Gl.Narrow);break;case"b":case"bb":case"bbb":t=mu(cu.DayPeriods,Gl.Abbreviated,ql.Standalone,!0);break;case"bbbb":t=mu(cu.DayPeriods,Gl.Wide,ql.Standalone,!0);break;case"bbbbb":t=mu(cu.DayPeriods,Gl.Narrow,ql.Standalone,!0);break;case"B":case"BB":case"BBB":t=mu(cu.DayPeriods,Gl.Abbreviated,ql.Format,!0);break;case"BBBB":t=mu(cu.DayPeriods,Gl.Wide,ql.Format,!0);break;case"BBBBB":t=mu(cu.DayPeriods,Gl.Narrow,ql.Format,!0);break;case"h":t=pu(au.Hours,1,-12);break;case"hh":t=pu(au.Hours,2,-12);break;case"H":t=pu(au.Hours,1);break;case"HH":t=pu(au.Hours,2);break;case"m":t=pu(au.Minutes,1);break;case"mm":t=pu(au.Minutes,2);break;case"s":t=pu(au.Seconds,1);break;case"ss":t=pu(au.Seconds,2);break;case"S":t=pu(au.FractionalSeconds,1);break;case"SS":t=pu(au.FractionalSeconds,2);break;case"SSS":t=pu(au.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":t=gu(ou.Short);break;case"ZZZZZ":t=gu(ou.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":t=gu(ou.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":t=gu(ou.Long);break;default:return null}return bu[e]=t,t}(e);c+=t?t(r,i,a):"''"===e?"'":e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}function uu(e,t,i){const n=new Date(0);return n.setFullYear(e,t,i),n.setHours(0,0,0),n}function du(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,(function(e,i){return null!=t&&i in t?t[i]:e}))),e}function hu(e,t,i="-",n,r){let s="";(e<0||r&&e<=0)&&(r?e=1-e:(e=-e,s=i));let o=String(e);for(;o.length<t;)o="0"+o;return n&&(o=o.substr(o.length-t)),s+o}function pu(e,t,i=0,n=!1,r=!1){return function(s,o){let a=function(e,t){switch(e){case au.FullYear:return t.getFullYear();case au.Month:return t.getMonth();case au.Date:return t.getDate();case au.Hours:return t.getHours();case au.Minutes:return t.getMinutes();case au.Seconds:return t.getSeconds();case au.FractionalSeconds:return t.getMilliseconds();case au.Day:return t.getDay();default:throw new Error(`Unknown DateType value "${e}".`)}}(e,s);if((i>0||a>-i)&&(a+=i),e===au.Hours)0===a&&-12===i&&(a=12);else if(e===au.FractionalSeconds)return c=t,hu(a,3).substr(0,c);var c;const l=Jl(o,Zl.MinusSign);return hu(a,t,l,n,r)}}function mu(e,t,i=ql.Format,n=!1){return function(r,s){return function(e,t,i,n,r,s){switch(i){case cu.Months:return function(e,t,i){const n=ia(e),r=tu([n[ra.MonthsFormat],n[ra.MonthsStandalone]],t);return tu(r,i)}(t,r,n)[e.getMonth()];case cu.Days:return function(e,t,i){const n=ia(e),r=tu([n[ra.DaysFormat],n[ra.DaysStandalone]],t);return tu(r,i)}(t,r,n)[e.getDay()];case cu.DayPeriods:const o=e.getHours(),a=e.getMinutes();if(s){const e=function(e){const t=ia(e);return eu(t),(t[ra.ExtraData][2]||[]).map(e=>"string"==typeof e?iu(e):[iu(e[0]),iu(e[1])])}(t),i=function(e,t,i){const n=ia(e);eu(n);const r=tu([n[ra.ExtraData][0],n[ra.ExtraData][1]],t)||[];return tu(r,i)||[]}(t,r,n),s=e.findIndex(e=>{if(Array.isArray(e)){const[t,i]=e,n=o>=t.hours&&a>=t.minutes,r=o<i.hours||o===i.hours&&a<i.minutes;if(t.hours<i.hours){if(n&&r)return!0}else if(n||r)return!0}else if(e.hours===o&&e.minutes===a)return!0;return!1});if(-1!==s)return i[s]}return function(e,t,i){const n=ia(e),r=tu([n[ra.DayPeriodsFormat],n[ra.DayPeriodsStandalone]],t);return tu(r,i)}(t,r,n)[o<12?0:1];case cu.Eras:return function(e,t){return tu(ia(e)[ra.Eras],t)}(t,n)[e.getFullYear()<=0?0:1];default:throw new Error("unexpected translation type "+i)}}(r,s,e,t,i,n)}}function gu(e){return function(t,i,n){const r=-1*n,s=Jl(i,Zl.MinusSign),o=r>0?Math.floor(r/60):Math.ceil(r/60);switch(e){case ou.Short:return(r>=0?"+":"")+hu(o,2,s)+hu(Math.abs(r%60),2,s);case ou.ShortGMT:return"GMT"+(r>=0?"+":"")+hu(o,1,s);case ou.Long:return"GMT"+(r>=0?"+":"")+hu(o,2,s)+":"+hu(Math.abs(r%60),2,s);case ou.Extended:return 0===n?"Z":(r>=0?"+":"")+hu(o,2,s)+":"+hu(Math.abs(r%60),2,s);default:throw new Error(`Unknown zone width "${e}"`)}}}function fu(e){return uu(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function _u(e,t=!1){return function(i,n){let r;if(t){const e=new Date(i.getFullYear(),i.getMonth(),1).getDay()-1,t=i.getDate();r=1+Math.floor((t+e)/7)}else{const e=fu(i),t=function(e){const t=uu(e,0,1).getDay();return uu(e,0,1+(t<=4?4:11)-t)}(e.getFullYear()),n=e.getTime()-t.getTime();r=1+Math.round(n/6048e5)}return hu(r,e,Jl(n,Zl.MinusSign))}}function vu(e,t=!1){return function(i,n){return hu(fu(i).getFullYear(),e,Jl(n,Zl.MinusSign),t)}}const bu={};function yu(e,t){e=e.replace(/:/g,"");const i=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(i)?t:i}function wu(e){return e instanceof Date&&!isNaN(e.valueOf())}const ku=/^(\d+)?\.((\d+)(-(\d+))?)?$/;function Cu(e,t,i,n,r,s,o=!1){let a="",c=!1;if(isFinite(e)){let l=function(e){let t,i,n,r,s,o=Math.abs(e)+"",a=0;for((i=o.indexOf("."))>-1&&(o=o.replace(".","")),(n=o.search(/e/i))>0?(i<0&&(i=n),i+=+o.slice(n+1),o=o.substring(0,n)):i<0&&(i=o.length),n=0;"0"===o.charAt(n);n++);if(n===(s=o.length))t=[0],i=1;else{for(s--;"0"===o.charAt(s);)s--;for(i-=n,t=[],r=0;n<=s;n++,r++)t[r]=Number(o.charAt(n))}return i>22&&(t=t.splice(0,21),a=i-1,i=1),{digits:t,exponent:a,integerLen:i}}(e);o&&(l=function(e){if(0===e.digits[0])return e;const t=e.digits.length-e.integerLen;return e.exponent?e.exponent+=2:(0===t?e.digits.push(0,0):1===t&&e.digits.push(0),e.integerLen+=2),e}(l));let u=t.minInt,d=t.minFrac,h=t.maxFrac;if(s){const e=s.match(ku);if(null===e)throw new Error(s+" is not a valid digit info");const t=e[1],i=e[3],n=e[5];null!=t&&(u=xu(t)),null!=i&&(d=xu(i)),null!=n?h=xu(n):null!=i&&d>h&&(h=d)}!function(e,t,i){if(t>i)throw new Error(`The minimum number of digits after fraction (${t}) is higher than the maximum (${i}).`);let n=e.digits,r=n.length-e.integerLen;const s=Math.min(Math.max(t,r),i);let o=s+e.integerLen,a=n[o];if(o>0){n.splice(Math.max(e.integerLen,o));for(let e=o;e<n.length;e++)n[e]=0}else{r=Math.max(0,r),e.integerLen=1,n.length=Math.max(1,o=s+1),n[0]=0;for(let e=1;e<o;e++)n[e]=0}if(a>=5)if(o-1<0){for(let t=0;t>o;t--)n.unshift(0),e.integerLen++;n.unshift(1),e.integerLen++}else n[o-1]++;for(;r<Math.max(0,s);r++)n.push(0);let c=0!==s;const l=t+e.integerLen,u=n.reduceRight((function(e,t,i,n){return n[i]=(t+=e)<10?t:t-10,c&&(0===n[i]&&i>=l?n.pop():c=!1),t>=10?1:0}),0);u&&(n.unshift(u),e.integerLen++)}(l,d,h);let p=l.digits,m=l.integerLen;const g=l.exponent;let f=[];for(c=p.every(e=>!e);m<u;m++)p.unshift(0);for(;m<0;m++)p.unshift(0);m>0?f=p.splice(m,p.length):(f=p,p=[0]);const _=[];for(p.length>=t.lgSize&&_.unshift(p.splice(-t.lgSize,p.length).join(""));p.length>t.gSize;)_.unshift(p.splice(-t.gSize,p.length).join(""));p.length&&_.unshift(p.join("")),a=_.join(Jl(i,n)),f.length&&(a+=Jl(i,r)+f.join("")),g&&(a+=Jl(i,Zl.Exponential)+"+"+g)}else a=Jl(i,Zl.Infinity);return a=e<0&&!c?t.negPre+a+t.negSuf:t.posPre+a+t.posSuf,a}function Su(e,t="-"){const i={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},n=e.split(";"),r=n[0],s=n[1],o=-1!==r.indexOf(".")?r.split("."):[r.substring(0,r.lastIndexOf("0")+1),r.substring(r.lastIndexOf("0")+1)],a=o[0],c=o[1]||"";i.posPre=a.substr(0,a.indexOf("#"));for(let u=0;u<c.length;u++){const e=c.charAt(u);"0"===e?i.minFrac=i.maxFrac=u+1:"#"===e?i.maxFrac=u+1:i.posSuf+=e}const l=a.split(",");if(i.gSize=l[1]?l[1].length:0,i.lgSize=l[2]||l[1]?(l[2]||l[1]).length:0,s){const e=r.length-i.posPre.length-i.posSuf.length,t=s.indexOf("#");i.negPre=s.substr(0,t).replace(/'/g,""),i.negSuf=s.substr(t+e).replace(/'/g,"")}else i.negPre=t+i.posPre,i.negSuf=i.posSuf;return i}function xu(e){const t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t}class Eu{}let Iu=(()=>{class e extends Eu{constructor(e){super(),this.locale=e}getPluralCategory(e,t){switch(function(e){return ia(e)[ra.PluralCase]}(t||this.locale)(e)){case Ul.Zero:return"zero";case Ul.One:return"one";case Ul.Two:return"two";case Ul.Few:return"few";case Ul.Many:return"many";default:return"other"}}}return e.\u0275fac=function(t){return new(t||e)(nn(nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();function Pu(e,t){t=encodeURIComponent(t);for(const i of e.split(";")){const e=i.indexOf("="),[n,r]=-1==e?[i,""]:[i.slice(0,e),i.slice(e+1)];if(n.trim()===t)return decodeURIComponent(r)}return null}let Du=(()=>{class e{constructor(e,t,i,n){this._iterableDiffers=e,this._keyValueDiffers=t,this._ngEl=i,this._renderer=n,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(e){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(e){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(co(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){const e=this._keyValueDiffer.diff(this._rawClass);e&&this._applyKeyValueChanges(e)}}_applyKeyValueChanges(e){e.forEachAddedItem(e=>this._toggleClass(e.key,e.currentValue)),e.forEachChangedItem(e=>this._toggleClass(e.key,e.currentValue)),e.forEachRemovedItem(e=>{e.previousValue&&this._toggleClass(e.key,!1)})}_applyIterableChanges(e){e.forEachAddedItem(e=>{if("string"!=typeof e.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+te(e.item));this._toggleClass(e.item,!0)}),e.forEachRemovedItem(e=>this._toggleClass(e.item,!1))}_applyClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach(e=>this._toggleClass(e,!0)):Object.keys(e).forEach(t=>this._toggleClass(t,!!e[t])))}_removeClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach(e=>this._toggleClass(e,!1)):Object.keys(e).forEach(e=>this._toggleClass(e,!1)))}_toggleClass(e,t){(e=e.trim())&&e.split(/\s+/g).forEach(e=>{t?this._renderer.addClass(this._ngEl.nativeElement,e):this._renderer.removeClass(this._ngEl.nativeElement,e)})}}return e.\u0275fac=function(t){return new(t||e)(vo(za),vo(Va),vo(wa),vo(Sa))},e.\u0275dir=Qe({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),e})();class Tu{constructor(e,t,i,n){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=n}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Au=(()=>{class e{constructor(e,t,i){this._viewContainer=e,this._template=t,this._differs=i,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const i=this._ngForOf;if(!this._differ&&i)try{this._differ=this._differs.find(i).create(this.ngForTrackBy)}catch(t){throw new Error(`Cannot find a differ supporting object '${i}' of type '${e=i,e.name||typeof e}'. NgFor only supports binding to Iterables such as Arrays.`)}}var e;if(this._differ){const e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){const t=[];e.forEachOperation((e,i,n)=>{if(null==e.previousIndex){const i=this._viewContainer.createEmbeddedView(this._template,new Tu(null,this._ngForOf,-1,-1),null===n?void 0:n),r=new Ru(e,i);t.push(r)}else if(null==n)this._viewContainer.remove(null===i?void 0:i);else if(null!==i){const r=this._viewContainer.get(i);this._viewContainer.move(r,n);const s=new Ru(e,r);t.push(s)}});for(let i=0;i<t.length;i++)this._perViewChange(t[i].view,t[i].record);for(let i=0,n=this._viewContainer.length;i<n;i++){const e=this._viewContainer.get(i);e.context.index=i,e.context.count=n,e.context.ngForOf=this._ngForOf}e.forEachIdentityChange(e=>{this._viewContainer.get(e.currentIndex).context.$implicit=e.item})}_perViewChange(e,t){e.context.$implicit=t.item}static ngTemplateContextGuard(e,t){return!0}}return e.\u0275fac=function(t){return new(t||e)(vo(rc),vo(Ja),vo(za))},e.\u0275dir=Qe({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),e})();class Ru{constructor(e,t){this.record=e,this.view=t}}let Ou=(()=>{class e{constructor(e,t){this._viewContainer=e,this._context=new Fu,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=t}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){Bu("ngIfThen",e),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){Bu("ngIfElse",e),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(e,t){return!0}}return e.\u0275fac=function(t){return new(t||e)(vo(rc),vo(Ja))},e.\u0275dir=Qe({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),e})();class Fu{constructor(){this.$implicit=null,this.ngIf=null}}function Bu(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${te(t)}'.`)}class Mu{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Lu=(()=>{class e{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(e){this._ngSwitch=e,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(e){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(e)}_matchCase(e){const t=e==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||t,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),t}_updateDefaultCases(e){if(this._defaultViews&&e!==this._defaultUsed){this._defaultUsed=e;for(let t=0;t<this._defaultViews.length;t++)this._defaultViews[t].enforceState(e)}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Qe({type:e,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}}),e})(),$u=(()=>{class e{constructor(e,t,i){this.ngSwitch=i,i._addCase(),this._view=new Mu(e,t)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return e.\u0275fac=function(t){return new(t||e)(vo(rc),vo(Ja),vo(Lu,9))},e.\u0275dir=Qe({type:e,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),e})(),ju=(()=>{class e{constructor(e,t,i){i._addDefault(new Mu(e,t))}}return e.\u0275fac=function(t){return new(t||e)(vo(rc),vo(Ja),vo(Lu,9))},e.\u0275dir=Qe({type:e,selectors:[["","ngSwitchDefault",""]]}),e})(),zu=(()=>{class e{constructor(e,t,i){this._ngEl=e,this._differs=t,this._renderer=i,this._ngStyle=null,this._differ=null}set ngStyle(e){this._ngStyle=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())}ngDoCheck(){if(this._differ){const e=this._differ.diff(this._ngStyle);e&&this._applyChanges(e)}}_setStyle(e,t){const[i,n]=e.split(".");null!=(t=null!=t&&n?`${t}${n}`:t)?this._renderer.setStyle(this._ngEl.nativeElement,i,t):this._renderer.removeStyle(this._ngEl.nativeElement,i)}_applyChanges(e){e.forEachRemovedItem(e=>this._setStyle(e.key,null)),e.forEachAddedItem(e=>this._setStyle(e.key,e.currentValue)),e.forEachChangedItem(e=>this._setStyle(e.key,e.currentValue))}}return e.\u0275fac=function(t){return new(t||e)(vo(wa),vo(Va),vo(Sa))},e.\u0275dir=Qe({type:e,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),e})(),Nu=(()=>{class e{constructor(e){this._viewContainerRef=e,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(e){if(this._shouldRecreateView(e)){const e=this._viewContainerRef;this._viewRef&&e.remove(e.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?e.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&this.ngTemplateOutletContext&&this._updateExistingContext(this.ngTemplateOutletContext)}_shouldRecreateView(e){const t=e.ngTemplateOutletContext;return!!e.ngTemplateOutlet||t&&this._hasContextShapeChanged(t)}_hasContextShapeChanged(e){const t=Object.keys(e.previousValue||{}),i=Object.keys(e.currentValue||{});if(t.length===i.length){for(let e of i)if(-1===t.indexOf(e))return!0;return!1}return!0}_updateExistingContext(e){for(let t of Object.keys(e))this._viewRef.context[t]=this.ngTemplateOutletContext[t]}}return e.\u0275fac=function(t){return new(t||e)(vo(rc))},e.\u0275dir=Qe({type:e,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[at]}),e})();function Vu(e,t){return Error(`InvalidPipeArgument: '${t}' for pipe '${te(e)}'`)}class Hu{createSubscription(e,t){return e.subscribe({next:t,error:e=>{throw e}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Uu{createSubscription(e,t){return e.then(t,e=>{throw e})}dispose(e){}onDestroy(e){}}const qu=new Uu,Gu=new Hu;let Wu=(()=>{class e{constructor(e){this._ref=e,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(e){return this._obj?e!==this._obj?(this._dispose(),this.transform(e)):this._latestValue:(e&&this._subscribe(e),this._latestValue)}_subscribe(e){this._obj=e,this._strategy=this._selectStrategy(e),this._subscription=this._strategy.createSubscription(e,t=>this._updateLatestValue(e,t))}_selectStrategy(t){if(Po(t))return qu;if(Do(t))return Gu;throw Vu(e,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(e,t){e===this._obj&&(this._latestValue=t,this._ref.markForCheck())}}return e.\u0275fac=function(t){return new(t||e)(function(e=ye.Default){const t=Wa(!0);if(null!=t||e&ye.Optional)return t;ue("ChangeDetectorRef")}())},e.\u0275pipe=Ye({name:"async",type:e,pure:!1}),e})();const Zu=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])\S*/g;let Qu=(()=>{class e{transform(t){if(null==t)return null;if("string"!=typeof t)throw Vu(e,t);return t.replace(Zu,e=>e[0].toUpperCase()+e.substr(1).toLowerCase())}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=Ye({name:"titlecase",type:e,pure:!0}),e})(),Yu=(()=>{class e{constructor(e){this._locale=e}transform(t,i,n){if(!Ju(t))return null;n=n||this._locale;try{return function(e,t,i){return Cu(e,Su(Xl(t,Hl.Decimal),Jl(t,Zl.MinusSign)),t,Zl.Group,Zl.Decimal,i)}(Xu(t),n,i)}catch(r){throw Vu(e,r.message)}}}return e.\u0275fac=function(t){return new(t||e)(vo(nl))},e.\u0275pipe=Ye({name:"number",type:e,pure:!0}),e})(),Ku=(()=>{class e{constructor(e,t="USD"){this._locale=e,this._defaultCurrencyCode=t}transform(t,i,n="symbol",r,s){if(!Ju(t))return null;s=s||this._locale,"boolean"==typeof n&&(n=n?"symbol":"code");let o=i||this._defaultCurrencyCode;"code"!==n&&(o="symbol"===n||"symbol-narrow"===n?function(e,t,i="en"){const n=function(e){return ia(e)[ra.Currencies]}(i)[e]||Vl[e]||[],r=n[1];return"narrow"===t&&"string"==typeof r?r:n[0]||e}(o,"symbol"===n?"wide":"narrow",s):n);try{return function(e,t,i,n,r){const s=Su(Xl(t,Hl.Currency),Jl(t,Zl.MinusSign));return s.minFrac=function(e){let t;const i=Vl[e];return i&&(t=i[2]),"number"==typeof t?t:2}(n),s.maxFrac=s.minFrac,Cu(e,s,t,Zl.CurrencyGroup,Zl.CurrencyDecimal,r).replace("\xa4",i).replace("\xa4","").trim()}(Xu(t),s,o,i,r)}catch(a){throw Vu(e,a.message)}}}return e.\u0275fac=function(t){return new(t||e)(vo(nl),vo(rl))},e.\u0275pipe=Ye({name:"currency",type:e,pure:!0}),e})();function Ju(e){return!(null==e||""===e||e!=e)}function Xu(e){if("string"==typeof e&&!isNaN(Number(e)-parseFloat(e)))return Number(e);if("number"!=typeof e)throw new Error(e+" is not a number");return e}let ed=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[{provide:Eu,useClass:Iu}]}),e})();function td(...e){let t=e[e.length-1];return x(t)?(e.pop(),B(e,t)):U(e)}function id(e,t){return function(i){return i.lift(new nd(e,t))}}class nd{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new rd(e,this.predicate,this.thisArg))}}class rd extends m{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}class sd{}class od{}class ad{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(e=>{const t=e.indexOf(":");if(t>0){const i=e.slice(0,t),n=i.toLowerCase(),r=e.slice(t+1).trim();this.maybeSetNormalizedName(i,n),this.headers.has(n)?this.headers.get(n).push(r):this.headers.set(n,[r])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const n=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(n,i),this.maybeSetNormalizedName(t,n))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof ad?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new ad;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof ad?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const n=("a"===e.op?this.headers.get(t):void 0)||[];n.push(...i),this.headers.set(t,n);break;case"d":const r=e.value;if(r){let e=this.headers.get(t);if(!e)return;e=e.filter(e=>-1===r.indexOf(e)),0===e.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,e)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class cd{encodeKey(e){return ld(e)}encodeValue(e){return ld(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}function ld(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class ud{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new cd,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(e,t){const i=new Map;return e.length>0&&e.replace(/^\?/,"").split("&").forEach(e=>{const n=e.indexOf("="),[r,s]=-1==n?[t.decodeKey(e),""]:[t.decodeKey(e.slice(0,n)),t.decodeValue(e.slice(n+1))],o=i.get(r)||[];o.push(s),i.set(r,o)}),i}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const n=e[i];Array.isArray(n)?n.forEach(e=>{t.push({param:i,value:e,op:"a"})}):t.push({param:i,value:n,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(e=>t+"="+this.encoder.encodeValue(e)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new ud({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(e.value),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let t=this.map.get(e.param)||[];const i=t.indexOf(e.value);-1!==i&&t.splice(i,1),t.length>0?this.map.set(e.param,t):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}function dd(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function hd(e){return"undefined"!=typeof Blob&&e instanceof Blob}function pd(e){return"undefined"!=typeof FormData&&e instanceof FormData}class md{constructor(e,t,i,n){let r;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||n?(this.body=void 0!==i?i:null,r=n):r=i,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.params&&(this.params=r.params)),this.headers||(this.headers=new ad),this.params){const e=this.params.toString();if(0===e.length)this.urlWithParams=t;else{const i=t.indexOf("?");this.urlWithParams=t+(-1===i?"?":i<t.length-1?"&":"")+e}}else this.params=new ud,this.urlWithParams=t}serializeBody(){return null===this.body?null:dd(this.body)||hd(this.body)||pd(this.body)||"string"==typeof this.body?this.body:this.body instanceof ud?this.body.toString():"object"==typeof this.body||"boolean"==typeof this.body||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return null===this.body||pd(this.body)?null:hd(this.body)?this.body.type||null:dd(this.body)?null:"string"==typeof this.body?"text/plain":this.body instanceof ud?"application/x-www-form-urlencoded;charset=UTF-8":"object"==typeof this.body||"number"==typeof this.body||"boolean"==typeof this.body?"application/json":null}clone(e={}){const t=e.method||this.method,i=e.url||this.url,n=e.responseType||this.responseType,r=void 0!==e.body?e.body:this.body,s=void 0!==e.withCredentials?e.withCredentials:this.withCredentials,o=void 0!==e.reportProgress?e.reportProgress:this.reportProgress;let a=e.headers||this.headers,c=e.params||this.params;return void 0!==e.setHeaders&&(a=Object.keys(e.setHeaders).reduce((t,i)=>t.set(i,e.setHeaders[i]),a)),e.setParams&&(c=Object.keys(e.setParams).reduce((t,i)=>t.set(i,e.setParams[i]),c)),new md(t,i,r,{params:c,headers:a,reportProgress:o,responseType:n,withCredentials:s})}}var gd=function(e){return e[e.Sent=0]="Sent",e[e.UploadProgress=1]="UploadProgress",e[e.ResponseHeader=2]="ResponseHeader",e[e.DownloadProgress=3]="DownloadProgress",e[e.Response=4]="Response",e[e.User=5]="User",e}({});class fd{constructor(e,t=200,i="OK"){this.headers=e.headers||new ad,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class _d extends fd{constructor(e={}){super(e),this.type=gd.ResponseHeader}clone(e={}){return new _d({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class vd extends fd{constructor(e={}){super(e),this.type=gd.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new vd({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class bd extends fd{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?"Http failure during parsing for "+(e.url||"(unknown url)"):`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function yd(e,t){return{body:t,headers:e.headers,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}let wd=(()=>{class e{constructor(e){this.handler=e}request(e,t,i={}){let n;if(e instanceof md)n=e;else{let r=void 0;r=i.headers instanceof ad?i.headers:new ad(i.headers);let s=void 0;i.params&&(s=i.params instanceof ud?i.params:new ud({fromObject:i.params})),n=new md(e,t,void 0!==i.body?i.body:null,{headers:r,params:s,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials})}const r=td(n).pipe(z(e=>this.handler.handle(e),void 0,1));if(e instanceof md||"events"===i.observe)return r;const s=r.pipe(id(e=>e instanceof vd));switch(i.observe||"body"){case"body":switch(n.responseType){case"arraybuffer":return s.pipe(E(e=>{if(null!==e.body&&!(e.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return e.body}));case"blob":return s.pipe(E(e=>{if(null!==e.body&&!(e.body instanceof Blob))throw new Error("Response is not a Blob.");return e.body}));case"text":return s.pipe(E(e=>{if(null!==e.body&&"string"!=typeof e.body)throw new Error("Response is not a string.");return e.body}));case"json":default:return s.pipe(E(e=>e.body))}case"response":return s;default:throw new Error(`Unreachable: unhandled observe type ${i.observe}}`)}}delete(e,t={}){return this.request("DELETE",e,t)}get(e,t={}){return this.request("GET",e,t)}head(e,t={}){return this.request("HEAD",e,t)}jsonp(e,t){return this.request("JSONP",e,{params:(new ud).append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,t={}){return this.request("OPTIONS",e,t)}patch(e,t,i={}){return this.request("PATCH",e,yd(i,t))}post(e,t,i={}){return this.request("POST",e,yd(i,t))}put(e,t,i={}){return this.request("PUT",e,yd(i,t))}}return e.\u0275fac=function(t){return new(t||e)(nn(sd))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();class kd{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const Cd=new Vi("HTTP_INTERCEPTORS");let Sd=(()=>{class e{intercept(e,t){return t.handle(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const xd=/^\)\]\}',?\n/;class Ed{}let Id=(()=>{class e{constructor(){}build(){return new XMLHttpRequest}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Pd=(()=>{class e{constructor(e){this.xhrFactory=e}handle(e){if("JSONP"===e.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new v(t=>{const i=this.xhrFactory.build();if(i.open(e.method,e.urlWithParams),e.withCredentials&&(i.withCredentials=!0),e.headers.forEach((e,t)=>i.setRequestHeader(e,t.join(","))),e.headers.has("Accept")||i.setRequestHeader("Accept","application/json, text/plain, */*"),!e.headers.has("Content-Type")){const t=e.detectContentTypeHeader();null!==t&&i.setRequestHeader("Content-Type",t)}if(e.responseType){const t=e.responseType.toLowerCase();i.responseType="json"!==t?t:"text"}const n=e.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const t=1223===i.status?204:i.status,n=i.statusText||"OK",s=new ad(i.getAllResponseHeaders()),o=function(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(i)||e.url;return r=new _d({headers:s,status:t,statusText:n,url:o}),r},o=()=>{let{headers:n,status:r,statusText:o,url:a}=s(),c=null;204!==r&&(c=void 0===i.response?i.responseText:i.response),0===r&&(r=c?200:0);let l=r>=200&&r<300;if("json"===e.responseType&&"string"==typeof c){const e=c;c=c.replace(xd,"");try{c=""!==c?JSON.parse(c):null}catch(u){c=e,l&&(l=!1,c={error:u,text:c})}}l?(t.next(new vd({body:c,headers:n,status:r,statusText:o,url:a||void 0})),t.complete()):t.error(new bd({error:c,headers:n,status:r,statusText:o,url:a||void 0}))},a=e=>{const{url:n}=s(),r=new bd({error:e,status:i.status||0,statusText:i.statusText||"Unknown Error",url:n||void 0});t.error(r)};let c=!1;const l=n=>{c||(t.next(s()),c=!0);let r={type:gd.DownloadProgress,loaded:n.loaded};n.lengthComputable&&(r.total=n.total),"text"===e.responseType&&i.responseText&&(r.partialText=i.responseText),t.next(r)},u=e=>{let i={type:gd.UploadProgress,loaded:e.loaded};e.lengthComputable&&(i.total=e.total),t.next(i)};return i.addEventListener("load",o),i.addEventListener("error",a),i.addEventListener("timeout",a),i.addEventListener("abort",a),e.reportProgress&&(i.addEventListener("progress",l),null!==n&&i.upload&&i.upload.addEventListener("progress",u)),i.send(n),t.next({type:gd.Sent}),()=>{i.removeEventListener("error",a),i.removeEventListener("abort",a),i.removeEventListener("load",o),i.removeEventListener("timeout",a),e.reportProgress&&(i.removeEventListener("progress",l),null!==n&&i.upload&&i.upload.removeEventListener("progress",u)),i.readyState!==i.DONE&&i.abort()}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Ed))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const Dd=new Vi("XSRF_COOKIE_NAME"),Td=new Vi("XSRF_HEADER_NAME");class Ad{}let Rd=(()=>{class e{constructor(e,t,i){this.doc=e,this.platform=t,this.cookieName=i,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=Pu(e,this.cookieName),this.lastCookieString=e),this.lastToken}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl),nn(el),nn(Dd))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Od=(()=>{class e{constructor(e,t){this.tokenService=e,this.headerName=t}intercept(e,t){const i=e.url.toLowerCase();if("GET"===e.method||"HEAD"===e.method||i.startsWith("http://")||i.startsWith("https://"))return t.handle(e);const n=this.tokenService.getToken();return null===n||e.headers.has(this.headerName)||(e=e.clone({headers:e.headers.set(this.headerName,n)})),t.handle(e)}}return e.\u0275fac=function(t){return new(t||e)(nn(Ad),nn(Td))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Fd=(()=>{class e{constructor(e,t){this.backend=e,this.injector=t,this.chain=null}handle(e){if(null===this.chain){const e=this.injector.get(Cd,[]);this.chain=e.reduceRight((e,t)=>new kd(e,t),this.backend)}return this.chain.handle(e)}}return e.\u0275fac=function(t){return new(t||e)(nn(od),nn(Js))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Bd=(()=>{class e{static disable(){return{ngModule:e,providers:[{provide:Od,useClass:Sd}]}}static withOptions(t={}){return{ngModule:e,providers:[t.cookieName?{provide:Dd,useValue:t.cookieName}:[],t.headerName?{provide:Td,useValue:t.headerName}:[]]}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[Od,{provide:Cd,useExisting:Od,multi:!0},{provide:Ad,useClass:Rd},{provide:Dd,useValue:"XSRF-TOKEN"},{provide:Td,useValue:"X-XSRF-TOKEN"}]}),e})(),Md=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[wd,{provide:sd,useClass:Fd},Pd,{provide:od,useExisting:Pd},Id,{provide:Ed,useExisting:Id}],imports:[[Bd.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),e})();var Ld=i("6Wo6"),$d=i.n(Ld);class jd extends d{constructor(e,t){super()}schedule(e,t=0){return this}}class zd extends jd{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,n=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(n,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let i=!1,n=void 0;try{this.work(e)}catch(r){i=!0,n=!!r&&r||new Error(r)}if(i)return this.unsubscribe(),n}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,n=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&i.splice(n,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}class Nd extends zd{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}let Vd=(()=>{class e{constructor(t,i=e.now){this.SchedulerAction=t,this.now=i}schedule(e,t=0,i){return new this.SchedulerAction(this,e).schedule(i,t)}}return e.now=()=>Date.now(),e})();class Hd extends Vd{constructor(e,t=Vd.now){super(e,()=>Hd.delegate&&Hd.delegate!==this?Hd.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Hd.delegate&&Hd.delegate!==this?Hd.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}class Ud extends Hd{}const qd=new Ud(Nd),Gd=new v(e=>e.complete());function Wd(e){return e?function(e){return new v(t=>e.schedule(()=>t.complete()))}(e):Gd}function Zd(e,t){return new v(t?i=>t.schedule(Qd,0,{error:e,subscriber:i}):t=>t.error(e))}function Qd({error:e,subscriber:t}){t.error(e)}let Yd=(()=>{class e{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return td(this.value);case"E":return Zd(this.error);case"C":return Wd()}throw new Error("unexpected notification kind value")}static createNext(t){return void 0!==t?new e("N",t):e.undefinedValueNotification}static createError(t){return new e("E",void 0,t)}static createComplete(){return e.completeNotification}}return e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e})();class Kd extends m{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(Kd.dispatch,this.delay,new Jd(e,this.destination)))}_next(e){this.scheduleMessage(Yd.createNext(e))}_error(e){this.scheduleMessage(Yd.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(Yd.createComplete()),this.unsubscribe()}}class Jd{constructor(e,t){this.notification=e,this.destination=t}}class Xd extends C{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new eh(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),n=this.scheduler,r=i.length;let s;if(this.closed)throw new y;if(this.isStopped||this.hasError?s=d.EMPTY:(this.observers.push(e),s=new w(this,e)),n&&e.add(e=new Kd(e,n)),t)for(let o=0;o<r&&!e.closed;o++)e.next(i[o]);else for(let o=0;o<r&&!e.closed;o++)e.next(i[o].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),s}_getNow(){return(this.scheduler||qd).now()}_trimBufferThenGetEvents(){const e=this._getNow(),t=this._bufferSize,i=this._windowTime,n=this._events,r=n.length;let s=0;for(;s<r&&!(e-n[s].time<i);)s++;return r>t&&(s=Math.max(s,r-t)),s>0&&n.splice(0,s),n}}class eh{constructor(e,t){this.time=e,this.value=t}}function th(e,t){return"function"==typeof t?i=>i.pipe(th((i,n)=>M(e(i,n)).pipe(E((e,r)=>t(i,e,n,r))))):t=>t.lift(new ih(e))}class ih{constructor(e){this.project=e}call(e,t){return t.subscribe(new nh(e,this.project))}}class nh extends ${constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(n){return void this.destination.error(n)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new L(this),n=this.destination;n.add(i),this.innerSubscription=j(e,i),this.innerSubscription!==i&&n.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;e&&!e.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const rh={schedule(e,t){const i=setTimeout(e,t);return()=>clearTimeout(i)},scheduleBeforeRender(e){if("undefined"==typeof window)return rh.schedule(e,0);if(void 0===window.requestAnimationFrame)return rh.schedule(e,16);const t=window.requestAnimationFrame(e);return()=>window.cancelAnimationFrame(t)}};let sh;function oh(e,t,i){let n=i;return function(e){return!!e&&e.nodeType===Node.ELEMENT_NODE}(e)&&t.some((t,i)=>!("*"===t||!function(e,t){if(!sh){const e=Element.prototype;sh=e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}return e.nodeType===Node.ELEMENT_NODE&&sh.call(e,t)}(e,t)||(n=i,0))),n}class ah{constructor(e,t){this.componentFactory=t.get(_a).resolveComponentFactory(e)}create(e){return new ch(this.componentFactory,e)}}class ch{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new Xd(1),this.events=this.eventEmitters.pipe(th(e=>q(...e))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:e})=>e)),this.ngZone=this.injector.get(gl),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null!==this.componentRef&&null===this.scheduledDestroyFn&&(this.scheduledDestroyFn=rh.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{var i,n;null!==this.componentRef?((i=t)!==(n=this.getInputValue(e))&&(i==i||n==n)||void 0===t&&this.unchangedInputs.has(e))&&(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=Js.create({providers:[],parent:this.injector}),i=function(e,t){const i=e.childNodes,n=t.map(()=>[]);let r=-1;t.some((e,t)=>"*"===e&&(r=t,!0));for(let s=0,o=i.length;s<o;++s){const e=i[s],o=oh(e,t,r);-1!==o&&n[o].push(e)}return n}(e,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(t,i,e),this.viewChangeDetectorRef=this.componentRef.injector.get(Ga),this.implementsOnChanges="function"==typeof this.componentRef.instance.ngOnChanges,this.initializeInputs(),this.initializeOutputs(this.componentRef),this.detectChanges(),this.injector.get(Fl).attachView(this.componentRef.hostView)}initializeInputs(){this.componentFactory.inputs.forEach(({propName:e})=>{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:t,templateName:i})=>e.instance[t].pipe(E(e=>({name:i,value:e}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=rh.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const n=this.unchangedInputs.has(e),r=n?void 0:this.getInputValue(e);this.inputChanges[e]=new ot(r,t,n)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class lh extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function uh(e,t){const i=function(e,t){return t.get(_a).resolveComponentFactory(e).inputs}(e,t.injector),n=t.strategyFactory||new ah(e,t.injector),r=function(e){const t={};return e.forEach(({propName:e,templateName:i})=>{var n;t[(n=i,n.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()))]=e}),t}(i);class s extends lh{constructor(e){super(),this.injector=e}get ngElementStrategy(){if(!this._ngElementStrategy){const e=this._ngElementStrategy=n.create(this.injector||t.injector);i.forEach(({propName:t})=>{if(!this.hasOwnProperty(t))return;const i=this[t];delete this[t],e.setInputValue(t,i)})}return this._ngElementStrategy}attributeChangedCallback(e,t,i,n){this.ngElementStrategy.setInputValue(r[e],i)}connectedCallback(){let e=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),e=!0),this.ngElementStrategy.connect(this),e||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(e=>{const t=function(e,t,i){if("function"!=typeof CustomEvent){const n=e.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,i),n}return new CustomEvent(t,{bubbles:!1,cancelable:!1,detail:i})}(this.ownerDocument,e.name,e.value);this.dispatchEvent(t)})}}return s.observedAttributes=Object.keys(r),i.forEach(({propName:e})=>{Object.defineProperty(s.prototype,e,{get(){return this.ngElementStrategy.getInputValue(e)},set(t){this.ngElementStrategy.setInputValue(e,t)},configurable:!0,enumerable:!0})}),s}class dh extends class extends class{}{constructor(){super()}supportsDOMEvents(){return!0}}{static makeCurrent(){var e;e=new dh,jl||(jl=e)}getProperty(e,t){return e[t]}log(e){window.console&&window.console.log&&window.console.log(e)}logGroup(e){window.console&&window.console.group&&window.console.group(e)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){return e.parentNode&&e.parentNode.removeChild(e),e}getValue(e){return e.value}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(e){const t=ph||(ph=document.querySelector("base"),ph)?ph.getAttribute("href"):null;return null==t?null:(i=t,hh||(hh=document.createElement("a")),hh.setAttribute("href",i),"/"===hh.pathname.charAt(0)?hh.pathname:"/"+hh.pathname);var i}resetBaseElement(){ph=null}getUserAgent(){return window.navigator.userAgent}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(e){return Pu(document.cookie,e)}}let hh,ph=null;const mh=new Vi("TRANSITION_ID"),gh=[{provide:Zc,useFactory:function(e,t,i){return()=>{i.get(Qc).donePromise.then(()=>{const i=zl();Array.prototype.slice.apply(t.querySelectorAll("style[ng-transition]")).filter(t=>t.getAttribute("ng-transition")===e).forEach(e=>i.remove(e))})}},deps:[mh,Nl,Js],multi:!0}];class fh{static init(){var e;e=new fh,El=e}addToWindow(e){Ae.getAngularTestability=(t,i=!0)=>{const n=e.findTestabilityInTree(t,i);if(null==n)throw new Error("Could not find testability for element.");return n},Ae.getAllAngularTestabilities=()=>e.getAllTestabilities(),Ae.getAllAngularRootElements=()=>e.getAllRootElements(),Ae.frameworkStabilizers||(Ae.frameworkStabilizers=[]),Ae.frameworkStabilizers.push(e=>{const t=Ae.getAllAngularTestabilities();let i=t.length,n=!1;const r=function(t){n=n||t,i--,0==i&&e(n)};t.forEach((function(e){e.whenStable(r)}))})}findTestabilityInTree(e,t,i){if(null==t)return null;const n=e.getTestability(t);return null!=n?n:i?zl().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}const _h=new Vi("EventManagerPlugins");let vh=(()=>{class e{constructor(e,t){this._zone=t,this._eventNameToPlugin=new Map,e.forEach(e=>e.manager=this),this._plugins=e.slice().reverse()}addEventListener(e,t,i){return this._findPluginFor(t).addEventListener(e,t,i)}addGlobalEventListener(e,t,i){return this._findPluginFor(t).addGlobalEventListener(e,t,i)}getZone(){return this._zone}_findPluginFor(e){const t=this._eventNameToPlugin.get(e);if(t)return t;const i=this._plugins;for(let n=0;n<i.length;n++){const t=i[n];if(t.supports(e))return this._eventNameToPlugin.set(e,t),t}throw new Error("No event manager plugin found for event "+e)}}return e.\u0275fac=function(t){return new(t||e)(nn(_h),nn(gl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();class bh{constructor(e){this._doc=e}addGlobalEventListener(e,t,i){const n=zl().getGlobalEventTarget(this._doc,e);if(!n)throw new Error(`Unsupported event target ${n} for event ${t}`);return this.addEventListener(n,t,i)}}let yh=(()=>{class e{constructor(){this._stylesSet=new Set}addStyles(e){const t=new Set;e.forEach(e=>{this._stylesSet.has(e)||(this._stylesSet.add(e),t.add(e))}),this.onStylesAdded(t)}onStylesAdded(e){}getAllStyles(){return Array.from(this._stylesSet)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),wh=(()=>{class e extends yh{constructor(e){super(),this._doc=e,this._hostNodes=new Map,this._hostNodes.set(e.head,[])}_addStylesToHost(e,t,i){e.forEach(e=>{const n=this._doc.createElement("style");n.textContent=e,i.push(t.appendChild(n))})}addHost(e){const t=[];this._addStylesToHost(this._stylesSet,e,t),this._hostNodes.set(e,t)}removeHost(e){const t=this._hostNodes.get(e);t&&t.forEach(kh),this._hostNodes.delete(e)}onStylesAdded(e){this._hostNodes.forEach((t,i)=>{this._addStylesToHost(e,i,t)})}ngOnDestroy(){this._hostNodes.forEach(e=>e.forEach(kh))}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();function kh(e){zl().remove(e)}const Ch={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Sh=/%COMP%/g;function xh(e,t,i){for(let n=0;n<t.length;n++){let r=t[n];Array.isArray(r)?xh(e,r,i):(r=r.replace(Sh,e),i.push(r))}return i}function Eh(e){return t=>{if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}let Ih=(()=>{class e{constructor(e,t,i){this.eventManager=e,this.sharedStylesHost=t,this.appId=i,this.rendererByCompId=new Map,this.defaultRenderer=new Ph(e)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;switch(t.encapsulation){case Ee.Emulated:{let i=this.rendererByCompId.get(t.id);return i||(i=new Dh(this.eventManager,this.sharedStylesHost,t,this.appId),this.rendererByCompId.set(t.id,i)),i.applyToHost(e),i}case 1:case Ee.ShadowDom:return new Th(this.eventManager,this.sharedStylesHost,e,t);default:if(!this.rendererByCompId.has(t.id)){const e=xh(t.id,t.styles,[]);this.sharedStylesHost.addStyles(e),this.rendererByCompId.set(t.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return e.\u0275fac=function(t){return new(t||e)(nn(vh),nn(wh),nn(Yc))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();class Ph{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(Ch[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,n){if(n){t=n+":"+t;const r=Ch[n];r?e.setAttributeNS(r,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const n=Ch[i];n?e.removeAttributeNS(n,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,n){n&(nr.DashCase|nr.Important)?e.style.setProperty(t,i,n&nr.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&nr.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,Eh(i)):this.eventManager.addEventListener(e,t,Eh(i))}}class Dh extends Ph{constructor(e,t,i,n){super(e),this.component=i;const r=xh(n+"-"+i.id,i.styles,[]);t.addStyles(r),this.contentAttr="_ngcontent-%COMP%".replace(Sh,n+"-"+i.id),this.hostAttr="_nghost-%COMP%".replace(Sh,n+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class Th extends Ph{constructor(e,t,i,n){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=xh(n.id,n.styles,[]);for(let s=0;s<r.length;s++){const e=document.createElement("style");e.textContent=r[s],this.shadowRoot.appendChild(e)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,i){return super.insertBefore(this.nodeOrShadowRoot(e),t,i)}removeChild(e,t){return super.removeChild(this.nodeOrShadowRoot(e),t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}}let Ah=(()=>{class e extends bh{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,i){return e.addEventListener(t,i,!1),()=>this.removeEventListener(e,t,i)}removeEventListener(e,t,i){return e.removeEventListener(t,i)}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const Rh=["alt","control","meta","shift"],Oh={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Fh={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},Bh={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let Mh=(()=>{class e extends bh{constructor(e){super(e)}supports(t){return null!=e.parseEventName(t)}addEventListener(t,i,n){const r=e.parseEventName(i),s=e.eventCallback(r.fullKey,n,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>zl().onAndCancel(t,r.domEventName,s))}static parseEventName(t){const i=t.toLowerCase().split("."),n=i.shift();if(0===i.length||"keydown"!==n&&"keyup"!==n)return null;const r=e._normalizeKey(i.pop());let s="";if(Rh.forEach(e=>{const t=i.indexOf(e);t>-1&&(i.splice(t,1),s+=e+".")}),s+=r,0!=i.length||0===r.length)return null;const o={};return o.domEventName=n,o.fullKey=s,o}static getEventFullKey(e){let t="",i=function(e){let t=e.key;if(null==t){if(t=e.keyIdentifier,null==t)return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),3===e.location&&Fh.hasOwnProperty(t)&&(t=Fh[t]))}return Oh[t]||t}(e);return i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),Rh.forEach(n=>{n!=i&&(0,Bh[n])(e)&&(t+=n+".")}),t+=i,t}static eventCallback(t,i,n){return r=>{e.getEventFullKey(r)===t&&n.runGuarded(()=>i(r))}}static _normalizeKey(e){switch(e){case"esc":return"escape";default:return e}}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Lh=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({factory:function(){return nn($h)},token:e,providedIn:"root"}),e})(),$h=(()=>{class e extends Lh{constructor(e){super(),this._doc=e}sanitize(e,t){if(null==t)return null;switch(e){case qn.NONE:return t;case qn.HTML:return yn(t,"HTML")?bn(t):Hn(this._doc,String(t)).toString();case qn.STYLE:return yn(t,"Style")?bn(t):t;case qn.SCRIPT:if(yn(t,"Script"))return bn(t);throw new Error("unsafe value used in a script context");case qn.URL:return wn(t),yn(t,"URL")?bn(t):En(String(t));case qn.RESOURCE_URL:if(yn(t,"ResourceURL"))return bn(t);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${e} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(e){return new mn(e)}bypassSecurityTrustStyle(e){return new gn(e)}bypassSecurityTrustScript(e){return new fn(e)}bypassSecurityTrustUrl(e){return new _n(e)}bypassSecurityTrustResourceUrl(e){return new vn(e)}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({factory:function(){return e=nn(Ms),new $h(e.get(Nl));var e},token:e,providedIn:"root"}),e})();const jh=Tl(Ml,"browser",[{provide:el,useValue:"browser"},{provide:Xc,useValue:function(){dh.makeCurrent(),fh.init()},multi:!0},{provide:Nl,useFactory:function(){return function(e){ht=e}(document),document},deps:[]}]),zh=[[],{provide:$s,useValue:"root"},{provide:Jn,useFactory:function(){return new Jn},deps:[]},{provide:_h,useClass:Ah,multi:!0,deps:[Nl,gl,el]},{provide:_h,useClass:Mh,multi:!0,deps:[Nl]},[],{provide:Ih,useClass:Ih,deps:[vh,wh,Yc]},{provide:Ca,useExisting:Ih},{provide:yh,useExisting:wh},{provide:wh,useClass:wh,deps:[Nl]},{provide:kl,useClass:kl,deps:[gl]},{provide:vh,useClass:vh,deps:[_h,gl]},[]];let Nh=(()=>{class e{constructor(e){if(e)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:e,providers:[{provide:Yc,useValue:t.appId},{provide:mh,useExisting:Yc},gh]}}}return e.\u0275fac=function(t){return new(t||e)(nn(e,12))},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:zh,imports:[ed,$l]}),e})();function Vh(){return new Hh(nn(Nl))}let Hh=(()=>{class e{constructor(e){this._doc=e,this._dom=zl()}addTag(e,t=!1){return e?this._getOrCreateElement(e,t):null}addTags(e,t=!1){return e?e.reduce((e,i)=>(i&&e.push(this._getOrCreateElement(i,t)),e),[]):[]}getTag(e){return e&&this._doc.querySelector(`meta[${e}]`)||null}getTags(e){if(!e)return[];const t=this._doc.querySelectorAll(`meta[${e}]`);return t?[].slice.call(t):[]}updateTag(e,t){if(!e)return null;t=t||this._parseSelector(e);const i=this.getTag(t);return i?this._setMetaElementAttributes(e,i):this._getOrCreateElement(e,!0)}removeTag(e){this.removeTagElement(this.getTag(e))}removeTagElement(e){e&&this._dom.remove(e)}_getOrCreateElement(e,t=!1){if(!t){const t=this._parseSelector(e),i=this.getTag(t);if(i&&this._containsAttributes(e,i))return i}const i=this._dom.createElement("meta");return this._setMetaElementAttributes(e,i),this._doc.getElementsByTagName("head")[0].appendChild(i),i}_setMetaElementAttributes(e,t){return Object.keys(e).forEach(i=>t.setAttribute(this._getMetaKeyMap(i),e[i])),t}_parseSelector(e){const t=e.name?"name":"property";return`${t}="${e[t]}"`}_containsAttributes(e,t){return Object.keys(e).every(i=>t.getAttribute(this._getMetaKeyMap(i))===e[i])}_getMetaKeyMap(e){return Uh[e]||e}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({factory:Vh,token:e,providedIn:"root"}),e})();const Uh={httpEquiv:"http-equiv"};function qh(){return new Gh(nn(Nl))}let Gh=(()=>{class e{constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({factory:qh,token:e,providedIn:"root"}),e})();function Wh(e){return function(t){const i=new Zh(e),n=t.lift(i);return i.caught=n}}"undefined"!=typeof window&&window;class Zh{constructor(e){this.selector=e}call(e,t){return t.subscribe(new Qh(e,this.selector,this.caught))}}class Qh extends ${constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let i;try{i=this.selector(e,this.caught)}catch(t){return void super.error(t)}this._unsubscribeAndRecycle();const n=new L(this);this.add(n);const r=j(i,n);r!==n&&this.add(r)}}}class Yh{constructor(){this.url="",this.headers={contentType:"",accept:""}}}let Kh=(()=>{class e{constructor(e,t){this.http=e,this.jsonapiConfig=t}exec(e,t,i){var n,r,s,o;const a={body:null!=i?i:null,headers:new ad({"Content-Type":null!==(r=null===(n=this.jsonapiConfig.headers)||void 0===n?void 0:n.contentType)&&void 0!==r?r:"application/vnd.api+json",Accept:null!==(o=null===(s=this.jsonapiConfig.headers)||void 0===s?void 0:s.accept)&&void 0!==o?o:"application/vnd.api+json"})};return this.http.request(t,this.jsonapiConfig.url+e,a)}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Yh))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Jh=(()=>{class e{constructor(t,i){this.resourceServices={},this.config=new Yh,t.url&&(this.config.url=t.url),e.me=this,e.injectedServices={JsonapiHttp:i,rsJsonapiConfig:this.config}}static exec(t,i,n){return e.injectedServices.JsonapiHttp.exec(t,i,n)}registerService(e){return!(e.type in this.resourceServices)&&(this.resourceServices[e.type]=e,e)}getResourceService(e,t=!1){const i=this.resourceServices[e];if(!i&&t)throw new Error(`The requested service with type ${e} has not been registered, please use register() method or @Autoregister() decorator`);return i}}return e.\u0275fac=function(t){return new(t||e)(nn(Yh,8),nn(Kh))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();class Xh{static mapAllResources(e){const t={};return e.forEach(e=>{let i;Jh.me.getResourceService(e.type)?(i=tp.getInstance().getOrCreateResource(e.type,e.id),i.fill({data:e}),i.is_new=!1):(i=new rp,i.id=e.id,i.type=e.type),t[i.type+"_"+i.id]=i}),t}static resourceByType(e){const t=this.mapAllResources(e),i={};for(const n of Object.keys(t)){const e=t[n];e.type in i||(i[e.type]={}),i[e.type][e.id]=e}return i}static buildIncluded(e){return"included"in e&&e.included?Xh.resourceByType(e.included):{}}}class ep{constructor(){this.data=[],this.is_loading=!1,this.content="collection"}fill(e){Xh.buildIncluded(e);const t={};this.data.length=0;for(const n of e.data)try{const e=this.getResourceOrFail(n);e.fill({data:n}),t[n.id]=n.id,this.data.push(e)}catch(i){this.content="ids",this.data.push({id:n.id,type:n.type})}this.data=this.data.filter(e=>e.id in t)}getResourceOrFail(e){const t=this.find(e.id);return null!==t?t:Jh.me.getResourceService(e.type,!0).getOrCreateResource(e.id)}setLoaded(e){this.is_loading=!e}find(e){if("ids"===this.content)return null;const t=this.data.findIndex(t=>t.id===e);return-1!==t?this.data[t]:null}}class tp{constructor(){this.resources={},this.collections={}}static getInstance(){return tp.instance||(tp.instance=new tp),tp.instance}getResource(e,t){return this.getKey(e,t)in this.resources?this.resources[this.getKey(e,t)]:null}getResourceOrFail(e,t){if(this.getKey(e,t)in this.resources)return this.resources[this.getKey(e,t)];throw new Error("The requested resource does not exist in cache memory")}getKey(e,t){return e+"."+t}getOrCreateCollection(e){return e in this.collections||(this.collections[e]=new ep),this.collections[e]}getOrCreateResource(e,t){let i=this.getResource(e,t);return null!==i||(i=Jh.me.getResourceService(e,!0).new(),i.id=t,this.setResource(i)),i}setResource(e){this.getKey(e.type,e.id)in this.resources?this.fillExistentResource(e):this.resources[this.getKey(e.type,e.id)]=e}removeResource(e,t){const i=this.getResource(e,t);if(i){Object.keys(this.collections).forEach(i=>{const n=this.collections[i],r=n.data.findIndex(i=>i.type===e&&i.id===t);-1!==r&&n.data.splice(r,1)}),i.attributes={};for(const e in i.relationships)if(i.relationships.hasOwnProperty(e)){const t=i.relationships[e].data;if(null==t)continue;Array.isArray(t)?i.relationships[e].data=[]:"object"==typeof t&&delete i.relationships[e].data}delete this.resources[this.getKey(e,t)]}}fillExistentResource(e){const t=this.getResourceOrFail(e.type,e.id);t.attributes=Object.assign(Object.assign({},t.attributes),e.attributes),t.relationships=t.relationships||e.relationships}}class ip{constructor(){this.data=new rp,this.is_loading=!0,this.content="id"}fill(e){this.content="id",null!==e?(this.data||(this.data=tp.getInstance().getOrCreateResource(e.data.type,e.data.id)),this.data.fill(e)&&(this.content="resource")):this.data=null}}class np{constructor(e,t,i,n){this.getService=e,this.relationshipsFrom=t,this.relationshipsDest=i,this.includedResources=n}buildRelationships(){for(const e of Object.keys(this.relationshipsFrom)){const t=this.relationshipsFrom[e];this.relationshipsDest[e]&&null===t.data&&(this.relationshipsDest[e].data=null,this.relationshipsDest[e].is_loading=!1),t.data&&(this.relationshipsDest[e]instanceof ep?this.buildRelationshipHasMany(t,e):this.relationshipsDest[e]instanceof ip&&this.buildRelationshipHasOne(t,e))}}buildRelationshipHasMany(e,t){0!==e.data.length?this.relationshipsDest[t].fill(e):this.relationshipsDest[t]=new ep}buildRelationshipHasOne(e,t){if("type"in e.data){if(this.relationshipsDest[t].data||(this.relationshipsDest[t].data=new rp),e.data.id!==this.relationshipsDest[t].data.id&&(this.relationshipsDest[t].data=new rp,this.relationshipsDest[t].data.type=e.data.type),this.relationshipsDest[t].data.id!==e.data.id||!this.relationshipsDest[t].data.attributes||0===Object.keys(this.relationshipsDest[t].data.attributes).length){const i=this.buildRelationship(e.data);i?this.relationshipsDest[t].data=i:(this.relationshipsDest[t].data.id=e.data.id,this.relationshipsDest[t].data.type=e.data.type)}}else this.relationshipsDest[t].data=[]}buildRelationship(e){if(e.type in this.includedResources&&e.id in this.includedResources[e.type]){const t=this.includedResources[e.type][e.id];return tp.getInstance().setResource(t),this.includedResources[e.type][e.id]}return tp.getInstance().getResource(e.type,e.id)}}class rp{constructor(){this.id="",this.type="",this.attributes={},this.links={},this.relationships={},this.is_new=!0,this.is_loading=!1}reset(){this.id="",this.attributes={},this.is_new=!0;for(const e of Object.keys(this.relationships))this.relationships[e]=this.relationships[e]instanceof ep?new ep:new ip}addRelationship(e,t){const i=this.relationships[t||e.type];i.data=i instanceof ep?this.replaceOrAddRelationship(i.data,e):e}addRelationships(e,t){if(0!==e.length){if(!(this.relationships[t]instanceof ep))throw new Error("addRelationships require a DocumentCollection (hasMany) relation.");e.forEach(e=>{this.addRelationship(e,t)})}}removeRelationship(e,t){if(!(e in this.relationships)||!("data"in this.relationships[e]))return!1;const i=this.relationships[e];return i instanceof ep?this.relationships[e].data=i.data.filter(e=>e.id!==t):i.data=null,!0}fill(e){var t;this.id=e.data.id||"",this.attributes=Object.assign(Object.assign({},this.attributes||{}),e.data.attributes),this.is_new=!1;const i=Jh.me.getResourceService(e.data.type);return!this.relationships&&i&&(this.relationships=(new i.resource).relationships),!!i&&(new np(Jh.me.getResourceService,null!==(t=e.data.relationships)&&void 0!==t?t:{},this.relationships,Xh.buildIncluded(e)).buildRelationships(),!0)}save(e){const t=Jh.me.getResourceService(this.type),i=this.type+(this.id?"/"+this.id:"")+(e?"?"+t.objectToQueryParams(e):"");return Jh.exec(i,this.is_new?"POST":"PATCH",this.toObject(e)).pipe(E(e=>this.handleSaveResponse(e)))}setLoaded(e){this.is_loading=!e}handleSaveResponse(e){return"id"in e.data&&(this.id=e.data.id),this.fill(e),e}delete(){return Jh.me.getResourceService(this.type).delete(this.id)}toObject(e){const t=this.buildRelationships(),i=this.buildIncluded(e),n={data:{type:this.type,id:this.id,attributes:this.attributes,relationships:t}};return this.meta&&(n.data.meta=this.meta),i.length>0&&(n.included=i),""===this.id&&delete n.data.id,n}buildCollectionRelationships(e,t,i){t.data?e[i]={data:t.data.reduce((e,t)=>(t.id&&t.type&&e.push({id:t.id,type:t.type}),e),[])}:delete e[i]}buildResourceRelationships(e,t,i){null!=t.data&&t.data.id&&t.data.type?e[i]={data:{id:t.data.id,type:t.data.type}}:delete e[i]}buildRelationships(){const e={};for(const t of Object.keys(this.relationships)){const i=this.relationships[t];i instanceof ep?this.buildCollectionRelationships(e,i,t):this.buildResourceRelationships(e,i,t)}return e}buildIncludedForCollection(e,t,i,n){const r=[];let s;for(const o of e)s=this.buildIncludedForResource(o,t,i,n),s&&r.push(s);return r}buildIncludedForResource(e,t,i,n){const r=e.type+"_"+e.id;return-1===i.indexOf(r)&&-1!==n.indexOf(t)?(i.push(r),e.toObject({}).data):null}buildIncluded(e){const t=[],i=[];return(null==e?void 0:e.include)?(Object.keys(this.relationships).forEach(n=>{const r=this.relationships[n];let s;r instanceof ep?(s=this.buildIncludedForCollection(r.data,n,i,e.include),s&&t.push(...s)):(s=this.buildIncludedForResource(r.data,n,i,e.include),s&&t.push(s))}),t):t}replaceOrAddRelationship(e,t){const i=e.findIndex(e=>e.id===t.id);return-1===i?e.push(t):e[i]=t,e}}class sp{constructor(){this.type="",this.resource=rp,setTimeout(()=>this.register())}register(){if(null===Jh.me)throw new Error("Error: you are trying to register `"+this.type+"` but JsonapiCore wasn't injected anywhere yet.");return Jh.me.registerService(this)}new(){const e=new this.resource;return e.type=this.type,Jh.me.getResourceService(this.type)||this.register(),e.reset(),e}all(e){e&&this.convertRemoteFilters(e);const t=this.type+(e?"?"+this.objectToQueryParams(e):""),i=tp.getInstance().getOrCreateCollection(t);return i.setLoaded(!1),Jh.exec(t,"GET").pipe(E(e=>(i.fill(e),i.setLoaded(!0),e.links&&this.generatePage(i,e.links),i)),Wh(e=>Zd(e)))}get(e,t={}){const i=`${this.type}/${e}`+(Object.keys(t).length>0?"?"+this.objectToQueryParams(t):""),n=this.getOrCreateResource(e);return n.setLoaded(!1),Jh.exec(i,"GET").pipe(E(e=>(n.fill(e),n.setLoaded(!0),n)),Wh(e=>Zd(e)))}save(e){return Jh.exec(this.type+(e.data.id?"/"+e.data.id:""),e.data.id?"PATCH":"POST",e).pipe(Wh(e=>Zd(e)))}delete(e){return Jh.exec(`${this.type}/${e}`,"DELETE").pipe(E(()=>(tp.getInstance().removeResource(this.type,e),null)),Wh(e=>Zd(e)))}objectToQueryParams(e,t=""){const i=[];for(const n of Object.keys(e)){const r=e[n],s=t&&"urlParams"!==t?`${t}[${n}]`:n;null!=r&&(Array.isArray(r)?i.push(`${s}=${r.map(encodeURIComponent).join(",")}`):i.push("object"==typeof r?this.objectToQueryParams(r,s):`${s}=${encodeURIComponent(r)}`))}return i.join("&")}newCollection(){return new ep}getOrCreateResource(e){const t=Jh.me.getResourceService(this.type,!0);let i;return i=tp.getInstance().getResource(this.type,e),null===i&&(i=t.new(),i.id=e,tp.getInstance().setResource(i)),i}generatePage(e,t){if(!t.last)return;const i=new URLSearchParams(new URL(t.last).search),n=Number(i.get("page[size]")),r=Number(i.get("page[number]")),s={number:r,total_resources:n*r,size:n};if(t.next){const e=new URLSearchParams(new URL(t.next).search);s.number=Number(e.get("page[number]"))-1}e.page=s}convertRemoteFilters(e){var t;return e.filter=null!==(t=e.remotefilter)&&void 0!==t?t:e.filter,delete e.remotefilter,e}}let op=(()=>{class e{constructor(e,t){if(e)throw new Error("GreetingModule is already loaded. Import it in the AppModule only")}static forRoot(t){return{ngModule:e,providers:[{provide:Yh,useValue:t}]}}}return e.\u0275fac=function(t){return new(t||e)(nn(e,12),nn(Jh))},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[Jh,Yh,Kh],imports:[[ed],Md]}),e})();var ap=i("TOAu");class cp extends C{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new y;return this._value}next(e){super.next(this._value=e)}}var lp=function(e){return e.MEALZ="mealz-space",e.SHELVES="shelves",e.SEARCH="search",e.EMPTY="",e}({});const up={"meals-space-catalog-search":{selector:[".mealz-catalog__title",".miam-recipe-catalog__content__title__search__text"],urlParam:"search"},"meals-space-home":["mealz-catalog-home",".miam-catalog-header"],"meals-space-category-search":{selector:["mealz-catalog-category",".miam-catalog-header__category-label"],urlParam:"search"},"meals-space-category":["mealz-catalog-category",".miam-catalog-header__category-label"],"meals-space-all-recipes":["mealz-catalog-all-recipes",".miam-recipe-catalog__content__title__all-recipes__text"],"my-space-favorites":["mealz-catalog-favorites","#favorites-panel"],"my-space-history":"mealz-catalog-history"},dp=(e,t)=>{const i=null!=t?t:"undefined"!=typeof window?window.location:null;return!!i&&new URLSearchParams(i.search).has(e)},hp=(e,t)=>{const i=null!=t?t:"undefined"!=typeof window?window.location:null;if(!i)return!1;const n=i.href,r=i.pathname;return e instanceof RegExp?e.test(n)||e.test(r):e.startsWith("http://")||e.startsWith("https://")?n.includes(e):r.includes(e)},pp=e=>"string"==typeof e||Array.isArray(e)?{selector:e}:e,mp=(e,t,i)=>{const n=null!=t?t:"undefined"!=typeof window?window.document:null;if(!n)return null;const r=null!=e?e:up;for(const[s,o]of Object.entries(r)){const e=pp(o);if((Array.isArray(e.selector)?e.selector:[e.selector]).some(e=>{try{return null!==n.querySelector(e)}catch(t){return!1}})&&(!e.urlParam||dp(e.urlParam,i))&&(!e.url||hp(e.url,i)))return s}return null},gp=(()=>{function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e})();function fp(e){return t=>0===e?Wd():t.lift(new _p(e))}class _p{constructor(e){if(this.total=e,this.total<0)throw new gp}call(e,t){return t.subscribe(new vp(e,this.total))}}class vp extends m{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function bp(e){return t=>t.lift(new yp(e))}class yp{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new wp(e,this.predicate))}}class wp extends m{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}var kp=function(e){return e[e.none=0]="none",e[e.error=1]="error",e[e.warn=2]="warn",e[e.all=3]="all",e}({});function Cp(e,...t){Ep().pipe(fp(1)).subscribe(i=>{kp[i]>=kp.all&&console.debug(e,...t)})}function Sp(e,...t){Ep().pipe(fp(1)).subscribe(i=>{kp[i]>=kp.warn&&console.warn(e,...t)})}function xp(e,...t){Ep().pipe(fp(1)).subscribe(i=>{kp[i]>=kp.error&&console.error(e,...t)})}function Ep(){return new v(e=>{const t=setInterval(()=>{var i;if(window.mealzInternal){clearInterval(t);const n=null===(i=window.mealzInternal)||void 0===i?void 0:i.config.logLevel;n&&n.pipe(bp(e=>void 0===e),fp(1)).subscribe(t=>e.next(t))}},150)})}const Ip="https://api.miam.tech",Pp="https://cdn.jsdelivr.net/npm/mealz-components@2.0.0/dist";let Dp=(()=>{class e{constructor(){this.forbidProfiling=!1,this.disabledAnalytics=!1,this.guestsChanged=new Rc,this.recipePriceChanged=new Rc,this.addAllProductsWasClicked=new Rc,this.hookCallback=(e,t)=>(Sp("[Mealz] hookCallback (used to force user login) not set"),!1),this.forcePosCallback=e=>(Sp("[Mealz] forcePosCallback (used to force selected shop) not set"),!1)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const Tp=new Rc;function Ap(e){Tp.emit(JSON.stringify({name:e.name,path:e.url,props:e.props}))}let Rp=(()=>{class e{constructor(e){this.contextRegistryService=e,this.isMealzPage=!1,this.eventEmitter=Tp,this.subscriptions=[],this.alreadyInitialized$=new cp(!1),this.queuedEvents=[],this.subscriptions.push(this.alreadyInitialized$.subscribe(e=>{e&&this.executeQueuedEvents()}))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}setAbTestKey(e){this.callMethodOrAddToQueue(()=>Object(ap.setABTestKey)(e))}init(e){var t;if(!this.alreadyInitialized$.value)return e?(Object(ap.initSharedAnalytics)(e,"10.0.2",Ap,"prod"),(null===(t=localStorage.getItem("_miam/affiliate"))||void 0===t?void 0:t.length)>0&&Object(ap.setAffiliate)(localStorage.getItem("_miam/affiliate")),void this.alreadyInitialized$.next(!0)):xp("[Mealz] Analytics not initialized (domain cannot be null)")}sendEvent(e,t,i,n){if(this.contextRegistryService.disabledAnalytics&&this.contextRegistryService.forbidProfiling)return;const r=n||(this.isMealzPage?lp.MEALZ:lp.EMPTY);this.callMethodOrAddToQueue(()=>Object(ap.sendEvent)(e,function(e){return e?`${location.origin}/miam${e}`:location.href}(t),r,i))}sendRemoveRecipesEvents(e,t){const i=null!=t?t:mp();e.forEach(e=>{this.sendEvent("recipe.remove",e.params.eventTrace.originPath,{recipe_id:e.params.recipeId},i)})}sendAddRecipesEvents(e,t){const i=null!=t?t:mp();e.forEach(e=>{this.sendEvent("recipe.add",e.params.eventTrace.originPath,{recipe_id:e.params.recipeId},i)})}sendUpdateGuestsEvents(e,t){const i=null!=t?t:mp();e.forEach(e=>{this.sendEvent("recipe.change-guests",e.params.eventTrace.originPath,{recipe_id:e.params.recipeId},i)})}sendEventsOfResetBasket(e,t,i){const n=null!=i?i:mp();e.recipeInfos.forEach(e=>{this.sendEvent("recipe.remove",t.originPath,{recipe_id:e.id},n)})}sendAddProductsEvents(e,t){const i=null!=t?t:mp(),n=e.length>1;e.forEach(e=>{let t;t=e.params.previousItem?"replacement":n?"bulk":"unit",this.sendEvent("entry.added",e.params.eventTrace.originPath,{entry_name:e.params.basketEntry.name,item_id:e.params.basketEntry.selectedItem.id,ext_item_id:e.params.basketEntry.selectedItem.attributes["ext-id"],item_ean:e.params.basketEntry.selectedItem.ean,product_quantity:e.params.basketEntry.quantity.toString(),recipe_id:e.params.recipeId,add_source:t},i)})}sendRemoveProductsEvents(e,t){const i=null!=t?t:mp();e.forEach(e=>{this.sendEvent("entry.deleted",e.params.eventTrace.originPath,{entry_name:e.params.basketEntry.name,item_id:e.params.basketEntry.selectedItem.id,ext_item_id:e.params.basketEntry.selectedItem.attributes["ext-id"],item_ean:e.params.basketEntry.selectedItem.ean,product_quantity:e.params.basketEntry.quantity.toString(),recipe_id:e.params.recipeId},i)})}sendProductsChangeQuantityEvents(e,t){const i=null!=t?t:mp();e.forEach(e=>{this.sendEvent("entry.change-quantity",e.params.eventTrace.originPath,{entry_name:e.params.basketEntry.name,item_id:e.params.basketEntry.selectedItem.id,ext_item_id:e.params.basketEntry.selectedItem.attributes["ext-id"],item_ean:e.params.basketEntry.selectedItem.ean,product_quantity:e.params.newQuantity.toString(),recipe_id:e.params.recipeId},i)})}callMethodOrAddToQueue(e){this.alreadyInitialized$.value?e():this.queuedEvents.push(e)}executeQueuedEvents(){this.queuedEvents.forEach(e=>e()),this.queuedEvents=[]}}return e.\u0275fac=function(t){return new(t||e)(nn(Dp))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Op=function(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e},Fp=i("fw2E"),Bp=Fp.a.Symbol,Mp=Object.prototype,Lp=Mp.hasOwnProperty,$p=Mp.toString,jp=Bp?Bp.toStringTag:void 0,zp=Object.prototype.toString,Np=Bp?Bp.toStringTag:void 0,Vp=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Np&&Np in Object(e)?function(e){var t=Lp.call(e,jp),i=e[jp];try{e[jp]=void 0;var n=!0}catch(s){}var r=$p.call(e);return n&&(t?e[jp]=i:delete e[jp]),r}(e):function(e){return zp.call(e)}(e)},Hp=function(e){return null!=e&&"object"==typeof e},Up=function(e){return Hp(e)&&"[object Arguments]"==Vp(e)},qp=Object.prototype,Gp=qp.hasOwnProperty,Wp=qp.propertyIsEnumerable,Zp=Up(function(){return arguments}())?Up:function(e){return Hp(e)&&Gp.call(e,"callee")&&!Wp.call(e,"callee")},Qp=Array.isArray,Yp=Bp?Bp.isConcatSpreadable:void 0,Kp=function(e){return Qp(e)||Zp(e)||!!(Yp&&e&&e[Yp])},Jp=function e(t,i,n,r,s){var o=-1,a=t.length;for(n||(n=Kp),s||(s=[]);++o<a;){var c=t[o];i>0&&n(c)?i>1?e(c,i-1,n,r,s):Op(s,c):r||(s[s.length]=c)}return s},Xp=function(e){return null!=e&&e.length?Jp(e,1):[]},em=function(e,t){return e===t||e!=e&&t!=t},tm=function(e,t){for(var i=e.length;i--;)if(em(e[i][0],t))return i;return-1},im=Array.prototype.splice;function nm(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}nm.prototype.clear=function(){this.__data__=[],this.size=0},nm.prototype.delete=function(e){var t=this.__data__,i=tm(t,e);return!(i<0||(i==t.length-1?t.pop():im.call(t,i,1),--this.size,0))},nm.prototype.get=function(e){var t=this.__data__,i=tm(t,e);return i<0?void 0:t[i][1]},nm.prototype.has=function(e){return tm(this.__data__,e)>-1},nm.prototype.set=function(e,t){var i=this.__data__,n=tm(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var rm,sm=nm,om=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},am=function(e){if(!om(e))return!1;var t=Vp(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},cm=Fp.a["__core-js_shared__"],lm=(rm=/[^.]+$/.exec(cm&&cm.keys&&cm.keys.IE_PROTO||""))?"Symbol(src)_1."+rm:"",um=Function.prototype.toString,dm=function(e){if(null!=e){try{return um.call(e)}catch(t){}try{return e+""}catch(t){}}return""},hm=/^\[object .+?Constructor\]$/,pm=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mm=function(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!om(e)||(t=e,lm&&lm in t))&&(am(e)?pm:hm).test(dm(e));var t}(i)?i:void 0},gm=mm(Fp.a,"Map"),fm=mm(Object,"create"),_m=Object.prototype.hasOwnProperty,vm=Object.prototype.hasOwnProperty;function bm(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}bm.prototype.clear=function(){this.__data__=fm?fm(null):{},this.size=0},bm.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},bm.prototype.get=function(e){var t=this.__data__;if(fm){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return _m.call(t,e)?t[e]:void 0},bm.prototype.has=function(e){var t=this.__data__;return fm?void 0!==t[e]:vm.call(t,e)},bm.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=fm&&void 0===t?"__lodash_hash_undefined__":t,this};var ym=bm,wm=function(e,t){var i,n,r=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof t?"string":"hash"]:r.map};function km(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}km.prototype.clear=function(){this.size=0,this.__data__={hash:new ym,map:new(gm||sm),string:new ym}},km.prototype.delete=function(e){var t=wm(this,e).delete(e);return this.size-=t?1:0,t},km.prototype.get=function(e){return wm(this,e).get(e)},km.prototype.has=function(e){return wm(this,e).has(e)},km.prototype.set=function(e,t){var i=wm(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};var Cm=km;function Sm(e){var t=this.__data__=new sm(e);this.size=t.size}Sm.prototype.clear=function(){this.__data__=new sm,this.size=0},Sm.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},Sm.prototype.get=function(e){return this.__data__.get(e)},Sm.prototype.has=function(e){return this.__data__.has(e)},Sm.prototype.set=function(e,t){var i=this.__data__;if(i instanceof sm){var n=i.__data__;if(!gm||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new Cm(n)}return i.set(e,t),this.size=i.size,this};var xm=Sm;function Em(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new Cm;++t<i;)this.add(e[t])}Em.prototype.add=Em.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Em.prototype.has=function(e){return this.__data__.has(e)};var Im=Em,Pm=function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1},Dm=function(e,t){return e.has(t)},Tm=function(e,t,i,n,r,s){var o=1&i,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var d=-1,h=!0,p=2&i?new Im:void 0;for(s.set(e,t),s.set(t,e);++d<a;){var m=e[d],g=t[d];if(n)var f=o?n(g,m,d,t,e,s):n(m,g,d,e,t,s);if(void 0!==f){if(f)continue;h=!1;break}if(p){if(!Pm(t,(function(e,t){if(!Dm(p,t)&&(m===e||r(m,e,i,n,s)))return p.push(t)}))){h=!1;break}}else if(m!==g&&!r(m,g,i,n,s)){h=!1;break}}return s.delete(e),s.delete(t),h},Am=Fp.a.Uint8Array,Rm=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i},Om=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i},Fm=Bp?Bp.prototype:void 0,Bm=Fm?Fm.valueOf:void 0,Mm=Object.prototype.propertyIsEnumerable,Lm=Object.getOwnPropertySymbols,$m=Lm?function(e){return null==e?[]:(e=Object(e),function(t,i){for(var n=-1,r=null==t?0:t.length,s=0,o=[];++n<r;){var a=t[n];Mm.call(e,a)&&(o[s++]=a)}return o}(Lm(e)))}:function(){return[]},jm=i("TPB+"),zm=/^(?:0|[1-9]\d*)$/,Nm=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&zm.test(e))&&e>-1&&e%1==0&&e<t},Vm=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Hm={};Hm["[object Float32Array]"]=Hm["[object Float64Array]"]=Hm["[object Int8Array]"]=Hm["[object Int16Array]"]=Hm["[object Int32Array]"]=Hm["[object Uint8Array]"]=Hm["[object Uint8ClampedArray]"]=Hm["[object Uint16Array]"]=Hm["[object Uint32Array]"]=!0,Hm["[object Arguments]"]=Hm["[object Array]"]=Hm["[object ArrayBuffer]"]=Hm["[object Boolean]"]=Hm["[object DataView]"]=Hm["[object Date]"]=Hm["[object Error]"]=Hm["[object Function]"]=Hm["[object Map]"]=Hm["[object Number]"]=Hm["[object Object]"]=Hm["[object RegExp]"]=Hm["[object Set]"]=Hm["[object String]"]=Hm["[object WeakMap]"]=!1;var Um,qm=i("Af8m"),Gm=qm.a&&qm.a.isTypedArray,Wm=Gm?(Um=Gm,function(e){return Um(e)}):function(e){return Hp(e)&&Vm(e.length)&&!!Hm[Vp(e)]},Zm=Object.prototype.hasOwnProperty,Qm=Object.prototype,Ym=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),Km=Object.prototype.hasOwnProperty,Jm=function(e){return null!=e&&Vm(e.length)&&!am(e)},Xm=function(e){return Jm(e)?function(e,t){var i=Qp(e),n=!i&&Zp(e),r=!i&&!n&&Object(jm.a)(e),s=!i&&!n&&!r&&Wm(e),o=i||n||r||s,a=o?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],c=a.length;for(var l in e)!t&&!Zm.call(e,l)||o&&("length"==l||r&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Nm(l,c))||a.push(l);return a}(e):function(e){if((t=e)!==("function"==typeof(i=t&&t.constructor)&&i.prototype||Qm))return Ym(e);var t,i,n=[];for(var r in Object(e))Km.call(e,r)&&"constructor"!=r&&n.push(r);return n}(e)},eg=function(e){return function(e,t,i){var n=t(e);return Qp(e)?n:Op(n,i(e))}(e,Xm,$m)},tg=Object.prototype.hasOwnProperty,ig=mm(Fp.a,"DataView"),ng=mm(Fp.a,"Promise"),rg=mm(Fp.a,"Set"),sg=mm(Fp.a,"WeakMap"),og=dm(ig),ag=dm(gm),cg=dm(ng),lg=dm(rg),ug=dm(sg),dg=Vp;(ig&&"[object DataView]"!=dg(new ig(new ArrayBuffer(1)))||gm&&"[object Map]"!=dg(new gm)||ng&&"[object Promise]"!=dg(ng.resolve())||rg&&"[object Set]"!=dg(new rg)||sg&&"[object WeakMap]"!=dg(new sg))&&(dg=function(e){var t=Vp(e),i="[object Object]"==t?e.constructor:void 0,n=i?dm(i):"";if(n)switch(n){case og:return"[object DataView]";case ag:return"[object Map]";case cg:return"[object Promise]";case lg:return"[object Set]";case ug:return"[object WeakMap]"}return t});var hg=dg,pg=Object.prototype.hasOwnProperty,mg=function e(t,i,n,r,s){return t===i||(null==t||null==i||!Hp(t)&&!Hp(i)?t!=t&&i!=i:function(e,t,i,n,r,s){var o=Qp(e),a=Qp(t),c=o?"[object Array]":hg(e),l=a?"[object Array]":hg(t),u="[object Object]"==(c="[object Arguments]"==c?"[object Object]":c),d="[object Object]"==(l="[object Arguments]"==l?"[object Object]":l),h=c==l;if(h&&Object(jm.a)(e)){if(!Object(jm.a)(t))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new xm),o||Wm(e)?Tm(e,t,i,n,r,s):function(e,t,i,n,r,s,o){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new Am(e),new Am(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return em(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Rm;case"[object Set]":if(a||(a=Om),e.size!=t.size&&!(1&n))return!1;var c=o.get(e);if(c)return c==t;n|=2,o.set(e,t);var l=Tm(a(e),a(t),n,r,s,o);return o.delete(e),l;case"[object Symbol]":if(Bm)return Bm.call(e)==Bm.call(t)}return!1}(e,t,c,i,n,r,s);if(!(1&i)){var p=u&&pg.call(e,"__wrapped__"),m=d&&pg.call(t,"__wrapped__");if(p||m){var g=p?e.value():e,f=m?t.value():t;return s||(s=new xm),r(g,f,i,n,s)}}return!!h&&(s||(s=new xm),function(e,t,i,n,r,s){var o=1&i,a=eg(e),c=a.length;if(c!=eg(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:tg.call(t,u)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var p=!0;s.set(e,t),s.set(t,e);for(var m=o;++l<c;){var g=e[u=a[l]],f=t[u];if(n)var _=o?n(f,g,u,t,e,s):n(g,f,u,e,t,s);if(!(void 0===_?g===f||r(g,f,i,n,s):_)){p=!1;break}m||(m="constructor"==u)}if(p&&!m){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,i,n,r,s))}(t,i,n,r,e,s))},gg=function(e){return e==e&&!om(e)},fg=function(e,t){return function(i){return null!=i&&i[e]===t&&(void 0!==t||e in Object(i))}},_g=function(e){return"symbol"==typeof e||Hp(e)&&"[object Symbol]"==Vp(e)},vg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bg=/^\w*$/,yg=function(e,t){if(Qp(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!_g(e))||bg.test(e)||!vg.test(e)||null!=t&&e in Object(t)};function wg(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=e.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(wg.Cache||Cm),i}wg.Cache=Cm;var kg,Cg,Sg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xg=/\\(\\)?/g,Eg=(kg=wg((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Sg,(function(e,i,n,r){t.push(n?r.replace(xg,"$1"):i||e)})),t}),(function(e){return 500===Cg.size&&Cg.clear(),e})),Cg=kg.cache,kg),Ig=function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r},Pg=Bp?Bp.prototype:void 0,Dg=Pg?Pg.toString:void 0,Tg=function(e,t){return Qp(e)?e:yg(e,t)?[e]:Eg(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(Qp(t))return Ig(t,e)+"";if(_g(t))return Dg?Dg.call(t):"";var i=t+"";return"0"==i&&1/t==-1/0?"-0":i}(e)}(e))},Ag=function(e){if("string"==typeof e||_g(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Rg=function(e,t){for(var i=0,n=(t=Tg(t,e)).length;null!=e&&i<n;)e=e[Ag(t[i++])];return i&&i==n?e:void 0},Og=function(e,t,i){var n=null==e?void 0:Rg(e,t);return void 0===n?i:n},Fg=function(e,t){return null!=e&&t in Object(e)},Bg=function(e){return e},Mg=function(e){return"function"==typeof e?e:null==e?Bg:"object"==typeof e?Qp(e)?(r=e[1],yg(n=e[0])&&gg(r)?fg(Ag(n),r):function(e){var t=Og(e,n);return void 0===t&&t===r?function(e,t){return null!=e&&function(e,t,i){for(var n=-1,r=(t=Tg(t,e)).length,s=!1;++n<r;){var o=Ag(t[n]);if(!(s=null!=e&&i(e,o)))break;e=e[o]}return s||++n!=r?s:!!(r=null==e?0:e.length)&&Vm(r)&&Nm(o,r)&&(Qp(e)||Zp(e))}(e,t,Fg)}(e,n):mg(r,t,3)}):1==(i=function(e){for(var t=Xm(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,gg(r)]}return t}(t=e)).length&&i[0][2]?fg(i[0][0],i[0][1]):function(e){return e===t||function(e,t,i,n){var r=i.length,s=r;if(null==e)return!s;for(e=Object(e);r--;){var o=i[r];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++r<s;){var a=(o=i[r])[0],c=e[a],l=o[1];if(o[2]){if(void 0===c&&!(a in e))return!1}else{var u,d=new xm;if(!(void 0===u?mg(l,c,3,void 0,d):u))return!1}}return!0}(e,0,i)}:function(e){return yg(e)?(t=Ag(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Rg(t,e)}}(e);var t}(e);var t,i,n,r},Lg=function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)},$g=Math.max,jg=function(e,t,i){return t=$g(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,s=$g(n.length-t,0),o=Array(s);++r<s;)o[r]=n[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=n[r];return a[t]=i(o),Lg(e,this,a)}},zg=function(){try{var e=mm(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Ng=Date.now,Vg=function(e){var t=0,i=0;return function(){var n=Ng(),r=16-(n-i);if(i=n,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(zg?function(e,t){return zg(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Bg),Hg=function(e){return e!=e},Ug=function(e,t){return!(null==e||!e.length)&&function(e,t,i){return t==t?function(e,t,i){for(var n=-1,r=e.length;++n<r;)if(e[n]===t)return n;return-1}(e,t):function(e,t,i,n){for(var r=e.length,s=-1;++s<r;)if(t(e[s],s,e))return s;return-1}(e,Hg)}(e,t)>-1},qg=rg&&1/Om(new rg([,-0]))[1]==1/0?function(e){return new rg(e)}:function(){},Gg=function(e){return Hp(e)&&Jm(e)},Wg=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0},Zg=function(e,t){return Vg(jg(e,void 0,Bg),e+"")}((function(e){var t=Wg(e);return Gg(t)&&(t=void 0),function(e,t,i){var n=-1,r=Ug,s=e.length,o=!0,a=[],c=a;if(s>=200){var l=t?null:qg(e);if(l)return Om(l);o=!1,r=Dm,c=new Im}else c=t?[]:a;e:for(;++n<s;){var u=e[n],d=t?t(u):u;if(u=0!==u?u:0,o&&d==d){for(var h=c.length;h--;)if(c[h]===d)continue e;t&&c.push(d),a.push(u)}else r(c,d,undefined)||(c!==a&&c.push(d),a.push(u))}return a}(Jp(e,1,Gg,!0),Mg(t))}));class Qg extends m{notifyNext(e,t,i,n,r){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class Yg extends m{constructor(e,t,i){super(),this.parent=e,this.outerValue=t,this.outerIndex=i,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function Kg(e,t,i,n,r=new Yg(e,i,n)){if(!r.closed)return t instanceof v?t.subscribe(r):F(t)(r)}const Jg={};function Xg(...e){let t=void 0,i=void 0;return x(e[e.length-1])&&(i=e.pop()),"function"==typeof e[e.length-1]&&(t=e.pop()),1===e.length&&c(e[0])&&(e=e[0]),U(e,i).lift(new ef(t))}class ef{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new tf(e,this.resultSelector))}}class tf extends Qg{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(Jg),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i<t;i++)this.add(Kg(this,e[i],void 0,i))}}notifyComplete(e){0==(this.active-=1)&&this.destination.complete()}notifyNext(e,t,i){const n=this.values,r=this.toRespond?n[i]===Jg?--this.toRespond:this.toRespond:0;n[i]=t,0===r&&(this.resultSelector?this._tryResultSelector(n):this.destination.next(n.slice()))}_tryResultSelector(e){let t;try{t=this.resultSelector.apply(this,e)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}function nf(...e){if(1===e.length){const t=e[0];if(c(t))return rf(t,null);if(l(t)&&Object.getPrototypeOf(t)===Object.prototype){const e=Object.keys(t);return rf(e.map(e=>t[e]),e)}}if("function"==typeof e[e.length-1]){const t=e.pop();return rf(e=1===e.length&&c(e[0])?e[0]:e,null).pipe(E(e=>t(...e)))}return rf(e,null)}function rf(e,t){return new v(i=>{const n=e.length;if(0===n)return void i.complete();const r=new Array(n);let s=0,o=0;for(let a=0;a<n;a++){const c=M(e[a]);let l=!1;i.add(c.subscribe({next:e=>{l||(l=!0,o++),r[a]=e},error:e=>i.error(e),complete:()=>{s++,s!==n&&l||(o===n&&i.next(t?t.reduce((e,t,i)=>(e[t]=r[i],e),{}):r),i.complete())}}))}})}const sf=new Hd(zd);function of(e,t=sf){return i=>i.lift(new af(e,t))}class af{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new cf(e,this.dueTime,this.scheduler))}}class cf extends m{constructor(e,t,i){super(e),this.dueTime=t,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(lf,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function lf(e){e.debouncedNext()}function uf(){}function df(e,t,i){return function(n){return n.lift(new hf(e,t,i))}}class hf{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new pf(e,this.nextOrObserver,this.error,this.complete))}}class pf extends m{constructor(e,t,i,r){super(e),this._tapNext=uf,this._tapError=uf,this._tapComplete=uf,this._tapError=i||uf,this._tapComplete=r||uf,n(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||uf,this._tapError=t.error||uf,this._tapComplete=t.complete||uf)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}class mf extends rp{constructor(){super(),this.attributes={name:"",quantity:"",unit:"",importance:"",active:!0,"forced-eans":[],"picture-url":"",position:-1},this.relationships={recipe:new ip,"quantity-unit":new ip,definition:new ip},Object.freeze(this.attributes.name),Object.freeze(this.attributes.unit),Object.freeze(this.picture)}get quantity(){return this.attributes.quantity?parseFloat(this.attributes.quantity).toString():"1"}get picture(){return this.attributes["picture-url"]}get forcedEans(){return this.attributes["forced-eans"]}}class gf extends rp{constructor(){super(...arguments),this.attributes={"activation-count":"",name:"","often-deleted":"","picture-url":"",plural:!0,"total-count":0}}}class ff extends rp{constructor(){super(...arguments),this.attributes={name:"",status:"",description:"",ean:"","ext-id":"",brand:"","product-page":"",image:"","unit-price":"",currency:"","capacity-unit":"","capacity-volume":"","capacity-factor":1,"created-at":"","updated-at":"",sponsored:!1,promoted:!1,"variable-capacity":!1,"pft-plages":[]}}get inBasket(){return this._inBasket}set inBasket(e){this._inBasket=e}get capacity(){return this.hasVariableCapacity?this.variableCapacity:this.fixedCapacity}get hasVariableCapacity(){return!(!this.attributes["variable-capacity"]||!this.variableCapacity)}get fixedCapacity(){var e;let t=this.capacityVolume;return this.capacityFactor&&this.capacityFactor>1&&(t=`${this.capacityFactor} x ${t}`),(null===(e=this.capacityUnit)||void 0===e?void 0:e.length)>0&&(t=`${t} ${this.attributes["capacity-unit"]}`),t}get variableCapacity(){return this._variableCapacity}set variableCapacity(e){e&&e.length>0&&(this._variableCapacity=`${e} ${this.capacityUnit}`)}get capacityVolume(){return this.attributes["capacity-volume"]}get capacityFactor(){return this.attributes["capacity-factor"]}get capacityUnit(){return this.attributes["capacity-unit"]}get pftPlages(){return this.attributes["pft-plages"]}get price(){return this.attributes["unit-price"]?parseFloat(this.attributes["unit-price"]):0}get ean(){return this.attributes.ean}get extId(){return this.attributes["ext-id"]}set extId(e){this.attributes["ext-id"]=e}}class _f extends rp{constructor(){super(...arguments),this.attributes={name:"",settings:{drive:{enabled:!0,logo:""},delivery:{enabled:!0,logo:""},mobile_warning:!1},"active-items-count":0,distance:0,address:"",latitude:"",longitude:"","ext-id":""},this.relationships={supplier:new ip,items:new ep}}get references(){return new Intl.NumberFormat("Fr-fr").format(this.attributes["active-items-count"])}get driveEnabled(){const e=this.attributes.settings;return e&&e.drive&&e.drive.enabled}get deliveryEnabled(){const e=this.attributes.settings;return e&&e.delivery&&e.delivery.enabled}get extId(){return this.attributes["ext-id"]}set extId(e){this.attributes["ext-id"]=e}}class vf extends rp{constructor(){super(...arguments),this.attributes={title:"","author-id":"",editable:!1,shared:!1,"catalog-category":!1,"catalog-position":"","recipes-count":"","media-url":"",settings:{}},this.relationships={provider:new ip,status:new ip,recipes:new ep,"shared-suppliers":new ep}}get title(){return this.attributes.title}get status(){return this.relationships&&this.relationships.status&&this.relationships.status.data}get subtitle(){return this.attributes.settings.subtitle}}var bf=i("yerO");class yf extends rp{constructor(){super(...arguments),this.attributes={title:"","ext-id":"","ext-link":"",description:"","number-of-guests":"","preparation-time":"","preheating-time":"","cooking-time":"","resting-time":"","media-url":"",source:"","informational-page-html":"","filigrane-logo-url":"","informational-sentence":"","order-history":"",difficulty:1,cost:1,suggested:!1,popularity:0,"video-id":"",promoted:!1,editable:!1,position:-1},this.relationships={ingredients:new ep,"ingredients-definitions":new ep,"recipe-steps":new ep,"recipe-provider":new ip,"recipe-status":new ip,tags:new ep,"recipe-type":new ip,sponsors:new ep,packages:new ep},this.ttl=3600,this.finalTimer=this.attributes["preparation-time"]+this.attributes["preheating-time"]+this.attributes["cooking-time"]+this.attributes["resting-time"]}get title(){return this.attributes.title}get promoted(){return this.attributes.promoted}get guests(){return this.attributes["number-of-guests"]}get filigraneLogoUrl(){return this.attributes["filigrane-logo-url"]?this.attributes["filigrane-logo-url"]:null}get sponsorName(){return this.sponsors.length>0?this.sponsors[0].attributes.name:null}get sponsorLogoUrl(){return this.sponsors.length>0?this.sponsors[0].attributes["logo-url"]:null}get informationalSentence(){return this.attributes["informational-sentence"]}get costLabel(){switch(this.attributes.cost){case 1:return"faible";case 2:return"moyen";case 3:return"\xe9lev\xe9";default:return"moyen"}}get orderHistory(){return this.attributes["order-history"]}get difficulty(){return this.attributes.difficulty}set difficulty(e){this.attributes.difficulty=e}get totalTime(){const e=Object(bf.normalize)(Object(bf.sum)(Object(bf.parse)(this.attributes["preparation-time"]),Object(bf.parse)(this.attributes["cooking-time"]),Object(bf.parse)(this.attributes["resting-time"])));return Object(bf.toMinutes)(e)<10?" < 10 min":this.formatDuration(e)}get preparationTime(){return this.formatDuration(Object(bf.normalize)(Object(bf.parse)(this.attributes["preparation-time"])))}get cookingTime(){return this.formatDuration(Object(bf.normalize)(Object(bf.parse)(this.attributes["cooking-time"])))}get restingTime(){return this.formatDuration(Object(bf.normalize)(Object(bf.parse)(this.attributes["resting-time"])))}get ingredients(){return this.relationships.ingredients.data.sort((e,t)=>e.attributes["forced-eans"]&&e.attributes["forced-eans"].length>0&&!(t.attributes["forced-eans"]&&t.attributes["forced-eans"].length>0)?-1:e.attributes.position-t.attributes.position)}get sponsors(){var e,t;return null===(t=null===(e=this.relationships)||void 0===e?void 0:e.sponsors)||void 0===t?void 0:t.data}get steps(){return this.relationships["recipe-steps"].data.sort((e,t)=>e.attributes["step-number"]>t.attributes["step-number"]?1:-1)}get status(){return this.relationships&&this.relationships["recipe-status"]&&this.relationships["recipe-status"].data}get recipeType(){return this.relationships&&this.relationships["recipe-type"]&&this.relationships["recipe-type"].data}get modifiedIngredients(){return this.normalizedIngredients.map(e=>Object.assign(Object.assign({},e),{qty:e.qty*(this.modifiedGuests||+this.guests)}))}get normalizedIngredients(){return this._normalizedIngredients&&0!==this._normalizedIngredients.length||(this._normalizedIngredients=this.ingredients.map(e=>({name:e.attributes.name,qty:+e.quantity/(+this.guests||1),unit:e.attributes.unit,picture:e.picture}))),this._normalizedIngredients}get videoId(){return this.attributes["video-id"]}get position(){return this.attributes.position}set position(e){this.attributes.position=e}formatDuration(e){if(!Object(bf.toMinutes)(e))return"-";if(e.days&&(e.hours+=24*e.days),!e.hours)return e.minutes+" min";let t=e.hours+" h";return e.minutes&&(t+=`${e.minutes<10?" 0":" "}${e.minutes}`),t}}class wf extends rp{constructor(){super(...arguments),this.attributes={name:"NoName",logo:null},this.relationships={recipes:new ep}}}class kf extends rp{constructor(){super(...arguments),this.attributes={name:"",label:""}}get hidden(){return"DELETED"===this.name}get name(){return this.attributes.name}get label(){return this.attributes.label}get icon(){switch(this.attributes.name){case"DRAFT":return"text_snippet";case"SUBMITTED":return"schedule";case"ACTIVE":return"done";case"INACTIVE":default:return"highlight_off"}}get color(){switch(this.attributes.name){case"DRAFT":return null;case"SUBMITTED":return"accent";case"ACTIVE":return"primary";case"INACTIVE":default:return null}}}class Cf extends rp{constructor(){super(...arguments),this.attributes={"step-number":0,title:"",description:"","media-url":null},this.relationships={recipe:new ip}}}class Sf extends rp{constructor(){super(...arguments),this.attributes={"tag-type-id":"",name:"","icon-url":"","picture-url":""}}get tagType(){return this.attributes["tag-type-id"]}get name(){return this.attributes.name}}class xf extends rp{constructor(){super(...arguments),this.attributes={name:""}}get name(){return this.attributes.name}}class Ef extends rp{constructor(){super(...arguments),this.attributes={name:"",description:"",logo:"",settings:{}},this.relationships={"point-of-sales":new ep,"catalog-setting":new ip,items:new ep}}get logo(){let e=this.attributes.logo;return e.match(/^assets\//)&&(e=e.replace("assets","https://miam.tech/fr/assets")),e}}class If extends rp{constructor(){super(...arguments),this.attributes={status:"",confirmed:!1,completion:{total:0,found:0},"recipes-infos":[],"total-price":0,token:null},this.relationships={"basket-entries":new ep}}get completion(){return this.attributes.completion}get recipeInfos(){return this.attributes["recipes-infos"]}get entries(){return this.relationships["basket-entries"]&&this.relationships["basket-entries"].data}get totalPrice(){return this.attributes["total-price"]}get token(){return this.attributes.token}hasRecipe(e){var t;return null===(t=this.recipeInfos)||void 0===t?void 0:t.some(t=>t.id===e)}guestsForRecipe(e){var t;return+(null===(t=this.recipeInfos.find(t=>t.id===e))||void 0===t?void 0:t.guests)}}class Pf extends rp{constructor(){super(...arguments),this.attributes={"selected-item-id":"","learning-factor":1,"basket-entries-items":new Array(0),quantity:1,"quantity-to-add":1,"recipe-ids":[],name:"","capacity-volume":1,"capacity-unit":"",status:"active",price:0,"price-per-unit":0,"unit-of-measurement":"","discount-amount":0,"discount-type":"","discounted-price":0},this.relationships={"selected-item":new ip}}get quantity(){return this.attributes.quantity}set quantity(e){this.attributes.quantity=e}get quantityToAdd(){return this.attributes["quantity-to-add"]}set quantityToAdd(e){this.attributes["quantity-to-add"]=e}get status(){return this.attributes.status}set status(e){this.attributes.status=e}get name(){return this.attributes.name}get nameId(){return this.attributes.name.toLowerCase().replace(/ /g,"_")}get recipesIds(){return this.attributes["recipe-ids"]}get ingredientsQuantity(){return this.attributes["capacity-volume"]}get ingredientsUnit(){return this.attributes["capacity-unit"]}get selectedItem(){return this.relationships["selected-item"].data}get price(){return this.attributes.price}get pricePerUnit(){return this.attributes["price-per-unit"]}get unitOfMeasurement(){return this.attributes["unit-of-measurement"]}get discountAmount(){return this.attributes["discount-amount"]}get discountType(){return this.attributes["discount-type"]}get discountedPrice(){return this.attributes["discounted-price"]}get totalprice(){return this.selectedItem?(this.selectedItem.price*this.attributes.quantity).toFixed(2):""}}class Df{constructor(){this._displayMode=!1}get displayMode(){return this._displayMode}set displayMode(e){e&&(this.description[0]=this.description[0].replace("article","ingr\xe9dient")),this._displayMode=e}static fromRecipe(e,t,i=null,n=null,r=null){const s=new Df;return Object.assign(s,{id:e.id,isRecipe:!0,title:e.attributes.title,picture:e.attributes["media-url"],description:[`${t} article${t>1?"s":""}`],count:e.modifiedGuests||e.guests,entries:r}),i&&s.description.push(""+i.toFixed(2)),null!=n&&(s.price=""+n.toFixed(2)),s}static fromBasketEntry(e,t,i){var n;const r=new Df,s=e.selectedItem,o=e.attributes["basket-entries-items"].find(t=>t.item_id===e.attributes["selected-item-id"]),a=parseFloat(o["unit-price"]),c=null===(n=e.recipesIds)||void 0===n?void 0:n.length;return s&&o&&null!=a&&Object.assign(r,Object.assign({id:e.id,record:e,isRecipe:!1,inlineTag:c&&c>1?`Pour ${c} repas`:null,title:e.name,picture:s.attributes.image,description:[`${s.attributes.brand?s.attributes.brand:""} ${s.attributes.name} | ${s.capacity}`],price:""+a.toFixed(2),count:e.quantity+e.quantityToAdd},t&&{recipe:t,ingredient:i})),r}hasEntries(){return this.entries&&(this.entries.found.length>0||this.entries.notFound.length>0||this.entries.oftenDeleted.length>0||this.entries.removed.length>0)}}class Tf extends rp{constructor(){super(...arguments),this.attributes={name:"","logo-url":"","provider-id":""}}}class Af{constructor(e={}){this.user_metadata={preferences:{}},this.forbidProfiling=!1,Object.assign(this,e)}get supplierId(){var e;return void 0===this.app_metadata.env?null:null===(e=this.app_metadata.env.prod)||void 0===e?void 0:e.supplier_id}}class Rf extends rp{constructor(){super(...arguments),this.attributes={"banner-text":null,"banner-image":null},this.relationships={supplier:new ip}}}class Of extends rp{constructor(){super(...arguments),this.attributes={position:0,height:0,width:0,"video-url":"","picture-url":"",content:"","background-color":"","font-size":0,"font-color":""},this.relationships={"sponsor-block-type":new ip,sponsor:new ip}}get position(){return this.attributes.position}get height(){var e,t;return this.attributes.height||(null===(t=null===(e=this.relationships["sponsor-block-type"])||void 0===e?void 0:e.data)||void 0===t?void 0:t.defaultHeight)}get width(){var e,t;return this.attributes.width||(null===(t=null===(e=this.relationships["sponsor-block-type"])||void 0===e?void 0:e.data)||void 0===t?void 0:t.defaultWidth)}get videoUrl(){return this.attributes["video-url"]}get pictureUrl(){return this.attributes["picture-url"]}get content(){return this.attributes.content}get backgroundColor(){return this.attributes["background-color"]}get fontSize(){return this.attributes["font-size"]}get fontColor(){return this.attributes["font-color"]}get style(){return{"grid-row":"span "+this.height,"grid-column":"span "+this.width,"aspect-ratio":this.width+" / "+this.height}}}class Ff extends rp{constructor(){super(...arguments),this.attributes={name:"","icon-url":"",description:"","default-height":0,"default-width":0,"mandatory-fields":[]}}get name(){return this.attributes.name}get iconUrl(){return this.attributes["icon-url"]}get description(){return this.attributes.description}get defaultHeight(){return this.attributes["default-height"]}get defaultWidth(){return this.attributes["default-width"]}get mandatoryFields(){return this.attributes["mandatory-fields"]}}class Bf extends rp{constructor(){super(...arguments),this.attributes={"is-past":!0,"recipe-id":""},this.relationships={recipe:new ip}}get isPast(){return this.attributes["is-past"]}set isPast(e){this.attributes["is-past"]=e}toggle(){this.isPast=!this.isPast}}class Mf extends rp{constructor(){super(...arguments),this.attributes={title:"",status:"",guests:4,budget:0,"point-of-sale-id":null},this.relationships={"menu-recipes":new ep,recipes:new ep}}}var Lf=function(e){return e[e.ADD_RECIPE=0]="ADD_RECIPE",e[e.REMOVE_RECIPE=1]="REMOVE_RECIPE",e[e.REMOVE_RECIPE_LIGHT=2]="REMOVE_RECIPE_LIGHT",e[e.UPDATE_RECIPE=3]="UPDATE_RECIPE",e[e.UPDATE_RECIPE_LIGHT=4]="UPDATE_RECIPE_LIGHT",e[e.ADD_RECIPE_LIGHT=5]="ADD_RECIPE_LIGHT",e[e.ADD_PRODUCT=6]="ADD_PRODUCT",e[e.ADD_ITEM=7]="ADD_ITEM",e[e.REMOVE_PRODUCT=8]="REMOVE_PRODUCT",e[e.REMOVE_PRODUCT_FROM_RECIPE=9]="REMOVE_PRODUCT_FROM_RECIPE",e[e.UPDATE_PRODUCT=10]="UPDATE_PRODUCT",e}({}),$f=function(e){return e[e.Success=0]="Success",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e}({});const jf={"basket-entries":["id","quantity","selected-item-id"]};let zf=(()=>{class e extends sp{constructor(e){super(),this.http=e,this.resource=Pf,this.type="basket-entries",this.register()}get sparseFields(){return"fields[basket-entries]="+jf["basket-entries"].join(",")}updateQuantity(e,t){return this.http.patch(encodeURI(`https://api.miam.tech/api/v1/basket-entries/${e}/quantity/${t}?${this.sparseFields}`.trim()),{})}selectItem(e,t,i){const n=new URL(`https://api.miam.tech/api/v1/basket-entries/${e}/select-item/${t}`.trim());return void 0!==i&&n.searchParams.set("forced_quantity",i.toString()),this.http.patch(encodeURI(n.toString()),{})}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Nf=(()=>{class e extends sp{constructor(e){super(),this.http=e,this.resource=Ef,this.type="suppliers",this.supplier$=new cp(null),this.lastSupplierCart=[],this.url=Ip+"/api/v1",this.register()}loadSupplier(e){return this.supplier$.next(null),this.supplier$.value&&this.supplier$.value.id===e?td(null):this.get(e,{include:["catalog-setting"]}).pipe(bp(e=>e.is_loading),df(e=>this.supplier$.next(e)))}getSupplierPointOfSales(e){return this.http.get(`${this.url}/point-of-sales?filter[supplier_id]=${e}`).pipe(E(e=>e.data))}getAffiliateSuppliers(){return this.all({remotefilter:{affiliate:!0}}).pipe(E(e=>e.data))}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Vf=(()=>{class e extends sp{constructor(e,t){super(),this.suppliersService=e,this.http=t,this.resource=_f,this.type="point-of-sales",this.pos$=new cp(void 0),this.basketLoadedForNewPos$=new C,this.posIsLoading$=new cp(!1),this.register(),this.navigateToCachedRecipeOnPosChange()}get waitForPos(){return this.posWasInitialized().pipe(bp(e=>!e),th(()=>this.pos$),bp(e=>!(null==e?void 0:e.id)))}posWasInitialized(){return Xg([this.pos$,this.posIsLoading$]).pipe(bp(([e,t])=>t),E(([e,t])=>null!=e))}loadPos(e){return this.posIsLoading$.next(!0),this.pos$.value&&this.pos$.value.id===e||this.get(e,{include:["supplier"]}).pipe(bp(e=>e.is_loading),df(e=>{this.pos$.next(e),this.posIsLoading$.next(!1)})).subscribe(),this.pos$}isPosValid(){return this.pos$.pipe(E(e=>{var t,i,n;return!!(null===(n=null===(i=null===(t=null==e?void 0:e.relationships)||void 0===t?void 0:t.supplier)||void 0===i?void 0:i.data)||void 0===n?void 0:n.id)}))}loadPosWithExtId(e){return e?(this.posIsLoading$.next(!0),this.suppliersService.supplier$.pipe(bp(e=>!(null==e?void 0:e.id)),fp(1),th(t=>this.all({remotefilter:{"ext-id":e,"supplier-id":t.id},include:["supplier"],fields:{"point-of-sales":["name","settings","active-items-count","distance","address","latitude","longitude","ext-id","supplier"],supplier:["id"]}}).pipe(bp(e=>e.is_loading),df(e=>{e.data.length>0?(this.pos$.next(e.data[0]),this.posIsLoading$.next(!1)):(this.pos$.next(null),this.posIsLoading$.next(!1))})))).subscribe(),this.pos$):(this.pos$.next(null),this.posIsLoading$.next(!1),this.pos$)}navigateToCachedRecipeOnPosChange(){this.isPosValid().pipe(bp(e=>!e),fp(1)).subscribe(()=>{const e=sessionStorage.getItem("_miam/cachedRecipeUrl");e&&(sessionStorage.removeItem("_miam/cachedRecipeUrl"),window.location.href.includes(e)||(window.location.href=e))},e=>{xp(e)})}posFromStorage(){const e=localStorage.getItem("_miam/noSupplier/posId");e?this.loadPos(e).pipe(fp(1)).subscribe():this.loadPosWithExtId(null)}getByAddress(e,t,i,n=!0){let r=`https://api.miam.tech/api/v1/point-of-sales/search?address=${e}&max_distance_km=${t}&filter[affiliate]=true`;return i.length>0&&(r+="&filter[supplier_id]="+i.join(",")),n&&(r+="&include=supplier"),this.http.get(r)}getByCoordinates(e,t,i,n,r=!0){let s=`https://api.miam.tech/api/v1/point-of-sales/search?latitude=${e}&longitude=${t}&max_distance_km=${i}&filter[affiliate]=true`;return n.length>0&&(s+="&filter[supplier_id]="+n.join(",")),r&&(s+="&include=supplier"),this.http.get(s)}emitBasketLoadedForNewPos(){this.basketLoadedForNewPos$.next()}basketLoadedForNewPos(){return this.basketLoadedForNewPos$.asObservable()}}return e.\u0275fac=function(t){return new(t||e)(nn(Nf),nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class Hf{constructor(e={}){Object.assign(this,e)}}class Uf{constructor(e){this.difficulty=null==e?void 0:e.difficulty,this.cost=null==e?void 0:e.cost,this.time=null==e?void 0:e.time,this.search=null==e?void 0:e.search,this.reviewed=null==e?void 0:e.reviewed,this.exclude_no_picture=null==e?void 0:e.exclude_no_picture,this.additionalFilters=null==e?void 0:e.additionalFilters}eventPath(){var e,t;let i="";const n=null===(e=this.additionalFilters)||void 0===e?void 0:e.filters.packages,r=!0===(null===(t=this.additionalFilters)||void 0===t?void 0:t.filters.liked);return n?i+="categories/"+n:r&&(i+="liked"),i}copy(){return new Uf(Object.assign({},this))}isEmpty(){var e;return this.selectableFiltersCount()<1&&""===this.search&&!(null===(e=this.additionalFilters)||void 0===e?void 0:e.filters)}selectableFiltersCount(){return[this.isFieldEmpty(this.difficulty),this.isFieldEmpty(this.cost),this.isFieldEmpty(this.time)].reduce((e,t)=>e+ +!t,0)}isFieldEmpty(e){if(!e)return!0;for(const t of e)if(t.value)return!1;return!0}}let qf=(()=>{class e extends sp{constructor(){super(),this.resource=wf,this.type="recipe-providers",this.register()}init(e){return this.register(),this.loadCachedProvider(e).toPromise()}getCached(){return this.provider}loadCachedProvider(e){return td(e).pipe(th(()=>this.get(e)),df(e=>this.provider=e))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Gf=(()=>{class e extends sp{constructor(){super(),this.resource=kf,this.type="recipe-statuses",this.validated$=new cp(null),this.draft$=new cp(null),this.deleted$=new cp(null),this.inactive$=new cp(null),this.fetching=!1,this.register()}get validated(){return this.validated$.value||this.fetching||this.fetchStatuses(),this.validated$.asObservable().pipe(bp(e=>null==e))}get draft(){return this.draft$.value||this.fetching||this.fetchStatuses(),this.draft$.asObservable().pipe(bp(e=>null==e))}get deleted(){return this.deleted$.value||this.fetching||this.fetchStatuses(),this.deleted$.asObservable().pipe(bp(e=>null==e))}get inactive(){return this.inactive$.value||this.fetching||this.fetchStatuses(),this.inactive$.asObservable().pipe(bp(e=>null==e))}get validatedValue(){return this.validated$.getValue()}get draftValue(){return this.draft$.getValue()}get deletedValue(){return this.deleted$.getValue()}get inactiveValue(){return this.inactive$.getValue()}fetchStatuses(){this.fetching=!0,nf([this.get("validated"),this.get("draft"),this.get("deleted"),this.get("inactive")]).pipe(bp(e=>e.some(e=>e.is_loading||!e))).subscribe(([e,t,i,n])=>{this.validated$.next(e),this.draft$.next(t),this.deleted$.next(i),this.inactive$.next(n)})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Wf=(()=>{class e extends sp{constructor(){super(),this.resource=xf,this.type="recipe-types",this.register()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Zf=(()=>{class e{constructor(){this.subject=new cp(null),this.toaster$=this.subject.asObservable().pipe(id(e=>null!==e))}show(e,t,i,n=!0){this.subject.next({type:e,title:t,customMessage:i,displayIcon:n})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Qf=(()=>{class e{get ignoredIngredients(){return JSON.parse(sessionStorage.getItem("_miam/ignoredBasketEntries")||"[]")}addIgnoredIngredients(e){"string"==typeof e&&(e=[e]),e=e.filter(e=>!this.isIngredientIgnored(e)),sessionStorage.setItem("_miam/ignoredBasketEntries",JSON.stringify([...this.ignoredIngredients,...e]))}isIngredientIgnored(e){return this.ignoredIngredients.includes(e)}removeIngredientFromIgnored(e){sessionStorage.setItem("_miam/ignoredBasketEntries",JSON.stringify(this.ignoredIngredients.filter(t=>t!==e)))}resetIgnoredIngredients(){sessionStorage.removeItem("_miam/ignoredBasketEntries")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Yf=(()=>{class e{constructor(e,t,i,n,r){this.http=e,this.recipesProvidersService=t,this.suppliersService=i,this.toasterService=n,this.ignoredBasketsService=r,this.isLogged$=new cp(!1),this.preferencesActivated$=new cp(!1),this.generatingAuthlessId$=new cp(!1),this.userCoordinates$=new cp(void 0),this.userInfo$=new cp(void 0),this.userRoles$=new cp([]),this.userProvider$=new cp(void 0),this.userSupplier$=new cp(void 0)}get userProvider(){return this.userProvider$.pipe(bp(e=>void 0===e))}get userSupplier(){return this.isAdmin.pipe(th(e=>e?td(null):this.userSupplier$.pipe(bp(e=>void 0===e))))}get userRoles(){return this.userRoles$}get isAdmin(){return this.userRoles$.pipe(bp(e=>0===e.length),th(e=>td(e.includes("Admin"))))}setUserProviderManually(e){this.userProvider$.next(e)}toggleIsLogged(e){this.isLogged$.next(e)}setUserInfo(e){const t=new Af({forbidProfiling:e});return this.http.get(Ip+"/user_info").pipe(fp(1),th(e=>(this.userInfo$.next(Object.assign(t,e)),localStorage.getItem("_miam/authlessId")&&this.ignoredBasketsService.resetIgnoredIngredients(),this.initRoles(),Xg([this.initProvider(),this.initSupplier()]))),bp(e=>void 0===e[0]||void 0===e[1]),fp(1))}resetUserInfo(){this.userInfo$.next(null),this.userRoles$.next([]),this.userProvider$.next(null),this.userSupplier$.next(null)}generateAnonymousUserId(){return this.generatingAuthlessId$.next(!0),this.http.post("https://api.miam.tech/api/v1/users/authless",{}).pipe(E(e=>e.authless_id),df(e=>{localStorage.setItem("_miam/authlessId",e),this.generatingAuthlessId$.next(!1)}))}setPreference(e,t){return this.userInfo$.pipe(bp(e=>!(null==e?void 0:e.user_metadata)),fp(1),th(i=>(i.user_metadata.preferences||(i.user_metadata.preferences={}),i.user_metadata.preferences[e]===t?td(i):(i.user_metadata.preferences[e]=t,this.http.patch(Ip+"/user_info",{data:i}).pipe(E(()=>i))))),df(e=>{this.showRecipeToaster(),this.userInfo$.next(e)}))}showRecipeToaster(){this.toasterService.show($f.Success,"","Vos pr\xe9f\xe9rences ont bien e\u0301te\u0301 mises a\u0300 jour")}hasPreference(e){return this.userInfo$.pipe(bp(e=>!(null==e?void 0:e.user_metadata)),E(t=>{var i,n;return!(!(null===(i=null==t?void 0:t.user_metadata)||void 0===i?void 0:i.preferences)||void 0===(null===(n=null==t?void 0:t.user_metadata)||void 0===n?void 0:n.preferences[e]))}))}setFavoriteItems(e){return this.suppliersService.supplier$.pipe(bp(e=>!e),fp(1),th(t=>this.http.post(Ip+"/set_favorite_items",{item_ext_ids:e,supplier_id:t.id})))}profilingForbidden(){var e;return null===(e=this.userInfo$.value)||void 0===e?void 0:e.forbidProfiling}can(e){return this.userInfo$.pipe(E(t=>null==t?void 0:t.app_metadata.permissions.includes(e)))}initProvider(){return this.userInfo$.pipe(th(e=>this.recipesProvidersService.get((null==e?void 0:e.app_metadata.recipe_provider)||"personal")),bp(e=>null==e),df(e=>this.userProvider$.next(e)))}initSupplier(){return this.userInfo$.pipe(th(e=>(null==e?void 0:e.supplierId)?this.suppliersService.get(e.supplierId):td(null)),bp(e=>void 0===e),df(e=>this.userSupplier$.next(e)))}initRoles(){var e;this.userRoles$.next((null===(e=this.userInfo$.value)||void 0===e?void 0:e.app_metadata.roles)||[])}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(qf),nn(Nf),nn(Zf),nn(Qf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Kf=(()=>{class e extends sp{constructor(){super(),this.resource=gf,this.type="ingredients-definitions",this.register()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const Jf=Ip+"/api/v1/";let Xf=(()=>{class e extends sp{constructor(e,t,i){super(),this.http=e,this.userService=t,this.ingredientsdefinitionsService=i,this.resource=mf,this.type="ingredients",this.isFetchingNames=!1,this.isFetchingUnits=!1,this.register()}getReviewedNames(){return this.reviewedNames||this.isFetchingNames||this.fetchReviewedNames(),this.reviewedNames||[]}getReviewedUnits(){return this.reviewedUnits||this.isFetchingUnits||this.fetchReviewedUnits(),this.reviewedUnits||[]}isReviewedName(e){return this.reviewedNames?td(this.reviewedNames.some(t=>t===e)):this.http.get(Jf+"ingredients-definitions/reviewed_names").pipe(th(t=>(this.reviewedNames=t,td(this.reviewedNames.some(t=>t===e)))))}isReviewedUnit(e){return this.reviewedUnits?td(this.reviewedUnits.some(t=>t.toLowerCase()===e.toLowerCase())):this.http.get(Jf+"quantity-units/reviewed_names").pipe(th(t=>(this.reviewedUnits=[...t.map(e=>e.name)],td(this.reviewedUnits.some(t=>t.toLowerCase()===e.toLowerCase())))))}formatIngredients(e){return nf(e.map(e=>this.get("from_s?ingredient_str="+e)))}createOrUpdateIngredients(e,t){const i=[...e.relationships.ingredients.data],n=[];return t.forEach(t=>{if(t.id){const e=i.findIndex(e=>e.id===t.id),r=i[e].attributes;(r.quantity!==t.attributes.quantity||r.importance!==t.attributes.importance||r["forced-eans"]!==t.attributes["forced-eans"]||r.position!==t.attributes.position)&&(i[e].attributes=Object.assign(Object.assign({},i[e].attributes),{quantity:t.attributes.quantity,importance:t.attributes.importance,"forced-eans":t.attributes["forced-eans"],position:t.attributes.position}),n.push(i[e]))}else{const i=this.new();delete i.id,i.attributes=Object.assign(Object.assign({},i.attributes),{quantity:""+t.attributes.quantity,importance:t.attributes.importance,position:t.attributes.position}),i.addRelationship(e,"recipe"),i.addRelationship(t.relationships["quantity-unit"].data,"quantity-unit"),i.addRelationship(t.relationships.definition.data,"definition"),n.push(i)}}),n}upsertIngredientList(e){return nf(e.map(e=>e.save()))}deleteIngredientList(e){return nf(e.map(e=>this.delete(e)))}searchIngredientByName(e){return this.http.get(`${Jf}ingredients-definitions/search?name=${e}`).pipe(E(e=>{const t=this.ingredientsdefinitionsService.newCollection();return t.fill(e),t.data}))}searchUnitByName(e){return this.http.get(`${Jf}quantity-units/search?name=${e}`).pipe(E(e=>e.data))}fetchQuantityToAdd(e,t,i){return this.http.get(`${Jf}ingredients/${e}/item-quantity?guests=${t}&item_id=${i}`).pipe(E(e=>e["quantity-to-add"]))}getConversion(e,t,i){return this.http.get(`${Jf}quantities-conversions/grams?ingredient_name=${e}&quantity_unit_id=${t}&quantity=${i}`)}fetchReviewedNames(){this.isFetchingNames=!0,this.http.get(Jf+"ingredients-definitions/reviewed_names").subscribe(e=>{this.reviewedNames=e,this.isFetchingNames=!1})}fetchReviewedUnits(){this.isFetchingUnits=!0,this.http.get(Jf+"quantity-units/reviewed_names").subscribe(e=>{this.reviewedUnits=[...e.map(e=>e.name)],this.isFetchingUnits=!1})}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Yf),nn(Kf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var e_=function(e,t){return t.length<2?e:Rg(e,function(e,t,i){var n=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(i=i>r?r:i)<0&&(i+=r),r=t>i?0:i-t>>>0,t>>>=0;for(var s=Array(r);++n<r;)s[n]=e[n+t];return s}(t,0,-1))},t_=Array.prototype.splice,i_=function(e,t){if(e!==t){var i=void 0!==e,n=null===e,r=e==e,s=_g(e),o=void 0!==t,a=null===t,c=t==t,l=_g(t);if(!a&&!l&&!s&&e>t||s&&o&&c&&!a&&!l||n&&o&&c||!i&&c||!r)return 1;if(!n&&!s&&!l&&e<t||l&&i&&r&&!n&&!s||a&&i&&r||!o&&r||!c)return-1}return 0},n_=function(e){return Vg(jg(e,void 0,Xp),e+"")}((function(e,t){var i=null==e?0:e.length,n=function(e,t){for(var i=-1,n=t.length,r=Array(n),s=null==e;++i<n;)r[i]=s?void 0:Og(e,t[i]);return r}(e,t);return function(e,t){for(var i=e?t.length:0,n=i-1;i--;){var r=t[i];if(i==n||r!==s){var s=r;Nm(r)?t_.call(e,r,1):(a=Tg(a=r,o=e),null==(o=e_(o,a))||delete o[Ag(Wg(a))])}}var o,a}(e,Ig(t,(function(e){return Nm(e,i)?+e:e})).sort(i_)),n}));let r_=(()=>{class e extends sp{constructor(){super(),this.resource=Cf,this.type="recipe-steps",this.register()}formToStepsMapper(e,t){const i=[...e.relationships["recipe-steps"].data],n=[];return t.forEach((t,r)=>{if(t.id){const e=i.findIndex(e=>e.id===t.id);i[e].attributes=Object.assign(Object.assign({},i[e].attributes),{"step-number":r,description:t.attributes.description}),n.push(n_(i,[e])[0])}else n.push(this.newStep(t,e,r))}),n}newStep(e,t,i){const n=this.new();return n.addRelationship(t,"recipe"),n.attributes=Object.assign(Object.assign({},n.attributes),{"step-number":i,description:e.attributes.description}),delete n.id,n}createOrUpdateRelatedSteps(e){return nf(e.map(e=>e.save()))}deleteStepList(e){return nf(e.map(e=>this.delete(e)))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),s_=(()=>{class e extends sp{constructor(){super(),this.resource=Tf,this.type="sponsors",this.register()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),o_=(()=>{class e extends sp{constructor(e,t,i){super(),this.http=e,this.providerService=t,this.statusService=i,this.resource=vf,this.type="packages",this.register()}categories_for(e,t=30,i=1){return this.all({page:{size:t,number:i},remotefilter:{category_for:e.join(","),status:"validated"},sort:["catalog_position"]})}unshareWithSupplier(e,t){return this.http.delete(`https://api.miam.tech/api/v1/packages/${e.id}/suppliers/${t.id}`,{headers:{"content-type":"application/vnd.api+json"}})}shareWithSupplierOrUpdate(e,t,i,n,r){const s=Object.assign(Object.assign(Object.assign({},null!==i?{category:i}:{}),null!==n?{catalog_position:n}:{}),null!==r?{edit_content:r}:{}),o=`https://api.miam.tech/api/v1/packages/${e.id}/suppliers/${t.id}`;return e.attributes.shared?this.http.patch(o,s,{headers:{"content-type":"application/vnd.api+json"}}):this.http.post(o,s,{headers:{"content-type":"application/vnd.api+json"}})}removeRecipeFromPackage(e,t){return this.http.delete(`https://api.miam.tech/api/v1/packages/${e.id}/recipes/${t.id}`,{headers:{"content-type":"application/vnd.api+json"}})}addRecipeToPackage(e,t){return this.http.post(`https://api.miam.tech/api/v1/packages/${e.id}/recipes/${t.id}`,{},{headers:{"content-type":"application/vnd.api+json"}})}updateRecipePosition(e,t,i){const n=`https://api.miam.tech/api/v1/packages/${e.id}/recipes/${t.id}`;return null!==i?this.http.patch(n,{position:i},{headers:{"content-type":"application/vnd.api+json"}}):this.http.post(n,{},{headers:{"content-type":"application/vnd.api+json"}})}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(qf),nn(Gf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),a_=(()=>{class e extends sp{constructor(e){super(),this.http=e,this.resource=Sf,this.type="tags",this.register()}autocomplete(e){return this.http.get("https://api.miam.tech/api/v1/tags/autocomplete/"+e)}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),c_=(()=>{class e{constructor(e,t){this.suppliersService=e,this.userService=t}buildHeaders(){let e=new ad;const t=localStorage.getItem("_miam/userId")||localStorage.getItem("_miam/authlessId"),i=sessionStorage.getItem("_miam/sessionId"),n=this.suppliersService.token,r=this.userService.language;return null!==t&&(e=e.set("Authorization","user_id "+t)),n&&(e=e.set("supplier-token",n)),r&&(e=e.set("language-id",r)),i&&(e=e.set("session-id",i)),e}}return e.\u0275fac=function(t){return new(t||e)(nn(Nf),nn(Yf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),l_=(()=>{class e extends sp{constructor(e,t,i,n){super(),this.analyticsService=e,this.userService=t,this.httpUtils=i,this.http=n,this.resource=Bf,this.type="recipe-likes",this.activeRecipeLikes=new Map,this.recipeLikeUpdated$=new cp({id:"",isPast:!1}),this.MAX_RECIPE_LIKES_BEFORE_CLEAN=200,this.cleanUnobservedLikesIfNecessary=new Rc,this.isCleaning=new cp(!1),this.register(),this.cleanUnobservedLikesIfNecessary.pipe(df(()=>this.isCleaning.next(!0)),of(100)).subscribe(()=>{this.doCleanUnobservedLikesIfNecessary()})}getLike(e){return this.addLikeToActivesIfNecessary(e),this.activeRecipeLikes.get(e)}prepareRecipeLikeForUpdate(e,t,i){const n=this.getLike(e).value;return n.isPast=i,n.attributes["recipe-id"]=e,t&&(n.id=t,n.is_new=!1,this.activeRecipeLikes.set(e,new cp(n))),n}updateLike(e,t,i){t.save().subscribe(()=>{this.analyticsService.sendEvent(t.isPast?"recipe.unlike":"recipe.like",i.originPath,{recipe_id:e,category_id:i.props.category_id}),this.recipeLikeUpdated$.next({id:e,isPast:t.isPast}),this.activeRecipeLikes.get(e).next(t)})}addLikeToActivesIfNecessary(e){this.activeRecipeLikes.get(e)||(this.activeRecipeLikes.set(e,new cp(this.new())),this.fetchLikesOfRecipe(e).subscribe(t=>{t.data[0]&&this.activeRecipeLikes.get(e)&&this.activeRecipeLikes.get(e).next(t.data[0])}))}removeLikeFromActivesIfNecessary(e){const t=this.activeRecipeLikes.get(e);t&&0===t.observers.length&&this.activeRecipeLikes.delete(e)}doCleanUnobservedLikesIfNecessary(){if(this.activeRecipeLikes.size<this.MAX_RECIPE_LIKES_BEFORE_CLEAN)return void this.isCleaning.next(!1);const e=[];for(const[t,i]of this.activeRecipeLikes)i&&0===i.observers.length&&e.push(t);e.forEach(e=>this.activeRecipeLikes.delete(e)),this.isCleaning.next(!1)}addLikesToRecipes(e){return this.userService.isLogged$.value?this.isCleaning.asObservable().pipe(bp(e=>e),fp(1),th(()=>this.afterCleanAddLikesToRecipes(e))):td(null)}getLikeHTML(e){const t=this.httpUtils.buildHeaders(),i=new URLSearchParams;return i.append("recipe-id",e),this.http.get("https://ssr-api.mealz.ai/v2/like-button?"+i,{headers:t,responseType:"text"})}afterCleanAddLikesToRecipes(e){return 0===(e=e.filter(e=>!this.activeRecipeLikes.has(e.id))).length?td(null):this.all({page:{size:20,number:1},remotefilter:{recipe_id:e.map(e=>e.id).join(),is_past:"true,false"}}).pipe(bp(e=>e.is_loading),df(t=>{t.data.forEach(t=>{this.activeRecipeLikes.set(t.attributes["recipe-id"].toString(),new cp(t)),e=e.filter(e=>e.id!==t.attributes["recipe-id"].toString())}),e.forEach(e=>{this.activeRecipeLikes.set(e.id,new cp(this.new()))})}))}fetchLikesOfRecipe(e){return this.all({remotefilter:{recipe_id:e,is_past:"true,false"}}).pipe(bp(e=>e.is_loading))}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(Yf),nn(c_),nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),u_=(()=>{class e{constructor(e,t,i,n){this.suppliersService=e,this.titleService=t,this.metaService=i,this.locale=n,this.tags=[],this.subscription=[]}setSEOData(e){var t;this.previousTitle=this.titleService.getTitle(),this.previousRobotsTagContent=null===(t=this.metaService.getTag("name=robots"))||void 0===t?void 0:t.content,this.previousCanonicalLinkHref=window.document.querySelector('link[rel="canonical"]').getAttribute("href"),this.recipe=e,this.subscription.push(this.supplierIsRecipeProvider().subscribe(e=>{e?(this.metaService.updateTag({name:"robots",content:"index, follow"},'name="robots"'),this.setCanonicalUrlTag(),this.addSEOScript()):this.metaService.updateTag({name:"robots",content:"noindex, nofollow"},'name="robots"'),this.addSEOTags(),this.repositionMetaTags()}))}setCanonicalUrlTag(){const e=window.document.querySelector('link[rel="canonical"]');e&&e.setAttribute("href",window.location.href)}repositionMetaTags(){const e=document.head.querySelectorAll("meta"),t=document.getElementsByTagName("head")[0];e.forEach(e=>{t.insertBefore(e,t.firstChild)})}removeSEOData(){this.subscription.forEach(e=>e.unsubscribe()),this.tags.forEach(e=>this.metaService.removeTagElement(e)),this.removeSEOScript(),this.titleService.setTitle(this.previousTitle),this.previousRobotsTagContent?this.metaService.updateTag({name:"robots",content:this.previousRobotsTagContent}):this.metaService.removeTag('name="robots"'),this.rollbackCanonicalLink()}rollbackCanonicalLink(){const e=window.document.querySelector('link[rel="canonical"]');e&&this.previousCanonicalLinkHref?e.setAttribute("href",this.previousCanonicalLinkHref):e.remove()}addSEOTags(){this.titleService.setTitle(this.recipe.attributes.title+" | "+this.supplier.attributes.name),this.tags=this.metaService.addTags([{property:"og:type",content:"recipe"},{property:"og:title",content:this.recipe.attributes.title},{property:"og:image",content:this.recipe.attributes["media-url"]},{property:"og:url",content:window.location.href},{property:"og:site_name",content:this.supplier.attributes.name},{property:"og:locale",content:this.locale},{name:"description",content:"Commandez la recette "+this.recipe.attributes.title+" en 1 clic chez votre magasin "+this.supplier.attributes.name+" pr\xe9f\xe9r\xe9."},{name:"keywords",content:"recettes, cuisine, recette, recettes de cuisine, plat, entr\xe9e, dessert, plat de r\xe9sistance, drive, courses, courses en ligne, courses en drive, courses en 1 clic, faites vos courses, cuisine, ingr\xe9dients, ingr\xe9dient"},{name:"viewport",content:"width=device-width, initial-scale=1.0"},{name:"Distribution",content:"global"},{name:"Author",content:"Mealz, "+this.supplier.attributes.name}])}supplierIsRecipeProvider(){return this.suppliersService.supplier$.pipe(bp(e=>null==e),fp(1),E(e=>(this.supplier=e,this.recipe.relationships["recipe-provider"].data.id.toLowerCase()===e.attributes.name.toLowerCase())))}buildJsonLD(){var e;const t=bf.toString(bf.sum(bf.normalize(this.recipe.attributes["preparation-time"]),bf.normalize(this.recipe.attributes["cooking-time"]),bf.normalize(this.recipe.attributes["resting-time"]))),i=this.recipe.relationships.tags.data.filter(e=>"diet"===e.tagType).map(e=>e.id),n=i.includes("diet_sans-gluten")?"https://schema.org/GlutenFreeDiet":i.includes("diet_sans-lactose")?"https://schema.org/LowLactoseDiet":i.includes("diet_vegan")?"https://schema.org/VeganDiet":i.includes("diet_vegetarien")||i.includes("diet_veggie")?"https://schema.org/VegetarianDiet":"",r=null===(e=this.recipe.relationships.tags.data.find(e=>"meal_type"===e.tagType))||void 0===e?void 0:e.name,s=this.recipe.ingredients.map(e=>`${+e.attributes.quantity} ${e.attributes.unit} ${e.attributes.name}`),o=this.recipe.steps.map(e=>Object.assign({"@type":"HowToStep",text:e.attributes.description},e.attributes["media-url"]?{image:e.attributes["media-url"]}:{}));return JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"@context":"https://schema.org/","@type":"Recipe",name:this.recipe.title,author:{"@type":"Organization",name:this.supplier.attributes.name},recipeIngredient:s,recipeInstructions:o,recipeYield:(this.recipe.modifiedGuests||this.recipe.guests)+" servings"},this.recipe.attributes["media-url"]?{image:[this.recipe.attributes["media-url"]]}:{}),this.recipe.attributes.description?{description:this.recipe.attributes.description}:{}),bf.toMinutes(this.recipe.attributes["preparation-time"])?{prepTime:this.recipe.attributes["preparation-time"]}:{}),bf.toMinutes(this.recipe.attributes["cooking-time"])?{cookTime:this.recipe.attributes["cooking-time"]}:{}),bf.toMinutes(t)?{totalTime:t}:{}),r?{recipeCategory:r}:{}),n?{suitableForDiet:n}:{}))}addSEOScript(){this.removeSEOScript();const e=document.createElement("script");e.type="application/ld+json",e.text=this.buildJsonLD(),e.id="mealz-seo-script",document.head.appendChild(e)}removeSEOScript(){const e=document.getElementById("mealz-seo-script");e&&document.head.removeChild(e)}}return e.\u0275fac=function(t){return new(t||e)(nn(Nf),nn(Gh),nn(Hh),nn(nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),d_=(()=>{class e{constructor(e){this.http=e,this.tagsToAdd=[],this.tagsToRemove=[],this.isOpened$=new cp(!1),this.currentPreferencesNumber=new cp(0),this.guests$=new cp(0),this.initGuests(),this.updatePreferencesCount()}get guests(){return this.guests$.value}set guests(e){this.guests$.next(e)}get preferencesInStorage(){return localStorage.getItem("_miam/preferences")?JSON.parse(localStorage.getItem("_miam/preferences")):null}initGuests(){this.guests$.next(+localStorage.getItem("_miam/preferences/guests")||4)}tagIsInStorage(e,t){const i=this.preferencesInStorage;return!!(i&&i.with&&i.without)&&(t?i.without.findIndex(t=>t.id===e.id)>-1:i.with.findIndex(t=>t.id===e.id)>-1)}tagShouldBeChecked(e,t){return"equipment"===e.attributes["tag-type-id"]?!this.tagIsInStorage(e,t)&&!this.tagWasAlreadyAdded(e)||this.tagWasAlreadyRemoved(e):this.tagIsInStorage(e,t)&&!this.tagWasAlreadyRemoved(e)||this.tagWasAlreadyAdded(e)}resetPreferences(){localStorage.setItem("_miam/preferences/guests","4"),localStorage.setItem("_miam/preferences",JSON.stringify({with:[],without:[]})),this.guests$.next(+localStorage.getItem("_miam/preferences/guests")||4),this.resetTagsActions()}resetTagsActions(){this.tagsToAdd=[],this.tagsToRemove=[],this.guests$.next(+localStorage.getItem("_miam/preferences/guests")||4)}sendCacheRequest(e,t,i){const n=localStorage.getItem("_miam/userId")||localStorage.getItem("_miam/authlessId"),r=Object.assign({userId:n,key:t},void 0!==i?{value:i}:{});return this.http.post("https://ssr-api.mealz.ai/v2/cache/"+e,r,{headers:{"Content-Type":"application/json"}})}addPreferencesToRemoteFilters(e={},t=!1){const i=this.getPreferences();if(0===i.with.length&&0===i.without.length&&0===this.tagsToAdd.length)return e;const n=i.with.filter(e=>this.tagsToRemove.every(t=>t.tag.id!==e.id)).map(e=>e.id).join(),r=i.without.filter(e=>this.tagsToRemove.every(t=>t.tag.id!==e.id)).map(e=>e.id).join();if(n&&(e.include_tags=e.include_tags?`${e.include_tags},${n}`:n),r&&(e.exclude_tags=e.exclude_tags?`${e.include_tags},${r}`:r),t&&this.tagsToAdd.length>0){const t=this.tagsToAdd.filter(e=>!e.without);e.include_tags=(e.include_tags?e.include_tags+",":"")+t.map(e=>e.tag.id).join();const i=this.tagsToAdd.filter(e=>e.without);e.exclude_tags=(e.exclude_tags?e.exclude_tags+",":"")+i.map(e=>e.tag.id).join()}return e}addTag(e){this.tagWasAlreadyRemoved(e.tag)?this.tagsToRemove.splice(this.tagsToRemove.findIndex(t=>t.tag.id===e.tag.id),1):this.tagsToAdd.push(e)}newTagFromSearch(e){this.tagWasAlreadyAdded(e)||this.tagIsInStorage(e,!0)&&!this.tagWasAlreadyRemoved(e)||this.addTag({tag:e,checked:!0,without:!0})}removeTag(e){this.tagWasAlreadyAdded(e.tag)?this.tagsToAdd.splice(this.tagsToAdd.findIndex(t=>t.tag.id===e.tag.id),1):this.tagsToRemove.push(e)}tagWasAlreadyRemoved(e){return this.tagsToRemove.findIndex(t=>t.tag.id===e.id)>-1}tagWasAlreadyAdded(e){return this.tagsToAdd.findIndex(t=>t.tag.id===e.id)>-1}updatePreferences(){this.tagsToAdd.forEach(e=>{this.saveTagInPreferences(e)}),this.tagsToRemove.forEach(e=>{this.removeTagFromPreferences(e)}),localStorage.setItem("_miam/preferences/guests",this.guests.toString()),this.updatePreferencesCount(),this.resetTagsActions()}saveTagInPreferences(e){const t=this.getPreferences();e.without?t.without.push({id:e.tag.id,name:e.tag.attributes.name}):t.with.push({id:e.tag.id,name:e.tag.attributes.name}),localStorage.setItem("_miam/preferences",JSON.stringify(t))}removeTagFromPreferences(e){const t=this.getPreferences();this.removeTagFromArray(e,e.without?t.without:t.with),localStorage.setItem("_miam/preferences",JSON.stringify(t))}removeTagFromArray(e,t){const i=t.findIndex(t=>t.id===e.tag.id);i>-1&&t.splice(i,1)}getPreferences(){let e=this.preferencesInStorage;return e&&e.with&&e.without||(e={with:[],without:[]}),e}updatePreferencesCount(){var e,t;const i=this.preferencesInStorage;this.currentPreferencesNumber.next(((null===(e=null==i?void 0:i.with)||void 0===e?void 0:e.length)||0)+((null===(t=null==i?void 0:i.without)||void 0===t?void 0:t.length)||0)+(4!==this.guests?1:0))}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),h_=(()=>{class e{constructor(e,t){this.analyticsService=e,this.posService=t,this.subscriptions=[],this.storeLocatorOpened$=new cp(!1),this.newStoreSelected$=new C,this.closeModalOnSelected=!1,this.closeModalOnCancel=!1,this.showStoreLocatorWarning=new cp(!1),this.changePosAfterWarnConfirm=!0,this.storeLocatorOpened$.subscribe(e=>{e&&0!==this.storeLocatorOpenedTimestamp&&(this.storeLocatorOpenedTimestamp=Date.now())})}changePosAndSupplier(e,t){var i,n;(null===(n=null===(i=this.posService.pos$)||void 0===i?void 0:i.value)||void 0===n?void 0:n.id)!==e.detail.posId?(this.selectedPosId=e.detail.posId,this.selectedSupplierName=e.detail.supplierName,this.storeLocatorEventTrace=t,this.isStoreLocatorWarningNeeded(e.detail.supplierId)?(this.changePosAfterWarnConfirm=!0,this.showStoreLocatorWarning.next(!0)):this.changePos()):this.closeStoreLocator()}isStoreLocatorWarningNeeded(e){return!1}changePos(){this.subscriptions.push(this.posService.loadPos(this.selectedPosId).pipe(bp(e=>!e||e.id!==this.selectedPosId),th(e=>(this.analyticsService.sendEvent("locator.select",this.storeLocatorEventTrace.originPath+"/locator",{pos_name:e.attributes.name,pos_id:e.id,supplier_name:this.selectedSupplierName}),localStorage.setItem("_miam/noSupplier/posId",e.id),this.posService.basketLoadedForNewPos())),E(()=>{this.newStoreSelected$.next(),this.closeStoreLocator()})).subscribe())}openStoreLocator(){this.storeLocatorOpened$.next(!0)}closeStoreLocator(){this.storeLocatorOpened$.value&&(this.storeLocatorEventTrace?this.analyticsService.sendEvent("locator.close",this.storeLocatorEventTrace.originPath+"/locator",{}):this.closeModalOnCancel=!0,this.storeLocatorOpenedTimestamp=0),this.storeLocatorOpened$.next(!1)}showChange(e){e.detail.show?this.openStoreLocator():this.closeStoreLocator()}searchChange(e,t){this.analyticsService.sendEvent("locator.search",t.originPath,{search_term:e.detail.searchTerm,stores_found_count:e.detail.storesFoundCount.toString()})}unsubscribe(){this.subscriptions.forEach(e=>e.unsubscribe())}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(Vf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function p_(e,t){return i=>i.lift(new m_(e,t))}class m_{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new g_(e,this.compare,this.keySelector))}}class g_ extends m{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:i}=this;t=i?i(e):e}catch(n){return this.destination.error(n)}let i=!1;if(this.hasKey)try{const{compare:e}=this;i=e(this.key,t)}catch(n){return this.destination.error(n)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}let f_=(()=>{class e extends sp{constructor(e,t){super(),this.http=e,this.posService=t,this.resource=Mf,this.type="menus",this.menus$=new cp(void 0),this.menuPrice$=new cp(null),this.recipesInMenu=new Map,this.recipesInMenuInitialized=!1,this.register()}createMenu(){var e,t;const i=this.new();return i.attributes.budget=0,i.attributes["point-of-sale-id"]=null!==(t=null===(e=this.posService.pos$.value)||void 0===e?void 0:e.id)&&void 0!==t?t:0,i.save().pipe(df(e=>this.menus$.next(e.data)),th(e=>td(e.data)))}deleteMenu(e){return this.delete(e).pipe(df(()=>this.menus$.next(null)))}updateMenu(e,t){return this.http.patch("https://api.miam.tech/api/v1/menus/"+e,{data:Object.assign({id:e,type:this.type},t)}).pipe(df(e=>this.menus$.next(e.data)),th(e=>td(e.data)))}isRecipeInMenu(e){return this.menuPrice$.pipe(th(()=>this.getMenuRecipeId(e)),E(e=>Boolean(e)),p_())}menuToBasket(e){return this.http.patch(Ip+"/api/v1/menus/to-basket",{basket_id:e})}addRecipeToMenu(e,t,i=!0,n){const r=i&&!(null==n?void 0:n.some(e=>"unselected"===e.status)),s={recipe_id:e,guests:t.toString(),autocomplete:r.toString()};return this.http.post("https://api.miam.tech/api/v1/menu-recipes/add-to-menu",s).pipe(E(e=>e.data),th(e=>{var t;if(!r){const i=(null===(t=null==n?void 0:n.filter(e=>{var t,i,n,r;const s=null===(n=null===(i=null===(t=e.ingredient)||void 0===t?void 0:t.relationships)||void 0===i?void 0:i.definition)||void 0===n?void 0:n.data;return(null===(r=null==e?void 0:e.item)||void 0===r?void 0:r.id)&&(null==s?void 0:s.id)}))||void 0===t?void 0:t.map(e=>{var t,i,n;const r=(null===(n=null===(i=null===(t=e.ingredient)||void 0===t?void 0:t.relationships)||void 0===i?void 0:i.definition)||void 0===n?void 0:n.data).id,s=Number(e.item.id);return this.patchUserSelection(e.status,s,r)}))||[];if(i.length>0)return nf(i).pipe(E(()=>e))}return td(e)}),df(e=>{var t;this.updateMenuPrice(),e&&(null===(t=e.attributes)||void 0===t?void 0:t["recipe-id"])&&this.recipesInMenu.set(e.attributes["recipe-id"].toString(),e.id)}))}removeRecipeFromMenu(e){return this.http.delete(Ip+"/api/v1/menu-recipes/remove-from-menu",{params:{recipe_id:e}}).pipe(df(()=>{this.updateMenuPrice(),this.recipesInMenu.delete(e)}))}updateRecipeFromMenu(e,t){const i="https://api.miam.tech/api/v1/menu-recipes/"+e,n={data:{id:e,type:"menu-recipes",attributes:{guests:t.toString()}}};return this.http.patch(i,n).pipe(df(()=>this.updateMenuPrice()))}fetchMenuRecipes(){return this.http.get(Ip+"/api/v1/menus/current?include=menu-recipes&fields[menu-recipes]=recipe-id").pipe(df(e=>{if(!e||!e.data)return this.menuId=null,this.recipesInMenu=new Map,void(this.recipesInMenuInitialized=!0);this.menuId=e.data.id,this.recipesInMenu=new Map((e.included||[]).filter(e=>{var t;return void 0!==(null===(t=e.attributes)||void 0===t?void 0:t["recipe-id"])}).map(e=>[e.attributes["recipe-id"].toString(),e.id])),this.recipesInMenuInitialized=!0}),E(()=>{}))}getMenuRecipeId(e){return this.recipesInMenuInitialized?td(this.recipesInMenu.get(e)):this.fetchMenuRecipes().pipe(E(()=>this.recipesInMenu.get(e)))}getGuestsForRecipe(e){return this.getMenuRecipeId(e).pipe(th(e=>e?this.fetchGuestsFromMenuRecipe(e):this.fetchGuestsFromMenu()))}fetchGuestsFromMenuRecipe(e){return this.http.get("https://api.miam.tech/api/v1/menu-recipes/"+e).pipe(E(e=>e.data.attributes.guests))}fetchGuestsFromMenu(){return this.http.get(Ip+"/api/v1/menus/current").pipe(E(e=>e.data.attributes.guests))}getAllMenuItems(){const e=`https://api.miam.tech/api/v1/menus/${this.menuId}/menu-items?include=item&page[size]=30`;return this.http.get(e+"&page[number]=1").pipe(th(t=>{const i=Math.ceil(t.meta.total_resources/30);return i<=1?td({data:t.data||[],included:t.included||[]}):nf(Array.from({length:i-1},(t,i)=>this.http.get(`${e}&page[number]=${i+2}`))).pipe(E(e=>this.combineMenuItemsPage(t,e)))}))}combineMenuItemsPage(e,t){return{data:t.reduce((e,t)=>e.concat(t.data),e.data),included:t.reduce((e,t)=>e.concat(t.included),e.included)}}patchUserSelection(e,t,i){return this.http.patch(Ip+"/api/v1/menu-items/user-selection",{status:e,item_id:t,ingredients_definition_id:i})}rejectRecipe(e){var t,i;const n=null!==(i=null===(t=this.posService.pos$.value)||void 0===t?void 0:t.id)&&void 0!==i?i:0;return this.http.patch("https://api.miam.tech/api/v1/recipes/reject?point_of_sale_id="+n,{recipe_ids:[e]})}getMenuPrice(){return this.http.get(Ip+"/api/v1/menus/current-cost").pipe(E(e=>e.cost))}updateMenuPrice(){this.getMenuPrice().pipe(fp(1)).subscribe(e=>{this.menuPrice$.next(e)})}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Vf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),__=(()=>{class e extends sp{constructor(e,t,i,n,r,s,o,a,c,l,u,d,h,p,m,g,f){super(),this.http=e,this.analyticsService=t,this.providerService=i,this.statusService=n,this.typeService=r,this.suppliersService=s,this.posService=o,this.ingredientsService=a,this.recipeStepsService=c,this.sponsorService=l,this.packageService=u,this.tagsService=d,this.recipeLikesService=h,this.seoService=p,this.preferencesService=m,this.storeLocatorService=g,this.mealsPlannerService=f,this.resource=yf,this.type="recipes",this.displayedRecipe$=new cp(null),this.displayHelper$=new cp(!1),this.displayedRecipeChanged$=new cp(null),this.recipeDetailsTabIndex$=new cp(null),this.hidden=new Rc,this.suggestionsPrimaryButtonActions={display:!0,addToBasket:!0},this.recipesPrimaryButtonActions={display:!0,addToBasket:!0},this.reloadRecipes$=new cp(!1),this.difficultyLevels=[{value:1,label:"Facile"},{value:2,label:"Moyen"},{value:3,label:"Difficile"}],this.isRecipeDetailsFromPlanner=!1,this.randomRecipeCount=1,this.recipes=[],this.register(),this.initRandomSeed()}loadRecipes(e){return 0===e.length?td([]):nf(e.map(e=>this.getOrFetch(e.id).pipe(df(t=>{e.guests&&(t.modifiedGuests=+e.guests),this.recipes.push(t)}))))}addMandatoryCompletionToFilter(e){var t;const i=e.copy();return(null===(t=i.additionalFilters)||void 0===t?void 0:t.filters.liked)?td(i):this.posService.posWasInitialized().pipe(bp(e=>!e),th(()=>this.posService.pos$),fp(1),E(t=>{var n;return(null==t?void 0:t.id)&&(i.additionalFilters=Object.assign(Object.assign({},e.additionalFilters),{filters:Object.assign({guests:"4",point_of_sale_id:t.id,primary_completion_perc:"100,100",forced_completion_perc:"100,100"},null===(n=e.additionalFilters)||void 0===n?void 0:n.filters)})),i}))}filter(e,t,i=[],n={},r=null,s=!1,o=""){var a;let c;const l=((null===(a=e.additionalFilters)||void 0===a?void 0:a.filters.liked)?{liked:"true"}:null)||this.preferencesService.addPreferencesToRemoteFilters(this.buildRemoteFilters(e,r));return s&&Object.assign(l,{random:this.randomSeed}),this.all({page:t,remotefilter:l,include:i,sort:[o],fields:n}).pipe(bp(e=>e.is_loading),th(e=>(c=e.data,r&&r>0&&c.forEach(e=>e.modifiedGuests=r),this.recipeLikesService.addLikesToRecipes(c))),E(()=>c))}loadRecipesFromPackageId(e,t,i,n){const r=["recipe-provider","sponsors"],s={recipes:["title","number-of-guests","media-url","video-id","filigrane-logo-url","difficulty","preparation-time","cooking-time","resting-time",...r],sponsors:["logo-url"],"recipe-provider":["name"]},o=new Uf({additionalFilters:{title:"",filters:{packages:e}}});return this.addMandatoryCompletionToFilter(o).pipe(th(e=>this.filter(e,{size:i,number:t},r,s,n,!1,"position")))}filterCount(e,t=null,i=[],n=!1){const r=this.preferencesService.addPreferencesToRemoteFilters(this.buildRemoteFilters(e,t),n);return this.all({remotefilter:r,page:{number:1,size:1},fields:{recipes:["id"]}}).pipe(bp(e=>e.is_loading),E(e=>{var t;let n=e.data.length?null===(t=e.page)||void 0===t?void 0:t.total_resources:0;return n-=e.data.filter(e=>i.includes(e.id)).length,n}))}buildRemoteFilters(e,t=null){var i,n,r,s;const o=this.buildRemoteFilter(e.difficulty,"-"),a=null===(i=this.buildRemoteFilter(e.cost,"-"))||void 0===i?void 0:i.split("-"),c=this.buildRemoteFilter(e.time,",");return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(null==o?void 0:o.length)>0?{difficulty:o+",eq"}:{}),2===(null==a?void 0:a.length)?{computed_cost:a[0]+",gt,"+a[1]+",lt"}:{}),(null==c?void 0:c.length)>0?{"total-time":c}:{}),(null===(n=e.additionalFilters)||void 0===n?void 0:n.filters)?e.additionalFilters.filters:{}),e.search?{search:e.search}:{}),(null===(r=e.additionalFilters)||void 0===r?void 0:r.filters.price)?{point_of_sale_id:this.posService.pos$.value.id}:{}),(null===(s=e.additionalFilters)||void 0===s?void 0:s.filters.price)&&null!==t?{guests:t.toString()}:{})}buildRemoteFilter(e,t){if(!e)return;let i="";for(const n of e)n.value&&(i.length>0&&(i+=t),i+=n.name);return i}getRandom(e=[],t={}){return this.randomRecipeCount++,this.filter({reviewed:!0,exclude_no_picture:!0},{number:this.randomRecipeCount,size:1},e,t,null,!0)}getSuggestionFromContext(e,t=[],i={}){let n="";return Object.keys(i).forEach(e=>{n+=`&fields[${e}]=${i[e].join(",")}`}),Xg([this.suppliersService.supplier$,this.posService.posWasInitialized().pipe(bp(e=>!e),th(()=>this.posService.pos$))]).pipe(bp(e=>!e[0]),of(100),th(i=>{const r=this.buildSuggestionBody(e);let s="supplier_id="+i[0].id;i[1]&&(s=`supplier_id=${i[0].id}&pos_id=${i[1].id}`);const o=`https://api.miam.tech/api/v1/recipes/suggestions?${s}&allow-empty=true${t.length>0?"&include="+t.join(","):""}${n}${this.buildfilterUrlFromPreferences()}`;return this.http.post(o,r)}),E(e=>{const t=this.newCollection();return t.fill(e),t.data}))}getSuggestedRecipes(){const e=this.buildfilterUrlFromPreferences(),t=e?"https://api.miam.tech/api/v1/recipes/suggest?"+e.slice(1):"https://api.miam.tech/api/v1/recipes/suggest";return this.http.get(t).pipe(E(e=>{const t=this.newCollection();return t.fill(e),t.data}))}searchRecipeByExtId(e){return this.http.get("https://api.miam.tech/api/v1/recipes/external/"+e).pipe(E(t=>{var i;if((null===(i=t.data)||void 0===i?void 0:i.attributes["ext-id"])===e){const e=this.new();return e.fill(t),e}return null}))}getPricing(e,t,i=null){if(!e)return td(null);let n=`https://api.miam.tech/api/v1/recipes/${e}/pricing?point_of_sale_id=${t}`;return i&&(n+="&serves="+i),this.http.get(n).pipe(E(e=>new Hf(e)))}getIngredientsDefinitions(e){return e?this.http.get(`https://api.miam.tech/api/v1/recipes/${e}?include=ingredients.definition`).pipe(E(e=>{const t=e.included||[],i=t.filter(e=>"ingredients"===e.type),n=new Map;return t.forEach(e=>{"ingredients-definitions"===e.type&&n.set(e.id,e)}),i.forEach(e=>{var t,i,r;const s=null===(r=null===(i=null===(t=e.relationships)||void 0===t?void 0:t.definition)||void 0===i?void 0:i.data)||void 0===r?void 0:r.id;s&&(e.relationships.definition.data=n.get(s))}),i})):td(null)}generateFromPicture(e){return this.http.post("https://api.miam.tech/api/v1/recipes/generate_from_picture",{base64_image:e})}display(e,{previewAllowed:t=!0,guests:i=null,previewMode:n=!1,displayGuests:r=!0,helpButtonAllowed:s=!0}){e&&this.get(e,{include:["ingredients","recipe-steps","recipe-type","sponsors","tags","recipe-provider"]}).subscribe(e=>{this.displayObject(e,{previewAllowed:t,guests:i,previewMode:n,displayGuests:r,helpButtonAllowed:s})})}displayObject(e,{previewAllowed:t=!0,guests:i=null,previewMode:n=!1,wasAdded:r=!1,displayGuests:s=!0,helpButtonAllowed:o=!0}){if(!e)return;const a=(i=null)=>{e.modifiedGuests=null!=i?i:+e.guests,this.displayedRecipe$.next({previewAllowed:t,recipe:e,previewMode:n,wasAdded:r,displayGuests:s,helpButtonAllowed:o,planner:this.isRecipeDetailsFromPlanner})};this.isRecipeDetailsFromPlanner?this.mealsPlannerService.getGuestsForRecipe(e.id).pipe(fp(1)).subscribe(e=>{a(e)}):a(i)}openRecipeDetails(e,t,i,n="",r=null){this.display(e,{previewAllowed:!0,previewMode:!1,guests:t}),this.recipeDetailsTabIndex$.next(i),this.analyticsService.sendEvent("recipe.display",n,{recipe_id:e,category_id:r})}openStoreLocator(){this.storeLocatorService.closeModalOnSelected=!0,this.storeLocatorService.openStoreLocator(),this.displayedRecipe$.next({previewAllowed:!1,recipe:null,previewMode:!0,wasAdded:!1,force:!0})}toggleHelper(){this.hide(),this.displayHelper$.next(!this.displayHelper$.value)}hide(){this.displayedRecipe$.next(null),this.hidden.emit(!0)}addTagToRecipe(e,t){return this.http.post(`https://api.miam.tech/api/v1/recipes/${e.id}/tags/${t.id}`,{})}setRecipesPrimaryButtonActions(e=!0,t=!0){this.recipesPrimaryButtonActions={display:e,addToBasket:t},this.suggestionsPrimaryButtonActions={display:e,addToBasket:t},this.reloadAllRecipes()}setSuggestionsPrimaryButtonActions(e=!0,t=!0){this.suggestionsPrimaryButtonActions={display:e,addToBasket:t},this.reloadAllRecipes()}plan(e,t,i,n=[],r={},s){let o="";Object.keys(r).forEach(e=>{o+=`&fields[${e}]=${r[e].join(",")}`});let a="https://api.miam.tech/api/v1/recipes/plan";return a+=`?budget=${e}&filter[guests]=${t}&recipes_count=${i}&filter[recipe_type_id]=main-dish`,a+=`&include=${n.join(",")}${o}&filter[recipe_type_id]=main-dish&filter[primary_completion_perc]=100,100&filter[forced_completion_perc]=100,100`,a+=void 0===s?"":"&filter[in_basket]="+s,a+=this.buildfilterUrlFromPreferences(),this.posService.waitForPos.pipe(fp(1),th(e=>(a+="&filter[point_of_sale_id]="+e.id,this.http.get(a,{}).pipe(E(e=>{const t=this.newCollection();return t.fill(e),t.data})))))}maxPlannableRecipes(e,t,i){let n="https://api.miam.tech/api/v1/recipes/plan_max_recipes";return n+=`?budget=${e}&filter[guests]=${t}&filter[recipe_type_id]=main-dish&filter[primary_completion_perc]=100,100&filter[forced_completion_perc]=100,100`,n+=void 0===i?"":"&filter[in_basket]="+i,n+=this.buildfilterUrlFromPreferences(),this.posService.waitForPos.pipe(fp(1),th(e=>this.http.get(n+="&filter[point_of_sale_id]="+e.id,{})),E(e=>e.max_recipes))}getIngredientsByRecipeId(e){return this.get(e,{include:["ingredients"],fields:{recipes:["ingredients"]}})}search(e,t,i,n,r){let s="https://api.miam.tech/api/v1/recipes/search?name="+e;return s+=`&page[size]=${i.size||20}&page[number]=${i.number||1}&partner=${t.partner}`,t.statuses.forEach(e=>s+="&recipe_status_ids[]="+e),s+=t.types.length?"&filter[recipe_type_id]="+t.types.join(","):"",s+=t.providers.length?"&filter[recipe_provider_id]="+t.providers.join(","):"",s+=t.packages.length?"&filter[packages]="+t.packages.join(","):"",s+=n.length?"&include="+n.join(","):"",s+=r?"&sort="+r:"",this.http.get(s,{}).pipe(E(e=>{const t=this.newCollection();return t.fill(e),t}))}getOrFetch(e){const t=this.recipes.find(t=>t.id===e);return t?td(t):this.get(e,{fields:{recipes:["number-of-guests","media-url","title"]}}).pipe(bp(e=>e.is_loading))}initRandomSeed(){this.randomSeed=Date.now()}reloadAllRecipes(){this.reloadRecipes$.next(!0)}buildSuggestionBody(e){const t={shelf_ingredients_ids:[],current_ingredients_ids:[],basket_ingredients_ids:[],group_id:""};return e.forEach(e=>{e.hasHighWeight?t.current_ingredients_ids.push(e.id):t.shelf_ingredients_ids.push(e.id)}),t.basket_ingredients_ids=this.suppliersService.lastSupplierCart.map(e=>e.id),t}buildfilterUrlFromPreferences(){return Object.entries(this.preferencesService.addPreferencesToRemoteFilters()).map(([e,t])=>`&filter[${e}]=${t}`).join("")}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Rp),nn(qf),nn(Gf),nn(Wf),nn(Nf),nn(Vf),nn(Xf),nn(r_),nn(s_),nn(o_),nn(a_),nn(l_),nn(u_),nn(d_),nn(h_),nn(f_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),v_=(()=>{class e{constructor(){this.callAuthlessTransfer=new C}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),b_=(()=>{class e{constructor(e){this.locale=e,this.code=function(e){return function(e){return ia(e)[ra.CurrencyCode]||null}(e)}(this.locale),this.symbol=function(e){return ia(e)[ra.CurrencySymbol]||null}(this.locale)}}return e.\u0275fac=function(t){return new(t||e)(nn(nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var y_=function(e){return e.Undiscounted="undiscounted",e.Unsupported="unsupported",e.StrikethroughPrice="strikethrough_price",e.StrikethroughPricePerc="strikethrough_price_perc",e.LoyaltyFund="loyalty_fund",e.LoyaltyFundPerc="loyalty_fund_perc",e.LoyaltyDiscount="loyalty_discount",e.LoyaltyDiscountPerc="loyalty_discount_perc",e.DiscountedProduct="discounted_product",e.DiscountedProductPerc="discounted_product_perc",e}({});let w_=(()=>{class e{constructor(e){this.currencyService=e}getPriceAmountSuffix(e){var t;return(null===(t=e.discountType)||void 0===t?void 0:t.endsWith("_perc"))?"%":this.currencyService.symbol}getPriceFromBasketEntry(e){return{unit:e.price,pricePerUnit:e.pricePerUnit,unitOfMeasurement:e.unitOfMeasurement,discountAmount:e.discountAmount,discountType:e.discountType,discountedPrice:e.discountedPrice}}getCurrentPrice(e){return e.discountType===y_.StrikethroughPricePerc||e.discountType===y_.StrikethroughPrice?e.discountedPrice:e.unit}getOldPrice(e){if(e.discountType!==y_.Undiscounted&&e.discountType!==y_.Unsupported)return e.unit}}return e.\u0275fac=function(t){return new(t||e)(nn(b_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const k_={baskets:["total-price","recipes-infos","completion","status"]};let C_=(()=>{class e extends sp{constructor(e,t,i,n,r,s,o,a,c,l){super(),this.http=e,this.basketEntriesService=t,this.posService=i,this.recipesService=n,this.analyticsService=r,this.usersService=s,this.toasterService=o,this.ignoredBasketsService=a,this.statesService=c,this.priceService=l,this.resource=If,this.type="baskets",this._basket$=new cp(null),this._basketPreview$=new cp(null),this.basketStats$=new cp(null),this.currentAndPreviewFetching=new cp(!1),this.basketIsFetching$=new cp(!1),this.basketPreviewIsCalculating$=new cp(!0),this.basketInitCalled=!1,this.recipesAdded=new Rc,this.confirming=new cp(!1),this.currentlyAddingRecipes=[],this.basketActionsQueue=new cp([]),this._entries$=new cp([]),this.actionsBeingProcessed=new cp([]),this.actionsBeingOverridden=[],this.subscriptions=[],this.register(),this.initQueueEmptying(),this.initToasterOnRecipeAdded()}get basket$(){return this._basket$.value||this.basketIsFetching$.value||(this.basketIsFetching$.next(!0),this.initBasket()),this._basket$}get basketPreview$(){return this._basketPreview$.value||this.basketPreviewIsCalculating$.value||(this.basketPreviewIsCalculating$.next(!0),this.initBasket()),this._basketPreview$}get waitForBasket(){return this.basket$.pipe(bp(e=>!e),fp(1))}get waitForBasketEntries(){return Xg([this._entries$,this.basketPreviewIsCalculating$]).pipe(bp(([e,t])=>!e||!this.basketInitCalled||t),fp(1),E(([e])=>e))}recipePricesInBasket$(){return this.basketPreview$.pipe(bp(e=>!e||0===e.length),E(e=>e.map(e=>({id:e.id,price:e.price}))))}initQueueEmptying(){this.subscriptions.push(this.basketActionsQueue.pipe(of(350),bp(e=>0===e.length||this.actionsBeingProcessed.value.length>0),df(()=>this.emptyActionsQueue())).subscribe())}initToasterOnRecipeAdded(){this.recipesService.confirmationToaster&&this.showRecipeAddedToaster()}subjectContainsRecipeId(e,t,i){return e.pipe(E(e=>e.some(e=>(e=>t===e.type)(e)&&e.params.recipeId===i)))}subjectContainsIngredientId(e,t,i){return e.pipe(E(e=>e.some(e=>e.type===t&&e.params.ingredientId===i)))}subjectContainsEntryId(e,t,i){return e.pipe(E(e=>e.some(e=>{var n;return e.type===t&&(null===(n=e.params.basketEntry)||void 0===n?void 0:n.id)===i})))}subjectContainsItemId(e,t,i){return e.pipe(E(e=>e.some(e=>e.type===t&&e.params.item.id===i)))}subjectContainsActionType(e,t){return e.pipe(E(e=>e.some(e=>e.type===t)))}recipeWillBeAdded(e){return this.subjectContainsRecipeId(this.basketActionsQueue,Lf.ADD_RECIPE,e)}recipeWillBeRemoved(e){return this.subjectContainsRecipeId(this.basketActionsQueue,Lf.REMOVE_RECIPE,e)}recipeWillBeUpdated(e){return this.subjectContainsRecipeId(this.basketActionsQueue,Lf.UPDATE_RECIPE,e)}recipeIsBeingAdded(e){return this.subjectContainsRecipeId(this.actionsBeingProcessed,Lf.ADD_RECIPE,e)}recipeIsBeingRemoved(e){return this.subjectContainsRecipeId(this.actionsBeingProcessed,Lf.REMOVE_RECIPE,e)}recipeIsBeingUpdated(e){return this.subjectContainsRecipeId(this.actionsBeingProcessed,Lf.UPDATE_RECIPE,e)}ingredientWillBeAdded(e){return this.subjectContainsIngredientId(this.basketActionsQueue,Lf.ADD_PRODUCT,e)}ingredientIsBeingRemoved(e){return this.subjectContainsIngredientId(this.actionsBeingProcessed,Lf.REMOVE_PRODUCT,e)}ingredientWillBeRemoved(e){return this.subjectContainsIngredientId(this.basketActionsQueue,Lf.REMOVE_PRODUCT,e)}entryWillBeRemoved(e){return this.subjectContainsEntryId(this.basketActionsQueue,Lf.REMOVE_PRODUCT,e)}entriesWillBeRemovedFromRecipe(){return this.subjectContainsActionType(this.basketActionsQueue,Lf.REMOVE_PRODUCT_FROM_RECIPE)}entryIsBeingRemoved(e){return this.subjectContainsEntryId(this.actionsBeingProcessed,Lf.REMOVE_PRODUCT,e)}entriesAreBeingRemovedFromRecipe(){return this.subjectContainsActionType(this.actionsBeingProcessed,Lf.REMOVE_PRODUCT_FROM_RECIPE)}entryWillBeUpdated(e){return this.subjectContainsEntryId(this.basketActionsQueue,Lf.UPDATE_PRODUCT,e)}entryIsBeingUpdated(e){return this.subjectContainsEntryId(this.actionsBeingProcessed,Lf.UPDATE_PRODUCT,e)}itemWillBeAdded(e){return this.subjectContainsItemId(this.basketActionsQueue,Lf.ADD_ITEM,e)}recipesWillBeAdded(){return this.basketActionsQueue.pipe(E(e=>e.some(e=>e.type===Lf.ADD_RECIPE)))}recipesWillBeRemoved(){return this.basketActionsQueue.pipe(E(e=>e.some(e=>e.type===Lf.REMOVE_RECIPE)))}recipesWillBeUpdated(){return this.basketActionsQueue.pipe(E(e=>e.some(e=>e.type===Lf.UPDATE_RECIPE)))}productsWillBeAdded(){return this.basketActionsQueue.pipe(E(e=>e.filter(e=>e.type===Lf.ADD_PRODUCT).length))}productsWillBeUpdated(){return this.basketActionsQueue.pipe(E(e=>e.filter(e=>e.type===Lf.UPDATE_PRODUCT).length))}productsWillBeRemoved(){return this.basketActionsQueue.pipe(E(e=>e.filter(e=>e.type===Lf.REMOVE_PRODUCT).length))}productsAreBeingRemoved(){return this.actionsBeingProcessed.pipe(E(e=>e.filter(e=>e.type===Lf.REMOVE_PRODUCT).length))}recipeIsInBasket(e){return this.basket$.pipe(bp(e=>!e),E(t=>t.hasRecipe(e)))}guestsForRecipe(e){var t;return null===(t=this.basket$.value)||void 0===t?void 0:t.guestsForRecipe(e)}showRecipeAddedToaster(){let e=0;this.subscriptions.push(this._entries$.subscribe(t=>{const i=t.reduce((e,t)=>"active"===t.status?e+t.quantity:e,0);e<i&&this.toasterService.show($f.Success,`${i-e} ${i-e==1?"article ajout\xe9":"articles ajout\xe9s"} \xe0 votre panier`,"",!1),e=i}))}reloadBasket(){return this.refreshCurrentBasket().pipe(fp(1))}initBasket(){this.basketInitCalled||(this.basketInitCalled=!0,this.loadBasket().subscribe(),this.loadPreview().subscribe())}refreshCurrentBasket(){return this.currentAndPreviewFetching.next(!0),this.posService.waitForPos.pipe(fp(1),th(e=>{Cp("[Mealz] refreshing basket");const t=localStorage.getItem("_miam/authlessId"),i=localStorage.getItem("_miam/userId");this.currentSubscription&&this.currentSubscription.unsubscribe();const n=t&&i?this.transferAuthlessBasket(e.id,t):this.fetchCurrentBasket(e.id);return t&&i&&(localStorage.removeItem("_miam/authlessId"),localStorage.removeItem("_miam/authless-forbid-profiling")),this.currentSubscription=n.subscribe(),this.checkIfIsAffiliated(),this._basket$}))}checkIfIsAffiliated(){this.http.get(Ip+"/api/v1/baskets/affiliated").pipe(fp(1)).subscribe(e=>{const t=null==e?void 0:e.affiliated;t?(localStorage.setItem("_miam/affiliated",t),Object(ap.setAffiliate)(t)):(localStorage.removeItem("_miam/affiliated"),Object(ap.setAffiliate)(null))})}transferAuthlessBasket(e,t){return this.statesService.callAuthlessTransfer.next(),this.http.patch(`https://api.miam.tech/api/v1/baskets/transfer_authless?point_of_sale_id=${e}&authless_user_id=${t}`,{}).pipe(th(e=>{const t=this.new();return t.fill(e),this.updateLocalBasket(t)}),Wh(()=>this.fetchCurrentBasket(e)))}fetchCurrentBasket(e){const t=`current?point_of_sale_id=${e}&fields[baskets]=${k_.baskets.join(",")}`;return this.get(t).pipe(th(e=>this.updateLocalBasket(e)),df(()=>{this.posService.emitBasketLoadedForNewPos&&this.posService.emitBasketLoadedForNewPos()}))}resetBasket(e={originPath:"",props:{}}){return Cp("[Mealz] resetting basket"),localStorage.removeItem("_miam/affiliate"),Object(ap.setAffiliate)(null),this.ignoredBasketsService.resetIgnoredIngredients(),this.posService.waitForPos.pipe(fp(1),th(t=>this.waitForBasket.pipe(df(t=>this.analyticsService.sendEventsOfResetBasket(t,e)),th(()=>this.get(`reset?point_of_sale_id=${t.id}&fields[baskets]=${k_.baskets.join(",")}`).pipe(th(e=>this.updateLocalBasket(e)))))))}confirmPaymentAndBasket(e){return this.confirming.next(!0),this.waitForBasket.pipe(th(t=>+e>0&&t.totalPrice>0?(this.analyticsService.sendEvent("payment.confirmed","",{basket_id:t.id,miam_amount:t.totalPrice.toString(),total_amount:e.toString(),pos_id:this.posService.pos$.getValue().id,pos_name:this.posService.pos$.getValue().attributes.name,supplier_id:this.posService.pos$.getValue().relationships.supplier.data.id,recipe_count:t.recipeInfos.length.toString(),miam_products:t.entries.length.toString()}),this.confirmBasket(t,e)):this._basket$),df(()=>this.confirming.next(!1)))}confirmBasket(e,t){return Cp("[Mealz] Confirm Mealz basket"),this.posService.waitForPos.pipe(fp(1),th(e=>this.http.patch("https://api.miam.tech/api/v1/baskets/confirm?point_of_sale_id="+e.id,{})),Wh(()=>td(null)),th(i=>i?(this.analyticsService.sendEvent("basket.confirmed","",{basket_id:e.id,miam_amount:e.totalPrice.toString(),total_amount:t.toString(),pos_id:this.posService.pos$.getValue().id,pos_name:this.posService.pos$.getValue().attributes.name,supplier_id:this.posService.pos$.getValue().relationships.supplier.data.id,recipe_count:e.recipeInfos.length.toString(),miam_products:e.entries.length.toString()}),this.refreshCurrentBasket()):td(null)),fp(1))}basketEntries(){return this._entries$}activeBasketEntries(){return this.basketEntries().pipe(E(e=>e.filter(e=>"active"===e.status)))}removeBasketEntries(e){return this._entries$.value?nf(e.map(e=>this.removeBasketEntry(e))).pipe(th(()=>this.refreshCurrentBasket()),fp(1)):td(null)}removeBasketEntry(e){const t=this._entries$.value.find(t=>t.id===e.id);if(!t||!e.quantity)return td(null);const i=t.quantity-e.quantity;return i>=1?(this.analyticsService.sendProductsChangeQuantityEvents([{type:Lf.UPDATE_PRODUCT,params:{recipeId:"",eventTrace:{originPath:"",props:{}},basketEntry:t,newQuantity:i}}]),t.quantity=i,t.save()):(t.quantity=1,t.status="deleted",this.analyticsService.sendRemoveProductsEvents([{type:Lf.REMOVE_PRODUCT,params:{recipeId:"",eventTrace:{originPath:"",props:{}},basketEntry:t}}]),t.save())}basketEntryFromIngredient(e,t,i=!1,n){return this.waitForBasket.pipe(th(r=>{let s=`https://api.miam.tech/api/v1/baskets/${r.id}/basket-entries/from-ingredient?ingredient_id=${e}&guests=${t}`;return n&&(s+="&selected_item_id="+n),s+=i?"&fields[basket-entries]=quantity,quantity-to-add":"&include=selected-item",this.http.get(s)}),bp(e=>!e),E(e=>{const t=this.basketEntriesService.new();return t.fill(e),t}))}addEntriesFromPicture(e,t=[],i=!1){return this.waitForBasket.pipe(th(e=>this.posService.waitForPos.pipe(fp(1),E(t=>[e,t]))),th(([n,r])=>{let s;s=i?`https://api.miam.tech/api/v1/baskets/school-list?fields[baskets]=${k_.baskets.join(",")}&point_of_sale_id=`+r.id:`https://api.miam.tech/api/v1/baskets/${n.id}/add-entries-from-picture?fields[baskets]=`+k_.baskets.join(",");const o=new FormData;return o.append("picture",e),o.append("include",t.join(",")),this.http.patch(s,o).pipe(th(e=>this.fillBasket(e)))}))}addRecipesToBasket(e,t,i,n=!0){const r=this.basketActionsQueue.value;e.forEach(e=>r.push({type:n?Lf.ADD_RECIPE:Lf.ADD_RECIPE_LIGHT,params:{recipeId:e,eventTrace:i,guests:t}})),this.basketActionsQueue.next(r)}removeRecipesFromBasket(e,t,i=!1){const n=this.basketActionsQueue.value;e.forEach(e=>n.push({type:i?Lf.REMOVE_RECIPE_LIGHT:Lf.REMOVE_RECIPE,params:{recipeId:e,eventTrace:t}})),this.basketActionsQueue.next(n)}updateRecipesInBasket(e,t,i,n=!1){const r=this.basketActionsQueue.value;e.forEach(e=>this.recipeIsInBasket(e).pipe(fp(1)).subscribe(s=>{s&&r.push({type:n?Lf.UPDATE_RECIPE_LIGHT:Lf.UPDATE_RECIPE,params:{recipeId:e,eventTrace:i,guests:t}})})),this.basketActionsQueue.next(r)}addIngredientsToBasket(e,t,i,n,r){const s=this.basketActionsQueue.value;t.forEach(t=>s.push({type:Lf.ADD_PRODUCT,params:{recipeId:e,ingredientId:t.ingredientId,basketEntry:t.entry,eventTrace:i,previousItem:n,searchString:r}})),this.basketActionsQueue.next(s)}addItemToBasket(e,t,i){const n=this.basketActionsQueue.value;n.push({type:Lf.ADD_ITEM,params:{item:e,eventTrace:t,previousItem:i}}),this.basketActionsQueue.next(n)}removeProductFromRecipe(e,t){const i=this.basketActionsQueue.value;e.forEach(e=>i.push({type:Lf.REMOVE_PRODUCT_FROM_RECIPE,params:{basketEntry:e.basketEntry,ingredientId:e.ingredient.id,forcedQuantity:e.basketEntry.quantity+e.basketEntry.quantityToAdd,eventTrace:t}})),this.basketActionsQueue.next(i)}removeIngredientsFromBasket(e,t,i,n){const r=this.basketActionsQueue.value;i.forEach(i=>r.push({type:Lf.REMOVE_PRODUCT,params:{basketEntry:e,recipeId:t,ingredientId:i,eventTrace:n}})),this.basketActionsQueue.next(r)}removeProduct(e,t,i){const n=this.basketActionsQueue.value;n.push({type:Lf.REMOVE_PRODUCT,params:{basketEntry:e,recipeId:i,eventTrace:t}}),this.basketActionsQueue.next(n)}changeProductQuantity(e,t,i,n){const r=this.basketActionsQueue.value;r.push({type:Lf.UPDATE_PRODUCT,params:{basketEntry:e,recipeId:n,newQuantity:t,eventTrace:i}}),this.basketActionsQueue.next(r)}emptyActionsQueue(){if(this.basketActionsQueue.value.length>0){const e=this.nextActionsBatch();this.actionsBeingProcessed.next([...e]),e.length>0&&this.processActionsBatch(e).subscribe(()=>{this.actionsBeingProcessed.next([]),this.basketActionsQueue.next(this.basketActionsQueue.value.filter(t=>!e.includes(t)&&!this.actionsBeingOverridden.includes(t))),this.actionsBeingOverridden=[]})}}nextActionsBatch(){const e=[];let t=0,i=this.basketActionsQueue.value[t],n=!1;for(;this.basketActionsQueue.value[t]&&this.basketActionsQueue.value[t].type===i.type&&!n;)i=this.basketActionsQueue.value[t],n=this.addActionToBatchOrStopProcessingBatch(e,i),t++;return e}addActionToBatchOrStopProcessingBatch(e,t){const i=this.checkForActionToOverride(e,t);if(-1!==i)this.actionsBeingOverridden.push(e[i]),e[i]=t;else{if(this.shouldForceStopBatch(e,t))return!0;e.push(t)}return!1}shouldForceStopBatch(e,t){return t.type===Lf.UPDATE_RECIPE&&e.length>0&&!e.some(e=>e.params.guests===t.params.guests)||(t.type===Lf.ADD_PRODUCT||t.type===Lf.REMOVE_PRODUCT)&&e.length>0&&!e.some(e=>e.params.recipeId===t.params.recipeId)}checkForActionToOverride(e,t){switch(t.type){case Lf.ADD_PRODUCT:return e.findIndex(e=>e.params.ingredientId===t.params.ingredientId&&e.params.recipeId===t.params.recipeId);case Lf.REMOVE_PRODUCT:return e.findIndex(e=>{var i;let n;return n=(null===(i=t.params.basketEntry)||void 0===i?void 0:i.id)?e.params.basketEntry.id===t.params.basketEntry.id:e.params.ingredientId===t.params.ingredientId,n&&e.params.recipeId===t.params.recipeId});case Lf.REMOVE_PRODUCT_FROM_RECIPE:return e.findIndex(e=>e.params.ingredientId===t.params.ingredientId&&e.params.recipeId===t.params.recipeId);case Lf.UPDATE_PRODUCT:return e.findIndex(e=>e.params.basketEntry.id===t.params.basketEntry.id);case Lf.UPDATE_RECIPE:return e.some(e=>e.params.recipeId!==t.params.recipeId)?-1:e.findIndex(e=>e.params.recipeId===t.params.recipeId);default:return e.findIndex(e=>e.params.recipeId===t.params.recipeId)}}processActionsBatch(e){switch(e[0].type){case Lf.ADD_RECIPE:return this.addRecipes(e);case Lf.ADD_RECIPE_LIGHT:return this.addRecipesWithoutIngredients(e);case Lf.REMOVE_RECIPE:return this.removeRecipes(e);case Lf.REMOVE_RECIPE_LIGHT:return this.removeRecipes(e,!0);case Lf.UPDATE_RECIPE:return this.updateRecipesGuests(e);case Lf.UPDATE_RECIPE_LIGHT:return this.updateRecipesGuests(e,!0);case Lf.ADD_PRODUCT:return this.addItemsForIngredients(e);case Lf.ADD_ITEM:return this.addItemsToBasket(e);case Lf.REMOVE_PRODUCT:return this.removeItemsForIngredients(e);case Lf.REMOVE_PRODUCT_FROM_RECIPE:return this.removeProductWithForcedQuantity(e);case Lf.UPDATE_PRODUCT:return this.changeBasketEntriesQuantities(e);default:return td(null)}}addRecipes(e,t=!0){return this.waitForBasket.pipe(th(i=>{const n=e.map(e=>({recipe_id:e.params.recipeId,guests:e.params.guests})).filter(e=>!this.currentlyAddingRecipes.includes(e.recipe_id)).filter(e=>!i.hasRecipe(e.recipe_id));if(0===n.length)return td(null);this.currentlyAddingRecipes=[...this.currentlyAddingRecipes,...n.map(e=>e.recipe_id)];const r=`https://api.miam.tech/api/v1/baskets/${i.id}/recipes?fields[baskets]=${k_.baskets.join(",")}${t?"":"&light_mode=true"}`,s={data:n};return this.analyticsService.sendAddRecipesEvents(e),this.http.post(r,s).pipe(th(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.id)?this.fillBasket(e):td(null)}),df(()=>{this.recipesAdded.emit(n.map(e=>e.recipe_id)),this.currentlyAddingRecipes=this.currentlyAddingRecipes.filter(e=>!this.basket$.value.recipeInfos.find(t=>t.id===e))}))}),Wh(()=>td(null)))}addRecipesWithoutIngredients(e){return this.addRecipes(e,!1)}removeRecipes(e,t=!1){return this.waitForBasket.pipe(th(i=>{let n=`https://api.miam.tech/api/v1/baskets/${i.id}/recipes?recipe_ids[]=`+e.map(e=>e.params.recipeId).join("&recipe_ids[]=")+"&fields[baskets]="+k_.baskets.join(",");return t&&(n+="&light_mode=true"),this.analyticsService.sendRemoveRecipesEvents(e),this.http.delete(n).pipe(th(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.id)?this.fillBasket(e):td(null)}))}),Wh(()=>td(null)))}removeRecipeById(e,t,i=!1){return this.waitForBasket.pipe(th(n=>{let r=`https://api.miam.tech/api/v1/baskets/${n.id}/recipes?recipe_ids[]=${e}&fields[baskets]=`+k_.baskets.join(",");return i&&(r+="&light_mode=true"),this.analyticsService.sendRemoveRecipesEvents([{type:Lf.REMOVE_RECIPE,params:{recipeId:e,eventTrace:{originPath:t}}}]),this.http.delete(r).pipe(th(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.id)?this.fillBasket(e):td(null)}))}),Wh(()=>td(null)))}updateRecipesGuests(e,t=!1){return this.waitForBasket.pipe(th(i=>{let n=`https://api.miam.tech/api/v1/baskets/${i.id}/recipes_guests?guests=${e[0].params.guests}&recipe_ids[]=`+e.map(e=>e.params.recipeId).join("&recipe_ids[]=")+"&fields[baskets]="+k_.baskets.join(",");return t&&(n+="&light_mode=true"),this.analyticsService.sendUpdateGuestsEvents(e),this.http.patch(n,{}).pipe(bp(e=>!e),th(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.id)?this.fillBasket(e):td(null)}))}),Wh(()=>td(null)))}addItemsForIngredients(e){return this.waitForBasket.pipe(th(t=>nf(e.map(e=>{const i=this.guestsForRecipe(e.params.recipeId);return this.http.patch(`https://api.miam.tech/api/v1/baskets/${t.id}/basket-entries/${e.params.basketEntry.id}/add-ingredient?ingredient_id=${e.params.ingredientId}&selected_item_id=${e.params.basketEntry.selectedItem.id}&guests=${i}&forced_quantity=${e.params.basketEntry.quantity}`,{})}))),df(()=>{const t=e.some(e=>e.params.previousItem)?"item-replacement":"meals-space-recipe-details";this.analyticsService.sendAddProductsEvents(e,t)}),th(()=>this.reloadBasket()),th(()=>td(null)),Wh(()=>td(null)))}addItemsToBasket(e){return this.waitForBasket.pipe(th(t=>nf(e.map(e=>this.http.post(encodeURI((`https://api.miam.tech/api/v1/baskets/${t.id}/basket-entries/from-item?include=selected-item&selected_item_id=`+e.params.item.id+"&name="+e.params.item.attributes.name).trim()),{})))),df(()=>{const t=e.some(e=>e.params.previousItem)?"item-replacement":"meals-space-recipe-details";this.analyticsService.sendAddProductsEvents(e,t)}),th(()=>this.reloadBasket()),th(()=>td(null)),Wh(()=>td(null)))}removeItemsForIngredients(e){return nf(e.map(e=>this.removeIngredient(e.params.basketEntry))).pipe(df(()=>this.analyticsService.sendRemoveProductsEvents(e)),th(()=>this.reloadBasket()),th(()=>td(null)),Wh(()=>td(null)))}removeProductWithForcedQuantity(e){return nf(e.map(e=>this.removeIngredientFromRecipe(e.params.basketEntry,e.params.ingredientId,e.params.forcedQuantity))).pipe(df(()=>this.analyticsService.sendRemoveProductsEvents(e)),th(()=>this.reloadBasket()),th(()=>td(null)),Wh(()=>td(null)))}removeIngredientFromRecipe(e,t,i){var n;return(null===(n=e.recipesIds)||void 0===n?void 0:n.length)?this.waitForBasket.pipe(th(n=>this.http.patch(`https://api.miam.tech/api/v1/baskets/${n.id}/basket-entries/${e.id}/remove-recipe?ingredient_id=${t}&forced_quantity=${i}`,{})),th(()=>td(null)),Wh(()=>td(null))):e.delete()}removeIngredient(e){var t;return(null===(t=e.recipesIds)||void 0===t?void 0:t.length)?this.waitForBasket.pipe(th(t=>this.http.patch(`https://api.miam.tech/api/v1/baskets/${t.id}/basket-entries/${e.id}/remove-ingredient`,{})),th(()=>td(null)),Wh(()=>td(null))):e.delete()}changeBasketEntriesQuantities(e){return nf(e.map(e=>this.basketEntriesService.updateQuantity(e.params.basketEntry.id,e.params.newQuantity))).pipe(df(()=>this.analyticsService.sendProductsChangeQuantityEvents(e)),th(()=>this.reloadBasket()),th(()=>td(null)),Wh(()=>td(null)))}updateLocalBasket(e){return this.basketPreviewIsCalculating$.next(!0),this._basket$.next(e),this.loadPreview().pipe(df(()=>{this.basketIsFetching$.next(!1),this.currentAndPreviewFetching.next(!1)}))}fillBasket(e){const t=this.new();return t.fill(e),this.basketPreviewIsCalculating$.next(!0),this._basket$.next(t),this.loadPreview()}loadBasket(){return this.posService.waitForPos.pipe(th(()=>this.refreshCurrentBasket()))}loadPreview(){return this.waitForBasket.pipe(th(e=>this.recipesService.loadRecipes(e.recipeInfos)),th(e=>this.fetchBasketEntries(this._basket$.value).pipe(E(t=>{const i=this.groupBasketEntries(e,t),n=this.recipesAndLineEntriesToBasketPreviewLine(e,i);this._basketPreview$.next(n),this.basketPreviewIsCalculating$.next(!1),this.basketStats$.next(this.buildStats(n))}))))}fetchBasketEntries(t){if(!t||!t.completion||t.completion.total<1)return this._entries$.next([]),this._entries$.pipe(fp(1));const i=Math.ceil(t.completion.total/e.entriesPerPages);return nf(Array(i).fill(0).map((e,i)=>this.fetchBasketEntriesPage(t,i+1))).pipe(E(e=>{const t=Xp(e.map(e=>e.data));return this._entries$.next(t),this._entries$.value}))}buildStats(e){const t=Zg(...e.map(e=>e.entries.found),"id"),i=t.reduce((e,t)=>{const i=t.attributes["basket-entries-items"].find(e=>e.item_id===t.attributes["selected-item-id"]);return e+(t.attributes.quantity||0)*parseFloat(i["unit-price"])},0);return{recipesCount:e.length,entriesCount:t.length,totalPrice:i}}fetchBasketEntriesPage(t,i){let n=`https://api.miam.tech/api/v1/baskets/${t.id}/basket-entries`;return n=`${n}?include=items,selected-item&page[number]=${i}&page[size]=${e.entriesPerPages}`,this.http.get(n).pipe(E(e=>{const t=this.basketEntriesService.newCollection();return t.fill(e),t}))}recipesAndLineEntriesToBasketPreviewLine(e,t){return e.map((e,i)=>{const n=t[i].found.length;let r=0;const s=e.modifiedGuests||parseInt(e.guests,10);return t[i].found.forEach(e=>{const t=e.attributes.quantity,i=this.priceService.getCurrentPrice(this.priceService.getPriceFromBasketEntry(e));r+=t*i/(e.recipesIds.length||1)}),Df.fromRecipe(e,n,r/s,r,t[i])}).sort((t,i)=>e.findIndex(e=>e.id===i.id)-e.findIndex(e=>e.id===t.id))}groupBasketEntries(e,t){return e.map(e=>{const i={found:[],notFound:[],oftenDeleted:[],removed:[],all:[]};return t.filter(t=>t.recipesIds.includes(+e.id)).forEach(e=>{if(e.attributes["selected-item-id"])switch(e.status){case"often_deleted":i.oftenDeleted.push(e);break;case"deleted":i.removed.push(e);break;default:i.found.push(e)}else i.notFound.push(e);i.all.push(e)}),i})}}return e.entriesPerPages=30,e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(zf),nn(Vf),nn(__),nn(Rp),nn(Yf),nn(Zf),nn(Qf),nn(v_),nn(w_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function S_(e){return t=>t.lift(new x_(e))}class x_{constructor(e){this.total=e}call(e,t){return t.subscribe(new E_(e,this.total))}}class E_ extends m{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function I_(e){return t=>t.lift(new P_(e))}class P_{constructor(e){this.notifier=e}call(e,t){const i=new D_(e),n=j(this.notifier,new L(i));return n&&!i.seenValue?(i.add(n),t.subscribe(i)):i}}class D_ extends ${constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}class T_{}function A_(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());const t=new e.constructor;for(const i in e)e.hasOwnProperty(i)&&(t[i]=A_(e[i]));return t}var R_=function(e){return e.INITIAL_STATE="INITIAL_STATE",e.SENT_TO_RETAILER="SENT_TO_RETAILER",e.RETAILER_PRODUCT_MATCH="RETAILER_PRODUCT_MATCH",e}({});class O_{constructor(e,t,i,n,r){this.basketEntry=e,this.updateMealzParams=t,this.basketsService=i,this.basketEntriesService=n,this.suppliersService=r,this.status=R_.INITIAL_STATE,this.id=this.basketEntry.selectedItem.extId,this.quantity=this.basketEntry.quantity,this.onSuccess=new C,this.onTimeout=new C,this.onError=new C}get type(){return""}get loggable(){return{type:this.type,id:this.id,quantity:this.quantity,quantityToAdd:this.basketEntry.quantityToAdd,fromRetailer:this.updatedFromRetailer}}updateMealzBasket(){Sp("updateMealzBasket not implemented")}shouldRemoveAction(e){return Sp("shouldRemoveAction not implemented"),!1}initProcess(e){this.status=R_.SENT_TO_RETAILER;const t=setTimeout(()=>{const i=e.value.indexOf(this);i<0?clearTimeout(t):(this.onTimeout.next(),e.value.splice(i,1),Sp("[Mealz] Action has not been completed after 10 seconds, aborting",this.loggable),e.next(e.value))},1e4)}updateBasketEntryQuantity(){return this.basketEntry.quantityToAdd?this.findBasketEntryById(this.basketEntry.id).pipe(E(e=>{if(e){const t=A_(this.basketEntry);return t.quantity=e.quantity+this.basketEntry.quantityToAdd,this.quantity=t.quantity,t}return this.basketEntry})):td(this.basketEntry)}createActionForRetailer(){return this.getDifferenceFromBasketEntry(this).pipe(E(e=>({id:this.id,quantity:e})))}syncWithUpdateFromRetailer(e){if((null==e?void 0:e.quantity)<this.quantity)return this.quantity=e.quantity,this.basketEntry.quantity=e.quantity,void(this.updatedFromRetailer=!0);this.updatedFromRetailer=!1}getDifferenceFromBasketEntry(e){return this.basketsService.waitForBasketEntries.pipe(E(t=>{const i=t.filter(e=>"active"===e.status).find(t=>t.id===e.basketEntry.id&&t.selectedItem.extId===e.id);return e.quantity-((null==i?void 0:i.quantity)||0)}))}findBasketEntryById(e){return this.basketsService.waitForBasketEntries.pipe(th(t=>td(t.find(t=>t.id===e))))}}class F_ extends O_{get type(){return"ADD-PRODUCT"}updateMealzBasket(){this.updatedFromRetailer&&(this.quantity<1?this.basketsService.removeProduct(this.basketEntry,new T_):this.basketsService.changeProductQuantity(this.basketEntry,this.basketEntry.quantity,new T_,this.basketEntry.recipesIds[this.basketEntry.recipesIds.length-1].toString()))}createActionForRetailer(){return this.getDifferenceFromRetailerCart(this).pipe(E(e=>({id:this.id,quantity:e})))}getDifferenceFromRetailerCart(e){const t=this.suppliersService.lastSupplierCart.find(t=>e.basketEntry.selectedItem.extId===t.id);return td(e.quantity-((null==t?void 0:t.quantity)||0))}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)&&e.quantity===this.quantity}}class B_{constructor(){this.miamBasketEntries=[],this.previousMiamQuantity=0}get retailerQuantity(){var e;return(null===(e=this.retailerProduct)||void 0===e?void 0:e.quantity)||0}get miamQuantity(){return this.miamBasketEntries.reduce((e,t)=>e+t.quantity,0)}get firstBasketEntryId(){var e;return null===(e=this.miamBasketEntries[0])||void 0===e?void 0:e.id}updatePreviousQuantity(){this.previousMiamQuantity=this.miamQuantity}clearRetailerProduct(){this.retailerProduct=null}addOrUpdateRetailerProduct(e){this.retailerProduct=e}removeMiamEntriesIfNecessary(){let e=this.miamQuantity-this.retailerQuantity;if(e<0)return[];const t=[];return this.miamBasketEntries.forEach(i=>{if(e>0){const n=Math.min(i.quantity,e);e-=n,t.push({id:i.id,quantity:n}),i.quantity-=n,this.previousMiamQuantity-=n}}),t}addOrUpdateBasketEntry(e){const t=this.miamBasketEntries.findIndex(t=>t.id===e.id);t>-1?this.miamBasketEntries[t].quantity=e.attributes.quantity:this.miamBasketEntries.push({id:e.id,quantity:e.attributes.quantity}),this.retailerProduct||(this.retailerProduct={id:e.selectedItem.attributes["ext-id"],quantity:0})}cleanBasketEntries(e){this.miamBasketEntries=this.miamBasketEntries.filter(t=>{var i,n,r;return(null===(n=null===(i=e.find(e=>e.id===t.id))||void 0===i?void 0:i.selectedItem)||void 0===n?void 0:n.attributes["ext-id"])===(null===(r=this.retailerProduct)||void 0===r?void 0:r.id)})}removeBasketEntries(){this.miamBasketEntries=[]}updateRetailerProductsFromEntry(){const e=this.miamQuantity-this.previousMiamQuantity;if(this.previousMiamQuantity=this.miamQuantity,0===e||!this.retailerProduct)return[];const t=this.retailerProduct;return t.quantity+=e,t.quantity<=0&&this.clearRetailerProduct(),[{id:t.id,quantity:e}]}}let M_=(()=>{class e{constructor(){}initBasketComparator(e,t,i){return this.extIdToItemsComparator={},this.updateRetailerProducts(t),this.addEntriesFromMiam(e),this.updateEntriesFromMiam(e),i?this.resolveFromRetailer():this.resolveFromMiam(e)}updateReceivedFromMiam(e){return Cp(`[Miam] update received from Miam\n - ${JSON.stringify(null==e?void 0:e.map(e=>{var t;return{id:e.id,extId:null===(t=e.selectedItem)||void 0===t?void 0:t.attributes["ext-id"],quantity:e.attributes.quantity}}))}\n - current comparison: ${JSON.stringify(Object.keys(this.extIdToItemsComparator).map(e=>({id:e,MQ:this.extIdToItemsComparator[e].miamQuantity,RQ:this.extIdToItemsComparator[e].retailerQuantity})))}`),this.cleanMiamEntries(e),this.addEntriesFromMiam(e),this.updateEntriesFromMiam(e),this.resolveFromMiam(e)}cleanMiamEntries(e){Object.keys(this.extIdToItemsComparator).forEach(t=>{this.extIdToItemsComparator[t].cleanBasketEntries(e)})}updateEntriesFromMiam(e){Object.keys(this.extIdToItemsComparator).forEach(t=>{const i=this.extIdToItemsComparator[t],n=e.filter(e=>e.selectedItem&&e.selectedItem.attributes["ext-id"]===t);n.length>0?n.forEach(e=>i.addOrUpdateBasketEntry(e)):i.removeBasketEntries()})}addEntriesFromMiam(e){e.forEach(e=>{const t=e.selectedItem&&e.selectedItem.attributes["ext-id"];if(!t)return;if(this.extIdToItemsComparator[t])return;const i=new B_;i.addOrUpdateBasketEntry(e),this.extIdToItemsComparator[t]=i})}resolveFromMiam(e){Cp(`[Miam] resolve from Miam basket\n - ${JSON.stringify(null==e?void 0:e.map(e=>{var t;return{id:e.id,extId:null===(t=e.selectedItem)||void 0===t?void 0:t.attributes["ext-id"],quantity:e.attributes.quantity}}))}\n - current comparison: ${JSON.stringify(Object.keys(this.extIdToItemsComparator).map(e=>({id:e,MQ:this.extIdToItemsComparator[e].miamQuantity,RQ:this.extIdToItemsComparator[e].retailerQuantity})))}`);let t=[];return Object.keys(this.extIdToItemsComparator).forEach(e=>{const i=this.extIdToItemsComparator[e].updateRetailerProductsFromEntry();t=[...t,...i]}),t}updateReceivedFromRetailer(e){return this.updateRetailerProducts(e),this.deleteRemovedRetailerProducts(e),this.resolveFromRetailer()}updateRetailerProducts(e){e.forEach(e=>{let t=this.extIdToItemsComparator[e.id];t||(t=new B_,this.extIdToItemsComparator[e.id]=t),t.addOrUpdateRetailerProduct(e)})}deleteRemovedRetailerProducts(e){Object.keys(this.extIdToItemsComparator).forEach(t=>{const i=this.extIdToItemsComparator[t];e.find(e=>e.id===t)||i.clearRetailerProduct()})}resolveFromRetailer(){let e=[];return Object.keys(this.extIdToItemsComparator).forEach(t=>{const i=this.extIdToItemsComparator[t];e=[...e,...i.removeMiamEntriesIfNecessary()]}),this.refreshQuantities(),e}refreshQuantities(){Object.keys(this.extIdToItemsComparator).forEach(e=>{this.extIdToItemsComparator[e].updatePreviousQuantity()})}reset(){this.extIdToItemsComparator=void 0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),L_=(()=>{class e{constructor(e,t,i){this.comparatorService=e,this.basketsService=t,this.supplierService=i,this.ignoreUpdatesFromMiam=!1,this.firstMiamBasketProcess=!0,this.pushProductsToBasket=e=>{throw new Error("No method was passed to 'window.miam.basket.definePushProductsToBasket'")},this.supplierService.supplier$.pipe(bp(e=>!e),fp(1),df(()=>{this.listenToMiam()})).subscribe()}set ignoreMiam(e){this.ignoreUpdatesFromMiam=e,e||this.basketsService.activeBasketEntries().pipe(fp(1)).subscribe(e=>this.processMiamBasket(e))}listenToMiam(){this.basketsService.activeBasketEntries().subscribe(e=>{this.ignoreUpdatesFromMiam||this.processMiamBasket(e)})}processMiamBasket(e){var t;Cp(`[Miam] Miam basket received\n - ${JSON.stringify(null==e?void 0:e.map(e=>({id:e.id,quantity:e.attributes.quantity})))}\n - First Miam basket was: ${JSON.stringify(null===(t=this.firstMiamBasket)||void 0===t?void 0:t.map(e=>({id:e.id,quantity:e.attributes.quantity})))}`),this.firstMiamBasket||0!==e.length||!this.firstMiamBasketProcess?this.miamBasketChanged(e):this.firstMiamBasketProcess=!1}miamBasketChanged(e){if(!this.isReady())return this.initFirstMiamBasket(e);if(this.isProcessingRetailerEvent)return void Cp("[Miam] skipping basket-sync - retailer is processing");const t=this.comparatorService.updateReceivedFromMiam(e);this.sendUpdateToRetailer(t)}initFirstMiamBasket(e){this.firstMiamBasket=e,this.initIfPossible()}initFirstRetailerBasket(e){this.firstRetailerBasket=e,this.initIfPossible()}initIfPossible(){var e;if(Cp(`[Miam] Trying to start basket sync\n - Miam: ${JSON.stringify(null===(e=this.firstMiamBasket)||void 0===e?void 0:e.map(e=>({id:e.id,quantity:e.attributes.quantity})))}\n - Retailer: ${JSON.stringify(this.firstRetailerBasket)}`),this.isReady())if("true"===sessionStorage.getItem("_miam/basketActionInterrupted")){const e=this.comparatorService.initBasketComparator(this.firstMiamBasket,this.firstRetailerBasket,!1);this.sendUpdateToRetailer(e),sessionStorage.removeItem("_miam/basketActionInterrupted")}else{this.isProcessingRetailerEvent=!0;const e=this.comparatorService.initBasketComparator(this.firstMiamBasket,this.firstRetailerBasket,!0);this.sendUpdateToMiam(e)}}isReady(){return!!this.firstMiamBasket&&!!this.firstRetailerBasket}resetMiam(){this.firstMiamBasket=void 0,this.comparatorService.reset()}sendUpdateToRetailer(e){Cp("[Miam] will update retailer "+JSON.stringify(e)),0!==e.length&&(this.pushBasketEntriesToBasket?this.pushBasketEntriesAndManagePFTs(e):this.pushProductsToBasket(e))}pushBasketEntriesAndManagePFTs(e){this.basketsService.basketEntries().pipe(fp(1)).subscribe(t=>{this.pushBasketEntriesToBasket(e.map(e=>{const i=t.find(t=>{var i;return(null===(i=t.selectedItem)||void 0===i?void 0:i.attributes["ext-id"])===e.id})?t.find(t=>{var i;return(null===(i=t.selectedItem)||void 0===i?void 0:i.attributes["ext-id"])===e.id}):void 0;if(i){const t=i.attributes["basket-entries-items"].find(e=>String(e.item_id)===i.selectedItem.id)||{};return Object.assign(i.selectedItem.attributes,{"pft-checksum":t.pft_checksum,"pft-plages":t.pft_plages}),{basketEntry:i,quantity:e.quantity}}return{removedId:e.id,quantity:e.quantity}}))})}sendUpdateToMiam(e){if(Cp("[Miam] will remove from miam "+JSON.stringify(e)),0===e.length)return Cp("[Miam] stop processing retailer event"),void(this.isProcessingRetailerEvent=!1);this.entriesToClean().pipe(th(t=>(e=[...e,...t],this.basketsService.removeBasketEntries(e)))).subscribe(()=>{Cp("[Miam] stop processing retailer event"),this.isProcessingRetailerEvent=!1})}entriesToClean(){return this.basketsService.activeBasketEntries().pipe(fp(1),E(e=>e.filter(e=>!e.selectedItem).map(e=>({id:e.id,quantity:e.quantity}))))}retailerBasketChanged(e){if(Cp(`[Miam] Update received from retailer\n - ${JSON.stringify(e)}\n - First retailer basket was : ${JSON.stringify(this.firstRetailerBasket)}`),!this.isReady())return this.initFirstRetailerBasket(e);this.isProcessingRetailerEvent=!0;const t=this.comparatorService.updateReceivedFromRetailer(e);this.sendUpdateToMiam(t)}handlePayment(e){e&&this.basketsService.confirmPaymentAndBasket(e).subscribe(()=>{this.firstRetailerBasket=[]})}}return e.\u0275fac=function(t){return new(t||e)(nn(M_),nn(C_),nn(Nf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),$_=(()=>{class e{constructor(e,t){this.basketsService=e,this.supplierService=t,this.subscriptions=[],this.mealzActionList=new cp([]),this.firstRetailerCartChanged=!0,this.noSupplier$=new cp(!1),this.lockWhileConfirming=new cp(!1),this.lockWhileSynchronizing=new cp(!1),this.pushBasketEntriesToBasket=()=>{throw new Error("No method was passed to 'window.mealz.basketSync.definePushBasketEntriesToBasket'")},this.init()}init(){Cp("[Mealz] Initializing BasketsSynchronizerService"),q(this.supplierService.supplier$,this.noSupplier$).pipe(bp((e,t)=>!e&&!t),fp(1),df(()=>{this.listenActionList(),this.listenToConfirm()})).subscribe()}addToActionList(e){e.forEach(e=>{e.updateBasketEntryQuantity().pipe(fp(1)).subscribe(t=>{e.basketEntry=t,this.mealzActionList.value.push(e)})}),this.mealzActionList.next(this.mealzActionList.value)}listenActionList(){Cp("[Mealz] Listening to action list"),this.subscriptions.push(this.mealzActionList.pipe(E(e=>e.filter(e=>e.status===R_.INITIAL_STATE)),id(e=>e.length>0),th(e=>this.createActionsForRetailer(e))).subscribe(e=>{if(e.length>0){Cp("[Mealz] Pushing products to retailer cart",e);const t=this.checkActionsToSkip(e),i=e.filter(e=>!t.some(t=>t.id===e.id));i.length>0&&this.sendActionsToRetailerCart(e.filter(e=>i.includes(e)))}else this.syncMealzBasketWithRetailerCart(this.supplierService.lastSupplierCart)}))}sendActionsToRetailerCart(e){if(this.pushProductsToRetailerCart)this.pushProductsToRetailerCart(e);else{if(!this.addProductsToRetailerCart||!this.removeProductsFromRetailerCart)throw new Error("[Mealz] is missing a callback to add to cart: You need to call either 'window.mealz.basketSync.definePushProductsToCart' or both 'window.mealz.basketSync.defineAddProductsToCart' and 'window.mealz.basketSync.defineRemoveProductsToCart'");{const t=[],i=[];e.forEach(e=>{e.quantity<0?i.push({id:e.id,quantity:-1*e.quantity,additionalInfos:e.additionalInfos}):t.push(e)}),t.length>0&&this.addProductsToRetailerCart(t),i.length>0&&this.removeProductsFromRetailerCart(i)}}}createActionsForRetailer(e){Cp("[Mealz] Processing actions in list:",e.map(e=>e.loggable));const t=new Set,i=[];return e.forEach(e=>{if(!t.has(e.id)){t.add(e.id),e.initProcess(this.mealzActionList);const n=e.createActionForRetailer();i.push(n)}}),nf(i)}syncMealzBasketWithRetailerCart(e){this.lockWhileSynchronizing.next(!0),this.basketsService.waitForBasketEntries.pipe(fp(1),th(t=>{const i=t.filter(e=>"active"===e.status),n=this.mapRetailerCartProducts(e),r=i.map(e=>{const t=n[e.selectedItem.extId];return t?this.handleMatchingProduct(t,e):this.handleNonMatchingProduct(e)});return 0===r.length&&r.push(td(null)),nf(r)})).subscribe(()=>{this.lockWhileSynchronizing.next(!1)})}mapRetailerCartProducts(e){return e.reduce((e,t)=>(e[t.id]=t,e),{})}handleMatchingProduct(e,t){return new v(i=>{this.updateMealzBasketFromRetailerBasket(e,t),Xg([this.basketsService.entryIsBeingUpdated(t.id),this.basketsService.entryWillBeUpdated(t.id)]).pipe(bp(([e,t])=>e||t),fp(1)).subscribe(()=>{i.next(),i.complete()})})}handleNonMatchingProduct(e){return new v(t=>{this.basketsService.removeProduct(e,new T_),Xg([this.basketsService.entryIsBeingRemoved(e.id),this.basketsService.entryWillBeRemoved(e.id)]).pipe(bp(([e,t])=>e||t),fp(1)).subscribe(()=>{t.next(),t.complete()})})}retailerCartChanged(e){Cp("[Mealz] Retailer cart changed",e);const t=[...this.supplierService.lastSupplierCart];this.firstRetailerCartChanged&&(this.syncMealzBasketWithRetailerCart(e),this.firstRetailerCartChanged=!1),Xg([this.lockWhileConfirming,this.lockWhileSynchronizing]).pipe(bp(([e,t])=>e||t),fp(1)).subscribe(()=>{const{addedProducts:i,updatedProducts:n,removedProducts:r}=this.compareProducts(t,e);i.length>0&&this.checkAddActions(i,this.mealzActionList.value),r.length>0&&this.checkRemoveActions(r,this.mealzActionList.value),n.length>0&&this.checkUpdateActions(n,this.mealzActionList.value)})}checkAddActions(e,t){Cp("[Mealz] Were added by retailer:",e),e.forEach(e=>{const i=t.find(t=>t.id===e.id);i&&i.status===R_.SENT_TO_RETAILER&&(i.status=R_.RETAILER_PRODUCT_MATCH,i.syncWithUpdateFromRetailer(e),i.updateMealzBasket(),this.removeFinishedActionsFromList(e.id,i))})}checkRemoveActions(e,t){Cp("[Mealz] Were removed by retailer:",e),e.forEach(e=>{const i=t.find(t=>t.id===e.id);i&&i.status===R_.SENT_TO_RETAILER?(i.status=R_.RETAILER_PRODUCT_MATCH,i.updateMealzBasket(),this.removeFinishedActionsFromList(e.id,i)):this.findProductInBasketEntries(e.id).subscribe(e=>{e&&this.basketsService.removeProduct(e,new T_)})})}checkUpdateActions(e,t){Cp("[Mealz] Were updated by retailer:",e),e.forEach(e=>{const i=t.find(t=>t.id===e.id);i&&i.status===R_.SENT_TO_RETAILER?(i.status=R_.RETAILER_PRODUCT_MATCH,i.syncWithUpdateFromRetailer(e),i.updateMealzBasket(),this.removeFinishedActionsFromList(e.id,i)):this.findAndRemoveExcessProductsInMealzBasket(e)})}checkActionsToSkip(e){const t=[];return e.forEach(e=>{0===e.quantity&&(t.push(e),this.skipRetailerUpdateForAction(this.mealzActionList.value.find(t=>t.id===e.id)))}),t}skipRetailerUpdateForAction(e){Cp("[Mealz] Skipping retailer update for action",e.loggable),this.findProductInBasketEntries(e.id).subscribe(t=>{e.status=R_.RETAILER_PRODUCT_MATCH,e.quantity=(null==t?void 0:t.quantity)||0,e.basketEntry.quantity=(null==t?void 0:t.quantity)||0,e.updateMealzBasket(),this.basketsService.productsWillBeAdded().pipe(bp(e=>e>0),fp(1)).subscribe(()=>{this.removeFinishedActionsFromList(e.id,e)})})}removeFinishedActionsFromList(e,t){Cp("[Mealz] Removing finished actions from list",t.loggable);const i=new C;this.basketsService.basketEntries().pipe(I_(i),th(n=>{if(t.status!==R_.RETAILER_PRODUCT_MATCH)return td(null);const r=n.find(t=>t.selectedItem.extId===e);return t.shouldRemoveAction(r)&&(this.finishAction(t),i.next(),i.complete()),td(r)})).subscribe()}finishAction(e){e.onSuccess.next(),this.mealzActionList.value.splice(this.mealzActionList.value.indexOf(e),1),this.mealzActionList.next(this.mealzActionList.value)}findAndRemoveExcessProductsInMealzBasket(e){Cp("[Mealz] Finding and removing excess products in Mealz basket",e),this.findProductInBasketEntries(e.id).subscribe(t=>{t&&this.updateMealzBasketFromRetailerBasket(e,t)})}findProductInBasketEntries(e){return this.basketsService.waitForBasketEntries.pipe(th(t=>td(t.find(t=>t.selectedItem.extId===e))))}updateMealzBasketFromRetailerBasket(e,t){t.quantity===e.quantity||e.quantity>t.quantity||(t.quantity=e.quantity,this.basketsService.changeProductQuantity(t,e.quantity,new T_))}subjectContainsEntryId(e,t){return e.pipe(E(e=>e.some(e=>e.id===t)))}hasPendingActions(){return this.mealzActionList.pipe(E(e=>e.length>0))}entryWillBeAdded(e){return this.subjectContainsEntryId(this.mealzActionList,e)}entryWillBeUpdated(e){return this.subjectContainsEntryId(this.mealzActionList,e)}compareProducts(e,t){const i=[],n=[],r=[],s=new Map;e.forEach(e=>s.set(e.id,e));const o=new Map;return t.forEach(e=>o.set(e.id,e)),t.forEach(e=>{const t=s.get(e.id);t?e.quantity!==t.quantity&&r.push(Object.assign(Object.assign({},e),{additionalInfos:{quantityDifference:e.quantity-t.quantity}})):i.push(e)}),e.forEach(e=>{o.has(e.id)||n.push(e)}),{addedProducts:i,removedProducts:n,updatedProducts:r}}handlePayment(e){e&&this.basketsService.confirmPaymentAndBasket(e).subscribe()}listenToConfirm(){this.basketsService.confirming.pipe(bp(e=>e===this.lockWhileConfirming.value)).subscribe(e=>{!e&&this.lockWhileConfirming.value&&this.resetMealz(),this.lockWhileConfirming.next(e)})}resetMealz(){this.mealzActionList.next([])}}return e.\u0275fac=function(t){return new(t||e)(nn(C_),nn(Nf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class j_ extends O_{get type(){return"REMOVE-PRODUCT"}updateMealzBasket(){}shouldRemoveAction(e){return!0}}class z_ extends O_{get type(){return"REMOVE-PRODUCT"}updateMealzBasket(){this.updateMealzParams.recipeId?this.basketsService.removeIngredientsFromBasket(this.basketEntry,this.updateMealzParams.recipeId,[this.updateMealzParams.ingredientId],this.updateMealzParams.eventTrace):this.basketsService.removeProduct(this.basketEntry,this.updateMealzParams.eventTrace)}shouldRemoveAction(e){return!0}}class N_ extends O_{get type(){return"UPDATE-PRODUCT"}updateMealzBasket(){var e;this.basketsService.changeProductQuantity(this.basketEntry,this.basketEntry.quantity,this.updateMealzParams.eventTrace,null===(e=this.updateMealzParams)||void 0===e?void 0:e.recipeId)}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)&&e.quantity===this.quantity}updateBasketEntryQuantity(){return td(this.basketEntry)}}let V_=(()=>{class e{constructor(e,t,i,n,r){this.basketsService=e,this.recipesService=t,this.priceService=i,this.basketSynchroService=n,this.analyticsService=r,this.recipesWithEntries=[],this.basketPreviewState$=new cp({isOpen:!1,activeTabIndex:0})}buildPreview(){return this.matchRecipesWithBasketEntries().pipe(th(e=>this.formatPreview(e)))}openBasket(e="",t=0){this.basketPreviewState$.next({isOpen:!0,activeTabIndex:t}),this.analyticsService.sendEvent("basket.display",e,{})}removeRecipe(e,t){return this.fetchDataToRemoveRecipe(e).pipe(th(({recipe:i,basketEntries:n})=>{const r=this.buildRemoveProducts(i,n),s=this.buildRemoveActions(r);return 0!==s.length?(this.basketSynchroService.addToActionList(s),s[s.length-1].onSuccess.pipe(fp(1),th(()=>this.removeRecipeFromBasket(r,e,t)))):this.basketsService.removeRecipeById(e,t)}))}removeProduct(e,t){const i=A_(e);i.quantity=0;const n=new z_(i,{eventTrace:t,ingredientId:""},this.basketsService);this.basketSynchroService.addToActionList([n])}updateProduct(e,t,i){const n=A_(e);n.quantity=t;const r=new N_(n,{eventTrace:i},this.basketsService);this.basketSynchroService.addToActionList([r])}buildRemoveProducts(e,t){return A_(t).map((t,i)=>({basketEntry:t,ingredient:e.ingredients[i]})).filter(e=>"-1"!==e.basketEntry.id)}buildRemoveActions(e){return e.filter(e=>"active"===e.basketEntry.status&&e.basketEntry.quantity>0).map(e=>new j_(e.basketEntry,{},this.basketsService))}fetchDataToRemoveRecipe(e){return this.recipesService.getIngredientsByRecipeId(e).pipe(th(e=>nf(e.ingredients.map(e=>this.basketsService.basketEntryFromIngredient(e.id,0))).pipe(E(t=>({recipe:e,basketEntries:t})))))}removeRecipeFromBasket(e,t,i){return nf(e.map(e=>this.basketsService.removeIngredientFromRecipe(e.basketEntry,e.ingredient.id,e.basketEntry.quantity+e.basketEntry.quantityToAdd))).pipe(th(()=>this.basketsService.reloadBasket()),th(()=>this.basketsService.removeRecipeById(t,i,!0)))}formatPreview(e){return this.recipesWithEntries=e,td(e.map(({recipe:e,entries:t})=>{const{id:i,modifiedGuests:n,guests:r,attributes:s}=e,{title:o,"media-url":a}=s,c=n||parseInt(r,10)||1,l=t.reduce((e,t)=>e+t.quantity,0),u=t.reduce((e,t)=>{const i=this.priceService.getCurrentPrice(this.priceService.getPriceFromBasketEntry(t));return e+t.attributes.quantity*i/(t.recipesIds.length||1)},0),d=u/c;return{id:i,title:o,picture:a,guests:c,nbrProducts:l,totalPrice:Math.round(100*u)/100,"price-per-serve":Math.round(100*d)/100}}))}matchRecipesWithBasketEntries(){return this.basketsService.waitForBasket.pipe(th(e=>nf({recipes:this.recipesService.loadRecipes(e.recipeInfos).pipe(fp(1)),activeEntries:this.basketsService.activeBasketEntries().pipe(fp(1))})),E(({recipes:e,activeEntries:t})=>e.map(e=>({recipe:e,entries:t.filter(t=>t.recipesIds.includes(+e.id))}))))}}return e.\u0275fac=function(t){return new(t||e)(nn(C_),nn(__),nn(w_),nn($_),nn(Rp))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),H_=(()=>{class e{constructor(e,t,i,n,r,s,o,a,c,l,u){this.analyticsService=e,this.basketsService=t,this.contextRegistryService=i,this.posService=n,this.http=r,this.userService=s,this.recipesService=o,this.suppliersService=a,this.basketSynchroService=c,this.statesService=l,this.basketUtilsService=u,this.basketIsBeingTransferred=new cp(!1),this.transferComplete$=new C,this.previousBasketEntries=[],this.subscriptions=[],this.subscriptions.push(this.startTransferOnSupplierLoaded(),this.checkAuthlessTransfer(),this.checkBasketStatus())}startTransferOnSupplierLoaded(){return this.suppliersService.supplier$.pipe(bp(e=>!e),fp(1)).subscribe(()=>this.handleBasketTransfer())}checkAuthlessTransfer(){return this.statesService.callAuthlessTransfer.pipe(fp(1)).subscribe(()=>this.updateRetailerBasket())}checkBasketStatus(){return this.basketsService._basket$.pipe(bp(e=>!e),E(e=>"transferring"===e.attributes.status)).subscribe(e=>{this.basketIsBeingTransferred.next(e),!e&&sessionStorage.getItem("_miam/transferUrl")&&sessionStorage.removeItem("_miam/transferUrl")})}unsubscribeService(){this.subscriptions.forEach(e=>e.unsubscribe())}setSessionData(e){sessionStorage.setItem("_miam/transferredBasketToken",e.basketToken),sessionStorage.setItem("_miam/posOfSaleExtId",e.posExtId)}clearTransferSessionData(){sessionStorage.removeItem("_miam/transferredBasketToken"),sessionStorage.removeItem("_miam/pointOfSaleExtId")}confirmBasket(){this.subscriptions.push(this.posService.waitForPos.pipe(fp(1),th(e=>this.http.patch("https://api.miam.tech/api/v1/baskets/start_transfer?point_of_sale_id="+e.id,{})),th(e=>{const[t,i]=e.transfer_url.split("?");return e.transfer_url=(this.contextRegistryService.transferUrlBaseOverride||t)+(i?"?"+i:""),this.basketsService.refreshCurrentBasket().pipe(bp(e=>!e),fp(1),th(t=>(this.analyticsService.sendEvent("basket.transfer","/basket",{basket_id:t.id,miam_amount:t.totalPrice.toString(),pos_id:this.posService.pos$.getValue().id,pos_name:this.posService.pos$.getValue().attributes.name,supplier_id:this.posService.pos$.getValue().relationships.supplier.data.id}),td(e))))}),th(e=>(sessionStorage.setItem("_miam/transferUrl",e.transfer_url),this.navigateToTransferUrl(),this.recipesService.hide(),td(null)))).subscribe())}navigateToTransferUrl(){const e=sessionStorage.getItem("_miam/transferUrl");e&&setTimeout(()=>window.open(e,"_blank"))}abortTransfer(){return this.posService.waitForPos.pipe(fp(1),th(e=>this.http.patch("https://api.miam.tech/api/v1/baskets/abort_transfer?point_of_sale_id="+e.id,{})),th(()=>this.basketsService.reloadBasket()),th(()=>(this.basketIsBeingTransferred.next(!1),td(null))))}handleBasketTransfer(){const e=this.getTransferData();e&&(this.setSessionData(e),this.tryToTransferBasket(e).pipe(th(()=>this.basketsService.reloadBasket())).subscribe())}tryToTransferBasket(e){return this.callHookbackIfNotLogged().pipe(bp(e=>!e),th(()=>this.forcePosIfUnset(e.posExtId)),bp(e=>!e),th(()=>this.posService.waitForPos.pipe(fp(1),th(e=>this.basketsService.waitForBasket.pipe(fp(1),th(()=>this.basketsService.waitForBasketEntries.pipe(fp(1),E(t=>(this.previousBasketEntries=A_(t),e)))))),th(t=>this.transferBasketForPos(t,e.basketToken)),fp(1))))}transferBasketForPos(e,t){const i=`https://api.miam.tech/api/v1/baskets/transfer?point_of_sale_id=${e.id}&transferred_basket_token=${t}`;return this.clearTransferSessionData(),sessionStorage.setItem("_miam/basketActionInterrupted","true"),this.http.patch(i,{}).pipe(Wh(()=>(this.transferComplete$.next(),td(null))),df(e=>e&&this.basketUtilsService.openBasket()),th(()=>this.basketsService.refreshCurrentBasket().pipe(th(()=>(this.transferComplete$.next(),sessionStorage.removeItem("_miam/basketActionInterrupted"),this.updateRetailerBasket(),td(!0))))))}filterNewAndUpdatedEntries(e){return[...e.filter(e=>!this.previousBasketEntries.find(t=>t.id===e.id)),...e.filter(e=>this.previousBasketEntries.find(t=>t.id===e.id&&t.quantity!==e.quantity))]}updateRetailerBasket(){this.basketsService.activeBasketEntries().pipe(S_(1),fp(1),th(e=>(this.createTransferAction(e),e))).subscribe()}updateRetailerBasketFromPlanner(){const e=this.basketsService.reloadBasket().pipe(th(()=>this.basketsService.currentAndPreviewFetching),bp(e=>e),fp(1),th(()=>this.basketsService.activeBasketEntries()),fp(1),th(e=>(e.length>0&&this.createTransferAction(e),e))).subscribe();this.subscriptions.push(e)}createTransferAction(e){const t=this.filterNewAndUpdatedEntries(e).map(e=>{const t=new F_(e,{},this.basketsService,void 0,this.suppliersService);return this.handleActionErrors(t),t});this.basketSynchroService.addToActionList(t)}handleActionErrors(e){e.onTimeout.pipe(fp(1)).subscribe(()=>{this.basketsService.removeProduct(e.basketEntry,new T_)})}callHookbackIfNotLogged(){return this.userService.isLogged$.pipe(fp(1),E(e=>this.contextRegistryService.hookCallback(e,!0)))}forcePosIfUnset(e){return this.posService.posWasInitialized().pipe(I_(this.transferComplete$),th(()=>this.posService.pos$.pipe(fp(1))),th(t=>{const i=t&&t.extId===e;return i||this.contextRegistryService.forcePosCallback(e),td(i)}))}getTransferData(){var e;const t=window.location.href,i=new URL(t).searchParams,n=i.get("transferred_basket_token")||sessionStorage.getItem("_miam/transferredBasketToken"),r=i.get("point_of_sale_ext_id")||i.get("magasin_id")||sessionStorage.getItem("_miam/posOfSaleExtId"),s=null===(e=i.get("affiliate"))||void 0===e?void 0:e.toLowerCase();return n&&r?(this.removeTransferParamsFromUrl(),{basketToken:n,posExtId:r,affiliate:s}):null}removeTransferParamsFromUrl(){const e=window.location.href,t=e.split("?")[1];if(t){const i=new URLSearchParams(t);i.delete("transferred_basket_token"),i.delete("point_of_sale_ext_id"),i.delete("magasin_id"),i.delete("affiliate");const n=e.split("?")[0]+(i.toString().length>0?"?"+i.toString():"");history.replaceState({},document.title,n)}}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(C_),nn(Dp),nn(Vf),nn(wd),nn(Yf),nn(__),nn(Nf),nn($_),nn(v_),nn(V_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),U_=(()=>{class e extends sp{constructor(e){super(),this.http=e,this.resource=Rf,this.type="catalog-settings",this.url=Ip+"/api/v1",this.register()}getSupplierCatalogSettings(e){return this.http.get(`${this.url}/suppliers/${e.id}/catalog-settings`).pipe(E(e=>e.data[0]))}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class q_ extends O_{get type(){return"RESET-BASKET"}updateMealzBasket(){}shouldRemoveAction(e){return!0}}let G_,W_=(()=>{class e{constructor(e){this.basketsService=e,this.listenBasketEntriesChange()}listenBasketEntriesChange(){this.basketsService.basketEntries().subscribe(e=>this.cleanupRecipesWithDeletedEntries(e))}cleanupRecipesWithDeletedEntries(e){const t=new Map,i=[];for(const n of e){const e=n.recipesIds||[];for(const i of e){t.has(+i)||t.set(+i,[]);const e=t.get(+i);e&&e.push(n)}}for(const[n,r]of t.entries())r.every(e=>"deleted"===e.attributes.status)&&this.basketsService.recipeIsInBasket(n.toString())&&i.push(n.toString());i.length>0&&this.removeRecipesFromBasket(i)}removeRecipesFromBasket(e){this.basketsService.removeRecipesFromBasket(e,{originPath:"",props:{}},!1)}}return e.\u0275fac=function(t){return new(t||e)(nn(C_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function Z_(e){return Array.isArray(e)?e:[e]}function Q_(e){return e instanceof wa?e.nativeElement:e}function Y_(...e){return H(1)(td(...e))}function K_(...e){const t=e[e.length-1];return x(t)?(e.pop(),i=>Y_(e,i,t)):t=>Y_(e,t)}try{G_="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(fE){G_=!1}let J_,X_,ev=(()=>{class e{constructor(e){this._platformId=e,this.isBrowser=this._platformId?"browser"===this._platformId:"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!G_)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return e.\u0275fac=function(t){return new(t||e)(nn(el))},e.\u0275prov=de({factory:function(){return new e(nn(el))},token:e,providedIn:"root"}),e})(),tv=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({}),e})();function iv(e){return function(){if(null==J_&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>J_=!0}))}finally{J_=J_||!1}return J_}()?e:!!e.capture}function nv(e){if(function(){if(null==X_){const e="undefined"!=typeof document?document.head:null;X_=!(!e||!e.createShadowRoot&&!e.attachShadow)}return X_}()){const t=e.getRootNode?e.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&t instanceof ShadowRoot)return t}return null}const rv=new Set;let sv,ov=(()=>{class e{constructor(e){this._platform=e,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):av}matchMedia(e){return this._platform.WEBKIT&&function(e){if(!rv.has(e))try{sv||(sv=document.createElement("style"),sv.setAttribute("type","text/css"),document.head.appendChild(sv)),sv.sheet&&(sv.sheet.insertRule(`@media ${e} {.fx-query-test{ }}`,0),rv.add(e))}catch(t){console.error(t)}}(e),this._matchMedia(e)}}return e.\u0275fac=function(t){return new(t||e)(nn(ev))},e.\u0275prov=de({factory:function(){return new e(nn(ev))},token:e,providedIn:"root"}),e})();function av(e){return{matches:"all"===e||""===e,media:e,addListener:()=>{},removeListener:()=>{}}}let cv=(()=>{class e{constructor(e,t){this._mediaMatcher=e,this._zone=t,this._queries=new Map,this._destroySubject=new C}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(e){return lv(Z_(e)).some(e=>this._registerQuery(e).mql.matches)}observe(e){let t=Xg(lv(Z_(e)).map(e=>this._registerQuery(e).observable));return t=Y_(t.pipe(fp(1)),t.pipe(S_(1),of(0))),t.pipe(E(e=>{const t={matches:!1,breakpoints:{}};return e.forEach(({matches:e,query:i})=>{t.matches=t.matches||e,t.breakpoints[i]=e}),t}))}_registerQuery(e){if(this._queries.has(e))return this._queries.get(e);const t=this._mediaMatcher.matchMedia(e),i={observable:new v(e=>{const i=t=>this._zone.run(()=>e.next(t));return t.addListener(i),()=>{t.removeListener(i)}}).pipe(K_(t),E(({matches:t})=>({query:e,matches:t})),I_(this._destroySubject)),mql:t};return this._queries.set(e,i),i}}return e.\u0275fac=function(t){return new(t||e)(nn(ov),nn(gl))},e.\u0275prov=de({factory:function(){return new e(nn(ov),nn(gl))},token:e,providedIn:"root"}),e})();function lv(e){return e.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}let uv=(()=>{class e{constructor(e){this.basketService=e,this.inBasket={}}matchMealzBasket(){this.basketService.waitForBasketEntries.subscribe(e=>{const t=e.filter(e=>"active"===e.status).map(e=>({id:e.selectedItem.extId,quantity:e.quantity}));this.pushToFakeCart(t)})}pushToFakeCart(e){e.forEach(e=>{var t;this.inBasket[e.id]=(null!==(t=this.inBasket[e.id])&&void 0!==t?t:0)+e.quantity,this.inBasket[e.id]<1&&delete this.inBasket[e.id]}),window.mealz.basketSync.retailerBasketChanged(this.getSupplierCart())}getSupplierCart(){return Object.entries(this.inBasket).map(([e,t])=>({id:e,quantity:t}))}}return e.\u0275fac=function(t){return new(t||e)(nn(C_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class dv extends O_{get type(){return"ADD-PRODUCT"}updateMealzBasket(){this.basketsService.addIngredientsToBasket(this.updateMealzParams.recipeId,[{ingredientId:this.updateMealzParams.ingredientId,entry:this.basketEntry}],this.updateMealzParams.eventTrace)}createActionForRetailer(){return(this.quantity<1?td(this.quantity):this.getDifferenceFromBasketEntry(this)).pipe(E(e=>({id:this.id,quantity:e})))}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)}}class hv extends O_{get type(){return"UPDATE-PRODUCT"}updateMealzBasket(){this.basketsService.changeProductQuantity(this.basketEntry,this.basketEntry.quantity,this.updateMealzParams.eventTrace,this.updateMealzParams.recipeId)}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)&&e.quantity===this.quantity}}let pv=(()=>{class e{constructor(e,t,i,n,r){this.contextRegistryService=e,this.userService=t,this.posService=i,this.basketsService=n,this.recipesService=r,this.shouldExecuteBasketMethod=new cp(void 0),this.subscriptions=new d,this.subscriptions.add(this.canExecuteStoredMethod().subscribe())}storeMethodIfCallbackNeeded(e){return this.hasUserAndHasPos().pipe(fp(1),E(t=>{t[0]&&t[1]||localStorage.setItem("_miam/storeCallbackMethod",JSON.stringify(e));const i=this.contextRegistryService.hookCallback(t[0],t[1]);return i&&localStorage.removeItem("_miam/storeCallbackMethod"),i}))}canExecuteStoredMethod(){return this.basketsService.waitForBasketEntries.pipe(th(()=>this.hasUserAndHasPos().pipe(bp(e=>!e[0]||!e[1]),fp(1),E(()=>this.getStoredMethod()))))}hasUserAndHasPos(){return Xg([this.userService.isLogged$,this.posService.posWasInitialized()])}getStoredMethod(){const e=localStorage.getItem("_miam/storeCallbackMethod");if(e&&"setFavoritesFilter"!==e){const e=JSON.parse(localStorage.getItem("_miam/storeCallbackMethod"));this.shouldExecuteBasketMethod.next(e),this.recipesService.display(e.arguments.recipeId,{previewAllowed:!0,previewMode:!1}),localStorage.removeItem("_miam/storeCallbackMethod")}}}return e.\u0275fac=function(t){return new(t||e)(nn(Dp),nn(Yf),nn(Vf),nn(C_),nn(__))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),mv=(()=>{class e extends sp{constructor(e,t){super(),this.http=e,this.posService=t,this.resource=ff,this.type="items",this.register()}searchForIngredient(e,t,i){return this.posService.waitForPos.pipe(fp(1),th(n=>{let r=`https://api.miam.tech/api/v1/items/search?${t?`ingredient_id=${t}&`:""}${i?`guests=${i}&`:""}point_of_sale_id=${n.id}`;return e&&(r+="&name="+e),this.http.get(encodeURI(r.trim()))}))}getPriceForItem(e){return this.posService.waitForPos.pipe(fp(1),th(t=>this.http.get(`https://api.miam.tech/api/v1/items/${e}/price?point_of_sale_id=${t.id}`)),E(e=>({unit:e.price,pricePerUnit:e["price-per-unit"],unitOfMeasurement:e["unit-of-measurement"],discountAmount:e["discount-amount"],discountType:e["discount-type"],discountedPrice:e["discounted-price"]})))}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Vf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),gv=(()=>{class e{constructor(){this.outOfStockEntries=[],this.fetchCurrentOutOfStocks()}fetchCurrentOutOfStocks(){const e=sessionStorage.getItem("_miam/outOfStockEntry")||"[]";try{this.outOfStockEntries=JSON.parse(e),Array.isArray(this.outOfStockEntries)||(this.outOfStockEntries=[e])}catch(t){this.outOfStockEntries=[]}}isOutOfStockFromStorage(e){var t;if("active"!==e.status)return!!(null===(t=null==e?void 0:e.selectedItem)||void 0===t?void 0:t.id)&&this.outOfStockEntries.includes(e.selectedItem.id.toString());this.removeEntryFromStorage(e)}removeEntryFromStorage(e){var t;(null===(t=null==e?void 0:e.selectedItem)||void 0===t?void 0:t.id)&&(this.outOfStockEntries=this.outOfStockEntries.filter(t=>t!==e.selectedItem.id),sessionStorage.setItem("_miam/outOfStockEntry",JSON.stringify(this.outOfStockEntries)))}addEntryToStorage(e){var t;(null===(t=e.selectedItem)||void 0===t?void 0:t.id)&&(this.fetchCurrentOutOfStocks(),this.outOfStockEntries.includes(e.selectedItem.id)||this.outOfStockEntries.push(e.selectedItem.id),sessionStorage.setItem("_miam/outOfStockEntry",JSON.stringify(this.outOfStockEntries)))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),fv=(()=>{class e{constructor(e,t,i,n,r,s,o,a,c,l,u,d){this.analyticsService=e,this.basketsService=t,this.recipeService=i,this.ignoredBasketsService=n,this.pendingBasketMethodsService=r,this.posService=s,this.itemsService=o,this.basketSynchroService=a,this.priceService=c,this.contextRegistryService=l,this.storeOutOfStockService=u,this.locale=d,this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.products=[],this.totalProducts$=new cp(0),this.allIngredientsToBasketLoading$=new cp(!1),this.ingredientToBasketLoading$=new cp(!1),this.updateIngredientFromBasketLoading$=new cp(!1),this.productsLoading$=new cp(!1),this.recipeLoading$=new cp(!1),this.basketEntryToReplace$=new cp(null),this.updateFooterDisplay$=new C,this.pageviewEventWasSent=!1,this.onlyShowPreparation=!1,this.noPosDisplay=!1,this.invalidPosDisplay=!1,this.productsByCategory$=new cp(this.productsByCategory),this.products$=new cp(this.products),this.recipePrice={remaining:0,inBasket:0},this.subscriptions=[],this.initDefaultState(),this.listenBasketPreview(),this.resetOnHide(),this.executeActionFromStorage()}get remainingBasketEntries(){return this.recipe?this.products.reduce((e,t)=>("initial"!==t.basketEntry.status||t.basketEntry.recipesIds.includes(this.recipe.id)||e.push(t.basketEntry),e),[]):[]}get hasAddedAProduct(){return this.products.some(e=>"active"===e.basketEntry.status)}get isSponsored(){var e,t;return(null===(t=null===(e=this.recipe)||void 0===e?void 0:e.sponsors)||void 0===t?void 0:t.length)>0}get containsAlcohol(){var e,t;return((null===(t=null===(e=this.recipe)||void 0===e?void 0:e.relationships.tags)||void 0===t?void 0:t.data)||[]).some(e=>"ingredient_category_alcool"===e.id)}get orderHistoryDate(){const e=this.recipe.orderHistory;return e?lu(new Date(e),"shortDate",this.locale):""}set basketEntryToReplace(e){this.basketEntryToReplace$.next(e)}set productsLoading(e){this.productsLoading$.next(e)}set recipeLoading(e){this.recipeLoading$.next(e)}set ingredientToBasketLoading(e){this.ingredientToBasketLoading$.next(e)}set allIngredientsToBasketLoading(e){this.allIngredientsToBasketLoading$.next(e)}set updateIngredientFromBasketLoading(e){this.updateIngredientFromBasketLoading$.next(e)}initDefaultState(e=!1){this.noPosDisplay=!1,this.invalidPosDisplay=!1,this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.products=[],this.recipePrice={remaining:0,inBasket:0},this.totalProducts$.next(0),this.allIngredientsToBasketLoading$.next(!1),this.ingredientToBasketLoading$.next(!1),this.updateIngredientFromBasketLoading$.next(!1),this.productsLoading$.next(e),this.recipeLoading$.next(e),this.basketEntryToReplace$.next(null),this.productsByCategory$.next(this.productsByCategory),this.products$.next(this.products)}executeActionFromStorage(){this.productsByCategory$.pipe(bp(e=>0===e.toPickProducts.length),fp(1),th(()=>this.pendingBasketMethodsService.shouldExecuteBasketMethod.pipe(bp(e=>!e)))).subscribe(e=>{"addRecipeToBasket"===e.method&&(this.recipe.modifiedGuests=e.arguments.guests||this.recipe.modifiedGuests,this.addAllIngredientsToBasket(e.arguments.eventTrace))})}resetOnHide(){let e=this.recipe;this.subscriptions.push(this.recipeService.displayedRecipe$.subscribe(t=>{(null==t?void 0:t.recipe)&&t.recipe.id!==(null==e?void 0:e.id)&&(e=t.recipe,this.initDefaultState(),this.checkIfPosIsInitializedAndValid())}))}checkIfPosIsInitializedAndValid(){this.posService.posWasInitialized().pipe(fp(1),th(e=>(this.noPosDisplay=!e,e?this.posService.isPosValid().pipe(fp(1)):td(!1)))).subscribe(e=>{this.invalidPosDisplay=!this.noPosDisplay&&!e})}getProducts(e=!1){e&&(this.productsLoading=!0),this.subscriptions.push(this.getIngredientsBasketEntries(e).subscribe(()=>{this.productsLoading=!1}))}setProductsByCategory(){this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.recipePrice={remaining:0,inBasket:0},this.categorizeProducts()}calculateProductPrice(e,t){const i="active"===e.basketEntry.status?this.priceService.getCurrentPrice(t)*e.basketEntry.quantity:this.priceService.getCurrentPrice(t)*e.basketEntry.quantityToAdd;e.price={unit:t.unit,total:Math.round(100*i)/100,pricePerUnit:t.pricePerUnit,unitOfMeasurement:t.unitOfMeasurement,discountedPrice:t.discountedPrice,discountAmount:t.discountAmount,discountType:t.discountType}}isProductsByCategorySet(){return this.productsByCategory.toPickProducts.length>0||this.productsByCategory.oftenIgnoredProducts.length>0}getIngredientsBasketEntries(e=!1){return this.recipe?(e||(this.ingredientToBasketLoading=!0),nf(this.recipe.ingredients.map(t=>this.basketsService.basketEntryFromIngredient(t.id,this.recipe.modifiedGuests,!e).pipe(E(e=>({ingredient:t,basketEntry:e}))))).pipe(th(t=>e?(this.products=t,this.setProductsByCategory(),td([])):(this.updatePriceOnGuestChange(t),td(this.products))),th(()=>td(this.products)))):td([])}ingredientRemoved(e,t){this.basketsService.recipeIsInBasket(this.recipe.id).pipe(fp(1)).subscribe(i=>{const n=A_(this.basketEntryForIngredient(e));if(n.quantity=0,i){const i=new z_(n,{recipeId:this.recipe.id,ingredientId:e.id,eventTrace:t},this.basketsService);q(i.onTimeout,i.onError).pipe(fp(1)).subscribe(()=>{this.updateIngredientFromBasketLoading=!1,this.getProducts(!0)}),this.basketSynchroService.addToActionList([i])}})}updateProductQuantity(e,t,i){const n=A_(e);n.quantity=t;const r=new N_(n,{eventTrace:i,recipeId:this.recipe.id},this.basketsService);q(r.onTimeout,r.onError).pipe(fp(1)).subscribe(()=>{this.updateIngredientFromBasketLoading=!1,this.getProducts(!0)}),this.basketSynchroService.addToActionList([r])}addAllIngredientsToBasket(e){this.subscriptions.push(this.canAddProductToBasket({method:"addRecipeToBasket",arguments:{recipeId:this.recipe.id,guests:this.recipe.modifiedGuests,eventTrace:e}},e).subscribe(t=>{if(t){this.analyticsService.sendEvent("entry.add-all",e.originPath,{recipe_id:this.recipe.id,entry_count:this.remainingBasketEntries.length.toString(),total_products:this.recipe.ingredients.length.toString(),total_price:this.recipePrice.remaining.toFixed(2).toString()},mp()),this.allIngredientsToBasketLoading=!0;const t=[];this.remainingProducts().forEach(e=>this.basketSynchroService.entryWillBeAdded(e.entry.selectedItem.extId).pipe(fp(1)).subscribe(i=>{i||t.push(e)}));const i=t.map(t=>new dv(t.entry,{recipeId:this.recipe.id,ingredientId:t.ingredientId,eventTrace:e},this.basketsService));this.basketSynchroService.addToActionList(i),q(...i.map(e=>e.onTimeout),...i.map(e=>e.onError)).pipe(fp(1)).subscribe(()=>{this.setProductOutOfStockInSession(this.remainingProducts()),this.allIngredientsToBasketLoading=!1});const n={ingredientsAdded:t.length,ingredientsTotal:this.recipe.ingredients.length};this.basketsService.productsWillBeAdded().pipe(bp(e=>e>0),fp(1)).subscribe(()=>{this.contextRegistryService.addAllProductsWasClicked.emit(n)})}}))}updateGuests(e){this.basketsService.recipeIsInBasket(this.recipe.id).pipe(fp(1)).subscribe(t=>{this.basketsService.updateRecipesInBasket([this.recipe.id],this.recipe.modifiedGuests,e,!0),this.getIngredientsBasketEntries(!1).pipe(fp(1)).subscribe(i=>{if(t){const t=i.filter(({basketEntry:e})=>"active"===e.status&&"-1"!==e.id&&e.recipesIds.includes(+this.recipe.id)).map(({basketEntry:t})=>{const i=A_(t);return new hv(i,{eventTrace:e,recipeId:this.recipe.id},this.basketsService)});this.basketSynchroService.addToActionList(t),q(...t.map(e=>e.onTimeout),...t.map(e=>e.onError)).pipe(fp(1)).subscribe(()=>{this.updateIngredientFromBasketLoading=!1,this.getProducts(!0)})}else this.analyticsService.sendEvent("recipe.change-guests",e.originPath,{recipe_id:this.recipe.id})})}),this.contextRegistryService.guestsChanged.emit({guests:this.recipe.modifiedGuests,recipeId:this.recipe.id}),this.recipeService.displayedRecipeChanged$.next()}replaceBasketEntry(e,t){this.basketEntryToReplace={ingredient:this.products[this.products.findIndex(t=>t.basketEntry.name===e.name)].ingredient,basketEntry:e,ignoreSelected:t}}canAddProductToBasket(e,t,i){const n=i||this.recipe;return this.pendingBasketMethodsService.storeMethodIfCallbackNeeded(e).pipe(th(e=>this.basketsService.recipeIsInBasket(n.id).pipe(fp(1),E(i=>(e&&!i&&this.basketsService.addRecipesToBasket([n.id],n.modifiedGuests,t,!1),e)))))}updateRecipePrice(e,t=!1){t?this.recipePrice.remaining=this.recipePrice.remaining-+e.price.total:this.recipePrice={remaining:this.recipePrice.remaining+("initial"===e.basketEntry.status&&+e.price.total),inBasket:this.recipePrice.inBasket+("active"===e.basketEntry.status&&+e.price.total)}}sendEmitToUpdateRecipePrice(){const{remaining:e,inBasket:t}=this.recipePrice;0!==t?this.basketsService.recipePricesInBasket$().pipe(fp(1),E(e=>{const i=e.find(e=>e.id===this.recipe.id);return i?+i.price:t})).subscribe(t=>{this.contextRegistryService.recipePriceChanged.emit({remaining:e,inBasket:t,recipeId:this.recipe.id})}):this.contextRegistryService.recipePriceChanged.emit(Object.assign(Object.assign({},this.recipePrice),{recipeId:this.recipe.id}))}unsubscribe(){this.subscriptions.forEach(e=>e.unsubscribe())}remainingProducts(){return this.remainingBasketEntries.reduce((e,t)=>{const i=this.products.find(e=>e.basketEntry.name===t.name);return i&&e.push({ingredientId:i.ingredient.id,entry:i.basketEntry}),e},[])}updatePriceOnGuestChange(e){this.recipePrice={remaining:0,inBasket:0};let t=!1;e.forEach((e,i)=>{const n=this.products[i];n.basketEntry.quantity=e.basketEntry.quantity,n.basketEntry.quantityToAdd=e.basketEntry.quantityToAdd,n.price&&this.calculateProductPrice(n,n.price),["initial","active"].includes(n.basketEntry.status)&&(this.updateRecipePrice(n),t=!0)}),t&&this.sendEmitToUpdateRecipePrice(),this.basketsService.recipeIsInBasket(this.recipe.id).pipe(fp(1)).subscribe(e=>{e||(this.updateIngredientFromBasketLoading=!1,this.ingredientToBasketLoading=!1)})}basketEntryForIngredient(e){return this.products.find(t=>t.ingredient.id===e.id).basketEntry}listenBasketPreview(){this.subscriptions.push(this.basketsService._basketPreview$.pipe(th(e=>{var t,i;if(e){const n=e.find(e=>{var t;return e.id===(null===(t=this.recipe)||void 0===t?void 0:t.id)});(null===(i=null===(t=null==n?void 0:n.entries)||void 0===t?void 0:t.all)||void 0===i?void 0:i.length)>0&&(this.products.forEach(e=>{var t;e.basketEntry=null!==(t=n.entries.all.find(t=>t.name===e.basketEntry.name))&&void 0!==t?t:e.basketEntry}),this.setProductsByCategory())}return td(null)})).subscribe())}isIngredientIgnored(e){this.ignoredBasketsService.isIngredientIgnored(e.ingredient.id)&&(e.basketEntry.status="ignored")}categorizeProducts(){this.products.forEach(e=>{const{basketEntry:t}=e,{status:i}=t;this.isIngredientIgnored(e),this.storeOutOfStockService.isOutOfStockFromStorage(t)&&(e.basketEntry.status="out_of_stock"),this.calculateProductPrice(e,this.priceService.getPriceFromBasketEntry(t)),this.correctProductState(e),"often_deleted"===i?this.productsByCategory.oftenIgnoredProducts.push(e):(this.productsByCategory.toPickProducts.push(e),this.updateRecipePrice(e))}),this.sendEmitToUpdateRecipePrice(),this.updateIngredientFromBasketLoading=!1,this.ingredientToBasketLoading=!1,this.productsByCategory$.next(this.productsByCategory)}correctProductState(e){if(!["often_deleted","deleted","ignored","out_of_stock"].includes(e.basketEntry.status)){const{id:t,selectedItem:i,recipesIds:n}=e.basketEntry;if("-1"===t)e.basketEntry.status=i?"initial":"unavailable";else{const t=n.includes(+this.recipe.id);e.basketEntry.status=t?"active":"initial"}}}setProductOutOfStockInSession(e){e.forEach(({entry:e})=>{e.status="out_of_stock",this.storeOutOfStockService.addEntryToStorage(e)})}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(C_),nn(__),nn(Qf),nn(pv),nn(Vf),nn(mv),nn($_),nn(w_),nn(Dp),nn(gv),nn(nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class _v extends O_{get type(){return"REMOVE-PRODUCT"}updateMealzBasket(){}shouldRemoveAction(e){return!0}}class vv extends O_{get type(){return"ADD-PRODUCT"}updateMealzBasket(){this.basketEntry.selectedItem&&this.basketEntry.removeRelationship("selected-item",this.basketEntry.selectedItem.id),this.basketEntry.addRelationship(this.updateMealzParams.item,"selected-item"),this.basketEntriesService.selectItem(this.basketEntry.id,this.updateMealzParams.item.id,this.quantity).pipe(th(()=>this.basketsService.refreshCurrentBasket()),fp(1)).subscribe()}createActionForRetailer(){return(this.quantity<1?td(this.quantity):this.getDifferenceFromBasketEntry(this)).pipe(E(e=>({id:this.id,quantity:e})))}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)}}class bv extends O_{get type(){return"ADD-PRODUCT"}updateMealzBasket(){this.updateMealzParams.recipeId?this.basketsService.addIngredientsToBasket(this.updateMealzParams.recipeId,[{ingredientId:this.updateMealzParams.ingredientId,entry:this.basketEntry}],this.updateMealzParams.eventTrace,this.updateMealzParams.previousItem,this.updateMealzParams.searchString):this.basketsService.addItemToBasket(this.updateMealzParams.item,this.updateMealzParams.eventTrace)}createActionForRetailer(){return(this.quantity<1?td(this.quantity):this.getDifferenceFromBasketEntry(this)).pipe(E(e=>({id:this.id,quantity:e})))}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)}}let yv=(()=>{class e{constructor(e,t,i,n,r,s,o,a){this.basketsService=e,this.basketEntriesService=t,this.itemsService=i,this.recipeDetailsService=n,this.basketSynchroService=r,this.ignoredBasketsService=s,this.recipesService=o,this.analyticsService=a,this.basketEntry=new Pf,this.itemsWithPricesList$=new cp([]),this.fetchingItemLoading$=new cp(!1),this.replaceItemLoading$=new cp(null),this.basketEntryToReplace$=new cp(null),this.replaceProductFromPreviewOpen$=new cp(null),this.additionModalOpen$=new cp(!1),this.productAdded$=new C,this.basketEntryToReplace$.pipe(th(e=>e?(this.basketEntry=e.basketEntry,this.ingredient=e.ingredient,this.ignoreSelected=e.ignoreSelected,this.addProductMode=e.addProductMode||!1,td(e)):(this.itemsWithPricesList$.next([]),this.addProductMode=!1,td(e))),id(e=>!!e||this.addProductMode),th(()=>this.fetchItems())).subscribe(),this.recipesService.displayedRecipe$.subscribe(e=>{this.recipe=null==e?void 0:e.recipe}),this.replaceProductFromPreviewOpen$.pipe(id(e=>!!e),th(()=>this.fetchItems())).subscribe()}handleItemSelection(e,t,i,n,r){const s=!!this.recipe;this.timeOutAction=r,this.onSelectItem(e,t,n).pipe(fp(1)).subscribe(r=>{r.onSuccess.pipe(fp(1)).subscribe(()=>{this.recipeDetailsService.hasReplaced=!0,n&&s&&this.sendReplaceEvent(t,n),this.addProductMode||!s?this.basketsService.itemWillBeAdded(e.id).subscribe(t=>{!t&&this.replaceItemLoading$.value&&i(e.id)}):this.basketsService.ingredientWillBeAdded(this.ingredient.id).subscribe(e=>{!e&&this.replaceItemLoading$.value&&i(this.basketEntry.id)})})})}onSelectItem(e,t,i){return this.addProductMode?this.handleAddProductMode(e,this.basketEntry,i):this.handleReplaceProductMode(e,this.basketEntry,this.ingredient,t,i,this.ignoreSelected)}searchItem(e){var t,i;return this.fetchingItemLoading$.next(!0),this.itemsService.searchForIngredient(e,null===(t=this.ingredient)||void 0===t?void 0:t.id,+(null===(i=this.recipe)||void 0===i?void 0:i.modifiedGuests)).pipe(E(e=>{const t=this.itemsService.newCollection();return t.fill(e),t.data.filter(e=>{var t;return e.id!==(null===(t=this.basketEntry.selectedItem)||void 0===t?void 0:t.id)})}),th(e=>{const t=e.map(e=>this.itemsService.getPriceForItem(e.id).pipe(E(t=>({item:e,price:t}))));return(0===t.length?td([]):nf(t)).pipe(E(e=>(this.fetchingItemLoading$.next(!1),this.itemsWithPricesList$.next(e))))}))}handleReplaceProductMode(e,t,i,n,r,s){return this.replaceItemLoading$.next(e),this.previousItem=t.selectedItem,s&&i&&this.ignoredBasketsService.removeIngredientFromIgnored(i.id),"active"===t.status?this.replaceBasketEntryActiveItem(e,t,i):this.addBasketEntryItem(e,t,n,r)}handleAddProductMode(e,t,i){this.replaceItemLoading$.next(e);const n=A_(t);this.replaceRelationship(n,e);const r=new bv(n,{eventTrace:i,item:e},this.basketsService,this.basketEntriesService);return q(r.onTimeout,r.onError).pipe(fp(1)).subscribe(()=>{this.rollbackReplace()}),this.basketSynchroService.addToActionList([r]),td(r)}fetchItems(){var e,t,i;return this.fetchingItemLoading$.next(!0),this.itemsService.searchForIngredient((null===(e=this.ingredient)||void 0===e?void 0:e.id)?null:this.basketEntry.name,null===(t=this.ingredient)||void 0===t?void 0:t.id,+(null===(i=this.recipe)||void 0===i?void 0:i.modifiedGuests)).pipe(E(e=>{const t=this.itemsService.newCollection();return t.fill(e),t.data}),th(e=>{this.basketEntry.selectedItem&&void 0===e.find(e=>{var t;return e.id===(null===(t=this.basketEntry.selectedItem)||void 0===t?void 0:t.id)})&&e.push(this.basketEntry.selectedItem);const t=e.map(e=>this.itemsService.getPriceForItem(e.id).pipe(E(t=>({item:e,price:t}))));return 0===t.length?td([]):nf(t)}),E(e=>(this.itemsWithPricesList$.next(this.moveSelectedItemToFront(e)),this.fetchingItemLoading$.next(!1),e)))}selectItem(e){const t=A_(this.basketEntry);t.quantity=0,t.selectedItem.extId=this.previousItem.extId;const i=new _v(t,{},this.basketsService);return q(i.onTimeout,i.onError).pipe(fp(1)).subscribe(()=>{this.rollbackReplace()}),this.basketSynchroService.addToActionList([i]),(this.ingredient&&this.recipe?this.basketsService.basketEntryFromIngredient(this.ingredient.id,+this.recipe.modifiedGuests||+this.recipe.guests||4,!0,e.id):td(this.basketEntry)).pipe(th(t=>{const i=A_(this.basketEntry);i.quantityToAdd=t.quantityToAdd,this.replaceRelationship(i,e);const n=new vv(i,{item:e},this.basketsService,this.basketEntriesService);return q(n.onTimeout,n.onError).pipe(fp(1)).subscribe(()=>{this.rollbackReplace()}),this.basketSynchroService.addToActionList([n]),n.onSuccess.pipe(fp(1)).subscribe(()=>{this.recipeDetailsService.updateIngredientFromBasketLoading=!1}),td(n)}))}changeReplaceModalState(e,t){t&&(this.basketEntry=t,this.ingredient=null),this.replaceProductFromPreviewOpen$.next(e?this.basketEntry:null)}changeAdditionModalState(e){this.addProductMode=!0,this.additionModalOpen$.next(e)}showProductSection(){this.productAdded$.next(""),this.changeAdditionModalState(!1)}replaceRelationship(e,t){e.selectedItem&&e.removeRelationship("selected-item",e.selectedItem.id),e.addRelationship(t,"selected-item")}rollbackReplace(){this.recipeDetailsService.ingredientToBasketLoading=!1,this.recipeDetailsService.updateIngredientFromBasketLoading=!1,this.replaceItemLoading$.next(void 0),this.basketEntry.relationships["selected-item"].data=this.previousItem,this.timeOutAction&&this.timeOutAction()}getAddIngredientMethod(e,t){return{method:"addIngredientToBasket",arguments:{recipeId:this.recipe.id,ingredientId:this.ingredient.id,entry:this.basketEntry,eventTrace:e,searchString:t}}}handleAddToBasketResponse(e,t,i){this.updateLoadingStates();const n=A_(this.basketEntry);n.quantityToAdd=e.quantityToAdd;const r=new bv(n,{eventTrace:i,recipeId:this.recipe.id,ingredientId:this.ingredient.id,previousItem:this.previousItem,searchString:t},this.basketsService);return this.handleAddIngredientActionErrors(r),this.basketSynchroService.addToActionList([r]),td(r)}handleAddIngredientActionErrors(e){q(e.onError,e.onTimeout).pipe(fp(1)).subscribe(()=>{this.rollbackReplace()})}updateLoadingStates(){this.recipeDetailsService.ingredientToBasketLoading="initial"===this.basketEntry.status,this.recipeDetailsService.updateIngredientFromBasketLoading="initial"!==this.basketEntry.status}replaceBasketEntryActiveItem(e,t,i){return i?this.selectItem(e):this.processActiveBasketEntryWithoutIngredient(e,t)}processActiveBasketEntryWithoutIngredient(e,t){return this.recipesService.all({filter:{id:t.recipesIds},include:["ingredients"],fields:{recipes:["ingredients","number-of-guests"],ingredients:["name"]}}).pipe(th(i=>{var n;return this.recipe=i.data.find(e=>e.ingredients.some(e=>e.attributes.name===t.name)),this.ingredient=null===(n=this.recipe)||void 0===n?void 0:n.ingredients.find(e=>e.attributes.name===t.name),this.selectItem(e)}))}addToBasket(e,t,i){return this.recipeDetailsService.canAddProductToBasket(this.getAddIngredientMethod(i,t),i,this.recipe).pipe(id(e=>e),th(()=>this.basketsService.basketEntryFromIngredient(this.ingredient.id,+this.recipe.modifiedGuests,!0,e.id)),th(e=>this.handleAddToBasketResponse(e,t,i)))}addBasketEntryItem(e,t,i,n){return this.replaceRelationship(t,e),this.addToBasket(e,i,n)}moveSelectedItemToFront(e){var t;const i=null===(t=this.basketEntry.selectedItem)||void 0===t?void 0:t.id;return e.sort((e,t)=>e.item.id===i?-1:t.item.id===i?1:0)}sendReplaceEvent(e,t){this.analyticsService.sendEvent("entry.replaced",t.originPath,{entry_name:this.basketEntry.name,new_item_id:this.basketEntry.selectedItem.id,new_item_ext_id:this.basketEntry.selectedItem.attributes["ext-id"],new_item_ean:this.basketEntry.selectedItem.ean,product_quantity:this.basketEntry.quantity.toString(),recipe_id:this.recipe.id,search_term:e,old_item_id:this.previousItem.id,old_item_ext_id:this.previousItem.attributes["ext-id"],old_item_ean:this.previousItem.ean})}}return e.\u0275fac=function(t){return new(t||e)(nn(C_),nn(zf),nn(mv),nn(fv),nn($_),nn(Qf),nn(__),nn(Rp))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),wv=(()=>{class e{constructor(e,t,i,n,r,s){this.basketsService=e,this.priceService=t,this.ignoredBasketsService=i,this.replaceItemService=n,this.contextRegistryService=r,this.basketSynchroService=s,this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.productsByCategory$=new cp(this.productsByCategory),this.products$=new cp([]),this.recipePrice$=new cp({remaining:0,inBasket:0}),this.productsLoading$=new cp(!1),this.ingredientToBasketLoading$=new cp(!1),this.updateIngredientFromBasketLoading$=new cp(!1)}initDefaultState(){this.resetProductsByCategory(),this.products$.next([]),this.productsByCategory$.next(this.productsByCategory),this.replaceItemService.basketEntryToReplace$.next(null)}resetProductsByCategory(){this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.recipePrice$.next({remaining:0,inBasket:0})}getIngredientsBasketEntries(e,t,i=!1){return e&&0!==e.length?(i||this.ingredientToBasketLoading$.next(!0),nf(e.map(e=>this.basketsService.basketEntryFromIngredient(e.id,t,!i).pipe(E(t=>({ingredient:e,basketEntry:t}))))).pipe(th(e=>i?(this.setProductsByCategory(e),td([])):(this.updatePriceOnGuestChange(e),td(this.products$.value))),th(()=>td(this.products$.value)))):td([])}productIsBeingAdded(e){var t;return this.basketSynchroService.entryWillBeAdded(null===(t=e.selectedItem)||void 0===t?void 0:t.extId)}setProductsByCategory(e){this.resetProductsByCategory(),e.forEach(e=>{const{basketEntry:t}=e,{status:i}=t;this.updateIngredientIgnoredStatus(e),this.updateProductAvailabilityStatus(e),this.computeProductPriceDetails(e,this.priceService.getPriceFromBasketEntry(t)),"often_deleted"===i?this.productsByCategory.oftenIgnoredProducts.push(e):(this.productsByCategory.toPickProducts.push(e),this.updateRecipePrice(e))}),this.sendEmitToUpdateRecipePrice(),this.products$.next(e),this.updateIngredientFromBasketLoading$.next(!1),this.ingredientToBasketLoading$.next(!1),this.productsByCategory$.next(this.productsByCategory)}updateRecipePrice(e,t=!1){t?(this.recipePrice$.value.remaining=this.recipePrice$.value.remaining-+e.price.total,this.recipePrice$.next(this.recipePrice$.value),this.products$.next(this.products$.value)):this.recipePrice$.next({remaining:this.recipePrice$.value.remaining+("initial"===e.basketEntry.status&&+e.price.total),inBasket:this.recipePrice$.value.inBasket+("active"===e.basketEntry.status&&+e.price.total)})}updatePriceOnGuestChange(e){this.recipePrice$.next({remaining:0,inBasket:0});let t=!1;e.forEach(e=>{const i=this.products$.value.find(t=>t.ingredient.id===e.ingredient.id);i&&(i.basketEntry.quantity=e.basketEntry.quantity,i.basketEntry.quantityToAdd=e.basketEntry.quantityToAdd,i.price&&this.computeProductPriceDetails(i,i.price),["initial","active"].includes(i.basketEntry.status)&&(this.updateRecipePrice(i),t=!0))}),t&&this.sendEmitToUpdateRecipePrice(),this.basketsService.recipeIsInBasket(this.recipeId).pipe(fp(1)).subscribe(e=>{e||(this.updateIngredientFromBasketLoading$.next(!1),this.ingredientToBasketLoading$.next(!1))})}updateIngredientIgnoredStatus(e){this.ignoredBasketsService.isIngredientIgnored(e.ingredient.id)&&(e.basketEntry.status="ignored")}updateProductAvailabilityStatus(e){const{basketEntry:t}=e,{id:i,selectedItem:n,recipesIds:r,status:s}=t;["often_deleted","deleted","ignored"].includes(s)||(t.status="-1"===i?n?"initial":"unavailable":r.includes(+this.recipeId)?"active":"initial")}computeProductPriceDetails(e,t){const i="active"===e.basketEntry.status?this.priceService.getCurrentPrice(t)*e.basketEntry.quantity:this.priceService.getCurrentPrice(t)*e.basketEntry.quantityToAdd;e.price={unit:t.unit,total:Math.round(100*i)/100,pricePerUnit:t.pricePerUnit,unitOfMeasurement:t.unitOfMeasurement,discountedPrice:t.discountedPrice,discountAmount:t.discountAmount,discountType:t.discountType}}isProductsByCategorySet(){return this.productsByCategory.toPickProducts.length>0||this.productsByCategory.oftenIgnoredProducts.length>0}replaceBasketEntry(e,t){this.replaceItemService.basketEntryToReplace$.next({ingredient:this.products$.value[this.products$.value.findIndex(t=>t.basketEntry.name===e.name)].ingredient,basketEntry:e,ignoreSelected:t})}sendEmitToUpdateRecipePrice(){const{remaining:e,inBasket:t}=this.recipePrice$.value;0!==t?this.basketsService.recipePricesInBasket$().pipe(fp(1),E(e=>{const i=e.find(e=>e.id===this.recipeId);return i?+i.price:t})).subscribe(t=>{this.contextRegistryService.recipePriceChanged.emit({remaining:e,inBasket:t,recipeId:this.recipeId})}):this.contextRegistryService.recipePriceChanged.emit(Object.assign(Object.assign({},this.recipePrice$.value),{recipeId:this.recipeId}))}}return e.\u0275fac=function(t){return new(t||e)(nn(C_),nn(w_),nn(Qf),nn(yv),nn(Dp),nn($_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),kv=(()=>{class e{constructor(e,t,i,n){this.analyticsService=e,this.ingredientsService=t,this.itemsService=i,this.mealsPlannerService=n,this.isRecipeInMenu=!1,this.productsPlannerByCategory$=new cp({toPickProducts:[],oftenIgnoredProducts:[]}),this.itemToReplace$=new cp(null),this.itemsWithPricesList$=new cp([]),this.plannerRecipePrice$=new cp(0),this.fetchingItemLoading$=new cp(!1),this.productsLoading=!1,this.updateRecipePrice(),this.itemToReplace$.pipe(th(e=>e?this.fetchItems("",e.ingredient,e.item,e.status):(this.itemsWithPricesList$.next([]),td(void 0)))).subscribe()}setRecipe(e,t){this.isRecipeInMenuSubscription&&this.isRecipeInMenuSubscription.unsubscribe(),this.guests=t,this.recipeId=e,this.isRecipeInMenuSubscription=Xg([this.mealsPlannerService.isRecipeInMenu(this.recipeId),this.mealsPlannerService.getMenuRecipeId(this.recipeId)]).subscribe(([e,t])=>{this.isRecipeInMenu=e,this.menuRecipeId=t})}updateGuests(e,t){this.guests=e,(this.isRecipeInMenu&&this.menuRecipeId?this.mealsPlannerService.updateRecipeFromMenu(this.menuRecipeId,e).pipe(fp(1)):td(void 0)).pipe(fp(1)).subscribe(()=>{const i=this.productsPlannerByCategory$.getValue(),n=[...i.toPickProducts,...i.oftenIgnoredProducts];0!==n.length&&nf(n.filter(e=>e.item).map(t=>this.ingredientsService.fetchQuantityToAdd(t.ingredient.id,e,t.item.id).pipe(E(e=>({product:t,quantity:e}))))).subscribe(e=>{const n=i.toPickProducts.map(t=>{const i=e.find(e=>e.product===t);return i?Object.assign(Object.assign({},t),{quantity:i.quantity}):t}),r=i.oftenIgnoredProducts.map(t=>{const i=e.find(e=>e.product===t);return i?Object.assign(Object.assign({},t),{quantity:i.quantity}):t});this.productsPlannerByCategory$.next({toPickProducts:n,oftenIgnoredProducts:r}),this.updateRecipePrice(),this.analyticsService.sendEvent("recipe.change-guests",t.originPath,{recipe_id:this.recipeId})})})}updateRecipePrice(){this.productsPlannerByCategory$.pipe(id(e=>e.toPickProducts.length>0),E(e=>[...e.toPickProducts,...e.oftenIgnoredProducts].filter(e=>{var t;return"ticked"===e.status&&(null===(t=e.price)||void 0===t?void 0:t.unit)&&e.quantity}).reduce((e,t)=>e+t.price.unit*t.quantity,0))).subscribe(e=>this.plannerRecipePrice$.next(e))}loadProducts(e){return this.productsLoading=!0,e&&0!==e.length?(this.isRecipeInMenu?this.loadFromMenu(e):this.loadFromLocal(e)).pipe(df(e=>this.categorizeItems(e))):td([])}loadFromMenu(e){return this.mealsPlannerService.getAllMenuItems().pipe(th(({data:t,included:i})=>{const n=this.toMap(i),r=e.map(e=>{const i=this.getDefinitionId(e),r=t.find(e=>e.attributes["ingredients-definition-id"]===i),s=String(null==r?void 0:r.attributes["item-id"]),o=null==r?void 0:r.attributes.status,a=n[s];return a?nf({price:this.itemsService.getPriceForItem(a.id),quantity:this.ingredientsService.fetchQuantityToAdd(e.id,this.guests,a.id)}).pipe(E(({price:t,quantity:i})=>({ingredient:e,item:a,price:t,quantity:i,status:o}))):td({ingredient:e,item:null,price:null,quantity:0,status:"unavailable"})});return nf(r)}))}loadFromLocal(e){const t=e.map(e=>this.itemsService.searchForIngredient("",e.id,this.guests).pipe(E(e=>{const t=this.itemsService.newCollection();return t.fill(e),t.data[0]}),th(t=>{if(!t)return td({ingredient:e,item:null,price:null,quantity:0,status:"unavailable"});const i=this.isOftenIgnored(e)?"unselected":"ticked";return nf({price:this.itemsService.getPriceForItem(t.id),quantity:this.ingredientsService.fetchQuantityToAdd(e.id,this.guests,t.id)}).pipe(E(({price:n,quantity:r})=>({ingredient:e,item:t,price:n,quantity:r,status:i})))})));return nf(t)}categorizeItems(e){const t={toPickProducts:[],oftenIgnoredProducts:[]};e.forEach(e=>{(this.isOftenIgnored(e.ingredient)&&"ticked"!==e.status?t.oftenIgnoredProducts:t.toPickProducts).push(e)}),this.itemToReplace$.next(null),this.plannerRecipePrice$.next(0),this.productsPlannerByCategory$.next(t)}fetchItems(e,t,i,n){return this.fetchingItemLoading$.next(!0),this.itemsService.searchForIngredient(e,t.id,this.guests).pipe(E(e=>{const t=this.itemsService.newCollection();return t.fill(e),t.data.filter(e=>e.id!==(null==i?void 0:i.id))}),th(e=>{i&&e.unshift(i);const r=e.map(e=>nf({price:this.itemsService.getPriceForItem(e.id),quantity:this.ingredientsService.fetchQuantityToAdd(t.id,this.guests,e.id)}).pipe(E(({price:r,quantity:s})=>({ingredient:t,item:e,price:r,quantity:s,status:e.id===(null==i?void 0:i.id)?n:"unselected"}))));return(0===r.length?td([]):nf(r)).pipe(E(e=>(this.fetchingItemLoading$.next(!1),this.itemsWithPricesList$.next(e))))}))}selectProduct(e,t){this.updateUserSelection("ticked",e,t)}unselectProduct(e,t){this.updateUserSelection("unselected",e,t)}openReplaceItemView(e){this.itemToReplace$.next(e)}replaceProduct(e){const t=this.getDefinitionId(e.ingredient);this.updateUserSelection("ticked",+e.item.id,t),this.replaceInCategories(e,t)}replaceInCategories(e,t){const i=this.productsPlannerByCategory$.getValue(),n=i.oftenIgnoredProducts.filter(e=>this.getDefinitionId(e.ingredient)!==t),r=i.toPickProducts.findIndex(e=>this.getDefinitionId(e.ingredient)===t);let s;-1!==r?(s=[...i.toPickProducts],s[r]=e):s=[...i.toPickProducts,e],this.productsPlannerByCategory$.next({toPickProducts:s,oftenIgnoredProducts:n}),this.itemsWithPricesList$.next(this.sortItems(e.item.id))}updateUserSelection(e,t,i){this.isRecipeInMenu&&this.mealsPlannerService.patchUserSelection(e,t,i).pipe(fp(1)).subscribe(()=>{this.mealsPlannerService.updateMenuPrice()}),this.updateProductStatus(e,i),this.updateRecipePrice()}updateProductStatus(e,t){const{toPickProducts:i,oftenIgnoredProducts:n}=this.productsPlannerByCategory$.getValue(),r=i.findIndex(e=>this.getDefinitionId(e.ingredient)===t);if(-1!==r){const t=i[r],s=Object.assign(Object.assign({},t),{status:e});if("unselected"===e&&this.isOftenIgnored(t.ingredient)){const e=i.filter((e,t)=>t!==r),t=[...n,s];this.productsPlannerByCategory$.next({toPickProducts:e,oftenIgnoredProducts:t})}else{const e=[...i];e[r]=s,this.productsPlannerByCategory$.next({toPickProducts:e,oftenIgnoredProducts:n})}}}toMap(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t.id]:t}),{})}getDefinitionId(e){var t;return(null===(t=null==e?void 0:e.relationships)||void 0===t?void 0:t.definition.data).id}isOftenIgnored(e){const t=e.relationships.definition.data;return!!(null==t?void 0:t.attributes["often-deleted"])}sortItems(e){return this.itemsWithPricesList$.getValue().map(t=>t.item.id!==e?Object.assign(Object.assign({},t),{status:"unselected"}):t).sort((t,i)=>t.item.id===e?-1:i.item.id===e?1:0)}reset(){this.productsPlannerByCategory$.next({toPickProducts:[],oftenIgnoredProducts:[]}),this.itemToReplace$.next(null),this.plannerRecipePrice$.next(0)}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(Xf),nn(mv),nn(f_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Cv=function(e){return e[e.Clear=0]="Clear",e[e.CostHight=1]="CostHight",e[e.CostMedium=2]="CostMedium",e[e.CostLow=3]="CostLow",e[e.DifficultyHigh=4]="DifficultyHigh",e[e.DifficultyMedium=5]="DifficultyMedium",e[e.DifficultyLow=6]="DifficultyLow",e[e.People=7]="People",e[e.Time=8]="Time",e[e.Plus=9]="Plus",e[e.Grip=10]="Grip",e[e.ArrowDown=11]="ArrowDown",e[e.Trash=12]="Trash",e[e.Trash_danger=13]="Trash_danger",e[e.Trash_grey05=14]="Trash_grey05",e[e.Trash_greyText=15]="Trash_greyText",e[e.Trash_greyTextDark=16]="Trash_greyTextDark",e[e.CloudUpload=17]="CloudUpload",e[e.Picture=18]="Picture",e[e.Wait=19]="Wait",e[e.Hot=20]="Hot",e[e.RecipeBook=21]="RecipeBook",e[e.ChevronDown=22]="ChevronDown",e[e.Search=23]="Search",e[e.Cart=24]="Cart",e[e.CartPlus=25]="CartPlus",e[e.Meal=26]="Meal",e[e.Meal_grey06=27]="Meal_grey06",e[e.HorizontalDots=28]="HorizontalDots",e[e.NoRecipeFound=29]="NoRecipeFound",e[e.Preheat=30]="Preheat",e[e.Empty=31]="Empty",e[e.CircledPlus=32]="CircledPlus",e[e.MainDish=33]="MainDish",e[e.NotMainDish=34]="NotMainDish",e[e.Dessert=35]="Dessert",e[e.NotDessert=36]="NotDessert",e[e.Starter=37]="Starter",e[e.NotStarter=38]="NotStarter",e[e.Edit=39]="Edit",e[e.Cross=40]="Cross",e[e.Home=41]="Home",e[e.Filter=42]="Filter",e[e.Checkmark=43]="Checkmark",e[e.Alert=44]="Alert",e}({});let Sv=(()=>{class e extends sp{constructor(){super(),this.resource=Ff,this.type="sponsor-block-types",this.register()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),xv=(()=>{class e extends sp{constructor(e){super(),this.blockTypesService=e,this.resource=Of,this.type="sponsor-blocks",this.register()}}return e.\u0275fac=function(t){return new(t||e)(nn(Sv))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Ev=(()=>{class e{constructor(e,t,i,n,r,s,o,a,c,l,u,d,h,p,m,g){this.analyticsService=e,this.basketsService=t,this.recipeService=i,this.pendingBasketMethodsService=n,this.posService=r,this.basketSynchroService=s,this.priceService=o,this.contextRegistryService=a,this.sponsorBlocksService=c,this.recipesService=l,this.seoService=u,this.storeLocatorService=d,this.recipeDetailsProductsService=h,this.recipeDetailsProductsPlannerService=p,this.ignoredBasketsService=m,this.locale=g,this.totalProducts$=new cp(0),this.allIngredientsToBasketLoading$=new cp(!1),this.recipeLoading$=new cp(!1),this.updateFooterDisplay$=new C,this.displayEventWasSent=!1,this.onlyShowPreparation=!1,this.noPosDisplay$=new cp(!1),this.invalidPosDisplay$=new cp(!1),this.orderHistoryDate$=new cp(""),this.remainingBasketEntries$=new cp([]),this.previewAllowed=!0,this.ingredientsPictures=!1,this.displayTagsIcons=!1,this.displayPricing=!0,this.displayGuests=!0,this.helpButtonAllowed=!0,this.stepsOnLeftSide=!1,this.cookingTimeAsPrimaryInfo=!1,this.pricingGuestsText="par-personne",this.recipeAdded=new Rc,this.recipeError=new Rc,this.closeDetails=new Rc,this.removedIngredients=[],this.isMobile=!1,this.displayTags=!1,this.showAddon=!1,this.showStoreSelector=!1,this.isRecipeFetched=!1,this.icon=Cv,this.primaryButtonClicked$=new Rc,this.addButtonLoading=!1,this.titleInHeader=!1,this.displayLastOrderModal=!1,this.sponsorHasStorytelling=!1,this.activeTabIndex=0,this.initialTabIndex=0,this.basketSynchroHasPendigActions=!1,this.subscriptions=[],this.initDefaultState(),this.listenToRecipeDisplayed(),this.listenToBasket(),this.listenRemainingBasketEntries()}get ingredientToBasketLoading(){return this.recipeDetailsProductsService.ingredientToBasketLoading$}get updateIngredientFromBasketLoading(){return this.recipeDetailsProductsService.updateIngredientFromBasketLoading$}get productsLoading(){return this.recipeDetailsProductsService.productsLoading$}get remainingBasketEntries(){return this.recipe?this.recipeDetailsProductsService.products$.value.reduce((e,t)=>("initial"!==t.basketEntry.status||t.basketEntry.recipesIds.includes(this.recipe.id)||e.push(t.basketEntry),e),[]):[]}setOrderHistoryDate(){const e=this.recipe.orderHistory;if(!e)return void this.orderHistoryDate$.next("");const t=new Date(e);this.orderHistoryDate$.next(lu(t,"shortDate",this.locale))}setupRecipe(e){let t,i=this.recipe;return(null==e?void 0:e.id)!==(null==i?void 0:i.id)&&(i=e,this.initDefaultState(!0),this.checkIfPosIsInitializedAndValid()),this.recipe=e,this.recipeDetailsProductsService.recipeId=this.recipe.id,this.recipeDetailsProductsPlannerService.setRecipe(this.recipe.id,+this.recipe.modifiedGuests),t=this.recipesService.isRecipeDetailsFromPlanner?this.loadPlannerProducts():this.loadProducts(),this.setOrderHistoryDate(),this.isRecipeFetched=!0,t.pipe(E(()=>{}))}listenRemainingBasketEntries(){this.subscriptions.push(this.recipeDetailsProductsService.products$.subscribe(e=>{this.remainingBasketEntries$.next(this.recipe?e.reduce((e,t)=>("initial"!==t.basketEntry.status||t.basketEntry.recipesIds.includes(this.recipe.id)||e.push(t.basketEntry),e),[]):[])}))}listenToRecipeDisplayed(){this.subscriptions.push(this.recipesService.displayedRecipe$.pipe(th(e=>(null==e?void 0:e.recipe)?this.setupRecipe(e.recipe):(this.initDefaultState(),this.checkIfPosIsInitializedAndValid(),td(null)))).subscribe())}listenToBasket(){this.subscriptions.push(this.basketsService._basket$.pipe(id(()=>!!this.recipe),th(()=>this.recipesService.isRecipeDetailsFromPlanner?this.loadPlannerProducts():this.loadProducts())).subscribe())}loadPlannerProducts(){return this.recipeDetailsProductsPlannerService.productsLoading?td([]):this.recipesService.getIngredientsDefinitions(this.recipe.id).pipe(th(e=>this.recipeDetailsProductsPlannerService.loadProducts(e)),df(()=>{this.recipeDetailsProductsPlannerService.productsLoading=!1,this.recipeDetailsProductsService.productsLoading$.next(!1)}),fp(1))}loadProducts(){return this.recipeDetailsProductsService.getIngredientsBasketEntries(this.recipe.ingredients,this.recipe.modifiedGuests,!0).pipe(df(()=>this.recipeDetailsProductsService.productsLoading$.next(!1)),fp(1))}initDefaultState(e=!1){this.noPosDisplay$.next(!1),this.invalidPosDisplay$.next(!1),this.recipeDetailsProductsService.initDefaultState(),this.recipeDetailsProductsPlannerService.reset(),this.totalProducts$.next(0),this.allIngredientsToBasketLoading$.next(!1),this.recipeDetailsProductsService.ingredientToBasketLoading$.next(!1),this.recipeDetailsProductsService.updateIngredientFromBasketLoading$.next(!1),this.recipeDetailsProductsService.productsLoading$.next(e),this.recipeLoading$.next(e),this.recipeDetailsProductsService.resetProductsByCategory()}checkIfPosIsInitializedAndValid(){this.posService.posWasInitialized().pipe(fp(1),th(e=>(this.noPosDisplay$.next(!e),e?this.posService.isPosValid().pipe(fp(1)):td(!1)))).subscribe(e=>{this.invalidPosDisplay$.next(!this.noPosDisplay$.value&&!e)})}updateGuests(e){this.basketsService.recipeIsInBasket(this.recipe.id).pipe(fp(1)).subscribe(t=>{this.basketsService.updateRecipesInBasket([this.recipe.id],this.recipe.modifiedGuests,e,!0),this.recipeDetailsProductsService.getIngredientsBasketEntries(this.recipe.ingredients,this.recipe.modifiedGuests,!1).pipe(fp(1)).subscribe(i=>{if(t){const t=i.filter(({basketEntry:e})=>"active"===e.status&&"-1"!==e.id&&e.recipesIds.includes(+this.recipe.id)).map(({basketEntry:t})=>{const i=A_(t);return new hv(i,{eventTrace:e,recipeId:this.recipe.id},this.basketsService)});t.length>0&&(this.basketSynchroService.addToActionList(t),q(...t.map(e=>e.onTimeout),...t.map(e=>e.onError)).pipe(fp(1)).subscribe(()=>{this.recipeDetailsProductsService.updateIngredientFromBasketLoading$.next(!1)}))}})}),this.contextRegistryService.guestsChanged.emit({guests:this.recipe.modifiedGuests,recipeId:this.recipe.id})}addAllIngredientsToBasket(e){this.subscriptions.push(this.canAddProductToBasket({method:"addRecipeToBasket",arguments:{recipeId:this.recipe.id,guests:this.recipe.modifiedGuests,eventTrace:e}},e).subscribe(t=>{if(t){this.allIngredientsToBasketLoading$.next(!0);const t=[];this.remainingProducts().forEach(e=>this.basketSynchroService.entryWillBeAdded(e.entry.selectedItem.extId).pipe(fp(1)).subscribe(i=>{i||t.push(e)}));const i=t.map(t=>new dv(t.entry,{recipeId:this.recipe.id,ingredientId:t.ingredientId,eventTrace:e},this.basketsService));this.basketSynchroService.addToActionList(i);const n=i.map(e=>e.onTimeout),r=i.map(e=>e.onError),s=i.map(e=>e.onSuccess);i.length>0?q(...s,...n,...r).pipe(fp(i.length)).subscribe({complete:()=>this.allIngredientsToBasketLoading$.next(!1)}):this.allIngredientsToBasketLoading$.next(!1);const o={ingredientsAdded:t.length,ingredientsTotal:this.recipe.ingredients.length};this.basketsService.productsWillBeAdded().pipe(bp(e=>e>0),fp(1)).subscribe(()=>{this.contextRegistryService.addAllProductsWasClicked.emit(o)})}}))}addToBasket(e,t){this.subscriptions.push(this.canAddProductToBasket({method:"addIngredientToBasket",arguments:{recipeId:this.recipe.id,ingredientId:e.ingredient.id,entry:e.basketEntry,eventTrace:t}},t).pipe(id(e=>e),df(()=>this.recipeDetailsProductsService.ingredientToBasketLoading$.next(!0)),E(()=>new bv(e.basketEntry,{recipeId:this.recipe.id,ingredientId:e.ingredient.id,eventTrace:t,previousItem:null,searchString:null},this.basketsService)),df(e=>{this.basketSynchroService.addToActionList([e])}),th(e=>q(e.onError,e.onTimeout).pipe(fp(1),df(()=>this.recipeDetailsProductsService.ingredientToBasketLoading$.next(!1))))).subscribe())}ingredientRemoved(e,t){const i=A_(this.basketEntryForIngredient(e));i.quantity=0;const n=new z_(i,{recipeId:this.recipe.id,ingredientId:e.id,eventTrace:t},this.basketsService);q(n.onTimeout,n.onError).pipe(fp(1)).subscribe(()=>{this.recipeDetailsProductsService.updateIngredientFromBasketLoading$.next(!1),this.recipeDetailsProductsService.getIngredientsBasketEntries(this.recipe.ingredients,this.recipe.modifiedGuests,!0)}),this.basketSynchroService.addToActionList([n])}updateProductQuantity(e,t,i){const n=A_(e);n.quantity=t;const r=new N_(n,{eventTrace:i,recipeId:this.recipe.id},this.basketsService);q(r.onTimeout,r.onError).pipe(fp(1)).subscribe(()=>{this.recipeDetailsProductsService.updateIngredientFromBasketLoading$.next(!1),this.recipeDetailsProductsService.getIngredientsBasketEntries(this.recipe.ingredients,this.recipe.modifiedGuests,!0)}),this.basketSynchroService.addToActionList([r])}ignoreProduct(e){e.basketEntry.status="ignored",this.ignoredBasketsService.addIgnoredIngredients(e.ingredient.id),this.recipeDetailsProductsService.updateRecipePrice(e,!0),this.recipeDetailsProductsService.sendEmitToUpdateRecipePrice()}canAddProductToBasket(e,t,i){const n=i||this.recipe;return this.pendingBasketMethodsService.storeMethodIfCallbackNeeded(e).pipe(th(e=>this.basketsService.recipeIsInBasket(n.id).pipe(fp(1),E(i=>(e&&!i&&this.basketsService.addRecipesToBasket([n.id],n.modifiedGuests,t,!1),e)))))}remainingProducts(){return this.remainingBasketEntries.reduce((e,t)=>{const i=this.recipeDetailsProductsService.products$.value.find(e=>e.basketEntry.name===t.name);return i&&e.push({ingredientId:i.ingredient.id,entry:i.basketEntry}),e},[])}basketEntryForIngredient(e){return this.recipeDetailsProductsService.products$.value.find(t=>t.ingredient.id===e.id).basketEntry}hasSponsorStorytelling(e){return this.sponsorBlocksService.all({remotefilter:{"sponsor-id":e},page:{number:1,size:1}}).pipe(fp(1),E(e=>e.data.length>0))}getSponsorBlocks(e){return this.sponsorBlocksService.all({remotefilter:{"sponsor-id":e},include:["sponsor","sponsor-block-type"],sort:["-position"]}).pipe(fp(1),E(e=>e.data.sort((e,t)=>e.position-t.position)))}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(C_),nn(__),nn(pv),nn(Vf),nn($_),nn(w_),nn(Dp),nn(xv),nn(__),nn(u_),nn(h_),nn(wv),nn(kv),nn(Qf),nn(nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Iv=(()=>{class e{constructor(e,t,i,n,r,s,o,a,c,l,u,d,h,p,m,g,f,_,v,b,y,w,k,C){this.posService=e,this.basketsService=t,this.userService=i,this.preferencesService=n,this.analyticsService=r,this.recipesService=s,this.basketRecipeCleanupService=o,this.mediaMatcher=a,this.suppliersService=c,this.breakpointObserver=l,this.basketHandler=u,this.storeLocatorService=d,this.recipeLikesService=h,this.fakeCartService=p,this.contextRegistryService=m,this.basketUtilsService=g,this.basketTransferService=f,this.recipeDetailsService=_,this.recipeDetailsProductsService=v,this.recipeDetailsProductsPlannerService=b,this.newRecipeDetailsService=y,this.replaceItemService=w,this.mealsPlannerService=k,this.tagsService=C,this.videoRecipesEnabled=!1,this.tagsOnRecipesEnabled=!1,this.seoEnabled=!1,this.defaultIngredientPicture="https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg",this.defaultRecipePicture="https://storage.googleapis.com/assets.miam.tech/generic/images/placeholder.png",this.globalScrollableElement=document.body,this.isSmallScreen$=new cp(!1),this.origin=new cp(null),this.supplierHeaderHeight$=new cp(0),this.logLevel$=new cp("all"),this.catalogUrl="",this.recipeInfoUrl="",this.retailerCartUrl="",this.promotionsUrl="",this.mealsPlannerUrl="",this.antiInflation=!1,this.displayIngredientPicturesOnRecipeCards=!1,this.collapseUnavailableProducts=!1,this.noSupplier=!1,this.displayProductsInBasket=!0,this.loggedOnSession=!1,this.isPreferencesSSR=!1,this.orderHistoryEnabled=!1,this.enableMealsPlanner$=new cp(!1),this.displaySupplierSelector$=new cp(!1),this.preferencesChanged=new Rc,this.mealz={paymentStarted:e=>{Cp("[Mealz] send paymentStarted event"),this.onBasketAndPosSendPaymentStartedEvent(e)},analytics:{init:e=>{this.analyticsService.init(e)},eventSent$:this.analyticsService.eventEmitter,setAbTestKey:e=>this.analyticsService.setAbTestKey(e)},basket:{basketIsReady$:this.basketsService.basketStats$.pipe(bp(e=>!e),fp(1),E(()=>!0)),initialize:()=>{if(!this.origin.value)throw new Error("Cannot start Mealz: origin hasn't been set");this.basketsService.initBasket()},reset:()=>{this.resetBasket()},recipeCount:()=>this.basketsService.waitForBasket.pipe(th(()=>this.basketsService.basketStats$),bp(e=>!e),E(e=>e.recipesCount),p_()),openPreview:(e="",t=0)=>this.basketUtilsService.openBasket(e,t),overrideTransferUrl:e=>{this.noSupplier&&e&&(this.contextRegistryService.transferUrlBaseOverride=e)}},basketSync:{definePushProductsToCart:e=>{this.basketHandler.pushProductsToRetailerCart=e},defineAddProductsToCart:e=>{this.basketHandler.addProductsToRetailerCart=e},defineRemoveProductsFromCart:e=>{this.basketHandler.removeProductsFromRetailerCart=e},definePushBasketEntriesToBasket:e=>{this.basketHandler.pushBasketEntriesToBasket=e},retailerBasketChanged:e=>{this.basketHandler.retailerCartChanged(e),this.suppliersService.lastSupplierCart=e},handlePayment:e=>{this.basketHandler.handlePayment(e),this.suppliersService.lastSupplierCart=[]}},config:{mealzLogs:e=>{this.logLevel$.next(e)}},features:{enableVideoRecipes:()=>{this.videoRecipesEnabled=!0;const e=document.createElement("script");e.src="https://www.youtube.com/iframe_api",document.body.appendChild(e)},enableUserPreferences:()=>{this.userService.preferencesActivated$.next(!0)},enableTagsOnRecipes:()=>{this.tagsOnRecipesEnabled=!0},enableMealsPlanner:(e,t=!1)=>{if(!e)throw new Error("You need to provide the url for the meals-planner page to enable the feature");this.mealsPlannerUrl=e,this.antiInflation=t,this.enableMealsPlanner$.next(!0)},enableSeo:()=>{this.seoEnabled=!0},collapseUnavailableProductsByDefault:()=>{this.collapseUnavailableProducts=!0}},hook:{setHookCallback:e=>{this.contextRegistryService.hookCallback=e},setForcePosCallback:e=>{this.contextRegistryService.forcePosCallback=e}},pos:{load:e=>{if(!this.origin.value)throw new Error("Cannot start Mealz: origin hasn't been set");localStorage.removeItem("_miam/noSupplier/posId"),this.posService.loadPosWithExtId(e)},getByAddress:this.posService.getByAddress.bind(this.posService),getByCoordinates:this.posService.getByCoordinates.bind(this.posService)},recipes:{hidden:this.recipesService.hidden,addAllIngredientsCTAWasClicked:this.contextRegistryService.addAllProductsWasClicked,setDefaultIngredientPicture:e=>this.defaultIngredientPicture=e,setDefaultRecipePicture:e=>this.defaultRecipePicture=e,setDifficultyLevels:e=>{this.recipesService.difficultyLevels=e},showConfirmationToaster:()=>{this.recipesService.confirmationToaster=!0},shouldDisplayIngredientPicturesOnRecipeCards:e=>{this.displayIngredientPicturesOnRecipeCards=e}},router:{setRecipeCatalogUrl:(e="")=>{this.catalogUrl=e},setRecipeInfoLink:(e="")=>{this.recipeInfoUrl=e},setRetailerCartUrl:(e="")=>{this.retailerCartUrl=e},setPromotionsUrl:(e="")=>{this.promotionsUrl=e}},supplier:{setOrigin:e=>{e.length>0&&this.setOriginIfNecessary(e)},load:e=>{if(this.suppliersService.supplier$.value&&this.basketHandler.resetMealz(),!this.origin.value)throw new Error("Cannot start Mealz: origin hasn't been set");this.suppliersService.loadSupplier(e.toString()).subscribe(),this.loggedOnSession||localStorage.removeItem("_miam/userId"),this.generateAuthlessIdIfNecessary().subscribe()},setupWithToken:e=>{this.suppliersService.token=e;const t=JSON.parse(atob(e));if(!t.origin||!t.domain||!t.supplierId&&!t.noSupplier)throw new Error("the token does not have the correct format");this.mealz.supplier.setOrigin(t.origin),this.mealz.analytics.init(t.domain),this.contextRegistryService.disabledAnalytics=!!t.disableAnalytics,t.orderHistory&&(this.orderHistoryEnabled=t.orderHistory),t.displayProductsInBasket&&(this.displayProductsInBasket=t.displayProductsInBasket),t.noSupplier?(this.loadTransferModalPackage(),this.noSupplier=!0,this.fakeCartService.matchMealzBasket(),this.mealz.user.reset(),this.posService.posFromStorage(),this.mealz.basketSync.definePushProductsToCart(e=>{this.fakeCartService.pushToFakeCart(e)}),this.basketHandler.noSupplier$.next(!0)):(localStorage.removeItem("_miam/noSupplier/posId"),this.mealz.supplier.load(t.supplierId))},getAffiliateSuppliers:()=>this.suppliersService.getAffiliateSuppliers()},user:{loadWithAuthlessId:(e,t=!1)=>{this.contextRegistryService.forbidProfiling=t,localStorage.setItem("_miam/authlessId",e),localStorage.setItem("_miam/authless-forbid-profiling",""+t)},loadWithExternalId:(e,t=!1,i=!1)=>(this.contextRegistryService.forbidProfiling=t,this.loggedOnSession=!0,localStorage.setItem("_miam/userId",e),localStorage.removeItem("_miam/userToken"),this.basketHandler.resetMealz(),this.logUser(e,t,i)),reset:()=>{this.loggedOnSession&&this.basketHandler.resetMealz(),this.loggedOnSession=!1,localStorage.removeItem("_miam/userToken"),localStorage.removeItem("_miam/userId"),this.userService.toggleIsLogged(!1),this.generateAuthlessIdIfNecessary().pipe(fp(1),th(e=>e?(this.userService.resetUserInfo(),Cp("[Mealz] will refresh basket after reset"),this.basketsService.refreshCurrentBasket()):td(null))).subscribe()},setLanguage:e=>{this.userService.language=e},setFavoriteItems:e=>this.userService.setFavoriteItems(e),setLocation:e=>this.userService.userCoordinates$.next(e||null),updateForbidProfiling:(e,t,i=!1)=>{i?this.mealz.user.loadWithAuthlessId(t,e):this.logUser(t,e,!1).subscribe()}},events:{storeLocatorOpened:()=>this.storeLocatorService.storeLocatorOpened$.pipe(p_())},setStickyHeaderHeight:e=>{this.supplierHeaderHeight$.value!==e&&this.supplierHeaderHeight$.next(e)},overrideIcon:(e,t)=>{this.icons||(this.icons=[]);const i=this.icons.findIndex(t=>t.icon===e);i>-1?this.icons[i]={icon:e,url:t}:this.icons.push({icon:e,url:t})},setDefaultScrollElementGetter:e=>this.defaultScrollElementGetter=e},this.mealzInternal={analytics:{sendEvent:(e,t,i,n)=>this.analyticsService.sendEvent(e,t,i,n),setIsMealzPage:e=>{this.analyticsService.isMealzPage=e}},basket:{recipePricesInBasket$:()=>this.basketsService.recipePricesInBasket$(),removeRecipe:(e,t)=>this.basketUtilsService.removeRecipe(e,t),buildPreview:()=>this.basketUtilsService.buildPreview(),basketPreviewState$:this.basketUtilsService.basketPreviewState$,recipesAddedToBasket$:()=>this.basketsService.recipesAdded,waitForBasketEntries:()=>this.basketsService.waitForBasket.pipe(th(()=>this.basketsService.waitForBasketEntries)),entries$:()=>this.basketsService.waitForBasket.pipe(th(()=>this.basketsService.basketEntries())),transfer:()=>this.basketTransferService.confirmBasket(),updateRetailerBasketFromPlanner:()=>this.basketTransferService.updateRetailerBasketFromPlanner(),displayProductsInBasket:()=>this.displayProductsInBasket},catalog:{loadMoreRecipes:(e,t,i,n)=>this.recipesService.loadRecipesFromPackageId(e,t,i,n)},config:{logLevel:this.logLevel$},planner:{itemToReplace$:this.recipeDetailsProductsPlannerService.itemToReplace$,itemsWithPricesList$:this.recipeDetailsProductsPlannerService.itemsWithPricesList$,fetchingItemLoading$:this.recipeDetailsProductsPlannerService.fetchingItemLoading$,menuPrice$:this.mealsPlannerService.menuPrice$,plannerRecipePrice$:this.recipeDetailsProductsPlannerService.plannerRecipePrice$,createMenu:()=>this.mealsPlannerService.createMenu(),deleteMenu:e=>this.mealsPlannerService.deleteMenu(e),updateMenu:(e,t)=>this.mealsPlannerService.updateMenu(e,t),addRecipeToMenu:(e,t,i=!0,n)=>this.mealsPlannerService.addRecipeToMenu(e,t,i,n),removeRecipeFromMenu:e=>this.mealsPlannerService.removeRecipeFromMenu(e),menuToBasket:e=>this.mealsPlannerService.menuToBasket(e),getMenuRecipeId:e=>this.mealsPlannerService.getMenuRecipeId(e),isRecipeInMenu$:e=>this.mealsPlannerService.isRecipeInMenu(e),rejectRecipe:e=>this.mealsPlannerService.rejectRecipe(e),selectProduct:(e,t)=>this.recipeDetailsProductsPlannerService.selectProduct(e,t),unselectProduct:(e,t)=>this.recipeDetailsProductsPlannerService.unselectProduct(e,t),replaceProduct:e=>this.recipeDetailsProductsPlannerService.replaceProduct(e),openReplaceItemView:e=>this.recipeDetailsProductsPlannerService.openReplaceItemView(e),searchItem:(e,t,i)=>this.recipeDetailsProductsPlannerService.fetchItems(e,t,i,"ticked"),getSuggestedRecipes:()=>this.recipesService.getSuggestedRecipes(),updateGuests:(e,t)=>this.recipeDetailsProductsPlannerService.updateGuests(e,t),getGuestsForRecipe:e=>this.mealsPlannerService.getGuestsForRecipe(e)},recipes:{openDetails:(e,t,i=0,n="",r=null)=>this.recipesService.openRecipeDetails(e,t,i,n,r),replaceBasketEntry:(e,t)=>this.recipeDetailsProductsService.replaceBasketEntry(e,t),updateGuests:e=>this.newRecipeDetailsService.updateGuests(e),addAllIngredientsToBasket:e=>this.newRecipeDetailsService.addAllIngredientsToBasket(e),addToBasket:(e,t)=>this.newRecipeDetailsService.addToBasket(e,t),ingredientRemoved:(e,t)=>this.newRecipeDetailsService.ingredientRemoved(e,t),updateProductQuantity:(e,t,i)=>this.newRecipeDetailsService.updateProductQuantity(e,t,i),ignoreProduct:e=>this.newRecipeDetailsService.ignoreProduct(e),productIsBeingAdded:e=>this.recipeDetailsProductsService.productIsBeingAdded(e),allIngredientsToBasketLoading$:this.newRecipeDetailsService.allIngredientsToBasketLoading$,ingredientToBasketLoading$:this.newRecipeDetailsService.ingredientToBasketLoading,updateIngredientFromBasketLoading$:this.newRecipeDetailsService.updateIngredientFromBasketLoading,productsLoading$:this.newRecipeDetailsService.productsLoading,displayedRecipe$:this.recipesService.displayedRecipe$,productsByCategory$:this.recipeDetailsProductsService.productsByCategory$,productsPlannerByCategory$:this.recipeDetailsProductsPlannerService.productsPlannerByCategory$,noPosDisplay$:this.newRecipeDetailsService.noPosDisplay$,invalidPosDisplay$:this.newRecipeDetailsService.invalidPosDisplay$,remainingBasketEntries$:this.newRecipeDetailsService.remainingBasketEntries$,recipePrice$:this.recipeDetailsProductsService.recipePrice$,orderHistoryDate$:this.newRecipeDetailsService.orderHistoryDate$,updateRecipeLike:(e,t,i,n="")=>{const r={originPath:n,props:{recipe_id:t}},s=this.recipeLikesService.prepareRecipeLikeForUpdate(t,e,i);this.recipeLikesService.updateLike(t,s,r)},recipeLikeUpdated:()=>this.recipeLikesService.recipeLikeUpdated$,guestsUpdated:()=>this.contextRegistryService.guestsChanged,recipePriceUpdated:()=>this.contextRegistryService.recipePriceChanged,fetchPricing:(e,t,i)=>e&&t&&i?this.recipesService.getPricing(e,t,i).pipe(bp(e=>0===e.price)):td(null),setIsRecipeDetailsFromPlanner:e=>this.recipesService.isRecipeDetailsFromPlanner=e,isRecipeInBasket:e=>this.basketsService.recipeIsInBasket(e),getRecipeLike:e=>this.recipeLikesService.getLike(e)},replaceItem:{basketEntryToReplace$:this.replaceItemService.basketEntryToReplace$,replaceProductFromPreviewOpen$:this.replaceItemService.replaceProductFromPreviewOpen$,additionModalOpen$:this.replaceItemService.additionModalOpen$,onSelectItem:(e,t,i,n)=>this.replaceItemService.handleItemSelection(e,t,i,n),itemsWithPricesList$:this.replaceItemService.itemsWithPricesList$,fetchingItemLoading$:this.replaceItemService.fetchingItemLoading$,replaceItemLoading$:this.replaceItemService.replaceItemLoading$,searchItem:e=>this.replaceItemService.searchItem(e)},router:{getRetailerCartUrl:()=>this.retailerCartUrl,getCatalogUrl:()=>this.catalogUrl},products:{changeQuantity:(e,t,i)=>{const n={originPath:i,props:{}};if(0===t)return this.basketUtilsService.removeProduct(e,n);this.basketUtilsService.updateProduct(e,t,n)},removeProduct:(e,t)=>{this.basketUtilsService.removeProduct(e,{originPath:t,props:{}})}},pos:{currentPos:()=>this.posService.pos$,loadPos:e=>this.posService.loadPos(e),basketLoadedForNewPos:()=>this.posService.basketLoadedForNewPos()},sponsor:{hasStorytelling:e=>this.newRecipeDetailsService.hasSponsorStorytelling(e),getSponsorBlocks:e=>this.newRecipeDetailsService.getSponsorBlocks(e)},supplier:{getToken:()=>this.suppliersService.token,currentSupplier:()=>this.suppliersService.supplier$,isNoSupplier:()=>this.noSupplier},user:{getLanguage:()=>this.userService.language,isAuthenticated:()=>this.userService.isLogged$,userCoordinates$:this.userService.userCoordinates$,setSessionId:e=>{sessionStorage.setItem("_miam/sessionId",e)}},storeLocator:{open:()=>this.storeLocatorService.openStoreLocator(),openWarning:()=>this.storeLocatorService.showStoreLocatorWarning.next(!0),close:()=>this.storeLocatorService.closeStoreLocator(),changePosAndSupplier:(e,t)=>this.storeLocatorService.changePosAndSupplier(e,t),newStoreSelected:()=>this.storeLocatorService.newStoreSelected$.next()},productAddition:{open:()=>this.replaceItemService.changeAdditionModalState(!0),productAdded$:this.replaceItemService.productAdded$},productReplacement:{open:e=>{this.replaceItemService.changeReplaceModalState(!0,e)}},html:{like:e=>this.recipeLikesService.getLikeHTML(e)},getStickyHeaderHeight:()=>this.supplierHeaderHeight$,preferences:{preferencesCount:()=>this.preferencesService.currentPreferencesNumber,guests$:this.preferencesService.guests$,resetTagsActions:()=>this.preferencesService.resetTagsActions(),tagShouldBeChecked:(e,t)=>this.preferencesService.tagShouldBeChecked(e,t),resetPreferences:()=>this.preferencesService.resetPreferences(),sendCacheRequest:(e,t,i)=>this.preferencesService.sendCacheRequest(e,t,i).pipe(E(()=>{})),preferencesInStorage:()=>this.preferencesService.preferencesInStorage,tagsToAdd:this.preferencesService.tagsToAdd,addTag:e=>this.preferencesService.addTag(e),removeTag:e=>this.preferencesService.removeTag(e),updatePreferences:()=>this.preferencesService.updatePreferences(),preferencesChanged$:()=>this.preferencesChanged,preferencesChanged:()=>this.preferencesChanged.emit(),addPreferencesToRemoteFilters:(e,t)=>this.preferencesService.addPreferencesToRemoteFilters(e,t),newTagFromSearch:e=>{this.preferencesService.addTag({tag:e,checked:!0,without:!0}),this.preferencesService.updatePreferences()}},tags:{all:e=>this.tagsService.all(e),autocomplete:e=>this.tagsService.autocomplete(e)},hook:{hookCallback:()=>Xg([this.userService.isLogged$,this.posService.posWasInitialized()]).pipe(fp(1),th(([e,t])=>td(this.contextRegistryService.hookCallback(e,t))))},noSupplier:{addRecipeToBasketFromIdAndOpenPreview:e=>(localStorage.getItem("_miam/noSupplier/posId")?this.addAllIngredientsFromRecipeId(e).subscribe():(this.displaySupplierSelector$.next(!0),this.storeLocatorService.newStoreSelected$.pipe(fp(1)).subscribe(()=>{this.addAllIngredientsFromRecipeId(e).subscribe()})),td(void 0)),displaySupplierSelector$:this.displaySupplierSelector$}},this.defaultScrollElementGetter=()=>document.body,this.isSmallScreen$.next(!this.mediaMatcher.matchMedia("(min-width: 1023px)").matches),this.breakpointObserver.observe("(min-width: 1023px)").subscribe(e=>this.isSmallScreen$.next(!e.matches)),this.icons=[],this.CORSIssues=new cp(!1);const S={mealzV10:this.mealz,mealzInternalV10:this.mealzInternal};window.mealz||(S.mealz=this.mealz),window.mealzInternal||(S.mealzInternal=this.mealzInternal),Object.assign(window,S)}setCORSIssueState(e){this.CORSIssues.next(e)}getCORSIssuesState(){return this.CORSIssues.asObservable()}getOverrideIconUrl(e){const t=this.icons.find(t=>t.icon===e);return t?t.url:""}setOriginIfNecessary(e){e&&this.origin.value!==e&&this.origin.next(e)}onBasketAndPosSendPaymentStartedEvent(e){nf([this.basketsService.waitForBasket,this.posService.waitForPos.pipe(fp(1))]).subscribe(t=>{const i=t[0];i.totalPrice>0&&this.analyticsService.sendEvent("payment.started","",{basket_id:i.id,miam_amount:i.totalPrice.toString(),total_amount:e.toString(),pos_id:this.posService.pos$.getValue().id,pos_name:this.posService.pos$.getValue().attributes.name,supplier_id:this.posService.pos$.getValue().relationships.supplier.data.id,recipe_count:i.recipeInfos.length.toString(),miam_products:i.entries.length.toString()})})}logUser(e,t,i){return e&&this.userService.toggleIsLogged(!0),i&&this.basketsService.initBasket(),this.userService.generatingAuthlessId$.pipe(bp(e=>e),fp(1),th(()=>localStorage.getItem("_miam/authlessId")?this.basketsService.reloadBasket():td(null)),th(()=>this.userService.setUserInfo(t)))}loadTransferModalPackage(){const e=document.createElement("script");e.setAttribute("type","module"),e.setAttribute("src",Pp+"/basket-transfer-modal/basket-transfer-modal.min.js"),document.head.appendChild(e)}generateAuthlessIdIfNecessary(){return this.userService.generatingAuthlessId$.pipe(of(800),fp(1),th(e=>e||this.loggedOnSession||localStorage.getItem("_miam/authlessId")?td(null):this.userService.generateAnonymousUserId()))}resetBasket(){this.basketsService.waitForBasketEntries.pipe(E(e=>e.filter(e=>"active"===e.status).map(e=>{const t=A_(e);return t.quantity=0,t}))).subscribe(e=>{0===e.length&&this.basketsService.resetBasket().subscribe();const t=e.map(e=>new q_(e,{},this.basketsService));this.basketHandler.addToActionList(t),t.length>0&&t[t.length-1].onSuccess.pipe(fp(1)).subscribe(()=>{this.basketsService.resetBasket().subscribe()})})}addAllIngredientsFromRecipeId(e){const t={originPath:"/locator",props:{recipe_id:e}};return this.recipesService.get(e,{include:["ingredients","recipe-steps","recipe-type","sponsors","tags","recipe-provider"]}).pipe(th(e=>this.newRecipeDetailsService.setupRecipe(e)),df(()=>{this.waitForIngredientsToFinish().pipe(df(()=>{this.basketUtilsService.openBasket("/locator",1)}),fp(1)).subscribe(),this.newRecipeDetailsService.addAllIngredientsToBasket(t)}),fp(1),E(()=>{}))}waitForIngredientsToFinish(){const e=e=>this.newRecipeDetailsService.allIngredientsToBasketLoading$.pipe(bp(t=>t===e),fp(1));return e(!0).pipe(th(()=>e(!1)),th(()=>e(!0)))}}return e.\u0275fac=function(t){return new(t||e)(nn(Vf),nn(C_),nn(Yf),nn(d_),nn(Rp),nn(__),nn(W_),nn(ov),nn(Nf),nn(cv),nn($_),nn(h_),nn(l_),nn(uv),nn(Dp),nn(V_),nn(H_),nn(fv),nn(wv),nn(kv),nn(Ev),nn(yv),nn(f_),nn(a_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Pv=(()=>{class e{constructor(e){this.http=e,this.MEALZ_SSR_API="https://ssr-api.mealz.ai/v2",this.componentStylesUrl="",this.scriptsPaths=[],this.allScriptLoaded$=new cp(!1),this.scriptLoaded=0}getComponentStyles(){return this.http.get(this.componentStylesUrl,{})}loadStyles(){this.getComponentStyles().subscribe(e=>{var t;null===(t=null==e?void 0:e.links)||void 0===t||t.forEach(e=>{this.appendElementToHead("link",{rel:"stylesheet",href:e})})})}loadComponentScripts(){var e;null===(e=this.scriptsPaths)||void 0===e||e.forEach(e=>{document.head.querySelector(`script[type="module"][src="${e}"]`)||this.appendElementToHead("script",{type:"module",src:e})})}appendElementToHead(e,t){const i=document.createElement(e);Object.entries(t).forEach(([e,t])=>i.setAttribute(e,t)),document.head.appendChild(i),i.onload=()=>{this.scriptLoaded+=1,this.scriptLoaded===this.scriptsPaths.length&&this.allScriptLoaded$.next(!0)}}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Dv=(()=>{class e extends Pv{constructor(e,t,i){super(e),this.http=e,this.posService=t,this.httpUtils=i,this.fetchingHTMLLoader$=new cp(!1),this.componentStylesUrl=this.MEALZ_SSR_API+"/styles/catalog/catalog-history",this.scriptsPaths=[Pp+"/catalog/catalog-history/catalog-history.min.js",Pp+"/history-order/history-order.min.js",Pp+"/drawer/drawer.min.js",Pp+"/recipe-card/recipe-card.min.js",Pp+"/drawer-view-swapper/drawer-view-swapper.min.js",Pp+"/history-drawer/history-drawer.min.js"]}displayHistory(e){const t=this.posService.pos$.getValue().id,i=`${this.MEALZ_SSR_API}/catalog/my-space/history?store_id=${t}&search=${e}`,n=this.httpUtils.buildHeaders();return this.loadStyles(),this.fetchingHTMLLoader$.next(!0),this.http.get(i,{headers:n,responseType:"text"}).pipe(df(()=>this.fetchingHTMLLoader$.next(!1)))}replaceNoHistoryRedirection(e){const t=document.querySelector(".mealz-catalog-history__empty__button");t&&(t.href=e)}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Vf),nn(c_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Tv,Av=new Uint8Array(16);function Rv(){if(!Tv&&!(Tv="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Tv(Av)}for(var Ov=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Fv=function(e){return"string"==typeof e&&Ov.test(e)},Bv=[],Mv=0;Mv<256;++Mv)Bv.push((Mv+256).toString(16).substr(1));var Lv=function(e,t,i){var n=(e=e||{}).random||(e.rng||Rv)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(var r=0;r<16;++r)t[i+r]=n[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(Bv[e[t+0]]+Bv[e[t+1]]+Bv[e[t+2]]+Bv[e[t+3]]+"-"+Bv[e[t+4]]+Bv[e[t+5]]+"-"+Bv[e[t+6]]+Bv[e[t+7]]+"-"+Bv[e[t+8]]+Bv[e[t+9]]+"-"+Bv[e[t+10]]+Bv[e[t+11]]+Bv[e[t+12]]+Bv[e[t+13]]+Bv[e[t+14]]+Bv[e[t+15]]).toLowerCase();if(!Fv(i))throw TypeError("Stringified UUID is invalid");return i}(n)};let $v=(()=>{class e{constructor(e,t){this.context=e,this.usersService=t}intercept(e,t){return e.url.includes("plausible")||e.url.includes("ssr-api")?t.handle(e):(e=(e=this.setAuthHeaders(e)).clone({withCredentials:!0}),e=this.setUserProfiling(e),e=this.setSessionId(e),this.context.origin.pipe(bp(e=>!e),th(()=>Xg([this.usersService.userInfo$,this.usersService.generatingAuthlessId$])),bp(()=>this.shouldWaitForAuthentication(e)),fp(1),th(()=>(e=this.setMiamHeaders(e),t.handle(e).pipe(E(e=>{var t;return e instanceof vd&&(null===(t=e.body)||void 0===t?void 0:t.links)&&(e=this.addPagesInfos(e)),e}),Wh(e=>(this.setCORSInContext(e),Zd(e))))))))}setAuthHeaders(e){const t=localStorage.getItem("_miam/userToken"),i=localStorage.getItem("_miam/userId")||localStorage.getItem("_miam/authlessId");return t?e=e.clone({setHeaders:{Authorization:"Bearer "+t}}):i&&(e=e.clone({setHeaders:{Authorization:"user_id "+i}})),e}setUserProfiling(e){return(this.usersService.profilingForbidden()||"true"===localStorage.getItem("_miam/authless-forbid-profiling"))&&(e=e.clone({params:e.params.append("profiling","off")})),e}setSessionId(e){let t=sessionStorage.getItem("_miam/sessionId");return t||(t=Lv(),sessionStorage.setItem("_miam/sessionId",t)),e.clone({setHeaders:{"mealz-session-id":t}})}setMiamHeaders(e){const t={"miam-origin":this.context.origin.value,"miam-front-version":"10.0.2","miam-front-type":"web","miam-api-version":"4.7.0"};return e.headers.has("language-id")||(t["language-id"]="ro"),e.url.includes(Ip)&&"GET"!==e.method&&!e.headers.has("Content-Type")&&(t["Content-Type"]="application/vnd.api+json"),e.clone({setHeaders:t})}addPagesInfos(e){const t=e.body.links;if(null==t?void 0:t.last)try{const i=new URLSearchParams(new URL(t.last).search),n=parseInt(i.get("page[size]")||"0",10),r=n*parseInt(i.get("page[number]")||"0",10);let s=parseInt(i.get("page[number]")||"0",10);if(t.next){const e=new URLSearchParams(new URL(t.next).search);s=parseInt(e.get("page[number]")||"0",10)-1}Object.assign(e.body,{meta:{size:n,resources_per_page:n,number:s,total_resources:r}})}catch(i){console.error("Invalid URL in links:",i.message)}return e}setCORSInContext(e){0===e.status&&e.url.includes("https://api.miam.tech/api")&&this.context.setCORSIssueState(!0)}shouldWaitForAuthentication(e){return!(e.url.includes("user_info")||e.url.includes("users/authless")||localStorage.getItem("_miam/userId")||localStorage.getItem("_miam/authlessId"))}}return e.\u0275fac=function(t){return new(t||e)(nn(Iv),nn(Yf))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),jv=(()=>{class e{constructor(e){this.basketsService=e,this.sendingFile=new cp(!1),this.currentBasketEntries=new cp([]),this.cancelling=new cp(!1),this.entriesToIgnore=[],this.subscriptions=[]}unsubscribeService(){this.subscriptions.forEach(e=>e.unsubscribe())}sendFile(e){const t=e.target,i=t.files.item(0);i&&(this.sendingFile.next(!0),this.subscriptions.push(this.basketsService.currentAndPreviewFetching.pipe(bp(e=>e),fp(1),th(()=>this.basketsService.waitForBasketEntries)).subscribe(e=>{this.entriesToIgnore=e,this.basketsService.addEntriesFromPicture(i,["basket-entries"],!!this.isSchoolList).pipe(th(()=>this.basketsService.waitForBasketEntries)).subscribe(e=>{const t=this.filterOldEntries(e);this.listenForBasketChanges(),this.sendingFile.next(!1),this.currentBasketEntries.next(t)}),t.value=null})))}cancelAndRemove(e){this.cancelling.next(!0),0!==this.currentBasketEntries.value.length?(this.currentBasketEntries.value.forEach(t=>this.basketsService.removeProduct(t,e)),this.subscriptions.push(Xg([this.basketsService.productsWillBeRemoved(),this.basketsService.productsAreBeingRemoved()]).pipe(bp(e=>e[0]>0||e[1]>0),fp(1),th(()=>this.basketsService.reloadBasket())).subscribe(()=>{this.currentBasketEntries.next([]),this.cancelling.next(!1)}))):this.cancelling.next(!1)}listenForBasketChanges(){this.subscriptions.push(this.basketsService.basketEntries().subscribe(e=>{const t=this.filterOldEntries(e),i=this.currentBasketEntries.value.map(e=>t.find(t=>t.id===e.id)||e).filter(e=>t.find(t=>t.id===e.id));t.filter(e=>!i.find(t=>t.id===e.id)).forEach(e=>i.push(e)),this.currentBasketEntries.next(i)}))}filterOldEntries(e){return e.filter(e=>{const t=this.entriesToIgnore.find(t=>t.id===e.id);return!(t&&t.quantity===e.quantity)}).map(e=>{const t=this.entriesToIgnore.find(t=>t.id===e.id);return e.quantity-=(null==t?void 0:t.quantity)||0,e})}}return e.\u0275fac=function(t){return new(t||e)(nn(C_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class zv{}const Nv=new Vi("NgValueAccessor"),Vv={provide:Nv,useExisting:re(()=>Hv),multi:!0};let Hv=(()=>{class e extends zv{constructor(e,t){super(),this._renderer=e,this._elementRef=t,this.onChange=e=>{},this.onTouched=()=>{}}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"checked",e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}}return e.\u0275fac=function(t){return new(t||e)(vo(Sa),vo(wa))},e.\u0275dir=Qe({type:e,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(e,t){1&e&&Ao("change",(function(e){return t.onChange(e.target.checked)}))("blur",(function(){return t.onTouched()}))},features:[ma([Vv]),eo]}),e})();const Uv={provide:Nv,useExisting:re(()=>Gv),multi:!0},qv=new Vi("CompositionEventMode");let Gv=(()=>{class e{constructor(e,t,i){this._renderer=e,this._elementRef=t,this._compositionMode=i,this.onChange=e=>{},this.onTouched=()=>{},this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const e=zl()?zl().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}())}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==e?"":e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}}return e.\u0275fac=function(t){return new(t||e)(vo(Sa),vo(wa),vo(qv,8))},e.\u0275dir=Qe({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(e,t){1&e&&Ao("input",(function(e){return t._handleInput(e.target.value)}))("blur",(function(){return t.onTouched()}))("compositionstart",(function(){return t._compositionStart()}))("compositionend",(function(e){return t._compositionEnd(e.target.value)}))},features:[ma([Uv])]}),e})();const Wv=new Vi("NgValidators"),Zv=new Vi("NgAsyncValidators");function Qv(e){return null!=e}function Yv(e){const t=Po(e)?M(e):e;return To(t),t}function Kv(e){let t={};return e.forEach(e=>{t=null!=e?Object.assign(Object.assign({},t),e):t}),0===Object.keys(t).length?null:t}function Jv(e,t){return t.map(t=>t(e))}function Xv(e){return e.map(e=>function(e){return!e.validate}(e)?e:t=>e.validate(t))}function eb(e){return null!=e?function(e){if(!e)return null;const t=e.filter(Qv);return 0==t.length?null:function(e){return Kv(Jv(e,t))}}(Xv(e)):null}function tb(e){return null!=e?function(e){if(!e)return null;const t=e.filter(Qv);return 0==t.length?null:function(e){return nf(Jv(e,t).map(Yv)).pipe(E(Kv))}}(Xv(e)):null}function ib(e,t){return null===e?[t]:Array.isArray(e)?[...e,t]:[e,t]}let nb=(()=>{class e{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=eb(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=tb(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e){this.control&&this.control.reset(e)}hasError(e,t){return!!this.control&&this.control.hasError(e,t)}getError(e,t){return this.control?this.control.getError(e,t):null}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Qe({type:e}),e})(),rb=(()=>{class e extends nb{get formDirective(){return null}get path(){return null}}return e.\u0275fac=function(t){return sb(t||e)},e.\u0275dir=Qe({type:e,features:[eo]}),e})();const sb=ji(rb);class ob extends nb{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let ab=(()=>{class e extends class{constructor(e){this._cd=e}is(e){var t,i;return!!(null===(i=null===(t=this._cd)||void 0===t?void 0:t.control)||void 0===i?void 0:i[e])}}{constructor(e){super(e)}}return e.\u0275fac=function(t){return new(t||e)(vo(ob,2))},e.\u0275dir=Qe({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(e,t){2&e&&Ho("ng-untouched",t.is("untouched"))("ng-touched",t.is("touched"))("ng-pristine",t.is("pristine"))("ng-dirty",t.is("dirty"))("ng-valid",t.is("valid"))("ng-invalid",t.is("invalid"))("ng-pending",t.is("pending"))},features:[eo]}),e})();function cb(e,t){e.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function lb(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function ub(e,t){const i=e.indexOf(t);i>-1&&e.splice(i,1)}function db(e){return(gb(e)?e.validators:e)||null}function hb(e){return Array.isArray(e)?eb(e):e||null}function pb(e,t){return(gb(t)?t.asyncValidators:e)||null}function mb(e){return Array.isArray(e)?tb(e):e||null}function gb(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}class fb{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=hb(this._rawValidators),this._composedAsyncValidatorFn=mb(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return"VALID"===this.status}get invalid(){return"INVALID"===this.status}get pending(){return"PENDING"==this.status}get disabled(){return"DISABLED"===this.status}get enabled(){return"DISABLED"!==this.status}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=hb(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=mb(e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(e=>{e.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(e=>{e.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status="PENDING",!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status="DISABLED",this.errors=null,this._forEachChild(t=>{t.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status="VALID",this._forEachChild(t=>{t.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),"VALID"!==this.status&&"PENDING"!==this.status||this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?"DISABLED":"VALID"}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status="PENDING",this._hasOwnPendingAsyncValidator=!0;const t=Yv(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(t=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(t,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(e,t,i){if(null==t)return null;if(Array.isArray(t)||(t=t.split(".")),Array.isArray(t)&&0===t.length)return null;let n=e;return t.forEach(e=>{n=n instanceof vb?n.controls.hasOwnProperty(e)?n.controls[e]:null:n instanceof bb&&n.at(e)||null}),n}(this,e)}getError(e,t){const i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Rc,this.statusChanges=new Rc}_calculateStatus(){return this._allControlsDisabled()?"DISABLED":this.errors?"INVALID":this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus("PENDING")?"PENDING":this._anyControlsHaveStatus("INVALID")?"INVALID":"VALID"}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){gb(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class _b extends fb{constructor(e=null,t,i){super(db(t),pb(i,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!i})}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(e=>e(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){ub(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){ub(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class vb extends fb{constructor(e,t,i){super(db(t),pb(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!i})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t){this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}removeControl(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity(),this._onCollectionChange()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(i=>{this._throwIfControlMissing(i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(i=>{this.controls[i]&&this.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,n)=>{i.reset(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t instanceof _b?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(e,t)=>!!t._syncPendingControls()||e);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[e])throw new Error(`Cannot find form control with name: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const i=this.controls[t];if(this.contains(t)&&e(i))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,i)=>((t.enabled||this.disabled)&&(e[i]=t.value),e))}_reduceChildren(e,t){let i=e;return this._forEachChild((e,n)=>{i=t(i,e,n)}),i}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control with name: '${i}'.`)})}}class bb extends fb{constructor(e,t,i){super(db(t),pb(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!i})}at(e){return this.controls[e]}push(e){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()}insert(e,t){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity()}removeAt(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity(),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((e,i)=>{this._throwIfControlMissing(i),this.at(i).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((e,i)=>{this.at(i)&&this.at(i).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((i,n)=>{i.reset(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof _b?e.value:e.getRawValue())}clear(){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity())}_syncPendingControls(){let e=this.controls.reduce((e,t)=>!!t._syncPendingControls()||e,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error("Cannot find form control at index "+e)}_forEachChild(e){this.controls.forEach((t,i)=>{e(t,i)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control at index: ${i}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const yb={provide:ob,useExisting:re(()=>kb)},wb=(()=>Promise.resolve(null))();let kb=(()=>{class e extends ob{constructor(e,t,i,n){super(),this.control=new _b,this._registered=!1,this.update=new Rc,this._parent=e,this._setValidators(t),this._setAsyncValidators(i),this.valueAccessor=function(e,t){if(!t)return null;Array.isArray(t);let i=void 0,n=void 0,r=void 0;return t.forEach(e=>{e.constructor===Gv?i=e:Object.getPrototypeOf(e.constructor)===zv?n=e:r=e}),r||n||i||null}(0,n)}ngOnChanges(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),function(e,t){if(!e.hasOwnProperty("model"))return!1;const i=e.model;return!!i.isFirstChange()||!Object.is(t,i.currentValue)}(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?[...this._parent.path,this.name]:[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){var e,t;(function(e,t,i){const n=function(e){return e._rawValidators}(e);null!==t.validator?e.setValidators(ib(n,t.validator)):"function"==typeof n&&e.setValidators([n]);const r=function(e){return e._rawAsyncValidators}(e);null!==t.asyncValidator?e.setAsyncValidators(ib(r,t.asyncValidator)):"function"==typeof r&&e.setAsyncValidators([r]);{const i=()=>e.updateValueAndValidity();cb(t._rawValidators,i),cb(t._rawAsyncValidators,i)}})(e=this.control,t=this),t.valueAccessor.writeValue(e.value),function(e,t){t.valueAccessor.registerOnChange(i=>{e._pendingValue=i,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&lb(e,t)})}(e,t),function(e,t){const i=(e,i)=>{t.valueAccessor.writeValue(e),i&&t.viewToModelUpdate(e)};e.registerOnChange(i),t._registerOnDestroy(()=>{e._unregisterOnChange(i)})}(e,t),function(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&lb(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),function(e,t){if(t.valueAccessor.setDisabledState){const i=e=>{t.valueAccessor.setDisabledState(e)};e.registerOnDisabledChange(i),t._registerOnDestroy(()=>{e._unregisterOnDisabledChange(i)})}}(e,t),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(e){wb.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1})})}_updateDisabled(e){const t=e.isDisabled.currentValue,i=""===t||t&&"false"!==t;wb.then(()=>{i&&!this.control.disabled?this.control.disable():!i&&this.control.disabled&&this.control.enable()})}}return e.\u0275fac=function(t){return new(t||e)(vo(rb,9),vo(Wv,10),vo(Zv,10),vo(Nv,10))},e.\u0275dir=Qe({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[ma([yb]),eo,at]}),e})(),Cb=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({}),e})();const Sb=new Vi("NgModelWithFormControlWarning");let xb=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[Cb]]}),e})(),Eb=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[xb]}),e})(),Ib=(()=>{class e{static withConfig(t){return{ngModule:e,providers:[{provide:Sb,useValue:t.warnOnNgModelWithFormControl}]}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[xb]}),e})();const Pb=e=>{e.stopPropagation(),e.preventDefault()};let Db=(()=>{class e{transform(e){return e?(e=e.trim()).charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=Ye({name:"capitalizeFirstLetter",type:e,pure:!0}),e})(),Tb=(()=>{class e{transform(e,t){var i;return void 0===t||t>=(null===(i=null==e?void 0:e.split(" "))||void 0===i?void 0:i.length)?e:e.split(" ").slice(0,t).join(" ")+" ..."}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=Ye({name:"ellipsis",type:e,pure:!0}),e})(),Ab=(()=>{class e{constructor(e){this.elementRef=e,this.threshold=.8,this.debounceTime=1e3,this.condition=!0,this.inViewport=new Rc,this.intersectionSubject=new C,this.isObserving=!1,this.subscriptions=[]}ngOnInit(){this.observer=new IntersectionObserver(e=>{e.forEach(e=>this.intersectionSubject.next(e))},{root:null,rootMargin:"0px",threshold:this.threshold}),this.subscriptions.push(this.intersectionSubject.pipe(of(this.debounceTime)).subscribe(e=>this.handleIntersection(e))),this.observer.observe(this.elementRef.nativeElement),this.isObserving=!0}ngOnChanges(e){this.isObserving&&e.condition&&this.handleIntersection.bind(this)}ngOnDestroy(){this.observer&&this.observer.disconnect(),this.isObserving=!1,this.intersectionSubject.complete(),this.subscriptions.forEach(e=>e.unsubscribe())}handleIntersection(e){this.condition&&e.isIntersecting&&(this.inViewport.emit(),this.observer.disconnect(),this.isObserving=!1)}}return e.\u0275fac=function(t){return new(t||e)(vo(wa))},e.\u0275dir=Qe({type:e,selectors:[["","ngMiamInViewport",""]],inputs:{threshold:"threshold",debounceTime:"debounceTime",condition:"condition"},outputs:{inViewport:"inViewport"},features:[at]}),e})(),Rb=(()=>{class e{constructor(e){this.el=e,this.marginRoot="0px",this.threshold=0,this.isLoading=!1,this.loadMore=new Rc,this.emitted=!1}ngOnInit(){this.intersectionObserver()}ngAfterViewInit(){this.observer.observe(this.el.nativeElement)}intersectionObserver(){this.observer=new IntersectionObserver(e=>{e[0].isIntersecting&&!this.isLoading&&this.loadMore.emit()},{root:null,rootMargin:this.marginRoot,threshold:this.threshold})}}return e.\u0275fac=function(t){return new(t||e)(vo(wa))},e.\u0275dir=Qe({type:e,selectors:[["","ngMiamLoadOnScroll",""]],inputs:{marginRoot:"marginRoot",threshold:"threshold",isLoading:"isLoading"},outputs:{loadMore:"loadMore"}}),e})();const Ob=["counterInput"];function Fb(e,t){if(1&e&&Co(0,"img",10),2&e){const e=Fo();bo("src",e.disable&&e.biColor?e.icons.minus_white:e.icons.minus,Wn)}}function Bb(e,t){1&e&&Co(0,"div",11)}function Mb(e,t){1&e&&(wo(0,"div",12),Co(1,"img",13),ko())}function Lb(e,t){1&e&&Co(0,"img",14),2&e&&bo("src",Fo().icons.plus,Wn)}function $b(e,t){1&e&&Co(0,"div",11)}const jb=function(e,t,i){return{disabled:e,"miam-counter-input__minus__remove":t,"ghost small":i}},zb=function(e,t,i){return{disabled:e,"ghost small":t,primary:i}};let Nb=(()=>{class e{constructor(e){this.cdr=e,this.floating=!1,this.biColor=!1,this.value=1,this.minRange=1,this.maxRange=100,this.disable=!1,this.minusLoading=!1,this.plusLoading=!1,this.debounceTime=0,this.valueChange=new Rc,this.icon=Cv,this.icons={minus:"https://storage.googleapis.com/assets.miam.tech/generic/icons/minus-primary.svg",minus_white:"https://storage.googleapis.com/assets.miam.tech/generic/icons/minus-white.svg",plus:"https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-primary.svg"},this.subscriptions=[]}ngOnInit(){this.biColor&&(this.icons.minus="https://storage.googleapis.com/assets.miam.tech/generic/icons/minus-black.svg",this.icons.plus="https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-white.svg",this.cdr.detectChanges()),this.valueSubject||(this.valueSubject=new cp(this.value),this.lastValue=this.value,this.subscriptions.push(this.valueSubject.pipe(of(this.debounceTime)).subscribe(()=>{this.lastValue!==this.value&&(this.valueChange.emit(this.value),this.lastValue=this.value)})))}ngOnChanges(e){var t;(null===(t=e.value)||void 0===t?void 0:t.isFirstChange())||this.value!==this.valueSubject.value&&this.valueSubject.next(this.value),this.cdr.detectChanges()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}increment(e){Pb(e),this.value<this.maxRange&&(this.value++,this.valueSubject.next(this.value),this.cdr.detectChanges())}decrement(e){Pb(e),this.value>this.minRange&&(this.value--,this.valueSubject.next(this.value),this.cdr.detectChanges())}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-counter-input"]],viewQuery:function(e,t){if(1&e&&Uc(Ob,1),2&e){let e;Hc(e=qc())&&(t.counterInput=e.first)}},inputs:{floating:"floating",biColor:"biColor",value:"value",minRange:"minRange",maxRange:"maxRange",disable:"disable",minusLoading:"minusLoading",plusLoading:"plusLoading",debounceTime:"debounceTime"},outputs:{valueChange:"valueChange"},features:[at],decls:12,vars:24,consts:[[1,"miam-counter-input"],[1,"miam-counter-input__counter"],[1,"miam-counter-input__minus","mealz-ds-button","square",3,"disabled","ngClass","click"],["alt","remove one button",3,"src",4,"ngIf"],["class","mealz-ds-loader",4,"ngIf"],[1,"miam-counter-input__value-container"],[1,"miam-counter-input__value-text","mealz-ds-text","weight-xxl"],["class","miam-counter-input__people-button",4,"ngIf"],[1,"miam-counter-input__plus","mealz-ds-button","square",3,"disabled","ngClass","click"],["alt","add one button",3,"src",4,"ngIf"],["alt","remove one button",3,"src"],[1,"mealz-ds-loader"],[1,"miam-counter-input__people-button"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/people-primary.svg","alt","people icon",1,"miam-counter-input__people-icon"],["alt","add one button",3,"src"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"div",1),wo(2,"button",2),Ao("click",(function(e){return t.decrement(e)})),fo(3,Fb,1,1,"img",3),fo(4,Bb,1,0,"div",4),ko(),wo(5,"div",5),wo(6,"span",6),Qo(7),ko(),fo(8,Mb,2,0,"div",7),ko(),wo(9,"button",8),Ao("click",(function(e){return t.increment(e)})),fo(10,Lb,1,1,"img",9),fo(11,$b,1,0,"div",4),ko(),ko(),ko()),2&e&&(Ho("disabled",t.disable)("floating",t.floating)("bi-color",t.biColor),Nr(2),bo("disabled",t.disable)("ngClass",wc(16,jb,t.disable,1==t.value,!t.biColor)),Nr(1),bo("ngIf",!t.minusLoading),Nr(1),bo("ngIf",t.minusLoading),Nr(3),Yo(t.value),Nr(1),bo("ngIf",t.floating),Nr(1),bo("disabled",t.disable)("ngClass",wc(20,zb,t.disable,!t.biColor,t.biColor)),Nr(1),bo("ngIf",!t.plusLoading),Nr(1),bo("ngIf",t.plusLoading))},directives:[Du,Ou],styles:[".miam-counter-input{display:flex;align-items:center;justify-content:center;padding:8px}.miam-counter-input.bi-color{padding:0}.miam-counter-input.floating{background:var(--mealz-ds-color-neutral-white,#fff);border-radius:120px}.miam-counter-input .miam-counter-input__counter{display:flex;align-items:center;justify-content:center;overflow:hidden}.miam-counter-input .miam-counter-input__counter>:not(:last-child){margin-right:8px}.miam-counter-input .miam-counter-input__counter .miam-counter-input__value-container{display:flex;width:32px;justify-content:center;align-items:center}.miam-counter-input .miam-counter-input__counter .miam-counter-input__value-container>:not(:last-child){margin-right:4px}.miam-counter-input .miam-counter-input__counter .miam-counter-input__value-container .miam-counter-input__value-text{color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-counter-input .miam-counter-input__counter .miam-counter-input__value-container .miam-counter-input__people-button{display:flex;justify-content:center;align-items:center}.miam-counter-input .miam-counter-input__counter .miam-counter-input__value-container .miam-counter-input__people-button .miam-counter-input__people-icon{height:18px;width:18px}"],encapsulation:2,changeDetection:0}),e})();const Vb=function(e,t){return{width:e,height:t}},Hb=function(e){return{width:e}};function Ub(e,t){if(1&e&&(wo(0,"div",2),Co(1,"img",3),ko()),2&e){const e=Fo();bo("ngStyle",yc(3,Vb,e.width+"px",e.height+"px")),Nr(1),bo("src",e.iconOverrideUrl,Wn)("ngStyle",bc(6,Hb,e.width+"px"))}}function qb(e,t){if(1&e&&(So(0),Co(1,"img",7),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Gb(e,t){if(1&e&&(So(0),Co(1,"img",8),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Wb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",9),Co(2,"path",10),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor)}}function Zb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",11),Co(2,"path",12),Co(3,"path",13),Co(4,"path",14),Co(5,"path",15),Co(6,"path",16),Co(7,"path",17),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor)}}function Qb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",18),Co(2,"path",19),Co(3,"path",20),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height)("fill",e.primaryColor)}}function Yb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",21),Co(2,"path",22),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height)("fill",e.primaryColor)}}function Kb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",23),wo(2,"g",24),Co(3,"path",25),ko(),wo(4,"g",26),Co(5,"path",27),ko(),wo(6,"g",28),Co(7,"path",29),ko(),wo(8,"defs"),wo(9,"clipPath",30),Co(10,"rect",31),ko(),wo(11,"clipPath",32),Co(12,"rect",33),ko(),wo(13,"clipPath",34),Co(14,"rect",35),ko(),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(2),mo("fill",e.primaryColor)}}function Jb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",23),wo(2,"g",24),Co(3,"path",25),ko(),wo(4,"g",26),Co(5,"path",36),ko(),wo(6,"g",28),Co(7,"path",29),ko(),wo(8,"defs"),wo(9,"clipPath",30),Co(10,"rect",31),ko(),wo(11,"clipPath",32),Co(12,"rect",33),ko(),wo(13,"clipPath",34),Co(14,"rect",35),ko(),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(2),mo("fill",e.primaryColor),Nr(2),mo("fill",e.primaryColor)}}function Xb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",23),wo(2,"g",24),Co(3,"path",25),ko(),wo(4,"g",26),Co(5,"path",36),ko(),wo(6,"g",28),Co(7,"path",37),ko(),wo(8,"defs"),wo(9,"clipPath",30),Co(10,"rect",31),ko(),wo(11,"clipPath",32),Co(12,"rect",33),ko(),wo(13,"clipPath",34),Co(14,"rect",35),ko(),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(2),mo("fill",e.primaryColor),Nr(2),mo("fill",e.primaryColor),Nr(2),mo("fill",e.primaryColor)}}function ey(e,t){if(1&e&&(So(0),si(),wo(1,"svg",38),Co(2,"path",39),Co(3,"path",40),Co(4,"path",41),Co(5,"path",42),Co(6,"path",43),wo(7,"g",44),Co(8,"path",45),Co(9,"path",46),Co(10,"path",47),Co(11,"path",48),Co(12,"path",49),ko(),wo(13,"g",44),Co(14,"path",50),Co(15,"path",51),Co(16,"path",52),Co(17,"path",53),Co(18,"path",54),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(2),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(2),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor)}}function ty(e,t){if(1&e&&(So(0),si(),wo(1,"svg",38),Co(2,"path",39),Co(3,"path",40),Co(4,"path",41),Co(5,"path",42),Co(6,"path",43),Co(7,"path",45),Co(8,"path",46),Co(9,"path",47),Co(10,"path",48),Co(11,"path",49),wo(12,"g",44),Co(13,"path",50),Co(14,"path",51),Co(15,"path",52),Co(16,"path",53),Co(17,"path",54),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(2),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor)}}function iy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",38),Co(2,"path",39),Co(3,"path",40),Co(4,"path",41),Co(5,"path",42),Co(6,"path",43),Co(7,"path",45),Co(8,"path",46),Co(9,"path",47),Co(10,"path",48),Co(11,"path",49),Co(12,"path",50),Co(13,"path",51),Co(14,"path",52),Co(15,"path",53),Co(16,"path",54),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor)}}function ny(e,t){if(1&e&&(So(0),si(),wo(1,"svg",55),Co(2,"path",56),Co(3,"path",57),Co(4,"path",58),Co(5,"path",59),Co(6,"path",60),Co(7,"path",61),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor)}}function ry(e,t){if(1&e&&(So(0),si(),wo(1,"svg",62),Co(2,"path",63),Co(3,"path",64),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(2),mo("fill",e.primaryColor)}}function sy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",65),Co(2,"path",66),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height)("fill",e.primaryColor)}}function oy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",67),Co(2,"path",68),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor)}}function ay(e,t){if(1&e&&(So(0),Co(1,"img",69),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function cy(e,t){if(1&e&&(So(0),Co(1,"img",70),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function ly(e,t){if(1&e&&(So(0),Co(1,"img",71),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function uy(e,t){if(1&e&&(So(0),Co(1,"img",72),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function dy(e,t){if(1&e&&(So(0),Co(1,"img",73),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function hy(e,t){if(1&e&&(So(0),Co(1,"img",74),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function py(e,t){if(1&e&&(So(0),si(),wo(1,"svg",11),Co(2,"path",75),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor)}}function my(e,t){if(1&e&&(So(0),si(),wo(1,"svg",62),Co(2,"path",63),Co(3,"path",76),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("fill",e.primaryColor)("width.px",e.width)("height.px",e.height)}}function gy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",62),Co(2,"path",77),Co(3,"path",78),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("fill",e.primaryColor)("width.px",e.width)("height.px",e.height)}}function fy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",67),Co(2,"path",79),Co(3,"path",80),Co(4,"path",81),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor)}}function _y(e,t){if(1&e&&(So(0),Co(1,"img",82),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function vy(e,t){if(1&e&&(So(0),Co(1,"img",83),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function by(e,t){if(1&e&&(So(0),Co(1,"img",84),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function yy(e,t){if(1&e&&(So(0),Co(1,"img",85),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function wy(e,t){if(1&e&&(So(0),Co(1,"img",86),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function ky(e,t){if(1&e&&(So(0),si(),wo(1,"svg",9),wo(2,"g"),Co(3,"path",87),ko(),wo(4,"defs"),wo(5,"clipPath",30),Co(6,"rect",88),ko(),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(2),mo("fill",e.primaryColor)}}function Cy(e,t){if(1&e&&(So(0),Co(1,"img",89),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Sy(e,t){if(1&e&&(So(0),Co(1,"img",90),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function xy(e,t){if(1&e&&(So(0),Co(1,"img",91),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Ey(e,t){if(1&e&&(So(0),Co(1,"img",92),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Iy(e,t){if(1&e&&(So(0),Co(1,"img",93),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Py(e,t){if(1&e&&(So(0),Co(1,"img",94),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Dy(e,t){if(1&e&&(So(0),Co(1,"img",95),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Ty(e,t){if(1&e&&(So(0),Co(1,"img",96),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Ay(e,t){if(1&e&&(So(0),Co(1,"img",97),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Ry(e,t){if(1&e&&(So(0),Co(1,"img",98),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Oy(e,t){if(1&e&&(So(0),Co(1,"img",99),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Fy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",100),Co(2,"path",101),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor)}}function By(e,t){if(1&e&&(So(0),si(),wo(1,"svg",102),Co(2,"path",103),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor)}}function My(e,t){1&e&&Eo(0)}function Ly(e,t){if(1&e&&(So(0,4),wo(1,"div",2),fo(2,qb,2,3,"ng-container",5),fo(3,Gb,2,3,"ng-container",5),fo(4,Wb,3,3,"ng-container",5),fo(5,Zb,8,8,"ng-container",5),fo(6,Qb,4,3,"ng-container",5),fo(7,Yb,3,3,"ng-container",5),fo(8,Kb,15,3,"ng-container",5),fo(9,Jb,15,4,"ng-container",5),fo(10,Xb,15,5,"ng-container",5),fo(11,ey,19,17,"ng-container",5),fo(12,ty,18,17,"ng-container",5),fo(13,iy,17,17,"ng-container",5),fo(14,ny,8,8,"ng-container",5),fo(15,ry,4,3,"ng-container",5),fo(16,sy,3,3,"ng-container",5),fo(17,oy,3,3,"ng-container",5),fo(18,ay,2,3,"ng-container",5),fo(19,cy,2,3,"ng-container",5),fo(20,ly,2,3,"ng-container",5),fo(21,uy,2,3,"ng-container",5),fo(22,dy,2,3,"ng-container",5),fo(23,hy,2,3,"ng-container",5),fo(24,py,3,3,"ng-container",5),fo(25,my,4,3,"ng-container",5),fo(26,gy,4,3,"ng-container",5),fo(27,fy,5,5,"ng-container",5),fo(28,_y,2,3,"ng-container",5),fo(29,vy,2,3,"ng-container",5),fo(30,by,2,3,"ng-container",5),fo(31,yy,2,3,"ng-container",5),fo(32,wy,2,3,"ng-container",5),fo(33,ky,7,3,"ng-container",5),fo(34,Cy,2,3,"ng-container",5),fo(35,Sy,2,3,"ng-container",5),fo(36,xy,2,3,"ng-container",5),fo(37,Ey,2,3,"ng-container",5),fo(38,Iy,2,3,"ng-container",5),fo(39,Py,2,3,"ng-container",5),fo(40,Dy,2,3,"ng-container",5),fo(41,Ty,2,3,"ng-container",5),fo(42,Ay,2,3,"ng-container",5),fo(43,Ry,2,3,"ng-container",5),fo(44,Oy,2,3,"ng-container",5),fo(45,Fy,3,3,"ng-container",5),fo(46,By,3,3,"ng-container",5),fo(47,My,1,0,"ng-container",6),ko(),xo()),2&e){const e=Fo();bo("ngSwitch",e.iconName),Nr(1),bo("ngStyle",yc(47,Vb,e.width+"px",e.height+"px")),Nr(1),bo("ngSwitchCase",e.icon.Checkmark),Nr(1),bo("ngSwitchCase",e.icon.Alert),Nr(1),bo("ngSwitchCase",e.icon.CloudUpload),Nr(1),bo("ngSwitchCase",e.icon.Time),Nr(1),bo("ngSwitchCase",e.icon.Clear),Nr(1),bo("ngSwitchCase",e.icon.Picture),Nr(1),bo("ngSwitchCase",e.icon.CostLow),Nr(1),bo("ngSwitchCase",e.icon.CostMedium),Nr(1),bo("ngSwitchCase",e.icon.CostHight),Nr(1),bo("ngSwitchCase",e.icon.DifficultyLow),Nr(1),bo("ngSwitchCase",e.icon.DifficultyMedium),Nr(1),bo("ngSwitchCase",e.icon.DifficultyHigh),Nr(1),bo("ngSwitchCase",e.icon.Grip),Nr(1),bo("ngSwitchCase",e.icon.ChevronDown),Nr(1),bo("ngSwitchCase",e.icon.ArrowDown),Nr(1),bo("ngSwitchCase",e.icon.Cart),Nr(1),bo("ngSwitchCase",e.icon.People),Nr(1),bo("ngSwitchCase",e.icon.Trash),Nr(1),bo("ngSwitchCase",e.icon.Trash_danger),Nr(1),bo("ngSwitchCase",e.icon.Trash_grey05),Nr(1),bo("ngSwitchCase",e.icon.Trash_greyText),Nr(1),bo("ngSwitchCase",e.icon.Trash_greyTextDark),Nr(1),bo("ngSwitchCase",e.icon.Plus),Nr(1),bo("ngSwitchCase",e.icon.Wait),Nr(1),bo("ngSwitchCase",e.icon.Hot),Nr(1),bo("ngSwitchCase",e.icon.Search),Nr(1),bo("ngSwitchCase",e.icon.RecipeBook),Nr(1),bo("ngSwitchCase",e.icon.Meal),Nr(1),bo("ngSwitchCase",e.icon.Meal_grey06),Nr(1),bo("ngSwitchCase",e.icon.HorizontalDots),Nr(1),bo("ngSwitchCase",e.icon.NoRecipeFound),Nr(1),bo("ngSwitchCase",e.icon.Preheat),Nr(1),bo("ngSwitchCase",e.icon.Empty),Nr(1),bo("ngSwitchCase",e.icon.Starter),Nr(1),bo("ngSwitchCase",e.icon.NotStarter),Nr(1),bo("ngSwitchCase",e.icon.Dessert),Nr(1),bo("ngSwitchCase",e.icon.NotDessert),Nr(1),bo("ngSwitchCase",e.icon.MainDish),Nr(1),bo("ngSwitchCase",e.icon.NotMainDish),Nr(1),bo("ngSwitchCase",e.icon.Edit),Nr(1),bo("ngSwitchCase",e.icon.CircledPlus),Nr(1),bo("ngSwitchCase",e.icon.CartPlus),Nr(1),bo("ngSwitchCase",e.icon.Cross),Nr(1),bo("ngSwitchCase",e.icon.Home),Nr(1),bo("ngSwitchCase",e.icon.Filter)}}let $y=(()=>{class e{constructor(e,t){this.contextService=e,this.cdr=t,this.primaryColor="black",this.secondaryColor="grey",this.width=16,this.height=16,this.icon=Cv}ngOnChanges(){this.iconOverrideUrl=this.contextService.getOverrideIconUrl(this.iconName),this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Iv),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-icon"]],inputs:{primaryColor:"primaryColor",secondaryColor:"secondaryColor",width:"width",height:"height",iconName:"iconName"},features:[at],decls:3,vars:2,consts:[["class","icon-container",3,"ngStyle",4,"ngIf","ngIfElse"],["switchIcon",""],[1,"icon-container",3,"ngStyle"],[1,"icon-container__icon",3,"src","ngStyle"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Checkmark.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Alert_danger.svg",1,"icon-container__icon",3,"ngStyle"],["viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M12.5018 13.821H9.91582H9.21945H9.06906V10.3523H10.2035C10.4912 10.3523 10.6612 10.0253 10.4912 9.78995L8.28443 6.73642C8.14385 6.54026 7.85288 6.54026 7.7123 6.73642L5.50552 9.78995C5.33551 10.0253 5.50225 10.3523 5.79322 10.3523H6.92767V13.821H6.77728H6.08092H3.08296C1.36657 13.7262 0 12.121 0 10.3817C0 9.18186 0.650593 8.13568 1.61504 7.57009C1.52677 7.33143 1.481 7.07643 1.481 6.80834C1.481 5.58235 2.4716 4.59175 3.69759 4.59175C3.9624 4.59175 4.21741 4.63752 4.45607 4.72579C5.16551 3.22191 6.69555 2.179 8.47405 2.179C10.7756 2.18227 12.6718 3.94443 12.8876 6.19044C14.6563 6.49449 16 8.13241 16 9.98611C16 11.9673 14.4569 13.6837 12.5018 13.821Z"],["viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M12.5 22C16.9183 22 20.5 18.4183 20.5 14C20.5 9.58172 16.9183 6 12.5 6C8.08172 6 4.5 9.58172 4.5 14C4.5 18.4183 8.08172 22 12.5 22Z","stroke-width","2"],["d","M14.5 2H10.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M12.5 2V6","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M18 8L19.5 6.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M12.5 14V11","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M12.5 14H9.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["viewBox","0 0 16 16","xmlns","http://www.w3.org/2000/svg",1,"bi","bi-x"],["fill-rule","evenodd","d","M11.854 4.146a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708-.708l7-7a.5.5 0 0 1 .708 0z"],["fill-rule","evenodd","d","M4.146 4.146a.5.5 0 0 0 0 .708l7 7a.5.5 0 0 0 .708-.708l-7-7a.5.5 0 0 0-.708 0z"],["viewBox","0 0 17 16","xmlns","http://www.w3.org/2000/svg",1,"bi","bi-image"],["fill-rule","evenodd","d","M14.002 2h-12a1 1 0 0 0-1 1v9l2.646-2.354a.5.5 0 0 1 .63-.062l2.66 1.773 3.71-3.71a.5.5 0 0 1 .577-.094L15.002 9.5V3a1 1 0 0 0-1-1zm-12-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2h-12zm4 4.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"],["viewBox","0 0 64 16","fill","none","xmlns","http://www.w3.org/2000/svg"],["clip-path","url(#clip0)"],["d","M14.7613 14.2631C14.5819 13.8245 14.3992 13.386 14.1998 12.954C14.0237 12.5686 13.7978 12.4557 13.3759 12.552C12.8409 12.6749 12.316 12.8377 11.7811 12.9474C10.7478 13.1634 9.71117 13.1833 8.69117 12.861C7.41202 12.459 6.73091 11.532 6.31228 10.3359H9.78094C10.0534 10.3359 10.2727 10.1166 10.2727 9.8442V8.75111C10.2727 8.47866 10.0534 8.25938 9.78094 8.25938H5.98003C5.98003 7.95371 5.97671 7.66134 5.98003 7.36896H9.78094C10.0534 7.36896 10.2727 7.14968 10.2727 6.87723V5.78414C10.2727 5.5117 10.0534 5.29241 9.78094 5.29241H6.45847C6.45847 5.27912 6.45847 5.26583 6.46512 5.25919C6.86381 4.35215 7.44524 3.62453 8.39879 3.24577C9.5085 2.8072 10.6415 2.81717 11.7844 3.05307C12.326 3.16271 12.8576 3.32883 13.3991 3.45176C13.7945 3.54147 14.0237 3.42518 14.1932 3.05639C14.3892 2.63111 14.5686 2.19919 14.748 1.76395C14.9175 1.35528 14.8178 1.06623 14.4324 0.840299C14.3361 0.783817 14.2364 0.737303 14.1334 0.697433C12.532 0.072808 10.8807 -0.159765 9.17625 0.112678C7.97684 0.305381 6.85717 0.717368 5.89033 1.46825C4.67098 2.41183 3.88023 3.65776 3.42173 5.12297L3.36525 5.29241H1.6575C1.38505 5.29241 1.16577 5.5117 1.16577 5.78414V6.87723C1.16577 7.14968 1.38505 7.36896 1.6575 7.36896H3.0031C3.0031 7.66798 3.0031 7.95704 3.0031 8.25938H1.6575C1.38505 8.25938 1.16577 8.47866 1.16577 8.75111V9.8442C1.16577 10.1166 1.38505 10.3359 1.6575 10.3359H3.27886C3.4018 10.7346 3.50479 11.14 3.66095 11.522C4.4816 13.5022 5.8571 14.911 7.927 15.5821C9.63808 16.137 11.3624 16.1204 13.0868 15.6452C13.5353 15.5223 13.9805 15.3628 14.4058 15.1668C14.8178 14.9774 14.9241 14.6585 14.7613 14.2631Z"],["clip-path","url(#clip1)"],["d","M38.7613 14.2631C38.5819 13.8245 38.3992 13.386 38.1998 12.954C38.0237 12.5686 37.7978 12.4557 37.3759 12.552C36.8409 12.6749 36.316 12.8377 35.7811 12.9474C34.7478 13.1634 33.7112 13.1833 32.6912 12.861C31.412 12.459 30.7309 11.532 30.3123 10.3359H33.7809C34.0534 10.3359 34.2727 10.1166 34.2727 9.8442V8.75111C34.2727 8.47866 34.0534 8.25938 33.7809 8.25938H29.98C29.98 7.95371 29.9767 7.66134 29.98 7.36896H33.7809C34.0534 7.36896 34.2727 7.14968 34.2727 6.87723V5.78414C34.2727 5.5117 34.0534 5.29241 33.7809 5.29241H30.4585C30.4585 5.27912 30.4585 5.26583 30.4651 5.25919C30.8638 4.35215 31.4452 3.62453 32.3988 3.24577C33.5085 2.8072 34.6415 2.81717 35.7844 3.05307C36.326 3.16271 36.8576 3.32883 37.3991 3.45176C37.7945 3.54147 38.0237 3.42518 38.1932 3.05639C38.3892 2.63111 38.5686 2.19919 38.748 1.76395C38.9175 1.35528 38.8178 1.06623 38.4324 0.840299C38.3361 0.783817 38.2364 0.737303 38.1334 0.697433C36.532 0.072808 34.8807 -0.159765 33.1763 0.112678C31.9768 0.305381 30.8572 0.717368 29.8903 1.46825C28.671 2.41183 27.8802 3.65776 27.4217 5.12297L27.3652 5.29241H25.6575C25.3851 5.29241 25.1658 5.5117 25.1658 5.78414V6.87723C25.1658 7.14968 25.3851 7.36896 25.6575 7.36896H27.0031C27.0031 7.66798 27.0031 7.95704 27.0031 8.25938H25.6575C25.3851 8.25938 25.1658 8.47866 25.1658 8.75111V9.8442C25.1658 10.1166 25.3851 10.3359 25.6575 10.3359H27.2789C27.4018 10.7346 27.5048 11.14 27.6609 11.522C28.4816 13.5022 29.8571 14.911 31.927 15.5821C33.6381 16.137 35.3624 16.1204 37.0868 15.6452C37.5353 15.5223 37.9805 15.3628 38.4058 15.1668C38.8178 14.9774 38.9241 14.6585 38.7613 14.2631Z","fill","#8C8CA1"],["clip-path","url(#clip2)"],["d","M62.7613 14.2631C62.5819 13.8245 62.3992 13.386 62.1998 12.954C62.0237 12.5686 61.7978 12.4557 61.3759 12.552C60.8409 12.6749 60.316 12.8377 59.7811 12.9474C58.7478 13.1634 57.7112 13.1833 56.6912 12.861C55.412 12.459 54.7309 11.532 54.3123 10.3359H57.7809C58.0534 10.3359 58.2727 10.1166 58.2727 9.8442V8.75111C58.2727 8.47866 58.0534 8.25938 57.7809 8.25938H53.98C53.98 7.95371 53.9767 7.66134 53.98 7.36896H57.7809C58.0534 7.36896 58.2727 7.14968 58.2727 6.87723V5.78414C58.2727 5.5117 58.0534 5.29241 57.7809 5.29241H54.4585C54.4585 5.27912 54.4585 5.26583 54.4651 5.25919C54.8638 4.35215 55.4452 3.62453 56.3988 3.24577C57.5085 2.8072 58.6415 2.81717 59.7844 3.05307C60.326 3.16271 60.8576 3.32883 61.3991 3.45176C61.7945 3.54147 62.0237 3.42518 62.1932 3.05639C62.3892 2.63111 62.5686 2.19919 62.748 1.76395C62.9175 1.35528 62.8178 1.06623 62.4324 0.840299C62.3361 0.783817 62.2364 0.737303 62.1334 0.697433C60.532 0.072808 58.8807 -0.159765 57.1763 0.112678C55.9768 0.305381 54.8572 0.717368 53.8903 1.46825C52.671 2.41183 51.8802 3.65776 51.4217 5.12297L51.3652 5.29241H49.6575C49.3851 5.29241 49.1658 5.5117 49.1658 5.78414V6.87723C49.1658 7.14968 49.3851 7.36896 49.6575 7.36896H51.0031C51.0031 7.66798 51.0031 7.95704 51.0031 8.25938H49.6575C49.3851 8.25938 49.1658 8.47866 49.1658 8.75111V9.8442C49.1658 10.1166 49.3851 10.3359 49.6575 10.3359H51.2789C51.4018 10.7346 51.5048 11.14 51.6609 11.522C52.4816 13.5022 53.8571 14.911 55.927 15.5821C57.6381 16.137 59.3624 16.1204 61.0868 15.6452C61.5353 15.5223 61.9805 15.3628 62.4058 15.1668C62.8178 14.9774 62.9241 14.6585 62.7613 14.2631Z","fill","#8C8CA1"],["id","clip0"],["width","16","height","16","fill","white"],["id","clip1"],["width","16","height","16","fill","white","transform","translate(24)"],["id","clip2"],["width","16","height","16","fill","white","transform","translate(48)"],["d","M38.7613 14.2631C38.5819 13.8245 38.3992 13.386 38.1998 12.954C38.0237 12.5686 37.7978 12.4557 37.3759 12.552C36.8409 12.6749 36.316 12.8377 35.7811 12.9474C34.7478 13.1634 33.7112 13.1833 32.6912 12.861C31.412 12.459 30.7309 11.532 30.3123 10.3359H33.7809C34.0534 10.3359 34.2727 10.1166 34.2727 9.8442V8.75111C34.2727 8.47866 34.0534 8.25938 33.7809 8.25938H29.98C29.98 7.95371 29.9767 7.66134 29.98 7.36896H33.7809C34.0534 7.36896 34.2727 7.14968 34.2727 6.87723V5.78414C34.2727 5.5117 34.0534 5.29241 33.7809 5.29241H30.4585C30.4585 5.27912 30.4585 5.26583 30.4651 5.25919C30.8638 4.35215 31.4452 3.62453 32.3988 3.24577C33.5085 2.8072 34.6415 2.81717 35.7844 3.05307C36.326 3.16271 36.8576 3.32883 37.3991 3.45176C37.7945 3.54147 38.0237 3.42518 38.1932 3.05639C38.3892 2.63111 38.5686 2.19919 38.748 1.76395C38.9175 1.35528 38.8178 1.06623 38.4324 0.840299C38.3361 0.783817 38.2364 0.737303 38.1334 0.697433C36.532 0.072808 34.8807 -0.159765 33.1763 0.112678C31.9768 0.305381 30.8572 0.717368 29.8903 1.46825C28.671 2.41183 27.8802 3.65776 27.4217 5.12297L27.3652 5.29241H25.6575C25.3851 5.29241 25.1658 5.5117 25.1658 5.78414V6.87723C25.1658 7.14968 25.3851 7.36896 25.6575 7.36896H27.0031C27.0031 7.66798 27.0031 7.95704 27.0031 8.25938H25.6575C25.3851 8.25938 25.1658 8.47866 25.1658 8.75111V9.8442C25.1658 10.1166 25.3851 10.3359 25.6575 10.3359H27.2789C27.4018 10.7346 27.5048 11.14 27.6609 11.522C28.4816 13.5022 29.8571 14.911 31.927 15.5821C33.6381 16.137 35.3624 16.1204 37.0868 15.6452C37.5353 15.5223 37.9805 15.3628 38.4058 15.1668C38.8178 14.9774 38.9241 14.6585 38.7613 14.2631Z"],["d","M62.7613 14.2631C62.5819 13.8245 62.3992 13.386 62.1998 12.954C62.0237 12.5686 61.7978 12.4557 61.3759 12.552C60.8409 12.6749 60.316 12.8377 59.7811 12.9474C58.7478 13.1634 57.7112 13.1833 56.6912 12.861C55.412 12.459 54.7309 11.532 54.3123 10.3359H57.7809C58.0534 10.3359 58.2727 10.1166 58.2727 9.8442V8.75111C58.2727 8.47866 58.0534 8.25938 57.7809 8.25938H53.98C53.98 7.95371 53.9767 7.66134 53.98 7.36896H57.7809C58.0534 7.36896 58.2727 7.14968 58.2727 6.87723V5.78414C58.2727 5.5117 58.0534 5.29241 57.7809 5.29241H54.4585C54.4585 5.27912 54.4585 5.26583 54.4651 5.25919C54.8638 4.35215 55.4452 3.62453 56.3988 3.24577C57.5085 2.8072 58.6415 2.81717 59.7844 3.05307C60.326 3.16271 60.8576 3.32883 61.3991 3.45176C61.7945 3.54147 62.0237 3.42518 62.1932 3.05639C62.3892 2.63111 62.5686 2.19919 62.748 1.76395C62.9175 1.35528 62.8178 1.06623 62.4324 0.840299C62.3361 0.783817 62.2364 0.737303 62.1334 0.697433C60.532 0.072808 58.8807 -0.159765 57.1763 0.112678C55.9768 0.305381 54.8572 0.717368 53.8903 1.46825C52.671 2.41183 51.8802 3.65776 51.4217 5.12297L51.3652 5.29241H49.6575C49.3851 5.29241 49.1658 5.5117 49.1658 5.78414V6.87723C49.1658 7.14968 49.3851 7.36896 49.6575 7.36896H51.0031C51.0031 7.66798 51.0031 7.95704 51.0031 8.25938H49.6575C49.3851 8.25938 49.1658 8.47866 49.1658 8.75111V9.8442C49.1658 10.1166 49.3851 10.3359 49.6575 10.3359H51.2789C51.4018 10.7346 51.5048 11.14 51.6609 11.522C52.4816 13.5022 53.8571 14.911 55.927 15.5821C57.6381 16.137 59.3624 16.1204 61.0868 15.6452C61.5353 15.5223 61.9805 15.3628 62.4058 15.1668C62.8178 14.9774 62.9241 14.6585 62.7613 14.2631Z"],["viewBox","0 0 80 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M6.5 12.0623C4.50627 11.6792 3 9.9255 3 7.82C3 5.43415 4.93413 3.5 7.32 3.5C7.7033 3.5 8.0749 3.54991 8.4287 3.6436C9.2199 2.64246 10.4449 2 11.82 2C13.2352 2 14.4914 2.68049 15.2794 3.73211C15.7186 3.58166 16.1898 3.5 16.68 3.5C19.0659 3.5 21 5.43415 21 7.82C21 9.9255 19.4937 11.6792 17.5 12.0623V20C17.5 20.5523 17.0523 21 16.5 21H7.5C6.9477 21 6.5 20.5523 6.5 20V12.0623Z","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M6.5 15.5H17.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M10 12.5V15.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M17.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M6.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["opacity","0.4"],["d","M34.5 12.0623C32.5063 11.6792 31 9.9255 31 7.82C31 5.43415 32.9341 3.5 35.32 3.5C35.7033 3.5 36.0749 3.54991 36.4287 3.6436C37.2199 2.64246 38.4449 2 39.82 2C41.2352 2 42.4914 2.68049 43.2794 3.73211C43.7186 3.58166 44.1898 3.5 44.68 3.5C47.0659 3.5 49 5.43415 49 7.82C49 9.9255 47.4937 11.6792 45.5 12.0623V20C45.5 20.5523 45.0523 21 44.5 21H35.5C34.9477 21 34.5 20.5523 34.5 20V12.0623Z","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M34.5 15.5H45.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M38 12.5V15.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M45.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M34.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M62.5 12.0623C60.5063 11.6792 59 9.9255 59 7.82C59 5.43415 60.9341 3.5 63.32 3.5C63.7033 3.5 64.0749 3.54991 64.4287 3.6436C65.2199 2.64246 66.4449 2 67.82 2C69.2352 2 70.4914 2.68049 71.2794 3.73211C71.7186 3.58166 72.1898 3.5 72.68 3.5C75.0659 3.5 77 5.43415 77 7.82C77 9.9255 75.4937 11.6792 73.5 12.0623V20C73.5 20.5523 73.0523 21 72.5 21H63.5C62.9477 21 62.5 20.5523 62.5 20V12.0623Z","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M62.5 15.5H73.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M66 12.5V15.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M73.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M62.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["viewBox","0 0 12 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M4.33333 3.6C4.33333 4.48366 3.58714 5.2 2.66667 5.2C1.74619 5.2 1 4.48366 1 3.6C1 2.71634 1.74619 2 2.66667 2C3.58714 2 4.33333 2.71634 4.33333 3.6Z"],["d","M4.33333 10C4.33333 10.8837 3.58714 11.6 2.66667 11.6C1.74619 11.6 1 10.8837 1 10C1 9.11634 1.74619 8.4 2.66667 8.4C3.58714 8.4 4.33333 9.11634 4.33333 10Z"],["d","M4.33333 16.4C4.33333 17.2837 3.58714 18 2.66667 18C1.74619 18 1 17.2837 1 16.4C1 15.5163 1.74619 14.8 2.66667 14.8C3.58714 14.8 4.33333 15.5163 4.33333 16.4Z"],["d","M11 3.6C11 4.48366 10.2538 5.2 9.33333 5.2C8.41286 5.2 7.66667 4.48366 7.66667 3.6C7.66667 2.71634 8.41286 2 9.33333 2C10.2538 2 11 2.71634 11 3.6Z"],["d","M11 10C11 10.8837 10.2538 11.6 9.33333 11.6C8.41286 11.6 7.66667 10.8837 7.66667 10C7.66667 9.11634 8.41286 8.4 9.33333 8.4C10.2538 8.4 11 9.11634 11 10Z"],["d","M11 16.4C11 17.2837 10.2538 18 9.33333 18C8.41286 18 7.66667 17.2837 7.66667 16.4C7.66667 15.5163 8.41286 14.8 9.33333 14.8C10.2538 14.8 11 15.5163 11 16.4Z"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24"],["d","M0 0h24v24H0V0z","fill","none"],["d","M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"],["viewBox","0 0 16 16","xmlns","http://www.w3.org/2000/svg",1,"bi","bi-arrow-down"],["fill-rule","evenodd","d","M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 16 16"],["d","M12.5 13c.828 0 1.5.672 1.5 1.5s-.672 1.5-1.5 1.5-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm-9 0c.828 0 1.5.672 1.5 1.5S4.328 16 3.5 16 2 15.328 2 14.5 2.672 13 3.5 13zM3 0l.591 2H15c.623 0 1.095.564.984 1.177C15.27 7.14 14.526 9 13 9H4.42c-.377.391-.67.729-.876 1H13c.552 0 1 .448 1 1s-.448 1-1 1H3c-1.28 0-2.11-.83-1.699-2.066.218-.654.813-1.44 1.807-2.454L1.433 2H0V0h3zm10.786 4H4.182l.887 3h7.737c.09-.124.2-.333.315-.621.224-.56.447-1.355.665-2.379z"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/People_grey06.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Trash.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Trash_danger.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Trash_grey05.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Trash_greyText.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Trash_greyTextDark.svg",1,"icon-container__icon",3,"ngStyle"],["fill-rule","evenodd","clip-rule","evenodd","d","M12.8889 4.88889C12.8889 4.39797 12.4909 4 12 4C11.5091 4 11.1111 4.39797 11.1111 4.88889V11.1111H4.88889C4.39797 11.1111 4 11.5091 4 12C4 12.4909 4.39797 12.8889 4.88889 12.8889H11.1111V19.1111C11.1111 19.602 11.5091 20 12 20C12.4909 20 12.8889 19.602 12.8889 19.1111V12.8889H19.1111C19.602 12.8889 20 12.4909 20 12C20 11.5091 19.602 11.1111 19.1111 11.1111H12.8889V4.88889Z"],["d","M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z"],["d","M0 0h24v24H0z","fill","none"],["d","M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.8 4.8z"],["d","M4.41768 3.64119C4.18693 3.41025 3.81256 3.41025 3.58181 3.64119C2.72506 4.49794 2.30397 5.69144 2.42634 6.91587C2.45687 7.22091 2.71384 7.44828 3.01393 7.44828C3.03365 7.44828 3.05353 7.44728 3.07325 7.44531C3.39818 7.41281 3.63522 7.12294 3.60272 6.79822C3.51562 5.92806 3.81278 5.08197 4.41768 4.47703C4.64862 4.24631 4.64862 3.87191 4.41768 3.64119Z"],["d","M6.75863 0C3.03191 0 0 3.03191 0 6.75863C0 10.4853 3.03191 13.5173 6.75863 13.5173C10.4853 13.5173 13.5173 10.4853 13.5173 6.75863C13.5173 3.03191 10.4853 0 6.75863 0ZM6.75863 12.335C3.68375 12.335 1.18228 9.8335 1.18228 6.75863C1.18228 3.68375 3.68375 1.18228 6.75863 1.18228C9.83331 1.18228 12.335 3.68375 12.335 6.75863C12.335 9.8335 9.8335 12.335 6.75863 12.335Z"],["d","M15.8268 14.9909L11.5312 10.6954C11.3002 10.4644 10.9262 10.4644 10.6953 10.6954C10.4644 10.9261 10.4644 11.3005 10.6953 11.5312L14.9909 15.8268C15.1064 15.9423 15.2575 16 15.4088 16C15.5602 16 15.7113 15.9423 15.8268 15.8268C16.0577 15.5961 16.0577 15.2217 15.8268 14.9909Z"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/RecipeBook.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Meal.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Meal_grey06.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/HorizontalDots.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/NoRecipeFound.svg",1,"icon-container__icon",3,"ngStyle"],["d","M15.0661 1.80645H13.0835C12.9121 0.772355 12.0038 -0.0160968 10.9185 0.000258065C9.73275 0.0180968 8.79029 1.00616 8.79029 2.19203V10.2383C8.79029 10.3707 8.73991 10.4986 8.64797 10.5939C8.06733 11.1957 7.74639 11.9984 7.75836 12.8526C7.78297 14.6074 9.24191 16.0241 10.9967 15.9997C13.7939 15.9608 15.1739 12.5853 13.2567 10.5954C13.1643 10.4995 13.1129 10.3715 13.1129 10.2383V9.29032H13.7758C14.0538 9.29032 14.2929 9.07658 14.3058 8.7989C14.3196 8.50248 14.0836 8.25806 13.7903 8.25806H13.1129V6.06452H14.421C14.699 6.06452 14.9381 5.85077 14.951 5.5731C14.9648 5.27668 14.7288 5.03226 14.4355 5.03226H13.1129V2.83871H15.0806C15.374 2.83871 15.61 2.59429 15.5962 2.29787C15.5832 2.02019 15.3441 1.80645 15.0661 1.80645ZM10.8655 13.997C9.78113 13.9205 9.35033 12.5256 10.2305 11.856C10.3592 11.758 10.4355 11.6063 10.4355 11.4445V5.27255C10.4355 4.99455 10.6492 4.75542 10.9269 4.74252C11.2233 4.72871 11.4677 4.96474 11.4677 5.25806V11.438C11.4677 11.6001 11.5402 11.7558 11.6695 11.8536C12.6164 12.569 12.0469 14.0803 10.8655 13.997ZM1.82255 2.83871C1.03991 2.83871 0.403198 2.202 0.403198 1.41935C0.403198 0.63671 1.03991 0 1.82255 0C2.6052 0 3.24191 0.63671 3.24191 1.41935C3.24191 2.202 2.6052 2.83871 1.82255 2.83871ZM1.82255 1.03226C1.6091 1.03226 1.43546 1.2059 1.43546 1.41935C1.43546 1.63281 1.6091 1.80645 1.82255 1.80645C2.036 1.80645 2.20965 1.63281 2.20965 1.41935C2.20965 1.2059 2.036 1.03226 1.82255 1.03226ZM5.41933 7.16129C4.20091 7.16129 3.20965 6.17003 3.20965 4.95161V3.43548C3.20965 2.21706 4.20088 1.22581 5.41933 1.22581C6.08117 1.22581 6.70255 1.51881 7.12423 2.02971C7.30568 2.24955 7.27455 2.57484 7.05471 2.75629C6.83491 2.93774 6.50959 2.90661 6.32813 2.68677C5.62807 1.83855 4.24191 2.33361 4.24191 3.43548V4.95161C4.24191 6.05432 5.62884 6.54794 6.32813 5.70026C6.50959 5.48039 6.83488 5.44919 7.05471 5.63061C7.27459 5.81203 7.30578 6.13732 7.12436 6.35719C6.70278 6.86819 6.0813 7.16129 5.41933 7.16129Z"],["width","16","height","16","fill","none"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Empty.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Starter.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/NotStarter.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Dessert.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/NotDessert.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/MainDish.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/NotMainDish.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Edit.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/CirclePlus.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/CartPlus.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_neutralBlack.svg",1,"icon-container__icon",3,"ngStyle"],["viewBox","0 0 18 18","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M16.244 6.79981L9.35632 2.34044C9.26608 2.28143 9.1606 2.25 9.05278 2.25C8.94496 2.25 8.83948 2.28143 8.74924 2.34044L6.14856 4.03425V3.22482C6.14856 3.07574 6.08934 2.93276 5.98393 2.82735C5.87851 2.72193 5.73554 2.66271 5.58646 2.66271H3.33803C3.18956 2.66465 3.04771 2.7245 2.94271 2.82949C2.83771 2.93449 2.77787 3.07634 2.77593 3.22482V6.22272L1.76414 6.90474C1.66004 6.96876 1.58001 7.06536 1.53646 7.17954C1.49292 7.29373 1.48831 7.4191 1.52334 7.53617C1.55838 7.65324 1.6311 7.75547 1.73021 7.82696C1.82932 7.89845 1.94927 7.93521 2.07142 7.93152C2.18072 7.93429 2.28815 7.90285 2.37871 7.84158L2.78342 7.57927V15.5537C2.78536 15.7022 2.84521 15.844 2.95021 15.949C3.0552 16.054 3.19705 16.1138 3.34553 16.1158H14.6626C14.8111 16.1138 14.9529 16.054 15.0579 15.949C15.1629 15.844 15.2228 15.7022 15.2247 15.5537V7.49682L15.6294 7.75914C15.6914 7.79949 15.7608 7.82724 15.8335 7.84079C15.9062 7.85434 15.9809 7.85344 16.0533 7.83813C16.1257 7.82282 16.1943 7.7934 16.2553 7.75155C16.3164 7.70971 16.3685 7.65626 16.4089 7.59425C16.4492 7.53225 16.477 7.4629 16.4905 7.39017C16.5041 7.31744 16.5032 7.24276 16.4879 7.17038C16.4726 7.098 16.4431 7.02935 16.4013 6.96834C16.3594 6.90732 16.306 6.85515 16.244 6.8148V6.79981ZM3.90763 3.78692H5.02435V4.76873L3.90763 5.51821V3.78692ZM10.0683 15.029H7.93981V12.4134H10.0683V15.029ZM14.1005 6.86726V14.9916H11.1925V11.8513C11.1925 11.7022 11.1333 11.5592 11.0279 11.4538C10.9225 11.3484 10.7795 11.2892 10.6304 11.2892H7.3777C7.22862 11.2892 7.08565 11.3484 6.98023 11.4538C6.87482 11.5592 6.8156 11.7022 6.8156 11.8513V14.9916H3.90763V6.84478L5.79631 5.61564C5.87449 5.5885 5.94602 5.54508 6.00616 5.48823L9.07152 3.47964L14.123 6.74735C14.1108 6.78631 14.1033 6.82655 14.1005 6.86726Z"],["viewBox","0 0 18 19","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M5.52217 3.5C4.46029 3.5 3.56734 4.28583 3.29895 5.33963H2.10141C1.94183 5.33891 1.78853 5.40683 1.6756 5.52804C1.56279 5.64939 1.49971 5.81396 1.50024 5.98542C1.50091 6.15617 1.56453 6.31945 1.67734 6.43964C1.79001 6.55984 1.94264 6.62705 2.10144 6.62633H3.29672C3.56323 7.68299 4.4583 8.47228 5.5222 8.47228C6.57538 8.47228 7.463 7.69836 7.73953 6.6578L15.9024 6.62635C16.0614 6.62606 16.2133 6.55785 16.3254 6.43707C16.4374 6.31615 16.5003 6.1523 16.5 5.98168C16.4996 5.8115 16.4366 5.64836 16.3246 5.52801C16.2125 5.40767 16.0608 5.33988 15.9023 5.3396L7.75581 5.37105C7.49785 4.30104 6.59486 3.5 5.52217 3.5ZM5.52217 4.78673C6.14605 4.78673 6.639 5.31521 6.639 5.98542C6.639 6.65577 6.14609 7.18543 5.52217 7.18543C4.89825 7.18543 4.40657 6.65581 4.40657 5.98542C4.40657 5.31503 4.89828 4.78673 5.52217 4.78673ZM10.1544 10.4675C9.07485 10.4675 8.1664 11.2673 7.89842 12.3397H2.10117C1.94212 12.3392 1.78935 12.4065 1.67669 12.5269C1.56389 12.6473 1.5004 12.8111 1.5 12.982C1.49973 13.1531 1.56295 13.3176 1.67589 13.4385C1.78869 13.5596 1.94173 13.6272 2.10119 13.6265H7.89947C8.16824 14.6987 9.07562 15.5 10.1542 15.5C11.2328 15.5 12.1402 14.6987 12.4089 13.6265H15.902C16.0609 13.6262 16.213 13.5581 16.3251 13.4372C16.4371 13.3163 16.4999 13.1526 16.4997 12.982C16.4993 12.8118 16.4363 12.6486 16.3243 12.5283C16.2122 12.4079 16.0605 12.3402 15.902 12.3397H12.4099C12.142 11.2673 11.2339 10.4675 10.1544 10.4675ZM10.1544 11.7542C10.7943 11.7542 11.3005 12.2943 11.3005 12.982C11.3005 13.6696 10.7943 14.2134 10.1544 14.2134C9.51445 14.2134 9.0083 13.6696 9.0083 12.982C9.0083 12.2944 9.51445 11.7542 10.1544 11.7542Z"]],template:function(e,t){if(1&e&&(fo(0,Ub,2,8,"div",0),fo(1,Ly,48,50,"ng-template",null,1,Wc)),2&e){const e=_o(2);bo("ngIf",""!==t.iconOverrideUrl)("ngIfElse",e)}},directives:[Ou,zu,Lu,$u,ju],styles:[".icon-container{display:flex;justify-items:center;align-items:center;margin:auto;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.icon-container svg{display:block;margin-left:auto;margin-right:auto;width:-moz-max-content;width:max-content}.icon-container .icon-container__icon{height:unset}"],encapsulation:2,changeDetection:0}),e})(),jy=(()=>{class e{constructor(e){this.analyticsService=e,this.originTrace={originPath:"",props:{}}}get eventTrace(){return{originPath:this.path,props:Object.assign(Object.assign({},this.originTrace.props),this.props)}}get path(){var e,t;return this.currentPath()?`${null!==(e=this.originTrace.originPath)&&void 0!==e?e:""}/${this.currentPath()}`:null!==(t=this.originTrace.originPath)&&void 0!==t?t:""}get props(){return{}}removeFromOriginPath(e){var t;(null===(t=this.originTrace.originPath)||void 0===t?void 0:t.includes(e))&&(this.originTrace.originPath=this.originTrace.originPath.replace(e,""))}pageview(){this.analyticsService.sendEvent("pageview",this.path,{})}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp))},e.\u0275cmp=He({type:e,selectors:[["ng-component"]],inputs:{originTrace:"originTrace"},decls:0,vars:0,template:function(e,t){},encapsulation:2}),e})();const zy=function(e){return{fill:e}},Ny=function(e){return{active:e}};let Vy=(()=>{class e extends jy{constructor(e,t,i){super(e),this.recipeLikesService=t,this.cdr=i,this.primaryColor="var(--m-color-primary)",this.wasToggled=new Rc,this.icon=Cv,this.subscriptions=[]}ngOnChanges(){this.initRecipeLike()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.recipeLikesService.cleanUnobservedLikesIfNecessary.emit()}currentPath(){return""}initRecipeLike(){this.recipe&&this.subscriptions.push(this.recipeLikesService.getLike(this.recipe.id).subscribe(e=>{this.recipeLike=e,this.cdr.detectChanges()}))}toggleLike(e){Pb(e),this.recipe&&(this.recipeLike.id?(this.recipeLike.toggle(),this.wasToggled.emit(this.recipeLike)):(this.recipeLike.addRelationship(this.recipe,"recipe"),this.recipeLike.isPast=!1),this.recipeLikesService.updateLike(this.recipe.id,this.recipeLike,this.eventTrace),this.cdr.detectChanges())}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(l_),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-like-button"]],inputs:{primaryColor:"primaryColor",recipe:"recipe"},outputs:{wasToggled:"wasToggled"},features:[eo,at],decls:4,vars:9,consts:[[1,"miam-like-button","mealz-ds-button","primary","reverse","square","small",3,"click"],[1,"miam-like-button__icon",3,"ngClass"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Heart.svg","alt","Heart",1,"miam-like-button__icon__empty",3,"ngClass"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/HeartFill.svg","alt","Filled heart",1,"miam-like-button__icon__full",3,"ngClass"]],template:function(e,t){1&e&&(wo(0,"button",0),Ao("click",(function(e){return t.toggleLike(e)})),wo(1,"div",1),Co(2,"img",2),Co(3,"img",3),ko(),ko()),2&e&&(Nr(1),bo("ngClass",bc(3,zy,0==t.recipeLike.isPast)),Nr(1),bo("ngClass",bc(5,Ny,!1!==t.recipeLike.isPast)),Nr(1),bo("ngClass",bc(7,Ny,0==t.recipeLike.isPast)))},directives:[Du],styles:[".miam-like-button{padding:8px;border:none;position:relative}.miam-like-button.mealz-ds-button.primary.reverse.square.small{background-color:var(--mealz-ds-color-background-primary)}.miam-like-button.mealz-ds-button.primary.reverse.square.small:hover:not(.loading):not(.disabled):not([disabled]){background-color:var(--mealz-ds-color-background-primary-hover)}.miam-like-button.mealz-ds-button.primary.reverse.square.small .miam-like-button__icon{position:relative;height:24px;width:24px}.miam-like-button.mealz-ds-button.primary.reverse.square.small .miam-like-button__icon img{position:absolute;top:0;right:0;height:100%;width:100%;opacity:0;transition:opacity .3s ease-in-out}.miam-like-button.mealz-ds-button.primary.reverse.square.small .miam-like-button__icon img.active{opacity:1}"],encapsulation:2,changeDetection:0}),e})(),Hy=(()=>{class e{constructor(e){this.context=e,this.icon=Cv,this.subscriptions=[]}openMealsPlanner(){window.location.href=this.context.mealsPlannerUrl}}return e.\u0275fac=function(t){return new(t||e)(vo(Iv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-meals-planner-link"]],decls:14,vars:1,consts:[[1,"miam-meals-planner-link",3,"click"],[1,"miam-meals-planner-link__gradient"],[1,"miam-meals-planner-link__content"],[1,"miam-meals-planner-link__title"],[1,"miam-meals-planner-link__description"],[1,"miam-meals-planner-link__cta"],[1,"mealz-ds-button","primary","reverse"],["width","24","height","24",3,"iconName"]],template:function(e,t){1&e&&(wo(0,"div",0),Ao("click",(function(){return t.openMealsPlanner()})),Co(1,"div",1),wo(2,"div",2),wo(3,"div",3),wo(4,"span"),Qo(5,"tradof#Je planifie mes repas#"),ko(),ko(),wo(6,"div",4),wo(7,"span"),Qo(8,"tradof#Je renseigne mon budget, le nombre de convives et de repas, et j'obtiens des id\xe9es repas#"),ko(),ko(),ko(),wo(9,"div",5),wo(10,"button",6),wo(11,"span"),Qo(12,"tradof#Planifier#"),ko(),ko(),Co(13,"ng-miam-icon",7),ko(),ko()),2&e&&(Nr(13),bo("iconName",t.icon.ChevronDown))},directives:[$y],styles:[".m-button,.m-button-grey,.m-button-grey.reverse,.m-button-primary,.m-button-primary.reverse,.m-button-secondary,.m-button-secondary.reverse{display:flex;justify-content:center;align-items:center;border-radius:var(--m-button-radius);padding:var(--m-button-padding);cursor:pointer;font-size:var(--m-button-text-size);line-height:var(--m-button-text-height);font-weight:var(--m-button-text-weight);outline:0;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none}.m-button-grey.reverse ng-miam-icon,.m-button-grey ng-miam-icon,.m-button-primary.reverse ng-miam-icon,.m-button-primary ng-miam-icon,.m-button-secondary.reverse ng-miam-icon,.m-button-secondary ng-miam-icon,.m-button ng-miam-icon{padding:0}.m-button-grey ng-miam-icon:last-child,.m-button-primary ng-miam-icon:last-child,.m-button-secondary ng-miam-icon:last-child,.m-button ng-miam-icon:last-child{margin-left:var(--m-button-gap)}.m-button-grey ng-miam-icon:first-child,.m-button-primary ng-miam-icon:first-child,.m-button-secondary ng-miam-icon:first-child,.m-button ng-miam-icon:first-child{margin-right:var(--m-button-gap)}.m-button-grey ng-miam-icon:last-child:first-child,.m-button-primary ng-miam-icon:last-child:first-child,.m-button-secondary ng-miam-icon:last-child:first-child,.m-button ng-miam-icon:last-child:first-child{margin:0}.m-button-primary{color:var(--m-color-white);background-color:var(--m-color-primary);border:1px solid var(--m-color-white)}@media (min-width:1023px){.m-button-primary:hover{color:var(--m-color-primary);background-color:var(--m-color-white);border:1px solid var(--m-color-primary);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-primary:hover ng-miam-icon svg path{fill:var(--m-color-primary)}}.m-button-primary ng-miam-icon svg path{fill:var(--m-color-white)}.m-button-primary:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-primary:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-button-primary.reverse{color:var(--m-color-primary);background-color:var(--m-color-white);border:1px solid var(--m-color-primary)}@media (min-width:1023px){.m-button-primary.reverse:hover{color:var(--m-color-white);background-color:var(--m-color-primary);border:1px solid var(--m-color-white);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-primary.reverse:hover ng-miam-icon svg path{fill:var(--m-color-white)}}.m-button-primary.reverse ng-miam-icon svg path{fill:var(--m-color-primary)}.m-button-primary.reverse:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-primary.reverse:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-button-secondary{color:var(--m-color-white);background-color:var(--m-color-secondary);border:1px solid var(--m-color-white)}@media (min-width:1023px){.m-button-secondary:hover{color:var(--m-color-secondary);background-color:var(--m-color-white);border:1px solid var(--m-color-secondary);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-secondary:hover ng-miam-icon svg path{fill:var(--m-color-secondary)}}.m-button-secondary ng-miam-icon svg path{fill:var(--m-color-white)}.m-button-secondary:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-secondary:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-button-secondary.reverse{color:var(--m-color-secondary);background-color:var(--m-color-white);border:1px solid var(--m-color-secondary)}@media (min-width:1023px){.m-button-secondary.reverse:hover{color:var(--m-color-white);background-color:var(--m-color-secondary);border:1px solid var(--m-color-white);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-secondary.reverse:hover ng-miam-icon svg path{fill:var(--m-color-white)}}.m-button-secondary.reverse ng-miam-icon svg path{fill:var(--m-color-secondary)}.m-button-secondary.reverse:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-secondary.reverse:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-button-grey{color:var(--m-color-grey03);background-color:var(--m-color-white);border:1px solid var(--m-color-grey03)}@media (min-width:1023px){.m-button-grey:hover{color:var(--m-color-white);background-color:var(--m-color-grey03);border:1px solid var(--m-color-white);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-grey:hover ng-miam-icon svg path{fill:var(--m-color-white)}}.m-button-grey ng-miam-icon svg path{fill:var(--m-color-grey03)}.m-button-grey:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-grey:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-button-grey.reverse{color:var(--m-color-white);background-color:var(--m-color-grey03);border:1px solid var(--m-color-white)}@media (min-width:1023px){.m-button-grey.reverse:hover{color:var(--m-color-grey03);background-color:var(--m-color-white);border:1px solid var(--m-color-grey03);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-grey.reverse:hover ng-miam-icon svg path{fill:var(--m-color-grey03)}}.m-button-grey.reverse ng-miam-icon svg path{fill:var(--m-color-white)}.m-button-grey.reverse:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-grey.reverse:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-body-typo,.m-h1-typo,.m-input,.m-input>*,.m-small-typo,.m-title-text-input:focus-within .miam-text-input__label,.m-title-text-input input,.m-title-text-input label:not(.miam-text-input__label__top){font-family:Work Sans;font-style:normal;font-weight:500;font-size:var(--m-font-size-medium);line-height:24px;color:var(--m-color-slate)}.m-h1-typo,.m-title-text-input input,.m-title-text-input label:not(.miam-text-input__label__top){font-weight:700;font-size:40px;line-height:48px}.m-small-typo{font-size:var(--m-font-size-small);line-height:16px}.m-input{display:flex;justify-content:space-between;align-items:center;max-width:320px;min-width:200px;border:1px solid var(--m-color-grey06);border-radius:5px;padding:8px 16px;margin-top:16px;outline:none}.m-input:focus-within{border:1px solid var(--m-color-primary)}@media (max-width:1023px){.m-input{padding:8px}}.m-title-text-input .miam-text-input{max-width:565px}.m-default-card{box-shadow:var(--m-shadow-small);background-color:var(--m-color-unpure-white);padding:16px;border-radius:8px}@media (max-width:1023px){.m-default-card{padding:8px;margin-bottom:8px}}.miam-meals-planner-link{display:flex;position:relative;height:var(--m-catalog-card-height);width:var(--m-catalog-card-width);flex-grow:1;background-image:url(https://storage.googleapis.com/assets.miam.tech/generic/meals-planner/background-meals-planner-link.jpeg);background-position:50%;background-size:cover;border-radius:8px;cursor:pointer}.miam-meals-planner-link .miam-meals-planner-link__gradient{display:flex;flex-grow:1;border-radius:8px;background:linear-gradient(180deg,rgba(0,0,0,.5),rgba(0,0,0,.5))}.miam-meals-planner-link .miam-meals-planner-link__content{position:absolute;top:12px;right:12px;left:12px;bottom:12px;display:flex;flex-grow:1;flex-direction:column;justify-content:center;align-items:center;text-align:center;color:#fff}.miam-meals-planner-link .miam-meals-planner-link__content .miam-meals-planner-link__title{font-weight:900;font-size:32px;line-height:120%}.miam-meals-planner-link .miam-meals-planner-link__content .miam-meals-planner-link__description{margin-top:8px;font-weight:500;font-size:16px;line-height:150%}.miam-meals-planner-link .miam-meals-planner-link__cta{position:absolute;width:-moz-fit-content;width:fit-content;left:50%;bottom:12px;transform:translateX(-50%)}.miam-meals-planner-link .miam-meals-planner-link__cta ng-miam-icon{display:none}.miam-meals-planner-link:hover .miam-meals-planner-link__cta .m-button-primary{color:#fff;background-color:var(--m-color-primary);border-color:var(--m-color-primary)}@media (max-width:1023px){.miam-meals-planner-link{height:144px;width:100%;max-width:unset;margin:0}.miam-meals-planner-link .miam-meals-planner-link__content{right:unset;flex-grow:1;max-width:calc(100% - 96px);text-align:left}.miam-meals-planner-link .miam-meals-planner-link__content .miam-meals-planner-link__title{font-weight:900;font-size:20px;line-height:120%}.miam-meals-planner-link .miam-meals-planner-link__content .miam-meals-planner-link__description{display:none}.miam-meals-planner-link .miam-meals-planner-link__cta{bottom:unset;left:unset;right:12px;top:50%;transform:translateY(-50%)}.miam-meals-planner-link .miam-meals-planner-link__cta button{display:none}.miam-meals-planner-link .miam-meals-planner-link__cta ng-miam-icon{display:initial;transform:rotate(-90deg)}.miam-meals-planner-link .miam-meals-planner-link__cta ng-miam-icon .icon-container svg path:last-child{fill:#fff}}"],encapsulation:2}),e})();function Uy(e,t){if(1&e&&(wo(0,"div",13),wo(1,"span"),Qo(2),ko(),ko()),2&e){const e=Fo(2);Nr(2),Yo(e.title)}}function qy(e,t){if(1&e&&(wo(0,"div",14),wo(1,"span"),Qo(2,"Utilizat \xeen "),ko(),wo(3,"span"),Qo(4),ko(),wo(5,"span"),Qo(6," mas\u0103"),ko(),ko()),2&e){const e=Fo(2);Nr(4),Yo(e.recipesCount)}}function Gy(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo(5);Nr(1),Yo(e.cancelButtonText)}}function Wy(e,t){1&e&&Co(0,"div",21)}function Zy(e,t){if(1&e){const e=Io();wo(0,"button",20),Ao("click",(function(){return Rt(e),Fo(4).onCancel()})),fo(1,Gy,2,1,"span",0),fo(2,Wy,1,0,"div",19),ko()}if(2&e){const e=Fo(4);bo("disabled",e.cancelButtonDisabled),Nr(1),bo("ngIf",!e.cancelButtonIsLoading),Nr(1),bo("ngIf",e.cancelButtonIsLoading)}}function Qy(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo(4);Nr(1),Yo(e.confirmButtonText)}}function Yy(e,t){1&e&&Co(0,"div",21)}function Ky(e,t){if(1&e){const e=Io();So(0),wo(1,"div",16),fo(2,Zy,3,3,"button",17),wo(3,"button",18),Ao("click",(function(){return Rt(e),Fo(3).onConfirm()})),fo(4,Qy,2,1,"span",0),fo(5,Yy,1,0,"div",19),ko(),ko(),xo()}if(2&e){const e=Fo(3);Nr(2),bo("ngIf",e.cancelButtonText),Nr(1),bo("disabled",e.confirmButtonDisabled)("ngClass",e.ctaColor),Nr(1),bo("ngIf",!e.confirmButtonIsLoading),Nr(1),bo("ngIf",e.confirmButtonIsLoading)}}function Jy(e,t){if(1&e){const e=Io();So(0),wo(1,"div",22),wo(2,"div",23),wo(3,"div",24),wo(4,"span"),Qo(5),Ec(6,"currency"),ko(),ko(),wo(7,"span",25),Qo(8,"tradof#dans mon panier#"),ko(),ko(),wo(9,"button",26),Ao("click",(function(){return Rt(e),Fo(3).basketTransferService.confirmBasket()})),wo(10,"span"),Qo(11,"tradof#Passer commande#"),ko(),ko(),ko(),xo()}if(2&e){const e=Fo(3);Nr(5),Yo(Pc(6,2,e.totalPrice,e.currencyService.code)),Nr(4),bo("ngClass",e.ctaColor)}}function Xy(e,t){if(1&e&&(So(0),wo(1,"div",27),wo(2,"a",28),wo(3,"button",29),wo(4,"span"),Qo(5,"tradof#Voir mon panier#"),ko(),ko(),ko(),ko(),xo()),2&e){const e=Fo(3);Nr(2),bo("href",e.contextService.retailerCartUrl,Wn),Nr(1),bo("ngClass",e.ctaColor)}}function ew(e,t){if(1&e&&(wo(0,"div",15),fo(1,Ky,6,5,"ng-container",0),fo(2,Jy,12,5,"ng-container",0),fo(3,Xy,6,2,"ng-container",0),ko()),2&e){const e=Fo(2);Nr(1),bo("ngIf",!(e.placeOrderFooter||e.redirectToCartFooter)),Nr(1),bo("ngIf",e.placeOrderFooter&&!e.redirectToCartFooter),Nr(1),bo("ngIf",!e.placeOrderFooter&&e.redirectToCartFooter)}}const tw=function(e,t){return{"with-header":e,"without-header":t}};function iw(e,t){if(1&e){const e=Io();So(0),wo(1,"div",1),wo(2,"div",2),Ao("click",(function(){return Rt(e),Fo().onClose()})),ko(),wo(3,"div",3),wo(4,"div",4),wo(5,"div",5),wo(6,"div",6),fo(7,Uy,3,1,"div",7),fo(8,qy,7,1,"div",8),wo(9,"div",9),Ao("click",(function(){return Rt(e),Fo().onClose()})),ko(),ko(),Lo(10),ko(),wo(11,"div",10),wo(12,"div",11),Lo(13,1),ko(),ko(),fo(14,ew,4,3,"div",12),ko(),ko(),ko(),xo()}if(2&e){const e=Fo();Nr(1),bo("ngClass",e.modalStyle),Nr(2),bo("ngClass",yc(5,tw,!e.noHeaderMode,e.noHeaderMode)),Nr(4),bo("ngIf",e.title),Nr(1),bo("ngIf",!e.title&&e.recipesCount),Nr(6),bo("ngIf",e.cancelButtonText||e.confirmButtonText||e.placeOrderFooter||e.redirectToCartFooter)}}const nw=[[["","header",""]],"*"],rw=["[header]","*"];let sw=(()=>{class e{constructor(e,t,i){this.contextService=e,this.basketTransferService=t,this.currencyService=i,this.modalStyle="center",this.ctaColor="primary",this.close=new Rc,this.cancel=new Rc,this.confirm=new Rc,this.icon=Cv,this.currentPath=""}set display(e){this._display=e;const t=this.contextService.defaultScrollElementGetter();e?null==t||t.classList.add("miam-no-scroll"):null==t||t.classList.remove("miam-no-scroll")}get display(){return this._display}ngOnInit(){this.observeNavigation()}ngOnDestroy(){this.mutationObserver.disconnect()}onEscapeDown(){this.display&&this.onClose()}onClose(){this.close.emit()}onCancel(){this.cancel.emit()}onConfirm(){this.confirm.emit()}observeNavigation(){this.currentPath=window.location.href,this.mutationObserver=new MutationObserver(()=>{this.currentPath.split("?")[0]!==window.location.href.split("?")[0]&&(this.currentPath=window.location.href,this.display&&this.onClose())}),this.mutationObserver.observe(document.body,{childList:!0})}}return e.\u0275fac=function(t){return new(t||e)(vo(Iv),vo(H_),vo(b_))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-modal"]],hostBindings:function(e,t){1&e&&Ao("keydown.escape",(function(){return t.onEscapeDown()}),!1,tr)},inputs:{recipesCount:"recipesCount",confirmButtonIsLoading:"confirmButtonIsLoading",cancelButtonIsLoading:"cancelButtonIsLoading",confirmButtonDisabled:"confirmButtonDisabled",cancelButtonDisabled:"cancelButtonDisabled",placeOrderFooter:"placeOrderFooter",redirectToCartFooter:"redirectToCartFooter",noHeaderMode:"noHeaderMode",totalPrice:"totalPrice",title:"title",confirmButtonText:"confirmButtonText",cancelButtonText:"cancelButtonText",modalStyle:"modalStyle",ctaColor:"ctaColor",display:"display"},outputs:{close:"close",cancel:"cancel",confirm:"confirm"},ngContentSelectors:rw,decls:1,vars:1,consts:[[4,"ngIf"],[1,"miam-modal__container",3,"ngClass"],[1,"miam-shadow-overlay",3,"click"],[1,"miam-modal","mealz-ds-text",3,"ngClass"],[1,"miam-modal__content-container"],[1,"miam-modal__header-container"],[1,"miam-modal__header"],["class","miam-modal__title mealz-ds-text size-xl weight-xxl",4,"ngIf"],["class","miam-modal__title mealz-ds-text",4,"ngIf"],[1,"miam-modal__close-icon","mealz-ds-button","ghost",3,"click"],[1,"miam-modal__content__scroll-protection"],[1,"miam-modal__content","mealz-ds-text"],["class","miam-modal__actions",4,"ngIf"],[1,"miam-modal__title","mealz-ds-text","size-xl","weight-xxl"],[1,"miam-modal__title","mealz-ds-text"],[1,"miam-modal__actions"],[1,"miam-modal__interactions"],["class","mealz-ds-button secondary",3,"disabled","click",4,"ngIf"],[1,"mealz-ds-button",3,"disabled","ngClass","click"],["class","mealz-ds-loader",4,"ngIf"],[1,"mealz-ds-button","secondary",3,"disabled","click"],[1,"mealz-ds-loader"],[1,"miam-modal__place-order"],[1,"miam-modal__place-order-price"],[1,"miam-modal__total-price","mealz-ds-text","size-l","weight-xxl"],[1,"miam-modal__total-price-label","mealz-ds-text","size-s"],[1,"miam-modal__place-order-cta","mealz-ds-button",3,"ngClass","click"],[1,"miam-modal__redirect-to-cart"],[3,"href"],[1,"miam-modal__redirect-to-cart-cta","mealz-ds-button",3,"ngClass"]],template:function(e,t){1&e&&(Mo(nw),fo(0,iw,15,8,"ng-container",0)),2&e&&bo("ngIf",t.display)},directives:[Ou,Du],pipes:[Ku],styles:[".miam-no-scroll{overflow:hidden}.miam-modal__container .miam-shadow-overlay{position:fixed;background:var(--mealz-ds-color-neutral-black);animation-name:show;animation-duration:.3s;opacity:.6;animation-timing-function:ease-in-out;z-index:var(--m-z-index-modal-overlay);top:0;left:0;width:100vw;height:100dvh;-webkit-tap-highlight-color:transparent}@keyframes show{0%{opacity:0}to{opacity:.6}}.miam-modal__container .miam-modal{z-index:var(--m-z-index-modal);position:fixed;overflow:hidden;background-color:var(--mealz-ds-color-background-primary);display:flex;flex-direction:column}@media print{.miam-modal__container .miam-modal{overflow-y:unset!important;position:unset!important;height:unset!important}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__close-icon{display:none}}.miam-modal__container .miam-modal.with-header .miam-modal__content-container .miam-modal__content{margin-top:24px;margin-bottom:24px}.miam-modal__container .miam-modal.without-header .miam-modal__content-container .miam-modal__header .miam-modal__title{display:none}.miam-modal__container .miam-modal.without-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{position:absolute;top:0;right:0;z-index:var(--m-z-index-position-absolute-high)}.miam-modal__container .miam-modal .miam-modal__content-container{position:relative;height:100%;display:flex;flex-direction:column;overflow:hidden}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__header{display:flex;flex-direction:row;justify-content:space-between}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__header .miam-modal__title{font-weight:900;overflow:hidden;text-overflow:ellipsis;align-self:center}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{margin:8px;padding:16px;background:50%/24px no-repeat url(https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg)}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__content__scroll-protection{overflow:hidden;height:100%;display:flex}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__content{width:100%;overflow-y:auto;overflow-x:hidden;scrollbar-color:var(--mealz-ds-color-primary-100),var(--mealz-ds-color-primary)}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__interactions{display:flex;justify-content:flex-end;flex-direction:row}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__interactions button+button{margin-left:12px}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__place-order{display:flex;justify-content:space-between;align-items:center}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__place-order .miam-modal__place-order-price{display:flex;flex-direction:column}.miam-modal__container.center .miam-modal{height:auto;min-width:464px;width:600px;max-width:700px;max-height:96dvh;box-sizing:border-box;top:50%;left:50%;right:unset;transform:translate(-50%,-50%);border-radius:8px;background-color:var(--mealz-ds-color-neutral-white);padding:24px}.miam-modal__container.right>.miam-modal{right:0;animation-name:openRightDrawer}@keyframes openRightDrawer{0%{right:-1200px}to{right:0}}.miam-modal__container.left>.miam-modal{left:0;animation-name:openLeftDrawer}@keyframes openLeftDrawer{0%{left:-1200px}to{left:0}}.miam-modal__container.left>.miam-modal,.miam-modal__container.right>.miam-modal{animation-duration:.5s;animation-timing-function:cubic-bezier(.75,0,.2,1);height:100%;width:1000px;top:0}.miam-modal__container.left>.miam-modal>.miam-modal__content-container,.miam-modal__container.right>.miam-modal>.miam-modal__content-container{height:100%;box-sizing:border-box}.miam-modal__container.left>.miam-modal>.miam-modal__content-container .miam-modal__content,.miam-modal__container.right>.miam-modal>.miam-modal__content-container .miam-modal__content{height:100%;box-sizing:border-box;margin:unset}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions{border-top:1px solid var(--mealz-ds-color-border)}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions{padding:24px}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order{padding:18px}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order .miam-modal__total-price,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order .miam-modal__total-price{color:var(--mealz-ds-color-primary,#24748f)}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order .miam-modal__total-price-label,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order .miam-modal__total-price-label{color:var(--mealz-ds-color-neutral-400,#8c96a2)}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart{padding:12px 16px;display:flex;flex-direction:row;justify-content:center}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a{color:var(--mealz-ds-color-neutral-white,#fff);text-decoration:none}@media (max-width:1023px){.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a .mealz-ds-button,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a .mealz-ds-button{width:100%}}.miam-modal__container.left>.miam-modal.with-header .miam-modal__content-container .miam-modal__header,.miam-modal__container.right>.miam-modal.with-header .miam-modal__content-container .miam-modal__header{border-bottom:1px solid var(--mealz-ds-color-border);padding:24px}.miam-modal__container.left>.miam-modal.with-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon,.miam-modal__container.right>.miam-modal.with-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{margin:unset}.miam-modal__container.left>.miam-modal.with-header .miam-modal__content-container .miam-modal__content,.miam-modal__container.right>.miam-modal.with-header .miam-modal__content-container .miam-modal__content{padding:16px}.miam-modal__container.left>.miam-modal.without-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon,.miam-modal__container.right>.miam-modal.without-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{margin:24px}.miam-modal__container.left.small-width .miam-modal,.miam-modal__container.right.small-width .miam-modal{min-width:680px;max-width:680px}.miam-modal__container.left.tiny-width .miam-modal,.miam-modal__container.right.tiny-width .miam-modal{min-width:360px;max-width:360px}@media (max-width:1023px){.miam-modal__container.center .miam-modal{min-width:60vw;padding:unset;max-width:calc(100vw - 48px)}.miam-modal__container.center .miam-modal.with-header .miam-modal__content-container .miam-modal__header{border-bottom:1px solid var(--mealz-ds-color-border);padding:24px}.miam-modal__container.center .miam-modal.with-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{margin:unset}.miam-modal__container.center .miam-modal.without-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{margin:24px}.miam-modal__container.center .miam-modal .miam-modal__content-container .miam-modal__content{box-sizing:border-box;height:100%;margin:unset;padding:24px}.miam-modal__container.center .miam-modal .miam-modal__content-container .miam-modal__actions{border-top:1px solid var(--mealz-ds-color-border)}.miam-modal__container.center .miam-modal .miam-modal__content-container .miam-modal__actions .miam-modal__interactions{justify-content:center;padding:16px 8px}.miam-modal__container.left.small-width>.miam-modal,.miam-modal__container.left.tiny-width>.miam-modal,.miam-modal__container.left>.miam-modal,.miam-modal__container.right.small-width>.miam-modal,.miam-modal__container.right.tiny-width>.miam-modal,.miam-modal__container.right>.miam-modal{max-width:100vw;max-height:100dvh;width:100vw;height:100dvh;top:0;bottom:0;right:0;animation-name:openBottomSheet;animation-duration:.5s;animation-timing-function:cubic-bezier(.075,.82,.165,1)}@keyframes openBottomSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}.miam-modal__container.left.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.left.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.right.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.right.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions{flex-direction:column-reverse}.miam-modal__container.left.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.left.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.right.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.right.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions{justify-content:center;padding:24px 8px}.miam-modal__container.left.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary,.miam-modal__container.left.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary,.miam-modal__container.right.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary,.miam-modal__container.right.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary{background-color:var(--mealz-ds-color-primary)}.miam-modal__container.left.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary,.miam-modal__container.left.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary,.miam-modal__container.right.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary,.miam-modal__container.right.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary{background-color:transparent}.miam-modal__container.left.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button,.miam-modal__container.left.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button,.miam-modal__container.right.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button,.miam-modal__container.right.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button{margin-left:unset;margin-bottom:12px}}"],encapsulation:2,changeDetection:0}),e})();const ow=[[["ng-miam-accordion-title"]],[["ng-miam-accordion-content"]]],aw=["ng-miam-accordion-title","ng-miam-accordion-content"];let cw=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Qe({type:e,selectors:[["ng-miam-accordion-title"],["","ng-miam-accordion-title",""]]}),e})(),lw=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Qe({type:e,selectors:[["ng-miam-accordion-content"],["","ng-miam-accordion-content",""]]}),e})(),uw=(()=>{class e{constructor(e){this.cdr=e,this.isCollapsed=!0,this.isCollapsedChange=new Rc,this.icon=Cv}get opened(){return!this.isCollapsed}ngOnInit(){}swapState(){this.isCollapsed=!this.isCollapsed,this.isCollapsedChange.emit(this.isCollapsed),this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-accordion"]],hostVars:2,hostBindings:function(e,t){2&e&&Ho("opened",t.opened)},inputs:{isCollapsed:"isCollapsed"},outputs:{isCollapsedChange:"isCollapsedChange"},ngContentSelectors:aw,decls:6,vars:0,consts:[[1,"miam-accordion__header",3,"click"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/chevron-down-primary.svg","alt","open and close icon",1,"miam-accordion__icon"],[1,"miam-accordion__collapsable-container"],[1,"miam-accordion__collapsable-content"]],template:function(e,t){1&e&&(Mo(ow),wo(0,"div",0),Ao("click",(function(){return t.swapState()})),Lo(1),Co(2,"img",1),ko(),wo(3,"div",2),wo(4,"div",3),Lo(5,1),ko(),ko())},styles:[".miam-accordion__header{display:flex;justify-content:space-between;align-items:center;padding:12px 8px}.miam-accordion__header:hover{cursor:pointer}.miam-accordion__icon{height:12px;width:12px;margin:6px;transition:all .3s ease;transform:rotate(0deg)}.miam-accordion__collapsable-container{overflow:hidden;transition:all .3s;border-bottom:1px solid var(--mealz-ds-color-neutral-200,#d9dde1)}.miam-accordion__collapsable-container .miam-accordion__collapsable-content{transition:all .3s ease;max-height:0}.opened .miam-accordion__icon{transform:rotate(180deg)}.opened .miam-accordion__collapsable-container{border-bottom:0}.opened .miam-accordion__collapsable-container .miam-accordion__collapsable-content{max-height:200vh}"],encapsulation:2,changeDetection:0}),e})();function dw(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo().$implicit;Nr(1),Yo(e.text)}}function hw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai pu\u021bin de 15 minute"),ko())}function pw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai pu\u021bin de 30 de minute"),ko())}function mw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai pu\u021bin de 1 or\u0103"),ko())}function gw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai pu\u021bin de 2 or\u0103"),ko())}function fw(e,t){if(1&e){const e=Io();wo(0,"div",13),wo(1,"input",14),Ao("ngModelChange",(function(){return Rt(e),Fo(2).uncheckFiltersOnChange("time")}))("ngModelChange",(function(e){return t.$implicit.value=e}))("ngModelChange",(function(){return Rt(e),Fo(2).filtersChanged()})),ko(),fo(2,dw,2,1,"span",4),fo(3,hw,2,0,"span",4),fo(4,pw,2,0,"span",4),fo(5,mw,2,0,"span",4),fo(6,gw,2,0,"span",4),ko()}if(2&e){const e=t.$implicit;Nr(1),bo("ngModel",e.value),Nr(1),bo("ngIf",e.text),Nr(1),bo("ngIf",!e.text&&"15"===e.name),Nr(1),bo("ngIf",!e.text&&"30"===e.name),Nr(1),bo("ngIf",!e.text&&"60"===e.name),Nr(1),bo("ngIf",!e.text&&"120"===e.name)}}function _w(e,t){if(1&e){const e=Io();wo(0,"div",8),wo(1,"ng-miam-accordion",9),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(2,"ng-miam-accordion-title"),wo(3,"div",10),wo(4,"span"),Qo(5,"tradof#Temps de pr\xe9paration#"),ko(),ko(),ko(),wo(6,"ng-miam-accordion-content"),fo(7,fw,7,6,"div",11),Co(8,"div",12),ko(),ko(),ko()}if(2&e){const e=Fo();Nr(1),bo("isCollapsed",!1),Nr(6),bo("ngForOf",e.filters.time)}}function vw(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo().$implicit;Nr(1),Yo(e.text)}}function bw(e,t){1&e&&(wo(0,"span"),Qo(1,"Buc\u0103tar \xeencep\u0103tor"),ko())}function yw(e,t){1&e&&(wo(0,"span"),Qo(1,"Buc\u0103tar intermediar"),ko())}function ww(e,t){1&e&&(wo(0,"span"),Qo(1,"Buc\u0103tar de top"),ko())}function kw(e,t){if(1&e){const e=Io();wo(0,"div",16),wo(1,"input",14),Ao("ngModelChange",(function(e){return t.$implicit.value=e}))("ngModelChange",(function(){return Rt(e),Fo(2).filtersChanged()})),ko(),fo(2,vw,2,1,"span",4),fo(3,bw,2,0,"span",4),fo(4,yw,2,0,"span",4),fo(5,ww,2,0,"span",4),ko()}if(2&e){const e=t.$implicit;Nr(1),bo("ngModel",e.value),Nr(1),bo("ngIf",e.text),Nr(1),bo("ngIf",!e.text&&"1"===e.name),Nr(1),bo("ngIf",!e.text&&"2"===e.name),Nr(1),bo("ngIf",!e.text&&"3"===e.name)}}function Cw(e,t){if(1&e){const e=Io();wo(0,"div",8),wo(1,"ng-miam-accordion",9),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(2,"ng-miam-accordion-title"),wo(3,"div",10),wo(4,"span"),Qo(5,"Dificultate"),ko(),ko(),ko(),wo(6,"ng-miam-accordion-content"),fo(7,kw,6,5,"div",15),Co(8,"div",12),ko(),ko(),ko()}if(2&e){const e=Fo();Nr(1),bo("isCollapsed",!1),Nr(6),bo("ngForOf",e.filters.difficulty)}}function Sw(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo().$implicit;Nr(1),Yo(e.text)}}function xw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai pu\u021bin de 5 EUR"),ko())}function Ew(e,t){1&e&&(wo(0,"span"),Qo(1,"\xcentre 5 EUR \u0219i 10 EUR"),ko())}function Iw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai mult de 10 EUR"),ko())}function Pw(e,t){if(1&e){const e=Io();wo(0,"div",13),wo(1,"input",14),Ao("ngModelChange",(function(){return Rt(e),Fo(2).uncheckFiltersOnChange("cost")}))("ngModelChange",(function(e){return t.$implicit.value=e}))("ngModelChange",(function(){return Rt(e),Fo(2).filtersChanged()})),ko(),fo(2,Sw,2,1,"span",4),fo(3,xw,2,0,"span",4),fo(4,Ew,2,0,"span",4),fo(5,Iw,2,0,"span",4),ko()}if(2&e){const e=t.$implicit;Nr(1),bo("ngModel",e.value),Nr(1),bo("ngIf",e.text),Nr(1),bo("ngIf",!e.text&&"0-5"===e.name),Nr(1),bo("ngIf",!e.text&&"5-10"===e.name),Nr(1),bo("ngIf",!e.text&&"10-1000"===e.name)}}function Dw(e,t){if(1&e){const e=Io();wo(0,"div",8),wo(1,"ng-miam-accordion",9),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(2,"ng-miam-accordion-title"),wo(3,"div",10),wo(4,"span"),Qo(5,"Cost pe persoan\u0103"),ko(),ko(),ko(),wo(6,"ng-miam-accordion-content"),fo(7,Pw,6,5,"div",11),ko(),ko(),ko()}if(2&e){const e=Fo();Nr(1),bo("isCollapsed",!1),Nr(6),bo("ngForOf",e.filters.cost)}}function Tw(e,t){if(1&e){const e=Io();wo(0,"div"),Co(1,"div",12),wo(2,"div",17),wo(3,"div",10),wo(4,"span"),Qo(5,"Preferin\u021be"),ko(),ko(),wo(6,"div",16),wo(7,"input",14),Ao("ngModelChange",(function(t){return Rt(e),Fo().updateUserPreference("has_children",t)})),ko(),wo(8,"span"),Qo(9,"Am copii"),ko(),ko(),ko(),ko()}if(2&e){const e=Fo();Nr(7),bo("ngModel",e.hasChildren)}}const Aw=function(e){return{"some-filters-set":e}};let Rw=(()=>{class e{constructor(e,t,i,n,r){this.cdr=e,this.mediaMatcher=t,this.usersService=i,this.context=n,this.recipesService=r,this.isFilterCollapsed=!0,this.position="right",this.modifiedGuests=null,this.excludedRecipesIds=[],this.filterChanged=new Rc,this.filterCollapsed=new Rc,this.preferencesChanged=new Rc,this.icon=Cv,this.filtersToDisplay=[],this.isMobile=!1,this.isLogged=!1,this.hasChildren=!1,this.subscriptions=[],this.isMobile=t.matchMedia("(max-width: 607px)").matches}ngOnInit(){this.setUserObservables()}ngOnChanges(e){(e.filters||e.filterToRemove||e.isFilterCollapsed||e.position)&&(this.filterToRemove&&this.removeFilter(this.filterToRemove),this.recalculateRecipesCount(),this.cdr.detectChanges())}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}filtersChanged(){this.recalculateRecipesCount()}reset(){var e,t,i;null===(e=this.filters.time)||void 0===e||e.forEach(e=>e.value=!1),null===(t=this.filters.cost)||void 0===t||t.forEach(e=>e.value=!1),null===(i=this.filters.difficulty)||void 0===i||i.forEach(e=>e.value=!1),this.recalculateRecipesCount()}confirm(){this.toggleFilter(),this.filterChanged.emit(this.filters)}buildFiltersArray(){let e=[];return e=[...e,...this.getSelectedFilters(this.filters.cost),...this.getSelectedFilters(this.filters.difficulty),...this.getSelectedFilters(this.filters.time)],this.filters.additionalFilters&&""!==this.filters.additionalFilters.title&&(e=[this.filters.additionalFilters.title].concat(e)),e}getSelectedFilters(e){return null==e?void 0:e.filter(e=>e.value).map(e=>e.text)}removeFilter(e){var t;if(e===(null===(t=this.filters.additionalFilters)||void 0===t?void 0:t.title))this.filters.additionalFilters=void 0;else for(const i in this.filters)if(this.filters.hasOwnProperty(i)&&"additionalFilters"!==i)for(const t of this.filters[i])t.text===e&&(t.value=!1);this.filtersChanged(),this.cdr.detectChanges()}uncheckFiltersOnChange(e){this.filters[e].forEach(e=>e.value=!1),this.cdr.detectChanges()}toggleFilter(){this.isFilterCollapsed=!this.isFilterCollapsed,this.cdr.detectChanges(),this.filterCollapsed.emit()}updateUserPreference(e,t){this.subscriptions.push(this.usersService.setPreference(e,t).subscribe(()=>this.preferencesChanged.emit()))}areSomeFiltersSet(){var e,t,i;return(null===(e=this.filters.difficulty)||void 0===e?void 0:e.some(e=>e.value))||(null===(t=this.filters.cost)||void 0===t?void 0:t.some(e=>e.value))||(null===(i=this.filters.time)||void 0===i?void 0:i.some(e=>e.value))}setUserObservables(){this.subscriptions.push(this.usersService.isLogged$.subscribe(e=>{this.isLogged=e,this.cdr.detectChanges()})),this.subscriptions.push(this.usersService.hasPreference("has_children").subscribe(e=>{this.hasChildren=e,this.cdr.detectChanges()}))}recalculateRecipesCount(){this.subscriptions.push(this.recipesService.addMandatoryCompletionToFilter(this.filters).pipe(th(e=>this.recipesService.filterCount(e,this.modifiedGuests,this.excludedRecipesIds)),df(e=>{this.recipesCount=e,this.cdr.detectChanges()})).subscribe())}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga),vo(ov),vo(Yf),vo(Iv),vo(__))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-filters"]],inputs:{filters:"filters",filterToRemove:"filterToRemove",isFilterCollapsed:"isFilterCollapsed",position:"position",modifiedGuests:"modifiedGuests",excludedRecipesIds:"excludedRecipesIds"},outputs:{filterChanged:"filterChanged",filterCollapsed:"filterCollapsed",preferencesChanged:"preferencesChanged"},features:[at],decls:19,vars:12,consts:[["title","tradof#Filtres#",1,"miam-recipe-filters",3,"modalStyle","display","ngClass","close"],[1,"miam-recipe-filters__content"],[1,"miam-recipe-filters__container"],["class","miam-recipe-filter__container",4,"ngIf"],[4,"ngIf"],[1,"miam-recipe-filters__ctas"],[1,"miam-recipe-filters__remove","mealz-ds-button","ghost",3,"click"],[1,"miam-recipe-filters__confirm","mealz-ds-button","primary",3,"click"],[1,"miam-recipe-filter__container"],[3,"isCollapsed","isCollapsedChange"],[1,"miam-recipe-filters__title"],["class","miam-recipe-filters__choice miam-recipe-filters__radio-input",4,"ngFor","ngForOf"],[1,"miam-recipe-filters__separator"],[1,"miam-recipe-filters__choice","miam-recipe-filters__radio-input"],["type","checkbox",3,"ngModel","ngModelChange"],["class","miam-recipe-filters__choice mealz-ds-checkbox",4,"ngFor","ngForOf"],[1,"miam-recipe-filters__choice","mealz-ds-checkbox"],[1,"miam-recipe-filters__preferences"]],template:function(e,t){1&e&&(wo(0,"ng-miam-modal",0),Ao("close",(function(){return t.toggleFilter()})),wo(1,"div",1),wo(2,"div",2),fo(3,_w,9,2,"div",3),fo(4,Cw,9,2,"div",3),fo(5,Dw,8,2,"div",3),fo(6,Tw,10,1,"div",4),Ec(7,"async"),ko(),wo(8,"div",5),wo(9,"button",6),Ao("click",(function(){return t.reset()})),wo(10,"span"),Qo(11,"tradof#R\xe9initialiser#"),ko(),ko(),wo(12,"button",7),Ao("click",(function(){return t.confirm()})),wo(13,"span"),Qo(14,"tradof#Voir# "),ko(),wo(15,"span"),Qo(16),ko(),wo(17,"span"),Qo(18,"tradof#recettes#"),ko(),ko(),ko(),ko(),ko()),2&e&&($o("modalStyle",t.position),bo("display",!t.isFilterCollapsed)("ngClass",bc(10,Aw,t.areSomeFiltersSet())),Nr(3),bo("ngIf",t.filters.time),Nr(1),bo("ngIf",t.filters.difficulty),Nr(1),bo("ngIf",t.filters.cost),Nr(1),bo("ngIf",t.isLogged&&Ic(7,8,t.usersService.preferencesActivated$)),Nr(10),Yo(void 0!==t.recipesCount?t.recipesCount+" ":""))},directives:[sw,Du,Ou,uw,cw,lw,Au,Hv,ab,kb],pipes:[Wu],styles:['ng-miam-recipe-filters .miam-modal__container.left .miam-modal,ng-miam-recipe-filters .miam-modal__container.right .miam-modal{width:480px}.miam-accordion__collapsable-container{border-bottom:none}.miam-recipe-filters{display:flex;flex-direction:column;justify-content:flex-start;background-color:var(--m-color-white);box-shadow:0 8px 28px 0 rgba(0,0,0,.07058823529411765)}.miam-recipe-filters .mealz-ds-checkbox{height:unset;padding:unset}.miam-recipe-filters .miam-recipe-filters__radio-input input{margin:0 8px 0 0;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:20px;height:20px;border:1px solid var(--mealz-ds-color-border);border-radius:50%;display:flex;justify-content:center;align-items:center;cursor:pointer}.miam-recipe-filters .miam-recipe-filters__radio-input input:before{content:"";background-color:transparent;border-radius:50%;width:12px;height:12px;transform:scale(0);transition:transform .12s ease-in-out}.miam-recipe-filters .miam-recipe-filters__radio-input input:checked{background-color:#fff;border:1px solid var(--mealz-ds-color-primary)}.miam-recipe-filters .miam-recipe-filters__radio-input input:checked:before{transform:scale(1);background-color:var(--mealz-ds-color-primary)}.miam-recipe-filters.right{left:unset;right:-1px;border-right:0;border-left:1px solid #ccc;box-shadow:0 -8px 28px 0 rgba(0,0,0,.07058823529411765)}.miam-recipe-filters .miam-recipe-filters__content{overflow-y:auto;height:-moz-fit-content;height:fit-content;padding-bottom:80px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__head{font-size:21px;line-height:24px;color:var(--m-color-primary);font-weight:700;margin-bottom:48px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container{transition:opacity .25s cubic-bezier(0,0,.2,1);opacity:1}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filter__container{margin-bottom:24px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filter__details{position:sticky;top:0;display:flex;flex-flow:row wrap;align-items:center;min-height:10vh;background-color:var(--m-color-grey);width:100%;margin-bottom:24px;padding-top:8px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filter__details .miam-recipe-filter__detail__title{padding:0 24px;margin-bottom:16px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filter__details .miam-recipe-filter__detail{display:flex;align-items:center;margin:0 0 16px 8px;padding:8px 16px;border:1px solid var(--m-color-primary);border-radius:4px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filter__details .miam-recipe-filter__detail .miam-recipe-filter__detail__icon .icon-container{margin:0 0 0 16px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filters__title{margin-bottom:16px;font-weight:700;font-size:16px;line-height:20px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filters__choice{margin-bottom:16px;display:flex;font-size:16px;line-height:20px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filters__choice:first-letter{text-transform:capitalize}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filters__choice input{height:20px;width:20px;margin:0 12px 0 0;cursor:pointer}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filters__separator{width:100%;height:1px;background-color:#e9e9e9;margin-top:24px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas{position:absolute;bottom:0;left:0;right:0;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px;border-top:1px solid var(--mealz-ds-color-neutral-200);background-color:var(--m-color-white)}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas>:not(:last-child){margin-right:24px}@media (max-width:450px){.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas{flex-direction:column-reverse}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas>:not(:last-child){margin-top:8px;margin-right:0}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas .mealz-ds-button{width:100%}}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas .miam-recipe-filters__confirm span{white-space:pre}'],encapsulation:2,changeDetection:0}),e})(),Ow=(()=>{class e{constructor(e,t,i){this.el=e,this.contextService=t,this.posService=i}ngOnInit(){this.listenToSelectPosButton()}ngOnDestroy(){var e;null===(e=this.subscription)||void 0===e||e.unsubscribe()}listenToSelectPosButton(){this.contextService.noSupplier&&(this.subscription=this.posService.pos$.subscribe(e=>{e?this.el.nativeElement.classList.remove("selectPos"):this.el.nativeElement.classList.add("selectPos")}))}}return e.\u0275fac=function(t){return new(t||e)(vo(wa),vo(Iv),vo(Vf))},e.\u0275dir=Qe({type:e,selectors:[["","ngMiamSelectPosButton",""]]}),e})();function Fw(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#/personne#"),ko())}function Bw(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo(4);Nr(1),Yo(e.guestsText)}}function Mw(e,t){if(1&e&&(wo(0,"div",11),fo(1,Fw,2,0,"span",12),fo(2,Bw,2,1,"span",12),ko()),2&e){const e=Fo(3);Nr(1),bo("ngIf","par-personne"===e.guestsText),Nr(1),bo("ngIf","par-personne"!==e.guestsText)}}function Lw(e,t){1&e&&(wo(0,"div",13),Qo(1,"tradof#/pers.#"),ko())}function $w(e,t){if(1&e&&(wo(0,"div",5),wo(1,"div",6),wo(2,"div",7),wo(3,"span"),Qo(4),ko(),wo(5,"span"),Qo(6),ko(),wo(7,"span"),Qo(8),ko(),ko(),fo(9,Mw,3,2,"div",8),fo(10,Lw,2,0,"ng-template",null,9,Wc),ko(),wo(12,"div",10),wo(13,"span"),Qo(14,"Adic\u0103"),ko(),wo(15,"span"),Qo(16),ko(),wo(17,"span"),Qo(18),ko(),ko(),ko()),2&e){const e=_o(11),t=Fo(2);Nr(4),Ko("",t.integerPart,","),Nr(2),Yo(t.decimalPart),Nr(2),Ko(" ",t.currencyService.symbol," "),Nr(1),bo("ngIf",null==t.guestsText?null:t.guestsText.length)("ngIfElse",e),Nr(7),Yo(t.total),Nr(2),Yo(t.currencyService.symbol)}}function jw(e,t){if(1&e){const e=Io();wo(0,"div",1),fo(1,$w,19,7,"div",2),wo(2,"div",3),wo(3,"button",4),Ao("click",(function(t){return Rt(e),Fo().openStoreLocator(t)})),wo(4,"span"),Qo(5,"tradof#Afficher le prix#"),ko(),ko(),ko(),ko()}if(2&e){const e=Fo();Nr(1),bo("ngIf",!e.loading)}}let zw=(()=>{class e{constructor(e,t,i,n,r,s,o){this.recipesService=e,this.posService=t,this.cdr=i,this.priceService=n,this.basketsService=r,this.element=s,this.currencyService=o,this.fetchPricingOnScroll=!0,this.inViewport=!0,this.priceSet=new Rc,this.loading=!0,this.subscriptions=[],this.guests$=new cp(0),this.isInView$=new cp(!1)}ngOnInit(){this.isInView$.next(this.inViewport),this.subscriptions.push(this.basketsService.basket$.pipe(bp(e=>!e)).subscribe())}ngOnChanges(e){if(e.serves){const e=this.guests$.value;this.guests$.next(this.serves),this.recipeExtId&&this.recipeId&&e>0&&e!==this.serves&&this.updateRecipeGuests()}(e.recipeId||e.recipeExtId)&&this.initPricing(),e.inViewport&&this.isInView$.next(this.inViewport)}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.onChangesSubscription&&this.onChangesSubscription.unsubscribe()}initPricing(){this.subscriptions.push(this.initRecipeForExtId().subscribe(()=>{var e;(null===(e=this.recipeId)||void 0===e?void 0:e.length)>0&&this.subscriptions.push(this.initPricingFromBasketChanges().subscribe(),this.initPricingFromGuestsAndViewPort())}))}initRecipeForExtId(){var e,t;return!((null===(e=this.recipeId)||void 0===e?void 0:e.length)>0)&&(null===(t=this.recipeExtId)||void 0===t?void 0:t.length)>0?this.recipesService.searchRecipeByExtId(this.recipeExtId).pipe(df(e=>{this.recipeId=(null==e?void 0:e.id)||null,this.cdr.detectChanges()})):td(null)}openStoreLocator(e){e.stopPropagation(),this.recipesService.openStoreLocator()}updateRecipeGuests(){this.basketsService.updateRecipesInBasket([this.recipeId],this.guests$.value,{originPath:"",props:{recipe_id:this.recipeId}})}initPricingFromGuestsAndViewPort(){let e;return Xg([this.posService.waitForPos,this.isInView$,this.guests$,this.basketsService.recipeIsInBasket(this.recipeId)]).pipe(bp(e=>!e[1]||!e[3])).subscribe(t=>{this.pos=t[0],!t[3]&&!1!==e&&this.inViewport&&(this.loading=!0,this.cdr.detectChanges(),this.onChangesSubscription&&this.onChangesSubscription.unsubscribe(),this.onChangesSubscription=this.fetchPricing().subscribe()),e=t[3]})}initPricingFromBasketChanges(){return Xg([this.posService.pos$,this.basketsService.basketPreview$,this.isInView$]).pipe(bp(e=>!e[0]||!e[1]||!e[2]),th(e=>{this.pos=e[0];const t=e[1].find(e=>{var t,i;return e.isRecipe&&(null===(t=e.id)||void 0===t?void 0:t.toString())===(null===(i=this.recipeId)||void 0===i?void 0:i.toString())});return t?this.recipesService.getPricing(this.recipeId,this.pos.id,this.serves).pipe(th(e=>this.extractPricing(t,e))):td(null)}))}fetchPricing(){return this.recipeId&&this.pos&&this.serves?this.recipesService.getPricing(this.recipeId,this.pos.id,this.serves).pipe(bp(e=>0===e.price),df(e=>{this.pricing=e,this.format(),this.loading=!1,this.priceSet.emit(e),this.cdr.detectChanges()})):td(null)}extractPricing(e,t){return this.pricing=new Hf({price:parseFloat(e.price),serves:e.count,"price-per-serve":parseFloat(e.price)/e.count,"discounted-ingredients-count":t["discounted-ingredients-count"]}),this.format(),this.loading=!1,this.priceSet.emit(this.pricing),this.cdr.detectChanges(),td(this.pricing)}format(){const e=this.pricing["price-per-serve"].toFixed(2).toString().split(".");this.integerPart=e[0],this.decimalPart=2===e.length?e[1]:"00",this.total=this.pricing.price.toFixed(2)}}return e.\u0275fac=function(t){return new(t||e)(vo(__),vo(Vf),vo(Ga),vo(w_),vo(C_),vo(wa),vo(b_))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-pricing"]],inputs:{recipeId:"recipeId",recipeExtId:"recipeExtId",serves:"serves",guestsText:"guestsText",fetchPricingOnScroll:"fetchPricingOnScroll",inViewport:"inViewport"},outputs:{priceSet:"priceSet"},features:[at],decls:1,vars:1,consts:[["class","miam-recipe-pricing","ngMiamSelectPosButton","",4,"ngIf"],["ngMiamSelectPosButton","",1,"miam-recipe-pricing"],["class","miam-recipe-pricing__with-pos",4,"ngIf"],[1,"miam-recipe-pricing__without-pos"],[1,"mealz-ds-button","ghost","miam-select-pos-button__open-store-selector-button",3,"click"],[1,"miam-recipe-pricing__with-pos"],[1,"miam-recipe-pricing__wrapper"],[1,"miam-recipe-pricing__wrapper__price","mealz-ds-text","size-l","weight-xxl"],["class","miam-recipe-pricing__wrapper__subline mealz-ds-text size-xs weight-m",4,"ngIf","ngIfElse"],["defaultGuestsText",""],[1,"miam-recipe-pricing__total"],[1,"miam-recipe-pricing__wrapper__subline","mealz-ds-text","size-xs","weight-m"],[4,"ngIf"],[1,"miam-recipe-pricing__wrapper__subline","mealz-ds-text","size-m","weight-m"]],template:function(e,t){1&e&&fo(0,jw,6,1,"div",0),2&e&&bo("ngIf",(null==t.recipeId?null:t.recipeId.length)>0)},directives:[Ou,Ow],styles:[".miam-recipe-pricing{display:flex;flex-direction:column;align-items:center}.miam-recipe-pricing .miam-recipe-pricing__with-pos{display:block}.miam-recipe-pricing .miam-recipe-pricing__without-pos,.miam-recipe-pricing.selectPos .miam-recipe-pricing__with-pos{display:none}.miam-recipe-pricing.selectPos .miam-recipe-pricing__without-pos{display:block}.miam-recipe-pricing .miam-recipe-pricing__wrapper{display:flex;flex-flow:row wrap;align-items:flex-start}.miam-recipe-pricing .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__price{color:var(--mealz-ds-color-primary,#24748f)}.miam-recipe-pricing .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__subline{color:var(--mealz-ds-color-neutral-400)}.miam-recipe-pricing .miam-recipe-pricing__total{display:none;color:var(--m-color-grey04);font-weight:400;font-size:12px;line-height:16px}.miam-recipe-pricing .miam-recipe-pricing__total span{margin-right:4px}"],encapsulation:2,changeDetection:0}),e})(),Nw=(()=>{class e{constructor(e){this.replaceItemService=e}}return e.\u0275fac=function(t){return new(t||e)(vo(yv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-product-addition-card"]],decls:6,vars:0,consts:[[1,"miam-product-addition-card"],[1,"miam-product-addition-card__title"],[1,"miam-product-addition-card__button","mealz-ds-button","secondary","small",3,"click"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"span",1),Qo(2,"tradof#Besoin de quelque chose en particulier ?#"),ko(),wo(3,"button",2),Ao("click",(function(){return t.replaceItemService.changeAdditionModalState(!0)})),wo(4,"span"),Qo(5,"tradof#Ajouter un produit#"),ko(),ko(),ko())},styles:[".miam-product-addition-card{padding:24px 16px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--mealz-ds-color-neutral-50)}.miam-product-addition-card>:not(:last-child){margin-bottom:16px}.miam-product-addition-card .miam-product-addition-card__button{border-radius:32px}"],encapsulation:2,changeDetection:0}),e})(),Vw=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-promotion-badge"]],decls:4,vars:0,consts:[[1,"miam-recipe-promotion-badge"],["alt","promotion badge","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/9.0/recipe_discount.svg",1,"miam-recipe-promotion-badge__icon"],[1,"mealz-ds-text","weight-xl"]],template:function(e,t){1&e&&(wo(0,"div",0),Co(1,"img",1),wo(2,"span",2),Qo(3,"tradof#Promo'#"),ko(),ko())},styles:[".miam-recipe-promotion-badge{display:flex;padding:4px 12px;border-radius:999px;color:var(--mealz-ds-color-neutral-white,#fff);background-color:#e02d2d;gap:8px}.miam-recipe-promotion-badge .miam-recipe-promotion-badge__icon{width:24px;height:24px}"],encapsulation:2,changeDetection:0}),e})(),Hw=(()=>{class e{constructor(){this.clicked=new Rc}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=He({type:e,selectors:[["ng-miam-promotions-banner"]],outputs:{clicked:"clicked"},decls:6,vars:0,consts:[[1,"miam-promotions-banner"],[1,"miam-promotions-banner__badge","mealz-ds-text","size-s","weight-xl"],[1,"miam-promotions-banner_button",3,"click"],[1,"miam-promotions-banner__text","mealz-ds-text","weight-xl"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"span",1),Qo(2,"tradof#Nouveau#"),ko(),wo(3,"button",2),Ao("click",(function(){return t.clicked.emit()})),wo(4,"span",3),Qo(5,"\ntradof# D\xe9couvrez nos recettes en promo' ! # "),ko(),ko(),ko())},styles:["ng-miam-promotions-banner{position:relative;max-width:480px;width:100%;margin:0 16px;box-sizing:border-box}ng-miam-promotions-banner .miam-promotions-banner__badge{position:absolute;top:0;left:50%;transform:translate(-50%,-50%);padding:4px 8px;border-radius:999px;color:var(--mealz-ds-color-neutral-white,#fff);background-color:#e02d2d}ng-miam-promotions-banner .miam-promotions-banner_button{padding:12px;text-decoration:underline;width:100%;border-radius:8px;border:none;cursor:pointer;background-color:var(--miam-color-neutral-50,#f7f8f9)}"],encapsulation:2,changeDetection:0}),e})();class Uw extends zd{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}requestAsyncId(e,t,i=0){return null!==i&&i>0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}}class qw extends Hd{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,n=-1,r=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++n<r&&(e=t.shift()));if(this.active=!1,i){for(;++n<r&&(e=t.shift());)e.unsubscribe();throw i}}}const Gw=new qw(Uw);class Ww{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new Zw(e,this.durationSelector))}}class Zw extends ${constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let i;try{const{durationSelector:t}=this;i=t(e)}catch(t){return this.destination.error(t)}const n=j(i,new L(this));!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function Qw(e){return!c(e)&&e-parseFloat(e)+1>=0}function Yw(e){const{index:t,period:i,subscriber:n}=e;if(n.next(t),!n.closed){if(-1===i)return n.complete();e.index=t+1,this.schedule(e,i)}}let Kw=(()=>{class e{constructor(e,t,i){this._platform=e,this._change=new C,this._changeListener=e=>{this._change.next(e)},this._document=i,t.runOutsideAngular(()=>{if(e.isBrowser){const e=this._getWindow();e.addEventListener("resize",this._changeListener),e.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._updateViewportSize())})}ngOnDestroy(){if(this._platform.isBrowser){const e=this._getWindow();e.removeEventListener("resize",this._changeListener),e.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){const e=this.getViewportScrollPosition(),{width:t,height:i}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+i,right:e.left+t,height:i,width:t}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const e=this._document,t=this._getWindow(),i=e.documentElement,n=i.getBoundingClientRect();return{top:-n.top||e.body.scrollTop||t.scrollY||i.scrollTop||0,left:-n.left||e.body.scrollLeft||t.scrollX||i.scrollLeft||0}}change(e=20){return e>0?this._change.pipe(function(e,t=sf){return i=()=>function(e=0,t,i){let n=-1;return Qw(t)?n=Number(t)<1?1:Number(t):x(t)&&(i=t),x(i)||(i=sf),new v(t=>{const r=Qw(e)?e:+e-i.now();return i.schedule(Yw,r,{index:0,period:n,subscriber:t})})}(e,t),function(e){return e.lift(new Ww(i))};var i}(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}}return e.\u0275fac=function(t){return new(t||e)(nn(ev),nn(gl),nn(Nl,8))},e.\u0275prov=de({factory:function(){return new e(nn(ev),nn(gl),nn(Nl,8))},token:e,providedIn:"root"}),e})(),Jw=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({}),e})();function Xw(e){const{subscriber:t,counter:i,period:n}=e;t.next(i),this.schedule({subscriber:t,counter:i+1,period:n},n)}function ek(e,t){for(let i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function tk(e,t){const i=t?"":"none";ek(e.style,{touchAction:t?"":"none",webkitUserDrag:t?"":"none",webkitTapHighlightColor:t?"":"transparent",userSelect:i,msUserSelect:i,webkitUserSelect:i,MozUserSelect:i})}function ik(e,t){const i=e.style;i.position=t?"":"fixed",i.top=i.opacity=t?"":"0",i.left=t?"":"-999em"}function nk(e){const t=e.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(e)*t}function rk(e,t){return e.getPropertyValue(t).split(",").map(e=>e.trim())}function sk(e){const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}function ok(e,t,i){const{top:n,bottom:r,left:s,right:o}=e;return i>=n&&i<=r&&t>=s&&t<=o}function ak(e,t,i){e.top+=t,e.bottom=e.top+e.height,e.left+=i,e.right=e.left+e.width}function ck(e,t,i,n){const{top:r,right:s,bottom:o,left:a,width:c,height:l}=e,u=c*t,d=l*t;return n>r-d&&n<o+d&&i>a-u&&i<s+u}class lk{constructor(e,t){this._document=e,this._viewportRuler=t,this.positions=new Map}clear(){this.positions.clear()}cache(e){this.clear(),this.positions.set(this._document,{scrollPosition:this._viewportRuler.getViewportScrollPosition()}),e.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:sk(e)})})}handleScroll(e){const t=e.target,i=this.positions.get(t);if(!i)return null;const n=t===this._document?t.documentElement:t,r=i.scrollPosition;let s,o;if(t===this._document){const e=this._viewportRuler.getViewportScrollPosition();s=e.top,o=e.left}else s=t.scrollTop,o=t.scrollLeft;const a=r.top-s,c=r.left-o;return this.positions.forEach((e,i)=>{e.clientRect&&t!==i&&n.contains(i)&&ak(e.clientRect,a,c)}),r.top=s,r.left=o,{top:a,left:c}}}function uk(e){const t=e.cloneNode(!0),i=t.querySelectorAll("[id]"),n=e.nodeName.toLowerCase();t.removeAttribute("id");for(let r=0;r<i.length;r++)i[r].removeAttribute("id");return"canvas"===n?mk(e,t):"input"!==n&&"select"!==n&&"textarea"!==n||pk(e,t),dk("canvas",e,t,mk),dk("input, textarea, select",e,t,pk),t}function dk(e,t,i,n){const r=t.querySelectorAll(e);if(r.length){const t=i.querySelectorAll(e);for(let e=0;e<r.length;e++)n(r[e],t[e])}}let hk=0;function pk(e,t){"file"!==t.type&&(t.value=e.value),"radio"===t.type&&t.name&&(t.name=`mat-clone-${t.name}-${hk++}`)}function mk(e,t){const i=t.getContext("2d");if(i)try{i.drawImage(e,0,0)}catch(fE){}}const gk=iv({passive:!0}),fk=iv({passive:!1});class _k{constructor(e,t,i,n,r,s){this._config=t,this._document=i,this._ngZone=n,this._viewportRuler=r,this._dragDropRegistry=s,this._passiveTransform={x:0,y:0},this._activeTransform={x:0,y:0},this._moveEvents=new C,this._pointerMoveSubscription=d.EMPTY,this._pointerUpSubscription=d.EMPTY,this._scrollSubscription=d.EMPTY,this._resizeSubscription=d.EMPTY,this._boundaryElement=null,this._nativeInteractionsEnabled=!0,this._handles=[],this._disabledHandles=new Set,this._direction="ltr",this.dragStartDelay=0,this._disabled=!1,this.beforeStarted=new C,this.started=new C,this.released=new C,this.ended=new C,this.entered=new C,this.exited=new C,this.dropped=new C,this.moved=this._moveEvents,this._pointerDown=e=>{if(this.beforeStarted.next(),this._handles.length){const t=this._handles.find(t=>{const i=e.target;return!!i&&(i===t||t.contains(i))});!t||this._disabledHandles.has(t)||this.disabled||this._initializeDragSequence(t,e)}else this.disabled||this._initializeDragSequence(this._rootElement,e)},this._pointerMove=e=>{const t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging){if(Math.abs(t.x-this._pickupPositionOnPage.x)+Math.abs(t.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){const t=Date.now()>=this._dragStartTime+this._getDragStartDelay(e),i=this._dropContainer;if(!t)return void this._endDragSequence(e);i&&(i.isDragging()||i.isReceiving())||(e.preventDefault(),this._hasStartedDragging=!0,this._ngZone.run(()=>this._startDragSequence(e)))}return}this._boundaryElement&&(this._previewRect&&(this._previewRect.width||this._previewRect.height)||(this._previewRect=(this._preview||this._rootElement).getBoundingClientRect())),e.preventDefault();const i=this._getConstrainedPointerPosition(t);if(this._hasMoved=!0,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,t);else{const e=this._activeTransform;e.x=i.x-this._pickupPositionOnPage.x+this._passiveTransform.x,e.y=i.y-this._pickupPositionOnPage.y+this._passiveTransform.y,this._applyRootElementTransform(e.x,e.y),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&this._rootElement.setAttribute("transform",`translate(${e.x} ${e.y})`)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:e,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})},this._pointerUp=e=>{this._endDragSequence(e)},this.withRootElement(e).withParent(t.parentDragRef||null),this._parentPositions=new lk(i,r),s.registerDragItem(this)}get disabled(){return this._disabled||!(!this._dropContainer||!this._dropContainer.disabled)}set disabled(e){const t=function(e){return null!=e&&""+e!="false"}(e);t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>tk(e,t)))}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){this._handles=e.map(e=>Q_(e)),this._handles.forEach(e=>tk(e,this.disabled)),this._toggleNativeDragInteractions();const t=new Set;return this._disabledHandles.forEach(e=>{this._handles.indexOf(e)>-1&&t.add(e)}),this._disabledHandles=t,this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){const t=Q_(e);return t!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular(()=>{t.addEventListener("mousedown",this._pointerDown,fk),t.addEventListener("touchstart",this._pointerDown,gk)}),this._initialTransform=void 0,this._rootElement=t),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?Q_(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(e){return this._parentDragRef=e,this}dispose(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&yk(this._rootElement),yk(this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeSubscriptions(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._anchor=this._parentDragRef=null}isDragging(){return this._hasStartedDragging&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),tk(e,!0))}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),tk(e,this.disabled))}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e}getFreeDragPosition(){const e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}_sortFromLastPointerPosition(){const e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e)}_removeSubscriptions(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}_destroyPreview(){this._preview&&yk(this._preview),this._previewRef&&this._previewRef.destroy(),this._preview=this._previewRef=null}_destroyPlaceholder(){this._placeholder&&yk(this._placeholder),this._placeholderRef&&this._placeholderRef.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(e){this._dragDropRegistry.isDragging(this)&&(this._removeSubscriptions(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),this._hasStartedDragging&&(this.released.next({source:this}),this._dropContainer?(this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)})):(this._passiveTransform.x=this._activeTransform.x,this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(this._getPointerPositionOnPage(e))})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this))))}_startDragSequence(e){wk(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();const t=this._dropContainer;if(t){const e=this._rootElement,i=e.parentNode,n=this._preview=this._createPreviewElement(),r=this._placeholder=this._createPlaceholderElement(),s=this._anchor=this._anchor||this._document.createComment(""),o=this._getShadowRoot();i.insertBefore(s,e),ik(e,!1),this._document.body.appendChild(i.replaceChild(r,e)),function(e,t){return t||e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement||e.body}(this._document,o).appendChild(n),this.started.next({source:this}),t.start(),this._initialContainer=t,this._initialIndex=t.getItemIndex(this)}else this.started.next({source:this}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(t?t.getScrollableParents():[])}_initializeDragSequence(e,t){this._parentDragRef&&t.stopPropagation();const i=this.isDragging(),n=wk(t),r=!n&&0!==t.button,s=this._rootElement,o=!n&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now();if(t.target&&t.target.draggable&&"mousedown"===t.type&&t.preventDefault(),i||r||o)return;this._handles.length&&(this._rootElementTapHighlight=s.style.webkitTapHighlightColor||"",s.style.webkitTapHighlightColor="transparent"),this._hasStartedDragging=this._hasMoved=!1,this._removeSubscriptions(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scroll.subscribe(e=>{this._updateOnScroll(e)}),this._boundaryElement&&(this._boundaryRect=sk(this._boundaryElement));const a=this._previewTemplate;this._pickupPositionInElement=a&&a.template&&!a.matchSize?{x:0,y:0}:this._getPointerPositionInElement(e,t);const c=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:c.x,y:c.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){ik(this._rootElement,!0),this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._boundaryRect=this._previewRect=void 0,this._ngZone.run(()=>{const t=this._dropContainer,i=t.getItemIndex(this),n=this._getPointerPositionOnPage(e),r=this._getDragDistance(this._getPointerPositionOnPage(e)),s=t._isOverContainer(n.x,n.y);this.ended.next({source:this,distance:r}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:s,distance:r}),t.drop(this,i,this._initialIndex,this._initialContainer,s,r),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:e,y:t},{x:i,y:n}){let r=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=r,this._dropContainer.enter(this,e,t,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)})}),this._dropContainer._startScrollingIfNecessary(i,n),this._dropContainer._sortItem(this,e,t,this._pointerDirectionDelta),this._preview.style.transform=vk(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y)}_createPreviewElement(){const e=this._previewTemplate,t=this.previewClass,i=e?e.template:null;let n;if(i&&e){const t=e.matchSize?this._rootElement.getBoundingClientRect():null,r=e.viewContainer.createEmbeddedView(i,e.context);r.detectChanges(),n=kk(r,this._document),this._previewRef=r,e.matchSize?Ck(n,t):n.style.transform=vk(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else{const e=this._rootElement;n=uk(e),Ck(n,e.getBoundingClientRect())}return ek(n.style,{pointerEvents:"none",margin:"0",position:"fixed",top:"0",left:"0",zIndex:""+(this._config.zIndex||1e3)}),tk(n,!1),n.classList.add("cdk-drag-preview"),n.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(e=>n.classList.add(e)):n.classList.add(t)),n}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();const e=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._preview.style.transform=vk(e.left,e.top);const t=function(e){const t=getComputedStyle(e),i=rk(t,"transition-property"),n=i.find(e=>"transform"===e||"all"===e);if(!n)return 0;const r=i.indexOf(n),s=rk(t,"transition-duration"),o=rk(t,"transition-delay");return nk(s[r])+nk(o[r])}(this._preview);return 0===t?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(e=>{const i=t=>{(!t||t.target===this._preview&&"transform"===t.propertyName)&&(this._preview.removeEventListener("transitionend",i),e(),clearTimeout(n))},n=setTimeout(i,1.5*t);this._preview.addEventListener("transitionend",i)}))}_createPlaceholderElement(){const e=this._placeholderTemplate,t=e?e.template:null;let i;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),i=kk(this._placeholderRef,this._document)):i=uk(this._rootElement),i.classList.add("cdk-drag-placeholder"),i}_getPointerPositionInElement(e,t){const i=this._rootElement.getBoundingClientRect(),n=e===this._rootElement?null:e,r=n?n.getBoundingClientRect():i,s=wk(t)?t.targetTouches[0]:t,o=this._getViewportScrollPosition();return{x:r.left-i.left+(s.pageX-r.left-o.left),y:r.top-i.top+(s.pageY-r.top-o.top)}}_getPointerPositionOnPage(e){const t=this._getViewportScrollPosition(),i=wk(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,n=i.pageX-t.left,r=i.pageY-t.top;if(this._ownerSVGElement){const e=this._ownerSVGElement.getScreenCTM();if(e){const t=this._ownerSVGElement.createSVGPoint();return t.x=n,t.y=r,t.matrixTransform(e.inverse())}}return{x:n,y:r}}_getConstrainedPointerPosition(e){const t=this._dropContainer?this._dropContainer.lockAxis:null;let{x:i,y:n}=this.constrainPosition?this.constrainPosition(e,this):e;if("x"===this.lockAxis||"x"===t?n=this._pickupPositionOnPage.y:"y"!==this.lockAxis&&"y"!==t||(i=this._pickupPositionOnPage.x),this._boundaryRect){const{x:e,y:t}=this._pickupPositionInElement,r=this._boundaryRect,s=this._previewRect,o=r.top+t,a=r.bottom-(s.height-t);i=bk(i,r.left+e,r.right-(s.width-e)),n=bk(n,o,a)}return{x:i,y:n}}_updatePointerDirectionDelta(e){const{x:t,y:i}=e,n=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,s=Math.abs(t-r.x),o=Math.abs(i-r.y);return s>this._config.pointerDirectionChangeThreshold&&(n.x=t>r.x?1:-1,r.x=t),o>this._config.pointerDirectionChangeThreshold&&(n.y=i>r.y?1:-1,r.y=i),n}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;const e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,tk(this._rootElement,e))}_removeRootElementListeners(e){e.removeEventListener("mousedown",this._pointerDown,fk),e.removeEventListener("touchstart",this._pointerDown,gk)}_applyRootElementTransform(e,t){const i=vk(e,t);null==this._initialTransform&&(this._initialTransform=this._rootElement.style.transform||""),this._rootElement.style.transform=this._initialTransform?i+" "+this._initialTransform:i}_getDragDistance(e){const t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(0===e&&0===t||this.isDragging()||!this._boundaryElement)return;const i=this._boundaryElement.getBoundingClientRect(),n=this._rootElement.getBoundingClientRect();if(0===i.width&&0===i.height||0===n.width&&0===n.height)return;const r=i.left-n.left,s=n.right-i.right,o=i.top-n.top,a=n.bottom-i.bottom;i.width>n.width?(r>0&&(e+=r),s>0&&(e-=s)):e=0,i.height>n.height?(o>0&&(t+=o),a>0&&(t-=a)):t=0,e===this._passiveTransform.x&&t===this._passiveTransform.y||this.setFreeDragPosition({y:t,x:e})}_getDragStartDelay(e){const t=this.dragStartDelay;return"number"==typeof t?t:wk(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){const t=this._parentPositions.handleScroll(e);if(t){const i=e.target;this._boundaryRect&&(i===this._document||i!==this._boundaryElement&&i.contains(this._boundaryElement))&&ak(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){const e=this._parentPositions.positions.get(this._document);return e?e.scrollPosition:this._viewportRuler.getViewportScrollPosition()}_getShadowRoot(){return void 0===this._cachedShadowRoot&&(this._cachedShadowRoot=nv(this._rootElement)),this._cachedShadowRoot}}function vk(e,t){return`translate3d(${Math.round(e)}px, ${Math.round(t)}px, 0)`}function bk(e,t,i){return Math.max(t,Math.min(i,e))}function yk(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function wk(e){return"t"===e.type[0]}function kk(e,t){const i=e.rootNodes;if(1===i.length&&i[0].nodeType===t.ELEMENT_NODE)return i[0];const n=t.createElement("div");return i.forEach(e=>n.appendChild(e)),n}function Ck(e,t){e.style.width=t.width+"px",e.style.height=t.height+"px",e.style.transform=vk(t.left,t.top)}function Sk(e,t){return Math.max(0,Math.min(t,e))}class xk{constructor(e,t,i,n,r){this._dragDropRegistry=t,this._ngZone=n,this._viewportRuler=r,this.disabled=!1,this.sortingDisabled=!1,this.autoScrollDisabled=!1,this.autoScrollStep=2,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.beforeStarted=new C,this.entered=new C,this.exited=new C,this.dropped=new C,this.sorted=new C,this._isDragging=!1,this._itemPositions=[],this._previousSwap={drag:null,delta:0,overlaps:!1},this._draggables=[],this._siblings=[],this._orientation="vertical",this._activeSiblings=new Set,this._direction="ltr",this._viewportScrollSubscription=d.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new C,this._cachedShadowRoot=null,this._startScrollInterval=()=>{this._stopScrolling(),function(e=0,t=sf){return(!Qw(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=sf),new v(i=>(i.add(t.schedule(Xw,e,{subscriber:i,counter:0,period:e})),i))}(0,Gw).pipe(I_(this._stopScrollTimers)).subscribe(()=>{const e=this._scrollNode,t=this.autoScrollStep;1===this._verticalScrollDirection?Ik(e,-t):2===this._verticalScrollDirection&&Ik(e,t),1===this._horizontalScrollDirection?Pk(e,-t):2===this._horizontalScrollDirection&&Pk(e,t)})},this.element=Q_(e),this._document=i,this.withScrollableParents([this.element]),t.registerDropContainer(this),this._parentPositions=new lk(i,r)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(e,t,i,n){let r;this._draggingStarted(),null==n?(r=this.sortingDisabled?this._draggables.indexOf(e):-1,-1===r&&(r=this._getItemIndexFromPointerPosition(e,t,i))):r=n;const s=this._activeDraggables,o=s.indexOf(e),a=e.getPlaceholderElement();let c=s[r];if(c===e&&(c=s[r+1]),o>-1&&s.splice(o,1),c&&!this._dragDropRegistry.isDragging(c)){const t=c.getRootElement();t.parentElement.insertBefore(a,t),s.splice(r,0,e)}else if(this._shouldEnterAsFirstChild(t,i)){const t=s[0].getRootElement();t.parentNode.insertBefore(a,t),s.unshift(e)}else Q_(this.element).appendChild(a),s.push(e);a.style.transform="",this._cacheItemPositions(),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)})}exit(e){this._reset(),this.exited.next({item:e,container:this})}drop(e,t,i,n,r,s){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:i,container:this,previousContainer:n,isPointerOverContainer:r,distance:s})}withItems(e){const t=this._draggables;return this._draggables=e,e.forEach(e=>e._withDropContainer(this)),this.isDragging()&&(t.filter(e=>e.isDragging()).every(t=>-1===e.indexOf(t))?this._reset():this._cacheItems()),this}withDirection(e){return this._direction=e,this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){return this._orientation=e,this}withScrollableParents(e){const t=Q_(this.element);return this._scrollableElements=-1===e.indexOf(t)?[t,...e]:e.slice(),this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?Ek("horizontal"===this._orientation&&"rtl"===this._direction?this._itemPositions.slice().reverse():this._itemPositions,t=>t.drag===e):this._draggables.indexOf(e)}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,i,n){if(this.sortingDisabled||!this._clientRect||!ck(this._clientRect,.05,t,i))return;const r=this._itemPositions,s=this._getItemIndexFromPointerPosition(e,t,i,n);if(-1===s&&r.length>0)return;const o="horizontal"===this._orientation,a=Ek(r,t=>t.drag===e),c=r[s],l=c.clientRect,u=a>s?1:-1,d=this._getItemOffsetPx(r[a].clientRect,l,u),h=this._getSiblingOffsetPx(a,r,u),p=r.slice();!function(e,t,i){const n=Sk(t,e.length-1),r=Sk(i,e.length-1);if(n===r)return;const s=e[n],o=r<n?-1:1;for(let a=n;a!==r;a+=o)e[a]=e[a+o];e[r]=s}(r,a,s),this.sorted.next({previousIndex:a,currentIndex:s,container:this,item:e}),r.forEach((t,i)=>{if(p[i]===t)return;const n=t.drag===e,r=n?d:h,s=n?e.getPlaceholderElement():t.drag.getRootElement();t.offset+=r,o?(s.style.transform=`translate3d(${Math.round(t.offset)}px, 0, 0)`,ak(t.clientRect,0,r)):(s.style.transform=`translate3d(0, ${Math.round(t.offset)}px, 0)`,ak(t.clientRect,r,0))}),this._previousSwap.overlaps=ok(l,t,i),this._previousSwap.drag=c.drag,this._previousSwap.delta=o?n.x:n.y}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let i,n=0,r=0;if(this._parentPositions.positions.forEach((s,o)=>{o!==this._document&&s.clientRect&&!i&&ck(s.clientRect,.05,e,t)&&([n,r]=function(e,t,i,n){const r=Dk(t,n),s=Tk(t,i);let o=0,a=0;if(r){const t=e.scrollTop;1===r?t>0&&(o=1):e.scrollHeight-t>e.clientHeight&&(o=2)}if(s){const t=e.scrollLeft;1===s?t>0&&(a=1):e.scrollWidth-t>e.clientWidth&&(a=2)}return[o,a]}(o,s.clientRect,e,t),(n||r)&&(i=o))}),!n&&!r){const{width:s,height:o}=this._viewportRuler.getViewportSize(),a={width:s,height:o,top:0,right:s,bottom:o,left:0};n=Dk(a,t),r=Tk(a,e),i=window}!i||n===this._verticalScrollDirection&&r===this._horizontalScrollDirection&&i===this._scrollNode||(this._verticalScrollDirection=n,this._horizontalScrollDirection=r,this._scrollNode=i,(n||r)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){const e=Q_(this.element).style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.msScrollSnapType="none",this._cacheItems(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){const e=Q_(this.element);this._parentPositions.cache(this._scrollableElements),this._clientRect=this._parentPositions.positions.get(e).clientRect}_cacheItemPositions(){const e="horizontal"===this._orientation;this._itemPositions=this._activeDraggables.map(e=>{const t=e.getVisibleElement();return{drag:e,offset:0,clientRect:sk(t)}}).sort((t,i)=>e?t.clientRect.left-i.clientRect.left:t.clientRect.top-i.clientRect.top)}_reset(){this._isDragging=!1;const e=Q_(this.element).style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._activeDraggables.forEach(e=>{const t=e.getRootElement();t&&(t.style.transform="")}),this._siblings.forEach(e=>e._stopReceiving(this)),this._activeDraggables=[],this._itemPositions=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1,this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_getSiblingOffsetPx(e,t,i){const n="horizontal"===this._orientation,r=t[e].clientRect,s=t[e+-1*i];let o=r[n?"width":"height"]*i;if(s){const e=n?"left":"top",t=n?"right":"bottom";-1===i?o-=s.clientRect[e]-r[t]:o+=r[e]-s.clientRect[t]}return o}_getItemOffsetPx(e,t,i){const n="horizontal"===this._orientation;let r=n?t.left-e.left:t.top-e.top;return-1===i&&(r+=n?t.width-e.width:t.height-e.height),r}_shouldEnterAsFirstChild(e,t){if(!this._activeDraggables.length)return!1;const i=this._itemPositions,n="horizontal"===this._orientation;if(i[0].drag!==this._activeDraggables[0]){const r=i[i.length-1].clientRect;return n?e>=r.right:t>=r.bottom}{const r=i[0].clientRect;return n?e<=r.left:t<=r.top}}_getItemIndexFromPointerPosition(e,t,i,n){const r="horizontal"===this._orientation,s=Ek(this._itemPositions,({drag:s,clientRect:o},a,c)=>{if(s===e)return c.length<2;if(n){const e=r?n.x:n.y;if(s===this._previousSwap.drag&&this._previousSwap.overlaps&&e===this._previousSwap.delta)return!1}return r?t>=Math.floor(o.left)&&t<Math.floor(o.right):i>=Math.floor(o.top)&&i<Math.floor(o.bottom)});return-1!==s&&this.sortPredicate(s,e,this)?s:-1}_cacheItems(){this._activeDraggables=this._draggables.slice(),this._cacheItemPositions(),this._cacheParentPositions()}_isOverContainer(e,t){return null!=this._clientRect&&ok(this._clientRect,e,t)}_getSiblingContainerFromPosition(e,t,i){return this._siblings.find(n=>n._canReceive(e,t,i))}_canReceive(e,t,i){if(!this._clientRect||!ok(this._clientRect,t,i)||!this.enterPredicate(e,this))return!1;const n=this._getShadowRoot().elementFromPoint(t,i);if(!n)return!1;const r=Q_(this.element);return n===r||r.contains(n)}_startReceiving(e,t){const i=this._activeSiblings;!i.has(e)&&t.every(e=>this.enterPredicate(e,this)||this._draggables.indexOf(e)>-1)&&(i.add(e),this._cacheParentPositions(),this._listenToScrollEvents())}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe()}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scroll.subscribe(e=>{if(this.isDragging()){const t=this._parentPositions.handleScroll(e);t&&(this._itemPositions.forEach(({clientRect:e})=>{ak(e,t.top,t.left)}),this._itemPositions.forEach(({drag:e})=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition()}))}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){const e=nv(Q_(this.element));this._cachedShadowRoot=e||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){const e=this._activeDraggables.filter(e=>e.isDragging());this._siblings.forEach(t=>t._startReceiving(this,e))}}function Ek(e,t){for(let i=0;i<e.length;i++)if(t(e[i],i,e))return i;return-1}function Ik(e,t){e===window?e.scrollBy(0,t):e.scrollTop+=t}function Pk(e,t){e===window?e.scrollBy(t,0):e.scrollLeft+=t}function Dk(e,t){const{top:i,bottom:n,height:r}=e,s=.05*r;return t>=i-s&&t<=i+s?1:t>=n-s&&t<=n+s?2:0}function Tk(e,t){const{left:i,right:n,width:r}=e,s=.05*r;return t>=i-s&&t<=i+s?1:t>=n-s&&t<=n+s?2:0}const Ak=iv({passive:!1,capture:!0});let Rk=(()=>{class e{constructor(e,t){this._ngZone=e,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=[],this._globalListeners=new Map,this._draggingPredicate=e=>e.isDragging(),this.pointerMove=new C,this.pointerUp=new C,this.scroll=new C,this._preventDefaultWhileDragging=e=>{this._activeDragInstances.length>0&&e.preventDefault()},this._persistentTouchmoveListener=e=>{this._activeDragInstances.length>0&&(this._activeDragInstances.some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))},this._document=t}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),1===this._dragInstances.size&&this._ngZone.runOutsideAngular(()=>{this._document.addEventListener("touchmove",this._persistentTouchmoveListener,Ak)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),0===this._dragInstances.size&&this._document.removeEventListener("touchmove",this._persistentTouchmoveListener,Ak)}startDragging(e,t){if(!(this._activeDragInstances.indexOf(e)>-1)&&(this._activeDragInstances.push(e),1===this._activeDragInstances.length)){const e=t.type.startsWith("touch");this._globalListeners.set(e?"touchend":"mouseup",{handler:e=>this.pointerUp.next(e),options:!0}).set("scroll",{handler:e=>this.scroll.next(e),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:Ak}),e||this._globalListeners.set("mousemove",{handler:e=>this.pointerMove.next(e),options:Ak}),this._ngZone.runOutsideAngular(()=>{this._globalListeners.forEach((e,t)=>{this._document.addEventListener(t,e.handler,e.options)})})}}stopDragging(e){const t=this._activeDragInstances.indexOf(e);t>-1&&(this._activeDragInstances.splice(t,1),0===this._activeDragInstances.length&&this._clearGlobalListeners())}isDragging(e){return this._activeDragInstances.indexOf(e)>-1}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_clearGlobalListeners(){this._globalListeners.forEach((e,t)=>{this._document.removeEventListener(t,e.handler,e.options)}),this._globalListeners.clear()}}return e.\u0275fac=function(t){return new(t||e)(nn(gl),nn(Nl))},e.\u0275prov=de({factory:function(){return new e(nn(gl),nn(Nl))},token:e,providedIn:"root"}),e})();const Ok={dragStartThreshold:5,pointerDirectionChangeThreshold:5};let Fk=(()=>{class e{constructor(e,t,i,n){this._document=e,this._ngZone=t,this._viewportRuler=i,this._dragDropRegistry=n}createDrag(e,t=Ok){return new _k(e,t,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(e){return new xk(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl),nn(gl),nn(Kw),nn(Rk))},e.\u0275prov=de({factory:function(){return new e(nn(Nl),nn(gl),nn(Kw),nn(Rk))},token:e,providedIn:"root"}),e})(),Bk=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[Fk],imports:[Jw]}),e})(),Mk=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[tv]]}),e})(),Lk=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[]]}),e})(),$k=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[Lk,ed,Eb,Ib,Bk,Mk]]}),e})(),jk=(()=>{class e{constructor(e){const t={"recipe-pricing":zw};Object.keys(t).map(i=>{const n="webc-miam-"+i;if(!customElements.get(n)){const r=uh(t[i],{injector:e});customElements.define(n,r)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Lk]]}),e})();function zk(e,t){1&e&&(wo(0,"div",19),wo(1,"span"),Qo(2,"Sponsoris\xe9"),ko(),ko())}function Nk(e,t){if(1&e){const e=Io();wo(0,"button",20),Ao("click",(function(){return Rt(e),Fo(2).replaceProduct()})),wo(1,"span"),Qo(2,"tradof#Remplacer#"),ko(),ko()}2&e&&bo("disabled",Fo(2).loading)}function Vk(e,t){1&e&&Co(0,"div",21)}function Hk(e,t){1&e&&Co(0,"img",22)}const Uk=function(e){return{loading:e}};function qk(e,t){if(1&e){const e=Io();wo(0,"div",1),wo(1,"div",2),wo(2,"div",3),wo(3,"div",4),wo(4,"img",5),Ao("error",(function(t){Rt(e);const i=Fo();return t.target.src=i.contextService.defaultIngredientPicture})),ko(),ko(),ko(),wo(5,"div",6),wo(6,"div",7),wo(7,"div",8),wo(8,"span"),Qo(9),Ec(10,"capitalizeFirstLetter"),ko(),ko(),wo(11,"div",9),wo(12,"div",10),Qo(13),Ec(14,"number"),ko(),ko(),fo(15,zk,3,0,"div",11),fo(16,Nk,3,1,"button",12),ko(),wo(17,"button",13),Ao("click",(function(){return Rt(e),Fo().removeProduct()})),fo(18,Vk,1,0,"div",14),fo(19,Hk,1,0,"img",15),ko(),ko(),ko(),wo(20,"div",16),wo(21,"span",17),Qo(22),Ec(23,"currency"),ko(),wo(24,"ng-miam-counter-input",18),Ao("valueChange",(function(t){return Rt(e),Fo().counterChanged(t)})),ko(),ko(),ko()}if(2&e){const e=Fo();$o("id",e.basketEntry.id),Nr(4),bo("src",e.basketEntry.selectedItem.attributes.image,Wn),Nr(5),Yo(Ic(10,15,e.basketEntry.selectedItem.attributes.name)),Nr(4),Jo(" ",Pc(14,17,e.basketEntry.selectedItem.capacityVolume,"1.0-2")," ",e.basketEntry.selectedItem.capacityUnit," "),Nr(2),bo("ngIf",e.basketEntry.selectedItem.attributes.promoted),Nr(1),bo("ngIf",0!=e.basketEntry.recipesIds.length||e.displayReplace),Nr(1),bo("ngClass",bc(23,Uk,e.loading)),Nr(1),bo("ngIf",e.loading),Nr(1),bo("ngIf",!e.loading),Nr(3),Ko(" ",Pc(23,20,e.basketEntry.price,e.basketEntry.selectedItem.attributes.currency)," "),Nr(2),bo("value",e.basketEntry.quantity)("minusLoading",e.minusLoading)("disable",e.loading)("debounceTime",300)}}let Gk=(()=>{class e extends jy{constructor(e,t,i,n,r,s,o,a,c,l,u){super(e),this.cdr=t,this.recipeDetailsService=i,this.recipesService=n,this.posService=r,this.userService=s,this.basketsService=o,this.replaceItemService=a,this.elementRef=c,this.contextService=l,this.basketSynchroService=u,this.displayReplace=!1,this.replaceButtonClicked=new Rc,this.removed=new Rc,this.countChanged=new Rc,this.subscriptions=[],this.counterMinusLoading=!1,this.loading=!1,this.minusLoading=!1,this.isSponsored=!1,this.price=""}ngOnInit(){this.initListeners(),this.scrollBackToProductCard()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.cdr.detectChanges()}currentPath(){return""}replaceProduct(){this.replaceItemService.scrollBackToBasketEntryId=this.basketEntry.id,this.replaceButtonClicked.emit(),this.replaceItemService.replaceProductFromPreviewOpen$.pipe(bp(e=>!!e),fp(1)).subscribe()}scrollBackToProductCard(){this.replaceItemService.scrollBackToBasketEntryId===this.basketEntry.id&&setTimeout(()=>{var e;const t=null===(e=this.elementRef.nativeElement.firstElementChild)||void 0===e?void 0:e.id;document.getElementById(t)&&(document.getElementById(t).scrollIntoView({behavior:this.recipeDetailsService.hasReplaced?"smooth":"auto",block:"center",inline:"center"}),this.cdr.detectChanges(),this.replaceItemService.scrollBackToBasketEntryId=null,this.recipeDetailsService.hasReplaced=!1)},0)}counterChanged(e){if(0===e)this.removeProduct();else{const t=A_(this.basketEntry);t.quantity=e;const i=new N_(t,{eventTrace:this.eventTrace},this.basketsService);q(i.onTimeout,i.onError).pipe(fp(1)).subscribe(()=>{const e=this.basketEntry.quantity;this.basketEntry.quantity=null,this.cdr.detectChanges(),this.basketEntry.quantity=e,this.cdr.detectChanges()}),this.basketSynchroService.addToActionList([i]),i.onSuccess.pipe(fp(1)).subscribe(()=>{this.basketEntry.quantity=t.quantity,this.subscriptions.push(this.basketsService.reloadBasket().subscribe(()=>this.cdr.detectChanges()))}),this.analyticsService.sendEvent("entry.change-quantity",this.path,{entry_name:this.basketEntry.name,item_id:this.basketEntry.selectedItem.id,ext_item_id:this.basketEntry.selectedItem.attributes["ext-id"],item_ean:this.basketEntry.selectedItem.attributes.ean,product_quantity:this.basketEntry.attributes.quantity.toString(),recipe_id:this.basketEntry.recipesIds.length>0?this.basketEntry.recipesIds[0].toString():null})}}removeProduct(){this.analyticsService.sendEvent("entry.deleted",this.path,{entry_name:this.basketEntry.name,item_id:this.basketEntry.selectedItem.id,ext_item_id:this.basketEntry.selectedItem.attributes["ext-id"],item_ean:this.basketEntry.selectedItem.ean,product_quantity:this.basketEntry.quantity.toString(),recipe_id:this.basketEntry.recipesIds.length>0?this.basketEntry.recipesIds[0].toString():null});const e=A_(this.basketEntry);e.quantity=0;const t=new z_(e,{eventTrace:this.eventTrace},this.basketsService);this.basketSynchroService.addToActionList([t]),this.removed.emit(),this.cdr.detectChanges()}initListeners(){const e=Xg([this.basketsService.entryIsBeingUpdated(this.basketEntry.id),this.basketsService.entryIsBeingRemoved(this.basketEntry.id),this.basketsService.entryWillBeRemoved(this.basketEntry.id),this.replaceItemService.replaceProductFromPreviewOpen$]);this.subscriptions.push(e.subscribe(([e,t,i,n])=>{var r;const s=n&&(null===(r=this.replaceItemService.basketEntry)||void 0===r?void 0:r.id)===this.basketEntry.id;this.loading=e||t||i||s,this.minusLoading=t||i,this.cdr.detectChanges()}))}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(fv),vo(__),vo(Vf),vo(Yf),vo(C_),vo(yv),vo(wa),vo(Iv),vo($_))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-basket-preview-product"]],inputs:{basketEntry:"basketEntry",displayReplace:"displayReplace"},outputs:{replaceButtonClicked:"replaceButtonClicked",removed:"removed",countChanged:"countChanged"},features:[eo],decls:1,vars:1,consts:[["class","miam-basket-preview-product",3,"id",4,"ngIf"],[1,"miam-basket-preview-product",3,"id"],[1,"miam-basket-preview-product__infos-container"],[1,"miam-basket-preview-product__picture-container"],[1,"miam-basket-preview-product__picture"],["alt","product picture",3,"src","error"],[1,"miam-basket-preview-product__infos-and-actions"],[1,"miam-basket-preview-product__infos"],[1,"miam-basket-preview-product__title","mealz-ds-text","weight-l","size-s"],[1,"miam-product-card__badges"],[1,"miam-basket-preview-product__capacity","mealz-ds-badge"],["class","miam-basket-preview-product__sponsorised mealz-ds-badge",4,"ngIf"],["class","miam-basket-preview-product__replace-button mealz-ds-button ghost",3,"disabled","click",4,"ngIf"],[1,"miam-basket-preview-line__remove","mealz-ds-button","ghost",3,"ngClass","click"],["class","mealz-ds-loader",4,"ngIf"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/trash.svg","alt","remove recipe",4,"ngIf"],[1,"miam-basket-preview-product__price-and-action"],[1,"miam-basket-preview-product__price","mealz-ds-text","size-l","weight-xl"],["minRange","0",3,"value","minusLoading","disable","debounceTime","valueChange"],[1,"miam-basket-preview-product__sponsorised","mealz-ds-badge"],[1,"miam-basket-preview-product__replace-button","mealz-ds-button","ghost",3,"disabled","click"],[1,"mealz-ds-loader"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/trash.svg","alt","remove recipe"]],template:function(e,t){1&e&&fo(0,qk,25,25,"div",0),2&e&&bo("ngIf",t.basketEntry.selectedItem)},directives:[Ou,Du,Nb],pipes:[Db,Yu,Ku],styles:[".miam-basket-preview-product{display:flex;padding:12px;flex-direction:column;align-items:flex-start;align-self:stretch;background:var(--mealz-ds-color-background-primary,#fff)}.miam-basket-preview-product .miam-basket-preview-product__infos-container{display:flex;flex-direction:row;align-items:flex-start;width:100%}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__picture-container{position:relative;margin-right:12px;margin-bottom:12px}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__picture-container .miam-basket-preview-product__picture{height:100px;width:100px;border-radius:8px;cursor:pointer}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__picture-container .miam-basket-preview-product__picture img{height:100%;width:100%;-o-object-fit:cover;object-fit:cover;border-radius:8px}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__infos-and-actions{display:flex;align-items:flex-start;flex:1 0 0}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__infos-and-actions>:not(:last-child){margin-right:8px}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__infos-and-actions .miam-basket-preview-product__infos{display:flex;flex-direction:column;align-items:flex-start;flex:1 0 0}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__infos-and-actions .miam-basket-preview-product__infos>:not(:last-child){margin-bottom:4px}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__infos-and-actions .miam-basket-preview-product__infos .miam-basket-preview-product__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-product-clamp:2;align-self:stretch;overflow:hidden;color:var(--mealz-ds-color-neutral-black,#02182b);text-overflow:ellipsis;cursor:pointer}.miam-basket-preview-product .miam-basket-preview-product__price-and-action{display:flex;flex-direction:row;justify-content:space-between;align-items:center;align-self:stretch}"],encapsulation:2,changeDetection:0}),e})(),Wk=(()=>{class e{constructor(e){const t={"basket-preview-product":Gk};Object.keys(t).map(i=>{const n="webc-miam-"+i;if(!customElements.get(n)){const r=uh(t[i],{injector:e});customElements.define(n,r)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,Lk,$k,jk]]}),e})();function Zk(e,t){if(1&e){const e=Io();wo(0,"ng-miam-basket-preview-product",7),Ao("replaceButtonClicked",(function(){Rt(e);const t=Fo().$implicit;return Fo().handleReplaceButtonClick(t)})),ko()}2&e&&bo("basketEntry",Fo().$implicit)("displayReplace",!0)}function Qk(e,t){if(1&e){const e=Io();wo(0,"div",8),wo(1,"span",9),Qo(2,"tradof#Le produit est indisponible.#"),ko(),wo(3,"button",10),Ao("click",(function(){Rt(e);const t=Fo().$implicit;return Fo().handleReplaceButtonClick(t)})),wo(4,"span"),Qo(5,"tradof#Remplacer#"),ko(),ko(),ko()}}function Yk(e,t){if(1&e&&(So(0),wo(1,"div",2),wo(2,"div",3),wo(3,"span",4),Qo(4),Ec(5,"capitalizeFirstLetter"),ko(),ko(),fo(6,Zk,1,2,"ng-miam-basket-preview-product",5),fo(7,Qk,6,0,"ng-template",null,6,Wc),ko(),xo()),2&e){const e=t.$implicit,i=_o(8);Nr(4),Yo(Ic(5,3,e.name)),Nr(2),bo("ngIf",e.selectedItem)("ngIfElse",i)}}let Kk=(()=>{class e extends jy{constructor(e,t,i,n){super(e),this.cdr=t,this.listScanService=i,this.replaceItemService=n,this.closed=new Rc,this.cancelled=new Rc,this.icon=Cv,this.entries=[],this.subscriptions=[]}ngOnInit(){this.subscriptions.push(this.listScanService.currentBasketEntries.subscribe(e=>{this.entries=e,this.cdr.detectChanges()}))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}currentPath(){return""}close(){this.closed.emit()}cancel(){this.cancelled.emit()}trackByEntryFn(e,t){return t.id}handleReplaceButtonClick(e){this.replaceItemService.changeReplaceModalState(!0,e),this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(jv),vo(yv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-list-scan-basket-preview"]],outputs:{closed:"closed",cancelled:"cancelled"},features:[eo],decls:3,vars:2,consts:[[1,"miam-list-scan__basket-preview"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"miam-list-scan__basket-preview__product"],[1,"miam-list-scan__basket-preview__product__name"],[1,"mealz-ds-text","size-s","weight-xl"],[3,"basketEntry","displayReplace","replaceButtonClicked",4,"ngIf","ngIfElse"],["noItem",""],[3,"basketEntry","displayReplace","replaceButtonClicked"],[1,"miam-list-scan__basket-preview__product__no-item"],[1,"mealz-ds-text","size-s","weight-m"],[1,"miam-basket-preview-product__replace-button","mealz-ds-button","ghost",3,"click"]],template:function(e,t){1&e&&(wo(0,"div",0),Co(1,"ng-miam-product-addition-card"),fo(2,Yk,9,5,"ng-container",1),ko()),2&e&&(Nr(2),bo("ngForOf",t.entries)("ngForTrackBy",t.trackByEntryFn))},directives:[Nw,Au,Ou,Gk],pipes:[Db],styles:[".miam-list-scan__basket-preview ng-miam-product-addition-card{margin-bottom:4px}.miam-list-scan__basket-preview .miam-list-scan__basket-preview__product{border-radius:4px;border:1px solid var(--mealz-ds-color-border);background:var(--mealz-ds-color-page-background);margin:4px 0}.miam-list-scan__basket-preview .miam-list-scan__basket-preview__product .miam-list-scan__basket-preview__product__name{padding:8px;border-bottom:1px solid var(--mealz-ds-color-background-secondary);background:#e6e6e6}.miam-list-scan__basket-preview .miam-list-scan__basket-preview__product .miam-list-scan__basket-preview__product__no-item{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:8px}"],encapsulation:2,changeDetection:0}),e})();function Jk(e,t){1&e&&(So(0),Co(1,"img",7),wo(2,"div",8),wo(3,"span"),Qo(4,"Scaneaz\u0103-mi lista"),ko(),ko(),xo())}const Xk=function(e){return{disabled:e}};function eC(e,t){if(1&e){const e=Io();wo(0,"div"),wo(1,"input",4),Ao("change",(function(t){return Rt(e),Fo().listScanService.sendFile(t)})),ko(),wo(2,"label",5),wo(3,"div",6),fo(4,Jk,5,0,"ng-container",1),ko(),ko(),ko()}if(2&e){const e=Fo(),t=_o(5);Nr(1),bo("disabled",e.loading),Nr(2),bo("ngClass",bc(4,Xk,e.loading)),Nr(1),bo("ngIf",!e.loading)("ngIfElse",t)}}function tC(e,t){1&e&&(So(0),Co(1,"img",12),wo(2,"span",8),Qo(3,"Import\u0103 lista mea"),ko(),xo())}function iC(e,t){if(1&e){const e=Io();wo(0,"input",9),Ao("change",(function(t){return Rt(e),Fo().listScanService.sendFile(t)})),ko(),wo(1,"label",10),wo(2,"div",11),fo(3,tC,4,0,"ng-container",1),ko(),ko()}if(2&e){const e=Fo(),t=_o(5);bo("disabled",e.loading),Nr(2),bo("ngClass",bc(4,Xk,e.loading)),Nr(1),bo("ngIf",!e.loading)("ngIfElse",t)}}function nC(e,t){1&e&&Co(0,"div",13)}let rC=(()=>{class e{constructor(e,t,i){this.cdr=e,this.mediaMatcher=t,this.listScanService=i,this.isSchoolList=!1,this.icon=Cv,this.loading=!1,this.isMobile=!1,this.isMobile=this.mediaMatcher.matchMedia("(max-width: 1023px)").matches}ngOnInit(){this.listScanService.sendingFile.subscribe(e=>{this.loading=e,this.cdr.detectChanges()})}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga),vo(ov),vo(jv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-list-scan-files-inputs"]],inputs:{isSchoolList:"isSchoolList"},decls:6,vars:2,consts:[[1,"miam-files-inputs"],[4,"ngIf","ngIfElse"],["desktop",""],["loader",""],["type","file","name","photo","id","photo","accept","image/*","capture","environment",1,"miam-files-inputs__inputfile",3,"disabled","change"],["for","photo"],[1,"mealz-ds-button","primary",3,"ngClass"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/ListScanner.svg","alt","take a photo"],[1,"mealz-ds-text","size-m","weight-xl"],["type","file","name","file","id","file","accept","image/*,application/pdf",1,"miam-files-inputs__inputfile",3,"disabled","change"],["for","file"],[1,"mealz-ds-button","secondary",3,"ngClass"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Upload.svg","alt","upload"],[1,"mealz-ds-loader"]],template:function(e,t){if(1&e&&(wo(0,"div",0),fo(1,eC,5,6,"div",1),fo(2,iC,4,6,"ng-template",null,2,Wc),fo(4,nC,1,0,"ng-template",null,3,Wc),ko()),2&e){const e=_o(3);Nr(1),bo("ngIf",1==t.isMobile)("ngIfElse",e)}},directives:[Ou,Du],styles:[".miam-files-inputs{position:relative;display:inline-block}.miam-files-inputs input{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}"],encapsulation:2,changeDetection:0}),e})(),sC=(()=>{class e extends jy{constructor(e,t,i,n){super(e),this.cdr=t,this.listScanService=i,this.basketSynchro=n,this.disableIngredientsMatching=!1,this.isSchoolList=!1,this.confirmed=new Rc,this.basketPreviewShown=!1,this.cancelConfirmationShown=!1,this.cancelling=!1,this.subscriptions=[]}ngOnInit(){this.listenEntries(),this.listenCancelling(),this.subscriptions.push(this.listScanService.sendingFile.subscribe(e=>{e&&(this.basketSynchro.ignoreMiam=!0)}))}ngOnChanges(e){e.isSchoolList&&(this.listScanService.isSchoolList=this.isSchoolList)}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.listScanService.unsubscribeService()}currentPath(){return"list-scan"}listenEntries(){this.subscriptions.push(this.listScanService.currentBasketEntries.pipe().subscribe(e=>{this.basketPreviewShown=e.length>0,this.cdr.detectChanges()}))}listenCancelling(){let e;this.subscriptions.push(this.listScanService.cancelling.pipe().subscribe(t=>{this.cancelling=t,!this.cancelling&&e&&(this.cancelConfirmationShown=!1),e=t,this.cdr.detectChanges()}))}confirm(){this.basketSynchro.ignoreMiam=!1,this.basketPreviewShown=!1,this.cdr.detectChanges(),this.confirmed.emit()}cancel(){this.cancelConfirmationShown=!0,this.cdr.detectChanges()}closeCancelConfirmationModal(){this.cancelConfirmationShown=!1,this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(jv),vo(L_))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-list-scan"]],inputs:{disableIngredientsMatching:"disableIngredientsMatching",isSchoolList:"isSchoolList"},outputs:{confirmed:"confirmed"},features:[eo,at],decls:7,vars:8,consts:[[1,"miam-list-scan"],[3,"isSchoolList"],["title","tradof#Nous avons trouv\xe9 pour vous#","cancelButtonText","tradof#Abandonner ma liste#","confirmButtonText","Ad\u0103uga\u021bi \xeen co\u0219","modalStyle","right",1,"miam-list-scan__result",3,"noHeaderMode","display","cancel","close","confirm"],[1,"miam-list-scan__content",3,"closed","cancelled"],["title","tradof#Abandonner ma liste#","cancelButtonText","Anulare","confirmButtonText","Abandonare",1,"miam-list-scan__confirmation",3,"display","noHeaderMode","confirmButtonDisabled","confirmButtonIsLoading","cancelButtonDisabled","displayChange","close","cancel","confirm"],[1,"mealz-ds-text","size-m","weight-m"]],template:function(e,t){1&e&&(wo(0,"div",0),Co(1,"ng-miam-list-scan-files-inputs",1),wo(2,"ng-miam-modal",2),Ao("cancel",(function(){return t.cancel()}))("close",(function(){return t.cancel()}))("confirm",(function(){return t.confirm()})),wo(3,"ng-miam-list-scan-basket-preview",3),Ao("closed",(function(){return t.confirm()}))("cancelled",(function(){return t.cancel()})),ko(),ko(),wo(4,"ng-miam-modal",4),Ao("displayChange",(function(e){return t.cancelConfirmationShown=e}))("close",(function(){return t.closeCancelConfirmationModal()}))("cancel",(function(){return t.closeCancelConfirmationModal()}))("confirm",(function(){return t.listScanService.cancelAndRemove(t.eventTrace)})),wo(5,"span",5),Qo(6,"tradof#Souhaitez-vous vraiment abandonner votre liste ?#"),ko(),ko(),ko()),2&e&&(Nr(1),bo("isSchoolList",t.isSchoolList),Nr(1),bo("noHeaderMode",!1)("display",t.basketPreviewShown),Nr(2),bo("display",t.cancelConfirmationShown)("noHeaderMode",!1)("confirmButtonDisabled",t.cancelling)("confirmButtonIsLoading",t.cancelling)("cancelButtonDisabled",t.cancelling))},directives:[rC,sw,Kk],styles:[".miam-list-scan .miam-list-scan__content{height:100%}@media (max-width:1023px){.miam-list-scan ng-miam-modal .miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__actions .mealz-ds-button+button{margin-left:12px;margin-bottom:0}}.miam-list-scan ng-miam-modal.miam-list-scan__confirmation .miam-modal__container .miam-shadow-overlay{z-index:calc(var(--m-z-index-modal-overlay) + 1)}"],encapsulation:2,changeDetection:0}),e})(),oC=(()=>{class e{constructor(e){if(!customElements.get("webc-miam-list-scan")){const t=uh(sC,{injector:e});customElements.define("webc-miam-list-scan",t)}}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,$k,Wk,Lk]]}),e})();class aC{constructor(e){this.callback=e}call(e,t){return t.subscribe(new cC(e,this.callback))}}class cC extends m{constructor(e,t){super(e),this.add(new d(t))}}let lC=(()=>{class e{constructor(){this.icon=Cv,this.addRecipe=new Rc}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=He({type:e,selectors:[["ng-miam-add-recipe-card"]],outputs:{addRecipe:"addRecipe"},decls:5,vars:1,consts:[[1,"miam-add-recipe-card",3,"click"],[1,"m-button-primary"],["width","14","height","14",3,"iconName"],[1,"miam-add-recipe-card__label"]],template:function(e,t){1&e&&(wo(0,"div",0),Ao("click",(function(){return t.addRecipe.emit()})),wo(1,"button",1),Co(2,"ng-miam-icon",2),ko(),wo(3,"span",3),Qo(4,"Ad\u0103uga\u021bi o idee de mas\u0103"),ko(),ko()),2&e&&(Nr(2),bo("iconName",t.icon.Plus))},directives:[$y],styles:["ng-miam-add-recipe-card{flex-grow:1}.miam-add-recipe-card{border-radius:8px;height:var(--m-catalog-card-height);width:var(--m-catalog-card-width);border:1px dashed var(--m-color-primary);box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}.miam-add-recipe-card:hover{background-color:var(--m-color-grey)}.miam-add-recipe-card .m-button-primary{border-radius:6px;height:48px;width:48px}.miam-add-recipe-card .m-button-primary:hover{background-color:var(--m-color-primary);border:1px solid var(--m-color-white)}.miam-add-recipe-card .m-button-primary img{filter:brightness(0) invert(100%)}.miam-add-recipe-card .miam-add-recipe-card__label{font-size:14px;line-height:22px;color:var(--m-color-primary);font-weight:700;margin-top:16px}"],encapsulation:2,changeDetection:0}),e})(),uC=(()=>{class e extends Pv{constructor(e){super(e),this.http=e,this.componentStylesUrl=this.MEALZ_SSR_API+"/styles/drawer",this.scriptsPaths=[Pp+"/drawer/drawer.min.js",Pp+"/drawer-view-swapper/drawer-view-swapper.min.js"],this.loadStyles(),this.loadComponentScripts()}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function dC(e,t){1&e&&(So(0),Co(1,"img",5),xo())}function hC(e,t){1&e&&Co(0,"img",6)}const pC=function(e,t,i){return{"in-basket":e,primary:t,secondary:i}};function mC(e,t){if(1&e){const e=Io();wo(0,"div",1),wo(1,"button",2),Ao("click",(function(t){return Rt(e),Fo().openRecipe(t)})),fo(2,dC,2,0,"ng-container",3),Ec(3,"async"),fo(4,hC,1,0,"ng-template",null,4,Wc),ko(),ko()}if(2&e){const e=_o(5),t=Fo();Nr(1),bo("disabled",!t.recipe)("ngClass",wc(6,pC,t.inBasket,!t.inBasket,t.inBasket)),Nr(1),bo("ngIf",!Ic(3,4,t.basketsService.recipeIsInBasket(t.recipe.id)))("ngIfElse",e)}}let gC=(()=>{class e extends jy{constructor(e,t,i,n,r,s,o,a){super(e),this.cdr=t,this.recipeService=i,this.basketsService=n,this.userService=r,this.pointOfSalesService=s,this.contextService=o,this.toasterService=a,this.previewAllowed=!0,this.helpButtonAllowed=!0,this.displayGuests=!0,this.displayed=new Rc,this.clicked=new Rc,this.hidden=new Rc,this.icon=Cv,this.inBasket=!1,this.subscriptions=[]}ngOnInit(){this.checkRecipeInBasket()}ngOnChanges(e){var t;if(this.recipe&&e.serves){const e=+this.recipe.modifiedGuests;this.recipe.modifiedGuests=this.serves,e!==this.serves&&this.updateRecipeGuests()}!this.recipe&&(null===(t=this.recipeName)||void 0===t?void 0:t.length)>0?this.subscriptions.push(this.searchRecipeByName().subscribe(e=>{this.recipe=e,e?(this.checkGuestsAndBasket(),this.cdr.detectChanges()):this.hidden.emit()})):!this.recipe&&this.recipeExtId?this.subscriptions.push(this.recipeService.searchRecipeByExtId(this.recipeExtId).subscribe(e=>{this.recipe=e,e?(this.contextService.noSupplier&&this.cdr.detectChanges(),this.checkGuestsAndBasket()):this.hidden.emit()})):this.checkRecipeInBasket()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}checkGuestsAndBasket(){var e;this.recipe&&(this.recipe.modifiedGuests=this.serves||+(null===(e=this.recipe)||void 0===e?void 0:e.guests),this.checkRecipeInBasket())}checkRecipeInBasket(){!this.basketSubscription&&this.recipe&&(this.basketSubscription=this.basketsService.recipeIsInBasket(this.recipe.id).subscribe(e=>{this.inBasket=e,this.cdr.detectChanges()}),this.subscriptions.push(this.basketSubscription))}searchRecipeByName(){return this.contextService.origin.pipe(bp(e=>!e),fp(1),th(e=>this.recipeService.all({remotefilter:{recipe_provider_id:e,search:this.recipeName}}).pipe(E(e=>{var t;return(null===(t=e.data[0])||void 0===t?void 0:t.attributes.title)===this.recipeName?e.data[0]:null}))))}currentPath(){return""}openRecipe(e){e.stopPropagation(),this.clicked.emit(),this.contextService.mealzInternal.recipes.openDetails(this.recipe.id,this.recipe.modifiedGuests,0),this.analyticsService.sendEvent("recipe.display",this.path,{recipe_id:this.recipe.id,category_id:this.originTrace.props.category_id}),this.displayed.emit()}sendShowEvent(){this.analyticsService.sendEvent("recipe.show",this.path,{recipe_id:this.recipe.id,category_id:this.originTrace.props.category_id})}updateRecipeGuests(){this.basketsService.updateRecipesInBasket([this.recipe.id],this.recipe.modifiedGuests,{originPath:"",props:{recipe_id:this.recipe.id}})}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(__),vo(C_),vo(Yf),vo(Vf),vo(Iv),vo(Zf))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-card-cta"]],inputs:{recipeName:"recipeName",recipeExtId:"recipeExtId",recipe:"recipe",serves:"serves",previewAllowed:"previewAllowed",helpButtonAllowed:"helpButtonAllowed",displayGuests:"displayGuests"},outputs:{displayed:"displayed",clicked:"clicked",hidden:"hidden"},features:[eo,at],decls:1,vars:1,consts:[["class","miam-recipe-card-cta",4,"ngIf"],[1,"miam-recipe-card-cta"],[1,"miam-recipe-card-cta__button","mealz-ds-button",3,"disabled","ngClass","click"],[4,"ngIf","ngIfElse"],["seeIngredients",""],["alt","basket icon","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Basket.svg"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/InCart_primary.svg","alt","see ingredients"]],template:function(e,t){1&e&&fo(0,mC,6,10,"div",0),2&e&&bo("ngIf",t.recipe)},directives:[Ou,Du],pipes:[Wu],styles:[".miam-recipe-card-cta{display:flex;justify-content:center;width:-moz-max-content;width:max-content}.miam-recipe-card-cta button{padding:12px 16px}.miam-recipe-card-cta button .mealz-ds-loader{width:20px;height:20px}.miam-recipe-card-cta button.mealz-ds-button.secondary.in-basket:hover:not(.loading):not(.disabled):not([disabled]){background-color:inherit;color:inherit}"],encapsulation:2,changeDetection:0}),e})();function fC(e,t){if(1&e&&Co(0,"ng-miam-like-button",31),2&e){const e=Fo(3);bo("recipe",e.recipe)("originTrace",e.eventTrace)}}function _C(e,t){if(1&e&&(wo(0,"div",30),fo(1,fC,1,2,"ng-miam-like-button",26),Ec(2,"async"),ko()),2&e){const e=Fo(2);Nr(1),bo("ngIf",!e.displayLikesBottom&&Ic(2,1,e.userService.isLogged$))}}function vC(e,t){1&e&&Co(0,"ng-miam-recipe-promotion-badge")}function bC(e,t){if(1&e&&(wo(0,"div",35),Co(1,"img",36),ko()),2&e){const e=Fo(3);Nr(1),bo("src",e.recipe.sponsorLogoUrl,Wn)}}function yC(e,t){if(1&e&&(wo(0,"div",32),fo(1,vC,1,0,"ng-miam-recipe-promotion-badge",33),fo(2,bC,2,1,"div",34),ko()),2&e){const e=Fo(2);Nr(1),bo("ngIf",!e.displayBadge&&e.isInPromotion),Nr(1),bo("ngIf",e.recipe.sponsorLogoUrl)}}function wC(e,t){1&e&&Co(0,"ng-miam-recipe-promotion-badge")}function kC(e,t){1&e&&Co(0,"img",40)}function CC(e,t){1&e&&Co(0,"img",41)}function SC(e,t){if(1&e&&(wo(0,"div",37),fo(1,wC,1,0,"ng-miam-recipe-promotion-badge",33),fo(2,kC,1,0,"img",38),fo(3,CC,1,0,"img",39),ko()),2&e){const e=Fo(2);bo("ngClass",e.isDrink?"drink":"food"),Nr(1),bo("ngIf",e.isInPromotion),Nr(1),bo("ngIf",!e.isDrink),Nr(1),bo("ngIf",e.isDrink)}}function xC(e,t){if(1&e&&(wo(0,"div",47),Qo(1),ko()),2&e){const e=Fo(3);Nr(1),Ko(" + ",e.recipe.modifiedIngredients.length-2," ")}}function EC(e,t){if(1&e){const e=Io();wo(0,"div",42),wo(1,"div",43),wo(2,"img",44),Ao("error",(function(t){Rt(e);const i=Fo(2);return t.target.src=i.contextService.defaultIngredientPicture})),ko(),ko(),wo(3,"div",43),wo(4,"img",45),Ao("error",(function(t){Rt(e);const i=Fo(2);return t.target.src=i.contextService.defaultIngredientPicture})),ko(),ko(),fo(5,xC,2,1,"div",46),ko()}if(2&e){const e=Fo(2);Nr(2),bo("src",e.ingredientPicture(e.recipe.modifiedIngredients[0]),Wn),Nr(2),bo("src",e.ingredientPicture(e.recipe.modifiedIngredients[1]),Wn),Nr(1),bo("ngIf",e.recipe.modifiedIngredients.length>2)}}function IC(e,t){if(1&e&&(wo(0,"div",51),Co(1,"img",52),wo(2,"span",53),Qo(3),ko(),ko()),2&e){const e=Fo(3);Nr(3),Yo(e.recipeService.difficultyLevels[e.recipe.difficulty-1].label)}}function PC(e,t){if(1&e&&(wo(0,"div",54),Co(1,"img",55),wo(2,"span",53),Qo(3),ko(),ko()),2&e){const e=Fo(3);Nr(3),Yo(e.recipe.totalTime)}}function DC(e,t){if(1&e&&(wo(0,"div",48),fo(1,IC,4,1,"div",49),fo(2,PC,4,1,"div",50),ko()),2&e){const e=Fo(2);Nr(1),bo("ngIf",e.recipe.difficulty),Nr(1),bo("ngIf",e.recipe.totalTime)}}function TC(e,t){1&e&&Co(0,"ng-miam-recipe-promotion-badge",56)}function AC(e,t){if(1&e){const e=Io();wo(0,"div",57),wo(1,"ng-miam-recipe-pricing",58),Ao("priceSet",(function(t){return Rt(e),Fo(2).updateIsInPromotion(t)})),ko(),ko()}if(2&e){const e=Fo(2);Nr(1),bo("recipeId",e.recipe.id)("serves",e.recipe.modifiedGuests||+e.recipe.guests)("inViewport",e.inViewport)}}function RC(e,t){if(1&e&&Co(0,"ng-miam-like-button",31),2&e){const e=Fo(2);bo("recipe",e.recipe)("originTrace",e.eventTrace)}}function OC(e,t){if(1&e){const e=Io();wo(0,"ng-miam-recipe-card-cta",59),Ao("displayed",(function(){return Rt(e),Fo(2).displayed.emit()}))("clicked",(function(t){return Rt(e),Fo(2).primaryButtonClicked$.emit(t)})),ko()}if(2&e){const e=Fo(2);bo("recipe",e.recipe)("previewAllowed",e.previewAllowed)("displayGuests",e.displayGuests)("helpButtonAllowed",e.helpButtonAllowed)("originTrace",e.eventTrace)}}function FC(e,t){if(1&e){const e=Io();wo(0,"div",60),wo(1,"button",61),Ao("click",(function(){return Rt(e),Fo(2).openCatalog.emit()})),wo(2,"span"),Qo(3,"tradof#Changer#"),ko(),ko(),wo(4,"button",62),Ao("click",(function(){return Rt(e),Fo(2).removeFromMealsPlanner.emit()})),Co(5,"ng-miam-icon",63),ko(),ko()}if(2&e){const e=Fo(2);Nr(5),bo("iconName",e.icon.Trash)}}function BC(e,t){if(1&e){const e=Io();wo(0,"button",61),Ao("click",(function(){Rt(e);const t=Fo(2);return t.addToMealsPlanner.emit(t.recipe)})),wo(1,"span"),Qo(2,"Ad\u0103uga\u021bi"),ko(),ko()}}function MC(e,t){if(1&e){const e=Io();wo(0,"div",2),Ao("inViewport",(function(){return Rt(e),Fo().cardInViewport()})),wo(1,"div",3),Ao("click",(function(){return Rt(e),Fo().openRecipe()})),wo(2,"div",4),wo(3,"img",5),Ao("error",(function(t){Rt(e);const i=Fo();return t.target.src=i.contextService.defaultRecipePicture})),ko(),ko(),Co(4,"div",6),wo(5,"div",7),wo(6,"div",8),fo(7,_C,3,3,"div",9),fo(8,yC,3,2,"div",10),fo(9,SC,4,4,"div",11),ko(),wo(10,"div",12),wo(11,"div",13),wo(12,"span"),Qo(13),ko(),ko(),wo(14,"div",14),wo(15,"span",15),Qo(16),ko(),Co(17,"img",16),ko(),ko(),ko(),ko(),wo(18,"div",17),fo(19,EC,6,3,"div",18),wo(20,"div",19),wo(21,"div",20),fo(22,DC,3,2,"div",21),wo(23,"div",22),fo(24,TC,1,0,"ng-miam-recipe-promotion-badge",23),fo(25,AC,2,3,"div",24),ko(),ko(),wo(26,"div",25),fo(27,RC,1,2,"ng-miam-like-button",26),Ec(28,"async"),fo(29,OC,1,5,"ng-miam-recipe-card-cta",27),ko(),fo(30,FC,6,1,"div",28),fo(31,BC,3,0,"button",29),ko(),ko(),ko()}if(2&e){const e=Fo();bo("threshold",0)("debounceTime",0),Nr(3),bo("src",null==e.recipe?null:e.recipe.attributes["media-url"],Wn)("alt",(null==e.recipe?null:e.recipe.attributes.title)+" picture"),Nr(4),bo("ngIf",!(e.displayBadge&&e.recipe.sponsorLogoUrl)),Nr(1),bo("ngIf",!e.displayBadge&&e.isInPromotion||e.recipe.sponsorLogoUrl),Nr(1),bo("ngIf",e.displayBadge),Nr(4),Yo(e.recipe.attributes.title),Nr(3),Yo(e.recipe.modifiedGuests||e.recipe.guests),Nr(3),bo("ngIf",e.contextService.displayIngredientPicturesOnRecipeCards&&(null==e.recipe||null==e.recipe.modifiedIngredients?null:e.recipe.modifiedIngredients.length)>1),Nr(3),bo("ngIf",e.displayInfos&&(e.recipe.difficulty||e.recipe.totalTime)),Nr(2),bo("ngIf",e.isInPromotion),Nr(1),bo("ngIf",e.recipe&&e.displayPricing),Nr(2),bo("ngIf",e.displayLikesBottom&&Ic(28,17,e.userService.isLogged$)),Nr(2),bo("ngIf",e.previewAllowed&&!e.addRecipeMode&&!e.replaceMode),Nr(1),bo("ngIf",e.replaceMode),Nr(1),bo("ngIf",e.addRecipeMode)}}function LC(e,t){if(1&e){const e=Io();wo(0,"div",2),Ao("inViewport",(function(){return Rt(e),Fo().cardInViewport()})),wo(1,"a",64),Co(2,"img",65),wo(3,"div",66),wo(4,"div",67),wo(5,"span"),Qo(6,"tradof#Besoin d'inspiration ?#"),ko(),ko(),wo(7,"button",68),wo(8,"span"),Qo(9,"tradof#D\xe9couvrez nos recettes#"),ko(),ko(),ko(),ko(),ko()}if(2&e){const e=Fo();bo("threshold",0)("debounceTime",0),Nr(1),bo("href",e.contextService.catalogUrl,Wn)}}const $C=function(e,t,i,n,r){return{"variant-1":e,"variant-2":t,"variant-3":i,"in-basket":n,"redirect-card":r}},jC=["recipe-provider","sponsors","tags"],zC={recipes:["title","number-of-guests","media-url","video-id","filigrane-logo-url","difficulty","preparation-time","cooking-time","resting-time",...jC],sponsors:["logo-url"],tags:["tag-type-id"],"recipe-provider":["name"]};let NC=(()=>{class e extends jy{constructor(e,t,i,n,r,s,o,a){super(e),this.cdr=t,this.recipeService=i,this.basketsService=n,this.userService=r,this.contextService=s,this.element=o,this.loadLitDrawerService=a,this.previewAllowed=!0,this.helpButtonAllowed=!0,this.displayInfos=!1,this.displayPricing=!0,this.displayGuests=!0,this.addRecipeMode=!1,this.replaceMode=!1,this.displayVariant=1,this.removedFromFavorite=new Rc,this.displayed=new Rc,this.removeFromMealsPlanner=new Rc,this.addToMealsPlanner=new Rc,this.openCatalog=new Rc,this.hide=new Rc,this.icon=Cv,this.actionsOpened=!1,this.isloaded=!1,this.inBasket=!1,this.inViewport=!1,this.isDrink=!1,this.isInPromotion=!1,this.displayLikesBottom=!1,this.displayBadge=!1,this.primaryButtonClicked$=new Rc,this.subscriptions=[]}ngOnInit(){this.subscriptions.push(this.recipeService.displayedRecipeChanged$.subscribe(()=>this.cdr.detectChanges()))}currentPath(){return""}ngOnChanges(e){this.updateDisplayVariant(),this.recipe?this.afterRecipeLoad(this.recipe):this.recipeId?this.loadRecipeFromId():e.productIds&&!this.randomModeEnable&&this.loadRecipeFromContext()}ngAfterViewInit(){this.subscriptions.push(this.basketsService.basket$.subscribe(()=>this.cdr.detectChanges())),this.subscriptions.push(this.recipeService.reloadRecipes$.subscribe(e=>{e&&this.cdr.detectChanges()}))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}updateDisplayVariant(){switch(this.displayVariant){case 2:this.displayBadge=!0,this.displayLikesBottom=!1;break;case 3:this.displayBadge=!0,this.displayLikesBottom=!0;break;default:this.displayBadge=!1,this.displayLikesBottom=!1}}openRecipe(){this.contextService.mealzInternal.recipes.openDetails(this.recipe.id,this.recipe.modifiedGuests,0),this.displayed.emit()}ingredientPicture(e){return e.picture||this.contextService.defaultIngredientPicture}sendShowEvent(){this.analyticsService.sendEvent("recipe.show",this.path,{recipe_id:this.recipe.id,category_id:this.originTrace.props.category_id})}cardInViewport(){this.inViewport=!0,this.cdr.detectChanges()}updateIsInPromotion(e){this.isInPromotion=e["discounted-ingredients-count"]>0,this.cdr.detectChanges()}loadRecipeFromId(){this.subscriptions.push(this.recipeService.get(this.recipeId,{include:jC,fields:zC}).pipe(bp(e=>e.is_loading),Wh(e=>(this.hide.emit(),td(e)))).subscribe(e=>{this.afterRecipeLoad(e)}))}loadRecipeFromContext(){this.subscriptions.push(this.fetchSuggestionOrRandom().pipe(bp(e=>!e),Wh(e=>(this.hide.emit(),td(e)))).subscribe(e=>{(null==e?void 0:e.length)>0?this.afterRecipeLoad(e[0]):(this.isloaded=!0,this.hide.emit(),this.cdr.detectChanges())}))}afterRecipeLoad(e){this.recipe=e,this.updateGuestsIfNecessary(),this.checkRecipeInBasket(),this.checkIsDrink(),this.isloaded=!0,this.cdr.detectChanges()}fetchSuggestionOrRandom(){return this.randomModeEnable?this.recipeService.getRandom(jC,zC):this.recipeService.getSuggestionFromContext(this.productIds,jC,zC)}updateGuestsIfNecessary(){this.subscriptions.push(this.basketsService.recipeIsInBasket(this.recipe.id).pipe(fp(1)).subscribe(e=>{e&&!this.recipe.modifiedGuests?this.recipe.modifiedGuests=this.serves||this.basketsService.guestsForRecipe(this.recipe.id)||+this.recipe.guests:this.recipe.modifiedGuests||(this.recipe.modifiedGuests=this.serves||+this.recipe.guests),this.cdr.detectChanges()}))}checkRecipeInBasket(){!this.basketSubscription&&this.recipe&&(this.basketSubscription=this.basketsService.recipeIsInBasket(this.recipe.id).subscribe(e=>{this.inBasket=e,this.cdr.detectChanges()}),this.subscriptions.push(this.basketSubscription))}checkIsDrink(){var e,t;const i=(null===(t=null===(e=this.recipe)||void 0===e?void 0:e.relationships.tags)||void 0===t?void 0:t.data)||[];this.isDrink=i.some(e=>["meal_type_boisson","meal_type_cocktail"].includes(e.id))}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(__),vo(C_),vo(Yf),vo(Iv),vo(wa),vo(uC))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-card"]],inputs:{recipeId:"recipeId",recipe:"recipe",randomModeEnable:"randomModeEnable",productIds:"productIds",previewAllowed:"previewAllowed",helpButtonAllowed:"helpButtonAllowed",displayInfos:"displayInfos",displayPricing:"displayPricing",displayGuests:"displayGuests",addRecipeMode:"addRecipeMode",replaceMode:"replaceMode",displayVariant:"displayVariant",serves:"serves"},outputs:{removedFromFavorite:"removedFromFavorite",displayed:"displayed",removeFromMealsPlanner:"removeFromMealsPlanner",addToMealsPlanner:"addToMealsPlanner",openCatalog:"openCatalog",hide:"hide"},features:[eo,at],decls:3,vars:10,consts:[["ngMiamInViewport","",1,"miam-recipe-card",3,"condition","ngClass","inViewport"],["class","miam-recipe-card__container","ngMiamInViewport","",3,"threshold","debounceTime","inViewport",4,"ngIf"],["ngMiamInViewport","",1,"miam-recipe-card__container",3,"threshold","debounceTime","inViewport"],[1,"miam-recipe-card__top",3,"click"],[1,"miam-recipe-card__picture"],["loading","lazy","aria-hidden","true",3,"src","alt","error"],[1,"miam-recipe-card__gradient"],[1,"miam-recipe-card__content"],[1,"miam-recipe-card__top-container"],["class","miam-recipe-card__like",4,"ngIf"],["class","miam-recipe-card_sponso_and_promo_badge",4,"ngIf"],["class","miam-recipe-card__badge-container",3,"ngClass",4,"ngIf"],[1,"miam-recipe-card__picture__bottom"],[1,"miam-recipe-card__title","mealz-ds-text","weight-xxl","size-m"],[1,"miam-recipe-card__counter"],[1,"mealz-ds-text","weight-xxl","size-m"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/recipe-counter.svg","alt","people"],[1,"miam-recipe-card__bottom"],["class","miam-recipe-card__ingredients__pictures",4,"ngIf"],[1,"miam-recipe-card__actions"],[1,"miam-recipe-card__infos"],["class","miam-recipe-card__difficulty-and-time",4,"ngIf"],[1,"miam-recipe-card__price-and-promotion"],["class","miam-recipe-card__bottom-promotion",4,"ngIf"],["class","miam-recipe-card__price",4,"ngIf"],[1,"miam-recipe-card__cta"],["class","miam-recipe-card__actions__icon",3,"recipe","originTrace",4,"ngIf"],[3,"recipe","previewAllowed","displayGuests","helpButtonAllowed","originTrace","displayed","clicked",4,"ngIf"],["class","miam-recipe-card__actions__replace",4,"ngIf"],["class","mealz-ds-button ghost",3,"click",4,"ngIf"],[1,"miam-recipe-card__like"],[1,"miam-recipe-card__actions__icon",3,"recipe","originTrace"],[1,"miam-recipe-card_sponso_and_promo_badge"],[4,"ngIf"],["class","miam-recipe-card__sponsor-container",4,"ngIf"],[1,"miam-recipe-card__sponsor-container"],["alt","sponsor picture",1,"miam-recipe-card__sponsor-picture",3,"src"],[1,"miam-recipe-card__badge-container",3,"ngClass"],["class","miam-recipe-card__badge","src","https://storage.googleapis.com/assets.miam.tech/generic/images/recipe_card-badge.svg","alt","recipe badge",4,"ngIf"],["class","miam-recipe-card__badge","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/9.0/recipe-card-badge-drinks.svg","alt","drink badge",4,"ngIf"],["src","https://storage.googleapis.com/assets.miam.tech/generic/images/recipe_card-badge.svg","alt","recipe badge",1,"miam-recipe-card__badge"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/9.0/recipe-card-badge-drinks.svg","alt","drink badge",1,"miam-recipe-card__badge"],[1,"miam-recipe-card__ingredients__pictures"],[1,"miam-recipe-card__ingredients__picture"],["alt","first ingredient picture",3,"src","error"],["alt","second ingredient picture",3,"src","error"],["class","miam-recipe-card__ingredients__more",4,"ngIf"],[1,"miam-recipe-card__ingredients__more"],[1,"miam-recipe-card__difficulty-and-time"],["class","miam-recipe-card__difficulty",4,"ngIf"],["class","miam-recipe-card__time",4,"ngIf"],[1,"miam-recipe-card__difficulty"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/ChefHat.svg","alt","difficulty"],[1,"mealz-ds-text","size-s","weight-m"],[1,"miam-recipe-card__time"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Clock.svg","alt","time"],[1,"miam-recipe-card__bottom-promotion"],[1,"miam-recipe-card__price"],[1,"mealz-ds-text","weight-xxl",3,"recipeId","serves","inViewport","priceSet"],[3,"recipe","previewAllowed","displayGuests","helpButtonAllowed","originTrace","displayed","clicked"],[1,"miam-recipe-card__actions__replace"],[1,"mealz-ds-button","ghost",3,"click"],[1,"mealz-ds-button","ghost","square",3,"click"],["primaryColor","var(--m-color-primary)",3,"iconName"],[1,"miam-recipe-card__redirect",3,"href"],["src","https://storage.googleapis.com/assets.miam.tech/generic/images/Suggestion_Redirect_Background.png"],[1,"miam-recipe-card__redirect__footer"],[1,"miam-recipe-card__redirect__title","mealz-ds-text","size-l","weight-xxl"],[1,"miam-recipe-card__redirect__button","mealz-ds-button","primary"]],template:function(e,t){1&e&&(wo(0,"div",0),Ao("inViewport",(function(){return t.sendShowEvent()})),fo(1,MC,32,19,"div",1),fo(2,LC,10,3,"div",1),ko()),2&e&&(bo("condition",!!t.recipe)("ngClass",kc(4,$C,2!==t.displayVariant&&3!==t.displayVariant,2===t.displayVariant,3===t.displayVariant,t.inBasket,t.isloaded&&!t.recipe)),Nr(1),bo("ngIf",t.recipe),Nr(1),bo("ngIf",t.isloaded&&!t.recipe))},directives:[Ab,Du,Ou,Vy,Vw,zw,gC,$y],pipes:[Wu],styles:[".miam-recipe-card{position:relative;display:flex;width:var(--m-catalog-card-width,308px);height:500px;flex-direction:column;align-items:flex-start;flex-shrink:0;border-radius:8px;overflow:hidden;cursor:pointer}.miam-recipe-card .miam-recipe-card__container{display:flex;flex-direction:column;height:100%;width:100%;flex-shrink:0;align-self:stretch}.miam-recipe-card .miam-recipe-card__container:hover .miam-recipe-card__top .miam-recipe-card__picture img{transform:scale(1.1)}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top{position:relative;flex:1;height:calc(100% - 72px)}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__picture{width:100%;height:100%;overflow:hidden}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__picture img{display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover;transition:transform .2s}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__gradient{position:absolute;width:100%;height:100%;top:0;left:0;background:linear-gradient(180deg,transparent 43.67%,rgba(0,0,0,.4) 91.33%)}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-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}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding:12px;box-sizing:border-box}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom .miam-recipe-card__title{color:var(--mealz-ds-color-neutral-white,#fff);text-shadow:0 2px 8px rgba(0,0,0,.15);text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom .miam-recipe-card__counter{display:flex;padding:4px 8px;align-items:center;border-radius:100px;background:var(--mealz-ds-color-neutral-white,#fff);color:var(--miam-color-neutral-black);height:-moz-fit-content;height:fit-content;flex-shrink:0}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom .miam-recipe-card__counter>:not(:last-child){margin-right:4px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom .miam-recipe-card__counter span{line-height:100%}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom .miam-recipe-card__counter img{width:16px;height:16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container{display:flex;flex-direction:row-reverse;justify-content:space-between;margin:12px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__sponsor-container{display:flex;padding:8px 12px;background-color:#fff;border-radius:100px;width:auto;height:auto;box-sizing:border-box}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__sponsor-container .miam-recipe-card__sponsor-picture{width:auto;height:auto;max-width:80px;max-height:40px;-o-object-fit:contain;object-fit:contain}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__badge-container,.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card_sponso_and_promo_badge{display:flex;flex-direction:column;align-items:flex-start}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__badge-container>:not(:last-child),.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card_sponso_and_promo_badge>:not(:last-child){margin-bottom:4px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__like .miam-like-button{border-radius:48px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__like .miam-like-button.mealz-ds-button.primary.reverse.square.small .miam-like-button__icon{height:16px;width:16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom{display:flex;width:100%;height:72px;flex-direction:column;align-items:flex-start;justify-content:center;box-sizing:border-box;padding:12px;border-radius:0 0 8px 8px;background-color:var(--mealz-ds-color-neutral-white,#fff);border-right:1px solid var(--m-color-neutral-200,#d9dde1);border-bottom:1px solid var(--m-color-neutral-200,#d9dde1);border-left:1px solid var(--m-color-neutral-200,#d9dde1)}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions{display:flex;justify-content:space-between;align-items:center;align-self:stretch}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions>:not(:last-child){margin-right:8px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__infos{display:flex;flex-direction:column;align-items:flex-start}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__infos .miam-recipe-card__price-and-promotion .miam-recipe-card__bottom-promotion{display:none}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__cta{display:flex;flex-direction:row;align-items:center}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__cta>:not(:last-child){margin-right:16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time{display:flex;flex-direction:row;color:var(--mealz-ds-color-text-disabled);margin-bottom:4px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time>:not(:last-child){margin-right:12px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time .miam-recipe-card__difficulty,.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time .miam-recipe-card__time{display:flex}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time .miam-recipe-card__difficulty img,.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time .miam-recipe-card__time img{margin-right:4px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__price{color:var(--mealz-ds-color-primary);line-height:100%;margin-right:4px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__price .miam-recipe-pricing{max-width:70px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__price .miam-recipe-pricing .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__subline{color:rgba(31,53,67,.5);font-weight:500;line-height:100%}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__actions__replace{display:flex;flex:1;justify-content:space-between;align-items:center}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect{display:flex;flex-direction:column;justify-content:flex-end;flex:1;border-radius:8px;border:1px solid var(--m-color-neutral-200,#d9dde1);box-sizing:border-box;text-decoration:unset}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect img{height:100%;-o-object-fit:cover;object-fit:cover}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect .miam-recipe-card__redirect__footer{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect .miam-recipe-card__redirect__footer .miam-recipe-card__redirect__button{margin-top:16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect .miam-recipe-card__redirect__footer .miam-recipe-card__redirect__button span{font-size:14px;font-weight:700;line-height:16px}@media (max-width:1023px){.miam-recipe-card.redirect-card{width:80vw;height:188px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect{flex-direction:row;height:100%}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect img{content:url(https://storage.googleapis.com/assets.miam.tech/generic/images/Suggestion_Redirect_Background_Mobile.png);height:136%;margin:-22px -16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect .miam-recipe-card__redirect__footer{min-width:156px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect .miam-recipe-card__redirect__footer .miam-recipe-card__redirect__title{font-size:16px}}"],encapsulation:2,changeDetection:0}),e})(),VC=(()=>{class e{constructor(e){const t={"add-recipe-card":lC,"recipe-card":NC,"recipe-card-cta":gC};Object.keys(t).map(i=>{const n="webc-miam-"+i;if(!customElements.get(n)){const r=uh(t[i],{injector:e});customElements.define(n,r)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,Lk,$k,jk]]}),e})();const HC=["categoryContent"],UC=["categoryCards"];function qC(e,t){1&e&&(wo(0,"div",14),Co(1,"div",15),wo(2,"div"),Qo(3,"\nSe \xeencarc\u0103 rezultatele... "),ko(),ko())}function GC(e,t){if(1&e&&Co(0,"ng-miam-recipe-card",16),2&e){const e=t.$implicit,i=Fo(2);bo("recipe",e)("displayInfos",i.displayInfos)("displayPricing",i.displayPricing)("displayVariant",i.displayRecipeVariant)("originTrace",i.eventTrace)}}function WC(e,t){if(1&e){const e=Io();wo(0,"div",1),Ao("inViewport",(function(){return Rt(e),Fo().sendShowEvent()})),wo(1,"div",2),wo(2,"div",3),Ao("click",(function(){return Rt(e),Fo().displayListMode()})),Qo(3),ko(),wo(4,"div",4),wo(5,"div",5),Qo(6),ko(),wo(7,"div",6),Ao("click",(function(){return Rt(e),Fo().displayListMode()})),wo(8,"span"),Qo(9,"Vede\u021bi totul"),ko(),Co(10,"img",7),ko(),ko(),ko(),wo(11,"div",8,9),wo(13,"div",10,11),fo(15,qC,4,0,"div",12),Ec(16,"async"),fo(17,GC,1,5,"ng-miam-recipe-card",13),ko(),ko(),ko()}if(2&e){const e=Fo();bo("condition",e.recipes.length>0),Nr(3),Yo(e.title),Nr(3),Yo(e.subtitle),Nr(9),bo("ngIf",Ic(16,6,e.loading)),Nr(2),bo("ngForOf",e.recipes)("ngForTrackBy",e.trackByFn)}}const ZC=["recipe-provider","sponsors","tags"],QC={recipes:["title","number-of-guests","media-url","video-id","filigrane-logo-url","difficulty","preparation-time","cooking-time","resting-time",...ZC],sponsors:["logo-url"],tags:["tag-type-id"],"recipe-provider":["name"]};let YC=(()=>{class e extends jy{constructor(e,t,i,n){super(e),this.recipesService=t,this.context=i,this.cdr=n,this.title="",this.maxRecipeNumber=20,this.displayInfos=!1,this.displayPricing=!0,this.displayRecipeVariant=1,this.loading=new Rc(!0),this.isHidden=new Rc(!1),this.recipes=[],this.hide=!1,this.icon=Cv,this.displayList=new Rc,this.subscriptions=[],this.recipes=[]}get props(){var e,t;const i={};return(null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.filters.packages)&&(i.category_id=this.filters.additionalFilters.filters.packages),i}ngOnChanges(e){var t;(e.filters||e.maxRecipeNumber||e.modifiedGuests)&&this.subscriptions.push(this.loadRecipes().pipe((t=()=>{this.hide=0===this.recipes.length,this.hide&&this.isHidden.emit(!0),this.loading.emit(!1),this.cdr.detectChanges()},e=>e.lift(new aC(t)))).subscribe())}sendShowEvent(){this.analyticsService.sendEvent("category.show",this.path,{category_id:this.filters.additionalFilters.filters.packages})}currentPath(){return""}loadRecipes(){return this.filters?(this.context.displayIngredientPicturesOnRecipeCards&&!ZC.includes("ingredients")&&(ZC.push("ingredients"),QC.recipes.push("ingredients"),QC.ingredients=["name","quantity","unit","active","forced-eans","picture-url","position"]),this.recipesService.addMandatoryCompletionToFilter(this.filters).pipe(th(e=>this.recipesService.filter(e,{number:1,size:this.maxRecipeNumber>0?this.maxRecipeNumber<30?this.maxRecipeNumber:30:0},ZC,QC,this.modifiedGuests,!1,"position")),df(e=>this.recipes=e))):td([])}displayListMode(){this.analyticsService.sendEvent("category.display",this.path,{category_id:this.filters.additionalFilters.filters.packages}),this.displayList.emit({title:this.title,filters:this.filters.additionalFilters.filters,subtitle:this.subtitle})}trackByFn(e,t){return t.id}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(__),vo(Iv),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-catalog-category"]],viewQuery:function(e,t){if(1&e&&(Uc(HC,1),Uc(UC,1),Uc(NC,1)),2&e){let e;Hc(e=qc())&&(t.categoryContent=e.first),Hc(e=qc())&&(t.categoryCards=e.first),Hc(e=qc())&&(t.recipeCards=e)}},inputs:{filters:"filters",title:"title",subtitle:"subtitle",maxRecipeNumber:"maxRecipeNumber",modifiedGuests:"modifiedGuests",displayInfos:"displayInfos",displayPricing:"displayPricing",displayRecipeVariant:"displayRecipeVariant"},outputs:{displayList:"displayList",loading:"loading",isHidden:"isHidden"},features:[eo,at],decls:1,vars:1,consts:[["class","miam-catalog-category","ngMiamInViewport","",3,"condition","inViewport",4,"ngIf"],["ngMiamInViewport","",1,"miam-catalog-category",3,"condition","inViewport"],[1,"miam-catalog-category__header"],[1,"miam-catalog-category__title",3,"click"],[1,"miam-catalog-category__header__bottom"],[1,"miam-catalog-category__subtitle","mealz-ds-text","size-s","weight-l"],[1,"miam-catalog-category__link","mealz-ds-text","size-s","weight-xl",3,"click"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg","alt","Arrow"],[1,"miam-catalog-category__content"],["categoryContent",""],[1,"miam-catalog-category__cards"],["categoryCards",""],["class","miam-catalog-category__loader",4,"ngIf"],[3,"recipe","displayInfos","displayPricing","displayVariant","originTrace",4,"ngFor","ngForOf","ngForTrackBy"],[1,"miam-catalog-category__loader"],[1,"miam-ds-loader"],[3,"recipe","displayInfos","displayPricing","displayVariant","originTrace"]],template:function(e,t){1&e&&fo(0,WC,18,8,"div",0),2&e&&bo("ngIf",!t.hide)},directives:[Ou,Ab,Au,NC],pipes:[Wu],styles:[".miam-catalog-category{display:flex;flex-direction:column;margin:20px 0}.miam-catalog-category .miam-catalog-category__header{display:flex;flex-direction:column;margin-bottom:16px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__title{width:-moz-fit-content;width:fit-content;margin-bottom:4px;font-size:24px;line-height:34px;font-weight:700;cursor:pointer}@media (min-width:1024px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__title:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__header__bottom{display:flex;align-items:center;justify-content:space-between;width:100%}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__header__bottom .miam-catalog-category__subtitle{color:var(--mealz-ds-color-neutral-500)}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__header__bottom .miam-catalog-category__link{display:flex;align-items:center;color:var(--mealz-ds-color-primary);cursor:pointer;white-space:nowrap;margin-left:16px;margin-right:4px}@media (min-width:1024px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__header__bottom .miam-catalog-category__link:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__content{position:relative;overflow:hidden;padding:16px 0;width:100%;height:var(--m-catalog-card-height);box-sizing:content-box}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{display:flex;flex-direction:row;flex-wrap:wrap;transition-duration:.5s;margin:-8px}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards>*{margin:8px}@media (min-width:1025px){.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards ng-miam-recipe-card{flex:1;min-width:240px;max-width:308px;display:flex}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards ng-miam-recipe-card .miam-recipe-card{flex:1}}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards .miam-catalog-category__loader{width:100%;font-size:20px;font-weight:700;color:var(--m-color-grey-text);text-align:center}@media (max-width:1023px){.miam-catalog-category .miam-catalog-category__header{flex-direction:column;align-items:flex-start;margin:0 24px 8px}.miam-catalog-category .miam-catalog-category__content{overflow-x:auto;margin:16px 0}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{flex-wrap:nowrap;padding:0 24px}}"],encapsulation:2,changeDetection:0}),e})();const KC=function(e){return{active:e}};function JC(e,t){if(1&e){const e=Io();wo(0,"a",12),Ao("click",(function(){return Rt(e),Fo().returnButtonPressed.emit()})),wo(1,"span"),Qo(2,"Idei de mas\u0103"),ko(),ko()}if(2&e){const e=Fo();bo("ngClass",bc(1,KC,e.home))}}function XC(e,t){if(1&e){const e=Io();wo(0,"a",13),Ao("click",(function(){return Rt(e),Fo().returnButtonPressed.emit()})),Qo(1),ko()}if(2&e){const e=Fo();bo("ngClass",bc(2,KC,e.home)),Nr(1),Yo(e.homeLabel)}}function eS(e,t){1&e&&Co(0,"img",5)}function tS(e,t){1&e&&(wo(0,"span",21),Qo(1,"tradof#Votre recherche :#\xa0"),ko())}function iS(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo(2);Nr(1),Yo(e.searchTerm)}}function nS(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Mon carnet#"),ko())}function rS(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Favoris#"),ko())}function sS(e,t){if(1&e&&(wo(0,"div",22),fo(1,nS,2,0,"span",16),fo(2,rS,2,0,"span",16),ko()),2&e){const e=Fo(2);Nr(1),bo("ngIf",e.context.orderHistoryEnabled),Nr(1),bo("ngIf",!e.context.orderHistoryEnabled)}}function oS(e,t){1&e&&(wo(0,"span",23),Qo(1,"tradof#Toutes nos recettes#"),ko())}function aS(e,t){if(1&e&&(wo(0,"span",24),Qo(1),ko()),2&e){const e=Fo(2);Nr(1),Yo(e.additionalFiltersTitle)}}function cS(e,t){1&e&&(wo(0,"span",25),Qo(1,"Selec\u021bia dvs."),ko())}function lS(e,t){if(1&e&&(wo(0,"a",14),fo(1,tS,2,0,"span",15),fo(2,iS,2,1,"span",16),fo(3,sS,3,2,"div",17),fo(4,oS,2,0,"span",18),fo(5,aS,2,1,"span",19),fo(6,cS,2,0,"span",20),ko()),2&e){const e=Fo();bo("ngClass",bc(7,KC,!e.home)),Nr(1),bo("ngIf",e.isSearchPage()),Nr(1),bo("ngIf",e.isSearchPage()),Nr(1),bo("ngIf",e.isFavoritesPage()),Nr(1),bo("ngIf",e.isAllRecipesPage()),Nr(1),bo("ngIf",e.isCategoryPage()),Nr(1),bo("ngIf",e.isDefaultPage())}}function uS(e,t){if(1&e&&(wo(0,"div"),Qo(1),ko()),2&e){const e=Fo(2);Nr(1),Ko(" ",null==e.catalogSetting?null:e.catalogSetting.attributes["banner-text"]," ")}}function dS(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Id\xe9es repas en 1 clic#"),ko())}function hS(e,t){if(1&e&&(wo(0,"div",26),wo(1,"div",27),fo(2,uS,2,1,"div",28),fo(3,dS,2,0,"ng-template",null,29,Wc),ko(),ko()),2&e){const e=_o(4),t=Fo();Nr(2),bo("ngIf",(null==t.catalogSetting||null==t.catalogSetting.attributes["banner-text"]?null:t.catalogSetting.attributes["banner-text"].length)>0)("ngIfElse",e)}}function pS(e,t){if(1&e&&Co(0,"div",30),2&e){const e=Fo();Vo("background-image","url("+((null==e.catalogSetting||null==e.catalogSetting.attributes["banner-image"]?null:e.catalogSetting.attributes["banner-image"].length)>0?null==e.catalogSetting?null:e.catalogSetting.attributes["banner-image"]:e.pictureUrl)+")")}}const mS=function(e){return{reduced:e}};let gS=(()=>{class e{constructor(e,t){this.cdr=e,this.context=t,this.pictureUrl="",this.returnButtonPressed=new Rc,this.icon=Cv,this.searchString=""}ngOnChanges(){this.cdr.detectChanges()}isSearchPage(){return!this.home&&!this.history&&this.searchTerm&&this.searchTerm.length>0}isFavoritesPage(){return!this.home&&!this.isSearchPage()&&"Mes id\xe9es repas"===this.additionalFiltersTitle}isAllRecipesPage(){return!this.home&&!this.isSearchPage()&&!this.isFavoritesPage()&&"Toutes nos recettes"===this.additionalFiltersTitle}isCategoryPage(){var e;return!this.home&&!this.isSearchPage()&&!this.isFavoritesPage()&&!this.isAllRecipesPage()&&(null===(e=this.additionalFiltersTitle)||void 0===e?void 0:e.length)>0}isDefaultPage(){return!(this.home||this.isSearchPage()||this.isFavoritesPage()||this.isAllRecipesPage()||this.isCategoryPage())}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga),vo(Iv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-catalog-header"]],inputs:{home:"home",history:"history",searchTerm:"searchTerm",additionalFiltersTitle:"additionalFiltersTitle",homeLabel:"homeLabel",pictureUrl:"pictureUrl",catalogSetting:"catalogSetting"},outputs:{returnButtonPressed:"returnButtonPressed"},features:[at],decls:12,vars:9,consts:[[1,"miam-catalog-header",3,"ngClass"],[1,"miam-catalog-header__left"],[1,"miam-catalog-header__nav"],["href","/"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Home.svg","alt","Home"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Caret.svg","alt","Caret"],["href","javascript:void(0)","class","mealz-ds-text size-s weight-l",3,"ngClass","click",4,"ngIf"],["href","javascript:void(0)",3,"ngClass","click",4,"ngIf"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Caret.svg","alt","Caret",4,"ngIf"],["href","javascript:void(0)","class","mealz-ds-text size-s weight-xxl",3,"ngClass",4,"ngIf"],["class","miam-catalog-header__title-container",4,"ngIf"],["class","miam-catalog-header__right",3,"background-image",4,"ngIf"],["href","javascript:void(0)",1,"mealz-ds-text","size-s","weight-l",3,"ngClass","click"],["href","javascript:void(0)",3,"ngClass","click"],["href","javascript:void(0)",1,"mealz-ds-text","size-s","weight-xxl",3,"ngClass"],["class","miam-catalog-header__search-label",4,"ngIf"],[4,"ngIf"],["class","miam-catalog-header__favorites-label",4,"ngIf"],["class","miam-catalog-header__all-recipes-label",4,"ngIf"],["class","miam-catalog-header__category-label",4,"ngIf"],["class","miam-catalog-header__default-label",4,"ngIf"],[1,"miam-catalog-header__search-label"],[1,"miam-catalog-header__favorites-label"],[1,"miam-catalog-header__all-recipes-label"],[1,"miam-catalog-header__category-label"],[1,"miam-catalog-header__default-label"],[1,"miam-catalog-header__title-container"],[1,"miam-catalog-header__title"],[4,"ngIf","ngIfElse"],["baseTitle",""],[1,"miam-catalog-header__right"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"div",1),wo(2,"div",2),wo(3,"a",3),Co(4,"img",4),ko(),Co(5,"img",5),fo(6,JC,3,3,"a",6),fo(7,XC,2,4,"a",7),fo(8,eS,1,0,"img",8),fo(9,lS,7,9,"a",9),ko(),fo(10,hS,5,2,"div",10),ko(),fo(11,pS,1,2,"div",11),ko()),2&e&&(bo("ngClass",bc(7,mS,!t.home)),Nr(6),bo("ngIf",!t.homeLabel),Nr(1),bo("ngIf",t.homeLabel),Nr(1),bo("ngIf",!t.home),Nr(1),bo("ngIf",!t.home),Nr(1),bo("ngIf",t.home),Nr(1),bo("ngIf",t.home))},directives:[Du,Ou],styles:[".miam-catalog-header{position:relative;display:flex;width:100%;background-repeat:no-repeat;background-size:60% 100%;background-position:100% 0}.miam-catalog-header.reduced{background-image:none!important;background-color:var(--mealz-ds-color-neutral-white);border-bottom:1px solid var(--mealz-ds-color-border);box-sizing:border-box}.miam-catalog-header.reduced .miam-catalog-header__left{flex-direction:row;justify-content:space-between;align-items:center;max-width:unset;border-bottom:unset;padding:unset}.miam-catalog-header.reduced .miam-catalog-header__left .miam-catalog-header__nav{margin-bottom:0;width:100%;padding:16px 24px}.miam-catalog-header.reduced .miam-catalog-header__left .miam-catalog-header__title-container{width:auto;flex-grow:1;margin-left:24px}.miam-catalog-header.reduced .miam-catalog-header__right{background-image:none!important;flex:0;align-items:center;padding:unset;height:unset}.miam-catalog-header .miam-catalog-header__left{display:flex;flex-direction:column;align-items:flex-start;padding:32px 40px;flex:1;max-width:548px;border-bottom:1px solid var(--mealz-ds-color-border)}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__nav{display:flex;align-items:center;font-weight:700;margin-bottom:24px}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__nav>*{margin-right:4px;text-align:center}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__nav>a{display:flex;align-items:center;color:var(--mealz-ds-color-neutral-500);text-decoration:none;font-weight:500}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__nav>a.active{font-weight:900;color:var(--mealz-ds-color-primary)}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__title-container{width:100%}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__title{display:flex;font-size:40px;line-height:42px;font-weight:900;margin-bottom:24px;color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-catalog-header:not(.reduced) .miam-catalog-header__nav{display:none}.miam-catalog-header .miam-catalog-header__right{display:flex;flex-direction:row;align-items:flex-end;justify-content:flex-end;padding:32px 24px 24px 4px;height:164px;flex:1;background-size:cover;background-position:50%}@media (max-width:1023px){.miam-catalog-header.reduced{display:none}}@media (max-width:607px){.miam-catalog-header.reduced,.miam-catalog-header:not(.reduced){background-color:var(--mealz-ds-color-background-primary);border-bottom:1px solid var(--mealz-ds-color-border)}.miam-catalog-header.reduced .miam-catalog-header__left,.miam-catalog-header:not(.reduced) .miam-catalog-header__left{max-width:unset;padding:16px;border-bottom:unset}.miam-catalog-header.reduced .miam-catalog-header__left .miam-catalog-header__nav,.miam-catalog-header:not(.reduced) .miam-catalog-header__left .miam-catalog-header__nav{display:none}.miam-catalog-header.reduced .miam-catalog-header__left .miam-catalog-header__title-container,.miam-catalog-header:not(.reduced) .miam-catalog-header__left .miam-catalog-header__title-container{margin-left:0}.miam-catalog-header.reduced .miam-catalog-header__left .miam-catalog-header__title-container .miam-catalog-header__title,.miam-catalog-header:not(.reduced) .miam-catalog-header__left .miam-catalog-header__title-container .miam-catalog-header__title{font-size:24px;margin-bottom:0}.miam-catalog-header.reduced .miam-catalog-header__right,.miam-catalog-header:not(.reduced) .miam-catalog-header__right{background-image:none!important;justify-content:center}.miam-catalog-header:not(.reduced){flex-direction:column}.miam-catalog-header:not(.reduced) .miam-catalog-header__right{padding:0}.miam-catalog-header.reduced{padding:16px;box-sizing:border-box}.miam-catalog-header.reduced .miam-catalog-header__left,.miam-catalog-header.reduced .miam-catalog-header__right{padding:unset}}"],encapsulation:2,changeDetection:0}),e})();function fS(e,t){if(1&e){const e=Io();wo(0,"input",15),Ao("ngModelChange",(function(t){return Rt(e),Fo().searchString=t}))("keydown.enter",(function(){return Rt(e),Fo().emitSearchString()}))("blur",(function(){return Rt(e),Fo().emitSearchString()})),ko()}2&e&&bo("ngModel",Fo().searchString)}function _S(e,t){if(1&e){const e=Io();wo(0,"input",16),Ao("ngModelChange",(function(t){return Rt(e),Fo().searchString=t}))("keydown.enter",(function(){return Rt(e),Fo().emitSearchString()}))("blur",(function(){return Rt(e),Fo().emitSearchString()})),ko()}2&e&&bo("ngModel",Fo().searchString)}function vS(e,t){if(1&e&&(wo(0,"div",19),Qo(1),ko()),2&e){const e=Fo(2);Nr(1),Ko(" ",e.filterBadgeCount," ")}}const bS=function(e){return{hidden:e}};function yS(e,t){if(1&e){const e=Io();wo(0,"button",17),Ao("click",(function(){return Rt(e),Fo().filterButtonPressed.emit()})),Co(1,"img",18),fo(2,vS,2,1,"div",11),ko()}if(2&e){const e=Fo();bo("ngClass",bc(3,bS,e.hideButtons))("disabled",e.hideButtons),Nr(2),bo("ngIf",e.filterBadgeCount&&e.filterBadgeCount>0)}}function wS(e,t){if(1&e){const e=Io();wo(0,"button",20),Ao("click",(function(){return Rt(e),Fo().returnHomePressed.emit()})),Co(1,"img",21),ko()}}function kS(e,t){if(1&e&&(wo(0,"div",19),Qo(1),ko()),2&e){const e=Fo(2);Nr(1),Ko(" ",e.filterBadgeCount," ")}}function CS(e,t){if(1&e){const e=Io();wo(0,"button",17),Ao("click",(function(){return Rt(e),Fo().filterButtonPressed.emit()})),Co(1,"img",18),fo(2,kS,2,1,"div",11),ko()}if(2&e){const e=Fo();bo("ngClass",bc(3,bS,e.hideButtons))("disabled",e.hideButtons),Nr(2),bo("ngIf",e.filterBadgeCount>0)}}function SS(e,t){1&e&&(wo(0,"span",22),Qo(1,"Preferin\u021be"),ko())}function xS(e,t){if(1&e&&(wo(0,"div",19),Qo(1),ko()),2&e){const e=Fo();Nr(1),Ko(" ",e.preferencesBadgeCount," ")}}function ES(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Mon carnet#"),ko())}function IS(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Favoris#"),ko())}function PS(e,t){if(1&e&&(wo(0,"div",23),fo(1,ES,2,0,"span",24),fo(2,IS,2,0,"span",24),ko()),2&e){const e=Fo();Nr(1),bo("ngIf",e.context.orderHistoryEnabled),Nr(1),bo("ngIf",!e.context.orderHistoryEnabled)}}const DS=function(e){return{"hidden-reduced":e}},TS=function(e,t,i){return{hidden:e,"ghost square":t,full:i}};let AS=(()=>{class e{constructor(e,t,i){this.cdr=e,this.preferencesService=t,this.context=i,this.hideButtons=!1,this.filterBadgeCount=0,this.reduced=!1,this.filterButtonPressed=new Rc,this.favoritesButtonPressed=new Rc,this.preferencesButtonPressed=new Rc,this.searchStringChanged=new Rc,this.returnHomePressed=new Rc,this.searchString="",this.preferencesBadgeCount=0,this.subscriptions=[]}ngOnInit(){this.subscriptions.push(this.preferencesService.currentPreferencesNumber.subscribe(e=>{this.preferencesBadgeCount=e,this.cdr.detectChanges()}))}ngOnChanges(){this.cdr.detectChanges()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}resetSearchString(){this.searchString="",this.cdr.detectChanges()}emitSearchString(){this.cdr.detectChanges(),this.searchStringChanged.emit(this.searchString)}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga),vo(d_),vo(Iv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-catalog-toolbar"]],inputs:{home:"home",history:"history",searchTerm:"searchTerm",additionalFiltersTitle:"additionalFiltersTitle",hideButtons:"hideButtons",filterBadgeCount:"filterBadgeCount",reduced:"reduced"},outputs:{filterButtonPressed:"filterButtonPressed",favoritesButtonPressed:"favoritesButtonPressed",preferencesButtonPressed:"preferencesButtonPressed",searchStringChanged:"searchStringChanged",returnHomePressed:"returnHomePressed"},features:[at],decls:16,vars:26,consts:[[1,"miam-catalog-toolbar"],[1,"miam-catalog-toolbar__searchbar-container"],[1,"miam-catalog-toolbar__searchbar",3,"ngClass"],["type","text","placeholder","tradof#Je cherche mon repas pr\xe9f\xe9r\xe9#","class","mealz-catalog-toolbar__searchbar miam-ds-searchbar miam-ds-text size-s weight-l",3,"ngModel","ngModelChange","keydown.enter","blur",4,"ngIf"],["type","text","placeholder","tradof#Je cherche un ingr\xe9dient ou un repas#","class","mealz-catalog-toolbar__searchbar miam-ds-searchbar miam-ds-text size-s weight-l",3,"ngModel","ngModelChange","keydown.enter","blur",4,"ngIf"],["class","miam-catalog-toolbar__controls__filter mealz-ds-button ghost square",3,"ngClass","disabled","click",4,"ngIf"],["class","miam-recipe-toolbar__return-button mealz-ds-button ghost square",3,"click",4,"ngIf"],[1,"miam-catalog-toolbar__buttons-container"],[1,"mealz-ds-button","miam-catalog-toolbar__controls__preferences",3,"ngClass","disabled","click"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/cog_neutral.svg","alt","preference icon"],["class","miam-catalog-toolbar__controls__preferences-label",4,"ngIf"],["class","miam-catalog-toolbar__controls__filter-badge",4,"ngIf"],[1,"mealz-ds-button","miam-catalog-toolbar__controls__favorites",3,"ngClass","disabled","click"],["alt","Heart",3,"src"],["class","miam-catalog-toolbar__controls__favorites-label",4,"ngIf"],["type","text","placeholder","tradof#Je cherche mon repas pr\xe9f\xe9r\xe9#",1,"mealz-catalog-toolbar__searchbar","miam-ds-searchbar","miam-ds-text","size-s","weight-l",3,"ngModel","ngModelChange","keydown.enter","blur"],["type","text","placeholder","tradof#Je cherche un ingr\xe9dient ou un repas#",1,"mealz-catalog-toolbar__searchbar","miam-ds-searchbar","miam-ds-text","size-s","weight-l",3,"ngModel","ngModelChange","keydown.enter","blur"],[1,"miam-catalog-toolbar__controls__filter","mealz-ds-button","ghost","square",3,"ngClass","disabled","click"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Filters.svg","alt","Filters"],[1,"miam-catalog-toolbar__controls__filter-badge"],[1,"miam-recipe-toolbar__return-button","mealz-ds-button","ghost","square",3,"click"],["alt","return","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/ArrowLeft_dark.svg"],[1,"miam-catalog-toolbar__controls__preferences-label"],[1,"miam-catalog-toolbar__controls__favorites-label"],[4,"ngIf"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"div",1),wo(2,"div",2),fo(3,fS,1,1,"input",3),fo(4,_S,1,1,"input",4),fo(5,yS,3,5,"button",5),fo(6,wS,2,0,"button",6),ko(),wo(7,"div",7),fo(8,CS,3,5,"button",5),wo(9,"button",8),Ao("click",(function(){return t.preferencesButtonPressed.emit()})),Co(10,"img",9),fo(11,SS,2,0,"span",10),fo(12,xS,2,1,"div",11),ko(),wo(13,"button",12),Ao("click",(function(){return t.favoritesButtonPressed.emit()})),Co(14,"img",13),fo(15,PS,3,2,"div",14),ko(),ko(),ko(),ko()),2&e&&(Ho("reduced",t.reduced),Nr(2),bo("ngClass",bc(16,DS,!t.home)),Nr(1),bo("ngIf",t.hideButtons&&!t.history),Nr(1),bo("ngIf",!t.hideButtons||t.history),Nr(1),bo("ngIf",!t.reduced),Nr(1),bo("ngIf",t.reduced&&!t.home),Nr(2),bo("ngIf",t.reduced),Nr(1),bo("ngClass",wc(18,TS,t.hideButtons,t.reduced,!t.reduced))("disabled",t.hideButtons),Nr(2),bo("ngIf",!t.reduced),Nr(1),bo("ngIf",t.preferencesBadgeCount>0),Nr(1),bo("ngClass",wc(22,TS,t.hideButtons,t.reduced,!t.reduced))("disabled",t.hideButtons),Nr(1),bo("src",t.hideButtons?"https://storage.googleapis.com/assets.miam.tech/generic/icons/Heart_grey.svg":"https://storage.googleapis.com/assets.miam.tech/generic/icons/Heart_Black.svg",Wn),Nr(1),bo("ngIf",!t.reduced))},directives:[Du,Ou,Gv,ab,kb],styles:[".miam-catalog-toolbar{position:relative;display:flex;width:100%;box-sizing:border-box}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container{display:flex;flex-direction:row;align-items:center;flex:1;max-width:600px}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container>:not(:last-child){margin-right:16px}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-catalog-toolbar__searchbar{width:480px;background-color:transparent}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-catalog-toolbar__searchbar::-moz-placeholder{color:var(--mealz-ds-color-text-disabled);opacity:1}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-catalog-toolbar__searchbar::placeholder{color:var(--mealz-ds-color-text-disabled);opacity:1}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-recipe-toolbar__return-button{width:24px;height:24px}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-recipe-toolbar__return-button img{cursor:pointer;min-width:15px;min-height:15px}.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;flex:1}.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container>:not(:last-child){margin-right:16px}.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites:not(.ghost):not(.hidden),.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences:not(.ghost):not(.hidden){display:flex;padding:8px 12px;background:var(--mealz-ds-color-primary-100,#e4eaec);color:var(--mealz-ds-color-neutral-black,#0f191f);border-radius:90px}.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites:not(.ghost):not(.hidden)>:not(:last-child),.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences:not(.ghost):not(.hidden)>:not(:last-child){margin-right:4px}.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container .mealz-ds-button.hidden{display:none}.miam-catalog-toolbar .miam-catalog-toolbar__controls__filter,.miam-catalog-toolbar .miam-catalog-toolbar__controls__preferences{position:relative}.miam-catalog-toolbar .miam-catalog-toolbar__controls__filter .miam-catalog-toolbar__controls__filter-badge,.miam-catalog-toolbar .miam-catalog-toolbar__controls__preferences .miam-catalog-toolbar__controls__filter-badge{height:18px;width:18px;display:flex;justify-content:center;align-items:center;background-color:var(--mealz-ds-color-primary-900);color:var(--miam-ds-color-neutral-white);border-radius:var(--m-border-radius-circle);font-size:12px;line-height:18px}.miam-catalog-toolbar .miam-catalog-toolbar__controls__filter:not(.full) .miam-catalog-toolbar__controls__filter-badge,.miam-catalog-toolbar .miam-catalog-toolbar__controls__preferences:not(.full) .miam-catalog-toolbar__controls__filter-badge{position:absolute;right:6px;top:6px}.miam-catalog-toolbar .miam-catalog-toolbar__controls__filter.hidden,.miam-catalog-toolbar.reduced .miam-catalog-toolbar__searchbar.hidden-reduced{display:none}@media (max-width:1023px){.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-catalog-toolbar__searchbar{width:auto;flex:1}}@media (max-width:700px){.miam-catalog-toolbar:not(.reduced){flex-direction:column-reverse}.miam-catalog-toolbar:not(.reduced)>:not(:last-child){margin-top:24px}.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__searchbar-container{border-bottom:unset;justify-content:space-between;max-width:unset}.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container{justify-content:space-between}.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites,.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences{border-radius:40px;padding:12px 16px;flex:1}.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites:hover,.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences:hover{background-color:var(--mealz-ds-color-primary-200)}.miam-catalog-toolbar.reduced .miam-catalog-toolbar__searchbar:not(.hidden-reduced),.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites.hidden,.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites:not(.full) span,.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences.hidden,.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences:not(.full) span{display:none}}"],encapsulation:2,changeDetection:0}),e})();function RS(e,t){if(1&e){const e=Io();wo(0,"button",7),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo().addTag(i)})),Qo(1),ko()}if(2&e){const e=t.$implicit;Nr(1),Ko(" ",e.attributes.name," ")}}function OS(e,t){1&e&&(wo(0,"div",8),wo(1,"span"),Qo(2,"tradof#Pas de panique, nous ne trouvons pas cet ingr\xe9dient. Aucun risque de le retrouver dans votre assiette.#"),ko(),ko())}let FS=(()=>{class e{constructor(e,t,i){this.preferencesService=e,this.tagsService=t,this.cdr=i,this.backAndReload=new Rc,this.suggestedTags=[],this.searchStr="",this.addingIngredient=!1,this.icon=Cv,this.notFound=!1,this.searchQuery=new cp(""),this.subscription=new d}ngOnInit(){this.listenOnSearchChange()}ngOnDestroy(){this.subscription.unsubscribe()}searchInputUpdate(e){this.searchQuery.next(e.target.value)}listenOnSearchChange(){this.subscription.add(this.searchQuery.pipe(of(250),p_(),th(e=>e.length>0?this.tagsService.autocomplete(e):td([]))).subscribe(e=>{var t,i;this.suggestedTags=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.filter(e=>"ingredient_category"===e.attributes["tag-type-id"]||"ingredientsdefinition"===e.attributes["tag-type-id"]),this.notFound=0===(null===(i=this.suggestedTags)||void 0===i?void 0:i.length),this.cdr.detectChanges()}))}addTag(e){this.preferencesService.newTagFromSearch(e),this.backAndReload.emit()}}return e.\u0275fac=function(t){return new(t||e)(vo(d_),vo(a_),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-preferences-search"]],outputs:{backAndReload:"backAndReload"},decls:7,vars:5,consts:[[1,"preferences__search"],[1,"preferences__search-bar"],["type","text","placeholder","tradof#Je n'aime pas...#",1,"preferences__search-bar-input","miam-ds-searchbar","miam-ds-text",3,"ngModel","keyup"],[1,"mealz-ds-button","ghost","small","square","preferences__clear-input-button",3,"click"],["alt","clear input","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_neutralBlack.svg",1,"preferences__clear-input-img"],["class","preferences__suggested__tag",3,"click",4,"ngFor","ngForOf"],["class","preferences__not-found",4,"ngIf"],[1,"preferences__suggested__tag",3,"click"],[1,"preferences__not-found"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"div",1),wo(2,"input",2),Ao("keyup",(function(e){return t.searchInputUpdate(e)})),ko(),wo(3,"button",3),Ao("click",(function(){return t.searchQuery.next("")})),Co(4,"img",4),ko(),ko(),fo(5,RS,2,1,"button",5),fo(6,OS,3,0,"div",6),ko()),2&e&&(Nr(2),bo("ngModel",t.searchQuery.value),Nr(2),Ho("hidden",0===(null==t.searchQuery.value?null:t.searchQuery.value.length)),Nr(1),bo("ngForOf",t.suggestedTags),Nr(1),bo("ngIf",t.notFound))},directives:[Gv,ab,kb,Au,Ou],styles:[".preferences__search .preferences__search-bar{margin:0 16px 24px;position:relative;display:flex}.preferences__search .preferences__search-bar .preferences__clear-input-img{height:24px;width:24px}.preferences__search .preferences__search-bar .preferences__clear-input-img.hidden{display:none}.preferences__search .preferences__search-bar .preferences__clear-input-button{position:absolute;top:1px;right:1px}.preferences__search .preferences__suggested__tag{background:none;border:none;font:inherit;cursor:pointer;width:100%;text-align:start;padding:12px 16px;border-bottom:1px solid var(--mealz-ds-color-neutral-200,#d9dde1);color:var(--mealz-ds-color-neutral-black)}.preferences__search .preferences__not-found{padding:12px 16px}"],encapsulation:2,changeDetection:0}),e})();function BS(e,t){if(1&e){const e=Io();So(0),wo(1,"button",5),Ao("click",(function(){return Rt(e),Fo().close()})),Co(2,"img",6),ko(),wo(3,"div",7),wo(4,"span"),Qo(5,"tradof#Mes pr\xe9f\xe9rences#"),ko(),ko(),wo(6,"button",8),Ao("click",(function(){return Rt(e),Fo().close()})),Co(7,"img",9),ko(),xo()}}function MS(e,t){if(1&e){const e=Io();wo(0,"div",10),wo(1,"button",11),Ao("click",(function(){return Rt(e),Fo().goToDefaultView()})),Co(2,"img",6),ko(),wo(3,"div",7),wo(4,"span"),Qo(5,"tradof#Je n'aime pas#"),ko(),ko(),ko()}}function LS(e,t){if(1&e){const e=Io();wo(0,"div",28),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(2).toggleTag(i)})),wo(1,"div",29),Qo(2),ko(),Co(3,"input",30),ko()}if(2&e){const e=t.$implicit;Nr(2),Ko(" ",e.tag.name," "),Nr(1),bo("checked",e.checked)}}function $S(e,t){1&e&&Co(0,"img",33),2&e&&bo("alt","remove "+Fo().$implicit.tag.attributes.name)}const jS=function(e){return{checked:e}};function zS(e,t){if(1&e){const e=Io();wo(0,"button",31),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(2).toggleTag(i)})),wo(1,"div",22),wo(2,"span"),Qo(3),Ec(4,"titlecase"),ko(),fo(5,$S,1,1,"img",32),ko(),ko()}if(2&e){const e=t.$implicit,i=Fo(2);bo("ngClass",bc(5,jS,e.checked)),Nr(3),Yo(Ic(4,3,e.tag.attributes.name)),Nr(2),bo("ngIf",i.isAdditionalIngredient(e))}}function NS(e,t){if(1&e){const e=Io();wo(0,"div",28),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(2).toggleTag(i)})),wo(1,"div",34),Qo(2),Ec(3,"titlecase"),ko(),Co(4,"input",30),ko()}if(2&e){const e=t.$implicit;Nr(2),Ko(" ",Ic(3,2,e.tag.name)," "),Nr(2),bo("checked",e.checked)}}function VS(e,t){if(1&e){const e=Io();So(0),wo(1,"div",12),wo(2,"span",13),Qo(3,"tradof#Nombre de personnes#"),ko(),wo(4,"ng-miam-counter-input",14),Ao("valueChange",(function(t){return Rt(e),Fo().preferencesService.guests=t})),ko(),ko(),wo(5,"ng-miam-accordion",15),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(6,"ng-miam-accordion-title"),wo(7,"span",16),Qo(8,"\ntradof#Avez-vous un r\xe9gime particulier ?# "),ko(),ko(),wo(9,"ng-miam-accordion-content"),wo(10,"div",17),fo(11,LS,4,2,"div",18),ko(),ko(),ko(),wo(12,"ng-miam-accordion",19),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(13,"ng-miam-accordion-title"),wo(14,"span",16),Qo(15,"\ntradof#Je n'aime pas# "),ko(),ko(),wo(16,"ng-miam-accordion-content"),fo(17,zS,6,7,"button",20),wo(18,"button",21),Ao("click",(function(){return Rt(e),Fo().goToSearchView()})),wo(19,"div",22),wo(20,"span"),Qo(21,"Ad\u0103uga\u021bi"),ko(),Co(22,"img",23),ko(),ko(),ko(),ko(),wo(23,"ng-miam-accordion",24),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(24,"ng-miam-accordion-title"),wo(25,"span",16),Qo(26,"\ntradof#Mes \xe9quipements# "),ko(),ko(),wo(27,"ng-miam-accordion-content"),wo(28,"ng-miam-accordion-content"),wo(29,"div",17),fo(30,NS,5,4,"div",18),ko(),ko(),ko(),ko(),wo(31,"div",25),wo(32,"button",26),Ao("click",(function(){return Rt(e),Fo().reset()})),wo(33,"span"),Qo(34,"tradof#R\xe9initialiser#"),ko(),ko(),wo(35,"button",27),Ao("click",(function(){return Rt(e),Fo().updateAndBack()})),wo(36,"span"),Qo(37,"tradof#Appliquer#"),ko(),ko(),ko(),xo()}if(2&e){const e=Fo();Nr(4),bo("value",e.preferencesService.guests),Nr(1),bo("isCollapsed",!1),Nr(6),bo("ngForOf",e.diets),Nr(1),bo("isCollapsed",!1),Nr(5),bo("ngForOf",e.ingredients),Nr(6),bo("isCollapsed",!1),Nr(7),bo("ngForOf",e.equipments)}}function HS(e,t){if(1&e){const e=Io();So(0),wo(1,"ng-miam-preferences-search",35),Ao("backAndReload",(function(){Rt(e);const t=Fo();return t.fetchTags(),t.goToDefaultView()})),ko(),xo()}}var US=function(e){return e[e.DEFAULT=0]="DEFAULT",e[e.SEARCH=1]="SEARCH",e}({});let qS=(()=>{class e extends jy{constructor(e,t,i,n,r,s,o){super(e),this.tagsService=t,this.cdr=i,this.preferencesService=n,this.recipesService=r,this.contextService=s,this.suppliersService=o,this.isOpenChange=new Rc,this.preferencesChanged=new Rc,this._isOpen=!1,this.diets=[],this.ingredients=[],this.equipments=[],this.displayType=US.DEFAULT,this.preferenceViewEnum=US,this.openedModalSubscriptions=[],this.subscriptions=[],this.forcedIngredients=[{id:"ingredient_category_lgumes",name:"L\xe9gume"},{id:"ingredient_category_viandes-blanches",name:"Viande blanche"},{id:"ingredient_category_fromage",name:"Fromage"},{id:"ingredient_category_poissons",name:"Poisson"},{id:"ingredient_category_fruits",name:"Fruit"},{id:"ingredientsdefinition_coriandre",name:"Coriandre"},{id:"ingredientsdefinition_brocoli",name:"Brocoli"},{id:"ingredientsdefinition_oeuf",name:"Oeuf"},{id:"ingredient_category_alcool",name:"Alcool"}]}set isOpen(e){e?this.fetchTags():this.openedModalSubscriptions.forEach(e=>e.unsubscribe()),!this._isOpen&&e&&this.pageview(),this._isOpen=e,this.isOpenChange.emit(this.isOpen),this.cdr.detectChanges()}get isOpen(){return this._isOpen}ngOnInit(){this.openedModalSubscriptions.push(this.preferencesService.guests$.subscribe(()=>this.cdr.detectChanges())),this.subscriptions.push(this.preferencesService.isOpened$.subscribe(e=>{this.isOpen=e}),this.suppliersService.supplier$.pipe(id(e=>!!e)).subscribe(e=>{this.supplierId=e.id,this.fetchTags()}))}ngAfterViewInit(){window.scrollTo(0,0)}ngOnDestroy(){this.openedModalSubscriptions.forEach(e=>e.unsubscribe()),this.subscriptions.forEach(e=>e.unsubscribe())}fetchTags(){this.openedModalSubscriptions.push(this.tagsService.all({remotefilter:{tag_type:"diet",for_supplier:this.supplierId}}).pipe(bp(e=>e.is_loading)).subscribe(e=>{this.diets=e.data.map(e=>({tag:e,checked:this.preferencesService.tagShouldBeChecked(e,!1),without:!1})),this.cdr.detectChanges()}),this.tagsService.all({remotefilter:{tag_type:"equipment",for_supplier:this.supplierId}}).pipe(bp(e=>e.is_loading)).subscribe(e=>{this.equipments=e.data.map(e=>({tag:e,checked:this.preferencesService.tagShouldBeChecked(e,!0),without:!0})),this.cdr.detectChanges()})),this.initIngredientTags()}reset(){this.preferencesService.resetPreferences(),this.contextService.isPreferencesSSR&&this.preferencesService.sendCacheRequest("remove","preferences").subscribe(),this.fetchTags()}initIngredientTags(){this.ingredients=[],this.forcedIngredients.forEach(e=>{const t=this.tagsService.new();t.id=e.id,t.attributes.name=e.name,this.ingredients.push({tag:t,checked:this.preferencesService.tagShouldBeChecked(t,!0),without:!0})}),this.getAdditionalIngredients()}isAdditionalIngredient(e){return-1===this.forcedIngredients.findIndex(t=>t.id===e.tag.id)&&(e.tag.id.includes("ingredient_category_")||e.tag.id.includes("ingredientsdefinition_"))}getAdditionalIngredients(){(this.preferencesService.preferencesInStorage||{with:[],without:[]}).without.filter(e=>e.id.includes("ingredient_category_")||e.id.includes("ingredientsdefinition_")||e.id.includes("meal_type_")).forEach(e=>{if(-1===this.forcedIngredients.findIndex(t=>t.id===e.id)){const t=this.tagsService.new();t.id=e.id,t.attributes.name=e.name,this.preferencesService.tagShouldBeChecked(t,!0)&&this.ingredients.push({tag:t,checked:!0,without:!0})}}),this.preferencesService.tagsToAdd.forEach(e=>{(e.tag.id.includes("ingredient_category_")||e.tag.id.includes("ingredientsdefinition_")||e.tag.id.includes("meal_type_"))&&-1===this.ingredients.findIndex(t=>t.tag.id===e.tag.id)&&this.ingredients.push(e)}),this.contextService.isPreferencesSSR&&this.updateFiltersInCache()}toggleTag(e){e.checked=!e.checked,"equipment"===e.tag.attributes["tag-type-id"]!==e.checked?this.preferencesService.addTag(e):(this.preferencesService.removeTag(e),this.isAdditionalIngredient(e)&&this.ingredients.splice(this.ingredients.findIndex(t=>t.tag.id===e.tag.id),1)),this.cdr.detectChanges()}updateAndBack(){this.preferencesService.updatePreferences(),this.preferencesChanged.emit(),this.contextService.isPreferencesSSR?this.updateFiltersInCache(!0):(this.contextService.preferencesChanged.emit(),this.close())}close(){this.isOpen=!1,this.preferencesService.resetTagsActions()}goToDefaultView(){this.displayType=US.DEFAULT,this.cdr.detectChanges()}goToSearchView(){this.displayType=US.SEARCH,this.cdr.detectChanges()}currentPath(){return"preferences"}updateFiltersInCache(e=!1){const t=new Uf,i=this.preferencesService.addPreferencesToRemoteFilters(t,!0),n=Object.assign({exclude_tags:i.exclude_tags,include_tags:i.include_tags},4!==this.preferencesService.guests&&{guests:this.preferencesService.guests});(Object.keys(n).length>0?this.preferencesService.sendCacheRequest("set","preferences",n):this.preferencesService.sendCacheRequest("remove","preferences")).subscribe(()=>{e&&(this.contextService.preferencesChanged.emit(),this.close())})}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(a_),vo(Ga),vo(d_),vo(__),vo(Iv),vo(Nf))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-preferences"]],inputs:{filters:"filters",isOpen:"isOpen"},outputs:{isOpenChange:"isOpenChange",preferencesChanged:"preferencesChanged"},features:[eo],decls:7,vars:6,consts:[["modalStyle","right",1,"miam-preferences-modal",3,"noHeaderMode","display","close"],[1,"miam-preferences"],[1,"miam-preferences__header"],[4,"ngIf"],["class","miam-preferences_nav-and-title",4,"ngIf"],[1,"mealz-ds-button","ghost","square","miam-preferences__back-button",3,"click"],["alt","go back","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg",1,"miam-preferences__back-image"],[1,"mealz-ds-text","size-l","weight-xxl","miam-preferences__title"],[1,"mealz-ds-button","ghost","square","miam-preferences__close-button",3,"click"],["alt","close modal","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg",1,"miam-preferences__close-image"],[1,"miam-preferences_nav-and-title"],[1,"mealz-ds-button","ghost","square","miam-preferences__search-back-button",3,"click"],[1,"miam-preferences__guests"],[1,"mealz-ds-text","miam-preferences_guest-label"],[1,"miam-preferences_guest-counter",3,"value","valueChange"],[1,"miam-preferences__diet-section",3,"isCollapsed","isCollapsedChange"],[1,"mealz-ds-text","weight-xl"],[1,"miam-preferences__list"],["class","miam-preferences__list__item mealz-ds-checkbox",3,"click",4,"ngFor","ngForOf"],[1,"miam-preferences__dislikes-section",3,"isCollapsed","isCollapsedChange"],["class","mealz-ds-badge miam-preferences__badge",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"mealz-ds-badge","miam-preferences__badge",3,"click"],[1,"miam-preferences__badge_label"],["alt","add dislikes","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-neutral-black.svg"],[1,"miam-preferences__equipments-section",3,"isCollapsed","isCollapsedChange"],[1,"miam-preferences__footer"],[1,"mealz-ds-button","secondary","miam-preferences__footer__reset",3,"click"],[1,"mealz-ds-button","primary","miam-preferences__footer__recipes",3,"click"],[1,"miam-preferences__list__item","mealz-ds-checkbox",3,"click"],[1,"mealz-ds-text","miam-preferences__list__item__name"],["type","checkbox",3,"checked"],[1,"mealz-ds-badge","miam-preferences__badge",3,"ngClass","click"],["class","miam-preferences__remove-tag","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg",3,"alt",4,"ngIf"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg",1,"miam-preferences__remove-tag",3,"alt"],[1,"miam-preferences__list__item__name"],[3,"backAndReload"]],template:function(e,t){1&e&&(wo(0,"ng-miam-modal",0),Ao("close",(function(){return t.close()})),wo(1,"div",1),wo(2,"div",2),fo(3,BS,8,0,"ng-container",3),fo(4,MS,6,0,"div",4),ko(),fo(5,VS,38,7,"ng-container",3),fo(6,HS,2,0,"ng-container",3),ko(),ko()),2&e&&(bo("noHeaderMode",!0)("display",t.isOpen),Nr(3),bo("ngIf",t.displayType===t.preferenceViewEnum.DEFAULT),Nr(1),bo("ngIf",t.displayType===t.preferenceViewEnum.SEARCH),Nr(1),bo("ngIf",t.displayType===t.preferenceViewEnum.DEFAULT),Nr(1),bo("ngIf",t.displayType===t.preferenceViewEnum.SEARCH))},directives:[sw,Ou,Nb,uw,cw,lw,Au,Du,FS],pipes:[Qu],styles:['@media (min-width:450px){ng-miam-preferences .miam-modal__container.left .miam-modal,ng-miam-preferences .miam-modal__container.right .miam-modal,webc-miam-preferences-modal .miam-modal__container.left .miam-modal,webc-miam-preferences-modal .miam-modal__container.right .miam-modal,webc-miam-preferences .miam-modal__container.left .miam-modal,webc-miam-preferences .miam-modal__container.right .miam-modal{width:450px}}.miam-preferences{position:relative;display:flex;flex-direction:column;margin-bottom:72px}.miam-preferences>:not(:last-child){margin-bottom:24px}@media (max-width:450px){.miam-preferences{margin-bottom:124px}}.miam-preferences .miam-preferences__header{display:flex;padding:8px;align-items:center;border-bottom:1px solid var(--mealz-ds-color-neutral-200,#d9dde1)}.miam-preferences .miam-preferences__header .miam-preferences_nav-and-title{display:flex;align-items:center}.miam-preferences .miam-preferences__header .miam-preferences__back-image{transform:rotate(180deg)}@media (min-width:1024px){.miam-preferences .miam-preferences__header{justify-content:space-between}}@media (min-width:1024px){.miam-preferences .miam-preferences__header .miam-preferences__back-button{display:none}}.miam-preferences .miam-preferences__header .miam-preferences__close-button{display:none}@media (min-width:1024px){.miam-preferences .miam-preferences__header .miam-preferences__close-button{display:block}}.miam-preferences .miam-preferences__header .miam-preferences__title{padding-left:8px;color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-preferences .miam-preferences__guests{display:flex;justify-content:space-between;align-items:center;padding:0 16px}.miam-preferences .miam-preferences__guests .miam-preferences_guest-counter{border-radius:6px;border:1px solid var(--mealz-ds-color-primary);color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-preferences .miam-preferences__guests .miam-preferences_guest-counter .miam-counter-input .miam-counter-input__value-container{position:relative}.miam-preferences .miam-preferences__guests .miam-preferences_guest-counter .miam-counter-input .miam-counter-input__value-container:after{content:"";background-image:url(https://storage.googleapis.com/assets.miam.tech/generic/icons/cutlery-neutral-black.svg);background-repeat:no-repeat;background-position:50%;background-size:contain;width:18px;height:18px}.miam-preferences ng-miam-accordion .miam-accordion__header{height:48px;display:flex;align-items:center;justify-content:space-between;margin:0 16px 12px;padding:8px 16px;border-radius:8px;background:var(--mealz-ds-color-primary-50,#f0f3f4);color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-preferences ng-miam-accordion .miam-accordion__collapsable-container{margin:0 16px;padding:0 8px;border-bottom:0}.miam-preferences ng-miam-accordion .miam-accordion__collapsable-content{border-bottom:0}.miam-preferences ng-miam-accordion .miam-accordion__collapsable-content .mealz-ds-checkbox{height:unset}.miam-preferences .miam-preferences__list{display:flex;flex-direction:column}.miam-preferences .miam-preferences__list .miam-preferences__list__item{display:flex;justify-content:space-between;align-items:center;padding:8px 0;cursor:pointer}.miam-preferences .miam-preferences__list .miam-preferences__list__item .miam-preferences__list__item__name{color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content{display:flex;align-items:flex-start;align-content:flex-start;align-self:stretch;flex-wrap:wrap;margin:-6px}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content>*{margin:6px}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content .miam-preferences__badge{color:var(--mealz-ds-color-neutral-black,#0f191f);padding:16px;cursor:pointer;transition:all .25s ease-in;-webkit-tap-highlight-color:transparent;border:none;display:flex;align-items:center}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content .miam-preferences__badge.checked{background:var(--miam-color-primary,#24748f);color:var(--mealz-ds-color-neutral-white,#fff)}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content .miam-preferences__badge .miam-preferences__badge_label{display:flex}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content .miam-preferences__badge .miam-preferences__badge_label>:not(:last-child){margin-right:8px}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content .miam-preferences__badge .miam-preferences__badge_label .miam-preferences__remove-tag{height:16px;width:16px}.miam-preferences .miam-preferences__footer{position:fixed;width:450px;bottom:0;display:flex;justify-content:center;padding:12px 16px;background:var(--mealz-ds-color-neutral-white,#fff);border-top:1px solid var(--mealz-ds-color-neutral-200,#d9dde1);box-sizing:border-box}.miam-preferences .miam-preferences__footer>:not(:last-child){margin-right:16px}@media (max-width:450px){.miam-preferences .miam-preferences__footer{width:100%;box-sizing:border-box;flex-direction:column-reverse}.miam-preferences .miam-preferences__footer>:not(:last-child){margin-right:0;margin-top:8px}}.miam-preferences .miam-preferences__footer .miam-preferences__footer__recipes .miam-preferences__footer__number-recipes{margin-right:8px}'],encapsulation:2,changeDetection:0}),e})();function GS(e,t){if(1&e&&(So(0),wo(1,"span"),Qo(2,"pentru"),ko(),wo(3,"span"),Qo(4),ko(),xo()),2&e){const e=Fo(3);Nr(4),Ko('"',e.filters.search,'"')}}function WS(e,t){if(1&e&&(wo(0,"div"),wo(1,"div",11),wo(2,"span"),Qo(3,"Ne pare r\u0103u, nu au fost g\u0103site oferte"),ko(),fo(4,GS,5,1,"ng-container",12),ko(),wo(5,"div",13),wo(6,"span"),Qo(7,"Modifica\u021bi termenii de c\u0103utare sau ajusta\u021bi filtrele"),ko(),ko(),ko()),2&e){const e=Fo(2);Nr(4),bo("ngIf",e.isSearching())}}function ZS(e,t){1&e&&(wo(0,"div"),wo(1,"div",14),wo(2,"span"),Qo(3,"Ne pare r\u0103u, \xeenc\u0103 nu ave\u021bi idei salvate de mese"),ko(),ko(),ko())}function QS(e,t){if(1&e&&(fo(0,ZS,4,0,"div",8),Ec(1,"async")),2&e){Fo();const e=_o(6);bo("ngIf",Ic(1,2,Fo().userService.isLogged$))("ngIfElse",e)}}function YS(e,t){1&e&&(wo(0,"div",15),wo(1,"span"),Qo(2,"Ne pare r\u0103u, trebuie s\u0103 fi\u021bi autentificat pentru a accesa con\u021binutul acestei pagini."),ko(),ko())}const KS=function(e,t){return{"icon-filtering":e,"icon-not-filtering":t}};function JS(e,t){if(1&e&&(wo(0,"div",6),Co(1,"ng-miam-icon",7),fo(2,WS,8,1,"div",8),fo(3,QS,2,4,"ng-template",null,9,Wc),fo(5,YS,3,0,"ng-template",null,10,Wc),ko()),2&e){const e=_o(4),t=Fo();Nr(1),bo("width",279)("height",243)("iconName",t.icon.NoRecipeFound)("ngClass",yc(6,KS,t.isFiltering(),!t.isFiltering())),Nr(1),bo("ngIf",t.isFiltering())("ngIfElse",e)}}function XS(e,t){1&e&&(wo(0,"div",16),Co(1,"div",17),wo(2,"div"),Qo(3,"\nSe \xeencarc\u0103 rezultatele... "),ko(),ko())}function ex(e,t){if(1&e){const e=Io();wo(0,"ng-miam-recipe-card",18),Ao("addToMealsPlanner",(function(t){return Rt(e),Fo().addToMealsPlanner.emit(t)})),ko()}if(2&e){const e=t.recipe,i=Fo();bo("recipe",e)("originTrace",i.eventTrace)("displayPricing",i.displayPricing)("previewAllowed",!i.addRecipeMode)("addRecipeMode",i.addRecipeMode)("displayGuests",i.displayGuests)("displayVariant",i.displayRecipeVariant)("helpButtonAllowed",i.helpButtonAllowed)}}const tx=function(e){return{recipe:e}};function ix(e,t){if(1&e){const e=Io();So(0),wo(1,"div",20),Ao("loadMore",(function(){return Rt(e),Fo(2).autoloadContentIfNecessary()})),Ec(2,"async"),Eo(3,21),ko(),xo()}if(2&e){const e=Fo().$implicit,t=Fo(),i=_o(7);Nr(1),bo("isLoading",Ic(2,3,t.loading)),Nr(2),bo("ngTemplateOutlet",i)("ngTemplateOutletContext",bc(5,tx,e))}}function nx(e,t){if(1&e&&Eo(0,21),2&e){const e=Fo().$implicit;Fo(),bo("ngTemplateOutlet",_o(7))("ngTemplateOutletContext",bc(2,tx,e))}}function rx(e,t){if(1&e&&(So(0),fo(1,ix,4,7,"ng-container",12),fo(2,nx,1,4,"ng-container",19),xo()),2&e){const e=t.last;Nr(1),bo("ngIf",e),Nr(1),bo("ngIf",!e)}}const sx=["recipe-provider","sponsors","tags"],ox={recipes:["title","number-of-guests","media-url","video-id","filigrane-logo-url","difficulty","preparation-time","cooking-time","resting-time",...sx],sponsors:["logo-url"],tags:["tag-type-id"],"recipe-provider":["name"]};let ax=(()=>{class e extends jy{constructor(e,t,i,n,r){super(e),this.recipesService=t,this.userService=i,this.context=n,this.cdr=r,this.randomMode=!1,this.modifiedGuests=null,this.displayInfos=!1,this.displayPricing=!0,this.displayGuests=!0,this.helpButtonAllowed=!0,this.addRecipeMode=!1,this.excludedRecipesIds=[],this.displayRecipeVariant=1,this.addToMealsPlanner=new Rc,this.filterRemoved=new Rc,this.loading=new cp(!0),this.currentRecipes=[],this.lastPage=0,this.icon=Cv,this.noMoreRecipes=!1,this.filtersToDisplay=[],this.currentRequestsCount=0,this.subscriptions=[],this.currentRecipes=[],this.filters=new Uf({search:""})}get sort(){var e;return(null===(e=this.filters.additionalFilters)||void 0===e?void 0:e.filters.packages)?"position":this.addRecipeMode?"price":""}get props(){var e,t;const i={};return(null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.filters.packages)&&(i.category_id=this.filters.additionalFilters.filters.packages),i}ngOnInit(){this.pageview()}ngOnChanges(e){const t=Object.keys(e);t.includes("originTrace")&&(1===t.length||2===t.length&&t.includes("excludedRecipesIds"))||(this.filtersToDisplay=this.buildFiltersArray(),this.reloadPage(),this.filters.search&&this.analyticsService.sendEvent("search",this.path,{search_term:this.filters.search}))}currentPath(){return this.filters.eventPath()}autoloadContentIfNecessary(){this.subscriptions.push(this.loading.pipe(fp(1),id(e=>!e)).subscribe(()=>{this.currentRecipes.length>0&&!this.noMoreRecipes&&this.loadMore(this.lastPage>2)}))}loadMore(e=!0){e&&(this.loading.next(!0),this.cdr.detectChanges()),this.lastPage++,this.loadContent()}loadRecipesPage(e){return this.noMoreRecipes?td([]):this.recipesService.addMandatoryCompletionToFilter(this.filters).pipe(th(t=>(this.context.displayIngredientPicturesOnRecipeCards&&!sx.includes("ingredients")&&(sx.push("ingredients"),ox.recipes.push("ingredients"),Object.assign(ox,{ingredients:["name","quantity","unit","active","forced-eans","picture-url","position"]})),this.currentRequestsCount++,this.recipesService.filter(t,{size:20,number:e},sx,ox,this.modifiedGuests,this.randomMode,this.sort).pipe(th(i=>this.processResults(i,t,e))))))}processResults(e,t,i){return this.currentRequestsCount--,JSON.stringify(t)===JSON.stringify(this.filters)||0===this.currentRequestsCount?(this.excludedRecipesIds.length>0&&(e=e.filter(e=>!this.excludedRecipesIds.includes(e.id))),this.currentRecipes=1===i?e:[...this.currentRecipes,...e],this.currentRecipes.forEach(e=>{this.modifiedGuests&&this.modifiedGuests>0&&(e.modifiedGuests=this.modifiedGuests)}),this.noMoreRecipes=0===e.length,td(this.currentRecipes)):(Cp(`Filtering aborted : ${JSON.stringify(t)} and ${JSON.stringify(this.filters)} are different`),td([]))}removeFilter(e){this.filterRemoved.emit(e)}buildFiltersArray(){let e=[];return e=[...e,...this.getSelectedFilters(this.filters.cost),...this.getSelectedFilters(this.filters.difficulty),...this.getSelectedFilters(this.filters.time)],this.filters.additionalFilters&&""!==this.filters.additionalFilters.title&&(e=[this.filters.additionalFilters.title].concat(e)),e}getSelectedFilters(e){return e?e.filter(e=>e.value).map(e=>e.text):[]}reloadPage(){this.loading.next(!0),this.lastPage=1,this.noMoreRecipes=!1,this.currentRecipes=[],this.cdr.detectChanges(),this.loadContent()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}isSearching(){return this.filters.search&&""!==this.filters.search}isFieldEmpty(e){return!e||!e.some(e=>e.value)}isFiltering(){return this.isSearching()||!this.isFieldEmpty(this.filters.difficulty)||!this.isFieldEmpty(this.filters.cost)||!this.isFieldEmpty(this.filters.time)}trackByFn(e,t){return t.id}loadContent(){this.subscriptions.push(this.loadRecipesPage(this.lastPage).subscribe(()=>{this.loading.next(!1),this.cdr.detectChanges()}))}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(__),vo(Yf),vo(Iv),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-catalog-list"]],viewQuery:function(e,t){if(1&e&&Uc(NC,1),2&e){let e;Hc(e=qc())&&(t.recipeCards=e)}},inputs:{filters:"filters",randomMode:"randomMode",modifiedGuests:"modifiedGuests",displayInfos:"displayInfos",displayPricing:"displayPricing",displayGuests:"displayGuests",helpButtonAllowed:"helpButtonAllowed",addRecipeMode:"addRecipeMode",excludedRecipesIds:"excludedRecipesIds",displayRecipeVariant:"displayRecipeVariant"},outputs:{addToMealsPlanner:"addToMealsPlanner",filterRemoved:"filterRemoved",loading:"loading"},features:[eo,at],decls:9,vars:8,consts:[[1,"miam-catalog-list"],["class","miam-catalog-list__notFound",4,"ngIf"],["class","miam-catalog-list__loader",4,"ngIf"],[1,"miam-catalog-list__cards"],["recipeCard",""],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"miam-catalog-list__notFound"],[1,"miam-catalog-list__notFound__icon",3,"width","height","iconName","ngClass"],[4,"ngIf","ngIfElse"],["notFiltering",""],["notLogged",""],[1,"miam-catalog-list__notFound__title1","filtering"],[4,"ngIf"],[1,"miam-catalog-list__notFound__title2"],[1,"miam-catalog-list__notFound__title1","not-filtering"],[1,"miam-catalog-list__notFound__title1","not-logged"],[1,"miam-catalog-list__loader"],[1,"miam-ds-loader"],[3,"recipe","originTrace","displayPricing","previewAllowed","addRecipeMode","displayGuests","displayVariant","helpButtonAllowed","addToMealsPlanner"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngIf"],["ngMiamLoadOnScroll","","marginRoot","600px",3,"isLoading","loadMore"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(wo(0,"div",0),fo(1,JS,7,9,"div",1),Ec(2,"async"),fo(3,XS,4,0,"div",2),Ec(4,"async"),wo(5,"div",3),fo(6,ex,1,8,"ng-template",null,4,Wc),fo(8,rx,3,2,"ng-container",5),ko(),ko()),2&e&&(Nr(1),bo("ngIf",!Ic(2,4,t.loading)&&0===t.currentRecipes.length),Nr(2),bo("ngIf",Ic(4,6,t.loading)),Nr(5),bo("ngForOf",t.currentRecipes)("ngForTrackBy",t.trackByFn))},directives:[Ou,Au,$y,Du,NC,Rb,Nu],pipes:[Wu],styles:[".miam-catalog-list{width:100%;padding:0 80px;box-sizing:border-box}.miam-catalog-list .miam-catalog-list__notFound{display:flex;flex-direction:column;width:100%;justify-content:center;text-align:center;padding:36px 0 0}.miam-catalog-list .miam-catalog-list__notFound .miam-catalog-list__notFound__title1{margin-top:36px;margin-bottom:8px;font-size:24px;font-weight:700;color:var(--m-color-primary)}.miam-catalog-list .miam-catalog-list__notFound .miam-catalog-list__notFound__title1.filtering span{display:inline}.miam-catalog-list .miam-catalog-list__notFound .miam-catalog-list__notFound__title1.filtering span+span{margin-left:5px}.miam-catalog-list .miam-catalog-list__notFound .miam-catalog-list__notFound__title2{font-size:22px;color:var(--m-color-grey-text)}.miam-catalog-list .miam-catalog-list__loader{width:100%;font-size:20px;font-weight:700;color:var(--m-color-grey-text);text-align:center}.miam-catalog-list .miam-catalog-list__loader .miam-ds-loader{margin-top:80px;margin-bottom:16px;margin-left:calc(50% - 40px);height:80px;width:80px;background-position-x:40px;background-size:40px 40px}.miam-catalog-list .miam-catalog-list__cards{display:grid;grid-template-columns:repeat(auto-fill,calc(var(--m-catalog-card-width) + 16px));justify-content:center;position:relative;width:100%;box-sizing:border-box;margin:-8px}.miam-catalog-list .miam-catalog-list__cards>*{margin:8px}.miam-catalog-list .miam-catalog-list__cards:not(:has(.miam-recipe-card)){grid-template-columns:unset}@media (max-width:1023px){.miam-catalog-list{padding:0 32px}}@media (max-width:700px){.miam-catalog-list{padding:0 20px}}"],encapsulation:2,changeDetection:0}),e})();const cx=["miamCatalogTopAnchor"],lx=["returnHomeButton"];function ux(e,t){1&e&&Co(0,"div",14)}function dx(e,t){if(1&e){const e=Io();wo(0,"div",15,16),wo(2,"ng-miam-catalog-toolbar",17),Ao("filterButtonPressed",(function(){return Rt(e),Fo(2).onFilterCollapsed()}))("preferencesButtonPressed",(function(){Rt(e);const t=Fo(2);return t.isPreferenceModalOpen=!t.isPreferenceModalOpen}))("searchStringChanged",(function(t){return Rt(e),Fo(2).updateSearch(t)}))("favoritesButtonPressed",(function(){return Rt(e),Fo(2).checkAndSetFavoritesFilter()}))("returnHomePressed",(function(){return Rt(e),Fo(2).returnToHomePage()})),ko(),ko()}if(2&e){const e=_o(1),t=Fo(2);Nr(2),bo("home",t.displayHomePage())("history",t.historyDisplayed)("searchTerm",null==t.filters?null:t.filters.search)("additionalFiltersTitle",null==t.filters||null==t.filters.additionalFilters?null:t.filters.additionalFilters.title)("hideButtons",t.isFavoritesPage())("filterBadgeCount",t.filters.selectableFiltersCount())("reduced",e.classList.contains("sticking"))}}function hx(e,t){if(1&e){const e=Io();wo(0,"div",18),wo(1,"ng-miam-promotions-banner",19),Ao("clicked",(function(){return Rt(e),Fo(2).goToPromotions()})),ko(),ko()}}function px(e,t){if(1&e){const e=Io();wo(0,"div",20),Ao("click",(function(){return Rt(e),Fo(2).basketUtilsService.openBasket()})),Co(1,"img",21),wo(2,"span",22),wo(3,"span"),Qo(4),ko(),wo(5,"span"),Qo(6," tradof#repas dans votre panier#"),ko(),ko(),Co(7,"img",23),ko()}if(2&e){const e=Fo(2);Nr(4),Yo(e.recipeCount)}}function mx(e,t){if(1&e&&(wo(0,"div",38),wo(1,"span"),Qo(2,"Cercetarea dvs.: "),ko(),wo(3,"span"),Qo(4),ko(),ko()),2&e){const e=Fo(3);Nr(4),Yo(e.filters.search)}}function gx(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Mon carnet#"),ko())}function fx(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Favoris#"),ko())}function _x(e,t){if(1&e&&(wo(0,"div",39),fo(1,gx,2,0,"span",40),fo(2,fx,2,0,"span",40),ko()),2&e){const e=Fo(3);Nr(1),bo("ngIf",e.contextService.orderHistoryEnabled),Nr(1),bo("ngIf",!e.contextService.orderHistoryEnabled)}}function vx(e,t){1&e&&(wo(0,"span",41),Qo(1,"tradof#Promos#"),ko())}function bx(e,t){1&e&&(wo(0,"span",42),Qo(1,"tradof#Toutes nos recettes#"),ko())}function yx(e,t){if(1&e&&(wo(0,"span",46),Qo(1),ko()),2&e){const e=Fo(4);Nr(1),Ko(" ",e.filters.additionalFilters.subtitle," ")}}function wx(e,t){if(1&e&&(wo(0,"div",43),wo(1,"span",44),Qo(2),ko(),fo(3,yx,2,1,"span",45),ko()),2&e){const e=Fo(3);Nr(2),Yo(e.filters.additionalFilters.title),Nr(1),bo("ngIf",(null==e.filters.additionalFilters.subtitle?null:e.filters.additionalFilters.subtitle.length)>0)}}function kx(e,t){1&e&&(wo(0,"span",47),Qo(1,"Selec\u021bia dvs."),ko())}function Cx(e,t){if(1&e){const e=Io();wo(0,"div",48),wo(1,"div",49),Ao("click",(function(){return Rt(e),Fo(3).toggleHistory(!1)})),Co(2,"img",50),wo(3,"span"),Qo(4,"tradof#Favoris#"),ko(),ko(),wo(5,"div",51),Ao("click",(function(){return Rt(e),Fo(3).toggleHistory(!0)})),Co(6,"img",52),wo(7,"span"),Qo(8,"tradof#Historique#"),ko(),ko(),ko()}if(2&e){const e=Fo(3);Nr(1),Ho("active",!e.historyDisplayed)("inactive",e.historyDisplayed),Nr(1),bo("src",e.historyDisplayed?"https://storage.googleapis.com/assets.miam.tech/generic/icons/Heart_Grey.svg":"https://storage.googleapis.com/assets.miam.tech/generic/icons/Heart.svg",Wn),Nr(3),Ho("active",e.historyDisplayed)("inactive",!e.historyDisplayed),Nr(1),bo("src",e.historyDisplayed?"https://storage.googleapis.com/assets.miam.tech/generic/icons/History.svg":"https://storage.googleapis.com/assets.miam.tech/generic/icons/History_Grey.svg",Wn)}}const Sx=function(e,t,i,n,r){return{"miam-recipe-catalog__favorites-list":e,"miam-recipe-catalog__search-list":t,"miam-recipe-catalog__all-recipes-list":i,"miam-recipe-catalog__category-list":n,"miam-recipe-catalog__default-list":r}};function xx(e,t){if(1&e){const e=Io();wo(0,"ng-miam-catalog-list",53),Ao("filterRemoved",(function(t){return Rt(e),Fo(3).removeFilter(t)})),ko()}if(2&e){const e=Fo(3);bo("ngClass",kc(7,Sx,e.isFavoritesPage(),e.isSearchPage(),e.isAllRecipesPage(),e.isCategoryPage(),e.isDefaultPage()))("filters",e.filters)("originTrace",e.eventTrace)("displayPricing",e.displayPricing)("displayInfos",e.displayInfos)("modifiedGuests",e.guests)("displayRecipeVariant",e.displayRecipeVariant)}}function Ex(e,t){1&e&&(wo(0,"div",57),Co(1,"div",58),wo(2,"span"),Qo(3,"\ntradof# Chargement des r\xe9sultats... # "),ko(),ko())}function Ix(e,t){if(1&e&&(wo(0,"div",54),fo(1,Ex,4,0,"div",55),Co(2,"div",56),ko()),2&e){const e=Fo(3);Nr(1),bo("ngIf",e.historyService.fetchingHTMLLoader$.value),Nr(1),bo("innerHTML",e.historyHTML,Gn)}}function Px(e,t){if(1&e){const e=Io();wo(0,"div",24),wo(1,"div",25),wo(2,"button",26),Ao("click",(function(){return Rt(e),Fo(2).returnToHomePage()})),Co(3,"img",27),ko(),fo(4,mx,5,1,"div",28),fo(5,_x,3,2,"div",29),fo(6,vx,2,0,"span",30),fo(7,bx,2,0,"span",31),fo(8,wx,4,2,"div",32),fo(9,kx,2,0,"span",33),ko(),Co(10,"div",14),fo(11,Cx,9,10,"div",34),wo(12,"div",15,35),wo(14,"ng-miam-catalog-toolbar",17),Ao("filterButtonPressed",(function(){return Rt(e),Fo(2).onFilterCollapsed()}))("preferencesButtonPressed",(function(){Rt(e);const t=Fo(2);return t.isPreferenceModalOpen=!t.isPreferenceModalOpen}))("searchStringChanged",(function(t){return Rt(e),Fo(2).updateSearch(t)}))("favoritesButtonPressed",(function(){return Rt(e),Fo(2).checkAndSetFavoritesFilter()}))("returnHomePressed",(function(){return Rt(e),Fo(2).returnToHomePage()})),ko(),ko(),fo(15,xx,1,13,"ng-miam-catalog-list",36),fo(16,Ix,3,2,"div",37),ko()}if(2&e){const e=_o(13),t=Fo(2);Nr(4),bo("ngIf",t.isSearchPage()),Nr(1),bo("ngIf",t.isFavoritesPage()),Nr(1),bo("ngIf",t.isPromotionsPage()),Nr(1),bo("ngIf",t.isAllRecipesPage()),Nr(1),bo("ngIf",t.isCategoryPage()),Nr(1),bo("ngIf",t.isDefaultPage()),Nr(2),bo("ngIf",t.isFavoritesPage()&&t.contextService.orderHistoryEnabled),Nr(3),bo("home",t.displayHomePage())("history",t.historyDisplayed)("searchTerm",null==t.filters?null:t.filters.search)("additionalFiltersTitle",null==t.filters||null==t.filters.additionalFilters?null:t.filters.additionalFilters.title)("hideButtons",t.isFavoritesPage())("filterBadgeCount",t.filters.selectableFiltersCount())("reduced",e.classList.contains("sticking")),Nr(1),bo("ngIf",!t.historyDisplayed),Nr(1),bo("ngIf",t.contextService.orderHistoryEnabled&&t.historyDisplayed)}}function Dx(e,t){if(1&e){const e=Io();So(0),wo(1,"ng-miam-catalog-category",64),Ao("displayList",(function(t){return Rt(e),Fo(5).categoryTitleClicked(t)})),ko(),xo()}if(2&e){const e=Fo().$implicit,t=Fo(4);Nr(1),bo("title",e.title)("subtitle",e.subtitle)("filters",e.filters)("maxRecipeNumber",t.maxRecipesPerCategory)("displayInfos",t.displayInfos)("displayPricing",t.displayPricing)("originTrace",t.eventTrace)("modifiedGuests",t.guests)("displayRecipeVariant",t.displayRecipeVariant)}}function Tx(e,t){1&e&&Co(0,"ng-miam-meals-planner-link")}function Ax(e,t){if(1&e){const e=Io();wo(0,"div",65),fo(1,Tx,1,0,"ng-miam-meals-planner-link",40),Ec(2,"async"),wo(3,"ng-miam-catalog-category",66),Ao("displayList",(function(t){return Rt(e),Fo(5).categoryTitleClicked(t)}))("isHidden",(function(t){return Rt(e),Fo(5).categoryHidden(t)})),ko(),ko(),wo(4,"div",67),Ao("click",(function(){return Rt(e),Fo(5).seeAllRecipes()})),wo(5,"div",68),Qo(6,"tradof#Toutes nos recettes#"),ko(),wo(7,"div",69),Co(8,"img",70),ko(),ko()}if(2&e){const e=Fo().$implicit,t=Fo(4);Nr(1),bo("ngIf",Ic(2,10,t.contextService.enableMealsPlanner$)),Nr(2),bo("title",e.title)("subtitle",e.subtitle)("filters",e.filters)("displayInfos",t.displayInfos)("displayPricing",t.displayPricing)("maxRecipeNumber",t.maxRecipesPerCategory)("modifiedGuests",t.guests)("displayRecipeVariant",t.displayRecipeVariant)("originTrace",t.eventTrace)}}function Rx(e,t){if(1&e&&(So(0),fo(1,Dx,2,9,"ng-container",62),fo(2,Ax,9,12,"ng-template",null,63,Wc),xo()),2&e){const e=t.index,i=_o(3);Nr(1),bo("ngIf",0!==e)("ngIfElse",i)}}function Ox(e,t){if(1&e&&(wo(0,"div",60),fo(1,Rx,4,2,"ng-container",61),ko()),2&e){const e=Fo(3);Nr(1),bo("ngForOf",e.categories)}}function Fx(e,t){1&e&&fo(0,Ox,2,1,"div",59),2&e&&bo("ngIf",Fo(2).categories.length>0)}function Bx(e,t){if(1&e){const e=Io();wo(0,"div",3),wo(1,"div",4),wo(2,"ng-miam-catalog-header",5),Ao("returnButtonPressed",(function(){return Rt(e),Fo().returnToHomePage()})),ko(),fo(3,ux,1,0,"div",6),fo(4,dx,3,7,"div",7),fo(5,hx,2,0,"div",8),fo(6,px,8,1,"div",9),fo(7,Px,17,16,"div",10),ko(),wo(8,"ng-miam-recipe-filters",11),Ao("filterChanged",(function(t){return Rt(e),Fo().updateFilters(t)}))("filterCollapsed",(function(){return Rt(e),Fo().onFilterCollapsed()}))("preferencesChanged",(function(){return Rt(e),Fo().reloadPackages()})),ko(),wo(9,"ng-miam-preferences",12),Ao("isOpenChange",(function(t){return Rt(e),Fo().isPreferenceModalOpen=t}))("preferencesChanged",(function(){Rt(e);const t=Fo();return t.updateFilters(t.filters,!1),t.reloadPackages()})),ko(),fo(10,Fx,1,1,"ng-template",null,13,Wc),ko()}if(2&e){const e=_o(11),t=Fo();Nr(2),bo("home",t.displayHomePage())("history",t.historyDisplayed)("searchTerm",null==t.filters?null:t.filters.search)("additionalFiltersTitle",null==t.filters||null==t.filters.additionalFilters?null:t.filters.additionalFilters.title)("homeLabel",t.homeLabel)("pictureUrl",t.displayHomePage()?t.headerPictureUrl:null)("catalogSetting",t.catalogSetting),Nr(1),bo("ngIf",t.displayHomePage()),Nr(1),bo("ngIf",t.displayHomePage()),Nr(1),bo("ngIf",t.displayHomePage()),Nr(1),bo("ngIf",t.recipeCount>0),Nr(1),bo("ngIf",!t.displayHomePage()||t.forceListView)("ngIfElse",e),Nr(1),bo("filters",t.filters)("isFilterCollapsed",t.isFilterCollapsed)("filterToRemove",t.filterToRemove)("position",t.filtersPosition),Nr(1),bo("isOpen",t.isPreferenceModalOpen)("filters",t.filters)}}let Mx=(()=>{class e extends jy{constructor(e,t,i,n,r,s,o,a,c,l,u,h,p,m,g){super(e),this.cdr=t,this.sponsorService=i,this.supplierService=n,this.packageService=r,this.recipesService=s,this.mediaMatcher=o,this.usersService=a,this.catalogSettingService=c,this.basketsService=l,this.contextService=u,this.historyService=h,this.contextRegistryService=p,this.basketUtilsService=m,this.sanitizer=g,this.headerPictureUrl="https://storage.googleapis.com/assets.miam.tech/generic/images/default-catalog-picture.png",this.initialRoute="",this.filtersPosition="right",this.displayInfos=!1,this.displayPricing=!0,this.displayRecipeVariant=1,this.maxRecipesPerCategory=20,this.isFilterCollapsed=!0,this.icon=Cv,this.categories=[],this.isMobile=!1,this.showUserFeedback=!1,this.recipeCount=0,this.totalPrice=0,this.isMyMealClose=!0,this.catalogSettingHasLoaded=!1,this.guests=+localStorage.getItem("_miam/preferences/guests"),this.forceListView=!1,this.historyDisplayed=!1,this.subscriptions=[],this.headerHeightSubscription=new d,this.isMobile=o.matchMedia("(max-width: 1022px)").matches,this.historyService.loadComponentScripts()}set isPreferenceModalOpen(e){this._isPreferenceModalOpen=e,this.cdr.detectChanges()}get isPreferenceModalOpen(){return this._isPreferenceModalOpen}ngOnInit(){this.analyticsService.isMealzPage=!0,this.pageview(),this.initFilters(),this.subscriptions.push(this.supplierService.supplier$.asObservable().pipe(bp(e=>void 0===e||null==e),fp(1),th(e=>(this.supplierId=e.id,this.initCatalogHeader(e),this.loadPackages()))).subscribe(),this.basketsService.basketStats$.pipe(bp(e=>!e)).subscribe(e=>{this.recipeCount=e.recipesCount,this.totalPrice=e.totalPrice,this.cdr.detectChanges()}),this.historyService.fetchingHTMLLoader$.subscribe(()=>{this.cdr.detectChanges()}),this.assessShowUserFeedback(),this.executeStoredMethodIfLoggedIn().subscribe()),this.setDirectAccess()}ngAfterViewInit(){this.openFeaturesFromURL(),this.initHeaderHeightListener(),this.cdr.detectChanges()}ngOnDestroy(){var e,t;this.analyticsService.isMealzPage=!1,this.subscriptions.forEach(e=>e.unsubscribe()),null===(e=this.headerHeightSubscription)||void 0===e||e.unsubscribe(),null===(t=this.stickyToolbarObserver)||void 0===t||t.disconnect()}currentPath(){return"recipes"}openFeaturesFromURL(){var e;const t=new URLSearchParams(window.location.search);"true"===t.get("openBasket")&&this.basketUtilsService.openBasket();const i=null===(e=t.get("cost"))||void 0===e?void 0:e.split(",");2===(null==i?void 0:i.length)&&this.setPriceFilters(i)}displayHomePage(){return this.filters.isEmpty()&&!this.forceListView}toggleHistory(e){e&&this.loadHistoryContent(),this.historyDisplayed=e,this.cdr.detectChanges()}initCatalogHeader(e){var t,i,n;if(null===(t=e.relationships["catalog-setting"])||void 0===t?void 0:t.data){const t=null===(n=null===(i=e.relationships["catalog-setting"])||void 0===i?void 0:i.data)||void 0===n?void 0:n.id;this.subscriptions.push(this.catalogSettingService.get(t).pipe(bp(e=>e.is_loading),fp(1),df(e=>{this.catalogSetting=e,this.catalogSettingHasLoaded=!0,this.cdr.detectChanges(),this.setStickyObserver()})).subscribe())}else this.catalogSettingHasLoaded=!0,this.cdr.detectChanges(),this.setStickyObserver()}deepCloneAndResetValues(e){return e.map(e=>Object.assign(Object.assign({},e),{value:!1}))}initFilters(){this.forceListView=!1,this.filters=new Uf({difficulty:this.recipesService.difficultyLevels.map(e=>({name:e.value.toString(),text:e.label,value:!1})),cost:[{name:"0-5",value:!1},{name:"5-10",value:!1},{name:"10-1000",value:!1}],time:[{name:"15",value:!1},{name:"30",value:!1},{name:"60",value:!1},{name:"120",value:!1}]}),this.customFilters&&Object.keys(this.customFilters).forEach(e=>{this.filters[e]=this.deepCloneAndResetValues(this.customFilters[e])}),this.catalogToolbar&&this.catalogToolbar.resetSearchString(),this.filters.search="",this.filters.additionalFilters=null}updateFilters(e,t=!0){this.filters=e.copy(),this.forceListView=t,this.filterToRemove=void 0,this.cdr.detectChanges(),this.setStickyObserver(),this.returnToTop()}seeAllRecipes(){this.filters.additionalFilters={title:"Toutes nos recettes",filters:{}},this.updateFilters(this.filters)}updateSearch(e){if(this.historyDisplayed&&e!==this.historySearch)this.loadHistoryContent(e);else if(e!==this.filters.search){const t=Object.assign(this.filters,{search:e});this.updateFilters(t)}}categoryHidden(e){e&&(this.categories.splice(0,1),this.cdr.detectChanges())}categoryTitleClicked(e){const t=Object.assign(this.filters,{additionalFilters:{filters:e.filters,title:e.title,subtitle:e.subtitle}});this.updateFilters(t)}goToPromotions(){this.setPromotionsFilter()}checkAndSetFavoritesFilter(){this.storeMethodIfCallbackNeeded("setFavoritesFilter").pipe(th(()=>(this.setFavoritesFilter(),td(null)))).subscribe()}setPromotionsFilter(){this.initFilters();const e=Object.assign(this.filters,{additionalFilters:{filters:{discounted_ingredients_count:1},title:"Promos"}});this.updateFilters(e)}setFavoritesFilter(){this.initFilters();const e=Object.assign(this.filters,{additionalFilters:{filters:{liked:!0},title:"Mes id\xe9es repas"}});this.updateFilters(e)}storeMethodIfCallbackNeeded(e){return this.isUserLoggedIn().pipe(fp(1),E(t=>(t||localStorage.setItem("_miam/storeCallbackMethod",e),this.contextRegistryService.hookCallback(t,!0))))}isUserLoggedIn(){return this.usersService.isLogged$}executeStoredMethodIfLoggedIn(){return this.isUserLoggedIn().pipe(bp(e=>!e),fp(1),E(()=>this.getStoredMethod()))}getStoredMethod(){"setFavoritesFilter"===localStorage.getItem("_miam/storeCallbackMethod")&&(this.setFavoritesFilter(),localStorage.removeItem("_miam/storeCallbackMethod"))}setPriceFilters(e){const t=Object.assign(this.filters,{additionalFilters:{filters:{computed_cost:e[0]+",gt,"+e[1]+",lt",recipe_type_id:"main-dish"},title:`Recettes \xe0 moins de ${e[1]}\u20ac`}});this.updateFilters(t)}removeFilter(e){throw new Error("This function is broken, use has been commentated, repair it if you want to use it again")}returnToTop(){this.topAnchor&&this.topAnchor.nativeElement.scrollIntoView()}returnToHomePage(){this.pageview(),this.initFilters(),this.historyDisplayed=!1,this.cdr.detectChanges(),this.setStickyObserver(),this.returnToTop()}onFilterCollapsed(){this.isFilterCollapsed=!this.isFilterCollapsed,this.cdr.detectChanges()}reloadPackages(){this.guests=+localStorage.getItem("_miam/preferences/guests"),this.subscriptions.push(this.loadPackages().subscribe())}isSearchPage(){return!this.displayHomePage()&&!this.historyDisplayed&&this.filters.search&&this.filters.search.length>0}isFavoritesPage(){var e,t;return!this.displayHomePage()&&!this.isSearchPage()&&"Mes id\xe9es repas"===(null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.title)}isPromotionsPage(){var e,t;return!this.displayHomePage()&&!this.isSearchPage()&&"Promos"===(null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.title)}isAllRecipesPage(){var e,t;return!(this.displayHomePage()||this.isSearchPage()||this.isFavoritesPage()||this.isPromotionsPage()||"Toutes nos recettes"!==(null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.title))}isCategoryPage(){var e,t,i;return!this.displayHomePage()&&!this.isSearchPage()&&!this.isFavoritesPage()&&!this.isPromotionsPage()&&!this.isAllRecipesPage()&&(null===(i=null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.title)||void 0===i?void 0:i.length)>0}isDefaultPage(){return!(this.displayHomePage()||this.isSearchPage()||this.isFavoritesPage()||this.isPromotionsPage()||this.isAllRecipesPage()||this.isCategoryPage())}loadPackages(){return this.packageService.categories_for([this.supplierId]).pipe(bp(e=>e.is_loading),df(e=>{this.initCategories(e),this.selectCategoryFromUrl(),this.cdr.detectChanges()}))}loadHistoryContent(e=""){""!==e&&(this.historyHTML=null),this.historyHTML||this.subscriptions.push(this.historyService.displayHistory(e).subscribe(t=>{this.historySearch=e,this.historyHTML=this.sanitizer.bypassSecurityTrustHtml(t),this.cdr.detectChanges(),this.historyService.replaceNoHistoryRedirection(this.contextService.catalogUrl)}))}initCategories(e){this.categories=e.data.map(e=>({key:e.title.trim().toLowerCase().replace(/[^a-zA-Z0-9 -]/,"").replace(/\s/g,"-"),title:e.title,subtitle:e.subtitle,filters:new Uf({additionalFilters:{filters:{packages:e.id},title:""}})}))}selectCategoryFromUrl(){const e=new URLSearchParams(window.location.search);if("favorites"===e.get("catalogCategory"))return this.checkAndSetFavoritesFilter();const t=this.categories.find(t=>t.key===e.get("catalogCategory"));return t?this.categoryTitleClicked({title:t.title,subtitle:t.subtitle,filters:t.filters.additionalFilters.filters}):void 0}assessShowUserFeedback(){return Xg([this.usersService.isLogged$,this.usersService.hasPreference("has_children"),this.usersService.preferencesActivated$]).subscribe(e=>{this.showUserFeedback=e[0]&&!e[1]&&e[2],this.cdr.detectChanges()})}setDirectAccess(){if(""!==this.initialRoute)switch(this.initialRoute){case"mes-repas":this.basketUtilsService.openBasket();break;case"recettes-favorites":this.checkAndSetFavoritesFilter()}}initHeaderHeightListener(){this.headerHeightSubscription.add(this.contextService.supplierHeaderHeight$.subscribe(()=>{document.querySelector(".miam-recipe-catalog__toolbar-container-anchor")&&(this.setStickyObserver(),this.cdr.detectChanges())}))}setStickyObserver(){var e;const t=document.querySelector(".miam-recipe-catalog__toolbar-container-anchor"),i=document.querySelector(".miam-recipe-catalog__toolbar-container");if(!t||!i)return;const n={rootMargin:`-${this.contextService.supplierHeaderHeight$.value}px 0px 0px 0px`,threshold:1};null===(e=this.stickyToolbarObserver)||void 0===e||e.unobserve(t),this.stickyToolbarObserver=new IntersectionObserver(()=>{this.setStickyToolbarStyle(t,i)},n),this.stickyToolbarObserver.observe(t)}setStickyToolbarStyle(e,t){const i=e.getBoundingClientRect(),n=this.contextService.supplierHeaderHeight$.value,r=t.classList.toggle("sticking",i.top<n);e.style.height=r?t.clientHeight+"px":"0px",t.style.top=n+"px",this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(s_),vo(Nf),vo(o_),vo(__),vo(ov),vo(Yf),vo(U_),vo(C_),vo(Iv),vo(Dv),vo(Dp),vo(V_),vo(Lh))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-catalog"]],viewQuery:function(e,t){if(1&e&&(Uc(gS,1),Uc(AS,1),Uc(cx,1),Uc(lx,1),Uc(YC,1)),2&e){let e;Hc(e=qc())&&(t.catalogHeader=e.first),Hc(e=qc())&&(t.catalogToolbar=e.first),Hc(e=qc())&&(t.topAnchor=e.first),Hc(e=qc())&&(t.returnHomeButton=e.first),Hc(e=qc())&&(t.categoriesComp=e)}},inputs:{headerPictureUrl:"headerPictureUrl",initialRoute:"initialRoute",filtersPosition:"filtersPosition",homeLabel:"homeLabel",displayInfos:"displayInfos",displayPricing:"displayPricing",displayRecipeVariant:"displayRecipeVariant",maxRecipesPerCategory:"maxRecipesPerCategory",customFilters:"customFilters"},features:[eo],decls:3,vars:1,consts:[[1,"miam-catalog-anchor"],["miamCatalogTopAnchor",""],["class","miam-recipe-catalog",4,"ngIf"],[1,"miam-recipe-catalog"],[1,"miam-recipe-catalog__content"],[3,"home","history","searchTerm","additionalFiltersTitle","homeLabel","pictureUrl","catalogSetting","returnButtonPressed"],["class","miam-recipe-catalog__toolbar-container-anchor",4,"ngIf"],["class","miam-recipe-catalog__toolbar-container",4,"ngIf"],["class","miam-recipe-catalog__promotions-banner",4,"ngIf"],["class","miam-recipe-catalog__content__myMeal__button",3,"click",4,"ngIf"],["class","miam-recipe-catalog__list",4,"ngIf","ngIfElse"],[3,"filters","isFilterCollapsed","filterToRemove","position","filterChanged","filterCollapsed","preferencesChanged"],[3,"isOpen","filters","isOpenChange","preferencesChanged"],["categoriesComponents",""],[1,"miam-recipe-catalog__toolbar-container-anchor"],[1,"miam-recipe-catalog__toolbar-container"],["stickyToolbar",""],[3,"home","history","searchTerm","additionalFiltersTitle","hideButtons","filterBadgeCount","reduced","filterButtonPressed","preferencesButtonPressed","searchStringChanged","favoritesButtonPressed","returnHomePressed"],[1,"miam-recipe-catalog__promotions-banner"],[3,"clicked"],[1,"miam-recipe-catalog__content__myMeal__button",3,"click"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/cutlery-white.svg","alt","Cutlery",1,"miam-recipe-catalog__myMeal__first__icon"],[1,"miam-recipe-catalog__myMeal__button__text","mealz-ds-text","weight-xl"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/chevron-down-white.svg","alt","Caret",1,"miam-recipe-catalog__myMeal__second__icon"],[1,"miam-recipe-catalog__list"],[1,"miam-recipe-catalog__content__title"],[1,"miam-recipe-catalog__content__title-icon","mealz-ds-button","primary","square",3,"click"],["alt","return","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/ArrowLeft_white.svg"],["class","miam-recipe-catalog__content__title__search__text",4,"ngIf"],["class","miam-recipe-catalog__content__title__favorites__text",4,"ngIf"],["class","miam-recipe-catalog__content__title__promotions__text",4,"ngIf"],["class","miam-recipe-catalog__content__title__all-recipes__text",4,"ngIf"],["class","miam-recipe-catalog__content__title__category",4,"ngIf"],["class","miam-recipe-catalog__content__default__text",4,"ngIf"],["class","miam-catalog-tabs mealz-ds-tabs",4,"ngIf"],["stickyToolbarCollection",""],[3,"ngClass","filters","originTrace","displayPricing","displayInfos","modifiedGuests","displayRecipeVariant","filterRemoved",4,"ngIf"],["class","miam-recipe-catalog__history-container",4,"ngIf"],[1,"miam-recipe-catalog__content__title__search__text"],[1,"miam-recipe-catalog__content__title__favorites__text"],[4,"ngIf"],[1,"miam-recipe-catalog__content__title__promotions__text"],[1,"miam-recipe-catalog__content__title__all-recipes__text"],[1,"miam-recipe-catalog__content__title__category"],[1,"mealz-ds-text","size-l","weight-xxl"],["class","mealz-ds-text size-s weight-l",4,"ngIf"],[1,"mealz-ds-text","size-s","weight-l"],[1,"miam-recipe-catalog__content__default__text"],[1,"miam-catalog-tabs","mealz-ds-tabs"],[1,"miam-catalog-tabs__item","mealz-ds-tab-item","mealz-ds-text","active",3,"click"],["alt","heart icon",3,"src"],[1,"miam-catalog-tabs__item","mealz-ds-tab-item","mealz-ds-text","inactive",3,"click"],["alt","history icon",3,"src"],[3,"ngClass","filters","originTrace","displayPricing","displayInfos","modifiedGuests","displayRecipeVariant","filterRemoved"],[1,"miam-recipe-catalog__history-container"],["class","miam-recipe-catalog__history-loader",4,"ngIf"],[3,"innerHTML"],[1,"miam-recipe-catalog__history-loader"],[1,"miam-ds-loader"],["class","miam-recipe-catalog__categories",4,"ngIf"],[1,"miam-recipe-catalog__categories"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["firstCategory",""],[3,"title","subtitle","filters","maxRecipeNumber","displayInfos","displayPricing","originTrace","modifiedGuests","displayRecipeVariant","displayList"],[1,"miam-recipe-catalog__first-category"],[3,"title","subtitle","filters","displayInfos","displayPricing","maxRecipeNumber","modifiedGuests","displayRecipeVariant","originTrace","displayList","isHidden"],[1,"miam-recipe-catalog__all-banner",3,"click"],[1,"miam-recipe-catalog__all-banner__text","mealz-ds-text","size-m","weight-xl"],[1,"miam-recipe-catalog__all-banner__icon"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/ArrowLeft_black.svg","alt","arrow right"]],template:function(e,t){1&e&&(Co(0,"div",0,1),fo(2,Bx,12,19,"div",2)),2&e&&(Nr(2),bo("ngIf",t.catalogSettingHasLoaded))},directives:[Ou,gS,Rw,qS,AS,Hw,ax,Du,Au,YC,Hy],pipes:[Wu],styles:[".miam-recipe-catalog{display:flex;justify-content:space-between;width:100%;position:relative;background-color:var(--mealz-ds-color-neutral-white)}.miam-recipe-catalog .miam-recipe-catalog__toolbar-container-anchor{width:100%}.miam-recipe-catalog .miam-recipe-catalog__toolbar-container{width:-moz-available;width:-webkit-fill-available;width:fill-available;padding:33px 80px 0;box-sizing:border-box;background-color:var(--mealz-ds-color-neutral-white);transition:padding .3s ease}.miam-recipe-catalog .miam-recipe-catalog__toolbar-container.sticking{position:fixed;top:0;z-index:10;border-bottom:1px solid var(--mealz-ds-color-neutral-200,#d9dde1);padding:16px 40px}@media (max-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__toolbar-container{padding:24px 16px 0}.miam-recipe-catalog .miam-recipe-catalog__toolbar-container.sticking{padding:8px}}.miam-recipe-catalog .miam-recipe-catalog__content{width:100%;position:relative}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title{width:100%;padding:0 80px;font-size:20px;line-height:34px;font-weight:900;display:flex;align-items:center;color:var(--mealz-ds-color-neutral-black,#0f191f);box-sizing:border-box}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title>:not(:last-child){margin-right:16px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title__search__text{display:flex;flex-wrap:wrap}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title__search__text>:not(:last-child){margin-right:6px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title-icon{width:32px;height:32px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title-icon img{cursor:pointer;width:13px;height:13px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title__category{display:flex;flex-direction:column}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title__category>:not(:last-child){margin-bottom:4px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title__category .size-s{color:var(--mealz-ds-color-neutral-500)}@media (max-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title{width:100%;padding:0 24px;box-sizing:border-box}}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__promotions-banner{display:none;justify-content:center;margin-top:36px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories{display:flex;flex-direction:column;width:100%;padding:4px 80px 48px;box-sizing:border-box}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category{display:flex;flex-direction:row;width:100%;align-items:flex-end}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category ng-miam-meals-planner-link{margin:0 16px 36px 0}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category ng-miam-catalog-category{flex:1}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__all-banner{display:flex;padding:24px 0;justify-content:center;align-items:center;gap:8px;align-self:stretch;border-radius:8px;background:var(--mealz-ds-color-neutral-100,#eff1f3);cursor:pointer}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__all-banner .miam-recipe-catalog__all-banner__text{color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__all-banner .miam-recipe-catalog__all-banner__icon{transform:rotate(-180deg);height:24px}@media (max-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories{padding:24px 0 48px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category{flex-direction:column;align-items:flex-start}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category ng-miam-catalog-category{width:100%}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category ng-miam-meals-planner-link{width:100%;padding:0 24px 24px;box-sizing:border-box;margin:unset}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__all-banner{margin:0 24px}}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list{width:100%;padding:24px 0;box-sizing:border-box}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list .miam-recipe-catalog__toolbar-container:not(.sticking){padding-bottom:24px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list .miam-recipe-catalog__toolbar-container.sticking{padding:8px 24px}@media (max-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list .miam-recipe-catalog__toolbar-container .sticking{padding:8px}}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list .miam-recipe-catalog__history-container .miam-recipe-catalog__history-loader{width:100%;font-size:20px;font-weight:700;color:var(--m-color-grey-text);text-align:center}.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs{position:relative;display:flex;box-sizing:border-box;width:100%;padding:24px 80px 0;background-color:var(--mealz-ds-color-neutral-white,#fff);transition:padding .3s ease}.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs .miam-catalog-tabs__item{display:flex;align-items:center;gap:4px;text-decoration:none}.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs .miam-catalog-tabs__item.inactive span{color:var(--mealz-ds-color-neutral-black,#0f191f);opacity:.7}@media (max-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs{padding:24px 24px 0}}@media (max-width:700px){.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs{padding:24px 0 0}.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs .miam-catalog-tabs__item{width:100%;justify-content:center;display:flex}}.miam-recipe-catalog .miam-recipe-catalog__content__myMeal__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;border-radius:1000px;background:var(--miam-color-primary-900,#10323f);box-shadow:0 8px 16px 0 rgba(0,0,0,.2)}.miam-recipe-catalog .miam-recipe-catalog__content__myMeal__button>:not(:last-child){margin-right:12px}.miam-recipe-catalog .miam-recipe-catalog__content__myMeal__button .miam-recipe-catalog__myMeal__button__text{font-weight:700;color:var(--mealz-ds-color-neutral-white,#fff);white-space:nowrap}.miam-recipe-catalog .miam-recipe-catalog__content__myMeal__button .miam-recipe-catalog__myMeal__second__icon{transform:rotate(-90deg)}@media (max-width:607px){.miam-recipe-catalog .miam-recipe-catalog__content__myMeal__button{width:auto;z-index:2}}.miam-recipe-catalog ng-miam-recipe-card .miam-recipe-card{height:var(--m-catalog-card-height);width:var(--m-catalog-card-width)}"],encapsulation:2,changeDetection:0}),e})(),Lx=(()=>{class e{constructor(e){const t={preferences:qS};Object.keys(t).map(i=>{const n="webc-miam-"+i;if(!customElements.get(n)){const r=uh(t[i],{injector:e});customElements.define(n,r)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,Lk,$k]]}),e})(),$x=(()=>{class e{constructor(e){const t={"recipe-catalog":Mx};Object.keys(t).map(i=>{const n="webc-miam-"+i;if(!customElements.get(n)){const r=uh(t[i],{injector:e});customElements.define(n,r)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,Lk,$k,VC,Ib,Lx]]}),e})();function jx(e,t){if(1&e){const e=Io();wo(0,"ng-miam-modal",1),Ao("close",(function(){return Rt(e),Fo().onClose()})),wo(1,"div",2),Co(2,"div",3),wo(3,"div",4),wo(4,"div",5),wo(5,"div",6),wo(6,"span"),Qo(7,"Cump\u0103ra\u021bi pe baza re\u021betelor"),ko(),ko(),wo(8,"div",7),wo(9,"span"),Qo(10,"tradof#Dor\xe9navant faites vos courses \xe0 partir de recettes et ajoutez les ingr\xe9dients en 1 clic !#"),ko(),ko(),ko(),wo(11,"div",8),wo(12,"div",9),wo(13,"span"),Qo(14,"Cum func\u021bioneaz\u0103?"),ko(),ko(),wo(15,"div",10),wo(16,"div",11),wo(17,"div",12),wo(18,"span"),Qo(19,"1"),ko(),ko(),ko(),wo(20,"div",13),wo(21,"span"),Qo(22,"tradof#Retrouvez le d\xe9tail de la recette en cliquant sur la carte.#"),ko(),ko(),ko(),wo(23,"div",10),wo(24,"div",11),wo(25,"div",12),wo(26,"span"),Qo(27,"2"),ko(),ko(),ko(),wo(28,"div",13),wo(29,"span"),Qo(30,"tradof#Ajustez le nombre de convives si n\xe9cessaire.#"),ko(),ko(),ko(),wo(31,"div",10),wo(32,"div",11),wo(33,"div",12),wo(34,"span"),Qo(35,"3"),ko(),ko(),ko(),wo(36,"div",13),wo(37,"span"),Qo(38,'tradof#Cliquez sur "Ajouter les ingr\xe9dients" et ajustez les produits si besoin.#'),ko(),ko(),ko(),wo(39,"div",10),wo(40,"div",11),wo(41,"div",12),wo(42,"span"),Qo(43,"4"),ko(),ko(),ko(),wo(44,"div",13),wo(45,"span"),Qo(46,"At\xe2t, se adaug\u0103! G\u0103si\u021bi detaliul"),ko(),wo(47,"span"),Qo(48),ko(),ko(),ko(),ko(),ko(),ko(),ko()}if(2&e){const e=Fo();bo("display",e.isDisplayed)("noHeaderMode",!0),Nr(48),Ko("",e.stringDetailLocation,".")}}let zx=(()=>{class e{constructor(e,t){this.cdr=e,this.recipesService=t,this.stringDetailLocation="dans l'onglet Mes Repas",this.close=new Rc,this.icon=Cv,this.isDisplayed=!1,this.subscriptions=[]}ngOnInit(){this.subscriptions.push(this.recipesService.displayHelper$.subscribe(e=>{this.isDisplayed=e,this.cdr.detectChanges()}))}onClose(){this.recipesService.toggleHelper(),this.close.emit()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga),vo(__))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-helper"]],inputs:{stringDetailLocation:"stringDetailLocation"},outputs:{close:"close"},decls:1,vars:1,consts:[["class","miam-recipe-helper__modal",3,"display","noHeaderMode","close",4,"ngIf"],[1,"miam-recipe-helper__modal",3,"display","noHeaderMode","close"],[1,"miam-recipe-helper"],[1,"miam-recipe-helper__image"],[1,"miam-recipe-helper__content"],[1,"miam-recipe-helper__header"],[1,"miam-recipe-helper__title","mealz-ds-text","size-xl","weight-xxl"],[1,"mealz-ds-text","weight-l"],[1,"miam-recipe-helper__steps"],[1,"miam-recipe-helper__how","mealz-ds-text","weight-xxl"],[1,"miam-recipe-helper__step"],[1,"miam-recipe-helper__step-number","mealz-ds-text","size-s","weight-xxl"],[1,"miam-recipe-helper__step-number__number"],[1,"miam-recipe-helper__step-description","mealz-ds-text","size-s","weight-l"]],template:function(e,t){1&e&&fo(0,jx,49,3,"ng-miam-modal",0),2&e&&bo("ngIf",t.isDisplayed)},directives:[Ou,sw],styles:[".miam-recipe-helper{display:flex;flex-direction:row}@media (max-width:1023px){.miam-recipe-helper{flex-direction:column}}.miam-recipe-helper .miam-recipe-helper__image{width:280px;height:500px;flex-shrink:0;background:50%/cover no-repeat url(https://storage.googleapis.com/assets.miam.tech/generic/images/default-recipe-helper-picture.jpeg)}@media (max-width:1023px){.miam-recipe-helper .miam-recipe-helper__image{width:100%;height:250px}}.miam-recipe-helper .miam-recipe-helper__content{padding:24px}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__header{margin-bottom:24px}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__header .miam-recipe-helper__title{margin-bottom:4px}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__steps .miam-recipe-helper__how{margin-bottom:16px}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__steps .miam-recipe-helper__step{display:flex;flex-direction:row;margin-bottom:12px;align-items:center}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__steps .miam-recipe-helper__step .miam-recipe-helper__step-number{width:24px;height:24px;border-radius:100px;background-color:var(--mealz-ds-color-primary);color:var(--mealz-ds-color-primary-text);margin-right:8px}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__steps .miam-recipe-helper__step .miam-recipe-helper__step-number .miam-recipe-helper__step-number__number{width:24px;height:24px;align-items:center;display:flex;justify-content:center}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__steps .miam-recipe-helper__step .miam-recipe-helper__step-description span+span{margin-left:5px}.miam-recipe-helper__modal .miam-modal__container.center .miam-modal{padding:unset}@media (max-width:1023px){.miam-recipe-helper__modal .miam-modal__container.center .miam-modal .miam-modal__content-container .miam-modal__header .miam-modal__close-button{border-radius:100px;padding:24px;background-color:#fff}.miam-recipe-helper__modal .miam-modal__container.center .miam-modal .miam-modal__content-container .miam-modal__content{padding:unset}}"],encapsulation:2,changeDetection:0}),e})();var Nx,Vx=function(e,t,i,n){for(var r=-1,s=null==e?0:e.length;++r<s;){var o=e[r];t(n,o,i(o),e)}return n},Hx=function(e,t){if(null==e)return e;if(!Jm(e))return function(e,t){return e&&function(e,t,i){for(var n=-1,r=Object(e),s=i(e),o=s.length;o--;){var a=s[++n];if(!1===t(r[a],a,r))break}return e}(e,t,Xm)}(e,t);for(var i=e.length,n=-1,r=Object(e);++n<i&&!1!==t(r[n],n,r););return e},Ux=function(e,t,i,n){return Hx(e,(function(e,r,s){t(n,e,i(e),s)})),n},qx=Object.prototype.hasOwnProperty,Gx=(Nx=function(e,t,i){qx.call(e,i)?e[i].push(t):function(e,t,i){"__proto__"==t&&zg?zg(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}(e,i,[t])},function(e,t){return(Qp(e)?Vx:Ux)(e,Nx,Mg(t),{})});const Wx=["tag"];function Zx(e,t){if(1&e){const e=Io();wo(0,"div",11,12),wo(2,"ng-miam-icon",13),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(3).toggleRecipe(i.id)})),ko(),wo(3,"span",14),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(3).toggleRecipe(i.id)})),Qo(4),Ec(5,"ellipsis"),ko(),ko()}if(2&e){const e=t.$implicit,i=Fo(3);Nr(2),bo("iconName",i.icon.Meal),Nr(2),Yo(Pc(5,2,e.title,6))}}const Qx=function(e){return{"height.px":e}},Yx=function(e){return{"miam-recipe-tags__container__toggle__hidden":e}},Kx=function(e){return{opacity:e}};function Jx(e,t){if(1&e){const e=Io();wo(0,"div",3),wo(1,"div",4),fo(2,Zx,6,5,"div",5),ko(),wo(3,"div",6),wo(4,"span",7),Ao("click",(function(){return Rt(e),Fo(2).toggleList()})),Qo(5),ko(),Co(6,"div",8),wo(7,"span",9),Ao("click",(function(){return Rt(e),Fo(2).toggleList()})),Co(8,"ng-miam-icon",10),ko(),ko(),ko()}if(2&e){const e=Fo(2);bo("ngStyle",bc(6,Qx,e.isListOpen?32*e.rowCount:24)),Nr(2),bo("ngForOf",e.recipePreviewLines),Nr(1),bo("ngClass",bc(8,Yx,!e.rowCount||0===e.wrappedItemsCount)),Nr(2),Ko(" ",e.isListOpen?" ":"+"+e.wrappedItemsCount,""),Nr(2),bo("ngStyle",bc(10,Kx,e.isListOpen?1:0)),Nr(1),bo("iconName",e.icon.ChevronDown)}}function Xx(e,t){if(1&e&&(So(0),fo(1,Jx,9,12,"div",2),xo()),2&e){const e=Fo();Nr(1),bo("ngIf",(null==e.recipePreviewLines?null:e.recipePreviewLines.length)>0)}}function eE(e,t){if(1&e){const e=Io();wo(0,"div",17),Ao("click",(function(){return Rt(e),Fo(2).toggleModal()})),wo(1,"span",18),Qo(2),ko(),wo(3,"span"),Qo(4,"mas\u0103"),ko(),ko()}if(2&e){const e=Fo(2);Nr(2),Yo(e.recipePreviewLines.length)}}function tE(e,t){if(1&e){const e=Io();wo(0,"div",11,12),wo(2,"ng-miam-icon",13),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(3).toggleRecipe(i.id)})),ko(),wo(3,"span",14),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(3).toggleRecipe(i.id)})),Qo(4),ko(),ko()}if(2&e){const e=t.$implicit,i=Fo(3);Nr(2),bo("iconName",i.icon.Meal),Nr(2),Yo(e.title)}}function iE(e,t){if(1&e){const e=Io();wo(0,"ng-miam-modal",19),Ao("close",(function(){return Rt(e),Fo(2).toggleModal()})),wo(1,"div",4),fo(2,tE,5,2,"div",5),ko(),ko()}if(2&e){const e=Fo(2);bo("display",e.modalIsOpened)("noHeaderMode",!1)("recipesCount",e.recipePreviewLines.length),Nr(2),bo("ngForOf",e.recipePreviewLines)}}function nE(e,t){if(1&e&&(fo(0,eE,5,1,"div",15),fo(1,iE,3,4,"ng-miam-modal",16)),2&e){const e=Fo();bo("ngIf",(null==e.recipePreviewLines?null:e.recipePreviewLines.length)>0),Nr(1),bo("ngIf",(null==e.recipePreviewLines?null:e.recipePreviewLines.length)>0)}}let rE=(()=>{class e extends jy{constructor(e,t,i,n,r){super(e),this.cdr=t,this.basketService=i,this.contexteservice=n,this.recipesService=r,this.recipeDetailPreviewAllowed=!0,this.reduce=!0,this.icon=Cv,this.modalIsOpened=!1,this.subscriptions=[]}currentPath(){return""}ngOnChanges(e){e.hasOwnProperty("extId")&&e.extId.firstChange&&this.subscriptions.push(this.basketService.basketPreview$.subscribe(e=>{e&&(this.recipePreviewLines=e.filter(e=>e.entries.found.find(e=>e.selectedItem.attributes["ext-id"]===this.extId)),this.cdr.detectChanges(),this.detectWrappedTags(this.tags))})),this.cdr.detectChanges()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}detectWrappedTags(e){if(0===e.length)return;const t=e.map(e=>e.nativeElement.getBoundingClientRect()),i=Gx(t,"top"),n=Object.keys(i);this.rowCount=n.length,this.lastItemIndexOfFirstRow=i[n[0]].length-1,this.wrappedItemsCount=e.toArray().length-(this.lastItemIndexOfFirstRow+1),this.cdr.detectChanges()}toggleRecipe(e){this.recipesService.display(e,{previewAllowed:this.recipeDetailPreviewAllowed,previewMode:!1})}toggleList(){this.isListOpen=!this.isListOpen,this.cdr.detectChanges()}toggleModal(){this.modalIsOpened=!this.modalIsOpened,this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(C_),vo(Iv),vo(__))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-tags"]],viewQuery:function(e,t){if(1&e&&Uc(Wx,1),2&e){let e;Hc(e=qc())&&(t.tags=e)}},inputs:{extId:"extId",recipeDetailPreviewAllowed:"recipeDetailPreviewAllowed",reduce:"reduce"},features:[eo,at],decls:3,vars:2,consts:[[4,"ngIf","ngIfElse"],["reduced",""],["class","miam-recipe-tags__container",3,"ngStyle",4,"ngIf"],[1,"miam-recipe-tags__container",3,"ngStyle"],[1,"miam-recipe-tags__container__list"],["class","miam-recipe-tags__list__badge",4,"ngFor","ngForOf"],[1,"miam-recipe-tags__container__toggle",3,"ngClass"],[1,"miam-recipe-tags__toggle__open",3,"click"],[1,"miam-recipe-tags__toggle__ligne"],[1,"miam-recipe-tags__toggle__close",3,"ngStyle","click"],["width","24","height","24","primaryColor","var(--m-color-white)",3,"iconName"],[1,"miam-recipe-tags__list__badge"],["tag",""],["primaryColor","var(--m-color-white)",1,"miam-recipe-tags__badge__icon",3,"iconName","click"],[1,"miam-recipe-tag__badge__text",3,"click"],["class","miam-recipe-tags__recipes",3,"click",4,"ngIf"],["class","miam-recipe-tags__modal",3,"display","noHeaderMode","recipesCount","close",4,"ngIf"],[1,"miam-recipe-tags__recipes",3,"click"],[1,"miam-recipe-tags__recipes__count"],[1,"miam-recipe-tags__modal",3,"display","noHeaderMode","recipesCount","close"]],template:function(e,t){if(1&e&&(fo(0,Xx,2,1,"ng-container",0),fo(1,nE,2,2,"ng-template",null,1,Wc)),2&e){const e=_o(2);bo("ngIf",!t.reduce)("ngIfElse",e)}},directives:[Ou,zu,Au,Du,$y,sw],pipes:[Tb],styles:[".miam-recipe-tags__container__list{display:flex;flex-wrap:wrap;flex:1 1;margin:-4px}.miam-recipe-tags__container__list>*{margin:4px}.miam-recipe-tags__container__list .miam-recipe-tags__list__badge{display:flex;align-items:center;padding:0 8px 0 0;height:24px;border:1px solid #e9e9e9;box-sizing:border-box;border-radius:100px;cursor:pointer;position:relative;max-width:50vw}.miam-recipe-tags__container__list .miam-recipe-tags__list__badge .miam-recipe-tags__badge__icon{padding:4px 8px;background:var(--m-color-primary);border-radius:100px 0 0 100px;flex:none;order:0;flex-grow:0}.miam-recipe-tags__container__list .miam-recipe-tags__list__badge .miam-recipe-tag__badge__text{font-size:12px;line-height:16px;color:#676767;margin:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.miam-recipe-tags__container{display:flex;transition:height .25s cubic-bezier(0,0,.2,1);overflow:hidden;padding:0 8px;margin-top:16px}.miam-recipe-tags__container .miam-recipe-tags__container__toggle{display:flex;flex-direction:column;align-items:center;width:80px;visibility:visible}.miam-recipe-tags__container .miam-recipe-tags__container__toggle.miam-recipe-tags__container__toggle__hidden{visibility:hidden}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__open{display:flex;justify-content:center;padding:4px 8px;height:24px;background:#f6f6f6;min-width:40px;border-radius:100px;cursor:pointer;line-height:100%}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__ligne{width:2px;flex:1;background-color:var(--m-color-grey);transform:height 1s linear}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__close{background:var(--m-color-primary);min-width:40px;cursor:pointer;border-radius:100px;transition:opacity .2s linear}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__close ng-miam-icon .icon-container{transform:rotate(180deg)}.miam-recipe-tags__recipes{display:flex;align-items:center;padding:0 8px 0 0;height:24px;border:1px solid #e9e9e9;box-sizing:border-box;border-radius:100px;cursor:pointer;position:relative;max-width:50vw}.miam-recipe-tags__recipes .miam-recipe-tags__recipes__count{margin-right:4px}.miam-recipe-tags__modal .miam-modal{top:50%;right:50%;transform:translate3d(50%,-50%,0);height:auto;animation-name:none}.miam-recipe-tags__modal .miam-modal .miam-modal__container .miam-recipe-tags__container__list{display:flex;flex-flow:row wrap;max-width:480px;padding:24px}@media (max-width:1023px){.miam-recipe-tags__modal .miam-modal .miam-modal__container .miam-recipe-tags__container__list{flex-flow:column}}"],encapsulation:2,changeDetection:0}),e})(),sE=(()=>{class e extends Pv{constructor(e,t,i){super(e),this.http=e,this.posService=t,this.httpUtils=i,this.fetchingHTMLLoader$=new cp(!1),this.componentStylesUrl=this.MEALZ_SSR_API+"/styles/add-to-cart-cta",this.scriptsPaths=[Pp+"/add-to-cart-cta/add-to-cart-cta.min.js"]}displayAddToCartCta(e){const t=this.posService.pos$.getValue();let i=`${this.MEALZ_SSR_API}/add-to-cart-cta?recipe_id=${e}`;(null==t?void 0:t.id)&&(i+="&store_id="+t.id);const n=this.httpUtils.buildHeaders();return this.loadStyles(),this.loadComponentScripts(),this.fetchingHTMLLoader$.next(!0),this.http.get(i,{headers:n,responseType:"text"}).pipe(df(()=>this.fetchingHTMLLoader$.next(!1)))}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Vf),nn(c_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),oE=(()=>{class e{constructor(e,t,i){this.addToCartCtaService=e,this.sanitizer=t,this.cdr=i,this.recipeId="14989",this.clicked=new Rc,this.ctaHTML=null}ngOnInit(){this.loadComponent()}loadComponent(){this.addToCartCtaService.displayAddToCartCta(this.recipeId).pipe(fp(1)).subscribe({next:e=>{this.ctaHTML=this.sanitizer.bypassSecurityTrustHtml(e),this.clicked.emit(),this.cdr.detectChanges()},error:e=>{console.error("Error loading add-to-cart-cta component:",e)}})}}return e.\u0275fac=function(t){return new(t||e)(vo(sE),vo(Lh),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-add-to-cart-cta"]],inputs:{recipeId:"recipeId"},outputs:{clicked:"clicked"},decls:1,vars:1,consts:[[3,"innerHTML"]],template:function(e,t){1&e&&Co(0,"div",0),2&e&&bo("innerHTML",t.ctaHTML,Gn)},encapsulation:2,changeDetection:0}),e})(),aE=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({}),e})();const cE=[zx,rE,oE],lE=["recipe-modal","recipe-helper","recipe-tags","toaster-stack","basket-transfer-modal","add-to-cart-cta"],uE=[oC,VC,$x,Lx,jk];let dE=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,Ib,$k,Lk,aE,...uE],oC,VC,$x,Lx,jk]}),e})();var hE,pE,mE;hE=$d.a,mE=void 0,"string"!=typeof(pE="fr")&&(mE=pE,pE=hE[ra.LocaleId]),pE=pE.toLowerCase().replace(/_/g,"-"),ta[pE]=hE,mE&&(ta[pE][ra.ExtraData]=mE);let gE=(()=>{class e{constructor(e){e.get(Iv),cE.forEach((t,i)=>{if(void 0===customElements.get("webc-miam-"+lE[i])){const n=uh(t,{injector:e});customElements.define("webc-miam-"+lE[i],n)}}),this.injectModals()}ngDoBootstrap(){}injectModals(){["webc-miam-recipe-helper","webc-miam-toaster-stack","webc-miam-basket-transfer-modal","webc-miam-warning-store-locator"].forEach(e=>{if(!document.querySelector(e)){const t=document.createElement(e);document.body.appendChild(t)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[C_,zf,H_,__,mv,Xf,r_,fv,h_,Rp,L_,$_,d_,jv,Dv,{provide:Cd,useClass:$v,multi:!0},{provide:nl,useValue:"fr-FR"},{provide:rl,useValue:"EUR"}],imports:[[op.forRoot({url:"https://api.miam.tech/api/v1/"}),dE,Nh]]}),e})();!function(){if(Pl)throw new Error("Cannot enable prod mode after platform setup.");Il=!1}(),jh().bootstrapModule(gE,{ngZone:"noop"})},"6Whc":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMonths=t.getDaysInMonth=void 0,t.getDaysInMonth=function(e){var t=e.getMonth(),i=new Date(0);return i.setFullYear(e.getFullYear(),t+1,0),i.setHours(0,0,0,0),i.getDate()},t.addMonths=function(e,i){var n=e.getMonth()+i,r=new Date(0);r.setFullYear(e.getFullYear(),n,1),r.setHours(0,0,0,0);var s=t.getDaysInMonth(r);e.setMonth(n,Math.min(s,e.getDate()))}},"6Wo6":function(e,t,i){var n,r,s;!function(o){if("object"==typeof e.exports){var a=o(0,t);void 0!==a&&(e.exports=a)}else r=[i,t],void 0===(s="function"==typeof(n=o)?n.apply(t,r):n)||(e.exports=s)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=void 0;t.default=["fr",[["AM","PM"],i,i],i,[["D","L","M","M","J","V","S"],["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],["di","lu","ma","me","je","ve","sa"]],i,[["J","F","M","A","M","J","J","A","S","O","N","D"],["janv.","f\xe9vr.","mars","avr.","mai","juin","juil.","ao\xfbt","sept.","oct.","nov.","d\xe9c."],["janvier","f\xe9vrier","mars","avril","mai","juin","juillet","ao\xfbt","septembre","octobre","novembre","d\xe9cembre"]],i,[["av. J.-C.","ap. J.-C."],i,["avant J\xe9sus-Christ","apr\xe8s J\xe9sus-Christ"]],1,[6,0],["dd/MM/y","d MMM y","d MMMM y","EEEE d MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH:mm:ss zzzz"],["{1} {0}","{1} '\xe0' {0}",i,i],[",","\u202f",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0\xa0%","#,##0.00\xa0\xa4","#E0"],"EUR","\u20ac","euro",{ARS:["$AR","$"],AUD:["$AU","$"],BEF:["FB"],BMD:["$BM","$"],BND:["$BN","$"],BZD:["$BZ","$"],CAD:["$CA","$"],CLP:["$CL","$"],CNY:[i,"\xa5"],COP:["$CO","$"],CYP:["\xa3CY"],EGP:[i,"\xa3E"],FJD:["$FJ","$"],FKP:["\xa3FK","\xa3"],FRF:["F"],GBP:["\xa3GB","\xa3"],GIP:["\xa3GI","\xa3"],HKD:[i,"$"],IEP:["\xa3IE"],ILP:["\xa3IL"],ITL:["\u20a4IT"],JPY:[i,"\xa5"],KMF:[i,"FC"],LBP:["\xa3LB","\xa3L"],MTP:["\xa3MT"],MXN:["$MX","$"],NAD:["$NA","$"],NIO:[i,"$C"],NZD:["$NZ","$"],RHD:["$RH"],RON:[i,"L"],RWF:[i,"FR"],SBD:["$SB","$"],SGD:["$SG","$"],SRD:["$SR","$"],TOP:[i,"$T"],TTD:["$TT","$"],TWD:[i,"NT$"],USD:["$US","$"],UYU:["$UY","$"],WST:["$WS"],XCD:[i,"$"],XPF:["FCFP"],ZMW:[i,"Kw"]},"ltr",function(e){var t=Math.floor(Math.abs(e));return 0===t||1===t?1:5}]}))},"960K":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isZero=void 0;var n=i("svPx");t.isZero=function(e){return 0===n.toMilliseconds(e)}},"9a4g":function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.UNITS_META=t.UNITS=t.UNITS_META_MAP=t.UNITS_META_MAP_LITERAL=t.ZERO=void 0,t.ZERO=Object.freeze({years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0}),t.UNITS_META_MAP_LITERAL={years:{milliseconds:31536e6,months:12,dateGetter:function(e){return e.getFullYear()},ISOCharacter:"Y",ISOPrecision:"period"},months:{milliseconds:2628e6,months:1,dateGetter:function(e){return e.getMonth()},ISOCharacter:"M",ISOPrecision:"period"},weeks:{milliseconds:6048e5,dateGetter:function(){return 0},ISOCharacter:"W",ISOPrecision:"period",stringifyConvertTo:"days"},days:{milliseconds:864e5,dateGetter:function(e){return e.getDate()},ISOCharacter:"D",ISOPrecision:"period"},hours:{milliseconds:36e5,dateGetter:function(e){return e.getHours()},ISOCharacter:"H",ISOPrecision:"time"},minutes:{milliseconds:6e4,dateGetter:function(e){return e.getMinutes()},ISOCharacter:"M",ISOPrecision:"time"},seconds:{milliseconds:1e3,dateGetter:function(e){return e.getSeconds()},ISOCharacter:"S",ISOPrecision:"time"},milliseconds:{milliseconds:1,dateGetter:function(e){return e.getMilliseconds()},stringifyConvertTo:"seconds"}},t.UNITS_META_MAP=t.UNITS_META_MAP_LITERAL,t.UNITS=Object.freeze(["years","months","weeks","days","hours","minutes","seconds","milliseconds"]),t.UNITS_META=Object.freeze(t.UNITS.map((function(e){return n(n({},t.UNITS_META_MAP[e]),{unit:e})})))},"9aqK":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validate=void 0;var n=i("9a4g");t.validate=function(e){Object.keys(e).forEach((function(t){if(!n.UNITS.includes(t))throw new TypeError('Unexpected property "'+t+'" on Duration object.');if(!Number.isInteger(e[t]))throw new TypeError('Property "'+t+'" must be a an integer. Received '+e[t]+".")}))}},Af8m:function(e,t,i){"use strict";(function(e){var n=i("kq48"),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===r&&n.a.process,a=function(){try{return s&&s.require&&s.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();t.a=a}).call(this,i("cyaT")(e))},D57s:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.cleanDurationObject=void 0;var r=i("9a4g");t.cleanDurationObject=function(e){var t=n({},e);return r.UNITS.forEach((function(e){0===t[e]&&(t[e]=0)})),t}},GrrB:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.apply=void 0;var n=i("6Whc"),r=i("X1CF");t.apply=function(e,t){var i=new Date(e),s=r.parse(t),o=s.weeks,a=s.days,c=s.hours,l=s.minutes,u=s.seconds,d=s.milliseconds;return n.addMonths(i,12*s.years+s.months),i.setDate(i.getDate()+7*o+a),i.setHours(i.getHours()+c,i.getMinutes()+l,i.getSeconds()+u,i.getMilliseconds()+d),i}},JsNM:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.between=void 0;var r=i("9a4g");t.between=function(e,t){var i=new Date(e),s=new Date(t),o=n({},r.ZERO);return r.UNITS_META.forEach((function(e){var t=e.dateGetter;o[e.unit]=t(s)-t(i)})),o}},MBFf:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.negate=void 0;var r=i("9a4g"),s=i("X1CF");t.negate=function(e){var t=n({},s.parse(e));return r.UNITS.forEach((function(e){t[e]=0===t[e]?0:-t[e]})),t}},NMSN:function(e,t,i){"use strict";var n=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var n=Array(e),r=0;for(t=0;t<i;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n};Object.defineProperty(t,"__esModule",{value:!0}),t.subtract=void 0;var r=i("MBFf"),s=i("ROwQ");t.subtract=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];return s.sum.apply(void 0,n([e],t.map(r.negate)))}},NoVc:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},ROwQ:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.sum=void 0;var r=i("9a4g"),s=i("X1CF");t.sum=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=n({},r.ZERO);return e.map(s.parse).forEach((function(e){r.UNITS.forEach((function(t){i[t]+=e[t]}))})),i}},TOAu:function(e,t,i){e.exports=(()=>{"use strict";var e={d:(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PlausibleEvent:()=>en,initSharedAnalytics:()=>Zi,sendEvent:()=>_n,setABTestKey:()=>Qi,setAffiliate:()=>Yi}),void 0===Math.imul&&(Math.imul=function(e,t){return(4294901760&e)*(65535&t)+(65535&e)*(0|t)|0}),void 0===ArrayBuffer.isView&&(ArrayBuffer.isView=function(e){return null!=e&&null!=e.__proto__&&e.__proto__.__proto__===Int8Array.prototype.__proto__});var i,n,r,s,o,a,c,l,u,d,h,p,m,g,f,_,v,b,y,w,k,C,S,x,E,I,P,D,T,A,R,O,F,B,M,L,$,j,z,N,V,H,U,q,G,W,Z,Q,Y,K,J,X,ee,te,ie,ne,re,se,oe,ae,ce,le,ue,de,he,pe,me,ge,fe,_e,ve,be,ye,we,ke,Ce,Se,xe,Ee,Ie,Pe,De,Te,Ae,Re,Oe,Fe,Be,Me,Le,$e,je,ze,Ne,Ve,He,Ue,qe,Ge,We,Ze,Qe,Ye,Ke,Je,Xe,et,tt,it,nt,rt,st,ot,at,ct,lt,ut,dt,ht,pt,mt,gt,ft=ArrayBuffer.isView,_t=Math.imul;function vt(){}function bt(){}function yt(e,t){return e>t?t:e}function wt(e,t){return e<t?t:e}function kt(e,t){return e-t|0}function Ct(e,t){return e-t|0}function St(e){return String.fromCharCode(e)}function xt(){}function Et(){}function It(e,t){this.c_1=e,this.d_1=t}function Pt(e){var t=null==e?null:Mt(e);return null==t?"null":t}function Dt(){}function Tt(e){var t=e>>5,i=new Int32Array(t+1|0);return i[t]=i[t]|1<<(31&e),i}function At(e){this.h_1=e,this.g_1=0}function Rt(e,t){var i;if(Ot(e)){var n=e.charCodeAt(t);if(n<0||n>65535)throw si("Invalid Char code: "+n);i=function(e){return function(e){return 65535&e}(function(e){return e<<16>>16}(function(e){return e instanceof Dt?e.f():function(e){return e>2147483647?2147483647:e<-2147483648?-2147483648:0|e}(e)}(e)))}(n)}else i=e.k(t);return i}function Ot(e){return"string"==typeof e}function Ft(e){return Ot(e)?e.length:e.l()}function Bt(e){return e=e===r?null:e,Object.create(e)}function Mt(e){return null==e?"null":Wt(e)?"[...]":"function"!=typeof e.toString?function(e){return Object.prototype.toString.call(e)}(e):e.toString()}function Lt(e,t){return null==e?null==t:null!=t&&("object"==typeof e&&"function"==typeof e.equals?e.equals(t):e!=e?t!=t:"number"==typeof e&&"number"==typeof t?e===t&&(0!==e||1/e==1/t):e===t)}function $t(e,t){null!=Error.captureStackTrace?Error.captureStackTrace(e,t):e.stack=(new Error).stack}function jt(e){return e.prototype}function zt(e,t,i){Error.call(e),function(e,t,i){var n=function e(t){var i=t.constructor,n=null==i?null:i.$metadata$,r=null==n?null:n.errorInfo;if(null!=r)return r;var s=0;if(Zt(t,"message")&&(s|=1),Zt(t,"cause")&&(s|=2),3!==s){var o=Object.getPrototypeOf(t);o!=Error.prototype&&(s|=e(o))}return null!=n&&(n.errorInfo=s),s}(Object.getPrototypeOf(e));if(!(1&n)){var s;if(null==t){var o;if(null!==t){var a=null==i?null:i.toString();o=null==a?r:a}else o=r;s=o}else s=t;e.message=s}2&n||(e.cause=i),e.name=Object.getPrototypeOf(e).constructor.name}(e,t,i)}function Nt(){throw gi()}function Vt(e){throw _i("lateinit property "+e+" has not been initialized")}function Ht(e,t,i,s,o,a,c,l,u){null!=o&&(t.prototype=Object.create(o.prototype),t.prototype.constructor=t);var d=function(e,t,i,s,o,a){return{kind:e,simpleName:t,associatedObjectKey:s,associatedObjects:o,suspendArity:a,$kClass$:r,defaultConstructor:i,iid:"interface"===e?(n===r&&(n=0),n=n+1|0):r}}(e,i,s,l,u,c);t.$metadata$=d,null!=a&&((Lt(d.iid,r)?t.prototype:t).$imask$=function(e){for(var t=1,i=[],n=0,r=e.length;n<r;){var s=e[n];n=n+1|0;var o=t,a=s.prototype.$imask$,c=null==a?s.$imask$:a;null!=c&&(i.push(c),o=c.length);var l=s.$metadata$.iid,u=null==l?null:Tt(l);null!=u&&(i.push(u),o=Math.max(o,u.length)),o>t&&(t=o)}return function(e,t){for(var i=0,n=new Int32Array(e);i<e;){for(var r=i,s=0,o=0,a=t.length;o<a;){var c=t[o];o=o+1|0,r<c.length&&(s|=c[r])}n[r]=s,i=i+1|0}return n}(t,i)}(a))}function Ut(e,t,i,n,r,s,o,a){Ht("class",e,t,i,n,r,s,o,a)}function qt(e,t,i,n,r,s,o,a){Ht("object",e,t,i,n,r,s,o,a)}function Gt(e,t,i,n){qt(e,"Companion",r,t,i,n,r,r)}function Wt(e){return Array.isArray(e)||ft(e)}function Zt(e,t){return e.hasOwnProperty(t)}function Qt(){s=this,this.m_1=new Int32Array([48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296])}function Yt(){return null==s&&new Qt,s}function Kt(){}function Jt(e){Kt.call(this),this.o_1=e}function Xt(){ei.call(this)}function ei(){Kt.call(this),this.q_1=""}function ti(){if(!a){a=!0;var e="undefined"!=typeof process&&process.versions&&!!process.versions.node;o=e?new Jt(process.stdout):new Xt}}function ii(e){var t,i,n=e;return null!=e.iterator?e.iterator():Wt(n)?new At(n):(null!=n&&(t=n,i=xt,function(e,t){var i=e.$imask$;return null!=i&&function(e,t){var i=t>>5;return!(i>e.length||0==(e[i]&1<<(31&t)))}(i,t)}(t,i.$metadata$.iid))?n:Nt()).b()}function ni(e){return zt(e),ri.call(e),e}function ri(){$t(this,ri)}function si(e){var t=function(e,t){return ui(e,t),oi.call(t),t}(e,Bt(jt(oi)));return $t(t,si),t}function oi(){$t(this,oi)}function ai(e){var t=function(e,t){return ui(e,t),ci.call(t),t}(e,Bt(jt(ci)));return $t(t,ai),t}function ci(){$t(this,ci)}function li(e){return ni(e),di.call(e),e}function ui(e,t){return function(e,t){zt(t,e),ri.call(t)}(e,t),di.call(t),t}function di(){$t(this,di)}function hi(){var e,t=(li(e=Bt(jt(mi))),mi.call(e),e);return $t(t,hi),t}function pi(e){var t=function(e,t){return ui(e,t),mi.call(t),t}(e,Bt(jt(mi)));return $t(t,pi),t}function mi(){$t(this,mi)}function gi(){var e,t=(li(e=Bt(jt(fi))),fi.call(e),e);return $t(t,gi),t}function fi(){$t(this,fi)}function _i(e){var t=function(e,t){return ui(e,t),vi.call(t),t}(e,Bt(jt(vi)));return $t(t,_i),t}function vi(){$t(this,vi)}function bi(e){var t=St(e).toUpperCase();return t.length>1?e:Rt(t,0)}function yi(e){return function(e){return 9<=e&&e<=13||28<=e&&e<=32||160===e||e>4096&&(5760===e||8192<=e&&e<=8202||8232===e||8233===e||8239===e||8287===e||12288===e)}(e)}function wi(e,t){var i,n,r,s=kt(e,48)>=0&&kt(e,57)<=0?Ct(e,48):kt(e,65)>=0&&kt(e,90)<=0?Ct(e,65)+10|0:kt(e,97)>=0&&kt(e,122)<=0?Ct(e,97)+10|0:kt(e,128)<0?-1:kt(e,65313)>=0&&kt(e,65338)<=0?Ct(e,65313)+10|0:kt(e,65345)>=0&&kt(e,65370)<=0?Ct(e,65345)+10|0:(i=e,n=function(e,t){for(var i=0,n=e.length-1|0,r=-1,s=0;i<=n;)if(t>(s=e[r=(i+n|0)/2|0]))i=r+1|0;else{if(t===s)return r;n=r-1|0}return r-(t<s?1:0)|0}(Yt().m_1,i),(r=i-Yt().m_1[n]|0)<10?r:-1);return s>=t?-1:s}function ki(e,t,i,n,s,o){return Mi(e,t,i,n,s,o=o!==r&&o)}function Ci(){}function Si(e,t,i){return xi(xi(e,i)-xi(t,i)|0,i)}function xi(e,t){var i=e%t|0;return i>=0?i:i+t|0}function Ei(){c=this,this.v_1=new Ii(1,0)}function Ii(e,t){null==c&&new Ei,Ti.call(this,e,t,1)}function Pi(e,t,i){Ci.call(this),this.d1_1=i,this.e1_1=t,this.f1_1=this.d1_1>0?e<=t:e>=t,this.g1_1=this.f1_1?e:this.e1_1}function Di(){}function Ti(e,t,i){if(0===i)throw si("Step must be non-zero.");if(-2147483648===i)throw si("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.a1_1=e,this.b1_1=function(e,t,i){var n;if(i>0)n=e>=t?t:t-Si(t,e,i)|0;else{if(!(i<0))throw si("Step is zero.");n=e<=t?t:t+Si(e,t,0|-i)|0}return n}(e,t,i),this.c1_1=i}function Ai(e,t,i){if(e===t)return!0;if(!(i=i!==r&&i))return!1;var n=bi(e),s=bi(t);return n===s||Rt(St(n).toLowerCase(),0)===Rt(St(s).toLowerCase(),0)}function Ri(e){var t;e:{for(var i=0;i<Ft(e);){var n=Rt(e,i);if(i=i+1|0,!yi(n)){t=!1;break e}}t=!0}return t}function Oi(e,t,i,n){return i=i===r?0:i,(n=n!==r&&n)||"string"!=typeof e?Fi(e,t,i,Ft(e),n):e.indexOf(t,i)}function Fi(e,t,i,n,s,o){var a=(o=o!==r&&o)?function(e,t){return l.a(e,t,-1)}(yt(i,Bi(e)),wt(n,0)):new Ii(wt(i,0),yt(n,Ft(e)));if("string"==typeof e&&"string"==typeof t){var c=a.a1_1,u=a.b1_1,d=a.c1_1;if(d>0&&c<=u||d<0&&u<=c)do{var h=c;if(c=c+d|0,ki(t,0,e,h,Ft(t),s))return h}while(h!==u)}else{var p=a.a1_1,m=a.b1_1,g=a.c1_1;if(g>0&&p<=m||g<0&&m<=p)do{var f=p;if(p=p+g|0,Mi(t,0,e,f,Ft(t),s))return f}while(f!==m)}return-1}function Bi(e){return Ft(e)-1|0}function Mi(e,t,i,n,r,s){if(n<0||t<0||t>(Ft(e)-r|0)||n>(Ft(i)-r|0))return!1;var o=0;if(o<r)do{var a=o;if(o=o+1|0,!Ai(Rt(e,t+a|0),Rt(i,n+a|0),s))return!1}while(o<r);return!0}function Li(e,t){this.h1_1=e,this.i1_1=t}function $i(e,t){return new Li(e,t)}function ji(e){var t=e.k1_1;if(null!=t)return t;Vt("domain")}function zi(e){var t=e.m1_1;if(null!=t)return t;Vt("clientSDKVersion")}function Ni(e){return!(null==e.k1_1||null==e.m1_1||Ri(ji(e))||Ri(zi(e)))}function Vi(e,t){if(n=t,o=o!==r&&o,!("string"==typeof(s="/miam/")?Oi(n,s,r,o)>=0:Fi(n,s,0,Ft(n),o)>=0))return i;var n,s,o,a;(function(e){for(var t=new mn([]),i=0,n=0;i<e.length;){if(47===Rt(e,i)){if(i>n){var r=e.substring(n,i);t.e3(r)}n=i+1|0}i=i+1|0}if(n<e.length){var s=e.substring(n);t.e3(s)}return t})(function(e,t,i){i=i===r?e:i;var n=Oi(e,"/miam/");return-1===n?i:e.substring(n+6|0,e.length)}(t)).r1((a=t,function(e){if(!Ui().t1_1.v1(e)&&null==function(e){return function(e){var t,i,n,r=e.length;if(0===r)return null;var s=Rt(e,0);if(kt(s,48)<0){if(1===r)return null;if(t=1,45===s)i=!0,n=-2147483648;else{if(43!==s)return null;i=!1,n=-2147483647}}else t=0,i=!1,n=-2147483647;var o=-59652323,a=o,c=0,l=t;if(l<r)do{var u=l;l=l+1|0;var d=wi(Rt(e,u),10);if(d<0)return null;if(c<a){if(a!==o)return null;if(c<(a=n/10|0))return null}if((c=_t(c,10))<(n+d|0))return null;c=c-d|0}while(l<r);return i?c:0|-c}(e)}(e))throw si('Invalid path : "'+a+'". "'+e+'" is not a valid path part.');return i}))}function Hi(){u=this,this.s1_1="https://plausible.io/api/event",this.t1_1=new mn(["","basket","basket-preview","catalog","categories","cooking","filter","finalize","item-selector","liked","list-scan","locator","meals-planner","dashboard","current","onboarding","ordered","orders","preferences","products","recipes","results","shopping","sponsor","search","supplier-selector","history"]),this.u1_1=new mn(["mealz-space","shelves","search","","retailer-shelves","retailer-search","meals-space-home","meals-space-catalog","meals-space-catalog-search","meals-space-category","meals-space-category-search","meals-space-recipe-details","meals-space-all-recipes","my-meals","item-replacement","basket","meals-planner-home","meals-planner-dashboard","meals-planner-catalog","meals-planner-catalog-search","meals-planner-categories","meals-planner-recipe-details","my-space-favorites","my-space-history"])}function Ui(){return null==u&&new Hi,u}function qi(){Ui(),this.n1_1="prod",this.o1_1=null,this.p1_1=null}function Gi(){d=this,this.k2_1=new fn([$i((Ji(),m).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),g).n2_1,Wi(new mn(["search_term"]),new mn([]))),$i((Ji(),f).n2_1,Wi(new mn(["search_term","number_of_results"]),new mn([]))),$i((Ji(),_).n2_1,Wi(new mn(["recipe_id"]),new mn(["category_id"]))),$i((Ji(),v).n2_1,Wi(new mn(["recipe_id"]),new mn(["category_id"]))),$i((Ji(),b).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),y).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),w).n2_1,Wi(new mn(["recipe_id"]),new mn(["mode","recipe_source"]))),$i((Ji(),k).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),C).n2_1,Wi(new mn(["recipe_id"]),new mn(["guests"]))),$i((Ji(),S).n2_1,Wi(new mn(["recipe_id"]),new mn(["category_id"]))),$i((Ji(),x).n2_1,Wi(new mn(["recipe_id"]),new mn(["category_id"]))),$i((Ji(),I).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),E).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),P).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),D).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),T).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),A).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),R).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),O).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),F).n2_1,Wi(new mn(["step"]),new mn([]))),$i((Ji(),B).n2_1,Wi(new mn(["category_id"]),new mn([]))),$i((Ji(),M).n2_1,Wi(new mn(["category_id"]),new mn([]))),$i((Ji(),L).n2_1,Wi(new mn(["category_id"]),new mn([]))),$i((Ji(),$).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),j).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),z).n2_1,Wi(new mn(["search_term"]),new mn([]))),$i((Ji(),N).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),V).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),H).n2_1,Wi(new mn(["search_term"]),new mn([]))),$i((Ji(),U).n2_1,Wi(new mn(["basket_id"]),new mn([]))),$i((Ji(),q).n2_1,Wi(new mn(["basket_id"]),new mn([]))),$i((Ji(),G).n2_1,Wi(new mn(["basket_id"]),new mn([]))),$i((Ji(),W).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Z).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Q).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Y).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),K).n2_1,Wi(new mn(["guests"]),new mn([]))),$i((Ji(),J).n2_1,Wi(new mn(["tag_type","tag_id"]),new mn([]))),$i((Ji(),X).n2_1,Wi(new mn(["search_term"]),new mn([]))),$i((Ji(),ee).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id"]))),$i((Ji(),te).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id","add_source","mode"]))),$i((Ji(),ie).n2_1,Wi(new mn(["recipe_id","entry_count"]),new mn(["total_products","total_price"]))),$i((Ji(),ne).n2_1,Wi(new mn(["recipe_id","entry_count"]),new mn([]))),$i((Ji(),re).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id"]))),$i((Ji(),se).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id"]))),$i((Ji(),oe).n2_1,Wi(new mn(["entry_name","product_quantity"]),new mn(["item_id","ext_item_id","item_ean","recipe_id","status"]))),$i((Ji(),ae).n2_1,Wi(new mn(["entry_name","new_item_id","new_item_ext_id","new_item_ean"]),new mn(["old_item_id","old_item_ext_id","old_item_ean","product_quantity","search_term","recipe_id"]))),$i((Ji(),ce).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id"]))),$i((Ji(),le).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id"]))),$i((Ji(),ue).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),de).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),he).n2_1,Wi(new mn(["search_term"]),new mn(["old_item_id","old_item_ext_id","old_item_ean","recipe_id"]))),$i((Ji(),pe).n2_1,Wi(new mn(["basket_id","miam_amount","total_amount","pos_id","pos_name","recipe_count","miam_products"]),new mn(["total_products","client_order_id"]))),$i((Ji(),me).n2_1,Wi(new mn(["basket_id","miam_amount","total_amount","pos_id","pos_name","recipe_count","miam_products"]),new mn(["total_products","client_order_id"]))),$i((Ji(),ge).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),fe).n2_1,Wi(new mn(["number_of_recipes"]),new mn([]))),$i((Ji(),_e).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),ve).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),be).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),ye).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),we).n2_1,Wi(new mn(["basket_id","miam_amount","total_amount","pos_id","pos_name","recipe_count","miam_products"]),new mn(["total_products","client_order_id"]))),$i((Ji(),ke).n2_1,Wi(new mn(["basket_id","miam_amount","pos_id","pos_name","supplier_id"]),new mn([]))),$i((Ji(),Le).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),$e).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),je).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),ze).n2_1,Wi(new mn(["supplier_id"]),new mn([]))),$i((Ji(),Ce).n2_1,Wi(new mn(["guests"]),new mn(["budget","recipe_count","mode"]))),$i((Ji(),Se).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Ee).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),xe).n2_1,Wi(new mn(["recipe_id"]),new mn(["recipe_source","mode"]))),$i((Ji(),Ie).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),Pe).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),De).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),Te).n2_1,Wi(new mn(["recipe_id","item_id"]),new mn([]))),$i((Ji(),Ae).n2_1,Wi(new mn(["recipe_id","item_id"]),new mn([]))),$i((Ji(),Re).n2_1,Wi(new mn(["recipe_id","item_id"]),new mn([]))),$i((Ji(),Oe).n2_1,Wi(new mn(["recipe_id","new_item_id"]),new mn(["old_item_id"]))),$i((Ji(),Fe).n2_1,Wi(new mn(["budget_user","budget_planner","recipe_count","guests","uses_count","time_passed"]),new mn([]))),$i((Ji(),Be).n2_1,Wi(new mn(["budget_user","recipe_count","guests"]),new mn(["budget_planner","mode"]))),$i((Ji(),Me).n2_1,Wi(new mn(["mode"]),new mn([]))),$i((Ji(),Ne).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Ve).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),He).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Ue).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),qe).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Ge).n2_1,Wi(new mn(["search_term","stores_found_count"]),new mn([]))),$i((Ji(),We).n2_1,Wi(new mn(["supplier_name"]),new mn([]))),$i((Ji(),Ze).n2_1,Wi(new mn(["pos_id","pos_name","supplier_name"]),new mn([]))),$i((Ji(),Qe).n2_1,Wi(new mn(["steps_completed"]),new mn([]))),$i((Ji(),Ye).n2_1,Wi(new mn(["steps_completed"]),new mn([]))),$i((Ji(),Ke).n2_1,Wi(new mn(["type","step"]),new mn([]))),$i((Ji(),Je).n2_1,Wi(new mn(["type"]),new mn([]))),$i((Ji(),Xe).n2_1,Wi(new mn(["type"]),new mn([]))),$i((Ji(),et).n2_1,Wi(new mn(["type","step"]),new mn([]))),$i((Ji(),tt).n2_1,Wi(new mn(["type"]),new mn([]))),$i((Ji(),it).n2_1,Wi(new mn(["type","step"]),new mn([]))),$i((Ji(),nt).n2_1,Wi(new mn(["from"]),new mn([]))),$i((Ji(),rt).n2_1,Wi(new mn(["step"]),new mn([]))),$i((Ji(),st).n2_1,Wi(new mn(["step"]),new mn([]))),$i((Ji(),ot).n2_1,Wi(new mn(["step"]),new mn([]))),$i((Ji(),at).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),ct).n2_1,Wi(new mn(["step"]),new mn([])))])}function Wi(e,t){return new fn([$i("mandatory",e),$i("optional",t)])}function Zi(e,t,i,n){n=n===r?"prod":n,pn().z2(e,t,i,n)}function Qi(e){pn().o1_1=e}function Yi(e){pn().p1_1=e}function Ki(e,t){It.call(this,e,t)}function Ji(){if(lt)return i;lt=!0,m=new Xi("PAGEVIEW",0,"pageview"),g=new Xi("SEARCH",1,"search"),f=new Xi("SEARCH_RESULTS",2,"search.results"),_=new Xi("RECIPE_SHOW",3,"recipe.show"),v=new Xi("RECIPE_DISPLAY",4,"recipe.display"),b=new Xi("RECIPE_COOKING_DISPLAY",5,"recipe.cooking.display"),y=new Xi("RECIPE_SHOPPING_DISPLAY",6,"recipe.shopping.display"),w=new Xi("RECIPE_ADD",7,"recipe.add"),k=new Xi("RECIPE_REMOVE",8,"recipe.remove"),C=new Xi("RECIPE_CHANGE_GUESTS",9,"recipe.change-guests"),S=new Xi("RECIPE_LIKE",10,"recipe.like"),x=new Xi("RECIPE_UNLIKE",11,"recipe.unlike"),E=new Xi("RECIPE_CLOSE",12,"recipe.close"),I=new Xi("RECIPE_CONTINUE",13,"recipe.continue"),P=new Xi("RECIPE_ORDERED_DISPLAY",14,"recipe.ordered.display"),D=new Xi("RECIPE_ORDERED_CLOSE",15,"recipe.ordered.close"),T=new Xi("SPONSOR_DISPLAY",16,"sponsor.display"),A=new Xi("SPONSOR_BACK",17,"sponsor.back"),R=new Xi("SPONSOR_CLOSE",18,"sponsor.close"),O=new Xi("HOME_DISPLAY",19,"home.display"),F=new Xi("BREADCRUMB_SELECT",20,"breadcrumb.select"),B=new Xi("CATEGORY_SHOW",21,"category.show"),M=new Xi("CATEGORY_DISPLAY",22,"category.display"),L=new Xi("CATEGORY_BACK",23,"category.back"),$=new Xi("LIKED_DISPLAY",24,"liked.display"),j=new Xi("LIKED_BACK",25,"liked.back"),z=new Xi("LIKED_SEARCH",26,"liked.search"),N=new Xi("ORDERS_DISPLAY",27,"orders.display"),V=new Xi("ORDERS_BACK",28,"orders.back"),H=new Xi("ORDERS_SEARCH",29,"orders.search"),U=new Xi("ORDER_DISPLAY",30,"order.display"),q=new Xi("ORDER_BACK",31,"order.back"),G=new Xi("ORDER_CLOSE",32,"order.close"),W=new Xi("PREFERENCES_DISPLAY",33,"preferences.display"),Z=new Xi("PREFERENCES_CLOSE",34,"preferences.close"),Q=new Xi("PREFERENCES_RESET",35,"preferences.reset"),Y=new Xi("PREFERENCES_SAVE",36,"preferences.save"),K=new Xi("PREFERENCES_GUESTS",37,"preferences.guests"),J=new Xi("PREFERENCES_TAG_SELECTED",38,"preferences.tag.selected"),X=new Xi("PREFERENCES_SEARCH",39,"preferences.search"),ee=new Xi("ENTRY_ADD",40,"entry.add"),te=new Xi("ENTRY_ADDED",41,"entry.added"),ie=new Xi("ENTRY_ADD_ALL",42,"entry.add-all"),ne=new Xi("ENTRY_ADD_ALL_AGAIN",43,"entry.add-all-again"),re=new Xi("ENTRY_DELETE",44,"entry.delete"),se=new Xi("ENTRY_DELETED",45,"entry.deleted"),oe=new Xi("ENTRY_REPLACE",46,"entry.replace"),ae=new Xi("ENTRY_REPLACED",47,"entry.replaced"),ce=new Xi("ENTRY_CHANGE_QUANTITY",48,"entry.change-quantity"),le=new Xi("ENTRY_IGNORE",49,"entry.ignore"),ue=new Xi("ITEM_SELECTOR_BACK",50,"item-selector.back"),de=new Xi("ITEM_SELECTOR_CLOSE",51,"item-selector.close"),he=new Xi("ITEM_SELECTOR_SEARCH",52,"item-selector.search"),pe=new Xi("PAYMENT_STARTED",53,"payment.started"),me=new Xi("PAYMENT_CONFIRMED",54,"payment.confirmed"),ge=new Xi("BASKET_DISPLAY",55,"basket.display"),fe=new Xi("BASKET_SHOW",56,"basket.show"),_e=new Xi("BASKET_RECIPES_DISPLAY",57,"basket.recipes.display"),ve=new Xi("BASKET_PRODUCTS_DISPLAY",58,"basket.products.display"),be=new Xi("BASKET_CLOSE",59,"basket.close"),ye=new Xi("BASKET_ENTRY_ADD",60,"basket.entry.add"),we=new Xi("BASKET_CONFIRMED",61,"basket.confirmed"),ke=new Xi("BASKET_TRANSFER",62,"basket.transfer"),Ce=new Xi("PLANNER_STARTED",63,"planner.started"),Se=new Xi("PLANNER_RESET",64,"planner.reset"),xe=new Xi("PLANNER_RECIPE_ADDED",65,"planner.recipe.add"),Ee=new Xi("PLANNER_RECIPE_DELETED",66,"planner.recipe.delete"),Ie=new Xi("PLANNER_RECIPE_SWAPPED",67,"planner.recipe.swap"),Pe=new Xi("PLANNER_RECIPE_CATALOG_PROMPT",68,"planner.recipe.catalog-prompt"),De=new Xi("PLANNER_SUGGESTION_SHOW",69,"planner.suggestion.show"),Te=new Xi("PLANNER_ITEM_DELETED",70,"planner.item.delete"),Ae=new Xi("PLANNER_ITEM_ADDED",71,"planner.item.add"),Re=new Xi("PLANNER_ITEM_REPLACE",72,"planner.item.replace"),Oe=new Xi("PLANNER_ITEM_REPLACED",73,"planner.item.replaced"),Fe=new Xi("PLANNER_CONFIRM",74,"planner.confirm"),Be=new Xi("PLANNER_FINALIZE",75,"planner.finalize"),Me=new Xi("PLANNER_MODE_SELECT",76,"planner.mode.select"),Le=new Xi("SUPPLIER_SELECTOR_DISPLAY",77,"supplier-selector.display"),$e=new Xi("SUPPLIER_SELECTOR_BACK",78,"supplier-selector.back"),je=new Xi("SUPPLIER_SELECTOR_CLOSE",79,"supplier-selector.close"),ze=new Xi("SUPPLIER_SELECTOR_SELECT",80,"supplier-selector.select"),Ne=new Xi("LOCATOR_DISPLAY",81,"locator.display"),Ve=new Xi("LOCATOR_MAP_DISPLAY",82,"locator.map.display"),He=new Xi("LOCATOR_LIST_DISPLAY",83,"locator.list.display"),Ue=new Xi("LOCATOR_BACK",84,"locator.back"),qe=new Xi("LOCATOR_CLOSE",85,"locator.close"),Ge=new Xi("LOCATOR_SEARCH",86,"locator.search"),We=new Xi("LOCATOR_FILTER",87,"locator.filter"),Ze=new Xi("LOCATOR_SELECT",88,"locator.select"),Qe=new Xi("ONBOARDING_ACTION",89,"onboarding.action"),Ye=new Xi("ONBOARDING_CLOSE",90,"onboarding.close"),Ke=new Xi("PLANNER_ONBOARDING_DISPLAY",91,"planner.onboarding.display"),Je=new Xi("PLANNER_ONBOARDING_START_CLICK",92,"planner.onboarding.start"),Xe=new Xi("PLANNER_ONBOARDING_SKIP_CLICK",93,"planner.onboarding.skip"),et=new Xi("PLANNER_PONBOARDING_NEXT_CLICK",94,"planner.onboarding.next"),tt=new Xi("PLANNER_ONBOARDING_UNDERSTOOD_CLICK",95,"planner.onboarding.understood"),it=new Xi("PLANNER_ONBOARDING_CLOSE_CLICK",96,"planner.onboarding.close"),nt=new Xi("PLANNER_HELP_QUESTION_MARK_CLICK",97,"planner.help.question-mark"),rt=new Xi("PLANNER_HELP_DISPLAY",98,"planner.help.display"),st=new Xi("PLANNER_HELP_NEXT_CLICK",99,"planner.help.next"),ot=new Xi("PLANNER_HELP_PREVIOUS_CLICK",100,"planner.help.previous"),at=new Xi("PLANNER_HELP_UNDERSTOOD_CLICK",101,"planner.help.understood"),ct=new Xi("PLANNER_HELP_CLOSE_CLICK",102,"planner.help.close")}function Xi(e,t,i){It.call(this,e,t),this.n2_1=i}function en(e,t,i,n){this.name=e,this.url=t,this.domain=i,this.props=n}function tn(){if(ht)return i;ht=!0,ut=new cn("ALL_LOGS",0),new cn("ERRORS_ONLY",1),dt=new cn("ERRORS_AND_WARNS",2),new cn("NO_LOGS",3)}function nn(e,t,i){var n="[MealzSharedAnalytics]["+i+"] "+t+" \n";(function(e){ti(),(ti(),o).n(e)})(n),e.a2_1&&(e.b2_1=e.b2_1+n)}function rn(e){return un().c2_1.equals(dn())&&nn(un(),e,"DEBUG"),i}function sn(e){return un().c2_1.equals(dn())&&nn(un(),e,"INFO"),i}function on(e){switch(un().c2_1.d_1){case 2:case 0:nn(un(),e,"WARN");break;default:return i}return i}function an(e){switch(un().c2_1.d_1){case 2:case 0:case 1:nn(un(),e,"ERROR");break;default:return i}return i}function cn(e,t){It.call(this,e,t)}function ln(){pt=this,this.a2_1=!1,this.b2_1="",this.c2_1=(tn(),dt),this.d2_1=rn,this.e2_1=sn,this.f2_1=on,this.g2_1=an}function un(){return null==pt&&new ln,pt}function dn(){return tn(),ut}function hn(){mt=this,qi.call(this)}function pn(){return null==mt&&new hn,mt}function mn(e){this.q1_1=[];for(var t=0,i=e.length;t<i;){var n=e[t];t=t+1|0,this.q1_1.push(n)}}function gn(){}function fn(e){this.h2_1={};for(var t=0,i=e.length;t<i;){var n=e[t];t=t+1|0,this.g3(n.h1_1,n.i1_1)}}function _n(e,t,i,n){(null==d&&new Gi,d).o2(e,t,i,gt.f3(n))}return Ut(vt,"Number"),qt(bt,"Unit"),Ht("interface",xt,"Iterable",void 0,void 0,void 0,void 0,void 0,void 0),Gt(Et),Ut(It,"Enum"),Ut(Dt,"Long",r,vt),Ut(At),qt(Qt,"Digit"),Ut(Kt,"BaseOutput"),Ut(Jt,"NodeJsOutput",r,Kt),Ut(ei,"BufferedOutput",ei,Kt),Ut(Xt,"BufferedOutputToConsoleLog",Xt,ei),Ut(ri,"Exception",(function e(){var t=ni(Bt(jt(ri)));return $t(t,e),t}),Error),Ut(di,"RuntimeException",(function e(){var t=li(Bt(jt(di)));return $t(t,e),t}),ri),Ut(oi,"IllegalArgumentException",(function e(){var t,i=(li(t=Bt(jt(oi))),oi.call(t),t);return $t(i,e),i}),di),Ut(ci,"IllegalStateException",(function e(){var t,i=(li(t=Bt(jt(ci))),ci.call(t),t);return $t(i,e),i}),di),Ut(mi,"NoSuchElementException",hi,di),Ut(fi,"ClassCastException",gi,di),Ut(vi,"UninitializedPropertyAccessException",(function e(){var t,i=(li(t=Bt(jt(vi))),vi.call(t),t);return $t(i,e),i}),di),Ut(Ci,"IntIterator"),Gt(Ei),Ut(Ti,"IntProgression",r,r,[xt]),Ut(Ii,"IntRange",r,Ti),Ut(Pi,"IntProgressionIterator",r,Ci),Gt(Di),Ut(Li,"Pair"),jt(bt).toString=function(){return"kotlin.Unit"},jt(It).equals=function(e){return this===e},jt(It).toString=function(){return this.c_1},jt(Dt).f=function(){return this.e_1},jt(At).i=function(){return!(this.g_1===this.h_1.length)},jt(At).j=function(){if(this.g_1===this.h_1.length)throw pi(""+this.g_1);var e=this.g_1;return this.g_1=e+1|0,this.h_1[e]},jt(Jt).n=function(e){var t=String(e);this.o_1.write(t)},jt(Xt).n=function(e){var t=String(e),i=t.lastIndexOf("\n",0);i>=0&&(this.q_1=this.q_1+t.substring(0,i),this.r(),t=t.substring(i+1|0)),this.q_1=this.q_1+t},jt(Xt).r=function(){console.log(this.q_1),this.q_1=""},jt(ei).n=function(e){this.q_1=this.q_1+String(e)},jt(Ci).j=function(){return this.u()},jt(Ii).z=function(){return this.a1_1>this.b1_1},jt(Ii).equals=function(e){return e instanceof Ii&&(this.z()&&e.z()||this.a1_1===e.a1_1&&this.b1_1===e.b1_1)},jt(Ii).toString=function(){return this.a1_1+".."+this.b1_1},jt(Pi).i=function(){return this.f1_1},jt(Pi).u=function(){var e=this.g1_1;if(e===this.e1_1){if(!this.f1_1)throw hi();this.f1_1=!1}else this.g1_1=this.g1_1+this.d1_1|0;return e},jt(Di).a=function(e,t,i){return new Ti(e,t,i)},jt(Ti).b=function(){return new Pi(this.a1_1,this.b1_1,this.c1_1)},jt(Ti).z=function(){return this.c1_1>0?this.a1_1>this.b1_1:this.a1_1<this.b1_1},jt(Ti).equals=function(e){return e instanceof Ti&&(this.z()&&e.z()||this.a1_1===e.a1_1&&this.b1_1===e.b1_1&&this.c1_1===e.c1_1)},jt(Ti).toString=function(){return this.c1_1>0?this.a1_1+".."+this.b1_1+" step "+this.c1_1:this.a1_1+" downTo "+this.b1_1+" step "+(0|-this.c1_1)},jt(Li).toString=function(){return"("+Pt(this.h1_1)+", "+Pt(this.i1_1)+")"},jt(Li).equals=function(e){if(this===e)return!0;if(!(e instanceof Li))return!1;var t=e instanceof Li?e:Nt();return!!Lt(this.h1_1,t.h1_1)&&!!Lt(this.i1_1,t.i1_1)},i=new bt,new Et,l=new Di,Gt(Hi),Ut(qi,"AbstractSharedAnalytics"),qt(Gi,"EventService"),Ut(Ki,"Platform",r,It),Ut(Xi,"PlausibleDestinations",r,It),Ut(en,"PlausibleEvent"),Ut(cn,"LogLevels",r,It),Gt(ln),qt(hn,"SharedAnalytics",r,qi),Ut(mn,"PlatformList"),Gt(gn),Ut(fn,"PlatformMap"),jt(qi).w1=function(e,t,n,r){if(Ni(this))return i;this.k1_1=e,this.l1_1="4.10.0",this.m1_1=t,this.j1_1=n,this.n1_1=r},jt(qi).y1=function(){return"uat"===this.n1_1.toLowerCase()?"https://analytics-uat.mealz.ai/publish_event":"https://analytics.mealz.ai/publish_event"},jt(qi).z1=function(e,t,n,r){if(!Ni(this))return un().f2_1("Tried to send event before analytics initialization");Vi(0,t),function(e,t){if(!Ui().u1_1.v1(t))throw si('Invalid journey : "'+t+'". Valid values are '+Ui().u1_1.toString())}(0,n),r.i2("client_sdk_version",zi(this)),r.i2("analytics_sdk_version",function(e){var t=e.l1_1;if(null!=t)return t;Vt("analyticsSDKVersion")}(this)),r.i2("platform",(function(){if(p)return i;p=!0,new Ki("ANDROID",0),new Ki("IOS",1),h=new Ki("WEB",2)}(),h).c_1),r.i2("abTestKey",this.o1_1),r.i2("affiliate",this.p1_1),r.i2("journey",n);var s=new en(e,t,ji(this),r.j2());!function(e){var t=e.j1_1;if(null!=t)return t;Vt("onEmit")}(this)(s),this.x1(s)},jt(Gi).o2=function(e,t,n,r){var s,o,a=this.k2_1.p2(e);if(null==a)s=null;else{var c,l=a.p2("mandatory");if(null==l)c=null;else{if(!l.y2((o=r,function(e){return!(null==o.p2(e))})))throw ai(Mt("Invalid props for "+e+" event : mandatory props are "+l.toString()+" and optional props are "+Pt(a.p2("optional"))));pn().x2(e,t,n,r),c=i}if(null==c)throw ai(Mt("No mandatory props found for "+e));s=i}if(null==s)throw ai(Mt("Unknown event "+e))},jt(en).a3=function(){return this.name},jt(en).b3=function(){return this.url},jt(en).c3=function(){return this.domain},jt(en).d3=function(){return this.props},jt(hn).x1=function(e){var t=this.y1(),i=new Headers;i.set("Content-Type","application/json");var n=JSON.stringify(e),r={method:"POST"};r.headers=i,r.body=n,r.referrer=void 0,r.referrerPolicy=void 0,r.mode=void 0,r.credentials=void 0,r.cache=void 0,r.redirect=void 0,r.integrity=void 0,r.keepalive=void 0,r.window=void 0;var s=r;window.fetch("https://plausible.io/api/event",s),window.fetch(t,s)},jt(hn).x2=function(e,t,i,n){this.z1(e,t,i,n)},jt(hn).z2=function(e,t,i,n){this.w1(e,t,i,n)},jt(mn).r1=function(e){this.q1_1.forEach(e)},jt(mn).y2=function(e){var t=this.q1_1.every(e);return null!=t&&"boolean"==typeof t?t:Nt()},jt(mn).e3=function(e){this.q1_1.push(e)},jt(mn).v1=function(e){var t=this.q1_1.includes(e);return null!=t&&"boolean"==typeof t?t:Nt()},jt(mn).toString=function(){for(var e="",t=ii(this.q1_1);t.i();)e+=t.j()+",";return"["+function(e,t,i){i=i===r?e:i;var n=function(e,t,i,n){var s,o;if(i=i===r?Bi(e):i,(n=n!==r&&n)||"string"!=typeof e)s=function(e,t,i,n){if(i=i===r?Bi(e):i,!(n=n!==r&&n)&&1===t.length&&"string"==typeof e){var s=St(function(e){var t;switch(e.length){case 0:throw pi("Array is empty.");case 1:t=e[0];break;default:throw si("Array has more than one element.")}return t}(t));return e.lastIndexOf(s,i)}var o=yt(i,Bi(e));if(0<=o)do{var a=o;o=o+-1|0;var c,l=Rt(e,a);e:{for(var u=0,d=t.length;u<d;){var h=t[u];if(u=u+1|0,Ai(h,l,n)){c=!0;break e}}c=!1}if(c)return a}while(0<=o);return-1}(e,((o=new Uint16Array([44])).$type$="CharArray",o),i,n);else{var a=St(44);s=e.lastIndexOf(a,i)}return s}(e);return-1===n?i:e.substring(0,n)}(e)+"]"},jt(gn).f3=function(e){for(var t=new fn([]),i=ii(Object.keys(e));i.i();){var n=i.j(),r=null==n||null!=n?n:Nt(),s=e[n];t.i2(r,null==s||null!=s?s:Nt())}return t},jt(fn).j2=function(){var e=this.h2_1;return null!=e?e:Nt()},jt(fn).g3=function(e,t){this.h2_1[e]=t;var i=this.h2_1[e];return null==i||null!=i?i:null},jt(fn).p2=function(e){var t=this.h2_1[e];return null==t||null!=t?t:null},jt(fn).i2=function(e,t){this.h2_1[e]=t},jt(fn).toString=function(){return JSON.stringify(this.h2_1)},gt=new gn,t})()},"TPB+":function(e,t,i){"use strict";(function(e){var n=i("fw2E"),r=i("VxF/"),s="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=s&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===s?n.a.Buffer:void 0;t.a=(a?a.isBuffer:void 0)||r.a}).call(this,i("cyaT")(e))},"VxF/":function(e,t,i){"use strict";t.a=function(){return!1}},WYLL:function(e,t){function i(e){return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}i.keys=function(){return[]},i.resolve=i,e.exports=i,i.id="WYLL"},X1CF:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;var r=i("9a4g"),s=i("xRwy"),o=i("9aqK"),a=i("D57s");t.parse=function(e){var t=function(e){return"string"==typeof e?s.parseISODuration(e):n(n({},r.ZERO),"number"==typeof e?{milliseconds:e}:e)}(e);return o.validate(t),a.cleanDurationObject(t)}},cyaT:function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},fw2E:function(e,t,i){"use strict";var n=i("kq48"),r="object"==typeof self&&self&&self.Object===Object&&self,s=n.a||r||Function("return this")();t.a=s},grw1:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNegativelySigned=void 0,t.isNegativelySigned=function(e){return e<0||Object.is(e,-0)}},kIwI:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0;var r=i("X1CF"),s=i("960K"),o=i("4NgV"),a=i("9a4g"),c=function(e){return e.join("").replace(/\./g,",")};t.toString=function(e){if(s.isZero(e))return"P0D";var t=n({},r.parse(e));if(1===o.getUnitCount(t)&&0!==t.weeks)return"P"+t.weeks+"W";var i={period:[],time:[]};a.UNITS_META.forEach((function(e){var i=e.unit,n=e.stringifyConvertTo;null!=n&&(t[n]+=t[i]*a.UNITS_META_MAP[i].milliseconds/a.UNITS_META_MAP[n].milliseconds,t[i]=0)})),a.UNITS_META.forEach((function(e){var n=e.ISOPrecision,r=t[e.unit];null!=n&&0!==r&&i[n].push(""+r+e.ISOCharacter)}));var l="P"+c(i.period);return i.time.length&&(l+="T"+c(i.time)),l}},kq48:function(e,t,i){"use strict";var n="object"==typeof global&&global&&global.Object===Object&&global;t.a=n},pvze:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=this&&this.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};Object.defineProperty(t,"__esModule",{value:!0}),t.normalize=void 0;var s=i("9a4g"),o=i("JsNM"),a=i("GrrB"),c=i("svPx"),l=i("X1CF"),u=function(e,t){return function(i,r){var s=n({},i);return e.forEach((function(e){var i=t(e);s[e]=~~(r/i),r-=s[e]*i})),s}},d=u(["years","months"],(function(e){return s.UNITS_META_MAP_LITERAL[e].months})),h=u(["days","hours","minutes","seconds","milliseconds"],(function(e){return s.UNITS_META_MAP_LITERAL[e].milliseconds}));t.normalize=function(e,t){return function(e){var t=l.parse(e),i=t.years,o=t.months,a=t.weeks,u=t.days,p=r(t,["years","months","weeks","days"]),m=n({},s.ZERO);return m=d(m,c.toMonths({years:i,months:o})),h(m,c.toMilliseconds(n(n({},p),{days:u+7*a})))}(null!=t?o.between(t,a.apply(t,e)):e)}},svPx:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toYears=t.toMonths=t.toWeeks=t.toDays=t.toHours=t.toMinutes=t.toSeconds=t.toUnit=t.toMilliseconds=void 0;var n=i("X1CF"),r=i("9a4g");t.toMilliseconds=function(e){var t=n.parse(e);return r.UNITS_META.reduce((function(e,i){return e+t[i.unit]*i.milliseconds}),0)},t.toUnit=function(e,i){return t.toMilliseconds(e)/r.UNITS_META_MAP[i].milliseconds};var s=function(e){return function(i){return t.toUnit(i,e)}};t.toSeconds=s("seconds"),t.toMinutes=s("minutes"),t.toHours=s("hours"),t.toDays=s("days"),t.toWeeks=s("weeks"),t.toMonths=s("months"),t.toYears=s("years")},wvHV:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNegative=void 0;var n=i("svPx");t.isNegative=function(e){return n.toMilliseconds(e)<0}},xRwy:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.parseISODuration=void 0;var r=i("9a4g"),s=i("MBFf"),o=i("grw1"),a="(?:[,.](\\d{1,3})\\d*)?",c=function(e){return"(?:(-?\\d+)"+e+")?"},l=function(e,t){return function(i){var a=i.match(e);if(!a)return null;var c="-"===a[1],l=a.slice(2);if(l.every((function(e){return void 0===e})))return null;var u=l.map((function(e,t){return void 0===e&&(e="0"),Number(t===l.length-1?e.padEnd(3,"0"):e)})),d=n({},r.ZERO);return t.forEach((function(e,t){d[e]=u[t]})),o.isNegativelySigned(d.seconds)&&(d.milliseconds*=-1),c?s.negate(d):d}},u=l(new RegExp(["^(-)?P","(\\d{4})","-?","(\\d{2})","-?","(\\d{2})","T","(\\d{2})",":?","(\\d{2})",":?","(\\d{2})",a,"$"].join("")),["years","months","days","hours","minutes","seconds","milliseconds"]),d=l(new RegExp(["^(-)?P",c("Y"),c("M"),c("W"),c("D"),"(?:T",c("H"),c("M"),c(a+"S"),")?$"].join("")),["years","months","weeks","days","hours","minutes","seconds","milliseconds"]);t.parseISODuration=function(e){var t=d(e)||u(e);if(null===t)throw new SyntaxError('Failed to parse duration. "'+e+'" is not a valid ISO duration string.');return t}},yerO:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),t.UNITS=void 0,r(i("0LHn"),t),r(i("GrrB"),t),r(i("JsNM"),t),r(i("wvHV"),t),r(i("960K"),t),r(i("MBFf"),t),r(i("pvze"),t),r(i("X1CF"),t),r(i("NMSN"),t),r(i("ROwQ"),t),r(i("kIwI"),t),r(i("svPx"),t),r(i("NoVc"),t);var s=i("9a4g");Object.defineProperty(t,"UNITS",{enumerable:!0,get:function(){return s.UNITS}})}},[[0,0]]]);
1
+ (window.webpackJsonpWebcMiamV10=window.webpackJsonpWebcMiamV10||[]).push([[1],{0:function(e,t,i){e.exports=i("5Mvx")},"0LHn":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.abs=void 0;var n=i("wvHV"),r=i("MBFf"),s=i("X1CF");t.abs=function(e){return n.isNegative(e)?r.negate(e):s.parse(e)}},"4NgV":function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getUnitCount=void 0;var r=i("9a4g"),s=i("X1CF");t.getUnitCount=function(e){var t=n({},s.parse(e)),i=0;return r.UNITS.forEach((function(e){0!==t[e]&&i++})),i}},"5Mvx":function(e,t,i){"use strict";function n(e){return"function"==typeof e}i.r(t);let r=!1;const s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else r&&console.log("RxJS: Back to a better error behavior. Thank you. <3");r=e},get useDeprecatedSynchronousErrorHandling(){return r}};function o(e){setTimeout(()=>{throw e},0)}const a={closed:!0,next(e){},error(e){if(s.useDeprecatedSynchronousErrorHandling)throw e;o(e)},complete(){}},c=(()=>Array.isArray||(e=>e&&"number"==typeof e.length))();function l(e){return null!==e&&"object"==typeof e}const u=(()=>{function e(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((e,t)=>`${t+1}) ${e.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e})();let d=(()=>{class e{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:i,_ctorUnsubscribe:r,_unsubscribe:s,_subscriptions:o}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(let e=0;e<i.length;++e)i[e].remove(this);if(n(s)){r&&(this._unsubscribe=void 0);try{s.call(this)}catch(a){t=a instanceof u?h(a.errors):[a]}}if(c(o)){let e=-1,i=o.length;for(;++e<i;){const i=o[e];if(l(i))try{i.unsubscribe()}catch(a){t=t||[],a instanceof u?t=t.concat(h(a.errors)):t.push(a)}}}if(t)throw new u(t)}add(t){let i=t;if(!t)return e.EMPTY;switch(typeof t){case"function":i=new e(t);case"object":if(i===this||i.closed||"function"!=typeof i.unsubscribe)return i;if(this.closed)return i.unsubscribe(),i;if(!(i instanceof e)){const t=i;i=new e,i._subscriptions=[t]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}let{_parentOrParents:n}=i;if(null===n)i._parentOrParents=this;else if(n instanceof e){if(n===this)return i;i._parentOrParents=[n,this]}else{if(-1!==n.indexOf(this))return i;n.push(this)}const r=this._subscriptions;return null===r?this._subscriptions=[i]:r.push(i),i}remove(e){const t=this._subscriptions;if(t){const i=t.indexOf(e);-1!==i&&t.splice(i,1)}}}return e.EMPTY=function(e){return e.closed=!0,e}(new e),e})();function h(e){return e.reduce((e,t)=>e.concat(t instanceof u?t.errors:t),[])}const p=(()=>"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random())();class m extends d{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=a;break;case 1:if(!e){this.destination=a;break}if("object"==typeof e){e instanceof m?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new g(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new g(this,e,t,i)}}[p](){return this}static create(e,t,i){const n=new m(e,t,i);return n.syncErrorThrowable=!1,n}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class g extends m{constructor(e,t,i,r){let s;super(),this._parentSubscriber=e;let o=this;n(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==a&&(o=Object.create(t),n(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;s.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=s;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):o(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;o(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);s.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),s.useDeprecatedSynchronousErrorHandling)throw i;o(i)}}__tryOrSetError(e,t,i){if(!s.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(n){return s.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=n,e.syncErrorThrown=!0,!0):(o(n),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const f=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")();function _(e){return e}let v=(()=>{class e{constructor(e){this._isScalar=!1,e&&(this._subscribe=e)}lift(t){const i=new e;return i.source=this,i.operator=t,i}subscribe(e,t,i){const{operator:n}=this,r=function(e,t,i){if(e){if(e instanceof m)return e;if(e[p])return e[p]()}return e||t||i?new m(e,t,i):new m(a)}(e,t,i);if(r.add(n?n.call(r,this.source):this.source||s.useDeprecatedSynchronousErrorHandling&&!r.syncErrorThrowable?this._subscribe(r):this._trySubscribe(r)),s.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable&&(r.syncErrorThrowable=!1,r.syncErrorThrown))throw r.syncErrorValue;return r}_trySubscribe(e){try{return this._subscribe(e)}catch(t){s.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){const{closed:t,destination:i,isStopped:n}=e;if(t||n)return!1;e=i&&i instanceof m?i:null}return!0}(e)?e.error(t):console.warn(t)}}forEach(e,t){return new(t=b(t))((t,i)=>{let n;n=this.subscribe(t=>{try{e(t)}catch(r){i(r),n&&n.unsubscribe()}},i,t)})}_subscribe(e){const{source:t}=this;return t&&t.subscribe(e)}[f](){return this}pipe(...e){return 0===e.length?this:(0===(t=e).length?_:1===t.length?t[0]:function(e){return t.reduce((e,t)=>t(e),e)})(this);var t}toPromise(e){return new(e=b(e))((e,t)=>{let i;this.subscribe(e=>i=e,e=>t(e),()=>e(i))})}}return e.create=t=>new e(t),e})();function b(e){if(e||(e=s.Promise||Promise),!e)throw new Error("no Promise impl found");return e}const y=(()=>{function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e})();class w extends d{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class k extends m{constructor(e){super(e),this.destination=e}}let C=(()=>{class e extends v{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[p](){return new k(this)}lift(e){const t=new S(this,this);return t.operator=e,t}next(e){if(this.closed)throw new y;if(!this.isStopped){const{observers:t}=this,i=t.length,n=t.slice();for(let r=0;r<i;r++)n[r].next(e)}}error(e){if(this.closed)throw new y;this.hasError=!0,this.thrownError=e,this.isStopped=!0;const{observers:t}=this,i=t.length,n=t.slice();for(let r=0;r<i;r++)n[r].error(e);this.observers.length=0}complete(){if(this.closed)throw new y;this.isStopped=!0;const{observers:e}=this,t=e.length,i=e.slice();for(let n=0;n<t;n++)i[n].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(e){if(this.closed)throw new y;return super._trySubscribe(e)}_subscribe(e){if(this.closed)throw new y;return this.hasError?(e.error(this.thrownError),d.EMPTY):this.isStopped?(e.complete(),d.EMPTY):(this.observers.push(e),new w(this,e))}asObservable(){const e=new v;return e.source=this,e}}return e.create=(e,t)=>new S(e,t),e})();class S extends C{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):d.EMPTY}}function x(e){return e&&"function"==typeof e.schedule}function E(e,t){return function(i){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new I(e,t))}}class I{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new P(e,this.project,this.thisArg))}}class P extends m{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const D=e=>t=>{for(let i=0,n=e.length;i<n&&!t.closed;i++)t.next(e[i]);t.complete()};function T(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}const A=T(),R=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function O(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}const F=e=>{if(e&&"function"==typeof e[f])return n=e,e=>{const t=n[f]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)};if(R(e))return D(e);if(O(e))return i=e,e=>(i.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,o),e);if(e&&"function"==typeof e[A])return t=e,e=>{const i=t[A]();for(;;){let t;try{t=i.next()}catch(n){return e.error(n),e}if(t.done){e.complete();break}if(e.next(t.value),e.closed)break}return"function"==typeof i.return&&e.add(()=>{i.return&&i.return()}),e};{const t=l(e)?"an invalid object":`'${e}'`;throw new TypeError(`You provided ${t} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`)}var t,i,n};function B(e,t){return new v(i=>{const n=new d;let r=0;return n.add(t.schedule((function(){r!==e.length?(i.next(e[r++]),i.closed||n.add(this.schedule())):i.complete()}))),n})}function M(e,t){return t?function(e,t){if(null!=e){if(function(e){return e&&"function"==typeof e[f]}(e))return function(e,t){return new v(i=>{const n=new d;return n.add(t.schedule(()=>{const r=e[f]();n.add(r.subscribe({next(e){n.add(t.schedule(()=>i.next(e)))},error(e){n.add(t.schedule(()=>i.error(e)))},complete(){n.add(t.schedule(()=>i.complete()))}}))})),n})}(e,t);if(O(e))return function(e,t){return new v(i=>{const n=new d;return n.add(t.schedule(()=>e.then(e=>{n.add(t.schedule(()=>{i.next(e),n.add(t.schedule(()=>i.complete()))}))},e=>{n.add(t.schedule(()=>i.error(e)))}))),n})}(e,t);if(R(e))return B(e,t);if(function(e){return e&&"function"==typeof e[A]}(e)||"string"==typeof e)return function(e,t){if(!e)throw new Error("Iterable cannot be null");return new v(i=>{const n=new d;let r;return n.add(()=>{r&&"function"==typeof r.return&&r.return()}),n.add(t.schedule(()=>{r=e[A](),n.add(t.schedule((function(){if(i.closed)return;let e,t;try{const i=r.next();e=i.value,t=i.done}catch(n){return void i.error(n)}t?i.complete():(i.next(e),this.schedule())})))})),n})}(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}(e,t):e instanceof v?e:new v(F(e))}class L extends m{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class $ extends m{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function j(e,t){if(t.closed)return;if(e instanceof v)return e.subscribe(t);let i;try{i=F(e)(t)}catch(n){t.error(n)}return i}function z(e,t,i=Number.POSITIVE_INFINITY){return"function"==typeof t?n=>n.pipe(z((i,n)=>M(e(i,n)).pipe(E((e,r)=>t(i,e,n,r))),i)):("number"==typeof t&&(i=t),t=>t.lift(new N(e,i)))}class N{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new V(e,this.project,this.concurrent))}}class V extends ${constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)}_tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(n){return void this.destination.error(n)}this.active++,this._innerSub(t)}_innerSub(e){const t=new L(this),i=this.destination;i.add(t);const n=j(e,t);n!==t&&i.add(n)}_complete(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyComplete(){const e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function H(e=Number.POSITIVE_INFINITY){return z(_,e)}function U(e,t){return t?B(e,t):new v(D(e))}function q(...e){let t=Number.POSITIVE_INFINITY,i=null,n=e[e.length-1];return x(n)?(i=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(t=e.pop())):"number"==typeof n&&(t=e.pop()),null===i&&1===e.length&&e[0]instanceof v?e[0]:H(t)(U(e,i))}function G(){return function(e){return e.lift(new W(e))}}class W{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const n=new Z(e,i),r=t.subscribe(n);return n.closed||(n.connection=i.connect()),r}}class Z extends m{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,n=e._connection;this.connection=null,!n||i&&n!==i||n.unsubscribe()}}class Q extends v{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new d,e.add(this.source.subscribe(new K(this.getSubject(),this))),e.closed&&(this._connection=null,e=d.EMPTY)),e}refCount(){return G()(this)}}const Y=(()=>{const e=Q.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}})();class K extends k{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}function J(){return new C}function X(e){for(let t in e)if(e[t]===X)return t;throw Error("Could not find renamed property on target object.")}function ee(e,t){for(const i in t)t.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=t[i])}function te(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(te).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return""+e.overriddenName;if(e.name)return""+e.name;const t=e.toString();if(null==t)return""+t;const i=t.indexOf("\n");return-1===i?t:t.substring(0,i)}function ie(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const ne=X({__forward_ref__:X});function re(e){return e.__forward_ref__=re,e.toString=function(){return te(this())},e}function se(e){return oe(e)?e():e}function oe(e){return"function"==typeof e&&e.hasOwnProperty(ne)&&e.__forward_ref__===re}class ae extends Error{constructor(e,t){super(function(e,t){return`${e?`NG0${e}: `:""}${t}`}(e,t)),this.code=e}}function ce(e){return"string"==typeof e?e:null==e?"":String(e)}function le(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():ce(e)}function ue(e,t){const i=t?" in "+t:"";throw new ae("201",`No provider for ${le(e)} found${i}`)}function de(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function he(e){return{providers:e.providers||[],imports:e.imports||[]}}function pe(e){return me(e,fe)||me(e,ve)}function me(e,t){return e.hasOwnProperty(t)?e[t]:null}function ge(e){return e&&(e.hasOwnProperty(_e)||e.hasOwnProperty(be))?e[_e]:null}const fe=X({\u0275prov:X}),_e=X({\u0275inj:X}),ve=X({ngInjectableDef:X}),be=X({ngInjectorDef:X});var ye=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}({});let we;function ke(e){const t=we;return we=e,t}function Ce(e,t,i){const n=pe(e);return n&&"root"==n.providedIn?void 0===n.value?n.value=n.factory():n.value:i&ye.Optional?null:void 0!==t?t:void ue(te(e),"Injector")}function Se(e){return{toString:e}.toString()}var xe=function(e){return e[e.OnPush=0]="OnPush",e[e.Default=1]="Default",e}({}),Ee=function(e){return e[e.Emulated=0]="Emulated",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom",e}({});const Ie="undefined"!=typeof globalThis&&globalThis,Pe="undefined"!=typeof window&&window,De="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Te="undefined"!=typeof global&&global,Ae=Ie||Te||Pe||De,Re={},Oe=[],Fe=[],Be=X({\u0275cmp:X}),Me=X({\u0275dir:X}),Le=X({\u0275pipe:X}),$e=X({\u0275mod:X}),je=X({\u0275loc:X}),ze=X({\u0275fac:X}),Ne=X({__NG_ELEMENT_ID__:X});let Ve=0;function He(e){return Se(()=>{const t={},i={type:e.type,providersResolver:null,decls:e.decls,vars:e.vars,factory:null,template:e.template||null,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:e.exportAs||null,onPush:e.changeDetection===xe.OnPush,directiveDefs:null,pipeDefs:null,selectors:e.selectors||Fe,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||Ee.Emulated,id:"c",styles:e.styles||Fe,_:null,setInput:null,schemas:e.schemas||null,tView:null},n=e.directives,r=e.features,s=e.pipes;return i.id+=Ve++,i.inputs=Ze(e.inputs,t),i.outputs=Ze(e.outputs),r&&r.forEach(e=>e(i)),i.directiveDefs=n?()=>("function"==typeof n?n():n).map(Ue):null,i.pipeDefs=s?()=>("function"==typeof s?s():s).map(qe):null,i})}function Ue(e){return Ke(e)||function(e){return e[Me]||null}(e)}function qe(e){return function(e){return e[Le]||null}(e)}const Ge={};function We(e){const t={type:e.type,bootstrap:e.bootstrap||Fe,declarations:e.declarations||Fe,imports:e.imports||Fe,exports:e.exports||Fe,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null};return null!=e.id&&Se(()=>{Ge[e.id]=e.type}),t}function Ze(e,t){if(null==e)return Re;const i={};for(const n in e)if(e.hasOwnProperty(n)){let r=e[n],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),i[r]=n,t&&(t[r]=s)}return i}const Qe=He;function Ye(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null}}function Ke(e){return e[Be]||null}function Je(e,t){const i=e[$e]||null;if(!i&&!0===t)throw new Error(`Type ${te(e)} does not have '\u0275mod' property.`);return i}function Xe(e){return Array.isArray(e)&&"object"==typeof e[1]}function et(e){return Array.isArray(e)&&!0===e[1]}function tt(e){return 0!=(8&e.flags)}function it(e){return 2==(2&e.flags)}function nt(e){return 1==(1&e.flags)}function rt(e){return null!==e.template}function st(e,t){return e.hasOwnProperty(ze)?e[ze]:null}class ot{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function at(){return ct}function ct(e){return e.type.prototype.ngOnChanges&&(e.setInput=ut),lt}function lt(){const e=dt(this),t=null==e?void 0:e.current;if(t){const i=e.previous;if(i===Re)e.previous=t;else for(let e in t)i[e]=t[e];e.current=null,this.ngOnChanges(t)}}function ut(e,t,i,n){const r=dt(e)||function(e,t){return e.__ngSimpleChanges__=t}(e,{previous:Re,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[i],c=o[a];s[a]=new ot(c&&c.currentValue,t,o===Re),e[n]=t}function dt(e){return e.__ngSimpleChanges__||null}at.ngInherit=!0;let ht=void 0;function pt(){return void 0!==ht?ht:"undefined"!=typeof document?document:void 0}function mt(e){return!!e.listen}const gt={createRenderer:(e,t)=>pt()};function ft(e){for(;Array.isArray(e);)e=e[0];return e}function _t(e,t){return ft(t[e])}function vt(e,t){return ft(t[e.index])}function bt(e,t){return e.data[t]}function yt(e,t){return e[t]}function wt(e,t){const i=t[e];return Xe(i)?i:i[0]}function kt(e){const t=function(e){return e.__ngContext__||null}(e);return t?Array.isArray(t)?t:t.lView:null}function Ct(e){return 4==(4&e[2])}function St(e){return 128==(128&e[2])}function xt(e,t){return null==t?null:e[t]}function Et(e){e[18]=0}function It(e,t){e[5]+=t;let i=e,n=e[3];for(;null!==n&&(1===t&&1===i[5]||-1===t&&0===i[5]);)n[5]+=t,i=n,n=n[3]}const Pt={lFrame:Jt(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Dt(){return Pt.bindingsEnabled}function Tt(){return Pt.lFrame.lView}function At(){return Pt.lFrame.tView}function Rt(e){Pt.lFrame.contextLView=e}function Ot(){let e=Ft();for(;null!==e&&64===e.type;)e=e.parent;return e}function Ft(){return Pt.lFrame.currentTNode}function Bt(e,t){const i=Pt.lFrame;i.currentTNode=e,i.isParent=t}function Mt(){return Pt.lFrame.isParent}function Lt(){Pt.lFrame.isParent=!1}function $t(){return Pt.isInCheckNoChangesMode}function jt(e){Pt.isInCheckNoChangesMode=e}function zt(){const e=Pt.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function Nt(){return Pt.lFrame.bindingIndex}function Vt(){return Pt.lFrame.bindingIndex++}function Ht(e){const t=Pt.lFrame,i=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,i}function Ut(e,t){const i=Pt.lFrame;i.bindingIndex=i.bindingRootIndex=e,qt(t)}function qt(e){Pt.lFrame.currentDirectiveIndex=e}function Gt(){return Pt.lFrame.currentQueryIndex}function Wt(e){Pt.lFrame.currentQueryIndex=e}function Zt(e){const t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function Qt(e,t,i){if(i&ye.SkipSelf){let n=t,r=e;for(;n=n.parent,!(null!==n||i&ye.Host||(n=Zt(r),null===n)||(r=r[15],10&n.type)););if(null===n)return!1;t=n,e=r}const n=Pt.lFrame=Kt();return n.currentTNode=t,n.lView=e,!0}function Yt(e){const t=Kt(),i=e[1];Pt.lFrame=t,t.currentTNode=i.firstChild,t.lView=e,t.tView=i,t.contextLView=e,t.bindingIndex=i.bindingStartIndex,t.inI18n=!1}function Kt(){const e=Pt.lFrame,t=null===e?null:e.child;return null===t?Jt(e):t}function Jt(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function Xt(){const e=Pt.lFrame;return Pt.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const ei=Xt;function ti(){const e=Xt();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function ii(){return Pt.lFrame.selectedIndex}function ni(e){Pt.lFrame.selectedIndex=e}function ri(){const e=Pt.lFrame;return bt(e.tView,e.selectedIndex)}function si(){Pt.lFrame.currentNamespace="http://www.w3.org/2000/svg"}function oi(e,t){for(let i=t.directiveStart,n=t.directiveEnd;i<n;i++){const t=e.data[i].type.prototype,{ngAfterContentInit:n,ngAfterContentChecked:r,ngAfterViewInit:s,ngAfterViewChecked:o,ngOnDestroy:a}=t;n&&(e.contentHooks||(e.contentHooks=[])).push(-i,n),r&&((e.contentHooks||(e.contentHooks=[])).push(i,r),(e.contentCheckHooks||(e.contentCheckHooks=[])).push(i,r)),s&&(e.viewHooks||(e.viewHooks=[])).push(-i,s),o&&((e.viewHooks||(e.viewHooks=[])).push(i,o),(e.viewCheckHooks||(e.viewCheckHooks=[])).push(i,o)),null!=a&&(e.destroyHooks||(e.destroyHooks=[])).push(i,a)}}function ai(e,t,i){ui(e,t,3,i)}function ci(e,t,i,n){(3&e[2])===i&&ui(e,t,i,n)}function li(e,t){let i=e[2];(3&i)===t&&(i&=2047,i+=1,e[2]=i)}function ui(e,t,i,n){const r=null!=n?n:-1,s=t.length-1;let o=0;for(let a=void 0!==n?65535&e[18]:0;a<s;a++)if("number"==typeof t[a+1]){if(o=t[a],null!=n&&o>=n)break}else t[a]<0&&(e[18]+=65536),(o<r||-1==r)&&(di(e,i,t,a),e[18]=(4294901760&e[18])+a+2),a++}function di(e,t,i,n){const r=i[n]<0,s=i[n+1],o=e[r?-i[n]:i[n]];if(r){if(e[2]>>11<e[18]>>16&&(3&e[2])===t){e[2]+=2048;try{s.call(o)}finally{}}}else try{s.call(o)}finally{}}class hi{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function pi(e,t,i){const n=mt(e);let r=0;for(;r<i.length;){const s=i[r];if("number"==typeof s){if(0!==s)break;r++;const o=i[r++],a=i[r++],c=i[r++];n?e.setAttribute(t,a,c,o):t.setAttributeNS(o,a,c)}else{const o=s,a=i[++r];mi(o)?n&&e.setProperty(t,o,a):n?e.setAttribute(t,o,a):t.setAttribute(o,a),r++}}return r}function mi(e){return 64===e.charCodeAt(0)}function gi(e,t){if(null===t||0===t.length);else if(null===e||0===e.length)e=t.slice();else{let i=-1;for(let n=0;n<t.length;n++){const r=t[n];"number"==typeof r?i=r:0===i||fi(e,i,r,null,-1===i||2===i?t[++n]:null)}}return e}function fi(e,t,i,n,r){let s=0,o=e.length;if(-1===t)o=-1;else for(;s<e.length;){const i=e[s++];if("number"==typeof i){if(i===t){o=-1;break}if(i>t){o=s-1;break}}}for(;s<e.length;){const t=e[s];if("number"==typeof t)break;if(t===i){if(null===n)return void(null!==r&&(e[s+1]=r));if(n===e[s+1])return void(e[s+2]=r)}s++,null!==n&&s++,null!==r&&s++}-1!==o&&(e.splice(o,0,t),s=o+1),e.splice(s++,0,i),null!==n&&e.splice(s++,0,n),null!==r&&e.splice(s++,0,r)}function _i(e){return-1!==e}function vi(e){return 32767&e}function bi(e,t){let i=e>>16,n=t;for(;i>0;)n=n[15],i--;return n}let yi=!0;function wi(e){const t=yi;return yi=e,t}let ki=0;function Ci(e,t){const i=xi(e,t);if(-1!==i)return i;const n=t[1];n.firstCreatePass&&(e.injectorIndex=t.length,Si(n.data,e),Si(t,null),Si(n.blueprint,null));const r=Ei(e,t),s=e.injectorIndex;if(_i(r)){const e=vi(r),i=bi(r,t),n=i[1].data;for(let r=0;r<8;r++)t[s+r]=i[e+r]|n[e+r]}return t[s+8]=r,s}function Si(e,t){e.push(0,0,0,0,0,0,0,0,t)}function xi(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function Ei(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let i=0,n=null,r=t;for(;null!==r;){const e=r[1],t=e.type;if(n=2===t?e.declTNode:1===t?r[6]:null,null===n)return-1;if(i++,r=r[15],-1!==n.injectorIndex)return n.injectorIndex|i<<16}return-1}function Ii(e,t,i){!function(e,t,i){let n;"string"==typeof i?n=i.charCodeAt(0)||0:i.hasOwnProperty(Ne)&&(n=i[Ne]),null==n&&(n=i[Ne]=ki++);const r=255&n;t.data[e+(r>>5)]|=1<<r}(e,t,i)}function Pi(e,t,i){if(i&ye.Optional)return e;ue(t,"NodeInjector")}function Di(e,t,i,n){if(i&ye.Optional&&void 0===n&&(n=null),0==(i&(ye.Self|ye.Host))){const r=e[9],s=ke(void 0);try{return r?r.get(t,n,i&ye.Optional):Ce(t,n,i&ye.Optional)}finally{ke(s)}}return Pi(n,t,i)}function Ti(e,t,i,n=ye.Default,r){if(null!==e){const s=function(e){if("string"==typeof e)return e.charCodeAt(0)||0;const t=e.hasOwnProperty(Ne)?e[Ne]:void 0;return"number"==typeof t?t>=0?255&t:Ri:t}(i);if("function"==typeof s){if(!Qt(t,e,n))return n&ye.Host?Pi(r,i,n):Di(t,i,n,r);try{const e=s();if(null!=e||n&ye.Optional)return e;ue(i)}finally{ei()}}else if("number"==typeof s){let r=null,o=xi(e,t),a=-1,c=n&ye.Host?t[16][6]:null;for((-1===o||n&ye.SkipSelf)&&(a=-1===o?Ei(e,t):t[o+8],-1!==a&&Li(n,!1)?(r=t[1],o=vi(a),t=bi(a,t)):o=-1);-1!==o;){const e=t[1];if(Mi(s,o,e.data)){const e=Oi(o,t,i,r,n,c);if(e!==Ai)return e}a=t[o+8],-1!==a&&Li(n,t[1].data[o+8]===c)&&Mi(s,o,t)?(r=e,o=vi(a),t=bi(a,t)):o=-1}}}return Di(t,i,n,r)}const Ai={};function Ri(){return new $i(Ot(),Tt())}function Oi(e,t,i,n,r,s){const o=t[1],a=o.data[e+8],c=Fi(a,o,i,null==n?it(a)&&yi:n!=o&&0!=(3&a.type),r&ye.Host&&s===a);return null!==c?Bi(t,o,c,a):Ai}function Fi(e,t,i,n,r){const s=e.providerIndexes,o=t.data,a=1048575&s,c=e.directiveStart,l=s>>20,u=r?a+l:e.directiveEnd;for(let d=n?a:a+l;d<u;d++){const e=o[d];if(d<c&&i===e||d>=c&&e.type===i)return d}if(r){const e=o[c];if(e&&rt(e)&&e.type===i)return c}return null}function Bi(e,t,i,n){let r=e[i];const s=t.data;if(r instanceof hi){const o=r;o.resolving&&function(e,t){throw new ae("200","Circular dependency in DI detected for "+e)}(le(s[i]));const a=wi(o.canSeeViewProviders);o.resolving=!0;const c=o.injectImpl?ke(o.injectImpl):null;Qt(e,n,ye.Default);try{r=e[i]=o.factory(void 0,s,e,n),t.firstCreatePass&&i>=n.directiveStart&&function(e,t,i){const{ngOnChanges:n,ngOnInit:r,ngDoCheck:s}=t.type.prototype;if(n){const n=ct(t);(i.preOrderHooks||(i.preOrderHooks=[])).push(e,n),(i.preOrderCheckHooks||(i.preOrderCheckHooks=[])).push(e,n)}r&&(i.preOrderHooks||(i.preOrderHooks=[])).push(0-e,r),s&&((i.preOrderHooks||(i.preOrderHooks=[])).push(e,s),(i.preOrderCheckHooks||(i.preOrderCheckHooks=[])).push(e,s))}(i,s[i],t)}finally{null!==c&&ke(c),wi(a),o.resolving=!1,ei()}}return r}function Mi(e,t,i){return!!(i[t+(e>>5)]&1<<e)}function Li(e,t){return!(e&ye.Self||e&ye.Host&&t)}class $i{constructor(e,t){this._tNode=e,this._lView=t}get(e,t){return Ti(this._tNode,this._lView,e,void 0,t)}}function ji(e){return Se(()=>{const t=e.prototype.constructor,i=t[ze]||zi(t),n=Object.prototype;let r=Object.getPrototypeOf(e.prototype).constructor;for(;r&&r!==n;){const e=r[ze]||zi(r);if(e&&e!==i)return e;r=Object.getPrototypeOf(r)}return e=>new e})}function zi(e){return oe(e)?()=>{const t=zi(se(e));return t&&t()}:st(e)}function Ni(e,t,i){return Se(()=>{const n=function(e){return function(...t){if(e){const i=e(...t);for(const e in i)this[e]=i[e]}}}(t);function r(...e){if(this instanceof r)return n.apply(this,e),this;const t=new r(...e);return i.annotation=t,i;function i(e,i,n){const r=e.hasOwnProperty("__parameters__")?e.__parameters__:Object.defineProperty(e,"__parameters__",{value:[]}).__parameters__;for(;r.length<=n;)r.push(null);return(r[n]=r[n]||[]).push(t),e}}return i&&(r.prototype=Object.create(i.prototype)),r.prototype.ngMetadataName=e,r.annotationCls=r,r})}class Vi{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=de({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return"InjectionToken "+this._desc}}function Hi(e,t){e.forEach(e=>Array.isArray(e)?Hi(e,t):t(e))}function Ui(e,t,i){t>=e.length?e.push(i):e.splice(t,0,i)}function qi(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Gi(e,t){const i=[];for(let n=0;n<e;n++)i.push(t);return i}function Wi(e,t,i){let n=Qi(e,t);return n>=0?e[1|n]=i:(n=~n,function(e,t,i,n){let r=e.length;if(r==t)e.push(i,n);else if(1===r)e.push(n,e[0]),e[0]=i;else{for(r--,e.push(e[r-1],e[r]);r>t;)e[r]=e[r-2],r--;e[t]=i,e[t+1]=n}}(e,n,t,i)),n}function Zi(e,t){const i=Qi(e,t);if(i>=0)return e[1|i]}function Qi(e,t){return function(e,t,i){let n=0,r=e.length>>1;for(;r!==n;){const i=n+(r-n>>1),s=e[i<<1];if(t===s)return i<<1;s>t?r=i:n=i+1}return~(r<<1)}(e,t)}const Yi={},Ki=/\n/gm,Ji=X({provide:String,useValue:X});let Xi=void 0;function en(e){const t=Xi;return Xi=e,t}function tn(e,t=ye.Default){if(void 0===Xi)throw new Error("inject() must be called from an injection context");return null===Xi?Ce(e,void 0,t):Xi.get(e,t&ye.Optional?null:void 0,t)}function nn(e,t=ye.Default){return(we||tn)(se(e),t)}function rn(e){const t=[];for(let i=0;i<e.length;i++){const n=se(e[i]);if(Array.isArray(n)){if(0===n.length)throw new Error("Arguments array must have arguments.");let e=void 0,i=ye.Default;for(let t=0;t<n.length;t++){const r=n[t],s=r.__NG_DI_FLAG__;"number"==typeof s?-1===s?e=r.token:i|=s:e=r}t.push(nn(e,i))}else t.push(nn(n))}return t}function sn(e,t){return e.__NG_DI_FLAG__=t,e.prototype.__NG_DI_FLAG__=t,e}const on=sn(Ni("Inject",e=>({token:e})),-1),an=sn(Ni("Optional"),8),cn=sn(Ni("SkipSelf"),4);let ln,un;function dn(e){var t;return(null===(t=function(){if(void 0===ln&&(ln=null,Ae.trustedTypes))try{ln=Ae.trustedTypes.createPolicy("angular",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch(t){}return ln}())||void 0===t?void 0:t.createHTML(e))||e}function hn(e){var t;return(null===(t=function(){if(void 0===un&&(un=null,Ae.trustedTypes))try{un=Ae.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch(t){}return un}())||void 0===t?void 0:t.createHTML(e))||e}class pn{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see https://g.co/ng/security#xss)"}}class mn extends pn{getTypeName(){return"HTML"}}class gn extends pn{getTypeName(){return"Style"}}class fn extends pn{getTypeName(){return"Script"}}class _n extends pn{getTypeName(){return"URL"}}class vn extends pn{getTypeName(){return"ResourceURL"}}function bn(e){return e instanceof pn?e.changingThisBreaksApplicationSecurity:e}function yn(e,t){const i=wn(e);if(null!=i&&i!==t){if("ResourceURL"===i&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${i} (see https://g.co/ng/security#xss)`)}return i===t}function wn(e){return e instanceof pn&&e.getTypeName()||null}class kn{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{const t=(new window.DOMParser).parseFromString(dn(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class Cn{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const e=this.inertDocument.createElement("html");this.inertDocument.appendChild(e);const t=this.inertDocument.createElement("body");e.appendChild(t)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=dn(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=dn(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let n=t.length-1;0<n;n--){const i=t.item(n).name;"xmlns:ns1"!==i&&0!==i.indexOf("ns1:")||e.removeAttribute(i)}let i=e.firstChild;for(;i;)i.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(i),i=i.nextSibling}}const Sn=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,xn=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;function En(e){return(e=String(e)).match(Sn)||e.match(xn)?e:"unsafe:"+e}function In(e){const t={};for(const i of e.split(","))t[i]=!0;return t}function Pn(...e){const t={};for(const i of e)for(const e in i)i.hasOwnProperty(e)&&(t[e]=!0);return t}const Dn=In("area,br,col,hr,img,wbr"),Tn=In("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),An=In("rp,rt"),Rn=Pn(An,Tn),On=Pn(Dn,Pn(Tn,In("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Pn(An,In("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Rn),Fn=In("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Bn=In("srcset"),Mn=Pn(Fn,Bn,In("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),In("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),Ln=In("script,style,template");class $n{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let e=this.checkClobberedElement(t,t.nextSibling);if(e){t=e;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!On.hasOwnProperty(t))return this.sanitizedSomething=!0,!Ln.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r<i.length;r++){const e=i.item(r),t=e.name,s=t.toLowerCase();if(!Mn.hasOwnProperty(s)){this.sanitizedSomething=!0;continue}let o=e.value;Fn[s]&&(o=En(o)),Bn[s]&&(n=o,o=(n=String(n)).split(",").map(e=>En(e.trim())).join(", ")),this.buf.push(" ",t,'="',Nn(o),'"')}var n;return this.buf.push(">"),!0}endElement(e){const t=e.nodeName.toLowerCase();On.hasOwnProperty(t)&&!Dn.hasOwnProperty(t)&&(this.buf.push("</"),this.buf.push(t),this.buf.push(">"))}chars(e){this.buf.push(Nn(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+e.outerHTML);return t}}const jn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,zn=/([^\#-~ |!])/g;function Nn(e){return e.replace(/&/g,"&amp;").replace(jn,(function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"})).replace(zn,(function(e){return"&#"+e.charCodeAt(0)+";"})).replace(/</g,"&lt;").replace(/>/g,"&gt;")}let Vn;function Hn(e,t){let i=null;try{Vn=Vn||function(e){const t=new Cn(e);return function(){try{return!!(new window.DOMParser).parseFromString(dn(""),"text/html")}catch(e){return!1}}()?new kn(t):t}(e);let n=t?String(t):"";i=Vn.getInertBodyElement(n);let r=5,s=n;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,n=s,s=i.innerHTML,i=Vn.getInertBodyElement(n)}while(n!==s);return dn((new $n).sanitizeChildren(Un(i)||i))}finally{if(i){const e=Un(i)||i;for(;e.firstChild;)e.removeChild(e.firstChild)}}}function Un(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var qn=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}({});function Gn(e){const t=Zn();return t?hn(t.sanitize(qn.HTML,e)||""):yn(e,"HTML")?hn(bn(e)):Hn(pt(),ce(e))}function Wn(e){const t=Zn();return t?t.sanitize(qn.URL,e)||"":yn(e,"URL")?bn(e):En(ce(e))}function Zn(){const e=Tt();return e&&e[12]}function Qn(e){return e.ngDebugContext}function Yn(e){return e.ngOriginalError}function Kn(e,...t){e.error(...t)}class Jn{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),n=function(e){return e.ngErrorLogger||Kn}(e);n(this._console,"ERROR",e),t&&n(this._console,"ORIGINAL ERROR",t),i&&n(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?Qn(e)?Qn(e):this._findContext(Yn(e)):null}_findOriginalError(e){let t=Yn(e);for(;t&&Yn(t);)t=Yn(t);return t}}function Xn(e,t){e.__ngContext__=t}const er=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Ae))();function tr(e){return{name:"window",target:e.ownerDocument.defaultView}}function ir(e){return e instanceof Function?e():e}var nr=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}({});function rr(e,t){return(void 0)(e,t)}function sr(e){const t=e[3];return et(t)?t[3]:t}function or(e){return cr(e[13])}function ar(e){return cr(e[4])}function cr(e){for(;null!==e&&!et(e);)e=e[4];return e}function lr(e,t,i,n,r){if(null!=n){let s,o=!1;et(n)?s=n:Xe(n)&&(o=!0,n=n[0]);const a=ft(n);0===e&&null!==i?null==r?_r(t,i,a):fr(t,i,a,r||null,!0):1===e&&null!==i?fr(t,i,a,r||null,!0):2===e?function(e,t,i){const n=br(e,t);n&&function(e,t,i,n){mt(e)?e.removeChild(t,i,n):t.removeChild(i)}(e,n,t,i)}(t,a,o):3===e&&t.destroyNode(a),null!=s&&function(e,t,i,n,r){const s=i[7];s!==ft(i)&&lr(t,e,n,s,r);for(let o=10;o<i.length;o++){const r=i[o];xr(r[1],r,e,t,n,s)}}(t,e,s,i,r)}}function ur(e,t,i){return mt(e)?e.createElement(t,i):null===i?e.createElement(t):e.createElementNS(i,t)}function dr(e,t){const i=e[9],n=i.indexOf(t),r=t[3];1024&t[2]&&(t[2]&=-1025,It(r,-1)),i.splice(n,1)}function hr(e,t){if(e.length<=10)return;const i=10+t,n=e[i];if(n){const s=n[17];null!==s&&s!==e&&dr(s,n),t>0&&(e[i-1][4]=n[4]);const o=qi(e,10+t);xr(n[1],r=n,r[11],2,null,null),r[0]=null,r[6]=null;const a=o[19];null!==a&&a.detachView(o[1]),n[3]=null,n[4]=null,n[2]&=-129}var r;return n}function pr(e,t){if(!(256&t[2])){const i=t[11];mt(i)&&i.destroyNode&&xr(e,t,i,3,null,null),function(e){let t=e[13];if(!t)return mr(e[1],e);for(;t;){let i=null;if(Xe(t))i=t[13];else{const e=t[10];e&&(i=e)}if(!i){for(;t&&!t[4]&&t!==e;)Xe(t)&&mr(t[1],t),t=t[3];null===t&&(t=e),Xe(t)&&mr(t[1],t),i=t&&t[4]}t=i}}(t)}}function mr(e,t){if(!(256&t[2])){t[2]&=-129,t[2]|=256,function(e,t){let i;if(null!=e&&null!=(i=e.destroyHooks))for(let n=0;n<i.length;n+=2){const e=t[i[n]];if(!(e instanceof hi)){const t=i[n+1];if(Array.isArray(t))for(let i=0;i<t.length;i+=2){const n=e[t[i]],r=t[i+1];try{r.call(n)}finally{}}else try{t.call(e)}finally{}}}}(e,t),function(e,t){const i=e.cleanup,n=t[7];let r=-1;if(null!==i)for(let s=0;s<i.length-1;s+=2)if("string"==typeof i[s]){const e=i[s+1],o="function"==typeof e?e(t):ft(t[e]),a=n[r=i[s+2]],c=i[s+3];"boolean"==typeof c?o.removeEventListener(i[s],a,c):c>=0?n[r=c]():n[r=-c].unsubscribe(),s+=2}else{const e=n[r=i[s+1]];i[s].call(e)}if(null!==n){for(let e=r+1;e<n.length;e++)(0,n[e])();t[7]=null}}(e,t),1===t[1].type&&mt(t[11])&&t[11].destroy();const i=t[17];if(null!==i&&et(t[3])){i!==t[3]&&dr(i,t);const n=t[19];null!==n&&n.detachView(e)}}}function gr(e,t,i){return function(e,t,i){let n=t;for(;null!==n&&40&n.type;)n=(t=n).parent;if(null===n)return i[0];if(2&n.flags){const t=e.data[n.directiveStart].encapsulation;if(t===Ee.None||t===Ee.Emulated)return null}return vt(n,i)}(e,t.parent,i)}function fr(e,t,i,n,r){mt(e)?e.insertBefore(t,i,n,r):t.insertBefore(i,n,r)}function _r(e,t,i){mt(e)?e.appendChild(t,i):t.appendChild(i)}function vr(e,t,i,n,r){null!==n?fr(e,t,i,n,r):_r(e,t,i)}function br(e,t){return mt(e)?e.parentNode(t):t.parentNode}function yr(e,t,i){return wr(e,t,i)}let wr=function(e,t,i){return 40&e.type?vt(e,i):null};function kr(e,t,i,n){const r=gr(e,n,t),s=t[11],o=yr(n.parent||t[6],n,t);if(null!=r)if(Array.isArray(i))for(let a=0;a<i.length;a++)vr(s,r,i[a],o,!1);else vr(s,r,i,o,!1)}function Cr(e,t){return null!==t?e[16][6].projection[t.projection]:null}function Sr(e,t,i,n,r,s,o){for(;null!=i;){const a=n[i.index],c=i.type;if(o&&0===t&&(a&&Xn(ft(a),n),i.flags|=4),64!=(64&i.flags))if(8&c)Sr(e,t,i.child,n,r,s,!1),lr(t,e,r,a,s);else if(32&c){const o=rr(i,n);let c;for(;c=o();)lr(t,e,r,c,s);lr(t,e,r,a,s)}else 16&c?Er(e,t,n,i,r,s):lr(t,e,r,a,s);i=o?i.projectionNext:i.next}}function xr(e,t,i,n,r,s){Sr(i,n,e.firstChild,t,r,s,!1)}function Er(e,t,i,n,r,s){const o=i[16],a=o[6].projection[n.projection];if(Array.isArray(a))for(let c=0;c<a.length;c++)lr(t,e,r,a[c],s);else Sr(e,t,a,o[3],r,s,!0)}function Ir(e,t,i){mt(e)?e.setAttribute(t,"style",i):t.style.cssText=i}function Pr(e,t,i){mt(e)?""===i?e.removeAttribute(t,"class"):e.setAttribute(t,"class",i):t.className=i}function Dr(e,t,i){let n=e.length;for(;;){const r=e.indexOf(t,i);if(-1===r)return r;if(0===r||e.charCodeAt(r-1)<=32){const i=t.length;if(r+i===n||e.charCodeAt(r+i)<=32)return r}i=r+1}}function Tr(e,t,i){let n=0;for(;n<e.length;){let r=e[n++];if(i&&"class"===r){if(r=e[n],-1!==Dr(r.toLowerCase(),t,0))return!0}else if(1===r){for(;n<e.length&&"string"==typeof(r=e[n++]);)if(r.toLowerCase()===t)return!0;return!1}}return!1}function Ar(e){return 4===e.type&&"ng-template"!==e.value}function Rr(e,t,i){return t===(4!==e.type||i?e.value:"ng-template")}function Or(e,t,i){let n=4;const r=e.attrs||[],s=function(e){for(let i=0;i<e.length;i++)if(3===(t=e[i])||4===t||6===t)return i;var t;return e.length}(r);let o=!1;for(let a=0;a<t.length;a++){const c=t[a];if("number"!=typeof c){if(!o)if(4&n){if(n=2|1&n,""!==c&&!Rr(e,c,i)||""===c&&1===t.length){if(Fr(n))return!1;o=!0}}else{const l=8&n?c:t[++a];if(8&n&&null!==e.attrs){if(!Tr(e.attrs,l,i)){if(Fr(n))return!1;o=!0}continue}const u=Br(8&n?"class":c,r,Ar(e),i);if(-1===u){if(Fr(n))return!1;o=!0;continue}if(""!==l){let e;e=u>s?"":r[u+1].toLowerCase();const t=8&n?e:null;if(t&&-1!==Dr(t,l,0)||2&n&&l!==e){if(Fr(n))return!1;o=!0}}}}else{if(!o&&!Fr(n)&&!Fr(c))return!1;if(o&&Fr(c))continue;o=!1,n=c|1&n}}return Fr(n)||o}function Fr(e){return 0==(1&e)}function Br(e,t,i,n){if(null===t)return-1;let r=0;if(n||!i){let i=!1;for(;r<t.length;){const n=t[r];if(n===e)return r;if(3===n||6===n)i=!0;else{if(1===n||2===n){let e=t[++r];for(;"string"==typeof e;)e=t[++r];continue}if(4===n)break;if(0===n){r+=4;continue}}r+=i?1:2}return-1}return function(e,t){let i=e.indexOf(4);if(i>-1)for(i++;i<e.length;){const n=e[i];if("number"==typeof n)return-1;if(n===t)return i;i++}return-1}(t,e)}function Mr(e,t,i=!1){for(let n=0;n<t.length;n++)if(Or(e,t[n],i))return!0;return!1}function Lr(e,t){e:for(let i=0;i<t.length;i++){const n=t[i];if(e.length===n.length){for(let t=0;t<e.length;t++)if(e[t]!==n[t])continue e;return!0}}return!1}function $r(e,t){return e?":not("+t.trim()+")":t}function jr(e){let t=e[0],i=1,n=2,r="",s=!1;for(;i<e.length;){let o=e[i];if("string"==typeof o)if(2&n){const t=e[++i];r+="["+o+(t.length>0?'="'+t+'"':"")+"]"}else 8&n?r+="."+o:4&n&&(r+=" "+o);else""===r||Fr(o)||(t+=$r(s,r),r=""),n=o,s=s||!Fr(n);i++}return""!==r&&(t+=$r(s,r)),t}const zr={};function Nr(e){Vr(At(),Tt(),ii()+e,$t())}function Vr(e,t,i,n){if(!n)if(3==(3&t[2])){const n=e.preOrderCheckHooks;null!==n&&ai(t,n,i)}else{const n=e.preOrderHooks;null!==n&&ci(t,n,0,i)}ni(i)}function Hr(e,t){return e<<17|t<<2}function Ur(e){return e>>17&32767}function qr(e){return 2|e}function Gr(e){return(131068&e)>>2}function Wr(e,t){return-131069&e|t<<2}function Zr(e){return 1|e}function Qr(e,t){const i=e.contentQueries;if(null!==i)for(let n=0;n<i.length;n+=2){const r=i[n],s=i[n+1];if(-1!==s){const i=e.data[s];Wt(r),i.contentQueries(2,t[s],s)}}}function Yr(e,t,i,n,r,s,o,a,c,l){const u=t.blueprint.slice();return u[0]=r,u[2]=140|n,Et(u),u[3]=u[15]=e,u[8]=i,u[10]=o||e&&e[10],u[11]=a||e&&e[11],u[12]=c||e&&e[12]||null,u[9]=l||e&&e[9]||null,u[6]=s,u[16]=2==t.type?e[16]:u,u}function Kr(e,t,i,n,r){let s=e.data[t];if(null===s)s=function(e,t,i,n,r){const s=Ft(),o=Mt(),a=e.data[t]=function(e,t,i,n,r,s){return{type:i,index:n,insertBeforeIndex:null,injectorIndex:t?t.injectorIndex:-1,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,propertyBindings:null,flags:0,providerIndexes:0,value:r,attrs:s,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tViews:null,next:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,o?s:s&&s.parent,i,t,n,r);return null===e.firstChild&&(e.firstChild=a),null!==s&&(o?null==s.child&&null!==a.parent&&(s.child=a):null===s.next&&(s.next=a)),a}(e,t,i,n,r),Pt.lFrame.inI18n&&(s.flags|=64);else if(64&s.type){s.type=i,s.value=n,s.attrs=r;const e=function(){const e=Pt.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}();s.injectorIndex=null===e?-1:e.injectorIndex}return Bt(s,!0),s}function Jr(e,t,i,n){if(0===i)return-1;const r=t.length;for(let s=0;s<i;s++)t.push(n),e.blueprint.push(n),e.data.push(null);return r}function Xr(e,t,i){Yt(t);try{const n=e.viewQuery;null!==n&&Ps(1,n,i);const r=e.template;null!==r&&is(e,t,r,1,i),e.firstCreatePass&&(e.firstCreatePass=!1),e.staticContentQueries&&Qr(e,t),e.staticViewQueries&&Ps(2,e.viewQuery,i);const s=e.components;null!==s&&function(e,t){for(let i=0;i<t.length;i++)Cs(e,t[i])}(t,s)}catch(n){throw e.firstCreatePass&&(e.incompleteFirstPass=!0),n}finally{t[2]&=-5,ti()}}function es(e,t,i,n){const r=t[2];if(256==(256&r))return;Yt(t);const s=$t();try{Et(t),Pt.lFrame.bindingIndex=e.bindingStartIndex,null!==i&&is(e,t,i,2,n);const o=3==(3&r);if(!s)if(o){const i=e.preOrderCheckHooks;null!==i&&ai(t,i,null)}else{const i=e.preOrderHooks;null!==i&&ci(t,i,0,null),li(t,0)}if(function(e){for(let t=or(e);null!==t;t=ar(t)){if(!t[2])continue;const e=t[9];for(let t=0;t<e.length;t++){const i=e[t],n=i[3];0==(1024&i[2])&&It(n,1),i[2]|=1024}}}(t),function(e){for(let t=or(e);null!==t;t=ar(t))for(let e=10;e<t.length;e++){const i=t[e],n=i[1];St(i)&&es(n,i,n.template,i[8])}}(t),null!==e.contentQueries&&Qr(e,t),!s)if(o){const i=e.contentCheckHooks;null!==i&&ai(t,i)}else{const i=e.contentHooks;null!==i&&ci(t,i,1),li(t,1)}!function(e,t){const i=e.hostBindingOpCodes;if(null!==i)try{for(let e=0;e<i.length;e++){const n=i[e];if(n<0)ni(~n);else{const r=n,s=i[++e],o=i[++e];Ut(s,r),o(2,t[r])}}}finally{ni(-1)}}(e,t);const a=e.components;null!==a&&function(e,t){for(let i=0;i<t.length;i++)ks(e,t[i])}(t,a);const c=e.viewQuery;if(null!==c&&Ps(2,c,n),!s)if(o){const i=e.viewCheckHooks;null!==i&&ai(t,i)}else{const i=e.viewHooks;null!==i&&ci(t,i,2),li(t,2)}!0===e.firstUpdatePass&&(e.firstUpdatePass=!1),s||(t[2]&=-73),1024&t[2]&&(t[2]&=-1025,It(t[3],-1))}finally{ti()}}function ts(e,t,i,n){const r=t[10],s=!$t(),o=Ct(t);try{s&&!o&&r.begin&&r.begin(),o&&Xr(e,t,n),es(e,t,i,n)}finally{s&&!o&&r.end&&r.end()}}function is(e,t,i,n,r){const s=ii(),o=2&n;try{ni(-1),o&&t.length>20&&Vr(e,t,20,$t()),i(n,r)}finally{ni(s)}}function ns(e,t,i){if(tt(t)){const n=t.directiveEnd;for(let r=t.directiveStart;r<n;r++){const t=e.data[r];t.contentQueries&&t.contentQueries(1,i[r],r)}}}function rs(e,t,i){Dt()&&(function(e,t,i,n){const r=i.directiveStart,s=i.directiveEnd;e.firstCreatePass||Ci(i,t),Xn(n,t);const o=i.initialInputs;for(let a=r;a<s;a++){const n=e.data[a],s=rt(n);s&&vs(t,i,n);const c=Bi(t,e,a,i);Xn(c,t),null!==o&&bs(0,a-r,c,n,0,o),s&&(wt(i.index,t)[8]=c)}}(e,t,i,vt(i,t)),128==(128&i.flags)&&function(e,t,i){const n=i.directiveStart,r=i.directiveEnd,s=i.index,o=Pt.lFrame.currentDirectiveIndex;try{ni(s);for(let i=n;i<r;i++){const n=e.data[i],r=t[i];qt(i),null===n.hostBindings&&0===n.hostVars&&null===n.hostAttrs||ps(n,r)}}finally{ni(-1),qt(o)}}(e,t,i))}function ss(e,t,i=vt){const n=t.localNames;if(null!==n){let r=t.index+1;for(let s=0;s<n.length;s+=2){const o=n[s+1],a=-1===o?i(t,e):e[o];e[r++]=a}}}function os(e){const t=e.tView;return null===t||t.incompleteFirstPass?e.tView=as(1,null,e.template,e.decls,e.vars,e.directiveDefs,e.pipeDefs,e.viewQuery,e.schemas,e.consts):t}function as(e,t,i,n,r,s,o,a,c,l){const u=20+n,d=u+r,h=function(e,t){const i=[];for(let n=0;n<t;n++)i.push(n<e?null:zr);return i}(u,d),p="function"==typeof l?l():l;return h[1]={type:e,blueprint:h,template:i,queries:null,viewQuery:a,declTNode:t,data:h.slice().fill(null,u),bindingStartIndex:u,expandoStartIndex:d,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:"function"==typeof s?s():s,pipeRegistry:"function"==typeof o?o():o,firstChild:null,schemas:c,consts:p,incompleteFirstPass:!1}}function cs(e,t,i,n){const r=Ts(t);null===i?r.push(n):(r.push(i),e.firstCreatePass&&As(e).push(n,r.length-1))}function ls(e,t,i){for(let n in e)if(e.hasOwnProperty(n)){const r=e[n];(i=null===i?{}:i).hasOwnProperty(n)?i[n].push(t,r):i[n]=[t,r]}return i}function us(e,t,i,n,r,s,o,a){const c=vt(t,i);let l,u=t.inputs;var d;!a&&null!=u&&(l=u[n])?(Os(e,i,l,n,r),it(t)&&function(e,t){const i=wt(t,e);16&i[2]||(i[2]|=64)}(i,t.index)):3&t.type&&(n="class"===(d=n)?"className":"for"===d?"htmlFor":"formaction"===d?"formAction":"innerHtml"===d?"innerHTML":"readonly"===d?"readOnly":"tabindex"===d?"tabIndex":d,r=null!=o?o(r,t.value||"",n):r,mt(s)?s.setProperty(c,n,r):mi(n)||(c.setProperty?c.setProperty(n,r):c[n]=r))}function ds(e,t,i,n){let r=!1;if(Dt()){const s=function(e,t,i){const n=e.directiveRegistry;let r=null;if(n)for(let s=0;s<n.length;s++){const o=n[s];Mr(i,o.selectors,!1)&&(r||(r=[]),Ii(Ci(i,t),e,o.type),rt(o)?(ms(e,i),r.unshift(o)):r.push(o))}return r}(e,t,i),o=null===n?null:{"":-1};if(null!==s){r=!0,fs(i,e.data.length,s.length);for(let e=0;e<s.length;e++){const t=s[e];t.providersResolver&&t.providersResolver(t)}let n=!1,a=!1,c=Jr(e,t,s.length,null);for(let r=0;r<s.length;r++){const l=s[r];i.mergedAttrs=gi(i.mergedAttrs,l.hostAttrs),_s(e,i,t,c,l),gs(c,l,o),null!==l.contentQueries&&(i.flags|=8),null===l.hostBindings&&null===l.hostAttrs&&0===l.hostVars||(i.flags|=128);const u=l.type.prototype;!n&&(u.ngOnChanges||u.ngOnInit||u.ngDoCheck)&&((e.preOrderHooks||(e.preOrderHooks=[])).push(i.index),n=!0),a||!u.ngOnChanges&&!u.ngDoCheck||((e.preOrderCheckHooks||(e.preOrderCheckHooks=[])).push(i.index),a=!0),c++}!function(e,t){const i=t.directiveEnd,n=e.data,r=t.attrs,s=[];let o=null,a=null;for(let c=t.directiveStart;c<i;c++){const e=n[c],i=e.inputs,l=null===r||Ar(t)?null:ys(i,r);s.push(l),o=ls(i,c,o),a=ls(e.outputs,c,a)}null!==o&&(o.hasOwnProperty("class")&&(t.flags|=16),o.hasOwnProperty("style")&&(t.flags|=32)),t.initialInputs=s,t.inputs=o,t.outputs=a}(e,i)}o&&function(e,t,i){if(t){const n=e.localNames=[];for(let e=0;e<t.length;e+=2){const r=i[t[e+1]];if(null==r)throw new ae("301",`Export of name '${t[e+1]}' not found!`);n.push(t[e],r)}}}(i,n,o)}return i.mergedAttrs=gi(i.mergedAttrs,i.attrs),r}function hs(e,t,i,n,r,s){const o=s.hostBindings;if(o){let i=e.hostBindingOpCodes;null===i&&(i=e.hostBindingOpCodes=[]);const s=~t.index;(function(e){let t=e.length;for(;t>0;){const i=e[--t];if("number"==typeof i&&i<0)return i}return 0})(i)!=s&&i.push(s),i.push(n,r,o)}}function ps(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function ms(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function gs(e,t,i){if(i){if(t.exportAs)for(let n=0;n<t.exportAs.length;n++)i[t.exportAs[n]]=e;rt(t)&&(i[""]=e)}}function fs(e,t,i){e.flags|=1,e.directiveStart=t,e.directiveEnd=t+i,e.providerIndexes=t}function _s(e,t,i,n,r){e.data[n]=r;const s=r.factory||(r.factory=st(r.type)),o=new hi(s,rt(r),null);e.blueprint[n]=o,i[n]=o,hs(e,t,0,n,Jr(e,i,r.hostVars,zr),r)}function vs(e,t,i){const n=vt(t,e),r=os(i),s=e[10],o=Ss(e,Yr(e,r,null,i.onPush?64:16,n,t,s,s.createRenderer(n,i),null,null));e[t.index]=o}function bs(e,t,i,n,r,s){const o=s[t];if(null!==o){const e=n.setInput;for(let t=0;t<o.length;){const r=o[t++],s=o[t++],a=o[t++];null!==e?n.setInput(i,a,r,s):i[s]=a}}}function ys(e,t){let i=null,n=0;for(;n<t.length;){const r=t[n];if(0!==r)if(5!==r){if("number"==typeof r)break;e.hasOwnProperty(r)&&(null===i&&(i=[]),i.push(r,e[r],t[n+1])),n+=2}else n+=2;else n+=4}return i}function ws(e,t,i,n){return new Array(e,!0,!1,t,null,0,n,i,null,null)}function ks(e,t){const i=wt(t,e);if(St(i)){const e=i[1];80&i[2]?es(e,i,e.template,i[8]):i[5]>0&&function e(t){for(let n=or(t);null!==n;n=ar(n))for(let t=10;t<n.length;t++){const i=n[t];if(1024&i[2]){const e=i[1];es(e,i,e.template,i[8])}else i[5]>0&&e(i)}const i=t[1].components;if(null!==i)for(let n=0;n<i.length;n++){const r=wt(i[n],t);St(r)&&r[5]>0&&e(r)}}(i)}}function Cs(e,t){const i=wt(t,e),n=i[1];!function(e,t){for(let i=t.length;i<e.blueprint.length;i++)t.push(e.blueprint[i])}(n,i),Xr(n,i,i[8])}function Ss(e,t){return e[13]?e[14][4]=t:e[13]=t,e[14]=t,t}function xs(e){for(;e;){e[2]|=64;const t=sr(e);if(0!=(512&e[2])&&!t)return e;e=t}return null}function Es(e,t,i){const n=t[10];n.begin&&n.begin();try{es(e,t,e.template,i)}catch(r){throw Rs(t,r),r}finally{n.end&&n.end()}}function Is(e){!function(e){for(let t=0;t<e.components.length;t++){const i=e.components[t],n=kt(i),r=n[1];ts(r,n,r.template,i)}}(e[8])}function Ps(e,t,i){Wt(0),t(e,i)}const Ds=(()=>Promise.resolve(null))();function Ts(e){return e[7]||(e[7]=[])}function As(e){return e.cleanup||(e.cleanup=[])}function Rs(e,t){const i=e[9],n=i?i.get(Jn,null):null;n&&n.handleError(t)}function Os(e,t,i,n,r){for(let s=0;s<i.length;){const o=i[s++],a=i[s++],c=t[o],l=e.data[o];null!==l.setInput?l.setInput(c,r,n,a):c[a]=r}}function Fs(e,t,i){const n=_t(t,e);!function(e,t,i){mt(e)?e.setValue(t,i):t.textContent=i}(e[11],n,i)}function Bs(e,t,i){let n=i?e.styles:null,r=i?e.classes:null,s=0;if(null!==t)for(let o=0;o<t.length;o++){const e=t[o];"number"==typeof e?s=e:1==s?r=ie(r,e):2==s&&(n=ie(n,e+": "+t[++o]+";"))}i?e.styles=n:e.stylesWithoutHost=n,i?e.classes=r:e.classesWithoutHost=r}const Ms=new Vi("INJECTOR",-1);class Ls{get(e,t=Yi){if(t===Yi){const t=new Error(`NullInjectorError: No provider for ${te(e)}!`);throw t.name="NullInjectorError",t}return t}}const $s=new Vi("Set Injector scope."),js={},zs={},Ns=[];let Vs=void 0;function Hs(){return void 0===Vs&&(Vs=new Ls),Vs}function Us(e,t=null,i=null,n){return new qs(e,i,t||Hs(),n)}class qs{constructor(e,t,i,n=null){this.parent=i,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this._destroyed=!1;const r=[];t&&Hi(t,i=>this.processProvider(i,e,t)),Hi([e],e=>this.processInjectorType(e,[],r)),this.records.set(Ms,Zs(void 0,this));const s=this.records.get($s);this.scope=null!=s?s.value:null,this.source=n||("object"==typeof e?null:te(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=Yi,i=ye.Default){this.assertNotDestroyed();const n=en(this);try{if(!(i&ye.SkipSelf)){let t=this.records.get(e);if(void 0===t){const i=("function"==typeof(r=e)||"object"==typeof r&&r instanceof Vi)&&pe(e);t=i&&this.injectableDefInScope(i)?Zs(Gs(e),js):null,this.records.set(e,t)}if(null!=t)return this.hydrate(e,t)}return(i&ye.Self?Hs():this.parent).get(e,t=i&ye.Optional&&t===Yi?null:t)}catch(s){if("NullInjectorError"===s.name){if((s.ngTempTokenPath=s.ngTempTokenPath||[]).unshift(te(e)),n)throw s;return function(e,t,i,n){const r=e.ngTempTokenPath;throw t.__source&&r.unshift(t.__source),e.message=function(e,t,i,n=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.substr(2):e;let r=te(t);if(Array.isArray(t))r=t.map(te).join(" -> ");else if("object"==typeof t){let e=[];for(let i in t)if(t.hasOwnProperty(i)){let n=t[i];e.push(i+":"+("string"==typeof n?JSON.stringify(n):te(n)))}r=`{${e.join(", ")}}`}return`${i}${n?"("+n+")":""}[${r}]: ${e.replace(Ki,"\n ")}`}("\n"+e.message,r,i,n),e.ngTokenPath=r,e.ngTempTokenPath=null,e}(s,e,"R3InjectorError",this.source)}throw s}finally{en(n)}var r}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((t,i)=>e.push(te(i))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=se(e)))return!1;let n=ge(e);const r=null==n&&e.ngModule||void 0,s=void 0===r?e:r,o=-1!==i.indexOf(s);if(void 0!==r&&(n=ge(r)),null==n)return!1;if(null!=n.imports&&!o){let e;i.push(s);try{Hi(n.imports,n=>{this.processInjectorType(n,t,i)&&(void 0===e&&(e=[]),e.push(n))})}finally{}if(void 0!==e)for(let t=0;t<e.length;t++){const{ngModule:i,providers:n}=e[t];Hi(n,e=>this.processProvider(e,i,n||Ns))}}this.injectorDefTypes.add(s);const a=st(s)||(()=>new s);this.records.set(s,Zs(a,js));const c=n.providers;if(null!=c&&!o){const t=e;Hi(c,e=>this.processProvider(e,t,c))}return void 0!==r&&void 0!==e.providers}processProvider(e,t,i){let n=Ys(e=se(e))?e:se(e&&e.provide);const r=function(e,t,i){return Qs(e)?Zs(void 0,e.useValue):Zs(Ws(e),js)}(e);if(Ys(e)||!0!==e.multi)this.records.get(n);else{let t=this.records.get(n);t||(t=Zs(void 0,js,!0),t.factory=()=>rn(t.multi),this.records.set(n,t)),n=e,t.multi.push(e)}this.records.set(n,r)}hydrate(e,t){var i;return t.value===js&&(t.value=zs,t.value=t.factory()),"object"==typeof t.value&&t.value&&null!==(i=t.value)&&"object"==typeof i&&"function"==typeof i.ngOnDestroy&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){return!!e.providedIn&&("string"==typeof e.providedIn?"any"===e.providedIn||e.providedIn===this.scope:this.injectorDefTypes.has(e.providedIn))}}function Gs(e){const t=pe(e),i=null!==t?t.factory:st(e);if(null!==i)return i;if(e instanceof Vi)throw new Error(`Token ${te(e)} is missing a \u0275prov definition.`);if(e instanceof Function)return function(e){const t=e.length;if(t>0){const i=Gi(t,"?");throw new Error(`Can't resolve all parameters for ${te(e)}: (${i.join(", ")}).`)}const i=function(e){const t=e&&(e[fe]||e[ve]);if(t){const i=function(e){if(e.hasOwnProperty("name"))return e.name;const t=(""+e).match(/^function\s*([^\s(]+)/);return null===t?"":t[1]}(e);return console.warn(`DEPRECATED: DI is instantiating a token "${i}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${i}" class.`),t}return null}(e);return null!==i?()=>i.factory(e):()=>new e}(e);throw new Error("unreachable")}function Ws(e,t,i){let n=void 0;if(Ys(e)){const t=se(e);return st(t)||Gs(t)}if(Qs(e))n=()=>se(e.useValue);else if((r=e)&&r.useFactory)n=()=>e.useFactory(...rn(e.deps||[]));else if(function(e){return!(!e||!e.useExisting)}(e))n=()=>nn(se(e.useExisting));else{const t=se(e&&(e.useClass||e.provide));if(!function(e){return!!e.deps}(e))return st(t)||Gs(t);n=()=>new t(...rn(e.deps))}var r;return n}function Zs(e,t,i=!1){return{factory:e,value:t,multi:i?[]:void 0}}function Qs(e){return null!==e&&"object"==typeof e&&Ji in e}function Ys(e){return"function"==typeof e}const Ks=function(e,t,i){return function(e,t=null,i=null,n){const r=Us(e,t,i,n);return r._resolveInjectorDefTypes(),r}({name:i},t,e,i)};let Js=(()=>{class e{static create(e,t){return Array.isArray(e)?Ks(e,t,""):Ks(e.providers,e.parent,e.name||"")}}return e.THROW_IF_NOT_FOUND=Yi,e.NULL=new Ls,e.\u0275prov=de({token:e,providedIn:"any",factory:()=>nn(Ms)}),e.__NG_ELEMENT_ID__=-1,e})();function Xs(e,t){oi(kt(e)[1],Ot())}function eo(e){let t=Object.getPrototypeOf(e.type.prototype).constructor,i=!0;const n=[e];for(;t;){let r=void 0;if(rt(e))r=t.\u0275cmp||t.\u0275dir;else{if(t.\u0275cmp)throw new Error("Directives cannot inherit Components");r=t.\u0275dir}if(r){if(i){n.push(r);const t=e;t.inputs=to(e.inputs),t.declaredInputs=to(e.declaredInputs),t.outputs=to(e.outputs);const i=r.hostBindings;i&&ro(e,i);const s=r.viewQuery,o=r.contentQueries;if(s&&io(e,s),o&&no(e,o),ee(e.inputs,r.inputs),ee(e.declaredInputs,r.declaredInputs),ee(e.outputs,r.outputs),rt(r)&&r.data.animation){const t=e.data;t.animation=(t.animation||[]).concat(r.data.animation)}}const t=r.features;if(t)for(let n=0;n<t.length;n++){const r=t[n];r&&r.ngInherit&&r(e),r===eo&&(i=!1)}}t=Object.getPrototypeOf(t)}!function(e){let t=0,i=null;for(let n=e.length-1;n>=0;n--){const r=e[n];r.hostVars=t+=r.hostVars,r.hostAttrs=gi(r.hostAttrs,i=gi(i,r.hostAttrs))}}(n)}function to(e){return e===Re?{}:e===Fe?[]:e}function io(e,t){const i=e.viewQuery;e.viewQuery=i?(e,n)=>{t(e,n),i(e,n)}:t}function no(e,t){const i=e.contentQueries;e.contentQueries=i?(e,n,r)=>{t(e,n,r),i(e,n,r)}:t}function ro(e,t){const i=e.hostBindings;e.hostBindings=i?(e,n)=>{t(e,n),i(e,n)}:t}let so=null;function oo(){if(!so){const e=Ae.Symbol;if(e&&e.iterator)so=e.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;t<e.length;++t){const i=e[t];"entries"!==i&&"size"!==i&&Map.prototype[i]===Map.prototype.entries&&(so=i)}}}return so}class ao{constructor(e){this.wrapped=e}static wrap(e){return new ao(e)}static unwrap(e){return ao.isWrapped(e)?e.wrapped:e}static isWrapped(e){return e instanceof ao}}function co(e){return!!lo(e)&&(Array.isArray(e)||!(e instanceof Map)&&oo()in e)}function lo(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function uo(e,t,i){return e[t]=i}function ho(e,t,i){return!Object.is(e[t],i)&&(e[t]=i,!0)}function po(e,t,i,n){const r=ho(e,t,i);return ho(e,t+1,n)||r}function mo(e,t,i,n){const r=Tt();return ho(r,Vt(),t)&&(At(),function(e,t,i,n,r,s){const o=vt(e,t);!function(e,t,i,n,r,s,o){if(null==s)mt(e)?e.removeAttribute(t,r,i):t.removeAttribute(r);else{const a=null==o?ce(s):o(s,n||"",r);mt(e)?e.setAttribute(t,r,a,i):i?t.setAttributeNS(i,r,a):t.setAttribute(r,a)}}(t[11],o,s,e.value,i,n,r)}(ri(),r,e,t,i,n)),mo}function go(e,t,i,n){return ho(e,Vt(),i)?t+ce(i)+n:zr}function fo(e,t,i,n,r,s,o,a){const c=Tt(),l=At(),u=e+20,d=l.firstCreatePass?function(e,t,i,n,r,s,o,a,c){const l=t.consts,u=Kr(t,e,4,o||null,xt(l,a));ds(t,i,u,xt(l,c)),oi(t,u);const d=u.tViews=as(2,u,n,r,s,t.directiveRegistry,t.pipeRegistry,null,t.schemas,l);return null!==t.queries&&(t.queries.template(t,u),d.queries=t.queries.embeddedTView(u)),u}(u,l,c,t,i,n,r,s,o):l.data[u];Bt(d,!1);const h=c[11].createComment("");kr(l,c,h,d),Xn(h,c),Ss(c,c[u]=ws(h,c,h,d)),nt(d)&&rs(l,c,d),null!=o&&ss(c,d,a)}function _o(e){return yt(Pt.lFrame.contextLView,20+e)}function vo(e,t=ye.Default){const i=Tt();return null===i?nn(e,t):Ti(Ot(),i,se(e),t)}function bo(e,t,i){const n=Tt();return ho(n,Vt(),t)&&us(At(),ri(),n,e,t,n[11],i,!1),bo}function yo(e,t,i,n,r){const s=r?"class":"style";Os(e,i,t.inputs[s],s,n)}function wo(e,t,i,n){const r=Tt(),s=At(),o=20+e,a=r[11],c=r[o]=ur(a,t,Pt.lFrame.currentNamespace),l=s.firstCreatePass?function(e,t,i,n,r,s,o){const a=t.consts,c=Kr(t,e,2,r,xt(a,s));return ds(t,i,c,xt(a,o)),null!==c.attrs&&Bs(c,c.attrs,!1),null!==c.mergedAttrs&&Bs(c,c.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,c),c}(o,s,r,0,t,i,n):s.data[o];Bt(l,!0);const u=l.mergedAttrs;null!==u&&pi(a,c,u);const d=l.classes;null!==d&&Pr(a,c,d);const h=l.styles;null!==h&&Ir(a,c,h),64!=(64&l.flags)&&kr(s,r,c,l),0===Pt.lFrame.elementDepthCount&&Xn(c,r),Pt.lFrame.elementDepthCount++,nt(l)&&(rs(s,r,l),ns(s,l,r)),null!==n&&ss(r,l)}function ko(){let e=Ot();Mt()?Lt():(e=e.parent,Bt(e,!1));const t=e;Pt.lFrame.elementDepthCount--;const i=At();i.firstCreatePass&&(oi(i,e),tt(e)&&i.queries.elementEnd(e)),null!=t.classesWithoutHost&&function(e){return 0!=(16&e.flags)}(t)&&yo(i,t,Tt(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function(e){return 0!=(32&e.flags)}(t)&&yo(i,t,Tt(),t.stylesWithoutHost,!1)}function Co(e,t,i,n){wo(e,t,i,n),ko()}function So(e,t,i){const n=Tt(),r=At(),s=e+20,o=r.firstCreatePass?function(e,t,i,n,r){const s=t.consts,o=xt(s,n),a=Kr(t,e,8,"ng-container",o);return null!==o&&Bs(a,o,!0),ds(t,i,a,xt(s,r)),null!==t.queries&&t.queries.elementStart(t,a),a}(s,r,n,t,i):r.data[s];Bt(o,!0);const a=n[s]=n[11].createComment("");kr(r,n,a,o),Xn(a,n),nt(o)&&(rs(r,n,o),ns(r,o,n)),null!=i&&ss(n,o)}function xo(){let e=Ot();const t=At();Mt()?Lt():(e=e.parent,Bt(e,!1)),t.firstCreatePass&&(oi(t,e),tt(e)&&t.queries.elementEnd(e))}function Eo(e,t,i){So(e,t,i),xo()}function Io(){return Tt()}function Po(e){return!!e&&"function"==typeof e.then}function Do(e){return!!e&&"function"==typeof e.subscribe}const To=Do;function Ao(e,t,i=!1,n){const r=Tt(),s=At(),o=Ot();return function(e,t,i,n,r,s,o=!1,a){const c=nt(n),l=e.firstCreatePass&&As(e),u=Ts(t);let d=!0;if(3&n.type){const h=vt(n,t),p=a?a(h):Re,m=p.target||h,g=u.length,f=a?e=>a(ft(e[n.index])).target:n.index;if(mt(i)){let o=null;if(!a&&c&&(o=function(e,t,i,n){const r=e.cleanup;if(null!=r)for(let s=0;s<r.length-1;s+=2){const e=r[s];if(e===i&&r[s+1]===n){const e=t[7],i=r[s+2];return e.length>i?e[i]:null}"string"==typeof e&&(s+=2)}return null}(e,t,r,n.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,d=!1;else{s=Oo(n,t,0,s,!1);const e=i.listen(p.name||m,r,s);u.push(s,e),l&&l.push(r,f,g,g+1)}}else s=Oo(n,t,0,s,!0),m.addEventListener(r,s,o),u.push(s),l&&l.push(r,f,g,o)}else s=Oo(n,t,0,s,!1);const h=n.outputs;let p;if(d&&null!==h&&(p=h[r])){const e=p.length;if(e)for(let i=0;i<e;i+=2){const e=t[p[i]][p[i+1]].subscribe(s),o=u.length;u.push(s,e),l&&l.push(r,n.index,o,-(o+1))}}}(s,r,r[11],o,e,t,i,n),Ao}function Ro(e,t,i,n){try{return!1!==i(n)}catch(r){return Rs(e,r),!1}}function Oo(e,t,i,n,r){return function i(s){if(s===Function)return n;const o=2&e.flags?wt(e.index,t):t;0==(32&t[2])&&xs(o);let a=Ro(t,0,n,s),c=i.__ngNextListenerFn__;for(;c;)a=Ro(t,0,c,s)&&a,c=c.__ngNextListenerFn__;return r&&!1===a&&(s.preventDefault(),s.returnValue=!1),a}}function Fo(e=1){return function(e){return(Pt.lFrame.contextLView=function(e,t){for(;e>0;)t=t[15],e--;return t}(e,Pt.lFrame.contextLView))[8]}(e)}function Bo(e,t){let i=null;const n=function(e){const t=e.attrs;if(null!=t){const e=t.indexOf(5);if(0==(1&e))return t[e+1]}return null}(e);for(let r=0;r<t.length;r++){const s=t[r];if("*"!==s){if(null===n?Mr(e,s,!0):Lr(n,s))return r}else i=r}return i}function Mo(e){const t=Tt()[16][6];if(!t.projection){const i=t.projection=Gi(e?e.length:1,null),n=i.slice();let r=t.child;for(;null!==r;){const t=e?Bo(r,e):0;null!==t&&(n[t]?n[t].projectionNext=r:i[t]=r,n[t]=r),r=r.next}}}function Lo(e,t=0,i){const n=Tt(),r=At(),s=Kr(r,20+e,16,null,i||null);null===s.projection&&(s.projection=t),Lt(),64!=(64&s.flags)&&function(e,t,i){Er(t[11],0,t,i,gr(e,i,t),yr(i.parent||t[6],i,t))}(r,n,s)}function $o(e,t,i){return jo(e,"",t,"",i),$o}function jo(e,t,i,n,r){const s=Tt(),o=go(s,t,i,n);return o!==zr&&us(At(),ri(),s,e,o,s[11],r,!1),jo}function zo(e,t,i,n,r){const s=e[i+1],o=null===t;let a=n?Ur(s):Gr(s),c=!1;for(;0!==a&&(!1===c||o);){const i=e[a+1];No(e[a],t)&&(c=!0,e[a+1]=n?Zr(i):qr(i)),a=n?Ur(i):Gr(i)}c&&(e[i+1]=n?qr(s):Zr(s))}function No(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&Qi(e,t)>=0}function Vo(e,t,i){return Uo(e,t,i,!1),Vo}function Ho(e,t){return Uo(e,t,null,!0),Ho}function Uo(e,t,i,n){const r=Tt(),s=At(),o=Ht(2);s.firstUpdatePass&&function(e,t,i,n){const r=e.data;if(null===r[i+1]){const s=r[ii()],o=function(e,t){return t>=e.expandoStartIndex}(e,i);(function(e,t){return 0!=(e.flags&(t?16:32))})(s,n)&&null===t&&!o&&(t=!1),t=function(e,t,i,n){const r=function(e){const t=Pt.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}(e);let s=n?t.residualClasses:t.residualStyles;if(null===r)0===(n?t.classBindings:t.styleBindings)&&(i=Go(i=qo(null,e,t,i,n),t.attrs,n),s=null);else{const o=t.directiveStylingLast;if(-1===o||e[o]!==r)if(i=qo(r,e,t,i,n),null===s){let i=function(e,t,i){const n=i?t.classBindings:t.styleBindings;if(0!==Gr(n))return e[Ur(n)]}(e,t,n);void 0!==i&&Array.isArray(i)&&(i=qo(null,e,t,i[1],n),i=Go(i,t.attrs,n),function(e,t,i,n){e[Ur(i?t.classBindings:t.styleBindings)]=n}(e,t,n,i))}else s=function(e,t,i){let n=void 0;const r=t.directiveEnd;for(let s=1+t.directiveStylingLast;s<r;s++)n=Go(n,e[s].hostAttrs,i);return Go(n,t.attrs,i)}(e,t,n)}return void 0!==s&&(n?t.residualClasses=s:t.residualStyles=s),i}(r,s,t,n),function(e,t,i,n,r,s){let o=s?t.classBindings:t.styleBindings,a=Ur(o),c=Gr(o);e[n]=i;let l,u=!1;if(Array.isArray(i)){const e=i;l=e[1],(null===l||Qi(e,l)>0)&&(u=!0)}else l=i;if(r)if(0!==c){const t=Ur(e[a+1]);e[n+1]=Hr(t,a),0!==t&&(e[t+1]=Wr(e[t+1],n)),e[a+1]=131071&e[a+1]|n<<17}else e[n+1]=Hr(a,0),0!==a&&(e[a+1]=Wr(e[a+1],n)),a=n;else e[n+1]=Hr(c,0),0===a?a=n:e[c+1]=Wr(e[c+1],n),c=n;u&&(e[n+1]=qr(e[n+1])),zo(e,l,n,!0),zo(e,l,n,!1),function(e,t,i,n,r){const s=r?e.residualClasses:e.residualStyles;null!=s&&"string"==typeof t&&Qi(s,t)>=0&&(i[n+1]=Zr(i[n+1]))}(t,l,e,n,s),o=Hr(a,c),s?t.classBindings=o:t.styleBindings=o}(r,s,t,i,o,n)}}(s,e,o,n),t!==zr&&ho(r,o,t)&&function(e,t,i,n,r,s,o,a){if(!(3&t.type))return;const c=e.data,l=c[a+1];Zo(1==(1&l)?Wo(c,t,i,r,Gr(l),o):void 0)||(Zo(s)||function(e){return 2==(2&e)}(l)&&(s=Wo(c,null,i,r,a,o)),function(e,t,i,n,r){const s=mt(e);if(t)r?s?e.addClass(i,n):i.classList.add(n):s?e.removeClass(i,n):i.classList.remove(n);else{let t=-1===n.indexOf("-")?void 0:nr.DashCase;if(null==r)s?e.removeStyle(i,n,t):i.style.removeProperty(n);else{const o="string"==typeof r&&r.endsWith("!important");o&&(r=r.slice(0,-10),t|=nr.Important),s?e.setStyle(i,n,r,t):i.style.setProperty(n,r,o?"important":"")}}}(n,o,_t(ii(),i),r,s))}(s,s.data[ii()],r,r[11],e,r[o+1]=function(e,t){return null==e||("string"==typeof t?e+=t:"object"==typeof e&&(e=te(bn(e)))),e}(t,i),n,o)}function qo(e,t,i,n,r){let s=null;const o=i.directiveEnd;let a=i.directiveStylingLast;for(-1===a?a=i.directiveStart:a++;a<o&&(s=t[a],n=Go(n,s.hostAttrs,r),s!==e);)a++;return null!==e&&(i.directiveStylingLast=a),n}function Go(e,t,i){const n=i?1:2;let r=-1;if(null!==t)for(let s=0;s<t.length;s++){const o=t[s];"number"==typeof o?r=o:r===n&&(Array.isArray(e)||(e=void 0===e?[]:["",e]),Wi(e,o,!!i||t[++s]))}return void 0===e?null:e}function Wo(e,t,i,n,r,s){const o=null===t;let a=void 0;for(;r>0;){const t=e[r],s=Array.isArray(t),c=s?t[1]:t,l=null===c;let u=i[r+1];u===zr&&(u=l?Oe:void 0);let d=l?Zi(u,n):c===n?u:void 0;if(s&&!Zo(d)&&(d=Zi(t,n)),Zo(d)&&(a=d,o))return a;const h=e[r+1];r=o?Ur(h):Gr(h)}if(null!==t){let e=s?t.residualClasses:t.residualStyles;null!=e&&(a=Zi(e,n))}return a}function Zo(e){return void 0!==e}function Qo(e,t=""){const i=Tt(),n=At(),r=e+20,s=n.firstCreatePass?Kr(n,r,1,t,null):n.data[r],o=i[r]=function(e,t){return mt(e)?e.createText(t):e.createTextNode(t)}(i[11],t);kr(n,i,o,s),Bt(s,!1)}function Yo(e){return Ko("",e,""),Yo}function Ko(e,t,i){const n=Tt(),r=go(n,e,t,i);return r!==zr&&Fs(n,ii(),r),Ko}function Jo(e,t,i,n,r){const s=Tt(),o=function(e,t,i,n,r,s){const o=po(e,Nt(),i,r);return Ht(2),o?t+ce(i)+n+ce(r)+s:zr}(s,e,t,i,n,r);return o!==zr&&Fs(s,ii(),o),Jo}const Xo=void 0;var ea=["en",[["a","p"],["AM","PM"],Xo],[["AM","PM"],Xo,Xo],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Xo,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Xo,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Xo,"{1} 'at' {0}",Xo],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(e){let t=Math.floor(Math.abs(e)),i=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===i?1:5}];let ta={};function ia(e){const t=function(e){return e.toLowerCase().replace(/_/g,"-")}(e);let i=na(t);if(i)return i;const n=t.split("-")[0];if(i=na(n),i)return i;if("en"===n)return ea;throw new Error(`Missing locale data for the locale "${e}".`)}function na(e){return e in ta||(ta[e]=Ae.ng&&Ae.ng.common&&Ae.ng.common.locales&&Ae.ng.common.locales[e]),ta[e]}var ra=function(e){return e[e.LocaleId=0]="LocaleId",e[e.DayPeriodsFormat=1]="DayPeriodsFormat",e[e.DayPeriodsStandalone=2]="DayPeriodsStandalone",e[e.DaysFormat=3]="DaysFormat",e[e.DaysStandalone=4]="DaysStandalone",e[e.MonthsFormat=5]="MonthsFormat",e[e.MonthsStandalone=6]="MonthsStandalone",e[e.Eras=7]="Eras",e[e.FirstDayOfWeek=8]="FirstDayOfWeek",e[e.WeekendRange=9]="WeekendRange",e[e.DateFormat=10]="DateFormat",e[e.TimeFormat=11]="TimeFormat",e[e.DateTimeFormat=12]="DateTimeFormat",e[e.NumberSymbols=13]="NumberSymbols",e[e.NumberFormats=14]="NumberFormats",e[e.CurrencyCode=15]="CurrencyCode",e[e.CurrencySymbol=16]="CurrencySymbol",e[e.CurrencyName=17]="CurrencyName",e[e.Currencies=18]="Currencies",e[e.Directionality=19]="Directionality",e[e.PluralCase=20]="PluralCase",e[e.ExtraData=21]="ExtraData",e}({});let sa="en-US";function oa(e){var t,i;i="Expected localeId to be defined",null==(t=e)&&function(e,t,i,n){throw new Error("ASSERTION ERROR: "+e+` [Expected=> null != ${t} <=Actual]`)}(i,t),"string"==typeof e&&(sa=e.toLowerCase().replace(/_/g,"-"))}function aa(e,t,i,n,r){if(e=se(e),Array.isArray(e))for(let s=0;s<e.length;s++)aa(e[s],t,i,n,r);else{const s=At(),o=Tt();let a=Ys(e)?e:se(e.provide),c=Ws(e);const l=Ot(),u=1048575&l.providerIndexes,d=l.directiveStart,h=l.providerIndexes>>20;if(Ys(e)||!e.multi){const n=new hi(c,r,vo),p=ua(a,t,r?u:u+h,d);-1===p?(Ii(Ci(l,o),s,a),ca(s,e,t.length),t.push(a),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),i.push(n),o.push(n)):(i[p]=n,o[p]=n)}else{const p=ua(a,t,u+h,d),m=ua(a,t,u,u+h),g=p>=0&&i[p],f=m>=0&&i[m];if(r&&!f||!r&&!g){Ii(Ci(l,o),s,a);const u=function(e,t,i,n,r){const s=new hi(e,i,vo);return s.multi=[],s.index=t,s.componentProviders=0,la(s,r,n&&!i),s}(r?ha:da,i.length,r,n,c);!r&&f&&(i[m].providerFactory=u),ca(s,e,t.length,0),t.push(a),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),i.push(u),o.push(u)}else ca(s,e,p>-1?p:m,la(i[r?m:p],c,!r&&n));!r&&n&&f&&i[m].componentProviders++}}}function ca(e,t,i,n){const r=Ys(t);if(r||t.useClass){const s=(t.useClass||t).prototype.ngOnDestroy;if(s){const o=e.destroyHooks||(e.destroyHooks=[]);if(!r&&t.multi){const e=o.indexOf(i);-1===e?o.push(i,[n,s]):o[e+1].push(n,s)}else o.push(i,s)}}}function la(e,t,i){return i&&e.componentProviders++,e.multi.push(t)-1}function ua(e,t,i,n){for(let r=i;r<n;r++)if(t[r]===e)return r;return-1}function da(e,t,i,n){return pa(this.multi,[])}function ha(e,t,i,n){const r=this.multi;let s;if(this.providerFactory){const e=this.providerFactory.componentProviders,t=Bi(i,i[1],this.providerFactory.index,n);s=t.slice(0,e),pa(r,s);for(let i=e;i<t.length;i++)s.push(t[i])}else s=[],pa(r,s);return s}function pa(e,t){for(let i=0;i<e.length;i++)t.push((0,e[i])());return t}function ma(e,t=[]){return i=>{i.providersResolver=(i,n)=>function(e,t,i){const n=At();if(n.firstCreatePass){const r=rt(e);aa(i,n.data,n.blueprint,r,!0),aa(t,n.data,n.blueprint,r,!1)}}(i,n?n(e):e,t)}}class ga{}class fa{resolveComponentFactory(e){throw function(e){const t=Error(`No component factory found for ${te(e)}. Did you add it to @NgModule.entryComponents?`);return t.ngComponent=e,t}(e)}}let _a=(()=>{class e{}return e.NULL=new fa,e})();function va(...e){}function ba(e,t){return new wa(vt(e,t))}const ya=function(){return ba(Ot(),Tt())};let wa=(()=>{class e{constructor(e){this.nativeElement=e}}return e.__NG_ELEMENT_ID__=ya,e})();function ka(e){return e instanceof wa?e.nativeElement:e}class Ca{}let Sa=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>xa(),e})();const xa=function(){const e=Tt(),t=wt(Ot().index,e);return function(e){return e[11]}(Xe(t)?t:e)};let Ea=(()=>{class e{}return e.\u0275prov=de({token:e,providedIn:"root",factory:()=>null}),e})();class Ia{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const Pa=new Ia("11.2.14");class Da{constructor(){}supports(e){return co(e)}create(e){return new Aa(e)}}const Ta=(e,t)=>t;class Aa{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||Ta}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,n=0,r=null;for(;t||i;){const s=!i||t&&t.currentIndex<Ba(i,n,r)?t:i,o=Ba(s,n,r),a=s.currentIndex;if(s===i)n--,i=i._nextRemoved;else if(t=t._next,null==s.previousIndex)n++;else{r||(r=[]);const e=o-n,t=a-n;if(e!=t){for(let i=0;i<e;i++){const n=i<r.length?r[i]:r[i]=0,s=n+i;t<=s&&s<e&&(r[i]=n+1)}r[s.previousIndex]=t-e}}o!==a&&e(s,o,a)}}forEachPreviousItem(e){let t;for(t=this._previousItHead;null!==t;t=t._nextPrevious)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachMovedItem(e){let t;for(t=this._movesHead;null!==t;t=t._nextMoved)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}forEachIdentityChange(e){let t;for(t=this._identityChangesHead;null!==t;t=t._nextIdentityChange)e(t)}diff(e){if(null==e&&(e=[]),!co(e))throw new Error(`Error trying to diff '${te(e)}'. Only arrays and iterables are allowed`);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t,i,n,r=this._itHead,s=!1;if(Array.isArray(e)){this.length=e.length;for(let t=0;t<this.length;t++)i=e[t],n=this._trackByFn(t,i),null!==r&&Object.is(r.trackById,n)?(s&&(r=this._verifyReinsertion(r,i,n,t)),Object.is(r.item,i)||this._addIdentityChange(r,i)):(r=this._mismatch(r,i,n,t),s=!0),r=r._next}else t=0,function(e,t){if(Array.isArray(e))for(let i=0;i<e.length;i++)t(e[i]);else{const i=e[oo()]();let n;for(;!(n=i.next()).done;)t(n.value)}}(e,e=>{n=this._trackByFn(t,e),null!==r&&Object.is(r.trackById,n)?(s&&(r=this._verifyReinsertion(r,e,n,t)),Object.is(r.item,e)||this._addIdentityChange(r,e)):(r=this._mismatch(r,e,n,t),s=!0),r=r._next,t++}),this.length=t;return this._truncate(r),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,n){let r;return null===e?r=this._itTail:(r=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,r,n)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,n))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,r,n)):e=this._addAfter(new Ra(t,i),r,n),e}_verifyReinsertion(e,t,i,n){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==r?e=this._reinsertAfter(r,e._prev,n):e.currentIndex!=n&&(e.currentIndex=n,this._addToMoves(e,n)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const n=e._prevRemoved,r=e._nextRemoved;return null===n?this._removalsHead=r:n._nextRemoved=r,null===r?this._removalsTail=n:r._prevRemoved=n,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const n=null===t?this._itHead:t._next;return e._next=n,e._prev=t,null===n?this._itTail=e:n._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new Fa),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new Fa),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class Ra{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Oa{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class Fa{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new Oa,this.map.set(t,i)),i.add(e)}get(e,t){const i=this.map.get(e);return i?i.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Ba(e,t,i){const n=e.previousIndex;if(null===n)return n;let r=0;return i&&n<i.length&&(r=i[n]),n+t+r}class Ma{constructor(){}supports(e){return e instanceof Map||lo(e)}create(){return new La}}class La{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead}forEachItem(e){let t;for(t=this._mapHead;null!==t;t=t._next)e(t)}forEachPreviousItem(e){let t;for(t=this._previousMapHead;null!==t;t=t._nextPrevious)e(t)}forEachChangedItem(e){let t;for(t=this._changesHead;null!==t;t=t._nextChanged)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}diff(e){if(e){if(!(e instanceof Map||lo(e)))throw new Error(`Error trying to diff '${te(e)}'. Only maps and objects are allowed`)}else e=new Map;return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t=this._mapHead;if(this._appendAfter=null,this._forEach(e,(e,i)=>{if(t&&t.key===i)this._maybeAddToChanges(t,e),this._appendAfter=t,t=t._next;else{const n=this._getOrCreateRecordForKey(i,e);t=this._insertBeforeOrAppend(t,n)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let e=t;null!==e;e=e._nextRemoved)e===this._mapHead&&(this._mapHead=null),this._records.delete(e.key),e._nextRemoved=e._next,e.previousValue=e.currentValue,e.currentValue=null,e._prev=null,e._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const i=this._records.get(e);this._maybeAddToChanges(i,t);const n=i._prev,r=i._next;return n&&(n._next=r),r&&(r._prev=n),i._next=null,i._prev=null,i}const i=new $a(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class $a{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function ja(){return new za([new Da])}let za=(()=>{class e{constructor(e){this.factories=e}static create(t,i){if(null!=i){const e=i.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:i=>e.create(t,i||ja()),deps:[[e,new cn,new an]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(null!=t)return t;throw new Error(`Cannot find a differ supporting object '${e}' of type '${i=e,i.name||typeof i}'`);var i}}return e.\u0275prov=de({token:e,providedIn:"root",factory:ja}),e})();function Na(){return new Va([new Ma])}let Va=(()=>{class e{constructor(e){this.factories=e}static create(t,i){if(i){const e=i.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:i=>e.create(t,i||Na()),deps:[[e,new cn,new an]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(t)return t;throw new Error(`Cannot find a differ supporting object '${e}'`)}}return e.\u0275prov=de({token:e,providedIn:"root",factory:Na}),e})();class Ha{constructor(e,t){this._lView=e,this._cdRefInjectingView=t,this._appRef=null,this._attachedToViewContainer=!1}get rootNodes(){const e=this._lView,t=e[1];return function e(t,i,n,r,s=!1){for(;null!==n;){const o=i[n.index];if(null!==o&&r.push(ft(o)),et(o))for(let t=10;t<o.length;t++){const i=o[t],n=i[1].firstChild;null!==n&&e(i[1],i,n,r)}const a=n.type;if(8&a)e(t,i,n.child,r);else if(32&a){const e=rr(n,i);let t;for(;t=e();)r.push(t)}else if(16&a){const t=Cr(i,n);if(Array.isArray(t))r.push(...t);else{const n=sr(i[16]);e(n[1],n,t,r,!0)}}n=s?n.projectionNext:n.next}return r}(t,e,t.firstChild,[])}get context(){return this._lView[8]}get destroyed(){return 256==(256&this._lView[2])}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){const e=this._lView[3];if(et(e)){const t=e[8],i=t?t.indexOf(this):-1;i>-1&&(hr(e,i),qi(t,i))}this._attachedToViewContainer=!1}pr(this._lView[1],this._lView)}onDestroy(e){cs(this._lView[1],this._lView,null,e)}markForCheck(){xs(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Es(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(e,t,i){jt(!0);try{Es(e,t,i)}finally{jt(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){var e;this._appRef=null,xr(this._lView[1],e=this._lView,e[11],2,null,null)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class Ua extends Ha{constructor(e){super(e),this._view=e}detectChanges(){Is(this._view)}checkNoChanges(){!function(e){jt(!0);try{Is(e)}finally{jt(!1)}}(this._view)}get context(){return null}}const qa=Wa;let Ga=(()=>{class e{}return e.__NG_ELEMENT_ID__=qa,e.__ChangeDetectorRef__=!0,e})();function Wa(e=!1){return function(e,t,i){if(!i&&it(e)){const i=wt(e.index,t);return new Ha(i,i)}return 47&e.type?new Ha(t[16],t):null}(Ot(),Tt(),e)}const Za=[new Ma],Qa=new za([new Da]),Ya=new Va(Za),Ka=function(){return tc(Ot(),Tt())};let Ja=(()=>{class e{}return e.__NG_ELEMENT_ID__=Ka,e})();const Xa=Ja,ec=class extends Xa{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=Yr(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const n=this._declarationLView[19];return null!==n&&(i[19]=n.createEmbeddedView(t)),Xr(t,i,e),new Ha(i)}};function tc(e,t){return 4&e.type?new ec(t,e,ba(e,t)):null}class ic{}const nc=function(){return lc(Ot(),Tt())};let rc=(()=>{class e{}return e.__NG_ELEMENT_ID__=nc,e})();const sc=rc,oc=class extends sc{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return ba(this._hostTNode,this._hostLView)}get injector(){return new $i(this._hostTNode,this._hostLView)}get parentInjector(){const e=Ei(this._hostTNode,this._hostLView);if(_i(e)){const t=bi(e,this._hostLView),i=vi(e);return new $i(t[1].data[i+8],t)}return new $i(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=ac(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const n=e.createEmbeddedView(t||{});return this.insert(n,i),n}createComponent(e,t,i,n,r){const s=i||this.parentInjector;if(!r&&null==e.ngModule&&s){const e=s.get(ic,null);e&&(r=e)}const o=e.create(s,n,void 0,r);return this.insert(o.hostView,t),o}insert(e,t){const i=e._lView,n=i[1];if(et(i[3])){const t=this.indexOf(e);if(-1!==t)this.detach(t);else{const t=i[3],n=new oc(t,t[6],t[3]);n.detach(n.indexOf(e))}}const r=this._adjustIndex(t),s=this._lContainer;!function(e,t,i,n){const r=10+n,s=i.length;n>0&&(i[r-1][4]=t),n<s-10?(t[4]=i[r],Ui(i,10+n,t)):(i.push(t),t[4]=null),t[3]=i;const o=t[17];null!==o&&i!==o&&function(e,t){const i=e[9];t[16]!==t[3][3][16]&&(e[2]=!0),null===i?e[9]=[t]:i.push(t)}(o,t);const a=t[19];null!==a&&a.insertView(e),t[2]|=128}(n,i,s,r);const o=function e(t,i){const n=10+t+1;if(n<i.length){const t=i[n],r=t[1].firstChild;if(null!==r)return function t(i,n){if(null!==n){const r=n.type;if(3&r)return vt(n,i);if(4&r)return e(-1,i[n.index]);if(8&r){const r=n.child;if(null!==r)return t(i,r);{const t=i[n.index];return et(t)?e(-1,t):ft(t)}}if(32&r)return rr(n,i)()||ft(i[n.index]);{const e=Cr(i,n);return null!==e?Array.isArray(e)?e[0]:t(sr(i[16]),e):t(i,n.next)}}return null}(t,r)}return i[7]}(r,s),a=i[11],c=br(a,s[7]);return null!==c&&function(e,t,i,n,r,s){n[0]=r,n[6]=t,xr(e,n,i,1,r,s)}(n,s[6],a,i,c,o),e.attachToViewContainerRef(),Ui(cc(s),r,e),e}move(e,t){return this.insert(e,t)}indexOf(e){const t=ac(this._lContainer);return null!==t?t.indexOf(e):-1}remove(e){const t=this._adjustIndex(e,-1),i=hr(this._lContainer,t);i&&(qi(cc(this._lContainer),t),pr(i[1],i))}detach(e){const t=this._adjustIndex(e,-1),i=hr(this._lContainer,t);return i&&null!=qi(cc(this._lContainer),t)?new Ha(i):null}_adjustIndex(e,t=0){return null==e?this.length+t:e}};function ac(e){return e[8]}function cc(e){return e[8]||(e[8]=[])}function lc(e,t){let i;const n=t[e.index];if(et(n))i=n;else{let r;if(8&e.type)r=ft(n);else{const i=t[11];r=i.createComment("");const n=vt(e,t);fr(i,br(i,n),r,function(e,t){return mt(e)?e.nextSibling(t):t.nextSibling}(i,n),!1)}t[e.index]=i=ws(n,t,r,e),Ss(t,i)}return new oc(i,e,t)}const uc={};class dc extends _a{constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){const t=Ke(e);return new mc(t,this.ngModule)}}function hc(e){const t=[];for(let i in e)e.hasOwnProperty(i)&&t.push({propName:e[i],templateName:i});return t}const pc=new Vi("SCHEDULER_TOKEN",{providedIn:"root",factory:()=>er});class mc extends ga{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=e.selectors.map(jr).join(","),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return hc(this.componentDef.inputs)}get outputs(){return hc(this.componentDef.outputs)}create(e,t,i,n){const r=(n=n||this.ngModule)?function(e,t){return{get:(i,n,r)=>{const s=e.get(i,uc,r);return s!==uc||n===uc?s:t.get(i,n,r)}}}(e,n.injector):e,s=r.get(Ca,gt),o=r.get(Ea,null),a=s.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",l=i?function(e,t,i){if(mt(e))return e.selectRootElement(t,i===Ee.ShadowDom);let n="string"==typeof t?e.querySelector(t):t;return n.textContent="",n}(a,i,this.componentDef.encapsulation):ur(s.createRenderer(null,this.componentDef),c,function(e){const t=e.toLowerCase();return"svg"===t?"http://www.w3.org/2000/svg":"math"===t?"http://www.w3.org/1998/MathML/":null}(c)),u=this.componentDef.onPush?576:528,d={components:[],scheduler:er,clean:Ds,playerHandler:null,flags:0},h=as(0,null,null,1,0,null,null,null,null,null),p=Yr(null,h,d,u,null,null,s,a,o,r);let m,g;Yt(p);try{const e=function(e,t,i,n,r,s){const o=i[1];i[20]=e;const a=Kr(o,20,2,"#host",null),c=a.mergedAttrs=t.hostAttrs;null!==c&&(Bs(a,c,!0),null!==e&&(pi(r,e,c),null!==a.classes&&Pr(r,e,a.classes),null!==a.styles&&Ir(r,e,a.styles)));const l=n.createRenderer(e,t),u=Yr(i,os(t),null,t.onPush?64:16,i[20],a,n,l,null,null);return o.firstCreatePass&&(Ii(Ci(a,i),o,t.type),ms(o,a),fs(a,i.length,1)),Ss(i,u),i[20]=u}(l,this.componentDef,p,s,a);if(l)if(i)pi(a,l,["ng-version",Pa.full]);else{const{attrs:e,classes:t}=function(e){const t=[],i=[];let n=1,r=2;for(;n<e.length;){let s=e[n];if("string"==typeof s)2===r?""!==s&&t.push(s,e[++n]):8===r&&i.push(s);else{if(!Fr(r))break;r=s}n++}return{attrs:t,classes:i}}(this.componentDef.selectors[0]);e&&pi(a,l,e),t&&t.length>0&&Pr(a,l,t.join(" "))}if(g=bt(h,20),void 0!==t){const e=g.projection=[];for(let i=0;i<this.ngContentSelectors.length;i++){const n=t[i];e.push(null!=n?Array.from(n):null)}}m=function(e,t,i,n,r){const s=i[1],o=function(e,t,i){const n=Ot();e.firstCreatePass&&(i.providersResolver&&i.providersResolver(i),_s(e,n,t,Jr(e,t,1,null),i));const r=Bi(t,e,n.directiveStart,n);Xn(r,t);const s=vt(n,t);return s&&Xn(s,t),r}(s,i,t);if(n.components.push(o),e[8]=o,r&&r.forEach(e=>e(o,t)),t.contentQueries){const e=Ot();t.contentQueries(1,o,e.directiveStart)}const a=Ot();return!s.firstCreatePass||null===t.hostBindings&&null===t.hostAttrs||(ni(a.index),hs(i[1],a,0,a.directiveStart,a.directiveEnd,t),ps(t,o)),o}(e,this.componentDef,p,d,[Xs]),Xr(h,p,null)}finally{ti()}return new gc(this.componentType,m,ba(g,p),p,g)}}class gc extends class{}{constructor(e,t,i,n,r){super(),this.location=i,this._rootLView=n,this._tNode=r,this.instance=t,this.hostView=this.changeDetectorRef=new Ua(n),this.componentType=e}get injector(){return new $i(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const fc=new Map;class _c extends ic{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new dc(this);const i=Je(e),n=e[je]||null;n&&oa(n),this._bootstrapComponents=ir(i.bootstrap),this._r3Injector=Us(e,t,[{provide:ic,useValue:this},{provide:_a,useValue:this.componentFactoryResolver}],te(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Js.THROW_IF_NOT_FOUND,i=ye.Default){return e===Js||e===ic||e===Ms?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(e=>e()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class vc extends class{}{constructor(e){super(),this.moduleType=e,null!==Je(e)&&function(e){const t=new Set;!function e(i){const n=Je(i,!0),r=n.id;null!==r&&(function(e,t,i){if(t&&t!==i)throw new Error(`Duplicate module registered for ${e} - ${te(t)} vs ${te(t.name)}`)}(r,fc.get(r),i),fc.set(r,i));const s=ir(n.imports);for(const o of s)t.has(o)||(t.add(o),e(o))}(e)}(e)}create(e){return new _c(this.moduleType,e)}}function bc(e,t,i,n){return Sc(Tt(),zt(),e,t,i,n)}function yc(e,t,i,n,r){return xc(Tt(),zt(),e,t,i,n,r)}function wc(e,t,i,n,r,s){return function(e,t,i,n,r,s,o,a){const c=t+i;return function(e,t,i,n,r){const s=po(e,t,i,n);return ho(e,t+2,r)||s}(e,c,r,s,o)?uo(e,c+3,a?n.call(a,r,s,o):n(r,s,o)):Cc(e,c+3)}(Tt(),zt(),e,t,i,n,r,s)}function kc(e,t,i,n,r,s,o,a){const c=zt()+e,l=Tt(),u=function(e,t,i,n,r,s){const o=po(e,t,i,n);return po(e,t+2,r,s)||o}(l,c,i,n,r,s);return ho(l,c+4,o)||u?uo(l,c+5,a?t.call(a,i,n,r,s,o):t(i,n,r,s,o)):function(e,t){return e[t]}(l,c+5)}function Cc(e,t){const i=e[t];return i===zr?void 0:i}function Sc(e,t,i,n,r,s){const o=t+i;return ho(e,o,r)?uo(e,o+1,s?n.call(s,r):n(r)):Cc(e,o+1)}function xc(e,t,i,n,r,s,o){const a=t+i;return po(e,a,r,s)?uo(e,a+2,o?n.call(o,r,s):n(r,s)):Cc(e,a+2)}function Ec(e,t){const i=At();let n;const r=e+20;i.firstCreatePass?(n=function(e,t){if(t)for(let i=t.length-1;i>=0;i--){const n=t[i];if(e===n.name)return n}throw new ae("302",`The pipe '${e}' could not be found!`)}(t,i.pipeRegistry),i.data[r]=n,n.onDestroy&&(i.destroyHooks||(i.destroyHooks=[])).push(r,n.onDestroy)):n=i.data[r];const s=n.factory||(n.factory=st(n.type)),o=ke(vo);try{const e=wi(!1),t=s();return wi(e),function(e,t,i,n){i>=e.data.length&&(e.data[i]=null,e.blueprint[i]=null),t[i]=n}(i,Tt(),r,t),t}finally{ke(o)}}function Ic(e,t,i){const n=e+20,r=Tt(),s=yt(r,n);return Tc(r,Dc(r,n)?Sc(r,zt(),t,s.transform,i,s):s.transform(i))}function Pc(e,t,i,n){const r=e+20,s=Tt(),o=yt(s,r);return Tc(s,Dc(s,r)?xc(s,zt(),t,o.transform,i,n,o):o.transform(i,n))}function Dc(e,t){return e[1].data[t].pure}function Tc(e,t){return ao.isWrapped(t)&&(t=ao.unwrap(t),e[Nt()]=zr),t}function Ac(e){return t=>{setTimeout(e,void 0,t)}}const Rc=class extends C{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var n,r,s;let o=e,a=t||(()=>null),c=i;if(e&&"object"==typeof e){const t=e;o=null===(n=t.next)||void 0===n?void 0:n.bind(t),a=null===(r=t.error)||void 0===r?void 0:r.bind(t),c=null===(s=t.complete)||void 0===s?void 0:s.bind(t)}this.__isAsync&&(a=Ac(a),o&&(o=Ac(o)),c&&(c=Ac(c)));const l=super.subscribe({next:o,error:a,complete:c});return e instanceof d&&e.add(l),l}};function Oc(){return this._results[oo()]()}class Fc{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=oo(),i=Fc.prototype;i[t]||(i[t]=Oc)}get changes(){return this._changes||(this._changes=new Rc)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){this.dirty=!1;const i=function e(t,i){void 0===i&&(i=t);for(let n=0;n<t.length;n++){let r=t[n];Array.isArray(r)?(i===t&&(i=t.slice(0,n)),e(r,i)):i!==t&&i.push(r)}return i}(e);(this._changesDetected=!function(e,t,i){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],s=t[n];if(i&&(r=i(r),s=i(s)),s!==r)return!1}return!0}(this._results,i,t))&&(this._results=i,this.length=i.length,this.last=i[this.length-1],this.first=i[0])}notifyOnChanges(){!this._changes||!this._changesDetected&&this._emitDistinctChangesOnly||this._changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}class Bc{constructor(e){this.queryList=e,this.matches=null}clone(){return new Bc(this.queryList)}setDirty(){this.queryList.setDirty()}}class Mc{constructor(e=[]){this.queries=e}createEmbeddedView(e){const t=e.queries;if(null!==t){const i=null!==e.contentQueries?e.contentQueries[0]:t.length,n=[];for(let e=0;e<i;e++){const i=t.getByIndex(e);n.push(this.queries[i.indexInDeclarationView].clone())}return new Mc(n)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let t=0;t<this.queries.length;t++)null!==Gc(e,t).matches&&this.queries[t].setDirty()}}class Lc{constructor(e,t,i=null){this.predicate=e,this.flags=t,this.read=i}}class $c{constructor(e=[]){this.queries=e}elementStart(e,t){for(let i=0;i<this.queries.length;i++)this.queries[i].elementStart(e,t)}elementEnd(e){for(let t=0;t<this.queries.length;t++)this.queries[t].elementEnd(e)}embeddedTView(e){let t=null;for(let i=0;i<this.length;i++){const n=null!==t?t.length:0,r=this.getByIndex(i).embeddedTView(e,n);r&&(r.indexInDeclarationView=i,null!==t?t.push(r):t=[r])}return null!==t?new $c(t):null}template(e,t){for(let i=0;i<this.queries.length;i++)this.queries[i].template(e,t)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}}class jc{constructor(e,t=-1){this.metadata=e,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=t}elementStart(e,t){this.isApplyingToNode(t)&&this.matchTNode(e,t)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,t){this.elementStart(e,t)}embeddedTView(e,t){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,t),new jc(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&1!=(1&this.metadata.flags)){const t=this._declarationNodeIndex;let i=e.parent;for(;null!==i&&8&i.type&&i.index!==t;)i=i.parent;return t===(null!==i?i.index:-1)}return this._appliesToNextNode}matchTNode(e,t){const i=this.metadata.predicate;if(Array.isArray(i))for(let n=0;n<i.length;n++){const r=i[n];this.matchTNodeWithReadOption(e,t,zc(t,r)),this.matchTNodeWithReadOption(e,t,Fi(t,e,r,!1,!1))}else i===Ja?4&t.type&&this.matchTNodeWithReadOption(e,t,-1):this.matchTNodeWithReadOption(e,t,Fi(t,e,i,!1,!1))}matchTNodeWithReadOption(e,t,i){if(null!==i){const n=this.metadata.read;if(null!==n)if(n===wa||n===rc||n===Ja&&4&t.type)this.addMatch(t.index,-2);else{const i=Fi(t,e,n,!1,!1);null!==i&&this.addMatch(t.index,i)}else this.addMatch(t.index,i)}}addMatch(e,t){null===this.matches?this.matches=[e,t]:this.matches.push(e,t)}}function zc(e,t){const i=e.localNames;if(null!==i)for(let n=0;n<i.length;n+=2)if(i[n]===t)return i[n+1];return null}function Nc(e,t,i,n){return-1===i?function(e,t){return 11&e.type?ba(e,t):4&e.type?tc(e,t):null}(t,e):-2===i?function(e,t,i){return i===wa?ba(t,e):i===Ja?tc(t,e):i===rc?lc(t,e):void 0}(e,t,n):Bi(e,e[1],i,t)}function Vc(e,t,i,n){const r=t[19].queries[n];if(null===r.matches){const n=e.data,s=i.matches,o=[];for(let e=0;e<s.length;e+=2){const r=s[e];o.push(r<0?null:Nc(t,n[r],s[e+1],i.metadata.read))}r.matches=o}return r.matches}function Hc(e){const t=Tt(),i=At(),n=Gt();Wt(n+1);const r=Gc(i,n);if(e.dirty&&Ct(t)===(2==(2&r.metadata.flags))){if(null===r.matches)e.reset([]);else{const s=r.crossesNgTemplate?function e(t,i,n,r){const s=t.queries.getByIndex(n),o=s.matches;if(null!==o){const a=Vc(t,i,s,n);for(let t=0;t<o.length;t+=2){const n=o[t];if(n>0)r.push(a[t/2]);else{const s=o[t+1],a=i[-n];for(let t=10;t<a.length;t++){const i=a[t];i[17]===i[3]&&e(i[1],i,s,r)}if(null!==a[9]){const t=a[9];for(let i=0;i<t.length;i++){const n=t[i];e(n[1],n,s,r)}}}}}return r}(i,t,n,[]):Vc(i,t,r,n);e.reset(s,ka),e.notifyOnChanges()}return!0}return!1}function Uc(e,t,i){const n=At();n.firstCreatePass&&(function(e,t,i){null===e.queries&&(e.queries=new $c),e.queries.track(new jc(t,-1))}(n,new Lc(e,t,i)),2==(2&t)&&(n.staticViewQueries=!0)),function(e,t,i){const n=new Fc(4==(4&i));cs(e,t,n,n.destroy),null===t[19]&&(t[19]=new Mc),t[19].queries.push(new Bc(n))}(n,Tt(),t)}function qc(){return e=Tt(),t=Gt(),e[19].queries[t].queryList;var e,t}function Gc(e,t){return e.queries.getByIndex(t)}function Wc(e,t){return tc(e,t)}const Zc=new Vi("Application Initializer");let Qc=(()=>{class e{constructor(e){this.appInits=e,this.resolve=va,this.reject=va,this.initialized=!1,this.done=!1,this.donePromise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}runInitializers(){if(this.initialized)return;const e=[],t=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let i=0;i<this.appInits.length;i++){const t=this.appInits[i]();Po(t)&&e.push(t)}Promise.all(e).then(()=>{t()}).catch(e=>{this.reject(e)}),0===e.length&&t(),this.initialized=!0}}return e.\u0275fac=function(t){return new(t||e)(nn(Zc,8))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const Yc=new Vi("AppId"),Kc={provide:Yc,useFactory:function(){return`${Jc()}${Jc()}${Jc()}`},deps:[]};function Jc(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const Xc=new Vi("Platform Initializer"),el=new Vi("Platform ID"),tl=new Vi("appBootstrapListener");let il=(()=>{class e{log(e){console.log(e)}warn(e){console.warn(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const nl=new Vi("LocaleId"),rl=new Vi("DefaultCurrencyCode");class sl{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const ol=function(e){return new vc(e)},al=ol,cl=function(e){return Promise.resolve(ol(e))},ll=function(e){const t=ol(e),i=ir(Je(e).declarations).reduce((e,t)=>{const i=Ke(t);return i&&e.push(new mc(i)),e},[]);return new sl(t,i)},ul=ll,dl=function(e){return Promise.resolve(ll(e))};let hl=(()=>{class e{constructor(){this.compileModuleSync=al,this.compileModuleAsync=cl,this.compileModuleAndAllComponentsSync=ul,this.compileModuleAndAllComponentsAsync=dl}clearCache(){}clearCacheFor(e){}getModuleId(e){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const pl=(()=>Promise.resolve(0))();function ml(e){"undefined"==typeof Zone?pl.then(()=>{e&&e.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",e)}class gl{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Rc(!1),this.onMicrotaskEmpty=new Rc(!1),this.onStable=new Rc(!1),this.onError=new Rc(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched(),this._nesting=0,this._outer=this._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(this._inner=this._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(this._inner=this._inner.fork(Zone.longStackTraceZoneSpec)),this.shouldCoalesceEventChangeDetection=!i&&t,this.shouldCoalesceRunChangeDetection=i,this.lastRequestAnimationFrameId=-1,this.nativeRequestAnimationFrame=function(){let e=Ae.requestAnimationFrame,t=Ae.cancelAnimationFrame;if("undefined"!=typeof Zone&&e&&t){const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i);const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n)}return{nativeRequestAnimationFrame:e,nativeCancelAnimationFrame:t}}().nativeRequestAnimationFrame,function(e){const t=()=>{!function(e){-1===e.lastRequestAnimationFrameId&&(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(Ae,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,vl(e),_l(e)},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),vl(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(i,n,r,s,o,a)=>{try{return bl(e),i.invokeTask(r,s,o,a)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||e.shouldCoalesceRunChangeDetection)&&t(),yl(e)}},onInvoke:(i,n,r,s,o,a,c)=>{try{return bl(e),i.invoke(r,s,o,a,c)}finally{e.shouldCoalesceRunChangeDetection&&t(),yl(e)}},onHasTask:(t,i,n,r)=>{t.hasTask(n,r),i===n&&("microTask"==r.change?(e._hasPendingMicrotasks=r.microTask,vl(e),_l(e)):"macroTask"==r.change&&(e.hasPendingMacrotasks=r.macroTask))},onHandleError:(t,i,n,r)=>(t.handleError(n,r),e.runOutsideAngular(()=>e.onError.emit(r)),!1)})}(this)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!gl.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(gl.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,n){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+n,e,fl,va,va);try{return r.runTask(s,t,i)}finally{r.cancelTask(s)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const fl={};function _l(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function vl(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function bl(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function yl(e){e._nesting--,_l(e)}class wl{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Rc,this.onMicrotaskEmpty=new Rc,this.onStable=new Rc,this.onError=new Rc}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,n){return e.apply(t,i)}}let kl=(()=>{class e{constructor(e){this._ngZone=e,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),e.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{gl.assertNotInAngularZone(),ml(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())ml(()=>{for(;0!==this._callbacks.length;){let e=this._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb(this._didWork)}this._didWork=!1});else{let e=this.getPendingTasks();this._callbacks=this._callbacks.filter(t=>!t.updateCb||!t.updateCb(e)||(clearTimeout(t.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(e=>({source:e.source,creationLocation:e.creationLocation,data:e.data})):[]}addCallback(e,t,i){let n=-1;t&&t>0&&(n=setTimeout(()=>{this._callbacks=this._callbacks.filter(e=>e.timeoutId!==n),e(this._didWork,this.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:n,updateCb:i})}whenStable(e,t,i){if(i&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(e,t,i),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(e,t,i){return[]}}return e.\u0275fac=function(t){return new(t||e)(nn(gl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Cl=(()=>{class e{constructor(){this._applications=new Map,El.addToWindow(this)}registerApplication(e,t){this._applications.set(e,t)}unregisterApplication(e){this._applications.delete(e)}unregisterAllApplications(){this._applications.clear()}getTestability(e){return this._applications.get(e)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(e,t=!0){return El.findTestabilityInTree(this,e,t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();class Sl{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let xl,El=new Sl,Il=!0,Pl=!1;const Dl=new Vi("AllowMultipleToken");function Tl(e,t,i=[]){const n="Platform: "+t,r=new Vi(n);return(t=[])=>{let s=Al();if(!s||s.injector.get(Dl,!1))if(e)e(i.concat(t).concat({provide:r,useValue:!0}));else{const e=i.concat(t).concat({provide:r,useValue:!0},{provide:$s,useValue:"platform"});!function(e){if(xl&&!xl.destroyed&&!xl.injector.get(Dl,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");xl=e.get(Rl);const t=e.get(Xc,null);t&&t.forEach(e=>e())}(Js.create({providers:e,name:n}))}return function(e){const t=Al();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(r)}}function Al(){return xl&&!xl.destroyed?xl:null}let Rl=(()=>{class e{constructor(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(e,t){const i=function(e,t){let i;return i="noop"===e?new wl:("zone.js"===e?void 0:e)||new gl({enableLongStackTrace:(Pl=!0,Il),shouldCoalesceEventChangeDetection:!!(null==t?void 0:t.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==t?void 0:t.ngZoneRunCoalescing)}),i}(t?t.ngZone:void 0,{ngZoneEventCoalescing:t&&t.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:t&&t.ngZoneRunCoalescing||!1}),n=[{provide:gl,useValue:i}];return i.run(()=>{const t=Js.create({providers:n,parent:this.injector,name:e.moduleType.name}),r=e.create(t),s=r.injector.get(Jn,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return i.runOutsideAngular(()=>{const e=i.onError.subscribe({next:e=>{s.handleError(e)}});r.onDestroy(()=>{Bl(this._modules,r),e.unsubscribe()})}),function(e,t,i){try{const n=i();return Po(n)?n.catch(i=>{throw t.runOutsideAngular(()=>e.handleError(i)),i}):n}catch(n){throw t.runOutsideAngular(()=>e.handleError(n)),n}}(s,i,()=>{const e=r.injector.get(Qc);return e.runInitializers(),e.donePromise.then(()=>(oa(r.injector.get(nl,"en-US")||"en-US"),this._moduleDoBootstrap(r),r))})})}bootstrapModule(e,t=[]){const i=Ol({},t);return function(e,t,i){const n=new vc(i);return Promise.resolve(n)}(0,0,e).then(e=>this.bootstrapModuleFactory(e,i))}_moduleDoBootstrap(e){const t=e.injector.get(Fl);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(e=>t.bootstrap(e));else{if(!e.instance.ngDoBootstrap)throw new Error(`The module ${te(e.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);e.instance.ngDoBootstrap(t)}this._modules.push(e)}onDestroy(e){this._destroyListeners.push(e)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(e=>e.destroy()),this._destroyListeners.forEach(e=>e()),this._destroyed=!0}get destroyed(){return this._destroyed}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();function Ol(e,t){return Array.isArray(t)?t.reduce(Ol,e):Object.assign(Object.assign({},e),t)}let Fl=(()=>{class e{constructor(e,t,i,n,r){this._zone=e,this._injector=t,this._exceptionHandler=i,this._componentFactoryResolver=n,this._initStatus=r,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const s=new v(e=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{e.next(this._stable),e.complete()})}),o=new v(e=>{let t;this._zone.runOutsideAngular(()=>{t=this._zone.onStable.subscribe(()=>{gl.assertNotInAngularZone(),ml(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,e.next(!0))})})});const i=this._zone.onUnstable.subscribe(()=>{gl.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{e.next(!1)}))});return()=>{t.unsubscribe(),i.unsubscribe()}});this.isStable=q(s,o.pipe(e=>{return G()((t=J,function(e){let i;i="function"==typeof t?t:function(){return t};const n=Object.create(e,Y);return n.source=e,n.subjectFactory=i,n})(e));var t}))}bootstrap(e,t){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let i;i=e instanceof ga?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(i.componentType);const n=i.isBoundToModule?void 0:this._injector.get(ic),r=i.create(Js.NULL,[],t||i.selector,n),s=r.location.nativeElement,o=r.injector.get(kl,null),a=o&&r.injector.get(Cl);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),Bl(this.components,r),a&&a.unregisterApplication(s)}),this._loadComponent(r),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let e of this._views)e.detectChanges()}catch(e){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(e))}finally{this._runningTick=!1}}attachView(e){const t=e;this._views.push(t),t.attachToAppRef(this)}detachView(e){const t=e;Bl(this._views,t),t.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(tl,[]).concat(this._bootstrapListeners).forEach(t=>t(e))}ngOnDestroy(){this._views.slice().forEach(e=>e.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return e.\u0275fac=function(t){return new(t||e)(nn(gl),nn(Js),nn(Jn),nn(_a),nn(Qc))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();function Bl(e,t){const i=e.indexOf(t);i>-1&&e.splice(i,1)}const Ml=Tl(null,"core",[{provide:el,useValue:"unknown"},{provide:Rl,deps:[Js]},{provide:Cl,deps:[]},{provide:il,deps:[]}]),Ll=[{provide:Fl,useClass:Fl,deps:[gl,Js,Jn,_a,Qc]},{provide:pc,deps:[gl],useFactory:function(e){let t=[];return e.onStable.subscribe(()=>{for(;t.length;)t.pop()()}),function(e){t.push(e)}}},{provide:Qc,useClass:Qc,deps:[[new an,Zc]]},{provide:hl,useClass:hl,deps:[]},Kc,{provide:za,useFactory:function(){return Qa},deps:[]},{provide:Va,useFactory:function(){return Ya},deps:[]},{provide:nl,useFactory:function(e){return oa(e=e||"undefined"!=typeof $localize&&$localize.locale||"en-US"),e},deps:[[new on(nl),new an,new cn]]},{provide:rl,useValue:"USD"}];let $l=(()=>{class e{constructor(e){}}return e.\u0275fac=function(t){return new(t||e)(nn(Fl))},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:Ll}),e})(),jl=null;function zl(){return jl}const Nl=new Vi("DocumentToken"),Vl={ADP:[void 0,void 0,0],AFN:[void 0,void 0,0],ALL:[void 0,void 0,0],AMD:[void 0,void 0,2],AOA:[void 0,"Kz"],ARS:[void 0,"$"],AUD:["A$","$"],BAM:[void 0,"KM"],BBD:[void 0,"$"],BDT:[void 0,"\u09f3"],BHD:[void 0,void 0,3],BIF:[void 0,void 0,0],BMD:[void 0,"$"],BND:[void 0,"$"],BOB:[void 0,"Bs"],BRL:["R$"],BSD:[void 0,"$"],BWP:[void 0,"P"],BYN:[void 0,"\u0440.",2],BYR:[void 0,void 0,0],BZD:[void 0,"$"],CAD:["CA$","$",2],CHF:[void 0,void 0,2],CLF:[void 0,void 0,4],CLP:[void 0,"$",0],CNY:["CN\xa5","\xa5"],COP:[void 0,"$",2],CRC:[void 0,"\u20a1",2],CUC:[void 0,"$"],CUP:[void 0,"$"],CZK:[void 0,"K\u010d",2],DJF:[void 0,void 0,0],DKK:[void 0,"kr",2],DOP:[void 0,"$"],EGP:[void 0,"E\xa3"],ESP:[void 0,"\u20a7",0],EUR:["\u20ac"],FJD:[void 0,"$"],FKP:[void 0,"\xa3"],GBP:["\xa3"],GEL:[void 0,"\u20be"],GIP:[void 0,"\xa3"],GNF:[void 0,"FG",0],GTQ:[void 0,"Q"],GYD:[void 0,"$",2],HKD:["HK$","$"],HNL:[void 0,"L"],HRK:[void 0,"kn"],HUF:[void 0,"Ft",2],IDR:[void 0,"Rp",2],ILS:["\u20aa"],INR:["\u20b9"],IQD:[void 0,void 0,0],IRR:[void 0,void 0,0],ISK:[void 0,"kr",0],ITL:[void 0,void 0,0],JMD:[void 0,"$"],JOD:[void 0,void 0,3],JPY:["\xa5",void 0,0],KHR:[void 0,"\u17db"],KMF:[void 0,"CF",0],KPW:[void 0,"\u20a9",0],KRW:["\u20a9",void 0,0],KWD:[void 0,void 0,3],KYD:[void 0,"$"],KZT:[void 0,"\u20b8"],LAK:[void 0,"\u20ad",0],LBP:[void 0,"L\xa3",0],LKR:[void 0,"Rs"],LRD:[void 0,"$"],LTL:[void 0,"Lt"],LUF:[void 0,void 0,0],LVL:[void 0,"Ls"],LYD:[void 0,void 0,3],MGA:[void 0,"Ar",0],MGF:[void 0,void 0,0],MMK:[void 0,"K",0],MNT:[void 0,"\u20ae",2],MRO:[void 0,void 0,0],MUR:[void 0,"Rs",2],MXN:["MX$","$"],MYR:[void 0,"RM"],NAD:[void 0,"$"],NGN:[void 0,"\u20a6"],NIO:[void 0,"C$"],NOK:[void 0,"kr",2],NPR:[void 0,"Rs"],NZD:["NZ$","$"],OMR:[void 0,void 0,3],PHP:[void 0,"\u20b1"],PKR:[void 0,"Rs",2],PLN:[void 0,"z\u0142"],PYG:[void 0,"\u20b2",0],RON:[void 0,"lei"],RSD:[void 0,void 0,0],RUB:[void 0,"\u20bd"],RUR:[void 0,"\u0440."],RWF:[void 0,"RF",0],SBD:[void 0,"$"],SEK:[void 0,"kr",2],SGD:[void 0,"$"],SHP:[void 0,"\xa3"],SLL:[void 0,void 0,0],SOS:[void 0,void 0,0],SRD:[void 0,"$"],SSP:[void 0,"\xa3"],STD:[void 0,void 0,0],STN:[void 0,"Db"],SYP:[void 0,"\xa3",0],THB:[void 0,"\u0e3f"],TMM:[void 0,void 0,0],TND:[void 0,void 0,3],TOP:[void 0,"T$"],TRL:[void 0,void 0,0],TRY:[void 0,"\u20ba"],TTD:[void 0,"$"],TWD:["NT$","$",2],TZS:[void 0,void 0,2],UAH:[void 0,"\u20b4"],UGX:[void 0,void 0,0],USD:["$"],UYI:[void 0,void 0,0],UYU:[void 0,"$"],UYW:[void 0,void 0,4],UZS:[void 0,void 0,2],VEF:[void 0,"Bs",2],VND:["\u20ab",void 0,0],VUV:[void 0,void 0,0],XAF:["FCFA",void 0,0],XCD:["EC$","$"],XOF:["CFA",void 0,0],XPF:["CFPF",void 0,0],XXX:["\xa4"],YER:[void 0,void 0,0],ZAR:[void 0,"R"],ZMK:[void 0,void 0,0],ZMW:[void 0,"ZK"],ZWD:[void 0,void 0,0]};var Hl=function(e){return e[e.Decimal=0]="Decimal",e[e.Percent=1]="Percent",e[e.Currency=2]="Currency",e[e.Scientific=3]="Scientific",e}({}),Ul=function(e){return e[e.Zero=0]="Zero",e[e.One=1]="One",e[e.Two=2]="Two",e[e.Few=3]="Few",e[e.Many=4]="Many",e[e.Other=5]="Other",e}({}),ql=function(e){return e[e.Format=0]="Format",e[e.Standalone=1]="Standalone",e}({}),Gl=function(e){return e[e.Narrow=0]="Narrow",e[e.Abbreviated=1]="Abbreviated",e[e.Wide=2]="Wide",e[e.Short=3]="Short",e}({}),Wl=function(e){return e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e[e.Full=3]="Full",e}({}),Zl=function(e){return e[e.Decimal=0]="Decimal",e[e.Group=1]="Group",e[e.List=2]="List",e[e.PercentSign=3]="PercentSign",e[e.PlusSign=4]="PlusSign",e[e.MinusSign=5]="MinusSign",e[e.Exponential=6]="Exponential",e[e.SuperscriptingExponent=7]="SuperscriptingExponent",e[e.PerMille=8]="PerMille",e[e[1/0]=9]="Infinity",e[e.NaN=10]="NaN",e[e.TimeSeparator=11]="TimeSeparator",e[e.CurrencyDecimal=12]="CurrencyDecimal",e[e.CurrencyGroup=13]="CurrencyGroup",e}({});function Ql(e,t){return tu(ia(e)[ra.DateFormat],t)}function Yl(e,t){return tu(ia(e)[ra.TimeFormat],t)}function Kl(e,t){return tu(ia(e)[ra.DateTimeFormat],t)}function Jl(e,t){const i=ia(e),n=i[ra.NumberSymbols][t];if(void 0===n){if(t===Zl.CurrencyDecimal)return i[ra.NumberSymbols][Zl.Decimal];if(t===Zl.CurrencyGroup)return i[ra.NumberSymbols][Zl.Group]}return n}function Xl(e,t){return ia(e)[ra.NumberFormats][t]}function eu(e){if(!e[ra.ExtraData])throw new Error(`Missing extra locale data for the locale "${e[ra.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function tu(e,t){for(let i=t;i>-1;i--)if(void 0!==e[i])return e[i];throw new Error("Locale data API: locale data undefined")}function iu(e){const[t,i]=e.split(":");return{hours:+t,minutes:+i}}const nu=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,ru={},su=/((?:[^GyYMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var ou=function(e){return e[e.Short=0]="Short",e[e.ShortGMT=1]="ShortGMT",e[e.Long=2]="Long",e[e.Extended=3]="Extended",e}({}),au=function(e){return e[e.FullYear=0]="FullYear",e[e.Month=1]="Month",e[e.Date=2]="Date",e[e.Hours=3]="Hours",e[e.Minutes=4]="Minutes",e[e.Seconds=5]="Seconds",e[e.FractionalSeconds=6]="FractionalSeconds",e[e.Day=7]="Day",e}({}),cu=function(e){return e[e.DayPeriods=0]="DayPeriods",e[e.Days=1]="Days",e[e.Months=2]="Months",e[e.Eras=3]="Eras",e}({});function lu(e,t,i,n){let r=function(e){if(wu(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){const[t,i=1,n=1]=e.split("-").map(e=>+e);return uu(t,i-1,n)}const t=parseFloat(e);if(!isNaN(e-t))return new Date(t);let i;if(i=e.match(nu))return function(e){const t=new Date(0);let i=0,n=0;const r=e[8]?t.setUTCFullYear:t.setFullYear,s=e[8]?t.setUTCHours:t.setHours;e[9]&&(i=Number(e[9]+e[10]),n=Number(e[9]+e[11])),r.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));const o=Number(e[4]||0)-i,a=Number(e[5]||0)-n,c=Number(e[6]||0),l=Math.floor(1e3*parseFloat("0."+(e[7]||0)));return s.call(t,o,a,c,l),t}(i)}const t=new Date(e);if(!wu(t))throw new Error(`Unable to convert "${e}" into a date`);return t}(e);t=function e(t,i){const n=function(e){return ia(e)[ra.LocaleId]}(t);if(ru[n]=ru[n]||{},ru[n][i])return ru[n][i];let r="";switch(i){case"shortDate":r=Ql(t,Wl.Short);break;case"mediumDate":r=Ql(t,Wl.Medium);break;case"longDate":r=Ql(t,Wl.Long);break;case"fullDate":r=Ql(t,Wl.Full);break;case"shortTime":r=Yl(t,Wl.Short);break;case"mediumTime":r=Yl(t,Wl.Medium);break;case"longTime":r=Yl(t,Wl.Long);break;case"fullTime":r=Yl(t,Wl.Full);break;case"short":const i=e(t,"shortTime"),n=e(t,"shortDate");r=du(Kl(t,Wl.Short),[i,n]);break;case"medium":const s=e(t,"mediumTime"),o=e(t,"mediumDate");r=du(Kl(t,Wl.Medium),[s,o]);break;case"long":const a=e(t,"longTime"),c=e(t,"longDate");r=du(Kl(t,Wl.Long),[a,c]);break;case"full":const l=e(t,"fullTime"),u=e(t,"fullDate");r=du(Kl(t,Wl.Full),[l,u])}return r&&(ru[n][i]=r),r}(i,t)||t;let s,o=[];for(;t;){if(s=su.exec(t),!s){o.push(t);break}{o=o.concat(s.slice(1));const e=o.pop();if(!e)break;t=e}}let a=r.getTimezoneOffset();n&&(a=yu(n,a),r=function(e,t,i){const n=e.getTimezoneOffset();return function(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}(e,-1*(yu(t,n)-n))}(r,n));let c="";return o.forEach(e=>{const t=function(e){if(bu[e])return bu[e];let t;switch(e){case"G":case"GG":case"GGG":t=mu(cu.Eras,Gl.Abbreviated);break;case"GGGG":t=mu(cu.Eras,Gl.Wide);break;case"GGGGG":t=mu(cu.Eras,Gl.Narrow);break;case"y":t=pu(au.FullYear,1,0,!1,!0);break;case"yy":t=pu(au.FullYear,2,0,!0,!0);break;case"yyy":t=pu(au.FullYear,3,0,!1,!0);break;case"yyyy":t=pu(au.FullYear,4,0,!1,!0);break;case"Y":t=vu(1);break;case"YY":t=vu(2,!0);break;case"YYY":t=vu(3);break;case"YYYY":t=vu(4);break;case"M":case"L":t=pu(au.Month,1,1);break;case"MM":case"LL":t=pu(au.Month,2,1);break;case"MMM":t=mu(cu.Months,Gl.Abbreviated);break;case"MMMM":t=mu(cu.Months,Gl.Wide);break;case"MMMMM":t=mu(cu.Months,Gl.Narrow);break;case"LLL":t=mu(cu.Months,Gl.Abbreviated,ql.Standalone);break;case"LLLL":t=mu(cu.Months,Gl.Wide,ql.Standalone);break;case"LLLLL":t=mu(cu.Months,Gl.Narrow,ql.Standalone);break;case"w":t=_u(1);break;case"ww":t=_u(2);break;case"W":t=_u(1,!0);break;case"d":t=pu(au.Date,1);break;case"dd":t=pu(au.Date,2);break;case"E":case"EE":case"EEE":t=mu(cu.Days,Gl.Abbreviated);break;case"EEEE":t=mu(cu.Days,Gl.Wide);break;case"EEEEE":t=mu(cu.Days,Gl.Narrow);break;case"EEEEEE":t=mu(cu.Days,Gl.Short);break;case"a":case"aa":case"aaa":t=mu(cu.DayPeriods,Gl.Abbreviated);break;case"aaaa":t=mu(cu.DayPeriods,Gl.Wide);break;case"aaaaa":t=mu(cu.DayPeriods,Gl.Narrow);break;case"b":case"bb":case"bbb":t=mu(cu.DayPeriods,Gl.Abbreviated,ql.Standalone,!0);break;case"bbbb":t=mu(cu.DayPeriods,Gl.Wide,ql.Standalone,!0);break;case"bbbbb":t=mu(cu.DayPeriods,Gl.Narrow,ql.Standalone,!0);break;case"B":case"BB":case"BBB":t=mu(cu.DayPeriods,Gl.Abbreviated,ql.Format,!0);break;case"BBBB":t=mu(cu.DayPeriods,Gl.Wide,ql.Format,!0);break;case"BBBBB":t=mu(cu.DayPeriods,Gl.Narrow,ql.Format,!0);break;case"h":t=pu(au.Hours,1,-12);break;case"hh":t=pu(au.Hours,2,-12);break;case"H":t=pu(au.Hours,1);break;case"HH":t=pu(au.Hours,2);break;case"m":t=pu(au.Minutes,1);break;case"mm":t=pu(au.Minutes,2);break;case"s":t=pu(au.Seconds,1);break;case"ss":t=pu(au.Seconds,2);break;case"S":t=pu(au.FractionalSeconds,1);break;case"SS":t=pu(au.FractionalSeconds,2);break;case"SSS":t=pu(au.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":t=gu(ou.Short);break;case"ZZZZZ":t=gu(ou.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":t=gu(ou.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":t=gu(ou.Long);break;default:return null}return bu[e]=t,t}(e);c+=t?t(r,i,a):"''"===e?"'":e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}function uu(e,t,i){const n=new Date(0);return n.setFullYear(e,t,i),n.setHours(0,0,0),n}function du(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,(function(e,i){return null!=t&&i in t?t[i]:e}))),e}function hu(e,t,i="-",n,r){let s="";(e<0||r&&e<=0)&&(r?e=1-e:(e=-e,s=i));let o=String(e);for(;o.length<t;)o="0"+o;return n&&(o=o.substr(o.length-t)),s+o}function pu(e,t,i=0,n=!1,r=!1){return function(s,o){let a=function(e,t){switch(e){case au.FullYear:return t.getFullYear();case au.Month:return t.getMonth();case au.Date:return t.getDate();case au.Hours:return t.getHours();case au.Minutes:return t.getMinutes();case au.Seconds:return t.getSeconds();case au.FractionalSeconds:return t.getMilliseconds();case au.Day:return t.getDay();default:throw new Error(`Unknown DateType value "${e}".`)}}(e,s);if((i>0||a>-i)&&(a+=i),e===au.Hours)0===a&&-12===i&&(a=12);else if(e===au.FractionalSeconds)return c=t,hu(a,3).substr(0,c);var c;const l=Jl(o,Zl.MinusSign);return hu(a,t,l,n,r)}}function mu(e,t,i=ql.Format,n=!1){return function(r,s){return function(e,t,i,n,r,s){switch(i){case cu.Months:return function(e,t,i){const n=ia(e),r=tu([n[ra.MonthsFormat],n[ra.MonthsStandalone]],t);return tu(r,i)}(t,r,n)[e.getMonth()];case cu.Days:return function(e,t,i){const n=ia(e),r=tu([n[ra.DaysFormat],n[ra.DaysStandalone]],t);return tu(r,i)}(t,r,n)[e.getDay()];case cu.DayPeriods:const o=e.getHours(),a=e.getMinutes();if(s){const e=function(e){const t=ia(e);return eu(t),(t[ra.ExtraData][2]||[]).map(e=>"string"==typeof e?iu(e):[iu(e[0]),iu(e[1])])}(t),i=function(e,t,i){const n=ia(e);eu(n);const r=tu([n[ra.ExtraData][0],n[ra.ExtraData][1]],t)||[];return tu(r,i)||[]}(t,r,n),s=e.findIndex(e=>{if(Array.isArray(e)){const[t,i]=e,n=o>=t.hours&&a>=t.minutes,r=o<i.hours||o===i.hours&&a<i.minutes;if(t.hours<i.hours){if(n&&r)return!0}else if(n||r)return!0}else if(e.hours===o&&e.minutes===a)return!0;return!1});if(-1!==s)return i[s]}return function(e,t,i){const n=ia(e),r=tu([n[ra.DayPeriodsFormat],n[ra.DayPeriodsStandalone]],t);return tu(r,i)}(t,r,n)[o<12?0:1];case cu.Eras:return function(e,t){return tu(ia(e)[ra.Eras],t)}(t,n)[e.getFullYear()<=0?0:1];default:throw new Error("unexpected translation type "+i)}}(r,s,e,t,i,n)}}function gu(e){return function(t,i,n){const r=-1*n,s=Jl(i,Zl.MinusSign),o=r>0?Math.floor(r/60):Math.ceil(r/60);switch(e){case ou.Short:return(r>=0?"+":"")+hu(o,2,s)+hu(Math.abs(r%60),2,s);case ou.ShortGMT:return"GMT"+(r>=0?"+":"")+hu(o,1,s);case ou.Long:return"GMT"+(r>=0?"+":"")+hu(o,2,s)+":"+hu(Math.abs(r%60),2,s);case ou.Extended:return 0===n?"Z":(r>=0?"+":"")+hu(o,2,s)+":"+hu(Math.abs(r%60),2,s);default:throw new Error(`Unknown zone width "${e}"`)}}}function fu(e){return uu(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function _u(e,t=!1){return function(i,n){let r;if(t){const e=new Date(i.getFullYear(),i.getMonth(),1).getDay()-1,t=i.getDate();r=1+Math.floor((t+e)/7)}else{const e=fu(i),t=function(e){const t=uu(e,0,1).getDay();return uu(e,0,1+(t<=4?4:11)-t)}(e.getFullYear()),n=e.getTime()-t.getTime();r=1+Math.round(n/6048e5)}return hu(r,e,Jl(n,Zl.MinusSign))}}function vu(e,t=!1){return function(i,n){return hu(fu(i).getFullYear(),e,Jl(n,Zl.MinusSign),t)}}const bu={};function yu(e,t){e=e.replace(/:/g,"");const i=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(i)?t:i}function wu(e){return e instanceof Date&&!isNaN(e.valueOf())}const ku=/^(\d+)?\.((\d+)(-(\d+))?)?$/;function Cu(e,t,i,n,r,s,o=!1){let a="",c=!1;if(isFinite(e)){let l=function(e){let t,i,n,r,s,o=Math.abs(e)+"",a=0;for((i=o.indexOf("."))>-1&&(o=o.replace(".","")),(n=o.search(/e/i))>0?(i<0&&(i=n),i+=+o.slice(n+1),o=o.substring(0,n)):i<0&&(i=o.length),n=0;"0"===o.charAt(n);n++);if(n===(s=o.length))t=[0],i=1;else{for(s--;"0"===o.charAt(s);)s--;for(i-=n,t=[],r=0;n<=s;n++,r++)t[r]=Number(o.charAt(n))}return i>22&&(t=t.splice(0,21),a=i-1,i=1),{digits:t,exponent:a,integerLen:i}}(e);o&&(l=function(e){if(0===e.digits[0])return e;const t=e.digits.length-e.integerLen;return e.exponent?e.exponent+=2:(0===t?e.digits.push(0,0):1===t&&e.digits.push(0),e.integerLen+=2),e}(l));let u=t.minInt,d=t.minFrac,h=t.maxFrac;if(s){const e=s.match(ku);if(null===e)throw new Error(s+" is not a valid digit info");const t=e[1],i=e[3],n=e[5];null!=t&&(u=xu(t)),null!=i&&(d=xu(i)),null!=n?h=xu(n):null!=i&&d>h&&(h=d)}!function(e,t,i){if(t>i)throw new Error(`The minimum number of digits after fraction (${t}) is higher than the maximum (${i}).`);let n=e.digits,r=n.length-e.integerLen;const s=Math.min(Math.max(t,r),i);let o=s+e.integerLen,a=n[o];if(o>0){n.splice(Math.max(e.integerLen,o));for(let e=o;e<n.length;e++)n[e]=0}else{r=Math.max(0,r),e.integerLen=1,n.length=Math.max(1,o=s+1),n[0]=0;for(let e=1;e<o;e++)n[e]=0}if(a>=5)if(o-1<0){for(let t=0;t>o;t--)n.unshift(0),e.integerLen++;n.unshift(1),e.integerLen++}else n[o-1]++;for(;r<Math.max(0,s);r++)n.push(0);let c=0!==s;const l=t+e.integerLen,u=n.reduceRight((function(e,t,i,n){return n[i]=(t+=e)<10?t:t-10,c&&(0===n[i]&&i>=l?n.pop():c=!1),t>=10?1:0}),0);u&&(n.unshift(u),e.integerLen++)}(l,d,h);let p=l.digits,m=l.integerLen;const g=l.exponent;let f=[];for(c=p.every(e=>!e);m<u;m++)p.unshift(0);for(;m<0;m++)p.unshift(0);m>0?f=p.splice(m,p.length):(f=p,p=[0]);const _=[];for(p.length>=t.lgSize&&_.unshift(p.splice(-t.lgSize,p.length).join(""));p.length>t.gSize;)_.unshift(p.splice(-t.gSize,p.length).join(""));p.length&&_.unshift(p.join("")),a=_.join(Jl(i,n)),f.length&&(a+=Jl(i,r)+f.join("")),g&&(a+=Jl(i,Zl.Exponential)+"+"+g)}else a=Jl(i,Zl.Infinity);return a=e<0&&!c?t.negPre+a+t.negSuf:t.posPre+a+t.posSuf,a}function Su(e,t="-"){const i={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},n=e.split(";"),r=n[0],s=n[1],o=-1!==r.indexOf(".")?r.split("."):[r.substring(0,r.lastIndexOf("0")+1),r.substring(r.lastIndexOf("0")+1)],a=o[0],c=o[1]||"";i.posPre=a.substr(0,a.indexOf("#"));for(let u=0;u<c.length;u++){const e=c.charAt(u);"0"===e?i.minFrac=i.maxFrac=u+1:"#"===e?i.maxFrac=u+1:i.posSuf+=e}const l=a.split(",");if(i.gSize=l[1]?l[1].length:0,i.lgSize=l[2]||l[1]?(l[2]||l[1]).length:0,s){const e=r.length-i.posPre.length-i.posSuf.length,t=s.indexOf("#");i.negPre=s.substr(0,t).replace(/'/g,""),i.negSuf=s.substr(t+e).replace(/'/g,"")}else i.negPre=t+i.posPre,i.negSuf=i.posSuf;return i}function xu(e){const t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t}class Eu{}let Iu=(()=>{class e extends Eu{constructor(e){super(),this.locale=e}getPluralCategory(e,t){switch(function(e){return ia(e)[ra.PluralCase]}(t||this.locale)(e)){case Ul.Zero:return"zero";case Ul.One:return"one";case Ul.Two:return"two";case Ul.Few:return"few";case Ul.Many:return"many";default:return"other"}}}return e.\u0275fac=function(t){return new(t||e)(nn(nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();function Pu(e,t){t=encodeURIComponent(t);for(const i of e.split(";")){const e=i.indexOf("="),[n,r]=-1==e?[i,""]:[i.slice(0,e),i.slice(e+1)];if(n.trim()===t)return decodeURIComponent(r)}return null}let Du=(()=>{class e{constructor(e,t,i,n){this._iterableDiffers=e,this._keyValueDiffers=t,this._ngEl=i,this._renderer=n,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(e){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(e){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(co(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){const e=this._keyValueDiffer.diff(this._rawClass);e&&this._applyKeyValueChanges(e)}}_applyKeyValueChanges(e){e.forEachAddedItem(e=>this._toggleClass(e.key,e.currentValue)),e.forEachChangedItem(e=>this._toggleClass(e.key,e.currentValue)),e.forEachRemovedItem(e=>{e.previousValue&&this._toggleClass(e.key,!1)})}_applyIterableChanges(e){e.forEachAddedItem(e=>{if("string"!=typeof e.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+te(e.item));this._toggleClass(e.item,!0)}),e.forEachRemovedItem(e=>this._toggleClass(e.item,!1))}_applyClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach(e=>this._toggleClass(e,!0)):Object.keys(e).forEach(t=>this._toggleClass(t,!!e[t])))}_removeClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach(e=>this._toggleClass(e,!1)):Object.keys(e).forEach(e=>this._toggleClass(e,!1)))}_toggleClass(e,t){(e=e.trim())&&e.split(/\s+/g).forEach(e=>{t?this._renderer.addClass(this._ngEl.nativeElement,e):this._renderer.removeClass(this._ngEl.nativeElement,e)})}}return e.\u0275fac=function(t){return new(t||e)(vo(za),vo(Va),vo(wa),vo(Sa))},e.\u0275dir=Qe({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),e})();class Tu{constructor(e,t,i,n){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=n}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Au=(()=>{class e{constructor(e,t,i){this._viewContainer=e,this._template=t,this._differs=i,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const i=this._ngForOf;if(!this._differ&&i)try{this._differ=this._differs.find(i).create(this.ngForTrackBy)}catch(t){throw new Error(`Cannot find a differ supporting object '${i}' of type '${e=i,e.name||typeof e}'. NgFor only supports binding to Iterables such as Arrays.`)}}var e;if(this._differ){const e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){const t=[];e.forEachOperation((e,i,n)=>{if(null==e.previousIndex){const i=this._viewContainer.createEmbeddedView(this._template,new Tu(null,this._ngForOf,-1,-1),null===n?void 0:n),r=new Ru(e,i);t.push(r)}else if(null==n)this._viewContainer.remove(null===i?void 0:i);else if(null!==i){const r=this._viewContainer.get(i);this._viewContainer.move(r,n);const s=new Ru(e,r);t.push(s)}});for(let i=0;i<t.length;i++)this._perViewChange(t[i].view,t[i].record);for(let i=0,n=this._viewContainer.length;i<n;i++){const e=this._viewContainer.get(i);e.context.index=i,e.context.count=n,e.context.ngForOf=this._ngForOf}e.forEachIdentityChange(e=>{this._viewContainer.get(e.currentIndex).context.$implicit=e.item})}_perViewChange(e,t){e.context.$implicit=t.item}static ngTemplateContextGuard(e,t){return!0}}return e.\u0275fac=function(t){return new(t||e)(vo(rc),vo(Ja),vo(za))},e.\u0275dir=Qe({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),e})();class Ru{constructor(e,t){this.record=e,this.view=t}}let Ou=(()=>{class e{constructor(e,t){this._viewContainer=e,this._context=new Fu,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=t}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){Bu("ngIfThen",e),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){Bu("ngIfElse",e),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(e,t){return!0}}return e.\u0275fac=function(t){return new(t||e)(vo(rc),vo(Ja))},e.\u0275dir=Qe({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),e})();class Fu{constructor(){this.$implicit=null,this.ngIf=null}}function Bu(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${te(t)}'.`)}class Mu{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Lu=(()=>{class e{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(e){this._ngSwitch=e,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(e){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(e)}_matchCase(e){const t=e==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||t,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),t}_updateDefaultCases(e){if(this._defaultViews&&e!==this._defaultUsed){this._defaultUsed=e;for(let t=0;t<this._defaultViews.length;t++)this._defaultViews[t].enforceState(e)}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Qe({type:e,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}}),e})(),$u=(()=>{class e{constructor(e,t,i){this.ngSwitch=i,i._addCase(),this._view=new Mu(e,t)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return e.\u0275fac=function(t){return new(t||e)(vo(rc),vo(Ja),vo(Lu,9))},e.\u0275dir=Qe({type:e,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),e})(),ju=(()=>{class e{constructor(e,t,i){i._addDefault(new Mu(e,t))}}return e.\u0275fac=function(t){return new(t||e)(vo(rc),vo(Ja),vo(Lu,9))},e.\u0275dir=Qe({type:e,selectors:[["","ngSwitchDefault",""]]}),e})(),zu=(()=>{class e{constructor(e,t,i){this._ngEl=e,this._differs=t,this._renderer=i,this._ngStyle=null,this._differ=null}set ngStyle(e){this._ngStyle=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())}ngDoCheck(){if(this._differ){const e=this._differ.diff(this._ngStyle);e&&this._applyChanges(e)}}_setStyle(e,t){const[i,n]=e.split(".");null!=(t=null!=t&&n?`${t}${n}`:t)?this._renderer.setStyle(this._ngEl.nativeElement,i,t):this._renderer.removeStyle(this._ngEl.nativeElement,i)}_applyChanges(e){e.forEachRemovedItem(e=>this._setStyle(e.key,null)),e.forEachAddedItem(e=>this._setStyle(e.key,e.currentValue)),e.forEachChangedItem(e=>this._setStyle(e.key,e.currentValue))}}return e.\u0275fac=function(t){return new(t||e)(vo(wa),vo(Va),vo(Sa))},e.\u0275dir=Qe({type:e,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),e})(),Nu=(()=>{class e{constructor(e){this._viewContainerRef=e,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(e){if(this._shouldRecreateView(e)){const e=this._viewContainerRef;this._viewRef&&e.remove(e.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?e.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&this.ngTemplateOutletContext&&this._updateExistingContext(this.ngTemplateOutletContext)}_shouldRecreateView(e){const t=e.ngTemplateOutletContext;return!!e.ngTemplateOutlet||t&&this._hasContextShapeChanged(t)}_hasContextShapeChanged(e){const t=Object.keys(e.previousValue||{}),i=Object.keys(e.currentValue||{});if(t.length===i.length){for(let e of i)if(-1===t.indexOf(e))return!0;return!1}return!0}_updateExistingContext(e){for(let t of Object.keys(e))this._viewRef.context[t]=this.ngTemplateOutletContext[t]}}return e.\u0275fac=function(t){return new(t||e)(vo(rc))},e.\u0275dir=Qe({type:e,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[at]}),e})();function Vu(e,t){return Error(`InvalidPipeArgument: '${t}' for pipe '${te(e)}'`)}class Hu{createSubscription(e,t){return e.subscribe({next:t,error:e=>{throw e}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Uu{createSubscription(e,t){return e.then(t,e=>{throw e})}dispose(e){}onDestroy(e){}}const qu=new Uu,Gu=new Hu;let Wu=(()=>{class e{constructor(e){this._ref=e,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(e){return this._obj?e!==this._obj?(this._dispose(),this.transform(e)):this._latestValue:(e&&this._subscribe(e),this._latestValue)}_subscribe(e){this._obj=e,this._strategy=this._selectStrategy(e),this._subscription=this._strategy.createSubscription(e,t=>this._updateLatestValue(e,t))}_selectStrategy(t){if(Po(t))return qu;if(Do(t))return Gu;throw Vu(e,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(e,t){e===this._obj&&(this._latestValue=t,this._ref.markForCheck())}}return e.\u0275fac=function(t){return new(t||e)(function(e=ye.Default){const t=Wa(!0);if(null!=t||e&ye.Optional)return t;ue("ChangeDetectorRef")}())},e.\u0275pipe=Ye({name:"async",type:e,pure:!1}),e})();const Zu=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])\S*/g;let Qu=(()=>{class e{transform(t){if(null==t)return null;if("string"!=typeof t)throw Vu(e,t);return t.replace(Zu,e=>e[0].toUpperCase()+e.substr(1).toLowerCase())}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=Ye({name:"titlecase",type:e,pure:!0}),e})(),Yu=(()=>{class e{constructor(e){this._locale=e}transform(t,i,n){if(!Ju(t))return null;n=n||this._locale;try{return function(e,t,i){return Cu(e,Su(Xl(t,Hl.Decimal),Jl(t,Zl.MinusSign)),t,Zl.Group,Zl.Decimal,i)}(Xu(t),n,i)}catch(r){throw Vu(e,r.message)}}}return e.\u0275fac=function(t){return new(t||e)(vo(nl))},e.\u0275pipe=Ye({name:"number",type:e,pure:!0}),e})(),Ku=(()=>{class e{constructor(e,t="USD"){this._locale=e,this._defaultCurrencyCode=t}transform(t,i,n="symbol",r,s){if(!Ju(t))return null;s=s||this._locale,"boolean"==typeof n&&(n=n?"symbol":"code");let o=i||this._defaultCurrencyCode;"code"!==n&&(o="symbol"===n||"symbol-narrow"===n?function(e,t,i="en"){const n=function(e){return ia(e)[ra.Currencies]}(i)[e]||Vl[e]||[],r=n[1];return"narrow"===t&&"string"==typeof r?r:n[0]||e}(o,"symbol"===n?"wide":"narrow",s):n);try{return function(e,t,i,n,r){const s=Su(Xl(t,Hl.Currency),Jl(t,Zl.MinusSign));return s.minFrac=function(e){let t;const i=Vl[e];return i&&(t=i[2]),"number"==typeof t?t:2}(n),s.maxFrac=s.minFrac,Cu(e,s,t,Zl.CurrencyGroup,Zl.CurrencyDecimal,r).replace("\xa4",i).replace("\xa4","").trim()}(Xu(t),s,o,i,r)}catch(a){throw Vu(e,a.message)}}}return e.\u0275fac=function(t){return new(t||e)(vo(nl),vo(rl))},e.\u0275pipe=Ye({name:"currency",type:e,pure:!0}),e})();function Ju(e){return!(null==e||""===e||e!=e)}function Xu(e){if("string"==typeof e&&!isNaN(Number(e)-parseFloat(e)))return Number(e);if("number"!=typeof e)throw new Error(e+" is not a number");return e}let ed=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[{provide:Eu,useClass:Iu}]}),e})();function td(...e){let t=e[e.length-1];return x(t)?(e.pop(),B(e,t)):U(e)}function id(e,t){return function(i){return i.lift(new nd(e,t))}}class nd{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new rd(e,this.predicate,this.thisArg))}}class rd extends m{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}class sd{}class od{}class ad{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(e=>{const t=e.indexOf(":");if(t>0){const i=e.slice(0,t),n=i.toLowerCase(),r=e.slice(t+1).trim();this.maybeSetNormalizedName(i,n),this.headers.has(n)?this.headers.get(n).push(r):this.headers.set(n,[r])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const n=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(n,i),this.maybeSetNormalizedName(t,n))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof ad?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new ad;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof ad?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const n=("a"===e.op?this.headers.get(t):void 0)||[];n.push(...i),this.headers.set(t,n);break;case"d":const r=e.value;if(r){let e=this.headers.get(t);if(!e)return;e=e.filter(e=>-1===r.indexOf(e)),0===e.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,e)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class cd{encodeKey(e){return ld(e)}encodeValue(e){return ld(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}function ld(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class ud{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new cd,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(e,t){const i=new Map;return e.length>0&&e.replace(/^\?/,"").split("&").forEach(e=>{const n=e.indexOf("="),[r,s]=-1==n?[t.decodeKey(e),""]:[t.decodeKey(e.slice(0,n)),t.decodeValue(e.slice(n+1))],o=i.get(r)||[];o.push(s),i.set(r,o)}),i}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const n=e[i];Array.isArray(n)?n.forEach(e=>{t.push({param:i,value:e,op:"a"})}):t.push({param:i,value:n,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(e=>t+"="+this.encoder.encodeValue(e)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new ud({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(e.value),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let t=this.map.get(e.param)||[];const i=t.indexOf(e.value);-1!==i&&t.splice(i,1),t.length>0?this.map.set(e.param,t):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}function dd(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function hd(e){return"undefined"!=typeof Blob&&e instanceof Blob}function pd(e){return"undefined"!=typeof FormData&&e instanceof FormData}class md{constructor(e,t,i,n){let r;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||n?(this.body=void 0!==i?i:null,r=n):r=i,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.params&&(this.params=r.params)),this.headers||(this.headers=new ad),this.params){const e=this.params.toString();if(0===e.length)this.urlWithParams=t;else{const i=t.indexOf("?");this.urlWithParams=t+(-1===i?"?":i<t.length-1?"&":"")+e}}else this.params=new ud,this.urlWithParams=t}serializeBody(){return null===this.body?null:dd(this.body)||hd(this.body)||pd(this.body)||"string"==typeof this.body?this.body:this.body instanceof ud?this.body.toString():"object"==typeof this.body||"boolean"==typeof this.body||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return null===this.body||pd(this.body)?null:hd(this.body)?this.body.type||null:dd(this.body)?null:"string"==typeof this.body?"text/plain":this.body instanceof ud?"application/x-www-form-urlencoded;charset=UTF-8":"object"==typeof this.body||"number"==typeof this.body||"boolean"==typeof this.body?"application/json":null}clone(e={}){const t=e.method||this.method,i=e.url||this.url,n=e.responseType||this.responseType,r=void 0!==e.body?e.body:this.body,s=void 0!==e.withCredentials?e.withCredentials:this.withCredentials,o=void 0!==e.reportProgress?e.reportProgress:this.reportProgress;let a=e.headers||this.headers,c=e.params||this.params;return void 0!==e.setHeaders&&(a=Object.keys(e.setHeaders).reduce((t,i)=>t.set(i,e.setHeaders[i]),a)),e.setParams&&(c=Object.keys(e.setParams).reduce((t,i)=>t.set(i,e.setParams[i]),c)),new md(t,i,r,{params:c,headers:a,reportProgress:o,responseType:n,withCredentials:s})}}var gd=function(e){return e[e.Sent=0]="Sent",e[e.UploadProgress=1]="UploadProgress",e[e.ResponseHeader=2]="ResponseHeader",e[e.DownloadProgress=3]="DownloadProgress",e[e.Response=4]="Response",e[e.User=5]="User",e}({});class fd{constructor(e,t=200,i="OK"){this.headers=e.headers||new ad,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class _d extends fd{constructor(e={}){super(e),this.type=gd.ResponseHeader}clone(e={}){return new _d({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class vd extends fd{constructor(e={}){super(e),this.type=gd.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new vd({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class bd extends fd{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?"Http failure during parsing for "+(e.url||"(unknown url)"):`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function yd(e,t){return{body:t,headers:e.headers,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}let wd=(()=>{class e{constructor(e){this.handler=e}request(e,t,i={}){let n;if(e instanceof md)n=e;else{let r=void 0;r=i.headers instanceof ad?i.headers:new ad(i.headers);let s=void 0;i.params&&(s=i.params instanceof ud?i.params:new ud({fromObject:i.params})),n=new md(e,t,void 0!==i.body?i.body:null,{headers:r,params:s,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials})}const r=td(n).pipe(z(e=>this.handler.handle(e),void 0,1));if(e instanceof md||"events"===i.observe)return r;const s=r.pipe(id(e=>e instanceof vd));switch(i.observe||"body"){case"body":switch(n.responseType){case"arraybuffer":return s.pipe(E(e=>{if(null!==e.body&&!(e.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return e.body}));case"blob":return s.pipe(E(e=>{if(null!==e.body&&!(e.body instanceof Blob))throw new Error("Response is not a Blob.");return e.body}));case"text":return s.pipe(E(e=>{if(null!==e.body&&"string"!=typeof e.body)throw new Error("Response is not a string.");return e.body}));case"json":default:return s.pipe(E(e=>e.body))}case"response":return s;default:throw new Error(`Unreachable: unhandled observe type ${i.observe}}`)}}delete(e,t={}){return this.request("DELETE",e,t)}get(e,t={}){return this.request("GET",e,t)}head(e,t={}){return this.request("HEAD",e,t)}jsonp(e,t){return this.request("JSONP",e,{params:(new ud).append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,t={}){return this.request("OPTIONS",e,t)}patch(e,t,i={}){return this.request("PATCH",e,yd(i,t))}post(e,t,i={}){return this.request("POST",e,yd(i,t))}put(e,t,i={}){return this.request("PUT",e,yd(i,t))}}return e.\u0275fac=function(t){return new(t||e)(nn(sd))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();class kd{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const Cd=new Vi("HTTP_INTERCEPTORS");let Sd=(()=>{class e{intercept(e,t){return t.handle(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const xd=/^\)\]\}',?\n/;class Ed{}let Id=(()=>{class e{constructor(){}build(){return new XMLHttpRequest}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Pd=(()=>{class e{constructor(e){this.xhrFactory=e}handle(e){if("JSONP"===e.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new v(t=>{const i=this.xhrFactory.build();if(i.open(e.method,e.urlWithParams),e.withCredentials&&(i.withCredentials=!0),e.headers.forEach((e,t)=>i.setRequestHeader(e,t.join(","))),e.headers.has("Accept")||i.setRequestHeader("Accept","application/json, text/plain, */*"),!e.headers.has("Content-Type")){const t=e.detectContentTypeHeader();null!==t&&i.setRequestHeader("Content-Type",t)}if(e.responseType){const t=e.responseType.toLowerCase();i.responseType="json"!==t?t:"text"}const n=e.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const t=1223===i.status?204:i.status,n=i.statusText||"OK",s=new ad(i.getAllResponseHeaders()),o=function(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(i)||e.url;return r=new _d({headers:s,status:t,statusText:n,url:o}),r},o=()=>{let{headers:n,status:r,statusText:o,url:a}=s(),c=null;204!==r&&(c=void 0===i.response?i.responseText:i.response),0===r&&(r=c?200:0);let l=r>=200&&r<300;if("json"===e.responseType&&"string"==typeof c){const e=c;c=c.replace(xd,"");try{c=""!==c?JSON.parse(c):null}catch(u){c=e,l&&(l=!1,c={error:u,text:c})}}l?(t.next(new vd({body:c,headers:n,status:r,statusText:o,url:a||void 0})),t.complete()):t.error(new bd({error:c,headers:n,status:r,statusText:o,url:a||void 0}))},a=e=>{const{url:n}=s(),r=new bd({error:e,status:i.status||0,statusText:i.statusText||"Unknown Error",url:n||void 0});t.error(r)};let c=!1;const l=n=>{c||(t.next(s()),c=!0);let r={type:gd.DownloadProgress,loaded:n.loaded};n.lengthComputable&&(r.total=n.total),"text"===e.responseType&&i.responseText&&(r.partialText=i.responseText),t.next(r)},u=e=>{let i={type:gd.UploadProgress,loaded:e.loaded};e.lengthComputable&&(i.total=e.total),t.next(i)};return i.addEventListener("load",o),i.addEventListener("error",a),i.addEventListener("timeout",a),i.addEventListener("abort",a),e.reportProgress&&(i.addEventListener("progress",l),null!==n&&i.upload&&i.upload.addEventListener("progress",u)),i.send(n),t.next({type:gd.Sent}),()=>{i.removeEventListener("error",a),i.removeEventListener("abort",a),i.removeEventListener("load",o),i.removeEventListener("timeout",a),e.reportProgress&&(i.removeEventListener("progress",l),null!==n&&i.upload&&i.upload.removeEventListener("progress",u)),i.readyState!==i.DONE&&i.abort()}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Ed))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const Dd=new Vi("XSRF_COOKIE_NAME"),Td=new Vi("XSRF_HEADER_NAME");class Ad{}let Rd=(()=>{class e{constructor(e,t,i){this.doc=e,this.platform=t,this.cookieName=i,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=Pu(e,this.cookieName),this.lastCookieString=e),this.lastToken}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl),nn(el),nn(Dd))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Od=(()=>{class e{constructor(e,t){this.tokenService=e,this.headerName=t}intercept(e,t){const i=e.url.toLowerCase();if("GET"===e.method||"HEAD"===e.method||i.startsWith("http://")||i.startsWith("https://"))return t.handle(e);const n=this.tokenService.getToken();return null===n||e.headers.has(this.headerName)||(e=e.clone({headers:e.headers.set(this.headerName,n)})),t.handle(e)}}return e.\u0275fac=function(t){return new(t||e)(nn(Ad),nn(Td))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Fd=(()=>{class e{constructor(e,t){this.backend=e,this.injector=t,this.chain=null}handle(e){if(null===this.chain){const e=this.injector.get(Cd,[]);this.chain=e.reduceRight((e,t)=>new kd(e,t),this.backend)}return this.chain.handle(e)}}return e.\u0275fac=function(t){return new(t||e)(nn(od),nn(Js))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Bd=(()=>{class e{static disable(){return{ngModule:e,providers:[{provide:Od,useClass:Sd}]}}static withOptions(t={}){return{ngModule:e,providers:[t.cookieName?{provide:Dd,useValue:t.cookieName}:[],t.headerName?{provide:Td,useValue:t.headerName}:[]]}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[Od,{provide:Cd,useExisting:Od,multi:!0},{provide:Ad,useClass:Rd},{provide:Dd,useValue:"XSRF-TOKEN"},{provide:Td,useValue:"X-XSRF-TOKEN"}]}),e})(),Md=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[wd,{provide:sd,useClass:Fd},Pd,{provide:od,useExisting:Pd},Id,{provide:Ed,useExisting:Id}],imports:[[Bd.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),e})();var Ld=i("6Wo6"),$d=i.n(Ld);class jd extends d{constructor(e,t){super()}schedule(e,t=0){return this}}class zd extends jd{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,n=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(n,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let i=!1,n=void 0;try{this.work(e)}catch(r){i=!0,n=!!r&&r||new Error(r)}if(i)return this.unsubscribe(),n}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,n=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&i.splice(n,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}class Nd extends zd{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}let Vd=(()=>{class e{constructor(t,i=e.now){this.SchedulerAction=t,this.now=i}schedule(e,t=0,i){return new this.SchedulerAction(this,e).schedule(i,t)}}return e.now=()=>Date.now(),e})();class Hd extends Vd{constructor(e,t=Vd.now){super(e,()=>Hd.delegate&&Hd.delegate!==this?Hd.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Hd.delegate&&Hd.delegate!==this?Hd.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}class Ud extends Hd{}const qd=new Ud(Nd),Gd=new v(e=>e.complete());function Wd(e){return e?function(e){return new v(t=>e.schedule(()=>t.complete()))}(e):Gd}function Zd(e,t){return new v(t?i=>t.schedule(Qd,0,{error:e,subscriber:i}):t=>t.error(e))}function Qd({error:e,subscriber:t}){t.error(e)}let Yd=(()=>{class e{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return td(this.value);case"E":return Zd(this.error);case"C":return Wd()}throw new Error("unexpected notification kind value")}static createNext(t){return void 0!==t?new e("N",t):e.undefinedValueNotification}static createError(t){return new e("E",void 0,t)}static createComplete(){return e.completeNotification}}return e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e})();class Kd extends m{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(Kd.dispatch,this.delay,new Jd(e,this.destination)))}_next(e){this.scheduleMessage(Yd.createNext(e))}_error(e){this.scheduleMessage(Yd.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(Yd.createComplete()),this.unsubscribe()}}class Jd{constructor(e,t){this.notification=e,this.destination=t}}class Xd extends C{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new eh(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),n=this.scheduler,r=i.length;let s;if(this.closed)throw new y;if(this.isStopped||this.hasError?s=d.EMPTY:(this.observers.push(e),s=new w(this,e)),n&&e.add(e=new Kd(e,n)),t)for(let o=0;o<r&&!e.closed;o++)e.next(i[o]);else for(let o=0;o<r&&!e.closed;o++)e.next(i[o].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),s}_getNow(){return(this.scheduler||qd).now()}_trimBufferThenGetEvents(){const e=this._getNow(),t=this._bufferSize,i=this._windowTime,n=this._events,r=n.length;let s=0;for(;s<r&&!(e-n[s].time<i);)s++;return r>t&&(s=Math.max(s,r-t)),s>0&&n.splice(0,s),n}}class eh{constructor(e,t){this.time=e,this.value=t}}function th(e,t){return"function"==typeof t?i=>i.pipe(th((i,n)=>M(e(i,n)).pipe(E((e,r)=>t(i,e,n,r))))):t=>t.lift(new ih(e))}class ih{constructor(e){this.project=e}call(e,t){return t.subscribe(new nh(e,this.project))}}class nh extends ${constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(n){return void this.destination.error(n)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new L(this),n=this.destination;n.add(i),this.innerSubscription=j(e,i),this.innerSubscription!==i&&n.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;e&&!e.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const rh={schedule(e,t){const i=setTimeout(e,t);return()=>clearTimeout(i)},scheduleBeforeRender(e){if("undefined"==typeof window)return rh.schedule(e,0);if(void 0===window.requestAnimationFrame)return rh.schedule(e,16);const t=window.requestAnimationFrame(e);return()=>window.cancelAnimationFrame(t)}};let sh;function oh(e,t,i){let n=i;return function(e){return!!e&&e.nodeType===Node.ELEMENT_NODE}(e)&&t.some((t,i)=>!("*"===t||!function(e,t){if(!sh){const e=Element.prototype;sh=e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}return e.nodeType===Node.ELEMENT_NODE&&sh.call(e,t)}(e,t)||(n=i,0))),n}class ah{constructor(e,t){this.componentFactory=t.get(_a).resolveComponentFactory(e)}create(e){return new ch(this.componentFactory,e)}}class ch{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new Xd(1),this.events=this.eventEmitters.pipe(th(e=>q(...e))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:e})=>e)),this.ngZone=this.injector.get(gl),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null!==this.componentRef&&null===this.scheduledDestroyFn&&(this.scheduledDestroyFn=rh.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{var i,n;null!==this.componentRef?((i=t)!==(n=this.getInputValue(e))&&(i==i||n==n)||void 0===t&&this.unchangedInputs.has(e))&&(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=Js.create({providers:[],parent:this.injector}),i=function(e,t){const i=e.childNodes,n=t.map(()=>[]);let r=-1;t.some((e,t)=>"*"===e&&(r=t,!0));for(let s=0,o=i.length;s<o;++s){const e=i[s],o=oh(e,t,r);-1!==o&&n[o].push(e)}return n}(e,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(t,i,e),this.viewChangeDetectorRef=this.componentRef.injector.get(Ga),this.implementsOnChanges="function"==typeof this.componentRef.instance.ngOnChanges,this.initializeInputs(),this.initializeOutputs(this.componentRef),this.detectChanges(),this.injector.get(Fl).attachView(this.componentRef.hostView)}initializeInputs(){this.componentFactory.inputs.forEach(({propName:e})=>{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:t,templateName:i})=>e.instance[t].pipe(E(e=>({name:i,value:e}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=rh.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const n=this.unchangedInputs.has(e),r=n?void 0:this.getInputValue(e);this.inputChanges[e]=new ot(r,t,n)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class lh extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function uh(e,t){const i=function(e,t){return t.get(_a).resolveComponentFactory(e).inputs}(e,t.injector),n=t.strategyFactory||new ah(e,t.injector),r=function(e){const t={};return e.forEach(({propName:e,templateName:i})=>{var n;t[(n=i,n.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()))]=e}),t}(i);class s extends lh{constructor(e){super(),this.injector=e}get ngElementStrategy(){if(!this._ngElementStrategy){const e=this._ngElementStrategy=n.create(this.injector||t.injector);i.forEach(({propName:t})=>{if(!this.hasOwnProperty(t))return;const i=this[t];delete this[t],e.setInputValue(t,i)})}return this._ngElementStrategy}attributeChangedCallback(e,t,i,n){this.ngElementStrategy.setInputValue(r[e],i)}connectedCallback(){let e=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),e=!0),this.ngElementStrategy.connect(this),e||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(e=>{const t=function(e,t,i){if("function"!=typeof CustomEvent){const n=e.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,i),n}return new CustomEvent(t,{bubbles:!1,cancelable:!1,detail:i})}(this.ownerDocument,e.name,e.value);this.dispatchEvent(t)})}}return s.observedAttributes=Object.keys(r),i.forEach(({propName:e})=>{Object.defineProperty(s.prototype,e,{get(){return this.ngElementStrategy.getInputValue(e)},set(t){this.ngElementStrategy.setInputValue(e,t)},configurable:!0,enumerable:!0})}),s}class dh extends class extends class{}{constructor(){super()}supportsDOMEvents(){return!0}}{static makeCurrent(){var e;e=new dh,jl||(jl=e)}getProperty(e,t){return e[t]}log(e){window.console&&window.console.log&&window.console.log(e)}logGroup(e){window.console&&window.console.group&&window.console.group(e)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){return e.parentNode&&e.parentNode.removeChild(e),e}getValue(e){return e.value}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(e){const t=ph||(ph=document.querySelector("base"),ph)?ph.getAttribute("href"):null;return null==t?null:(i=t,hh||(hh=document.createElement("a")),hh.setAttribute("href",i),"/"===hh.pathname.charAt(0)?hh.pathname:"/"+hh.pathname);var i}resetBaseElement(){ph=null}getUserAgent(){return window.navigator.userAgent}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(e){return Pu(document.cookie,e)}}let hh,ph=null;const mh=new Vi("TRANSITION_ID"),gh=[{provide:Zc,useFactory:function(e,t,i){return()=>{i.get(Qc).donePromise.then(()=>{const i=zl();Array.prototype.slice.apply(t.querySelectorAll("style[ng-transition]")).filter(t=>t.getAttribute("ng-transition")===e).forEach(e=>i.remove(e))})}},deps:[mh,Nl,Js],multi:!0}];class fh{static init(){var e;e=new fh,El=e}addToWindow(e){Ae.getAngularTestability=(t,i=!0)=>{const n=e.findTestabilityInTree(t,i);if(null==n)throw new Error("Could not find testability for element.");return n},Ae.getAllAngularTestabilities=()=>e.getAllTestabilities(),Ae.getAllAngularRootElements=()=>e.getAllRootElements(),Ae.frameworkStabilizers||(Ae.frameworkStabilizers=[]),Ae.frameworkStabilizers.push(e=>{const t=Ae.getAllAngularTestabilities();let i=t.length,n=!1;const r=function(t){n=n||t,i--,0==i&&e(n)};t.forEach((function(e){e.whenStable(r)}))})}findTestabilityInTree(e,t,i){if(null==t)return null;const n=e.getTestability(t);return null!=n?n:i?zl().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}const _h=new Vi("EventManagerPlugins");let vh=(()=>{class e{constructor(e,t){this._zone=t,this._eventNameToPlugin=new Map,e.forEach(e=>e.manager=this),this._plugins=e.slice().reverse()}addEventListener(e,t,i){return this._findPluginFor(t).addEventListener(e,t,i)}addGlobalEventListener(e,t,i){return this._findPluginFor(t).addGlobalEventListener(e,t,i)}getZone(){return this._zone}_findPluginFor(e){const t=this._eventNameToPlugin.get(e);if(t)return t;const i=this._plugins;for(let n=0;n<i.length;n++){const t=i[n];if(t.supports(e))return this._eventNameToPlugin.set(e,t),t}throw new Error("No event manager plugin found for event "+e)}}return e.\u0275fac=function(t){return new(t||e)(nn(_h),nn(gl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();class bh{constructor(e){this._doc=e}addGlobalEventListener(e,t,i){const n=zl().getGlobalEventTarget(this._doc,e);if(!n)throw new Error(`Unsupported event target ${n} for event ${t}`);return this.addEventListener(n,t,i)}}let yh=(()=>{class e{constructor(){this._stylesSet=new Set}addStyles(e){const t=new Set;e.forEach(e=>{this._stylesSet.has(e)||(this._stylesSet.add(e),t.add(e))}),this.onStylesAdded(t)}onStylesAdded(e){}getAllStyles(){return Array.from(this._stylesSet)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),wh=(()=>{class e extends yh{constructor(e){super(),this._doc=e,this._hostNodes=new Map,this._hostNodes.set(e.head,[])}_addStylesToHost(e,t,i){e.forEach(e=>{const n=this._doc.createElement("style");n.textContent=e,i.push(t.appendChild(n))})}addHost(e){const t=[];this._addStylesToHost(this._stylesSet,e,t),this._hostNodes.set(e,t)}removeHost(e){const t=this._hostNodes.get(e);t&&t.forEach(kh),this._hostNodes.delete(e)}onStylesAdded(e){this._hostNodes.forEach((t,i)=>{this._addStylesToHost(e,i,t)})}ngOnDestroy(){this._hostNodes.forEach(e=>e.forEach(kh))}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();function kh(e){zl().remove(e)}const Ch={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Sh=/%COMP%/g;function xh(e,t,i){for(let n=0;n<t.length;n++){let r=t[n];Array.isArray(r)?xh(e,r,i):(r=r.replace(Sh,e),i.push(r))}return i}function Eh(e){return t=>{if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}let Ih=(()=>{class e{constructor(e,t,i){this.eventManager=e,this.sharedStylesHost=t,this.appId=i,this.rendererByCompId=new Map,this.defaultRenderer=new Ph(e)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;switch(t.encapsulation){case Ee.Emulated:{let i=this.rendererByCompId.get(t.id);return i||(i=new Dh(this.eventManager,this.sharedStylesHost,t,this.appId),this.rendererByCompId.set(t.id,i)),i.applyToHost(e),i}case 1:case Ee.ShadowDom:return new Th(this.eventManager,this.sharedStylesHost,e,t);default:if(!this.rendererByCompId.has(t.id)){const e=xh(t.id,t.styles,[]);this.sharedStylesHost.addStyles(e),this.rendererByCompId.set(t.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return e.\u0275fac=function(t){return new(t||e)(nn(vh),nn(wh),nn(Yc))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();class Ph{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(Ch[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,n){if(n){t=n+":"+t;const r=Ch[n];r?e.setAttributeNS(r,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const n=Ch[i];n?e.removeAttributeNS(n,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,n){n&(nr.DashCase|nr.Important)?e.style.setProperty(t,i,n&nr.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&nr.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,Eh(i)):this.eventManager.addEventListener(e,t,Eh(i))}}class Dh extends Ph{constructor(e,t,i,n){super(e),this.component=i;const r=xh(n+"-"+i.id,i.styles,[]);t.addStyles(r),this.contentAttr="_ngcontent-%COMP%".replace(Sh,n+"-"+i.id),this.hostAttr="_nghost-%COMP%".replace(Sh,n+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class Th extends Ph{constructor(e,t,i,n){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=xh(n.id,n.styles,[]);for(let s=0;s<r.length;s++){const e=document.createElement("style");e.textContent=r[s],this.shadowRoot.appendChild(e)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,i){return super.insertBefore(this.nodeOrShadowRoot(e),t,i)}removeChild(e,t){return super.removeChild(this.nodeOrShadowRoot(e),t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}}let Ah=(()=>{class e extends bh{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,i){return e.addEventListener(t,i,!1),()=>this.removeEventListener(e,t,i)}removeEventListener(e,t,i){return e.removeEventListener(t,i)}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();const Rh=["alt","control","meta","shift"],Oh={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Fh={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},Bh={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let Mh=(()=>{class e extends bh{constructor(e){super(e)}supports(t){return null!=e.parseEventName(t)}addEventListener(t,i,n){const r=e.parseEventName(i),s=e.eventCallback(r.fullKey,n,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>zl().onAndCancel(t,r.domEventName,s))}static parseEventName(t){const i=t.toLowerCase().split("."),n=i.shift();if(0===i.length||"keydown"!==n&&"keyup"!==n)return null;const r=e._normalizeKey(i.pop());let s="";if(Rh.forEach(e=>{const t=i.indexOf(e);t>-1&&(i.splice(t,1),s+=e+".")}),s+=r,0!=i.length||0===r.length)return null;const o={};return o.domEventName=n,o.fullKey=s,o}static getEventFullKey(e){let t="",i=function(e){let t=e.key;if(null==t){if(t=e.keyIdentifier,null==t)return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),3===e.location&&Fh.hasOwnProperty(t)&&(t=Fh[t]))}return Oh[t]||t}(e);return i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),Rh.forEach(n=>{n!=i&&(0,Bh[n])(e)&&(t+=n+".")}),t+=i,t}static eventCallback(t,i,n){return r=>{e.getEventFullKey(r)===t&&n.runGuarded(()=>i(r))}}static _normalizeKey(e){switch(e){case"esc":return"escape";default:return e}}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Lh=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({factory:function(){return nn($h)},token:e,providedIn:"root"}),e})(),$h=(()=>{class e extends Lh{constructor(e){super(),this._doc=e}sanitize(e,t){if(null==t)return null;switch(e){case qn.NONE:return t;case qn.HTML:return yn(t,"HTML")?bn(t):Hn(this._doc,String(t)).toString();case qn.STYLE:return yn(t,"Style")?bn(t):t;case qn.SCRIPT:if(yn(t,"Script"))return bn(t);throw new Error("unsafe value used in a script context");case qn.URL:return wn(t),yn(t,"URL")?bn(t):En(String(t));case qn.RESOURCE_URL:if(yn(t,"ResourceURL"))return bn(t);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${e} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(e){return new mn(e)}bypassSecurityTrustStyle(e){return new gn(e)}bypassSecurityTrustScript(e){return new fn(e)}bypassSecurityTrustUrl(e){return new _n(e)}bypassSecurityTrustResourceUrl(e){return new vn(e)}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({factory:function(){return e=nn(Ms),new $h(e.get(Nl));var e},token:e,providedIn:"root"}),e})();const jh=Tl(Ml,"browser",[{provide:el,useValue:"browser"},{provide:Xc,useValue:function(){dh.makeCurrent(),fh.init()},multi:!0},{provide:Nl,useFactory:function(){return function(e){ht=e}(document),document},deps:[]}]),zh=[[],{provide:$s,useValue:"root"},{provide:Jn,useFactory:function(){return new Jn},deps:[]},{provide:_h,useClass:Ah,multi:!0,deps:[Nl,gl,el]},{provide:_h,useClass:Mh,multi:!0,deps:[Nl]},[],{provide:Ih,useClass:Ih,deps:[vh,wh,Yc]},{provide:Ca,useExisting:Ih},{provide:yh,useExisting:wh},{provide:wh,useClass:wh,deps:[Nl]},{provide:kl,useClass:kl,deps:[gl]},{provide:vh,useClass:vh,deps:[_h,gl]},[]];let Nh=(()=>{class e{constructor(e){if(e)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:e,providers:[{provide:Yc,useValue:t.appId},{provide:mh,useExisting:Yc},gh]}}}return e.\u0275fac=function(t){return new(t||e)(nn(e,12))},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:zh,imports:[ed,$l]}),e})();function Vh(){return new Hh(nn(Nl))}let Hh=(()=>{class e{constructor(e){this._doc=e,this._dom=zl()}addTag(e,t=!1){return e?this._getOrCreateElement(e,t):null}addTags(e,t=!1){return e?e.reduce((e,i)=>(i&&e.push(this._getOrCreateElement(i,t)),e),[]):[]}getTag(e){return e&&this._doc.querySelector(`meta[${e}]`)||null}getTags(e){if(!e)return[];const t=this._doc.querySelectorAll(`meta[${e}]`);return t?[].slice.call(t):[]}updateTag(e,t){if(!e)return null;t=t||this._parseSelector(e);const i=this.getTag(t);return i?this._setMetaElementAttributes(e,i):this._getOrCreateElement(e,!0)}removeTag(e){this.removeTagElement(this.getTag(e))}removeTagElement(e){e&&this._dom.remove(e)}_getOrCreateElement(e,t=!1){if(!t){const t=this._parseSelector(e),i=this.getTag(t);if(i&&this._containsAttributes(e,i))return i}const i=this._dom.createElement("meta");return this._setMetaElementAttributes(e,i),this._doc.getElementsByTagName("head")[0].appendChild(i),i}_setMetaElementAttributes(e,t){return Object.keys(e).forEach(i=>t.setAttribute(this._getMetaKeyMap(i),e[i])),t}_parseSelector(e){const t=e.name?"name":"property";return`${t}="${e[t]}"`}_containsAttributes(e,t){return Object.keys(e).every(i=>t.getAttribute(this._getMetaKeyMap(i))===e[i])}_getMetaKeyMap(e){return Uh[e]||e}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({factory:Vh,token:e,providedIn:"root"}),e})();const Uh={httpEquiv:"http-equiv"};function qh(){return new Gh(nn(Nl))}let Gh=(()=>{class e{constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl))},e.\u0275prov=de({factory:qh,token:e,providedIn:"root"}),e})();function Wh(e){return function(t){const i=new Zh(e),n=t.lift(i);return i.caught=n}}"undefined"!=typeof window&&window;class Zh{constructor(e){this.selector=e}call(e,t){return t.subscribe(new Qh(e,this.selector,this.caught))}}class Qh extends ${constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let i;try{i=this.selector(e,this.caught)}catch(t){return void super.error(t)}this._unsubscribeAndRecycle();const n=new L(this);this.add(n);const r=j(i,n);r!==n&&this.add(r)}}}class Yh{constructor(){this.url="",this.headers={contentType:"",accept:""}}}let Kh=(()=>{class e{constructor(e,t){this.http=e,this.jsonapiConfig=t}exec(e,t,i){var n,r,s,o;const a={body:null!=i?i:null,headers:new ad({"Content-Type":null!==(r=null===(n=this.jsonapiConfig.headers)||void 0===n?void 0:n.contentType)&&void 0!==r?r:"application/vnd.api+json",Accept:null!==(o=null===(s=this.jsonapiConfig.headers)||void 0===s?void 0:s.accept)&&void 0!==o?o:"application/vnd.api+json"})};return this.http.request(t,this.jsonapiConfig.url+e,a)}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Yh))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),Jh=(()=>{class e{constructor(t,i){this.resourceServices={},this.config=new Yh,t.url&&(this.config.url=t.url),e.me=this,e.injectedServices={JsonapiHttp:i,rsJsonapiConfig:this.config}}static exec(t,i,n){return e.injectedServices.JsonapiHttp.exec(t,i,n)}registerService(e){return!(e.type in this.resourceServices)&&(this.resourceServices[e.type]=e,e)}getResourceService(e,t=!1){const i=this.resourceServices[e];if(!i&&t)throw new Error(`The requested service with type ${e} has not been registered, please use register() method or @Autoregister() decorator`);return i}}return e.\u0275fac=function(t){return new(t||e)(nn(Yh,8),nn(Kh))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})();class Xh{static mapAllResources(e){const t={};return e.forEach(e=>{let i;Jh.me.getResourceService(e.type)?(i=tp.getInstance().getOrCreateResource(e.type,e.id),i.fill({data:e}),i.is_new=!1):(i=new rp,i.id=e.id,i.type=e.type),t[i.type+"_"+i.id]=i}),t}static resourceByType(e){const t=this.mapAllResources(e),i={};for(const n of Object.keys(t)){const e=t[n];e.type in i||(i[e.type]={}),i[e.type][e.id]=e}return i}static buildIncluded(e){return"included"in e&&e.included?Xh.resourceByType(e.included):{}}}class ep{constructor(){this.data=[],this.is_loading=!1,this.content="collection"}fill(e){Xh.buildIncluded(e);const t={};this.data.length=0;for(const n of e.data)try{const e=this.getResourceOrFail(n);e.fill({data:n}),t[n.id]=n.id,this.data.push(e)}catch(i){this.content="ids",this.data.push({id:n.id,type:n.type})}this.data=this.data.filter(e=>e.id in t)}getResourceOrFail(e){const t=this.find(e.id);return null!==t?t:Jh.me.getResourceService(e.type,!0).getOrCreateResource(e.id)}setLoaded(e){this.is_loading=!e}find(e){if("ids"===this.content)return null;const t=this.data.findIndex(t=>t.id===e);return-1!==t?this.data[t]:null}}class tp{constructor(){this.resources={},this.collections={}}static getInstance(){return tp.instance||(tp.instance=new tp),tp.instance}getResource(e,t){return this.getKey(e,t)in this.resources?this.resources[this.getKey(e,t)]:null}getResourceOrFail(e,t){if(this.getKey(e,t)in this.resources)return this.resources[this.getKey(e,t)];throw new Error("The requested resource does not exist in cache memory")}getKey(e,t){return e+"."+t}getOrCreateCollection(e){return e in this.collections||(this.collections[e]=new ep),this.collections[e]}getOrCreateResource(e,t){let i=this.getResource(e,t);return null!==i||(i=Jh.me.getResourceService(e,!0).new(),i.id=t,this.setResource(i)),i}setResource(e){this.getKey(e.type,e.id)in this.resources?this.fillExistentResource(e):this.resources[this.getKey(e.type,e.id)]=e}removeResource(e,t){const i=this.getResource(e,t);if(i){Object.keys(this.collections).forEach(i=>{const n=this.collections[i],r=n.data.findIndex(i=>i.type===e&&i.id===t);-1!==r&&n.data.splice(r,1)}),i.attributes={};for(const e in i.relationships)if(i.relationships.hasOwnProperty(e)){const t=i.relationships[e].data;if(null==t)continue;Array.isArray(t)?i.relationships[e].data=[]:"object"==typeof t&&delete i.relationships[e].data}delete this.resources[this.getKey(e,t)]}}fillExistentResource(e){const t=this.getResourceOrFail(e.type,e.id);t.attributes=Object.assign(Object.assign({},t.attributes),e.attributes),t.relationships=t.relationships||e.relationships}}class ip{constructor(){this.data=new rp,this.is_loading=!0,this.content="id"}fill(e){this.content="id",null!==e?(this.data||(this.data=tp.getInstance().getOrCreateResource(e.data.type,e.data.id)),this.data.fill(e)&&(this.content="resource")):this.data=null}}class np{constructor(e,t,i,n){this.getService=e,this.relationshipsFrom=t,this.relationshipsDest=i,this.includedResources=n}buildRelationships(){for(const e of Object.keys(this.relationshipsFrom)){const t=this.relationshipsFrom[e];this.relationshipsDest[e]&&null===t.data&&(this.relationshipsDest[e].data=null,this.relationshipsDest[e].is_loading=!1),t.data&&(this.relationshipsDest[e]instanceof ep?this.buildRelationshipHasMany(t,e):this.relationshipsDest[e]instanceof ip&&this.buildRelationshipHasOne(t,e))}}buildRelationshipHasMany(e,t){0!==e.data.length?this.relationshipsDest[t].fill(e):this.relationshipsDest[t]=new ep}buildRelationshipHasOne(e,t){if("type"in e.data){if(this.relationshipsDest[t].data||(this.relationshipsDest[t].data=new rp),e.data.id!==this.relationshipsDest[t].data.id&&(this.relationshipsDest[t].data=new rp,this.relationshipsDest[t].data.type=e.data.type),this.relationshipsDest[t].data.id!==e.data.id||!this.relationshipsDest[t].data.attributes||0===Object.keys(this.relationshipsDest[t].data.attributes).length){const i=this.buildRelationship(e.data);i?this.relationshipsDest[t].data=i:(this.relationshipsDest[t].data.id=e.data.id,this.relationshipsDest[t].data.type=e.data.type)}}else this.relationshipsDest[t].data=[]}buildRelationship(e){if(e.type in this.includedResources&&e.id in this.includedResources[e.type]){const t=this.includedResources[e.type][e.id];return tp.getInstance().setResource(t),this.includedResources[e.type][e.id]}return tp.getInstance().getResource(e.type,e.id)}}class rp{constructor(){this.id="",this.type="",this.attributes={},this.links={},this.relationships={},this.is_new=!0,this.is_loading=!1}reset(){this.id="",this.attributes={},this.is_new=!0;for(const e of Object.keys(this.relationships))this.relationships[e]=this.relationships[e]instanceof ep?new ep:new ip}addRelationship(e,t){const i=this.relationships[t||e.type];i.data=i instanceof ep?this.replaceOrAddRelationship(i.data,e):e}addRelationships(e,t){if(0!==e.length){if(!(this.relationships[t]instanceof ep))throw new Error("addRelationships require a DocumentCollection (hasMany) relation.");e.forEach(e=>{this.addRelationship(e,t)})}}removeRelationship(e,t){if(!(e in this.relationships)||!("data"in this.relationships[e]))return!1;const i=this.relationships[e];return i instanceof ep?this.relationships[e].data=i.data.filter(e=>e.id!==t):i.data=null,!0}fill(e){var t;this.id=e.data.id||"",this.attributes=Object.assign(Object.assign({},this.attributes||{}),e.data.attributes),this.is_new=!1;const i=Jh.me.getResourceService(e.data.type);return!this.relationships&&i&&(this.relationships=(new i.resource).relationships),!!i&&(new np(Jh.me.getResourceService,null!==(t=e.data.relationships)&&void 0!==t?t:{},this.relationships,Xh.buildIncluded(e)).buildRelationships(),!0)}save(e){const t=Jh.me.getResourceService(this.type),i=this.type+(this.id?"/"+this.id:"")+(e?"?"+t.objectToQueryParams(e):"");return Jh.exec(i,this.is_new?"POST":"PATCH",this.toObject(e)).pipe(E(e=>this.handleSaveResponse(e)))}setLoaded(e){this.is_loading=!e}handleSaveResponse(e){return"id"in e.data&&(this.id=e.data.id),this.fill(e),e}delete(){return Jh.me.getResourceService(this.type).delete(this.id)}toObject(e){const t=this.buildRelationships(),i=this.buildIncluded(e),n={data:{type:this.type,id:this.id,attributes:this.attributes,relationships:t}};return this.meta&&(n.data.meta=this.meta),i.length>0&&(n.included=i),""===this.id&&delete n.data.id,n}buildCollectionRelationships(e,t,i){t.data?e[i]={data:t.data.reduce((e,t)=>(t.id&&t.type&&e.push({id:t.id,type:t.type}),e),[])}:delete e[i]}buildResourceRelationships(e,t,i){null!=t.data&&t.data.id&&t.data.type?e[i]={data:{id:t.data.id,type:t.data.type}}:delete e[i]}buildRelationships(){const e={};for(const t of Object.keys(this.relationships)){const i=this.relationships[t];i instanceof ep?this.buildCollectionRelationships(e,i,t):this.buildResourceRelationships(e,i,t)}return e}buildIncludedForCollection(e,t,i,n){const r=[];let s;for(const o of e)s=this.buildIncludedForResource(o,t,i,n),s&&r.push(s);return r}buildIncludedForResource(e,t,i,n){const r=e.type+"_"+e.id;return-1===i.indexOf(r)&&-1!==n.indexOf(t)?(i.push(r),e.toObject({}).data):null}buildIncluded(e){const t=[],i=[];return(null==e?void 0:e.include)?(Object.keys(this.relationships).forEach(n=>{const r=this.relationships[n];let s;r instanceof ep?(s=this.buildIncludedForCollection(r.data,n,i,e.include),s&&t.push(...s)):(s=this.buildIncludedForResource(r.data,n,i,e.include),s&&t.push(s))}),t):t}replaceOrAddRelationship(e,t){const i=e.findIndex(e=>e.id===t.id);return-1===i?e.push(t):e[i]=t,e}}class sp{constructor(){this.type="",this.resource=rp,setTimeout(()=>this.register())}register(){if(null===Jh.me)throw new Error("Error: you are trying to register `"+this.type+"` but JsonapiCore wasn't injected anywhere yet.");return Jh.me.registerService(this)}new(){const e=new this.resource;return e.type=this.type,Jh.me.getResourceService(this.type)||this.register(),e.reset(),e}all(e){e&&this.convertRemoteFilters(e);const t=this.type+(e?"?"+this.objectToQueryParams(e):""),i=tp.getInstance().getOrCreateCollection(t);return i.setLoaded(!1),Jh.exec(t,"GET").pipe(E(e=>(i.fill(e),i.setLoaded(!0),e.links&&this.generatePage(i,e.links),i)),Wh(e=>Zd(e)))}get(e,t={}){const i=`${this.type}/${e}`+(Object.keys(t).length>0?"?"+this.objectToQueryParams(t):""),n=this.getOrCreateResource(e);return n.setLoaded(!1),Jh.exec(i,"GET").pipe(E(e=>(n.fill(e),n.setLoaded(!0),n)),Wh(e=>Zd(e)))}save(e){return Jh.exec(this.type+(e.data.id?"/"+e.data.id:""),e.data.id?"PATCH":"POST",e).pipe(Wh(e=>Zd(e)))}delete(e){return Jh.exec(`${this.type}/${e}`,"DELETE").pipe(E(()=>(tp.getInstance().removeResource(this.type,e),null)),Wh(e=>Zd(e)))}objectToQueryParams(e,t=""){const i=[];for(const n of Object.keys(e)){const r=e[n],s=t&&"urlParams"!==t?`${t}[${n}]`:n;null!=r&&(Array.isArray(r)?i.push(`${s}=${r.map(encodeURIComponent).join(",")}`):i.push("object"==typeof r?this.objectToQueryParams(r,s):`${s}=${encodeURIComponent(r)}`))}return i.join("&")}newCollection(){return new ep}getOrCreateResource(e){const t=Jh.me.getResourceService(this.type,!0);let i;return i=tp.getInstance().getResource(this.type,e),null===i&&(i=t.new(),i.id=e,tp.getInstance().setResource(i)),i}generatePage(e,t){if(!t.last)return;const i=new URLSearchParams(new URL(t.last).search),n=Number(i.get("page[size]")),r=Number(i.get("page[number]")),s={number:r,total_resources:n*r,size:n};if(t.next){const e=new URLSearchParams(new URL(t.next).search);s.number=Number(e.get("page[number]"))-1}e.page=s}convertRemoteFilters(e){var t;return e.filter=null!==(t=e.remotefilter)&&void 0!==t?t:e.filter,delete e.remotefilter,e}}let op=(()=>{class e{constructor(e,t){if(e)throw new Error("GreetingModule is already loaded. Import it in the AppModule only")}static forRoot(t){return{ngModule:e,providers:[{provide:Yh,useValue:t}]}}}return e.\u0275fac=function(t){return new(t||e)(nn(e,12),nn(Jh))},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[Jh,Yh,Kh],imports:[[ed],Md]}),e})();var ap=i("TOAu");class cp extends C{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new y;return this._value}next(e){super.next(this._value=e)}}var lp=function(e){return e.MEALZ="mealz-space",e.SHELVES="shelves",e.SEARCH="search",e.EMPTY="",e}({});const up={"meals-space-catalog-search":{selector:[".mealz-catalog__title",".miam-recipe-catalog__content__title__search__text"],urlParam:"search"},"meals-space-home":["mealz-catalog-home",".miam-catalog-header"],"meals-space-category-search":{selector:["mealz-catalog-category",".miam-catalog-header__category-label"],urlParam:"search"},"meals-space-category":["mealz-catalog-category",".miam-catalog-header__category-label"],"meals-space-all-recipes":["mealz-catalog-all-recipes",".miam-recipe-catalog__content__title__all-recipes__text"],"my-space-favorites":["mealz-catalog-favorites","#favorites-panel"],"my-space-history":"mealz-catalog-history"},dp=(e,t)=>{const i=null!=t?t:"undefined"!=typeof window?window.location:null;return!!i&&new URLSearchParams(i.search).has(e)},hp=(e,t)=>{const i=null!=t?t:"undefined"!=typeof window?window.location:null;if(!i)return!1;const n=i.href,r=i.pathname;return e instanceof RegExp?e.test(n)||e.test(r):e.startsWith("http://")||e.startsWith("https://")?n.includes(e):r.includes(e)},pp=e=>"string"==typeof e||Array.isArray(e)?{selector:e}:e,mp=(e,t,i)=>{const n=null!=t?t:"undefined"!=typeof window?window.document:null;if(!n)return null;const r=null!=e?e:up;for(const[s,o]of Object.entries(r)){const e=pp(o);if((Array.isArray(e.selector)?e.selector:[e.selector]).some(e=>{try{return null!==n.querySelector(e)}catch(t){return!1}})&&(!e.urlParam||dp(e.urlParam,i))&&(!e.url||hp(e.url,i)))return s}return null},gp=(()=>{function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e})();function fp(e){return t=>0===e?Wd():t.lift(new _p(e))}class _p{constructor(e){if(this.total=e,this.total<0)throw new gp}call(e,t){return t.subscribe(new vp(e,this.total))}}class vp extends m{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function bp(e){return t=>t.lift(new yp(e))}class yp{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new wp(e,this.predicate))}}class wp extends m{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}var kp=function(e){return e[e.none=0]="none",e[e.error=1]="error",e[e.warn=2]="warn",e[e.all=3]="all",e}({});function Cp(e,...t){Ep().pipe(fp(1)).subscribe(i=>{kp[i]>=kp.all&&console.debug(e,...t)})}function Sp(e,...t){Ep().pipe(fp(1)).subscribe(i=>{kp[i]>=kp.warn&&console.warn(e,...t)})}function xp(e,...t){Ep().pipe(fp(1)).subscribe(i=>{kp[i]>=kp.error&&console.error(e,...t)})}function Ep(){return new v(e=>{const t=setInterval(()=>{var i;if(window.mealzInternal){clearInterval(t);const n=null===(i=window.mealzInternal)||void 0===i?void 0:i.config.logLevel;n&&n.pipe(bp(e=>void 0===e),fp(1)).subscribe(t=>e.next(t))}},150)})}const Ip="https://api.miam.tech",Pp="https://cdn.jsdelivr.net/npm/mealz-components@2/dist";let Dp=(()=>{class e{constructor(){this.forbidProfiling=!1,this.disabledAnalytics=!1,this.guestsChanged=new Rc,this.recipePriceChanged=new Rc,this.addAllProductsWasClicked=new Rc,this.hookCallback=(e,t)=>(Sp("[Mealz] hookCallback (used to force user login) not set"),!1),this.forcePosCallback=e=>(Sp("[Mealz] forcePosCallback (used to force selected shop) not set"),!1)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const Tp=new Rc;function Ap(e){Tp.emit(JSON.stringify({name:e.name,path:e.url,props:e.props}))}let Rp=(()=>{class e{constructor(e){this.contextRegistryService=e,this.isMealzPage=!1,this.eventEmitter=Tp,this.subscriptions=[],this.alreadyInitialized$=new cp(!1),this.queuedEvents=[],this.subscriptions.push(this.alreadyInitialized$.subscribe(e=>{e&&this.executeQueuedEvents()}))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}setAbTestKey(e){this.callMethodOrAddToQueue(()=>Object(ap.setABTestKey)(e))}init(e){var t;if(!this.alreadyInitialized$.value)return e?(Object(ap.initSharedAnalytics)(e,"10.0.4",Ap,"prod"),(null===(t=localStorage.getItem("_miam/affiliate"))||void 0===t?void 0:t.length)>0&&Object(ap.setAffiliate)(localStorage.getItem("_miam/affiliate")),void this.alreadyInitialized$.next(!0)):xp("[Mealz] Analytics not initialized (domain cannot be null)")}sendEvent(e,t,i,n){if(this.contextRegistryService.disabledAnalytics&&this.contextRegistryService.forbidProfiling)return;const r=n||(this.isMealzPage?lp.MEALZ:lp.EMPTY);this.callMethodOrAddToQueue(()=>Object(ap.sendEvent)(e,function(e){return e?`${location.origin}/miam${e}`:location.href}(t),r,i))}sendRemoveRecipesEvents(e,t){const i=null!=t?t:mp();e.forEach(e=>{this.sendEvent("recipe.remove",e.params.eventTrace.originPath,{recipe_id:e.params.recipeId},i)})}sendAddRecipesEvents(e,t){const i=null!=t?t:mp();e.forEach(e=>{this.sendEvent("recipe.add",e.params.eventTrace.originPath,{recipe_id:e.params.recipeId},i)})}sendUpdateGuestsEvents(e,t){const i=null!=t?t:mp();e.forEach(e=>{this.sendEvent("recipe.change-guests",e.params.eventTrace.originPath,{recipe_id:e.params.recipeId},i)})}sendEventsOfResetBasket(e,t,i){const n=null!=i?i:mp();e.recipeInfos.forEach(e=>{this.sendEvent("recipe.remove",t.originPath,{recipe_id:e.id},n)})}sendAddProductsEvents(e,t){const i=null!=t?t:mp(),n=e.length>1;e.forEach(e=>{let t;t=e.params.previousItem?"replacement":n?"bulk":"unit",this.sendEvent("entry.added",e.params.eventTrace.originPath,{entry_name:e.params.basketEntry.name,item_id:e.params.basketEntry.selectedItem.id,ext_item_id:e.params.basketEntry.selectedItem.attributes["ext-id"],item_ean:e.params.basketEntry.selectedItem.ean,product_quantity:e.params.basketEntry.quantity.toString(),recipe_id:e.params.recipeId,add_source:t},i)})}sendRemoveProductsEvents(e,t){const i=null!=t?t:mp();e.forEach(e=>{this.sendEvent("entry.deleted",e.params.eventTrace.originPath,{entry_name:e.params.basketEntry.name,item_id:e.params.basketEntry.selectedItem.id,ext_item_id:e.params.basketEntry.selectedItem.attributes["ext-id"],item_ean:e.params.basketEntry.selectedItem.ean,product_quantity:e.params.basketEntry.quantity.toString(),recipe_id:e.params.recipeId},i)})}sendProductsChangeQuantityEvents(e,t){const i=null!=t?t:mp();e.forEach(e=>{this.sendEvent("entry.change-quantity",e.params.eventTrace.originPath,{entry_name:e.params.basketEntry.name,item_id:e.params.basketEntry.selectedItem.id,ext_item_id:e.params.basketEntry.selectedItem.attributes["ext-id"],item_ean:e.params.basketEntry.selectedItem.ean,product_quantity:e.params.newQuantity.toString(),recipe_id:e.params.recipeId},i)})}callMethodOrAddToQueue(e){this.alreadyInitialized$.value?e():this.queuedEvents.push(e)}executeQueuedEvents(){this.queuedEvents.forEach(e=>e()),this.queuedEvents=[]}}return e.\u0275fac=function(t){return new(t||e)(nn(Dp))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Op=function(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e},Fp=i("fw2E"),Bp=Fp.a.Symbol,Mp=Object.prototype,Lp=Mp.hasOwnProperty,$p=Mp.toString,jp=Bp?Bp.toStringTag:void 0,zp=Object.prototype.toString,Np=Bp?Bp.toStringTag:void 0,Vp=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Np&&Np in Object(e)?function(e){var t=Lp.call(e,jp),i=e[jp];try{e[jp]=void 0;var n=!0}catch(s){}var r=$p.call(e);return n&&(t?e[jp]=i:delete e[jp]),r}(e):function(e){return zp.call(e)}(e)},Hp=function(e){return null!=e&&"object"==typeof e},Up=function(e){return Hp(e)&&"[object Arguments]"==Vp(e)},qp=Object.prototype,Gp=qp.hasOwnProperty,Wp=qp.propertyIsEnumerable,Zp=Up(function(){return arguments}())?Up:function(e){return Hp(e)&&Gp.call(e,"callee")&&!Wp.call(e,"callee")},Qp=Array.isArray,Yp=Bp?Bp.isConcatSpreadable:void 0,Kp=function(e){return Qp(e)||Zp(e)||!!(Yp&&e&&e[Yp])},Jp=function e(t,i,n,r,s){var o=-1,a=t.length;for(n||(n=Kp),s||(s=[]);++o<a;){var c=t[o];i>0&&n(c)?i>1?e(c,i-1,n,r,s):Op(s,c):r||(s[s.length]=c)}return s},Xp=function(e){return null!=e&&e.length?Jp(e,1):[]},em=function(e,t){return e===t||e!=e&&t!=t},tm=function(e,t){for(var i=e.length;i--;)if(em(e[i][0],t))return i;return-1},im=Array.prototype.splice;function nm(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}nm.prototype.clear=function(){this.__data__=[],this.size=0},nm.prototype.delete=function(e){var t=this.__data__,i=tm(t,e);return!(i<0||(i==t.length-1?t.pop():im.call(t,i,1),--this.size,0))},nm.prototype.get=function(e){var t=this.__data__,i=tm(t,e);return i<0?void 0:t[i][1]},nm.prototype.has=function(e){return tm(this.__data__,e)>-1},nm.prototype.set=function(e,t){var i=this.__data__,n=tm(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var rm,sm=nm,om=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},am=function(e){if(!om(e))return!1;var t=Vp(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},cm=Fp.a["__core-js_shared__"],lm=(rm=/[^.]+$/.exec(cm&&cm.keys&&cm.keys.IE_PROTO||""))?"Symbol(src)_1."+rm:"",um=Function.prototype.toString,dm=function(e){if(null!=e){try{return um.call(e)}catch(t){}try{return e+""}catch(t){}}return""},hm=/^\[object .+?Constructor\]$/,pm=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mm=function(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!om(e)||(t=e,lm&&lm in t))&&(am(e)?pm:hm).test(dm(e));var t}(i)?i:void 0},gm=mm(Fp.a,"Map"),fm=mm(Object,"create"),_m=Object.prototype.hasOwnProperty,vm=Object.prototype.hasOwnProperty;function bm(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}bm.prototype.clear=function(){this.__data__=fm?fm(null):{},this.size=0},bm.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},bm.prototype.get=function(e){var t=this.__data__;if(fm){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return _m.call(t,e)?t[e]:void 0},bm.prototype.has=function(e){var t=this.__data__;return fm?void 0!==t[e]:vm.call(t,e)},bm.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=fm&&void 0===t?"__lodash_hash_undefined__":t,this};var ym=bm,wm=function(e,t){var i,n,r=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof t?"string":"hash"]:r.map};function km(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}km.prototype.clear=function(){this.size=0,this.__data__={hash:new ym,map:new(gm||sm),string:new ym}},km.prototype.delete=function(e){var t=wm(this,e).delete(e);return this.size-=t?1:0,t},km.prototype.get=function(e){return wm(this,e).get(e)},km.prototype.has=function(e){return wm(this,e).has(e)},km.prototype.set=function(e,t){var i=wm(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};var Cm=km;function Sm(e){var t=this.__data__=new sm(e);this.size=t.size}Sm.prototype.clear=function(){this.__data__=new sm,this.size=0},Sm.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},Sm.prototype.get=function(e){return this.__data__.get(e)},Sm.prototype.has=function(e){return this.__data__.has(e)},Sm.prototype.set=function(e,t){var i=this.__data__;if(i instanceof sm){var n=i.__data__;if(!gm||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new Cm(n)}return i.set(e,t),this.size=i.size,this};var xm=Sm;function Em(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new Cm;++t<i;)this.add(e[t])}Em.prototype.add=Em.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Em.prototype.has=function(e){return this.__data__.has(e)};var Im=Em,Pm=function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1},Dm=function(e,t){return e.has(t)},Tm=function(e,t,i,n,r,s){var o=1&i,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var d=-1,h=!0,p=2&i?new Im:void 0;for(s.set(e,t),s.set(t,e);++d<a;){var m=e[d],g=t[d];if(n)var f=o?n(g,m,d,t,e,s):n(m,g,d,e,t,s);if(void 0!==f){if(f)continue;h=!1;break}if(p){if(!Pm(t,(function(e,t){if(!Dm(p,t)&&(m===e||r(m,e,i,n,s)))return p.push(t)}))){h=!1;break}}else if(m!==g&&!r(m,g,i,n,s)){h=!1;break}}return s.delete(e),s.delete(t),h},Am=Fp.a.Uint8Array,Rm=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i},Om=function(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i},Fm=Bp?Bp.prototype:void 0,Bm=Fm?Fm.valueOf:void 0,Mm=Object.prototype.propertyIsEnumerable,Lm=Object.getOwnPropertySymbols,$m=Lm?function(e){return null==e?[]:(e=Object(e),function(t,i){for(var n=-1,r=null==t?0:t.length,s=0,o=[];++n<r;){var a=t[n];Mm.call(e,a)&&(o[s++]=a)}return o}(Lm(e)))}:function(){return[]},jm=i("TPB+"),zm=/^(?:0|[1-9]\d*)$/,Nm=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&zm.test(e))&&e>-1&&e%1==0&&e<t},Vm=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Hm={};Hm["[object Float32Array]"]=Hm["[object Float64Array]"]=Hm["[object Int8Array]"]=Hm["[object Int16Array]"]=Hm["[object Int32Array]"]=Hm["[object Uint8Array]"]=Hm["[object Uint8ClampedArray]"]=Hm["[object Uint16Array]"]=Hm["[object Uint32Array]"]=!0,Hm["[object Arguments]"]=Hm["[object Array]"]=Hm["[object ArrayBuffer]"]=Hm["[object Boolean]"]=Hm["[object DataView]"]=Hm["[object Date]"]=Hm["[object Error]"]=Hm["[object Function]"]=Hm["[object Map]"]=Hm["[object Number]"]=Hm["[object Object]"]=Hm["[object RegExp]"]=Hm["[object Set]"]=Hm["[object String]"]=Hm["[object WeakMap]"]=!1;var Um,qm=i("Af8m"),Gm=qm.a&&qm.a.isTypedArray,Wm=Gm?(Um=Gm,function(e){return Um(e)}):function(e){return Hp(e)&&Vm(e.length)&&!!Hm[Vp(e)]},Zm=Object.prototype.hasOwnProperty,Qm=Object.prototype,Ym=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),Km=Object.prototype.hasOwnProperty,Jm=function(e){return null!=e&&Vm(e.length)&&!am(e)},Xm=function(e){return Jm(e)?function(e,t){var i=Qp(e),n=!i&&Zp(e),r=!i&&!n&&Object(jm.a)(e),s=!i&&!n&&!r&&Wm(e),o=i||n||r||s,a=o?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],c=a.length;for(var l in e)!t&&!Zm.call(e,l)||o&&("length"==l||r&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Nm(l,c))||a.push(l);return a}(e):function(e){if((t=e)!==("function"==typeof(i=t&&t.constructor)&&i.prototype||Qm))return Ym(e);var t,i,n=[];for(var r in Object(e))Km.call(e,r)&&"constructor"!=r&&n.push(r);return n}(e)},eg=function(e){return function(e,t,i){var n=t(e);return Qp(e)?n:Op(n,i(e))}(e,Xm,$m)},tg=Object.prototype.hasOwnProperty,ig=mm(Fp.a,"DataView"),ng=mm(Fp.a,"Promise"),rg=mm(Fp.a,"Set"),sg=mm(Fp.a,"WeakMap"),og=dm(ig),ag=dm(gm),cg=dm(ng),lg=dm(rg),ug=dm(sg),dg=Vp;(ig&&"[object DataView]"!=dg(new ig(new ArrayBuffer(1)))||gm&&"[object Map]"!=dg(new gm)||ng&&"[object Promise]"!=dg(ng.resolve())||rg&&"[object Set]"!=dg(new rg)||sg&&"[object WeakMap]"!=dg(new sg))&&(dg=function(e){var t=Vp(e),i="[object Object]"==t?e.constructor:void 0,n=i?dm(i):"";if(n)switch(n){case og:return"[object DataView]";case ag:return"[object Map]";case cg:return"[object Promise]";case lg:return"[object Set]";case ug:return"[object WeakMap]"}return t});var hg=dg,pg=Object.prototype.hasOwnProperty,mg=function e(t,i,n,r,s){return t===i||(null==t||null==i||!Hp(t)&&!Hp(i)?t!=t&&i!=i:function(e,t,i,n,r,s){var o=Qp(e),a=Qp(t),c=o?"[object Array]":hg(e),l=a?"[object Array]":hg(t),u="[object Object]"==(c="[object Arguments]"==c?"[object Object]":c),d="[object Object]"==(l="[object Arguments]"==l?"[object Object]":l),h=c==l;if(h&&Object(jm.a)(e)){if(!Object(jm.a)(t))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new xm),o||Wm(e)?Tm(e,t,i,n,r,s):function(e,t,i,n,r,s,o){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new Am(e),new Am(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return em(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Rm;case"[object Set]":if(a||(a=Om),e.size!=t.size&&!(1&n))return!1;var c=o.get(e);if(c)return c==t;n|=2,o.set(e,t);var l=Tm(a(e),a(t),n,r,s,o);return o.delete(e),l;case"[object Symbol]":if(Bm)return Bm.call(e)==Bm.call(t)}return!1}(e,t,c,i,n,r,s);if(!(1&i)){var p=u&&pg.call(e,"__wrapped__"),m=d&&pg.call(t,"__wrapped__");if(p||m){var g=p?e.value():e,f=m?t.value():t;return s||(s=new xm),r(g,f,i,n,s)}}return!!h&&(s||(s=new xm),function(e,t,i,n,r,s){var o=1&i,a=eg(e),c=a.length;if(c!=eg(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:tg.call(t,u)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var p=!0;s.set(e,t),s.set(t,e);for(var m=o;++l<c;){var g=e[u=a[l]],f=t[u];if(n)var _=o?n(f,g,u,t,e,s):n(g,f,u,e,t,s);if(!(void 0===_?g===f||r(g,f,i,n,s):_)){p=!1;break}m||(m="constructor"==u)}if(p&&!m){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,i,n,r,s))}(t,i,n,r,e,s))},gg=function(e){return e==e&&!om(e)},fg=function(e,t){return function(i){return null!=i&&i[e]===t&&(void 0!==t||e in Object(i))}},_g=function(e){return"symbol"==typeof e||Hp(e)&&"[object Symbol]"==Vp(e)},vg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bg=/^\w*$/,yg=function(e,t){if(Qp(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!_g(e))||bg.test(e)||!vg.test(e)||null!=t&&e in Object(t)};function wg(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=e.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(wg.Cache||Cm),i}wg.Cache=Cm;var kg,Cg,Sg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xg=/\\(\\)?/g,Eg=(kg=wg((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Sg,(function(e,i,n,r){t.push(n?r.replace(xg,"$1"):i||e)})),t}),(function(e){return 500===Cg.size&&Cg.clear(),e})),Cg=kg.cache,kg),Ig=function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r},Pg=Bp?Bp.prototype:void 0,Dg=Pg?Pg.toString:void 0,Tg=function(e,t){return Qp(e)?e:yg(e,t)?[e]:Eg(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(Qp(t))return Ig(t,e)+"";if(_g(t))return Dg?Dg.call(t):"";var i=t+"";return"0"==i&&1/t==-1/0?"-0":i}(e)}(e))},Ag=function(e){if("string"==typeof e||_g(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Rg=function(e,t){for(var i=0,n=(t=Tg(t,e)).length;null!=e&&i<n;)e=e[Ag(t[i++])];return i&&i==n?e:void 0},Og=function(e,t,i){var n=null==e?void 0:Rg(e,t);return void 0===n?i:n},Fg=function(e,t){return null!=e&&t in Object(e)},Bg=function(e){return e},Mg=function(e){return"function"==typeof e?e:null==e?Bg:"object"==typeof e?Qp(e)?(r=e[1],yg(n=e[0])&&gg(r)?fg(Ag(n),r):function(e){var t=Og(e,n);return void 0===t&&t===r?function(e,t){return null!=e&&function(e,t,i){for(var n=-1,r=(t=Tg(t,e)).length,s=!1;++n<r;){var o=Ag(t[n]);if(!(s=null!=e&&i(e,o)))break;e=e[o]}return s||++n!=r?s:!!(r=null==e?0:e.length)&&Vm(r)&&Nm(o,r)&&(Qp(e)||Zp(e))}(e,t,Fg)}(e,n):mg(r,t,3)}):1==(i=function(e){for(var t=Xm(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,gg(r)]}return t}(t=e)).length&&i[0][2]?fg(i[0][0],i[0][1]):function(e){return e===t||function(e,t,i,n){var r=i.length,s=r;if(null==e)return!s;for(e=Object(e);r--;){var o=i[r];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++r<s;){var a=(o=i[r])[0],c=e[a],l=o[1];if(o[2]){if(void 0===c&&!(a in e))return!1}else{var u,d=new xm;if(!(void 0===u?mg(l,c,3,void 0,d):u))return!1}}return!0}(e,0,i)}:function(e){return yg(e)?(t=Ag(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Rg(t,e)}}(e);var t}(e);var t,i,n,r},Lg=function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)},$g=Math.max,jg=function(e,t,i){return t=$g(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,s=$g(n.length-t,0),o=Array(s);++r<s;)o[r]=n[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=n[r];return a[t]=i(o),Lg(e,this,a)}},zg=function(){try{var e=mm(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Ng=Date.now,Vg=function(e){var t=0,i=0;return function(){var n=Ng(),r=16-(n-i);if(i=n,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(zg?function(e,t){return zg(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Bg),Hg=function(e){return e!=e},Ug=function(e,t){return!(null==e||!e.length)&&function(e,t,i){return t==t?function(e,t,i){for(var n=-1,r=e.length;++n<r;)if(e[n]===t)return n;return-1}(e,t):function(e,t,i,n){for(var r=e.length,s=-1;++s<r;)if(t(e[s],s,e))return s;return-1}(e,Hg)}(e,t)>-1},qg=rg&&1/Om(new rg([,-0]))[1]==1/0?function(e){return new rg(e)}:function(){},Gg=function(e){return Hp(e)&&Jm(e)},Wg=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0},Zg=function(e,t){return Vg(jg(e,void 0,Bg),e+"")}((function(e){var t=Wg(e);return Gg(t)&&(t=void 0),function(e,t,i){var n=-1,r=Ug,s=e.length,o=!0,a=[],c=a;if(s>=200){var l=t?null:qg(e);if(l)return Om(l);o=!1,r=Dm,c=new Im}else c=t?[]:a;e:for(;++n<s;){var u=e[n],d=t?t(u):u;if(u=0!==u?u:0,o&&d==d){for(var h=c.length;h--;)if(c[h]===d)continue e;t&&c.push(d),a.push(u)}else r(c,d,undefined)||(c!==a&&c.push(d),a.push(u))}return a}(Jp(e,1,Gg,!0),Mg(t))}));class Qg extends m{notifyNext(e,t,i,n,r){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class Yg extends m{constructor(e,t,i){super(),this.parent=e,this.outerValue=t,this.outerIndex=i,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function Kg(e,t,i,n,r=new Yg(e,i,n)){if(!r.closed)return t instanceof v?t.subscribe(r):F(t)(r)}const Jg={};function Xg(...e){let t=void 0,i=void 0;return x(e[e.length-1])&&(i=e.pop()),"function"==typeof e[e.length-1]&&(t=e.pop()),1===e.length&&c(e[0])&&(e=e[0]),U(e,i).lift(new ef(t))}class ef{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new tf(e,this.resultSelector))}}class tf extends Qg{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(Jg),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i<t;i++)this.add(Kg(this,e[i],void 0,i))}}notifyComplete(e){0==(this.active-=1)&&this.destination.complete()}notifyNext(e,t,i){const n=this.values,r=this.toRespond?n[i]===Jg?--this.toRespond:this.toRespond:0;n[i]=t,0===r&&(this.resultSelector?this._tryResultSelector(n):this.destination.next(n.slice()))}_tryResultSelector(e){let t;try{t=this.resultSelector.apply(this,e)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}function nf(...e){if(1===e.length){const t=e[0];if(c(t))return rf(t,null);if(l(t)&&Object.getPrototypeOf(t)===Object.prototype){const e=Object.keys(t);return rf(e.map(e=>t[e]),e)}}if("function"==typeof e[e.length-1]){const t=e.pop();return rf(e=1===e.length&&c(e[0])?e[0]:e,null).pipe(E(e=>t(...e)))}return rf(e,null)}function rf(e,t){return new v(i=>{const n=e.length;if(0===n)return void i.complete();const r=new Array(n);let s=0,o=0;for(let a=0;a<n;a++){const c=M(e[a]);let l=!1;i.add(c.subscribe({next:e=>{l||(l=!0,o++),r[a]=e},error:e=>i.error(e),complete:()=>{s++,s!==n&&l||(o===n&&i.next(t?t.reduce((e,t,i)=>(e[t]=r[i],e),{}):r),i.complete())}}))}})}const sf=new Hd(zd);function of(e,t=sf){return i=>i.lift(new af(e,t))}class af{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new cf(e,this.dueTime,this.scheduler))}}class cf extends m{constructor(e,t,i){super(e),this.dueTime=t,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(lf,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function lf(e){e.debouncedNext()}function uf(){}function df(e,t,i){return function(n){return n.lift(new hf(e,t,i))}}class hf{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new pf(e,this.nextOrObserver,this.error,this.complete))}}class pf extends m{constructor(e,t,i,r){super(e),this._tapNext=uf,this._tapError=uf,this._tapComplete=uf,this._tapError=i||uf,this._tapComplete=r||uf,n(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||uf,this._tapError=t.error||uf,this._tapComplete=t.complete||uf)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}class mf extends rp{constructor(){super(),this.attributes={name:"",quantity:"",unit:"",importance:"",active:!0,"forced-eans":[],"picture-url":"",position:-1},this.relationships={recipe:new ip,"quantity-unit":new ip,definition:new ip},Object.freeze(this.attributes.name),Object.freeze(this.attributes.unit),Object.freeze(this.picture)}get quantity(){return this.attributes.quantity?parseFloat(this.attributes.quantity).toString():"1"}get picture(){return this.attributes["picture-url"]}get forcedEans(){return this.attributes["forced-eans"]}}class gf extends rp{constructor(){super(...arguments),this.attributes={"activation-count":"",name:"","often-deleted":"","picture-url":"",plural:!0,"total-count":0}}}class ff extends rp{constructor(){super(...arguments),this.attributes={name:"",status:"",description:"",ean:"","ext-id":"",brand:"","product-page":"",image:"","unit-price":"",currency:"","capacity-unit":"","capacity-volume":"","capacity-factor":1,"created-at":"","updated-at":"",sponsored:!1,promoted:!1,"variable-capacity":!1,"pft-plages":[]}}get inBasket(){return this._inBasket}set inBasket(e){this._inBasket=e}get capacity(){return this.hasVariableCapacity?this.variableCapacity:this.fixedCapacity}get hasVariableCapacity(){return!(!this.attributes["variable-capacity"]||!this.variableCapacity)}get fixedCapacity(){var e;let t=this.capacityVolume;return this.capacityFactor&&this.capacityFactor>1&&(t=`${this.capacityFactor} x ${t}`),(null===(e=this.capacityUnit)||void 0===e?void 0:e.length)>0&&(t=`${t} ${this.attributes["capacity-unit"]}`),t}get variableCapacity(){return this._variableCapacity}set variableCapacity(e){e&&e.length>0&&(this._variableCapacity=`${e} ${this.capacityUnit}`)}get capacityVolume(){return this.attributes["capacity-volume"]}get capacityFactor(){return this.attributes["capacity-factor"]}get capacityUnit(){return this.attributes["capacity-unit"]}get pftPlages(){return this.attributes["pft-plages"]}get price(){return this.attributes["unit-price"]?parseFloat(this.attributes["unit-price"]):0}get ean(){return this.attributes.ean}get extId(){return this.attributes["ext-id"]}set extId(e){this.attributes["ext-id"]=e}}class _f extends rp{constructor(){super(...arguments),this.attributes={name:"",settings:{drive:{enabled:!0,logo:""},delivery:{enabled:!0,logo:""},mobile_warning:!1},"active-items-count":0,distance:0,address:"",latitude:"",longitude:"","ext-id":""},this.relationships={supplier:new ip,items:new ep}}get references(){return new Intl.NumberFormat("Fr-fr").format(this.attributes["active-items-count"])}get driveEnabled(){const e=this.attributes.settings;return e&&e.drive&&e.drive.enabled}get deliveryEnabled(){const e=this.attributes.settings;return e&&e.delivery&&e.delivery.enabled}get extId(){return this.attributes["ext-id"]}set extId(e){this.attributes["ext-id"]=e}}class vf extends rp{constructor(){super(...arguments),this.attributes={title:"","author-id":"",editable:!1,shared:!1,"catalog-category":!1,"catalog-position":"","recipes-count":"","media-url":"",settings:{}},this.relationships={provider:new ip,status:new ip,recipes:new ep,"shared-suppliers":new ep}}get title(){return this.attributes.title}get status(){return this.relationships&&this.relationships.status&&this.relationships.status.data}get subtitle(){return this.attributes.settings.subtitle}}var bf=i("yerO");class yf extends rp{constructor(){super(...arguments),this.attributes={title:"","ext-id":"","ext-link":"",description:"","number-of-guests":"","preparation-time":"","preheating-time":"","cooking-time":"","resting-time":"","media-url":"",source:"","informational-page-html":"","filigrane-logo-url":"","informational-sentence":"","order-history":"",difficulty:1,cost:1,suggested:!1,popularity:0,"video-id":"",promoted:!1,editable:!1,position:-1},this.relationships={ingredients:new ep,"ingredients-definitions":new ep,"recipe-steps":new ep,"recipe-provider":new ip,"recipe-status":new ip,tags:new ep,"recipe-type":new ip,sponsors:new ep,packages:new ep},this.ttl=3600,this.finalTimer=this.attributes["preparation-time"]+this.attributes["preheating-time"]+this.attributes["cooking-time"]+this.attributes["resting-time"]}get title(){return this.attributes.title}get promoted(){return this.attributes.promoted}get guests(){return this.attributes["number-of-guests"]}get filigraneLogoUrl(){return this.attributes["filigrane-logo-url"]?this.attributes["filigrane-logo-url"]:null}get sponsorName(){return this.sponsors.length>0?this.sponsors[0].attributes.name:null}get sponsorLogoUrl(){return this.sponsors.length>0?this.sponsors[0].attributes["logo-url"]:null}get informationalSentence(){return this.attributes["informational-sentence"]}get costLabel(){switch(this.attributes.cost){case 1:return"faible";case 2:return"moyen";case 3:return"\xe9lev\xe9";default:return"moyen"}}get orderHistory(){return this.attributes["order-history"]}get difficulty(){return this.attributes.difficulty}set difficulty(e){this.attributes.difficulty=e}get totalTime(){const e=Object(bf.normalize)(Object(bf.sum)(Object(bf.parse)(this.attributes["preparation-time"]),Object(bf.parse)(this.attributes["cooking-time"]),Object(bf.parse)(this.attributes["resting-time"])));return Object(bf.toMinutes)(e)<10?" < 10 min":this.formatDuration(e)}get preparationTime(){return this.formatDuration(Object(bf.normalize)(Object(bf.parse)(this.attributes["preparation-time"])))}get cookingTime(){return this.formatDuration(Object(bf.normalize)(Object(bf.parse)(this.attributes["cooking-time"])))}get restingTime(){return this.formatDuration(Object(bf.normalize)(Object(bf.parse)(this.attributes["resting-time"])))}get ingredients(){return this.relationships.ingredients.data.sort((e,t)=>e.attributes["forced-eans"]&&e.attributes["forced-eans"].length>0&&!(t.attributes["forced-eans"]&&t.attributes["forced-eans"].length>0)?-1:e.attributes.position-t.attributes.position)}get sponsors(){var e,t;return null===(t=null===(e=this.relationships)||void 0===e?void 0:e.sponsors)||void 0===t?void 0:t.data}get steps(){return this.relationships["recipe-steps"].data.sort((e,t)=>e.attributes["step-number"]>t.attributes["step-number"]?1:-1)}get status(){return this.relationships&&this.relationships["recipe-status"]&&this.relationships["recipe-status"].data}get recipeType(){return this.relationships&&this.relationships["recipe-type"]&&this.relationships["recipe-type"].data}get modifiedIngredients(){return this.normalizedIngredients.map(e=>Object.assign(Object.assign({},e),{qty:e.qty*(this.modifiedGuests||+this.guests)}))}get normalizedIngredients(){return this._normalizedIngredients&&0!==this._normalizedIngredients.length||(this._normalizedIngredients=this.ingredients.map(e=>({name:e.attributes.name,qty:+e.quantity/(+this.guests||1),unit:e.attributes.unit,picture:e.picture}))),this._normalizedIngredients}get videoId(){return this.attributes["video-id"]}get position(){return this.attributes.position}set position(e){this.attributes.position=e}formatDuration(e){if(!Object(bf.toMinutes)(e))return"-";if(e.days&&(e.hours+=24*e.days),!e.hours)return e.minutes+" min";let t=e.hours+" h";return e.minutes&&(t+=`${e.minutes<10?" 0":" "}${e.minutes}`),t}}class wf extends rp{constructor(){super(...arguments),this.attributes={name:"NoName",logo:null},this.relationships={recipes:new ep}}}class kf extends rp{constructor(){super(...arguments),this.attributes={name:"",label:""}}get hidden(){return"DELETED"===this.name}get name(){return this.attributes.name}get label(){return this.attributes.label}get icon(){switch(this.attributes.name){case"DRAFT":return"text_snippet";case"SUBMITTED":return"schedule";case"ACTIVE":return"done";case"INACTIVE":default:return"highlight_off"}}get color(){switch(this.attributes.name){case"DRAFT":return null;case"SUBMITTED":return"accent";case"ACTIVE":return"primary";case"INACTIVE":default:return null}}}class Cf extends rp{constructor(){super(...arguments),this.attributes={"step-number":0,title:"",description:"","media-url":null},this.relationships={recipe:new ip}}}class Sf extends rp{constructor(){super(...arguments),this.attributes={"tag-type-id":"",name:"","icon-url":"","picture-url":""}}get tagType(){return this.attributes["tag-type-id"]}get name(){return this.attributes.name}}class xf extends rp{constructor(){super(...arguments),this.attributes={name:""}}get name(){return this.attributes.name}}class Ef extends rp{constructor(){super(...arguments),this.attributes={name:"",description:"",logo:"",settings:{}},this.relationships={"point-of-sales":new ep,"catalog-setting":new ip,items:new ep}}get logo(){let e=this.attributes.logo;return e.match(/^assets\//)&&(e=e.replace("assets","https://miam.tech/fr/assets")),e}}class If extends rp{constructor(){super(...arguments),this.attributes={status:"",confirmed:!1,completion:{total:0,found:0},"recipes-infos":[],"total-price":0,token:null},this.relationships={"basket-entries":new ep}}get completion(){return this.attributes.completion}get recipeInfos(){return this.attributes["recipes-infos"]}get entries(){return this.relationships["basket-entries"]&&this.relationships["basket-entries"].data}get totalPrice(){return this.attributes["total-price"]}get token(){return this.attributes.token}hasRecipe(e){var t;return null===(t=this.recipeInfos)||void 0===t?void 0:t.some(t=>t.id===e)}guestsForRecipe(e){var t;return+(null===(t=this.recipeInfos.find(t=>t.id===e))||void 0===t?void 0:t.guests)}}class Pf extends rp{constructor(){super(...arguments),this.attributes={"selected-item-id":"","learning-factor":1,"basket-entries-items":new Array(0),quantity:1,"quantity-to-add":1,"recipe-ids":[],name:"","capacity-volume":1,"capacity-unit":"",status:"active",price:0,"price-per-unit":0,"unit-of-measurement":"","discount-amount":0,"discount-type":"","discounted-price":0},this.relationships={"selected-item":new ip}}get quantity(){return this.attributes.quantity}set quantity(e){this.attributes.quantity=e}get quantityToAdd(){return this.attributes["quantity-to-add"]}set quantityToAdd(e){this.attributes["quantity-to-add"]=e}get status(){return this.attributes.status}set status(e){this.attributes.status=e}get name(){return this.attributes.name}get nameId(){return this.attributes.name.toLowerCase().replace(/ /g,"_")}get recipesIds(){return this.attributes["recipe-ids"]}get ingredientsQuantity(){return this.attributes["capacity-volume"]}get ingredientsUnit(){return this.attributes["capacity-unit"]}get selectedItem(){return this.relationships["selected-item"].data}get price(){return this.attributes.price}get pricePerUnit(){return this.attributes["price-per-unit"]}get unitOfMeasurement(){return this.attributes["unit-of-measurement"]}get discountAmount(){return this.attributes["discount-amount"]}get discountType(){return this.attributes["discount-type"]}get discountedPrice(){return this.attributes["discounted-price"]}get totalprice(){return this.selectedItem?(this.selectedItem.price*this.attributes.quantity).toFixed(2):""}}class Df{constructor(){this._displayMode=!1}get displayMode(){return this._displayMode}set displayMode(e){e&&(this.description[0]=this.description[0].replace("article","ingr\xe9dient")),this._displayMode=e}static fromRecipe(e,t,i=null,n=null,r=null){const s=new Df;return Object.assign(s,{id:e.id,isRecipe:!0,title:e.attributes.title,picture:e.attributes["media-url"],description:[`${t} article${t>1?"s":""}`],count:e.modifiedGuests||e.guests,entries:r}),i&&s.description.push(""+i.toFixed(2)),null!=n&&(s.price=""+n.toFixed(2)),s}static fromBasketEntry(e,t,i){var n;const r=new Df,s=e.selectedItem,o=e.attributes["basket-entries-items"].find(t=>t.item_id===e.attributes["selected-item-id"]),a=parseFloat(o["unit-price"]),c=null===(n=e.recipesIds)||void 0===n?void 0:n.length;return s&&o&&null!=a&&Object.assign(r,Object.assign({id:e.id,record:e,isRecipe:!1,inlineTag:c&&c>1?`Pour ${c} repas`:null,title:e.name,picture:s.attributes.image,description:[`${s.attributes.brand?s.attributes.brand:""} ${s.attributes.name} | ${s.capacity}`],price:""+a.toFixed(2),count:e.quantity+e.quantityToAdd},t&&{recipe:t,ingredient:i})),r}hasEntries(){return this.entries&&(this.entries.found.length>0||this.entries.notFound.length>0||this.entries.oftenDeleted.length>0||this.entries.removed.length>0)}}class Tf extends rp{constructor(){super(...arguments),this.attributes={name:"","logo-url":"","provider-id":""}}}class Af{constructor(e={}){this.user_metadata={preferences:{}},this.forbidProfiling=!1,Object.assign(this,e)}get supplierId(){var e;return void 0===this.app_metadata.env?null:null===(e=this.app_metadata.env.prod)||void 0===e?void 0:e.supplier_id}}class Rf extends rp{constructor(){super(...arguments),this.attributes={"banner-text":null,"banner-image":null},this.relationships={supplier:new ip}}}class Of extends rp{constructor(){super(...arguments),this.attributes={position:0,height:0,width:0,"video-url":"","picture-url":"",content:"","background-color":"","font-size":0,"font-color":""},this.relationships={"sponsor-block-type":new ip,sponsor:new ip}}get position(){return this.attributes.position}get height(){var e,t;return this.attributes.height||(null===(t=null===(e=this.relationships["sponsor-block-type"])||void 0===e?void 0:e.data)||void 0===t?void 0:t.defaultHeight)}get width(){var e,t;return this.attributes.width||(null===(t=null===(e=this.relationships["sponsor-block-type"])||void 0===e?void 0:e.data)||void 0===t?void 0:t.defaultWidth)}get videoUrl(){return this.attributes["video-url"]}get pictureUrl(){return this.attributes["picture-url"]}get content(){return this.attributes.content}get backgroundColor(){return this.attributes["background-color"]}get fontSize(){return this.attributes["font-size"]}get fontColor(){return this.attributes["font-color"]}get style(){return{"grid-row":"span "+this.height,"grid-column":"span "+this.width,"aspect-ratio":this.width+" / "+this.height}}}class Ff extends rp{constructor(){super(...arguments),this.attributes={name:"","icon-url":"",description:"","default-height":0,"default-width":0,"mandatory-fields":[]}}get name(){return this.attributes.name}get iconUrl(){return this.attributes["icon-url"]}get description(){return this.attributes.description}get defaultHeight(){return this.attributes["default-height"]}get defaultWidth(){return this.attributes["default-width"]}get mandatoryFields(){return this.attributes["mandatory-fields"]}}class Bf extends rp{constructor(){super(...arguments),this.attributes={"is-past":!0,"recipe-id":""},this.relationships={recipe:new ip}}get isPast(){return this.attributes["is-past"]}set isPast(e){this.attributes["is-past"]=e}toggle(){this.isPast=!this.isPast}}class Mf extends rp{constructor(){super(...arguments),this.attributes={title:"",status:"",guests:4,budget:0,"point-of-sale-id":null},this.relationships={"menu-recipes":new ep,recipes:new ep}}}var Lf=function(e){return e[e.ADD_RECIPE=0]="ADD_RECIPE",e[e.REMOVE_RECIPE=1]="REMOVE_RECIPE",e[e.REMOVE_RECIPE_LIGHT=2]="REMOVE_RECIPE_LIGHT",e[e.UPDATE_RECIPE=3]="UPDATE_RECIPE",e[e.UPDATE_RECIPE_LIGHT=4]="UPDATE_RECIPE_LIGHT",e[e.ADD_RECIPE_LIGHT=5]="ADD_RECIPE_LIGHT",e[e.ADD_PRODUCT=6]="ADD_PRODUCT",e[e.ADD_ITEM=7]="ADD_ITEM",e[e.REMOVE_PRODUCT=8]="REMOVE_PRODUCT",e[e.REMOVE_PRODUCT_FROM_RECIPE=9]="REMOVE_PRODUCT_FROM_RECIPE",e[e.UPDATE_PRODUCT=10]="UPDATE_PRODUCT",e}({}),$f=function(e){return e[e.Success=0]="Success",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e}({});const jf={"basket-entries":["id","quantity","selected-item-id"]};let zf=(()=>{class e extends sp{constructor(e){super(),this.http=e,this.resource=Pf,this.type="basket-entries",this.register()}get sparseFields(){return"fields[basket-entries]="+jf["basket-entries"].join(",")}updateQuantity(e,t){return this.http.patch(encodeURI(`https://api.miam.tech/api/v1/basket-entries/${e}/quantity/${t}?${this.sparseFields}`.trim()),{})}selectItem(e,t,i){const n=new URL(`https://api.miam.tech/api/v1/basket-entries/${e}/select-item/${t}`.trim());return void 0!==i&&n.searchParams.set("forced_quantity",i.toString()),this.http.patch(encodeURI(n.toString()),{})}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Nf=(()=>{class e extends sp{constructor(e){super(),this.http=e,this.resource=Ef,this.type="suppliers",this.supplier$=new cp(null),this.lastSupplierCart=[],this.url=Ip+"/api/v1",this.register()}loadSupplier(e){return this.supplier$.next(null),this.supplier$.value&&this.supplier$.value.id===e?td(null):this.get(e,{include:["catalog-setting"]}).pipe(bp(e=>e.is_loading),df(e=>this.supplier$.next(e)))}getSupplierPointOfSales(e){return this.http.get(`${this.url}/point-of-sales?filter[supplier_id]=${e}`).pipe(E(e=>e.data))}getAffiliateSuppliers(){return this.all({remotefilter:{affiliate:!0}}).pipe(E(e=>e.data))}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Vf=(()=>{class e extends sp{constructor(e,t){super(),this.suppliersService=e,this.http=t,this.resource=_f,this.type="point-of-sales",this.pos$=new cp(void 0),this.basketLoadedForNewPos$=new C,this.posIsLoading$=new cp(!1),this.register(),this.navigateToCachedRecipeOnPosChange()}get waitForPos(){return this.posWasInitialized().pipe(bp(e=>!e),th(()=>this.pos$),bp(e=>!(null==e?void 0:e.id)))}posWasInitialized(){return Xg([this.pos$,this.posIsLoading$]).pipe(bp(([e,t])=>t),E(([e,t])=>null!=e))}loadPos(e){return this.posIsLoading$.next(!0),this.pos$.value&&this.pos$.value.id===e||this.get(e,{include:["supplier"]}).pipe(bp(e=>e.is_loading),df(e=>{this.pos$.next(e),this.posIsLoading$.next(!1)})).subscribe(),this.pos$}isPosValid(){return this.pos$.pipe(E(e=>{var t,i,n;return!!(null===(n=null===(i=null===(t=null==e?void 0:e.relationships)||void 0===t?void 0:t.supplier)||void 0===i?void 0:i.data)||void 0===n?void 0:n.id)}))}loadPosWithExtId(e){return e?(this.posIsLoading$.next(!0),this.suppliersService.supplier$.pipe(bp(e=>!(null==e?void 0:e.id)),fp(1),th(t=>this.all({remotefilter:{"ext-id":e,"supplier-id":t.id},include:["supplier"],fields:{"point-of-sales":["name","settings","active-items-count","distance","address","latitude","longitude","ext-id","supplier"],supplier:["id"]}}).pipe(bp(e=>e.is_loading),df(e=>{e.data.length>0?(this.pos$.next(e.data[0]),this.posIsLoading$.next(!1)):(this.pos$.next(null),this.posIsLoading$.next(!1))})))).subscribe(),this.pos$):(this.pos$.next(null),this.posIsLoading$.next(!1),this.pos$)}navigateToCachedRecipeOnPosChange(){this.isPosValid().pipe(bp(e=>!e),fp(1)).subscribe(()=>{const e=sessionStorage.getItem("_miam/cachedRecipeUrl");e&&(sessionStorage.removeItem("_miam/cachedRecipeUrl"),window.location.href.includes(e)||(window.location.href=e))},e=>{xp(e)})}posFromStorage(){const e=localStorage.getItem("_miam/noSupplier/posId");e?this.loadPos(e).pipe(fp(1)).subscribe():this.loadPosWithExtId(null)}getByAddress(e,t,i,n=!0){let r=`https://api.miam.tech/api/v1/point-of-sales/search?address=${e}&max_distance_km=${t}&filter[affiliate]=true`;return i.length>0&&(r+="&filter[supplier_id]="+i.join(",")),n&&(r+="&include=supplier"),this.http.get(r)}getByCoordinates(e,t,i,n,r=!0){let s=`https://api.miam.tech/api/v1/point-of-sales/search?latitude=${e}&longitude=${t}&max_distance_km=${i}&filter[affiliate]=true`;return n.length>0&&(s+="&filter[supplier_id]="+n.join(",")),r&&(s+="&include=supplier"),this.http.get(s)}emitBasketLoadedForNewPos(){this.basketLoadedForNewPos$.next()}basketLoadedForNewPos(){return this.basketLoadedForNewPos$.asObservable()}}return e.\u0275fac=function(t){return new(t||e)(nn(Nf),nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class Hf{constructor(e={}){Object.assign(this,e)}}class Uf{constructor(e){this.difficulty=null==e?void 0:e.difficulty,this.cost=null==e?void 0:e.cost,this.time=null==e?void 0:e.time,this.search=null==e?void 0:e.search,this.reviewed=null==e?void 0:e.reviewed,this.exclude_no_picture=null==e?void 0:e.exclude_no_picture,this.additionalFilters=null==e?void 0:e.additionalFilters}eventPath(){var e,t;let i="";const n=null===(e=this.additionalFilters)||void 0===e?void 0:e.filters.packages,r=!0===(null===(t=this.additionalFilters)||void 0===t?void 0:t.filters.liked);return n?i+="categories/"+n:r&&(i+="liked"),i}copy(){return new Uf(Object.assign({},this))}isEmpty(){var e;return this.selectableFiltersCount()<1&&""===this.search&&!(null===(e=this.additionalFilters)||void 0===e?void 0:e.filters)}selectableFiltersCount(){return[this.isFieldEmpty(this.difficulty),this.isFieldEmpty(this.cost),this.isFieldEmpty(this.time)].reduce((e,t)=>e+ +!t,0)}isFieldEmpty(e){if(!e)return!0;for(const t of e)if(t.value)return!1;return!0}}let qf=(()=>{class e extends sp{constructor(){super(),this.resource=wf,this.type="recipe-providers",this.register()}init(e){return this.register(),this.loadCachedProvider(e).toPromise()}getCached(){return this.provider}loadCachedProvider(e){return td(e).pipe(th(()=>this.get(e)),df(e=>this.provider=e))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Gf=(()=>{class e extends sp{constructor(){super(),this.resource=kf,this.type="recipe-statuses",this.validated$=new cp(null),this.draft$=new cp(null),this.deleted$=new cp(null),this.inactive$=new cp(null),this.fetching=!1,this.register()}get validated(){return this.validated$.value||this.fetching||this.fetchStatuses(),this.validated$.asObservable().pipe(bp(e=>null==e))}get draft(){return this.draft$.value||this.fetching||this.fetchStatuses(),this.draft$.asObservable().pipe(bp(e=>null==e))}get deleted(){return this.deleted$.value||this.fetching||this.fetchStatuses(),this.deleted$.asObservable().pipe(bp(e=>null==e))}get inactive(){return this.inactive$.value||this.fetching||this.fetchStatuses(),this.inactive$.asObservable().pipe(bp(e=>null==e))}get validatedValue(){return this.validated$.getValue()}get draftValue(){return this.draft$.getValue()}get deletedValue(){return this.deleted$.getValue()}get inactiveValue(){return this.inactive$.getValue()}fetchStatuses(){this.fetching=!0,nf([this.get("validated"),this.get("draft"),this.get("deleted"),this.get("inactive")]).pipe(bp(e=>e.some(e=>e.is_loading||!e))).subscribe(([e,t,i,n])=>{this.validated$.next(e),this.draft$.next(t),this.deleted$.next(i),this.inactive$.next(n)})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Wf=(()=>{class e extends sp{constructor(){super(),this.resource=xf,this.type="recipe-types",this.register()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Zf=(()=>{class e{constructor(){this.subject=new cp(null),this.toaster$=this.subject.asObservable().pipe(id(e=>null!==e))}show(e,t,i,n=!0){this.subject.next({type:e,title:t,customMessage:i,displayIcon:n})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Qf=(()=>{class e{get ignoredIngredients(){return JSON.parse(sessionStorage.getItem("_miam/ignoredBasketEntries")||"[]")}addIgnoredIngredients(e){"string"==typeof e&&(e=[e]),e=e.filter(e=>!this.isIngredientIgnored(e)),sessionStorage.setItem("_miam/ignoredBasketEntries",JSON.stringify([...this.ignoredIngredients,...e]))}isIngredientIgnored(e){return this.ignoredIngredients.includes(e)}removeIngredientFromIgnored(e){sessionStorage.setItem("_miam/ignoredBasketEntries",JSON.stringify(this.ignoredIngredients.filter(t=>t!==e)))}resetIgnoredIngredients(){sessionStorage.removeItem("_miam/ignoredBasketEntries")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Yf=(()=>{class e{constructor(e,t,i,n,r){this.http=e,this.recipesProvidersService=t,this.suppliersService=i,this.toasterService=n,this.ignoredBasketsService=r,this.isLogged$=new cp(!1),this.preferencesActivated$=new cp(!1),this.generatingAuthlessId$=new cp(!1),this.userCoordinates$=new cp(void 0),this.userInfo$=new cp(void 0),this.userRoles$=new cp([]),this.userProvider$=new cp(void 0),this.userSupplier$=new cp(void 0)}get userProvider(){return this.userProvider$.pipe(bp(e=>void 0===e))}get userSupplier(){return this.isAdmin.pipe(th(e=>e?td(null):this.userSupplier$.pipe(bp(e=>void 0===e))))}get userRoles(){return this.userRoles$}get isAdmin(){return this.userRoles$.pipe(bp(e=>0===e.length),th(e=>td(e.includes("Admin"))))}setUserProviderManually(e){this.userProvider$.next(e)}toggleIsLogged(e){this.isLogged$.next(e)}setUserInfo(e){const t=new Af({forbidProfiling:e});return this.http.get(Ip+"/user_info").pipe(fp(1),th(e=>(this.userInfo$.next(Object.assign(t,e)),localStorage.getItem("_miam/authlessId")&&this.ignoredBasketsService.resetIgnoredIngredients(),this.initRoles(),Xg([this.initProvider(),this.initSupplier()]))),bp(e=>void 0===e[0]||void 0===e[1]),fp(1))}resetUserInfo(){this.userInfo$.next(null),this.userRoles$.next([]),this.userProvider$.next(null),this.userSupplier$.next(null)}generateAnonymousUserId(){return this.generatingAuthlessId$.next(!0),this.http.post("https://api.miam.tech/api/v1/users/authless",{}).pipe(E(e=>e.authless_id),df(e=>{localStorage.setItem("_miam/authlessId",e),this.generatingAuthlessId$.next(!1)}))}setPreference(e,t){return this.userInfo$.pipe(bp(e=>!(null==e?void 0:e.user_metadata)),fp(1),th(i=>(i.user_metadata.preferences||(i.user_metadata.preferences={}),i.user_metadata.preferences[e]===t?td(i):(i.user_metadata.preferences[e]=t,this.http.patch(Ip+"/user_info",{data:i}).pipe(E(()=>i))))),df(e=>{this.showRecipeToaster(),this.userInfo$.next(e)}))}showRecipeToaster(){this.toasterService.show($f.Success,"","Vos pr\xe9f\xe9rences ont bien e\u0301te\u0301 mises a\u0300 jour")}hasPreference(e){return this.userInfo$.pipe(bp(e=>!(null==e?void 0:e.user_metadata)),E(t=>{var i,n;return!(!(null===(i=null==t?void 0:t.user_metadata)||void 0===i?void 0:i.preferences)||void 0===(null===(n=null==t?void 0:t.user_metadata)||void 0===n?void 0:n.preferences[e]))}))}setFavoriteItems(e){return this.suppliersService.supplier$.pipe(bp(e=>!e),fp(1),th(t=>this.http.post(Ip+"/set_favorite_items",{item_ext_ids:e,supplier_id:t.id})))}profilingForbidden(){var e;return null===(e=this.userInfo$.value)||void 0===e?void 0:e.forbidProfiling}can(e){return this.userInfo$.pipe(E(t=>null==t?void 0:t.app_metadata.permissions.includes(e)))}initProvider(){return this.userInfo$.pipe(th(e=>this.recipesProvidersService.get((null==e?void 0:e.app_metadata.recipe_provider)||"personal")),bp(e=>null==e),df(e=>this.userProvider$.next(e)))}initSupplier(){return this.userInfo$.pipe(th(e=>(null==e?void 0:e.supplierId)?this.suppliersService.get(e.supplierId):td(null)),bp(e=>void 0===e),df(e=>this.userSupplier$.next(e)))}initRoles(){var e;this.userRoles$.next((null===(e=this.userInfo$.value)||void 0===e?void 0:e.app_metadata.roles)||[])}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(qf),nn(Nf),nn(Zf),nn(Qf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Kf=(()=>{class e extends sp{constructor(){super(),this.resource=gf,this.type="ingredients-definitions",this.register()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const Jf=Ip+"/api/v1/";let Xf=(()=>{class e extends sp{constructor(e,t,i){super(),this.http=e,this.userService=t,this.ingredientsdefinitionsService=i,this.resource=mf,this.type="ingredients",this.isFetchingNames=!1,this.isFetchingUnits=!1,this.register()}getReviewedNames(){return this.reviewedNames||this.isFetchingNames||this.fetchReviewedNames(),this.reviewedNames||[]}getReviewedUnits(){return this.reviewedUnits||this.isFetchingUnits||this.fetchReviewedUnits(),this.reviewedUnits||[]}isReviewedName(e){return this.reviewedNames?td(this.reviewedNames.some(t=>t===e)):this.http.get(Jf+"ingredients-definitions/reviewed_names").pipe(th(t=>(this.reviewedNames=t,td(this.reviewedNames.some(t=>t===e)))))}isReviewedUnit(e){return this.reviewedUnits?td(this.reviewedUnits.some(t=>t.toLowerCase()===e.toLowerCase())):this.http.get(Jf+"quantity-units/reviewed_names").pipe(th(t=>(this.reviewedUnits=[...t.map(e=>e.name)],td(this.reviewedUnits.some(t=>t.toLowerCase()===e.toLowerCase())))))}formatIngredients(e){return nf(e.map(e=>this.get("from_s?ingredient_str="+e)))}createOrUpdateIngredients(e,t){const i=[...e.relationships.ingredients.data],n=[];return t.forEach(t=>{if(t.id){const e=i.findIndex(e=>e.id===t.id),r=i[e].attributes;(r.quantity!==t.attributes.quantity||r.importance!==t.attributes.importance||r["forced-eans"]!==t.attributes["forced-eans"]||r.position!==t.attributes.position)&&(i[e].attributes=Object.assign(Object.assign({},i[e].attributes),{quantity:t.attributes.quantity,importance:t.attributes.importance,"forced-eans":t.attributes["forced-eans"],position:t.attributes.position}),n.push(i[e]))}else{const i=this.new();delete i.id,i.attributes=Object.assign(Object.assign({},i.attributes),{quantity:""+t.attributes.quantity,importance:t.attributes.importance,position:t.attributes.position}),i.addRelationship(e,"recipe"),i.addRelationship(t.relationships["quantity-unit"].data,"quantity-unit"),i.addRelationship(t.relationships.definition.data,"definition"),n.push(i)}}),n}upsertIngredientList(e){return nf(e.map(e=>e.save()))}deleteIngredientList(e){return nf(e.map(e=>this.delete(e)))}searchIngredientByName(e){return this.http.get(`${Jf}ingredients-definitions/search?name=${e}`).pipe(E(e=>{const t=this.ingredientsdefinitionsService.newCollection();return t.fill(e),t.data}))}searchUnitByName(e){return this.http.get(`${Jf}quantity-units/search?name=${e}`).pipe(E(e=>e.data))}fetchQuantityToAdd(e,t,i){return this.http.get(`${Jf}ingredients/${e}/item-quantity?guests=${t}&item_id=${i}`).pipe(E(e=>e["quantity-to-add"]))}getConversion(e,t,i){return this.http.get(`${Jf}quantities-conversions/grams?ingredient_name=${e}&quantity_unit_id=${t}&quantity=${i}`)}fetchReviewedNames(){this.isFetchingNames=!0,this.http.get(Jf+"ingredients-definitions/reviewed_names").subscribe(e=>{this.reviewedNames=e,this.isFetchingNames=!1})}fetchReviewedUnits(){this.isFetchingUnits=!0,this.http.get(Jf+"quantity-units/reviewed_names").subscribe(e=>{this.reviewedUnits=[...e.map(e=>e.name)],this.isFetchingUnits=!1})}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Yf),nn(Kf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var e_=function(e,t){return t.length<2?e:Rg(e,function(e,t,i){var n=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(i=i>r?r:i)<0&&(i+=r),r=t>i?0:i-t>>>0,t>>>=0;for(var s=Array(r);++n<r;)s[n]=e[n+t];return s}(t,0,-1))},t_=Array.prototype.splice,i_=function(e,t){if(e!==t){var i=void 0!==e,n=null===e,r=e==e,s=_g(e),o=void 0!==t,a=null===t,c=t==t,l=_g(t);if(!a&&!l&&!s&&e>t||s&&o&&c&&!a&&!l||n&&o&&c||!i&&c||!r)return 1;if(!n&&!s&&!l&&e<t||l&&i&&r&&!n&&!s||a&&i&&r||!o&&r||!c)return-1}return 0},n_=function(e){return Vg(jg(e,void 0,Xp),e+"")}((function(e,t){var i=null==e?0:e.length,n=function(e,t){for(var i=-1,n=t.length,r=Array(n),s=null==e;++i<n;)r[i]=s?void 0:Og(e,t[i]);return r}(e,t);return function(e,t){for(var i=e?t.length:0,n=i-1;i--;){var r=t[i];if(i==n||r!==s){var s=r;Nm(r)?t_.call(e,r,1):(a=Tg(a=r,o=e),null==(o=e_(o,a))||delete o[Ag(Wg(a))])}}var o,a}(e,Ig(t,(function(e){return Nm(e,i)?+e:e})).sort(i_)),n}));let r_=(()=>{class e extends sp{constructor(){super(),this.resource=Cf,this.type="recipe-steps",this.register()}formToStepsMapper(e,t){const i=[...e.relationships["recipe-steps"].data],n=[];return t.forEach((t,r)=>{if(t.id){const e=i.findIndex(e=>e.id===t.id);i[e].attributes=Object.assign(Object.assign({},i[e].attributes),{"step-number":r,description:t.attributes.description}),n.push(n_(i,[e])[0])}else n.push(this.newStep(t,e,r))}),n}newStep(e,t,i){const n=this.new();return n.addRelationship(t,"recipe"),n.attributes=Object.assign(Object.assign({},n.attributes),{"step-number":i,description:e.attributes.description}),delete n.id,n}createOrUpdateRelatedSteps(e){return nf(e.map(e=>e.save()))}deleteStepList(e){return nf(e.map(e=>this.delete(e)))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),s_=(()=>{class e extends sp{constructor(){super(),this.resource=Tf,this.type="sponsors",this.register()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),o_=(()=>{class e extends sp{constructor(e,t,i){super(),this.http=e,this.providerService=t,this.statusService=i,this.resource=vf,this.type="packages",this.register()}categories_for(e,t=30,i=1){return this.all({page:{size:t,number:i},remotefilter:{category_for:e.join(","),status:"validated"},sort:["catalog_position"]})}unshareWithSupplier(e,t){return this.http.delete(`https://api.miam.tech/api/v1/packages/${e.id}/suppliers/${t.id}`,{headers:{"content-type":"application/vnd.api+json"}})}shareWithSupplierOrUpdate(e,t,i,n,r){const s=Object.assign(Object.assign(Object.assign({},null!==i?{category:i}:{}),null!==n?{catalog_position:n}:{}),null!==r?{edit_content:r}:{}),o=`https://api.miam.tech/api/v1/packages/${e.id}/suppliers/${t.id}`;return e.attributes.shared?this.http.patch(o,s,{headers:{"content-type":"application/vnd.api+json"}}):this.http.post(o,s,{headers:{"content-type":"application/vnd.api+json"}})}removeRecipeFromPackage(e,t){return this.http.delete(`https://api.miam.tech/api/v1/packages/${e.id}/recipes/${t.id}`,{headers:{"content-type":"application/vnd.api+json"}})}addRecipeToPackage(e,t){return this.http.post(`https://api.miam.tech/api/v1/packages/${e.id}/recipes/${t.id}`,{},{headers:{"content-type":"application/vnd.api+json"}})}updateRecipePosition(e,t,i){const n=`https://api.miam.tech/api/v1/packages/${e.id}/recipes/${t.id}`;return null!==i?this.http.patch(n,{position:i},{headers:{"content-type":"application/vnd.api+json"}}):this.http.post(n,{},{headers:{"content-type":"application/vnd.api+json"}})}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(qf),nn(Gf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),a_=(()=>{class e extends sp{constructor(e){super(),this.http=e,this.resource=Sf,this.type="tags",this.register()}autocomplete(e){return this.http.get("https://api.miam.tech/api/v1/tags/autocomplete/"+e)}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),c_=(()=>{class e{constructor(e,t){this.suppliersService=e,this.userService=t}buildHeaders(){let e=new ad;const t=localStorage.getItem("_miam/userId")||localStorage.getItem("_miam/authlessId"),i=sessionStorage.getItem("_miam/sessionId"),n=this.suppliersService.token,r=this.userService.language;return null!==t&&(e=e.set("Authorization","user_id "+t)),n&&(e=e.set("supplier-token",n)),r&&(e=e.set("language-id",r)),i&&(e=e.set("session-id",i)),e}}return e.\u0275fac=function(t){return new(t||e)(nn(Nf),nn(Yf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),l_=(()=>{class e extends sp{constructor(e,t,i,n){super(),this.analyticsService=e,this.userService=t,this.httpUtils=i,this.http=n,this.resource=Bf,this.type="recipe-likes",this.activeRecipeLikes=new Map,this.recipeLikeUpdated$=new cp({id:"",isPast:!1}),this.MAX_RECIPE_LIKES_BEFORE_CLEAN=200,this.cleanUnobservedLikesIfNecessary=new Rc,this.isCleaning=new cp(!1),this.register(),this.cleanUnobservedLikesIfNecessary.pipe(df(()=>this.isCleaning.next(!0)),of(100)).subscribe(()=>{this.doCleanUnobservedLikesIfNecessary()})}getLike(e){return this.addLikeToActivesIfNecessary(e),this.activeRecipeLikes.get(e)}prepareRecipeLikeForUpdate(e,t,i){const n=this.getLike(e).value;return n.isPast=i,n.attributes["recipe-id"]=e,t&&(n.id=t,n.is_new=!1,this.activeRecipeLikes.set(e,new cp(n))),n}updateLike(e,t,i){t.save().subscribe(()=>{this.analyticsService.sendEvent(t.isPast?"recipe.unlike":"recipe.like",i.originPath,{recipe_id:e,category_id:i.props.category_id}),this.recipeLikeUpdated$.next({id:e,isPast:t.isPast}),this.activeRecipeLikes.get(e).next(t)})}addLikeToActivesIfNecessary(e){this.activeRecipeLikes.get(e)||(this.activeRecipeLikes.set(e,new cp(this.new())),this.fetchLikesOfRecipe(e).subscribe(t=>{t.data[0]&&this.activeRecipeLikes.get(e)&&this.activeRecipeLikes.get(e).next(t.data[0])}))}removeLikeFromActivesIfNecessary(e){const t=this.activeRecipeLikes.get(e);t&&0===t.observers.length&&this.activeRecipeLikes.delete(e)}doCleanUnobservedLikesIfNecessary(){if(this.activeRecipeLikes.size<this.MAX_RECIPE_LIKES_BEFORE_CLEAN)return void this.isCleaning.next(!1);const e=[];for(const[t,i]of this.activeRecipeLikes)i&&0===i.observers.length&&e.push(t);e.forEach(e=>this.activeRecipeLikes.delete(e)),this.isCleaning.next(!1)}addLikesToRecipes(e){return this.userService.isLogged$.value?this.isCleaning.asObservable().pipe(bp(e=>e),fp(1),th(()=>this.afterCleanAddLikesToRecipes(e))):td(null)}getLikeHTML(e){const t=this.httpUtils.buildHeaders(),i=new URLSearchParams;return i.append("recipe-id",e),this.http.get("https://ssr-api.mealz.ai/v2/like-button?"+i,{headers:t,responseType:"text"})}afterCleanAddLikesToRecipes(e){return 0===(e=e.filter(e=>!this.activeRecipeLikes.has(e.id))).length?td(null):this.all({page:{size:20,number:1},remotefilter:{recipe_id:e.map(e=>e.id).join(),is_past:"true,false"}}).pipe(bp(e=>e.is_loading),df(t=>{t.data.forEach(t=>{this.activeRecipeLikes.set(t.attributes["recipe-id"].toString(),new cp(t)),e=e.filter(e=>e.id!==t.attributes["recipe-id"].toString())}),e.forEach(e=>{this.activeRecipeLikes.set(e.id,new cp(this.new()))})}))}fetchLikesOfRecipe(e){return this.all({remotefilter:{recipe_id:e,is_past:"true,false"}}).pipe(bp(e=>e.is_loading))}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(Yf),nn(c_),nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),u_=(()=>{class e{constructor(e,t,i,n){this.suppliersService=e,this.titleService=t,this.metaService=i,this.locale=n,this.tags=[],this.subscription=[]}setSEOData(e){var t;this.previousTitle=this.titleService.getTitle(),this.previousRobotsTagContent=null===(t=this.metaService.getTag("name=robots"))||void 0===t?void 0:t.content,this.previousCanonicalLinkHref=window.document.querySelector('link[rel="canonical"]').getAttribute("href"),this.recipe=e,this.subscription.push(this.supplierIsRecipeProvider().subscribe(e=>{e?(this.metaService.updateTag({name:"robots",content:"index, follow"},'name="robots"'),this.setCanonicalUrlTag(),this.addSEOScript()):this.metaService.updateTag({name:"robots",content:"noindex, nofollow"},'name="robots"'),this.addSEOTags(),this.repositionMetaTags()}))}setCanonicalUrlTag(){const e=window.document.querySelector('link[rel="canonical"]');e&&e.setAttribute("href",window.location.href)}repositionMetaTags(){const e=document.head.querySelectorAll("meta"),t=document.getElementsByTagName("head")[0];e.forEach(e=>{t.insertBefore(e,t.firstChild)})}removeSEOData(){this.subscription.forEach(e=>e.unsubscribe()),this.tags.forEach(e=>this.metaService.removeTagElement(e)),this.removeSEOScript(),this.titleService.setTitle(this.previousTitle),this.previousRobotsTagContent?this.metaService.updateTag({name:"robots",content:this.previousRobotsTagContent}):this.metaService.removeTag('name="robots"'),this.rollbackCanonicalLink()}rollbackCanonicalLink(){const e=window.document.querySelector('link[rel="canonical"]');e&&this.previousCanonicalLinkHref?e.setAttribute("href",this.previousCanonicalLinkHref):e.remove()}addSEOTags(){this.titleService.setTitle(this.recipe.attributes.title+" | "+this.supplier.attributes.name),this.tags=this.metaService.addTags([{property:"og:type",content:"recipe"},{property:"og:title",content:this.recipe.attributes.title},{property:"og:image",content:this.recipe.attributes["media-url"]},{property:"og:url",content:window.location.href},{property:"og:site_name",content:this.supplier.attributes.name},{property:"og:locale",content:this.locale},{name:"description",content:"Commandez la recette "+this.recipe.attributes.title+" en 1 clic chez votre magasin "+this.supplier.attributes.name+" pr\xe9f\xe9r\xe9."},{name:"keywords",content:"recettes, cuisine, recette, recettes de cuisine, plat, entr\xe9e, dessert, plat de r\xe9sistance, drive, courses, courses en ligne, courses en drive, courses en 1 clic, faites vos courses, cuisine, ingr\xe9dients, ingr\xe9dient"},{name:"viewport",content:"width=device-width, initial-scale=1.0"},{name:"Distribution",content:"global"},{name:"Author",content:"Mealz, "+this.supplier.attributes.name}])}supplierIsRecipeProvider(){return this.suppliersService.supplier$.pipe(bp(e=>null==e),fp(1),E(e=>(this.supplier=e,this.recipe.relationships["recipe-provider"].data.id.toLowerCase()===e.attributes.name.toLowerCase())))}buildJsonLD(){var e;const t=bf.toString(bf.sum(bf.normalize(this.recipe.attributes["preparation-time"]),bf.normalize(this.recipe.attributes["cooking-time"]),bf.normalize(this.recipe.attributes["resting-time"]))),i=this.recipe.relationships.tags.data.filter(e=>"diet"===e.tagType).map(e=>e.id),n=i.includes("diet_sans-gluten")?"https://schema.org/GlutenFreeDiet":i.includes("diet_sans-lactose")?"https://schema.org/LowLactoseDiet":i.includes("diet_vegan")?"https://schema.org/VeganDiet":i.includes("diet_vegetarien")||i.includes("diet_veggie")?"https://schema.org/VegetarianDiet":"",r=null===(e=this.recipe.relationships.tags.data.find(e=>"meal_type"===e.tagType))||void 0===e?void 0:e.name,s=this.recipe.ingredients.map(e=>`${+e.attributes.quantity} ${e.attributes.unit} ${e.attributes.name}`),o=this.recipe.steps.map(e=>Object.assign({"@type":"HowToStep",text:e.attributes.description},e.attributes["media-url"]?{image:e.attributes["media-url"]}:{}));return JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"@context":"https://schema.org/","@type":"Recipe",name:this.recipe.title,author:{"@type":"Organization",name:this.supplier.attributes.name},recipeIngredient:s,recipeInstructions:o,recipeYield:(this.recipe.modifiedGuests||this.recipe.guests)+" servings"},this.recipe.attributes["media-url"]?{image:[this.recipe.attributes["media-url"]]}:{}),this.recipe.attributes.description?{description:this.recipe.attributes.description}:{}),bf.toMinutes(this.recipe.attributes["preparation-time"])?{prepTime:this.recipe.attributes["preparation-time"]}:{}),bf.toMinutes(this.recipe.attributes["cooking-time"])?{cookTime:this.recipe.attributes["cooking-time"]}:{}),bf.toMinutes(t)?{totalTime:t}:{}),r?{recipeCategory:r}:{}),n?{suitableForDiet:n}:{}))}addSEOScript(){this.removeSEOScript();const e=document.createElement("script");e.type="application/ld+json",e.text=this.buildJsonLD(),e.id="mealz-seo-script",document.head.appendChild(e)}removeSEOScript(){const e=document.getElementById("mealz-seo-script");e&&document.head.removeChild(e)}}return e.\u0275fac=function(t){return new(t||e)(nn(Nf),nn(Gh),nn(Hh),nn(nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),d_=(()=>{class e{constructor(e){this.http=e,this.tagsToAdd=[],this.tagsToRemove=[],this.isOpened$=new cp(!1),this.currentPreferencesNumber=new cp(0),this.guests$=new cp(0),this.initGuests(),this.updatePreferencesCount()}get guests(){return this.guests$.value}set guests(e){this.guests$.next(e)}get preferencesInStorage(){return localStorage.getItem("_miam/preferences")?JSON.parse(localStorage.getItem("_miam/preferences")):null}initGuests(){this.guests$.next(+localStorage.getItem("_miam/preferences/guests")||4)}tagIsInStorage(e,t){const i=this.preferencesInStorage;return!!(i&&i.with&&i.without)&&(t?i.without.findIndex(t=>t.id===e.id)>-1:i.with.findIndex(t=>t.id===e.id)>-1)}tagShouldBeChecked(e,t){return"equipment"===e.attributes["tag-type-id"]?!this.tagIsInStorage(e,t)&&!this.tagWasAlreadyAdded(e)||this.tagWasAlreadyRemoved(e):this.tagIsInStorage(e,t)&&!this.tagWasAlreadyRemoved(e)||this.tagWasAlreadyAdded(e)}resetPreferences(){localStorage.setItem("_miam/preferences/guests","4"),localStorage.setItem("_miam/preferences",JSON.stringify({with:[],without:[]})),this.guests$.next(+localStorage.getItem("_miam/preferences/guests")||4),this.resetTagsActions()}resetTagsActions(){this.tagsToAdd=[],this.tagsToRemove=[],this.guests$.next(+localStorage.getItem("_miam/preferences/guests")||4)}sendCacheRequest(e,t,i){const n=localStorage.getItem("_miam/userId")||localStorage.getItem("_miam/authlessId"),r=Object.assign({userId:n,key:t},void 0!==i?{value:i}:{});return this.http.post("https://ssr-api.mealz.ai/v2/cache/"+e,r,{headers:{"Content-Type":"application/json"}})}addPreferencesToRemoteFilters(e={},t=!1){const i=this.getPreferences();if(0===i.with.length&&0===i.without.length&&0===this.tagsToAdd.length)return e;const n=i.with.filter(e=>this.tagsToRemove.every(t=>t.tag.id!==e.id)).map(e=>e.id).join(),r=i.without.filter(e=>this.tagsToRemove.every(t=>t.tag.id!==e.id)).map(e=>e.id).join();if(n&&(e.include_tags=e.include_tags?`${e.include_tags},${n}`:n),r&&(e.exclude_tags=e.exclude_tags?`${e.include_tags},${r}`:r),t&&this.tagsToAdd.length>0){const t=this.tagsToAdd.filter(e=>!e.without);e.include_tags=(e.include_tags?e.include_tags+",":"")+t.map(e=>e.tag.id).join();const i=this.tagsToAdd.filter(e=>e.without);e.exclude_tags=(e.exclude_tags?e.exclude_tags+",":"")+i.map(e=>e.tag.id).join()}return e}addTag(e){this.tagWasAlreadyRemoved(e.tag)?this.tagsToRemove.splice(this.tagsToRemove.findIndex(t=>t.tag.id===e.tag.id),1):this.tagsToAdd.push(e)}newTagFromSearch(e){this.tagWasAlreadyAdded(e)||this.tagIsInStorage(e,!0)&&!this.tagWasAlreadyRemoved(e)||this.addTag({tag:e,checked:!0,without:!0})}removeTag(e){this.tagWasAlreadyAdded(e.tag)?this.tagsToAdd.splice(this.tagsToAdd.findIndex(t=>t.tag.id===e.tag.id),1):this.tagsToRemove.push(e)}tagWasAlreadyRemoved(e){return this.tagsToRemove.findIndex(t=>t.tag.id===e.id)>-1}tagWasAlreadyAdded(e){return this.tagsToAdd.findIndex(t=>t.tag.id===e.id)>-1}updatePreferences(){this.tagsToAdd.forEach(e=>{this.saveTagInPreferences(e)}),this.tagsToRemove.forEach(e=>{this.removeTagFromPreferences(e)}),localStorage.setItem("_miam/preferences/guests",this.guests.toString()),this.updatePreferencesCount(),this.resetTagsActions()}saveTagInPreferences(e){const t=this.getPreferences();e.without?t.without.push({id:e.tag.id,name:e.tag.attributes.name}):t.with.push({id:e.tag.id,name:e.tag.attributes.name}),localStorage.setItem("_miam/preferences",JSON.stringify(t))}removeTagFromPreferences(e){const t=this.getPreferences();this.removeTagFromArray(e,e.without?t.without:t.with),localStorage.setItem("_miam/preferences",JSON.stringify(t))}removeTagFromArray(e,t){const i=t.findIndex(t=>t.id===e.tag.id);i>-1&&t.splice(i,1)}getPreferences(){let e=this.preferencesInStorage;return e&&e.with&&e.without||(e={with:[],without:[]}),e}updatePreferencesCount(){var e,t;const i=this.preferencesInStorage;this.currentPreferencesNumber.next(((null===(e=null==i?void 0:i.with)||void 0===e?void 0:e.length)||0)+((null===(t=null==i?void 0:i.without)||void 0===t?void 0:t.length)||0)+(4!==this.guests?1:0))}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),h_=(()=>{class e{constructor(e,t){this.analyticsService=e,this.posService=t,this.subscriptions=[],this.storeLocatorOpened$=new cp(!1),this.newStoreSelected$=new C,this.closeModalOnSelected=!1,this.closeModalOnCancel=!1,this.showStoreLocatorWarning=new cp(!1),this.changePosAfterWarnConfirm=!0,this.storeLocatorOpened$.subscribe(e=>{e&&0!==this.storeLocatorOpenedTimestamp&&(this.storeLocatorOpenedTimestamp=Date.now())})}changePosAndSupplier(e,t){var i,n;(null===(n=null===(i=this.posService.pos$)||void 0===i?void 0:i.value)||void 0===n?void 0:n.id)!==e.detail.posId?(this.selectedPosId=e.detail.posId,this.selectedSupplierName=e.detail.supplierName,this.storeLocatorEventTrace=t,this.isStoreLocatorWarningNeeded(e.detail.supplierId)?(this.changePosAfterWarnConfirm=!0,this.showStoreLocatorWarning.next(!0)):this.changePos()):this.closeStoreLocator()}isStoreLocatorWarningNeeded(e){return!1}changePos(){this.subscriptions.push(this.posService.loadPos(this.selectedPosId).pipe(bp(e=>!e||e.id!==this.selectedPosId),th(e=>(this.analyticsService.sendEvent("locator.select",this.storeLocatorEventTrace.originPath+"/locator",{pos_name:e.attributes.name,pos_id:e.id,supplier_name:this.selectedSupplierName}),localStorage.setItem("_miam/noSupplier/posId",e.id),this.posService.basketLoadedForNewPos())),E(()=>{this.newStoreSelected$.next(),this.closeStoreLocator()})).subscribe())}openStoreLocator(){this.storeLocatorOpened$.next(!0)}closeStoreLocator(){this.storeLocatorOpened$.value&&(this.storeLocatorEventTrace?this.analyticsService.sendEvent("locator.close",this.storeLocatorEventTrace.originPath+"/locator",{}):this.closeModalOnCancel=!0,this.storeLocatorOpenedTimestamp=0),this.storeLocatorOpened$.next(!1)}showChange(e){e.detail.show?this.openStoreLocator():this.closeStoreLocator()}searchChange(e,t){this.analyticsService.sendEvent("locator.search",t.originPath,{search_term:e.detail.searchTerm,stores_found_count:e.detail.storesFoundCount.toString()})}unsubscribe(){this.subscriptions.forEach(e=>e.unsubscribe())}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(Vf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function p_(e,t){return i=>i.lift(new m_(e,t))}class m_{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new g_(e,this.compare,this.keySelector))}}class g_ extends m{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:i}=this;t=i?i(e):e}catch(n){return this.destination.error(n)}let i=!1;if(this.hasKey)try{const{compare:e}=this;i=e(this.key,t)}catch(n){return this.destination.error(n)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}let f_=(()=>{class e extends sp{constructor(e,t){super(),this.http=e,this.posService=t,this.resource=Mf,this.type="menus",this.menus$=new cp(void 0),this.menuPrice$=new cp(null),this.recipesInMenu=new Map,this.recipesInMenuInitialized=!1,this.register()}createMenu(){var e,t;const i=this.new();return i.attributes.budget=0,i.attributes["point-of-sale-id"]=null!==(t=null===(e=this.posService.pos$.value)||void 0===e?void 0:e.id)&&void 0!==t?t:0,i.save().pipe(df(e=>this.menus$.next(e.data)),th(e=>td(e.data)))}deleteMenu(e){return this.delete(e).pipe(df(()=>this.menus$.next(null)))}updateMenu(e,t){return this.http.patch("https://api.miam.tech/api/v1/menus/"+e,{data:Object.assign({id:e,type:this.type},t)}).pipe(df(e=>this.menus$.next(e.data)),th(e=>td(e.data)))}isRecipeInMenu(e){return this.menuPrice$.pipe(th(()=>this.getMenuRecipeId(e)),E(e=>Boolean(e)),p_())}menuToBasket(e){return this.http.patch(Ip+"/api/v1/menus/to-basket",{basket_id:e})}addRecipeToMenu(e,t,i=!0,n){const r=i&&!(null==n?void 0:n.some(e=>"unselected"===e.status)),s={recipe_id:e,guests:t.toString(),autocomplete:r.toString()};return this.http.post("https://api.miam.tech/api/v1/menu-recipes/add-to-menu",s).pipe(E(e=>e.data),th(e=>{var t;if(!r){const i=(null===(t=null==n?void 0:n.filter(e=>{var t,i,n,r;const s=null===(n=null===(i=null===(t=e.ingredient)||void 0===t?void 0:t.relationships)||void 0===i?void 0:i.definition)||void 0===n?void 0:n.data;return(null===(r=null==e?void 0:e.item)||void 0===r?void 0:r.id)&&(null==s?void 0:s.id)}))||void 0===t?void 0:t.map(e=>{var t,i,n;const r=(null===(n=null===(i=null===(t=e.ingredient)||void 0===t?void 0:t.relationships)||void 0===i?void 0:i.definition)||void 0===n?void 0:n.data).id,s=Number(e.item.id);return this.patchUserSelection(e.status,s,r)}))||[];if(i.length>0)return nf(i).pipe(E(()=>e))}return td(e)}),df(e=>{var t;this.updateMenuPrice(),e&&(null===(t=e.attributes)||void 0===t?void 0:t["recipe-id"])&&this.recipesInMenu.set(e.attributes["recipe-id"].toString(),e.id)}))}removeRecipeFromMenu(e){return this.http.delete(Ip+"/api/v1/menu-recipes/remove-from-menu",{params:{recipe_id:e}}).pipe(df(()=>{this.updateMenuPrice(),this.recipesInMenu.delete(e)}))}updateRecipeFromMenu(e,t){const i="https://api.miam.tech/api/v1/menu-recipes/"+e,n={data:{id:e,type:"menu-recipes",attributes:{guests:t.toString()}}};return this.http.patch(i,n).pipe(df(()=>this.updateMenuPrice()))}fetchMenuRecipes(){return this.http.get(Ip+"/api/v1/menus/current?include=menu-recipes&fields[menu-recipes]=recipe-id").pipe(df(e=>{if(!e||!e.data)return this.menuId=null,this.recipesInMenu=new Map,void(this.recipesInMenuInitialized=!0);this.menuId=e.data.id,this.recipesInMenu=new Map((e.included||[]).filter(e=>{var t;return void 0!==(null===(t=e.attributes)||void 0===t?void 0:t["recipe-id"])}).map(e=>[e.attributes["recipe-id"].toString(),e.id])),this.recipesInMenuInitialized=!0}),E(()=>{}))}getMenuRecipeId(e){return this.recipesInMenuInitialized?td(this.recipesInMenu.get(e)):this.fetchMenuRecipes().pipe(E(()=>this.recipesInMenu.get(e)))}getGuestsForRecipe(e){return this.getMenuRecipeId(e).pipe(th(e=>e?this.fetchGuestsFromMenuRecipe(e):this.fetchGuestsFromMenu()))}fetchGuestsFromMenuRecipe(e){return this.http.get("https://api.miam.tech/api/v1/menu-recipes/"+e).pipe(E(e=>e.data.attributes.guests))}fetchGuestsFromMenu(){return this.http.get(Ip+"/api/v1/menus/current").pipe(E(e=>e.data.attributes.guests))}getAllMenuItems(){const e=`https://api.miam.tech/api/v1/menus/${this.menuId}/menu-items?include=item&page[size]=30`;return this.http.get(e+"&page[number]=1").pipe(th(t=>{const i=Math.ceil(t.meta.total_resources/30);return i<=1?td({data:t.data||[],included:t.included||[]}):nf(Array.from({length:i-1},(t,i)=>this.http.get(`${e}&page[number]=${i+2}`))).pipe(E(e=>this.combineMenuItemsPage(t,e)))}))}combineMenuItemsPage(e,t){return{data:t.reduce((e,t)=>e.concat(t.data),e.data),included:t.reduce((e,t)=>e.concat(t.included),e.included)}}patchUserSelection(e,t,i){return this.http.patch(Ip+"/api/v1/menu-items/user-selection",{status:e,item_id:t,ingredients_definition_id:i})}rejectRecipe(e){var t,i;const n=null!==(i=null===(t=this.posService.pos$.value)||void 0===t?void 0:t.id)&&void 0!==i?i:0;return this.http.patch("https://api.miam.tech/api/v1/recipes/reject?point_of_sale_id="+n,{recipe_ids:[e]})}getMenuPrice(){return this.http.get(Ip+"/api/v1/menus/current-cost").pipe(E(e=>e.cost))}updateMenuPrice(){this.getMenuPrice().pipe(fp(1)).subscribe(e=>{this.menuPrice$.next(e)})}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Vf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),__=(()=>{class e extends sp{constructor(e,t,i,n,r,s,o,a,c,l,u,d,h,p,m,g,f){super(),this.http=e,this.analyticsService=t,this.providerService=i,this.statusService=n,this.typeService=r,this.suppliersService=s,this.posService=o,this.ingredientsService=a,this.recipeStepsService=c,this.sponsorService=l,this.packageService=u,this.tagsService=d,this.recipeLikesService=h,this.seoService=p,this.preferencesService=m,this.storeLocatorService=g,this.mealsPlannerService=f,this.resource=yf,this.type="recipes",this.displayedRecipe$=new cp(null),this.displayHelper$=new cp(!1),this.displayedRecipeChanged$=new cp(null),this.recipeDetailsTabIndex$=new cp(null),this.hidden=new Rc,this.suggestionsPrimaryButtonActions={display:!0,addToBasket:!0},this.recipesPrimaryButtonActions={display:!0,addToBasket:!0},this.reloadRecipes$=new cp(!1),this.difficultyLevels=[{value:1,label:"Facile"},{value:2,label:"Moyen"},{value:3,label:"Difficile"}],this.isRecipeDetailsFromPlanner=!1,this.randomRecipeCount=1,this.recipes=[],this.register(),this.initRandomSeed()}loadRecipes(e){return 0===e.length?td([]):nf(e.map(e=>this.getOrFetch(e.id).pipe(df(t=>{e.guests&&(t.modifiedGuests=+e.guests),this.recipes.push(t)}))))}addMandatoryCompletionToFilter(e){var t;const i=e.copy();return(null===(t=i.additionalFilters)||void 0===t?void 0:t.filters.liked)?td(i):this.posService.posWasInitialized().pipe(bp(e=>!e),th(()=>this.posService.pos$),fp(1),E(t=>{var n;return(null==t?void 0:t.id)&&(i.additionalFilters=Object.assign(Object.assign({},e.additionalFilters),{filters:Object.assign({guests:"4",point_of_sale_id:t.id,primary_completion_perc:"100,100",forced_completion_perc:"100,100"},null===(n=e.additionalFilters)||void 0===n?void 0:n.filters)})),i}))}filter(e,t,i=[],n={},r=null,s=!1,o=""){var a;let c;const l=((null===(a=e.additionalFilters)||void 0===a?void 0:a.filters.liked)?{liked:"true"}:null)||this.preferencesService.addPreferencesToRemoteFilters(this.buildRemoteFilters(e,r));return s&&Object.assign(l,{random:this.randomSeed}),this.all({page:t,remotefilter:l,include:i,sort:[o],fields:n}).pipe(bp(e=>e.is_loading),th(e=>(c=e.data,r&&r>0&&c.forEach(e=>e.modifiedGuests=r),this.recipeLikesService.addLikesToRecipes(c))),E(()=>c))}loadRecipesFromPackageId(e,t,i,n){const r=["recipe-provider","sponsors"],s={recipes:["title","number-of-guests","media-url","video-id","filigrane-logo-url","difficulty","preparation-time","cooking-time","resting-time",...r],sponsors:["logo-url"],"recipe-provider":["name"]},o=new Uf({additionalFilters:{title:"",filters:{packages:e}}});return this.addMandatoryCompletionToFilter(o).pipe(th(e=>this.filter(e,{size:i,number:t},r,s,n,!1,"position")))}filterCount(e,t=null,i=[],n=!1){const r=this.preferencesService.addPreferencesToRemoteFilters(this.buildRemoteFilters(e,t),n);return this.all({remotefilter:r,page:{number:1,size:1},fields:{recipes:["id"]}}).pipe(bp(e=>e.is_loading),E(e=>{var t;let n=e.data.length?null===(t=e.page)||void 0===t?void 0:t.total_resources:0;return n-=e.data.filter(e=>i.includes(e.id)).length,n}))}buildRemoteFilters(e,t=null){var i,n,r,s;const o=this.buildRemoteFilter(e.difficulty,"-"),a=null===(i=this.buildRemoteFilter(e.cost,"-"))||void 0===i?void 0:i.split("-"),c=this.buildRemoteFilter(e.time,",");return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(null==o?void 0:o.length)>0?{difficulty:o+",eq"}:{}),2===(null==a?void 0:a.length)?{computed_cost:a[0]+",gt,"+a[1]+",lt"}:{}),(null==c?void 0:c.length)>0?{"total-time":c}:{}),(null===(n=e.additionalFilters)||void 0===n?void 0:n.filters)?e.additionalFilters.filters:{}),e.search?{search:e.search}:{}),(null===(r=e.additionalFilters)||void 0===r?void 0:r.filters.price)?{point_of_sale_id:this.posService.pos$.value.id}:{}),(null===(s=e.additionalFilters)||void 0===s?void 0:s.filters.price)&&null!==t?{guests:t.toString()}:{})}buildRemoteFilter(e,t){if(!e)return;let i="";for(const n of e)n.value&&(i.length>0&&(i+=t),i+=n.name);return i}getRandom(e=[],t={}){return this.randomRecipeCount++,this.filter({reviewed:!0,exclude_no_picture:!0},{number:this.randomRecipeCount,size:1},e,t,null,!0)}getSuggestionFromContext(e,t=[],i={}){let n="";return Object.keys(i).forEach(e=>{n+=`&fields[${e}]=${i[e].join(",")}`}),Xg([this.suppliersService.supplier$,this.posService.posWasInitialized().pipe(bp(e=>!e),th(()=>this.posService.pos$))]).pipe(bp(e=>!e[0]),of(100),th(i=>{const r=this.buildSuggestionBody(e);let s="supplier_id="+i[0].id;i[1]&&(s=`supplier_id=${i[0].id}&pos_id=${i[1].id}`);const o=`https://api.miam.tech/api/v1/recipes/suggestions?${s}&allow-empty=true${t.length>0?"&include="+t.join(","):""}${n}${this.buildfilterUrlFromPreferences()}`;return this.http.post(o,r)}),E(e=>{const t=this.newCollection();return t.fill(e),t.data}))}getSuggestedRecipes(){const e=this.buildfilterUrlFromPreferences(),t=e?"https://api.miam.tech/api/v1/recipes/suggest?"+e.slice(1):"https://api.miam.tech/api/v1/recipes/suggest";return this.http.get(t).pipe(E(e=>{const t=this.newCollection();return t.fill(e),t.data}))}searchRecipeByExtId(e){return this.http.get("https://api.miam.tech/api/v1/recipes/external/"+e).pipe(E(t=>{var i;if((null===(i=t.data)||void 0===i?void 0:i.attributes["ext-id"])===e){const e=this.new();return e.fill(t),e}return null}))}getPricing(e,t,i=null,n=!1){if(!e)return td(null);if(n)return this.suppliersService.supplier$.pipe(bp(e=>!(null==e?void 0:e.id)),fp(1),th(n=>{let r=`https://api.miam.tech/api/v1/recipes/${e}/pricing`;return r+="?point-of-sale-ext-id="+t,r+="&supplier-id="+n.id,i&&(r+="&serves="+i),this.http.get(r).pipe(E(e=>new Hf(e)))}));let r=`https://api.miam.tech/api/v1/recipes/${e}/pricing`;return r+="?point_of_sale_id="+t,i&&(r+="&serves="+i),this.http.get(r).pipe(E(e=>new Hf(e)))}getIngredientsDefinitions(e){return e?this.http.get(`https://api.miam.tech/api/v1/recipes/${e}?include=ingredients.definition`).pipe(E(e=>{const t=e.included||[],i=t.filter(e=>"ingredients"===e.type),n=new Map;return t.forEach(e=>{"ingredients-definitions"===e.type&&n.set(e.id,e)}),i.forEach(e=>{var t,i,r;const s=null===(r=null===(i=null===(t=e.relationships)||void 0===t?void 0:t.definition)||void 0===i?void 0:i.data)||void 0===r?void 0:r.id;s&&(e.relationships.definition.data=n.get(s))}),i})):td(null)}generateFromPicture(e){return this.http.post("https://api.miam.tech/api/v1/recipes/generate_from_picture",{base64_image:e})}display(e,{previewAllowed:t=!0,guests:i=null,previewMode:n=!1,displayGuests:r=!0,helpButtonAllowed:s=!0}){e&&this.get(e,{include:["ingredients","recipe-steps","recipe-type","sponsors","tags","recipe-provider"]}).subscribe(e=>{this.displayObject(e,{previewAllowed:t,guests:i,previewMode:n,displayGuests:r,helpButtonAllowed:s})})}displayObject(e,{previewAllowed:t=!0,guests:i=null,previewMode:n=!1,wasAdded:r=!1,displayGuests:s=!0,helpButtonAllowed:o=!0}){if(!e)return;const a=(i=null)=>{e.modifiedGuests=null!=i?i:+e.guests,this.displayedRecipe$.next({previewAllowed:t,recipe:e,previewMode:n,wasAdded:r,displayGuests:s,helpButtonAllowed:o,planner:this.isRecipeDetailsFromPlanner})};this.isRecipeDetailsFromPlanner?this.mealsPlannerService.getGuestsForRecipe(e.id).pipe(fp(1)).subscribe(e=>{a(e)}):a(i)}openRecipeDetails(e,t,i,n="",r=null){this.display(e,{previewAllowed:!0,previewMode:!1,guests:t}),this.recipeDetailsTabIndex$.next(i),this.analyticsService.sendEvent("recipe.display",n,{recipe_id:e,category_id:r})}openStoreLocator(){this.storeLocatorService.closeModalOnSelected=!0,this.storeLocatorService.openStoreLocator(),this.displayedRecipe$.next({previewAllowed:!1,recipe:null,previewMode:!0,wasAdded:!1,force:!0})}toggleHelper(){this.hide(),this.displayHelper$.next(!this.displayHelper$.value)}hide(){this.displayedRecipe$.next(null),this.hidden.emit(!0)}addTagToRecipe(e,t){return this.http.post(`https://api.miam.tech/api/v1/recipes/${e.id}/tags/${t.id}`,{})}setRecipesPrimaryButtonActions(e=!0,t=!0){this.recipesPrimaryButtonActions={display:e,addToBasket:t},this.suggestionsPrimaryButtonActions={display:e,addToBasket:t},this.reloadAllRecipes()}setSuggestionsPrimaryButtonActions(e=!0,t=!0){this.suggestionsPrimaryButtonActions={display:e,addToBasket:t},this.reloadAllRecipes()}plan(e,t,i,n=[],r={},s){let o="";Object.keys(r).forEach(e=>{o+=`&fields[${e}]=${r[e].join(",")}`});let a="https://api.miam.tech/api/v1/recipes/plan";return a+=`?budget=${e}&filter[guests]=${t}&recipes_count=${i}&filter[recipe_type_id]=main-dish`,a+=`&include=${n.join(",")}${o}&filter[recipe_type_id]=main-dish&filter[primary_completion_perc]=100,100&filter[forced_completion_perc]=100,100`,a+=void 0===s?"":"&filter[in_basket]="+s,a+=this.buildfilterUrlFromPreferences(),this.posService.waitForPos.pipe(fp(1),th(e=>(a+="&filter[point_of_sale_id]="+e.id,this.http.get(a,{}).pipe(E(e=>{const t=this.newCollection();return t.fill(e),t.data})))))}maxPlannableRecipes(e,t,i){let n="https://api.miam.tech/api/v1/recipes/plan_max_recipes";return n+=`?budget=${e}&filter[guests]=${t}&filter[recipe_type_id]=main-dish&filter[primary_completion_perc]=100,100&filter[forced_completion_perc]=100,100`,n+=void 0===i?"":"&filter[in_basket]="+i,n+=this.buildfilterUrlFromPreferences(),this.posService.waitForPos.pipe(fp(1),th(e=>this.http.get(n+="&filter[point_of_sale_id]="+e.id,{})),E(e=>e.max_recipes))}getIngredientsByRecipeId(e){return this.get(e,{include:["ingredients"],fields:{recipes:["ingredients"]}})}search(e,t,i,n,r){let s="https://api.miam.tech/api/v1/recipes/search?name="+e;return s+=`&page[size]=${i.size||20}&page[number]=${i.number||1}&partner=${t.partner}`,t.statuses.forEach(e=>s+="&recipe_status_ids[]="+e),s+=t.types.length?"&filter[recipe_type_id]="+t.types.join(","):"",s+=t.providers.length?"&filter[recipe_provider_id]="+t.providers.join(","):"",s+=t.packages.length?"&filter[packages]="+t.packages.join(","):"",s+=n.length?"&include="+n.join(","):"",s+=r?"&sort="+r:"",this.http.get(s,{}).pipe(E(e=>{const t=this.newCollection();return t.fill(e),t}))}getOrFetch(e){const t=this.recipes.find(t=>t.id===e);return t?td(t):this.get(e,{fields:{recipes:["number-of-guests","media-url","title"]}}).pipe(bp(e=>e.is_loading))}initRandomSeed(){this.randomSeed=Date.now()}reloadAllRecipes(){this.reloadRecipes$.next(!0)}buildSuggestionBody(e){const t={shelf_ingredients_ids:[],current_ingredients_ids:[],basket_ingredients_ids:[],group_id:""};return e.forEach(e=>{e.hasHighWeight?t.current_ingredients_ids.push(e.id):t.shelf_ingredients_ids.push(e.id)}),t.basket_ingredients_ids=this.suppliersService.lastSupplierCart.map(e=>e.id),t}buildfilterUrlFromPreferences(){return Object.entries(this.preferencesService.addPreferencesToRemoteFilters()).map(([e,t])=>`&filter[${e}]=${t}`).join("")}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Rp),nn(qf),nn(Gf),nn(Wf),nn(Nf),nn(Vf),nn(Xf),nn(r_),nn(s_),nn(o_),nn(a_),nn(l_),nn(u_),nn(d_),nn(h_),nn(f_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),v_=(()=>{class e{constructor(){this.callAuthlessTransfer=new C}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),b_=(()=>{class e{constructor(e){this.locale=e,this.code=function(e){return function(e){return ia(e)[ra.CurrencyCode]||null}(e)}(this.locale),this.symbol=function(e){return ia(e)[ra.CurrencySymbol]||null}(this.locale)}}return e.\u0275fac=function(t){return new(t||e)(nn(nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var y_=function(e){return e.Undiscounted="undiscounted",e.Unsupported="unsupported",e.StrikethroughPrice="strikethrough_price",e.StrikethroughPricePerc="strikethrough_price_perc",e.LoyaltyFund="loyalty_fund",e.LoyaltyFundPerc="loyalty_fund_perc",e.LoyaltyDiscount="loyalty_discount",e.LoyaltyDiscountPerc="loyalty_discount_perc",e.DiscountedProduct="discounted_product",e.DiscountedProductPerc="discounted_product_perc",e}({});let w_=(()=>{class e{constructor(e){this.currencyService=e}getPriceAmountSuffix(e){var t;return(null===(t=e.discountType)||void 0===t?void 0:t.endsWith("_perc"))?"%":this.currencyService.symbol}getPriceFromBasketEntry(e){return{unit:e.price,pricePerUnit:e.pricePerUnit,unitOfMeasurement:e.unitOfMeasurement,discountAmount:e.discountAmount,discountType:e.discountType,discountedPrice:e.discountedPrice}}getCurrentPrice(e){return e.discountType===y_.StrikethroughPricePerc||e.discountType===y_.StrikethroughPrice?e.discountedPrice:e.unit}getOldPrice(e){if(e.discountType!==y_.Undiscounted&&e.discountType!==y_.Unsupported)return e.unit}}return e.\u0275fac=function(t){return new(t||e)(nn(b_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const k_={baskets:["total-price","recipes-infos","completion","status"]};let C_=(()=>{class e extends sp{constructor(e,t,i,n,r,s,o,a,c,l){super(),this.http=e,this.basketEntriesService=t,this.posService=i,this.recipesService=n,this.analyticsService=r,this.usersService=s,this.toasterService=o,this.ignoredBasketsService=a,this.statesService=c,this.priceService=l,this.resource=If,this.type="baskets",this._basket$=new cp(null),this._basketPreview$=new cp(null),this.basketStats$=new cp(null),this.currentAndPreviewFetching=new cp(!1),this.basketIsFetching$=new cp(!1),this.basketPreviewIsCalculating$=new cp(!0),this.basketInitCalled=!1,this.recipesAdded=new Rc,this.confirming=new cp(!1),this.currentlyAddingRecipes=[],this.basketActionsQueue=new cp([]),this._entries$=new cp([]),this.actionsBeingProcessed=new cp([]),this.actionsBeingOverridden=[],this.subscriptions=[],this.register(),this.initQueueEmptying(),this.initToasterOnRecipeAdded()}get basket$(){return this._basket$.value||this.basketIsFetching$.value||(this.basketIsFetching$.next(!0),this.initBasket()),this._basket$}get basketPreview$(){return this._basketPreview$.value||this.basketPreviewIsCalculating$.value||(this.basketPreviewIsCalculating$.next(!0),this.initBasket()),this._basketPreview$}get waitForBasket(){return this.basket$.pipe(bp(e=>!e),fp(1))}get waitForBasketEntries(){return Xg([this._entries$,this.basketPreviewIsCalculating$]).pipe(bp(([e,t])=>!e||!this.basketInitCalled||t),fp(1),E(([e])=>e))}recipePricesInBasket$(){return this.basketPreview$.pipe(bp(e=>!e||0===e.length),E(e=>e.map(e=>({id:e.id,price:e.price}))))}initQueueEmptying(){this.subscriptions.push(this.basketActionsQueue.pipe(of(350),bp(e=>0===e.length||this.actionsBeingProcessed.value.length>0),df(()=>this.emptyActionsQueue())).subscribe())}initToasterOnRecipeAdded(){this.recipesService.confirmationToaster&&this.showRecipeAddedToaster()}subjectContainsRecipeId(e,t,i){return e.pipe(E(e=>e.some(e=>(e=>t===e.type)(e)&&e.params.recipeId===i)))}subjectContainsIngredientId(e,t,i){return e.pipe(E(e=>e.some(e=>e.type===t&&e.params.ingredientId===i)))}subjectContainsEntryId(e,t,i){return e.pipe(E(e=>e.some(e=>{var n;return e.type===t&&(null===(n=e.params.basketEntry)||void 0===n?void 0:n.id)===i})))}subjectContainsItemId(e,t,i){return e.pipe(E(e=>e.some(e=>e.type===t&&e.params.item.id===i)))}subjectContainsActionType(e,t){return e.pipe(E(e=>e.some(e=>e.type===t)))}recipeWillBeAdded(e){return this.subjectContainsRecipeId(this.basketActionsQueue,Lf.ADD_RECIPE,e)}recipeWillBeRemoved(e){return this.subjectContainsRecipeId(this.basketActionsQueue,Lf.REMOVE_RECIPE,e)}recipeWillBeUpdated(e){return this.subjectContainsRecipeId(this.basketActionsQueue,Lf.UPDATE_RECIPE,e)}recipeIsBeingAdded(e){return this.subjectContainsRecipeId(this.actionsBeingProcessed,Lf.ADD_RECIPE,e)}recipeIsBeingRemoved(e){return this.subjectContainsRecipeId(this.actionsBeingProcessed,Lf.REMOVE_RECIPE,e)}recipeIsBeingUpdated(e){return this.subjectContainsRecipeId(this.actionsBeingProcessed,Lf.UPDATE_RECIPE,e)}ingredientWillBeAdded(e){return this.subjectContainsIngredientId(this.basketActionsQueue,Lf.ADD_PRODUCT,e)}ingredientIsBeingRemoved(e){return this.subjectContainsIngredientId(this.actionsBeingProcessed,Lf.REMOVE_PRODUCT,e)}ingredientWillBeRemoved(e){return this.subjectContainsIngredientId(this.basketActionsQueue,Lf.REMOVE_PRODUCT,e)}entryWillBeRemoved(e){return this.subjectContainsEntryId(this.basketActionsQueue,Lf.REMOVE_PRODUCT,e)}entriesWillBeRemovedFromRecipe(){return this.subjectContainsActionType(this.basketActionsQueue,Lf.REMOVE_PRODUCT_FROM_RECIPE)}entryIsBeingRemoved(e){return this.subjectContainsEntryId(this.actionsBeingProcessed,Lf.REMOVE_PRODUCT,e)}entriesAreBeingRemovedFromRecipe(){return this.subjectContainsActionType(this.actionsBeingProcessed,Lf.REMOVE_PRODUCT_FROM_RECIPE)}entryWillBeUpdated(e){return this.subjectContainsEntryId(this.basketActionsQueue,Lf.UPDATE_PRODUCT,e)}entryIsBeingUpdated(e){return this.subjectContainsEntryId(this.actionsBeingProcessed,Lf.UPDATE_PRODUCT,e)}itemWillBeAdded(e){return this.subjectContainsItemId(this.basketActionsQueue,Lf.ADD_ITEM,e)}recipesWillBeAdded(){return this.basketActionsQueue.pipe(E(e=>e.some(e=>e.type===Lf.ADD_RECIPE)))}recipesWillBeRemoved(){return this.basketActionsQueue.pipe(E(e=>e.some(e=>e.type===Lf.REMOVE_RECIPE)))}recipesWillBeUpdated(){return this.basketActionsQueue.pipe(E(e=>e.some(e=>e.type===Lf.UPDATE_RECIPE)))}productsWillBeAdded(){return this.basketActionsQueue.pipe(E(e=>e.filter(e=>e.type===Lf.ADD_PRODUCT).length))}productsWillBeUpdated(){return this.basketActionsQueue.pipe(E(e=>e.filter(e=>e.type===Lf.UPDATE_PRODUCT).length))}productsWillBeRemoved(){return this.basketActionsQueue.pipe(E(e=>e.filter(e=>e.type===Lf.REMOVE_PRODUCT).length))}productsAreBeingRemoved(){return this.actionsBeingProcessed.pipe(E(e=>e.filter(e=>e.type===Lf.REMOVE_PRODUCT).length))}recipeIsInBasket(e){return this.basket$.pipe(bp(e=>!e),E(t=>t.hasRecipe(e)))}guestsForRecipe(e){var t;return null===(t=this.basket$.value)||void 0===t?void 0:t.guestsForRecipe(e)}showRecipeAddedToaster(){let e=0;this.subscriptions.push(this._entries$.subscribe(t=>{const i=t.reduce((e,t)=>"active"===t.status?e+t.quantity:e,0);e<i&&this.toasterService.show($f.Success,`${i-e} ${i-e==1?"article ajout\xe9":"articles ajout\xe9s"} \xe0 votre panier`,"",!1),e=i}))}reloadBasket(){return this.refreshCurrentBasket().pipe(fp(1))}initBasket(){this.basketInitCalled||(this.basketInitCalled=!0,this.loadBasket().subscribe(),this.loadPreview().subscribe())}refreshCurrentBasket(){return this.currentAndPreviewFetching.next(!0),this.posService.waitForPos.pipe(fp(1),th(e=>{Cp("[Mealz] refreshing basket");const t=localStorage.getItem("_miam/authlessId"),i=localStorage.getItem("_miam/userId");this.currentSubscription&&this.currentSubscription.unsubscribe();const n=t&&i?this.transferAuthlessBasket(e.id,t):this.fetchCurrentBasket(e.id);return t&&i&&(localStorage.removeItem("_miam/authlessId"),localStorage.removeItem("_miam/authless-forbid-profiling")),this.currentSubscription=n.subscribe(),this.checkIfIsAffiliated(),this._basket$}))}checkIfIsAffiliated(){this.http.get(Ip+"/api/v1/baskets/affiliated").pipe(fp(1)).subscribe(e=>{const t=null==e?void 0:e.affiliated;t?(localStorage.setItem("_miam/affiliated",t),Object(ap.setAffiliate)(t)):(localStorage.removeItem("_miam/affiliated"),Object(ap.setAffiliate)(null))})}transferAuthlessBasket(e,t){return this.statesService.callAuthlessTransfer.next(),this.http.patch(`https://api.miam.tech/api/v1/baskets/transfer_authless?point_of_sale_id=${e}&authless_user_id=${t}`,{}).pipe(th(e=>{const t=this.new();return t.fill(e),this.updateLocalBasket(t)}),Wh(()=>this.fetchCurrentBasket(e)))}fetchCurrentBasket(e){const t=`current?point_of_sale_id=${e}&fields[baskets]=${k_.baskets.join(",")}`;return this.get(t).pipe(th(e=>this.updateLocalBasket(e)),df(()=>{this.posService.emitBasketLoadedForNewPos&&this.posService.emitBasketLoadedForNewPos()}))}resetBasket(e={originPath:"",props:{}}){return Cp("[Mealz] resetting basket"),localStorage.removeItem("_miam/affiliate"),Object(ap.setAffiliate)(null),this.ignoredBasketsService.resetIgnoredIngredients(),this.posService.waitForPos.pipe(fp(1),th(t=>this.waitForBasket.pipe(df(t=>this.analyticsService.sendEventsOfResetBasket(t,e)),th(()=>this.get(`reset?point_of_sale_id=${t.id}&fields[baskets]=${k_.baskets.join(",")}`).pipe(th(e=>this.updateLocalBasket(e)))))))}confirmPaymentAndBasket(e){return this.confirming.next(!0),this.waitForBasket.pipe(th(t=>+e>0&&t.totalPrice>0?(this.analyticsService.sendEvent("payment.confirmed","",{basket_id:t.id,miam_amount:t.totalPrice.toString(),total_amount:e.toString(),pos_id:this.posService.pos$.getValue().id,pos_name:this.posService.pos$.getValue().attributes.name,supplier_id:this.posService.pos$.getValue().relationships.supplier.data.id,recipe_count:t.recipeInfos.length.toString(),miam_products:t.entries.length.toString()}),this.confirmBasket(t,e)):this._basket$),df(()=>this.confirming.next(!1)))}confirmBasket(e,t){return Cp("[Mealz] Confirm Mealz basket"),this.posService.waitForPos.pipe(fp(1),th(e=>this.http.patch("https://api.miam.tech/api/v1/baskets/confirm?point_of_sale_id="+e.id,{})),Wh(()=>td(null)),th(i=>i?(this.analyticsService.sendEvent("basket.confirmed","",{basket_id:e.id,miam_amount:e.totalPrice.toString(),total_amount:t.toString(),pos_id:this.posService.pos$.getValue().id,pos_name:this.posService.pos$.getValue().attributes.name,supplier_id:this.posService.pos$.getValue().relationships.supplier.data.id,recipe_count:e.recipeInfos.length.toString(),miam_products:e.entries.length.toString()}),this.refreshCurrentBasket()):td(null)),fp(1))}basketEntries(){return this._entries$}activeBasketEntries(){return this.basketEntries().pipe(E(e=>e.filter(e=>"active"===e.status)))}removeBasketEntries(e){return this._entries$.value?nf(e.map(e=>this.removeBasketEntry(e))).pipe(th(()=>this.refreshCurrentBasket()),fp(1)):td(null)}removeBasketEntry(e){const t=this._entries$.value.find(t=>t.id===e.id);if(!t||!e.quantity)return td(null);const i=t.quantity-e.quantity;return i>=1?(this.analyticsService.sendProductsChangeQuantityEvents([{type:Lf.UPDATE_PRODUCT,params:{recipeId:"",eventTrace:{originPath:"",props:{}},basketEntry:t,newQuantity:i}}]),t.quantity=i,t.save()):(t.quantity=1,t.status="deleted",this.analyticsService.sendRemoveProductsEvents([{type:Lf.REMOVE_PRODUCT,params:{recipeId:"",eventTrace:{originPath:"",props:{}},basketEntry:t}}]),t.save())}basketEntryFromIngredient(e,t,i=!1,n){return this.waitForBasket.pipe(th(r=>{let s=`https://api.miam.tech/api/v1/baskets/${r.id}/basket-entries/from-ingredient?ingredient_id=${e}&guests=${t}`;return n&&(s+="&selected_item_id="+n),s+=i?"&fields[basket-entries]=quantity,quantity-to-add":"&include=selected-item",this.http.get(s)}),bp(e=>!e),E(e=>{const t=this.basketEntriesService.new();return t.fill(e),t}))}addEntriesFromPicture(e,t=[],i=!1){return this.waitForBasket.pipe(th(e=>this.posService.waitForPos.pipe(fp(1),E(t=>[e,t]))),th(([n,r])=>{let s;s=i?`https://api.miam.tech/api/v1/baskets/school-list?fields[baskets]=${k_.baskets.join(",")}&point_of_sale_id=`+r.id:`https://api.miam.tech/api/v1/baskets/${n.id}/add-entries-from-picture?fields[baskets]=`+k_.baskets.join(",");const o=new FormData;return o.append("picture",e),o.append("include",t.join(",")),this.http.patch(s,o).pipe(th(e=>this.fillBasket(e)))}))}addRecipesToBasket(e,t,i,n=!0){const r=this.basketActionsQueue.value;e.forEach(e=>r.push({type:n?Lf.ADD_RECIPE:Lf.ADD_RECIPE_LIGHT,params:{recipeId:e,eventTrace:i,guests:t}})),this.basketActionsQueue.next(r)}removeRecipesFromBasket(e,t,i=!1){const n=this.basketActionsQueue.value;e.forEach(e=>n.push({type:i?Lf.REMOVE_RECIPE_LIGHT:Lf.REMOVE_RECIPE,params:{recipeId:e,eventTrace:t}})),this.basketActionsQueue.next(n)}updateRecipesInBasket(e,t,i,n=!1){const r=this.basketActionsQueue.value;e.forEach(e=>this.recipeIsInBasket(e).pipe(fp(1)).subscribe(s=>{s&&r.push({type:n?Lf.UPDATE_RECIPE_LIGHT:Lf.UPDATE_RECIPE,params:{recipeId:e,eventTrace:i,guests:t}})})),this.basketActionsQueue.next(r)}addIngredientsToBasket(e,t,i,n,r){const s=this.basketActionsQueue.value;t.forEach(t=>s.push({type:Lf.ADD_PRODUCT,params:{recipeId:e,ingredientId:t.ingredientId,basketEntry:t.entry,eventTrace:i,previousItem:n,searchString:r}})),this.basketActionsQueue.next(s)}addItemToBasket(e,t,i){const n=this.basketActionsQueue.value;n.push({type:Lf.ADD_ITEM,params:{item:e,eventTrace:t,previousItem:i}}),this.basketActionsQueue.next(n)}removeProductFromRecipe(e,t){const i=this.basketActionsQueue.value;e.forEach(e=>i.push({type:Lf.REMOVE_PRODUCT_FROM_RECIPE,params:{basketEntry:e.basketEntry,ingredientId:e.ingredient.id,forcedQuantity:e.basketEntry.quantity+e.basketEntry.quantityToAdd,eventTrace:t}})),this.basketActionsQueue.next(i)}removeIngredientsFromBasket(e,t,i,n){const r=this.basketActionsQueue.value;i.forEach(i=>r.push({type:Lf.REMOVE_PRODUCT,params:{basketEntry:e,recipeId:t,ingredientId:i,eventTrace:n}})),this.basketActionsQueue.next(r)}removeProduct(e,t,i){const n=this.basketActionsQueue.value;n.push({type:Lf.REMOVE_PRODUCT,params:{basketEntry:e,recipeId:i,eventTrace:t}}),this.basketActionsQueue.next(n)}changeProductQuantity(e,t,i,n){const r=this.basketActionsQueue.value;r.push({type:Lf.UPDATE_PRODUCT,params:{basketEntry:e,recipeId:n,newQuantity:t,eventTrace:i}}),this.basketActionsQueue.next(r)}emptyActionsQueue(){if(this.basketActionsQueue.value.length>0){const e=this.nextActionsBatch();this.actionsBeingProcessed.next([...e]),e.length>0&&this.processActionsBatch(e).subscribe(()=>{this.actionsBeingProcessed.next([]),this.basketActionsQueue.next(this.basketActionsQueue.value.filter(t=>!e.includes(t)&&!this.actionsBeingOverridden.includes(t))),this.actionsBeingOverridden=[]})}}nextActionsBatch(){const e=[];let t=0,i=this.basketActionsQueue.value[t],n=!1;for(;this.basketActionsQueue.value[t]&&this.basketActionsQueue.value[t].type===i.type&&!n;)i=this.basketActionsQueue.value[t],n=this.addActionToBatchOrStopProcessingBatch(e,i),t++;return e}addActionToBatchOrStopProcessingBatch(e,t){const i=this.checkForActionToOverride(e,t);if(-1!==i)this.actionsBeingOverridden.push(e[i]),e[i]=t;else{if(this.shouldForceStopBatch(e,t))return!0;e.push(t)}return!1}shouldForceStopBatch(e,t){return t.type===Lf.UPDATE_RECIPE&&e.length>0&&!e.some(e=>e.params.guests===t.params.guests)||(t.type===Lf.ADD_PRODUCT||t.type===Lf.REMOVE_PRODUCT)&&e.length>0&&!e.some(e=>e.params.recipeId===t.params.recipeId)}checkForActionToOverride(e,t){switch(t.type){case Lf.ADD_PRODUCT:return e.findIndex(e=>e.params.ingredientId===t.params.ingredientId&&e.params.recipeId===t.params.recipeId);case Lf.REMOVE_PRODUCT:return e.findIndex(e=>{var i;let n;return n=(null===(i=t.params.basketEntry)||void 0===i?void 0:i.id)?e.params.basketEntry.id===t.params.basketEntry.id:e.params.ingredientId===t.params.ingredientId,n&&e.params.recipeId===t.params.recipeId});case Lf.REMOVE_PRODUCT_FROM_RECIPE:return e.findIndex(e=>e.params.ingredientId===t.params.ingredientId&&e.params.recipeId===t.params.recipeId);case Lf.UPDATE_PRODUCT:return e.findIndex(e=>e.params.basketEntry.id===t.params.basketEntry.id);case Lf.UPDATE_RECIPE:return e.some(e=>e.params.recipeId!==t.params.recipeId)?-1:e.findIndex(e=>e.params.recipeId===t.params.recipeId);default:return e.findIndex(e=>e.params.recipeId===t.params.recipeId)}}processActionsBatch(e){switch(e[0].type){case Lf.ADD_RECIPE:return this.addRecipes(e);case Lf.ADD_RECIPE_LIGHT:return this.addRecipesWithoutIngredients(e);case Lf.REMOVE_RECIPE:return this.removeRecipes(e);case Lf.REMOVE_RECIPE_LIGHT:return this.removeRecipes(e,!0);case Lf.UPDATE_RECIPE:return this.updateRecipesGuests(e);case Lf.UPDATE_RECIPE_LIGHT:return this.updateRecipesGuests(e,!0);case Lf.ADD_PRODUCT:return this.addItemsForIngredients(e);case Lf.ADD_ITEM:return this.addItemsToBasket(e);case Lf.REMOVE_PRODUCT:return this.removeItemsForIngredients(e);case Lf.REMOVE_PRODUCT_FROM_RECIPE:return this.removeProductWithForcedQuantity(e);case Lf.UPDATE_PRODUCT:return this.changeBasketEntriesQuantities(e);default:return td(null)}}addRecipes(e,t=!0){return this.waitForBasket.pipe(th(i=>{const n=e.map(e=>({recipe_id:e.params.recipeId,guests:e.params.guests})).filter(e=>!this.currentlyAddingRecipes.includes(e.recipe_id)).filter(e=>!i.hasRecipe(e.recipe_id));if(0===n.length)return td(null);this.currentlyAddingRecipes=[...this.currentlyAddingRecipes,...n.map(e=>e.recipe_id)];const r=`https://api.miam.tech/api/v1/baskets/${i.id}/recipes?fields[baskets]=${k_.baskets.join(",")}${t?"":"&light_mode=true"}`,s={data:n};return this.analyticsService.sendAddRecipesEvents(e),this.http.post(r,s).pipe(th(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.id)?this.fillBasket(e):td(null)}),df(()=>{this.recipesAdded.emit(n.map(e=>e.recipe_id)),this.currentlyAddingRecipes=this.currentlyAddingRecipes.filter(e=>!this.basket$.value.recipeInfos.find(t=>t.id===e))}))}),Wh(()=>td(null)))}addRecipesWithoutIngredients(e){return this.addRecipes(e,!1)}removeRecipes(e,t=!1){return this.waitForBasket.pipe(th(i=>{let n=`https://api.miam.tech/api/v1/baskets/${i.id}/recipes?recipe_ids[]=`+e.map(e=>e.params.recipeId).join("&recipe_ids[]=")+"&fields[baskets]="+k_.baskets.join(",");return t&&(n+="&light_mode=true"),this.analyticsService.sendRemoveRecipesEvents(e),this.http.delete(n).pipe(th(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.id)?this.fillBasket(e):td(null)}))}),Wh(()=>td(null)))}removeRecipeById(e,t,i=!1){return this.waitForBasket.pipe(th(n=>{let r=`https://api.miam.tech/api/v1/baskets/${n.id}/recipes?recipe_ids[]=${e}&fields[baskets]=`+k_.baskets.join(",");return i&&(r+="&light_mode=true"),this.analyticsService.sendRemoveRecipesEvents([{type:Lf.REMOVE_RECIPE,params:{recipeId:e,eventTrace:{originPath:t}}}]),this.http.delete(r).pipe(th(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.id)?this.fillBasket(e):td(null)}))}),Wh(()=>td(null)))}updateRecipesGuests(e,t=!1){return this.waitForBasket.pipe(th(i=>{let n=`https://api.miam.tech/api/v1/baskets/${i.id}/recipes_guests?guests=${e[0].params.guests}&recipe_ids[]=`+e.map(e=>e.params.recipeId).join("&recipe_ids[]=")+"&fields[baskets]="+k_.baskets.join(",");return t&&(n+="&light_mode=true"),this.analyticsService.sendUpdateGuestsEvents(e),this.http.patch(n,{}).pipe(bp(e=>!e),th(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.id)?this.fillBasket(e):td(null)}))}),Wh(()=>td(null)))}addItemsForIngredients(e){return this.waitForBasket.pipe(th(t=>nf(e.map(e=>{const i=this.guestsForRecipe(e.params.recipeId);return this.http.patch(`https://api.miam.tech/api/v1/baskets/${t.id}/basket-entries/${e.params.basketEntry.id}/add-ingredient?ingredient_id=${e.params.ingredientId}&selected_item_id=${e.params.basketEntry.selectedItem.id}&guests=${i}&forced_quantity=${e.params.basketEntry.quantity}`,{})}))),df(()=>{const t=e.some(e=>e.params.previousItem)?"item-replacement":"meals-space-recipe-details";this.analyticsService.sendAddProductsEvents(e,t)}),th(()=>this.reloadBasket()),th(()=>td(null)),Wh(()=>td(null)))}addItemsToBasket(e){return this.waitForBasket.pipe(th(t=>nf(e.map(e=>this.http.post(encodeURI((`https://api.miam.tech/api/v1/baskets/${t.id}/basket-entries/from-item?include=selected-item&selected_item_id=`+e.params.item.id+"&name="+e.params.item.attributes.name).trim()),{})))),df(()=>{const t=e.some(e=>e.params.previousItem)?"item-replacement":"meals-space-recipe-details";this.analyticsService.sendAddProductsEvents(e,t)}),th(()=>this.reloadBasket()),th(()=>td(null)),Wh(()=>td(null)))}removeItemsForIngredients(e){return nf(e.map(e=>this.removeIngredient(e.params.basketEntry))).pipe(df(()=>this.analyticsService.sendRemoveProductsEvents(e)),th(()=>this.reloadBasket()),th(()=>td(null)),Wh(()=>td(null)))}removeProductWithForcedQuantity(e){return nf(e.map(e=>this.removeIngredientFromRecipe(e.params.basketEntry,e.params.ingredientId,e.params.forcedQuantity))).pipe(df(()=>this.analyticsService.sendRemoveProductsEvents(e)),th(()=>this.reloadBasket()),th(()=>td(null)),Wh(()=>td(null)))}removeIngredientFromRecipe(e,t,i){var n;return(null===(n=e.recipesIds)||void 0===n?void 0:n.length)?this.waitForBasket.pipe(th(n=>this.http.patch(`https://api.miam.tech/api/v1/baskets/${n.id}/basket-entries/${e.id}/remove-recipe?ingredient_id=${t}&forced_quantity=${i}`,{})),th(()=>td(null)),Wh(()=>td(null))):e.delete()}removeIngredient(e){var t;return(null===(t=e.recipesIds)||void 0===t?void 0:t.length)?this.waitForBasket.pipe(th(t=>this.http.patch(`https://api.miam.tech/api/v1/baskets/${t.id}/basket-entries/${e.id}/remove-ingredient`,{})),th(()=>td(null)),Wh(()=>td(null))):e.delete()}changeBasketEntriesQuantities(e){return nf(e.map(e=>this.basketEntriesService.updateQuantity(e.params.basketEntry.id,e.params.newQuantity))).pipe(df(()=>this.analyticsService.sendProductsChangeQuantityEvents(e)),th(()=>this.reloadBasket()),th(()=>td(null)),Wh(()=>td(null)))}updateLocalBasket(e){return this.basketPreviewIsCalculating$.next(!0),this._basket$.next(e),this.loadPreview().pipe(df(()=>{this.basketIsFetching$.next(!1),this.currentAndPreviewFetching.next(!1)}))}fillBasket(e){const t=this.new();return t.fill(e),this.basketPreviewIsCalculating$.next(!0),this._basket$.next(t),this.loadPreview()}loadBasket(){return this.posService.waitForPos.pipe(th(()=>this.refreshCurrentBasket()))}loadPreview(){return this.waitForBasket.pipe(th(e=>this.recipesService.loadRecipes(e.recipeInfos)),th(e=>this.fetchBasketEntries(this._basket$.value).pipe(E(t=>{const i=this.groupBasketEntries(e,t),n=this.recipesAndLineEntriesToBasketPreviewLine(e,i);this._basketPreview$.next(n),this.basketPreviewIsCalculating$.next(!1),this.basketStats$.next(this.buildStats(n))}))))}fetchBasketEntries(t){if(!t||!t.completion||t.completion.total<1)return this._entries$.next([]),this._entries$.pipe(fp(1));const i=Math.ceil(t.completion.total/e.entriesPerPages);return nf(Array(i).fill(0).map((e,i)=>this.fetchBasketEntriesPage(t,i+1))).pipe(E(e=>{const t=Xp(e.map(e=>e.data));return this._entries$.next(t),this._entries$.value}))}buildStats(e){const t=Zg(...e.map(e=>e.entries.found),"id"),i=t.reduce((e,t)=>{const i=t.attributes["basket-entries-items"].find(e=>e.item_id===t.attributes["selected-item-id"]);return e+(t.attributes.quantity||0)*parseFloat(i["unit-price"])},0);return{recipesCount:e.length,entriesCount:t.length,totalPrice:i}}fetchBasketEntriesPage(t,i){let n=`https://api.miam.tech/api/v1/baskets/${t.id}/basket-entries`;return n=`${n}?include=items,selected-item&page[number]=${i}&page[size]=${e.entriesPerPages}`,this.http.get(n).pipe(E(e=>{const t=this.basketEntriesService.newCollection();return t.fill(e),t}))}recipesAndLineEntriesToBasketPreviewLine(e,t){return e.map((e,i)=>{const n=t[i].found.length;let r=0;const s=e.modifiedGuests||parseInt(e.guests,10);return t[i].found.forEach(e=>{const t=e.attributes.quantity,i=this.priceService.getCurrentPrice(this.priceService.getPriceFromBasketEntry(e));r+=t*i/(e.recipesIds.length||1)}),Df.fromRecipe(e,n,r/s,r,t[i])}).sort((t,i)=>e.findIndex(e=>e.id===i.id)-e.findIndex(e=>e.id===t.id))}groupBasketEntries(e,t){return e.map(e=>{const i={found:[],notFound:[],oftenDeleted:[],removed:[],all:[]};return t.filter(t=>t.recipesIds.includes(+e.id)).forEach(e=>{if(e.attributes["selected-item-id"])switch(e.status){case"often_deleted":i.oftenDeleted.push(e);break;case"deleted":i.removed.push(e);break;default:i.found.push(e)}else i.notFound.push(e);i.all.push(e)}),i})}}return e.entriesPerPages=30,e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(zf),nn(Vf),nn(__),nn(Rp),nn(Yf),nn(Zf),nn(Qf),nn(v_),nn(w_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function S_(e){return t=>t.lift(new x_(e))}class x_{constructor(e){this.total=e}call(e,t){return t.subscribe(new E_(e,this.total))}}class E_ extends m{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function I_(e){return t=>t.lift(new P_(e))}class P_{constructor(e){this.notifier=e}call(e,t){const i=new D_(e),n=j(this.notifier,new L(i));return n&&!i.seenValue?(i.add(n),t.subscribe(i)):i}}class D_ extends ${constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}class T_{}function A_(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());const t=new e.constructor;for(const i in e)e.hasOwnProperty(i)&&(t[i]=A_(e[i]));return t}var R_=function(e){return e.INITIAL_STATE="INITIAL_STATE",e.SENT_TO_RETAILER="SENT_TO_RETAILER",e.RETAILER_PRODUCT_MATCH="RETAILER_PRODUCT_MATCH",e}({});class O_{constructor(e,t,i,n,r){this.basketEntry=e,this.updateMealzParams=t,this.basketsService=i,this.basketEntriesService=n,this.suppliersService=r,this.status=R_.INITIAL_STATE,this.id=this.basketEntry.selectedItem.extId,this.quantity=this.basketEntry.quantity,this.onSuccess=new C,this.onTimeout=new C,this.onError=new C}get type(){return""}get loggable(){return{type:this.type,id:this.id,quantity:this.quantity,quantityToAdd:this.basketEntry.quantityToAdd,fromRetailer:this.updatedFromRetailer}}updateMealzBasket(){Sp("updateMealzBasket not implemented")}shouldRemoveAction(e){return Sp("shouldRemoveAction not implemented"),!1}initProcess(e){this.status=R_.SENT_TO_RETAILER;const t=setTimeout(()=>{const i=e.value.indexOf(this);i<0?clearTimeout(t):(this.onTimeout.next(),e.value.splice(i,1),Sp("[Mealz] Action has not been completed after 10 seconds, aborting",this.loggable),e.next(e.value))},1e4)}updateBasketEntryQuantity(){return this.basketEntry.quantityToAdd?this.findBasketEntryById(this.basketEntry.id).pipe(E(e=>{if(e){const t=A_(this.basketEntry);return t.quantity=e.quantity+this.basketEntry.quantityToAdd,this.quantity=t.quantity,t}return this.basketEntry})):td(this.basketEntry)}createActionForRetailer(){return this.getDifferenceFromBasketEntry(this).pipe(E(e=>({id:this.id,quantity:e})))}syncWithUpdateFromRetailer(e){if((null==e?void 0:e.quantity)<this.quantity)return this.quantity=e.quantity,this.basketEntry.quantity=e.quantity,void(this.updatedFromRetailer=!0);this.updatedFromRetailer=!1}getDifferenceFromBasketEntry(e){return this.basketsService.waitForBasketEntries.pipe(E(t=>{const i=t.filter(e=>"active"===e.status).find(t=>t.id===e.basketEntry.id&&t.selectedItem.extId===e.id);return e.quantity-((null==i?void 0:i.quantity)||0)}))}findBasketEntryById(e){return this.basketsService.waitForBasketEntries.pipe(th(t=>td(t.find(t=>t.id===e))))}}class F_ extends O_{get type(){return"ADD-PRODUCT"}updateMealzBasket(){this.updatedFromRetailer&&(this.quantity<1?this.basketsService.removeProduct(this.basketEntry,new T_):this.basketsService.changeProductQuantity(this.basketEntry,this.basketEntry.quantity,new T_,this.basketEntry.recipesIds[this.basketEntry.recipesIds.length-1].toString()))}createActionForRetailer(){return this.getDifferenceFromRetailerCart(this).pipe(E(e=>({id:this.id,quantity:e})))}getDifferenceFromRetailerCart(e){const t=this.suppliersService.lastSupplierCart.find(t=>e.basketEntry.selectedItem.extId===t.id);return td(e.quantity-((null==t?void 0:t.quantity)||0))}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)&&e.quantity===this.quantity}}class B_{constructor(){this.miamBasketEntries=[],this.previousMiamQuantity=0}get retailerQuantity(){var e;return(null===(e=this.retailerProduct)||void 0===e?void 0:e.quantity)||0}get miamQuantity(){return this.miamBasketEntries.reduce((e,t)=>e+t.quantity,0)}get firstBasketEntryId(){var e;return null===(e=this.miamBasketEntries[0])||void 0===e?void 0:e.id}updatePreviousQuantity(){this.previousMiamQuantity=this.miamQuantity}clearRetailerProduct(){this.retailerProduct=null}addOrUpdateRetailerProduct(e){this.retailerProduct=e}removeMiamEntriesIfNecessary(){let e=this.miamQuantity-this.retailerQuantity;if(e<0)return[];const t=[];return this.miamBasketEntries.forEach(i=>{if(e>0){const n=Math.min(i.quantity,e);e-=n,t.push({id:i.id,quantity:n}),i.quantity-=n,this.previousMiamQuantity-=n}}),t}addOrUpdateBasketEntry(e){const t=this.miamBasketEntries.findIndex(t=>t.id===e.id);t>-1?this.miamBasketEntries[t].quantity=e.attributes.quantity:this.miamBasketEntries.push({id:e.id,quantity:e.attributes.quantity}),this.retailerProduct||(this.retailerProduct={id:e.selectedItem.attributes["ext-id"],quantity:0})}cleanBasketEntries(e){this.miamBasketEntries=this.miamBasketEntries.filter(t=>{var i,n,r;return(null===(n=null===(i=e.find(e=>e.id===t.id))||void 0===i?void 0:i.selectedItem)||void 0===n?void 0:n.attributes["ext-id"])===(null===(r=this.retailerProduct)||void 0===r?void 0:r.id)})}removeBasketEntries(){this.miamBasketEntries=[]}updateRetailerProductsFromEntry(){const e=this.miamQuantity-this.previousMiamQuantity;if(this.previousMiamQuantity=this.miamQuantity,0===e||!this.retailerProduct)return[];const t=this.retailerProduct;return t.quantity+=e,t.quantity<=0&&this.clearRetailerProduct(),[{id:t.id,quantity:e}]}}let M_=(()=>{class e{constructor(){}initBasketComparator(e,t,i){return this.extIdToItemsComparator={},this.updateRetailerProducts(t),this.addEntriesFromMiam(e),this.updateEntriesFromMiam(e),i?this.resolveFromRetailer():this.resolveFromMiam(e)}updateReceivedFromMiam(e){return Cp(`[Miam] update received from Miam\n - ${JSON.stringify(null==e?void 0:e.map(e=>{var t;return{id:e.id,extId:null===(t=e.selectedItem)||void 0===t?void 0:t.attributes["ext-id"],quantity:e.attributes.quantity}}))}\n - current comparison: ${JSON.stringify(Object.keys(this.extIdToItemsComparator).map(e=>({id:e,MQ:this.extIdToItemsComparator[e].miamQuantity,RQ:this.extIdToItemsComparator[e].retailerQuantity})))}`),this.cleanMiamEntries(e),this.addEntriesFromMiam(e),this.updateEntriesFromMiam(e),this.resolveFromMiam(e)}cleanMiamEntries(e){Object.keys(this.extIdToItemsComparator).forEach(t=>{this.extIdToItemsComparator[t].cleanBasketEntries(e)})}updateEntriesFromMiam(e){Object.keys(this.extIdToItemsComparator).forEach(t=>{const i=this.extIdToItemsComparator[t],n=e.filter(e=>e.selectedItem&&e.selectedItem.attributes["ext-id"]===t);n.length>0?n.forEach(e=>i.addOrUpdateBasketEntry(e)):i.removeBasketEntries()})}addEntriesFromMiam(e){e.forEach(e=>{const t=e.selectedItem&&e.selectedItem.attributes["ext-id"];if(!t)return;if(this.extIdToItemsComparator[t])return;const i=new B_;i.addOrUpdateBasketEntry(e),this.extIdToItemsComparator[t]=i})}resolveFromMiam(e){Cp(`[Miam] resolve from Miam basket\n - ${JSON.stringify(null==e?void 0:e.map(e=>{var t;return{id:e.id,extId:null===(t=e.selectedItem)||void 0===t?void 0:t.attributes["ext-id"],quantity:e.attributes.quantity}}))}\n - current comparison: ${JSON.stringify(Object.keys(this.extIdToItemsComparator).map(e=>({id:e,MQ:this.extIdToItemsComparator[e].miamQuantity,RQ:this.extIdToItemsComparator[e].retailerQuantity})))}`);let t=[];return Object.keys(this.extIdToItemsComparator).forEach(e=>{const i=this.extIdToItemsComparator[e].updateRetailerProductsFromEntry();t=[...t,...i]}),t}updateReceivedFromRetailer(e){return this.updateRetailerProducts(e),this.deleteRemovedRetailerProducts(e),this.resolveFromRetailer()}updateRetailerProducts(e){e.forEach(e=>{let t=this.extIdToItemsComparator[e.id];t||(t=new B_,this.extIdToItemsComparator[e.id]=t),t.addOrUpdateRetailerProduct(e)})}deleteRemovedRetailerProducts(e){Object.keys(this.extIdToItemsComparator).forEach(t=>{const i=this.extIdToItemsComparator[t];e.find(e=>e.id===t)||i.clearRetailerProduct()})}resolveFromRetailer(){let e=[];return Object.keys(this.extIdToItemsComparator).forEach(t=>{const i=this.extIdToItemsComparator[t];e=[...e,...i.removeMiamEntriesIfNecessary()]}),this.refreshQuantities(),e}refreshQuantities(){Object.keys(this.extIdToItemsComparator).forEach(e=>{this.extIdToItemsComparator[e].updatePreviousQuantity()})}reset(){this.extIdToItemsComparator=void 0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),L_=(()=>{class e{constructor(e,t,i){this.comparatorService=e,this.basketsService=t,this.supplierService=i,this.ignoreUpdatesFromMiam=!1,this.firstMiamBasketProcess=!0,this.pushProductsToBasket=e=>{throw new Error("No method was passed to 'window.miam.basket.definePushProductsToBasket'")},this.supplierService.supplier$.pipe(bp(e=>!e),fp(1),df(()=>{this.listenToMiam()})).subscribe()}set ignoreMiam(e){this.ignoreUpdatesFromMiam=e,e||this.basketsService.activeBasketEntries().pipe(fp(1)).subscribe(e=>this.processMiamBasket(e))}listenToMiam(){this.basketsService.activeBasketEntries().subscribe(e=>{this.ignoreUpdatesFromMiam||this.processMiamBasket(e)})}processMiamBasket(e){var t;Cp(`[Miam] Miam basket received\n - ${JSON.stringify(null==e?void 0:e.map(e=>({id:e.id,quantity:e.attributes.quantity})))}\n - First Miam basket was: ${JSON.stringify(null===(t=this.firstMiamBasket)||void 0===t?void 0:t.map(e=>({id:e.id,quantity:e.attributes.quantity})))}`),this.firstMiamBasket||0!==e.length||!this.firstMiamBasketProcess?this.miamBasketChanged(e):this.firstMiamBasketProcess=!1}miamBasketChanged(e){if(!this.isReady())return this.initFirstMiamBasket(e);if(this.isProcessingRetailerEvent)return void Cp("[Miam] skipping basket-sync - retailer is processing");const t=this.comparatorService.updateReceivedFromMiam(e);this.sendUpdateToRetailer(t)}initFirstMiamBasket(e){this.firstMiamBasket=e,this.initIfPossible()}initFirstRetailerBasket(e){this.firstRetailerBasket=e,this.initIfPossible()}initIfPossible(){var e;if(Cp(`[Miam] Trying to start basket sync\n - Miam: ${JSON.stringify(null===(e=this.firstMiamBasket)||void 0===e?void 0:e.map(e=>({id:e.id,quantity:e.attributes.quantity})))}\n - Retailer: ${JSON.stringify(this.firstRetailerBasket)}`),this.isReady())if("true"===sessionStorage.getItem("_miam/basketActionInterrupted")){const e=this.comparatorService.initBasketComparator(this.firstMiamBasket,this.firstRetailerBasket,!1);this.sendUpdateToRetailer(e),sessionStorage.removeItem("_miam/basketActionInterrupted")}else{this.isProcessingRetailerEvent=!0;const e=this.comparatorService.initBasketComparator(this.firstMiamBasket,this.firstRetailerBasket,!0);this.sendUpdateToMiam(e)}}isReady(){return!!this.firstMiamBasket&&!!this.firstRetailerBasket}resetMiam(){this.firstMiamBasket=void 0,this.comparatorService.reset()}sendUpdateToRetailer(e){Cp("[Miam] will update retailer "+JSON.stringify(e)),0!==e.length&&(this.pushBasketEntriesToBasket?this.pushBasketEntriesAndManagePFTs(e):this.pushProductsToBasket(e))}pushBasketEntriesAndManagePFTs(e){this.basketsService.basketEntries().pipe(fp(1)).subscribe(t=>{this.pushBasketEntriesToBasket(e.map(e=>{const i=t.find(t=>{var i;return(null===(i=t.selectedItem)||void 0===i?void 0:i.attributes["ext-id"])===e.id})?t.find(t=>{var i;return(null===(i=t.selectedItem)||void 0===i?void 0:i.attributes["ext-id"])===e.id}):void 0;if(i){const t=i.attributes["basket-entries-items"].find(e=>String(e.item_id)===i.selectedItem.id)||{};return Object.assign(i.selectedItem.attributes,{"pft-checksum":t.pft_checksum,"pft-plages":t.pft_plages}),{basketEntry:i,quantity:e.quantity}}return{removedId:e.id,quantity:e.quantity}}))})}sendUpdateToMiam(e){if(Cp("[Miam] will remove from miam "+JSON.stringify(e)),0===e.length)return Cp("[Miam] stop processing retailer event"),void(this.isProcessingRetailerEvent=!1);this.entriesToClean().pipe(th(t=>(e=[...e,...t],this.basketsService.removeBasketEntries(e)))).subscribe(()=>{Cp("[Miam] stop processing retailer event"),this.isProcessingRetailerEvent=!1})}entriesToClean(){return this.basketsService.activeBasketEntries().pipe(fp(1),E(e=>e.filter(e=>!e.selectedItem).map(e=>({id:e.id,quantity:e.quantity}))))}retailerBasketChanged(e){if(Cp(`[Miam] Update received from retailer\n - ${JSON.stringify(e)}\n - First retailer basket was : ${JSON.stringify(this.firstRetailerBasket)}`),!this.isReady())return this.initFirstRetailerBasket(e);this.isProcessingRetailerEvent=!0;const t=this.comparatorService.updateReceivedFromRetailer(e);this.sendUpdateToMiam(t)}handlePayment(e){e&&this.basketsService.confirmPaymentAndBasket(e).subscribe(()=>{this.firstRetailerBasket=[]})}}return e.\u0275fac=function(t){return new(t||e)(nn(M_),nn(C_),nn(Nf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),$_=(()=>{class e{constructor(e,t){this.basketsService=e,this.supplierService=t,this.subscriptions=[],this.mealzActionList=new cp([]),this.firstRetailerCartChanged=!0,this.noSupplier$=new cp(!1),this.lockWhileConfirming=new cp(!1),this.lockWhileSynchronizing=new cp(!1),this.pushBasketEntriesToBasket=()=>{throw new Error("No method was passed to 'window.mealz.basketSync.definePushBasketEntriesToBasket'")},this.init()}init(){Cp("[Mealz] Initializing BasketsSynchronizerService"),q(this.supplierService.supplier$,this.noSupplier$).pipe(bp((e,t)=>!e&&!t),fp(1),df(()=>{this.listenActionList(),this.listenToConfirm()})).subscribe()}addToActionList(e){e.forEach(e=>{e.updateBasketEntryQuantity().pipe(fp(1)).subscribe(t=>{e.basketEntry=t,this.mealzActionList.value.push(e)})}),this.mealzActionList.next(this.mealzActionList.value)}listenActionList(){Cp("[Mealz] Listening to action list"),this.subscriptions.push(this.mealzActionList.pipe(E(e=>e.filter(e=>e.status===R_.INITIAL_STATE)),id(e=>e.length>0),th(e=>this.createActionsForRetailer(e))).subscribe(e=>{if(e.length>0){Cp("[Mealz] Pushing products to retailer cart",e);const t=this.checkActionsToSkip(e),i=e.filter(e=>!t.some(t=>t.id===e.id));i.length>0&&this.sendActionsToRetailerCart(e.filter(e=>i.includes(e)))}else this.syncMealzBasketWithRetailerCart(this.supplierService.lastSupplierCart)}))}sendActionsToRetailerCart(e){if(this.pushProductsToRetailerCart)this.pushProductsToRetailerCart(e);else{if(!this.addProductsToRetailerCart||!this.removeProductsFromRetailerCart)throw new Error("[Mealz] is missing a callback to add to cart: You need to call either 'window.mealz.basketSync.definePushProductsToCart' or both 'window.mealz.basketSync.defineAddProductsToCart' and 'window.mealz.basketSync.defineRemoveProductsToCart'");{const t=[],i=[];e.forEach(e=>{e.quantity<0?i.push({id:e.id,quantity:-1*e.quantity,additionalInfos:e.additionalInfos}):t.push(e)}),t.length>0&&this.addProductsToRetailerCart(t),i.length>0&&this.removeProductsFromRetailerCart(i)}}}createActionsForRetailer(e){Cp("[Mealz] Processing actions in list:",e.map(e=>e.loggable));const t=new Set,i=[];return e.forEach(e=>{if(!t.has(e.id)){t.add(e.id),e.initProcess(this.mealzActionList);const n=e.createActionForRetailer();i.push(n)}}),nf(i)}syncMealzBasketWithRetailerCart(e){this.lockWhileSynchronizing.next(!0),this.basketsService.waitForBasketEntries.pipe(fp(1),th(t=>{const i=t.filter(e=>"active"===e.status),n=this.mapRetailerCartProducts(e),r=i.map(e=>{const t=n[e.selectedItem.extId];return t?this.handleMatchingProduct(t,e):this.handleNonMatchingProduct(e)});return 0===r.length&&r.push(td(null)),nf(r)})).subscribe(()=>{this.lockWhileSynchronizing.next(!1)})}mapRetailerCartProducts(e){return e.reduce((e,t)=>(e[t.id]=t,e),{})}handleMatchingProduct(e,t){return new v(i=>{this.updateMealzBasketFromRetailerBasket(e,t),Xg([this.basketsService.entryIsBeingUpdated(t.id),this.basketsService.entryWillBeUpdated(t.id)]).pipe(bp(([e,t])=>e||t),fp(1)).subscribe(()=>{i.next(),i.complete()})})}handleNonMatchingProduct(e){return new v(t=>{this.basketsService.removeProduct(e,new T_),Xg([this.basketsService.entryIsBeingRemoved(e.id),this.basketsService.entryWillBeRemoved(e.id)]).pipe(bp(([e,t])=>e||t),fp(1)).subscribe(()=>{t.next(),t.complete()})})}retailerCartChanged(e){Cp("[Mealz] Retailer cart changed",e);const t=[...this.supplierService.lastSupplierCart];this.firstRetailerCartChanged&&(this.syncMealzBasketWithRetailerCart(e),this.firstRetailerCartChanged=!1),Xg([this.lockWhileConfirming,this.lockWhileSynchronizing]).pipe(bp(([e,t])=>e||t),fp(1)).subscribe(()=>{const{addedProducts:i,updatedProducts:n,removedProducts:r}=this.compareProducts(t,e);i.length>0&&this.checkAddActions(i,this.mealzActionList.value),r.length>0&&this.checkRemoveActions(r,this.mealzActionList.value),n.length>0&&this.checkUpdateActions(n,this.mealzActionList.value)})}checkAddActions(e,t){Cp("[Mealz] Were added by retailer:",e),e.forEach(e=>{const i=t.find(t=>t.id===e.id);i&&i.status===R_.SENT_TO_RETAILER&&(i.status=R_.RETAILER_PRODUCT_MATCH,i.syncWithUpdateFromRetailer(e),i.updateMealzBasket(),this.removeFinishedActionsFromList(e.id,i))})}checkRemoveActions(e,t){Cp("[Mealz] Were removed by retailer:",e),e.forEach(e=>{const i=t.find(t=>t.id===e.id);i&&i.status===R_.SENT_TO_RETAILER?(i.status=R_.RETAILER_PRODUCT_MATCH,i.updateMealzBasket(),this.removeFinishedActionsFromList(e.id,i)):this.findProductInBasketEntries(e.id).subscribe(e=>{e&&this.basketsService.removeProduct(e,new T_)})})}checkUpdateActions(e,t){Cp("[Mealz] Were updated by retailer:",e),e.forEach(e=>{const i=t.find(t=>t.id===e.id);i&&i.status===R_.SENT_TO_RETAILER?(i.status=R_.RETAILER_PRODUCT_MATCH,i.syncWithUpdateFromRetailer(e),i.updateMealzBasket(),this.removeFinishedActionsFromList(e.id,i)):this.findAndRemoveExcessProductsInMealzBasket(e)})}checkActionsToSkip(e){const t=[];return e.forEach(e=>{0===e.quantity&&(t.push(e),this.skipRetailerUpdateForAction(this.mealzActionList.value.find(t=>t.id===e.id)))}),t}skipRetailerUpdateForAction(e){Cp("[Mealz] Skipping retailer update for action",e.loggable),this.findProductInBasketEntries(e.id).subscribe(t=>{e.status=R_.RETAILER_PRODUCT_MATCH,e.quantity=(null==t?void 0:t.quantity)||0,e.basketEntry.quantity=(null==t?void 0:t.quantity)||0,e.updateMealzBasket(),this.basketsService.productsWillBeAdded().pipe(bp(e=>e>0),fp(1)).subscribe(()=>{this.removeFinishedActionsFromList(e.id,e)})})}removeFinishedActionsFromList(e,t){Cp("[Mealz] Removing finished actions from list",t.loggable);const i=new C;this.basketsService.basketEntries().pipe(I_(i),th(n=>{if(t.status!==R_.RETAILER_PRODUCT_MATCH)return td(null);const r=n.find(t=>t.selectedItem.extId===e);return t.shouldRemoveAction(r)&&(this.finishAction(t),i.next(),i.complete()),td(r)})).subscribe()}finishAction(e){e.onSuccess.next(),this.mealzActionList.value.splice(this.mealzActionList.value.indexOf(e),1),this.mealzActionList.next(this.mealzActionList.value)}findAndRemoveExcessProductsInMealzBasket(e){Cp("[Mealz] Finding and removing excess products in Mealz basket",e),this.findProductInBasketEntries(e.id).subscribe(t=>{t&&this.updateMealzBasketFromRetailerBasket(e,t)})}findProductInBasketEntries(e){return this.basketsService.waitForBasketEntries.pipe(th(t=>td(t.find(t=>t.selectedItem.extId===e))))}updateMealzBasketFromRetailerBasket(e,t){t.quantity===e.quantity||e.quantity>t.quantity||(t.quantity=e.quantity,this.basketsService.changeProductQuantity(t,e.quantity,new T_))}subjectContainsEntryId(e,t){return e.pipe(E(e=>e.some(e=>e.id===t)))}hasPendingActions(){return this.mealzActionList.pipe(E(e=>e.length>0))}entryWillBeAdded(e){return this.subjectContainsEntryId(this.mealzActionList,e)}entryWillBeUpdated(e){return this.subjectContainsEntryId(this.mealzActionList,e)}compareProducts(e,t){const i=[],n=[],r=[],s=new Map;e.forEach(e=>s.set(e.id,e));const o=new Map;return t.forEach(e=>o.set(e.id,e)),t.forEach(e=>{const t=s.get(e.id);t?e.quantity!==t.quantity&&r.push(Object.assign(Object.assign({},e),{additionalInfos:{quantityDifference:e.quantity-t.quantity}})):i.push(e)}),e.forEach(e=>{o.has(e.id)||n.push(e)}),{addedProducts:i,removedProducts:n,updatedProducts:r}}handlePayment(e){e&&this.basketsService.confirmPaymentAndBasket(e).subscribe()}listenToConfirm(){this.basketsService.confirming.pipe(bp(e=>e===this.lockWhileConfirming.value)).subscribe(e=>{!e&&this.lockWhileConfirming.value&&this.resetMealz(),this.lockWhileConfirming.next(e)})}resetMealz(){this.mealzActionList.next([])}}return e.\u0275fac=function(t){return new(t||e)(nn(C_),nn(Nf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class j_ extends O_{get type(){return"REMOVE-PRODUCT"}updateMealzBasket(){}shouldRemoveAction(e){return!0}}class z_ extends O_{get type(){return"REMOVE-PRODUCT"}updateMealzBasket(){this.updateMealzParams.recipeId?this.basketsService.removeIngredientsFromBasket(this.basketEntry,this.updateMealzParams.recipeId,[this.updateMealzParams.ingredientId],this.updateMealzParams.eventTrace):this.basketsService.removeProduct(this.basketEntry,this.updateMealzParams.eventTrace)}shouldRemoveAction(e){return!0}}class N_ extends O_{get type(){return"UPDATE-PRODUCT"}updateMealzBasket(){var e;this.basketsService.changeProductQuantity(this.basketEntry,this.basketEntry.quantity,this.updateMealzParams.eventTrace,null===(e=this.updateMealzParams)||void 0===e?void 0:e.recipeId)}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)&&e.quantity===this.quantity}updateBasketEntryQuantity(){return td(this.basketEntry)}}let V_=(()=>{class e{constructor(e,t,i,n,r){this.basketsService=e,this.recipesService=t,this.priceService=i,this.basketSynchroService=n,this.analyticsService=r,this.recipesWithEntries=[],this.basketPreviewState$=new cp({isOpen:!1,activeTabIndex:0})}buildPreview(){return this.matchRecipesWithBasketEntries().pipe(th(e=>this.formatPreview(e)))}openBasket(e="",t=0){this.basketPreviewState$.next({isOpen:!0,activeTabIndex:t}),this.analyticsService.sendEvent("basket.display",e,{})}removeRecipe(e,t){return this.fetchDataToRemoveRecipe(e).pipe(th(({recipe:i,basketEntries:n})=>{const r=this.buildRemoveProducts(i,n),s=this.buildRemoveActions(r);return 0!==s.length?(this.basketSynchroService.addToActionList(s),s[s.length-1].onSuccess.pipe(fp(1),th(()=>this.removeRecipeFromBasket(r,e,t)))):this.basketsService.removeRecipeById(e,t)}))}removeProduct(e,t){const i=A_(e);i.quantity=0;const n=new z_(i,{eventTrace:t,ingredientId:""},this.basketsService);this.basketSynchroService.addToActionList([n])}updateProduct(e,t,i){const n=A_(e);n.quantity=t;const r=new N_(n,{eventTrace:i},this.basketsService);this.basketSynchroService.addToActionList([r])}buildRemoveProducts(e,t){return A_(t).map((t,i)=>({basketEntry:t,ingredient:e.ingredients[i]})).filter(e=>"-1"!==e.basketEntry.id)}buildRemoveActions(e){return e.filter(e=>"active"===e.basketEntry.status&&e.basketEntry.quantity>0).map(e=>new j_(e.basketEntry,{},this.basketsService))}fetchDataToRemoveRecipe(e){return this.recipesService.getIngredientsByRecipeId(e).pipe(th(e=>nf(e.ingredients.map(e=>this.basketsService.basketEntryFromIngredient(e.id,0))).pipe(E(t=>({recipe:e,basketEntries:t})))))}removeRecipeFromBasket(e,t,i){return nf(e.map(e=>this.basketsService.removeIngredientFromRecipe(e.basketEntry,e.ingredient.id,e.basketEntry.quantity+e.basketEntry.quantityToAdd))).pipe(th(()=>this.basketsService.reloadBasket()),th(()=>this.basketsService.removeRecipeById(t,i,!0)))}formatPreview(e){return this.recipesWithEntries=e,td(e.map(({recipe:e,entries:t})=>{const{id:i,modifiedGuests:n,guests:r,attributes:s}=e,{title:o,"media-url":a}=s,c=n||parseInt(r,10)||1,l=t.reduce((e,t)=>e+t.quantity,0),u=t.reduce((e,t)=>{const i=this.priceService.getCurrentPrice(this.priceService.getPriceFromBasketEntry(t));return e+t.attributes.quantity*i/(t.recipesIds.length||1)},0),d=u/c;return{id:i,title:o,picture:a,guests:c,nbrProducts:l,totalPrice:Math.round(100*u)/100,"price-per-serve":Math.round(100*d)/100}}))}matchRecipesWithBasketEntries(){return this.basketsService.waitForBasket.pipe(th(e=>nf({recipes:this.recipesService.loadRecipes(e.recipeInfos).pipe(fp(1)),activeEntries:this.basketsService.activeBasketEntries().pipe(fp(1))})),E(({recipes:e,activeEntries:t})=>e.map(e=>({recipe:e,entries:t.filter(t=>t.recipesIds.includes(+e.id))}))))}}return e.\u0275fac=function(t){return new(t||e)(nn(C_),nn(__),nn(w_),nn($_),nn(Rp))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),H_=(()=>{class e{constructor(e,t,i,n,r,s,o,a,c,l,u){this.analyticsService=e,this.basketsService=t,this.contextRegistryService=i,this.posService=n,this.http=r,this.userService=s,this.recipesService=o,this.suppliersService=a,this.basketSynchroService=c,this.statesService=l,this.basketUtilsService=u,this.basketIsBeingTransferred=new cp(!1),this.transferComplete$=new C,this.previousBasketEntries=[],this.subscriptions=[],this.subscriptions.push(this.startTransferOnSupplierLoaded(),this.checkAuthlessTransfer(),this.checkBasketStatus())}startTransferOnSupplierLoaded(){return this.suppliersService.supplier$.pipe(bp(e=>!e),fp(1)).subscribe(()=>this.handleBasketTransfer())}checkAuthlessTransfer(){return this.statesService.callAuthlessTransfer.pipe(fp(1)).subscribe(()=>this.updateRetailerBasket())}checkBasketStatus(){return this.basketsService._basket$.pipe(bp(e=>!e),E(e=>"transferring"===e.attributes.status)).subscribe(e=>{this.basketIsBeingTransferred.next(e),!e&&sessionStorage.getItem("_miam/transferUrl")&&sessionStorage.removeItem("_miam/transferUrl")})}unsubscribeService(){this.subscriptions.forEach(e=>e.unsubscribe())}setSessionData(e){sessionStorage.setItem("_miam/transferredBasketToken",e.basketToken),sessionStorage.setItem("_miam/posOfSaleExtId",e.posExtId)}clearTransferSessionData(){sessionStorage.removeItem("_miam/transferredBasketToken"),sessionStorage.removeItem("_miam/pointOfSaleExtId")}confirmBasket(){this.subscriptions.push(this.posService.waitForPos.pipe(fp(1),th(e=>this.http.patch("https://api.miam.tech/api/v1/baskets/start_transfer?point_of_sale_id="+e.id,{})),th(e=>{const[t,i]=e.transfer_url.split("?");return e.transfer_url=(this.contextRegistryService.transferUrlBaseOverride||t)+(i?"?"+i:""),this.basketsService.refreshCurrentBasket().pipe(bp(e=>!e),fp(1),th(t=>(this.analyticsService.sendEvent("basket.transfer","/basket",{basket_id:t.id,miam_amount:t.totalPrice.toString(),pos_id:this.posService.pos$.getValue().id,pos_name:this.posService.pos$.getValue().attributes.name,supplier_id:this.posService.pos$.getValue().relationships.supplier.data.id}),td(e))))}),th(e=>(sessionStorage.setItem("_miam/transferUrl",e.transfer_url),this.navigateToTransferUrl(),this.recipesService.hide(),td(null)))).subscribe())}navigateToTransferUrl(){const e=sessionStorage.getItem("_miam/transferUrl");e&&setTimeout(()=>window.open(e,"_blank"))}abortTransfer(){return this.posService.waitForPos.pipe(fp(1),th(e=>this.http.patch("https://api.miam.tech/api/v1/baskets/abort_transfer?point_of_sale_id="+e.id,{})),th(()=>this.basketsService.reloadBasket()),th(()=>(this.basketIsBeingTransferred.next(!1),td(null))))}handleBasketTransfer(){const e=this.getTransferData();e&&(this.setSessionData(e),this.tryToTransferBasket(e).pipe(th(()=>this.basketsService.reloadBasket())).subscribe())}tryToTransferBasket(e){return this.callHookbackIfNotLogged().pipe(bp(e=>!e),th(()=>this.forcePosIfUnset(e.posExtId)),bp(e=>!e),th(()=>this.posService.waitForPos.pipe(fp(1),th(e=>this.basketsService.waitForBasket.pipe(fp(1),th(()=>this.basketsService.waitForBasketEntries.pipe(fp(1),E(t=>(this.previousBasketEntries=A_(t),e)))))),th(t=>this.transferBasketForPos(t,e.basketToken)),fp(1))))}transferBasketForPos(e,t){const i=`https://api.miam.tech/api/v1/baskets/transfer?point_of_sale_id=${e.id}&transferred_basket_token=${t}`;return this.clearTransferSessionData(),sessionStorage.setItem("_miam/basketActionInterrupted","true"),this.http.patch(i,{}).pipe(Wh(()=>(this.transferComplete$.next(),td(null))),df(e=>e&&this.basketUtilsService.openBasket()),th(()=>this.basketsService.refreshCurrentBasket().pipe(th(()=>(this.transferComplete$.next(),sessionStorage.removeItem("_miam/basketActionInterrupted"),this.updateRetailerBasket(),td(!0))))))}filterNewAndUpdatedEntries(e){return[...e.filter(e=>!this.previousBasketEntries.find(t=>t.id===e.id)),...e.filter(e=>this.previousBasketEntries.find(t=>t.id===e.id&&t.quantity!==e.quantity))]}updateRetailerBasket(){this.basketsService.activeBasketEntries().pipe(S_(1),fp(1),th(e=>(this.createTransferAction(e),e))).subscribe()}updateRetailerBasketFromPlanner(){const e=this.basketsService.reloadBasket().pipe(th(()=>this.basketsService.currentAndPreviewFetching),bp(e=>e),fp(1),th(()=>this.basketsService.activeBasketEntries()),fp(1),th(e=>(e.length>0&&this.createTransferAction(e),e))).subscribe();this.subscriptions.push(e)}createTransferAction(e){const t=this.filterNewAndUpdatedEntries(e).map(e=>{const t=new F_(e,{},this.basketsService,void 0,this.suppliersService);return this.handleActionErrors(t),t});this.basketSynchroService.addToActionList(t)}handleActionErrors(e){e.onTimeout.pipe(fp(1)).subscribe(()=>{this.basketsService.removeProduct(e.basketEntry,new T_)})}callHookbackIfNotLogged(){return this.userService.isLogged$.pipe(fp(1),E(e=>this.contextRegistryService.hookCallback(e,!0)))}forcePosIfUnset(e){return this.posService.posWasInitialized().pipe(I_(this.transferComplete$),th(()=>this.posService.pos$.pipe(fp(1))),th(t=>{const i=t&&t.extId===e;return i||this.contextRegistryService.forcePosCallback(e),td(i)}))}getTransferData(){var e;const t=window.location.href,i=new URL(t).searchParams,n=i.get("transferred_basket_token")||sessionStorage.getItem("_miam/transferredBasketToken"),r=i.get("point_of_sale_ext_id")||i.get("magasin_id")||sessionStorage.getItem("_miam/posOfSaleExtId"),s=null===(e=i.get("affiliate"))||void 0===e?void 0:e.toLowerCase();return n&&r?(this.removeTransferParamsFromUrl(),{basketToken:n,posExtId:r,affiliate:s}):null}removeTransferParamsFromUrl(){const e=window.location.href,t=e.split("?")[1];if(t){const i=new URLSearchParams(t);i.delete("transferred_basket_token"),i.delete("point_of_sale_ext_id"),i.delete("magasin_id"),i.delete("affiliate");const n=e.split("?")[0]+(i.toString().length>0?"?"+i.toString():"");history.replaceState({},document.title,n)}}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(C_),nn(Dp),nn(Vf),nn(wd),nn(Yf),nn(__),nn(Nf),nn($_),nn(v_),nn(V_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),U_=(()=>{class e extends sp{constructor(e){super(),this.http=e,this.resource=Rf,this.type="catalog-settings",this.url=Ip+"/api/v1",this.register()}getSupplierCatalogSettings(e){return this.http.get(`${this.url}/suppliers/${e.id}/catalog-settings`).pipe(E(e=>e.data[0]))}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class q_ extends O_{get type(){return"RESET-BASKET"}updateMealzBasket(){}shouldRemoveAction(e){return!0}}let G_,W_=(()=>{class e{constructor(e){this.basketsService=e,this.listenBasketEntriesChange()}listenBasketEntriesChange(){this.basketsService.basketEntries().subscribe(e=>this.cleanupRecipesWithDeletedEntries(e))}cleanupRecipesWithDeletedEntries(e){const t=new Map,i=[];for(const n of e){const e=n.recipesIds||[];for(const i of e){t.has(+i)||t.set(+i,[]);const e=t.get(+i);e&&e.push(n)}}for(const[n,r]of t.entries())r.every(e=>"deleted"===e.attributes.status)&&this.basketsService.recipeIsInBasket(n.toString())&&i.push(n.toString());i.length>0&&this.removeRecipesFromBasket(i)}removeRecipesFromBasket(e){this.basketsService.removeRecipesFromBasket(e,{originPath:"",props:{}},!1)}}return e.\u0275fac=function(t){return new(t||e)(nn(C_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function Z_(e){return Array.isArray(e)?e:[e]}function Q_(e){return e instanceof wa?e.nativeElement:e}function Y_(...e){return H(1)(td(...e))}function K_(...e){const t=e[e.length-1];return x(t)?(e.pop(),i=>Y_(e,i,t)):t=>Y_(e,t)}try{G_="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(fE){G_=!1}let J_,X_,ev=(()=>{class e{constructor(e){this._platformId=e,this.isBrowser=this._platformId?"browser"===this._platformId:"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!G_)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return e.\u0275fac=function(t){return new(t||e)(nn(el))},e.\u0275prov=de({factory:function(){return new e(nn(el))},token:e,providedIn:"root"}),e})(),tv=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({}),e})();function iv(e){return function(){if(null==J_&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>J_=!0}))}finally{J_=J_||!1}return J_}()?e:!!e.capture}function nv(e){if(function(){if(null==X_){const e="undefined"!=typeof document?document.head:null;X_=!(!e||!e.createShadowRoot&&!e.attachShadow)}return X_}()){const t=e.getRootNode?e.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&t instanceof ShadowRoot)return t}return null}const rv=new Set;let sv,ov=(()=>{class e{constructor(e){this._platform=e,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):av}matchMedia(e){return this._platform.WEBKIT&&function(e){if(!rv.has(e))try{sv||(sv=document.createElement("style"),sv.setAttribute("type","text/css"),document.head.appendChild(sv)),sv.sheet&&(sv.sheet.insertRule(`@media ${e} {.fx-query-test{ }}`,0),rv.add(e))}catch(t){console.error(t)}}(e),this._matchMedia(e)}}return e.\u0275fac=function(t){return new(t||e)(nn(ev))},e.\u0275prov=de({factory:function(){return new e(nn(ev))},token:e,providedIn:"root"}),e})();function av(e){return{matches:"all"===e||""===e,media:e,addListener:()=>{},removeListener:()=>{}}}let cv=(()=>{class e{constructor(e,t){this._mediaMatcher=e,this._zone=t,this._queries=new Map,this._destroySubject=new C}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(e){return lv(Z_(e)).some(e=>this._registerQuery(e).mql.matches)}observe(e){let t=Xg(lv(Z_(e)).map(e=>this._registerQuery(e).observable));return t=Y_(t.pipe(fp(1)),t.pipe(S_(1),of(0))),t.pipe(E(e=>{const t={matches:!1,breakpoints:{}};return e.forEach(({matches:e,query:i})=>{t.matches=t.matches||e,t.breakpoints[i]=e}),t}))}_registerQuery(e){if(this._queries.has(e))return this._queries.get(e);const t=this._mediaMatcher.matchMedia(e),i={observable:new v(e=>{const i=t=>this._zone.run(()=>e.next(t));return t.addListener(i),()=>{t.removeListener(i)}}).pipe(K_(t),E(({matches:t})=>({query:e,matches:t})),I_(this._destroySubject)),mql:t};return this._queries.set(e,i),i}}return e.\u0275fac=function(t){return new(t||e)(nn(ov),nn(gl))},e.\u0275prov=de({factory:function(){return new e(nn(ov),nn(gl))},token:e,providedIn:"root"}),e})();function lv(e){return e.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}let uv=(()=>{class e{constructor(e){this.basketService=e,this.inBasket={}}matchMealzBasket(){this.basketService.waitForBasketEntries.subscribe(e=>{const t=e.filter(e=>"active"===e.status).map(e=>({id:e.selectedItem.extId,quantity:e.quantity}));this.pushToFakeCart(t)})}pushToFakeCart(e){e.forEach(e=>{var t;this.inBasket[e.id]=(null!==(t=this.inBasket[e.id])&&void 0!==t?t:0)+e.quantity,this.inBasket[e.id]<1&&delete this.inBasket[e.id]}),window.mealz.basketSync.retailerBasketChanged(this.getSupplierCart())}getSupplierCart(){return Object.entries(this.inBasket).map(([e,t])=>({id:e,quantity:t}))}}return e.\u0275fac=function(t){return new(t||e)(nn(C_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class dv extends O_{get type(){return"ADD-PRODUCT"}updateMealzBasket(){this.basketsService.addIngredientsToBasket(this.updateMealzParams.recipeId,[{ingredientId:this.updateMealzParams.ingredientId,entry:this.basketEntry}],this.updateMealzParams.eventTrace)}createActionForRetailer(){return(this.quantity<1?td(this.quantity):this.getDifferenceFromBasketEntry(this)).pipe(E(e=>({id:this.id,quantity:e})))}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)}}class hv extends O_{get type(){return"UPDATE-PRODUCT"}updateMealzBasket(){this.basketsService.changeProductQuantity(this.basketEntry,this.basketEntry.quantity,this.updateMealzParams.eventTrace,this.updateMealzParams.recipeId)}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)&&e.quantity===this.quantity}}let pv=(()=>{class e{constructor(e,t,i,n,r){this.contextRegistryService=e,this.userService=t,this.posService=i,this.basketsService=n,this.recipesService=r,this.shouldExecuteBasketMethod=new cp(void 0),this.subscriptions=new d,this.subscriptions.add(this.canExecuteStoredMethod().subscribe())}storeMethodIfCallbackNeeded(e){return this.hasUserAndHasPos().pipe(fp(1),E(t=>{t[0]&&t[1]||localStorage.setItem("_miam/storeCallbackMethod",JSON.stringify(e));const i=this.contextRegistryService.hookCallback(t[0],t[1]);return i&&localStorage.removeItem("_miam/storeCallbackMethod"),i}))}canExecuteStoredMethod(){return this.basketsService.waitForBasketEntries.pipe(th(()=>this.hasUserAndHasPos().pipe(bp(e=>!e[0]||!e[1]),fp(1),E(()=>this.getStoredMethod()))))}hasUserAndHasPos(){return Xg([this.userService.isLogged$,this.posService.posWasInitialized()])}getStoredMethod(){const e=localStorage.getItem("_miam/storeCallbackMethod");if(e&&"setFavoritesFilter"!==e){const e=JSON.parse(localStorage.getItem("_miam/storeCallbackMethod"));this.shouldExecuteBasketMethod.next(e),this.recipesService.display(e.arguments.recipeId,{previewAllowed:!0,previewMode:!1}),localStorage.removeItem("_miam/storeCallbackMethod")}}}return e.\u0275fac=function(t){return new(t||e)(nn(Dp),nn(Yf),nn(Vf),nn(C_),nn(__))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),mv=(()=>{class e extends sp{constructor(e,t){super(),this.http=e,this.posService=t,this.resource=ff,this.type="items",this.register()}searchForIngredient(e,t,i){return this.posService.waitForPos.pipe(fp(1),th(n=>{let r=`https://api.miam.tech/api/v1/items/search?${t?`ingredient_id=${t}&`:""}${i?`guests=${i}&`:""}point_of_sale_id=${n.id}`;return e&&(r+="&name="+e),this.http.get(encodeURI(r.trim()))}))}getPriceForItem(e){return this.posService.waitForPos.pipe(fp(1),th(t=>this.http.get(`https://api.miam.tech/api/v1/items/${e}/price?point_of_sale_id=${t.id}`)),E(e=>({unit:e.price,pricePerUnit:e["price-per-unit"],unitOfMeasurement:e["unit-of-measurement"],discountAmount:e["discount-amount"],discountType:e["discount-type"],discountedPrice:e["discounted-price"]})))}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Vf))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),gv=(()=>{class e{constructor(){this.outOfStockEntries=[],this.fetchCurrentOutOfStocks()}fetchCurrentOutOfStocks(){const e=sessionStorage.getItem("_miam/outOfStockEntry")||"[]";try{this.outOfStockEntries=JSON.parse(e),Array.isArray(this.outOfStockEntries)||(this.outOfStockEntries=[e])}catch(t){this.outOfStockEntries=[]}}isOutOfStockFromStorage(e){var t;if("active"!==e.status)return!!(null===(t=null==e?void 0:e.selectedItem)||void 0===t?void 0:t.id)&&this.outOfStockEntries.includes(e.selectedItem.id.toString());this.removeEntryFromStorage(e)}removeEntryFromStorage(e){var t;(null===(t=null==e?void 0:e.selectedItem)||void 0===t?void 0:t.id)&&(this.outOfStockEntries=this.outOfStockEntries.filter(t=>t!==e.selectedItem.id),sessionStorage.setItem("_miam/outOfStockEntry",JSON.stringify(this.outOfStockEntries)))}addEntryToStorage(e){var t;(null===(t=e.selectedItem)||void 0===t?void 0:t.id)&&(this.fetchCurrentOutOfStocks(),this.outOfStockEntries.includes(e.selectedItem.id)||this.outOfStockEntries.push(e.selectedItem.id),sessionStorage.setItem("_miam/outOfStockEntry",JSON.stringify(this.outOfStockEntries)))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),fv=(()=>{class e{constructor(e,t,i,n,r,s,o,a,c,l,u,d){this.analyticsService=e,this.basketsService=t,this.recipeService=i,this.ignoredBasketsService=n,this.pendingBasketMethodsService=r,this.posService=s,this.itemsService=o,this.basketSynchroService=a,this.priceService=c,this.contextRegistryService=l,this.storeOutOfStockService=u,this.locale=d,this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.products=[],this.totalProducts$=new cp(0),this.allIngredientsToBasketLoading$=new cp(!1),this.ingredientToBasketLoading$=new cp(!1),this.updateIngredientFromBasketLoading$=new cp(!1),this.productsLoading$=new cp(!1),this.recipeLoading$=new cp(!1),this.basketEntryToReplace$=new cp(null),this.updateFooterDisplay$=new C,this.pageviewEventWasSent=!1,this.onlyShowPreparation=!1,this.noPosDisplay=!1,this.invalidPosDisplay=!1,this.productsByCategory$=new cp(this.productsByCategory),this.products$=new cp(this.products),this.recipePrice={remaining:0,inBasket:0},this.subscriptions=[],this.initDefaultState(),this.listenBasketPreview(),this.resetOnHide(),this.executeActionFromStorage()}get remainingBasketEntries(){return this.recipe?this.products.reduce((e,t)=>("initial"!==t.basketEntry.status||t.basketEntry.recipesIds.includes(this.recipe.id)||e.push(t.basketEntry),e),[]):[]}get hasAddedAProduct(){return this.products.some(e=>"active"===e.basketEntry.status)}get isSponsored(){var e,t;return(null===(t=null===(e=this.recipe)||void 0===e?void 0:e.sponsors)||void 0===t?void 0:t.length)>0}get containsAlcohol(){var e,t;return((null===(t=null===(e=this.recipe)||void 0===e?void 0:e.relationships.tags)||void 0===t?void 0:t.data)||[]).some(e=>"ingredient_category_alcool"===e.id)}get orderHistoryDate(){const e=this.recipe.orderHistory;return e?lu(new Date(e),"shortDate",this.locale):""}set basketEntryToReplace(e){this.basketEntryToReplace$.next(e)}set productsLoading(e){this.productsLoading$.next(e)}set recipeLoading(e){this.recipeLoading$.next(e)}set ingredientToBasketLoading(e){this.ingredientToBasketLoading$.next(e)}set allIngredientsToBasketLoading(e){this.allIngredientsToBasketLoading$.next(e)}set updateIngredientFromBasketLoading(e){this.updateIngredientFromBasketLoading$.next(e)}initDefaultState(e=!1){this.noPosDisplay=!1,this.invalidPosDisplay=!1,this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.products=[],this.recipePrice={remaining:0,inBasket:0},this.totalProducts$.next(0),this.allIngredientsToBasketLoading$.next(!1),this.ingredientToBasketLoading$.next(!1),this.updateIngredientFromBasketLoading$.next(!1),this.productsLoading$.next(e),this.recipeLoading$.next(e),this.basketEntryToReplace$.next(null),this.productsByCategory$.next(this.productsByCategory),this.products$.next(this.products)}executeActionFromStorage(){this.productsByCategory$.pipe(bp(e=>0===e.toPickProducts.length),fp(1),th(()=>this.pendingBasketMethodsService.shouldExecuteBasketMethod.pipe(bp(e=>!e)))).subscribe(e=>{"addRecipeToBasket"===e.method&&(this.recipe.modifiedGuests=e.arguments.guests||this.recipe.modifiedGuests,this.addAllIngredientsToBasket(e.arguments.eventTrace))})}resetOnHide(){let e=this.recipe;this.subscriptions.push(this.recipeService.displayedRecipe$.subscribe(t=>{(null==t?void 0:t.recipe)&&t.recipe.id!==(null==e?void 0:e.id)&&(e=t.recipe,this.initDefaultState(),this.checkIfPosIsInitializedAndValid())}))}checkIfPosIsInitializedAndValid(){this.posService.posWasInitialized().pipe(fp(1),th(e=>(this.noPosDisplay=!e,e?this.posService.isPosValid().pipe(fp(1)):td(!1)))).subscribe(e=>{this.invalidPosDisplay=!this.noPosDisplay&&!e})}getProducts(e=!1){e&&(this.productsLoading=!0),this.subscriptions.push(this.getIngredientsBasketEntries(e).subscribe(()=>{this.productsLoading=!1}))}setProductsByCategory(){this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.recipePrice={remaining:0,inBasket:0},this.categorizeProducts()}calculateProductPrice(e,t){const i="active"===e.basketEntry.status?this.priceService.getCurrentPrice(t)*e.basketEntry.quantity:this.priceService.getCurrentPrice(t)*e.basketEntry.quantityToAdd;e.price={unit:t.unit,total:Math.round(100*i)/100,pricePerUnit:t.pricePerUnit,unitOfMeasurement:t.unitOfMeasurement,discountedPrice:t.discountedPrice,discountAmount:t.discountAmount,discountType:t.discountType}}isProductsByCategorySet(){return this.productsByCategory.toPickProducts.length>0||this.productsByCategory.oftenIgnoredProducts.length>0}getIngredientsBasketEntries(e=!1){return this.recipe?(e||(this.ingredientToBasketLoading=!0),nf(this.recipe.ingredients.map(t=>this.basketsService.basketEntryFromIngredient(t.id,this.recipe.modifiedGuests,!e).pipe(E(e=>({ingredient:t,basketEntry:e}))))).pipe(th(t=>e?(this.products=t,this.setProductsByCategory(),td([])):(this.updatePriceOnGuestChange(t),td(this.products))),th(()=>td(this.products)))):td([])}ingredientRemoved(e,t){this.basketsService.recipeIsInBasket(this.recipe.id).pipe(fp(1)).subscribe(i=>{const n=A_(this.basketEntryForIngredient(e));if(n.quantity=0,i){const i=new z_(n,{recipeId:this.recipe.id,ingredientId:e.id,eventTrace:t},this.basketsService);q(i.onTimeout,i.onError).pipe(fp(1)).subscribe(()=>{this.updateIngredientFromBasketLoading=!1,this.getProducts(!0)}),this.basketSynchroService.addToActionList([i])}})}updateProductQuantity(e,t,i){const n=A_(e);n.quantity=t;const r=new N_(n,{eventTrace:i,recipeId:this.recipe.id},this.basketsService);q(r.onTimeout,r.onError).pipe(fp(1)).subscribe(()=>{this.updateIngredientFromBasketLoading=!1,this.getProducts(!0)}),this.basketSynchroService.addToActionList([r])}addAllIngredientsToBasket(e){this.subscriptions.push(this.canAddProductToBasket({method:"addRecipeToBasket",arguments:{recipeId:this.recipe.id,guests:this.recipe.modifiedGuests,eventTrace:e}},e).subscribe(t=>{if(t){this.analyticsService.sendEvent("entry.add-all",e.originPath,{recipe_id:this.recipe.id,entry_count:this.remainingBasketEntries.length.toString(),total_products:this.recipe.ingredients.length.toString(),total_price:this.recipePrice.remaining.toFixed(2).toString()},mp()),this.allIngredientsToBasketLoading=!0;const t=[];this.remainingProducts().forEach(e=>this.basketSynchroService.entryWillBeAdded(e.entry.selectedItem.extId).pipe(fp(1)).subscribe(i=>{i||t.push(e)}));const i=t.map(t=>new dv(t.entry,{recipeId:this.recipe.id,ingredientId:t.ingredientId,eventTrace:e},this.basketsService));this.basketSynchroService.addToActionList(i),q(...i.map(e=>e.onTimeout),...i.map(e=>e.onError)).pipe(fp(1)).subscribe(()=>{this.setProductOutOfStockInSession(this.remainingProducts()),this.allIngredientsToBasketLoading=!1});const n={ingredientsAdded:t.length,ingredientsTotal:this.recipe.ingredients.length};this.basketsService.productsWillBeAdded().pipe(bp(e=>e>0),fp(1)).subscribe(()=>{this.contextRegistryService.addAllProductsWasClicked.emit(n)})}}))}updateGuests(e){this.basketsService.recipeIsInBasket(this.recipe.id).pipe(fp(1)).subscribe(t=>{this.basketsService.updateRecipesInBasket([this.recipe.id],this.recipe.modifiedGuests,e,!0),this.getIngredientsBasketEntries(!1).pipe(fp(1)).subscribe(i=>{if(t){const t=i.filter(({basketEntry:e})=>"active"===e.status&&"-1"!==e.id&&e.recipesIds.includes(+this.recipe.id)).map(({basketEntry:t})=>{const i=A_(t);return new hv(i,{eventTrace:e,recipeId:this.recipe.id},this.basketsService)});this.basketSynchroService.addToActionList(t),q(...t.map(e=>e.onTimeout),...t.map(e=>e.onError)).pipe(fp(1)).subscribe(()=>{this.updateIngredientFromBasketLoading=!1,this.getProducts(!0)})}else this.analyticsService.sendEvent("recipe.change-guests",e.originPath,{recipe_id:this.recipe.id})})}),this.contextRegistryService.guestsChanged.emit({guests:this.recipe.modifiedGuests,recipeId:this.recipe.id}),this.recipeService.displayedRecipeChanged$.next()}replaceBasketEntry(e,t){this.basketEntryToReplace={ingredient:this.products[this.products.findIndex(t=>t.basketEntry.name===e.name)].ingredient,basketEntry:e,ignoreSelected:t}}canAddProductToBasket(e,t,i){const n=i||this.recipe;return this.pendingBasketMethodsService.storeMethodIfCallbackNeeded(e).pipe(th(e=>this.basketsService.recipeIsInBasket(n.id).pipe(fp(1),E(i=>(e&&!i&&this.basketsService.addRecipesToBasket([n.id],n.modifiedGuests,t,!1),e)))))}updateRecipePrice(e,t=!1){t?this.recipePrice.remaining=this.recipePrice.remaining-+e.price.total:this.recipePrice={remaining:this.recipePrice.remaining+("initial"===e.basketEntry.status&&+e.price.total),inBasket:this.recipePrice.inBasket+("active"===e.basketEntry.status&&+e.price.total)}}sendEmitToUpdateRecipePrice(){const{remaining:e,inBasket:t}=this.recipePrice;0!==t?this.basketsService.recipePricesInBasket$().pipe(fp(1),E(e=>{const i=e.find(e=>e.id===this.recipe.id);return i?+i.price:t})).subscribe(t=>{this.contextRegistryService.recipePriceChanged.emit({remaining:e,inBasket:t,recipeId:this.recipe.id})}):this.contextRegistryService.recipePriceChanged.emit(Object.assign(Object.assign({},this.recipePrice),{recipeId:this.recipe.id}))}unsubscribe(){this.subscriptions.forEach(e=>e.unsubscribe())}remainingProducts(){return this.remainingBasketEntries.reduce((e,t)=>{const i=this.products.find(e=>e.basketEntry.name===t.name);return i&&e.push({ingredientId:i.ingredient.id,entry:i.basketEntry}),e},[])}updatePriceOnGuestChange(e){this.recipePrice={remaining:0,inBasket:0};let t=!1;e.forEach((e,i)=>{const n=this.products[i];n.basketEntry.quantity=e.basketEntry.quantity,n.basketEntry.quantityToAdd=e.basketEntry.quantityToAdd,n.price&&this.calculateProductPrice(n,n.price),["initial","active"].includes(n.basketEntry.status)&&(this.updateRecipePrice(n),t=!0)}),t&&this.sendEmitToUpdateRecipePrice(),this.basketsService.recipeIsInBasket(this.recipe.id).pipe(fp(1)).subscribe(e=>{e||(this.updateIngredientFromBasketLoading=!1,this.ingredientToBasketLoading=!1)})}basketEntryForIngredient(e){return this.products.find(t=>t.ingredient.id===e.id).basketEntry}listenBasketPreview(){this.subscriptions.push(this.basketsService._basketPreview$.pipe(th(e=>{var t,i;if(e){const n=e.find(e=>{var t;return e.id===(null===(t=this.recipe)||void 0===t?void 0:t.id)});(null===(i=null===(t=null==n?void 0:n.entries)||void 0===t?void 0:t.all)||void 0===i?void 0:i.length)>0&&(this.products.forEach(e=>{var t;e.basketEntry=null!==(t=n.entries.all.find(t=>t.name===e.basketEntry.name))&&void 0!==t?t:e.basketEntry}),this.setProductsByCategory())}return td(null)})).subscribe())}isIngredientIgnored(e){this.ignoredBasketsService.isIngredientIgnored(e.ingredient.id)&&(e.basketEntry.status="ignored")}categorizeProducts(){this.products.forEach(e=>{const{basketEntry:t}=e,{status:i}=t;this.isIngredientIgnored(e),this.storeOutOfStockService.isOutOfStockFromStorage(t)&&(e.basketEntry.status="out_of_stock"),this.calculateProductPrice(e,this.priceService.getPriceFromBasketEntry(t)),this.correctProductState(e),"often_deleted"===i?this.productsByCategory.oftenIgnoredProducts.push(e):(this.productsByCategory.toPickProducts.push(e),this.updateRecipePrice(e))}),this.sendEmitToUpdateRecipePrice(),this.updateIngredientFromBasketLoading=!1,this.ingredientToBasketLoading=!1,this.productsByCategory$.next(this.productsByCategory)}correctProductState(e){if(!["often_deleted","deleted","ignored","out_of_stock"].includes(e.basketEntry.status)){const{id:t,selectedItem:i,recipesIds:n}=e.basketEntry;if("-1"===t)e.basketEntry.status=i?"initial":"unavailable";else{const t=n.includes(+this.recipe.id);e.basketEntry.status=t?"active":"initial"}}}setProductOutOfStockInSession(e){e.forEach(({entry:e})=>{e.status="out_of_stock",this.storeOutOfStockService.addEntryToStorage(e)})}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(C_),nn(__),nn(Qf),nn(pv),nn(Vf),nn(mv),nn($_),nn(w_),nn(Dp),nn(gv),nn(nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class _v extends O_{get type(){return"REMOVE-PRODUCT"}updateMealzBasket(){}shouldRemoveAction(e){return!0}}class vv extends O_{get type(){return"ADD-PRODUCT"}updateMealzBasket(){this.basketEntry.selectedItem&&this.basketEntry.removeRelationship("selected-item",this.basketEntry.selectedItem.id),this.basketEntry.addRelationship(this.updateMealzParams.item,"selected-item"),this.basketEntriesService.selectItem(this.basketEntry.id,this.updateMealzParams.item.id,this.quantity).pipe(th(()=>this.basketsService.refreshCurrentBasket()),fp(1)).subscribe()}createActionForRetailer(){return(this.quantity<1?td(this.quantity):this.getDifferenceFromBasketEntry(this)).pipe(E(e=>({id:this.id,quantity:e})))}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)}}class bv extends O_{get type(){return"ADD-PRODUCT"}updateMealzBasket(){this.updateMealzParams.recipeId?this.basketsService.addIngredientsToBasket(this.updateMealzParams.recipeId,[{ingredientId:this.updateMealzParams.ingredientId,entry:this.basketEntry}],this.updateMealzParams.eventTrace,this.updateMealzParams.previousItem,this.updateMealzParams.searchString):this.basketsService.addItemToBasket(this.updateMealzParams.item,this.updateMealzParams.eventTrace)}createActionForRetailer(){return(this.quantity<1?td(this.quantity):this.getDifferenceFromBasketEntry(this)).pipe(E(e=>({id:this.id,quantity:e})))}shouldRemoveAction(e){return"active"===(null==e?void 0:e.status)}}let yv=(()=>{class e{constructor(e,t,i,n,r,s,o,a){this.basketsService=e,this.basketEntriesService=t,this.itemsService=i,this.recipeDetailsService=n,this.basketSynchroService=r,this.ignoredBasketsService=s,this.recipesService=o,this.analyticsService=a,this.basketEntry=new Pf,this.itemsWithPricesList$=new cp([]),this.fetchingItemLoading$=new cp(!1),this.replaceItemLoading$=new cp(null),this.basketEntryToReplace$=new cp(null),this.replaceProductFromPreviewOpen$=new cp(null),this.additionModalOpen$=new cp(!1),this.productAdded$=new C,this.basketEntryToReplace$.pipe(th(e=>e?(this.basketEntry=e.basketEntry,this.ingredient=e.ingredient,this.ignoreSelected=e.ignoreSelected,this.addProductMode=e.addProductMode||!1,td(e)):(this.itemsWithPricesList$.next([]),this.addProductMode=!1,td(e))),id(e=>!!e||this.addProductMode),th(()=>this.fetchItems())).subscribe(),this.recipesService.displayedRecipe$.subscribe(e=>{this.recipe=null==e?void 0:e.recipe}),this.replaceProductFromPreviewOpen$.pipe(id(e=>!!e),th(()=>this.fetchItems())).subscribe()}handleItemSelection(e,t,i,n,r){const s=!!this.recipe;this.timeOutAction=r,this.onSelectItem(e,t,n).pipe(fp(1)).subscribe(r=>{r.onSuccess.pipe(fp(1)).subscribe(()=>{this.recipeDetailsService.hasReplaced=!0,n&&s&&this.sendReplaceEvent(t,n),this.addProductMode||!s?this.basketsService.itemWillBeAdded(e.id).subscribe(t=>{!t&&this.replaceItemLoading$.value&&i(e.id)}):this.basketsService.ingredientWillBeAdded(this.ingredient.id).subscribe(e=>{!e&&this.replaceItemLoading$.value&&i(this.basketEntry.id)})})})}onSelectItem(e,t,i){return this.addProductMode?this.handleAddProductMode(e,this.basketEntry,i):this.handleReplaceProductMode(e,this.basketEntry,this.ingredient,t,i,this.ignoreSelected)}searchItem(e){var t,i;return this.fetchingItemLoading$.next(!0),this.itemsService.searchForIngredient(e,null===(t=this.ingredient)||void 0===t?void 0:t.id,+(null===(i=this.recipe)||void 0===i?void 0:i.modifiedGuests)).pipe(E(e=>{const t=this.itemsService.newCollection();return t.fill(e),t.data.filter(e=>{var t;return e.id!==(null===(t=this.basketEntry.selectedItem)||void 0===t?void 0:t.id)})}),th(e=>{const t=e.map(e=>this.itemsService.getPriceForItem(e.id).pipe(E(t=>({item:e,price:t}))));return(0===t.length?td([]):nf(t)).pipe(E(e=>(this.fetchingItemLoading$.next(!1),this.itemsWithPricesList$.next(e))))}))}handleReplaceProductMode(e,t,i,n,r,s){return this.replaceItemLoading$.next(e),this.previousItem=t.selectedItem,s&&i&&this.ignoredBasketsService.removeIngredientFromIgnored(i.id),"active"===t.status?this.replaceBasketEntryActiveItem(e,t,i):this.addBasketEntryItem(e,t,n,r)}handleAddProductMode(e,t,i){this.replaceItemLoading$.next(e);const n=A_(t);this.replaceRelationship(n,e);const r=new bv(n,{eventTrace:i,item:e},this.basketsService,this.basketEntriesService);return q(r.onTimeout,r.onError).pipe(fp(1)).subscribe(()=>{this.rollbackReplace()}),this.basketSynchroService.addToActionList([r]),td(r)}fetchItems(){var e,t,i;return this.fetchingItemLoading$.next(!0),this.itemsService.searchForIngredient((null===(e=this.ingredient)||void 0===e?void 0:e.id)?null:this.basketEntry.name,null===(t=this.ingredient)||void 0===t?void 0:t.id,+(null===(i=this.recipe)||void 0===i?void 0:i.modifiedGuests)).pipe(E(e=>{const t=this.itemsService.newCollection();return t.fill(e),t.data}),th(e=>{this.basketEntry.selectedItem&&void 0===e.find(e=>{var t;return e.id===(null===(t=this.basketEntry.selectedItem)||void 0===t?void 0:t.id)})&&e.push(this.basketEntry.selectedItem);const t=e.map(e=>this.itemsService.getPriceForItem(e.id).pipe(E(t=>({item:e,price:t}))));return 0===t.length?td([]):nf(t)}),E(e=>(this.itemsWithPricesList$.next(this.moveSelectedItemToFront(e)),this.fetchingItemLoading$.next(!1),e)))}selectItem(e){const t=A_(this.basketEntry);t.quantity=0,t.selectedItem.extId=this.previousItem.extId;const i=new _v(t,{},this.basketsService);return q(i.onTimeout,i.onError).pipe(fp(1)).subscribe(()=>{this.rollbackReplace()}),this.basketSynchroService.addToActionList([i]),(this.ingredient&&this.recipe?this.basketsService.basketEntryFromIngredient(this.ingredient.id,+this.recipe.modifiedGuests||+this.recipe.guests||4,!0,e.id):td(this.basketEntry)).pipe(th(t=>{const i=A_(this.basketEntry);i.quantityToAdd=t.quantityToAdd,this.replaceRelationship(i,e);const n=new vv(i,{item:e},this.basketsService,this.basketEntriesService);return q(n.onTimeout,n.onError).pipe(fp(1)).subscribe(()=>{this.rollbackReplace()}),this.basketSynchroService.addToActionList([n]),n.onSuccess.pipe(fp(1)).subscribe(()=>{this.recipeDetailsService.updateIngredientFromBasketLoading=!1}),td(n)}))}changeReplaceModalState(e,t){t&&(this.basketEntry=t,this.ingredient=null),this.replaceProductFromPreviewOpen$.next(e?this.basketEntry:null)}changeAdditionModalState(e){this.addProductMode=!0,this.additionModalOpen$.next(e)}showProductSection(){this.productAdded$.next(""),this.changeAdditionModalState(!1)}replaceRelationship(e,t){e.selectedItem&&e.removeRelationship("selected-item",e.selectedItem.id),e.addRelationship(t,"selected-item")}rollbackReplace(){this.recipeDetailsService.ingredientToBasketLoading=!1,this.recipeDetailsService.updateIngredientFromBasketLoading=!1,this.replaceItemLoading$.next(void 0),this.basketEntry.relationships["selected-item"].data=this.previousItem,this.timeOutAction&&this.timeOutAction()}getAddIngredientMethod(e,t){return{method:"addIngredientToBasket",arguments:{recipeId:this.recipe.id,ingredientId:this.ingredient.id,entry:this.basketEntry,eventTrace:e,searchString:t}}}handleAddToBasketResponse(e,t,i){this.updateLoadingStates();const n=A_(this.basketEntry);n.quantityToAdd=e.quantityToAdd;const r=new bv(n,{eventTrace:i,recipeId:this.recipe.id,ingredientId:this.ingredient.id,previousItem:this.previousItem,searchString:t},this.basketsService);return this.handleAddIngredientActionErrors(r),this.basketSynchroService.addToActionList([r]),td(r)}handleAddIngredientActionErrors(e){q(e.onError,e.onTimeout).pipe(fp(1)).subscribe(()=>{this.rollbackReplace()})}updateLoadingStates(){this.recipeDetailsService.ingredientToBasketLoading="initial"===this.basketEntry.status,this.recipeDetailsService.updateIngredientFromBasketLoading="initial"!==this.basketEntry.status}replaceBasketEntryActiveItem(e,t,i){return i?this.selectItem(e):this.processActiveBasketEntryWithoutIngredient(e,t)}processActiveBasketEntryWithoutIngredient(e,t){return this.recipesService.all({filter:{id:t.recipesIds},include:["ingredients"],fields:{recipes:["ingredients","number-of-guests"],ingredients:["name"]}}).pipe(th(i=>{var n;return this.recipe=i.data.find(e=>e.ingredients.some(e=>e.attributes.name===t.name)),this.ingredient=null===(n=this.recipe)||void 0===n?void 0:n.ingredients.find(e=>e.attributes.name===t.name),this.selectItem(e)}))}addToBasket(e,t,i){return this.recipeDetailsService.canAddProductToBasket(this.getAddIngredientMethod(i,t),i,this.recipe).pipe(id(e=>e),th(()=>this.basketsService.basketEntryFromIngredient(this.ingredient.id,+this.recipe.modifiedGuests,!0,e.id)),th(e=>this.handleAddToBasketResponse(e,t,i)))}addBasketEntryItem(e,t,i,n){return this.replaceRelationship(t,e),this.addToBasket(e,i,n)}moveSelectedItemToFront(e){var t;const i=null===(t=this.basketEntry.selectedItem)||void 0===t?void 0:t.id;return e.sort((e,t)=>e.item.id===i?-1:t.item.id===i?1:0)}sendReplaceEvent(e,t){this.analyticsService.sendEvent("entry.replaced",t.originPath,{entry_name:this.basketEntry.name,new_item_id:this.basketEntry.selectedItem.id,new_item_ext_id:this.basketEntry.selectedItem.attributes["ext-id"],new_item_ean:this.basketEntry.selectedItem.ean,product_quantity:this.basketEntry.quantity.toString(),recipe_id:this.recipe.id,search_term:e,old_item_id:this.previousItem.id,old_item_ext_id:this.previousItem.attributes["ext-id"],old_item_ean:this.previousItem.ean})}}return e.\u0275fac=function(t){return new(t||e)(nn(C_),nn(zf),nn(mv),nn(fv),nn($_),nn(Qf),nn(__),nn(Rp))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),wv=(()=>{class e{constructor(e,t,i,n,r,s){this.basketsService=e,this.priceService=t,this.ignoredBasketsService=i,this.replaceItemService=n,this.contextRegistryService=r,this.basketSynchroService=s,this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.productsByCategory$=new cp(this.productsByCategory),this.products$=new cp([]),this.recipePrice$=new cp({remaining:0,inBasket:0}),this.productsLoading$=new cp(!1),this.ingredientToBasketLoading$=new cp(!1),this.updateIngredientFromBasketLoading$=new cp(!1)}initDefaultState(){this.resetProductsByCategory(),this.products$.next([]),this.productsByCategory$.next(this.productsByCategory),this.replaceItemService.basketEntryToReplace$.next(null)}resetProductsByCategory(){this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.recipePrice$.next({remaining:0,inBasket:0})}getIngredientsBasketEntries(e,t,i=!1){return e&&0!==e.length?(i||this.ingredientToBasketLoading$.next(!0),nf(e.map(e=>this.basketsService.basketEntryFromIngredient(e.id,t,!i).pipe(E(t=>({ingredient:e,basketEntry:t}))))).pipe(th(e=>i?(this.setProductsByCategory(e),td([])):(this.updatePriceOnGuestChange(e),td(this.products$.value))),th(()=>td(this.products$.value)))):td([])}productIsBeingAdded(e){var t;return this.basketSynchroService.entryWillBeAdded(null===(t=e.selectedItem)||void 0===t?void 0:t.extId)}setProductsByCategory(e){this.resetProductsByCategory(),e.forEach(e=>{const{basketEntry:t}=e,{status:i}=t;this.updateIngredientIgnoredStatus(e),this.updateProductAvailabilityStatus(e),this.computeProductPriceDetails(e,this.priceService.getPriceFromBasketEntry(t)),"often_deleted"===i?this.productsByCategory.oftenIgnoredProducts.push(e):(this.productsByCategory.toPickProducts.push(e),this.updateRecipePrice(e))}),this.sendEmitToUpdateRecipePrice(),this.products$.next(e),this.updateIngredientFromBasketLoading$.next(!1),this.ingredientToBasketLoading$.next(!1),this.productsByCategory$.next(this.productsByCategory)}updateRecipePrice(e,t=!1){t?(this.recipePrice$.value.remaining=this.recipePrice$.value.remaining-+e.price.total,this.recipePrice$.next(this.recipePrice$.value),this.products$.next(this.products$.value)):this.recipePrice$.next({remaining:this.recipePrice$.value.remaining+("initial"===e.basketEntry.status&&+e.price.total),inBasket:this.recipePrice$.value.inBasket+("active"===e.basketEntry.status&&+e.price.total)})}updatePriceOnGuestChange(e){this.recipePrice$.next({remaining:0,inBasket:0});let t=!1;e.forEach(e=>{const i=this.products$.value.find(t=>t.ingredient.id===e.ingredient.id);i&&(i.basketEntry.quantity=e.basketEntry.quantity,i.basketEntry.quantityToAdd=e.basketEntry.quantityToAdd,i.price&&this.computeProductPriceDetails(i,i.price),["initial","active"].includes(i.basketEntry.status)&&(this.updateRecipePrice(i),t=!0))}),t&&this.sendEmitToUpdateRecipePrice(),this.basketsService.recipeIsInBasket(this.recipeId).pipe(fp(1)).subscribe(e=>{e||(this.updateIngredientFromBasketLoading$.next(!1),this.ingredientToBasketLoading$.next(!1))})}updateIngredientIgnoredStatus(e){this.ignoredBasketsService.isIngredientIgnored(e.ingredient.id)&&(e.basketEntry.status="ignored")}updateProductAvailabilityStatus(e){const{basketEntry:t}=e,{id:i,selectedItem:n,recipesIds:r,status:s}=t;["often_deleted","deleted","ignored"].includes(s)||(t.status="-1"===i?n?"initial":"unavailable":r.includes(+this.recipeId)?"active":"initial")}computeProductPriceDetails(e,t){const i="active"===e.basketEntry.status?this.priceService.getCurrentPrice(t)*e.basketEntry.quantity:this.priceService.getCurrentPrice(t)*e.basketEntry.quantityToAdd;e.price={unit:t.unit,total:Math.round(100*i)/100,pricePerUnit:t.pricePerUnit,unitOfMeasurement:t.unitOfMeasurement,discountedPrice:t.discountedPrice,discountAmount:t.discountAmount,discountType:t.discountType}}isProductsByCategorySet(){return this.productsByCategory.toPickProducts.length>0||this.productsByCategory.oftenIgnoredProducts.length>0}replaceBasketEntry(e,t){this.replaceItemService.basketEntryToReplace$.next({ingredient:this.products$.value[this.products$.value.findIndex(t=>t.basketEntry.name===e.name)].ingredient,basketEntry:e,ignoreSelected:t})}sendEmitToUpdateRecipePrice(){const{remaining:e,inBasket:t}=this.recipePrice$.value;0!==t?this.basketsService.recipePricesInBasket$().pipe(fp(1),E(e=>{const i=e.find(e=>e.id===this.recipeId);return i?+i.price:t})).subscribe(t=>{this.contextRegistryService.recipePriceChanged.emit({remaining:e,inBasket:t,recipeId:this.recipeId})}):this.contextRegistryService.recipePriceChanged.emit(Object.assign(Object.assign({},this.recipePrice$.value),{recipeId:this.recipeId}))}}return e.\u0275fac=function(t){return new(t||e)(nn(C_),nn(w_),nn(Qf),nn(yv),nn(Dp),nn($_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),kv=(()=>{class e{constructor(e,t,i,n){this.analyticsService=e,this.ingredientsService=t,this.itemsService=i,this.mealsPlannerService=n,this.isRecipeInMenu=!1,this.productsPlannerByCategory$=new cp({toPickProducts:[],oftenIgnoredProducts:[]}),this.itemToReplace$=new cp(null),this.itemsWithPricesList$=new cp([]),this.plannerRecipePrice$=new cp(0),this.fetchingItemLoading$=new cp(!1),this.productsLoading=!1,this.updateRecipePrice(),this.itemToReplace$.pipe(th(e=>e?this.fetchItems("",e.ingredient,e.item,e.status):(this.itemsWithPricesList$.next([]),td(void 0)))).subscribe()}setRecipe(e,t){this.isRecipeInMenuSubscription&&this.isRecipeInMenuSubscription.unsubscribe(),this.guests=t,this.recipeId=e,this.isRecipeInMenuSubscription=Xg([this.mealsPlannerService.isRecipeInMenu(this.recipeId),this.mealsPlannerService.getMenuRecipeId(this.recipeId)]).subscribe(([e,t])=>{this.isRecipeInMenu=e,this.menuRecipeId=t})}updateGuests(e,t){this.guests=e,(this.isRecipeInMenu&&this.menuRecipeId?this.mealsPlannerService.updateRecipeFromMenu(this.menuRecipeId,e).pipe(fp(1)):td(void 0)).pipe(fp(1)).subscribe(()=>{const i=this.productsPlannerByCategory$.getValue(),n=[...i.toPickProducts,...i.oftenIgnoredProducts];0!==n.length&&nf(n.filter(e=>e.item).map(t=>this.ingredientsService.fetchQuantityToAdd(t.ingredient.id,e,t.item.id).pipe(E(e=>({product:t,quantity:e}))))).subscribe(e=>{const n=i.toPickProducts.map(t=>{const i=e.find(e=>e.product===t);return i?Object.assign(Object.assign({},t),{quantity:i.quantity}):t}),r=i.oftenIgnoredProducts.map(t=>{const i=e.find(e=>e.product===t);return i?Object.assign(Object.assign({},t),{quantity:i.quantity}):t});this.productsPlannerByCategory$.next({toPickProducts:n,oftenIgnoredProducts:r}),this.updateRecipePrice(),this.analyticsService.sendEvent("recipe.change-guests",t.originPath,{recipe_id:this.recipeId})})})}updateRecipePrice(){this.productsPlannerByCategory$.pipe(id(e=>e.toPickProducts.length>0),E(e=>[...e.toPickProducts,...e.oftenIgnoredProducts].filter(e=>{var t;return"ticked"===e.status&&(null===(t=e.price)||void 0===t?void 0:t.unit)&&e.quantity}).reduce((e,t)=>e+t.price.unit*t.quantity,0))).subscribe(e=>this.plannerRecipePrice$.next(e))}loadProducts(e){return this.productsLoading=!0,e&&0!==e.length?(this.isRecipeInMenu?this.loadFromMenu(e):this.loadFromLocal(e)).pipe(df(e=>this.categorizeItems(e))):td([])}loadFromMenu(e){return this.mealsPlannerService.getAllMenuItems().pipe(th(({data:t,included:i})=>{const n=this.toMap(i),r=e.map(e=>{const i=this.getDefinitionId(e),r=t.find(e=>e.attributes["ingredients-definition-id"]===i),s=String(null==r?void 0:r.attributes["item-id"]),o=null==r?void 0:r.attributes.status,a=n[s];return a?nf({price:this.itemsService.getPriceForItem(a.id),quantity:this.ingredientsService.fetchQuantityToAdd(e.id,this.guests,a.id)}).pipe(E(({price:t,quantity:i})=>({ingredient:e,item:a,price:t,quantity:i,status:o}))):td({ingredient:e,item:null,price:null,quantity:0,status:"unavailable"})});return nf(r)}))}loadFromLocal(e){const t=e.map(e=>this.itemsService.searchForIngredient("",e.id,this.guests).pipe(E(e=>{const t=this.itemsService.newCollection();return t.fill(e),t.data[0]}),th(t=>{if(!t)return td({ingredient:e,item:null,price:null,quantity:0,status:"unavailable"});const i=this.isOftenIgnored(e)?"unselected":"ticked";return nf({price:this.itemsService.getPriceForItem(t.id),quantity:this.ingredientsService.fetchQuantityToAdd(e.id,this.guests,t.id)}).pipe(E(({price:n,quantity:r})=>({ingredient:e,item:t,price:n,quantity:r,status:i})))})));return nf(t)}categorizeItems(e){const t={toPickProducts:[],oftenIgnoredProducts:[]};e.forEach(e=>{(this.isOftenIgnored(e.ingredient)&&"ticked"!==e.status?t.oftenIgnoredProducts:t.toPickProducts).push(e)}),this.itemToReplace$.next(null),this.plannerRecipePrice$.next(0),this.productsPlannerByCategory$.next(t)}fetchItems(e,t,i,n){return this.fetchingItemLoading$.next(!0),this.itemsService.searchForIngredient(e,t.id,this.guests).pipe(E(e=>{const t=this.itemsService.newCollection();return t.fill(e),t.data.filter(e=>e.id!==(null==i?void 0:i.id))}),th(e=>{i&&e.unshift(i);const r=e.map(e=>nf({price:this.itemsService.getPriceForItem(e.id),quantity:this.ingredientsService.fetchQuantityToAdd(t.id,this.guests,e.id)}).pipe(E(({price:r,quantity:s})=>({ingredient:t,item:e,price:r,quantity:s,status:e.id===(null==i?void 0:i.id)?n:"unselected"}))));return(0===r.length?td([]):nf(r)).pipe(E(e=>(this.fetchingItemLoading$.next(!1),this.itemsWithPricesList$.next(e))))}))}selectProduct(e,t){this.updateUserSelection("ticked",e,t)}unselectProduct(e,t){this.updateUserSelection("unselected",e,t)}openReplaceItemView(e){this.itemToReplace$.next(e)}replaceProduct(e){const t=this.getDefinitionId(e.ingredient);this.updateUserSelection("ticked",+e.item.id,t),this.replaceInCategories(e,t)}replaceInCategories(e,t){const i=this.productsPlannerByCategory$.getValue(),n=i.oftenIgnoredProducts.filter(e=>this.getDefinitionId(e.ingredient)!==t),r=i.toPickProducts.findIndex(e=>this.getDefinitionId(e.ingredient)===t);let s;-1!==r?(s=[...i.toPickProducts],s[r]=e):s=[...i.toPickProducts,e],this.productsPlannerByCategory$.next({toPickProducts:s,oftenIgnoredProducts:n}),this.itemsWithPricesList$.next(this.sortItems(e.item.id))}updateUserSelection(e,t,i){this.isRecipeInMenu&&this.mealsPlannerService.patchUserSelection(e,t,i).pipe(fp(1)).subscribe(()=>{this.mealsPlannerService.updateMenuPrice()}),this.updateProductStatus(e,i),this.updateRecipePrice()}updateProductStatus(e,t){const{toPickProducts:i,oftenIgnoredProducts:n}=this.productsPlannerByCategory$.getValue(),r=i.findIndex(e=>this.getDefinitionId(e.ingredient)===t);if(-1!==r){const t=i[r],s=Object.assign(Object.assign({},t),{status:e});if("unselected"===e&&this.isOftenIgnored(t.ingredient)){const e=i.filter((e,t)=>t!==r),t=[...n,s];this.productsPlannerByCategory$.next({toPickProducts:e,oftenIgnoredProducts:t})}else{const e=[...i];e[r]=s,this.productsPlannerByCategory$.next({toPickProducts:e,oftenIgnoredProducts:n})}}}toMap(e){return e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t.id]:t}),{})}getDefinitionId(e){var t;return(null===(t=null==e?void 0:e.relationships)||void 0===t?void 0:t.definition.data).id}isOftenIgnored(e){const t=e.relationships.definition.data;return!!(null==t?void 0:t.attributes["often-deleted"])}sortItems(e){return this.itemsWithPricesList$.getValue().map(t=>t.item.id!==e?Object.assign(Object.assign({},t),{status:"unselected"}):t).sort((t,i)=>t.item.id===e?-1:i.item.id===e?1:0)}reset(){this.productsPlannerByCategory$.next({toPickProducts:[],oftenIgnoredProducts:[]}),this.itemToReplace$.next(null),this.plannerRecipePrice$.next(0)}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(Xf),nn(mv),nn(f_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Cv=function(e){return e[e.Clear=0]="Clear",e[e.CostHight=1]="CostHight",e[e.CostMedium=2]="CostMedium",e[e.CostLow=3]="CostLow",e[e.DifficultyHigh=4]="DifficultyHigh",e[e.DifficultyMedium=5]="DifficultyMedium",e[e.DifficultyLow=6]="DifficultyLow",e[e.People=7]="People",e[e.Time=8]="Time",e[e.Plus=9]="Plus",e[e.Grip=10]="Grip",e[e.ArrowDown=11]="ArrowDown",e[e.Trash=12]="Trash",e[e.Trash_danger=13]="Trash_danger",e[e.Trash_grey05=14]="Trash_grey05",e[e.Trash_greyText=15]="Trash_greyText",e[e.Trash_greyTextDark=16]="Trash_greyTextDark",e[e.CloudUpload=17]="CloudUpload",e[e.Picture=18]="Picture",e[e.Wait=19]="Wait",e[e.Hot=20]="Hot",e[e.RecipeBook=21]="RecipeBook",e[e.ChevronDown=22]="ChevronDown",e[e.Search=23]="Search",e[e.Cart=24]="Cart",e[e.CartPlus=25]="CartPlus",e[e.Meal=26]="Meal",e[e.Meal_grey06=27]="Meal_grey06",e[e.HorizontalDots=28]="HorizontalDots",e[e.NoRecipeFound=29]="NoRecipeFound",e[e.Preheat=30]="Preheat",e[e.Empty=31]="Empty",e[e.CircledPlus=32]="CircledPlus",e[e.MainDish=33]="MainDish",e[e.NotMainDish=34]="NotMainDish",e[e.Dessert=35]="Dessert",e[e.NotDessert=36]="NotDessert",e[e.Starter=37]="Starter",e[e.NotStarter=38]="NotStarter",e[e.Edit=39]="Edit",e[e.Cross=40]="Cross",e[e.Home=41]="Home",e[e.Filter=42]="Filter",e[e.Checkmark=43]="Checkmark",e[e.Alert=44]="Alert",e}({});let Sv=(()=>{class e extends sp{constructor(){super(),this.resource=Ff,this.type="sponsor-block-types",this.register()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),xv=(()=>{class e extends sp{constructor(e){super(),this.blockTypesService=e,this.resource=Of,this.type="sponsor-blocks",this.register()}}return e.\u0275fac=function(t){return new(t||e)(nn(Sv))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Ev=(()=>{class e{constructor(e,t,i,n,r,s,o,a,c,l,u,d,h,p,m,g){this.analyticsService=e,this.basketsService=t,this.recipeService=i,this.pendingBasketMethodsService=n,this.posService=r,this.basketSynchroService=s,this.priceService=o,this.contextRegistryService=a,this.sponsorBlocksService=c,this.recipesService=l,this.seoService=u,this.storeLocatorService=d,this.recipeDetailsProductsService=h,this.recipeDetailsProductsPlannerService=p,this.ignoredBasketsService=m,this.locale=g,this.totalProducts$=new cp(0),this.allIngredientsToBasketLoading$=new cp(!1),this.recipeLoading$=new cp(!1),this.updateFooterDisplay$=new C,this.displayEventWasSent=!1,this.onlyShowPreparation=!1,this.noPosDisplay$=new cp(!1),this.invalidPosDisplay$=new cp(!1),this.orderHistoryDate$=new cp(""),this.remainingBasketEntries$=new cp([]),this.previewAllowed=!0,this.ingredientsPictures=!1,this.displayTagsIcons=!1,this.displayPricing=!0,this.displayGuests=!0,this.helpButtonAllowed=!0,this.stepsOnLeftSide=!1,this.cookingTimeAsPrimaryInfo=!1,this.pricingGuestsText="par-personne",this.recipeAdded=new Rc,this.recipeError=new Rc,this.closeDetails=new Rc,this.removedIngredients=[],this.isMobile=!1,this.displayTags=!1,this.showAddon=!1,this.showStoreSelector=!1,this.isRecipeFetched=!1,this.icon=Cv,this.primaryButtonClicked$=new Rc,this.addButtonLoading=!1,this.titleInHeader=!1,this.displayLastOrderModal=!1,this.sponsorHasStorytelling=!1,this.activeTabIndex=0,this.initialTabIndex=0,this.basketSynchroHasPendigActions=!1,this.subscriptions=[],this.initDefaultState(),this.listenToRecipeDisplayed(),this.listenToBasket(),this.listenRemainingBasketEntries()}get ingredientToBasketLoading(){return this.recipeDetailsProductsService.ingredientToBasketLoading$}get updateIngredientFromBasketLoading(){return this.recipeDetailsProductsService.updateIngredientFromBasketLoading$}get productsLoading(){return this.recipeDetailsProductsService.productsLoading$}get remainingBasketEntries(){return this.recipe?this.recipeDetailsProductsService.products$.value.reduce((e,t)=>("initial"!==t.basketEntry.status||t.basketEntry.recipesIds.includes(this.recipe.id)||e.push(t.basketEntry),e),[]):[]}setOrderHistoryDate(){const e=this.recipe.orderHistory;if(!e)return void this.orderHistoryDate$.next("");const t=new Date(e);this.orderHistoryDate$.next(lu(t,"shortDate",this.locale))}setupRecipe(e){let t,i=this.recipe;return(null==e?void 0:e.id)!==(null==i?void 0:i.id)&&(i=e,this.initDefaultState(!0),this.checkIfPosIsInitializedAndValid()),this.recipe=e,this.recipeDetailsProductsService.recipeId=this.recipe.id,this.recipeDetailsProductsPlannerService.setRecipe(this.recipe.id,+this.recipe.modifiedGuests),t=this.recipesService.isRecipeDetailsFromPlanner?this.loadPlannerProducts():this.loadProducts(),this.setOrderHistoryDate(),this.isRecipeFetched=!0,t.pipe(E(()=>{}))}listenRemainingBasketEntries(){this.subscriptions.push(this.recipeDetailsProductsService.products$.subscribe(e=>{this.remainingBasketEntries$.next(this.recipe?e.reduce((e,t)=>("initial"!==t.basketEntry.status||t.basketEntry.recipesIds.includes(this.recipe.id)||e.push(t.basketEntry),e),[]):[])}))}listenToRecipeDisplayed(){this.subscriptions.push(this.recipesService.displayedRecipe$.pipe(th(e=>(null==e?void 0:e.recipe)?this.setupRecipe(e.recipe):(this.initDefaultState(),this.checkIfPosIsInitializedAndValid(),td(null)))).subscribe())}listenToBasket(){this.subscriptions.push(this.basketsService._basket$.pipe(id(()=>!!this.recipe),th(()=>this.recipesService.isRecipeDetailsFromPlanner?this.loadPlannerProducts():this.loadProducts())).subscribe())}loadPlannerProducts(){return this.recipeDetailsProductsPlannerService.productsLoading?td([]):this.recipesService.getIngredientsDefinitions(this.recipe.id).pipe(th(e=>this.recipeDetailsProductsPlannerService.loadProducts(e)),df(()=>{this.recipeDetailsProductsPlannerService.productsLoading=!1,this.recipeDetailsProductsService.productsLoading$.next(!1)}),fp(1))}loadProducts(){return this.recipeDetailsProductsService.getIngredientsBasketEntries(this.recipe.ingredients,this.recipe.modifiedGuests,!0).pipe(df(()=>this.recipeDetailsProductsService.productsLoading$.next(!1)),fp(1))}initDefaultState(e=!1){this.noPosDisplay$.next(!1),this.invalidPosDisplay$.next(!1),this.recipeDetailsProductsService.initDefaultState(),this.recipeDetailsProductsPlannerService.reset(),this.totalProducts$.next(0),this.allIngredientsToBasketLoading$.next(!1),this.recipeDetailsProductsService.ingredientToBasketLoading$.next(!1),this.recipeDetailsProductsService.updateIngredientFromBasketLoading$.next(!1),this.recipeDetailsProductsService.productsLoading$.next(e),this.recipeLoading$.next(e),this.recipeDetailsProductsService.resetProductsByCategory()}checkIfPosIsInitializedAndValid(){this.posService.posWasInitialized().pipe(fp(1),th(e=>(this.noPosDisplay$.next(!e),e?this.posService.isPosValid().pipe(fp(1)):td(!1)))).subscribe(e=>{this.invalidPosDisplay$.next(!this.noPosDisplay$.value&&!e)})}updateGuests(e){this.basketsService.recipeIsInBasket(this.recipe.id).pipe(fp(1)).subscribe(t=>{this.basketsService.updateRecipesInBasket([this.recipe.id],this.recipe.modifiedGuests,e,!0),this.recipeDetailsProductsService.getIngredientsBasketEntries(this.recipe.ingredients,this.recipe.modifiedGuests,!1).pipe(fp(1)).subscribe(i=>{if(t){const t=i.filter(({basketEntry:e})=>"active"===e.status&&"-1"!==e.id&&e.recipesIds.includes(+this.recipe.id)).map(({basketEntry:t})=>{const i=A_(t);return new hv(i,{eventTrace:e,recipeId:this.recipe.id},this.basketsService)});t.length>0&&(this.basketSynchroService.addToActionList(t),q(...t.map(e=>e.onTimeout),...t.map(e=>e.onError)).pipe(fp(1)).subscribe(()=>{this.recipeDetailsProductsService.updateIngredientFromBasketLoading$.next(!1)}))}})}),this.contextRegistryService.guestsChanged.emit({guests:this.recipe.modifiedGuests,recipeId:this.recipe.id})}addAllIngredientsToBasket(e){this.subscriptions.push(this.canAddProductToBasket({method:"addRecipeToBasket",arguments:{recipeId:this.recipe.id,guests:this.recipe.modifiedGuests,eventTrace:e}},e).subscribe(t=>{if(t){this.allIngredientsToBasketLoading$.next(!0);const t=[];this.remainingProducts().forEach(e=>this.basketSynchroService.entryWillBeAdded(e.entry.selectedItem.extId).pipe(fp(1)).subscribe(i=>{i||t.push(e)}));const i=t.map(t=>new dv(t.entry,{recipeId:this.recipe.id,ingredientId:t.ingredientId,eventTrace:e},this.basketsService));this.basketSynchroService.addToActionList(i);const n=i.map(e=>e.onTimeout),r=i.map(e=>e.onError),s=i.map(e=>e.onSuccess);i.length>0?q(...s,...n,...r).pipe(fp(i.length)).subscribe({complete:()=>this.allIngredientsToBasketLoading$.next(!1)}):this.allIngredientsToBasketLoading$.next(!1);const o={ingredientsAdded:t.length,ingredientsTotal:this.recipe.ingredients.length};this.basketsService.productsWillBeAdded().pipe(bp(e=>e>0),fp(1)).subscribe(()=>{this.contextRegistryService.addAllProductsWasClicked.emit(o)})}}))}addToBasket(e,t){this.subscriptions.push(this.canAddProductToBasket({method:"addIngredientToBasket",arguments:{recipeId:this.recipe.id,ingredientId:e.ingredient.id,entry:e.basketEntry,eventTrace:t}},t).pipe(id(e=>e),df(()=>this.recipeDetailsProductsService.ingredientToBasketLoading$.next(!0)),E(()=>new bv(e.basketEntry,{recipeId:this.recipe.id,ingredientId:e.ingredient.id,eventTrace:t,previousItem:null,searchString:null},this.basketsService)),df(e=>{this.basketSynchroService.addToActionList([e])}),th(e=>q(e.onError,e.onTimeout).pipe(fp(1),df(()=>this.recipeDetailsProductsService.ingredientToBasketLoading$.next(!1))))).subscribe())}ingredientRemoved(e,t){const i=A_(this.basketEntryForIngredient(e));i.quantity=0;const n=new z_(i,{recipeId:this.recipe.id,ingredientId:e.id,eventTrace:t},this.basketsService);q(n.onTimeout,n.onError).pipe(fp(1)).subscribe(()=>{this.recipeDetailsProductsService.updateIngredientFromBasketLoading$.next(!1),this.recipeDetailsProductsService.getIngredientsBasketEntries(this.recipe.ingredients,this.recipe.modifiedGuests,!0)}),this.basketSynchroService.addToActionList([n])}updateProductQuantity(e,t,i){const n=A_(e);n.quantity=t;const r=new N_(n,{eventTrace:i,recipeId:this.recipe.id},this.basketsService);q(r.onTimeout,r.onError).pipe(fp(1)).subscribe(()=>{this.recipeDetailsProductsService.updateIngredientFromBasketLoading$.next(!1),this.recipeDetailsProductsService.getIngredientsBasketEntries(this.recipe.ingredients,this.recipe.modifiedGuests,!0)}),this.basketSynchroService.addToActionList([r])}ignoreProduct(e){e.basketEntry.status="ignored",this.ignoredBasketsService.addIgnoredIngredients(e.ingredient.id),this.recipeDetailsProductsService.updateRecipePrice(e,!0),this.recipeDetailsProductsService.sendEmitToUpdateRecipePrice()}canAddProductToBasket(e,t,i){const n=i||this.recipe;return this.pendingBasketMethodsService.storeMethodIfCallbackNeeded(e).pipe(th(e=>this.basketsService.recipeIsInBasket(n.id).pipe(fp(1),E(i=>(e&&!i&&this.basketsService.addRecipesToBasket([n.id],n.modifiedGuests,t,!1),e)))))}remainingProducts(){return this.remainingBasketEntries.reduce((e,t)=>{const i=this.recipeDetailsProductsService.products$.value.find(e=>e.basketEntry.name===t.name);return i&&e.push({ingredientId:i.ingredient.id,entry:i.basketEntry}),e},[])}basketEntryForIngredient(e){return this.recipeDetailsProductsService.products$.value.find(t=>t.ingredient.id===e.id).basketEntry}hasSponsorStorytelling(e){return this.sponsorBlocksService.all({remotefilter:{"sponsor-id":e},page:{number:1,size:1}}).pipe(fp(1),E(e=>e.data.length>0))}getSponsorBlocks(e){return this.sponsorBlocksService.all({remotefilter:{"sponsor-id":e},include:["sponsor","sponsor-block-type"],sort:["-position"]}).pipe(fp(1),E(e=>e.data.sort((e,t)=>e.position-t.position)))}}return e.\u0275fac=function(t){return new(t||e)(nn(Rp),nn(C_),nn(__),nn(pv),nn(Vf),nn($_),nn(w_),nn(Dp),nn(xv),nn(__),nn(u_),nn(h_),nn(wv),nn(kv),nn(Qf),nn(nl))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Iv=(()=>{class e{constructor(e,t,i,n,r,s,o,a,c,l,u,d,h,p,m,g,f,_,v,b,y,w,k,C){this.posService=e,this.basketsService=t,this.userService=i,this.preferencesService=n,this.analyticsService=r,this.recipesService=s,this.basketRecipeCleanupService=o,this.mediaMatcher=a,this.suppliersService=c,this.breakpointObserver=l,this.basketHandler=u,this.storeLocatorService=d,this.recipeLikesService=h,this.fakeCartService=p,this.contextRegistryService=m,this.basketUtilsService=g,this.basketTransferService=f,this.recipeDetailsService=_,this.recipeDetailsProductsService=v,this.recipeDetailsProductsPlannerService=b,this.newRecipeDetailsService=y,this.replaceItemService=w,this.mealsPlannerService=k,this.tagsService=C,this.videoRecipesEnabled=!1,this.tagsOnRecipesEnabled=!1,this.seoEnabled=!1,this.defaultIngredientPicture="https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg",this.defaultRecipePicture="https://storage.googleapis.com/assets.miam.tech/generic/images/placeholder.png",this.globalScrollableElement=document.body,this.isSmallScreen$=new cp(!1),this.origin=new cp(null),this.supplierHeaderHeight$=new cp(0),this.logLevel$=new cp("all"),this.catalogUrl="",this.recipeInfoUrl="",this.retailerCartUrl="",this.promotionsUrl="",this.mealsPlannerUrl="",this.antiInflation=!1,this.displayIngredientPicturesOnRecipeCards=!1,this.collapseUnavailableProducts=!1,this.noSupplier=!1,this.displayProductsInBasket=!0,this.loggedOnSession=!1,this.isPreferencesSSR=!1,this.orderHistoryEnabled=!1,this.enableMealsPlanner$=new cp(!1),this.displaySupplierSelector$=new cp(!1),this.preferencesChanged=new Rc,this.mealz={paymentStarted:e=>{Cp("[Mealz] send paymentStarted event"),this.onBasketAndPosSendPaymentStartedEvent(e)},analytics:{init:e=>{this.analyticsService.init(e)},eventSent$:this.analyticsService.eventEmitter,setAbTestKey:e=>this.analyticsService.setAbTestKey(e)},basket:{basketIsReady$:this.basketsService.basketStats$.pipe(bp(e=>!e),fp(1),E(()=>!0)),initialize:()=>{if(!this.origin.value)throw new Error("Cannot start Mealz: origin hasn't been set");this.basketsService.initBasket()},reset:()=>{this.resetBasket()},recipeCount:()=>this.basketsService.waitForBasket.pipe(th(()=>this.basketsService.basketStats$),bp(e=>!e),E(e=>e.recipesCount),p_()),openPreview:(e="",t=0)=>this.basketUtilsService.openBasket(e,t),overrideTransferUrl:e=>{this.noSupplier&&e&&(this.contextRegistryService.transferUrlBaseOverride=e)}},basketSync:{definePushProductsToCart:e=>{this.basketHandler.pushProductsToRetailerCart=e},defineAddProductsToCart:e=>{this.basketHandler.addProductsToRetailerCart=e},defineRemoveProductsFromCart:e=>{this.basketHandler.removeProductsFromRetailerCart=e},definePushBasketEntriesToBasket:e=>{this.basketHandler.pushBasketEntriesToBasket=e},retailerBasketChanged:e=>{this.basketHandler.retailerCartChanged(e),this.suppliersService.lastSupplierCart=e},handlePayment:e=>{this.basketHandler.handlePayment(e),this.suppliersService.lastSupplierCart=[]}},config:{mealzLogs:e=>{this.logLevel$.next(e)}},features:{enableVideoRecipes:()=>{this.videoRecipesEnabled=!0;const e=document.createElement("script");e.src="https://www.youtube.com/iframe_api",document.body.appendChild(e)},enableUserPreferences:()=>{this.userService.preferencesActivated$.next(!0)},enableTagsOnRecipes:()=>{this.tagsOnRecipesEnabled=!0},enableMealsPlanner:(e,t=!1)=>{if(!e)throw new Error("You need to provide the url for the meals-planner page to enable the feature");this.mealsPlannerUrl=e,this.antiInflation=t,this.enableMealsPlanner$.next(!0)},enableSeo:()=>{this.seoEnabled=!0},collapseUnavailableProductsByDefault:()=>{this.collapseUnavailableProducts=!0}},hook:{setHookCallback:e=>{this.contextRegistryService.hookCallback=e},setForcePosCallback:e=>{this.contextRegistryService.forcePosCallback=e}},pos:{load:e=>{if(!this.origin.value)throw new Error("Cannot start Mealz: origin hasn't been set");localStorage.removeItem("_miam/noSupplier/posId"),this.posService.loadPosWithExtId(e)},getByAddress:this.posService.getByAddress.bind(this.posService),getByCoordinates:this.posService.getByCoordinates.bind(this.posService)},recipes:{hidden:this.recipesService.hidden,addAllIngredientsCTAWasClicked:this.contextRegistryService.addAllProductsWasClicked,setDefaultIngredientPicture:e=>this.defaultIngredientPicture=e,setDefaultRecipePicture:e=>this.defaultRecipePicture=e,setDifficultyLevels:e=>{this.recipesService.difficultyLevels=e},showConfirmationToaster:()=>{this.recipesService.confirmationToaster=!0},shouldDisplayIngredientPicturesOnRecipeCards:e=>{this.displayIngredientPicturesOnRecipeCards=e}},router:{setRecipeCatalogUrl:(e="")=>{this.catalogUrl=e},setRecipeInfoLink:(e="")=>{this.recipeInfoUrl=e},setRetailerCartUrl:(e="")=>{this.retailerCartUrl=e},setPromotionsUrl:(e="")=>{this.promotionsUrl=e}},supplier:{setOrigin:e=>{e.length>0&&this.setOriginIfNecessary(e)},load:e=>{if(this.suppliersService.supplier$.value&&this.basketHandler.resetMealz(),!this.origin.value)throw new Error("Cannot start Mealz: origin hasn't been set");this.suppliersService.loadSupplier(e.toString()).subscribe(),this.loggedOnSession||localStorage.removeItem("_miam/userId"),this.generateAuthlessIdIfNecessary().subscribe()},setupWithToken:e=>{this.suppliersService.token=e;const t=JSON.parse(atob(e));if(!t.origin||!t.domain||!t.supplierId&&!t.noSupplier)throw new Error("the token does not have the correct format");this.mealz.supplier.setOrigin(t.origin),this.mealz.analytics.init(t.domain),this.contextRegistryService.disabledAnalytics=!!t.disableAnalytics,t.orderHistory&&(this.orderHistoryEnabled=t.orderHistory),t.displayProductsInBasket&&(this.displayProductsInBasket=t.displayProductsInBasket),t.noSupplier?(this.loadTransferModalPackage(),this.noSupplier=!0,this.fakeCartService.matchMealzBasket(),this.mealz.user.reset(),this.posService.posFromStorage(),this.mealz.basketSync.definePushProductsToCart(e=>{this.fakeCartService.pushToFakeCart(e)}),this.basketHandler.noSupplier$.next(!0)):(localStorage.removeItem("_miam/noSupplier/posId"),this.mealz.supplier.load(t.supplierId))},getAffiliateSuppliers:()=>this.suppliersService.getAffiliateSuppliers()},user:{loadWithAuthlessId:(e,t=!1)=>{this.contextRegistryService.forbidProfiling=t,localStorage.setItem("_miam/authlessId",e),localStorage.setItem("_miam/authless-forbid-profiling",""+t)},loadWithExternalId:(e,t=!1,i=!1)=>(this.contextRegistryService.forbidProfiling=t,this.loggedOnSession=!0,localStorage.setItem("_miam/userId",e),localStorage.removeItem("_miam/userToken"),this.basketHandler.resetMealz(),this.logUser(e,t,i)),reset:()=>{this.loggedOnSession&&this.basketHandler.resetMealz(),this.loggedOnSession=!1,localStorage.removeItem("_miam/userToken"),localStorage.removeItem("_miam/userId"),this.userService.toggleIsLogged(!1),this.generateAuthlessIdIfNecessary().pipe(fp(1),th(e=>e?(this.userService.resetUserInfo(),Cp("[Mealz] will refresh basket after reset"),this.basketsService.refreshCurrentBasket()):td(null))).subscribe()},setLanguage:e=>{this.userService.language=e},setFavoriteItems:e=>this.userService.setFavoriteItems(e),setLocation:e=>this.userService.userCoordinates$.next(e||null),updateForbidProfiling:(e,t,i=!1)=>{i?this.mealz.user.loadWithAuthlessId(t,e):this.logUser(t,e,!1).subscribe()}},events:{storeLocatorOpened:()=>this.storeLocatorService.storeLocatorOpened$.pipe(p_())},setStickyHeaderHeight:e=>{this.supplierHeaderHeight$.value!==e&&this.supplierHeaderHeight$.next(e)},overrideIcon:(e,t)=>{this.icons||(this.icons=[]);const i=this.icons.findIndex(t=>t.icon===e);i>-1?this.icons[i]={icon:e,url:t}:this.icons.push({icon:e,url:t})},setDefaultScrollElementGetter:e=>this.defaultScrollElementGetter=e},this.mealzInternal={analytics:{sendEvent:(e,t,i,n)=>this.analyticsService.sendEvent(e,t,i,n),setIsMealzPage:e=>{this.analyticsService.isMealzPage=e}},basket:{recipePricesInBasket$:()=>this.basketsService.recipePricesInBasket$(),removeRecipe:(e,t)=>this.basketUtilsService.removeRecipe(e,t),buildPreview:()=>this.basketUtilsService.buildPreview(),basketPreviewState$:this.basketUtilsService.basketPreviewState$,recipesAddedToBasket$:()=>this.basketsService.recipesAdded,waitForBasketEntries:()=>this.basketsService.waitForBasket.pipe(th(()=>this.basketsService.waitForBasketEntries)),entries$:()=>this.basketsService.waitForBasket.pipe(th(()=>this.basketsService.basketEntries())),transfer:()=>this.basketTransferService.confirmBasket(),updateRetailerBasketFromPlanner:()=>this.basketTransferService.updateRetailerBasketFromPlanner(),displayProductsInBasket:()=>this.displayProductsInBasket},catalog:{loadMoreRecipes:(e,t,i,n)=>this.recipesService.loadRecipesFromPackageId(e,t,i,n)},config:{logLevel:this.logLevel$},planner:{itemToReplace$:this.recipeDetailsProductsPlannerService.itemToReplace$,itemsWithPricesList$:this.recipeDetailsProductsPlannerService.itemsWithPricesList$,fetchingItemLoading$:this.recipeDetailsProductsPlannerService.fetchingItemLoading$,menuPrice$:this.mealsPlannerService.menuPrice$,plannerRecipePrice$:this.recipeDetailsProductsPlannerService.plannerRecipePrice$,createMenu:()=>this.mealsPlannerService.createMenu(),deleteMenu:e=>this.mealsPlannerService.deleteMenu(e),updateMenu:(e,t)=>this.mealsPlannerService.updateMenu(e,t),addRecipeToMenu:(e,t,i=!0,n)=>this.mealsPlannerService.addRecipeToMenu(e,t,i,n),removeRecipeFromMenu:e=>this.mealsPlannerService.removeRecipeFromMenu(e),menuToBasket:e=>this.mealsPlannerService.menuToBasket(e),getMenuRecipeId:e=>this.mealsPlannerService.getMenuRecipeId(e),isRecipeInMenu$:e=>this.mealsPlannerService.isRecipeInMenu(e),rejectRecipe:e=>this.mealsPlannerService.rejectRecipe(e),selectProduct:(e,t)=>this.recipeDetailsProductsPlannerService.selectProduct(e,t),unselectProduct:(e,t)=>this.recipeDetailsProductsPlannerService.unselectProduct(e,t),replaceProduct:e=>this.recipeDetailsProductsPlannerService.replaceProduct(e),openReplaceItemView:e=>this.recipeDetailsProductsPlannerService.openReplaceItemView(e),searchItem:(e,t,i)=>this.recipeDetailsProductsPlannerService.fetchItems(e,t,i,"ticked"),getSuggestedRecipes:()=>this.recipesService.getSuggestedRecipes(),updateGuests:(e,t)=>this.recipeDetailsProductsPlannerService.updateGuests(e,t),getGuestsForRecipe:e=>this.mealsPlannerService.getGuestsForRecipe(e)},recipes:{openDetails:(e,t,i=0,n="",r=null)=>this.recipesService.openRecipeDetails(e,t,i,n,r),replaceBasketEntry:(e,t)=>this.recipeDetailsProductsService.replaceBasketEntry(e,t),updateGuests:e=>this.newRecipeDetailsService.updateGuests(e),addAllIngredientsToBasket:e=>this.newRecipeDetailsService.addAllIngredientsToBasket(e),addToBasket:(e,t)=>this.newRecipeDetailsService.addToBasket(e,t),ingredientRemoved:(e,t)=>this.newRecipeDetailsService.ingredientRemoved(e,t),updateProductQuantity:(e,t,i)=>this.newRecipeDetailsService.updateProductQuantity(e,t,i),ignoreProduct:e=>this.newRecipeDetailsService.ignoreProduct(e),productIsBeingAdded:e=>this.recipeDetailsProductsService.productIsBeingAdded(e),allIngredientsToBasketLoading$:this.newRecipeDetailsService.allIngredientsToBasketLoading$,ingredientToBasketLoading$:this.newRecipeDetailsService.ingredientToBasketLoading,updateIngredientFromBasketLoading$:this.newRecipeDetailsService.updateIngredientFromBasketLoading,productsLoading$:this.newRecipeDetailsService.productsLoading,displayedRecipe$:this.recipesService.displayedRecipe$,productsByCategory$:this.recipeDetailsProductsService.productsByCategory$,productsPlannerByCategory$:this.recipeDetailsProductsPlannerService.productsPlannerByCategory$,noPosDisplay$:this.newRecipeDetailsService.noPosDisplay$,invalidPosDisplay$:this.newRecipeDetailsService.invalidPosDisplay$,remainingBasketEntries$:this.newRecipeDetailsService.remainingBasketEntries$,recipePrice$:this.recipeDetailsProductsService.recipePrice$,orderHistoryDate$:this.newRecipeDetailsService.orderHistoryDate$,updateRecipeLike:(e,t,i,n="")=>{const r={originPath:n,props:{recipe_id:t}},s=this.recipeLikesService.prepareRecipeLikeForUpdate(t,e,i);this.recipeLikesService.updateLike(t,s,r)},recipeLikeUpdated:()=>this.recipeLikesService.recipeLikeUpdated$,guestsUpdated:()=>this.contextRegistryService.guestsChanged,recipePriceUpdated:()=>this.contextRegistryService.recipePriceChanged,fetchPricing:(e,t,i,n=!1)=>e&&t&&i?this.recipesService.getPricing(e,t,i,n).pipe(bp(e=>0===e.price)):td(null),setIsRecipeDetailsFromPlanner:e=>this.recipesService.isRecipeDetailsFromPlanner=e,isRecipeInBasket:e=>this.basketsService.recipeIsInBasket(e),getRecipeLike:e=>this.recipeLikesService.getLike(e)},replaceItem:{basketEntryToReplace$:this.replaceItemService.basketEntryToReplace$,replaceProductFromPreviewOpen$:this.replaceItemService.replaceProductFromPreviewOpen$,additionModalOpen$:this.replaceItemService.additionModalOpen$,onSelectItem:(e,t,i,n)=>this.replaceItemService.handleItemSelection(e,t,i,n),itemsWithPricesList$:this.replaceItemService.itemsWithPricesList$,fetchingItemLoading$:this.replaceItemService.fetchingItemLoading$,replaceItemLoading$:this.replaceItemService.replaceItemLoading$,searchItem:e=>this.replaceItemService.searchItem(e)},router:{getRetailerCartUrl:()=>this.retailerCartUrl,getCatalogUrl:()=>this.catalogUrl},products:{changeQuantity:(e,t,i)=>{const n={originPath:i,props:{}};if(0===t)return this.basketUtilsService.removeProduct(e,n);this.basketUtilsService.updateProduct(e,t,n)},removeProduct:(e,t)=>{this.basketUtilsService.removeProduct(e,{originPath:t,props:{}})}},pos:{currentPos:()=>this.posService.pos$,loadPos:e=>this.posService.loadPos(e),basketLoadedForNewPos:()=>this.posService.basketLoadedForNewPos()},sponsor:{hasStorytelling:e=>this.newRecipeDetailsService.hasSponsorStorytelling(e),getSponsorBlocks:e=>this.newRecipeDetailsService.getSponsorBlocks(e)},supplier:{getToken:()=>this.suppliersService.token,currentSupplier:()=>this.suppliersService.supplier$,isNoSupplier:()=>this.noSupplier},user:{getLanguage:()=>this.userService.language,isAuthenticated:()=>this.userService.isLogged$,userCoordinates$:this.userService.userCoordinates$,setSessionId:e=>{sessionStorage.setItem("_miam/sessionId",e)}},storeLocator:{open:()=>this.storeLocatorService.openStoreLocator(),openWarning:()=>this.storeLocatorService.showStoreLocatorWarning.next(!0),close:()=>this.storeLocatorService.closeStoreLocator(),changePosAndSupplier:(e,t)=>this.storeLocatorService.changePosAndSupplier(e,t),newStoreSelected:()=>this.storeLocatorService.newStoreSelected$.next()},productAddition:{open:()=>this.replaceItemService.changeAdditionModalState(!0),productAdded$:this.replaceItemService.productAdded$},productReplacement:{open:e=>{this.replaceItemService.changeReplaceModalState(!0,e)}},html:{like:e=>this.recipeLikesService.getLikeHTML(e)},getStickyHeaderHeight:()=>this.supplierHeaderHeight$,preferences:{preferencesCount:()=>this.preferencesService.currentPreferencesNumber,guests$:this.preferencesService.guests$,resetTagsActions:()=>this.preferencesService.resetTagsActions(),tagShouldBeChecked:(e,t)=>this.preferencesService.tagShouldBeChecked(e,t),resetPreferences:()=>this.preferencesService.resetPreferences(),sendCacheRequest:(e,t,i)=>this.preferencesService.sendCacheRequest(e,t,i).pipe(E(()=>{})),preferencesInStorage:()=>this.preferencesService.preferencesInStorage,tagsToAdd:this.preferencesService.tagsToAdd,addTag:e=>this.preferencesService.addTag(e),removeTag:e=>this.preferencesService.removeTag(e),updatePreferences:()=>this.preferencesService.updatePreferences(),preferencesChanged$:()=>this.preferencesChanged,preferencesChanged:()=>this.preferencesChanged.emit(),addPreferencesToRemoteFilters:(e,t)=>this.preferencesService.addPreferencesToRemoteFilters(e,t),newTagFromSearch:e=>{this.preferencesService.addTag({tag:e,checked:!0,without:!0}),this.preferencesService.updatePreferences()}},tags:{all:e=>this.tagsService.all(e),autocomplete:e=>this.tagsService.autocomplete(e)},hook:{hookCallback:()=>Xg([this.userService.isLogged$,this.posService.posWasInitialized()]).pipe(fp(1),th(([e,t])=>td(this.contextRegistryService.hookCallback(e,t))))},noSupplier:{addRecipeToBasketFromIdAndOpenPreview:e=>(localStorage.getItem("_miam/noSupplier/posId")?this.addAllIngredientsFromRecipeId(e).subscribe():(this.displaySupplierSelector$.next(!0),this.storeLocatorService.newStoreSelected$.pipe(fp(1)).subscribe(()=>{this.addAllIngredientsFromRecipeId(e).subscribe()})),td(void 0)),displaySupplierSelector$:this.displaySupplierSelector$}},this.defaultScrollElementGetter=()=>document.body,this.isSmallScreen$.next(!this.mediaMatcher.matchMedia("(min-width: 1023px)").matches),this.breakpointObserver.observe("(min-width: 1023px)").subscribe(e=>this.isSmallScreen$.next(!e.matches)),this.icons=[],this.CORSIssues=new cp(!1);const S={mealzV10:this.mealz,mealzInternalV10:this.mealzInternal};window.mealz||(S.mealz=this.mealz),window.mealzInternal||(S.mealzInternal=this.mealzInternal),Object.assign(window,S)}setCORSIssueState(e){this.CORSIssues.next(e)}getCORSIssuesState(){return this.CORSIssues.asObservable()}getOverrideIconUrl(e){const t=this.icons.find(t=>t.icon===e);return t?t.url:""}setOriginIfNecessary(e){e&&this.origin.value!==e&&this.origin.next(e)}onBasketAndPosSendPaymentStartedEvent(e){nf([this.basketsService.waitForBasket,this.posService.waitForPos.pipe(fp(1))]).subscribe(t=>{const i=t[0];i.totalPrice>0&&this.analyticsService.sendEvent("payment.started","",{basket_id:i.id,miam_amount:i.totalPrice.toString(),total_amount:e.toString(),pos_id:this.posService.pos$.getValue().id,pos_name:this.posService.pos$.getValue().attributes.name,supplier_id:this.posService.pos$.getValue().relationships.supplier.data.id,recipe_count:i.recipeInfos.length.toString(),miam_products:i.entries.length.toString()})})}logUser(e,t,i){return e&&this.userService.toggleIsLogged(!0),i&&this.basketsService.initBasket(),this.userService.generatingAuthlessId$.pipe(bp(e=>e),fp(1),th(()=>localStorage.getItem("_miam/authlessId")?this.basketsService.reloadBasket():td(null)),th(()=>this.userService.setUserInfo(t)))}loadTransferModalPackage(){const e=document.createElement("script");e.setAttribute("type","module"),e.setAttribute("src",Pp+"/basket-transfer-modal/basket-transfer-modal.min.js"),document.head.appendChild(e)}generateAuthlessIdIfNecessary(){return this.userService.generatingAuthlessId$.pipe(of(800),fp(1),th(e=>e||this.loggedOnSession||localStorage.getItem("_miam/authlessId")?td(null):this.userService.generateAnonymousUserId()))}resetBasket(){this.basketsService.waitForBasketEntries.pipe(E(e=>e.filter(e=>"active"===e.status).map(e=>{const t=A_(e);return t.quantity=0,t}))).subscribe(e=>{0===e.length&&this.basketsService.resetBasket().subscribe();const t=e.map(e=>new q_(e,{},this.basketsService));this.basketHandler.addToActionList(t),t.length>0&&t[t.length-1].onSuccess.pipe(fp(1)).subscribe(()=>{this.basketsService.resetBasket().subscribe()})})}addAllIngredientsFromRecipeId(e){const t={originPath:"/locator",props:{recipe_id:e}};return this.recipesService.get(e,{include:["ingredients","recipe-steps","recipe-type","sponsors","tags","recipe-provider"]}).pipe(th(e=>this.newRecipeDetailsService.setupRecipe(e)),df(()=>{this.waitForIngredientsToFinish().pipe(df(()=>{this.basketUtilsService.openBasket("/locator",1)}),fp(1)).subscribe(),this.newRecipeDetailsService.addAllIngredientsToBasket(t)}),fp(1),E(()=>{}))}waitForIngredientsToFinish(){const e=e=>this.newRecipeDetailsService.allIngredientsToBasketLoading$.pipe(bp(t=>t===e),fp(1));return e(!0).pipe(th(()=>e(!1)),th(()=>e(!0)))}}return e.\u0275fac=function(t){return new(t||e)(nn(Vf),nn(C_),nn(Yf),nn(d_),nn(Rp),nn(__),nn(W_),nn(ov),nn(Nf),nn(cv),nn($_),nn(h_),nn(l_),nn(uv),nn(Dp),nn(V_),nn(H_),nn(fv),nn(wv),nn(kv),nn(Ev),nn(yv),nn(f_),nn(a_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Pv=(()=>{class e{constructor(e){this.http=e,this.MEALZ_SSR_API="https://ssr-api.mealz.ai/v2",this.componentStylesUrl="",this.scriptsPaths=[],this.allScriptLoaded$=new cp(!1),this.scriptLoaded=0}getComponentStyles(){return this.http.get(this.componentStylesUrl,{})}loadStyles(){this.getComponentStyles().subscribe(e=>{var t;null===(t=null==e?void 0:e.links)||void 0===t||t.forEach(e=>{this.appendElementToHead("link",{rel:"stylesheet",href:e})})})}loadComponentScripts(){var e;null===(e=this.scriptsPaths)||void 0===e||e.forEach(e=>{document.head.querySelector(`script[type="module"][src="${e}"]`)||this.appendElementToHead("script",{type:"module",src:e})})}appendElementToHead(e,t){const i=document.createElement(e);Object.entries(t).forEach(([e,t])=>i.setAttribute(e,t)),document.head.appendChild(i),i.onload=()=>{this.scriptLoaded+=1,this.scriptLoaded===this.scriptsPaths.length&&this.allScriptLoaded$.next(!0)}}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Dv=(()=>{class e extends Pv{constructor(e,t,i){super(e),this.http=e,this.posService=t,this.httpUtils=i,this.fetchingHTMLLoader$=new cp(!1),this.componentStylesUrl=this.MEALZ_SSR_API+"/styles/catalog/catalog-history",this.scriptsPaths=[Pp+"/catalog/catalog-history/catalog-history.min.js",Pp+"/history-order/history-order.min.js",Pp+"/drawer/drawer.min.js",Pp+"/recipe-card/recipe-card.min.js",Pp+"/drawer-view-swapper/drawer-view-swapper.min.js",Pp+"/history-drawer/history-drawer.min.js"]}displayHistory(e){const t=this.posService.pos$.getValue().id,i=`${this.MEALZ_SSR_API}/catalog/my-space/history?store_id=${t}&search=${e}`,n=this.httpUtils.buildHeaders();return this.loadStyles(),this.fetchingHTMLLoader$.next(!0),this.http.get(i,{headers:n,responseType:"text"}).pipe(df(()=>this.fetchingHTMLLoader$.next(!1)))}replaceNoHistoryRedirection(e){const t=document.querySelector(".mealz-catalog-history__empty__button");t&&(t.href=e)}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Vf),nn(c_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Tv,Av=new Uint8Array(16);function Rv(){if(!Tv&&!(Tv="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Tv(Av)}for(var Ov=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Fv=function(e){return"string"==typeof e&&Ov.test(e)},Bv=[],Mv=0;Mv<256;++Mv)Bv.push((Mv+256).toString(16).substr(1));var Lv=function(e,t,i){var n=(e=e||{}).random||(e.rng||Rv)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(var r=0;r<16;++r)t[i+r]=n[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(Bv[e[t+0]]+Bv[e[t+1]]+Bv[e[t+2]]+Bv[e[t+3]]+"-"+Bv[e[t+4]]+Bv[e[t+5]]+"-"+Bv[e[t+6]]+Bv[e[t+7]]+"-"+Bv[e[t+8]]+Bv[e[t+9]]+"-"+Bv[e[t+10]]+Bv[e[t+11]]+Bv[e[t+12]]+Bv[e[t+13]]+Bv[e[t+14]]+Bv[e[t+15]]).toLowerCase();if(!Fv(i))throw TypeError("Stringified UUID is invalid");return i}(n)};let $v=(()=>{class e{constructor(e,t){this.context=e,this.usersService=t}intercept(e,t){return e.url.includes("plausible")||e.url.includes("ssr-api")?t.handle(e):(e=(e=this.setAuthHeaders(e)).clone({withCredentials:!0}),e=this.setUserProfiling(e),e=this.setSessionId(e),this.context.origin.pipe(bp(e=>!e),th(()=>Xg([this.usersService.userInfo$,this.usersService.generatingAuthlessId$])),bp(()=>this.shouldWaitForAuthentication(e)),fp(1),th(()=>(e=this.setMiamHeaders(e),t.handle(e).pipe(E(e=>{var t;return e instanceof vd&&(null===(t=e.body)||void 0===t?void 0:t.links)&&(e=this.addPagesInfos(e)),e}),Wh(e=>(this.setCORSInContext(e),Zd(e))))))))}setAuthHeaders(e){const t=localStorage.getItem("_miam/userToken"),i=localStorage.getItem("_miam/userId")||localStorage.getItem("_miam/authlessId");return t?e=e.clone({setHeaders:{Authorization:"Bearer "+t}}):i&&(e=e.clone({setHeaders:{Authorization:"user_id "+i}})),e}setUserProfiling(e){return(this.usersService.profilingForbidden()||"true"===localStorage.getItem("_miam/authless-forbid-profiling"))&&(e=e.clone({params:e.params.append("profiling","off")})),e}setSessionId(e){let t=sessionStorage.getItem("_miam/sessionId");return t||(t=Lv(),sessionStorage.setItem("_miam/sessionId",t)),e.clone({setHeaders:{"mealz-session-id":t}})}setMiamHeaders(e){const t={"miam-origin":this.context.origin.value,"miam-front-version":"10.0.4","miam-front-type":"web","miam-api-version":"4.7.0"};return e.headers.has("language-id")||(t["language-id"]="ro"),e.url.includes(Ip)&&"GET"!==e.method&&!e.headers.has("Content-Type")&&(t["Content-Type"]="application/vnd.api+json"),e.clone({setHeaders:t})}addPagesInfos(e){const t=e.body.links;if(null==t?void 0:t.last)try{const i=new URLSearchParams(new URL(t.last).search),n=parseInt(i.get("page[size]")||"0",10),r=n*parseInt(i.get("page[number]")||"0",10);let s=parseInt(i.get("page[number]")||"0",10);if(t.next){const e=new URLSearchParams(new URL(t.next).search);s=parseInt(e.get("page[number]")||"0",10)-1}Object.assign(e.body,{meta:{size:n,resources_per_page:n,number:s,total_resources:r}})}catch(i){console.error("Invalid URL in links:",i.message)}return e}setCORSInContext(e){0===e.status&&e.url.includes("https://api.miam.tech/api")&&this.context.setCORSIssueState(!0)}shouldWaitForAuthentication(e){return!(e.url.includes("user_info")||e.url.includes("users/authless")||localStorage.getItem("_miam/userId")||localStorage.getItem("_miam/authlessId"))}}return e.\u0275fac=function(t){return new(t||e)(nn(Iv),nn(Yf))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),jv=(()=>{class e{constructor(e){this.basketsService=e,this.sendingFile=new cp(!1),this.currentBasketEntries=new cp([]),this.cancelling=new cp(!1),this.entriesToIgnore=[],this.subscriptions=[]}unsubscribeService(){this.subscriptions.forEach(e=>e.unsubscribe())}sendFile(e){const t=e.target,i=t.files.item(0);i&&(this.sendingFile.next(!0),this.subscriptions.push(this.basketsService.currentAndPreviewFetching.pipe(bp(e=>e),fp(1),th(()=>this.basketsService.waitForBasketEntries)).subscribe(e=>{this.entriesToIgnore=e,this.basketsService.addEntriesFromPicture(i,["basket-entries"],!!this.isSchoolList).pipe(th(()=>this.basketsService.waitForBasketEntries)).subscribe(e=>{const t=this.filterOldEntries(e);this.listenForBasketChanges(),this.sendingFile.next(!1),this.currentBasketEntries.next(t)}),t.value=null})))}cancelAndRemove(e){this.cancelling.next(!0),0!==this.currentBasketEntries.value.length?(this.currentBasketEntries.value.forEach(t=>this.basketsService.removeProduct(t,e)),this.subscriptions.push(Xg([this.basketsService.productsWillBeRemoved(),this.basketsService.productsAreBeingRemoved()]).pipe(bp(e=>e[0]>0||e[1]>0),fp(1),th(()=>this.basketsService.reloadBasket())).subscribe(()=>{this.currentBasketEntries.next([]),this.cancelling.next(!1)}))):this.cancelling.next(!1)}listenForBasketChanges(){this.subscriptions.push(this.basketsService.basketEntries().subscribe(e=>{const t=this.filterOldEntries(e),i=this.currentBasketEntries.value.map(e=>t.find(t=>t.id===e.id)||e).filter(e=>t.find(t=>t.id===e.id));t.filter(e=>!i.find(t=>t.id===e.id)).forEach(e=>i.push(e)),this.currentBasketEntries.next(i)}))}filterOldEntries(e){return e.filter(e=>{const t=this.entriesToIgnore.find(t=>t.id===e.id);return!(t&&t.quantity===e.quantity)}).map(e=>{const t=this.entriesToIgnore.find(t=>t.id===e.id);return e.quantity-=(null==t?void 0:t.quantity)||0,e})}}return e.\u0275fac=function(t){return new(t||e)(nn(C_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class zv{}const Nv=new Vi("NgValueAccessor"),Vv={provide:Nv,useExisting:re(()=>Hv),multi:!0};let Hv=(()=>{class e extends zv{constructor(e,t){super(),this._renderer=e,this._elementRef=t,this.onChange=e=>{},this.onTouched=()=>{}}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"checked",e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}}return e.\u0275fac=function(t){return new(t||e)(vo(Sa),vo(wa))},e.\u0275dir=Qe({type:e,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(e,t){1&e&&Ao("change",(function(e){return t.onChange(e.target.checked)}))("blur",(function(){return t.onTouched()}))},features:[ma([Vv]),eo]}),e})();const Uv={provide:Nv,useExisting:re(()=>Gv),multi:!0},qv=new Vi("CompositionEventMode");let Gv=(()=>{class e{constructor(e,t,i){this._renderer=e,this._elementRef=t,this._compositionMode=i,this.onChange=e=>{},this.onTouched=()=>{},this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const e=zl()?zl().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}())}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==e?"":e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}}return e.\u0275fac=function(t){return new(t||e)(vo(Sa),vo(wa),vo(qv,8))},e.\u0275dir=Qe({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(e,t){1&e&&Ao("input",(function(e){return t._handleInput(e.target.value)}))("blur",(function(){return t.onTouched()}))("compositionstart",(function(){return t._compositionStart()}))("compositionend",(function(e){return t._compositionEnd(e.target.value)}))},features:[ma([Uv])]}),e})();const Wv=new Vi("NgValidators"),Zv=new Vi("NgAsyncValidators");function Qv(e){return null!=e}function Yv(e){const t=Po(e)?M(e):e;return To(t),t}function Kv(e){let t={};return e.forEach(e=>{t=null!=e?Object.assign(Object.assign({},t),e):t}),0===Object.keys(t).length?null:t}function Jv(e,t){return t.map(t=>t(e))}function Xv(e){return e.map(e=>function(e){return!e.validate}(e)?e:t=>e.validate(t))}function eb(e){return null!=e?function(e){if(!e)return null;const t=e.filter(Qv);return 0==t.length?null:function(e){return Kv(Jv(e,t))}}(Xv(e)):null}function tb(e){return null!=e?function(e){if(!e)return null;const t=e.filter(Qv);return 0==t.length?null:function(e){return nf(Jv(e,t).map(Yv)).pipe(E(Kv))}}(Xv(e)):null}function ib(e,t){return null===e?[t]:Array.isArray(e)?[...e,t]:[e,t]}let nb=(()=>{class e{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=eb(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=tb(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e){this.control&&this.control.reset(e)}hasError(e,t){return!!this.control&&this.control.hasError(e,t)}getError(e,t){return this.control?this.control.getError(e,t):null}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Qe({type:e}),e})(),rb=(()=>{class e extends nb{get formDirective(){return null}get path(){return null}}return e.\u0275fac=function(t){return sb(t||e)},e.\u0275dir=Qe({type:e,features:[eo]}),e})();const sb=ji(rb);class ob extends nb{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let ab=(()=>{class e extends class{constructor(e){this._cd=e}is(e){var t,i;return!!(null===(i=null===(t=this._cd)||void 0===t?void 0:t.control)||void 0===i?void 0:i[e])}}{constructor(e){super(e)}}return e.\u0275fac=function(t){return new(t||e)(vo(ob,2))},e.\u0275dir=Qe({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(e,t){2&e&&Ho("ng-untouched",t.is("untouched"))("ng-touched",t.is("touched"))("ng-pristine",t.is("pristine"))("ng-dirty",t.is("dirty"))("ng-valid",t.is("valid"))("ng-invalid",t.is("invalid"))("ng-pending",t.is("pending"))},features:[eo]}),e})();function cb(e,t){e.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function lb(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function ub(e,t){const i=e.indexOf(t);i>-1&&e.splice(i,1)}function db(e){return(gb(e)?e.validators:e)||null}function hb(e){return Array.isArray(e)?eb(e):e||null}function pb(e,t){return(gb(t)?t.asyncValidators:e)||null}function mb(e){return Array.isArray(e)?tb(e):e||null}function gb(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}class fb{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=hb(this._rawValidators),this._composedAsyncValidatorFn=mb(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return"VALID"===this.status}get invalid(){return"INVALID"===this.status}get pending(){return"PENDING"==this.status}get disabled(){return"DISABLED"===this.status}get enabled(){return"DISABLED"!==this.status}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=hb(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=mb(e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(e=>{e.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(e=>{e.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status="PENDING",!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status="DISABLED",this.errors=null,this._forEachChild(t=>{t.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status="VALID",this._forEachChild(t=>{t.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),"VALID"!==this.status&&"PENDING"!==this.status||this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?"DISABLED":"VALID"}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status="PENDING",this._hasOwnPendingAsyncValidator=!0;const t=Yv(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(t=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(t,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(e,t,i){if(null==t)return null;if(Array.isArray(t)||(t=t.split(".")),Array.isArray(t)&&0===t.length)return null;let n=e;return t.forEach(e=>{n=n instanceof vb?n.controls.hasOwnProperty(e)?n.controls[e]:null:n instanceof bb&&n.at(e)||null}),n}(this,e)}getError(e,t){const i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Rc,this.statusChanges=new Rc}_calculateStatus(){return this._allControlsDisabled()?"DISABLED":this.errors?"INVALID":this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus("PENDING")?"PENDING":this._anyControlsHaveStatus("INVALID")?"INVALID":"VALID"}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){gb(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class _b extends fb{constructor(e=null,t,i){super(db(t),pb(i,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!i})}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(e=>e(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){ub(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){ub(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class vb extends fb{constructor(e,t,i){super(db(t),pb(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!i})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t){this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}removeControl(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity(),this._onCollectionChange()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(i=>{this._throwIfControlMissing(i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(i=>{this.controls[i]&&this.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,n)=>{i.reset(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t instanceof _b?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(e,t)=>!!t._syncPendingControls()||e);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[e])throw new Error(`Cannot find form control with name: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const i=this.controls[t];if(this.contains(t)&&e(i))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,i)=>((t.enabled||this.disabled)&&(e[i]=t.value),e))}_reduceChildren(e,t){let i=e;return this._forEachChild((e,n)=>{i=t(i,e,n)}),i}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control with name: '${i}'.`)})}}class bb extends fb{constructor(e,t,i){super(db(t),pb(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!i})}at(e){return this.controls[e]}push(e){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()}insert(e,t){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity()}removeAt(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity(),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((e,i)=>{this._throwIfControlMissing(i),this.at(i).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((e,i)=>{this.at(i)&&this.at(i).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((i,n)=>{i.reset(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof _b?e.value:e.getRawValue())}clear(){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity())}_syncPendingControls(){let e=this.controls.reduce((e,t)=>!!t._syncPendingControls()||e,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error("Cannot find form control at index "+e)}_forEachChild(e){this.controls.forEach((t,i)=>{e(t,i)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control at index: ${i}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const yb={provide:ob,useExisting:re(()=>kb)},wb=(()=>Promise.resolve(null))();let kb=(()=>{class e extends ob{constructor(e,t,i,n){super(),this.control=new _b,this._registered=!1,this.update=new Rc,this._parent=e,this._setValidators(t),this._setAsyncValidators(i),this.valueAccessor=function(e,t){if(!t)return null;Array.isArray(t);let i=void 0,n=void 0,r=void 0;return t.forEach(e=>{e.constructor===Gv?i=e:Object.getPrototypeOf(e.constructor)===zv?n=e:r=e}),r||n||i||null}(0,n)}ngOnChanges(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),function(e,t){if(!e.hasOwnProperty("model"))return!1;const i=e.model;return!!i.isFirstChange()||!Object.is(t,i.currentValue)}(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?[...this._parent.path,this.name]:[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){var e,t;(function(e,t,i){const n=function(e){return e._rawValidators}(e);null!==t.validator?e.setValidators(ib(n,t.validator)):"function"==typeof n&&e.setValidators([n]);const r=function(e){return e._rawAsyncValidators}(e);null!==t.asyncValidator?e.setAsyncValidators(ib(r,t.asyncValidator)):"function"==typeof r&&e.setAsyncValidators([r]);{const i=()=>e.updateValueAndValidity();cb(t._rawValidators,i),cb(t._rawAsyncValidators,i)}})(e=this.control,t=this),t.valueAccessor.writeValue(e.value),function(e,t){t.valueAccessor.registerOnChange(i=>{e._pendingValue=i,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&lb(e,t)})}(e,t),function(e,t){const i=(e,i)=>{t.valueAccessor.writeValue(e),i&&t.viewToModelUpdate(e)};e.registerOnChange(i),t._registerOnDestroy(()=>{e._unregisterOnChange(i)})}(e,t),function(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&lb(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),function(e,t){if(t.valueAccessor.setDisabledState){const i=e=>{t.valueAccessor.setDisabledState(e)};e.registerOnDisabledChange(i),t._registerOnDestroy(()=>{e._unregisterOnDisabledChange(i)})}}(e,t),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(e){wb.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1})})}_updateDisabled(e){const t=e.isDisabled.currentValue,i=""===t||t&&"false"!==t;wb.then(()=>{i&&!this.control.disabled?this.control.disable():!i&&this.control.disabled&&this.control.enable()})}}return e.\u0275fac=function(t){return new(t||e)(vo(rb,9),vo(Wv,10),vo(Zv,10),vo(Nv,10))},e.\u0275dir=Qe({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[ma([yb]),eo,at]}),e})(),Cb=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({}),e})();const Sb=new Vi("NgModelWithFormControlWarning");let xb=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[Cb]]}),e})(),Eb=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[xb]}),e})(),Ib=(()=>{class e{static withConfig(t){return{ngModule:e,providers:[{provide:Sb,useValue:t.warnOnNgModelWithFormControl}]}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[xb]}),e})();const Pb=e=>{e.stopPropagation(),e.preventDefault()};let Db=(()=>{class e{transform(e){return e?(e=e.trim()).charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=Ye({name:"capitalizeFirstLetter",type:e,pure:!0}),e})(),Tb=(()=>{class e{transform(e,t){var i;return void 0===t||t>=(null===(i=null==e?void 0:e.split(" "))||void 0===i?void 0:i.length)?e:e.split(" ").slice(0,t).join(" ")+" ..."}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=Ye({name:"ellipsis",type:e,pure:!0}),e})(),Ab=(()=>{class e{constructor(e){this.elementRef=e,this.threshold=.8,this.debounceTime=1e3,this.condition=!0,this.inViewport=new Rc,this.intersectionSubject=new C,this.isObserving=!1,this.subscriptions=[]}ngOnInit(){this.observer=new IntersectionObserver(e=>{e.forEach(e=>this.intersectionSubject.next(e))},{root:null,rootMargin:"0px",threshold:this.threshold}),this.subscriptions.push(this.intersectionSubject.pipe(of(this.debounceTime)).subscribe(e=>this.handleIntersection(e))),this.observer.observe(this.elementRef.nativeElement),this.isObserving=!0}ngOnChanges(e){this.isObserving&&e.condition&&this.handleIntersection.bind(this)}ngOnDestroy(){this.observer&&this.observer.disconnect(),this.isObserving=!1,this.intersectionSubject.complete(),this.subscriptions.forEach(e=>e.unsubscribe())}handleIntersection(e){this.condition&&e.isIntersecting&&(this.inViewport.emit(),this.observer.disconnect(),this.isObserving=!1)}}return e.\u0275fac=function(t){return new(t||e)(vo(wa))},e.\u0275dir=Qe({type:e,selectors:[["","ngMiamInViewport",""]],inputs:{threshold:"threshold",debounceTime:"debounceTime",condition:"condition"},outputs:{inViewport:"inViewport"},features:[at]}),e})(),Rb=(()=>{class e{constructor(e){this.el=e,this.marginRoot="0px",this.threshold=0,this.isLoading=!1,this.loadMore=new Rc,this.emitted=!1}ngOnInit(){this.intersectionObserver()}ngAfterViewInit(){this.observer.observe(this.el.nativeElement)}intersectionObserver(){this.observer=new IntersectionObserver(e=>{e[0].isIntersecting&&!this.isLoading&&this.loadMore.emit()},{root:null,rootMargin:this.marginRoot,threshold:this.threshold})}}return e.\u0275fac=function(t){return new(t||e)(vo(wa))},e.\u0275dir=Qe({type:e,selectors:[["","ngMiamLoadOnScroll",""]],inputs:{marginRoot:"marginRoot",threshold:"threshold",isLoading:"isLoading"},outputs:{loadMore:"loadMore"}}),e})();const Ob=["counterInput"];function Fb(e,t){if(1&e&&Co(0,"img",10),2&e){const e=Fo();bo("src",e.disable&&e.biColor?e.icons.minus_white:e.icons.minus,Wn)}}function Bb(e,t){1&e&&Co(0,"div",11)}function Mb(e,t){1&e&&(wo(0,"div",12),Co(1,"img",13),ko())}function Lb(e,t){1&e&&Co(0,"img",14),2&e&&bo("src",Fo().icons.plus,Wn)}function $b(e,t){1&e&&Co(0,"div",11)}const jb=function(e,t,i){return{disabled:e,"miam-counter-input__minus__remove":t,"ghost small":i}},zb=function(e,t,i){return{disabled:e,"ghost small":t,primary:i}};let Nb=(()=>{class e{constructor(e){this.cdr=e,this.floating=!1,this.biColor=!1,this.value=1,this.minRange=1,this.maxRange=100,this.disable=!1,this.minusLoading=!1,this.plusLoading=!1,this.debounceTime=0,this.valueChange=new Rc,this.icon=Cv,this.icons={minus:"https://storage.googleapis.com/assets.miam.tech/generic/icons/minus-primary.svg",minus_white:"https://storage.googleapis.com/assets.miam.tech/generic/icons/minus-white.svg",plus:"https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-primary.svg"},this.subscriptions=[]}ngOnInit(){this.biColor&&(this.icons.minus="https://storage.googleapis.com/assets.miam.tech/generic/icons/minus-black.svg",this.icons.plus="https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-white.svg",this.cdr.detectChanges()),this.valueSubject||(this.valueSubject=new cp(this.value),this.lastValue=this.value,this.subscriptions.push(this.valueSubject.pipe(of(this.debounceTime)).subscribe(()=>{this.lastValue!==this.value&&(this.valueChange.emit(this.value),this.lastValue=this.value)})))}ngOnChanges(e){var t;(null===(t=e.value)||void 0===t?void 0:t.isFirstChange())||this.value!==this.valueSubject.value&&this.valueSubject.next(this.value),this.cdr.detectChanges()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}increment(e){Pb(e),this.value<this.maxRange&&(this.value++,this.valueSubject.next(this.value),this.cdr.detectChanges())}decrement(e){Pb(e),this.value>this.minRange&&(this.value--,this.valueSubject.next(this.value),this.cdr.detectChanges())}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-counter-input"]],viewQuery:function(e,t){if(1&e&&Uc(Ob,1),2&e){let e;Hc(e=qc())&&(t.counterInput=e.first)}},inputs:{floating:"floating",biColor:"biColor",value:"value",minRange:"minRange",maxRange:"maxRange",disable:"disable",minusLoading:"minusLoading",plusLoading:"plusLoading",debounceTime:"debounceTime"},outputs:{valueChange:"valueChange"},features:[at],decls:12,vars:24,consts:[[1,"miam-counter-input"],[1,"miam-counter-input__counter"],[1,"miam-counter-input__minus","mealz-ds-button","square",3,"disabled","ngClass","click"],["alt","remove one button",3,"src",4,"ngIf"],["class","mealz-ds-loader",4,"ngIf"],[1,"miam-counter-input__value-container"],[1,"miam-counter-input__value-text","mealz-ds-text","weight-xxl"],["class","miam-counter-input__people-button",4,"ngIf"],[1,"miam-counter-input__plus","mealz-ds-button","square",3,"disabled","ngClass","click"],["alt","add one button",3,"src",4,"ngIf"],["alt","remove one button",3,"src"],[1,"mealz-ds-loader"],[1,"miam-counter-input__people-button"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/people-primary.svg","alt","people icon",1,"miam-counter-input__people-icon"],["alt","add one button",3,"src"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"div",1),wo(2,"button",2),Ao("click",(function(e){return t.decrement(e)})),fo(3,Fb,1,1,"img",3),fo(4,Bb,1,0,"div",4),ko(),wo(5,"div",5),wo(6,"span",6),Qo(7),ko(),fo(8,Mb,2,0,"div",7),ko(),wo(9,"button",8),Ao("click",(function(e){return t.increment(e)})),fo(10,Lb,1,1,"img",9),fo(11,$b,1,0,"div",4),ko(),ko(),ko()),2&e&&(Ho("disabled",t.disable)("floating",t.floating)("bi-color",t.biColor),Nr(2),bo("disabled",t.disable)("ngClass",wc(16,jb,t.disable,1==t.value,!t.biColor)),Nr(1),bo("ngIf",!t.minusLoading),Nr(1),bo("ngIf",t.minusLoading),Nr(3),Yo(t.value),Nr(1),bo("ngIf",t.floating),Nr(1),bo("disabled",t.disable)("ngClass",wc(20,zb,t.disable,!t.biColor,t.biColor)),Nr(1),bo("ngIf",!t.plusLoading),Nr(1),bo("ngIf",t.plusLoading))},directives:[Du,Ou],styles:[".miam-counter-input{display:flex;align-items:center;justify-content:center;padding:8px}.miam-counter-input.bi-color{padding:0}.miam-counter-input.floating{background:var(--mealz-ds-color-neutral-white,#fff);border-radius:120px}.miam-counter-input .miam-counter-input__counter{display:flex;align-items:center;justify-content:center;overflow:hidden}.miam-counter-input .miam-counter-input__counter>:not(:last-child){margin-right:8px}.miam-counter-input .miam-counter-input__counter .miam-counter-input__value-container{display:flex;width:32px;justify-content:center;align-items:center}.miam-counter-input .miam-counter-input__counter .miam-counter-input__value-container>:not(:last-child){margin-right:4px}.miam-counter-input .miam-counter-input__counter .miam-counter-input__value-container .miam-counter-input__value-text{color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-counter-input .miam-counter-input__counter .miam-counter-input__value-container .miam-counter-input__people-button{display:flex;justify-content:center;align-items:center}.miam-counter-input .miam-counter-input__counter .miam-counter-input__value-container .miam-counter-input__people-button .miam-counter-input__people-icon{height:18px;width:18px}"],encapsulation:2,changeDetection:0}),e})();const Vb=function(e,t){return{width:e,height:t}},Hb=function(e){return{width:e}};function Ub(e,t){if(1&e&&(wo(0,"div",2),Co(1,"img",3),ko()),2&e){const e=Fo();bo("ngStyle",yc(3,Vb,e.width+"px",e.height+"px")),Nr(1),bo("src",e.iconOverrideUrl,Wn)("ngStyle",bc(6,Hb,e.width+"px"))}}function qb(e,t){if(1&e&&(So(0),Co(1,"img",7),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Gb(e,t){if(1&e&&(So(0),Co(1,"img",8),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Wb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",9),Co(2,"path",10),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor)}}function Zb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",11),Co(2,"path",12),Co(3,"path",13),Co(4,"path",14),Co(5,"path",15),Co(6,"path",16),Co(7,"path",17),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor)}}function Qb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",18),Co(2,"path",19),Co(3,"path",20),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height)("fill",e.primaryColor)}}function Yb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",21),Co(2,"path",22),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height)("fill",e.primaryColor)}}function Kb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",23),wo(2,"g",24),Co(3,"path",25),ko(),wo(4,"g",26),Co(5,"path",27),ko(),wo(6,"g",28),Co(7,"path",29),ko(),wo(8,"defs"),wo(9,"clipPath",30),Co(10,"rect",31),ko(),wo(11,"clipPath",32),Co(12,"rect",33),ko(),wo(13,"clipPath",34),Co(14,"rect",35),ko(),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(2),mo("fill",e.primaryColor)}}function Jb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",23),wo(2,"g",24),Co(3,"path",25),ko(),wo(4,"g",26),Co(5,"path",36),ko(),wo(6,"g",28),Co(7,"path",29),ko(),wo(8,"defs"),wo(9,"clipPath",30),Co(10,"rect",31),ko(),wo(11,"clipPath",32),Co(12,"rect",33),ko(),wo(13,"clipPath",34),Co(14,"rect",35),ko(),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(2),mo("fill",e.primaryColor),Nr(2),mo("fill",e.primaryColor)}}function Xb(e,t){if(1&e&&(So(0),si(),wo(1,"svg",23),wo(2,"g",24),Co(3,"path",25),ko(),wo(4,"g",26),Co(5,"path",36),ko(),wo(6,"g",28),Co(7,"path",37),ko(),wo(8,"defs"),wo(9,"clipPath",30),Co(10,"rect",31),ko(),wo(11,"clipPath",32),Co(12,"rect",33),ko(),wo(13,"clipPath",34),Co(14,"rect",35),ko(),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(2),mo("fill",e.primaryColor),Nr(2),mo("fill",e.primaryColor),Nr(2),mo("fill",e.primaryColor)}}function ey(e,t){if(1&e&&(So(0),si(),wo(1,"svg",38),Co(2,"path",39),Co(3,"path",40),Co(4,"path",41),Co(5,"path",42),Co(6,"path",43),wo(7,"g",44),Co(8,"path",45),Co(9,"path",46),Co(10,"path",47),Co(11,"path",48),Co(12,"path",49),ko(),wo(13,"g",44),Co(14,"path",50),Co(15,"path",51),Co(16,"path",52),Co(17,"path",53),Co(18,"path",54),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(2),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(2),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor)}}function ty(e,t){if(1&e&&(So(0),si(),wo(1,"svg",38),Co(2,"path",39),Co(3,"path",40),Co(4,"path",41),Co(5,"path",42),Co(6,"path",43),Co(7,"path",45),Co(8,"path",46),Co(9,"path",47),Co(10,"path",48),Co(11,"path",49),wo(12,"g",44),Co(13,"path",50),Co(14,"path",51),Co(15,"path",52),Co(16,"path",53),Co(17,"path",54),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(2),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor)}}function iy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",38),Co(2,"path",39),Co(3,"path",40),Co(4,"path",41),Co(5,"path",42),Co(6,"path",43),Co(7,"path",45),Co(8,"path",46),Co(9,"path",47),Co(10,"path",48),Co(11,"path",49),Co(12,"path",50),Co(13,"path",51),Co(14,"path",52),Co(15,"path",53),Co(16,"path",54),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor),Nr(1),mo("stroke",e.primaryColor)}}function ny(e,t){if(1&e&&(So(0),si(),wo(1,"svg",55),Co(2,"path",56),Co(3,"path",57),Co(4,"path",58),Co(5,"path",59),Co(6,"path",60),Co(7,"path",61),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor)}}function ry(e,t){if(1&e&&(So(0),si(),wo(1,"svg",62),Co(2,"path",63),Co(3,"path",64),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(2),mo("fill",e.primaryColor)}}function sy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",65),Co(2,"path",66),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height)("fill",e.primaryColor)}}function oy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",67),Co(2,"path",68),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor)}}function ay(e,t){if(1&e&&(So(0),Co(1,"img",69),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function cy(e,t){if(1&e&&(So(0),Co(1,"img",70),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function ly(e,t){if(1&e&&(So(0),Co(1,"img",71),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function uy(e,t){if(1&e&&(So(0),Co(1,"img",72),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function dy(e,t){if(1&e&&(So(0),Co(1,"img",73),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function hy(e,t){if(1&e&&(So(0),Co(1,"img",74),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function py(e,t){if(1&e&&(So(0),si(),wo(1,"svg",11),Co(2,"path",75),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor)}}function my(e,t){if(1&e&&(So(0),si(),wo(1,"svg",62),Co(2,"path",63),Co(3,"path",76),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("fill",e.primaryColor)("width.px",e.width)("height.px",e.height)}}function gy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",62),Co(2,"path",77),Co(3,"path",78),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("fill",e.primaryColor)("width.px",e.width)("height.px",e.height)}}function fy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",67),Co(2,"path",79),Co(3,"path",80),Co(4,"path",81),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor),Nr(1),mo("fill",e.primaryColor)}}function _y(e,t){if(1&e&&(So(0),Co(1,"img",82),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function vy(e,t){if(1&e&&(So(0),Co(1,"img",83),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function by(e,t){if(1&e&&(So(0),Co(1,"img",84),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function yy(e,t){if(1&e&&(So(0),Co(1,"img",85),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function wy(e,t){if(1&e&&(So(0),Co(1,"img",86),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function ky(e,t){if(1&e&&(So(0),si(),wo(1,"svg",9),wo(2,"g"),Co(3,"path",87),ko(),wo(4,"defs"),wo(5,"clipPath",30),Co(6,"rect",88),ko(),ko(),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(2),mo("fill",e.primaryColor)}}function Cy(e,t){if(1&e&&(So(0),Co(1,"img",89),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Sy(e,t){if(1&e&&(So(0),Co(1,"img",90),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function xy(e,t){if(1&e&&(So(0),Co(1,"img",91),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Ey(e,t){if(1&e&&(So(0),Co(1,"img",92),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Iy(e,t){if(1&e&&(So(0),Co(1,"img",93),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Py(e,t){if(1&e&&(So(0),Co(1,"img",94),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Dy(e,t){if(1&e&&(So(0),Co(1,"img",95),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Ty(e,t){if(1&e&&(So(0),Co(1,"img",96),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Ay(e,t){if(1&e&&(So(0),Co(1,"img",97),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Ry(e,t){if(1&e&&(So(0),Co(1,"img",98),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Oy(e,t){if(1&e&&(So(0),Co(1,"img",99),xo()),2&e){const e=Fo(2);Nr(1),bo("ngStyle",bc(1,Hb,e.width+"px"))}}function Fy(e,t){if(1&e&&(So(0),si(),wo(1,"svg",100),Co(2,"path",101),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor)}}function By(e,t){if(1&e&&(So(0),si(),wo(1,"svg",102),Co(2,"path",103),ko(),xo()),2&e){const e=Fo(2);Nr(1),mo("width.px",e.width)("height.px",e.height),Nr(1),mo("fill",e.primaryColor)}}function My(e,t){1&e&&Eo(0)}function Ly(e,t){if(1&e&&(So(0,4),wo(1,"div",2),fo(2,qb,2,3,"ng-container",5),fo(3,Gb,2,3,"ng-container",5),fo(4,Wb,3,3,"ng-container",5),fo(5,Zb,8,8,"ng-container",5),fo(6,Qb,4,3,"ng-container",5),fo(7,Yb,3,3,"ng-container",5),fo(8,Kb,15,3,"ng-container",5),fo(9,Jb,15,4,"ng-container",5),fo(10,Xb,15,5,"ng-container",5),fo(11,ey,19,17,"ng-container",5),fo(12,ty,18,17,"ng-container",5),fo(13,iy,17,17,"ng-container",5),fo(14,ny,8,8,"ng-container",5),fo(15,ry,4,3,"ng-container",5),fo(16,sy,3,3,"ng-container",5),fo(17,oy,3,3,"ng-container",5),fo(18,ay,2,3,"ng-container",5),fo(19,cy,2,3,"ng-container",5),fo(20,ly,2,3,"ng-container",5),fo(21,uy,2,3,"ng-container",5),fo(22,dy,2,3,"ng-container",5),fo(23,hy,2,3,"ng-container",5),fo(24,py,3,3,"ng-container",5),fo(25,my,4,3,"ng-container",5),fo(26,gy,4,3,"ng-container",5),fo(27,fy,5,5,"ng-container",5),fo(28,_y,2,3,"ng-container",5),fo(29,vy,2,3,"ng-container",5),fo(30,by,2,3,"ng-container",5),fo(31,yy,2,3,"ng-container",5),fo(32,wy,2,3,"ng-container",5),fo(33,ky,7,3,"ng-container",5),fo(34,Cy,2,3,"ng-container",5),fo(35,Sy,2,3,"ng-container",5),fo(36,xy,2,3,"ng-container",5),fo(37,Ey,2,3,"ng-container",5),fo(38,Iy,2,3,"ng-container",5),fo(39,Py,2,3,"ng-container",5),fo(40,Dy,2,3,"ng-container",5),fo(41,Ty,2,3,"ng-container",5),fo(42,Ay,2,3,"ng-container",5),fo(43,Ry,2,3,"ng-container",5),fo(44,Oy,2,3,"ng-container",5),fo(45,Fy,3,3,"ng-container",5),fo(46,By,3,3,"ng-container",5),fo(47,My,1,0,"ng-container",6),ko(),xo()),2&e){const e=Fo();bo("ngSwitch",e.iconName),Nr(1),bo("ngStyle",yc(47,Vb,e.width+"px",e.height+"px")),Nr(1),bo("ngSwitchCase",e.icon.Checkmark),Nr(1),bo("ngSwitchCase",e.icon.Alert),Nr(1),bo("ngSwitchCase",e.icon.CloudUpload),Nr(1),bo("ngSwitchCase",e.icon.Time),Nr(1),bo("ngSwitchCase",e.icon.Clear),Nr(1),bo("ngSwitchCase",e.icon.Picture),Nr(1),bo("ngSwitchCase",e.icon.CostLow),Nr(1),bo("ngSwitchCase",e.icon.CostMedium),Nr(1),bo("ngSwitchCase",e.icon.CostHight),Nr(1),bo("ngSwitchCase",e.icon.DifficultyLow),Nr(1),bo("ngSwitchCase",e.icon.DifficultyMedium),Nr(1),bo("ngSwitchCase",e.icon.DifficultyHigh),Nr(1),bo("ngSwitchCase",e.icon.Grip),Nr(1),bo("ngSwitchCase",e.icon.ChevronDown),Nr(1),bo("ngSwitchCase",e.icon.ArrowDown),Nr(1),bo("ngSwitchCase",e.icon.Cart),Nr(1),bo("ngSwitchCase",e.icon.People),Nr(1),bo("ngSwitchCase",e.icon.Trash),Nr(1),bo("ngSwitchCase",e.icon.Trash_danger),Nr(1),bo("ngSwitchCase",e.icon.Trash_grey05),Nr(1),bo("ngSwitchCase",e.icon.Trash_greyText),Nr(1),bo("ngSwitchCase",e.icon.Trash_greyTextDark),Nr(1),bo("ngSwitchCase",e.icon.Plus),Nr(1),bo("ngSwitchCase",e.icon.Wait),Nr(1),bo("ngSwitchCase",e.icon.Hot),Nr(1),bo("ngSwitchCase",e.icon.Search),Nr(1),bo("ngSwitchCase",e.icon.RecipeBook),Nr(1),bo("ngSwitchCase",e.icon.Meal),Nr(1),bo("ngSwitchCase",e.icon.Meal_grey06),Nr(1),bo("ngSwitchCase",e.icon.HorizontalDots),Nr(1),bo("ngSwitchCase",e.icon.NoRecipeFound),Nr(1),bo("ngSwitchCase",e.icon.Preheat),Nr(1),bo("ngSwitchCase",e.icon.Empty),Nr(1),bo("ngSwitchCase",e.icon.Starter),Nr(1),bo("ngSwitchCase",e.icon.NotStarter),Nr(1),bo("ngSwitchCase",e.icon.Dessert),Nr(1),bo("ngSwitchCase",e.icon.NotDessert),Nr(1),bo("ngSwitchCase",e.icon.MainDish),Nr(1),bo("ngSwitchCase",e.icon.NotMainDish),Nr(1),bo("ngSwitchCase",e.icon.Edit),Nr(1),bo("ngSwitchCase",e.icon.CircledPlus),Nr(1),bo("ngSwitchCase",e.icon.CartPlus),Nr(1),bo("ngSwitchCase",e.icon.Cross),Nr(1),bo("ngSwitchCase",e.icon.Home),Nr(1),bo("ngSwitchCase",e.icon.Filter)}}let $y=(()=>{class e{constructor(e,t){this.contextService=e,this.cdr=t,this.primaryColor="black",this.secondaryColor="grey",this.width=16,this.height=16,this.icon=Cv}ngOnChanges(){this.iconOverrideUrl=this.contextService.getOverrideIconUrl(this.iconName),this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Iv),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-icon"]],inputs:{primaryColor:"primaryColor",secondaryColor:"secondaryColor",width:"width",height:"height",iconName:"iconName"},features:[at],decls:3,vars:2,consts:[["class","icon-container",3,"ngStyle",4,"ngIf","ngIfElse"],["switchIcon",""],[1,"icon-container",3,"ngStyle"],[1,"icon-container__icon",3,"src","ngStyle"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Checkmark.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Alert_danger.svg",1,"icon-container__icon",3,"ngStyle"],["viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M12.5018 13.821H9.91582H9.21945H9.06906V10.3523H10.2035C10.4912 10.3523 10.6612 10.0253 10.4912 9.78995L8.28443 6.73642C8.14385 6.54026 7.85288 6.54026 7.7123 6.73642L5.50552 9.78995C5.33551 10.0253 5.50225 10.3523 5.79322 10.3523H6.92767V13.821H6.77728H6.08092H3.08296C1.36657 13.7262 0 12.121 0 10.3817C0 9.18186 0.650593 8.13568 1.61504 7.57009C1.52677 7.33143 1.481 7.07643 1.481 6.80834C1.481 5.58235 2.4716 4.59175 3.69759 4.59175C3.9624 4.59175 4.21741 4.63752 4.45607 4.72579C5.16551 3.22191 6.69555 2.179 8.47405 2.179C10.7756 2.18227 12.6718 3.94443 12.8876 6.19044C14.6563 6.49449 16 8.13241 16 9.98611C16 11.9673 14.4569 13.6837 12.5018 13.821Z"],["viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M12.5 22C16.9183 22 20.5 18.4183 20.5 14C20.5 9.58172 16.9183 6 12.5 6C8.08172 6 4.5 9.58172 4.5 14C4.5 18.4183 8.08172 22 12.5 22Z","stroke-width","2"],["d","M14.5 2H10.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M12.5 2V6","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M18 8L19.5 6.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M12.5 14V11","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M12.5 14H9.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["viewBox","0 0 16 16","xmlns","http://www.w3.org/2000/svg",1,"bi","bi-x"],["fill-rule","evenodd","d","M11.854 4.146a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708-.708l7-7a.5.5 0 0 1 .708 0z"],["fill-rule","evenodd","d","M4.146 4.146a.5.5 0 0 0 0 .708l7 7a.5.5 0 0 0 .708-.708l-7-7a.5.5 0 0 0-.708 0z"],["viewBox","0 0 17 16","xmlns","http://www.w3.org/2000/svg",1,"bi","bi-image"],["fill-rule","evenodd","d","M14.002 2h-12a1 1 0 0 0-1 1v9l2.646-2.354a.5.5 0 0 1 .63-.062l2.66 1.773 3.71-3.71a.5.5 0 0 1 .577-.094L15.002 9.5V3a1 1 0 0 0-1-1zm-12-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2h-12zm4 4.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"],["viewBox","0 0 64 16","fill","none","xmlns","http://www.w3.org/2000/svg"],["clip-path","url(#clip0)"],["d","M14.7613 14.2631C14.5819 13.8245 14.3992 13.386 14.1998 12.954C14.0237 12.5686 13.7978 12.4557 13.3759 12.552C12.8409 12.6749 12.316 12.8377 11.7811 12.9474C10.7478 13.1634 9.71117 13.1833 8.69117 12.861C7.41202 12.459 6.73091 11.532 6.31228 10.3359H9.78094C10.0534 10.3359 10.2727 10.1166 10.2727 9.8442V8.75111C10.2727 8.47866 10.0534 8.25938 9.78094 8.25938H5.98003C5.98003 7.95371 5.97671 7.66134 5.98003 7.36896H9.78094C10.0534 7.36896 10.2727 7.14968 10.2727 6.87723V5.78414C10.2727 5.5117 10.0534 5.29241 9.78094 5.29241H6.45847C6.45847 5.27912 6.45847 5.26583 6.46512 5.25919C6.86381 4.35215 7.44524 3.62453 8.39879 3.24577C9.5085 2.8072 10.6415 2.81717 11.7844 3.05307C12.326 3.16271 12.8576 3.32883 13.3991 3.45176C13.7945 3.54147 14.0237 3.42518 14.1932 3.05639C14.3892 2.63111 14.5686 2.19919 14.748 1.76395C14.9175 1.35528 14.8178 1.06623 14.4324 0.840299C14.3361 0.783817 14.2364 0.737303 14.1334 0.697433C12.532 0.072808 10.8807 -0.159765 9.17625 0.112678C7.97684 0.305381 6.85717 0.717368 5.89033 1.46825C4.67098 2.41183 3.88023 3.65776 3.42173 5.12297L3.36525 5.29241H1.6575C1.38505 5.29241 1.16577 5.5117 1.16577 5.78414V6.87723C1.16577 7.14968 1.38505 7.36896 1.6575 7.36896H3.0031C3.0031 7.66798 3.0031 7.95704 3.0031 8.25938H1.6575C1.38505 8.25938 1.16577 8.47866 1.16577 8.75111V9.8442C1.16577 10.1166 1.38505 10.3359 1.6575 10.3359H3.27886C3.4018 10.7346 3.50479 11.14 3.66095 11.522C4.4816 13.5022 5.8571 14.911 7.927 15.5821C9.63808 16.137 11.3624 16.1204 13.0868 15.6452C13.5353 15.5223 13.9805 15.3628 14.4058 15.1668C14.8178 14.9774 14.9241 14.6585 14.7613 14.2631Z"],["clip-path","url(#clip1)"],["d","M38.7613 14.2631C38.5819 13.8245 38.3992 13.386 38.1998 12.954C38.0237 12.5686 37.7978 12.4557 37.3759 12.552C36.8409 12.6749 36.316 12.8377 35.7811 12.9474C34.7478 13.1634 33.7112 13.1833 32.6912 12.861C31.412 12.459 30.7309 11.532 30.3123 10.3359H33.7809C34.0534 10.3359 34.2727 10.1166 34.2727 9.8442V8.75111C34.2727 8.47866 34.0534 8.25938 33.7809 8.25938H29.98C29.98 7.95371 29.9767 7.66134 29.98 7.36896H33.7809C34.0534 7.36896 34.2727 7.14968 34.2727 6.87723V5.78414C34.2727 5.5117 34.0534 5.29241 33.7809 5.29241H30.4585C30.4585 5.27912 30.4585 5.26583 30.4651 5.25919C30.8638 4.35215 31.4452 3.62453 32.3988 3.24577C33.5085 2.8072 34.6415 2.81717 35.7844 3.05307C36.326 3.16271 36.8576 3.32883 37.3991 3.45176C37.7945 3.54147 38.0237 3.42518 38.1932 3.05639C38.3892 2.63111 38.5686 2.19919 38.748 1.76395C38.9175 1.35528 38.8178 1.06623 38.4324 0.840299C38.3361 0.783817 38.2364 0.737303 38.1334 0.697433C36.532 0.072808 34.8807 -0.159765 33.1763 0.112678C31.9768 0.305381 30.8572 0.717368 29.8903 1.46825C28.671 2.41183 27.8802 3.65776 27.4217 5.12297L27.3652 5.29241H25.6575C25.3851 5.29241 25.1658 5.5117 25.1658 5.78414V6.87723C25.1658 7.14968 25.3851 7.36896 25.6575 7.36896H27.0031C27.0031 7.66798 27.0031 7.95704 27.0031 8.25938H25.6575C25.3851 8.25938 25.1658 8.47866 25.1658 8.75111V9.8442C25.1658 10.1166 25.3851 10.3359 25.6575 10.3359H27.2789C27.4018 10.7346 27.5048 11.14 27.6609 11.522C28.4816 13.5022 29.8571 14.911 31.927 15.5821C33.6381 16.137 35.3624 16.1204 37.0868 15.6452C37.5353 15.5223 37.9805 15.3628 38.4058 15.1668C38.8178 14.9774 38.9241 14.6585 38.7613 14.2631Z","fill","#8C8CA1"],["clip-path","url(#clip2)"],["d","M62.7613 14.2631C62.5819 13.8245 62.3992 13.386 62.1998 12.954C62.0237 12.5686 61.7978 12.4557 61.3759 12.552C60.8409 12.6749 60.316 12.8377 59.7811 12.9474C58.7478 13.1634 57.7112 13.1833 56.6912 12.861C55.412 12.459 54.7309 11.532 54.3123 10.3359H57.7809C58.0534 10.3359 58.2727 10.1166 58.2727 9.8442V8.75111C58.2727 8.47866 58.0534 8.25938 57.7809 8.25938H53.98C53.98 7.95371 53.9767 7.66134 53.98 7.36896H57.7809C58.0534 7.36896 58.2727 7.14968 58.2727 6.87723V5.78414C58.2727 5.5117 58.0534 5.29241 57.7809 5.29241H54.4585C54.4585 5.27912 54.4585 5.26583 54.4651 5.25919C54.8638 4.35215 55.4452 3.62453 56.3988 3.24577C57.5085 2.8072 58.6415 2.81717 59.7844 3.05307C60.326 3.16271 60.8576 3.32883 61.3991 3.45176C61.7945 3.54147 62.0237 3.42518 62.1932 3.05639C62.3892 2.63111 62.5686 2.19919 62.748 1.76395C62.9175 1.35528 62.8178 1.06623 62.4324 0.840299C62.3361 0.783817 62.2364 0.737303 62.1334 0.697433C60.532 0.072808 58.8807 -0.159765 57.1763 0.112678C55.9768 0.305381 54.8572 0.717368 53.8903 1.46825C52.671 2.41183 51.8802 3.65776 51.4217 5.12297L51.3652 5.29241H49.6575C49.3851 5.29241 49.1658 5.5117 49.1658 5.78414V6.87723C49.1658 7.14968 49.3851 7.36896 49.6575 7.36896H51.0031C51.0031 7.66798 51.0031 7.95704 51.0031 8.25938H49.6575C49.3851 8.25938 49.1658 8.47866 49.1658 8.75111V9.8442C49.1658 10.1166 49.3851 10.3359 49.6575 10.3359H51.2789C51.4018 10.7346 51.5048 11.14 51.6609 11.522C52.4816 13.5022 53.8571 14.911 55.927 15.5821C57.6381 16.137 59.3624 16.1204 61.0868 15.6452C61.5353 15.5223 61.9805 15.3628 62.4058 15.1668C62.8178 14.9774 62.9241 14.6585 62.7613 14.2631Z","fill","#8C8CA1"],["id","clip0"],["width","16","height","16","fill","white"],["id","clip1"],["width","16","height","16","fill","white","transform","translate(24)"],["id","clip2"],["width","16","height","16","fill","white","transform","translate(48)"],["d","M38.7613 14.2631C38.5819 13.8245 38.3992 13.386 38.1998 12.954C38.0237 12.5686 37.7978 12.4557 37.3759 12.552C36.8409 12.6749 36.316 12.8377 35.7811 12.9474C34.7478 13.1634 33.7112 13.1833 32.6912 12.861C31.412 12.459 30.7309 11.532 30.3123 10.3359H33.7809C34.0534 10.3359 34.2727 10.1166 34.2727 9.8442V8.75111C34.2727 8.47866 34.0534 8.25938 33.7809 8.25938H29.98C29.98 7.95371 29.9767 7.66134 29.98 7.36896H33.7809C34.0534 7.36896 34.2727 7.14968 34.2727 6.87723V5.78414C34.2727 5.5117 34.0534 5.29241 33.7809 5.29241H30.4585C30.4585 5.27912 30.4585 5.26583 30.4651 5.25919C30.8638 4.35215 31.4452 3.62453 32.3988 3.24577C33.5085 2.8072 34.6415 2.81717 35.7844 3.05307C36.326 3.16271 36.8576 3.32883 37.3991 3.45176C37.7945 3.54147 38.0237 3.42518 38.1932 3.05639C38.3892 2.63111 38.5686 2.19919 38.748 1.76395C38.9175 1.35528 38.8178 1.06623 38.4324 0.840299C38.3361 0.783817 38.2364 0.737303 38.1334 0.697433C36.532 0.072808 34.8807 -0.159765 33.1763 0.112678C31.9768 0.305381 30.8572 0.717368 29.8903 1.46825C28.671 2.41183 27.8802 3.65776 27.4217 5.12297L27.3652 5.29241H25.6575C25.3851 5.29241 25.1658 5.5117 25.1658 5.78414V6.87723C25.1658 7.14968 25.3851 7.36896 25.6575 7.36896H27.0031C27.0031 7.66798 27.0031 7.95704 27.0031 8.25938H25.6575C25.3851 8.25938 25.1658 8.47866 25.1658 8.75111V9.8442C25.1658 10.1166 25.3851 10.3359 25.6575 10.3359H27.2789C27.4018 10.7346 27.5048 11.14 27.6609 11.522C28.4816 13.5022 29.8571 14.911 31.927 15.5821C33.6381 16.137 35.3624 16.1204 37.0868 15.6452C37.5353 15.5223 37.9805 15.3628 38.4058 15.1668C38.8178 14.9774 38.9241 14.6585 38.7613 14.2631Z"],["d","M62.7613 14.2631C62.5819 13.8245 62.3992 13.386 62.1998 12.954C62.0237 12.5686 61.7978 12.4557 61.3759 12.552C60.8409 12.6749 60.316 12.8377 59.7811 12.9474C58.7478 13.1634 57.7112 13.1833 56.6912 12.861C55.412 12.459 54.7309 11.532 54.3123 10.3359H57.7809C58.0534 10.3359 58.2727 10.1166 58.2727 9.8442V8.75111C58.2727 8.47866 58.0534 8.25938 57.7809 8.25938H53.98C53.98 7.95371 53.9767 7.66134 53.98 7.36896H57.7809C58.0534 7.36896 58.2727 7.14968 58.2727 6.87723V5.78414C58.2727 5.5117 58.0534 5.29241 57.7809 5.29241H54.4585C54.4585 5.27912 54.4585 5.26583 54.4651 5.25919C54.8638 4.35215 55.4452 3.62453 56.3988 3.24577C57.5085 2.8072 58.6415 2.81717 59.7844 3.05307C60.326 3.16271 60.8576 3.32883 61.3991 3.45176C61.7945 3.54147 62.0237 3.42518 62.1932 3.05639C62.3892 2.63111 62.5686 2.19919 62.748 1.76395C62.9175 1.35528 62.8178 1.06623 62.4324 0.840299C62.3361 0.783817 62.2364 0.737303 62.1334 0.697433C60.532 0.072808 58.8807 -0.159765 57.1763 0.112678C55.9768 0.305381 54.8572 0.717368 53.8903 1.46825C52.671 2.41183 51.8802 3.65776 51.4217 5.12297L51.3652 5.29241H49.6575C49.3851 5.29241 49.1658 5.5117 49.1658 5.78414V6.87723C49.1658 7.14968 49.3851 7.36896 49.6575 7.36896H51.0031C51.0031 7.66798 51.0031 7.95704 51.0031 8.25938H49.6575C49.3851 8.25938 49.1658 8.47866 49.1658 8.75111V9.8442C49.1658 10.1166 49.3851 10.3359 49.6575 10.3359H51.2789C51.4018 10.7346 51.5048 11.14 51.6609 11.522C52.4816 13.5022 53.8571 14.911 55.927 15.5821C57.6381 16.137 59.3624 16.1204 61.0868 15.6452C61.5353 15.5223 61.9805 15.3628 62.4058 15.1668C62.8178 14.9774 62.9241 14.6585 62.7613 14.2631Z"],["viewBox","0 0 80 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M6.5 12.0623C4.50627 11.6792 3 9.9255 3 7.82C3 5.43415 4.93413 3.5 7.32 3.5C7.7033 3.5 8.0749 3.54991 8.4287 3.6436C9.2199 2.64246 10.4449 2 11.82 2C13.2352 2 14.4914 2.68049 15.2794 3.73211C15.7186 3.58166 16.1898 3.5 16.68 3.5C19.0659 3.5 21 5.43415 21 7.82C21 9.9255 19.4937 11.6792 17.5 12.0623V20C17.5 20.5523 17.0523 21 16.5 21H7.5C6.9477 21 6.5 20.5523 6.5 20V12.0623Z","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M6.5 15.5H17.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M10 12.5V15.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M17.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M6.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["opacity","0.4"],["d","M34.5 12.0623C32.5063 11.6792 31 9.9255 31 7.82C31 5.43415 32.9341 3.5 35.32 3.5C35.7033 3.5 36.0749 3.54991 36.4287 3.6436C37.2199 2.64246 38.4449 2 39.82 2C41.2352 2 42.4914 2.68049 43.2794 3.73211C43.7186 3.58166 44.1898 3.5 44.68 3.5C47.0659 3.5 49 5.43415 49 7.82C49 9.9255 47.4937 11.6792 45.5 12.0623V20C45.5 20.5523 45.0523 21 44.5 21H35.5C34.9477 21 34.5 20.5523 34.5 20V12.0623Z","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M34.5 15.5H45.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M38 12.5V15.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M45.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M34.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M62.5 12.0623C60.5063 11.6792 59 9.9255 59 7.82C59 5.43415 60.9341 3.5 63.32 3.5C63.7033 3.5 64.0749 3.54991 64.4287 3.6436C65.2199 2.64246 66.4449 2 67.82 2C69.2352 2 70.4914 2.68049 71.2794 3.73211C71.7186 3.58166 72.1898 3.5 72.68 3.5C75.0659 3.5 77 5.43415 77 7.82C77 9.9255 75.4937 11.6792 73.5 12.0623V20C73.5 20.5523 73.0523 21 72.5 21H63.5C62.9477 21 62.5 20.5523 62.5 20V12.0623Z","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M62.5 15.5H73.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M66 12.5V15.5","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M73.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M62.5 14V17","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["viewBox","0 0 12 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M4.33333 3.6C4.33333 4.48366 3.58714 5.2 2.66667 5.2C1.74619 5.2 1 4.48366 1 3.6C1 2.71634 1.74619 2 2.66667 2C3.58714 2 4.33333 2.71634 4.33333 3.6Z"],["d","M4.33333 10C4.33333 10.8837 3.58714 11.6 2.66667 11.6C1.74619 11.6 1 10.8837 1 10C1 9.11634 1.74619 8.4 2.66667 8.4C3.58714 8.4 4.33333 9.11634 4.33333 10Z"],["d","M4.33333 16.4C4.33333 17.2837 3.58714 18 2.66667 18C1.74619 18 1 17.2837 1 16.4C1 15.5163 1.74619 14.8 2.66667 14.8C3.58714 14.8 4.33333 15.5163 4.33333 16.4Z"],["d","M11 3.6C11 4.48366 10.2538 5.2 9.33333 5.2C8.41286 5.2 7.66667 4.48366 7.66667 3.6C7.66667 2.71634 8.41286 2 9.33333 2C10.2538 2 11 2.71634 11 3.6Z"],["d","M11 10C11 10.8837 10.2538 11.6 9.33333 11.6C8.41286 11.6 7.66667 10.8837 7.66667 10C7.66667 9.11634 8.41286 8.4 9.33333 8.4C10.2538 8.4 11 9.11634 11 10Z"],["d","M11 16.4C11 17.2837 10.2538 18 9.33333 18C8.41286 18 7.66667 17.2837 7.66667 16.4C7.66667 15.5163 8.41286 14.8 9.33333 14.8C10.2538 14.8 11 15.5163 11 16.4Z"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24"],["d","M0 0h24v24H0V0z","fill","none"],["d","M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"],["viewBox","0 0 16 16","xmlns","http://www.w3.org/2000/svg",1,"bi","bi-arrow-down"],["fill-rule","evenodd","d","M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 16 16"],["d","M12.5 13c.828 0 1.5.672 1.5 1.5s-.672 1.5-1.5 1.5-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm-9 0c.828 0 1.5.672 1.5 1.5S4.328 16 3.5 16 2 15.328 2 14.5 2.672 13 3.5 13zM3 0l.591 2H15c.623 0 1.095.564.984 1.177C15.27 7.14 14.526 9 13 9H4.42c-.377.391-.67.729-.876 1H13c.552 0 1 .448 1 1s-.448 1-1 1H3c-1.28 0-2.11-.83-1.699-2.066.218-.654.813-1.44 1.807-2.454L1.433 2H0V0h3zm10.786 4H4.182l.887 3h7.737c.09-.124.2-.333.315-.621.224-.56.447-1.355.665-2.379z"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/People_grey06.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Trash.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Trash_danger.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Trash_grey05.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Trash_greyText.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Trash_greyTextDark.svg",1,"icon-container__icon",3,"ngStyle"],["fill-rule","evenodd","clip-rule","evenodd","d","M12.8889 4.88889C12.8889 4.39797 12.4909 4 12 4C11.5091 4 11.1111 4.39797 11.1111 4.88889V11.1111H4.88889C4.39797 11.1111 4 11.5091 4 12C4 12.4909 4.39797 12.8889 4.88889 12.8889H11.1111V19.1111C11.1111 19.602 11.5091 20 12 20C12.4909 20 12.8889 19.602 12.8889 19.1111V12.8889H19.1111C19.602 12.8889 20 12.4909 20 12C20 11.5091 19.602 11.1111 19.1111 11.1111H12.8889V4.88889Z"],["d","M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z"],["d","M0 0h24v24H0z","fill","none"],["d","M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.8 4.8z"],["d","M4.41768 3.64119C4.18693 3.41025 3.81256 3.41025 3.58181 3.64119C2.72506 4.49794 2.30397 5.69144 2.42634 6.91587C2.45687 7.22091 2.71384 7.44828 3.01393 7.44828C3.03365 7.44828 3.05353 7.44728 3.07325 7.44531C3.39818 7.41281 3.63522 7.12294 3.60272 6.79822C3.51562 5.92806 3.81278 5.08197 4.41768 4.47703C4.64862 4.24631 4.64862 3.87191 4.41768 3.64119Z"],["d","M6.75863 0C3.03191 0 0 3.03191 0 6.75863C0 10.4853 3.03191 13.5173 6.75863 13.5173C10.4853 13.5173 13.5173 10.4853 13.5173 6.75863C13.5173 3.03191 10.4853 0 6.75863 0ZM6.75863 12.335C3.68375 12.335 1.18228 9.8335 1.18228 6.75863C1.18228 3.68375 3.68375 1.18228 6.75863 1.18228C9.83331 1.18228 12.335 3.68375 12.335 6.75863C12.335 9.8335 9.8335 12.335 6.75863 12.335Z"],["d","M15.8268 14.9909L11.5312 10.6954C11.3002 10.4644 10.9262 10.4644 10.6953 10.6954C10.4644 10.9261 10.4644 11.3005 10.6953 11.5312L14.9909 15.8268C15.1064 15.9423 15.2575 16 15.4088 16C15.5602 16 15.7113 15.9423 15.8268 15.8268C16.0577 15.5961 16.0577 15.2217 15.8268 14.9909Z"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/RecipeBook.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Meal.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Meal_grey06.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/HorizontalDots.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/NoRecipeFound.svg",1,"icon-container__icon",3,"ngStyle"],["d","M15.0661 1.80645H13.0835C12.9121 0.772355 12.0038 -0.0160968 10.9185 0.000258065C9.73275 0.0180968 8.79029 1.00616 8.79029 2.19203V10.2383C8.79029 10.3707 8.73991 10.4986 8.64797 10.5939C8.06733 11.1957 7.74639 11.9984 7.75836 12.8526C7.78297 14.6074 9.24191 16.0241 10.9967 15.9997C13.7939 15.9608 15.1739 12.5853 13.2567 10.5954C13.1643 10.4995 13.1129 10.3715 13.1129 10.2383V9.29032H13.7758C14.0538 9.29032 14.2929 9.07658 14.3058 8.7989C14.3196 8.50248 14.0836 8.25806 13.7903 8.25806H13.1129V6.06452H14.421C14.699 6.06452 14.9381 5.85077 14.951 5.5731C14.9648 5.27668 14.7288 5.03226 14.4355 5.03226H13.1129V2.83871H15.0806C15.374 2.83871 15.61 2.59429 15.5962 2.29787C15.5832 2.02019 15.3441 1.80645 15.0661 1.80645ZM10.8655 13.997C9.78113 13.9205 9.35033 12.5256 10.2305 11.856C10.3592 11.758 10.4355 11.6063 10.4355 11.4445V5.27255C10.4355 4.99455 10.6492 4.75542 10.9269 4.74252C11.2233 4.72871 11.4677 4.96474 11.4677 5.25806V11.438C11.4677 11.6001 11.5402 11.7558 11.6695 11.8536C12.6164 12.569 12.0469 14.0803 10.8655 13.997ZM1.82255 2.83871C1.03991 2.83871 0.403198 2.202 0.403198 1.41935C0.403198 0.63671 1.03991 0 1.82255 0C2.6052 0 3.24191 0.63671 3.24191 1.41935C3.24191 2.202 2.6052 2.83871 1.82255 2.83871ZM1.82255 1.03226C1.6091 1.03226 1.43546 1.2059 1.43546 1.41935C1.43546 1.63281 1.6091 1.80645 1.82255 1.80645C2.036 1.80645 2.20965 1.63281 2.20965 1.41935C2.20965 1.2059 2.036 1.03226 1.82255 1.03226ZM5.41933 7.16129C4.20091 7.16129 3.20965 6.17003 3.20965 4.95161V3.43548C3.20965 2.21706 4.20088 1.22581 5.41933 1.22581C6.08117 1.22581 6.70255 1.51881 7.12423 2.02971C7.30568 2.24955 7.27455 2.57484 7.05471 2.75629C6.83491 2.93774 6.50959 2.90661 6.32813 2.68677C5.62807 1.83855 4.24191 2.33361 4.24191 3.43548V4.95161C4.24191 6.05432 5.62884 6.54794 6.32813 5.70026C6.50959 5.48039 6.83488 5.44919 7.05471 5.63061C7.27459 5.81203 7.30578 6.13732 7.12436 6.35719C6.70278 6.86819 6.0813 7.16129 5.41933 7.16129Z"],["width","16","height","16","fill","none"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Empty.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Starter.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/NotStarter.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Dessert.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/NotDessert.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/MainDish.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/NotMainDish.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Edit.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/CirclePlus.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/CartPlus.svg",1,"icon-container__icon",3,"ngStyle"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_neutralBlack.svg",1,"icon-container__icon",3,"ngStyle"],["viewBox","0 0 18 18","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M16.244 6.79981L9.35632 2.34044C9.26608 2.28143 9.1606 2.25 9.05278 2.25C8.94496 2.25 8.83948 2.28143 8.74924 2.34044L6.14856 4.03425V3.22482C6.14856 3.07574 6.08934 2.93276 5.98393 2.82735C5.87851 2.72193 5.73554 2.66271 5.58646 2.66271H3.33803C3.18956 2.66465 3.04771 2.7245 2.94271 2.82949C2.83771 2.93449 2.77787 3.07634 2.77593 3.22482V6.22272L1.76414 6.90474C1.66004 6.96876 1.58001 7.06536 1.53646 7.17954C1.49292 7.29373 1.48831 7.4191 1.52334 7.53617C1.55838 7.65324 1.6311 7.75547 1.73021 7.82696C1.82932 7.89845 1.94927 7.93521 2.07142 7.93152C2.18072 7.93429 2.28815 7.90285 2.37871 7.84158L2.78342 7.57927V15.5537C2.78536 15.7022 2.84521 15.844 2.95021 15.949C3.0552 16.054 3.19705 16.1138 3.34553 16.1158H14.6626C14.8111 16.1138 14.9529 16.054 15.0579 15.949C15.1629 15.844 15.2228 15.7022 15.2247 15.5537V7.49682L15.6294 7.75914C15.6914 7.79949 15.7608 7.82724 15.8335 7.84079C15.9062 7.85434 15.9809 7.85344 16.0533 7.83813C16.1257 7.82282 16.1943 7.7934 16.2553 7.75155C16.3164 7.70971 16.3685 7.65626 16.4089 7.59425C16.4492 7.53225 16.477 7.4629 16.4905 7.39017C16.5041 7.31744 16.5032 7.24276 16.4879 7.17038C16.4726 7.098 16.4431 7.02935 16.4013 6.96834C16.3594 6.90732 16.306 6.85515 16.244 6.8148V6.79981ZM3.90763 3.78692H5.02435V4.76873L3.90763 5.51821V3.78692ZM10.0683 15.029H7.93981V12.4134H10.0683V15.029ZM14.1005 6.86726V14.9916H11.1925V11.8513C11.1925 11.7022 11.1333 11.5592 11.0279 11.4538C10.9225 11.3484 10.7795 11.2892 10.6304 11.2892H7.3777C7.22862 11.2892 7.08565 11.3484 6.98023 11.4538C6.87482 11.5592 6.8156 11.7022 6.8156 11.8513V14.9916H3.90763V6.84478L5.79631 5.61564C5.87449 5.5885 5.94602 5.54508 6.00616 5.48823L9.07152 3.47964L14.123 6.74735C14.1108 6.78631 14.1033 6.82655 14.1005 6.86726Z"],["viewBox","0 0 18 19","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M5.52217 3.5C4.46029 3.5 3.56734 4.28583 3.29895 5.33963H2.10141C1.94183 5.33891 1.78853 5.40683 1.6756 5.52804C1.56279 5.64939 1.49971 5.81396 1.50024 5.98542C1.50091 6.15617 1.56453 6.31945 1.67734 6.43964C1.79001 6.55984 1.94264 6.62705 2.10144 6.62633H3.29672C3.56323 7.68299 4.4583 8.47228 5.5222 8.47228C6.57538 8.47228 7.463 7.69836 7.73953 6.6578L15.9024 6.62635C16.0614 6.62606 16.2133 6.55785 16.3254 6.43707C16.4374 6.31615 16.5003 6.1523 16.5 5.98168C16.4996 5.8115 16.4366 5.64836 16.3246 5.52801C16.2125 5.40767 16.0608 5.33988 15.9023 5.3396L7.75581 5.37105C7.49785 4.30104 6.59486 3.5 5.52217 3.5ZM5.52217 4.78673C6.14605 4.78673 6.639 5.31521 6.639 5.98542C6.639 6.65577 6.14609 7.18543 5.52217 7.18543C4.89825 7.18543 4.40657 6.65581 4.40657 5.98542C4.40657 5.31503 4.89828 4.78673 5.52217 4.78673ZM10.1544 10.4675C9.07485 10.4675 8.1664 11.2673 7.89842 12.3397H2.10117C1.94212 12.3392 1.78935 12.4065 1.67669 12.5269C1.56389 12.6473 1.5004 12.8111 1.5 12.982C1.49973 13.1531 1.56295 13.3176 1.67589 13.4385C1.78869 13.5596 1.94173 13.6272 2.10119 13.6265H7.89947C8.16824 14.6987 9.07562 15.5 10.1542 15.5C11.2328 15.5 12.1402 14.6987 12.4089 13.6265H15.902C16.0609 13.6262 16.213 13.5581 16.3251 13.4372C16.4371 13.3163 16.4999 13.1526 16.4997 12.982C16.4993 12.8118 16.4363 12.6486 16.3243 12.5283C16.2122 12.4079 16.0605 12.3402 15.902 12.3397H12.4099C12.142 11.2673 11.2339 10.4675 10.1544 10.4675ZM10.1544 11.7542C10.7943 11.7542 11.3005 12.2943 11.3005 12.982C11.3005 13.6696 10.7943 14.2134 10.1544 14.2134C9.51445 14.2134 9.0083 13.6696 9.0083 12.982C9.0083 12.2944 9.51445 11.7542 10.1544 11.7542Z"]],template:function(e,t){if(1&e&&(fo(0,Ub,2,8,"div",0),fo(1,Ly,48,50,"ng-template",null,1,Wc)),2&e){const e=_o(2);bo("ngIf",""!==t.iconOverrideUrl)("ngIfElse",e)}},directives:[Ou,zu,Lu,$u,ju],styles:[".icon-container{display:flex;justify-items:center;align-items:center;margin:auto;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.icon-container svg{display:block;margin-left:auto;margin-right:auto;width:-moz-max-content;width:max-content}.icon-container .icon-container__icon{height:unset}"],encapsulation:2,changeDetection:0}),e})(),jy=(()=>{class e{constructor(e){this.analyticsService=e,this.originTrace={originPath:"",props:{}}}get eventTrace(){return{originPath:this.path,props:Object.assign(Object.assign({},this.originTrace.props),this.props)}}get path(){var e,t;return this.currentPath()?`${null!==(e=this.originTrace.originPath)&&void 0!==e?e:""}/${this.currentPath()}`:null!==(t=this.originTrace.originPath)&&void 0!==t?t:""}get props(){return{}}removeFromOriginPath(e){var t;(null===(t=this.originTrace.originPath)||void 0===t?void 0:t.includes(e))&&(this.originTrace.originPath=this.originTrace.originPath.replace(e,""))}pageview(){this.analyticsService.sendEvent("pageview",this.path,{})}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp))},e.\u0275cmp=He({type:e,selectors:[["ng-component"]],inputs:{originTrace:"originTrace"},decls:0,vars:0,template:function(e,t){},encapsulation:2}),e})();const zy=function(e){return{fill:e}},Ny=function(e){return{active:e}};let Vy=(()=>{class e extends jy{constructor(e,t,i){super(e),this.recipeLikesService=t,this.cdr=i,this.primaryColor="var(--m-color-primary)",this.wasToggled=new Rc,this.icon=Cv,this.subscriptions=[]}ngOnChanges(){this.initRecipeLike()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.recipeLikesService.cleanUnobservedLikesIfNecessary.emit()}currentPath(){return""}initRecipeLike(){this.recipe&&this.subscriptions.push(this.recipeLikesService.getLike(this.recipe.id).subscribe(e=>{this.recipeLike=e,this.cdr.detectChanges()}))}toggleLike(e){Pb(e),this.recipe&&(this.recipeLike.id?(this.recipeLike.toggle(),this.wasToggled.emit(this.recipeLike)):(this.recipeLike.addRelationship(this.recipe,"recipe"),this.recipeLike.isPast=!1),this.recipeLikesService.updateLike(this.recipe.id,this.recipeLike,this.eventTrace),this.cdr.detectChanges())}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(l_),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-like-button"]],inputs:{primaryColor:"primaryColor",recipe:"recipe"},outputs:{wasToggled:"wasToggled"},features:[eo,at],decls:4,vars:9,consts:[[1,"miam-like-button","mealz-ds-button","primary","reverse","square","small",3,"click"],[1,"miam-like-button__icon",3,"ngClass"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Heart.svg","alt","Heart",1,"miam-like-button__icon__empty",3,"ngClass"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/HeartFill.svg","alt","Filled heart",1,"miam-like-button__icon__full",3,"ngClass"]],template:function(e,t){1&e&&(wo(0,"button",0),Ao("click",(function(e){return t.toggleLike(e)})),wo(1,"div",1),Co(2,"img",2),Co(3,"img",3),ko(),ko()),2&e&&(Nr(1),bo("ngClass",bc(3,zy,0==t.recipeLike.isPast)),Nr(1),bo("ngClass",bc(5,Ny,!1!==t.recipeLike.isPast)),Nr(1),bo("ngClass",bc(7,Ny,0==t.recipeLike.isPast)))},directives:[Du],styles:[".miam-like-button{padding:8px;border:none;position:relative}.miam-like-button.mealz-ds-button.primary.reverse.square.small{background-color:var(--mealz-ds-color-background-primary)}.miam-like-button.mealz-ds-button.primary.reverse.square.small:hover:not(.loading):not(.disabled):not([disabled]){background-color:var(--mealz-ds-color-background-primary-hover)}.miam-like-button.mealz-ds-button.primary.reverse.square.small .miam-like-button__icon{position:relative;height:24px;width:24px}.miam-like-button.mealz-ds-button.primary.reverse.square.small .miam-like-button__icon img{position:absolute;top:0;right:0;height:100%;width:100%;opacity:0;transition:opacity .3s ease-in-out}.miam-like-button.mealz-ds-button.primary.reverse.square.small .miam-like-button__icon img.active{opacity:1}"],encapsulation:2,changeDetection:0}),e})(),Hy=(()=>{class e{constructor(e){this.context=e,this.icon=Cv,this.subscriptions=[]}openMealsPlanner(){window.location.href=this.context.mealsPlannerUrl}}return e.\u0275fac=function(t){return new(t||e)(vo(Iv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-meals-planner-link"]],decls:14,vars:1,consts:[[1,"miam-meals-planner-link",3,"click"],[1,"miam-meals-planner-link__gradient"],[1,"miam-meals-planner-link__content"],[1,"miam-meals-planner-link__title"],[1,"miam-meals-planner-link__description"],[1,"miam-meals-planner-link__cta"],[1,"mealz-ds-button","primary","reverse"],["width","24","height","24",3,"iconName"]],template:function(e,t){1&e&&(wo(0,"div",0),Ao("click",(function(){return t.openMealsPlanner()})),Co(1,"div",1),wo(2,"div",2),wo(3,"div",3),wo(4,"span"),Qo(5,"tradof#Je planifie mes repas#"),ko(),ko(),wo(6,"div",4),wo(7,"span"),Qo(8,"tradof#Je renseigne mon budget, le nombre de convives et de repas, et j'obtiens des id\xe9es repas#"),ko(),ko(),ko(),wo(9,"div",5),wo(10,"button",6),wo(11,"span"),Qo(12,"tradof#Planifier#"),ko(),ko(),Co(13,"ng-miam-icon",7),ko(),ko()),2&e&&(Nr(13),bo("iconName",t.icon.ChevronDown))},directives:[$y],styles:[".m-button,.m-button-grey,.m-button-grey.reverse,.m-button-primary,.m-button-primary.reverse,.m-button-secondary,.m-button-secondary.reverse{display:flex;justify-content:center;align-items:center;border-radius:var(--m-button-radius);padding:var(--m-button-padding);cursor:pointer;font-size:var(--m-button-text-size);line-height:var(--m-button-text-height);font-weight:var(--m-button-text-weight);outline:0;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none}.m-button-grey.reverse ng-miam-icon,.m-button-grey ng-miam-icon,.m-button-primary.reverse ng-miam-icon,.m-button-primary ng-miam-icon,.m-button-secondary.reverse ng-miam-icon,.m-button-secondary ng-miam-icon,.m-button ng-miam-icon{padding:0}.m-button-grey ng-miam-icon:last-child,.m-button-primary ng-miam-icon:last-child,.m-button-secondary ng-miam-icon:last-child,.m-button ng-miam-icon:last-child{margin-left:var(--m-button-gap)}.m-button-grey ng-miam-icon:first-child,.m-button-primary ng-miam-icon:first-child,.m-button-secondary ng-miam-icon:first-child,.m-button ng-miam-icon:first-child{margin-right:var(--m-button-gap)}.m-button-grey ng-miam-icon:last-child:first-child,.m-button-primary ng-miam-icon:last-child:first-child,.m-button-secondary ng-miam-icon:last-child:first-child,.m-button ng-miam-icon:last-child:first-child{margin:0}.m-button-primary{color:var(--m-color-white);background-color:var(--m-color-primary);border:1px solid var(--m-color-white)}@media (min-width:1023px){.m-button-primary:hover{color:var(--m-color-primary);background-color:var(--m-color-white);border:1px solid var(--m-color-primary);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-primary:hover ng-miam-icon svg path{fill:var(--m-color-primary)}}.m-button-primary ng-miam-icon svg path{fill:var(--m-color-white)}.m-button-primary:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-primary:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-button-primary.reverse{color:var(--m-color-primary);background-color:var(--m-color-white);border:1px solid var(--m-color-primary)}@media (min-width:1023px){.m-button-primary.reverse:hover{color:var(--m-color-white);background-color:var(--m-color-primary);border:1px solid var(--m-color-white);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-primary.reverse:hover ng-miam-icon svg path{fill:var(--m-color-white)}}.m-button-primary.reverse ng-miam-icon svg path{fill:var(--m-color-primary)}.m-button-primary.reverse:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-primary.reverse:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-button-secondary{color:var(--m-color-white);background-color:var(--m-color-secondary);border:1px solid var(--m-color-white)}@media (min-width:1023px){.m-button-secondary:hover{color:var(--m-color-secondary);background-color:var(--m-color-white);border:1px solid var(--m-color-secondary);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-secondary:hover ng-miam-icon svg path{fill:var(--m-color-secondary)}}.m-button-secondary ng-miam-icon svg path{fill:var(--m-color-white)}.m-button-secondary:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-secondary:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-button-secondary.reverse{color:var(--m-color-secondary);background-color:var(--m-color-white);border:1px solid var(--m-color-secondary)}@media (min-width:1023px){.m-button-secondary.reverse:hover{color:var(--m-color-white);background-color:var(--m-color-secondary);border:1px solid var(--m-color-white);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-secondary.reverse:hover ng-miam-icon svg path{fill:var(--m-color-white)}}.m-button-secondary.reverse ng-miam-icon svg path{fill:var(--m-color-secondary)}.m-button-secondary.reverse:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-secondary.reverse:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-button-grey{color:var(--m-color-grey03);background-color:var(--m-color-white);border:1px solid var(--m-color-grey03)}@media (min-width:1023px){.m-button-grey:hover{color:var(--m-color-white);background-color:var(--m-color-grey03);border:1px solid var(--m-color-white);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-grey:hover ng-miam-icon svg path{fill:var(--m-color-white)}}.m-button-grey ng-miam-icon svg path{fill:var(--m-color-grey03)}.m-button-grey:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-grey:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-button-grey.reverse{color:var(--m-color-white);background-color:var(--m-color-grey03);border:1px solid var(--m-color-white)}@media (min-width:1023px){.m-button-grey.reverse:hover{color:var(--m-color-grey03);background-color:var(--m-color-white);border:1px solid var(--m-color-grey03);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out,fill .3s ease-in-out}.m-button-grey.reverse:hover ng-miam-icon svg path{fill:var(--m-color-grey03)}}.m-button-grey.reverse ng-miam-icon svg path{fill:var(--m-color-white)}.m-button-grey.reverse:disabled{background-color:var(--m-color-grey);color:var(--m-color-grey-text)}.m-button-grey.reverse:disabled ng-miam-icon svg path{fill:var(--m-color-grey-text)}.m-body-typo,.m-h1-typo,.m-input,.m-input>*,.m-small-typo,.m-title-text-input:focus-within .miam-text-input__label,.m-title-text-input input,.m-title-text-input label:not(.miam-text-input__label__top){font-family:Work Sans;font-style:normal;font-weight:500;font-size:var(--m-font-size-medium);line-height:24px;color:var(--m-color-slate)}.m-h1-typo,.m-title-text-input input,.m-title-text-input label:not(.miam-text-input__label__top){font-weight:700;font-size:40px;line-height:48px}.m-small-typo{font-size:var(--m-font-size-small);line-height:16px}.m-input{display:flex;justify-content:space-between;align-items:center;max-width:320px;min-width:200px;border:1px solid var(--m-color-grey06);border-radius:5px;padding:8px 16px;margin-top:16px;outline:none}.m-input:focus-within{border:1px solid var(--m-color-primary)}@media (max-width:1023px){.m-input{padding:8px}}.m-title-text-input .miam-text-input{max-width:565px}.m-default-card{box-shadow:var(--m-shadow-small);background-color:var(--m-color-unpure-white);padding:16px;border-radius:8px}@media (max-width:1023px){.m-default-card{padding:8px;margin-bottom:8px}}.miam-meals-planner-link{display:flex;position:relative;height:var(--m-catalog-card-height);width:var(--m-catalog-card-width);flex-grow:1;background-image:url(https://storage.googleapis.com/assets.miam.tech/generic/meals-planner/background-meals-planner-link.jpeg);background-position:50%;background-size:cover;border-radius:8px;cursor:pointer}.miam-meals-planner-link .miam-meals-planner-link__gradient{display:flex;flex-grow:1;border-radius:8px;background:linear-gradient(180deg,rgba(0,0,0,.5),rgba(0,0,0,.5))}.miam-meals-planner-link .miam-meals-planner-link__content{position:absolute;top:12px;right:12px;left:12px;bottom:12px;display:flex;flex-grow:1;flex-direction:column;justify-content:center;align-items:center;text-align:center;color:#fff}.miam-meals-planner-link .miam-meals-planner-link__content .miam-meals-planner-link__title{font-weight:900;font-size:32px;line-height:120%}.miam-meals-planner-link .miam-meals-planner-link__content .miam-meals-planner-link__description{margin-top:8px;font-weight:500;font-size:16px;line-height:150%}.miam-meals-planner-link .miam-meals-planner-link__cta{position:absolute;width:-moz-fit-content;width:fit-content;left:50%;bottom:12px;transform:translateX(-50%)}.miam-meals-planner-link .miam-meals-planner-link__cta ng-miam-icon{display:none}.miam-meals-planner-link:hover .miam-meals-planner-link__cta .m-button-primary{color:#fff;background-color:var(--m-color-primary);border-color:var(--m-color-primary)}@media (max-width:1023px){.miam-meals-planner-link{height:144px;width:100%;max-width:unset;margin:0}.miam-meals-planner-link .miam-meals-planner-link__content{right:unset;flex-grow:1;max-width:calc(100% - 96px);text-align:left}.miam-meals-planner-link .miam-meals-planner-link__content .miam-meals-planner-link__title{font-weight:900;font-size:20px;line-height:120%}.miam-meals-planner-link .miam-meals-planner-link__content .miam-meals-planner-link__description{display:none}.miam-meals-planner-link .miam-meals-planner-link__cta{bottom:unset;left:unset;right:12px;top:50%;transform:translateY(-50%)}.miam-meals-planner-link .miam-meals-planner-link__cta button{display:none}.miam-meals-planner-link .miam-meals-planner-link__cta ng-miam-icon{display:initial;transform:rotate(-90deg)}.miam-meals-planner-link .miam-meals-planner-link__cta ng-miam-icon .icon-container svg path:last-child{fill:#fff}}"],encapsulation:2}),e})();function Uy(e,t){if(1&e&&(wo(0,"div",13),wo(1,"span"),Qo(2),ko(),ko()),2&e){const e=Fo(2);Nr(2),Yo(e.title)}}function qy(e,t){if(1&e&&(wo(0,"div",14),wo(1,"span"),Qo(2,"Utilizat \xeen "),ko(),wo(3,"span"),Qo(4),ko(),wo(5,"span"),Qo(6," mas\u0103"),ko(),ko()),2&e){const e=Fo(2);Nr(4),Yo(e.recipesCount)}}function Gy(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo(5);Nr(1),Yo(e.cancelButtonText)}}function Wy(e,t){1&e&&Co(0,"div",21)}function Zy(e,t){if(1&e){const e=Io();wo(0,"button",20),Ao("click",(function(){return Rt(e),Fo(4).onCancel()})),fo(1,Gy,2,1,"span",0),fo(2,Wy,1,0,"div",19),ko()}if(2&e){const e=Fo(4);bo("disabled",e.cancelButtonDisabled),Nr(1),bo("ngIf",!e.cancelButtonIsLoading),Nr(1),bo("ngIf",e.cancelButtonIsLoading)}}function Qy(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo(4);Nr(1),Yo(e.confirmButtonText)}}function Yy(e,t){1&e&&Co(0,"div",21)}function Ky(e,t){if(1&e){const e=Io();So(0),wo(1,"div",16),fo(2,Zy,3,3,"button",17),wo(3,"button",18),Ao("click",(function(){return Rt(e),Fo(3).onConfirm()})),fo(4,Qy,2,1,"span",0),fo(5,Yy,1,0,"div",19),ko(),ko(),xo()}if(2&e){const e=Fo(3);Nr(2),bo("ngIf",e.cancelButtonText),Nr(1),bo("disabled",e.confirmButtonDisabled)("ngClass",e.ctaColor),Nr(1),bo("ngIf",!e.confirmButtonIsLoading),Nr(1),bo("ngIf",e.confirmButtonIsLoading)}}function Jy(e,t){if(1&e){const e=Io();So(0),wo(1,"div",22),wo(2,"div",23),wo(3,"div",24),wo(4,"span"),Qo(5),Ec(6,"currency"),ko(),ko(),wo(7,"span",25),Qo(8,"tradof#dans mon panier#"),ko(),ko(),wo(9,"button",26),Ao("click",(function(){return Rt(e),Fo(3).basketTransferService.confirmBasket()})),wo(10,"span"),Qo(11,"tradof#Passer commande#"),ko(),ko(),ko(),xo()}if(2&e){const e=Fo(3);Nr(5),Yo(Pc(6,2,e.totalPrice,e.currencyService.code)),Nr(4),bo("ngClass",e.ctaColor)}}function Xy(e,t){if(1&e&&(So(0),wo(1,"div",27),wo(2,"a",28),wo(3,"button",29),wo(4,"span"),Qo(5,"tradof#Voir mon panier#"),ko(),ko(),ko(),ko(),xo()),2&e){const e=Fo(3);Nr(2),bo("href",e.contextService.retailerCartUrl,Wn),Nr(1),bo("ngClass",e.ctaColor)}}function ew(e,t){if(1&e&&(wo(0,"div",15),fo(1,Ky,6,5,"ng-container",0),fo(2,Jy,12,5,"ng-container",0),fo(3,Xy,6,2,"ng-container",0),ko()),2&e){const e=Fo(2);Nr(1),bo("ngIf",!(e.placeOrderFooter||e.redirectToCartFooter)),Nr(1),bo("ngIf",e.placeOrderFooter&&!e.redirectToCartFooter),Nr(1),bo("ngIf",!e.placeOrderFooter&&e.redirectToCartFooter)}}const tw=function(e,t){return{"with-header":e,"without-header":t}};function iw(e,t){if(1&e){const e=Io();So(0),wo(1,"div",1),wo(2,"div",2),Ao("click",(function(){return Rt(e),Fo().onClose()})),ko(),wo(3,"div",3),wo(4,"div",4),wo(5,"div",5),wo(6,"div",6),fo(7,Uy,3,1,"div",7),fo(8,qy,7,1,"div",8),wo(9,"div",9),Ao("click",(function(){return Rt(e),Fo().onClose()})),ko(),ko(),Lo(10),ko(),wo(11,"div",10),wo(12,"div",11),Lo(13,1),ko(),ko(),fo(14,ew,4,3,"div",12),ko(),ko(),ko(),xo()}if(2&e){const e=Fo();Nr(1),bo("ngClass",e.modalStyle),Nr(2),bo("ngClass",yc(5,tw,!e.noHeaderMode,e.noHeaderMode)),Nr(4),bo("ngIf",e.title),Nr(1),bo("ngIf",!e.title&&e.recipesCount),Nr(6),bo("ngIf",e.cancelButtonText||e.confirmButtonText||e.placeOrderFooter||e.redirectToCartFooter)}}const nw=[[["","header",""]],"*"],rw=["[header]","*"];let sw=(()=>{class e{constructor(e,t,i){this.contextService=e,this.basketTransferService=t,this.currencyService=i,this.modalStyle="center",this.ctaColor="primary",this.close=new Rc,this.cancel=new Rc,this.confirm=new Rc,this.icon=Cv,this.currentPath=""}set display(e){this._display=e;const t=this.contextService.defaultScrollElementGetter();e?null==t||t.classList.add("miam-no-scroll"):null==t||t.classList.remove("miam-no-scroll")}get display(){return this._display}ngOnInit(){this.observeNavigation()}ngOnDestroy(){this.mutationObserver.disconnect()}onEscapeDown(){this.display&&this.onClose()}onClose(){this.close.emit()}onCancel(){this.cancel.emit()}onConfirm(){this.confirm.emit()}observeNavigation(){this.currentPath=window.location.href,this.mutationObserver=new MutationObserver(()=>{this.currentPath.split("?")[0]!==window.location.href.split("?")[0]&&(this.currentPath=window.location.href,this.display&&this.onClose())}),this.mutationObserver.observe(document.body,{childList:!0})}}return e.\u0275fac=function(t){return new(t||e)(vo(Iv),vo(H_),vo(b_))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-modal"]],hostBindings:function(e,t){1&e&&Ao("keydown.escape",(function(){return t.onEscapeDown()}),!1,tr)},inputs:{recipesCount:"recipesCount",confirmButtonIsLoading:"confirmButtonIsLoading",cancelButtonIsLoading:"cancelButtonIsLoading",confirmButtonDisabled:"confirmButtonDisabled",cancelButtonDisabled:"cancelButtonDisabled",placeOrderFooter:"placeOrderFooter",redirectToCartFooter:"redirectToCartFooter",noHeaderMode:"noHeaderMode",totalPrice:"totalPrice",title:"title",confirmButtonText:"confirmButtonText",cancelButtonText:"cancelButtonText",modalStyle:"modalStyle",ctaColor:"ctaColor",display:"display"},outputs:{close:"close",cancel:"cancel",confirm:"confirm"},ngContentSelectors:rw,decls:1,vars:1,consts:[[4,"ngIf"],[1,"miam-modal__container",3,"ngClass"],[1,"miam-shadow-overlay",3,"click"],[1,"miam-modal","mealz-ds-text",3,"ngClass"],[1,"miam-modal__content-container"],[1,"miam-modal__header-container"],[1,"miam-modal__header"],["class","miam-modal__title mealz-ds-text size-xl weight-xxl",4,"ngIf"],["class","miam-modal__title mealz-ds-text",4,"ngIf"],[1,"miam-modal__close-icon","mealz-ds-button","ghost",3,"click"],[1,"miam-modal__content__scroll-protection"],[1,"miam-modal__content","mealz-ds-text"],["class","miam-modal__actions",4,"ngIf"],[1,"miam-modal__title","mealz-ds-text","size-xl","weight-xxl"],[1,"miam-modal__title","mealz-ds-text"],[1,"miam-modal__actions"],[1,"miam-modal__interactions"],["class","mealz-ds-button secondary",3,"disabled","click",4,"ngIf"],[1,"mealz-ds-button",3,"disabled","ngClass","click"],["class","mealz-ds-loader",4,"ngIf"],[1,"mealz-ds-button","secondary",3,"disabled","click"],[1,"mealz-ds-loader"],[1,"miam-modal__place-order"],[1,"miam-modal__place-order-price"],[1,"miam-modal__total-price","mealz-ds-text","size-l","weight-xxl"],[1,"miam-modal__total-price-label","mealz-ds-text","size-s"],[1,"miam-modal__place-order-cta","mealz-ds-button",3,"ngClass","click"],[1,"miam-modal__redirect-to-cart"],[3,"href"],[1,"miam-modal__redirect-to-cart-cta","mealz-ds-button",3,"ngClass"]],template:function(e,t){1&e&&(Mo(nw),fo(0,iw,15,8,"ng-container",0)),2&e&&bo("ngIf",t.display)},directives:[Ou,Du],pipes:[Ku],styles:[".miam-no-scroll{overflow:hidden}.miam-modal__container .miam-shadow-overlay{position:fixed;background:var(--mealz-ds-color-neutral-black);animation-name:show;animation-duration:.3s;opacity:.6;animation-timing-function:ease-in-out;z-index:var(--m-z-index-modal-overlay);top:0;left:0;width:100vw;height:100dvh;-webkit-tap-highlight-color:transparent}@keyframes show{0%{opacity:0}to{opacity:.6}}.miam-modal__container .miam-modal{z-index:var(--m-z-index-modal);position:fixed;overflow:hidden;background-color:var(--mealz-ds-color-background-primary);display:flex;flex-direction:column}@media print{.miam-modal__container .miam-modal{overflow-y:unset!important;position:unset!important;height:unset!important}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__close-icon{display:none}}.miam-modal__container .miam-modal.with-header .miam-modal__content-container .miam-modal__content{margin-top:24px;margin-bottom:24px}.miam-modal__container .miam-modal.without-header .miam-modal__content-container .miam-modal__header .miam-modal__title{display:none}.miam-modal__container .miam-modal.without-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{position:absolute;top:0;right:0;z-index:var(--m-z-index-position-absolute-high)}.miam-modal__container .miam-modal .miam-modal__content-container{position:relative;height:100%;display:flex;flex-direction:column;overflow:hidden}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__header{display:flex;flex-direction:row;justify-content:space-between}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__header .miam-modal__title{font-weight:900;overflow:hidden;text-overflow:ellipsis;align-self:center}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{margin:8px;padding:16px;background:50%/24px no-repeat url(https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg)}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__content__scroll-protection{overflow:hidden;height:100%;display:flex}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__content{width:100%;overflow-y:auto;overflow-x:hidden;scrollbar-color:var(--mealz-ds-color-primary-100),var(--mealz-ds-color-primary)}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__interactions{display:flex;justify-content:flex-end;flex-direction:row}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__interactions button+button{margin-left:12px}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__place-order{display:flex;justify-content:space-between;align-items:center}.miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__place-order .miam-modal__place-order-price{display:flex;flex-direction:column}.miam-modal__container.center .miam-modal{height:auto;min-width:464px;width:600px;max-width:700px;max-height:96dvh;box-sizing:border-box;top:50%;left:50%;right:unset;transform:translate(-50%,-50%);border-radius:8px;background-color:var(--mealz-ds-color-neutral-white);padding:24px}.miam-modal__container.right>.miam-modal{right:0;animation-name:openRightDrawer}@keyframes openRightDrawer{0%{right:-1200px}to{right:0}}.miam-modal__container.left>.miam-modal{left:0;animation-name:openLeftDrawer}@keyframes openLeftDrawer{0%{left:-1200px}to{left:0}}.miam-modal__container.left>.miam-modal,.miam-modal__container.right>.miam-modal{animation-duration:.5s;animation-timing-function:cubic-bezier(.75,0,.2,1);height:100%;width:1000px;top:0}.miam-modal__container.left>.miam-modal>.miam-modal__content-container,.miam-modal__container.right>.miam-modal>.miam-modal__content-container{height:100%;box-sizing:border-box}.miam-modal__container.left>.miam-modal>.miam-modal__content-container .miam-modal__content,.miam-modal__container.right>.miam-modal>.miam-modal__content-container .miam-modal__content{height:100%;box-sizing:border-box;margin:unset}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions{border-top:1px solid var(--mealz-ds-color-border)}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions{padding:24px}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order{padding:18px}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order .miam-modal__total-price,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order .miam-modal__total-price{color:var(--mealz-ds-color-primary,#24748f)}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order .miam-modal__total-price-label,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__place-order .miam-modal__total-price-label{color:var(--mealz-ds-color-neutral-400,#8c96a2)}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart{padding:12px 16px;display:flex;flex-direction:row;justify-content:center}.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a{color:var(--mealz-ds-color-neutral-white,#fff);text-decoration:none}@media (max-width:1023px){.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a .mealz-ds-button,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__redirect-to-cart a .mealz-ds-button{width:100%}}.miam-modal__container.left>.miam-modal.with-header .miam-modal__content-container .miam-modal__header,.miam-modal__container.right>.miam-modal.with-header .miam-modal__content-container .miam-modal__header{border-bottom:1px solid var(--mealz-ds-color-border);padding:24px}.miam-modal__container.left>.miam-modal.with-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon,.miam-modal__container.right>.miam-modal.with-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{margin:unset}.miam-modal__container.left>.miam-modal.with-header .miam-modal__content-container .miam-modal__content,.miam-modal__container.right>.miam-modal.with-header .miam-modal__content-container .miam-modal__content{padding:16px}.miam-modal__container.left>.miam-modal.without-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon,.miam-modal__container.right>.miam-modal.without-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{margin:24px}.miam-modal__container.left.small-width .miam-modal,.miam-modal__container.right.small-width .miam-modal{min-width:680px;max-width:680px}.miam-modal__container.left.tiny-width .miam-modal,.miam-modal__container.right.tiny-width .miam-modal{min-width:360px;max-width:360px}@media (max-width:1023px){.miam-modal__container.center .miam-modal{min-width:60vw;padding:unset;max-width:calc(100vw - 48px)}.miam-modal__container.center .miam-modal.with-header .miam-modal__content-container .miam-modal__header{border-bottom:1px solid var(--mealz-ds-color-border);padding:24px}.miam-modal__container.center .miam-modal.with-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{margin:unset}.miam-modal__container.center .miam-modal.without-header .miam-modal__content-container .miam-modal__header .miam-modal__close-icon{margin:24px}.miam-modal__container.center .miam-modal .miam-modal__content-container .miam-modal__content{box-sizing:border-box;height:100%;margin:unset;padding:24px}.miam-modal__container.center .miam-modal .miam-modal__content-container .miam-modal__actions{border-top:1px solid var(--mealz-ds-color-border)}.miam-modal__container.center .miam-modal .miam-modal__content-container .miam-modal__actions .miam-modal__interactions{justify-content:center;padding:16px 8px}.miam-modal__container.left.small-width>.miam-modal,.miam-modal__container.left.tiny-width>.miam-modal,.miam-modal__container.left>.miam-modal,.miam-modal__container.right.small-width>.miam-modal,.miam-modal__container.right.tiny-width>.miam-modal,.miam-modal__container.right>.miam-modal{max-width:100vw;max-height:100dvh;width:100vw;height:100dvh;top:0;bottom:0;right:0;animation-name:openBottomSheet;animation-duration:.5s;animation-timing-function:cubic-bezier(.075,.82,.165,1)}@keyframes openBottomSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}.miam-modal__container.left.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.left.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.right.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.right.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions{flex-direction:column-reverse}.miam-modal__container.left.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.left.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.right.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.right.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .miam-modal__interactions{justify-content:center;padding:24px 8px}.miam-modal__container.left.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary,.miam-modal__container.left.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary,.miam-modal__container.right.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary,.miam-modal__container.right.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.primary{background-color:var(--mealz-ds-color-primary)}.miam-modal__container.left.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary,.miam-modal__container.left.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary,.miam-modal__container.right.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary,.miam-modal__container.right.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button:hover.secondary{background-color:transparent}.miam-modal__container.left.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button,.miam-modal__container.left.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button,.miam-modal__container.left>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button,.miam-modal__container.right.small-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button,.miam-modal__container.right.tiny-width>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button,.miam-modal__container.right>.miam-modal>.miam-modal__content-container>.miam-modal__actions .mealz-ds-button+button{margin-left:unset;margin-bottom:12px}}"],encapsulation:2,changeDetection:0}),e})();const ow=[[["ng-miam-accordion-title"]],[["ng-miam-accordion-content"]]],aw=["ng-miam-accordion-title","ng-miam-accordion-content"];let cw=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Qe({type:e,selectors:[["ng-miam-accordion-title"],["","ng-miam-accordion-title",""]]}),e})(),lw=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=Qe({type:e,selectors:[["ng-miam-accordion-content"],["","ng-miam-accordion-content",""]]}),e})(),uw=(()=>{class e{constructor(e){this.cdr=e,this.isCollapsed=!0,this.isCollapsedChange=new Rc,this.icon=Cv}get opened(){return!this.isCollapsed}ngOnInit(){}swapState(){this.isCollapsed=!this.isCollapsed,this.isCollapsedChange.emit(this.isCollapsed),this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-accordion"]],hostVars:2,hostBindings:function(e,t){2&e&&Ho("opened",t.opened)},inputs:{isCollapsed:"isCollapsed"},outputs:{isCollapsedChange:"isCollapsedChange"},ngContentSelectors:aw,decls:6,vars:0,consts:[[1,"miam-accordion__header",3,"click"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/chevron-down-primary.svg","alt","open and close icon",1,"miam-accordion__icon"],[1,"miam-accordion__collapsable-container"],[1,"miam-accordion__collapsable-content"]],template:function(e,t){1&e&&(Mo(ow),wo(0,"div",0),Ao("click",(function(){return t.swapState()})),Lo(1),Co(2,"img",1),ko(),wo(3,"div",2),wo(4,"div",3),Lo(5,1),ko(),ko())},styles:[".miam-accordion__header{display:flex;justify-content:space-between;align-items:center;padding:12px 8px}.miam-accordion__header:hover{cursor:pointer}.miam-accordion__icon{height:12px;width:12px;margin:6px;transition:all .3s ease;transform:rotate(0deg)}.miam-accordion__collapsable-container{overflow:hidden;transition:all .3s;border-bottom:1px solid var(--mealz-ds-color-neutral-200,#d9dde1)}.miam-accordion__collapsable-container .miam-accordion__collapsable-content{transition:all .3s ease;max-height:0}.opened .miam-accordion__icon{transform:rotate(180deg)}.opened .miam-accordion__collapsable-container{border-bottom:0}.opened .miam-accordion__collapsable-container .miam-accordion__collapsable-content{max-height:200vh}"],encapsulation:2,changeDetection:0}),e})();function dw(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo().$implicit;Nr(1),Yo(e.text)}}function hw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai pu\u021bin de 15 minute"),ko())}function pw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai pu\u021bin de 30 de minute"),ko())}function mw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai pu\u021bin de 1 or\u0103"),ko())}function gw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai pu\u021bin de 2 or\u0103"),ko())}function fw(e,t){if(1&e){const e=Io();wo(0,"div",13),wo(1,"input",14),Ao("ngModelChange",(function(){return Rt(e),Fo(2).uncheckFiltersOnChange("time")}))("ngModelChange",(function(e){return t.$implicit.value=e}))("ngModelChange",(function(){return Rt(e),Fo(2).filtersChanged()})),ko(),fo(2,dw,2,1,"span",4),fo(3,hw,2,0,"span",4),fo(4,pw,2,0,"span",4),fo(5,mw,2,0,"span",4),fo(6,gw,2,0,"span",4),ko()}if(2&e){const e=t.$implicit;Nr(1),bo("ngModel",e.value),Nr(1),bo("ngIf",e.text),Nr(1),bo("ngIf",!e.text&&"15"===e.name),Nr(1),bo("ngIf",!e.text&&"30"===e.name),Nr(1),bo("ngIf",!e.text&&"60"===e.name),Nr(1),bo("ngIf",!e.text&&"120"===e.name)}}function _w(e,t){if(1&e){const e=Io();wo(0,"div",8),wo(1,"ng-miam-accordion",9),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(2,"ng-miam-accordion-title"),wo(3,"div",10),wo(4,"span"),Qo(5,"tradof#Temps de pr\xe9paration#"),ko(),ko(),ko(),wo(6,"ng-miam-accordion-content"),fo(7,fw,7,6,"div",11),Co(8,"div",12),ko(),ko(),ko()}if(2&e){const e=Fo();Nr(1),bo("isCollapsed",!1),Nr(6),bo("ngForOf",e.filters.time)}}function vw(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo().$implicit;Nr(1),Yo(e.text)}}function bw(e,t){1&e&&(wo(0,"span"),Qo(1,"Buc\u0103tar \xeencep\u0103tor"),ko())}function yw(e,t){1&e&&(wo(0,"span"),Qo(1,"Buc\u0103tar intermediar"),ko())}function ww(e,t){1&e&&(wo(0,"span"),Qo(1,"Buc\u0103tar de top"),ko())}function kw(e,t){if(1&e){const e=Io();wo(0,"div",16),wo(1,"input",14),Ao("ngModelChange",(function(e){return t.$implicit.value=e}))("ngModelChange",(function(){return Rt(e),Fo(2).filtersChanged()})),ko(),fo(2,vw,2,1,"span",4),fo(3,bw,2,0,"span",4),fo(4,yw,2,0,"span",4),fo(5,ww,2,0,"span",4),ko()}if(2&e){const e=t.$implicit;Nr(1),bo("ngModel",e.value),Nr(1),bo("ngIf",e.text),Nr(1),bo("ngIf",!e.text&&"1"===e.name),Nr(1),bo("ngIf",!e.text&&"2"===e.name),Nr(1),bo("ngIf",!e.text&&"3"===e.name)}}function Cw(e,t){if(1&e){const e=Io();wo(0,"div",8),wo(1,"ng-miam-accordion",9),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(2,"ng-miam-accordion-title"),wo(3,"div",10),wo(4,"span"),Qo(5,"Dificultate"),ko(),ko(),ko(),wo(6,"ng-miam-accordion-content"),fo(7,kw,6,5,"div",15),Co(8,"div",12),ko(),ko(),ko()}if(2&e){const e=Fo();Nr(1),bo("isCollapsed",!1),Nr(6),bo("ngForOf",e.filters.difficulty)}}function Sw(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo().$implicit;Nr(1),Yo(e.text)}}function xw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai pu\u021bin de 5 EUR"),ko())}function Ew(e,t){1&e&&(wo(0,"span"),Qo(1,"\xcentre 5 EUR \u0219i 10 EUR"),ko())}function Iw(e,t){1&e&&(wo(0,"span"),Qo(1,"Mai mult de 10 EUR"),ko())}function Pw(e,t){if(1&e){const e=Io();wo(0,"div",13),wo(1,"input",14),Ao("ngModelChange",(function(){return Rt(e),Fo(2).uncheckFiltersOnChange("cost")}))("ngModelChange",(function(e){return t.$implicit.value=e}))("ngModelChange",(function(){return Rt(e),Fo(2).filtersChanged()})),ko(),fo(2,Sw,2,1,"span",4),fo(3,xw,2,0,"span",4),fo(4,Ew,2,0,"span",4),fo(5,Iw,2,0,"span",4),ko()}if(2&e){const e=t.$implicit;Nr(1),bo("ngModel",e.value),Nr(1),bo("ngIf",e.text),Nr(1),bo("ngIf",!e.text&&"0-5"===e.name),Nr(1),bo("ngIf",!e.text&&"5-10"===e.name),Nr(1),bo("ngIf",!e.text&&"10-1000"===e.name)}}function Dw(e,t){if(1&e){const e=Io();wo(0,"div",8),wo(1,"ng-miam-accordion",9),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(2,"ng-miam-accordion-title"),wo(3,"div",10),wo(4,"span"),Qo(5,"Cost pe persoan\u0103"),ko(),ko(),ko(),wo(6,"ng-miam-accordion-content"),fo(7,Pw,6,5,"div",11),ko(),ko(),ko()}if(2&e){const e=Fo();Nr(1),bo("isCollapsed",!1),Nr(6),bo("ngForOf",e.filters.cost)}}function Tw(e,t){if(1&e){const e=Io();wo(0,"div"),Co(1,"div",12),wo(2,"div",17),wo(3,"div",10),wo(4,"span"),Qo(5,"Preferin\u021be"),ko(),ko(),wo(6,"div",16),wo(7,"input",14),Ao("ngModelChange",(function(t){return Rt(e),Fo().updateUserPreference("has_children",t)})),ko(),wo(8,"span"),Qo(9,"Am copii"),ko(),ko(),ko(),ko()}if(2&e){const e=Fo();Nr(7),bo("ngModel",e.hasChildren)}}const Aw=function(e){return{"some-filters-set":e}};let Rw=(()=>{class e{constructor(e,t,i,n,r){this.cdr=e,this.mediaMatcher=t,this.usersService=i,this.context=n,this.recipesService=r,this.isFilterCollapsed=!0,this.position="right",this.modifiedGuests=null,this.excludedRecipesIds=[],this.filterChanged=new Rc,this.filterCollapsed=new Rc,this.preferencesChanged=new Rc,this.icon=Cv,this.filtersToDisplay=[],this.isMobile=!1,this.isLogged=!1,this.hasChildren=!1,this.subscriptions=[],this.isMobile=t.matchMedia("(max-width: 607px)").matches}ngOnInit(){this.setUserObservables()}ngOnChanges(e){(e.filters||e.filterToRemove||e.isFilterCollapsed||e.position)&&(this.filterToRemove&&this.removeFilter(this.filterToRemove),this.recalculateRecipesCount(),this.cdr.detectChanges())}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}filtersChanged(){this.recalculateRecipesCount()}reset(){var e,t,i;null===(e=this.filters.time)||void 0===e||e.forEach(e=>e.value=!1),null===(t=this.filters.cost)||void 0===t||t.forEach(e=>e.value=!1),null===(i=this.filters.difficulty)||void 0===i||i.forEach(e=>e.value=!1),this.recalculateRecipesCount()}confirm(){this.toggleFilter(),this.filterChanged.emit(this.filters)}buildFiltersArray(){let e=[];return e=[...e,...this.getSelectedFilters(this.filters.cost),...this.getSelectedFilters(this.filters.difficulty),...this.getSelectedFilters(this.filters.time)],this.filters.additionalFilters&&""!==this.filters.additionalFilters.title&&(e=[this.filters.additionalFilters.title].concat(e)),e}getSelectedFilters(e){return null==e?void 0:e.filter(e=>e.value).map(e=>e.text)}removeFilter(e){var t;if(e===(null===(t=this.filters.additionalFilters)||void 0===t?void 0:t.title))this.filters.additionalFilters=void 0;else for(const i in this.filters)if(this.filters.hasOwnProperty(i)&&"additionalFilters"!==i)for(const t of this.filters[i])t.text===e&&(t.value=!1);this.filtersChanged(),this.cdr.detectChanges()}uncheckFiltersOnChange(e){this.filters[e].forEach(e=>e.value=!1),this.cdr.detectChanges()}toggleFilter(){this.isFilterCollapsed=!this.isFilterCollapsed,this.cdr.detectChanges(),this.filterCollapsed.emit()}updateUserPreference(e,t){this.subscriptions.push(this.usersService.setPreference(e,t).subscribe(()=>this.preferencesChanged.emit()))}areSomeFiltersSet(){var e,t,i;return(null===(e=this.filters.difficulty)||void 0===e?void 0:e.some(e=>e.value))||(null===(t=this.filters.cost)||void 0===t?void 0:t.some(e=>e.value))||(null===(i=this.filters.time)||void 0===i?void 0:i.some(e=>e.value))}setUserObservables(){this.subscriptions.push(this.usersService.isLogged$.subscribe(e=>{this.isLogged=e,this.cdr.detectChanges()})),this.subscriptions.push(this.usersService.hasPreference("has_children").subscribe(e=>{this.hasChildren=e,this.cdr.detectChanges()}))}recalculateRecipesCount(){this.subscriptions.push(this.recipesService.addMandatoryCompletionToFilter(this.filters).pipe(th(e=>this.recipesService.filterCount(e,this.modifiedGuests,this.excludedRecipesIds)),df(e=>{this.recipesCount=e,this.cdr.detectChanges()})).subscribe())}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga),vo(ov),vo(Yf),vo(Iv),vo(__))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-filters"]],inputs:{filters:"filters",filterToRemove:"filterToRemove",isFilterCollapsed:"isFilterCollapsed",position:"position",modifiedGuests:"modifiedGuests",excludedRecipesIds:"excludedRecipesIds"},outputs:{filterChanged:"filterChanged",filterCollapsed:"filterCollapsed",preferencesChanged:"preferencesChanged"},features:[at],decls:19,vars:12,consts:[["title","tradof#Filtres#",1,"miam-recipe-filters",3,"modalStyle","display","ngClass","close"],[1,"miam-recipe-filters__content"],[1,"miam-recipe-filters__container"],["class","miam-recipe-filter__container",4,"ngIf"],[4,"ngIf"],[1,"miam-recipe-filters__ctas"],[1,"miam-recipe-filters__remove","mealz-ds-button","ghost",3,"click"],[1,"miam-recipe-filters__confirm","mealz-ds-button","primary",3,"click"],[1,"miam-recipe-filter__container"],[3,"isCollapsed","isCollapsedChange"],[1,"miam-recipe-filters__title"],["class","miam-recipe-filters__choice miam-recipe-filters__radio-input",4,"ngFor","ngForOf"],[1,"miam-recipe-filters__separator"],[1,"miam-recipe-filters__choice","miam-recipe-filters__radio-input"],["type","checkbox",3,"ngModel","ngModelChange"],["class","miam-recipe-filters__choice mealz-ds-checkbox",4,"ngFor","ngForOf"],[1,"miam-recipe-filters__choice","mealz-ds-checkbox"],[1,"miam-recipe-filters__preferences"]],template:function(e,t){1&e&&(wo(0,"ng-miam-modal",0),Ao("close",(function(){return t.toggleFilter()})),wo(1,"div",1),wo(2,"div",2),fo(3,_w,9,2,"div",3),fo(4,Cw,9,2,"div",3),fo(5,Dw,8,2,"div",3),fo(6,Tw,10,1,"div",4),Ec(7,"async"),ko(),wo(8,"div",5),wo(9,"button",6),Ao("click",(function(){return t.reset()})),wo(10,"span"),Qo(11,"tradof#R\xe9initialiser#"),ko(),ko(),wo(12,"button",7),Ao("click",(function(){return t.confirm()})),wo(13,"span"),Qo(14,"tradof#Voir# "),ko(),wo(15,"span"),Qo(16),ko(),wo(17,"span"),Qo(18,"tradof#recettes#"),ko(),ko(),ko(),ko(),ko()),2&e&&($o("modalStyle",t.position),bo("display",!t.isFilterCollapsed)("ngClass",bc(10,Aw,t.areSomeFiltersSet())),Nr(3),bo("ngIf",t.filters.time),Nr(1),bo("ngIf",t.filters.difficulty),Nr(1),bo("ngIf",t.filters.cost),Nr(1),bo("ngIf",t.isLogged&&Ic(7,8,t.usersService.preferencesActivated$)),Nr(10),Yo(void 0!==t.recipesCount?t.recipesCount+" ":""))},directives:[sw,Du,Ou,uw,cw,lw,Au,Hv,ab,kb],pipes:[Wu],styles:['ng-miam-recipe-filters .miam-modal__container.left .miam-modal,ng-miam-recipe-filters .miam-modal__container.right .miam-modal{width:480px}.miam-accordion__collapsable-container{border-bottom:none}.miam-recipe-filters{display:flex;flex-direction:column;justify-content:flex-start;background-color:var(--m-color-white);box-shadow:0 8px 28px 0 rgba(0,0,0,.07058823529411765)}.miam-recipe-filters .mealz-ds-checkbox{height:unset;padding:unset}.miam-recipe-filters .miam-recipe-filters__radio-input input{margin:0 8px 0 0;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:20px;height:20px;border:1px solid var(--mealz-ds-color-border);border-radius:50%;display:flex;justify-content:center;align-items:center;cursor:pointer}.miam-recipe-filters .miam-recipe-filters__radio-input input:before{content:"";background-color:transparent;border-radius:50%;width:12px;height:12px;transform:scale(0);transition:transform .12s ease-in-out}.miam-recipe-filters .miam-recipe-filters__radio-input input:checked{background-color:#fff;border:1px solid var(--mealz-ds-color-primary)}.miam-recipe-filters .miam-recipe-filters__radio-input input:checked:before{transform:scale(1);background-color:var(--mealz-ds-color-primary)}.miam-recipe-filters.right{left:unset;right:-1px;border-right:0;border-left:1px solid #ccc;box-shadow:0 -8px 28px 0 rgba(0,0,0,.07058823529411765)}.miam-recipe-filters .miam-recipe-filters__content{overflow-y:auto;height:-moz-fit-content;height:fit-content;padding-bottom:80px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__head{font-size:21px;line-height:24px;color:var(--m-color-primary);font-weight:700;margin-bottom:48px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container{transition:opacity .25s cubic-bezier(0,0,.2,1);opacity:1}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filter__container{margin-bottom:24px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filter__details{position:sticky;top:0;display:flex;flex-flow:row wrap;align-items:center;min-height:10vh;background-color:var(--m-color-grey);width:100%;margin-bottom:24px;padding-top:8px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filter__details .miam-recipe-filter__detail__title{padding:0 24px;margin-bottom:16px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filter__details .miam-recipe-filter__detail{display:flex;align-items:center;margin:0 0 16px 8px;padding:8px 16px;border:1px solid var(--m-color-primary);border-radius:4px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filter__details .miam-recipe-filter__detail .miam-recipe-filter__detail__icon .icon-container{margin:0 0 0 16px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filters__title{margin-bottom:16px;font-weight:700;font-size:16px;line-height:20px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filters__choice{margin-bottom:16px;display:flex;font-size:16px;line-height:20px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filters__choice:first-letter{text-transform:capitalize}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filters__choice input{height:20px;width:20px;margin:0 12px 0 0;cursor:pointer}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__container .miam-recipe-filters__separator{width:100%;height:1px;background-color:#e9e9e9;margin-top:24px}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas{position:absolute;bottom:0;left:0;right:0;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px;border-top:1px solid var(--mealz-ds-color-neutral-200);background-color:var(--m-color-white)}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas>:not(:last-child){margin-right:24px}@media (max-width:450px){.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas{flex-direction:column-reverse}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas>:not(:last-child){margin-top:8px;margin-right:0}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas .mealz-ds-button{width:100%}}.miam-recipe-filters .miam-recipe-filters__content .miam-recipe-filters__ctas .miam-recipe-filters__confirm span{white-space:pre}'],encapsulation:2,changeDetection:0}),e})(),Ow=(()=>{class e{constructor(e,t,i){this.el=e,this.contextService=t,this.posService=i}ngOnInit(){this.listenToSelectPosButton()}ngOnDestroy(){var e;null===(e=this.subscription)||void 0===e||e.unsubscribe()}listenToSelectPosButton(){this.contextService.noSupplier&&(this.subscription=this.posService.pos$.subscribe(e=>{e?this.el.nativeElement.classList.remove("selectPos"):this.el.nativeElement.classList.add("selectPos")}))}}return e.\u0275fac=function(t){return new(t||e)(vo(wa),vo(Iv),vo(Vf))},e.\u0275dir=Qe({type:e,selectors:[["","ngMiamSelectPosButton",""]]}),e})();function Fw(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#/personne#"),ko())}function Bw(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo(4);Nr(1),Yo(e.guestsText)}}function Mw(e,t){if(1&e&&(wo(0,"div",11),fo(1,Fw,2,0,"span",12),fo(2,Bw,2,1,"span",12),ko()),2&e){const e=Fo(3);Nr(1),bo("ngIf","par-personne"===e.guestsText),Nr(1),bo("ngIf","par-personne"!==e.guestsText)}}function Lw(e,t){1&e&&(wo(0,"div",13),Qo(1,"tradof#/pers.#"),ko())}function $w(e,t){if(1&e&&(wo(0,"div",5),wo(1,"div",6),wo(2,"div",7),wo(3,"span"),Qo(4),ko(),wo(5,"span"),Qo(6),ko(),wo(7,"span"),Qo(8),ko(),ko(),fo(9,Mw,3,2,"div",8),fo(10,Lw,2,0,"ng-template",null,9,Wc),ko(),wo(12,"div",10),wo(13,"span"),Qo(14,"Adic\u0103"),ko(),wo(15,"span"),Qo(16),ko(),wo(17,"span"),Qo(18),ko(),ko(),ko()),2&e){const e=_o(11),t=Fo(2);Nr(4),Ko("",t.integerPart,","),Nr(2),Yo(t.decimalPart),Nr(2),Ko(" ",t.currencyService.symbol," "),Nr(1),bo("ngIf",null==t.guestsText?null:t.guestsText.length)("ngIfElse",e),Nr(7),Yo(t.total),Nr(2),Yo(t.currencyService.symbol)}}function jw(e,t){if(1&e){const e=Io();wo(0,"div",1),fo(1,$w,19,7,"div",2),wo(2,"div",3),wo(3,"button",4),Ao("click",(function(t){return Rt(e),Fo().openStoreLocator(t)})),wo(4,"span"),Qo(5,"tradof#Afficher le prix#"),ko(),ko(),ko(),ko()}if(2&e){const e=Fo();Nr(1),bo("ngIf",!e.loading)}}let zw=(()=>{class e{constructor(e,t,i,n,r,s,o){this.recipesService=e,this.posService=t,this.cdr=i,this.priceService=n,this.basketsService=r,this.element=s,this.currencyService=o,this.fetchPricingOnScroll=!0,this.inViewport=!0,this.priceSet=new Rc,this.loading=!0,this.subscriptions=[],this.guests$=new cp(0),this.isInView$=new cp(!1)}ngOnInit(){this.isInView$.next(this.inViewport),this.subscriptions.push(this.basketsService.basket$.pipe(bp(e=>!e)).subscribe())}ngOnChanges(e){if(e.serves){const e=this.guests$.value;this.guests$.next(this.serves),this.recipeExtId&&this.recipeId&&e>0&&e!==this.serves&&this.updateRecipeGuests()}(e.recipeId||e.recipeExtId)&&this.initPricing(),e.inViewport&&this.isInView$.next(this.inViewport)}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.onChangesSubscription&&this.onChangesSubscription.unsubscribe()}initPricing(){this.subscriptions.push(this.initRecipeForExtId().subscribe(()=>{var e;(null===(e=this.recipeId)||void 0===e?void 0:e.length)>0&&this.subscriptions.push(this.initPricingFromBasketChanges().subscribe(),this.initPricingFromGuestsAndViewPort())}))}initRecipeForExtId(){var e,t;return!((null===(e=this.recipeId)||void 0===e?void 0:e.length)>0)&&(null===(t=this.recipeExtId)||void 0===t?void 0:t.length)>0?this.recipesService.searchRecipeByExtId(this.recipeExtId).pipe(df(e=>{this.recipeId=(null==e?void 0:e.id)||null,this.cdr.detectChanges()})):td(null)}openStoreLocator(e){e.stopPropagation(),this.recipesService.openStoreLocator()}updateRecipeGuests(){this.basketsService.updateRecipesInBasket([this.recipeId],this.guests$.value,{originPath:"",props:{recipe_id:this.recipeId}})}initPricingFromGuestsAndViewPort(){let e;return Xg([this.posService.waitForPos,this.isInView$,this.guests$,this.basketsService.recipeIsInBasket(this.recipeId)]).pipe(bp(e=>!e[1]||!e[3])).subscribe(t=>{this.pos=t[0],!t[3]&&!1!==e&&this.inViewport&&(this.loading=!0,this.cdr.detectChanges(),this.onChangesSubscription&&this.onChangesSubscription.unsubscribe(),this.onChangesSubscription=this.fetchPricing().subscribe()),e=t[3]})}initPricingFromBasketChanges(){return Xg([this.posService.pos$,this.basketsService.basketPreview$,this.isInView$]).pipe(bp(e=>!e[0]||!e[1]||!e[2]),th(e=>{this.pos=e[0];const t=e[1].find(e=>{var t,i;return e.isRecipe&&(null===(t=e.id)||void 0===t?void 0:t.toString())===(null===(i=this.recipeId)||void 0===i?void 0:i.toString())});return t?this.recipesService.getPricing(this.recipeId,this.pos.id,this.serves).pipe(th(e=>this.extractPricing(t,e))):td(null)}))}fetchPricing(){return this.recipeId&&this.pos&&this.serves?this.recipesService.getPricing(this.recipeId,this.pos.id,this.serves).pipe(bp(e=>0===e.price),df(e=>{this.pricing=e,this.format(),this.loading=!1,this.priceSet.emit(e),this.cdr.detectChanges()})):td(null)}extractPricing(e,t){return this.pricing=new Hf({price:parseFloat(e.price),serves:e.count,"price-per-serve":parseFloat(e.price)/e.count,"discounted-ingredients-count":t["discounted-ingredients-count"]}),this.format(),this.loading=!1,this.priceSet.emit(this.pricing),this.cdr.detectChanges(),td(this.pricing)}format(){const e=this.pricing["price-per-serve"].toFixed(2).toString().split(".");this.integerPart=e[0],this.decimalPart=2===e.length?e[1]:"00",this.total=this.pricing.price.toFixed(2)}}return e.\u0275fac=function(t){return new(t||e)(vo(__),vo(Vf),vo(Ga),vo(w_),vo(C_),vo(wa),vo(b_))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-pricing"]],inputs:{recipeId:"recipeId",recipeExtId:"recipeExtId",serves:"serves",guestsText:"guestsText",fetchPricingOnScroll:"fetchPricingOnScroll",inViewport:"inViewport"},outputs:{priceSet:"priceSet"},features:[at],decls:1,vars:1,consts:[["class","miam-recipe-pricing","ngMiamSelectPosButton","",4,"ngIf"],["ngMiamSelectPosButton","",1,"miam-recipe-pricing"],["class","miam-recipe-pricing__with-pos",4,"ngIf"],[1,"miam-recipe-pricing__without-pos"],[1,"mealz-ds-button","ghost","miam-select-pos-button__open-store-selector-button",3,"click"],[1,"miam-recipe-pricing__with-pos"],[1,"miam-recipe-pricing__wrapper"],[1,"miam-recipe-pricing__wrapper__price","mealz-ds-text","size-l","weight-xxl"],["class","miam-recipe-pricing__wrapper__subline mealz-ds-text size-xs weight-m",4,"ngIf","ngIfElse"],["defaultGuestsText",""],[1,"miam-recipe-pricing__total"],[1,"miam-recipe-pricing__wrapper__subline","mealz-ds-text","size-xs","weight-m"],[4,"ngIf"],[1,"miam-recipe-pricing__wrapper__subline","mealz-ds-text","size-m","weight-m"]],template:function(e,t){1&e&&fo(0,jw,6,1,"div",0),2&e&&bo("ngIf",(null==t.recipeId?null:t.recipeId.length)>0)},directives:[Ou,Ow],styles:[".miam-recipe-pricing{display:flex;flex-direction:column;align-items:center}.miam-recipe-pricing .miam-recipe-pricing__with-pos{display:block}.miam-recipe-pricing .miam-recipe-pricing__without-pos,.miam-recipe-pricing.selectPos .miam-recipe-pricing__with-pos{display:none}.miam-recipe-pricing.selectPos .miam-recipe-pricing__without-pos{display:block}.miam-recipe-pricing .miam-recipe-pricing__wrapper{display:flex;flex-flow:row wrap;align-items:flex-start}.miam-recipe-pricing .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__price{color:var(--mealz-ds-color-primary,#24748f)}.miam-recipe-pricing .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__subline{color:var(--mealz-ds-color-neutral-400)}.miam-recipe-pricing .miam-recipe-pricing__total{display:none;color:var(--m-color-grey04);font-weight:400;font-size:12px;line-height:16px}.miam-recipe-pricing .miam-recipe-pricing__total span{margin-right:4px}"],encapsulation:2,changeDetection:0}),e})(),Nw=(()=>{class e{constructor(e){this.replaceItemService=e}}return e.\u0275fac=function(t){return new(t||e)(vo(yv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-product-addition-card"]],decls:6,vars:0,consts:[[1,"miam-product-addition-card"],[1,"miam-product-addition-card__title"],[1,"miam-product-addition-card__button","mealz-ds-button","secondary","small",3,"click"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"span",1),Qo(2,"tradof#Besoin de quelque chose en particulier ?#"),ko(),wo(3,"button",2),Ao("click",(function(){return t.replaceItemService.changeAdditionModalState(!0)})),wo(4,"span"),Qo(5,"tradof#Ajouter un produit#"),ko(),ko(),ko())},styles:[".miam-product-addition-card{padding:24px 16px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--mealz-ds-color-neutral-50)}.miam-product-addition-card>:not(:last-child){margin-bottom:16px}.miam-product-addition-card .miam-product-addition-card__button{border-radius:32px}"],encapsulation:2,changeDetection:0}),e})(),Vw=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-promotion-badge"]],decls:4,vars:0,consts:[[1,"miam-recipe-promotion-badge"],["alt","promotion badge","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/9.0/recipe_discount.svg",1,"miam-recipe-promotion-badge__icon"],[1,"mealz-ds-text","weight-xl"]],template:function(e,t){1&e&&(wo(0,"div",0),Co(1,"img",1),wo(2,"span",2),Qo(3,"tradof#Promo'#"),ko(),ko())},styles:[".miam-recipe-promotion-badge{display:flex;padding:4px 12px;border-radius:999px;color:var(--mealz-ds-color-neutral-white,#fff);background-color:#e02d2d;gap:8px}.miam-recipe-promotion-badge .miam-recipe-promotion-badge__icon{width:24px;height:24px}"],encapsulation:2,changeDetection:0}),e})(),Hw=(()=>{class e{constructor(){this.clicked=new Rc}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=He({type:e,selectors:[["ng-miam-promotions-banner"]],outputs:{clicked:"clicked"},decls:6,vars:0,consts:[[1,"miam-promotions-banner"],[1,"miam-promotions-banner__badge","mealz-ds-text","size-s","weight-xl"],[1,"miam-promotions-banner_button",3,"click"],[1,"miam-promotions-banner__text","mealz-ds-text","weight-xl"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"span",1),Qo(2,"tradof#Nouveau#"),ko(),wo(3,"button",2),Ao("click",(function(){return t.clicked.emit()})),wo(4,"span",3),Qo(5,"\ntradof# D\xe9couvrez nos recettes en promo' ! # "),ko(),ko(),ko())},styles:["ng-miam-promotions-banner{position:relative;max-width:480px;width:100%;margin:0 16px;box-sizing:border-box}ng-miam-promotions-banner .miam-promotions-banner__badge{position:absolute;top:0;left:50%;transform:translate(-50%,-50%);padding:4px 8px;border-radius:999px;color:var(--mealz-ds-color-neutral-white,#fff);background-color:#e02d2d}ng-miam-promotions-banner .miam-promotions-banner_button{padding:12px;text-decoration:underline;width:100%;border-radius:8px;border:none;cursor:pointer;background-color:var(--miam-color-neutral-50,#f7f8f9)}"],encapsulation:2,changeDetection:0}),e})();class Uw extends zd{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}requestAsyncId(e,t,i=0){return null!==i&&i>0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}}class qw extends Hd{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,n=-1,r=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++n<r&&(e=t.shift()));if(this.active=!1,i){for(;++n<r&&(e=t.shift());)e.unsubscribe();throw i}}}const Gw=new qw(Uw);class Ww{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new Zw(e,this.durationSelector))}}class Zw extends ${constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let i;try{const{durationSelector:t}=this;i=t(e)}catch(t){return this.destination.error(t)}const n=j(i,new L(this));!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function Qw(e){return!c(e)&&e-parseFloat(e)+1>=0}function Yw(e){const{index:t,period:i,subscriber:n}=e;if(n.next(t),!n.closed){if(-1===i)return n.complete();e.index=t+1,this.schedule(e,i)}}let Kw=(()=>{class e{constructor(e,t,i){this._platform=e,this._change=new C,this._changeListener=e=>{this._change.next(e)},this._document=i,t.runOutsideAngular(()=>{if(e.isBrowser){const e=this._getWindow();e.addEventListener("resize",this._changeListener),e.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._updateViewportSize())})}ngOnDestroy(){if(this._platform.isBrowser){const e=this._getWindow();e.removeEventListener("resize",this._changeListener),e.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){const e=this.getViewportScrollPosition(),{width:t,height:i}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+i,right:e.left+t,height:i,width:t}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const e=this._document,t=this._getWindow(),i=e.documentElement,n=i.getBoundingClientRect();return{top:-n.top||e.body.scrollTop||t.scrollY||i.scrollTop||0,left:-n.left||e.body.scrollLeft||t.scrollX||i.scrollLeft||0}}change(e=20){return e>0?this._change.pipe(function(e,t=sf){return i=()=>function(e=0,t,i){let n=-1;return Qw(t)?n=Number(t)<1?1:Number(t):x(t)&&(i=t),x(i)||(i=sf),new v(t=>{const r=Qw(e)?e:+e-i.now();return i.schedule(Yw,r,{index:0,period:n,subscriber:t})})}(e,t),function(e){return e.lift(new Ww(i))};var i}(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}}return e.\u0275fac=function(t){return new(t||e)(nn(ev),nn(gl),nn(Nl,8))},e.\u0275prov=de({factory:function(){return new e(nn(ev),nn(gl),nn(Nl,8))},token:e,providedIn:"root"}),e})(),Jw=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({}),e})();function Xw(e){const{subscriber:t,counter:i,period:n}=e;t.next(i),this.schedule({subscriber:t,counter:i+1,period:n},n)}function ek(e,t){for(let i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function tk(e,t){const i=t?"":"none";ek(e.style,{touchAction:t?"":"none",webkitUserDrag:t?"":"none",webkitTapHighlightColor:t?"":"transparent",userSelect:i,msUserSelect:i,webkitUserSelect:i,MozUserSelect:i})}function ik(e,t){const i=e.style;i.position=t?"":"fixed",i.top=i.opacity=t?"":"0",i.left=t?"":"-999em"}function nk(e){const t=e.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(e)*t}function rk(e,t){return e.getPropertyValue(t).split(",").map(e=>e.trim())}function sk(e){const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}function ok(e,t,i){const{top:n,bottom:r,left:s,right:o}=e;return i>=n&&i<=r&&t>=s&&t<=o}function ak(e,t,i){e.top+=t,e.bottom=e.top+e.height,e.left+=i,e.right=e.left+e.width}function ck(e,t,i,n){const{top:r,right:s,bottom:o,left:a,width:c,height:l}=e,u=c*t,d=l*t;return n>r-d&&n<o+d&&i>a-u&&i<s+u}class lk{constructor(e,t){this._document=e,this._viewportRuler=t,this.positions=new Map}clear(){this.positions.clear()}cache(e){this.clear(),this.positions.set(this._document,{scrollPosition:this._viewportRuler.getViewportScrollPosition()}),e.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:sk(e)})})}handleScroll(e){const t=e.target,i=this.positions.get(t);if(!i)return null;const n=t===this._document?t.documentElement:t,r=i.scrollPosition;let s,o;if(t===this._document){const e=this._viewportRuler.getViewportScrollPosition();s=e.top,o=e.left}else s=t.scrollTop,o=t.scrollLeft;const a=r.top-s,c=r.left-o;return this.positions.forEach((e,i)=>{e.clientRect&&t!==i&&n.contains(i)&&ak(e.clientRect,a,c)}),r.top=s,r.left=o,{top:a,left:c}}}function uk(e){const t=e.cloneNode(!0),i=t.querySelectorAll("[id]"),n=e.nodeName.toLowerCase();t.removeAttribute("id");for(let r=0;r<i.length;r++)i[r].removeAttribute("id");return"canvas"===n?mk(e,t):"input"!==n&&"select"!==n&&"textarea"!==n||pk(e,t),dk("canvas",e,t,mk),dk("input, textarea, select",e,t,pk),t}function dk(e,t,i,n){const r=t.querySelectorAll(e);if(r.length){const t=i.querySelectorAll(e);for(let e=0;e<r.length;e++)n(r[e],t[e])}}let hk=0;function pk(e,t){"file"!==t.type&&(t.value=e.value),"radio"===t.type&&t.name&&(t.name=`mat-clone-${t.name}-${hk++}`)}function mk(e,t){const i=t.getContext("2d");if(i)try{i.drawImage(e,0,0)}catch(fE){}}const gk=iv({passive:!0}),fk=iv({passive:!1});class _k{constructor(e,t,i,n,r,s){this._config=t,this._document=i,this._ngZone=n,this._viewportRuler=r,this._dragDropRegistry=s,this._passiveTransform={x:0,y:0},this._activeTransform={x:0,y:0},this._moveEvents=new C,this._pointerMoveSubscription=d.EMPTY,this._pointerUpSubscription=d.EMPTY,this._scrollSubscription=d.EMPTY,this._resizeSubscription=d.EMPTY,this._boundaryElement=null,this._nativeInteractionsEnabled=!0,this._handles=[],this._disabledHandles=new Set,this._direction="ltr",this.dragStartDelay=0,this._disabled=!1,this.beforeStarted=new C,this.started=new C,this.released=new C,this.ended=new C,this.entered=new C,this.exited=new C,this.dropped=new C,this.moved=this._moveEvents,this._pointerDown=e=>{if(this.beforeStarted.next(),this._handles.length){const t=this._handles.find(t=>{const i=e.target;return!!i&&(i===t||t.contains(i))});!t||this._disabledHandles.has(t)||this.disabled||this._initializeDragSequence(t,e)}else this.disabled||this._initializeDragSequence(this._rootElement,e)},this._pointerMove=e=>{const t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging){if(Math.abs(t.x-this._pickupPositionOnPage.x)+Math.abs(t.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){const t=Date.now()>=this._dragStartTime+this._getDragStartDelay(e),i=this._dropContainer;if(!t)return void this._endDragSequence(e);i&&(i.isDragging()||i.isReceiving())||(e.preventDefault(),this._hasStartedDragging=!0,this._ngZone.run(()=>this._startDragSequence(e)))}return}this._boundaryElement&&(this._previewRect&&(this._previewRect.width||this._previewRect.height)||(this._previewRect=(this._preview||this._rootElement).getBoundingClientRect())),e.preventDefault();const i=this._getConstrainedPointerPosition(t);if(this._hasMoved=!0,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,t);else{const e=this._activeTransform;e.x=i.x-this._pickupPositionOnPage.x+this._passiveTransform.x,e.y=i.y-this._pickupPositionOnPage.y+this._passiveTransform.y,this._applyRootElementTransform(e.x,e.y),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&this._rootElement.setAttribute("transform",`translate(${e.x} ${e.y})`)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:e,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})},this._pointerUp=e=>{this._endDragSequence(e)},this.withRootElement(e).withParent(t.parentDragRef||null),this._parentPositions=new lk(i,r),s.registerDragItem(this)}get disabled(){return this._disabled||!(!this._dropContainer||!this._dropContainer.disabled)}set disabled(e){const t=function(e){return null!=e&&""+e!="false"}(e);t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>tk(e,t)))}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){this._handles=e.map(e=>Q_(e)),this._handles.forEach(e=>tk(e,this.disabled)),this._toggleNativeDragInteractions();const t=new Set;return this._disabledHandles.forEach(e=>{this._handles.indexOf(e)>-1&&t.add(e)}),this._disabledHandles=t,this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){const t=Q_(e);return t!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular(()=>{t.addEventListener("mousedown",this._pointerDown,fk),t.addEventListener("touchstart",this._pointerDown,gk)}),this._initialTransform=void 0,this._rootElement=t),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?Q_(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(e){return this._parentDragRef=e,this}dispose(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&yk(this._rootElement),yk(this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeSubscriptions(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._anchor=this._parentDragRef=null}isDragging(){return this._hasStartedDragging&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),tk(e,!0))}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),tk(e,this.disabled))}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e}getFreeDragPosition(){const e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}_sortFromLastPointerPosition(){const e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e)}_removeSubscriptions(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}_destroyPreview(){this._preview&&yk(this._preview),this._previewRef&&this._previewRef.destroy(),this._preview=this._previewRef=null}_destroyPlaceholder(){this._placeholder&&yk(this._placeholder),this._placeholderRef&&this._placeholderRef.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(e){this._dragDropRegistry.isDragging(this)&&(this._removeSubscriptions(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),this._hasStartedDragging&&(this.released.next({source:this}),this._dropContainer?(this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)})):(this._passiveTransform.x=this._activeTransform.x,this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(this._getPointerPositionOnPage(e))})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this))))}_startDragSequence(e){wk(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();const t=this._dropContainer;if(t){const e=this._rootElement,i=e.parentNode,n=this._preview=this._createPreviewElement(),r=this._placeholder=this._createPlaceholderElement(),s=this._anchor=this._anchor||this._document.createComment(""),o=this._getShadowRoot();i.insertBefore(s,e),ik(e,!1),this._document.body.appendChild(i.replaceChild(r,e)),function(e,t){return t||e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement||e.body}(this._document,o).appendChild(n),this.started.next({source:this}),t.start(),this._initialContainer=t,this._initialIndex=t.getItemIndex(this)}else this.started.next({source:this}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(t?t.getScrollableParents():[])}_initializeDragSequence(e,t){this._parentDragRef&&t.stopPropagation();const i=this.isDragging(),n=wk(t),r=!n&&0!==t.button,s=this._rootElement,o=!n&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now();if(t.target&&t.target.draggable&&"mousedown"===t.type&&t.preventDefault(),i||r||o)return;this._handles.length&&(this._rootElementTapHighlight=s.style.webkitTapHighlightColor||"",s.style.webkitTapHighlightColor="transparent"),this._hasStartedDragging=this._hasMoved=!1,this._removeSubscriptions(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scroll.subscribe(e=>{this._updateOnScroll(e)}),this._boundaryElement&&(this._boundaryRect=sk(this._boundaryElement));const a=this._previewTemplate;this._pickupPositionInElement=a&&a.template&&!a.matchSize?{x:0,y:0}:this._getPointerPositionInElement(e,t);const c=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:c.x,y:c.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){ik(this._rootElement,!0),this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._boundaryRect=this._previewRect=void 0,this._ngZone.run(()=>{const t=this._dropContainer,i=t.getItemIndex(this),n=this._getPointerPositionOnPage(e),r=this._getDragDistance(this._getPointerPositionOnPage(e)),s=t._isOverContainer(n.x,n.y);this.ended.next({source:this,distance:r}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:s,distance:r}),t.drop(this,i,this._initialIndex,this._initialContainer,s,r),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:e,y:t},{x:i,y:n}){let r=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=r,this._dropContainer.enter(this,e,t,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)})}),this._dropContainer._startScrollingIfNecessary(i,n),this._dropContainer._sortItem(this,e,t,this._pointerDirectionDelta),this._preview.style.transform=vk(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y)}_createPreviewElement(){const e=this._previewTemplate,t=this.previewClass,i=e?e.template:null;let n;if(i&&e){const t=e.matchSize?this._rootElement.getBoundingClientRect():null,r=e.viewContainer.createEmbeddedView(i,e.context);r.detectChanges(),n=kk(r,this._document),this._previewRef=r,e.matchSize?Ck(n,t):n.style.transform=vk(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else{const e=this._rootElement;n=uk(e),Ck(n,e.getBoundingClientRect())}return ek(n.style,{pointerEvents:"none",margin:"0",position:"fixed",top:"0",left:"0",zIndex:""+(this._config.zIndex||1e3)}),tk(n,!1),n.classList.add("cdk-drag-preview"),n.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(e=>n.classList.add(e)):n.classList.add(t)),n}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();const e=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._preview.style.transform=vk(e.left,e.top);const t=function(e){const t=getComputedStyle(e),i=rk(t,"transition-property"),n=i.find(e=>"transform"===e||"all"===e);if(!n)return 0;const r=i.indexOf(n),s=rk(t,"transition-duration"),o=rk(t,"transition-delay");return nk(s[r])+nk(o[r])}(this._preview);return 0===t?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(e=>{const i=t=>{(!t||t.target===this._preview&&"transform"===t.propertyName)&&(this._preview.removeEventListener("transitionend",i),e(),clearTimeout(n))},n=setTimeout(i,1.5*t);this._preview.addEventListener("transitionend",i)}))}_createPlaceholderElement(){const e=this._placeholderTemplate,t=e?e.template:null;let i;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),i=kk(this._placeholderRef,this._document)):i=uk(this._rootElement),i.classList.add("cdk-drag-placeholder"),i}_getPointerPositionInElement(e,t){const i=this._rootElement.getBoundingClientRect(),n=e===this._rootElement?null:e,r=n?n.getBoundingClientRect():i,s=wk(t)?t.targetTouches[0]:t,o=this._getViewportScrollPosition();return{x:r.left-i.left+(s.pageX-r.left-o.left),y:r.top-i.top+(s.pageY-r.top-o.top)}}_getPointerPositionOnPage(e){const t=this._getViewportScrollPosition(),i=wk(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,n=i.pageX-t.left,r=i.pageY-t.top;if(this._ownerSVGElement){const e=this._ownerSVGElement.getScreenCTM();if(e){const t=this._ownerSVGElement.createSVGPoint();return t.x=n,t.y=r,t.matrixTransform(e.inverse())}}return{x:n,y:r}}_getConstrainedPointerPosition(e){const t=this._dropContainer?this._dropContainer.lockAxis:null;let{x:i,y:n}=this.constrainPosition?this.constrainPosition(e,this):e;if("x"===this.lockAxis||"x"===t?n=this._pickupPositionOnPage.y:"y"!==this.lockAxis&&"y"!==t||(i=this._pickupPositionOnPage.x),this._boundaryRect){const{x:e,y:t}=this._pickupPositionInElement,r=this._boundaryRect,s=this._previewRect,o=r.top+t,a=r.bottom-(s.height-t);i=bk(i,r.left+e,r.right-(s.width-e)),n=bk(n,o,a)}return{x:i,y:n}}_updatePointerDirectionDelta(e){const{x:t,y:i}=e,n=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,s=Math.abs(t-r.x),o=Math.abs(i-r.y);return s>this._config.pointerDirectionChangeThreshold&&(n.x=t>r.x?1:-1,r.x=t),o>this._config.pointerDirectionChangeThreshold&&(n.y=i>r.y?1:-1,r.y=i),n}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;const e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,tk(this._rootElement,e))}_removeRootElementListeners(e){e.removeEventListener("mousedown",this._pointerDown,fk),e.removeEventListener("touchstart",this._pointerDown,gk)}_applyRootElementTransform(e,t){const i=vk(e,t);null==this._initialTransform&&(this._initialTransform=this._rootElement.style.transform||""),this._rootElement.style.transform=this._initialTransform?i+" "+this._initialTransform:i}_getDragDistance(e){const t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(0===e&&0===t||this.isDragging()||!this._boundaryElement)return;const i=this._boundaryElement.getBoundingClientRect(),n=this._rootElement.getBoundingClientRect();if(0===i.width&&0===i.height||0===n.width&&0===n.height)return;const r=i.left-n.left,s=n.right-i.right,o=i.top-n.top,a=n.bottom-i.bottom;i.width>n.width?(r>0&&(e+=r),s>0&&(e-=s)):e=0,i.height>n.height?(o>0&&(t+=o),a>0&&(t-=a)):t=0,e===this._passiveTransform.x&&t===this._passiveTransform.y||this.setFreeDragPosition({y:t,x:e})}_getDragStartDelay(e){const t=this.dragStartDelay;return"number"==typeof t?t:wk(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){const t=this._parentPositions.handleScroll(e);if(t){const i=e.target;this._boundaryRect&&(i===this._document||i!==this._boundaryElement&&i.contains(this._boundaryElement))&&ak(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){const e=this._parentPositions.positions.get(this._document);return e?e.scrollPosition:this._viewportRuler.getViewportScrollPosition()}_getShadowRoot(){return void 0===this._cachedShadowRoot&&(this._cachedShadowRoot=nv(this._rootElement)),this._cachedShadowRoot}}function vk(e,t){return`translate3d(${Math.round(e)}px, ${Math.round(t)}px, 0)`}function bk(e,t,i){return Math.max(t,Math.min(i,e))}function yk(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function wk(e){return"t"===e.type[0]}function kk(e,t){const i=e.rootNodes;if(1===i.length&&i[0].nodeType===t.ELEMENT_NODE)return i[0];const n=t.createElement("div");return i.forEach(e=>n.appendChild(e)),n}function Ck(e,t){e.style.width=t.width+"px",e.style.height=t.height+"px",e.style.transform=vk(t.left,t.top)}function Sk(e,t){return Math.max(0,Math.min(t,e))}class xk{constructor(e,t,i,n,r){this._dragDropRegistry=t,this._ngZone=n,this._viewportRuler=r,this.disabled=!1,this.sortingDisabled=!1,this.autoScrollDisabled=!1,this.autoScrollStep=2,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.beforeStarted=new C,this.entered=new C,this.exited=new C,this.dropped=new C,this.sorted=new C,this._isDragging=!1,this._itemPositions=[],this._previousSwap={drag:null,delta:0,overlaps:!1},this._draggables=[],this._siblings=[],this._orientation="vertical",this._activeSiblings=new Set,this._direction="ltr",this._viewportScrollSubscription=d.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new C,this._cachedShadowRoot=null,this._startScrollInterval=()=>{this._stopScrolling(),function(e=0,t=sf){return(!Qw(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=sf),new v(i=>(i.add(t.schedule(Xw,e,{subscriber:i,counter:0,period:e})),i))}(0,Gw).pipe(I_(this._stopScrollTimers)).subscribe(()=>{const e=this._scrollNode,t=this.autoScrollStep;1===this._verticalScrollDirection?Ik(e,-t):2===this._verticalScrollDirection&&Ik(e,t),1===this._horizontalScrollDirection?Pk(e,-t):2===this._horizontalScrollDirection&&Pk(e,t)})},this.element=Q_(e),this._document=i,this.withScrollableParents([this.element]),t.registerDropContainer(this),this._parentPositions=new lk(i,r)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(e,t,i,n){let r;this._draggingStarted(),null==n?(r=this.sortingDisabled?this._draggables.indexOf(e):-1,-1===r&&(r=this._getItemIndexFromPointerPosition(e,t,i))):r=n;const s=this._activeDraggables,o=s.indexOf(e),a=e.getPlaceholderElement();let c=s[r];if(c===e&&(c=s[r+1]),o>-1&&s.splice(o,1),c&&!this._dragDropRegistry.isDragging(c)){const t=c.getRootElement();t.parentElement.insertBefore(a,t),s.splice(r,0,e)}else if(this._shouldEnterAsFirstChild(t,i)){const t=s[0].getRootElement();t.parentNode.insertBefore(a,t),s.unshift(e)}else Q_(this.element).appendChild(a),s.push(e);a.style.transform="",this._cacheItemPositions(),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)})}exit(e){this._reset(),this.exited.next({item:e,container:this})}drop(e,t,i,n,r,s){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:i,container:this,previousContainer:n,isPointerOverContainer:r,distance:s})}withItems(e){const t=this._draggables;return this._draggables=e,e.forEach(e=>e._withDropContainer(this)),this.isDragging()&&(t.filter(e=>e.isDragging()).every(t=>-1===e.indexOf(t))?this._reset():this._cacheItems()),this}withDirection(e){return this._direction=e,this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){return this._orientation=e,this}withScrollableParents(e){const t=Q_(this.element);return this._scrollableElements=-1===e.indexOf(t)?[t,...e]:e.slice(),this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?Ek("horizontal"===this._orientation&&"rtl"===this._direction?this._itemPositions.slice().reverse():this._itemPositions,t=>t.drag===e):this._draggables.indexOf(e)}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,i,n){if(this.sortingDisabled||!this._clientRect||!ck(this._clientRect,.05,t,i))return;const r=this._itemPositions,s=this._getItemIndexFromPointerPosition(e,t,i,n);if(-1===s&&r.length>0)return;const o="horizontal"===this._orientation,a=Ek(r,t=>t.drag===e),c=r[s],l=c.clientRect,u=a>s?1:-1,d=this._getItemOffsetPx(r[a].clientRect,l,u),h=this._getSiblingOffsetPx(a,r,u),p=r.slice();!function(e,t,i){const n=Sk(t,e.length-1),r=Sk(i,e.length-1);if(n===r)return;const s=e[n],o=r<n?-1:1;for(let a=n;a!==r;a+=o)e[a]=e[a+o];e[r]=s}(r,a,s),this.sorted.next({previousIndex:a,currentIndex:s,container:this,item:e}),r.forEach((t,i)=>{if(p[i]===t)return;const n=t.drag===e,r=n?d:h,s=n?e.getPlaceholderElement():t.drag.getRootElement();t.offset+=r,o?(s.style.transform=`translate3d(${Math.round(t.offset)}px, 0, 0)`,ak(t.clientRect,0,r)):(s.style.transform=`translate3d(0, ${Math.round(t.offset)}px, 0)`,ak(t.clientRect,r,0))}),this._previousSwap.overlaps=ok(l,t,i),this._previousSwap.drag=c.drag,this._previousSwap.delta=o?n.x:n.y}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let i,n=0,r=0;if(this._parentPositions.positions.forEach((s,o)=>{o!==this._document&&s.clientRect&&!i&&ck(s.clientRect,.05,e,t)&&([n,r]=function(e,t,i,n){const r=Dk(t,n),s=Tk(t,i);let o=0,a=0;if(r){const t=e.scrollTop;1===r?t>0&&(o=1):e.scrollHeight-t>e.clientHeight&&(o=2)}if(s){const t=e.scrollLeft;1===s?t>0&&(a=1):e.scrollWidth-t>e.clientWidth&&(a=2)}return[o,a]}(o,s.clientRect,e,t),(n||r)&&(i=o))}),!n&&!r){const{width:s,height:o}=this._viewportRuler.getViewportSize(),a={width:s,height:o,top:0,right:s,bottom:o,left:0};n=Dk(a,t),r=Tk(a,e),i=window}!i||n===this._verticalScrollDirection&&r===this._horizontalScrollDirection&&i===this._scrollNode||(this._verticalScrollDirection=n,this._horizontalScrollDirection=r,this._scrollNode=i,(n||r)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){const e=Q_(this.element).style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.msScrollSnapType="none",this._cacheItems(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){const e=Q_(this.element);this._parentPositions.cache(this._scrollableElements),this._clientRect=this._parentPositions.positions.get(e).clientRect}_cacheItemPositions(){const e="horizontal"===this._orientation;this._itemPositions=this._activeDraggables.map(e=>{const t=e.getVisibleElement();return{drag:e,offset:0,clientRect:sk(t)}}).sort((t,i)=>e?t.clientRect.left-i.clientRect.left:t.clientRect.top-i.clientRect.top)}_reset(){this._isDragging=!1;const e=Q_(this.element).style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._activeDraggables.forEach(e=>{const t=e.getRootElement();t&&(t.style.transform="")}),this._siblings.forEach(e=>e._stopReceiving(this)),this._activeDraggables=[],this._itemPositions=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1,this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_getSiblingOffsetPx(e,t,i){const n="horizontal"===this._orientation,r=t[e].clientRect,s=t[e+-1*i];let o=r[n?"width":"height"]*i;if(s){const e=n?"left":"top",t=n?"right":"bottom";-1===i?o-=s.clientRect[e]-r[t]:o+=r[e]-s.clientRect[t]}return o}_getItemOffsetPx(e,t,i){const n="horizontal"===this._orientation;let r=n?t.left-e.left:t.top-e.top;return-1===i&&(r+=n?t.width-e.width:t.height-e.height),r}_shouldEnterAsFirstChild(e,t){if(!this._activeDraggables.length)return!1;const i=this._itemPositions,n="horizontal"===this._orientation;if(i[0].drag!==this._activeDraggables[0]){const r=i[i.length-1].clientRect;return n?e>=r.right:t>=r.bottom}{const r=i[0].clientRect;return n?e<=r.left:t<=r.top}}_getItemIndexFromPointerPosition(e,t,i,n){const r="horizontal"===this._orientation,s=Ek(this._itemPositions,({drag:s,clientRect:o},a,c)=>{if(s===e)return c.length<2;if(n){const e=r?n.x:n.y;if(s===this._previousSwap.drag&&this._previousSwap.overlaps&&e===this._previousSwap.delta)return!1}return r?t>=Math.floor(o.left)&&t<Math.floor(o.right):i>=Math.floor(o.top)&&i<Math.floor(o.bottom)});return-1!==s&&this.sortPredicate(s,e,this)?s:-1}_cacheItems(){this._activeDraggables=this._draggables.slice(),this._cacheItemPositions(),this._cacheParentPositions()}_isOverContainer(e,t){return null!=this._clientRect&&ok(this._clientRect,e,t)}_getSiblingContainerFromPosition(e,t,i){return this._siblings.find(n=>n._canReceive(e,t,i))}_canReceive(e,t,i){if(!this._clientRect||!ok(this._clientRect,t,i)||!this.enterPredicate(e,this))return!1;const n=this._getShadowRoot().elementFromPoint(t,i);if(!n)return!1;const r=Q_(this.element);return n===r||r.contains(n)}_startReceiving(e,t){const i=this._activeSiblings;!i.has(e)&&t.every(e=>this.enterPredicate(e,this)||this._draggables.indexOf(e)>-1)&&(i.add(e),this._cacheParentPositions(),this._listenToScrollEvents())}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe()}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scroll.subscribe(e=>{if(this.isDragging()){const t=this._parentPositions.handleScroll(e);t&&(this._itemPositions.forEach(({clientRect:e})=>{ak(e,t.top,t.left)}),this._itemPositions.forEach(({drag:e})=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition()}))}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){const e=nv(Q_(this.element));this._cachedShadowRoot=e||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){const e=this._activeDraggables.filter(e=>e.isDragging());this._siblings.forEach(t=>t._startReceiving(this,e))}}function Ek(e,t){for(let i=0;i<e.length;i++)if(t(e[i],i,e))return i;return-1}function Ik(e,t){e===window?e.scrollBy(0,t):e.scrollTop+=t}function Pk(e,t){e===window?e.scrollBy(t,0):e.scrollLeft+=t}function Dk(e,t){const{top:i,bottom:n,height:r}=e,s=.05*r;return t>=i-s&&t<=i+s?1:t>=n-s&&t<=n+s?2:0}function Tk(e,t){const{left:i,right:n,width:r}=e,s=.05*r;return t>=i-s&&t<=i+s?1:t>=n-s&&t<=n+s?2:0}const Ak=iv({passive:!1,capture:!0});let Rk=(()=>{class e{constructor(e,t){this._ngZone=e,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=[],this._globalListeners=new Map,this._draggingPredicate=e=>e.isDragging(),this.pointerMove=new C,this.pointerUp=new C,this.scroll=new C,this._preventDefaultWhileDragging=e=>{this._activeDragInstances.length>0&&e.preventDefault()},this._persistentTouchmoveListener=e=>{this._activeDragInstances.length>0&&(this._activeDragInstances.some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))},this._document=t}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),1===this._dragInstances.size&&this._ngZone.runOutsideAngular(()=>{this._document.addEventListener("touchmove",this._persistentTouchmoveListener,Ak)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),0===this._dragInstances.size&&this._document.removeEventListener("touchmove",this._persistentTouchmoveListener,Ak)}startDragging(e,t){if(!(this._activeDragInstances.indexOf(e)>-1)&&(this._activeDragInstances.push(e),1===this._activeDragInstances.length)){const e=t.type.startsWith("touch");this._globalListeners.set(e?"touchend":"mouseup",{handler:e=>this.pointerUp.next(e),options:!0}).set("scroll",{handler:e=>this.scroll.next(e),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:Ak}),e||this._globalListeners.set("mousemove",{handler:e=>this.pointerMove.next(e),options:Ak}),this._ngZone.runOutsideAngular(()=>{this._globalListeners.forEach((e,t)=>{this._document.addEventListener(t,e.handler,e.options)})})}}stopDragging(e){const t=this._activeDragInstances.indexOf(e);t>-1&&(this._activeDragInstances.splice(t,1),0===this._activeDragInstances.length&&this._clearGlobalListeners())}isDragging(e){return this._activeDragInstances.indexOf(e)>-1}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_clearGlobalListeners(){this._globalListeners.forEach((e,t)=>{this._document.removeEventListener(t,e.handler,e.options)}),this._globalListeners.clear()}}return e.\u0275fac=function(t){return new(t||e)(nn(gl),nn(Nl))},e.\u0275prov=de({factory:function(){return new e(nn(gl),nn(Nl))},token:e,providedIn:"root"}),e})();const Ok={dragStartThreshold:5,pointerDirectionChangeThreshold:5};let Fk=(()=>{class e{constructor(e,t,i,n){this._document=e,this._ngZone=t,this._viewportRuler=i,this._dragDropRegistry=n}createDrag(e,t=Ok){return new _k(e,t,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(e){return new xk(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}}return e.\u0275fac=function(t){return new(t||e)(nn(Nl),nn(gl),nn(Kw),nn(Rk))},e.\u0275prov=de({factory:function(){return new e(nn(Nl),nn(gl),nn(Kw),nn(Rk))},token:e,providedIn:"root"}),e})(),Bk=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[Fk],imports:[Jw]}),e})(),Mk=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[tv]]}),e})(),Lk=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[]]}),e})(),$k=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[Lk,ed,Eb,Ib,Bk,Mk]]}),e})(),jk=(()=>{class e{constructor(e){const t={"recipe-pricing":zw};Object.keys(t).map(i=>{const n="webc-miam-"+i;if(!customElements.get(n)){const r=uh(t[i],{injector:e});customElements.define(n,r)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Lk]]}),e})();function zk(e,t){1&e&&(wo(0,"div",19),wo(1,"span"),Qo(2,"Sponsoris\xe9"),ko(),ko())}function Nk(e,t){if(1&e){const e=Io();wo(0,"button",20),Ao("click",(function(){return Rt(e),Fo(2).replaceProduct()})),wo(1,"span"),Qo(2,"tradof#Remplacer#"),ko(),ko()}2&e&&bo("disabled",Fo(2).loading)}function Vk(e,t){1&e&&Co(0,"div",21)}function Hk(e,t){1&e&&Co(0,"img",22)}const Uk=function(e){return{loading:e}};function qk(e,t){if(1&e){const e=Io();wo(0,"div",1),wo(1,"div",2),wo(2,"div",3),wo(3,"div",4),wo(4,"img",5),Ao("error",(function(t){Rt(e);const i=Fo();return t.target.src=i.contextService.defaultIngredientPicture})),ko(),ko(),ko(),wo(5,"div",6),wo(6,"div",7),wo(7,"div",8),wo(8,"span"),Qo(9),Ec(10,"capitalizeFirstLetter"),ko(),ko(),wo(11,"div",9),wo(12,"div",10),Qo(13),Ec(14,"number"),ko(),ko(),fo(15,zk,3,0,"div",11),fo(16,Nk,3,1,"button",12),ko(),wo(17,"button",13),Ao("click",(function(){return Rt(e),Fo().removeProduct()})),fo(18,Vk,1,0,"div",14),fo(19,Hk,1,0,"img",15),ko(),ko(),ko(),wo(20,"div",16),wo(21,"span",17),Qo(22),Ec(23,"currency"),ko(),wo(24,"ng-miam-counter-input",18),Ao("valueChange",(function(t){return Rt(e),Fo().counterChanged(t)})),ko(),ko(),ko()}if(2&e){const e=Fo();$o("id",e.basketEntry.id),Nr(4),bo("src",e.basketEntry.selectedItem.attributes.image,Wn),Nr(5),Yo(Ic(10,15,e.basketEntry.selectedItem.attributes.name)),Nr(4),Jo(" ",Pc(14,17,e.basketEntry.selectedItem.capacityVolume,"1.0-2")," ",e.basketEntry.selectedItem.capacityUnit," "),Nr(2),bo("ngIf",e.basketEntry.selectedItem.attributes.promoted),Nr(1),bo("ngIf",0!=e.basketEntry.recipesIds.length||e.displayReplace),Nr(1),bo("ngClass",bc(23,Uk,e.loading)),Nr(1),bo("ngIf",e.loading),Nr(1),bo("ngIf",!e.loading),Nr(3),Ko(" ",Pc(23,20,e.basketEntry.price,e.basketEntry.selectedItem.attributes.currency)," "),Nr(2),bo("value",e.basketEntry.quantity)("minusLoading",e.minusLoading)("disable",e.loading)("debounceTime",300)}}let Gk=(()=>{class e extends jy{constructor(e,t,i,n,r,s,o,a,c,l,u){super(e),this.cdr=t,this.recipeDetailsService=i,this.recipesService=n,this.posService=r,this.userService=s,this.basketsService=o,this.replaceItemService=a,this.elementRef=c,this.contextService=l,this.basketSynchroService=u,this.displayReplace=!1,this.replaceButtonClicked=new Rc,this.removed=new Rc,this.countChanged=new Rc,this.subscriptions=[],this.counterMinusLoading=!1,this.loading=!1,this.minusLoading=!1,this.isSponsored=!1,this.price=""}ngOnInit(){this.initListeners(),this.scrollBackToProductCard()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.cdr.detectChanges()}currentPath(){return""}replaceProduct(){this.replaceItemService.scrollBackToBasketEntryId=this.basketEntry.id,this.replaceButtonClicked.emit(),this.replaceItemService.replaceProductFromPreviewOpen$.pipe(bp(e=>!!e),fp(1)).subscribe()}scrollBackToProductCard(){this.replaceItemService.scrollBackToBasketEntryId===this.basketEntry.id&&setTimeout(()=>{var e;const t=null===(e=this.elementRef.nativeElement.firstElementChild)||void 0===e?void 0:e.id;document.getElementById(t)&&(document.getElementById(t).scrollIntoView({behavior:this.recipeDetailsService.hasReplaced?"smooth":"auto",block:"center",inline:"center"}),this.cdr.detectChanges(),this.replaceItemService.scrollBackToBasketEntryId=null,this.recipeDetailsService.hasReplaced=!1)},0)}counterChanged(e){if(0===e)this.removeProduct();else{const t=A_(this.basketEntry);t.quantity=e;const i=new N_(t,{eventTrace:this.eventTrace},this.basketsService);q(i.onTimeout,i.onError).pipe(fp(1)).subscribe(()=>{const e=this.basketEntry.quantity;this.basketEntry.quantity=null,this.cdr.detectChanges(),this.basketEntry.quantity=e,this.cdr.detectChanges()}),this.basketSynchroService.addToActionList([i]),i.onSuccess.pipe(fp(1)).subscribe(()=>{this.basketEntry.quantity=t.quantity,this.subscriptions.push(this.basketsService.reloadBasket().subscribe(()=>this.cdr.detectChanges()))}),this.analyticsService.sendEvent("entry.change-quantity",this.path,{entry_name:this.basketEntry.name,item_id:this.basketEntry.selectedItem.id,ext_item_id:this.basketEntry.selectedItem.attributes["ext-id"],item_ean:this.basketEntry.selectedItem.attributes.ean,product_quantity:this.basketEntry.attributes.quantity.toString(),recipe_id:this.basketEntry.recipesIds.length>0?this.basketEntry.recipesIds[0].toString():null})}}removeProduct(){this.analyticsService.sendEvent("entry.deleted",this.path,{entry_name:this.basketEntry.name,item_id:this.basketEntry.selectedItem.id,ext_item_id:this.basketEntry.selectedItem.attributes["ext-id"],item_ean:this.basketEntry.selectedItem.ean,product_quantity:this.basketEntry.quantity.toString(),recipe_id:this.basketEntry.recipesIds.length>0?this.basketEntry.recipesIds[0].toString():null});const e=A_(this.basketEntry);e.quantity=0;const t=new z_(e,{eventTrace:this.eventTrace},this.basketsService);this.basketSynchroService.addToActionList([t]),this.removed.emit(),this.cdr.detectChanges()}initListeners(){const e=Xg([this.basketsService.entryIsBeingUpdated(this.basketEntry.id),this.basketsService.entryIsBeingRemoved(this.basketEntry.id),this.basketsService.entryWillBeRemoved(this.basketEntry.id),this.replaceItemService.replaceProductFromPreviewOpen$]);this.subscriptions.push(e.subscribe(([e,t,i,n])=>{var r;const s=n&&(null===(r=this.replaceItemService.basketEntry)||void 0===r?void 0:r.id)===this.basketEntry.id;this.loading=e||t||i||s,this.minusLoading=t||i,this.cdr.detectChanges()}))}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(fv),vo(__),vo(Vf),vo(Yf),vo(C_),vo(yv),vo(wa),vo(Iv),vo($_))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-basket-preview-product"]],inputs:{basketEntry:"basketEntry",displayReplace:"displayReplace"},outputs:{replaceButtonClicked:"replaceButtonClicked",removed:"removed",countChanged:"countChanged"},features:[eo],decls:1,vars:1,consts:[["class","miam-basket-preview-product",3,"id",4,"ngIf"],[1,"miam-basket-preview-product",3,"id"],[1,"miam-basket-preview-product__infos-container"],[1,"miam-basket-preview-product__picture-container"],[1,"miam-basket-preview-product__picture"],["alt","product picture",3,"src","error"],[1,"miam-basket-preview-product__infos-and-actions"],[1,"miam-basket-preview-product__infos"],[1,"miam-basket-preview-product__title","mealz-ds-text","weight-l","size-s"],[1,"miam-product-card__badges"],[1,"miam-basket-preview-product__capacity","mealz-ds-badge"],["class","miam-basket-preview-product__sponsorised mealz-ds-badge",4,"ngIf"],["class","miam-basket-preview-product__replace-button mealz-ds-button ghost",3,"disabled","click",4,"ngIf"],[1,"miam-basket-preview-line__remove","mealz-ds-button","ghost",3,"ngClass","click"],["class","mealz-ds-loader",4,"ngIf"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/trash.svg","alt","remove recipe",4,"ngIf"],[1,"miam-basket-preview-product__price-and-action"],[1,"miam-basket-preview-product__price","mealz-ds-text","size-l","weight-xl"],["minRange","0",3,"value","minusLoading","disable","debounceTime","valueChange"],[1,"miam-basket-preview-product__sponsorised","mealz-ds-badge"],[1,"miam-basket-preview-product__replace-button","mealz-ds-button","ghost",3,"disabled","click"],[1,"mealz-ds-loader"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/trash.svg","alt","remove recipe"]],template:function(e,t){1&e&&fo(0,qk,25,25,"div",0),2&e&&bo("ngIf",t.basketEntry.selectedItem)},directives:[Ou,Du,Nb],pipes:[Db,Yu,Ku],styles:[".miam-basket-preview-product{display:flex;padding:12px;flex-direction:column;align-items:flex-start;align-self:stretch;background:var(--mealz-ds-color-background-primary,#fff)}.miam-basket-preview-product .miam-basket-preview-product__infos-container{display:flex;flex-direction:row;align-items:flex-start;width:100%}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__picture-container{position:relative;margin-right:12px;margin-bottom:12px}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__picture-container .miam-basket-preview-product__picture{height:100px;width:100px;border-radius:8px;cursor:pointer}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__picture-container .miam-basket-preview-product__picture img{height:100%;width:100%;-o-object-fit:cover;object-fit:cover;border-radius:8px}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__infos-and-actions{display:flex;align-items:flex-start;flex:1 0 0}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__infos-and-actions>:not(:last-child){margin-right:8px}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__infos-and-actions .miam-basket-preview-product__infos{display:flex;flex-direction:column;align-items:flex-start;flex:1 0 0}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__infos-and-actions .miam-basket-preview-product__infos>:not(:last-child){margin-bottom:4px}.miam-basket-preview-product .miam-basket-preview-product__infos-container .miam-basket-preview-product__infos-and-actions .miam-basket-preview-product__infos .miam-basket-preview-product__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-product-clamp:2;align-self:stretch;overflow:hidden;color:var(--mealz-ds-color-neutral-black,#02182b);text-overflow:ellipsis;cursor:pointer}.miam-basket-preview-product .miam-basket-preview-product__price-and-action{display:flex;flex-direction:row;justify-content:space-between;align-items:center;align-self:stretch}"],encapsulation:2,changeDetection:0}),e})(),Wk=(()=>{class e{constructor(e){const t={"basket-preview-product":Gk};Object.keys(t).map(i=>{const n="webc-miam-"+i;if(!customElements.get(n)){const r=uh(t[i],{injector:e});customElements.define(n,r)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,Lk,$k,jk]]}),e})();function Zk(e,t){if(1&e){const e=Io();wo(0,"ng-miam-basket-preview-product",7),Ao("replaceButtonClicked",(function(){Rt(e);const t=Fo().$implicit;return Fo().handleReplaceButtonClick(t)})),ko()}2&e&&bo("basketEntry",Fo().$implicit)("displayReplace",!0)}function Qk(e,t){if(1&e){const e=Io();wo(0,"div",8),wo(1,"span",9),Qo(2,"tradof#Le produit est indisponible.#"),ko(),wo(3,"button",10),Ao("click",(function(){Rt(e);const t=Fo().$implicit;return Fo().handleReplaceButtonClick(t)})),wo(4,"span"),Qo(5,"tradof#Remplacer#"),ko(),ko(),ko()}}function Yk(e,t){if(1&e&&(So(0),wo(1,"div",2),wo(2,"div",3),wo(3,"span",4),Qo(4),Ec(5,"capitalizeFirstLetter"),ko(),ko(),fo(6,Zk,1,2,"ng-miam-basket-preview-product",5),fo(7,Qk,6,0,"ng-template",null,6,Wc),ko(),xo()),2&e){const e=t.$implicit,i=_o(8);Nr(4),Yo(Ic(5,3,e.name)),Nr(2),bo("ngIf",e.selectedItem)("ngIfElse",i)}}let Kk=(()=>{class e extends jy{constructor(e,t,i,n){super(e),this.cdr=t,this.listScanService=i,this.replaceItemService=n,this.closed=new Rc,this.cancelled=new Rc,this.icon=Cv,this.entries=[],this.subscriptions=[]}ngOnInit(){this.subscriptions.push(this.listScanService.currentBasketEntries.subscribe(e=>{this.entries=e,this.cdr.detectChanges()}))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}currentPath(){return""}close(){this.closed.emit()}cancel(){this.cancelled.emit()}trackByEntryFn(e,t){return t.id}handleReplaceButtonClick(e){this.replaceItemService.changeReplaceModalState(!0,e),this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(jv),vo(yv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-list-scan-basket-preview"]],outputs:{closed:"closed",cancelled:"cancelled"},features:[eo],decls:3,vars:2,consts:[[1,"miam-list-scan__basket-preview"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"miam-list-scan__basket-preview__product"],[1,"miam-list-scan__basket-preview__product__name"],[1,"mealz-ds-text","size-s","weight-xl"],[3,"basketEntry","displayReplace","replaceButtonClicked",4,"ngIf","ngIfElse"],["noItem",""],[3,"basketEntry","displayReplace","replaceButtonClicked"],[1,"miam-list-scan__basket-preview__product__no-item"],[1,"mealz-ds-text","size-s","weight-m"],[1,"miam-basket-preview-product__replace-button","mealz-ds-button","ghost",3,"click"]],template:function(e,t){1&e&&(wo(0,"div",0),Co(1,"ng-miam-product-addition-card"),fo(2,Yk,9,5,"ng-container",1),ko()),2&e&&(Nr(2),bo("ngForOf",t.entries)("ngForTrackBy",t.trackByEntryFn))},directives:[Nw,Au,Ou,Gk],pipes:[Db],styles:[".miam-list-scan__basket-preview ng-miam-product-addition-card{margin-bottom:4px}.miam-list-scan__basket-preview .miam-list-scan__basket-preview__product{border-radius:4px;border:1px solid var(--mealz-ds-color-border);background:var(--mealz-ds-color-page-background);margin:4px 0}.miam-list-scan__basket-preview .miam-list-scan__basket-preview__product .miam-list-scan__basket-preview__product__name{padding:8px;border-bottom:1px solid var(--mealz-ds-color-background-secondary);background:#e6e6e6}.miam-list-scan__basket-preview .miam-list-scan__basket-preview__product .miam-list-scan__basket-preview__product__no-item{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:8px}"],encapsulation:2,changeDetection:0}),e})();function Jk(e,t){1&e&&(So(0),Co(1,"img",7),wo(2,"div",8),wo(3,"span"),Qo(4,"Scaneaz\u0103-mi lista"),ko(),ko(),xo())}const Xk=function(e){return{disabled:e}};function eC(e,t){if(1&e){const e=Io();wo(0,"div"),wo(1,"input",4),Ao("change",(function(t){return Rt(e),Fo().listScanService.sendFile(t)})),ko(),wo(2,"label",5),wo(3,"div",6),fo(4,Jk,5,0,"ng-container",1),ko(),ko(),ko()}if(2&e){const e=Fo(),t=_o(5);Nr(1),bo("disabled",e.loading),Nr(2),bo("ngClass",bc(4,Xk,e.loading)),Nr(1),bo("ngIf",!e.loading)("ngIfElse",t)}}function tC(e,t){1&e&&(So(0),Co(1,"img",12),wo(2,"span",8),Qo(3,"Import\u0103 lista mea"),ko(),xo())}function iC(e,t){if(1&e){const e=Io();wo(0,"input",9),Ao("change",(function(t){return Rt(e),Fo().listScanService.sendFile(t)})),ko(),wo(1,"label",10),wo(2,"div",11),fo(3,tC,4,0,"ng-container",1),ko(),ko()}if(2&e){const e=Fo(),t=_o(5);bo("disabled",e.loading),Nr(2),bo("ngClass",bc(4,Xk,e.loading)),Nr(1),bo("ngIf",!e.loading)("ngIfElse",t)}}function nC(e,t){1&e&&Co(0,"div",13)}let rC=(()=>{class e{constructor(e,t,i){this.cdr=e,this.mediaMatcher=t,this.listScanService=i,this.isSchoolList=!1,this.icon=Cv,this.loading=!1,this.isMobile=!1,this.isMobile=this.mediaMatcher.matchMedia("(max-width: 1023px)").matches}ngOnInit(){this.listScanService.sendingFile.subscribe(e=>{this.loading=e,this.cdr.detectChanges()})}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga),vo(ov),vo(jv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-list-scan-files-inputs"]],inputs:{isSchoolList:"isSchoolList"},decls:6,vars:2,consts:[[1,"miam-files-inputs"],[4,"ngIf","ngIfElse"],["desktop",""],["loader",""],["type","file","name","photo","id","photo","accept","image/*","capture","environment",1,"miam-files-inputs__inputfile",3,"disabled","change"],["for","photo"],[1,"mealz-ds-button","primary",3,"ngClass"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/ListScanner.svg","alt","take a photo"],[1,"mealz-ds-text","size-m","weight-xl"],["type","file","name","file","id","file","accept","image/*,application/pdf",1,"miam-files-inputs__inputfile",3,"disabled","change"],["for","file"],[1,"mealz-ds-button","secondary",3,"ngClass"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Upload.svg","alt","upload"],[1,"mealz-ds-loader"]],template:function(e,t){if(1&e&&(wo(0,"div",0),fo(1,eC,5,6,"div",1),fo(2,iC,4,6,"ng-template",null,2,Wc),fo(4,nC,1,0,"ng-template",null,3,Wc),ko()),2&e){const e=_o(3);Nr(1),bo("ngIf",1==t.isMobile)("ngIfElse",e)}},directives:[Ou,Du],styles:[".miam-files-inputs{position:relative;display:inline-block}.miam-files-inputs input{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}"],encapsulation:2,changeDetection:0}),e})(),sC=(()=>{class e extends jy{constructor(e,t,i,n){super(e),this.cdr=t,this.listScanService=i,this.basketSynchro=n,this.disableIngredientsMatching=!1,this.isSchoolList=!1,this.confirmed=new Rc,this.basketPreviewShown=!1,this.cancelConfirmationShown=!1,this.cancelling=!1,this.subscriptions=[]}ngOnInit(){this.listenEntries(),this.listenCancelling(),this.subscriptions.push(this.listScanService.sendingFile.subscribe(e=>{e&&(this.basketSynchro.ignoreMiam=!0)}))}ngOnChanges(e){e.isSchoolList&&(this.listScanService.isSchoolList=this.isSchoolList)}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.listScanService.unsubscribeService()}currentPath(){return"list-scan"}listenEntries(){this.subscriptions.push(this.listScanService.currentBasketEntries.pipe().subscribe(e=>{this.basketPreviewShown=e.length>0,this.cdr.detectChanges()}))}listenCancelling(){let e;this.subscriptions.push(this.listScanService.cancelling.pipe().subscribe(t=>{this.cancelling=t,!this.cancelling&&e&&(this.cancelConfirmationShown=!1),e=t,this.cdr.detectChanges()}))}confirm(){this.basketSynchro.ignoreMiam=!1,this.basketPreviewShown=!1,this.cdr.detectChanges(),this.confirmed.emit()}cancel(){this.cancelConfirmationShown=!0,this.cdr.detectChanges()}closeCancelConfirmationModal(){this.cancelConfirmationShown=!1,this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(jv),vo(L_))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-list-scan"]],inputs:{disableIngredientsMatching:"disableIngredientsMatching",isSchoolList:"isSchoolList"},outputs:{confirmed:"confirmed"},features:[eo,at],decls:7,vars:8,consts:[[1,"miam-list-scan"],[3,"isSchoolList"],["title","tradof#Nous avons trouv\xe9 pour vous#","cancelButtonText","tradof#Abandonner ma liste#","confirmButtonText","Ad\u0103uga\u021bi \xeen co\u0219","modalStyle","right",1,"miam-list-scan__result",3,"noHeaderMode","display","cancel","close","confirm"],[1,"miam-list-scan__content",3,"closed","cancelled"],["title","tradof#Abandonner ma liste#","cancelButtonText","Anulare","confirmButtonText","Abandonare",1,"miam-list-scan__confirmation",3,"display","noHeaderMode","confirmButtonDisabled","confirmButtonIsLoading","cancelButtonDisabled","displayChange","close","cancel","confirm"],[1,"mealz-ds-text","size-m","weight-m"]],template:function(e,t){1&e&&(wo(0,"div",0),Co(1,"ng-miam-list-scan-files-inputs",1),wo(2,"ng-miam-modal",2),Ao("cancel",(function(){return t.cancel()}))("close",(function(){return t.cancel()}))("confirm",(function(){return t.confirm()})),wo(3,"ng-miam-list-scan-basket-preview",3),Ao("closed",(function(){return t.confirm()}))("cancelled",(function(){return t.cancel()})),ko(),ko(),wo(4,"ng-miam-modal",4),Ao("displayChange",(function(e){return t.cancelConfirmationShown=e}))("close",(function(){return t.closeCancelConfirmationModal()}))("cancel",(function(){return t.closeCancelConfirmationModal()}))("confirm",(function(){return t.listScanService.cancelAndRemove(t.eventTrace)})),wo(5,"span",5),Qo(6,"tradof#Souhaitez-vous vraiment abandonner votre liste ?#"),ko(),ko(),ko()),2&e&&(Nr(1),bo("isSchoolList",t.isSchoolList),Nr(1),bo("noHeaderMode",!1)("display",t.basketPreviewShown),Nr(2),bo("display",t.cancelConfirmationShown)("noHeaderMode",!1)("confirmButtonDisabled",t.cancelling)("confirmButtonIsLoading",t.cancelling)("cancelButtonDisabled",t.cancelling))},directives:[rC,sw,Kk],styles:[".miam-list-scan .miam-list-scan__content{height:100%}@media (max-width:1023px){.miam-list-scan ng-miam-modal .miam-modal__container .miam-modal .miam-modal__content-container .miam-modal__actions .mealz-ds-button+button{margin-left:12px;margin-bottom:0}}.miam-list-scan ng-miam-modal.miam-list-scan__confirmation .miam-modal__container .miam-shadow-overlay{z-index:calc(var(--m-z-index-modal-overlay) + 1)}"],encapsulation:2,changeDetection:0}),e})(),oC=(()=>{class e{constructor(e){if(!customElements.get("webc-miam-list-scan")){const t=uh(sC,{injector:e});customElements.define("webc-miam-list-scan",t)}}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,$k,Wk,Lk]]}),e})();class aC{constructor(e){this.callback=e}call(e,t){return t.subscribe(new cC(e,this.callback))}}class cC extends m{constructor(e,t){super(e),this.add(new d(t))}}let lC=(()=>{class e{constructor(){this.icon=Cv,this.addRecipe=new Rc}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=He({type:e,selectors:[["ng-miam-add-recipe-card"]],outputs:{addRecipe:"addRecipe"},decls:5,vars:1,consts:[[1,"miam-add-recipe-card",3,"click"],[1,"m-button-primary"],["width","14","height","14",3,"iconName"],[1,"miam-add-recipe-card__label"]],template:function(e,t){1&e&&(wo(0,"div",0),Ao("click",(function(){return t.addRecipe.emit()})),wo(1,"button",1),Co(2,"ng-miam-icon",2),ko(),wo(3,"span",3),Qo(4,"Ad\u0103uga\u021bi o idee de mas\u0103"),ko(),ko()),2&e&&(Nr(2),bo("iconName",t.icon.Plus))},directives:[$y],styles:["ng-miam-add-recipe-card{flex-grow:1}.miam-add-recipe-card{border-radius:8px;height:var(--m-catalog-card-height);width:var(--m-catalog-card-width);border:1px dashed var(--m-color-primary);box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}.miam-add-recipe-card:hover{background-color:var(--m-color-grey)}.miam-add-recipe-card .m-button-primary{border-radius:6px;height:48px;width:48px}.miam-add-recipe-card .m-button-primary:hover{background-color:var(--m-color-primary);border:1px solid var(--m-color-white)}.miam-add-recipe-card .m-button-primary img{filter:brightness(0) invert(100%)}.miam-add-recipe-card .miam-add-recipe-card__label{font-size:14px;line-height:22px;color:var(--m-color-primary);font-weight:700;margin-top:16px}"],encapsulation:2,changeDetection:0}),e})(),uC=(()=>{class e extends Pv{constructor(e){super(e),this.http=e,this.componentStylesUrl=this.MEALZ_SSR_API+"/styles/drawer",this.scriptsPaths=[Pp+"/drawer/drawer.min.js",Pp+"/drawer-view-swapper/drawer-view-swapper.min.js"],this.loadStyles(),this.loadComponentScripts()}}return e.\u0275fac=function(t){return new(t||e)(nn(wd))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function dC(e,t){1&e&&(So(0),Co(1,"img",5),xo())}function hC(e,t){1&e&&Co(0,"img",6)}const pC=function(e,t,i){return{"in-basket":e,primary:t,secondary:i}};function mC(e,t){if(1&e){const e=Io();wo(0,"div",1),wo(1,"button",2),Ao("click",(function(t){return Rt(e),Fo().openRecipe(t)})),fo(2,dC,2,0,"ng-container",3),Ec(3,"async"),fo(4,hC,1,0,"ng-template",null,4,Wc),ko(),ko()}if(2&e){const e=_o(5),t=Fo();Nr(1),bo("disabled",!t.recipe)("ngClass",wc(6,pC,t.inBasket,!t.inBasket,t.inBasket)),Nr(1),bo("ngIf",!Ic(3,4,t.basketsService.recipeIsInBasket(t.recipe.id)))("ngIfElse",e)}}let gC=(()=>{class e extends jy{constructor(e,t,i,n,r,s,o,a){super(e),this.cdr=t,this.recipeService=i,this.basketsService=n,this.userService=r,this.pointOfSalesService=s,this.contextService=o,this.toasterService=a,this.previewAllowed=!0,this.helpButtonAllowed=!0,this.displayGuests=!0,this.displayed=new Rc,this.clicked=new Rc,this.hidden=new Rc,this.icon=Cv,this.inBasket=!1,this.subscriptions=[]}ngOnInit(){this.checkRecipeInBasket()}ngOnChanges(e){var t;if(this.recipe&&e.serves){const e=+this.recipe.modifiedGuests;this.recipe.modifiedGuests=this.serves,e!==this.serves&&this.updateRecipeGuests()}!this.recipe&&(null===(t=this.recipeName)||void 0===t?void 0:t.length)>0?this.subscriptions.push(this.searchRecipeByName().subscribe(e=>{this.recipe=e,e?(this.checkGuestsAndBasket(),this.cdr.detectChanges()):this.hidden.emit()})):!this.recipe&&this.recipeExtId?this.subscriptions.push(this.recipeService.searchRecipeByExtId(this.recipeExtId).subscribe(e=>{this.recipe=e,e?(this.contextService.noSupplier&&this.cdr.detectChanges(),this.checkGuestsAndBasket()):this.hidden.emit()})):this.checkRecipeInBasket()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}checkGuestsAndBasket(){var e;this.recipe&&(this.recipe.modifiedGuests=this.serves||+(null===(e=this.recipe)||void 0===e?void 0:e.guests),this.checkRecipeInBasket())}checkRecipeInBasket(){!this.basketSubscription&&this.recipe&&(this.basketSubscription=this.basketsService.recipeIsInBasket(this.recipe.id).subscribe(e=>{this.inBasket=e,this.cdr.detectChanges()}),this.subscriptions.push(this.basketSubscription))}searchRecipeByName(){return this.contextService.origin.pipe(bp(e=>!e),fp(1),th(e=>this.recipeService.all({remotefilter:{recipe_provider_id:e,search:this.recipeName}}).pipe(E(e=>{var t;return(null===(t=e.data[0])||void 0===t?void 0:t.attributes.title)===this.recipeName?e.data[0]:null}))))}currentPath(){return""}openRecipe(e){e.stopPropagation(),this.clicked.emit(),this.contextService.mealzInternal.recipes.openDetails(this.recipe.id,this.recipe.modifiedGuests,0),this.analyticsService.sendEvent("recipe.display",this.path,{recipe_id:this.recipe.id,category_id:this.originTrace.props.category_id}),this.displayed.emit()}sendShowEvent(){this.analyticsService.sendEvent("recipe.show",this.path,{recipe_id:this.recipe.id,category_id:this.originTrace.props.category_id})}updateRecipeGuests(){this.basketsService.updateRecipesInBasket([this.recipe.id],this.recipe.modifiedGuests,{originPath:"",props:{recipe_id:this.recipe.id}})}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(__),vo(C_),vo(Yf),vo(Vf),vo(Iv),vo(Zf))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-card-cta"]],inputs:{recipeName:"recipeName",recipeExtId:"recipeExtId",recipe:"recipe",serves:"serves",previewAllowed:"previewAllowed",helpButtonAllowed:"helpButtonAllowed",displayGuests:"displayGuests"},outputs:{displayed:"displayed",clicked:"clicked",hidden:"hidden"},features:[eo,at],decls:1,vars:1,consts:[["class","miam-recipe-card-cta",4,"ngIf"],[1,"miam-recipe-card-cta"],[1,"miam-recipe-card-cta__button","mealz-ds-button",3,"disabled","ngClass","click"],[4,"ngIf","ngIfElse"],["seeIngredients",""],["alt","basket icon","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Basket.svg"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/InCart_primary.svg","alt","see ingredients"]],template:function(e,t){1&e&&fo(0,mC,6,10,"div",0),2&e&&bo("ngIf",t.recipe)},directives:[Ou,Du],pipes:[Wu],styles:[".miam-recipe-card-cta{display:flex;justify-content:center;width:-moz-max-content;width:max-content}.miam-recipe-card-cta button{padding:12px 16px}.miam-recipe-card-cta button .mealz-ds-loader{width:20px;height:20px}.miam-recipe-card-cta button.mealz-ds-button.secondary.in-basket:hover:not(.loading):not(.disabled):not([disabled]){background-color:inherit;color:inherit}"],encapsulation:2,changeDetection:0}),e})();function fC(e,t){if(1&e&&Co(0,"ng-miam-like-button",31),2&e){const e=Fo(3);bo("recipe",e.recipe)("originTrace",e.eventTrace)}}function _C(e,t){if(1&e&&(wo(0,"div",30),fo(1,fC,1,2,"ng-miam-like-button",26),Ec(2,"async"),ko()),2&e){const e=Fo(2);Nr(1),bo("ngIf",!e.displayLikesBottom&&Ic(2,1,e.userService.isLogged$))}}function vC(e,t){1&e&&Co(0,"ng-miam-recipe-promotion-badge")}function bC(e,t){if(1&e&&(wo(0,"div",35),Co(1,"img",36),ko()),2&e){const e=Fo(3);Nr(1),bo("src",e.recipe.sponsorLogoUrl,Wn)}}function yC(e,t){if(1&e&&(wo(0,"div",32),fo(1,vC,1,0,"ng-miam-recipe-promotion-badge",33),fo(2,bC,2,1,"div",34),ko()),2&e){const e=Fo(2);Nr(1),bo("ngIf",!e.displayBadge&&e.isInPromotion),Nr(1),bo("ngIf",e.recipe.sponsorLogoUrl)}}function wC(e,t){1&e&&Co(0,"ng-miam-recipe-promotion-badge")}function kC(e,t){1&e&&Co(0,"img",40)}function CC(e,t){1&e&&Co(0,"img",41)}function SC(e,t){if(1&e&&(wo(0,"div",37),fo(1,wC,1,0,"ng-miam-recipe-promotion-badge",33),fo(2,kC,1,0,"img",38),fo(3,CC,1,0,"img",39),ko()),2&e){const e=Fo(2);bo("ngClass",e.isDrink?"drink":"food"),Nr(1),bo("ngIf",e.isInPromotion),Nr(1),bo("ngIf",!e.isDrink),Nr(1),bo("ngIf",e.isDrink)}}function xC(e,t){if(1&e&&(wo(0,"div",47),Qo(1),ko()),2&e){const e=Fo(3);Nr(1),Ko(" + ",e.recipe.modifiedIngredients.length-2," ")}}function EC(e,t){if(1&e){const e=Io();wo(0,"div",42),wo(1,"div",43),wo(2,"img",44),Ao("error",(function(t){Rt(e);const i=Fo(2);return t.target.src=i.contextService.defaultIngredientPicture})),ko(),ko(),wo(3,"div",43),wo(4,"img",45),Ao("error",(function(t){Rt(e);const i=Fo(2);return t.target.src=i.contextService.defaultIngredientPicture})),ko(),ko(),fo(5,xC,2,1,"div",46),ko()}if(2&e){const e=Fo(2);Nr(2),bo("src",e.ingredientPicture(e.recipe.modifiedIngredients[0]),Wn),Nr(2),bo("src",e.ingredientPicture(e.recipe.modifiedIngredients[1]),Wn),Nr(1),bo("ngIf",e.recipe.modifiedIngredients.length>2)}}function IC(e,t){if(1&e&&(wo(0,"div",51),Co(1,"img",52),wo(2,"span",53),Qo(3),ko(),ko()),2&e){const e=Fo(3);Nr(3),Yo(e.recipeService.difficultyLevels[e.recipe.difficulty-1].label)}}function PC(e,t){if(1&e&&(wo(0,"div",54),Co(1,"img",55),wo(2,"span",53),Qo(3),ko(),ko()),2&e){const e=Fo(3);Nr(3),Yo(e.recipe.totalTime)}}function DC(e,t){if(1&e&&(wo(0,"div",48),fo(1,IC,4,1,"div",49),fo(2,PC,4,1,"div",50),ko()),2&e){const e=Fo(2);Nr(1),bo("ngIf",e.recipe.difficulty),Nr(1),bo("ngIf",e.recipe.totalTime)}}function TC(e,t){1&e&&Co(0,"ng-miam-recipe-promotion-badge",56)}function AC(e,t){if(1&e){const e=Io();wo(0,"div",57),wo(1,"ng-miam-recipe-pricing",58),Ao("priceSet",(function(t){return Rt(e),Fo(2).updateIsInPromotion(t)})),ko(),ko()}if(2&e){const e=Fo(2);Nr(1),bo("recipeId",e.recipe.id)("serves",e.recipe.modifiedGuests||+e.recipe.guests)("inViewport",e.inViewport)}}function RC(e,t){if(1&e&&Co(0,"ng-miam-like-button",31),2&e){const e=Fo(2);bo("recipe",e.recipe)("originTrace",e.eventTrace)}}function OC(e,t){if(1&e){const e=Io();wo(0,"ng-miam-recipe-card-cta",59),Ao("displayed",(function(){return Rt(e),Fo(2).displayed.emit()}))("clicked",(function(t){return Rt(e),Fo(2).primaryButtonClicked$.emit(t)})),ko()}if(2&e){const e=Fo(2);bo("recipe",e.recipe)("previewAllowed",e.previewAllowed)("displayGuests",e.displayGuests)("helpButtonAllowed",e.helpButtonAllowed)("originTrace",e.eventTrace)}}function FC(e,t){if(1&e){const e=Io();wo(0,"div",60),wo(1,"button",61),Ao("click",(function(){return Rt(e),Fo(2).openCatalog.emit()})),wo(2,"span"),Qo(3,"tradof#Changer#"),ko(),ko(),wo(4,"button",62),Ao("click",(function(){return Rt(e),Fo(2).removeFromMealsPlanner.emit()})),Co(5,"ng-miam-icon",63),ko(),ko()}if(2&e){const e=Fo(2);Nr(5),bo("iconName",e.icon.Trash)}}function BC(e,t){if(1&e){const e=Io();wo(0,"button",61),Ao("click",(function(){Rt(e);const t=Fo(2);return t.addToMealsPlanner.emit(t.recipe)})),wo(1,"span"),Qo(2,"Ad\u0103uga\u021bi"),ko(),ko()}}function MC(e,t){if(1&e){const e=Io();wo(0,"div",2),Ao("inViewport",(function(){return Rt(e),Fo().cardInViewport()})),wo(1,"div",3),Ao("click",(function(){return Rt(e),Fo().openRecipe()})),wo(2,"div",4),wo(3,"img",5),Ao("error",(function(t){Rt(e);const i=Fo();return t.target.src=i.contextService.defaultRecipePicture})),ko(),ko(),Co(4,"div",6),wo(5,"div",7),wo(6,"div",8),fo(7,_C,3,3,"div",9),fo(8,yC,3,2,"div",10),fo(9,SC,4,4,"div",11),ko(),wo(10,"div",12),wo(11,"div",13),wo(12,"span"),Qo(13),ko(),ko(),wo(14,"div",14),wo(15,"span",15),Qo(16),ko(),Co(17,"img",16),ko(),ko(),ko(),ko(),wo(18,"div",17),fo(19,EC,6,3,"div",18),wo(20,"div",19),wo(21,"div",20),fo(22,DC,3,2,"div",21),wo(23,"div",22),fo(24,TC,1,0,"ng-miam-recipe-promotion-badge",23),fo(25,AC,2,3,"div",24),ko(),ko(),wo(26,"div",25),fo(27,RC,1,2,"ng-miam-like-button",26),Ec(28,"async"),fo(29,OC,1,5,"ng-miam-recipe-card-cta",27),ko(),fo(30,FC,6,1,"div",28),fo(31,BC,3,0,"button",29),ko(),ko(),ko()}if(2&e){const e=Fo();bo("threshold",0)("debounceTime",0),Nr(3),bo("src",null==e.recipe?null:e.recipe.attributes["media-url"],Wn)("alt",(null==e.recipe?null:e.recipe.attributes.title)+" picture"),Nr(4),bo("ngIf",!(e.displayBadge&&e.recipe.sponsorLogoUrl)),Nr(1),bo("ngIf",!e.displayBadge&&e.isInPromotion||e.recipe.sponsorLogoUrl),Nr(1),bo("ngIf",e.displayBadge),Nr(4),Yo(e.recipe.attributes.title),Nr(3),Yo(e.recipe.modifiedGuests||e.recipe.guests),Nr(3),bo("ngIf",e.contextService.displayIngredientPicturesOnRecipeCards&&(null==e.recipe||null==e.recipe.modifiedIngredients?null:e.recipe.modifiedIngredients.length)>1),Nr(3),bo("ngIf",e.displayInfos&&(e.recipe.difficulty||e.recipe.totalTime)),Nr(2),bo("ngIf",e.isInPromotion),Nr(1),bo("ngIf",e.recipe&&e.displayPricing),Nr(2),bo("ngIf",e.displayLikesBottom&&Ic(28,17,e.userService.isLogged$)),Nr(2),bo("ngIf",e.previewAllowed&&!e.addRecipeMode&&!e.replaceMode),Nr(1),bo("ngIf",e.replaceMode),Nr(1),bo("ngIf",e.addRecipeMode)}}function LC(e,t){if(1&e){const e=Io();wo(0,"div",2),Ao("inViewport",(function(){return Rt(e),Fo().cardInViewport()})),wo(1,"a",64),Co(2,"img",65),wo(3,"div",66),wo(4,"div",67),wo(5,"span"),Qo(6,"tradof#Besoin d'inspiration ?#"),ko(),ko(),wo(7,"button",68),wo(8,"span"),Qo(9,"tradof#D\xe9couvrez nos recettes#"),ko(),ko(),ko(),ko(),ko()}if(2&e){const e=Fo();bo("threshold",0)("debounceTime",0),Nr(1),bo("href",e.contextService.catalogUrl,Wn)}}const $C=function(e,t,i,n,r){return{"variant-1":e,"variant-2":t,"variant-3":i,"in-basket":n,"redirect-card":r}},jC=["recipe-provider","sponsors","tags"],zC={recipes:["title","number-of-guests","media-url","video-id","filigrane-logo-url","difficulty","preparation-time","cooking-time","resting-time",...jC],sponsors:["logo-url"],tags:["tag-type-id"],"recipe-provider":["name"]};let NC=(()=>{class e extends jy{constructor(e,t,i,n,r,s,o,a){super(e),this.cdr=t,this.recipeService=i,this.basketsService=n,this.userService=r,this.contextService=s,this.element=o,this.loadLitDrawerService=a,this.previewAllowed=!0,this.helpButtonAllowed=!0,this.displayInfos=!1,this.displayPricing=!0,this.displayGuests=!0,this.addRecipeMode=!1,this.replaceMode=!1,this.displayVariant=1,this.removedFromFavorite=new Rc,this.displayed=new Rc,this.removeFromMealsPlanner=new Rc,this.addToMealsPlanner=new Rc,this.openCatalog=new Rc,this.hide=new Rc,this.icon=Cv,this.actionsOpened=!1,this.isloaded=!1,this.inBasket=!1,this.inViewport=!1,this.isDrink=!1,this.isInPromotion=!1,this.displayLikesBottom=!1,this.displayBadge=!1,this.primaryButtonClicked$=new Rc,this.subscriptions=[]}ngOnInit(){this.subscriptions.push(this.recipeService.displayedRecipeChanged$.subscribe(()=>this.cdr.detectChanges()))}currentPath(){return""}ngOnChanges(e){this.updateDisplayVariant(),this.recipe?this.afterRecipeLoad(this.recipe):this.recipeId?this.loadRecipeFromId():e.productIds&&!this.randomModeEnable&&this.loadRecipeFromContext()}ngAfterViewInit(){this.subscriptions.push(this.basketsService.basket$.subscribe(()=>this.cdr.detectChanges())),this.subscriptions.push(this.recipeService.reloadRecipes$.subscribe(e=>{e&&this.cdr.detectChanges()}))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}updateDisplayVariant(){switch(this.displayVariant){case 2:this.displayBadge=!0,this.displayLikesBottom=!1;break;case 3:this.displayBadge=!0,this.displayLikesBottom=!0;break;default:this.displayBadge=!1,this.displayLikesBottom=!1}}openRecipe(){this.contextService.mealzInternal.recipes.openDetails(this.recipe.id,this.recipe.modifiedGuests,0),this.displayed.emit()}ingredientPicture(e){return e.picture||this.contextService.defaultIngredientPicture}sendShowEvent(){this.analyticsService.sendEvent("recipe.show",this.path,{recipe_id:this.recipe.id,category_id:this.originTrace.props.category_id})}cardInViewport(){this.inViewport=!0,this.cdr.detectChanges()}updateIsInPromotion(e){this.isInPromotion=e["discounted-ingredients-count"]>0,this.cdr.detectChanges()}loadRecipeFromId(){this.subscriptions.push(this.recipeService.get(this.recipeId,{include:jC,fields:zC}).pipe(bp(e=>e.is_loading),Wh(e=>(this.hide.emit(),td(e)))).subscribe(e=>{this.afterRecipeLoad(e)}))}loadRecipeFromContext(){this.subscriptions.push(this.fetchSuggestionOrRandom().pipe(bp(e=>!e),Wh(e=>(this.hide.emit(),td(e)))).subscribe(e=>{(null==e?void 0:e.length)>0?this.afterRecipeLoad(e[0]):(this.isloaded=!0,this.hide.emit(),this.cdr.detectChanges())}))}afterRecipeLoad(e){this.recipe=e,this.updateGuestsIfNecessary(),this.checkRecipeInBasket(),this.checkIsDrink(),this.isloaded=!0,this.cdr.detectChanges()}fetchSuggestionOrRandom(){return this.randomModeEnable?this.recipeService.getRandom(jC,zC):this.recipeService.getSuggestionFromContext(this.productIds,jC,zC)}updateGuestsIfNecessary(){this.subscriptions.push(this.basketsService.recipeIsInBasket(this.recipe.id).pipe(fp(1)).subscribe(e=>{e&&!this.recipe.modifiedGuests?this.recipe.modifiedGuests=this.serves||this.basketsService.guestsForRecipe(this.recipe.id)||+this.recipe.guests:this.recipe.modifiedGuests||(this.recipe.modifiedGuests=this.serves||+this.recipe.guests),this.cdr.detectChanges()}))}checkRecipeInBasket(){!this.basketSubscription&&this.recipe&&(this.basketSubscription=this.basketsService.recipeIsInBasket(this.recipe.id).subscribe(e=>{this.inBasket=e,this.cdr.detectChanges()}),this.subscriptions.push(this.basketSubscription))}checkIsDrink(){var e,t;const i=(null===(t=null===(e=this.recipe)||void 0===e?void 0:e.relationships.tags)||void 0===t?void 0:t.data)||[];this.isDrink=i.some(e=>["meal_type_boisson","meal_type_cocktail"].includes(e.id))}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(__),vo(C_),vo(Yf),vo(Iv),vo(wa),vo(uC))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-card"]],inputs:{recipeId:"recipeId",recipe:"recipe",randomModeEnable:"randomModeEnable",productIds:"productIds",previewAllowed:"previewAllowed",helpButtonAllowed:"helpButtonAllowed",displayInfos:"displayInfos",displayPricing:"displayPricing",displayGuests:"displayGuests",addRecipeMode:"addRecipeMode",replaceMode:"replaceMode",displayVariant:"displayVariant",serves:"serves"},outputs:{removedFromFavorite:"removedFromFavorite",displayed:"displayed",removeFromMealsPlanner:"removeFromMealsPlanner",addToMealsPlanner:"addToMealsPlanner",openCatalog:"openCatalog",hide:"hide"},features:[eo,at],decls:3,vars:10,consts:[["ngMiamInViewport","",1,"miam-recipe-card",3,"condition","ngClass","inViewport"],["class","miam-recipe-card__container","ngMiamInViewport","",3,"threshold","debounceTime","inViewport",4,"ngIf"],["ngMiamInViewport","",1,"miam-recipe-card__container",3,"threshold","debounceTime","inViewport"],[1,"miam-recipe-card__top",3,"click"],[1,"miam-recipe-card__picture"],["loading","lazy","aria-hidden","true",3,"src","alt","error"],[1,"miam-recipe-card__gradient"],[1,"miam-recipe-card__content"],[1,"miam-recipe-card__top-container"],["class","miam-recipe-card__like",4,"ngIf"],["class","miam-recipe-card_sponso_and_promo_badge",4,"ngIf"],["class","miam-recipe-card__badge-container",3,"ngClass",4,"ngIf"],[1,"miam-recipe-card__picture__bottom"],[1,"miam-recipe-card__title","mealz-ds-text","weight-xxl","size-m"],[1,"miam-recipe-card__counter"],[1,"mealz-ds-text","weight-xxl","size-m"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/recipe-counter.svg","alt","people"],[1,"miam-recipe-card__bottom"],["class","miam-recipe-card__ingredients__pictures",4,"ngIf"],[1,"miam-recipe-card__actions"],[1,"miam-recipe-card__infos"],["class","miam-recipe-card__difficulty-and-time",4,"ngIf"],[1,"miam-recipe-card__price-and-promotion"],["class","miam-recipe-card__bottom-promotion",4,"ngIf"],["class","miam-recipe-card__price",4,"ngIf"],[1,"miam-recipe-card__cta"],["class","miam-recipe-card__actions__icon",3,"recipe","originTrace",4,"ngIf"],[3,"recipe","previewAllowed","displayGuests","helpButtonAllowed","originTrace","displayed","clicked",4,"ngIf"],["class","miam-recipe-card__actions__replace",4,"ngIf"],["class","mealz-ds-button ghost",3,"click",4,"ngIf"],[1,"miam-recipe-card__like"],[1,"miam-recipe-card__actions__icon",3,"recipe","originTrace"],[1,"miam-recipe-card_sponso_and_promo_badge"],[4,"ngIf"],["class","miam-recipe-card__sponsor-container",4,"ngIf"],[1,"miam-recipe-card__sponsor-container"],["alt","sponsor picture",1,"miam-recipe-card__sponsor-picture",3,"src"],[1,"miam-recipe-card__badge-container",3,"ngClass"],["class","miam-recipe-card__badge","src","https://storage.googleapis.com/assets.miam.tech/generic/images/recipe_card-badge.svg","alt","recipe badge",4,"ngIf"],["class","miam-recipe-card__badge","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/9.0/recipe-card-badge-drinks.svg","alt","drink badge",4,"ngIf"],["src","https://storage.googleapis.com/assets.miam.tech/generic/images/recipe_card-badge.svg","alt","recipe badge",1,"miam-recipe-card__badge"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/9.0/recipe-card-badge-drinks.svg","alt","drink badge",1,"miam-recipe-card__badge"],[1,"miam-recipe-card__ingredients__pictures"],[1,"miam-recipe-card__ingredients__picture"],["alt","first ingredient picture",3,"src","error"],["alt","second ingredient picture",3,"src","error"],["class","miam-recipe-card__ingredients__more",4,"ngIf"],[1,"miam-recipe-card__ingredients__more"],[1,"miam-recipe-card__difficulty-and-time"],["class","miam-recipe-card__difficulty",4,"ngIf"],["class","miam-recipe-card__time",4,"ngIf"],[1,"miam-recipe-card__difficulty"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/ChefHat.svg","alt","difficulty"],[1,"mealz-ds-text","size-s","weight-m"],[1,"miam-recipe-card__time"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Clock.svg","alt","time"],[1,"miam-recipe-card__bottom-promotion"],[1,"miam-recipe-card__price"],[1,"mealz-ds-text","weight-xxl",3,"recipeId","serves","inViewport","priceSet"],[3,"recipe","previewAllowed","displayGuests","helpButtonAllowed","originTrace","displayed","clicked"],[1,"miam-recipe-card__actions__replace"],[1,"mealz-ds-button","ghost",3,"click"],[1,"mealz-ds-button","ghost","square",3,"click"],["primaryColor","var(--m-color-primary)",3,"iconName"],[1,"miam-recipe-card__redirect",3,"href"],["src","https://storage.googleapis.com/assets.miam.tech/generic/images/Suggestion_Redirect_Background.png"],[1,"miam-recipe-card__redirect__footer"],[1,"miam-recipe-card__redirect__title","mealz-ds-text","size-l","weight-xxl"],[1,"miam-recipe-card__redirect__button","mealz-ds-button","primary"]],template:function(e,t){1&e&&(wo(0,"div",0),Ao("inViewport",(function(){return t.sendShowEvent()})),fo(1,MC,32,19,"div",1),fo(2,LC,10,3,"div",1),ko()),2&e&&(bo("condition",!!t.recipe)("ngClass",kc(4,$C,2!==t.displayVariant&&3!==t.displayVariant,2===t.displayVariant,3===t.displayVariant,t.inBasket,t.isloaded&&!t.recipe)),Nr(1),bo("ngIf",t.recipe),Nr(1),bo("ngIf",t.isloaded&&!t.recipe))},directives:[Ab,Du,Ou,Vy,Vw,zw,gC,$y],pipes:[Wu],styles:[".miam-recipe-card{position:relative;display:flex;width:var(--m-catalog-card-width,308px);height:500px;flex-direction:column;align-items:flex-start;flex-shrink:0;border-radius:8px;overflow:hidden;cursor:pointer}.miam-recipe-card .miam-recipe-card__container{display:flex;flex-direction:column;height:100%;width:100%;flex-shrink:0;align-self:stretch}.miam-recipe-card .miam-recipe-card__container:hover .miam-recipe-card__top .miam-recipe-card__picture img{transform:scale(1.1)}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top{position:relative;flex:1;height:calc(100% - 72px)}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__picture{width:100%;height:100%;overflow:hidden}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__picture img{display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover;transition:transform .2s}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__gradient{position:absolute;width:100%;height:100%;top:0;left:0;background:linear-gradient(180deg,transparent 43.67%,rgba(0,0,0,.4) 91.33%)}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-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}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding:12px;box-sizing:border-box}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom .miam-recipe-card__title{color:var(--mealz-ds-color-neutral-white,#fff);text-shadow:0 2px 8px rgba(0,0,0,.15);text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom .miam-recipe-card__counter{display:flex;padding:4px 8px;align-items:center;border-radius:100px;background:var(--mealz-ds-color-neutral-white,#fff);color:var(--miam-color-neutral-black);height:-moz-fit-content;height:fit-content;flex-shrink:0}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom .miam-recipe-card__counter>:not(:last-child){margin-right:4px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom .miam-recipe-card__counter span{line-height:100%}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__picture__bottom .miam-recipe-card__counter img{width:16px;height:16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container{display:flex;flex-direction:row-reverse;justify-content:space-between;margin:12px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__sponsor-container{display:flex;padding:8px 12px;background-color:#fff;border-radius:100px;width:auto;height:auto;box-sizing:border-box}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__sponsor-container .miam-recipe-card__sponsor-picture{width:auto;height:auto;max-width:80px;max-height:40px;-o-object-fit:contain;object-fit:contain}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__badge-container,.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card_sponso_and_promo_badge{display:flex;flex-direction:column;align-items:flex-start}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__badge-container>:not(:last-child),.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card_sponso_and_promo_badge>:not(:last-child){margin-bottom:4px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__like .miam-like-button{border-radius:48px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__top .miam-recipe-card__content .miam-recipe-card__top-container .miam-recipe-card__like .miam-like-button.mealz-ds-button.primary.reverse.square.small .miam-like-button__icon{height:16px;width:16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom{display:flex;width:100%;height:72px;flex-direction:column;align-items:flex-start;justify-content:center;box-sizing:border-box;padding:12px;border-radius:0 0 8px 8px;background-color:var(--mealz-ds-color-neutral-white,#fff);border-right:1px solid var(--m-color-neutral-200,#d9dde1);border-bottom:1px solid var(--m-color-neutral-200,#d9dde1);border-left:1px solid var(--m-color-neutral-200,#d9dde1)}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions{display:flex;justify-content:space-between;align-items:center;align-self:stretch}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions>:not(:last-child){margin-right:8px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__infos{display:flex;flex-direction:column;align-items:flex-start}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__infos .miam-recipe-card__price-and-promotion .miam-recipe-card__bottom-promotion{display:none}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__cta{display:flex;flex-direction:row;align-items:center}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__cta>:not(:last-child){margin-right:16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time{display:flex;flex-direction:row;color:var(--mealz-ds-color-text-disabled);margin-bottom:4px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time>:not(:last-child){margin-right:12px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time .miam-recipe-card__difficulty,.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time .miam-recipe-card__time{display:flex}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time .miam-recipe-card__difficulty img,.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__difficulty-and-time .miam-recipe-card__time img{margin-right:4px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__price{color:var(--mealz-ds-color-primary);line-height:100%;margin-right:4px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__price .miam-recipe-pricing{max-width:70px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__price .miam-recipe-pricing .miam-recipe-pricing__wrapper .miam-recipe-pricing__wrapper__subline{color:rgba(31,53,67,.5);font-weight:500;line-height:100%}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__bottom .miam-recipe-card__actions .miam-recipe-card__actions__replace{display:flex;flex:1;justify-content:space-between;align-items:center}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect{display:flex;flex-direction:column;justify-content:flex-end;flex:1;border-radius:8px;border:1px solid var(--m-color-neutral-200,#d9dde1);box-sizing:border-box;text-decoration:unset}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect img{height:100%;-o-object-fit:cover;object-fit:cover}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect .miam-recipe-card__redirect__footer{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect .miam-recipe-card__redirect__footer .miam-recipe-card__redirect__button{margin-top:16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect .miam-recipe-card__redirect__footer .miam-recipe-card__redirect__button span{font-size:14px;font-weight:700;line-height:16px}@media (max-width:1023px){.miam-recipe-card.redirect-card{width:80vw;height:188px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect{flex-direction:row;height:100%}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect img{content:url(https://storage.googleapis.com/assets.miam.tech/generic/images/Suggestion_Redirect_Background_Mobile.png);height:136%;margin:-22px -16px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect .miam-recipe-card__redirect__footer{min-width:156px}.miam-recipe-card .miam-recipe-card__container .miam-recipe-card__redirect .miam-recipe-card__redirect__footer .miam-recipe-card__redirect__title{font-size:16px}}"],encapsulation:2,changeDetection:0}),e})(),VC=(()=>{class e{constructor(e){const t={"add-recipe-card":lC,"recipe-card":NC,"recipe-card-cta":gC};Object.keys(t).map(i=>{const n="webc-miam-"+i;if(!customElements.get(n)){const r=uh(t[i],{injector:e});customElements.define(n,r)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,Lk,$k,jk]]}),e})();const HC=["categoryContent"],UC=["categoryCards"];function qC(e,t){1&e&&(wo(0,"div",14),Co(1,"div",15),wo(2,"div"),Qo(3,"\nSe \xeencarc\u0103 rezultatele... "),ko(),ko())}function GC(e,t){if(1&e&&Co(0,"ng-miam-recipe-card",16),2&e){const e=t.$implicit,i=Fo(2);bo("recipe",e)("displayInfos",i.displayInfos)("displayPricing",i.displayPricing)("displayVariant",i.displayRecipeVariant)("originTrace",i.eventTrace)}}function WC(e,t){if(1&e){const e=Io();wo(0,"div",1),Ao("inViewport",(function(){return Rt(e),Fo().sendShowEvent()})),wo(1,"div",2),wo(2,"div",3),Ao("click",(function(){return Rt(e),Fo().displayListMode()})),Qo(3),ko(),wo(4,"div",4),wo(5,"div",5),Qo(6),ko(),wo(7,"div",6),Ao("click",(function(){return Rt(e),Fo().displayListMode()})),wo(8,"span"),Qo(9,"Vede\u021bi totul"),ko(),Co(10,"img",7),ko(),ko(),ko(),wo(11,"div",8,9),wo(13,"div",10,11),fo(15,qC,4,0,"div",12),Ec(16,"async"),fo(17,GC,1,5,"ng-miam-recipe-card",13),ko(),ko(),ko()}if(2&e){const e=Fo();bo("condition",e.recipes.length>0),Nr(3),Yo(e.title),Nr(3),Yo(e.subtitle),Nr(9),bo("ngIf",Ic(16,6,e.loading)),Nr(2),bo("ngForOf",e.recipes)("ngForTrackBy",e.trackByFn)}}const ZC=["recipe-provider","sponsors","tags"],QC={recipes:["title","number-of-guests","media-url","video-id","filigrane-logo-url","difficulty","preparation-time","cooking-time","resting-time",...ZC],sponsors:["logo-url"],tags:["tag-type-id"],"recipe-provider":["name"]};let YC=(()=>{class e extends jy{constructor(e,t,i,n){super(e),this.recipesService=t,this.context=i,this.cdr=n,this.title="",this.maxRecipeNumber=20,this.displayInfos=!1,this.displayPricing=!0,this.displayRecipeVariant=1,this.loading=new Rc(!0),this.isHidden=new Rc(!1),this.recipes=[],this.hide=!1,this.icon=Cv,this.displayList=new Rc,this.subscriptions=[],this.recipes=[]}get props(){var e,t;const i={};return(null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.filters.packages)&&(i.category_id=this.filters.additionalFilters.filters.packages),i}ngOnChanges(e){var t;(e.filters||e.maxRecipeNumber||e.modifiedGuests)&&this.subscriptions.push(this.loadRecipes().pipe((t=()=>{this.hide=0===this.recipes.length,this.hide&&this.isHidden.emit(!0),this.loading.emit(!1),this.cdr.detectChanges()},e=>e.lift(new aC(t)))).subscribe())}sendShowEvent(){this.analyticsService.sendEvent("category.show",this.path,{category_id:this.filters.additionalFilters.filters.packages})}currentPath(){return""}loadRecipes(){return this.filters?(this.context.displayIngredientPicturesOnRecipeCards&&!ZC.includes("ingredients")&&(ZC.push("ingredients"),QC.recipes.push("ingredients"),QC.ingredients=["name","quantity","unit","active","forced-eans","picture-url","position"]),this.recipesService.addMandatoryCompletionToFilter(this.filters).pipe(th(e=>this.recipesService.filter(e,{number:1,size:this.maxRecipeNumber>0?this.maxRecipeNumber<30?this.maxRecipeNumber:30:0},ZC,QC,this.modifiedGuests,!1,"position")),df(e=>this.recipes=e))):td([])}displayListMode(){this.analyticsService.sendEvent("category.display",this.path,{category_id:this.filters.additionalFilters.filters.packages}),this.displayList.emit({title:this.title,filters:this.filters.additionalFilters.filters,subtitle:this.subtitle})}trackByFn(e,t){return t.id}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(__),vo(Iv),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-catalog-category"]],viewQuery:function(e,t){if(1&e&&(Uc(HC,1),Uc(UC,1),Uc(NC,1)),2&e){let e;Hc(e=qc())&&(t.categoryContent=e.first),Hc(e=qc())&&(t.categoryCards=e.first),Hc(e=qc())&&(t.recipeCards=e)}},inputs:{filters:"filters",title:"title",subtitle:"subtitle",maxRecipeNumber:"maxRecipeNumber",modifiedGuests:"modifiedGuests",displayInfos:"displayInfos",displayPricing:"displayPricing",displayRecipeVariant:"displayRecipeVariant"},outputs:{displayList:"displayList",loading:"loading",isHidden:"isHidden"},features:[eo,at],decls:1,vars:1,consts:[["class","miam-catalog-category","ngMiamInViewport","",3,"condition","inViewport",4,"ngIf"],["ngMiamInViewport","",1,"miam-catalog-category",3,"condition","inViewport"],[1,"miam-catalog-category__header"],[1,"miam-catalog-category__title",3,"click"],[1,"miam-catalog-category__header__bottom"],[1,"miam-catalog-category__subtitle","mealz-ds-text","size-s","weight-l"],[1,"miam-catalog-category__link","mealz-ds-text","size-s","weight-xl",3,"click"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg","alt","Arrow"],[1,"miam-catalog-category__content"],["categoryContent",""],[1,"miam-catalog-category__cards"],["categoryCards",""],["class","miam-catalog-category__loader",4,"ngIf"],[3,"recipe","displayInfos","displayPricing","displayVariant","originTrace",4,"ngFor","ngForOf","ngForTrackBy"],[1,"miam-catalog-category__loader"],[1,"miam-ds-loader"],[3,"recipe","displayInfos","displayPricing","displayVariant","originTrace"]],template:function(e,t){1&e&&fo(0,WC,18,8,"div",0),2&e&&bo("ngIf",!t.hide)},directives:[Ou,Ab,Au,NC],pipes:[Wu],styles:[".miam-catalog-category{display:flex;flex-direction:column;margin:20px 0}.miam-catalog-category .miam-catalog-category__header{display:flex;flex-direction:column;margin-bottom:16px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__title{width:-moz-fit-content;width:fit-content;margin-bottom:4px;font-size:24px;line-height:34px;font-weight:700;cursor:pointer}@media (min-width:1024px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__title:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__header__bottom{display:flex;align-items:center;justify-content:space-between;width:100%}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__header__bottom .miam-catalog-category__subtitle{color:var(--mealz-ds-color-neutral-500)}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__header__bottom .miam-catalog-category__link{display:flex;align-items:center;color:var(--mealz-ds-color-primary);cursor:pointer;white-space:nowrap;margin-left:16px;margin-right:4px}@media (min-width:1024px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__header__bottom .miam-catalog-category__link:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__content{position:relative;overflow:hidden;padding:16px 0;width:100%;height:var(--m-catalog-card-height);box-sizing:content-box}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{display:flex;flex-direction:row;flex-wrap:wrap;transition-duration:.5s;margin:-8px}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards>*{margin:8px}@media (min-width:1025px){.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards ng-miam-recipe-card{flex:1;min-width:240px;max-width:308px;display:flex}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards ng-miam-recipe-card .miam-recipe-card{flex:1}}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards .miam-catalog-category__loader{width:100%;font-size:20px;font-weight:700;color:var(--m-color-grey-text);text-align:center}@media (max-width:1023px){.miam-catalog-category .miam-catalog-category__header{flex-direction:column;align-items:flex-start;margin:0 24px 8px}.miam-catalog-category .miam-catalog-category__content{overflow-x:auto;margin:16px 0}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{flex-wrap:nowrap;padding:0 24px}}"],encapsulation:2,changeDetection:0}),e})();const KC=function(e){return{active:e}};function JC(e,t){if(1&e){const e=Io();wo(0,"a",12),Ao("click",(function(){return Rt(e),Fo().returnButtonPressed.emit()})),wo(1,"span"),Qo(2,"Idei de mas\u0103"),ko(),ko()}if(2&e){const e=Fo();bo("ngClass",bc(1,KC,e.home))}}function XC(e,t){if(1&e){const e=Io();wo(0,"a",13),Ao("click",(function(){return Rt(e),Fo().returnButtonPressed.emit()})),Qo(1),ko()}if(2&e){const e=Fo();bo("ngClass",bc(2,KC,e.home)),Nr(1),Yo(e.homeLabel)}}function eS(e,t){1&e&&Co(0,"img",5)}function tS(e,t){1&e&&(wo(0,"span",21),Qo(1,"tradof#Votre recherche :#\xa0"),ko())}function iS(e,t){if(1&e&&(wo(0,"span"),Qo(1),ko()),2&e){const e=Fo(2);Nr(1),Yo(e.searchTerm)}}function nS(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Mon carnet#"),ko())}function rS(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Favoris#"),ko())}function sS(e,t){if(1&e&&(wo(0,"div",22),fo(1,nS,2,0,"span",16),fo(2,rS,2,0,"span",16),ko()),2&e){const e=Fo(2);Nr(1),bo("ngIf",e.context.orderHistoryEnabled),Nr(1),bo("ngIf",!e.context.orderHistoryEnabled)}}function oS(e,t){1&e&&(wo(0,"span",23),Qo(1,"tradof#Toutes nos recettes#"),ko())}function aS(e,t){if(1&e&&(wo(0,"span",24),Qo(1),ko()),2&e){const e=Fo(2);Nr(1),Yo(e.additionalFiltersTitle)}}function cS(e,t){1&e&&(wo(0,"span",25),Qo(1,"Selec\u021bia dvs."),ko())}function lS(e,t){if(1&e&&(wo(0,"a",14),fo(1,tS,2,0,"span",15),fo(2,iS,2,1,"span",16),fo(3,sS,3,2,"div",17),fo(4,oS,2,0,"span",18),fo(5,aS,2,1,"span",19),fo(6,cS,2,0,"span",20),ko()),2&e){const e=Fo();bo("ngClass",bc(7,KC,!e.home)),Nr(1),bo("ngIf",e.isSearchPage()),Nr(1),bo("ngIf",e.isSearchPage()),Nr(1),bo("ngIf",e.isFavoritesPage()),Nr(1),bo("ngIf",e.isAllRecipesPage()),Nr(1),bo("ngIf",e.isCategoryPage()),Nr(1),bo("ngIf",e.isDefaultPage())}}function uS(e,t){if(1&e&&(wo(0,"div"),Qo(1),ko()),2&e){const e=Fo(2);Nr(1),Ko(" ",null==e.catalogSetting?null:e.catalogSetting.attributes["banner-text"]," ")}}function dS(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Id\xe9es repas en 1 clic#"),ko())}function hS(e,t){if(1&e&&(wo(0,"div",26),wo(1,"div",27),fo(2,uS,2,1,"div",28),fo(3,dS,2,0,"ng-template",null,29,Wc),ko(),ko()),2&e){const e=_o(4),t=Fo();Nr(2),bo("ngIf",(null==t.catalogSetting||null==t.catalogSetting.attributes["banner-text"]?null:t.catalogSetting.attributes["banner-text"].length)>0)("ngIfElse",e)}}function pS(e,t){if(1&e&&Co(0,"div",30),2&e){const e=Fo();Vo("background-image","url("+((null==e.catalogSetting||null==e.catalogSetting.attributes["banner-image"]?null:e.catalogSetting.attributes["banner-image"].length)>0?null==e.catalogSetting?null:e.catalogSetting.attributes["banner-image"]:e.pictureUrl)+")")}}const mS=function(e){return{reduced:e}};let gS=(()=>{class e{constructor(e,t){this.cdr=e,this.context=t,this.pictureUrl="",this.returnButtonPressed=new Rc,this.icon=Cv,this.searchString=""}ngOnChanges(){this.cdr.detectChanges()}isSearchPage(){return!this.home&&!this.history&&this.searchTerm&&this.searchTerm.length>0}isFavoritesPage(){return!this.home&&!this.isSearchPage()&&"Mes id\xe9es repas"===this.additionalFiltersTitle}isAllRecipesPage(){return!this.home&&!this.isSearchPage()&&!this.isFavoritesPage()&&"Toutes nos recettes"===this.additionalFiltersTitle}isCategoryPage(){var e;return!this.home&&!this.isSearchPage()&&!this.isFavoritesPage()&&!this.isAllRecipesPage()&&(null===(e=this.additionalFiltersTitle)||void 0===e?void 0:e.length)>0}isDefaultPage(){return!(this.home||this.isSearchPage()||this.isFavoritesPage()||this.isAllRecipesPage()||this.isCategoryPage())}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga),vo(Iv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-catalog-header"]],inputs:{home:"home",history:"history",searchTerm:"searchTerm",additionalFiltersTitle:"additionalFiltersTitle",homeLabel:"homeLabel",pictureUrl:"pictureUrl",catalogSetting:"catalogSetting"},outputs:{returnButtonPressed:"returnButtonPressed"},features:[at],decls:12,vars:9,consts:[[1,"miam-catalog-header",3,"ngClass"],[1,"miam-catalog-header__left"],[1,"miam-catalog-header__nav"],["href","/"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Home.svg","alt","Home"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Caret.svg","alt","Caret"],["href","javascript:void(0)","class","mealz-ds-text size-s weight-l",3,"ngClass","click",4,"ngIf"],["href","javascript:void(0)",3,"ngClass","click",4,"ngIf"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Caret.svg","alt","Caret",4,"ngIf"],["href","javascript:void(0)","class","mealz-ds-text size-s weight-xxl",3,"ngClass",4,"ngIf"],["class","miam-catalog-header__title-container",4,"ngIf"],["class","miam-catalog-header__right",3,"background-image",4,"ngIf"],["href","javascript:void(0)",1,"mealz-ds-text","size-s","weight-l",3,"ngClass","click"],["href","javascript:void(0)",3,"ngClass","click"],["href","javascript:void(0)",1,"mealz-ds-text","size-s","weight-xxl",3,"ngClass"],["class","miam-catalog-header__search-label",4,"ngIf"],[4,"ngIf"],["class","miam-catalog-header__favorites-label",4,"ngIf"],["class","miam-catalog-header__all-recipes-label",4,"ngIf"],["class","miam-catalog-header__category-label",4,"ngIf"],["class","miam-catalog-header__default-label",4,"ngIf"],[1,"miam-catalog-header__search-label"],[1,"miam-catalog-header__favorites-label"],[1,"miam-catalog-header__all-recipes-label"],[1,"miam-catalog-header__category-label"],[1,"miam-catalog-header__default-label"],[1,"miam-catalog-header__title-container"],[1,"miam-catalog-header__title"],[4,"ngIf","ngIfElse"],["baseTitle",""],[1,"miam-catalog-header__right"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"div",1),wo(2,"div",2),wo(3,"a",3),Co(4,"img",4),ko(),Co(5,"img",5),fo(6,JC,3,3,"a",6),fo(7,XC,2,4,"a",7),fo(8,eS,1,0,"img",8),fo(9,lS,7,9,"a",9),ko(),fo(10,hS,5,2,"div",10),ko(),fo(11,pS,1,2,"div",11),ko()),2&e&&(bo("ngClass",bc(7,mS,!t.home)),Nr(6),bo("ngIf",!t.homeLabel),Nr(1),bo("ngIf",t.homeLabel),Nr(1),bo("ngIf",!t.home),Nr(1),bo("ngIf",!t.home),Nr(1),bo("ngIf",t.home),Nr(1),bo("ngIf",t.home))},directives:[Du,Ou],styles:[".miam-catalog-header{position:relative;display:flex;width:100%;background-repeat:no-repeat;background-size:60% 100%;background-position:100% 0}.miam-catalog-header.reduced{background-image:none!important;background-color:var(--mealz-ds-color-neutral-white);border-bottom:1px solid var(--mealz-ds-color-border);box-sizing:border-box}.miam-catalog-header.reduced .miam-catalog-header__left{flex-direction:row;justify-content:space-between;align-items:center;max-width:unset;border-bottom:unset;padding:unset}.miam-catalog-header.reduced .miam-catalog-header__left .miam-catalog-header__nav{margin-bottom:0;width:100%;padding:16px 24px}.miam-catalog-header.reduced .miam-catalog-header__left .miam-catalog-header__title-container{width:auto;flex-grow:1;margin-left:24px}.miam-catalog-header.reduced .miam-catalog-header__right{background-image:none!important;flex:0;align-items:center;padding:unset;height:unset}.miam-catalog-header .miam-catalog-header__left{display:flex;flex-direction:column;align-items:flex-start;padding:32px 40px;flex:1;max-width:548px;border-bottom:1px solid var(--mealz-ds-color-border)}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__nav{display:flex;align-items:center;font-weight:700;margin-bottom:24px}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__nav>*{margin-right:4px;text-align:center}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__nav>a{display:flex;align-items:center;color:var(--mealz-ds-color-neutral-500);text-decoration:none;font-weight:500}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__nav>a.active{font-weight:900;color:var(--mealz-ds-color-primary)}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__title-container{width:100%}.miam-catalog-header .miam-catalog-header__left .miam-catalog-header__title{display:flex;font-size:40px;line-height:42px;font-weight:900;margin-bottom:24px;color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-catalog-header:not(.reduced) .miam-catalog-header__nav{display:none}.miam-catalog-header .miam-catalog-header__right{display:flex;flex-direction:row;align-items:flex-end;justify-content:flex-end;padding:32px 24px 24px 4px;height:164px;flex:1;background-size:cover;background-position:50%}@media (max-width:1023px){.miam-catalog-header.reduced{display:none}}@media (max-width:607px){.miam-catalog-header.reduced,.miam-catalog-header:not(.reduced){background-color:var(--mealz-ds-color-background-primary);border-bottom:1px solid var(--mealz-ds-color-border)}.miam-catalog-header.reduced .miam-catalog-header__left,.miam-catalog-header:not(.reduced) .miam-catalog-header__left{max-width:unset;padding:16px;border-bottom:unset}.miam-catalog-header.reduced .miam-catalog-header__left .miam-catalog-header__nav,.miam-catalog-header:not(.reduced) .miam-catalog-header__left .miam-catalog-header__nav{display:none}.miam-catalog-header.reduced .miam-catalog-header__left .miam-catalog-header__title-container,.miam-catalog-header:not(.reduced) .miam-catalog-header__left .miam-catalog-header__title-container{margin-left:0}.miam-catalog-header.reduced .miam-catalog-header__left .miam-catalog-header__title-container .miam-catalog-header__title,.miam-catalog-header:not(.reduced) .miam-catalog-header__left .miam-catalog-header__title-container .miam-catalog-header__title{font-size:24px;margin-bottom:0}.miam-catalog-header.reduced .miam-catalog-header__right,.miam-catalog-header:not(.reduced) .miam-catalog-header__right{background-image:none!important;justify-content:center}.miam-catalog-header:not(.reduced){flex-direction:column}.miam-catalog-header:not(.reduced) .miam-catalog-header__right{padding:0}.miam-catalog-header.reduced{padding:16px;box-sizing:border-box}.miam-catalog-header.reduced .miam-catalog-header__left,.miam-catalog-header.reduced .miam-catalog-header__right{padding:unset}}"],encapsulation:2,changeDetection:0}),e})();function fS(e,t){if(1&e){const e=Io();wo(0,"input",15),Ao("ngModelChange",(function(t){return Rt(e),Fo().searchString=t}))("keydown.enter",(function(){return Rt(e),Fo().emitSearchString()}))("blur",(function(){return Rt(e),Fo().emitSearchString()})),ko()}2&e&&bo("ngModel",Fo().searchString)}function _S(e,t){if(1&e){const e=Io();wo(0,"input",16),Ao("ngModelChange",(function(t){return Rt(e),Fo().searchString=t}))("keydown.enter",(function(){return Rt(e),Fo().emitSearchString()}))("blur",(function(){return Rt(e),Fo().emitSearchString()})),ko()}2&e&&bo("ngModel",Fo().searchString)}function vS(e,t){if(1&e&&(wo(0,"div",19),Qo(1),ko()),2&e){const e=Fo(2);Nr(1),Ko(" ",e.filterBadgeCount," ")}}const bS=function(e){return{hidden:e}};function yS(e,t){if(1&e){const e=Io();wo(0,"button",17),Ao("click",(function(){return Rt(e),Fo().filterButtonPressed.emit()})),Co(1,"img",18),fo(2,vS,2,1,"div",11),ko()}if(2&e){const e=Fo();bo("ngClass",bc(3,bS,e.hideButtons))("disabled",e.hideButtons),Nr(2),bo("ngIf",e.filterBadgeCount&&e.filterBadgeCount>0)}}function wS(e,t){if(1&e){const e=Io();wo(0,"button",20),Ao("click",(function(){return Rt(e),Fo().returnHomePressed.emit()})),Co(1,"img",21),ko()}}function kS(e,t){if(1&e&&(wo(0,"div",19),Qo(1),ko()),2&e){const e=Fo(2);Nr(1),Ko(" ",e.filterBadgeCount," ")}}function CS(e,t){if(1&e){const e=Io();wo(0,"button",17),Ao("click",(function(){return Rt(e),Fo().filterButtonPressed.emit()})),Co(1,"img",18),fo(2,kS,2,1,"div",11),ko()}if(2&e){const e=Fo();bo("ngClass",bc(3,bS,e.hideButtons))("disabled",e.hideButtons),Nr(2),bo("ngIf",e.filterBadgeCount>0)}}function SS(e,t){1&e&&(wo(0,"span",22),Qo(1,"Preferin\u021be"),ko())}function xS(e,t){if(1&e&&(wo(0,"div",19),Qo(1),ko()),2&e){const e=Fo();Nr(1),Ko(" ",e.preferencesBadgeCount," ")}}function ES(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Mon carnet#"),ko())}function IS(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Favoris#"),ko())}function PS(e,t){if(1&e&&(wo(0,"div",23),fo(1,ES,2,0,"span",24),fo(2,IS,2,0,"span",24),ko()),2&e){const e=Fo();Nr(1),bo("ngIf",e.context.orderHistoryEnabled),Nr(1),bo("ngIf",!e.context.orderHistoryEnabled)}}const DS=function(e){return{"hidden-reduced":e}},TS=function(e,t,i){return{hidden:e,"ghost square":t,full:i}};let AS=(()=>{class e{constructor(e,t,i){this.cdr=e,this.preferencesService=t,this.context=i,this.hideButtons=!1,this.filterBadgeCount=0,this.reduced=!1,this.filterButtonPressed=new Rc,this.favoritesButtonPressed=new Rc,this.preferencesButtonPressed=new Rc,this.searchStringChanged=new Rc,this.returnHomePressed=new Rc,this.searchString="",this.preferencesBadgeCount=0,this.subscriptions=[]}ngOnInit(){this.subscriptions.push(this.preferencesService.currentPreferencesNumber.subscribe(e=>{this.preferencesBadgeCount=e,this.cdr.detectChanges()}))}ngOnChanges(){this.cdr.detectChanges()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}resetSearchString(){this.searchString="",this.cdr.detectChanges()}emitSearchString(){this.cdr.detectChanges(),this.searchStringChanged.emit(this.searchString)}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga),vo(d_),vo(Iv))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-catalog-toolbar"]],inputs:{home:"home",history:"history",searchTerm:"searchTerm",additionalFiltersTitle:"additionalFiltersTitle",hideButtons:"hideButtons",filterBadgeCount:"filterBadgeCount",reduced:"reduced"},outputs:{filterButtonPressed:"filterButtonPressed",favoritesButtonPressed:"favoritesButtonPressed",preferencesButtonPressed:"preferencesButtonPressed",searchStringChanged:"searchStringChanged",returnHomePressed:"returnHomePressed"},features:[at],decls:16,vars:26,consts:[[1,"miam-catalog-toolbar"],[1,"miam-catalog-toolbar__searchbar-container"],[1,"miam-catalog-toolbar__searchbar",3,"ngClass"],["type","text","placeholder","tradof#Je cherche mon repas pr\xe9f\xe9r\xe9#","class","mealz-catalog-toolbar__searchbar miam-ds-searchbar miam-ds-text size-s weight-l",3,"ngModel","ngModelChange","keydown.enter","blur",4,"ngIf"],["type","text","placeholder","tradof#Je cherche un ingr\xe9dient ou un repas#","class","mealz-catalog-toolbar__searchbar miam-ds-searchbar miam-ds-text size-s weight-l",3,"ngModel","ngModelChange","keydown.enter","blur",4,"ngIf"],["class","miam-catalog-toolbar__controls__filter mealz-ds-button ghost square",3,"ngClass","disabled","click",4,"ngIf"],["class","miam-recipe-toolbar__return-button mealz-ds-button ghost square",3,"click",4,"ngIf"],[1,"miam-catalog-toolbar__buttons-container"],[1,"mealz-ds-button","miam-catalog-toolbar__controls__preferences",3,"ngClass","disabled","click"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/cog_neutral.svg","alt","preference icon"],["class","miam-catalog-toolbar__controls__preferences-label",4,"ngIf"],["class","miam-catalog-toolbar__controls__filter-badge",4,"ngIf"],[1,"mealz-ds-button","miam-catalog-toolbar__controls__favorites",3,"ngClass","disabled","click"],["alt","Heart",3,"src"],["class","miam-catalog-toolbar__controls__favorites-label",4,"ngIf"],["type","text","placeholder","tradof#Je cherche mon repas pr\xe9f\xe9r\xe9#",1,"mealz-catalog-toolbar__searchbar","miam-ds-searchbar","miam-ds-text","size-s","weight-l",3,"ngModel","ngModelChange","keydown.enter","blur"],["type","text","placeholder","tradof#Je cherche un ingr\xe9dient ou un repas#",1,"mealz-catalog-toolbar__searchbar","miam-ds-searchbar","miam-ds-text","size-s","weight-l",3,"ngModel","ngModelChange","keydown.enter","blur"],[1,"miam-catalog-toolbar__controls__filter","mealz-ds-button","ghost","square",3,"ngClass","disabled","click"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Filters.svg","alt","Filters"],[1,"miam-catalog-toolbar__controls__filter-badge"],[1,"miam-recipe-toolbar__return-button","mealz-ds-button","ghost","square",3,"click"],["alt","return","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/ArrowLeft_dark.svg"],[1,"miam-catalog-toolbar__controls__preferences-label"],[1,"miam-catalog-toolbar__controls__favorites-label"],[4,"ngIf"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"div",1),wo(2,"div",2),fo(3,fS,1,1,"input",3),fo(4,_S,1,1,"input",4),fo(5,yS,3,5,"button",5),fo(6,wS,2,0,"button",6),ko(),wo(7,"div",7),fo(8,CS,3,5,"button",5),wo(9,"button",8),Ao("click",(function(){return t.preferencesButtonPressed.emit()})),Co(10,"img",9),fo(11,SS,2,0,"span",10),fo(12,xS,2,1,"div",11),ko(),wo(13,"button",12),Ao("click",(function(){return t.favoritesButtonPressed.emit()})),Co(14,"img",13),fo(15,PS,3,2,"div",14),ko(),ko(),ko(),ko()),2&e&&(Ho("reduced",t.reduced),Nr(2),bo("ngClass",bc(16,DS,!t.home)),Nr(1),bo("ngIf",t.hideButtons&&!t.history),Nr(1),bo("ngIf",!t.hideButtons||t.history),Nr(1),bo("ngIf",!t.reduced),Nr(1),bo("ngIf",t.reduced&&!t.home),Nr(2),bo("ngIf",t.reduced),Nr(1),bo("ngClass",wc(18,TS,t.hideButtons,t.reduced,!t.reduced))("disabled",t.hideButtons),Nr(2),bo("ngIf",!t.reduced),Nr(1),bo("ngIf",t.preferencesBadgeCount>0),Nr(1),bo("ngClass",wc(22,TS,t.hideButtons,t.reduced,!t.reduced))("disabled",t.hideButtons),Nr(1),bo("src",t.hideButtons?"https://storage.googleapis.com/assets.miam.tech/generic/icons/Heart_grey.svg":"https://storage.googleapis.com/assets.miam.tech/generic/icons/Heart_Black.svg",Wn),Nr(1),bo("ngIf",!t.reduced))},directives:[Du,Ou,Gv,ab,kb],styles:[".miam-catalog-toolbar{position:relative;display:flex;width:100%;box-sizing:border-box}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container{display:flex;flex-direction:row;align-items:center;flex:1;max-width:600px}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container>:not(:last-child){margin-right:16px}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-catalog-toolbar__searchbar{width:480px;background-color:transparent}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-catalog-toolbar__searchbar::-moz-placeholder{color:var(--mealz-ds-color-text-disabled);opacity:1}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-catalog-toolbar__searchbar::placeholder{color:var(--mealz-ds-color-text-disabled);opacity:1}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-recipe-toolbar__return-button{width:24px;height:24px}.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-recipe-toolbar__return-button img{cursor:pointer;min-width:15px;min-height:15px}.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;flex:1}.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container>:not(:last-child){margin-right:16px}.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites:not(.ghost):not(.hidden),.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences:not(.ghost):not(.hidden){display:flex;padding:8px 12px;background:var(--mealz-ds-color-primary-100,#e4eaec);color:var(--mealz-ds-color-neutral-black,#0f191f);border-radius:90px}.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites:not(.ghost):not(.hidden)>:not(:last-child),.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences:not(.ghost):not(.hidden)>:not(:last-child){margin-right:4px}.miam-catalog-toolbar .miam-catalog-toolbar__buttons-container .mealz-ds-button.hidden{display:none}.miam-catalog-toolbar .miam-catalog-toolbar__controls__filter,.miam-catalog-toolbar .miam-catalog-toolbar__controls__preferences{position:relative}.miam-catalog-toolbar .miam-catalog-toolbar__controls__filter .miam-catalog-toolbar__controls__filter-badge,.miam-catalog-toolbar .miam-catalog-toolbar__controls__preferences .miam-catalog-toolbar__controls__filter-badge{height:18px;width:18px;display:flex;justify-content:center;align-items:center;background-color:var(--mealz-ds-color-primary-900);color:var(--miam-ds-color-neutral-white);border-radius:var(--m-border-radius-circle);font-size:12px;line-height:18px}.miam-catalog-toolbar .miam-catalog-toolbar__controls__filter:not(.full) .miam-catalog-toolbar__controls__filter-badge,.miam-catalog-toolbar .miam-catalog-toolbar__controls__preferences:not(.full) .miam-catalog-toolbar__controls__filter-badge{position:absolute;right:6px;top:6px}.miam-catalog-toolbar .miam-catalog-toolbar__controls__filter.hidden,.miam-catalog-toolbar.reduced .miam-catalog-toolbar__searchbar.hidden-reduced{display:none}@media (max-width:1023px){.miam-catalog-toolbar .miam-catalog-toolbar__searchbar-container .miam-catalog-toolbar__searchbar{width:auto;flex:1}}@media (max-width:700px){.miam-catalog-toolbar:not(.reduced){flex-direction:column-reverse}.miam-catalog-toolbar:not(.reduced)>:not(:last-child){margin-top:24px}.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__searchbar-container{border-bottom:unset;justify-content:space-between;max-width:unset}.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container{justify-content:space-between}.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites,.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences{border-radius:40px;padding:12px 16px;flex:1}.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites:hover,.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences:hover{background-color:var(--mealz-ds-color-primary-200)}.miam-catalog-toolbar.reduced .miam-catalog-toolbar__searchbar:not(.hidden-reduced),.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites.hidden,.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__favorites:not(.full) span,.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences.hidden,.miam-catalog-toolbar:not(.reduced) .miam-catalog-toolbar__buttons-container .mealz-ds-button.miam-catalog-toolbar__controls__preferences:not(.full) span{display:none}}"],encapsulation:2,changeDetection:0}),e})();function RS(e,t){if(1&e){const e=Io();wo(0,"button",7),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo().addTag(i)})),Qo(1),ko()}if(2&e){const e=t.$implicit;Nr(1),Ko(" ",e.attributes.name," ")}}function OS(e,t){1&e&&(wo(0,"div",8),wo(1,"span"),Qo(2,"tradof#Pas de panique, nous ne trouvons pas cet ingr\xe9dient. Aucun risque de le retrouver dans votre assiette.#"),ko(),ko())}let FS=(()=>{class e{constructor(e,t,i){this.preferencesService=e,this.tagsService=t,this.cdr=i,this.backAndReload=new Rc,this.suggestedTags=[],this.searchStr="",this.addingIngredient=!1,this.icon=Cv,this.notFound=!1,this.searchQuery=new cp(""),this.subscription=new d}ngOnInit(){this.listenOnSearchChange()}ngOnDestroy(){this.subscription.unsubscribe()}searchInputUpdate(e){this.searchQuery.next(e.target.value)}listenOnSearchChange(){this.subscription.add(this.searchQuery.pipe(of(250),p_(),th(e=>e.length>0?this.tagsService.autocomplete(e):td([]))).subscribe(e=>{var t,i;this.suggestedTags=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.filter(e=>"ingredient_category"===e.attributes["tag-type-id"]||"ingredientsdefinition"===e.attributes["tag-type-id"]),this.notFound=0===(null===(i=this.suggestedTags)||void 0===i?void 0:i.length),this.cdr.detectChanges()}))}addTag(e){this.preferencesService.newTagFromSearch(e),this.backAndReload.emit()}}return e.\u0275fac=function(t){return new(t||e)(vo(d_),vo(a_),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-preferences-search"]],outputs:{backAndReload:"backAndReload"},decls:7,vars:5,consts:[[1,"preferences__search"],[1,"preferences__search-bar"],["type","text","placeholder","tradof#Je n'aime pas...#",1,"preferences__search-bar-input","miam-ds-searchbar","miam-ds-text",3,"ngModel","keyup"],[1,"mealz-ds-button","ghost","small","square","preferences__clear-input-button",3,"click"],["alt","clear input","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_neutralBlack.svg",1,"preferences__clear-input-img"],["class","preferences__suggested__tag",3,"click",4,"ngFor","ngForOf"],["class","preferences__not-found",4,"ngIf"],[1,"preferences__suggested__tag",3,"click"],[1,"preferences__not-found"]],template:function(e,t){1&e&&(wo(0,"div",0),wo(1,"div",1),wo(2,"input",2),Ao("keyup",(function(e){return t.searchInputUpdate(e)})),ko(),wo(3,"button",3),Ao("click",(function(){return t.searchQuery.next("")})),Co(4,"img",4),ko(),ko(),fo(5,RS,2,1,"button",5),fo(6,OS,3,0,"div",6),ko()),2&e&&(Nr(2),bo("ngModel",t.searchQuery.value),Nr(2),Ho("hidden",0===(null==t.searchQuery.value?null:t.searchQuery.value.length)),Nr(1),bo("ngForOf",t.suggestedTags),Nr(1),bo("ngIf",t.notFound))},directives:[Gv,ab,kb,Au,Ou],styles:[".preferences__search .preferences__search-bar{margin:0 16px 24px;position:relative;display:flex}.preferences__search .preferences__search-bar .preferences__clear-input-img{height:24px;width:24px}.preferences__search .preferences__search-bar .preferences__clear-input-img.hidden{display:none}.preferences__search .preferences__search-bar .preferences__clear-input-button{position:absolute;top:1px;right:1px}.preferences__search .preferences__suggested__tag{background:none;border:none;font:inherit;cursor:pointer;width:100%;text-align:start;padding:12px 16px;border-bottom:1px solid var(--mealz-ds-color-neutral-200,#d9dde1);color:var(--mealz-ds-color-neutral-black)}.preferences__search .preferences__not-found{padding:12px 16px}"],encapsulation:2,changeDetection:0}),e})();function BS(e,t){if(1&e){const e=Io();So(0),wo(1,"button",5),Ao("click",(function(){return Rt(e),Fo().close()})),Co(2,"img",6),ko(),wo(3,"div",7),wo(4,"span"),Qo(5,"tradof#Mes pr\xe9f\xe9rences#"),ko(),ko(),wo(6,"button",8),Ao("click",(function(){return Rt(e),Fo().close()})),Co(7,"img",9),ko(),xo()}}function MS(e,t){if(1&e){const e=Io();wo(0,"div",10),wo(1,"button",11),Ao("click",(function(){return Rt(e),Fo().goToDefaultView()})),Co(2,"img",6),ko(),wo(3,"div",7),wo(4,"span"),Qo(5,"tradof#Je n'aime pas#"),ko(),ko(),ko()}}function LS(e,t){if(1&e){const e=Io();wo(0,"div",28),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(2).toggleTag(i)})),wo(1,"div",29),Qo(2),ko(),Co(3,"input",30),ko()}if(2&e){const e=t.$implicit;Nr(2),Ko(" ",e.tag.name," "),Nr(1),bo("checked",e.checked)}}function $S(e,t){1&e&&Co(0,"img",33),2&e&&bo("alt","remove "+Fo().$implicit.tag.attributes.name)}const jS=function(e){return{checked:e}};function zS(e,t){if(1&e){const e=Io();wo(0,"button",31),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(2).toggleTag(i)})),wo(1,"div",22),wo(2,"span"),Qo(3),Ec(4,"titlecase"),ko(),fo(5,$S,1,1,"img",32),ko(),ko()}if(2&e){const e=t.$implicit,i=Fo(2);bo("ngClass",bc(5,jS,e.checked)),Nr(3),Yo(Ic(4,3,e.tag.attributes.name)),Nr(2),bo("ngIf",i.isAdditionalIngredient(e))}}function NS(e,t){if(1&e){const e=Io();wo(0,"div",28),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(2).toggleTag(i)})),wo(1,"div",34),Qo(2),Ec(3,"titlecase"),ko(),Co(4,"input",30),ko()}if(2&e){const e=t.$implicit;Nr(2),Ko(" ",Ic(3,2,e.tag.name)," "),Nr(2),bo("checked",e.checked)}}function VS(e,t){if(1&e){const e=Io();So(0),wo(1,"div",12),wo(2,"span",13),Qo(3,"tradof#Nombre de personnes#"),ko(),wo(4,"ng-miam-counter-input",14),Ao("valueChange",(function(t){return Rt(e),Fo().preferencesService.guests=t})),ko(),ko(),wo(5,"ng-miam-accordion",15),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(6,"ng-miam-accordion-title"),wo(7,"span",16),Qo(8,"\ntradof#Avez-vous un r\xe9gime particulier ?# "),ko(),ko(),wo(9,"ng-miam-accordion-content"),wo(10,"div",17),fo(11,LS,4,2,"div",18),ko(),ko(),ko(),wo(12,"ng-miam-accordion",19),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(13,"ng-miam-accordion-title"),wo(14,"span",16),Qo(15,"\ntradof#Je n'aime pas# "),ko(),ko(),wo(16,"ng-miam-accordion-content"),fo(17,zS,6,7,"button",20),wo(18,"button",21),Ao("click",(function(){return Rt(e),Fo().goToSearchView()})),wo(19,"div",22),wo(20,"span"),Qo(21,"Ad\u0103uga\u021bi"),ko(),Co(22,"img",23),ko(),ko(),ko(),ko(),wo(23,"ng-miam-accordion",24),Ao("isCollapsedChange",(function(){return Rt(e),Fo().cdr.detectChanges()})),wo(24,"ng-miam-accordion-title"),wo(25,"span",16),Qo(26,"\ntradof#Mes \xe9quipements# "),ko(),ko(),wo(27,"ng-miam-accordion-content"),wo(28,"ng-miam-accordion-content"),wo(29,"div",17),fo(30,NS,5,4,"div",18),ko(),ko(),ko(),ko(),wo(31,"div",25),wo(32,"button",26),Ao("click",(function(){return Rt(e),Fo().reset()})),wo(33,"span"),Qo(34,"tradof#R\xe9initialiser#"),ko(),ko(),wo(35,"button",27),Ao("click",(function(){return Rt(e),Fo().updateAndBack()})),wo(36,"span"),Qo(37,"tradof#Appliquer#"),ko(),ko(),ko(),xo()}if(2&e){const e=Fo();Nr(4),bo("value",e.preferencesService.guests),Nr(1),bo("isCollapsed",!1),Nr(6),bo("ngForOf",e.diets),Nr(1),bo("isCollapsed",!1),Nr(5),bo("ngForOf",e.ingredients),Nr(6),bo("isCollapsed",!1),Nr(7),bo("ngForOf",e.equipments)}}function HS(e,t){if(1&e){const e=Io();So(0),wo(1,"ng-miam-preferences-search",35),Ao("backAndReload",(function(){Rt(e);const t=Fo();return t.fetchTags(),t.goToDefaultView()})),ko(),xo()}}var US=function(e){return e[e.DEFAULT=0]="DEFAULT",e[e.SEARCH=1]="SEARCH",e}({});let qS=(()=>{class e extends jy{constructor(e,t,i,n,r,s,o){super(e),this.tagsService=t,this.cdr=i,this.preferencesService=n,this.recipesService=r,this.contextService=s,this.suppliersService=o,this.isOpenChange=new Rc,this.preferencesChanged=new Rc,this._isOpen=!1,this.diets=[],this.ingredients=[],this.equipments=[],this.displayType=US.DEFAULT,this.preferenceViewEnum=US,this.openedModalSubscriptions=[],this.subscriptions=[],this.forcedIngredients=[{id:"ingredient_category_lgumes",name:"L\xe9gume"},{id:"ingredient_category_viandes-blanches",name:"Viande blanche"},{id:"ingredient_category_fromage",name:"Fromage"},{id:"ingredient_category_poissons",name:"Poisson"},{id:"ingredient_category_fruits",name:"Fruit"},{id:"ingredientsdefinition_coriandre",name:"Coriandre"},{id:"ingredientsdefinition_brocoli",name:"Brocoli"},{id:"ingredientsdefinition_oeuf",name:"Oeuf"},{id:"ingredient_category_alcool",name:"Alcool"}]}set isOpen(e){e?this.fetchTags():this.openedModalSubscriptions.forEach(e=>e.unsubscribe()),!this._isOpen&&e&&this.pageview(),this._isOpen=e,this.isOpenChange.emit(this.isOpen),this.cdr.detectChanges()}get isOpen(){return this._isOpen}ngOnInit(){this.openedModalSubscriptions.push(this.preferencesService.guests$.subscribe(()=>this.cdr.detectChanges())),this.subscriptions.push(this.preferencesService.isOpened$.subscribe(e=>{this.isOpen=e}),this.suppliersService.supplier$.pipe(id(e=>!!e)).subscribe(e=>{this.supplierId=e.id,this.fetchTags()}))}ngAfterViewInit(){window.scrollTo(0,0)}ngOnDestroy(){this.openedModalSubscriptions.forEach(e=>e.unsubscribe()),this.subscriptions.forEach(e=>e.unsubscribe())}fetchTags(){this.openedModalSubscriptions.push(this.tagsService.all({remotefilter:{tag_type:"diet",for_supplier:this.supplierId}}).pipe(bp(e=>e.is_loading)).subscribe(e=>{this.diets=e.data.map(e=>({tag:e,checked:this.preferencesService.tagShouldBeChecked(e,!1),without:!1})),this.cdr.detectChanges()}),this.tagsService.all({remotefilter:{tag_type:"equipment",for_supplier:this.supplierId}}).pipe(bp(e=>e.is_loading)).subscribe(e=>{this.equipments=e.data.map(e=>({tag:e,checked:this.preferencesService.tagShouldBeChecked(e,!0),without:!0})),this.cdr.detectChanges()})),this.initIngredientTags()}reset(){this.preferencesService.resetPreferences(),this.contextService.isPreferencesSSR&&this.preferencesService.sendCacheRequest("remove","preferences").subscribe(),this.fetchTags()}initIngredientTags(){this.ingredients=[],this.forcedIngredients.forEach(e=>{const t=this.tagsService.new();t.id=e.id,t.attributes.name=e.name,this.ingredients.push({tag:t,checked:this.preferencesService.tagShouldBeChecked(t,!0),without:!0})}),this.getAdditionalIngredients()}isAdditionalIngredient(e){return-1===this.forcedIngredients.findIndex(t=>t.id===e.tag.id)&&(e.tag.id.includes("ingredient_category_")||e.tag.id.includes("ingredientsdefinition_"))}getAdditionalIngredients(){(this.preferencesService.preferencesInStorage||{with:[],without:[]}).without.filter(e=>e.id.includes("ingredient_category_")||e.id.includes("ingredientsdefinition_")||e.id.includes("meal_type_")).forEach(e=>{if(-1===this.forcedIngredients.findIndex(t=>t.id===e.id)){const t=this.tagsService.new();t.id=e.id,t.attributes.name=e.name,this.preferencesService.tagShouldBeChecked(t,!0)&&this.ingredients.push({tag:t,checked:!0,without:!0})}}),this.preferencesService.tagsToAdd.forEach(e=>{(e.tag.id.includes("ingredient_category_")||e.tag.id.includes("ingredientsdefinition_")||e.tag.id.includes("meal_type_"))&&-1===this.ingredients.findIndex(t=>t.tag.id===e.tag.id)&&this.ingredients.push(e)}),this.contextService.isPreferencesSSR&&this.updateFiltersInCache()}toggleTag(e){e.checked=!e.checked,"equipment"===e.tag.attributes["tag-type-id"]!==e.checked?this.preferencesService.addTag(e):(this.preferencesService.removeTag(e),this.isAdditionalIngredient(e)&&this.ingredients.splice(this.ingredients.findIndex(t=>t.tag.id===e.tag.id),1)),this.cdr.detectChanges()}updateAndBack(){this.preferencesService.updatePreferences(),this.preferencesChanged.emit(),this.contextService.isPreferencesSSR?this.updateFiltersInCache(!0):(this.contextService.preferencesChanged.emit(),this.close())}close(){this.isOpen=!1,this.preferencesService.resetTagsActions()}goToDefaultView(){this.displayType=US.DEFAULT,this.cdr.detectChanges()}goToSearchView(){this.displayType=US.SEARCH,this.cdr.detectChanges()}currentPath(){return"preferences"}updateFiltersInCache(e=!1){const t=new Uf,i=this.preferencesService.addPreferencesToRemoteFilters(t,!0),n=Object.assign({exclude_tags:i.exclude_tags,include_tags:i.include_tags},4!==this.preferencesService.guests&&{guests:this.preferencesService.guests});(Object.keys(n).length>0?this.preferencesService.sendCacheRequest("set","preferences",n):this.preferencesService.sendCacheRequest("remove","preferences")).subscribe(()=>{e&&(this.contextService.preferencesChanged.emit(),this.close())})}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(a_),vo(Ga),vo(d_),vo(__),vo(Iv),vo(Nf))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-preferences"]],inputs:{filters:"filters",isOpen:"isOpen"},outputs:{isOpenChange:"isOpenChange",preferencesChanged:"preferencesChanged"},features:[eo],decls:7,vars:6,consts:[["modalStyle","right",1,"miam-preferences-modal",3,"noHeaderMode","display","close"],[1,"miam-preferences"],[1,"miam-preferences__header"],[4,"ngIf"],["class","miam-preferences_nav-and-title",4,"ngIf"],[1,"mealz-ds-button","ghost","square","miam-preferences__back-button",3,"click"],["alt","go back","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg",1,"miam-preferences__back-image"],[1,"mealz-ds-text","size-l","weight-xxl","miam-preferences__title"],[1,"mealz-ds-button","ghost","square","miam-preferences__close-button",3,"click"],["alt","close modal","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg",1,"miam-preferences__close-image"],[1,"miam-preferences_nav-and-title"],[1,"mealz-ds-button","ghost","square","miam-preferences__search-back-button",3,"click"],[1,"miam-preferences__guests"],[1,"mealz-ds-text","miam-preferences_guest-label"],[1,"miam-preferences_guest-counter",3,"value","valueChange"],[1,"miam-preferences__diet-section",3,"isCollapsed","isCollapsedChange"],[1,"mealz-ds-text","weight-xl"],[1,"miam-preferences__list"],["class","miam-preferences__list__item mealz-ds-checkbox",3,"click",4,"ngFor","ngForOf"],[1,"miam-preferences__dislikes-section",3,"isCollapsed","isCollapsedChange"],["class","mealz-ds-badge miam-preferences__badge",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"mealz-ds-badge","miam-preferences__badge",3,"click"],[1,"miam-preferences__badge_label"],["alt","add dislikes","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-neutral-black.svg"],[1,"miam-preferences__equipments-section",3,"isCollapsed","isCollapsedChange"],[1,"miam-preferences__footer"],[1,"mealz-ds-button","secondary","miam-preferences__footer__reset",3,"click"],[1,"mealz-ds-button","primary","miam-preferences__footer__recipes",3,"click"],[1,"miam-preferences__list__item","mealz-ds-checkbox",3,"click"],[1,"mealz-ds-text","miam-preferences__list__item__name"],["type","checkbox",3,"checked"],[1,"mealz-ds-badge","miam-preferences__badge",3,"ngClass","click"],["class","miam-preferences__remove-tag","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg",3,"alt",4,"ngIf"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg",1,"miam-preferences__remove-tag",3,"alt"],[1,"miam-preferences__list__item__name"],[3,"backAndReload"]],template:function(e,t){1&e&&(wo(0,"ng-miam-modal",0),Ao("close",(function(){return t.close()})),wo(1,"div",1),wo(2,"div",2),fo(3,BS,8,0,"ng-container",3),fo(4,MS,6,0,"div",4),ko(),fo(5,VS,38,7,"ng-container",3),fo(6,HS,2,0,"ng-container",3),ko(),ko()),2&e&&(bo("noHeaderMode",!0)("display",t.isOpen),Nr(3),bo("ngIf",t.displayType===t.preferenceViewEnum.DEFAULT),Nr(1),bo("ngIf",t.displayType===t.preferenceViewEnum.SEARCH),Nr(1),bo("ngIf",t.displayType===t.preferenceViewEnum.DEFAULT),Nr(1),bo("ngIf",t.displayType===t.preferenceViewEnum.SEARCH))},directives:[sw,Ou,Nb,uw,cw,lw,Au,Du,FS],pipes:[Qu],styles:['@media (min-width:450px){ng-miam-preferences .miam-modal__container.left .miam-modal,ng-miam-preferences .miam-modal__container.right .miam-modal,webc-miam-preferences-modal .miam-modal__container.left .miam-modal,webc-miam-preferences-modal .miam-modal__container.right .miam-modal,webc-miam-preferences .miam-modal__container.left .miam-modal,webc-miam-preferences .miam-modal__container.right .miam-modal{width:450px}}.miam-preferences{position:relative;display:flex;flex-direction:column;margin-bottom:72px}.miam-preferences>:not(:last-child){margin-bottom:24px}@media (max-width:450px){.miam-preferences{margin-bottom:124px}}.miam-preferences .miam-preferences__header{display:flex;padding:8px;align-items:center;border-bottom:1px solid var(--mealz-ds-color-neutral-200,#d9dde1)}.miam-preferences .miam-preferences__header .miam-preferences_nav-and-title{display:flex;align-items:center}.miam-preferences .miam-preferences__header .miam-preferences__back-image{transform:rotate(180deg)}@media (min-width:1024px){.miam-preferences .miam-preferences__header{justify-content:space-between}}@media (min-width:1024px){.miam-preferences .miam-preferences__header .miam-preferences__back-button{display:none}}.miam-preferences .miam-preferences__header .miam-preferences__close-button{display:none}@media (min-width:1024px){.miam-preferences .miam-preferences__header .miam-preferences__close-button{display:block}}.miam-preferences .miam-preferences__header .miam-preferences__title{padding-left:8px;color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-preferences .miam-preferences__guests{display:flex;justify-content:space-between;align-items:center;padding:0 16px}.miam-preferences .miam-preferences__guests .miam-preferences_guest-counter{border-radius:6px;border:1px solid var(--mealz-ds-color-primary);color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-preferences .miam-preferences__guests .miam-preferences_guest-counter .miam-counter-input .miam-counter-input__value-container{position:relative}.miam-preferences .miam-preferences__guests .miam-preferences_guest-counter .miam-counter-input .miam-counter-input__value-container:after{content:"";background-image:url(https://storage.googleapis.com/assets.miam.tech/generic/icons/cutlery-neutral-black.svg);background-repeat:no-repeat;background-position:50%;background-size:contain;width:18px;height:18px}.miam-preferences ng-miam-accordion .miam-accordion__header{height:48px;display:flex;align-items:center;justify-content:space-between;margin:0 16px 12px;padding:8px 16px;border-radius:8px;background:var(--mealz-ds-color-primary-50,#f0f3f4);color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-preferences ng-miam-accordion .miam-accordion__collapsable-container{margin:0 16px;padding:0 8px;border-bottom:0}.miam-preferences ng-miam-accordion .miam-accordion__collapsable-content{border-bottom:0}.miam-preferences ng-miam-accordion .miam-accordion__collapsable-content .mealz-ds-checkbox{height:unset}.miam-preferences .miam-preferences__list{display:flex;flex-direction:column}.miam-preferences .miam-preferences__list .miam-preferences__list__item{display:flex;justify-content:space-between;align-items:center;padding:8px 0;cursor:pointer}.miam-preferences .miam-preferences__list .miam-preferences__list__item .miam-preferences__list__item__name{color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content{display:flex;align-items:flex-start;align-content:flex-start;align-self:stretch;flex-wrap:wrap;margin:-6px}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content>*{margin:6px}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content .miam-preferences__badge{color:var(--mealz-ds-color-neutral-black,#0f191f);padding:16px;cursor:pointer;transition:all .25s ease-in;-webkit-tap-highlight-color:transparent;border:none;display:flex;align-items:center}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content .miam-preferences__badge.checked{background:var(--miam-color-primary,#24748f);color:var(--mealz-ds-color-neutral-white,#fff)}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content .miam-preferences__badge .miam-preferences__badge_label{display:flex}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content .miam-preferences__badge .miam-preferences__badge_label>:not(:last-child){margin-right:8px}.miam-preferences .miam-preferences__dislikes-section ng-miam-accordion-content .miam-preferences__badge .miam-preferences__badge_label .miam-preferences__remove-tag{height:16px;width:16px}.miam-preferences .miam-preferences__footer{position:fixed;width:450px;bottom:0;display:flex;justify-content:center;padding:12px 16px;background:var(--mealz-ds-color-neutral-white,#fff);border-top:1px solid var(--mealz-ds-color-neutral-200,#d9dde1);box-sizing:border-box}.miam-preferences .miam-preferences__footer>:not(:last-child){margin-right:16px}@media (max-width:450px){.miam-preferences .miam-preferences__footer{width:100%;box-sizing:border-box;flex-direction:column-reverse}.miam-preferences .miam-preferences__footer>:not(:last-child){margin-right:0;margin-top:8px}}.miam-preferences .miam-preferences__footer .miam-preferences__footer__recipes .miam-preferences__footer__number-recipes{margin-right:8px}'],encapsulation:2,changeDetection:0}),e})();function GS(e,t){if(1&e&&(So(0),wo(1,"span"),Qo(2,"pentru"),ko(),wo(3,"span"),Qo(4),ko(),xo()),2&e){const e=Fo(3);Nr(4),Ko('"',e.filters.search,'"')}}function WS(e,t){if(1&e&&(wo(0,"div"),wo(1,"div",11),wo(2,"span"),Qo(3,"Ne pare r\u0103u, nu au fost g\u0103site oferte"),ko(),fo(4,GS,5,1,"ng-container",12),ko(),wo(5,"div",13),wo(6,"span"),Qo(7,"Modifica\u021bi termenii de c\u0103utare sau ajusta\u021bi filtrele"),ko(),ko(),ko()),2&e){const e=Fo(2);Nr(4),bo("ngIf",e.isSearching())}}function ZS(e,t){1&e&&(wo(0,"div"),wo(1,"div",14),wo(2,"span"),Qo(3,"Ne pare r\u0103u, \xeenc\u0103 nu ave\u021bi idei salvate de mese"),ko(),ko(),ko())}function QS(e,t){if(1&e&&(fo(0,ZS,4,0,"div",8),Ec(1,"async")),2&e){Fo();const e=_o(6);bo("ngIf",Ic(1,2,Fo().userService.isLogged$))("ngIfElse",e)}}function YS(e,t){1&e&&(wo(0,"div",15),wo(1,"span"),Qo(2,"Ne pare r\u0103u, trebuie s\u0103 fi\u021bi autentificat pentru a accesa con\u021binutul acestei pagini."),ko(),ko())}const KS=function(e,t){return{"icon-filtering":e,"icon-not-filtering":t}};function JS(e,t){if(1&e&&(wo(0,"div",6),Co(1,"ng-miam-icon",7),fo(2,WS,8,1,"div",8),fo(3,QS,2,4,"ng-template",null,9,Wc),fo(5,YS,3,0,"ng-template",null,10,Wc),ko()),2&e){const e=_o(4),t=Fo();Nr(1),bo("width",279)("height",243)("iconName",t.icon.NoRecipeFound)("ngClass",yc(6,KS,t.isFiltering(),!t.isFiltering())),Nr(1),bo("ngIf",t.isFiltering())("ngIfElse",e)}}function XS(e,t){1&e&&(wo(0,"div",16),Co(1,"div",17),wo(2,"div"),Qo(3,"\nSe \xeencarc\u0103 rezultatele... "),ko(),ko())}function ex(e,t){if(1&e){const e=Io();wo(0,"ng-miam-recipe-card",18),Ao("addToMealsPlanner",(function(t){return Rt(e),Fo().addToMealsPlanner.emit(t)})),ko()}if(2&e){const e=t.recipe,i=Fo();bo("recipe",e)("originTrace",i.eventTrace)("displayPricing",i.displayPricing)("previewAllowed",!i.addRecipeMode)("addRecipeMode",i.addRecipeMode)("displayGuests",i.displayGuests)("displayVariant",i.displayRecipeVariant)("helpButtonAllowed",i.helpButtonAllowed)}}const tx=function(e){return{recipe:e}};function ix(e,t){if(1&e){const e=Io();So(0),wo(1,"div",20),Ao("loadMore",(function(){return Rt(e),Fo(2).autoloadContentIfNecessary()})),Ec(2,"async"),Eo(3,21),ko(),xo()}if(2&e){const e=Fo().$implicit,t=Fo(),i=_o(7);Nr(1),bo("isLoading",Ic(2,3,t.loading)),Nr(2),bo("ngTemplateOutlet",i)("ngTemplateOutletContext",bc(5,tx,e))}}function nx(e,t){if(1&e&&Eo(0,21),2&e){const e=Fo().$implicit;Fo(),bo("ngTemplateOutlet",_o(7))("ngTemplateOutletContext",bc(2,tx,e))}}function rx(e,t){if(1&e&&(So(0),fo(1,ix,4,7,"ng-container",12),fo(2,nx,1,4,"ng-container",19),xo()),2&e){const e=t.last;Nr(1),bo("ngIf",e),Nr(1),bo("ngIf",!e)}}const sx=["recipe-provider","sponsors","tags"],ox={recipes:["title","number-of-guests","media-url","video-id","filigrane-logo-url","difficulty","preparation-time","cooking-time","resting-time",...sx],sponsors:["logo-url"],tags:["tag-type-id"],"recipe-provider":["name"]};let ax=(()=>{class e extends jy{constructor(e,t,i,n,r){super(e),this.recipesService=t,this.userService=i,this.context=n,this.cdr=r,this.randomMode=!1,this.modifiedGuests=null,this.displayInfos=!1,this.displayPricing=!0,this.displayGuests=!0,this.helpButtonAllowed=!0,this.addRecipeMode=!1,this.excludedRecipesIds=[],this.displayRecipeVariant=1,this.addToMealsPlanner=new Rc,this.filterRemoved=new Rc,this.loading=new cp(!0),this.currentRecipes=[],this.lastPage=0,this.icon=Cv,this.noMoreRecipes=!1,this.filtersToDisplay=[],this.currentRequestsCount=0,this.subscriptions=[],this.currentRecipes=[],this.filters=new Uf({search:""})}get sort(){var e;return(null===(e=this.filters.additionalFilters)||void 0===e?void 0:e.filters.packages)?"position":this.addRecipeMode?"price":""}get props(){var e,t;const i={};return(null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.filters.packages)&&(i.category_id=this.filters.additionalFilters.filters.packages),i}ngOnInit(){this.pageview()}ngOnChanges(e){const t=Object.keys(e);t.includes("originTrace")&&(1===t.length||2===t.length&&t.includes("excludedRecipesIds"))||(this.filtersToDisplay=this.buildFiltersArray(),this.reloadPage(),this.filters.search&&this.analyticsService.sendEvent("search",this.path,{search_term:this.filters.search}))}currentPath(){return this.filters.eventPath()}autoloadContentIfNecessary(){this.subscriptions.push(this.loading.pipe(fp(1),id(e=>!e)).subscribe(()=>{this.currentRecipes.length>0&&!this.noMoreRecipes&&this.loadMore(this.lastPage>2)}))}loadMore(e=!0){e&&(this.loading.next(!0),this.cdr.detectChanges()),this.lastPage++,this.loadContent()}loadRecipesPage(e){return this.noMoreRecipes?td([]):this.recipesService.addMandatoryCompletionToFilter(this.filters).pipe(th(t=>(this.context.displayIngredientPicturesOnRecipeCards&&!sx.includes("ingredients")&&(sx.push("ingredients"),ox.recipes.push("ingredients"),Object.assign(ox,{ingredients:["name","quantity","unit","active","forced-eans","picture-url","position"]})),this.currentRequestsCount++,this.recipesService.filter(t,{size:20,number:e},sx,ox,this.modifiedGuests,this.randomMode,this.sort).pipe(th(i=>this.processResults(i,t,e))))))}processResults(e,t,i){return this.currentRequestsCount--,JSON.stringify(t)===JSON.stringify(this.filters)||0===this.currentRequestsCount?(this.excludedRecipesIds.length>0&&(e=e.filter(e=>!this.excludedRecipesIds.includes(e.id))),this.currentRecipes=1===i?e:[...this.currentRecipes,...e],this.currentRecipes.forEach(e=>{this.modifiedGuests&&this.modifiedGuests>0&&(e.modifiedGuests=this.modifiedGuests)}),this.noMoreRecipes=0===e.length,td(this.currentRecipes)):(Cp(`Filtering aborted : ${JSON.stringify(t)} and ${JSON.stringify(this.filters)} are different`),td([]))}removeFilter(e){this.filterRemoved.emit(e)}buildFiltersArray(){let e=[];return e=[...e,...this.getSelectedFilters(this.filters.cost),...this.getSelectedFilters(this.filters.difficulty),...this.getSelectedFilters(this.filters.time)],this.filters.additionalFilters&&""!==this.filters.additionalFilters.title&&(e=[this.filters.additionalFilters.title].concat(e)),e}getSelectedFilters(e){return e?e.filter(e=>e.value).map(e=>e.text):[]}reloadPage(){this.loading.next(!0),this.lastPage=1,this.noMoreRecipes=!1,this.currentRecipes=[],this.cdr.detectChanges(),this.loadContent()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}isSearching(){return this.filters.search&&""!==this.filters.search}isFieldEmpty(e){return!e||!e.some(e=>e.value)}isFiltering(){return this.isSearching()||!this.isFieldEmpty(this.filters.difficulty)||!this.isFieldEmpty(this.filters.cost)||!this.isFieldEmpty(this.filters.time)}trackByFn(e,t){return t.id}loadContent(){this.subscriptions.push(this.loadRecipesPage(this.lastPage).subscribe(()=>{this.loading.next(!1),this.cdr.detectChanges()}))}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(__),vo(Yf),vo(Iv),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-catalog-list"]],viewQuery:function(e,t){if(1&e&&Uc(NC,1),2&e){let e;Hc(e=qc())&&(t.recipeCards=e)}},inputs:{filters:"filters",randomMode:"randomMode",modifiedGuests:"modifiedGuests",displayInfos:"displayInfos",displayPricing:"displayPricing",displayGuests:"displayGuests",helpButtonAllowed:"helpButtonAllowed",addRecipeMode:"addRecipeMode",excludedRecipesIds:"excludedRecipesIds",displayRecipeVariant:"displayRecipeVariant"},outputs:{addToMealsPlanner:"addToMealsPlanner",filterRemoved:"filterRemoved",loading:"loading"},features:[eo,at],decls:9,vars:8,consts:[[1,"miam-catalog-list"],["class","miam-catalog-list__notFound",4,"ngIf"],["class","miam-catalog-list__loader",4,"ngIf"],[1,"miam-catalog-list__cards"],["recipeCard",""],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"miam-catalog-list__notFound"],[1,"miam-catalog-list__notFound__icon",3,"width","height","iconName","ngClass"],[4,"ngIf","ngIfElse"],["notFiltering",""],["notLogged",""],[1,"miam-catalog-list__notFound__title1","filtering"],[4,"ngIf"],[1,"miam-catalog-list__notFound__title2"],[1,"miam-catalog-list__notFound__title1","not-filtering"],[1,"miam-catalog-list__notFound__title1","not-logged"],[1,"miam-catalog-list__loader"],[1,"miam-ds-loader"],[3,"recipe","originTrace","displayPricing","previewAllowed","addRecipeMode","displayGuests","displayVariant","helpButtonAllowed","addToMealsPlanner"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngIf"],["ngMiamLoadOnScroll","","marginRoot","600px",3,"isLoading","loadMore"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(wo(0,"div",0),fo(1,JS,7,9,"div",1),Ec(2,"async"),fo(3,XS,4,0,"div",2),Ec(4,"async"),wo(5,"div",3),fo(6,ex,1,8,"ng-template",null,4,Wc),fo(8,rx,3,2,"ng-container",5),ko(),ko()),2&e&&(Nr(1),bo("ngIf",!Ic(2,4,t.loading)&&0===t.currentRecipes.length),Nr(2),bo("ngIf",Ic(4,6,t.loading)),Nr(5),bo("ngForOf",t.currentRecipes)("ngForTrackBy",t.trackByFn))},directives:[Ou,Au,$y,Du,NC,Rb,Nu],pipes:[Wu],styles:[".miam-catalog-list{width:100%;padding:0 80px;box-sizing:border-box}.miam-catalog-list .miam-catalog-list__notFound{display:flex;flex-direction:column;width:100%;justify-content:center;text-align:center;padding:36px 0 0}.miam-catalog-list .miam-catalog-list__notFound .miam-catalog-list__notFound__title1{margin-top:36px;margin-bottom:8px;font-size:24px;font-weight:700;color:var(--m-color-primary)}.miam-catalog-list .miam-catalog-list__notFound .miam-catalog-list__notFound__title1.filtering span{display:inline}.miam-catalog-list .miam-catalog-list__notFound .miam-catalog-list__notFound__title1.filtering span+span{margin-left:5px}.miam-catalog-list .miam-catalog-list__notFound .miam-catalog-list__notFound__title2{font-size:22px;color:var(--m-color-grey-text)}.miam-catalog-list .miam-catalog-list__loader{width:100%;font-size:20px;font-weight:700;color:var(--m-color-grey-text);text-align:center}.miam-catalog-list .miam-catalog-list__loader .miam-ds-loader{margin-top:80px;margin-bottom:16px;margin-left:calc(50% - 40px);height:80px;width:80px;background-position-x:40px;background-size:40px 40px}.miam-catalog-list .miam-catalog-list__cards{display:grid;grid-template-columns:repeat(auto-fill,calc(var(--m-catalog-card-width) + 16px));justify-content:center;position:relative;width:100%;box-sizing:border-box;margin:-8px}.miam-catalog-list .miam-catalog-list__cards>*{margin:8px}.miam-catalog-list .miam-catalog-list__cards:not(:has(.miam-recipe-card)){grid-template-columns:unset}@media (max-width:1023px){.miam-catalog-list{padding:0 32px}}@media (max-width:700px){.miam-catalog-list{padding:0 20px}}"],encapsulation:2,changeDetection:0}),e})();const cx=["miamCatalogTopAnchor"],lx=["returnHomeButton"];function ux(e,t){1&e&&Co(0,"div",14)}function dx(e,t){if(1&e){const e=Io();wo(0,"div",15,16),wo(2,"ng-miam-catalog-toolbar",17),Ao("filterButtonPressed",(function(){return Rt(e),Fo(2).onFilterCollapsed()}))("preferencesButtonPressed",(function(){Rt(e);const t=Fo(2);return t.isPreferenceModalOpen=!t.isPreferenceModalOpen}))("searchStringChanged",(function(t){return Rt(e),Fo(2).updateSearch(t)}))("favoritesButtonPressed",(function(){return Rt(e),Fo(2).checkAndSetFavoritesFilter()}))("returnHomePressed",(function(){return Rt(e),Fo(2).returnToHomePage()})),ko(),ko()}if(2&e){const e=_o(1),t=Fo(2);Nr(2),bo("home",t.displayHomePage())("history",t.historyDisplayed)("searchTerm",null==t.filters?null:t.filters.search)("additionalFiltersTitle",null==t.filters||null==t.filters.additionalFilters?null:t.filters.additionalFilters.title)("hideButtons",t.isFavoritesPage())("filterBadgeCount",t.filters.selectableFiltersCount())("reduced",e.classList.contains("sticking"))}}function hx(e,t){if(1&e){const e=Io();wo(0,"div",18),wo(1,"ng-miam-promotions-banner",19),Ao("clicked",(function(){return Rt(e),Fo(2).goToPromotions()})),ko(),ko()}}function px(e,t){if(1&e){const e=Io();wo(0,"div",20),Ao("click",(function(){return Rt(e),Fo(2).basketUtilsService.openBasket()})),Co(1,"img",21),wo(2,"span",22),wo(3,"span"),Qo(4),ko(),wo(5,"span"),Qo(6," tradof#repas dans votre panier#"),ko(),ko(),Co(7,"img",23),ko()}if(2&e){const e=Fo(2);Nr(4),Yo(e.recipeCount)}}function mx(e,t){if(1&e&&(wo(0,"div",38),wo(1,"span"),Qo(2,"Cercetarea dvs.: "),ko(),wo(3,"span"),Qo(4),ko(),ko()),2&e){const e=Fo(3);Nr(4),Yo(e.filters.search)}}function gx(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Mon carnet#"),ko())}function fx(e,t){1&e&&(wo(0,"span"),Qo(1,"tradof#Favoris#"),ko())}function _x(e,t){if(1&e&&(wo(0,"div",39),fo(1,gx,2,0,"span",40),fo(2,fx,2,0,"span",40),ko()),2&e){const e=Fo(3);Nr(1),bo("ngIf",e.contextService.orderHistoryEnabled),Nr(1),bo("ngIf",!e.contextService.orderHistoryEnabled)}}function vx(e,t){1&e&&(wo(0,"span",41),Qo(1,"tradof#Promos#"),ko())}function bx(e,t){1&e&&(wo(0,"span",42),Qo(1,"tradof#Toutes nos recettes#"),ko())}function yx(e,t){if(1&e&&(wo(0,"span",46),Qo(1),ko()),2&e){const e=Fo(4);Nr(1),Ko(" ",e.filters.additionalFilters.subtitle," ")}}function wx(e,t){if(1&e&&(wo(0,"div",43),wo(1,"span",44),Qo(2),ko(),fo(3,yx,2,1,"span",45),ko()),2&e){const e=Fo(3);Nr(2),Yo(e.filters.additionalFilters.title),Nr(1),bo("ngIf",(null==e.filters.additionalFilters.subtitle?null:e.filters.additionalFilters.subtitle.length)>0)}}function kx(e,t){1&e&&(wo(0,"span",47),Qo(1,"Selec\u021bia dvs."),ko())}function Cx(e,t){if(1&e){const e=Io();wo(0,"div",48),wo(1,"div",49),Ao("click",(function(){return Rt(e),Fo(3).toggleHistory(!1)})),Co(2,"img",50),wo(3,"span"),Qo(4,"tradof#Favoris#"),ko(),ko(),wo(5,"div",51),Ao("click",(function(){return Rt(e),Fo(3).toggleHistory(!0)})),Co(6,"img",52),wo(7,"span"),Qo(8,"tradof#Historique#"),ko(),ko(),ko()}if(2&e){const e=Fo(3);Nr(1),Ho("active",!e.historyDisplayed)("inactive",e.historyDisplayed),Nr(1),bo("src",e.historyDisplayed?"https://storage.googleapis.com/assets.miam.tech/generic/icons/Heart_Grey.svg":"https://storage.googleapis.com/assets.miam.tech/generic/icons/Heart.svg",Wn),Nr(3),Ho("active",e.historyDisplayed)("inactive",!e.historyDisplayed),Nr(1),bo("src",e.historyDisplayed?"https://storage.googleapis.com/assets.miam.tech/generic/icons/History.svg":"https://storage.googleapis.com/assets.miam.tech/generic/icons/History_Grey.svg",Wn)}}const Sx=function(e,t,i,n,r){return{"miam-recipe-catalog__favorites-list":e,"miam-recipe-catalog__search-list":t,"miam-recipe-catalog__all-recipes-list":i,"miam-recipe-catalog__category-list":n,"miam-recipe-catalog__default-list":r}};function xx(e,t){if(1&e){const e=Io();wo(0,"ng-miam-catalog-list",53),Ao("filterRemoved",(function(t){return Rt(e),Fo(3).removeFilter(t)})),ko()}if(2&e){const e=Fo(3);bo("ngClass",kc(7,Sx,e.isFavoritesPage(),e.isSearchPage(),e.isAllRecipesPage(),e.isCategoryPage(),e.isDefaultPage()))("filters",e.filters)("originTrace",e.eventTrace)("displayPricing",e.displayPricing)("displayInfos",e.displayInfos)("modifiedGuests",e.guests)("displayRecipeVariant",e.displayRecipeVariant)}}function Ex(e,t){1&e&&(wo(0,"div",57),Co(1,"div",58),wo(2,"span"),Qo(3,"\ntradof# Chargement des r\xe9sultats... # "),ko(),ko())}function Ix(e,t){if(1&e&&(wo(0,"div",54),fo(1,Ex,4,0,"div",55),Co(2,"div",56),ko()),2&e){const e=Fo(3);Nr(1),bo("ngIf",e.historyService.fetchingHTMLLoader$.value),Nr(1),bo("innerHTML",e.historyHTML,Gn)}}function Px(e,t){if(1&e){const e=Io();wo(0,"div",24),wo(1,"div",25),wo(2,"button",26),Ao("click",(function(){return Rt(e),Fo(2).returnToHomePage()})),Co(3,"img",27),ko(),fo(4,mx,5,1,"div",28),fo(5,_x,3,2,"div",29),fo(6,vx,2,0,"span",30),fo(7,bx,2,0,"span",31),fo(8,wx,4,2,"div",32),fo(9,kx,2,0,"span",33),ko(),Co(10,"div",14),fo(11,Cx,9,10,"div",34),wo(12,"div",15,35),wo(14,"ng-miam-catalog-toolbar",17),Ao("filterButtonPressed",(function(){return Rt(e),Fo(2).onFilterCollapsed()}))("preferencesButtonPressed",(function(){Rt(e);const t=Fo(2);return t.isPreferenceModalOpen=!t.isPreferenceModalOpen}))("searchStringChanged",(function(t){return Rt(e),Fo(2).updateSearch(t)}))("favoritesButtonPressed",(function(){return Rt(e),Fo(2).checkAndSetFavoritesFilter()}))("returnHomePressed",(function(){return Rt(e),Fo(2).returnToHomePage()})),ko(),ko(),fo(15,xx,1,13,"ng-miam-catalog-list",36),fo(16,Ix,3,2,"div",37),ko()}if(2&e){const e=_o(13),t=Fo(2);Nr(4),bo("ngIf",t.isSearchPage()),Nr(1),bo("ngIf",t.isFavoritesPage()),Nr(1),bo("ngIf",t.isPromotionsPage()),Nr(1),bo("ngIf",t.isAllRecipesPage()),Nr(1),bo("ngIf",t.isCategoryPage()),Nr(1),bo("ngIf",t.isDefaultPage()),Nr(2),bo("ngIf",t.isFavoritesPage()&&t.contextService.orderHistoryEnabled),Nr(3),bo("home",t.displayHomePage())("history",t.historyDisplayed)("searchTerm",null==t.filters?null:t.filters.search)("additionalFiltersTitle",null==t.filters||null==t.filters.additionalFilters?null:t.filters.additionalFilters.title)("hideButtons",t.isFavoritesPage())("filterBadgeCount",t.filters.selectableFiltersCount())("reduced",e.classList.contains("sticking")),Nr(1),bo("ngIf",!t.historyDisplayed),Nr(1),bo("ngIf",t.contextService.orderHistoryEnabled&&t.historyDisplayed)}}function Dx(e,t){if(1&e){const e=Io();So(0),wo(1,"ng-miam-catalog-category",64),Ao("displayList",(function(t){return Rt(e),Fo(5).categoryTitleClicked(t)})),ko(),xo()}if(2&e){const e=Fo().$implicit,t=Fo(4);Nr(1),bo("title",e.title)("subtitle",e.subtitle)("filters",e.filters)("maxRecipeNumber",t.maxRecipesPerCategory)("displayInfos",t.displayInfos)("displayPricing",t.displayPricing)("originTrace",t.eventTrace)("modifiedGuests",t.guests)("displayRecipeVariant",t.displayRecipeVariant)}}function Tx(e,t){1&e&&Co(0,"ng-miam-meals-planner-link")}function Ax(e,t){if(1&e){const e=Io();wo(0,"div",65),fo(1,Tx,1,0,"ng-miam-meals-planner-link",40),Ec(2,"async"),wo(3,"ng-miam-catalog-category",66),Ao("displayList",(function(t){return Rt(e),Fo(5).categoryTitleClicked(t)}))("isHidden",(function(t){return Rt(e),Fo(5).categoryHidden(t)})),ko(),ko(),wo(4,"div",67),Ao("click",(function(){return Rt(e),Fo(5).seeAllRecipes()})),wo(5,"div",68),Qo(6,"tradof#Toutes nos recettes#"),ko(),wo(7,"div",69),Co(8,"img",70),ko(),ko()}if(2&e){const e=Fo().$implicit,t=Fo(4);Nr(1),bo("ngIf",Ic(2,10,t.contextService.enableMealsPlanner$)),Nr(2),bo("title",e.title)("subtitle",e.subtitle)("filters",e.filters)("displayInfos",t.displayInfos)("displayPricing",t.displayPricing)("maxRecipeNumber",t.maxRecipesPerCategory)("modifiedGuests",t.guests)("displayRecipeVariant",t.displayRecipeVariant)("originTrace",t.eventTrace)}}function Rx(e,t){if(1&e&&(So(0),fo(1,Dx,2,9,"ng-container",62),fo(2,Ax,9,12,"ng-template",null,63,Wc),xo()),2&e){const e=t.index,i=_o(3);Nr(1),bo("ngIf",0!==e)("ngIfElse",i)}}function Ox(e,t){if(1&e&&(wo(0,"div",60),fo(1,Rx,4,2,"ng-container",61),ko()),2&e){const e=Fo(3);Nr(1),bo("ngForOf",e.categories)}}function Fx(e,t){1&e&&fo(0,Ox,2,1,"div",59),2&e&&bo("ngIf",Fo(2).categories.length>0)}function Bx(e,t){if(1&e){const e=Io();wo(0,"div",3),wo(1,"div",4),wo(2,"ng-miam-catalog-header",5),Ao("returnButtonPressed",(function(){return Rt(e),Fo().returnToHomePage()})),ko(),fo(3,ux,1,0,"div",6),fo(4,dx,3,7,"div",7),fo(5,hx,2,0,"div",8),fo(6,px,8,1,"div",9),fo(7,Px,17,16,"div",10),ko(),wo(8,"ng-miam-recipe-filters",11),Ao("filterChanged",(function(t){return Rt(e),Fo().updateFilters(t)}))("filterCollapsed",(function(){return Rt(e),Fo().onFilterCollapsed()}))("preferencesChanged",(function(){return Rt(e),Fo().reloadPackages()})),ko(),wo(9,"ng-miam-preferences",12),Ao("isOpenChange",(function(t){return Rt(e),Fo().isPreferenceModalOpen=t}))("preferencesChanged",(function(){Rt(e);const t=Fo();return t.updateFilters(t.filters,!1),t.reloadPackages()})),ko(),fo(10,Fx,1,1,"ng-template",null,13,Wc),ko()}if(2&e){const e=_o(11),t=Fo();Nr(2),bo("home",t.displayHomePage())("history",t.historyDisplayed)("searchTerm",null==t.filters?null:t.filters.search)("additionalFiltersTitle",null==t.filters||null==t.filters.additionalFilters?null:t.filters.additionalFilters.title)("homeLabel",t.homeLabel)("pictureUrl",t.displayHomePage()?t.headerPictureUrl:null)("catalogSetting",t.catalogSetting),Nr(1),bo("ngIf",t.displayHomePage()),Nr(1),bo("ngIf",t.displayHomePage()),Nr(1),bo("ngIf",t.displayHomePage()),Nr(1),bo("ngIf",t.recipeCount>0),Nr(1),bo("ngIf",!t.displayHomePage()||t.forceListView)("ngIfElse",e),Nr(1),bo("filters",t.filters)("isFilterCollapsed",t.isFilterCollapsed)("filterToRemove",t.filterToRemove)("position",t.filtersPosition),Nr(1),bo("isOpen",t.isPreferenceModalOpen)("filters",t.filters)}}let Mx=(()=>{class e extends jy{constructor(e,t,i,n,r,s,o,a,c,l,u,h,p,m,g){super(e),this.cdr=t,this.sponsorService=i,this.supplierService=n,this.packageService=r,this.recipesService=s,this.mediaMatcher=o,this.usersService=a,this.catalogSettingService=c,this.basketsService=l,this.contextService=u,this.historyService=h,this.contextRegistryService=p,this.basketUtilsService=m,this.sanitizer=g,this.headerPictureUrl="https://storage.googleapis.com/assets.miam.tech/generic/images/default-catalog-picture.png",this.initialRoute="",this.filtersPosition="right",this.displayInfos=!1,this.displayPricing=!0,this.displayRecipeVariant=1,this.maxRecipesPerCategory=20,this.isFilterCollapsed=!0,this.icon=Cv,this.categories=[],this.isMobile=!1,this.showUserFeedback=!1,this.recipeCount=0,this.totalPrice=0,this.isMyMealClose=!0,this.catalogSettingHasLoaded=!1,this.guests=+localStorage.getItem("_miam/preferences/guests"),this.forceListView=!1,this.historyDisplayed=!1,this.subscriptions=[],this.headerHeightSubscription=new d,this.isMobile=o.matchMedia("(max-width: 1022px)").matches,this.historyService.loadComponentScripts()}set isPreferenceModalOpen(e){this._isPreferenceModalOpen=e,this.cdr.detectChanges()}get isPreferenceModalOpen(){return this._isPreferenceModalOpen}ngOnInit(){this.analyticsService.isMealzPage=!0,this.pageview(),this.initFilters(),this.subscriptions.push(this.supplierService.supplier$.asObservable().pipe(bp(e=>void 0===e||null==e),fp(1),th(e=>(this.supplierId=e.id,this.initCatalogHeader(e),this.loadPackages()))).subscribe(),this.basketsService.basketStats$.pipe(bp(e=>!e)).subscribe(e=>{this.recipeCount=e.recipesCount,this.totalPrice=e.totalPrice,this.cdr.detectChanges()}),this.historyService.fetchingHTMLLoader$.subscribe(()=>{this.cdr.detectChanges()}),this.assessShowUserFeedback(),this.executeStoredMethodIfLoggedIn().subscribe()),this.setDirectAccess()}ngAfterViewInit(){this.openFeaturesFromURL(),this.initHeaderHeightListener(),this.cdr.detectChanges()}ngOnDestroy(){var e,t;this.analyticsService.isMealzPage=!1,this.subscriptions.forEach(e=>e.unsubscribe()),null===(e=this.headerHeightSubscription)||void 0===e||e.unsubscribe(),null===(t=this.stickyToolbarObserver)||void 0===t||t.disconnect()}currentPath(){return"recipes"}openFeaturesFromURL(){var e;const t=new URLSearchParams(window.location.search);"true"===t.get("openBasket")&&this.basketUtilsService.openBasket();const i=null===(e=t.get("cost"))||void 0===e?void 0:e.split(",");2===(null==i?void 0:i.length)&&this.setPriceFilters(i)}displayHomePage(){return this.filters.isEmpty()&&!this.forceListView}toggleHistory(e){e&&this.loadHistoryContent(),this.historyDisplayed=e,this.cdr.detectChanges()}initCatalogHeader(e){var t,i,n;if(null===(t=e.relationships["catalog-setting"])||void 0===t?void 0:t.data){const t=null===(n=null===(i=e.relationships["catalog-setting"])||void 0===i?void 0:i.data)||void 0===n?void 0:n.id;this.subscriptions.push(this.catalogSettingService.get(t).pipe(bp(e=>e.is_loading),fp(1),df(e=>{this.catalogSetting=e,this.catalogSettingHasLoaded=!0,this.cdr.detectChanges(),this.setStickyObserver()})).subscribe())}else this.catalogSettingHasLoaded=!0,this.cdr.detectChanges(),this.setStickyObserver()}deepCloneAndResetValues(e){return e.map(e=>Object.assign(Object.assign({},e),{value:!1}))}initFilters(){this.forceListView=!1,this.filters=new Uf({difficulty:this.recipesService.difficultyLevels.map(e=>({name:e.value.toString(),text:e.label,value:!1})),cost:[{name:"0-5",value:!1},{name:"5-10",value:!1},{name:"10-1000",value:!1}],time:[{name:"15",value:!1},{name:"30",value:!1},{name:"60",value:!1},{name:"120",value:!1}]}),this.customFilters&&Object.keys(this.customFilters).forEach(e=>{this.filters[e]=this.deepCloneAndResetValues(this.customFilters[e])}),this.catalogToolbar&&this.catalogToolbar.resetSearchString(),this.filters.search="",this.filters.additionalFilters=null}updateFilters(e,t=!0){this.filters=e.copy(),this.forceListView=t,this.filterToRemove=void 0,this.cdr.detectChanges(),this.setStickyObserver(),this.returnToTop()}seeAllRecipes(){this.filters.additionalFilters={title:"Toutes nos recettes",filters:{}},this.updateFilters(this.filters)}updateSearch(e){if(this.historyDisplayed&&e!==this.historySearch)this.loadHistoryContent(e);else if(e!==this.filters.search){const t=Object.assign(this.filters,{search:e});this.updateFilters(t)}}categoryHidden(e){e&&(this.categories.splice(0,1),this.cdr.detectChanges())}categoryTitleClicked(e){const t=Object.assign(this.filters,{additionalFilters:{filters:e.filters,title:e.title,subtitle:e.subtitle}});this.updateFilters(t)}goToPromotions(){this.setPromotionsFilter()}checkAndSetFavoritesFilter(){this.storeMethodIfCallbackNeeded("setFavoritesFilter").pipe(th(()=>(this.setFavoritesFilter(),td(null)))).subscribe()}setPromotionsFilter(){this.initFilters();const e=Object.assign(this.filters,{additionalFilters:{filters:{discounted_ingredients_count:1},title:"Promos"}});this.updateFilters(e)}setFavoritesFilter(){this.initFilters();const e=Object.assign(this.filters,{additionalFilters:{filters:{liked:!0},title:"Mes id\xe9es repas"}});this.updateFilters(e)}storeMethodIfCallbackNeeded(e){return this.isUserLoggedIn().pipe(fp(1),E(t=>(t||localStorage.setItem("_miam/storeCallbackMethod",e),this.contextRegistryService.hookCallback(t,!0))))}isUserLoggedIn(){return this.usersService.isLogged$}executeStoredMethodIfLoggedIn(){return this.isUserLoggedIn().pipe(bp(e=>!e),fp(1),E(()=>this.getStoredMethod()))}getStoredMethod(){"setFavoritesFilter"===localStorage.getItem("_miam/storeCallbackMethod")&&(this.setFavoritesFilter(),localStorage.removeItem("_miam/storeCallbackMethod"))}setPriceFilters(e){const t=Object.assign(this.filters,{additionalFilters:{filters:{computed_cost:e[0]+",gt,"+e[1]+",lt",recipe_type_id:"main-dish"},title:`Recettes \xe0 moins de ${e[1]}\u20ac`}});this.updateFilters(t)}removeFilter(e){throw new Error("This function is broken, use has been commentated, repair it if you want to use it again")}returnToTop(){this.topAnchor&&this.topAnchor.nativeElement.scrollIntoView()}returnToHomePage(){this.pageview(),this.initFilters(),this.historyDisplayed=!1,this.cdr.detectChanges(),this.setStickyObserver(),this.returnToTop()}onFilterCollapsed(){this.isFilterCollapsed=!this.isFilterCollapsed,this.cdr.detectChanges()}reloadPackages(){this.guests=+localStorage.getItem("_miam/preferences/guests"),this.subscriptions.push(this.loadPackages().subscribe())}isSearchPage(){return!this.displayHomePage()&&!this.historyDisplayed&&this.filters.search&&this.filters.search.length>0}isFavoritesPage(){var e,t;return!this.displayHomePage()&&!this.isSearchPage()&&"Mes id\xe9es repas"===(null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.title)}isPromotionsPage(){var e,t;return!this.displayHomePage()&&!this.isSearchPage()&&"Promos"===(null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.title)}isAllRecipesPage(){var e,t;return!(this.displayHomePage()||this.isSearchPage()||this.isFavoritesPage()||this.isPromotionsPage()||"Toutes nos recettes"!==(null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.title))}isCategoryPage(){var e,t,i;return!this.displayHomePage()&&!this.isSearchPage()&&!this.isFavoritesPage()&&!this.isPromotionsPage()&&!this.isAllRecipesPage()&&(null===(i=null===(t=null===(e=this.filters)||void 0===e?void 0:e.additionalFilters)||void 0===t?void 0:t.title)||void 0===i?void 0:i.length)>0}isDefaultPage(){return!(this.displayHomePage()||this.isSearchPage()||this.isFavoritesPage()||this.isPromotionsPage()||this.isAllRecipesPage()||this.isCategoryPage())}loadPackages(){return this.packageService.categories_for([this.supplierId]).pipe(bp(e=>e.is_loading),df(e=>{this.initCategories(e),this.selectCategoryFromUrl(),this.cdr.detectChanges()}))}loadHistoryContent(e=""){""!==e&&(this.historyHTML=null),this.historyHTML||this.subscriptions.push(this.historyService.displayHistory(e).subscribe(t=>{this.historySearch=e,this.historyHTML=this.sanitizer.bypassSecurityTrustHtml(t),this.cdr.detectChanges(),this.historyService.replaceNoHistoryRedirection(this.contextService.catalogUrl)}))}initCategories(e){this.categories=e.data.map(e=>({key:e.title.trim().toLowerCase().replace(/[^a-zA-Z0-9 -]/,"").replace(/\s/g,"-"),title:e.title,subtitle:e.subtitle,filters:new Uf({additionalFilters:{filters:{packages:e.id},title:""}})}))}selectCategoryFromUrl(){const e=new URLSearchParams(window.location.search);if("favorites"===e.get("catalogCategory"))return this.checkAndSetFavoritesFilter();const t=this.categories.find(t=>t.key===e.get("catalogCategory"));return t?this.categoryTitleClicked({title:t.title,subtitle:t.subtitle,filters:t.filters.additionalFilters.filters}):void 0}assessShowUserFeedback(){return Xg([this.usersService.isLogged$,this.usersService.hasPreference("has_children"),this.usersService.preferencesActivated$]).subscribe(e=>{this.showUserFeedback=e[0]&&!e[1]&&e[2],this.cdr.detectChanges()})}setDirectAccess(){if(""!==this.initialRoute)switch(this.initialRoute){case"mes-repas":this.basketUtilsService.openBasket();break;case"recettes-favorites":this.checkAndSetFavoritesFilter()}}initHeaderHeightListener(){this.headerHeightSubscription.add(this.contextService.supplierHeaderHeight$.subscribe(()=>{document.querySelector(".miam-recipe-catalog__toolbar-container-anchor")&&(this.setStickyObserver(),this.cdr.detectChanges())}))}setStickyObserver(){var e;const t=document.querySelector(".miam-recipe-catalog__toolbar-container-anchor"),i=document.querySelector(".miam-recipe-catalog__toolbar-container");if(!t||!i)return;const n={rootMargin:`-${this.contextService.supplierHeaderHeight$.value}px 0px 0px 0px`,threshold:1};null===(e=this.stickyToolbarObserver)||void 0===e||e.unobserve(t),this.stickyToolbarObserver=new IntersectionObserver(()=>{this.setStickyToolbarStyle(t,i)},n),this.stickyToolbarObserver.observe(t)}setStickyToolbarStyle(e,t){const i=e.getBoundingClientRect(),n=this.contextService.supplierHeaderHeight$.value,r=t.classList.toggle("sticking",i.top<n);e.style.height=r?t.clientHeight+"px":"0px",t.style.top=n+"px",this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(s_),vo(Nf),vo(o_),vo(__),vo(ov),vo(Yf),vo(U_),vo(C_),vo(Iv),vo(Dv),vo(Dp),vo(V_),vo(Lh))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-catalog"]],viewQuery:function(e,t){if(1&e&&(Uc(gS,1),Uc(AS,1),Uc(cx,1),Uc(lx,1),Uc(YC,1)),2&e){let e;Hc(e=qc())&&(t.catalogHeader=e.first),Hc(e=qc())&&(t.catalogToolbar=e.first),Hc(e=qc())&&(t.topAnchor=e.first),Hc(e=qc())&&(t.returnHomeButton=e.first),Hc(e=qc())&&(t.categoriesComp=e)}},inputs:{headerPictureUrl:"headerPictureUrl",initialRoute:"initialRoute",filtersPosition:"filtersPosition",homeLabel:"homeLabel",displayInfos:"displayInfos",displayPricing:"displayPricing",displayRecipeVariant:"displayRecipeVariant",maxRecipesPerCategory:"maxRecipesPerCategory",customFilters:"customFilters"},features:[eo],decls:3,vars:1,consts:[[1,"miam-catalog-anchor"],["miamCatalogTopAnchor",""],["class","miam-recipe-catalog",4,"ngIf"],[1,"miam-recipe-catalog"],[1,"miam-recipe-catalog__content"],[3,"home","history","searchTerm","additionalFiltersTitle","homeLabel","pictureUrl","catalogSetting","returnButtonPressed"],["class","miam-recipe-catalog__toolbar-container-anchor",4,"ngIf"],["class","miam-recipe-catalog__toolbar-container",4,"ngIf"],["class","miam-recipe-catalog__promotions-banner",4,"ngIf"],["class","miam-recipe-catalog__content__myMeal__button",3,"click",4,"ngIf"],["class","miam-recipe-catalog__list",4,"ngIf","ngIfElse"],[3,"filters","isFilterCollapsed","filterToRemove","position","filterChanged","filterCollapsed","preferencesChanged"],[3,"isOpen","filters","isOpenChange","preferencesChanged"],["categoriesComponents",""],[1,"miam-recipe-catalog__toolbar-container-anchor"],[1,"miam-recipe-catalog__toolbar-container"],["stickyToolbar",""],[3,"home","history","searchTerm","additionalFiltersTitle","hideButtons","filterBadgeCount","reduced","filterButtonPressed","preferencesButtonPressed","searchStringChanged","favoritesButtonPressed","returnHomePressed"],[1,"miam-recipe-catalog__promotions-banner"],[3,"clicked"],[1,"miam-recipe-catalog__content__myMeal__button",3,"click"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/cutlery-white.svg","alt","Cutlery",1,"miam-recipe-catalog__myMeal__first__icon"],[1,"miam-recipe-catalog__myMeal__button__text","mealz-ds-text","weight-xl"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/chevron-down-white.svg","alt","Caret",1,"miam-recipe-catalog__myMeal__second__icon"],[1,"miam-recipe-catalog__list"],[1,"miam-recipe-catalog__content__title"],[1,"miam-recipe-catalog__content__title-icon","mealz-ds-button","primary","square",3,"click"],["alt","return","src","https://storage.googleapis.com/assets.miam.tech/generic/icons/ArrowLeft_white.svg"],["class","miam-recipe-catalog__content__title__search__text",4,"ngIf"],["class","miam-recipe-catalog__content__title__favorites__text",4,"ngIf"],["class","miam-recipe-catalog__content__title__promotions__text",4,"ngIf"],["class","miam-recipe-catalog__content__title__all-recipes__text",4,"ngIf"],["class","miam-recipe-catalog__content__title__category",4,"ngIf"],["class","miam-recipe-catalog__content__default__text",4,"ngIf"],["class","miam-catalog-tabs mealz-ds-tabs",4,"ngIf"],["stickyToolbarCollection",""],[3,"ngClass","filters","originTrace","displayPricing","displayInfos","modifiedGuests","displayRecipeVariant","filterRemoved",4,"ngIf"],["class","miam-recipe-catalog__history-container",4,"ngIf"],[1,"miam-recipe-catalog__content__title__search__text"],[1,"miam-recipe-catalog__content__title__favorites__text"],[4,"ngIf"],[1,"miam-recipe-catalog__content__title__promotions__text"],[1,"miam-recipe-catalog__content__title__all-recipes__text"],[1,"miam-recipe-catalog__content__title__category"],[1,"mealz-ds-text","size-l","weight-xxl"],["class","mealz-ds-text size-s weight-l",4,"ngIf"],[1,"mealz-ds-text","size-s","weight-l"],[1,"miam-recipe-catalog__content__default__text"],[1,"miam-catalog-tabs","mealz-ds-tabs"],[1,"miam-catalog-tabs__item","mealz-ds-tab-item","mealz-ds-text","active",3,"click"],["alt","heart icon",3,"src"],[1,"miam-catalog-tabs__item","mealz-ds-tab-item","mealz-ds-text","inactive",3,"click"],["alt","history icon",3,"src"],[3,"ngClass","filters","originTrace","displayPricing","displayInfos","modifiedGuests","displayRecipeVariant","filterRemoved"],[1,"miam-recipe-catalog__history-container"],["class","miam-recipe-catalog__history-loader",4,"ngIf"],[3,"innerHTML"],[1,"miam-recipe-catalog__history-loader"],[1,"miam-ds-loader"],["class","miam-recipe-catalog__categories",4,"ngIf"],[1,"miam-recipe-catalog__categories"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["firstCategory",""],[3,"title","subtitle","filters","maxRecipeNumber","displayInfos","displayPricing","originTrace","modifiedGuests","displayRecipeVariant","displayList"],[1,"miam-recipe-catalog__first-category"],[3,"title","subtitle","filters","displayInfos","displayPricing","maxRecipeNumber","modifiedGuests","displayRecipeVariant","originTrace","displayList","isHidden"],[1,"miam-recipe-catalog__all-banner",3,"click"],[1,"miam-recipe-catalog__all-banner__text","mealz-ds-text","size-m","weight-xl"],[1,"miam-recipe-catalog__all-banner__icon"],["src","https://storage.googleapis.com/assets.miam.tech/generic/icons/ArrowLeft_black.svg","alt","arrow right"]],template:function(e,t){1&e&&(Co(0,"div",0,1),fo(2,Bx,12,19,"div",2)),2&e&&(Nr(2),bo("ngIf",t.catalogSettingHasLoaded))},directives:[Ou,gS,Rw,qS,AS,Hw,ax,Du,Au,YC,Hy],pipes:[Wu],styles:[".miam-recipe-catalog{display:flex;justify-content:space-between;width:100%;position:relative;background-color:var(--mealz-ds-color-neutral-white)}.miam-recipe-catalog .miam-recipe-catalog__toolbar-container-anchor{width:100%}.miam-recipe-catalog .miam-recipe-catalog__toolbar-container{width:-moz-available;width:-webkit-fill-available;width:fill-available;padding:33px 80px 0;box-sizing:border-box;background-color:var(--mealz-ds-color-neutral-white);transition:padding .3s ease}.miam-recipe-catalog .miam-recipe-catalog__toolbar-container.sticking{position:fixed;top:0;z-index:10;border-bottom:1px solid var(--mealz-ds-color-neutral-200,#d9dde1);padding:16px 40px}@media (max-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__toolbar-container{padding:24px 16px 0}.miam-recipe-catalog .miam-recipe-catalog__toolbar-container.sticking{padding:8px}}.miam-recipe-catalog .miam-recipe-catalog__content{width:100%;position:relative}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title{width:100%;padding:0 80px;font-size:20px;line-height:34px;font-weight:900;display:flex;align-items:center;color:var(--mealz-ds-color-neutral-black,#0f191f);box-sizing:border-box}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title>:not(:last-child){margin-right:16px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title__search__text{display:flex;flex-wrap:wrap}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title__search__text>:not(:last-child){margin-right:6px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title-icon{width:32px;height:32px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title-icon img{cursor:pointer;width:13px;height:13px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title__category{display:flex;flex-direction:column}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title__category>:not(:last-child){margin-bottom:4px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title .miam-recipe-catalog__content__title__category .size-s{color:var(--mealz-ds-color-neutral-500)}@media (max-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__content__title{width:100%;padding:0 24px;box-sizing:border-box}}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__promotions-banner{display:none;justify-content:center;margin-top:36px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories{display:flex;flex-direction:column;width:100%;padding:4px 80px 48px;box-sizing:border-box}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category{display:flex;flex-direction:row;width:100%;align-items:flex-end}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category ng-miam-meals-planner-link{margin:0 16px 36px 0}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category ng-miam-catalog-category{flex:1}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__all-banner{display:flex;padding:24px 0;justify-content:center;align-items:center;gap:8px;align-self:stretch;border-radius:8px;background:var(--mealz-ds-color-neutral-100,#eff1f3);cursor:pointer}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__all-banner .miam-recipe-catalog__all-banner__text{color:var(--mealz-ds-color-neutral-black,#0f191f)}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__all-banner .miam-recipe-catalog__all-banner__icon{transform:rotate(-180deg);height:24px}@media (max-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories{padding:24px 0 48px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category{flex-direction:column;align-items:flex-start}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category ng-miam-catalog-category{width:100%}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__first-category ng-miam-meals-planner-link{width:100%;padding:0 24px 24px;box-sizing:border-box;margin:unset}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__categories .miam-recipe-catalog__all-banner{margin:0 24px}}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list{width:100%;padding:24px 0;box-sizing:border-box}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list .miam-recipe-catalog__toolbar-container:not(.sticking){padding-bottom:24px}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list .miam-recipe-catalog__toolbar-container.sticking{padding:8px 24px}@media (max-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list .miam-recipe-catalog__toolbar-container .sticking{padding:8px}}.miam-recipe-catalog .miam-recipe-catalog__content .miam-recipe-catalog__list .miam-recipe-catalog__history-container .miam-recipe-catalog__history-loader{width:100%;font-size:20px;font-weight:700;color:var(--m-color-grey-text);text-align:center}.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs{position:relative;display:flex;box-sizing:border-box;width:100%;padding:24px 80px 0;background-color:var(--mealz-ds-color-neutral-white,#fff);transition:padding .3s ease}.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs .miam-catalog-tabs__item{display:flex;align-items:center;gap:4px;text-decoration:none}.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs .miam-catalog-tabs__item.inactive span{color:var(--mealz-ds-color-neutral-black,#0f191f);opacity:.7}@media (max-width:1023px){.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs{padding:24px 24px 0}}@media (max-width:700px){.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs{padding:24px 0 0}.miam-recipe-catalog .miam-recipe-catalog__content .miam-catalog-tabs .miam-catalog-tabs__item{width:100%;justify-content:center;display:flex}}.miam-recipe-catalog .miam-recipe-catalog__content__myMeal__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;border-radius:1000px;background:var(--miam-color-primary-900,#10323f);box-shadow:0 8px 16px 0 rgba(0,0,0,.2)}.miam-recipe-catalog .miam-recipe-catalog__content__myMeal__button>:not(:last-child){margin-right:12px}.miam-recipe-catalog .miam-recipe-catalog__content__myMeal__button .miam-recipe-catalog__myMeal__button__text{font-weight:700;color:var(--mealz-ds-color-neutral-white,#fff);white-space:nowrap}.miam-recipe-catalog .miam-recipe-catalog__content__myMeal__button .miam-recipe-catalog__myMeal__second__icon{transform:rotate(-90deg)}@media (max-width:607px){.miam-recipe-catalog .miam-recipe-catalog__content__myMeal__button{width:auto;z-index:2}}.miam-recipe-catalog ng-miam-recipe-card .miam-recipe-card{height:var(--m-catalog-card-height);width:var(--m-catalog-card-width)}"],encapsulation:2,changeDetection:0}),e})(),Lx=(()=>{class e{constructor(e){const t={preferences:qS};Object.keys(t).map(i=>{const n="webc-miam-"+i;if(!customElements.get(n)){const r=uh(t[i],{injector:e});customElements.define(n,r)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,Lk,$k]]}),e})(),$x=(()=>{class e{constructor(e){const t={"recipe-catalog":Mx};Object.keys(t).map(i=>{const n="webc-miam-"+i;if(!customElements.get(n)){const r=uh(t[i],{injector:e});customElements.define(n,r)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,Lk,$k,VC,Ib,Lx]]}),e})();function jx(e,t){if(1&e){const e=Io();wo(0,"ng-miam-modal",1),Ao("close",(function(){return Rt(e),Fo().onClose()})),wo(1,"div",2),Co(2,"div",3),wo(3,"div",4),wo(4,"div",5),wo(5,"div",6),wo(6,"span"),Qo(7,"Cump\u0103ra\u021bi pe baza re\u021betelor"),ko(),ko(),wo(8,"div",7),wo(9,"span"),Qo(10,"tradof#Dor\xe9navant faites vos courses \xe0 partir de recettes et ajoutez les ingr\xe9dients en 1 clic !#"),ko(),ko(),ko(),wo(11,"div",8),wo(12,"div",9),wo(13,"span"),Qo(14,"Cum func\u021bioneaz\u0103?"),ko(),ko(),wo(15,"div",10),wo(16,"div",11),wo(17,"div",12),wo(18,"span"),Qo(19,"1"),ko(),ko(),ko(),wo(20,"div",13),wo(21,"span"),Qo(22,"tradof#Retrouvez le d\xe9tail de la recette en cliquant sur la carte.#"),ko(),ko(),ko(),wo(23,"div",10),wo(24,"div",11),wo(25,"div",12),wo(26,"span"),Qo(27,"2"),ko(),ko(),ko(),wo(28,"div",13),wo(29,"span"),Qo(30,"tradof#Ajustez le nombre de convives si n\xe9cessaire.#"),ko(),ko(),ko(),wo(31,"div",10),wo(32,"div",11),wo(33,"div",12),wo(34,"span"),Qo(35,"3"),ko(),ko(),ko(),wo(36,"div",13),wo(37,"span"),Qo(38,'tradof#Cliquez sur "Ajouter les ingr\xe9dients" et ajustez les produits si besoin.#'),ko(),ko(),ko(),wo(39,"div",10),wo(40,"div",11),wo(41,"div",12),wo(42,"span"),Qo(43,"4"),ko(),ko(),ko(),wo(44,"div",13),wo(45,"span"),Qo(46,"At\xe2t, se adaug\u0103! G\u0103si\u021bi detaliul"),ko(),wo(47,"span"),Qo(48),ko(),ko(),ko(),ko(),ko(),ko(),ko()}if(2&e){const e=Fo();bo("display",e.isDisplayed)("noHeaderMode",!0),Nr(48),Ko("",e.stringDetailLocation,".")}}let zx=(()=>{class e{constructor(e,t){this.cdr=e,this.recipesService=t,this.stringDetailLocation="dans l'onglet Mes Repas",this.close=new Rc,this.icon=Cv,this.isDisplayed=!1,this.subscriptions=[]}ngOnInit(){this.subscriptions.push(this.recipesService.displayHelper$.subscribe(e=>{this.isDisplayed=e,this.cdr.detectChanges()}))}onClose(){this.recipesService.toggleHelper(),this.close.emit()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}}return e.\u0275fac=function(t){return new(t||e)(vo(Ga),vo(__))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-helper"]],inputs:{stringDetailLocation:"stringDetailLocation"},outputs:{close:"close"},decls:1,vars:1,consts:[["class","miam-recipe-helper__modal",3,"display","noHeaderMode","close",4,"ngIf"],[1,"miam-recipe-helper__modal",3,"display","noHeaderMode","close"],[1,"miam-recipe-helper"],[1,"miam-recipe-helper__image"],[1,"miam-recipe-helper__content"],[1,"miam-recipe-helper__header"],[1,"miam-recipe-helper__title","mealz-ds-text","size-xl","weight-xxl"],[1,"mealz-ds-text","weight-l"],[1,"miam-recipe-helper__steps"],[1,"miam-recipe-helper__how","mealz-ds-text","weight-xxl"],[1,"miam-recipe-helper__step"],[1,"miam-recipe-helper__step-number","mealz-ds-text","size-s","weight-xxl"],[1,"miam-recipe-helper__step-number__number"],[1,"miam-recipe-helper__step-description","mealz-ds-text","size-s","weight-l"]],template:function(e,t){1&e&&fo(0,jx,49,3,"ng-miam-modal",0),2&e&&bo("ngIf",t.isDisplayed)},directives:[Ou,sw],styles:[".miam-recipe-helper{display:flex;flex-direction:row}@media (max-width:1023px){.miam-recipe-helper{flex-direction:column}}.miam-recipe-helper .miam-recipe-helper__image{width:280px;height:500px;flex-shrink:0;background:50%/cover no-repeat url(https://storage.googleapis.com/assets.miam.tech/generic/images/default-recipe-helper-picture.jpeg)}@media (max-width:1023px){.miam-recipe-helper .miam-recipe-helper__image{width:100%;height:250px}}.miam-recipe-helper .miam-recipe-helper__content{padding:24px}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__header{margin-bottom:24px}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__header .miam-recipe-helper__title{margin-bottom:4px}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__steps .miam-recipe-helper__how{margin-bottom:16px}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__steps .miam-recipe-helper__step{display:flex;flex-direction:row;margin-bottom:12px;align-items:center}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__steps .miam-recipe-helper__step .miam-recipe-helper__step-number{width:24px;height:24px;border-radius:100px;background-color:var(--mealz-ds-color-primary);color:var(--mealz-ds-color-primary-text);margin-right:8px}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__steps .miam-recipe-helper__step .miam-recipe-helper__step-number .miam-recipe-helper__step-number__number{width:24px;height:24px;align-items:center;display:flex;justify-content:center}.miam-recipe-helper .miam-recipe-helper__content .miam-recipe-helper__steps .miam-recipe-helper__step .miam-recipe-helper__step-description span+span{margin-left:5px}.miam-recipe-helper__modal .miam-modal__container.center .miam-modal{padding:unset}@media (max-width:1023px){.miam-recipe-helper__modal .miam-modal__container.center .miam-modal .miam-modal__content-container .miam-modal__header .miam-modal__close-button{border-radius:100px;padding:24px;background-color:#fff}.miam-recipe-helper__modal .miam-modal__container.center .miam-modal .miam-modal__content-container .miam-modal__content{padding:unset}}"],encapsulation:2,changeDetection:0}),e})();var Nx,Vx=function(e,t,i,n){for(var r=-1,s=null==e?0:e.length;++r<s;){var o=e[r];t(n,o,i(o),e)}return n},Hx=function(e,t){if(null==e)return e;if(!Jm(e))return function(e,t){return e&&function(e,t,i){for(var n=-1,r=Object(e),s=i(e),o=s.length;o--;){var a=s[++n];if(!1===t(r[a],a,r))break}return e}(e,t,Xm)}(e,t);for(var i=e.length,n=-1,r=Object(e);++n<i&&!1!==t(r[n],n,r););return e},Ux=function(e,t,i,n){return Hx(e,(function(e,r,s){t(n,e,i(e),s)})),n},qx=Object.prototype.hasOwnProperty,Gx=(Nx=function(e,t,i){qx.call(e,i)?e[i].push(t):function(e,t,i){"__proto__"==t&&zg?zg(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}(e,i,[t])},function(e,t){return(Qp(e)?Vx:Ux)(e,Nx,Mg(t),{})});const Wx=["tag"];function Zx(e,t){if(1&e){const e=Io();wo(0,"div",11,12),wo(2,"ng-miam-icon",13),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(3).toggleRecipe(i.id)})),ko(),wo(3,"span",14),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(3).toggleRecipe(i.id)})),Qo(4),Ec(5,"ellipsis"),ko(),ko()}if(2&e){const e=t.$implicit,i=Fo(3);Nr(2),bo("iconName",i.icon.Meal),Nr(2),Yo(Pc(5,2,e.title,6))}}const Qx=function(e){return{"height.px":e}},Yx=function(e){return{"miam-recipe-tags__container__toggle__hidden":e}},Kx=function(e){return{opacity:e}};function Jx(e,t){if(1&e){const e=Io();wo(0,"div",3),wo(1,"div",4),fo(2,Zx,6,5,"div",5),ko(),wo(3,"div",6),wo(4,"span",7),Ao("click",(function(){return Rt(e),Fo(2).toggleList()})),Qo(5),ko(),Co(6,"div",8),wo(7,"span",9),Ao("click",(function(){return Rt(e),Fo(2).toggleList()})),Co(8,"ng-miam-icon",10),ko(),ko(),ko()}if(2&e){const e=Fo(2);bo("ngStyle",bc(6,Qx,e.isListOpen?32*e.rowCount:24)),Nr(2),bo("ngForOf",e.recipePreviewLines),Nr(1),bo("ngClass",bc(8,Yx,!e.rowCount||0===e.wrappedItemsCount)),Nr(2),Ko(" ",e.isListOpen?" ":"+"+e.wrappedItemsCount,""),Nr(2),bo("ngStyle",bc(10,Kx,e.isListOpen?1:0)),Nr(1),bo("iconName",e.icon.ChevronDown)}}function Xx(e,t){if(1&e&&(So(0),fo(1,Jx,9,12,"div",2),xo()),2&e){const e=Fo();Nr(1),bo("ngIf",(null==e.recipePreviewLines?null:e.recipePreviewLines.length)>0)}}function eE(e,t){if(1&e){const e=Io();wo(0,"div",17),Ao("click",(function(){return Rt(e),Fo(2).toggleModal()})),wo(1,"span",18),Qo(2),ko(),wo(3,"span"),Qo(4,"mas\u0103"),ko(),ko()}if(2&e){const e=Fo(2);Nr(2),Yo(e.recipePreviewLines.length)}}function tE(e,t){if(1&e){const e=Io();wo(0,"div",11,12),wo(2,"ng-miam-icon",13),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(3).toggleRecipe(i.id)})),ko(),wo(3,"span",14),Ao("click",(function(){Rt(e);const i=t.$implicit;return Fo(3).toggleRecipe(i.id)})),Qo(4),ko(),ko()}if(2&e){const e=t.$implicit,i=Fo(3);Nr(2),bo("iconName",i.icon.Meal),Nr(2),Yo(e.title)}}function iE(e,t){if(1&e){const e=Io();wo(0,"ng-miam-modal",19),Ao("close",(function(){return Rt(e),Fo(2).toggleModal()})),wo(1,"div",4),fo(2,tE,5,2,"div",5),ko(),ko()}if(2&e){const e=Fo(2);bo("display",e.modalIsOpened)("noHeaderMode",!1)("recipesCount",e.recipePreviewLines.length),Nr(2),bo("ngForOf",e.recipePreviewLines)}}function nE(e,t){if(1&e&&(fo(0,eE,5,1,"div",15),fo(1,iE,3,4,"ng-miam-modal",16)),2&e){const e=Fo();bo("ngIf",(null==e.recipePreviewLines?null:e.recipePreviewLines.length)>0),Nr(1),bo("ngIf",(null==e.recipePreviewLines?null:e.recipePreviewLines.length)>0)}}let rE=(()=>{class e extends jy{constructor(e,t,i,n,r){super(e),this.cdr=t,this.basketService=i,this.contexteservice=n,this.recipesService=r,this.recipeDetailPreviewAllowed=!0,this.reduce=!0,this.icon=Cv,this.modalIsOpened=!1,this.subscriptions=[]}currentPath(){return""}ngOnChanges(e){e.hasOwnProperty("extId")&&e.extId.firstChange&&this.subscriptions.push(this.basketService.basketPreview$.subscribe(e=>{e&&(this.recipePreviewLines=e.filter(e=>e.entries.found.find(e=>e.selectedItem.attributes["ext-id"]===this.extId)),this.cdr.detectChanges(),this.detectWrappedTags(this.tags))})),this.cdr.detectChanges()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}detectWrappedTags(e){if(0===e.length)return;const t=e.map(e=>e.nativeElement.getBoundingClientRect()),i=Gx(t,"top"),n=Object.keys(i);this.rowCount=n.length,this.lastItemIndexOfFirstRow=i[n[0]].length-1,this.wrappedItemsCount=e.toArray().length-(this.lastItemIndexOfFirstRow+1),this.cdr.detectChanges()}toggleRecipe(e){this.recipesService.display(e,{previewAllowed:this.recipeDetailPreviewAllowed,previewMode:!1})}toggleList(){this.isListOpen=!this.isListOpen,this.cdr.detectChanges()}toggleModal(){this.modalIsOpened=!this.modalIsOpened,this.cdr.detectChanges()}}return e.\u0275fac=function(t){return new(t||e)(vo(Rp),vo(Ga),vo(C_),vo(Iv),vo(__))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-recipe-tags"]],viewQuery:function(e,t){if(1&e&&Uc(Wx,1),2&e){let e;Hc(e=qc())&&(t.tags=e)}},inputs:{extId:"extId",recipeDetailPreviewAllowed:"recipeDetailPreviewAllowed",reduce:"reduce"},features:[eo,at],decls:3,vars:2,consts:[[4,"ngIf","ngIfElse"],["reduced",""],["class","miam-recipe-tags__container",3,"ngStyle",4,"ngIf"],[1,"miam-recipe-tags__container",3,"ngStyle"],[1,"miam-recipe-tags__container__list"],["class","miam-recipe-tags__list__badge",4,"ngFor","ngForOf"],[1,"miam-recipe-tags__container__toggle",3,"ngClass"],[1,"miam-recipe-tags__toggle__open",3,"click"],[1,"miam-recipe-tags__toggle__ligne"],[1,"miam-recipe-tags__toggle__close",3,"ngStyle","click"],["width","24","height","24","primaryColor","var(--m-color-white)",3,"iconName"],[1,"miam-recipe-tags__list__badge"],["tag",""],["primaryColor","var(--m-color-white)",1,"miam-recipe-tags__badge__icon",3,"iconName","click"],[1,"miam-recipe-tag__badge__text",3,"click"],["class","miam-recipe-tags__recipes",3,"click",4,"ngIf"],["class","miam-recipe-tags__modal",3,"display","noHeaderMode","recipesCount","close",4,"ngIf"],[1,"miam-recipe-tags__recipes",3,"click"],[1,"miam-recipe-tags__recipes__count"],[1,"miam-recipe-tags__modal",3,"display","noHeaderMode","recipesCount","close"]],template:function(e,t){if(1&e&&(fo(0,Xx,2,1,"ng-container",0),fo(1,nE,2,2,"ng-template",null,1,Wc)),2&e){const e=_o(2);bo("ngIf",!t.reduce)("ngIfElse",e)}},directives:[Ou,zu,Au,Du,$y,sw],pipes:[Tb],styles:[".miam-recipe-tags__container__list{display:flex;flex-wrap:wrap;flex:1 1;margin:-4px}.miam-recipe-tags__container__list>*{margin:4px}.miam-recipe-tags__container__list .miam-recipe-tags__list__badge{display:flex;align-items:center;padding:0 8px 0 0;height:24px;border:1px solid #e9e9e9;box-sizing:border-box;border-radius:100px;cursor:pointer;position:relative;max-width:50vw}.miam-recipe-tags__container__list .miam-recipe-tags__list__badge .miam-recipe-tags__badge__icon{padding:4px 8px;background:var(--m-color-primary);border-radius:100px 0 0 100px;flex:none;order:0;flex-grow:0}.miam-recipe-tags__container__list .miam-recipe-tags__list__badge .miam-recipe-tag__badge__text{font-size:12px;line-height:16px;color:#676767;margin:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.miam-recipe-tags__container{display:flex;transition:height .25s cubic-bezier(0,0,.2,1);overflow:hidden;padding:0 8px;margin-top:16px}.miam-recipe-tags__container .miam-recipe-tags__container__toggle{display:flex;flex-direction:column;align-items:center;width:80px;visibility:visible}.miam-recipe-tags__container .miam-recipe-tags__container__toggle.miam-recipe-tags__container__toggle__hidden{visibility:hidden}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__open{display:flex;justify-content:center;padding:4px 8px;height:24px;background:#f6f6f6;min-width:40px;border-radius:100px;cursor:pointer;line-height:100%}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__ligne{width:2px;flex:1;background-color:var(--m-color-grey);transform:height 1s linear}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__close{background:var(--m-color-primary);min-width:40px;cursor:pointer;border-radius:100px;transition:opacity .2s linear}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__close ng-miam-icon .icon-container{transform:rotate(180deg)}.miam-recipe-tags__recipes{display:flex;align-items:center;padding:0 8px 0 0;height:24px;border:1px solid #e9e9e9;box-sizing:border-box;border-radius:100px;cursor:pointer;position:relative;max-width:50vw}.miam-recipe-tags__recipes .miam-recipe-tags__recipes__count{margin-right:4px}.miam-recipe-tags__modal .miam-modal{top:50%;right:50%;transform:translate3d(50%,-50%,0);height:auto;animation-name:none}.miam-recipe-tags__modal .miam-modal .miam-modal__container .miam-recipe-tags__container__list{display:flex;flex-flow:row wrap;max-width:480px;padding:24px}@media (max-width:1023px){.miam-recipe-tags__modal .miam-modal .miam-modal__container .miam-recipe-tags__container__list{flex-flow:column}}"],encapsulation:2,changeDetection:0}),e})(),sE=(()=>{class e extends Pv{constructor(e,t,i){super(e),this.http=e,this.posService=t,this.httpUtils=i,this.fetchingHTMLLoader$=new cp(!1),this.componentStylesUrl=this.MEALZ_SSR_API+"/styles/add-to-cart-cta",this.scriptsPaths=[Pp+"/add-to-cart-cta/add-to-cart-cta.min.js"]}displayAddToCartCta(e){const t=this.posService.pos$.getValue();let i=`${this.MEALZ_SSR_API}/add-to-cart-cta?recipe_id=${e}`;(null==t?void 0:t.id)&&(i+="&store_id="+t.id);const n=this.httpUtils.buildHeaders();return this.loadStyles(),this.loadComponentScripts(),this.fetchingHTMLLoader$.next(!0),this.http.get(i,{headers:n,responseType:"text"}).pipe(df(()=>this.fetchingHTMLLoader$.next(!1)))}}return e.\u0275fac=function(t){return new(t||e)(nn(wd),nn(Vf),nn(c_))},e.\u0275prov=de({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),oE=(()=>{class e{constructor(e,t,i){this.addToCartCtaService=e,this.sanitizer=t,this.cdr=i,this.recipeId="14989",this.clicked=new Rc,this.ctaHTML=null}ngOnInit(){this.loadComponent()}loadComponent(){this.addToCartCtaService.displayAddToCartCta(this.recipeId).pipe(fp(1)).subscribe({next:e=>{this.ctaHTML=this.sanitizer.bypassSecurityTrustHtml(e),this.clicked.emit(),this.cdr.detectChanges()},error:e=>{console.error("Error loading add-to-cart-cta component:",e)}})}}return e.\u0275fac=function(t){return new(t||e)(vo(sE),vo(Lh),vo(Ga))},e.\u0275cmp=He({type:e,selectors:[["ng-miam-add-to-cart-cta"]],inputs:{recipeId:"recipeId"},outputs:{clicked:"clicked"},decls:1,vars:1,consts:[[3,"innerHTML"]],template:function(e,t){1&e&&Co(0,"div",0),2&e&&bo("innerHTML",t.ctaHTML,Gn)},encapsulation:2,changeDetection:0}),e})(),aE=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({}),e})();const cE=[zx,rE,oE],lE=["recipe-modal","recipe-helper","recipe-tags","toaster-stack","basket-transfer-modal","add-to-cart-cta"],uE=[oC,VC,$x,Lx,jk];let dE=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=We({type:e}),e.\u0275inj=he({imports:[[ed,Eb,Ib,$k,Lk,aE,...uE],oC,VC,$x,Lx,jk]}),e})();var hE,pE,mE;hE=$d.a,mE=void 0,"string"!=typeof(pE="fr")&&(mE=pE,pE=hE[ra.LocaleId]),pE=pE.toLowerCase().replace(/_/g,"-"),ta[pE]=hE,mE&&(ta[pE][ra.ExtraData]=mE);let gE=(()=>{class e{constructor(e){e.get(Iv),cE.forEach((t,i)=>{if(void 0===customElements.get("webc-miam-"+lE[i])){const n=uh(t,{injector:e});customElements.define("webc-miam-"+lE[i],n)}}),this.injectModals()}ngDoBootstrap(){}injectModals(){["webc-miam-recipe-helper","webc-miam-toaster-stack","webc-miam-basket-transfer-modal","webc-miam-warning-store-locator"].forEach(e=>{if(!document.querySelector(e)){const t=document.createElement(e);document.body.appendChild(t)}})}}return e.\u0275fac=function(t){return new(t||e)(nn(Js))},e.\u0275mod=We({type:e}),e.\u0275inj=he({providers:[C_,zf,H_,__,mv,Xf,r_,fv,h_,Rp,L_,$_,d_,jv,Dv,{provide:Cd,useClass:$v,multi:!0},{provide:nl,useValue:"fr-FR"},{provide:rl,useValue:"EUR"}],imports:[[op.forRoot({url:"https://api.miam.tech/api/v1/"}),dE,Nh]]}),e})();!function(){if(Pl)throw new Error("Cannot enable prod mode after platform setup.");Il=!1}(),jh().bootstrapModule(gE,{ngZone:"noop"})},"6Whc":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMonths=t.getDaysInMonth=void 0,t.getDaysInMonth=function(e){var t=e.getMonth(),i=new Date(0);return i.setFullYear(e.getFullYear(),t+1,0),i.setHours(0,0,0,0),i.getDate()},t.addMonths=function(e,i){var n=e.getMonth()+i,r=new Date(0);r.setFullYear(e.getFullYear(),n,1),r.setHours(0,0,0,0);var s=t.getDaysInMonth(r);e.setMonth(n,Math.min(s,e.getDate()))}},"6Wo6":function(e,t,i){var n,r,s;!function(o){if("object"==typeof e.exports){var a=o(0,t);void 0!==a&&(e.exports=a)}else r=[i,t],void 0===(s="function"==typeof(n=o)?n.apply(t,r):n)||(e.exports=s)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=void 0;t.default=["fr",[["AM","PM"],i,i],i,[["D","L","M","M","J","V","S"],["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],["di","lu","ma","me","je","ve","sa"]],i,[["J","F","M","A","M","J","J","A","S","O","N","D"],["janv.","f\xe9vr.","mars","avr.","mai","juin","juil.","ao\xfbt","sept.","oct.","nov.","d\xe9c."],["janvier","f\xe9vrier","mars","avril","mai","juin","juillet","ao\xfbt","septembre","octobre","novembre","d\xe9cembre"]],i,[["av. J.-C.","ap. J.-C."],i,["avant J\xe9sus-Christ","apr\xe8s J\xe9sus-Christ"]],1,[6,0],["dd/MM/y","d MMM y","d MMMM y","EEEE d MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH:mm:ss zzzz"],["{1} {0}","{1} '\xe0' {0}",i,i],[",","\u202f",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0\xa0%","#,##0.00\xa0\xa4","#E0"],"EUR","\u20ac","euro",{ARS:["$AR","$"],AUD:["$AU","$"],BEF:["FB"],BMD:["$BM","$"],BND:["$BN","$"],BZD:["$BZ","$"],CAD:["$CA","$"],CLP:["$CL","$"],CNY:[i,"\xa5"],COP:["$CO","$"],CYP:["\xa3CY"],EGP:[i,"\xa3E"],FJD:["$FJ","$"],FKP:["\xa3FK","\xa3"],FRF:["F"],GBP:["\xa3GB","\xa3"],GIP:["\xa3GI","\xa3"],HKD:[i,"$"],IEP:["\xa3IE"],ILP:["\xa3IL"],ITL:["\u20a4IT"],JPY:[i,"\xa5"],KMF:[i,"FC"],LBP:["\xa3LB","\xa3L"],MTP:["\xa3MT"],MXN:["$MX","$"],NAD:["$NA","$"],NIO:[i,"$C"],NZD:["$NZ","$"],RHD:["$RH"],RON:[i,"L"],RWF:[i,"FR"],SBD:["$SB","$"],SGD:["$SG","$"],SRD:["$SR","$"],TOP:[i,"$T"],TTD:["$TT","$"],TWD:[i,"NT$"],USD:["$US","$"],UYU:["$UY","$"],WST:["$WS"],XCD:[i,"$"],XPF:["FCFP"],ZMW:[i,"Kw"]},"ltr",function(e){var t=Math.floor(Math.abs(e));return 0===t||1===t?1:5}]}))},"960K":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isZero=void 0;var n=i("svPx");t.isZero=function(e){return 0===n.toMilliseconds(e)}},"9a4g":function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.UNITS_META=t.UNITS=t.UNITS_META_MAP=t.UNITS_META_MAP_LITERAL=t.ZERO=void 0,t.ZERO=Object.freeze({years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0}),t.UNITS_META_MAP_LITERAL={years:{milliseconds:31536e6,months:12,dateGetter:function(e){return e.getFullYear()},ISOCharacter:"Y",ISOPrecision:"period"},months:{milliseconds:2628e6,months:1,dateGetter:function(e){return e.getMonth()},ISOCharacter:"M",ISOPrecision:"period"},weeks:{milliseconds:6048e5,dateGetter:function(){return 0},ISOCharacter:"W",ISOPrecision:"period",stringifyConvertTo:"days"},days:{milliseconds:864e5,dateGetter:function(e){return e.getDate()},ISOCharacter:"D",ISOPrecision:"period"},hours:{milliseconds:36e5,dateGetter:function(e){return e.getHours()},ISOCharacter:"H",ISOPrecision:"time"},minutes:{milliseconds:6e4,dateGetter:function(e){return e.getMinutes()},ISOCharacter:"M",ISOPrecision:"time"},seconds:{milliseconds:1e3,dateGetter:function(e){return e.getSeconds()},ISOCharacter:"S",ISOPrecision:"time"},milliseconds:{milliseconds:1,dateGetter:function(e){return e.getMilliseconds()},stringifyConvertTo:"seconds"}},t.UNITS_META_MAP=t.UNITS_META_MAP_LITERAL,t.UNITS=Object.freeze(["years","months","weeks","days","hours","minutes","seconds","milliseconds"]),t.UNITS_META=Object.freeze(t.UNITS.map((function(e){return n(n({},t.UNITS_META_MAP[e]),{unit:e})})))},"9aqK":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validate=void 0;var n=i("9a4g");t.validate=function(e){Object.keys(e).forEach((function(t){if(!n.UNITS.includes(t))throw new TypeError('Unexpected property "'+t+'" on Duration object.');if(!Number.isInteger(e[t]))throw new TypeError('Property "'+t+'" must be a an integer. Received '+e[t]+".")}))}},Af8m:function(e,t,i){"use strict";(function(e){var n=i("kq48"),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===r&&n.a.process,a=function(){try{return s&&s.require&&s.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();t.a=a}).call(this,i("cyaT")(e))},D57s:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.cleanDurationObject=void 0;var r=i("9a4g");t.cleanDurationObject=function(e){var t=n({},e);return r.UNITS.forEach((function(e){0===t[e]&&(t[e]=0)})),t}},GrrB:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.apply=void 0;var n=i("6Whc"),r=i("X1CF");t.apply=function(e,t){var i=new Date(e),s=r.parse(t),o=s.weeks,a=s.days,c=s.hours,l=s.minutes,u=s.seconds,d=s.milliseconds;return n.addMonths(i,12*s.years+s.months),i.setDate(i.getDate()+7*o+a),i.setHours(i.getHours()+c,i.getMinutes()+l,i.getSeconds()+u,i.getMilliseconds()+d),i}},JsNM:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.between=void 0;var r=i("9a4g");t.between=function(e,t){var i=new Date(e),s=new Date(t),o=n({},r.ZERO);return r.UNITS_META.forEach((function(e){var t=e.dateGetter;o[e.unit]=t(s)-t(i)})),o}},MBFf:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.negate=void 0;var r=i("9a4g"),s=i("X1CF");t.negate=function(e){var t=n({},s.parse(e));return r.UNITS.forEach((function(e){t[e]=0===t[e]?0:-t[e]})),t}},NMSN:function(e,t,i){"use strict";var n=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var n=Array(e),r=0;for(t=0;t<i;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n};Object.defineProperty(t,"__esModule",{value:!0}),t.subtract=void 0;var r=i("MBFf"),s=i("ROwQ");t.subtract=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];return s.sum.apply(void 0,n([e],t.map(r.negate)))}},NoVc:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},ROwQ:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.sum=void 0;var r=i("9a4g"),s=i("X1CF");t.sum=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=n({},r.ZERO);return e.map(s.parse).forEach((function(e){r.UNITS.forEach((function(t){i[t]+=e[t]}))})),i}},TOAu:function(e,t,i){e.exports=(()=>{"use strict";var e={d:(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PlausibleEvent:()=>en,initSharedAnalytics:()=>Zi,sendEvent:()=>_n,setABTestKey:()=>Qi,setAffiliate:()=>Yi}),void 0===Math.imul&&(Math.imul=function(e,t){return(4294901760&e)*(65535&t)+(65535&e)*(0|t)|0}),void 0===ArrayBuffer.isView&&(ArrayBuffer.isView=function(e){return null!=e&&null!=e.__proto__&&e.__proto__.__proto__===Int8Array.prototype.__proto__});var i,n,r,s,o,a,c,l,u,d,h,p,m,g,f,_,v,b,y,w,k,C,S,x,E,I,P,D,T,A,R,O,F,B,M,L,$,j,z,N,V,H,U,q,G,W,Z,Q,Y,K,J,X,ee,te,ie,ne,re,se,oe,ae,ce,le,ue,de,he,pe,me,ge,fe,_e,ve,be,ye,we,ke,Ce,Se,xe,Ee,Ie,Pe,De,Te,Ae,Re,Oe,Fe,Be,Me,Le,$e,je,ze,Ne,Ve,He,Ue,qe,Ge,We,Ze,Qe,Ye,Ke,Je,Xe,et,tt,it,nt,rt,st,ot,at,ct,lt,ut,dt,ht,pt,mt,gt,ft=ArrayBuffer.isView,_t=Math.imul;function vt(){}function bt(){}function yt(e,t){return e>t?t:e}function wt(e,t){return e<t?t:e}function kt(e,t){return e-t|0}function Ct(e,t){return e-t|0}function St(e){return String.fromCharCode(e)}function xt(){}function Et(){}function It(e,t){this.c_1=e,this.d_1=t}function Pt(e){var t=null==e?null:Mt(e);return null==t?"null":t}function Dt(){}function Tt(e){var t=e>>5,i=new Int32Array(t+1|0);return i[t]=i[t]|1<<(31&e),i}function At(e){this.h_1=e,this.g_1=0}function Rt(e,t){var i;if(Ot(e)){var n=e.charCodeAt(t);if(n<0||n>65535)throw si("Invalid Char code: "+n);i=function(e){return function(e){return 65535&e}(function(e){return e<<16>>16}(function(e){return e instanceof Dt?e.f():function(e){return e>2147483647?2147483647:e<-2147483648?-2147483648:0|e}(e)}(e)))}(n)}else i=e.k(t);return i}function Ot(e){return"string"==typeof e}function Ft(e){return Ot(e)?e.length:e.l()}function Bt(e){return e=e===r?null:e,Object.create(e)}function Mt(e){return null==e?"null":Wt(e)?"[...]":"function"!=typeof e.toString?function(e){return Object.prototype.toString.call(e)}(e):e.toString()}function Lt(e,t){return null==e?null==t:null!=t&&("object"==typeof e&&"function"==typeof e.equals?e.equals(t):e!=e?t!=t:"number"==typeof e&&"number"==typeof t?e===t&&(0!==e||1/e==1/t):e===t)}function $t(e,t){null!=Error.captureStackTrace?Error.captureStackTrace(e,t):e.stack=(new Error).stack}function jt(e){return e.prototype}function zt(e,t,i){Error.call(e),function(e,t,i){var n=function e(t){var i=t.constructor,n=null==i?null:i.$metadata$,r=null==n?null:n.errorInfo;if(null!=r)return r;var s=0;if(Zt(t,"message")&&(s|=1),Zt(t,"cause")&&(s|=2),3!==s){var o=Object.getPrototypeOf(t);o!=Error.prototype&&(s|=e(o))}return null!=n&&(n.errorInfo=s),s}(Object.getPrototypeOf(e));if(!(1&n)){var s;if(null==t){var o;if(null!==t){var a=null==i?null:i.toString();o=null==a?r:a}else o=r;s=o}else s=t;e.message=s}2&n||(e.cause=i),e.name=Object.getPrototypeOf(e).constructor.name}(e,t,i)}function Nt(){throw gi()}function Vt(e){throw _i("lateinit property "+e+" has not been initialized")}function Ht(e,t,i,s,o,a,c,l,u){null!=o&&(t.prototype=Object.create(o.prototype),t.prototype.constructor=t);var d=function(e,t,i,s,o,a){return{kind:e,simpleName:t,associatedObjectKey:s,associatedObjects:o,suspendArity:a,$kClass$:r,defaultConstructor:i,iid:"interface"===e?(n===r&&(n=0),n=n+1|0):r}}(e,i,s,l,u,c);t.$metadata$=d,null!=a&&((Lt(d.iid,r)?t.prototype:t).$imask$=function(e){for(var t=1,i=[],n=0,r=e.length;n<r;){var s=e[n];n=n+1|0;var o=t,a=s.prototype.$imask$,c=null==a?s.$imask$:a;null!=c&&(i.push(c),o=c.length);var l=s.$metadata$.iid,u=null==l?null:Tt(l);null!=u&&(i.push(u),o=Math.max(o,u.length)),o>t&&(t=o)}return function(e,t){for(var i=0,n=new Int32Array(e);i<e;){for(var r=i,s=0,o=0,a=t.length;o<a;){var c=t[o];o=o+1|0,r<c.length&&(s|=c[r])}n[r]=s,i=i+1|0}return n}(t,i)}(a))}function Ut(e,t,i,n,r,s,o,a){Ht("class",e,t,i,n,r,s,o,a)}function qt(e,t,i,n,r,s,o,a){Ht("object",e,t,i,n,r,s,o,a)}function Gt(e,t,i,n){qt(e,"Companion",r,t,i,n,r,r)}function Wt(e){return Array.isArray(e)||ft(e)}function Zt(e,t){return e.hasOwnProperty(t)}function Qt(){s=this,this.m_1=new Int32Array([48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296])}function Yt(){return null==s&&new Qt,s}function Kt(){}function Jt(e){Kt.call(this),this.o_1=e}function Xt(){ei.call(this)}function ei(){Kt.call(this),this.q_1=""}function ti(){if(!a){a=!0;var e="undefined"!=typeof process&&process.versions&&!!process.versions.node;o=e?new Jt(process.stdout):new Xt}}function ii(e){var t,i,n=e;return null!=e.iterator?e.iterator():Wt(n)?new At(n):(null!=n&&(t=n,i=xt,function(e,t){var i=e.$imask$;return null!=i&&function(e,t){var i=t>>5;return!(i>e.length||0==(e[i]&1<<(31&t)))}(i,t)}(t,i.$metadata$.iid))?n:Nt()).b()}function ni(e){return zt(e),ri.call(e),e}function ri(){$t(this,ri)}function si(e){var t=function(e,t){return ui(e,t),oi.call(t),t}(e,Bt(jt(oi)));return $t(t,si),t}function oi(){$t(this,oi)}function ai(e){var t=function(e,t){return ui(e,t),ci.call(t),t}(e,Bt(jt(ci)));return $t(t,ai),t}function ci(){$t(this,ci)}function li(e){return ni(e),di.call(e),e}function ui(e,t){return function(e,t){zt(t,e),ri.call(t)}(e,t),di.call(t),t}function di(){$t(this,di)}function hi(){var e,t=(li(e=Bt(jt(mi))),mi.call(e),e);return $t(t,hi),t}function pi(e){var t=function(e,t){return ui(e,t),mi.call(t),t}(e,Bt(jt(mi)));return $t(t,pi),t}function mi(){$t(this,mi)}function gi(){var e,t=(li(e=Bt(jt(fi))),fi.call(e),e);return $t(t,gi),t}function fi(){$t(this,fi)}function _i(e){var t=function(e,t){return ui(e,t),vi.call(t),t}(e,Bt(jt(vi)));return $t(t,_i),t}function vi(){$t(this,vi)}function bi(e){var t=St(e).toUpperCase();return t.length>1?e:Rt(t,0)}function yi(e){return function(e){return 9<=e&&e<=13||28<=e&&e<=32||160===e||e>4096&&(5760===e||8192<=e&&e<=8202||8232===e||8233===e||8239===e||8287===e||12288===e)}(e)}function wi(e,t){var i,n,r,s=kt(e,48)>=0&&kt(e,57)<=0?Ct(e,48):kt(e,65)>=0&&kt(e,90)<=0?Ct(e,65)+10|0:kt(e,97)>=0&&kt(e,122)<=0?Ct(e,97)+10|0:kt(e,128)<0?-1:kt(e,65313)>=0&&kt(e,65338)<=0?Ct(e,65313)+10|0:kt(e,65345)>=0&&kt(e,65370)<=0?Ct(e,65345)+10|0:(i=e,n=function(e,t){for(var i=0,n=e.length-1|0,r=-1,s=0;i<=n;)if(t>(s=e[r=(i+n|0)/2|0]))i=r+1|0;else{if(t===s)return r;n=r-1|0}return r-(t<s?1:0)|0}(Yt().m_1,i),(r=i-Yt().m_1[n]|0)<10?r:-1);return s>=t?-1:s}function ki(e,t,i,n,s,o){return Mi(e,t,i,n,s,o=o!==r&&o)}function Ci(){}function Si(e,t,i){return xi(xi(e,i)-xi(t,i)|0,i)}function xi(e,t){var i=e%t|0;return i>=0?i:i+t|0}function Ei(){c=this,this.v_1=new Ii(1,0)}function Ii(e,t){null==c&&new Ei,Ti.call(this,e,t,1)}function Pi(e,t,i){Ci.call(this),this.d1_1=i,this.e1_1=t,this.f1_1=this.d1_1>0?e<=t:e>=t,this.g1_1=this.f1_1?e:this.e1_1}function Di(){}function Ti(e,t,i){if(0===i)throw si("Step must be non-zero.");if(-2147483648===i)throw si("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.a1_1=e,this.b1_1=function(e,t,i){var n;if(i>0)n=e>=t?t:t-Si(t,e,i)|0;else{if(!(i<0))throw si("Step is zero.");n=e<=t?t:t+Si(e,t,0|-i)|0}return n}(e,t,i),this.c1_1=i}function Ai(e,t,i){if(e===t)return!0;if(!(i=i!==r&&i))return!1;var n=bi(e),s=bi(t);return n===s||Rt(St(n).toLowerCase(),0)===Rt(St(s).toLowerCase(),0)}function Ri(e){var t;e:{for(var i=0;i<Ft(e);){var n=Rt(e,i);if(i=i+1|0,!yi(n)){t=!1;break e}}t=!0}return t}function Oi(e,t,i,n){return i=i===r?0:i,(n=n!==r&&n)||"string"!=typeof e?Fi(e,t,i,Ft(e),n):e.indexOf(t,i)}function Fi(e,t,i,n,s,o){var a=(o=o!==r&&o)?function(e,t){return l.a(e,t,-1)}(yt(i,Bi(e)),wt(n,0)):new Ii(wt(i,0),yt(n,Ft(e)));if("string"==typeof e&&"string"==typeof t){var c=a.a1_1,u=a.b1_1,d=a.c1_1;if(d>0&&c<=u||d<0&&u<=c)do{var h=c;if(c=c+d|0,ki(t,0,e,h,Ft(t),s))return h}while(h!==u)}else{var p=a.a1_1,m=a.b1_1,g=a.c1_1;if(g>0&&p<=m||g<0&&m<=p)do{var f=p;if(p=p+g|0,Mi(t,0,e,f,Ft(t),s))return f}while(f!==m)}return-1}function Bi(e){return Ft(e)-1|0}function Mi(e,t,i,n,r,s){if(n<0||t<0||t>(Ft(e)-r|0)||n>(Ft(i)-r|0))return!1;var o=0;if(o<r)do{var a=o;if(o=o+1|0,!Ai(Rt(e,t+a|0),Rt(i,n+a|0),s))return!1}while(o<r);return!0}function Li(e,t){this.h1_1=e,this.i1_1=t}function $i(e,t){return new Li(e,t)}function ji(e){var t=e.k1_1;if(null!=t)return t;Vt("domain")}function zi(e){var t=e.m1_1;if(null!=t)return t;Vt("clientSDKVersion")}function Ni(e){return!(null==e.k1_1||null==e.m1_1||Ri(ji(e))||Ri(zi(e)))}function Vi(e,t){if(n=t,o=o!==r&&o,!("string"==typeof(s="/miam/")?Oi(n,s,r,o)>=0:Fi(n,s,0,Ft(n),o)>=0))return i;var n,s,o,a;(function(e){for(var t=new mn([]),i=0,n=0;i<e.length;){if(47===Rt(e,i)){if(i>n){var r=e.substring(n,i);t.e3(r)}n=i+1|0}i=i+1|0}if(n<e.length){var s=e.substring(n);t.e3(s)}return t})(function(e,t,i){i=i===r?e:i;var n=Oi(e,"/miam/");return-1===n?i:e.substring(n+6|0,e.length)}(t)).r1((a=t,function(e){if(!Ui().t1_1.v1(e)&&null==function(e){return function(e){var t,i,n,r=e.length;if(0===r)return null;var s=Rt(e,0);if(kt(s,48)<0){if(1===r)return null;if(t=1,45===s)i=!0,n=-2147483648;else{if(43!==s)return null;i=!1,n=-2147483647}}else t=0,i=!1,n=-2147483647;var o=-59652323,a=o,c=0,l=t;if(l<r)do{var u=l;l=l+1|0;var d=wi(Rt(e,u),10);if(d<0)return null;if(c<a){if(a!==o)return null;if(c<(a=n/10|0))return null}if((c=_t(c,10))<(n+d|0))return null;c=c-d|0}while(l<r);return i?c:0|-c}(e)}(e))throw si('Invalid path : "'+a+'". "'+e+'" is not a valid path part.');return i}))}function Hi(){u=this,this.s1_1="https://plausible.io/api/event",this.t1_1=new mn(["","basket","basket-preview","catalog","categories","cooking","filter","finalize","item-selector","liked","list-scan","locator","meals-planner","dashboard","current","onboarding","ordered","orders","preferences","products","recipes","results","shopping","sponsor","search","supplier-selector","history"]),this.u1_1=new mn(["mealz-space","shelves","search","","retailer-shelves","retailer-search","meals-space-home","meals-space-catalog","meals-space-catalog-search","meals-space-category","meals-space-category-search","meals-space-recipe-details","meals-space-all-recipes","my-meals","item-replacement","basket","meals-planner-home","meals-planner-dashboard","meals-planner-catalog","meals-planner-catalog-search","meals-planner-categories","meals-planner-recipe-details","my-space-favorites","my-space-history"])}function Ui(){return null==u&&new Hi,u}function qi(){Ui(),this.n1_1="prod",this.o1_1=null,this.p1_1=null}function Gi(){d=this,this.k2_1=new fn([$i((Ji(),m).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),g).n2_1,Wi(new mn(["search_term"]),new mn([]))),$i((Ji(),f).n2_1,Wi(new mn(["search_term","number_of_results"]),new mn([]))),$i((Ji(),_).n2_1,Wi(new mn(["recipe_id"]),new mn(["category_id"]))),$i((Ji(),v).n2_1,Wi(new mn(["recipe_id"]),new mn(["category_id"]))),$i((Ji(),b).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),y).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),w).n2_1,Wi(new mn(["recipe_id"]),new mn(["mode","recipe_source"]))),$i((Ji(),k).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),C).n2_1,Wi(new mn(["recipe_id"]),new mn(["guests"]))),$i((Ji(),S).n2_1,Wi(new mn(["recipe_id"]),new mn(["category_id"]))),$i((Ji(),x).n2_1,Wi(new mn(["recipe_id"]),new mn(["category_id"]))),$i((Ji(),I).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),E).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),P).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),D).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),T).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),A).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),R).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),O).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),F).n2_1,Wi(new mn(["step"]),new mn([]))),$i((Ji(),B).n2_1,Wi(new mn(["category_id"]),new mn([]))),$i((Ji(),M).n2_1,Wi(new mn(["category_id"]),new mn([]))),$i((Ji(),L).n2_1,Wi(new mn(["category_id"]),new mn([]))),$i((Ji(),$).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),j).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),z).n2_1,Wi(new mn(["search_term"]),new mn([]))),$i((Ji(),N).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),V).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),H).n2_1,Wi(new mn(["search_term"]),new mn([]))),$i((Ji(),U).n2_1,Wi(new mn(["basket_id"]),new mn([]))),$i((Ji(),q).n2_1,Wi(new mn(["basket_id"]),new mn([]))),$i((Ji(),G).n2_1,Wi(new mn(["basket_id"]),new mn([]))),$i((Ji(),W).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Z).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Q).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Y).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),K).n2_1,Wi(new mn(["guests"]),new mn([]))),$i((Ji(),J).n2_1,Wi(new mn(["tag_type","tag_id"]),new mn([]))),$i((Ji(),X).n2_1,Wi(new mn(["search_term"]),new mn([]))),$i((Ji(),ee).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id"]))),$i((Ji(),te).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id","add_source","mode"]))),$i((Ji(),ie).n2_1,Wi(new mn(["recipe_id","entry_count"]),new mn(["total_products","total_price"]))),$i((Ji(),ne).n2_1,Wi(new mn(["recipe_id","entry_count"]),new mn([]))),$i((Ji(),re).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id"]))),$i((Ji(),se).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id"]))),$i((Ji(),oe).n2_1,Wi(new mn(["entry_name","product_quantity"]),new mn(["item_id","ext_item_id","item_ean","recipe_id","status"]))),$i((Ji(),ae).n2_1,Wi(new mn(["entry_name","new_item_id","new_item_ext_id","new_item_ean"]),new mn(["old_item_id","old_item_ext_id","old_item_ean","product_quantity","search_term","recipe_id"]))),$i((Ji(),ce).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id"]))),$i((Ji(),le).n2_1,Wi(new mn(["entry_name","item_id","ext_item_id","item_ean","product_quantity"]),new mn(["recipe_id"]))),$i((Ji(),ue).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),de).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),he).n2_1,Wi(new mn(["search_term"]),new mn(["old_item_id","old_item_ext_id","old_item_ean","recipe_id"]))),$i((Ji(),pe).n2_1,Wi(new mn(["basket_id","miam_amount","total_amount","pos_id","pos_name","recipe_count","miam_products"]),new mn(["total_products","client_order_id"]))),$i((Ji(),me).n2_1,Wi(new mn(["basket_id","miam_amount","total_amount","pos_id","pos_name","recipe_count","miam_products"]),new mn(["total_products","client_order_id"]))),$i((Ji(),ge).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),fe).n2_1,Wi(new mn(["number_of_recipes"]),new mn([]))),$i((Ji(),_e).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),ve).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),be).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),ye).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),we).n2_1,Wi(new mn(["basket_id","miam_amount","total_amount","pos_id","pos_name","recipe_count","miam_products"]),new mn(["total_products","client_order_id"]))),$i((Ji(),ke).n2_1,Wi(new mn(["basket_id","miam_amount","pos_id","pos_name","supplier_id"]),new mn([]))),$i((Ji(),Le).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),$e).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),je).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),ze).n2_1,Wi(new mn(["supplier_id"]),new mn([]))),$i((Ji(),Ce).n2_1,Wi(new mn(["guests"]),new mn(["budget","recipe_count","mode"]))),$i((Ji(),Se).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Ee).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),xe).n2_1,Wi(new mn(["recipe_id"]),new mn(["recipe_source","mode"]))),$i((Ji(),Ie).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),Pe).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),De).n2_1,Wi(new mn(["recipe_id"]),new mn([]))),$i((Ji(),Te).n2_1,Wi(new mn(["recipe_id","item_id"]),new mn([]))),$i((Ji(),Ae).n2_1,Wi(new mn(["recipe_id","item_id"]),new mn([]))),$i((Ji(),Re).n2_1,Wi(new mn(["recipe_id","item_id"]),new mn([]))),$i((Ji(),Oe).n2_1,Wi(new mn(["recipe_id","new_item_id"]),new mn(["old_item_id"]))),$i((Ji(),Fe).n2_1,Wi(new mn(["budget_user","budget_planner","recipe_count","guests","uses_count","time_passed"]),new mn([]))),$i((Ji(),Be).n2_1,Wi(new mn(["budget_user","recipe_count","guests"]),new mn(["budget_planner","mode"]))),$i((Ji(),Me).n2_1,Wi(new mn(["mode"]),new mn([]))),$i((Ji(),Ne).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Ve).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),He).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Ue).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),qe).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),Ge).n2_1,Wi(new mn(["search_term","stores_found_count"]),new mn([]))),$i((Ji(),We).n2_1,Wi(new mn(["supplier_name"]),new mn([]))),$i((Ji(),Ze).n2_1,Wi(new mn(["pos_id","pos_name","supplier_name"]),new mn([]))),$i((Ji(),Qe).n2_1,Wi(new mn(["steps_completed"]),new mn([]))),$i((Ji(),Ye).n2_1,Wi(new mn(["steps_completed"]),new mn([]))),$i((Ji(),Ke).n2_1,Wi(new mn(["type","step"]),new mn([]))),$i((Ji(),Je).n2_1,Wi(new mn(["type"]),new mn([]))),$i((Ji(),Xe).n2_1,Wi(new mn(["type"]),new mn([]))),$i((Ji(),et).n2_1,Wi(new mn(["type","step"]),new mn([]))),$i((Ji(),tt).n2_1,Wi(new mn(["type"]),new mn([]))),$i((Ji(),it).n2_1,Wi(new mn(["type","step"]),new mn([]))),$i((Ji(),nt).n2_1,Wi(new mn(["from"]),new mn([]))),$i((Ji(),rt).n2_1,Wi(new mn(["step"]),new mn([]))),$i((Ji(),st).n2_1,Wi(new mn(["step"]),new mn([]))),$i((Ji(),ot).n2_1,Wi(new mn(["step"]),new mn([]))),$i((Ji(),at).n2_1,Wi(new mn([]),new mn([]))),$i((Ji(),ct).n2_1,Wi(new mn(["step"]),new mn([])))])}function Wi(e,t){return new fn([$i("mandatory",e),$i("optional",t)])}function Zi(e,t,i,n){n=n===r?"prod":n,pn().z2(e,t,i,n)}function Qi(e){pn().o1_1=e}function Yi(e){pn().p1_1=e}function Ki(e,t){It.call(this,e,t)}function Ji(){if(lt)return i;lt=!0,m=new Xi("PAGEVIEW",0,"pageview"),g=new Xi("SEARCH",1,"search"),f=new Xi("SEARCH_RESULTS",2,"search.results"),_=new Xi("RECIPE_SHOW",3,"recipe.show"),v=new Xi("RECIPE_DISPLAY",4,"recipe.display"),b=new Xi("RECIPE_COOKING_DISPLAY",5,"recipe.cooking.display"),y=new Xi("RECIPE_SHOPPING_DISPLAY",6,"recipe.shopping.display"),w=new Xi("RECIPE_ADD",7,"recipe.add"),k=new Xi("RECIPE_REMOVE",8,"recipe.remove"),C=new Xi("RECIPE_CHANGE_GUESTS",9,"recipe.change-guests"),S=new Xi("RECIPE_LIKE",10,"recipe.like"),x=new Xi("RECIPE_UNLIKE",11,"recipe.unlike"),E=new Xi("RECIPE_CLOSE",12,"recipe.close"),I=new Xi("RECIPE_CONTINUE",13,"recipe.continue"),P=new Xi("RECIPE_ORDERED_DISPLAY",14,"recipe.ordered.display"),D=new Xi("RECIPE_ORDERED_CLOSE",15,"recipe.ordered.close"),T=new Xi("SPONSOR_DISPLAY",16,"sponsor.display"),A=new Xi("SPONSOR_BACK",17,"sponsor.back"),R=new Xi("SPONSOR_CLOSE",18,"sponsor.close"),O=new Xi("HOME_DISPLAY",19,"home.display"),F=new Xi("BREADCRUMB_SELECT",20,"breadcrumb.select"),B=new Xi("CATEGORY_SHOW",21,"category.show"),M=new Xi("CATEGORY_DISPLAY",22,"category.display"),L=new Xi("CATEGORY_BACK",23,"category.back"),$=new Xi("LIKED_DISPLAY",24,"liked.display"),j=new Xi("LIKED_BACK",25,"liked.back"),z=new Xi("LIKED_SEARCH",26,"liked.search"),N=new Xi("ORDERS_DISPLAY",27,"orders.display"),V=new Xi("ORDERS_BACK",28,"orders.back"),H=new Xi("ORDERS_SEARCH",29,"orders.search"),U=new Xi("ORDER_DISPLAY",30,"order.display"),q=new Xi("ORDER_BACK",31,"order.back"),G=new Xi("ORDER_CLOSE",32,"order.close"),W=new Xi("PREFERENCES_DISPLAY",33,"preferences.display"),Z=new Xi("PREFERENCES_CLOSE",34,"preferences.close"),Q=new Xi("PREFERENCES_RESET",35,"preferences.reset"),Y=new Xi("PREFERENCES_SAVE",36,"preferences.save"),K=new Xi("PREFERENCES_GUESTS",37,"preferences.guests"),J=new Xi("PREFERENCES_TAG_SELECTED",38,"preferences.tag.selected"),X=new Xi("PREFERENCES_SEARCH",39,"preferences.search"),ee=new Xi("ENTRY_ADD",40,"entry.add"),te=new Xi("ENTRY_ADDED",41,"entry.added"),ie=new Xi("ENTRY_ADD_ALL",42,"entry.add-all"),ne=new Xi("ENTRY_ADD_ALL_AGAIN",43,"entry.add-all-again"),re=new Xi("ENTRY_DELETE",44,"entry.delete"),se=new Xi("ENTRY_DELETED",45,"entry.deleted"),oe=new Xi("ENTRY_REPLACE",46,"entry.replace"),ae=new Xi("ENTRY_REPLACED",47,"entry.replaced"),ce=new Xi("ENTRY_CHANGE_QUANTITY",48,"entry.change-quantity"),le=new Xi("ENTRY_IGNORE",49,"entry.ignore"),ue=new Xi("ITEM_SELECTOR_BACK",50,"item-selector.back"),de=new Xi("ITEM_SELECTOR_CLOSE",51,"item-selector.close"),he=new Xi("ITEM_SELECTOR_SEARCH",52,"item-selector.search"),pe=new Xi("PAYMENT_STARTED",53,"payment.started"),me=new Xi("PAYMENT_CONFIRMED",54,"payment.confirmed"),ge=new Xi("BASKET_DISPLAY",55,"basket.display"),fe=new Xi("BASKET_SHOW",56,"basket.show"),_e=new Xi("BASKET_RECIPES_DISPLAY",57,"basket.recipes.display"),ve=new Xi("BASKET_PRODUCTS_DISPLAY",58,"basket.products.display"),be=new Xi("BASKET_CLOSE",59,"basket.close"),ye=new Xi("BASKET_ENTRY_ADD",60,"basket.entry.add"),we=new Xi("BASKET_CONFIRMED",61,"basket.confirmed"),ke=new Xi("BASKET_TRANSFER",62,"basket.transfer"),Ce=new Xi("PLANNER_STARTED",63,"planner.started"),Se=new Xi("PLANNER_RESET",64,"planner.reset"),xe=new Xi("PLANNER_RECIPE_ADDED",65,"planner.recipe.add"),Ee=new Xi("PLANNER_RECIPE_DELETED",66,"planner.recipe.delete"),Ie=new Xi("PLANNER_RECIPE_SWAPPED",67,"planner.recipe.swap"),Pe=new Xi("PLANNER_RECIPE_CATALOG_PROMPT",68,"planner.recipe.catalog-prompt"),De=new Xi("PLANNER_SUGGESTION_SHOW",69,"planner.suggestion.show"),Te=new Xi("PLANNER_ITEM_DELETED",70,"planner.item.delete"),Ae=new Xi("PLANNER_ITEM_ADDED",71,"planner.item.add"),Re=new Xi("PLANNER_ITEM_REPLACE",72,"planner.item.replace"),Oe=new Xi("PLANNER_ITEM_REPLACED",73,"planner.item.replaced"),Fe=new Xi("PLANNER_CONFIRM",74,"planner.confirm"),Be=new Xi("PLANNER_FINALIZE",75,"planner.finalize"),Me=new Xi("PLANNER_MODE_SELECT",76,"planner.mode.select"),Le=new Xi("SUPPLIER_SELECTOR_DISPLAY",77,"supplier-selector.display"),$e=new Xi("SUPPLIER_SELECTOR_BACK",78,"supplier-selector.back"),je=new Xi("SUPPLIER_SELECTOR_CLOSE",79,"supplier-selector.close"),ze=new Xi("SUPPLIER_SELECTOR_SELECT",80,"supplier-selector.select"),Ne=new Xi("LOCATOR_DISPLAY",81,"locator.display"),Ve=new Xi("LOCATOR_MAP_DISPLAY",82,"locator.map.display"),He=new Xi("LOCATOR_LIST_DISPLAY",83,"locator.list.display"),Ue=new Xi("LOCATOR_BACK",84,"locator.back"),qe=new Xi("LOCATOR_CLOSE",85,"locator.close"),Ge=new Xi("LOCATOR_SEARCH",86,"locator.search"),We=new Xi("LOCATOR_FILTER",87,"locator.filter"),Ze=new Xi("LOCATOR_SELECT",88,"locator.select"),Qe=new Xi("ONBOARDING_ACTION",89,"onboarding.action"),Ye=new Xi("ONBOARDING_CLOSE",90,"onboarding.close"),Ke=new Xi("PLANNER_ONBOARDING_DISPLAY",91,"planner.onboarding.display"),Je=new Xi("PLANNER_ONBOARDING_START_CLICK",92,"planner.onboarding.start"),Xe=new Xi("PLANNER_ONBOARDING_SKIP_CLICK",93,"planner.onboarding.skip"),et=new Xi("PLANNER_PONBOARDING_NEXT_CLICK",94,"planner.onboarding.next"),tt=new Xi("PLANNER_ONBOARDING_UNDERSTOOD_CLICK",95,"planner.onboarding.understood"),it=new Xi("PLANNER_ONBOARDING_CLOSE_CLICK",96,"planner.onboarding.close"),nt=new Xi("PLANNER_HELP_QUESTION_MARK_CLICK",97,"planner.help.question-mark"),rt=new Xi("PLANNER_HELP_DISPLAY",98,"planner.help.display"),st=new Xi("PLANNER_HELP_NEXT_CLICK",99,"planner.help.next"),ot=new Xi("PLANNER_HELP_PREVIOUS_CLICK",100,"planner.help.previous"),at=new Xi("PLANNER_HELP_UNDERSTOOD_CLICK",101,"planner.help.understood"),ct=new Xi("PLANNER_HELP_CLOSE_CLICK",102,"planner.help.close")}function Xi(e,t,i){It.call(this,e,t),this.n2_1=i}function en(e,t,i,n){this.name=e,this.url=t,this.domain=i,this.props=n}function tn(){if(ht)return i;ht=!0,ut=new cn("ALL_LOGS",0),new cn("ERRORS_ONLY",1),dt=new cn("ERRORS_AND_WARNS",2),new cn("NO_LOGS",3)}function nn(e,t,i){var n="[MealzSharedAnalytics]["+i+"] "+t+" \n";(function(e){ti(),(ti(),o).n(e)})(n),e.a2_1&&(e.b2_1=e.b2_1+n)}function rn(e){return un().c2_1.equals(dn())&&nn(un(),e,"DEBUG"),i}function sn(e){return un().c2_1.equals(dn())&&nn(un(),e,"INFO"),i}function on(e){switch(un().c2_1.d_1){case 2:case 0:nn(un(),e,"WARN");break;default:return i}return i}function an(e){switch(un().c2_1.d_1){case 2:case 0:case 1:nn(un(),e,"ERROR");break;default:return i}return i}function cn(e,t){It.call(this,e,t)}function ln(){pt=this,this.a2_1=!1,this.b2_1="",this.c2_1=(tn(),dt),this.d2_1=rn,this.e2_1=sn,this.f2_1=on,this.g2_1=an}function un(){return null==pt&&new ln,pt}function dn(){return tn(),ut}function hn(){mt=this,qi.call(this)}function pn(){return null==mt&&new hn,mt}function mn(e){this.q1_1=[];for(var t=0,i=e.length;t<i;){var n=e[t];t=t+1|0,this.q1_1.push(n)}}function gn(){}function fn(e){this.h2_1={};for(var t=0,i=e.length;t<i;){var n=e[t];t=t+1|0,this.g3(n.h1_1,n.i1_1)}}function _n(e,t,i,n){(null==d&&new Gi,d).o2(e,t,i,gt.f3(n))}return Ut(vt,"Number"),qt(bt,"Unit"),Ht("interface",xt,"Iterable",void 0,void 0,void 0,void 0,void 0,void 0),Gt(Et),Ut(It,"Enum"),Ut(Dt,"Long",r,vt),Ut(At),qt(Qt,"Digit"),Ut(Kt,"BaseOutput"),Ut(Jt,"NodeJsOutput",r,Kt),Ut(ei,"BufferedOutput",ei,Kt),Ut(Xt,"BufferedOutputToConsoleLog",Xt,ei),Ut(ri,"Exception",(function e(){var t=ni(Bt(jt(ri)));return $t(t,e),t}),Error),Ut(di,"RuntimeException",(function e(){var t=li(Bt(jt(di)));return $t(t,e),t}),ri),Ut(oi,"IllegalArgumentException",(function e(){var t,i=(li(t=Bt(jt(oi))),oi.call(t),t);return $t(i,e),i}),di),Ut(ci,"IllegalStateException",(function e(){var t,i=(li(t=Bt(jt(ci))),ci.call(t),t);return $t(i,e),i}),di),Ut(mi,"NoSuchElementException",hi,di),Ut(fi,"ClassCastException",gi,di),Ut(vi,"UninitializedPropertyAccessException",(function e(){var t,i=(li(t=Bt(jt(vi))),vi.call(t),t);return $t(i,e),i}),di),Ut(Ci,"IntIterator"),Gt(Ei),Ut(Ti,"IntProgression",r,r,[xt]),Ut(Ii,"IntRange",r,Ti),Ut(Pi,"IntProgressionIterator",r,Ci),Gt(Di),Ut(Li,"Pair"),jt(bt).toString=function(){return"kotlin.Unit"},jt(It).equals=function(e){return this===e},jt(It).toString=function(){return this.c_1},jt(Dt).f=function(){return this.e_1},jt(At).i=function(){return!(this.g_1===this.h_1.length)},jt(At).j=function(){if(this.g_1===this.h_1.length)throw pi(""+this.g_1);var e=this.g_1;return this.g_1=e+1|0,this.h_1[e]},jt(Jt).n=function(e){var t=String(e);this.o_1.write(t)},jt(Xt).n=function(e){var t=String(e),i=t.lastIndexOf("\n",0);i>=0&&(this.q_1=this.q_1+t.substring(0,i),this.r(),t=t.substring(i+1|0)),this.q_1=this.q_1+t},jt(Xt).r=function(){console.log(this.q_1),this.q_1=""},jt(ei).n=function(e){this.q_1=this.q_1+String(e)},jt(Ci).j=function(){return this.u()},jt(Ii).z=function(){return this.a1_1>this.b1_1},jt(Ii).equals=function(e){return e instanceof Ii&&(this.z()&&e.z()||this.a1_1===e.a1_1&&this.b1_1===e.b1_1)},jt(Ii).toString=function(){return this.a1_1+".."+this.b1_1},jt(Pi).i=function(){return this.f1_1},jt(Pi).u=function(){var e=this.g1_1;if(e===this.e1_1){if(!this.f1_1)throw hi();this.f1_1=!1}else this.g1_1=this.g1_1+this.d1_1|0;return e},jt(Di).a=function(e,t,i){return new Ti(e,t,i)},jt(Ti).b=function(){return new Pi(this.a1_1,this.b1_1,this.c1_1)},jt(Ti).z=function(){return this.c1_1>0?this.a1_1>this.b1_1:this.a1_1<this.b1_1},jt(Ti).equals=function(e){return e instanceof Ti&&(this.z()&&e.z()||this.a1_1===e.a1_1&&this.b1_1===e.b1_1&&this.c1_1===e.c1_1)},jt(Ti).toString=function(){return this.c1_1>0?this.a1_1+".."+this.b1_1+" step "+this.c1_1:this.a1_1+" downTo "+this.b1_1+" step "+(0|-this.c1_1)},jt(Li).toString=function(){return"("+Pt(this.h1_1)+", "+Pt(this.i1_1)+")"},jt(Li).equals=function(e){if(this===e)return!0;if(!(e instanceof Li))return!1;var t=e instanceof Li?e:Nt();return!!Lt(this.h1_1,t.h1_1)&&!!Lt(this.i1_1,t.i1_1)},i=new bt,new Et,l=new Di,Gt(Hi),Ut(qi,"AbstractSharedAnalytics"),qt(Gi,"EventService"),Ut(Ki,"Platform",r,It),Ut(Xi,"PlausibleDestinations",r,It),Ut(en,"PlausibleEvent"),Ut(cn,"LogLevels",r,It),Gt(ln),qt(hn,"SharedAnalytics",r,qi),Ut(mn,"PlatformList"),Gt(gn),Ut(fn,"PlatformMap"),jt(qi).w1=function(e,t,n,r){if(Ni(this))return i;this.k1_1=e,this.l1_1="4.10.0",this.m1_1=t,this.j1_1=n,this.n1_1=r},jt(qi).y1=function(){return"uat"===this.n1_1.toLowerCase()?"https://analytics-uat.mealz.ai/publish_event":"https://analytics.mealz.ai/publish_event"},jt(qi).z1=function(e,t,n,r){if(!Ni(this))return un().f2_1("Tried to send event before analytics initialization");Vi(0,t),function(e,t){if(!Ui().u1_1.v1(t))throw si('Invalid journey : "'+t+'". Valid values are '+Ui().u1_1.toString())}(0,n),r.i2("client_sdk_version",zi(this)),r.i2("analytics_sdk_version",function(e){var t=e.l1_1;if(null!=t)return t;Vt("analyticsSDKVersion")}(this)),r.i2("platform",(function(){if(p)return i;p=!0,new Ki("ANDROID",0),new Ki("IOS",1),h=new Ki("WEB",2)}(),h).c_1),r.i2("abTestKey",this.o1_1),r.i2("affiliate",this.p1_1),r.i2("journey",n);var s=new en(e,t,ji(this),r.j2());!function(e){var t=e.j1_1;if(null!=t)return t;Vt("onEmit")}(this)(s),this.x1(s)},jt(Gi).o2=function(e,t,n,r){var s,o,a=this.k2_1.p2(e);if(null==a)s=null;else{var c,l=a.p2("mandatory");if(null==l)c=null;else{if(!l.y2((o=r,function(e){return!(null==o.p2(e))})))throw ai(Mt("Invalid props for "+e+" event : mandatory props are "+l.toString()+" and optional props are "+Pt(a.p2("optional"))));pn().x2(e,t,n,r),c=i}if(null==c)throw ai(Mt("No mandatory props found for "+e));s=i}if(null==s)throw ai(Mt("Unknown event "+e))},jt(en).a3=function(){return this.name},jt(en).b3=function(){return this.url},jt(en).c3=function(){return this.domain},jt(en).d3=function(){return this.props},jt(hn).x1=function(e){var t=this.y1(),i=new Headers;i.set("Content-Type","application/json");var n=JSON.stringify(e),r={method:"POST"};r.headers=i,r.body=n,r.referrer=void 0,r.referrerPolicy=void 0,r.mode=void 0,r.credentials=void 0,r.cache=void 0,r.redirect=void 0,r.integrity=void 0,r.keepalive=void 0,r.window=void 0;var s=r;window.fetch("https://plausible.io/api/event",s),window.fetch(t,s)},jt(hn).x2=function(e,t,i,n){this.z1(e,t,i,n)},jt(hn).z2=function(e,t,i,n){this.w1(e,t,i,n)},jt(mn).r1=function(e){this.q1_1.forEach(e)},jt(mn).y2=function(e){var t=this.q1_1.every(e);return null!=t&&"boolean"==typeof t?t:Nt()},jt(mn).e3=function(e){this.q1_1.push(e)},jt(mn).v1=function(e){var t=this.q1_1.includes(e);return null!=t&&"boolean"==typeof t?t:Nt()},jt(mn).toString=function(){for(var e="",t=ii(this.q1_1);t.i();)e+=t.j()+",";return"["+function(e,t,i){i=i===r?e:i;var n=function(e,t,i,n){var s,o;if(i=i===r?Bi(e):i,(n=n!==r&&n)||"string"!=typeof e)s=function(e,t,i,n){if(i=i===r?Bi(e):i,!(n=n!==r&&n)&&1===t.length&&"string"==typeof e){var s=St(function(e){var t;switch(e.length){case 0:throw pi("Array is empty.");case 1:t=e[0];break;default:throw si("Array has more than one element.")}return t}(t));return e.lastIndexOf(s,i)}var o=yt(i,Bi(e));if(0<=o)do{var a=o;o=o+-1|0;var c,l=Rt(e,a);e:{for(var u=0,d=t.length;u<d;){var h=t[u];if(u=u+1|0,Ai(h,l,n)){c=!0;break e}}c=!1}if(c)return a}while(0<=o);return-1}(e,((o=new Uint16Array([44])).$type$="CharArray",o),i,n);else{var a=St(44);s=e.lastIndexOf(a,i)}return s}(e);return-1===n?i:e.substring(0,n)}(e)+"]"},jt(gn).f3=function(e){for(var t=new fn([]),i=ii(Object.keys(e));i.i();){var n=i.j(),r=null==n||null!=n?n:Nt(),s=e[n];t.i2(r,null==s||null!=s?s:Nt())}return t},jt(fn).j2=function(){var e=this.h2_1;return null!=e?e:Nt()},jt(fn).g3=function(e,t){this.h2_1[e]=t;var i=this.h2_1[e];return null==i||null!=i?i:null},jt(fn).p2=function(e){var t=this.h2_1[e];return null==t||null!=t?t:null},jt(fn).i2=function(e,t){this.h2_1[e]=t},jt(fn).toString=function(){return JSON.stringify(this.h2_1)},gt=new gn,t})()},"TPB+":function(e,t,i){"use strict";(function(e){var n=i("fw2E"),r=i("VxF/"),s="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=s&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===s?n.a.Buffer:void 0;t.a=(a?a.isBuffer:void 0)||r.a}).call(this,i("cyaT")(e))},"VxF/":function(e,t,i){"use strict";t.a=function(){return!1}},WYLL:function(e,t){function i(e){return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}i.keys=function(){return[]},i.resolve=i,e.exports=i,i.id="WYLL"},X1CF:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;var r=i("9a4g"),s=i("xRwy"),o=i("9aqK"),a=i("D57s");t.parse=function(e){var t=function(e){return"string"==typeof e?s.parseISODuration(e):n(n({},r.ZERO),"number"==typeof e?{milliseconds:e}:e)}(e);return o.validate(t),a.cleanDurationObject(t)}},cyaT:function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},fw2E:function(e,t,i){"use strict";var n=i("kq48"),r="object"==typeof self&&self&&self.Object===Object&&self,s=n.a||r||Function("return this")();t.a=s},grw1:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNegativelySigned=void 0,t.isNegativelySigned=function(e){return e<0||Object.is(e,-0)}},kIwI:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0;var r=i("X1CF"),s=i("960K"),o=i("4NgV"),a=i("9a4g"),c=function(e){return e.join("").replace(/\./g,",")};t.toString=function(e){if(s.isZero(e))return"P0D";var t=n({},r.parse(e));if(1===o.getUnitCount(t)&&0!==t.weeks)return"P"+t.weeks+"W";var i={period:[],time:[]};a.UNITS_META.forEach((function(e){var i=e.unit,n=e.stringifyConvertTo;null!=n&&(t[n]+=t[i]*a.UNITS_META_MAP[i].milliseconds/a.UNITS_META_MAP[n].milliseconds,t[i]=0)})),a.UNITS_META.forEach((function(e){var n=e.ISOPrecision,r=t[e.unit];null!=n&&0!==r&&i[n].push(""+r+e.ISOCharacter)}));var l="P"+c(i.period);return i.time.length&&(l+="T"+c(i.time)),l}},kq48:function(e,t,i){"use strict";var n="object"==typeof global&&global&&global.Object===Object&&global;t.a=n},pvze:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=this&&this.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};Object.defineProperty(t,"__esModule",{value:!0}),t.normalize=void 0;var s=i("9a4g"),o=i("JsNM"),a=i("GrrB"),c=i("svPx"),l=i("X1CF"),u=function(e,t){return function(i,r){var s=n({},i);return e.forEach((function(e){var i=t(e);s[e]=~~(r/i),r-=s[e]*i})),s}},d=u(["years","months"],(function(e){return s.UNITS_META_MAP_LITERAL[e].months})),h=u(["days","hours","minutes","seconds","milliseconds"],(function(e){return s.UNITS_META_MAP_LITERAL[e].milliseconds}));t.normalize=function(e,t){return function(e){var t=l.parse(e),i=t.years,o=t.months,a=t.weeks,u=t.days,p=r(t,["years","months","weeks","days"]),m=n({},s.ZERO);return m=d(m,c.toMonths({years:i,months:o})),h(m,c.toMilliseconds(n(n({},p),{days:u+7*a})))}(null!=t?o.between(t,a.apply(t,e)):e)}},svPx:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toYears=t.toMonths=t.toWeeks=t.toDays=t.toHours=t.toMinutes=t.toSeconds=t.toUnit=t.toMilliseconds=void 0;var n=i("X1CF"),r=i("9a4g");t.toMilliseconds=function(e){var t=n.parse(e);return r.UNITS_META.reduce((function(e,i){return e+t[i.unit]*i.milliseconds}),0)},t.toUnit=function(e,i){return t.toMilliseconds(e)/r.UNITS_META_MAP[i].milliseconds};var s=function(e){return function(i){return t.toUnit(i,e)}};t.toSeconds=s("seconds"),t.toMinutes=s("minutes"),t.toHours=s("hours"),t.toDays=s("days"),t.toWeeks=s("weeks"),t.toMonths=s("months"),t.toYears=s("years")},wvHV:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNegative=void 0;var n=i("svPx");t.isNegative=function(e){return n.toMilliseconds(e)<0}},xRwy:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.parseISODuration=void 0;var r=i("9a4g"),s=i("MBFf"),o=i("grw1"),a="(?:[,.](\\d{1,3})\\d*)?",c=function(e){return"(?:(-?\\d+)"+e+")?"},l=function(e,t){return function(i){var a=i.match(e);if(!a)return null;var c="-"===a[1],l=a.slice(2);if(l.every((function(e){return void 0===e})))return null;var u=l.map((function(e,t){return void 0===e&&(e="0"),Number(t===l.length-1?e.padEnd(3,"0"):e)})),d=n({},r.ZERO);return t.forEach((function(e,t){d[e]=u[t]})),o.isNegativelySigned(d.seconds)&&(d.milliseconds*=-1),c?s.negate(d):d}},u=l(new RegExp(["^(-)?P","(\\d{4})","-?","(\\d{2})","-?","(\\d{2})","T","(\\d{2})",":?","(\\d{2})",":?","(\\d{2})",a,"$"].join("")),["years","months","days","hours","minutes","seconds","milliseconds"]),d=l(new RegExp(["^(-)?P",c("Y"),c("M"),c("W"),c("D"),"(?:T",c("H"),c("M"),c(a+"S"),")?$"].join("")),["years","months","weeks","days","hours","minutes","seconds","milliseconds"]);t.parseISODuration=function(e){var t=d(e)||u(e);if(null===t)throw new SyntaxError('Failed to parse duration. "'+e+'" is not a valid ISO duration string.');return t}},yerO:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),t.UNITS=void 0,r(i("0LHn"),t),r(i("GrrB"),t),r(i("JsNM"),t),r(i("wvHV"),t),r(i("960K"),t),r(i("MBFf"),t),r(i("pvze"),t),r(i("X1CF"),t),r(i("NMSN"),t),r(i("ROwQ"),t),r(i("kIwI"),t),r(i("svPx"),t),r(i("NoVc"),t);var s=i("9a4g");Object.defineProperty(t,"UNITS",{enumerable:!0,get:function(){return s.UNITS}})}},[[0,0]]]);