import{a as p,b as o}from"./chunk-2JOQHUZT.js";import{o as s}from"./chunk-GQP2MJQK.js";import{A as r,w as c}from"./chunk-ZVAMPSQU.js";var a="cookingToolbar",u="1",m=(()=>{let t=class t{constructor(){this.quickTutorialService=r(o),this.pinnedRecipes=[];try{let e=localStorage.getItem(a);if(e){let i=JSON.parse(e);this.pinnedRecipes=i.pinnedRecipes}}catch(e){s(e)}}pinRecipe(e){this.pinnedRecipes.push(e),this.quickTutorialService.triggerQuickTutorial(p.PinnedRecipes),this.save()}isPinned(e){return this.pinnedRecipes.some(i=>i.id===e)}unpinRecipe(e){let i=this.pinnedRecipes.findIndex(d=>d.id===e);i!==-1&&(this.pinnedRecipes.splice(i,1),this.save())}clearPins(){this.pinnedRecipes.splice(0,this.pinnedRecipes.length),this.save()}save(){localStorage.setItem(a,JSON.stringify({pinnedRecipes:this.pinnedRecipes,version:u}))}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=c({token:t,factory:t.\u0275fac,providedIn:"root"});let n=t;return n})();export{m as a};
