(function(e){function t(t){for(var n,a,s=t[0],c=t[1],u=t[2],p=0,l=[];p0?r("div",{staticClass:"col-md-6 order-md-1 col-sm-12 order-sm-2 col-12 order-2"},[r("div",{staticClass:"card border-primary"},[r("div",{staticClass:"card-body"},[r("div",{staticClass:"row"},[r("div",{staticClass:"col col-md-8"},[r("h4",{staticClass:"card-title"},[r("i",{staticClass:"fas fa-pepper-hot"}),e._v(" "+e._s(e.$t("Ingredients")))])])]),r("br"),r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-12"},[r("table",{staticClass:"table table-sm"},[e._l(e.recipe.steps,(function(t){return[e._l(t.ingredients,(function(t){return[r("Ingredient",{key:t.id,attrs:{ingredient:t,ingredient_factor:e.ingredient_factor},on:{"checked-state-changed":e.updateIngredientCheckedState}})]}))]}))],2)])])])])]):e._e(),r("div",{staticClass:"col-12 order-1 col-sm-12 order-sm-1 col-md-6 order-md-2"},[r("div",{staticClass:"row"},[r("div",{staticClass:"col-12"},[null!==e.recipe.image?r("img",{staticClass:"img img-fluid rounded",staticStyle:{"max-height":"30vh"},attrs:{src:e.recipe.image,alt:e.$t("Recipe_Image")}}):e._e()])]),r("div",{staticClass:"row",staticStyle:{"margin-top":"2vh","margin-bottom":"2vh"}},[r("div",{staticClass:"col-12"},[r("Nutrition",{attrs:{recipe:e.recipe,ingredient_factor:e.ingredient_factor}})],1)])])]),e.recipe.internal?e._e():[e.recipe.file_path.includes(".pdf")?r("div",[r("PdfViewer",{attrs:{recipe:e.recipe}})],1):e._e(),e.recipe.file_path.includes(".png")||e.recipe.file_path.includes(".jpg")||e.recipe.file_path.includes(".jpeg")||e.recipe.file_path.includes(".gif")?r("div",[r("ImageViewer",{attrs:{recipe:e.recipe}})],1):e._e()],e._l(e.recipe.steps,(function(t,n){return r("div",{key:t.id,staticStyle:{"margin-top":"1vh"}},[r("Step",{attrs:{recipe:e.recipe,step:t,ingredient_factor:e.ingredient_factor,index:n,start_time:e.start_time},on:{"update-start-time":e.updateStartTime,"checked-state-changed":e.updateIngredientCheckedState}})],1)}))],2),r("add-recipe-to-book",{attrs:{recipe:e.recipe}}),"None"!==e.share_uid?r("div",{staticClass:"row text-center d-print-none",staticStyle:{"margin-top":"3vh","margin-bottom":"3vh"}},[r("div",{staticClass:"col col-md-12"},[r("a",{attrs:{href:e.resolveDjangoUrl("view_report_share_abuse",e.share_uid)}},[e._v(e._s(e.$t("Report Abuse")))])])]):e._e()],2)},o=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"my-auto",staticStyle:{"padding-right":"4px"}},[r("i",{staticClass:"fas fa-user-clock fa-2x text-primary"})])},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"my-auto",staticStyle:{"padding-right":"4px"}},[r("i",{staticClass:"far fa-clock fa-2x text-primary"})])},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"my-auto",staticStyle:{"padding-right":"4px"}},[r("i",{staticClass:"fas fa-pizza-slice fa-2x text-primary"})])}],a=r("b85c"),s=r("5f5b"),c=(r("2dd8"),r("7c15")),u=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("hr"),"TEXT"===e.step.type||"RECIPE"===e.step.type?[e.recipe.steps.length>1?r("div",{staticClass:"row"},[r("div",{staticClass:"col col-md-8"},[r("h5",{staticClass:"text-primary"},[e.step.name?[e._v(e._s(e.step.name))]:[e._v(e._s(e.$t("Step"))+" "+e._s(e.index+1))],0!==e.step.time?r("small",{staticClass:"text-muted",staticStyle:{"margin-left":"4px"}},[r("i",{staticClass:"fas fa-user-clock"}),e._v(" "+e._s(e.step.time)+" "+e._s(e.$t("min"))+" ")]):e._e(),""!==e.start_time?r("small",{staticClass:"d-print-none"},[r("b-link",{attrs:{id:"id_reactive_popover_"+e.step.id,href:"#"},on:{click:e.openPopover}},[e._v(" "+e._s(e.moment(e.start_time).add(e.step.time_offset,"minutes").format("HH:mm"))+" ")])],1):e._e()],2)]),r("div",{staticClass:"col col-md-4",staticStyle:{"text-align":"right"}},[r("b-button",{staticClass:"shadow-none d-print-none",class:{"text-primary":e.details_visible,"text-success":!e.details_visible},staticStyle:{border:"none",background:"none"},on:{click:function(t){e.details_visible=!e.details_visible}}},[r("i",{staticClass:"far fa-check-circle"})])],1)]):e._e()]:e._e(),"TEXT"===e.step.type?[r("b-collapse",{attrs:{id:"collapse-1"},model:{value:e.details_visible,callback:function(t){e.details_visible=t},expression:"details_visible"}},[r("div",{staticClass:"row"},[e.step.ingredients.length>0&&(e.recipe.steps.length>1||e.force_ingredients)?r("div",{staticClass:"col col-md-4"},[r("table",{staticClass:"table table-sm"},[e._l(e.step.ingredients,(function(t){return[r("Ingredient",{key:t.id,attrs:{ingredient:t,ingredient_factor:e.ingredient_factor},on:{"checked-state-changed":function(r){return e.$emit("checked-state-changed",t)}}})]}))],2)]):e._e(),r("div",{staticClass:"col",class:{"col-md-8":e.recipe.steps.length>1,"col-md-12":e.recipe.steps.length<=1}},[r("compile-component",{attrs:{code:e.step.ingredients_markdown,ingredient_factor:e.ingredient_factor}})],1)])])]:e._e(),"TIME"===e.step.type||"FILE"===e.step.type?[r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-8 offset-md-2",staticStyle:{"text-align":"center"}},[r("h4",{staticClass:"text-primary"},[e.step.name?[e._v(e._s(e.step.name))]:[e._v(e._s(e.$t("Step"))+" "+e._s(e.index+1))]],2),0!==e.step.time?r("span",{staticClass:"text-muted",staticStyle:{"margin-left":"4px"}},[r("i",{staticClass:"fa fa-stopwatch"}),e._v(" "+e._s(e.step.time)+" "+e._s(e.$t("min")))]):e._e(),""!==e.start_time?r("b-link",{staticClass:"d-print-none",attrs:{id:"id_reactive_popover_"+e.step.id,href:"#"},on:{click:e.openPopover}},[e._v(" "+e._s(e.moment(e.start_time).add(e.step.time_offset,"minutes").format("HH:mm"))+" ")]):e._e()],1),r("div",{staticClass:"col-md-2",staticStyle:{"text-align":"right"}},[r("b-button",{staticClass:"shadow-none d-print-none",class:{"text-primary":e.details_visible,"text-success":!e.details_visible},staticStyle:{border:"none",background:"none"},on:{click:function(t){e.details_visible=!e.details_visible}}},[r("i",{staticClass:"far fa-check-circle"})])],1)]),r("b-collapse",{attrs:{id:"collapse-1"},model:{value:e.details_visible,callback:function(t){e.details_visible=t},expression:"details_visible"}},[""!==e.step.instruction?r("div",{staticClass:"row"},[r("div",{staticClass:"col col-md-12",staticStyle:{"text-align":"center"}},[r("compile-component",{attrs:{code:e.step.ingredients_markdown,ingredient_factor:e.ingredient_factor}})],1)]):e._e()])]:e._e(),r("div",{staticClass:"row",staticStyle:{"text-align":"center"}},[r("div",{staticClass:"col col-md-12"},[null!==e.step.file?[e.step.file.file.includes(".png")||e.recipe.file_path.includes(".jpg")||e.recipe.file_path.includes(".jpeg")||e.recipe.file_path.includes(".gif")?r("div",[r("img",{staticStyle:{"max-width":"50vw","max-height":"50vh"},attrs:{src:e.step.file.file}})]):r("div",[r("a",{attrs:{href:e.step.file.file,target:"_blank",rel:"noreferrer nofollow"}},[e._v(e._s(e.$t("Download"))+" "+e._s(e.$t("File")))])])]:e._e()],2)]),"RECIPE"===e.step.type&&null!==e.step.step_recipe_data?r("div",{staticClass:"card"},[r("b-collapse",{attrs:{id:"collapse-1"},model:{value:e.details_visible,callback:function(t){e.details_visible=t},expression:"details_visible"}},[r("div",{staticClass:"card-body"},[r("h2",{staticClass:"card-title"},[r("a",{attrs:{href:e.resolveDjangoUrl("view_recipe",e.step.step_recipe_data.id)}},[e._v(e._s(e.step.step_recipe_data.name))])]),e._l(e.step.step_recipe_data.steps,(function(t,n){return r("div",{key:"substep_"+t.id},[r("Step",{attrs:{recipe:e.step.step_recipe_data,step:t,ingredient_factor:e.ingredient_factor,index:n,start_time:e.start_time,force_ingredients:!0}})],1)}))],2)])],1):e._e(),""!==e.start_time?r("div",[r("b-popover",{ref:"id_reactive_popover_"+e.step.id,attrs:{target:"id_reactive_popover_"+e.step.id,triggers:"click",placement:"bottom",title:e.$t("Step start time")}},[r("div",[r("b-form-group",{staticClass:"mb-1",attrs:{label:"Time","label-for":"popover-input-1","label-cols":"3"}},[r("b-form-input",{attrs:{type:"datetime-local",id:"popover-input-1",size:"sm"},model:{value:e.set_time_input,callback:function(t){e.set_time_input=t},expression:"set_time_input"}})],1)],1),r("div",{staticClass:"row",staticStyle:{"margin-top":"1vh"}},[r("div",{staticClass:"col-12",staticStyle:{"text-align":"right"}},[r("b-button",{staticStyle:{"margin-right":"8px"},attrs:{size:"sm",variant:"secondary"},on:{click:e.closePopover}},[e._v("Cancel")]),r("b-button",{attrs:{size:"sm",variant:"primary"},on:{click:e.updateTime}},[e._v("Ok")])],1)])])],1):e._e()],2)},d=[],p=(r("a9e3"),r("fa7d")),l=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("tr",{on:{click:function(t){return e.$emit("checked-state-changed",e.ingredient)}}},[e.ingredient.is_header?[r("td",{attrs:{colspan:"5"}},[r("b",[e._v(e._s(e.ingredient.note))])])]:[r("td",{staticClass:"d-print-none"},[e.ingredient.checked?r("i",{staticClass:"far fa-check-circle text-success"}):e._e(),e.ingredient.checked?e._e():r("i",{staticClass:"far fa-check-circle text-primary"})]),r("td",[0!==e.ingredient.amount?r("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.ingredient.amount))}}):e._e()]),r("td",[null===e.ingredient.unit||e.ingredient.no_amount?e._e():r("span",[e._v(e._s(e.ingredient.unit.name))])]),r("td",[null!==e.ingredient.food?[null!==e.ingredient.food.recipe?r("a",{attrs:{href:e.resolveDjangoUrl("view_recipe",e.ingredient.food.recipe),target:"_blank",rel:"noopener noreferrer"}},[e._v(e._s(e.ingredient.food.name))]):e._e(),null===e.ingredient.food.recipe?r("span",[e._v(e._s(e.ingredient.food.name))]):e._e()]:e._e()],2),r("td",[e.ingredient.note?r("div",[r("span",{directives:[{name:"b-popover",rawName:"v-b-popover.hover",value:e.ingredient.note,expression:"ingredient.note",modifiers:{hover:!0}}],staticClass:"d-print-none"},[r("i",{staticClass:"far fa-comment"})]),r("div",{staticClass:"d-none d-print-block"},[r("i",{staticClass:"far fa-comment-alt d-print-none"}),e._v(" "+e._s(e.ingredient.note)+" ")])]):e._e()])]],2)},h=[],b={name:"Ingredient",props:{ingredient:Object,ingredient_factor:{type:Number,default:1}},mixins:[p["b"]],data:function(){return{checked:!1}},methods:{calculateAmount:function(e){return Object(p["e"])(e,this.ingredient_factor)}}},f=b,j=r("2877"),v=Object(j["a"])(f,l,h,!1,null,null,null),O=v.exports,m=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r(e.compiled,{tag:"component",attrs:{ingredient_factor:e.ingredient_factor,code:e.code}})],1)},g=[],y=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.number))}})},_=[],S={name:"ScalableNumber",props:{number:Number,factor:{type:Number,default:4}},methods:{calculateAmount:function(e){return Object(p["e"])(e,this.factor)}}},k=S,P=Object(j["a"])(k,y,_,!1,null,null,null),w=P.exports,U={name:"CompileComponent",props:["code","ingredient_factor"],data:function(){return{compiled:null}},mounted:function(){this.compiled=n["default"].component("compiled-component",{props:["ingredient_factor","code"],components:{ScalableNumber:w},template:"
".concat(this.code,"
")})}},C=U,R=Object(j["a"])(C,m,g,!1,null,null,null),L=R.exports,E=r("c1df"),I=r.n(E),T=r("81d5");n["default"].prototype.moment=I.a;var x={name:"Step",mixins:[p["a"],p["b"]],components:{Ingredient:O,CompileComponent:L},props:{step:Object,ingredient_factor:Number,index:Number,recipe:Object,start_time:String,force_ingredients:{type:Boolean,default:!1}},data:function(){return{details_visible:!0,set_time_input:""}},mounted:function(){this.set_time_input=I()(this.start_time).add(this.step.time_offset,"minutes").format("yyyy-MM-DDTHH:mm")},methods:{calculateAmount:function(e){return Object(p["e"])(e,this.ingredient_factor)},updateTime:function(){var e=I()(this.set_time_input).add(-1*this.step.time_offset,"minutes").format("yyyy-MM-DDTHH:mm");this.$emit("update-start-time",e),this.closePopover()},closePopover:function(){this.$refs["id_reactive_popover_".concat(this.step.id)].$emit("close")},openPopover:function(){this.$refs["id_reactive_popover_".concat(this.step.id)].$emit("open")}}},B=x,M=Object(j["a"])(B,u,d,!1,null,null,null),F=M.exports,q=r("fc0d"),A=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("iframe",{staticStyle:{border:"none"},attrs:{src:e.pdfUrl,width:"100%",height:"700px"}})])},D=[],K={name:"PdfViewer",mixins:[p["b"]],props:{recipe:Object},computed:{pdfUrl:function(){return"/static/pdfjs/viewer.html?file="+Object(p["h"])("api_get_recipe_file",this.recipe.id)}}},V=K,N=Object(j["a"])(V,A,D,!1,null,null,null),$=N.exports,H=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticStyle:{"text-align":"center"}},[r("b-img",{attrs:{src:e.pdfUrl,alt:e.$t("External_Recipe_Image")}})],1)},z=[],G={name:"ImageViewer",props:{recipe:Object},computed:{pdfUrl:function(){return Object(p["h"])("api_get_recipe_file",this.recipe.id)}}},W=G,J=Object(j["a"])(W,H,z,!1,null,null,null),Z=J.exports,X=function(){var e=this,t=e.$createElement,r=e._self._c||t;return null!==e.recipe.nutrition?r("div",[r("div",{staticClass:"card border-success"},[r("div",{staticClass:"card-body"},[r("div",{staticClass:"row"},[r("div",{staticClass:"col-12"},[r("h4",{staticClass:"card-title"},[r("i",{staticClass:"fas fa-carrot"}),e._v(" "+e._s(e.$t("Nutrition")))])])]),r("div",{staticClass:"row"},[r("div",{staticClass:"col-6"},[r("i",{staticClass:"fas fa-fire fa-fw text-primary"}),e._v(" "+e._s(e.$t("Calories"))+" ")]),r("div",{staticClass:"col-6"},[r("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.calories))}}),e._v(" kcal ")])]),r("div",{staticClass:"row"},[r("div",{staticClass:"col-6"},[r("i",{staticClass:"fas fa-bread-slice fa-fw text-primary"}),e._v(" "+e._s(e.$t("Carbohydrates"))+" ")]),r("div",{staticClass:"col-6"},[r("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.carbohydrates))}}),e._v(" g ")])]),r("div",{staticClass:"row"},[r("div",{staticClass:"col-6"},[r("i",{staticClass:"fas fa-cheese fa-fw text-primary"}),e._v(" "+e._s(e.$t("Fats"))+" ")]),r("div",{staticClass:"col-6"},[r("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.fats))}}),e._v(" g ")])]),r("div",{staticClass:"row"},[r("div",{staticClass:"col-6"},[r("i",{staticClass:"fas fa-drumstick-bite fa-fw text-primary"}),e._v(" "+e._s(e.$t("Proteins"))+" ")]),r("div",{staticClass:"col-6"},[r("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.proteins))}}),e._v(" g ")])])])])]):e._e()},Y=[],Q={name:"Nutrition",props:{recipe:Object,ingredient_factor:Number},methods:{calculateAmount:function(e){return Object(p["e"])(e,this.ingredient_factor)}}},ee=Q,te=Object(j["a"])(ee,X,Y,!1,null,null,null),re=te.exports,ne=r("d76c"),ie=r("d46a"),oe=r("ca5b"),ae=r("830a");n["default"].prototype.moment=I.a,n["default"].use(s["a"]);var se={name:"RecipeView",mixins:[p["b"],p["d"]],components:{LastCooked:ae["a"],RecipeRating:oe["a"],PdfViewer:$,ImageViewer:Z,Ingredient:O,Step:F,RecipeContextMenu:q["a"],Nutrition:re,Keywords:T["a"],LoadingSpinner:ne["a"],AddRecipeToBook:ie["a"]},computed:{ingredient_factor:function(){return this.servings/this.recipe.servings}},data:function(){return{loading:!0,recipe:void 0,ingredient_count:0,servings:1,start_time:"",share_uid:window.SHARE_UID}},mounted:function(){this.loadRecipe(window.RECIPE_ID),this.$i18n.locale=window.CUSTOM_LOCALE},methods:{loadRecipe:function(e){var t=this;Object(c["a"])(e).then((function(e){0!==window.USER_SERVINGS&&(e.servings=window.USER_SERVINGS),t.servings=e.servings;var r,n=0,i=Object(a["a"])(e.steps);try{for(i.s();!(r=i.n()).done;){var o=r.value;t.ingredient_count+=o.ingredients.length;var s,c=Object(a["a"])(o.ingredients);try{for(c.s();!(s=c.n()).done;){var u=s.value;t.$set(u,"checked",!1)}}catch(d){c.e(d)}finally{c.f()}o.time_offset=n,n+=o.time}}catch(d){i.e(d)}finally{i.f()}n>0&&(t.start_time=I()().format("yyyy-MM-DDTHH:mm")),t.recipe=e,t.loading=!1}))},updateStartTime:function(e){this.start_time=e},updateIngredientCheckedState:function(e){var t,r=Object(a["a"])(this.recipe.steps);try{for(r.s();!(t=r.n()).done;){var n,i=t.value,o=Object(a["a"])(i.ingredients);try{for(o.s();!(n=o.n()).done;){var s=n.value;s.id===e.id&&this.$set(s,"checked",!s.checked)}}catch(c){o.e(c)}finally{o.f()}}}catch(c){r.e(c)}finally{r.f()}}}},ce=se,ue=Object(j["a"])(ce,i,o,!1,null,null,null),de=ue.exports,pe=r("9225");n["default"].config.productionTip=!1,new n["default"]({i18n:pe["a"],render:function(e){return e(de)}}).$mount("#app")},1:function(e,t,r){e.exports=r("0671")},2165:function(e){e.exports=JSON.parse('{"err_fetching_resource":"","err_creating_resource":"","err_updating_resource":"","err_deleting_resource":"","success_fetching_resource":"","success_creating_resource":"","success_updating_resource":"","success_deleting_resource":"","import_running":"","all_fields_optional":"","convert_internal":"","show_only_internal":"","Log_Recipe_Cooking":"","External_Recipe_Image":"","Add_to_Shopping":"","Add_to_Plan":"","Step_start_time":"","Sort_by_new":"","Recipes_per_page":"","Manage_Books":"","Meal_Plan":"","Select_Book":"","Recipe_Image":"","Import_finished":"","View_Recipes":"","Log_Cooking":"","New_Recipe":"","Url_Import":"","Reset_Search":"","Recently_Viewed":"","Load_More":"","Keywords":"","Books":"","Proteins":"","Fats":"","Carbohydrates":"","Calories":"","Nutrition":"","Date":"","Share":"","Export":"","Copy":"","Rating":"","Close":"","Link":"","Add":"","New":"","Success":"","Failure":"","Ingredients":"","Supermarket":"","Categories":"","Category":"","Selected":"","min":"","Servings":"","Waiting":"","Preparation":"","External":"","Size":"","Files":"","File":"","Edit":"","Cancel":"","Delete":"","Open":"","Ok":"","Save":"","Step":"","Search":"","Import":"","Print":"","Settings":"","or":"","and":"","Information":"","Download":"","Create":""}')},"2b2d":function(e,t,r){"use strict";r.d(t,"a",(function(){return k}));r("d3b7"),r("3ca3"),r("ddb0"),r("2b3d"),r("ac1f"),r("5319");var n,i,o,a,s,c,u,d=r("9ab4"),p=r("bc3a"),l=r.n(p),h=(r("841c"),r("25f0"),r("b0c0"),"undefined"!==typeof window?localStorage.getItem("BASE_PATH")||"":location.protocol+"//"+location.host),b=function(){function e(e,t,r){void 0===t&&(t=h),void 0===r&&(r=l.a),this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}return e}(),f=function(e){function t(t,r){var n=e.call(this,r)||this;return n.field=t,n.name="RequiredError",n}return Object(d["c"])(t,e),t}(Error),j="https://example.com",v=function(e,t,r){if(null===r||void 0===r)throw new f(t,"Required parameter "+t+" was null or undefined when calling "+e+".")},O=function(e){for(var t=[],r=1;r0?r("div",e._l(e.recipe.keywords,(function(t){return r("span",{key:t.id,staticStyle:{padding:"2px"}},[r("b-badge",{attrs:{pill:"",variant:"light"}},[e._v(e._s(t.label))])],1)})),0):e._e()},i=[],o={name:"Keywords",props:{recipe:Object}},a=o,s=r("2877"),c=Object(s["a"])(a,n,i,!1,null,null,null);t["a"]=c.exports},"830a":function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("span",[null!==e.recipe.last_cooked?r("b-badge",{attrs:{pill:"",variant:"primary"}},[r("i",{staticClass:"fas fa-utensils"}),e._v(" "+e._s(e.formatDate(e.recipe.last_cooked)))]):e._e()],1)},i=[],o=r("c1df"),a=r.n(o),s={name:"LastCooked",props:{recipe:Object},methods:{formatDate:function(e){return a.a.locale(window.navigator.language),a()(e).format("L")}}},c=s,u=r("2877"),d=Object(u["a"])(c,n,i,!1,null,"720408c0",null);t["a"]=d.exports},9225:function(e,t,r){"use strict";r("159b"),r("d3b7"),r("ddb0"),r("ac1f"),r("466d");var n=r("a026"),i=r("a925");function o(){var e=r("49f8"),t={};return e.keys().forEach((function(r){var n=r.match(/([A-Za-z0-9-_]+)\./i);if(n&&n.length>1){var i=n[1];t[i]=e(r)}})),t}n["default"].use(i["a"]),t["a"]=new i["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:o()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Eiwitten","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteren","Rating":"Beoordeling","Close":"Sluiten","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerken","Open":"Open","Save":"Opslaan","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie","Keywords":"Etiketten","Books":"Boeken","show_only_internal":"Toon alleen interne recepten","New_Recipe":"Nieuw Recept","Url_Import":"Importeer URL","Reset_Search":"Zoeken resetten","or":"of","and":"en","Recently_Viewed":"Recent bekeken","External":"Externe","Settings":"Instellingen","Meal_Plan":"Maaltijdplan","New":"Nieuw","Supermarket":"Supermarkt","Categories":"Categorieën","Category":"Categorie","Selected":"Geselecteerd","Copy":"Kopie","Link":"Link","Sort_by_new":"Sorteer op nieuw","Recipes_per_page":"Recepten per pagina","Files":"Bestanden","Size":"Grootte","File":"Bestand","err_fetching_resource":"Bij het ophalen van een hulpbron is een foutmelding opgetreden!","err_creating_resource":"Bij het maken van een hulpbron is een foutmelding opgetreden!","err_updating_resource":"Bij het updaten van een hulpbron is een foutmelding opgetreden!","success_fetching_resource":"Hulpbron is succesvol opgehaald!","success_creating_resource":"Hulpbron succesvol aangemaakt!","success_updating_resource":"Hulpbron succesvol geüpdatet!","Success":"Succes","Download":"Download","err_deleting_resource":"Bij het verwijderen van een hulpbron is een foutmelding opgetreden!","success_deleting_resource":"Hulpbron succesvol verwijderd!","Cancel":"Annuleer","Delete":"Verwijder","Ok":"Open","Load_More":"Laad meer","Manage_Books":"Beheer Boeken","Create":"Maak","Failure":"Storing","View":"Bekijk","Recipes":"Recepten","Move":"Verplaats","Parent":"Ouder","move_confirmation":"Verplaats {child} naar ouder {parent}","merge_confirmation":"Vervang {source} with {target}","move_selection":"Selecteer een ouder om {child} naar te verplaatsen.","merge_selection":"Vervang alle voorvallen van {source} door het type {type}.","Root":"Bron","show_split_screen":"Toon gesplitste weergave","New_Keyword":"Nieuw Etiket","Delete_Keyword":"Verwijder Etiket","Edit_Keyword":"Bewerk Etiket","Move_Keyword":"Verplaats Etiket","Hide_Keywords":"Verberg Etiketten","Hide_Recipes":"Verberg Recepten","Advanced Search Settings":"Geavanceerde zoekinstellingen","Merge":"Voeg samen","delete_confimation":"Weet je zeker dat je {kw} en zijn kinderen wil verwijderen?","Merge_Keyword":"Voeg Etiket samen"}')},ca5b:function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e.recipe.rating>0?r("span",{staticClass:"d-inline"},[e._l(Math.floor(e.recipe.rating),(function(e){return r("i",{key:e,staticClass:"fas fa-star fa-xs text-primary"})})),e.recipe.rating%1>0?r("i",{staticClass:"fas fa-star-half-alt fa-xs text-primary"}):e._e(),e._l(5-Math.ceil(e.recipe.rating),(function(e){return r("i",{key:e+10,staticClass:"far fa-star fa-xs text-secondary"})}))],2):e._e()])},i=[],o={name:"RecipeRating",props:{recipe:Object}},a=o,s=r("2877"),c=Object(s["a"])(a,n,i,!1,null,"7151a4e2",null);t["a"]=c.exports},d46a:function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("b-modal",{staticClass:"modal",attrs:{id:"id_modal_add_book_"+e.modal_id,title:e.$t("Manage_Books"),"ok-title":e.$t("Add"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.addToBook()},shown:e.loadBookEntries}},[r("table",e._l(this.recipe_book_list,(function(t){return r("tr",{key:t.id},[r("td",[r("button",{staticClass:"btn btn-sm btn-danger",on:{click:function(r){return e.removeFromBook(t)}}},[r("i",{staticClass:"fa fa-trash-alt"})])]),r("td",[e._v(" "+e._s(t.book_content.name))])])})),0),r("multiselect",{staticStyle:{"margin-top":"1vh"},attrs:{options:e.books_filtered,taggable:!0,"tag-placeholder":e.$t("Create"),placeholder:e.$t("Select_Book"),label:"name","track-by":"id",id:"id_books",multiple:!1,loading:e.books_loading},on:{tag:e.createBook,"search-change":e.loadBooks},model:{value:e.selected_book,callback:function(t){e.selected_book=t},expression:"selected_book"}})],1)],1)},i=[],o=(r("a9e3"),r("159b"),r("4de4"),r("8e5f")),a=r.n(o),s=r("c1df"),c=r.n(s),u=r("a026"),d=r("5f5b"),p=r("2b2d"),l=r("fa7d");u["default"].prototype.moment=c.a,u["default"].use(d["a"]);var h={name:"AddRecipeToBook",components:{Multiselect:a.a},props:{recipe:Object,modal_id:Number},data:function(){return{books:[],books_loading:!1,recipe_book_list:[],selected_book:null}},computed:{books_filtered:function(){var e=this,t=[];return this.books.forEach((function(r){0===e.recipe_book_list.filter((function(e){return e.book===r.id})).length&&t.push(r)})),t}},mounted:function(){},methods:{loadBooks:function(e){var t=this;this.books_loading=!0;var r=new p["a"];r.listRecipeBooks({query:{query:e}}).then((function(e){t.books=e.data.filter((function(e){return-1===t.recipe_book_list.indexOf(e)})),t.books_loading=!1}))},createBook:function(e){var t=this,r=new p["a"];r.createRecipeBook({name:e}).then((function(e){t.books.push(e.data),t.selected_book=e.data,l["c"].makeStandardToast(l["c"].SUCCESS_CREATE)}))},addToBook:function(){var e=this,t=new p["a"];t.createRecipeBookEntry({book:this.selected_book.id,recipe:this.recipe.id}).then((function(t){e.recipe_book_list.push(t.data),l["c"].makeStandardToast(l["c"].SUCCESS_CREATE)}))},removeFromBook:function(e){var t=this,r=new p["a"];r.destroyRecipeBookEntry(e.id).then((function(r){t.recipe_book_list=t.recipe_book_list.filter((function(t){return t.id!==e.id})),l["c"].makeStandardToast(l["c"].SUCCESS_DELETE)}))},loadBookEntries:function(){var e=this,t=new p["a"];t.listRecipeBookEntrys({query:{recipe:this.recipe.id}}).then((function(t){e.recipe_book_list=t.data,e.loadBooks("")}))}}},b=h,f=(r("60bc"),r("2877")),j=Object(f["a"])(b,n,i,!1,null,null,null);t["a"]=j.exports},d76c:function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"row"},[r("div",{staticClass:"col",staticStyle:{"text-align":"center"}},[r("img",{staticClass:"spinner-tandoor",style:{height:e.size+"vh"},attrs:{alt:"loading spinner",src:""}})])])},i=[],o=(r("a9e3"),{name:"LoadingSpinner",props:{recipe:Object,size:{type:Number,default:30}}}),a=o,s=r("2877"),c=Object(s["a"])(a,n,i,!1,null,null,null);t["a"]=c.exports},dc43:function(e){e.exports=JSON.parse('{"err_fetching_resource":"","err_creating_resource":"","err_updating_resource":"","err_deleting_resource":"","success_fetching_resource":"","success_creating_resource":"","success_updating_resource":"","success_deleting_resource":"","import_running":"","all_fields_optional":"","convert_internal":"","show_only_internal":"","Log_Recipe_Cooking":"","External_Recipe_Image":"外部菜谱图像","Add_to_Shopping":"添加到购物","Add_to_Plan":"添加到计划","Step_start_time":"","Sort_by_new":"","Recipes_per_page":"","Manage_Books":"管理书籍","Meal_Plan":"","Select_Book":"","Recipe_Image":"菜谱图像","Import_finished":"导入完成","View_Recipes":"","Log_Cooking":"","New_Recipe":"新菜谱","Url_Import":"导入网址","Reset_Search":"重置搜索","Recently_Viewed":"最近浏览","Load_More":"加载更多","Keywords":"关键字","Books":"书籍","Proteins":"蛋白质","Fats":"脂肪","Carbohydrates":"碳水化合物","Calories":"卡路里","Nutrition":"营养","Date":"日期","Share":"分享","Export":"导出","Copy":"拷贝","Rating":"评分","Close":"关闭","Link":"链接","Add":"添加","New":"新","Success":"成功","Failure":"失败","Ingredients":"材料","Supermarket":"超级市场","Categories":"分类","Category":"分类","Selected":"选定","min":"","Servings":"份量","Waiting":"等待","Preparation":"准备","External":"外部","Size":"大小","Files":"文件","File":"文件","Edit":"编辑","Cancel":"取消","Delete":"删除","Open":"打开","Ok":"打开","Save":"储存","Step":"步骤","Search":"搜索","Import":"导入","Print":"打印","Settings":"设置","or":"或","and":"与","Information":"更多资讯","Download":"下载","Create":"创立"}')},dfc6:function(e){e.exports=JSON.parse('{"err_fetching_resource":"","err_creating_resource":"","err_updating_resource":"","err_deleting_resource":"","success_fetching_resource":"","success_creating_resource":"","success_updating_resource":"","success_deleting_resource":"","import_running":"","all_fields_optional":"","convert_internal":"","show_only_internal":"","Log_Recipe_Cooking":"","External_Recipe_Image":"","Add_to_Book":"","Add_to_Shopping":"","Add_to_Plan":"","Step_start_time":"","Meal_Plan":"","Select_Book":"","Recipe_Image":"","Import_finished":"","View_Recipes":"","Log_Cooking":"","New_Recipe":"","Url_Import":"","Reset_Search":"","Recently_Viewed":"","Load_More":"","Keywords":"","Books":"","Proteins":"","Fats":"","Carbohydrates":"","Calories":"","Nutrition":"","Date":"","Share":"","Export":"","Copy":"","Rating":"","Close":"","Link":"","Add":"","New":"","Success":"","Ingredients":"","Supermarket":"","Categories":"","Category":"","Selected":"","min":"","Servings":"","Waiting":"","Preparation":"","External":"","Size":"","Files":"","File":"","Edit":"","Cancel":"","Delete":"","Open":"","Ok":"","Save":"","Step":"","Search":"","Import":"","Print":"","Settings":"","or":"","and":"","Information":"","Download":""}')},edd4:function(e){e.exports=JSON.parse('{"err_fetching_resource":"There was an error fetching a resource!","err_creating_resource":"There was an error creating a resource!","err_updating_resource":"There was an error updating a resource!","err_deleting_resource":"There was an error deleting a resource!","success_fetching_resource":"Successfully fetched a resource!","success_creating_resource":"Successfully created a resource!","success_updating_resource":"Successfully updated a resource!","success_deleting_resource":"Successfully deleted a resource!","import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","show_split_screen":"Show split view","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Sort_by_new":"Sort by new","Recipes_per_page":"Recipes per Page","Manage_Books":"Manage Books","Meal_Plan":"Meal Plan","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Recently_Viewed":"Recently Viewed","Load_More":"Load More","New_Keyword":"New Keyword","Delete_Keyword":"Delete Keyword","Edit_Keyword":"Edit Keyword","Move_Keyword":"Move Keyword","Merge_Keyword":"Merge Keyword","Hide_Keywords":"Hide Keywords","Hide_Recipes":"Hide Recipes","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Copy":"Copy","Rating":"Rating","Close":"Close","Cancel":"Cancel","Link":"Link","Add":"Add","New":"New","Success":"Success","Failure":"Failure","Ingredients":"Ingredients","Supermarket":"Supermarket","Categories":"Categories","Category":"Category","Selected":"Selected","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","External":"External","Size":"Size","Files":"Files","File":"File","Edit":"Edit","Delete":"Delete","Open":"Open","Ok":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","Settings":"Settings","or":"or","and":"and","Information":"Information","Download":"Download","Create":"Create","Advanced Search Settings":"Advanced Search Settings","View":"View","Recipes":"Recipes","Move":"Move","Merge":"Merge","Parent":"Parent","delete_confimation":"Are you sure that you want to delete {kw} and all of it\'s children?","move_confirmation":"Move {child} to parent {parent}","merge_confirmation":"Replace {source} with {target}","move_selection":"Select a parent to move {child} to.","merge_selection":"Replace all occurences of {source} with the selected {type}.","Root":"Root"}')},f693:function(e){e.exports=JSON.parse('{"err_fetching_resource":"Il y a eu une erreur pour récupérer une ressource !","err_creating_resource":"Il y a eu une erreur pour créer une ressource !","err_updating_resource":"Il y a eu une erreur pour mettre à jour une ressource !","err_deleting_resource":"Il y a eu une erreur pour supprimer une ressource !","success_fetching_resource":"Ressource correctement récupérée !","success_creating_resource":"Ressource correctement créée !","success_updating_resource":"Ressource correctement mise à jour !","success_deleting_resource":"Ressource correctement supprimée !","import_running":"Importation en cours, veuillez patienter !","all_fields_optional":"Tous les champs sont optionnels et peuvent être laissés vides.","convert_internal":"Convertir en recette interne","show_only_internal":"Montrer uniquement les recettes internes","Log_Recipe_Cooking":"Marquer la recette comme cuisinée","External_Recipe_Image":"Image externe de recette","Add_to_Shopping":"Ajouter à la liste de courses","Add_to_Plan":"Ajouter au menu","Step_start_time":"Heure de départ de l\'étape","Sort_by_new":"Trier par nouveautés","Recipes_per_page":"Nombre de recettes par page","Manage_Books":"Gérer les favoris","Meal_Plan":"Menu de la semaine","Select_Book":"Sélectionnez livre","Recipe_Image":"Image de la recette","Import_finished":"Importation finie","View_Recipes":"Voir les recettes","Log_Cooking":"Marquer comme cuisiné","New_Recipe":"Nouvelle recette","Url_Import":"Importation de l\'url","Reset_Search":"Réinitialiser la recherche","Recently_Viewed":"Vu récemment","Load_More":"Charger plus","Keywords":"Mots-clés","Books":"Livres","Proteins":"Protéines","Fats":"Matières grasses","Carbohydrates":"Glucides","Calories":"Calories","Nutrition":"Informations nutritionnelles","Date":"Date","Share":"Partager","Export":"Exporter","Copy":"Copier","Rating":"Note","Close":"Fermer","Link":"Lien","Add":"Ajouter","New":"Nouveau","Success":"Réussite","Failure":"Échec","Ingredients":"Ingrédients","Supermarket":"Supermarché","Categories":"Catégories","Category":"Catégorie","Selected":"Sélectionné","min":"min","Servings":"Portions","Waiting":"Attente","Preparation":"Préparation","External":"Externe","Size":"Taille","Files":"Fichiers","File":"Fichier","Edit":"Modifier","Cancel":"Annuler","Delete":"Supprimer","Open":"Ouvrir","Ok":"Ouvrir","Save":"Sauvegarder","Step":"Étape","Search":"Rechercher","Import":"Importer","Print":"Imprimer","Settings":"Paramètres","or":"ou","and":"et","Information":"Information","Download":"Télécharger","Create":"Créer"}')},fa7d:function(e,t,r){"use strict";r.d(t,"d",(function(){return d})),r.d(t,"g",(function(){return p})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return h})),r.d(t,"f",(function(){return b})),r.d(t,"b",(function(){return f})),r.d(t,"h",(function(){return j})),r.d(t,"e",(function(){return O}));var n=r("53ca"),i=r("d4ec"),o=r("bee2"),a=r("ade3"),s=(r("99af"),r("59e4")),c=r("9225");function u(e,t,r){var n=Math.floor(e),i=1,o=n+1,a=1;if(e!==n)while(i<=t&&a<=t){var s=(n+o)/(i+a);if(e===s){i+a<=t?(i+=a,n+=o,a=t+1):i>a?a=t+1:i=t+1;break}et&&(i=a,n=o),!r)return[0,n,i];var c=Math.floor(n/i);return[c,n-c*i,i]}var d={methods:{makeToast:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return p(e,t,r)}}};function p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=new s["a"];n.$bvToast.toast(t,{title:e,variant:r,toaster:"b-toaster-top-center",solid:!0})}var l=function(){function e(){Object(i["a"])(this,e)}return Object(o["a"])(e,null,[{key:"makeStandardToast",value:function(t){switch(t){case e.SUCCESS_CREATE:p(c["a"].tc("Success"),c["a"].tc("success_creating_resource"),"success");break;case e.SUCCESS_FETCH:p(c["a"].tc("Success"),c["a"].tc("success_fetching_resource"),"success");break;case e.SUCCESS_UPDATE:p(c["a"].tc("Success"),c["a"].tc("success_updating_resource"),"success");break;case e.SUCCESS_DELETE:p(c["a"].tc("Success"),c["a"].tc("success_deleting_resource"),"success");break;case e.FAIL_CREATE:p(c["a"].tc("Failure"),c["a"].tc("success_creating_resource"),"danger");break;case e.FAIL_FETCH:p(c["a"].tc("Failure"),c["a"].tc("err_fetching_resource"),"danger");break;case e.FAIL_UPDATE:p(c["a"].tc("Failure"),c["a"].tc("err_updating_resource"),"danger");break;case e.FAIL_DELETE:p(c["a"].tc("Failure"),c["a"].tc("err_deleting_resource"),"danger");break}}}]),e}();Object(a["a"])(l,"SUCCESS_CREATE","SUCCESS_CREATE"),Object(a["a"])(l,"SUCCESS_FETCH","SUCCESS_FETCH"),Object(a["a"])(l,"SUCCESS_UPDATE","SUCCESS_UPDATE"),Object(a["a"])(l,"SUCCESS_DELETE","SUCCESS_DELETE"),Object(a["a"])(l,"FAIL_CREATE","FAIL_CREATE"),Object(a["a"])(l,"FAIL_FETCH","FAIL_FETCH"),Object(a["a"])(l,"FAIL_UPDATE","FAIL_UPDATE"),Object(a["a"])(l,"FAIL_DELETE","FAIL_DELETE");var h={methods:{_:function(e){return b(e)}}};function b(e){return window.gettext(e)}var f={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return j(e,t)}}};function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null==t)return window.Urls[e]();if("object"!=Object(n["a"])(t))return window.Urls[e](t);if("object"==Object(n["a"])(t)){if(1===t.length)return window.Urls[e](t);if(2===t.length)return window.Urls[e](t[0],t[1]);if(3===t.length)return window.Urls[e](t[0],t[1],t[2])}}function v(e){return window.USER_PREF[e]}function O(e,t){if(v("use_fractions")){var r="",n=u(e*t,10,!0);return n[0]>0&&(r+=n[0]),n[1]>0&&(r+=" ".concat(n[1],"").concat(n[2],"")),r}return m(e*t)}function m(e){var t=v("user_fractions")?v("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}},fc0d:function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("div",{staticClass:"dropdown d-print-none"},[e._m(0),r("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuLink"}},[r("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_recipe",e.recipe.id)}},[r("i",{staticClass:"fas fa-pencil-alt fa-fw"}),e._v(" "+e._s(e.$t("Edit")))]),e.recipe.internal?e._e():r("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_convert_recipe",e.recipe.id)}},[r("i",{staticClass:"fas fa-exchange-alt fa-fw"}),e._v(" "+e._s(e.$t("convert_internal")))]),r("a",{attrs:{href:"#"}},[r("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_add_book_"+e.modal_id)}}},[r("i",{staticClass:"fas fa-bookmark fa-fw"}),e._v(" "+e._s(e.$t("Manage_Books"))+" ")])]),e.recipe.internal?r("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_shopping")+"?r=["+e.recipe.id+","+e.servings_value+"]",target:"_blank",rel:"noopener noreferrer"}},[r("i",{staticClass:"fas fa-shopping-cart fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Shopping"))+" ")]):e._e(),r("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_meal_plan")+"?recipe="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[r("i",{staticClass:"fas fa-calendar fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Plan"))+" ")]),r("a",{attrs:{href:"#"}},[r("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_cook_log_"+e.modal_id)}}},[r("i",{staticClass:"fas fa-clipboard-list fa-fw"}),e._v(" "+e._s(e.$t("Log_Cooking"))+" ")])]),r("a",{attrs:{href:"#"}},[r("button",{staticClass:"dropdown-item",attrs:{onclick:"window.print()"}},[r("i",{staticClass:"fas fa-print fa-fw"}),e._v(" "+e._s(e.$t("Print"))+" ")])]),r("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_export")+"?r="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[r("i",{staticClass:"fas fa-file-export fa-fw"}),e._v(" "+e._s(e.$t("Export")))]),r("a",{attrs:{href:"#"}},[e.recipe.internal?r("button",{staticClass:"dropdown-item",on:{click:function(t){return e.createShareLink()}}},[r("i",{staticClass:"fas fa-share-alt fa-fw"}),e._v(" "+e._s(e.$t("Share"))+" ")]):e._e()])])]),r("cook-log",{attrs:{recipe:e.recipe,modal_id:e.modal_id}}),r("add-recipe-to-book",{attrs:{recipe:e.recipe,modal_id:e.modal_id}}),r("b-modal",{attrs:{id:"modal-share-link_"+e.modal_id,title:e.$t("Share"),"hide-footer":""}},[r("div",{staticClass:"row"},[r("div",{staticClass:"col col-md-12"},[void 0!==e.recipe_share_link?r("label",[e._v(e._s(e.$t("Public share link")))]):e._e(),r("input",{directives:[{name:"model",rawName:"v-model",value:e.recipe_share_link,expression:"recipe_share_link"}],ref:"share_link_ref",staticClass:"form-control",domProps:{value:e.recipe_share_link},on:{input:function(t){t.target.composing||(e.recipe_share_link=t.target.value)}}}),r("b-button",{staticClass:"mt-2 mb-3 d-none d-md-inline",attrs:{variant:"secondary"},on:{click:function(t){return e.$bvModal.hide("modal-share-link_"+e.modal_id)}}},[e._v(e._s(e.$t("Close"))+" ")]),r("b-button",{staticClass:"mt-2 mb-3 ml-md-2",attrs:{variant:"primary"},on:{click:function(t){return e.copyShareLink()}}},[e._v(e._s(e.$t("Copy")))]),r("b-button",{staticClass:"mt-2 mb-3 ml-2 float-right",attrs:{variant:"success"},on:{click:function(t){return e.shareIntend()}}},[e._v(e._s(e.$t("Share"))+" "),r("i",{staticClass:"fa fa-share-alt"})])],1)])])],1)},i=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a",{staticClass:"btn shadow-none",attrs:{href:"#",role:"button",id:"dropdownMenuLink","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[r("i",{staticClass:"fas fa-ellipsis-v fa-lg"})])}],o=(r("a9e3"),r("9911"),r("b0c0"),r("99af"),r("fa7d")),a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("b-modal",{staticClass:"modal",attrs:{id:"id_modal_cook_log_"+e.modal_id,title:e.$t("Log_Recipe_Cooking"),"ok-title":e.$t("Save"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.logCook()}}},[r("p",[e._v(e._s(e.$t("all_fields_optional")))]),r("form",[r("label",{attrs:{for:"id_log_servings"}},[e._v(e._s(e.$t("Servings")))]),r("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.servings,expression:"logObject.servings"}],staticClass:"form-control",attrs:{type:"number",id:"id_log_servings"},domProps:{value:e.logObject.servings},on:{input:function(t){t.target.composing||e.$set(e.logObject,"servings",t.target.value)}}}),r("label",{staticStyle:{"margin-top":"2vh"}},[e._v(e._s(e.$t("Rating"))+" - "),r("span",{attrs:{id:"id_rating_show"}},[e._v(e._s(e.logObject.rating)+"/5")])]),r("b-form-rating",{model:{value:e.logObject.rating,callback:function(t){e.$set(e.logObject,"rating",t)},expression:"logObject.rating"}}),r("label",{staticStyle:{"margin-top":"2vh"},attrs:{for:"id_date"}},[e._v(e._s(e.$t("Date")))]),r("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.created_at,expression:"logObject.created_at"}],staticClass:"form-control",attrs:{type:"datetime-local",id:"id_date"},domProps:{value:e.logObject.created_at},on:{input:function(t){t.target.composing||e.$set(e.logObject,"created_at",t.target.value)}}})],1)])],1)},s=[],c=r("c1df"),u=r.n(c),d=r("a026"),p=r("5f5b"),l=r("7c15");d["default"].prototype.moment=u.a,d["default"].use(p["a"]);var h={name:"CookLog",props:{recipe:Object,modal_id:Number},data:function(){return{logObject:{recipe:this.recipe.id,servings:0,rating:0,created_at:u()().format("yyyy-MM-DDTHH:mm")}}},methods:{logCook:function(){Object(l["b"])(this.logObject)}}},b=h,f=r("2877"),j=Object(f["a"])(b,a,s,!1,null,null,null),v=j.exports,O=r("bc3a"),m=r.n(O),g=r("d46a"),y={name:"RecipeContextMenu",mixins:[o["b"]],components:{AddRecipeToBook:g["a"],CookLog:v},data:function(){return{servings_value:0,recipe_share_link:void 0,modal_id:this.recipe.id+Math.round(1e5*Math.random())}},props:{recipe:Object,servings:{type:Number,default:-1}},mounted:function(){this.servings_value=-1===this.servings?this.recipe.servings:this.servings},methods:{createShareLink:function(){var e=this;m.a.get(Object(o["h"])("api_share_link",this.recipe.id)).then((function(t){e.$bvModal.show("modal-share-link_".concat(e.modal_id)),e.recipe_share_link=t.data.link})).catch((function(t){403===t.response.status&&Object(o["g"])(e.$t("Share"),e.$t("Sharing is not enabled for this space."),"danger")}))},copyShareLink:function(){var e=this.$refs.share_link_ref;e.select(),document.execCommand("copy")},shareIntend:function(){var e={title:this.recipe.name,text:"".concat(this.$t("Check out this recipe: ")," ").concat(this.recipe.name),url:this.recipe_share_link};navigator.share(e)}}},_=y,S=Object(f["a"])(_,n,i,!1,null,null,null);t["a"]=S.exports}});