From 0559143f0e246d3544a7c39fb40dd6f40cbbf6d2 Mon Sep 17 00:00:00 2001 From: smilerz Date: Mon, 16 Aug 2021 08:54:57 -0500 Subject: [PATCH] initial Vue components --- cookbook/helper/recipe_search.py | 15 +- cookbook/serializer.py | 19 +- cookbook/static/vue/css/food_list_view.css | 1 + cookbook/static/vue/food_list_view.html | 1 + cookbook/static/vue/js/food_list_view.js | 1 + cookbook/static/vue/js/keyword_list_view.js | 2 +- cookbook/static/vue/js/recipe_search_view.js | 2 +- cookbook/templates/sw.js | 2 +- cookbook/tests/api/test_api_food.py | 8 +- cookbook/views/api.py | 6 +- vue/src/apps/FoodListView/FoodListView.vue | 614 ++++++++++++++++++ vue/src/apps/FoodListView/main.js | 10 + .../apps/KeywordListView/KeywordListView.vue | 1 - .../RecipeSearchView/RecipeSearchView.vue | 12 +- vue/src/components/FoodCard.vue | 215 ++++++ vue/vue.config.js | 4 + vue/webpack-stats.json | 2 +- 17 files changed, 881 insertions(+), 34 deletions(-) create mode 100644 cookbook/static/vue/css/food_list_view.css create mode 100644 cookbook/static/vue/food_list_view.html create mode 100644 cookbook/static/vue/js/food_list_view.js create mode 100644 vue/src/apps/FoodListView/FoodListView.vue create mode 100644 vue/src/apps/FoodListView/main.js create mode 100644 vue/src/components/FoodCard.vue diff --git a/cookbook/helper/recipe_search.py b/cookbook/helper/recipe_search.py index 6c26f778..8258ddaf 100644 --- a/cookbook/helper/recipe_search.py +++ b/cookbook/helper/recipe_search.py @@ -178,26 +178,27 @@ def get_facet(qs, params, space): facets = {} ratings = params.getlist('ratings', []) keyword_list = params.getlist('keywords', []) - ingredient_list = params.getlist('foods', []) + food_list = params.getlist('foods', []) book_list = params.getlist('book', []) search_keywords_or = params.get('keywords_or', True) search_foods_or = params.get('foods_or', True) search_books_or = params.get('books_or', True) - # if using an OR search, will annotate all keywords, otherwise, just those that appear in results - if search_keywords_or: - keywords = Keyword.objects.filter(space=space).annotate(recipe_count=Count('recipe')) - else: - keywords = Keyword.objects.filter(recipe__in=qs, space=space).annotate(recipe_count=Count('recipe')) + # this returns a list of keywords in the queryset and how many times it appears + keywords = Keyword.objects.filter(recipe__in=qs).annotate(recipe_count=Count('recipe')) # custom django-tree function annotates a queryset to make building a tree easier. # see https://django-treebeard.readthedocs.io/en/latest/api.html#treebeard.models.Node.get_annotated_list_qs for details kw_a = annotated_qs(keywords, root=True, fill=True) + # return list of foods in the recipe queryset and how many times they appear + foods = Food.objects.filter(ingredient__step__recipe__in=list(qs.values_list('id', flat=True))).annotate(recipe_count=Count('ingredient')) + food_a = annotated_qs(foods, root=True, fill=True) + # TODO add rating facet facets['Ratings'] = [] facets['Keywords'] = fill_annotated_parents(kw_a, keyword_list) # TODO add food facet - facets['Foods'] = [] + facets['Foods'] = fill_annotated_parents(food_a, food_list) # TODO add book facet facets['Books'] = [] facets['Recent'] = ViewLog.objects.filter( diff --git a/cookbook/serializer.py b/cookbook/serializer.py index 7dbb39de..79ca4f95 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -47,7 +47,7 @@ class SpaceFilterSerializer(serializers.ListSerializer): def to_representation(self, data): if (type(data) == QuerySet and data.query.is_sliced): - # if query is sliced it came from api request not nested serializer + # if query is sliced or if is a MP_NodeQuerySet it came from api request not nested serializer return super().to_representation(data) if self.child.Meta.model == User: data = data.filter(userpreference__space=self.context['request'].space) @@ -211,9 +211,9 @@ class KeywordSerializer(UniqueFieldsMixin, serializers.ModelSerializer): return str(obj) def get_image(self, obj): - recipes = obj.recipe_set.all().exclude(image__isnull=True).exclude(image__exact='') + recipes = obj.recipe_set.all().filter(space=obj.space).exclude(image__isnull=True).exclude(image__exact='') if len(recipes) == 0: - recipes = Recipe.objects.filter(keywords__in=obj.get_tree()).exclude(image__isnull=True).exclude(image__exact='') # if no recipes found - check whole tree + recipes = Recipe.objects.filter(keywords__in=obj.get_tree(), space=obj.space).exclude(image__isnull=True).exclude(image__exact='') # if no recipes found - check whole tree if len(recipes) != 0: return random.choice(recipes).image.url else: @@ -292,16 +292,15 @@ class FoodSerializer(UniqueFieldsMixin, WritableNestedModelSerializer): numrecipe = serializers.SerializerMethodField('count_recipes') def get_image(self, obj): - if obj.recipe: - recipes = Recipe.objects.filter(id=obj.recipe).exclude(image__isnull=True).exclude(image__exact='') - if len(recipes) == 0: - return recipes.image.url + if obj.recipe and obj.space == obj.recipe.space: + if obj.recipe.image and obj.recipe.image != '': + return obj.recipe.image.url # if food is not also a recipe, look for recipe images that use the food - recipes = Recipe.objects.filter(steps__ingredients__food=obj).exclude(image__isnull=True).exclude(image__exact='') + recipes = Recipe.objects.filter(steps__ingredients__food=obj, space=obj.space).exclude(image__isnull=True).exclude(image__exact='') # if no recipes found - check whole tree if len(recipes) == 0: - recipes = Recipe.objects.filter(steps__ingredients__food__in=obj.get_tree()).exclude(image__isnull=True).exclude(image__exact='') + recipes = Recipe.objects.filter(steps__ingredients__food__in=obj.get_tree(), space=obj.space).exclude(image__isnull=True).exclude(image__exact='') if len(recipes) != 0: return random.choice(recipes).image.url @@ -309,7 +308,7 @@ class FoodSerializer(UniqueFieldsMixin, WritableNestedModelSerializer): return None def count_recipes(self, obj): - return Recipe.objects.filter(steps__ingredients__food=obj).count() + return Recipe.objects.filter(steps__ingredients__food=obj, space=obj.space).count() def create(self, validated_data): validated_data['name'] = validated_data['name'].strip() diff --git a/cookbook/static/vue/css/food_list_view.css b/cookbook/static/vue/css/food_list_view.css new file mode 100644 index 00000000..60114661 --- /dev/null +++ b/cookbook/static/vue/css/food_list_view.css @@ -0,0 +1 @@ +.shake[data-v-33424c9e]{-webkit-animation:shake-data-v-33424c9e .82s cubic-bezier(.36,.07,.19,.97) both;animation:shake-data-v-33424c9e .82s cubic-bezier(.36,.07,.19,.97) both;transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden;perspective:1000px}@-webkit-keyframes shake-data-v-33424c9e{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-4px,0,0)}40%,60%{transform:translate3d(4px,0,0)}}@keyframes shake-data-v-33424c9e{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-4px,0,0)}40%,60%{transform:translate3d(4px,0,0)}} \ No newline at end of file diff --git a/cookbook/static/vue/food_list_view.html b/cookbook/static/vue/food_list_view.html new file mode 100644 index 00000000..2387bb5a --- /dev/null +++ b/cookbook/static/vue/food_list_view.html @@ -0,0 +1 @@ +Vue App
\ No newline at end of file diff --git a/cookbook/static/vue/js/food_list_view.js b/cookbook/static/vue/js/food_list_view.js new file mode 100644 index 00000000..a829a61e --- /dev/null +++ b/cookbook/static/vue/js/food_list_view.js @@ -0,0 +1 @@ +(function(e){function t(t){for(var n,a,s=t[0],c=t[1],u=t[2],p=0,h=[];p0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(){return{width:0,height:0,top:t,right:e,bottom:t,left:e}}},closeMenu:function(){this.show_menu=!1}}},y=g,S=(r("721c"),r("2877")),w=Object(S["a"])(y,f,b,!1,null,"33424c9e",null),_=w.exports,k=r("7432"),P=r("e166"),U=r.n(P),R=r("ad23"),C=r("34ef"),L=r("0d08");c.a.defaults.xsrfCookieName="csrftoken",c.a.defaults.xsrfHeaderName="X-CSRFTOKEN",n["default"].use(u["a"]);var E={name:"FoodListView",mixins:[h["b"]],components:{TwemojiTextarea:R["a"],FoodCard:_,GenericMultiselect:k["a"],InfiniteLoading:U.a},computed:{emojiDataAll:function(){return C},emojiGroups:function(){return L}},data:function(){return{foods:[],foods2:[],show_split:!1,search_input:"",search_input2:"",advanced_visible:!1,right_page:0,right:+new Date,isDirtyRight:!1,left_page:0,left:+new Date,isDirtyLeft:!1,this_item:{id:-1,name:"",description:"",icon:"",target:{id:-1,name:""}}}},watch:{search_input:p()((function(){this.left_page=0,this.foods=[],this.left+=1}),700),search_input2:p()((function(){this.right_page=0,this.foods2=[],this.right+=1}),700)},methods:{makeToast:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.$bvToast.toast(t,{title:e,variant:r,toaster:"b-toaster-top-center",solid:!0})},resetSearch:function(){""!==this.search_input?this.search_input="":(this.left_page=0,this.foods=[],this.left+=1),""!==this.search_input2?this.search_input2="":(this.right_page=0,this.foods2=[],this.right+=1)},startAction:function(e,t){var r=e.target||null,i=e.source||null;"delete"==e.action?(this.this_item=i,this.$bvModal.show("id_modal_keyword_delete")):"new"==e.action?(this.this_item={},this.$bvModal.show("id_modal_keyword_edit")):"edit"==e.action?(this.this_item=i,this.$bvModal.show("id_modal_keyword_edit")):"move"===e.action?(this.this_item=i,null==r?this.$bvModal.show("id_modal_keyword_move"):this.moveKeyword(i.id,r.id)):"merge"===e.action?(this.this_item=i,null==r?this.$bvModal.show("id_modal_keyword_merge"):this.mergeKeyword(e.source.id,e.target.id)):"get-children"===e.action?i.expanded?n["default"].set(i,"expanded",!1):(this.this_item=i,this.getChildren(t,i)):"get-recipes"===e.action&&(i.show_recipes?n["default"].set(i,"show_recipes",!1):(this.this_item=i,this.getRecipes(t,i)))},saveFood:function(){var e=this,t=new l["a"],r={name:this.this_item.name,description:this.this_item.description,icon:this.this_item.icon};this.this_item.id?t.partialUpdateFood(this.this_item.id,r).then((function(t){e.refreshCard(e.this_item.id),e.this_item={}})).catch((function(t){console.log(t),e.this_item={}})):t.createFood(r).then((function(t){e.foods=[t.data].concat(e.foods),e.show_split?e.foods2=[JSON.parse(JSON.stringify(t.data))].concat(e.foods2):e.foods2=[],e.this_item={}})).catch((function(t){console.log(t),e.this_item={}}))},delFood:function(e){var t=this,r=new l["a"];r.destroyFood(e).then((function(r){t.destroyCard(e)})).catch((function(e){console.log(e),t.this_item={}}))},moveFood:function(e,t){var r=this,n=new l["a"];n.moveFood(String(e),String(t)).then((function(n){if(0===t){var i=r.findFood(r.foods,e)||r.findFood(r.foods2,e);i.parent=null,r.show_split?(r.destroyCard(e),r.foods=[i].concat(r.foods),r.foods2=[JSON.parse(JSON.stringify(i))].concat(r.foods2)):(r.destroyCard(e),r.foods=[i].concat(r.foods),r.foods2=[])}else r.destroyCard(e),r.refreshCard(t)})).catch((function(e){console.log(e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},mergeFood:function(e,t){var r=this,n=new l["a"];n.mergeFood(String(e),String(t)).then((function(n){r.destroyCard(e),r.refreshCard(t)})).catch((function(e){console.log("Error",e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},getChildren:function(e,t){var r=this,i=new l["a"],o={},a=void 0,s=void 0,c=t.id,u=void 0,d=200;i.listFoods(a,c,u,s,d).then((function(i){"left"==e?o=r.findFood(r.keywords,t.id):"right"==e&&(o=r.findFood(r.keywords2,t.id)),o&&(n["default"].set(o,"children",i.data.results),n["default"].set(o,"expanded",!0),n["default"].set(o,"show_recipes",!1))})).catch((function(e){console.log(e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},getRecipes:function(e,t){var r=this,i=new l["a"],o={},a=200;console.log(i.listRecipes),i.listRecipes(void 0,void 0,String(t.id),void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,a,void 0).then((function(i){"left"==e?o=r.findFood(r.foods,t.id):"right"==e&&(o=r.findFood(r.foods2,t.id)),o&&(n["default"].set(o,"recipes",i.data.results),n["default"].set(o,"show_recipes",!0),n["default"].set(o,"expanded",!1))})).catch((function(e){console.log(e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},refreshCard:function(e){var t=this,r={},i=new l["a"],o=void 0,a=void 0;i.retrieveFood(e).then((function(i){if(r=t.findFood(t.foods,e)||t.findFood(t.foods2,e),r.parent){var s=t.findFood(t.foods,r.parent),c=t.findFood(t.foods2,r.parent);s&&s.expanded&&(o=s.children.indexOf(s.children.find((function(e){return e.id===r.id}))),n["default"].set(s.children,o,i.data)),c&&c.expanded&&(a=c.children.indexOf(c.children.find((function(e){return e.id===r.id}))),n["default"].set(c.children,a,JSON.parse(JSON.stringify(i.data))))}else o=t.foods.indexOf(t.foods.find((function(e){return e.id===r.id}))),a=t.foods2.indexOf(t.foods2.find((function(e){return e.id===r.id}))),n["default"].set(t.foods,o,i.data),n["default"].set(t.foods2,a,JSON.parse(JSON.stringify(i.data)))}))},findFood:function(e,t){if(0==e.length)return!1;var r=e.filter((function(e){return e.id==t}));if(1==r.length)return r[0];if(0==r.length){var n,i=Object(a["a"])(e.filter((function(e){return 1==e.expanded})));try{for(i.s();!(n=i.n()).done;){var o=n.value;if(r=this.findFood(o.children,t),r)return r}}catch(s){i.e(s)}finally{i.f()}}else console.log("something terrible happened")},prepareEmoji:function(){this.$refs._edit.addText(this.this_item.icon||""),this.$refs._edit.blur(),document.getElementById("btn-emoji-default").disabled=!0},setIcon:function(e){this.this_item.icon=e},infiniteHandler:function(e,t){var r=this,n=new l["a"],i="left"===t?this.search_input:this.search_input2,o="left"===t?this.left_page+1:this.right_page+1,a=void 0,s=void 0,c=void 0;""===i&&(i=void 0,a=0),n.listFoods(i,a,s,o,c).then((function(n){n.data.results.length?"left"===t?(r.left_page+=1,r.foods=r.foods.concat(n.data.results),e.loaded(),r.foods.length>=n.data.count&&e.complete()):"right"===t&&(r.right_page+=1,r.foods2=r.foods2.concat(n.data.results),e.loaded(),r.foods2.length>=n.data.count&&e.complete()):(console.log("no data returned"),e.complete())})).catch((function(t){console.log(t),r.makeToast(r.$t("Error"),t.bodyText,"danger"),e.complete()}))},destroyCard:function(e){var t=this.findFood(this.foods,e),r=this.findFood(this.foods2,e),i=void 0;if(t?i=t.parent:r&&(i=r.parent),i){var o=this.findFood(this.foods,i),a=this.findFood(this.v2,i);if(o&&(n["default"].set(o,"numchild",o.numchild-1),o.expanded)){var s=o.children.indexOf(o.children.find((function(t){return t.id===e})));n["default"].delete(o.children,s)}if(a&&(n["default"].set(a,"numchild",a.numchild-1),a.expanded)){var c=a.children.indexOf(a.children.find((function(t){return t.id===e})));n["default"].delete(a.children,c)}}this.foods=this.foods.filter((function(t){return t.id!=e})),this.foods2=this.foods2.filter((function(t){return t.id!=e}))}}},T=E,x=(r("60bc"),Object(S["a"])(T,i,o,!1,null,null,null)),I=x.exports,B=r("9225");n["default"].config.productionTip=!1,new n["default"]({i18n:B["a"],render:function(e){return e(I)}}).$mount("#app")},"2b2d":function(e,t,r){"use strict";r.d(t,"a",(function(){return _}));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"),h=r.n(p),l=(r("841c"),r("25f0"),r("b0c0"),"undefined"!==typeof window?localStorage.getItem("BASE_PATH")||"":location.protocol+"//"+location.host),f=function(){function e(e,t,r){void 0===t&&(t=l),void 0===r&&(r=h.a),this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}return e}(),b=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 b(t,"Required parameter "+t+" was null or undefined when calling "+e+".")},O=function(e){for(var t=[],r=1;r120?r("span",[e._v(" "+e._s(e.recipe.description.substr(0,120)+"…")+" ")]):e._e(),e.recipe.description.length<=120?r("span",[e._v(" "+e._s(e.recipe.description)+" ")]):e._e()]:e._e(),r("br"),e._v(" "),r("last-cooked",{attrs:{recipe:e.recipe}}),r("keywords",{staticStyle:{"margin-top":"4px"},attrs:{recipe:e.recipe}}),e.recipe.internal?e._e():r("b-badge",{attrs:{pill:"",variant:"info"}},[e._v(e._s(e.$t("External")))]),Date.parse(e.recipe.created_at)>new Date(Date.now()-6048e5)?r("b-badge",{attrs:{pill:"",variant:"success"}},[e._v(" "+e._s(e.$t("New"))+" ")]):e._e()]:[e._v(e._s(e.meal_plan.note))]],2)],1),void 0!==e.footer_text?r("b-card-footer",[r("i",{class:e.footer_icon}),e._v(" "+e._s(e.footer_text)+" ")]):e._e()],1)},i=[],o=r("fc0d"),a=r("81d5"),s=r("fa7d"),c=r("ca5b"),u=r("c1df"),d=r.n(u),p=r("a026"),h=r("830a");p["default"].prototype.moment=d.a;var l={name:"RecipeCard",mixins:[s["b"]],components:{LastCooked:h["a"],RecipeRating:c["a"],Keywords:a["a"],RecipeContextMenu:o["a"]},props:{recipe:Object,meal_plan:Object,footer_text:String,footer_icon:String},data:function(){return{recipe_image:""}},mounted:function(){null==this.recipe||null===this.recipe.image?this.recipe_image=window.IMAGE_PLACEHOLDER:this.recipe_image=this.recipe.image},methods:{clickUrl:function(){return null!==this.recipe?Object(s["g"])("view_recipe",this.recipe.id):Object(s["g"])("view_plan_entry",this.meal_plan.id)}},directives:{hover:{inserted:function(e){e.addEventListener("mouseenter",(function(){e.classList.add("shadow")})),e.addEventListener("mouseleave",(function(){e.classList.remove("shadow")}))}}}},f=l,b=r("2877"),j=Object(b["a"])(f,n,i,!1,null,"354baad6",null);t["a"]=j.exports},"6ce2":function(e){e.exports=JSON.parse('{"Import":"Importieren","import_running":"Import läuft, bitte warten!","Import_finished":"Import fertig","View_Recipes":"Rezepte Ansehen","Information":"Information","all_fields_optional":"Alle Felder sind optional und können leer gelassen werden.","convert_internal":"Zu internem Rezept wandeln","Log_Recipe_Cooking":"Kochen protokollieren","External_Recipe_Image":"Externes Rezept Bild","Add_to_Book":"Zu Buch hinzufügen","Add_to_Shopping":"Zu Einkaufsliste hinzufügen","Add_to_Plan":"Zu Plan hinzufügen","Step_start_time":"Schritt Startzeit","Select_Book":"Buch wählen","Recipe_Image":"Rezept Bild","Log_Cooking":"Kochen protokollieren","Proteins":"Proteine","Fats":"Fette","Carbohydrates":"Kohlenhydrate","Calories":"Kalorien","Nutrition":"Nährwerte","Keywords":"Stichwörter","Books":"Bücher","show_only_internal":"Nur interne Rezepte anzeigen","Ingredients":"Zutaten","min":"Min","Servings":"Portionen","Waiting":"Wartezeit","Preparation":"Vorbereitung","Edit":"Bearbeiten","Open":"Öffnen","Save":"Speichern","Step":"Schritt","Search":"Suchen","Print":"Drucken","New_Recipe":"Neues Rezept","Url_Import":"URL Import","Reset_Search":"Suche zurücksetzen","or":"oder","and":"und","Recently_Viewed":"Kürzlich angesehen","External":"Extern","Settings":"Einstellungen","Meal_Plan":"Speiseplan","Date":"Datum","Share":"Teilen","Export":"Exportieren","Rating":"Bewertung","Close":"Schließen","Add":"Hinzufügen","Copy":"Kopieren","New":"Neu","Categories":"Kategorien","Category":"Kategorie","Selected":"Ausgewählt","Supermarket":"Supermarkt","Files":"Dateien","Size":"Größe","success_fetching_resource":"Ressource erfolgreich abgerufen!","Download":"Herunterladen","Success":"Erfolgreich","err_fetching_resource":"Ein Fehler trat während dem Abrufen einer Ressource auf!","err_creating_resource":"Ein Fehler trat während dem Erstellen einer Ressource auf!","err_updating_resource":"Ein Fehler trat während dem Aktualisieren einer Ressource auf!","success_creating_resource":"Ressource erfolgreich erstellt!","success_updating_resource":"Ressource erfolgreich aktualisiert!","File":"Datei","Delete":"Löschen","err_deleting_resource":"Ein Fehler trat während dem Löschen einer Ressource auf!","Cancel":"Abbrechen","success_deleting_resource":"Ressource erfolgreich gelöscht!","Load_More":"Mehr laden","Ok":"Öffnen"}')},7:function(e,t,r){e.exports=r("0ae9")},"721c":function(e,t,r){"use strict";r("50a3")},7432:function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("multiselect",{attrs:{options:e.objects,"close-on-select":!0,"clear-on-select":!0,"hide-selected":!0,"preserve-search":!0,placeholder:e.placeholder,label:e.label,"track-by":"id",multiple:e.multiple,loading:e.loading},on:{"search-change":e.search,input:e.selectionChanged},model:{value:e.selected_objects,callback:function(t){e.selected_objects=t},expression:"selected_objects"}})},i=[],o=(r("ac1f"),r("841c"),r("99af"),r("8e5f")),a=r.n(o),s=r("2b2d"),c={name:"GenericMultiselect",components:{Multiselect:a.a},data:function(){return{loading:!1,objects:[],selected_objects:[]}},props:{placeholder:String,search_function:String,label:String,parent_variable:{type:String,default:void 0},sticky_options:{type:Array,default:function(){return[]}},initial_selection:{type:Array,default:function(){return[]}},multiple:{type:Boolean,default:!0},tree_api:{type:Boolean,default:!1}},watch:{initial_selection:function(e,t){this.selected_objects=e}},mounted:function(){this.search("")},methods:{search:function(e){var t=this,r=new s["a"];if(this.tree_api){var n=1,i=void 0,o=void 0,a=10;""===e&&(e=void 0),r[this.search_function](e,i,o,n,a).then((function(e){t.objects=t.sticky_options.concat(e.data.results)}))}else r[this.search_function]({query:{query:e,limit:10}}).then((function(e){t.objects=t.sticky_options.concat(e.data)}))},selectionChanged:function(){this.$emit("change",{var:this.parent_variable,val:this.selected_objects})}}},u=c,d=r("2877"),p=Object(d["a"])(u,n,i,!1,null,"abc99b66",null);t["a"]=p.exports},"7c15":function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"d",(function(){return s})),r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return u}));var n=r("bc3a"),i=r.n(n),o=r("fa7d");function a(e){var t=Object(o["g"])("api:recipe-detail",e);return void 0!==window.SHARE_UID&&(t+="?share="+window.SHARE_UID),i.a.get(t).then((function(e){return e.data})).catch((function(e){d(e,"There was an error loading a resource!","danger")}))}function s(e){return i.a.post(Object(o["g"])("api:cooklog-list"),e).then((function(e){Object(o["f"])("Saved","Cook Log entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function c(e){return i.a.get(Object(o["g"])("api:recipebook-list")+"?query="+e).then((function(e){return e.data})).catch((function(e){}))}function u(e){return i.a.post(Object(o["g"])("api:recipebookentry-list"),e).then((function(e){Object(o["f"])("Saved","Recipe Book entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function d(e,t){if("response"in e){console.log(e.response);var r="statusText"in e.response?e.response.statusText:Object(o["e"])("Error");t+="\n\n"+JSON.stringify(e.response.data),Object(o["f"])(r,t,"danger")}else Object(o["f"])("Error",t,"danger"),console.log(e)}i.a.defaults.xsrfCookieName="csrftoken",i.a.defaults.xsrfHeaderName="X-CSRFTOKEN"},"81d5":function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.recipe.keywords.length>0?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"}')},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("Add_to_Book"),"ok-title":e.$t("Add"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.addToBook()}}},[r("multiselect",{attrs:{options:e.books,"preserve-search":!0,placeholder:e.$t("Select_Book"),label:"name","track-by":"id",id:"id_books",multiple:!1},on:{"search-change":e.loadBook},model:{value:e.selected_book,callback:function(t){e.selected_book=t},expression:"selected_book"}})],1)],1)},i=[],o=(r("a9e3"),r("8e5f")),a=r.n(o),s=r("c1df"),c=r.n(s),u=r("a026"),d=r("5f5b"),p=r("7c15");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:[],selected_book:null}},mounted:function(){this.loadBook("")},methods:{loadBook:function(e){var t=this;Object(p["b"])(e).then((function(e){t.books=e}))},addToBook:function(){Object(p["a"])({recipe:this.recipe.id,book:this.selected_book.id})}}},l=h,f=(r("60bc"),r("2877")),b=Object(f["a"])(l,n,i,!1,null,null,null);t["a"]=b.exports},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_Book":"Add to Book","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","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","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","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}.","Download":"Download","Root":"Root"}')},fa7d:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"f",(function(){return s})),r.d(t,"a",(function(){return c})),r.d(t,"e",(function(){return u})),r.d(t,"b",(function(){return d})),r.d(t,"g",(function(){return p})),r.d(t,"d",(function(){return l}));var n=r("53ca"),i=(r("99af"),r("59e4"));function o(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 a={methods:{makeToast:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return s(e,t,r)}}};function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=new i["a"];n.$bvToast.toast(t,{title:e,variant:r,toaster:"b-toaster-top-center",solid:!0})}var c={methods:{_:function(e){return u(e)}}};function u(e){return window.gettext(e)}var d={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(e,t)}}};function p(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 h(e){return window.USER_PREF[e]}function l(e,t){if(h("use_fractions")){var r="",n=o(e*t,9,!0);return n[0]>0&&(r+=n[0]),n[1]>0&&(r+=" ".concat(n[1],"").concat(n[2],"")),r}return f(e*t)}function f(e){var t=h("user_fractions")?h("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("Add_to_Book"))+" ")])]),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"),h=r("7c15");d["default"].prototype.moment=u.a,d["default"].use(p["a"]);var l={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(h["d"])(this.logObject)}}},f=l,b=r("2877"),j=Object(b["a"])(f,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["g"])("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["f"])(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)}}},S=y,w=Object(b["a"])(S,n,i,!1,null,null,null);t["a"]=w.exports}}); \ No newline at end of file diff --git a/cookbook/static/vue/js/keyword_list_view.js b/cookbook/static/vue/js/keyword_list_view.js index 49422646..7946b593 100644 --- a/cookbook/static/vue/js/keyword_list_view.js +++ b/cookbook/static/vue/js/keyword_list_view.js @@ -1 +1 @@ -(function(e){function t(t){for(var n,a,s=t[0],c=t[1],u=t[2],p=0,h=[];p0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(){return{width:0,height:0,top:t,right:e,bottom:t,left:e}}},closeMenu:function(){this.show_menu=!1}}},U=P,R=(r("c77a"),Object(g["a"])(U,b,f,!1,null,"54d4941f",null)),C=R.exports,L=r("7432"),E=r("e166"),T=r.n(E),x=r("ad23"),I=r("34ef"),B=r("0d08");c.a.defaults.xsrfCookieName="csrftoken",c.a.defaults.xsrfHeaderName="X-CSRFTOKEN",n["default"].use(u["a"]);var M={name:"KeywordListView",mixins:[h["b"]],components:{TwemojiTextarea:x["a"],KeywordCard:C,GenericMultiselect:L["a"],InfiniteLoading:T.a},computed:{emojiDataAll:function(){return I},emojiGroups:function(){return B}},data:function(){return{keywords:[],keywords2:[],show_split:!1,search_input:"",search_input2:"",advanced_visible:!1,right_page:0,right:+new Date,isDirtyRight:!1,left_page:0,left:+new Date,isDirtyLeft:!1,this_item:{id:-1,name:"",description:"",icon:"",target:{id:-1,name:""}}}},watch:{search_input:p()((function(){this.left_page=0,this.keywords=[],this.left+=1}),700),search_input2:p()((function(){this.right_page=0,this.keywords2=[],this.right+=1}),700)},methods:{makeToast:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.$bvToast.toast(t,{title:e,variant:r,toaster:"b-toaster-top-center",solid:!0})},resetSearch:function(){""!==this.search_input?this.search_input="":(this.left_page=0,this.keywords=[],this.left+=1),""!==this.search_input2?this.search_input2="":(this.right_page=0,this.keywords2=[],this.right+=1)},startAction:function(e,t){var r=e.target||null,i=e.source||null;"delete"==e.action?(this.this_item=i,this.$bvModal.show("id_modal_keyword_delete")):"new"==e.action?(this.this_item={},this.$bvModal.show("id_modal_keyword_edit")):"edit"==e.action?(this.this_item=i,this.$bvModal.show("id_modal_keyword_edit")):"move"===e.action?(this.this_item=i,null==r?this.$bvModal.show("id_modal_keyword_move"):this.moveKeyword(i.id,r.id)):"merge"===e.action?(this.this_item=i,null==r?this.$bvModal.show("id_modal_keyword_merge"):this.mergeKeyword(e.source.id,e.target.id)):"get-children"===e.action?i.expanded?n["default"].set(i,"expanded",!1):(this.this_item=i,this.getChildren(t,i)):"get-recipes"===e.action&&(i.show_recipes?n["default"].set(i,"show_recipes",!1):(this.this_item=i,this.getRecipes(t,i)))},saveKeyword:function(){var e=this,t=new l["a"],r={name:this.this_item.name,description:this.this_item.description,icon:this.this_item.icon};this.this_item.id?t.partialUpdateKeyword(this.this_item.id,r).then((function(t){e.refreshCard(e.this_item.id),e.this_item={}})).catch((function(t){console.log(t),e.this_item={}})):t.createKeyword(r).then((function(t){e.keywords=[t.data].concat(e.keywords),e.show_split?e.keywords2=[JSON.parse(JSON.stringify(t.data))].concat(e.keywords2):e.keywords2=[],e.this_item={}})).catch((function(t){console.log(t),e.this_item={}}))},delKeyword:function(e){var t=this,r=new l["a"];r.destroyKeyword(e).then((function(r){t.destroyCard(e)})).catch((function(e){console.log(e),t.this_item={}}))},moveKeyword:function(e,t){var r=this,n=new l["a"];n.moveKeyword(String(e),String(t)).then((function(n){if(0===t){var i=r.findKeyword(r.keywords,e)||r.findKeyword(r.keywords2,e);i.parent=null,r.show_split?(r.destroyCard(e),r.keywords=[i].concat(r.keywords),r.keywords2=[JSON.parse(JSON.stringify(i))].concat(r.keywords2)):(r.destroyCard(e),r.keywords=[i].concat(r.keywords),r.keywords2=[])}else r.destroyCard(e),r.refreshCard(t)})).catch((function(e){console.log(e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},mergeKeyword:function(e,t){var r=this,n=new l["a"];n.mergeKeyword(String(e),String(t)).then((function(n){r.destroyCard(e),r.refreshCard(t)})).catch((function(e){console.log("Error",e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},getChildren:function(e,t){var r=this,i=new l["a"],o={},a=void 0,s=void 0,c=t.id,u=void 0,d=200;i.listKeywords(a,c,u,s,d).then((function(i){"left"==e?o=r.findKeyword(r.keywords,t.id):"right"==e&&(o=r.findKeyword(r.keywords2,t.id)),o&&(n["default"].set(o,"children",i.data.results),n["default"].set(o,"expanded",!0),n["default"].set(o,"show_recipes",!1))})).catch((function(e){console.log(e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},getRecipes:function(e,t){var r=this,i=new l["a"],o={},a=200,s=String(t.id);console.log(i.listRecipes),i.listRecipes(void 0,s,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,a,void 0).then((function(i){"left"==e?o=r.findKeyword(r.keywords,t.id):"right"==e&&(o=r.findKeyword(r.keywords2,t.id)),o&&(n["default"].set(o,"recipes",i.data.results),n["default"].set(o,"show_recipes",!0),n["default"].set(o,"expanded",!1))})).catch((function(e){console.log(e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},refreshCard:function(e){var t=this,r={},i=new l["a"],o=void 0,a=void 0;i.retrieveKeyword(e).then((function(i){if(r=t.findKeyword(t.keywords,e)||t.findKeyword(t.keywords2,e),r.parent){var s=t.findKeyword(t.keywords,r.parent),c=t.findKeyword(t.keywords2,r.parent);s&&s.expanded&&(o=s.children.indexOf(s.children.find((function(e){return e.id===r.id}))),n["default"].set(s.children,o,i.data)),c&&c.expanded&&(a=c.children.indexOf(c.children.find((function(e){return e.id===r.id}))),n["default"].set(c.children,a,JSON.parse(JSON.stringify(i.data))))}else o=t.keywords.indexOf(t.keywords.find((function(e){return e.id===r.id}))),a=t.keywords2.indexOf(t.keywords2.find((function(e){return e.id===r.id}))),n["default"].set(t.keywords,o,i.data),n["default"].set(t.keywords2,a,JSON.parse(JSON.stringify(i.data)))}))},findKeyword:function(e,t){if(0==e.length)return!1;var r=e.filter((function(e){return e.id==t}));if(1==r.length)return r[0];if(0==r.length){var n,i=Object(a["a"])(e.filter((function(e){return 1==e.expanded})));try{for(i.s();!(n=i.n()).done;){var o=n.value;if(r=this.findKeyword(o.children,t),r)return r}}catch(s){i.e(s)}finally{i.f()}}else console.log("something terrible happened")},prepareEmoji:function(){this.$refs._edit.addText(this.this_item.icon||""),this.$refs._edit.blur(),document.getElementById("btn-emoji-default").disabled=!0},setIcon:function(e){this.this_item.icon=e},infiniteHandler:function(e,t){var r=this,n=new l["a"],i="left"===t?this.search_input:this.search_input2,o="left"===t?this.left_page+1:this.right_page+1,a=void 0,s=void 0,c=void 0;""===i&&(i=void 0,a=0),n.listKeywords(i,a,s,o,c).then((function(n){n.data.results.length?"left"===t?(r.left_page+=1,r.keywords=r.keywords.concat(n.data.results),e.loaded(),r.keywords.length>=n.data.count&&e.complete()):"right"===t&&(r.right_page+=1,r.keywords2=r.keywords2.concat(n.data.results),e.loaded(),r.keywords2.length>=n.data.count&&e.complete()):(console.log("no data returned"),e.complete())})).catch((function(t){console.log(t),r.makeToast(r.$t("Error"),t.bodyText,"danger"),e.complete()}))},destroyCard:function(e){var t=this.findKeyword(this.keywords,e),r=this.findKeyword(this.keywords2,e),i=void 0;if(t?i=t.parent:r&&(i=r.parent),i){var o=this.findKeyword(this.keywords,i),a=this.findKeyword(this.keywords2,i);if(o&&(n["default"].set(o,"numchild",o.numchild-1),o.expanded)){var s=o.children.indexOf(o.children.find((function(t){return t.id===e})));n["default"].delete(o.children,s)}if(a&&(n["default"].set(a,"numchild",a.numchild-1),a.expanded)){var c=a.children.indexOf(a.children.find((function(t){return t.id===e})));n["default"].delete(a.children,c)}}this.keywords=this.keywords.filter((function(t){return t.id!=e})),this.keywords2=this.keywords2.filter((function(t){return t.id!=e}))}}},q=M,F=(r("60bc"),Object(g["a"])(q,i,o,!1,null,null,null)),K=F.exports,$=r("9225");n["default"].config.productionTip=!1,new n["default"]({i18n:$["a"],render:function(e){return e(K)}}).$mount("#app")},"6b0a":function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("b-card",{directives:[{name:"hover",rawName:"v-hover"}],attrs:{"no-body":""}},[r("a",{attrs:{href:e.clickUrl()}},[r("b-card-img-lazy",{staticStyle:{height:"15vh","object-fit":"cover"},attrs:{src:e.recipe_image,alt:e.$t("Recipe_Image"),top:""}}),r("div",{staticClass:"card-img-overlay h-100 d-flex flex-column justify-content-right",staticStyle:{float:"right","text-align":"right","padding-top":"10px","padding-right":"5px"}},[r("a",[null!==e.recipe?r("recipe-context-menu",{staticStyle:{float:"right"},attrs:{recipe:e.recipe}}):e._e()],1)])],1),r("b-card-body",{staticClass:"p-4"},[r("h6",[r("a",{attrs:{href:e.clickUrl()}},[null!==e.recipe?[e._v(e._s(e.recipe.name))]:[e._v(e._s(e.meal_plan.title))]],2)]),r("b-card-text",{staticStyle:{"text-overflow":"ellipsis"}},[null!==e.recipe?[r("recipe-rating",{attrs:{recipe:e.recipe}}),null!==e.recipe.description?[e.recipe.description.length>120?r("span",[e._v(" "+e._s(e.recipe.description.substr(0,120)+"…")+" ")]):e._e(),e.recipe.description.length<=120?r("span",[e._v(" "+e._s(e.recipe.description)+" ")]):e._e()]:e._e(),r("br"),e._v(" "),r("last-cooked",{attrs:{recipe:e.recipe}}),r("keywords",{staticStyle:{"margin-top":"4px"},attrs:{recipe:e.recipe}}),e.recipe.internal?e._e():r("b-badge",{attrs:{pill:"",variant:"info"}},[e._v(e._s(e.$t("External")))]),Date.parse(e.recipe.created_at)>new Date(Date.now()-6048e5)?r("b-badge",{attrs:{pill:"",variant:"success"}},[e._v(" "+e._s(e.$t("New"))+" ")]):e._e()]:[e._v(e._s(e.meal_plan.note))]],2)],1),void 0!==e.footer_text?r("b-card-footer",[r("i",{class:e.footer_icon}),e._v(" "+e._s(e.footer_text)+" ")]):e._e()],1)},i=[],o=r("fc0d"),a=r("81d5"),s=r("fa7d"),c=r("ca5b"),u=r("c1df"),d=r.n(u),p=r("a026"),h=r("830a");p["default"].prototype.moment=d.a;var l={name:"RecipeCard",mixins:[s["b"]],components:{LastCooked:h["a"],RecipeRating:c["a"],Keywords:a["a"],RecipeContextMenu:o["a"]},props:{recipe:Object,meal_plan:Object,footer_text:String,footer_icon:String},data:function(){return{recipe_image:""}},mounted:function(){null==this.recipe||null===this.recipe.image?this.recipe_image=window.IMAGE_PLACEHOLDER:this.recipe_image=this.recipe.image},methods:{clickUrl:function(){return null!==this.recipe?Object(s["g"])("view_recipe",this.recipe.id):Object(s["g"])("view_plan_entry",this.meal_plan.id)}},directives:{hover:{inserted:function(e){e.addEventListener("mouseenter",(function(){e.classList.add("shadow")})),e.addEventListener("mouseleave",(function(){e.classList.remove("shadow")}))}}}},b=l,f=r("2877"),j=Object(f["a"])(b,n,i,!1,null,"354baad6",null);t["a"]=j.exports},"6ce2":function(e){e.exports=JSON.parse('{"Import":"Importieren","import_running":"Import läuft, bitte warten!","Import_finished":"Import fertig","View_Recipes":"Rezepte Ansehen","Information":"Information","all_fields_optional":"Alle Felder sind optional und können leer gelassen werden.","convert_internal":"Zu internem Rezept wandeln","Log_Recipe_Cooking":"Kochen protokollieren","External_Recipe_Image":"Externes Rezept Bild","Add_to_Book":"Zu Buch hinzufügen","Add_to_Shopping":"Zu Einkaufsliste hinzufügen","Add_to_Plan":"Zu Plan hinzufügen","Step_start_time":"Schritt Startzeit","Select_Book":"Buch wählen","Recipe_Image":"Rezept Bild","Log_Cooking":"Kochen protokollieren","Proteins":"Proteine","Fats":"Fette","Carbohydrates":"Kohlenhydrate","Calories":"Kalorien","Nutrition":"Nährwerte","Keywords":"Stichwörter","Books":"Bücher","show_only_internal":"Nur interne Rezepte anzeigen","Ingredients":"Zutaten","min":"Min","Servings":"Portionen","Waiting":"Wartezeit","Preparation":"Vorbereitung","Edit":"Bearbeiten","Open":"Öffnen","Save":"Speichern","Step":"Schritt","Search":"Suchen","Print":"Drucken","New_Recipe":"Neues Rezept","Url_Import":"URL Import","Reset_Search":"Suche zurücksetzen","or":"oder","and":"und","Recently_Viewed":"Kürzlich angesehen","External":"Extern","Settings":"Einstellungen","Meal_Plan":"Speiseplan","Date":"Datum","Share":"Teilen","Export":"Exportieren","Rating":"Bewertung","Close":"Schließen","Add":"Hinzufügen","Copy":"Kopieren","New":"Neu","Categories":"Kategorien","Category":"Kategorie","Selected":"Ausgewählt","Supermarket":"Supermarkt","Files":"Dateien","Size":"Größe","success_fetching_resource":"Ressource erfolgreich abgerufen!","Download":"Herunterladen","Success":"Erfolgreich","err_fetching_resource":"Ein Fehler trat während dem Abrufen einer Ressource auf!","err_creating_resource":"Ein Fehler trat während dem Erstellen einer Ressource auf!","err_updating_resource":"Ein Fehler trat während dem Aktualisieren einer Ressource auf!","success_creating_resource":"Ressource erfolgreich erstellt!","success_updating_resource":"Ressource erfolgreich aktualisiert!","File":"Datei","Delete":"Löschen","err_deleting_resource":"Ein Fehler trat während dem Löschen einer Ressource auf!","Cancel":"Abbrechen","success_deleting_resource":"Ressource erfolgreich gelöscht!","Load_More":"Mehr laden","Ok":"Öffnen"}')},7432:function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("multiselect",{attrs:{options:e.objects,"close-on-select":!0,"clear-on-select":!0,"hide-selected":!0,"preserve-search":!0,placeholder:e.placeholder,label:e.label,"track-by":"id",multiple:e.multiple,loading:e.loading},on:{"search-change":e.search,input:e.selectionChanged},model:{value:e.selected_objects,callback:function(t){e.selected_objects=t},expression:"selected_objects"}})},i=[],o=(r("ac1f"),r("841c"),r("99af"),r("8e5f")),a=r.n(o),s=r("2b2d"),c={name:"GenericMultiselect",components:{Multiselect:a.a},data:function(){return{loading:!1,objects:[],selected_objects:[]}},props:{placeholder:String,search_function:String,label:String,parent_variable:{type:String,default:void 0},sticky_options:{type:Array,default:function(){return[]}},initial_selection:{type:Array,default:function(){return[]}},multiple:{type:Boolean,default:!0},tree_api:{type:Boolean,default:!1}},watch:{initial_selection:function(e,t){this.selected_objects=e}},mounted:function(){this.search("")},methods:{search:function(e){var t=this,r=new s["a"];if(this.tree_api){var n=1,i=void 0,o=void 0,a=10;""===e&&(e=void 0),r[this.search_function](e,i,o,n,a).then((function(e){t.objects=t.sticky_options.concat(e.data.results)}))}else r[this.search_function]({query:{query:e,limit:10}}).then((function(e){t.objects=t.sticky_options.concat(e.data)}))},selectionChanged:function(){this.$emit("change",{var:this.parent_variable,val:this.selected_objects})}}},u=c,d=r("2877"),p=Object(d["a"])(u,n,i,!1,null,"abc99b66",null);t["a"]=p.exports},"7c15":function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"d",(function(){return s})),r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return u}));var n=r("bc3a"),i=r.n(n),o=r("fa7d");function a(e){var t=Object(o["g"])("api:recipe-detail",e);return void 0!==window.SHARE_UID&&(t+="?share="+window.SHARE_UID),i.a.get(t).then((function(e){return e.data})).catch((function(e){d(e,"There was an error loading a resource!","danger")}))}function s(e){return i.a.post(Object(o["g"])("api:cooklog-list"),e).then((function(e){Object(o["f"])("Saved","Cook Log entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function c(e){return i.a.get(Object(o["g"])("api:recipebook-list")+"?query="+e).then((function(e){return e.data})).catch((function(e){}))}function u(e){return i.a.post(Object(o["g"])("api:recipebookentry-list"),e).then((function(e){Object(o["f"])("Saved","Recipe Book entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function d(e,t){if("response"in e){console.log(e.response);var r="statusText"in e.response?e.response.statusText:Object(o["e"])("Error");t+="\n\n"+JSON.stringify(e.response.data),Object(o["f"])(r,t,"danger")}else Object(o["f"])("Error",t,"danger"),console.log(e)}i.a.defaults.xsrfCookieName="csrftoken",i.a.defaults.xsrfHeaderName="X-CSRFTOKEN"},"81d5":function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.recipe.keywords.length>0?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"}')},c77a:function(e,t,r){"use strict";r("1de6")},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("Add_to_Book"),"ok-title":e.$t("Add"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.addToBook()}}},[r("multiselect",{attrs:{options:e.books,"preserve-search":!0,placeholder:e.$t("Select_Book"),label:"name","track-by":"id",id:"id_books",multiple:!1},on:{"search-change":e.loadBook},model:{value:e.selected_book,callback:function(t){e.selected_book=t},expression:"selected_book"}})],1)],1)},i=[],o=(r("a9e3"),r("8e5f")),a=r.n(o),s=r("c1df"),c=r.n(s),u=r("a026"),d=r("5f5b"),p=r("7c15");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:[],selected_book:null}},mounted:function(){this.loadBook("")},methods:{loadBook:function(e){var t=this;Object(p["b"])(e).then((function(e){t.books=e}))},addToBook:function(){Object(p["a"])({recipe:this.recipe.id,book:this.selected_book.id})}}},l=h,b=(r("60bc"),r("2877")),f=Object(b["a"])(l,n,i,!1,null,null,null);t["a"]=f.exports},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_Book":"Add to Book","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","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","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","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}.","Download":"Download","Root":"Root"}')},fa7d:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"f",(function(){return s})),r.d(t,"a",(function(){return c})),r.d(t,"e",(function(){return u})),r.d(t,"b",(function(){return d})),r.d(t,"g",(function(){return p})),r.d(t,"d",(function(){return l}));var n=r("53ca"),i=(r("99af"),r("59e4"));function o(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 a={methods:{makeToast:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return s(e,t,r)}}};function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=new i["a"];n.$bvToast.toast(t,{title:e,variant:r,toaster:"b-toaster-top-center",solid:!0})}var c={methods:{_:function(e){return u(e)}}};function u(e){return window.gettext(e)}var d={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(e,t)}}};function p(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 h(e){return window.USER_PREF[e]}function l(e,t){if(h("use_fractions")){var r="",n=o(e*t,9,!0);return n[0]>0&&(r+=n[0]),n[1]>0&&(r+=" ".concat(n[1],"").concat(n[2],"")),r}return b(e*t)}function b(e){var t=h("user_fractions")?h("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("Add_to_Book"))+" ")])]),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"),h=r("7c15");d["default"].prototype.moment=u.a,d["default"].use(p["a"]);var l={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(h["d"])(this.logObject)}}},b=l,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["g"])("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["f"])(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)}}},w=y,k=Object(f["a"])(w,n,i,!1,null,null,null);t["a"]=k.exports}}); \ No newline at end of file +(function(e){function t(t){for(var n,a,s=t[0],c=t[1],u=t[2],p=0,h=[];p0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(){return{width:0,height:0,top:t,right:e,bottom:t,left:e}}},closeMenu:function(){this.show_menu=!1}}},y=g,w=(r("c77a"),r("2877")),k=Object(w["a"])(y,b,f,!1,null,"54d4941f",null),S=k.exports,_=r("7432"),P=r("e166"),U=r.n(P),R=r("ad23"),C=r("34ef"),L=r("0d08");c.a.defaults.xsrfCookieName="csrftoken",c.a.defaults.xsrfHeaderName="X-CSRFTOKEN",n["default"].use(u["a"]);var E={name:"KeywordListView",mixins:[h["b"]],components:{TwemojiTextarea:R["a"],KeywordCard:S,GenericMultiselect:_["a"],InfiniteLoading:U.a},computed:{emojiDataAll:function(){return C},emojiGroups:function(){return L}},data:function(){return{keywords:[],keywords2:[],show_split:!1,search_input:"",search_input2:"",advanced_visible:!1,right_page:0,right:+new Date,isDirtyRight:!1,left_page:0,left:+new Date,isDirtyLeft:!1,this_item:{id:-1,name:"",description:"",icon:"",target:{id:-1,name:""}}}},watch:{search_input:p()((function(){this.left_page=0,this.keywords=[],this.left+=1}),700),search_input2:p()((function(){this.right_page=0,this.keywords2=[],this.right+=1}),700)},methods:{makeToast:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.$bvToast.toast(t,{title:e,variant:r,toaster:"b-toaster-top-center",solid:!0})},resetSearch:function(){""!==this.search_input?this.search_input="":(this.left_page=0,this.keywords=[],this.left+=1),""!==this.search_input2?this.search_input2="":(this.right_page=0,this.keywords2=[],this.right+=1)},startAction:function(e,t){var r=e.target||null,i=e.source||null;"delete"==e.action?(this.this_item=i,this.$bvModal.show("id_modal_keyword_delete")):"new"==e.action?(this.this_item={},this.$bvModal.show("id_modal_keyword_edit")):"edit"==e.action?(this.this_item=i,this.$bvModal.show("id_modal_keyword_edit")):"move"===e.action?(this.this_item=i,null==r?this.$bvModal.show("id_modal_keyword_move"):this.moveKeyword(i.id,r.id)):"merge"===e.action?(this.this_item=i,null==r?this.$bvModal.show("id_modal_keyword_merge"):this.mergeKeyword(e.source.id,e.target.id)):"get-children"===e.action?i.expanded?n["default"].set(i,"expanded",!1):(this.this_item=i,this.getChildren(t,i)):"get-recipes"===e.action&&(i.show_recipes?n["default"].set(i,"show_recipes",!1):(this.this_item=i,this.getRecipes(t,i)))},saveKeyword:function(){var e=this,t=new l["a"],r={name:this.this_item.name,description:this.this_item.description,icon:this.this_item.icon};this.this_item.id?t.partialUpdateKeyword(this.this_item.id,r).then((function(t){e.refreshCard(e.this_item.id),e.this_item={}})).catch((function(t){console.log(t),e.this_item={}})):t.createKeyword(r).then((function(t){e.keywords=[t.data].concat(e.keywords),e.show_split?e.keywords2=[JSON.parse(JSON.stringify(t.data))].concat(e.keywords2):e.keywords2=[],e.this_item={}})).catch((function(t){console.log(t),e.this_item={}}))},delKeyword:function(e){var t=this,r=new l["a"];r.destroyKeyword(e).then((function(r){t.destroyCard(e)})).catch((function(e){console.log(e),t.this_item={}}))},moveKeyword:function(e,t){var r=this,n=new l["a"];n.moveKeyword(String(e),String(t)).then((function(n){if(0===t){var i=r.findKeyword(r.keywords,e)||r.findKeyword(r.keywords2,e);i.parent=null,r.show_split?(r.destroyCard(e),r.keywords=[i].concat(r.keywords),r.keywords2=[JSON.parse(JSON.stringify(i))].concat(r.keywords2)):(r.destroyCard(e),r.keywords=[i].concat(r.keywords),r.keywords2=[])}else r.destroyCard(e),r.refreshCard(t)})).catch((function(e){console.log(e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},mergeKeyword:function(e,t){var r=this,n=new l["a"];n.mergeKeyword(String(e),String(t)).then((function(n){r.destroyCard(e),r.refreshCard(t)})).catch((function(e){console.log("Error",e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},getChildren:function(e,t){var r=this,i=new l["a"],o={},a=void 0,s=void 0,c=t.id,u=void 0,d=200;i.listKeywords(a,c,u,s,d).then((function(i){"left"==e?o=r.findKeyword(r.keywords,t.id):"right"==e&&(o=r.findKeyword(r.keywords2,t.id)),o&&(n["default"].set(o,"children",i.data.results),n["default"].set(o,"expanded",!0),n["default"].set(o,"show_recipes",!1))})).catch((function(e){console.log(e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},getRecipes:function(e,t){var r=this,i=new l["a"],o={},a=200,s=String(t.id);console.log(i.listRecipes),i.listRecipes(void 0,s,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,a,void 0).then((function(i){"left"==e?o=r.findKeyword(r.keywords,t.id):"right"==e&&(o=r.findKeyword(r.keywords2,t.id)),o&&(n["default"].set(o,"recipes",i.data.results),n["default"].set(o,"show_recipes",!0),n["default"].set(o,"expanded",!1))})).catch((function(e){console.log(e),r.makeToast(r.$t("Error"),e.bodyText,"danger")}))},refreshCard:function(e){var t=this,r={},i=new l["a"],o=void 0,a=void 0;i.retrieveKeyword(e).then((function(i){if(r=t.findKeyword(t.keywords,e)||t.findKeyword(t.keywords2,e),r.parent){var s=t.findKeyword(t.keywords,r.parent),c=t.findKeyword(t.keywords2,r.parent);s&&s.expanded&&(o=s.children.indexOf(s.children.find((function(e){return e.id===r.id}))),n["default"].set(s.children,o,i.data)),c&&c.expanded&&(a=c.children.indexOf(c.children.find((function(e){return e.id===r.id}))),n["default"].set(c.children,a,JSON.parse(JSON.stringify(i.data))))}else o=t.keywords.indexOf(t.keywords.find((function(e){return e.id===r.id}))),a=t.keywords2.indexOf(t.keywords2.find((function(e){return e.id===r.id}))),n["default"].set(t.keywords,o,i.data),n["default"].set(t.keywords2,a,JSON.parse(JSON.stringify(i.data)))}))},findKeyword:function(e,t){if(0==e.length)return!1;var r=e.filter((function(e){return e.id==t}));if(1==r.length)return r[0];if(0==r.length){var n,i=Object(a["a"])(e.filter((function(e){return 1==e.expanded})));try{for(i.s();!(n=i.n()).done;){var o=n.value;if(r=this.findKeyword(o.children,t),r)return r}}catch(s){i.e(s)}finally{i.f()}}else console.log("something terrible happened")},prepareEmoji:function(){this.$refs._edit.addText(this.this_item.icon||""),this.$refs._edit.blur(),document.getElementById("btn-emoji-default").disabled=!0},setIcon:function(e){this.this_item.icon=e},infiniteHandler:function(e,t){var r=this,n=new l["a"],i="left"===t?this.search_input:this.search_input2,o="left"===t?this.left_page+1:this.right_page+1,a=void 0,s=void 0,c=void 0;""===i&&(i=void 0,a=0),n.listKeywords(i,a,s,o,c).then((function(n){n.data.results.length?"left"===t?(r.left_page+=1,r.keywords=r.keywords.concat(n.data.results),e.loaded(),r.keywords.length>=n.data.count&&e.complete()):"right"===t&&(r.right_page+=1,r.keywords2=r.keywords2.concat(n.data.results),e.loaded(),r.keywords2.length>=n.data.count&&e.complete()):(console.log("no data returned"),e.complete())})).catch((function(t){console.log(t),r.makeToast(r.$t("Error"),t.bodyText,"danger"),e.complete()}))},destroyCard:function(e){var t=this.findKeyword(this.keywords,e),r=this.findKeyword(this.keywords2,e),i=void 0;if(t?i=t.parent:r&&(i=r.parent),i){var o=this.findKeyword(this.keywords,i),a=this.findKeyword(this.keywords2,i);if(o&&(n["default"].set(o,"numchild",o.numchild-1),o.expanded)){var s=o.children.indexOf(o.children.find((function(t){return t.id===e})));n["default"].delete(o.children,s)}if(a&&(n["default"].set(a,"numchild",a.numchild-1),a.expanded)){var c=a.children.indexOf(a.children.find((function(t){return t.id===e})));n["default"].delete(a.children,c)}}this.keywords=this.keywords.filter((function(t){return t.id!=e})),this.keywords2=this.keywords2.filter((function(t){return t.id!=e}))}}},T=E,x=(r("60bc"),Object(w["a"])(T,i,o,!1,null,null,null)),I=x.exports,B=r("9225");n["default"].config.productionTip=!1,new n["default"]({i18n:B["a"],render:function(e){return e(I)}}).$mount("#app")},"6b0a":function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("b-card",{directives:[{name:"hover",rawName:"v-hover"}],attrs:{"no-body":""}},[r("a",{attrs:{href:e.clickUrl()}},[r("b-card-img-lazy",{staticStyle:{height:"15vh","object-fit":"cover"},attrs:{src:e.recipe_image,alt:e.$t("Recipe_Image"),top:""}}),r("div",{staticClass:"card-img-overlay h-100 d-flex flex-column justify-content-right",staticStyle:{float:"right","text-align":"right","padding-top":"10px","padding-right":"5px"}},[r("a",[null!==e.recipe?r("recipe-context-menu",{staticStyle:{float:"right"},attrs:{recipe:e.recipe}}):e._e()],1)])],1),r("b-card-body",{staticClass:"p-4"},[r("h6",[r("a",{attrs:{href:e.clickUrl()}},[null!==e.recipe?[e._v(e._s(e.recipe.name))]:[e._v(e._s(e.meal_plan.title))]],2)]),r("b-card-text",{staticStyle:{"text-overflow":"ellipsis"}},[null!==e.recipe?[r("recipe-rating",{attrs:{recipe:e.recipe}}),null!==e.recipe.description?[e.recipe.description.length>120?r("span",[e._v(" "+e._s(e.recipe.description.substr(0,120)+"…")+" ")]):e._e(),e.recipe.description.length<=120?r("span",[e._v(" "+e._s(e.recipe.description)+" ")]):e._e()]:e._e(),r("br"),e._v(" "),r("last-cooked",{attrs:{recipe:e.recipe}}),r("keywords",{staticStyle:{"margin-top":"4px"},attrs:{recipe:e.recipe}}),e.recipe.internal?e._e():r("b-badge",{attrs:{pill:"",variant:"info"}},[e._v(e._s(e.$t("External")))]),Date.parse(e.recipe.created_at)>new Date(Date.now()-6048e5)?r("b-badge",{attrs:{pill:"",variant:"success"}},[e._v(" "+e._s(e.$t("New"))+" ")]):e._e()]:[e._v(e._s(e.meal_plan.note))]],2)],1),void 0!==e.footer_text?r("b-card-footer",[r("i",{class:e.footer_icon}),e._v(" "+e._s(e.footer_text)+" ")]):e._e()],1)},i=[],o=r("fc0d"),a=r("81d5"),s=r("fa7d"),c=r("ca5b"),u=r("c1df"),d=r.n(u),p=r("a026"),h=r("830a");p["default"].prototype.moment=d.a;var l={name:"RecipeCard",mixins:[s["b"]],components:{LastCooked:h["a"],RecipeRating:c["a"],Keywords:a["a"],RecipeContextMenu:o["a"]},props:{recipe:Object,meal_plan:Object,footer_text:String,footer_icon:String},data:function(){return{recipe_image:""}},mounted:function(){null==this.recipe||null===this.recipe.image?this.recipe_image=window.IMAGE_PLACEHOLDER:this.recipe_image=this.recipe.image},methods:{clickUrl:function(){return null!==this.recipe?Object(s["g"])("view_recipe",this.recipe.id):Object(s["g"])("view_plan_entry",this.meal_plan.id)}},directives:{hover:{inserted:function(e){e.addEventListener("mouseenter",(function(){e.classList.add("shadow")})),e.addEventListener("mouseleave",(function(){e.classList.remove("shadow")}))}}}},b=l,f=r("2877"),j=Object(f["a"])(b,n,i,!1,null,"354baad6",null);t["a"]=j.exports},"6ce2":function(e){e.exports=JSON.parse('{"Import":"Importieren","import_running":"Import läuft, bitte warten!","Import_finished":"Import fertig","View_Recipes":"Rezepte Ansehen","Information":"Information","all_fields_optional":"Alle Felder sind optional und können leer gelassen werden.","convert_internal":"Zu internem Rezept wandeln","Log_Recipe_Cooking":"Kochen protokollieren","External_Recipe_Image":"Externes Rezept Bild","Add_to_Book":"Zu Buch hinzufügen","Add_to_Shopping":"Zu Einkaufsliste hinzufügen","Add_to_Plan":"Zu Plan hinzufügen","Step_start_time":"Schritt Startzeit","Select_Book":"Buch wählen","Recipe_Image":"Rezept Bild","Log_Cooking":"Kochen protokollieren","Proteins":"Proteine","Fats":"Fette","Carbohydrates":"Kohlenhydrate","Calories":"Kalorien","Nutrition":"Nährwerte","Keywords":"Stichwörter","Books":"Bücher","show_only_internal":"Nur interne Rezepte anzeigen","Ingredients":"Zutaten","min":"Min","Servings":"Portionen","Waiting":"Wartezeit","Preparation":"Vorbereitung","Edit":"Bearbeiten","Open":"Öffnen","Save":"Speichern","Step":"Schritt","Search":"Suchen","Print":"Drucken","New_Recipe":"Neues Rezept","Url_Import":"URL Import","Reset_Search":"Suche zurücksetzen","or":"oder","and":"und","Recently_Viewed":"Kürzlich angesehen","External":"Extern","Settings":"Einstellungen","Meal_Plan":"Speiseplan","Date":"Datum","Share":"Teilen","Export":"Exportieren","Rating":"Bewertung","Close":"Schließen","Add":"Hinzufügen","Copy":"Kopieren","New":"Neu","Categories":"Kategorien","Category":"Kategorie","Selected":"Ausgewählt","Supermarket":"Supermarkt","Files":"Dateien","Size":"Größe","success_fetching_resource":"Ressource erfolgreich abgerufen!","Download":"Herunterladen","Success":"Erfolgreich","err_fetching_resource":"Ein Fehler trat während dem Abrufen einer Ressource auf!","err_creating_resource":"Ein Fehler trat während dem Erstellen einer Ressource auf!","err_updating_resource":"Ein Fehler trat während dem Aktualisieren einer Ressource auf!","success_creating_resource":"Ressource erfolgreich erstellt!","success_updating_resource":"Ressource erfolgreich aktualisiert!","File":"Datei","Delete":"Löschen","err_deleting_resource":"Ein Fehler trat während dem Löschen einer Ressource auf!","Cancel":"Abbrechen","success_deleting_resource":"Ressource erfolgreich gelöscht!","Load_More":"Mehr laden","Ok":"Öffnen"}')},7432:function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("multiselect",{attrs:{options:e.objects,"close-on-select":!0,"clear-on-select":!0,"hide-selected":!0,"preserve-search":!0,placeholder:e.placeholder,label:e.label,"track-by":"id",multiple:e.multiple,loading:e.loading},on:{"search-change":e.search,input:e.selectionChanged},model:{value:e.selected_objects,callback:function(t){e.selected_objects=t},expression:"selected_objects"}})},i=[],o=(r("ac1f"),r("841c"),r("99af"),r("8e5f")),a=r.n(o),s=r("2b2d"),c={name:"GenericMultiselect",components:{Multiselect:a.a},data:function(){return{loading:!1,objects:[],selected_objects:[]}},props:{placeholder:String,search_function:String,label:String,parent_variable:{type:String,default:void 0},sticky_options:{type:Array,default:function(){return[]}},initial_selection:{type:Array,default:function(){return[]}},multiple:{type:Boolean,default:!0},tree_api:{type:Boolean,default:!1}},watch:{initial_selection:function(e,t){this.selected_objects=e}},mounted:function(){this.search("")},methods:{search:function(e){var t=this,r=new s["a"];if(this.tree_api){var n=1,i=void 0,o=void 0,a=10;""===e&&(e=void 0),r[this.search_function](e,i,o,n,a).then((function(e){t.objects=t.sticky_options.concat(e.data.results)}))}else r[this.search_function]({query:{query:e,limit:10}}).then((function(e){t.objects=t.sticky_options.concat(e.data)}))},selectionChanged:function(){this.$emit("change",{var:this.parent_variable,val:this.selected_objects})}}},u=c,d=r("2877"),p=Object(d["a"])(u,n,i,!1,null,"abc99b66",null);t["a"]=p.exports},"7c15":function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"d",(function(){return s})),r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return u}));var n=r("bc3a"),i=r.n(n),o=r("fa7d");function a(e){var t=Object(o["g"])("api:recipe-detail",e);return void 0!==window.SHARE_UID&&(t+="?share="+window.SHARE_UID),i.a.get(t).then((function(e){return e.data})).catch((function(e){d(e,"There was an error loading a resource!","danger")}))}function s(e){return i.a.post(Object(o["g"])("api:cooklog-list"),e).then((function(e){Object(o["f"])("Saved","Cook Log entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function c(e){return i.a.get(Object(o["g"])("api:recipebook-list")+"?query="+e).then((function(e){return e.data})).catch((function(e){}))}function u(e){return i.a.post(Object(o["g"])("api:recipebookentry-list"),e).then((function(e){Object(o["f"])("Saved","Recipe Book entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function d(e,t){if("response"in e){console.log(e.response);var r="statusText"in e.response?e.response.statusText:Object(o["e"])("Error");t+="\n\n"+JSON.stringify(e.response.data),Object(o["f"])(r,t,"danger")}else Object(o["f"])("Error",t,"danger"),console.log(e)}i.a.defaults.xsrfCookieName="csrftoken",i.a.defaults.xsrfHeaderName="X-CSRFTOKEN"},"81d5":function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.recipe.keywords.length>0?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"}')},c77a:function(e,t,r){"use strict";r("1de6")},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("Add_to_Book"),"ok-title":e.$t("Add"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.addToBook()}}},[r("multiselect",{attrs:{options:e.books,"preserve-search":!0,placeholder:e.$t("Select_Book"),label:"name","track-by":"id",id:"id_books",multiple:!1},on:{"search-change":e.loadBook},model:{value:e.selected_book,callback:function(t){e.selected_book=t},expression:"selected_book"}})],1)],1)},i=[],o=(r("a9e3"),r("8e5f")),a=r.n(o),s=r("c1df"),c=r.n(s),u=r("a026"),d=r("5f5b"),p=r("7c15");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:[],selected_book:null}},mounted:function(){this.loadBook("")},methods:{loadBook:function(e){var t=this;Object(p["b"])(e).then((function(e){t.books=e}))},addToBook:function(){Object(p["a"])({recipe:this.recipe.id,book:this.selected_book.id})}}},l=h,b=(r("60bc"),r("2877")),f=Object(b["a"])(l,n,i,!1,null,null,null);t["a"]=f.exports},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_Book":"Add to Book","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","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","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","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}.","Download":"Download","Root":"Root"}')},fa7d:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"f",(function(){return s})),r.d(t,"a",(function(){return c})),r.d(t,"e",(function(){return u})),r.d(t,"b",(function(){return d})),r.d(t,"g",(function(){return p})),r.d(t,"d",(function(){return l}));var n=r("53ca"),i=(r("99af"),r("59e4"));function o(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 a={methods:{makeToast:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return s(e,t,r)}}};function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=new i["a"];n.$bvToast.toast(t,{title:e,variant:r,toaster:"b-toaster-top-center",solid:!0})}var c={methods:{_:function(e){return u(e)}}};function u(e){return window.gettext(e)}var d={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(e,t)}}};function p(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 h(e){return window.USER_PREF[e]}function l(e,t){if(h("use_fractions")){var r="",n=o(e*t,9,!0);return n[0]>0&&(r+=n[0]),n[1]>0&&(r+=" ".concat(n[1],"").concat(n[2],"")),r}return b(e*t)}function b(e){var t=h("user_fractions")?h("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("Add_to_Book"))+" ")])]),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"),h=r("7c15");d["default"].prototype.moment=u.a,d["default"].use(p["a"]);var l={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(h["d"])(this.logObject)}}},b=l,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["g"])("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["f"])(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)}}},w=y,k=Object(f["a"])(w,n,i,!1,null,null,null);t["a"]=k.exports}}); \ No newline at end of file diff --git a/cookbook/static/vue/js/recipe_search_view.js b/cookbook/static/vue/js/recipe_search_view.js index a22268fe..19819948 100644 --- a/cookbook/static/vue/js/recipe_search_view.js +++ b/cookbook/static/vue/js/recipe_search_view.js @@ -1 +1 @@ -(function(e){function t(t){for(var n,a,s=t[0],c=t[1],u=t[2],p=0,h=[];p0?t.listRecipes(void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,this.settings.sort_by_new,1,this.settings.recently_viewed,{query:{last_viewed:this.settings.recently_viewed}}).then((function(t){e.last_viewed_recipes=t.data.results})):this.last_viewed_recipes=[]},genericSelectChanged:function(e){this.settings[e.var]=e.val,this.refreshData(!1)},resetSearch:function(){this.settings.search_input="",this.settings.search_internal=!1,this.settings.search_keywords=[],this.settings.search_foods=[],this.settings.search_books=[],this.settings.pagination_page=1,this.refreshData(!1)},pageChange:function(e){this.settings.pagination_page=e,this.refreshData(!1)},isAdvancedSettingsSet:function(){return this.settings.search_keywords.length+this.settings.search_foods.length+this.settings.search_books.length>0},normalizer:function(e){return{id:e.id,label:e.name+" ("+e.count+")",children:e.children,isDefaultExpanded:e.isDefaultExpanded}}}},S=y,_=(r("60bc"),r("2877")),w=Object(_["a"])(S,i,o,!1,null,null,null),k=w.exports,P=r("9225");n["default"].config.productionTip=!1,new n["default"]({i18n:P["a"],render:function(e){return e(k)}}).$mount("#app")},"6b0a":function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("b-card",{directives:[{name:"hover",rawName:"v-hover"}],attrs:{"no-body":""}},[r("a",{attrs:{href:e.clickUrl()}},[r("b-card-img-lazy",{staticStyle:{height:"15vh","object-fit":"cover"},attrs:{src:e.recipe_image,alt:e.$t("Recipe_Image"),top:""}}),r("div",{staticClass:"card-img-overlay h-100 d-flex flex-column justify-content-right",staticStyle:{float:"right","text-align":"right","padding-top":"10px","padding-right":"5px"}},[r("a",[null!==e.recipe?r("recipe-context-menu",{staticStyle:{float:"right"},attrs:{recipe:e.recipe}}):e._e()],1)])],1),r("b-card-body",{staticClass:"p-4"},[r("h6",[r("a",{attrs:{href:e.clickUrl()}},[null!==e.recipe?[e._v(e._s(e.recipe.name))]:[e._v(e._s(e.meal_plan.title))]],2)]),r("b-card-text",{staticStyle:{"text-overflow":"ellipsis"}},[null!==e.recipe?[r("recipe-rating",{attrs:{recipe:e.recipe}}),null!==e.recipe.description?[e.recipe.description.length>120?r("span",[e._v(" "+e._s(e.recipe.description.substr(0,120)+"…")+" ")]):e._e(),e.recipe.description.length<=120?r("span",[e._v(" "+e._s(e.recipe.description)+" ")]):e._e()]:e._e(),r("br"),e._v(" "),r("last-cooked",{attrs:{recipe:e.recipe}}),r("keywords",{staticStyle:{"margin-top":"4px"},attrs:{recipe:e.recipe}}),e.recipe.internal?e._e():r("b-badge",{attrs:{pill:"",variant:"info"}},[e._v(e._s(e.$t("External")))]),Date.parse(e.recipe.created_at)>new Date(Date.now()-6048e5)?r("b-badge",{attrs:{pill:"",variant:"success"}},[e._v(" "+e._s(e.$t("New"))+" ")]):e._e()]:[e._v(e._s(e.meal_plan.note))]],2)],1),void 0!==e.footer_text?r("b-card-footer",[r("i",{class:e.footer_icon}),e._v(" "+e._s(e.footer_text)+" ")]):e._e()],1)},i=[],o=r("fc0d"),a=r("81d5"),s=r("fa7d"),c=r("ca5b"),u=r("c1df"),d=r.n(u),p=r("a026"),h=r("830a");p["default"].prototype.moment=d.a;var l={name:"RecipeCard",mixins:[s["b"]],components:{LastCooked:h["a"],RecipeRating:c["a"],Keywords:a["a"],RecipeContextMenu:o["a"]},props:{recipe:Object,meal_plan:Object,footer_text:String,footer_icon:String},data:function(){return{recipe_image:""}},mounted:function(){null==this.recipe||null===this.recipe.image?this.recipe_image=window.IMAGE_PLACEHOLDER:this.recipe_image=this.recipe.image},methods:{clickUrl:function(){return null!==this.recipe?Object(s["g"])("view_recipe",this.recipe.id):Object(s["g"])("view_plan_entry",this.meal_plan.id)}},directives:{hover:{inserted:function(e){e.addEventListener("mouseenter",(function(){e.classList.add("shadow")})),e.addEventListener("mouseleave",(function(){e.classList.remove("shadow")}))}}}},b=l,f=r("2877"),j=Object(f["a"])(b,n,i,!1,null,"354baad6",null);t["a"]=j.exports},"6ce2":function(e){e.exports=JSON.parse('{"Import":"Importieren","import_running":"Import läuft, bitte warten!","Import_finished":"Import fertig","View_Recipes":"Rezepte Ansehen","Information":"Information","all_fields_optional":"Alle Felder sind optional und können leer gelassen werden.","convert_internal":"Zu internem Rezept wandeln","Log_Recipe_Cooking":"Kochen protokollieren","External_Recipe_Image":"Externes Rezept Bild","Add_to_Book":"Zu Buch hinzufügen","Add_to_Shopping":"Zu Einkaufsliste hinzufügen","Add_to_Plan":"Zu Plan hinzufügen","Step_start_time":"Schritt Startzeit","Select_Book":"Buch wählen","Recipe_Image":"Rezept Bild","Log_Cooking":"Kochen protokollieren","Proteins":"Proteine","Fats":"Fette","Carbohydrates":"Kohlenhydrate","Calories":"Kalorien","Nutrition":"Nährwerte","Keywords":"Stichwörter","Books":"Bücher","show_only_internal":"Nur interne Rezepte anzeigen","Ingredients":"Zutaten","min":"Min","Servings":"Portionen","Waiting":"Wartezeit","Preparation":"Vorbereitung","Edit":"Bearbeiten","Open":"Öffnen","Save":"Speichern","Step":"Schritt","Search":"Suchen","Print":"Drucken","New_Recipe":"Neues Rezept","Url_Import":"URL Import","Reset_Search":"Suche zurücksetzen","or":"oder","and":"und","Recently_Viewed":"Kürzlich angesehen","External":"Extern","Settings":"Einstellungen","Meal_Plan":"Speiseplan","Date":"Datum","Share":"Teilen","Export":"Exportieren","Rating":"Bewertung","Close":"Schließen","Add":"Hinzufügen","Copy":"Kopieren","New":"Neu","Categories":"Kategorien","Category":"Kategorie","Selected":"Ausgewählt","Supermarket":"Supermarkt","Files":"Dateien","Size":"Größe","success_fetching_resource":"Ressource erfolgreich abgerufen!","Download":"Herunterladen","Success":"Erfolgreich","err_fetching_resource":"Ein Fehler trat während dem Abrufen einer Ressource auf!","err_creating_resource":"Ein Fehler trat während dem Erstellen einer Ressource auf!","err_updating_resource":"Ein Fehler trat während dem Aktualisieren einer Ressource auf!","success_creating_resource":"Ressource erfolgreich erstellt!","success_updating_resource":"Ressource erfolgreich aktualisiert!","File":"Datei","Delete":"Löschen","err_deleting_resource":"Ein Fehler trat während dem Löschen einer Ressource auf!","Cancel":"Abbrechen","success_deleting_resource":"Ressource erfolgreich gelöscht!","Load_More":"Mehr laden","Ok":"Öffnen"}')},7432:function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("multiselect",{attrs:{options:e.objects,"close-on-select":!0,"clear-on-select":!0,"hide-selected":!0,"preserve-search":!0,placeholder:e.placeholder,label:e.label,"track-by":"id",multiple:e.multiple,loading:e.loading},on:{"search-change":e.search,input:e.selectionChanged},model:{value:e.selected_objects,callback:function(t){e.selected_objects=t},expression:"selected_objects"}})},i=[],o=(r("ac1f"),r("841c"),r("99af"),r("8e5f")),a=r.n(o),s=r("2b2d"),c={name:"GenericMultiselect",components:{Multiselect:a.a},data:function(){return{loading:!1,objects:[],selected_objects:[]}},props:{placeholder:String,search_function:String,label:String,parent_variable:{type:String,default:void 0},sticky_options:{type:Array,default:function(){return[]}},initial_selection:{type:Array,default:function(){return[]}},multiple:{type:Boolean,default:!0},tree_api:{type:Boolean,default:!1}},watch:{initial_selection:function(e,t){this.selected_objects=e}},mounted:function(){this.search("")},methods:{search:function(e){var t=this,r=new s["a"];if(this.tree_api){var n=1,i=void 0,o=void 0,a=10;""===e&&(e=void 0),r[this.search_function](e,i,o,n,a).then((function(e){t.objects=t.sticky_options.concat(e.data.results)}))}else r[this.search_function]({query:{query:e,limit:10}}).then((function(e){t.objects=t.sticky_options.concat(e.data)}))},selectionChanged:function(){this.$emit("change",{var:this.parent_variable,val:this.selected_objects})}}},u=c,d=r("2877"),p=Object(d["a"])(u,n,i,!1,null,"abc99b66",null);t["a"]=p.exports},"7c15":function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"d",(function(){return s})),r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return u}));var n=r("bc3a"),i=r.n(n),o=r("fa7d");function a(e){var t=Object(o["g"])("api:recipe-detail",e);return void 0!==window.SHARE_UID&&(t+="?share="+window.SHARE_UID),i.a.get(t).then((function(e){return e.data})).catch((function(e){d(e,"There was an error loading a resource!","danger")}))}function s(e){return i.a.post(Object(o["g"])("api:cooklog-list"),e).then((function(e){Object(o["f"])("Saved","Cook Log entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function c(e){return i.a.get(Object(o["g"])("api:recipebook-list")+"?query="+e).then((function(e){return e.data})).catch((function(e){}))}function u(e){return i.a.post(Object(o["g"])("api:recipebookentry-list"),e).then((function(e){Object(o["f"])("Saved","Recipe Book entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function d(e,t){if("response"in e){console.log(e.response);var r="statusText"in e.response?e.response.statusText:Object(o["e"])("Error");t+="\n\n"+JSON.stringify(e.response.data),Object(o["f"])(r,t,"danger")}else Object(o["f"])("Error",t,"danger"),console.log(e)}i.a.defaults.xsrfCookieName="csrftoken",i.a.defaults.xsrfHeaderName="X-CSRFTOKEN"},"81d5":function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.recipe.keywords.length>0?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"}')},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("Add_to_Book"),"ok-title":e.$t("Add"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.addToBook()}}},[r("multiselect",{attrs:{options:e.books,"preserve-search":!0,placeholder:e.$t("Select_Book"),label:"name","track-by":"id",id:"id_books",multiple:!1},on:{"search-change":e.loadBook},model:{value:e.selected_book,callback:function(t){e.selected_book=t},expression:"selected_book"}})],1)],1)},i=[],o=(r("a9e3"),r("8e5f")),a=r.n(o),s=r("c1df"),c=r.n(s),u=r("a026"),d=r("5f5b"),p=r("7c15");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:[],selected_book:null}},mounted:function(){this.loadBook("")},methods:{loadBook:function(e){var t=this;Object(p["b"])(e).then((function(e){t.books=e}))},addToBook:function(){Object(p["a"])({recipe:this.recipe.id,book:this.selected_book.id})}}},l=h,b=(r("60bc"),r("2877")),f=Object(b["a"])(l,n,i,!1,null,null,null);t["a"]=f.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},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_Book":"Add to Book","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","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","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","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}.","Download":"Download","Root":"Root"}')},fa7d:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"f",(function(){return s})),r.d(t,"a",(function(){return c})),r.d(t,"e",(function(){return u})),r.d(t,"b",(function(){return d})),r.d(t,"g",(function(){return p})),r.d(t,"d",(function(){return l}));var n=r("53ca"),i=(r("99af"),r("59e4"));function o(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 a={methods:{makeToast:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return s(e,t,r)}}};function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=new i["a"];n.$bvToast.toast(t,{title:e,variant:r,toaster:"b-toaster-top-center",solid:!0})}var c={methods:{_:function(e){return u(e)}}};function u(e){return window.gettext(e)}var d={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(e,t)}}};function p(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 h(e){return window.USER_PREF[e]}function l(e,t){if(h("use_fractions")){var r="",n=o(e*t,9,!0);return n[0]>0&&(r+=n[0]),n[1]>0&&(r+=" ".concat(n[1],"").concat(n[2],"")),r}return b(e*t)}function b(e){var t=h("user_fractions")?h("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("Add_to_Book"))+" ")])]),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"),h=r("7c15");d["default"].prototype.moment=u.a,d["default"].use(p["a"]);var l={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(h["d"])(this.logObject)}}},b=l,f=r("2877"),j=Object(f["a"])(b,a,s,!1,null,null,null),O=j.exports,v=r("bc3a"),g=r.n(v),m=r("d46a"),y={name:"RecipeContextMenu",mixins:[o["b"]],components:{AddRecipeToBook:m["a"],CookLog:O},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;g.a.get(Object(o["g"])("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["f"])(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)}}},S=y,_=Object(f["a"])(S,n,i,!1,null,null,null);t["a"]=_.exports}}); \ No newline at end of file +(function(e){function t(t){for(var n,a,s=t[0],c=t[1],u=t[2],p=0,h=[];p0?t.listRecipes(void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,this.settings.sort_by_new,1,this.settings.recently_viewed,{query:{last_viewed:this.settings.recently_viewed}}).then((function(t){e.last_viewed_recipes=t.data.results})):this.last_viewed_recipes=[]},genericSelectChanged:function(e){this.settings[e.var]=e.val,this.refreshData(!1)},resetSearch:function(){this.settings.search_input="",this.settings.search_internal=!1,this.settings.search_keywords=[],this.settings.search_foods=[],this.settings.search_books=[],this.settings.pagination_page=1,this.refreshData(!1)},pageChange:function(e){this.settings.pagination_page=e,this.refreshData(!1)},isAdvancedSettingsSet:function(){return this.settings.search_keywords.length+this.settings.search_foods.length+this.settings.search_books.length>0},normalizer:function(e){return{id:e.id,label:e.name+" ("+e.count+")",children:e.children,isDefaultExpanded:e.isDefaultExpanded}}}},S=y,_=(r("60bc"),r("2877")),w=Object(_["a"])(S,i,o,!1,null,null,null),k=w.exports,P=r("9225");n["default"].config.productionTip=!1,new n["default"]({i18n:P["a"],render:function(e){return e(k)}}).$mount("#app")},"6b0a":function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("b-card",{directives:[{name:"hover",rawName:"v-hover"}],attrs:{"no-body":""}},[r("a",{attrs:{href:e.clickUrl()}},[r("b-card-img-lazy",{staticStyle:{height:"15vh","object-fit":"cover"},attrs:{src:e.recipe_image,alt:e.$t("Recipe_Image"),top:""}}),r("div",{staticClass:"card-img-overlay h-100 d-flex flex-column justify-content-right",staticStyle:{float:"right","text-align":"right","padding-top":"10px","padding-right":"5px"}},[r("a",[null!==e.recipe?r("recipe-context-menu",{staticStyle:{float:"right"},attrs:{recipe:e.recipe}}):e._e()],1)])],1),r("b-card-body",{staticClass:"p-4"},[r("h6",[r("a",{attrs:{href:e.clickUrl()}},[null!==e.recipe?[e._v(e._s(e.recipe.name))]:[e._v(e._s(e.meal_plan.title))]],2)]),r("b-card-text",{staticStyle:{"text-overflow":"ellipsis"}},[null!==e.recipe?[r("recipe-rating",{attrs:{recipe:e.recipe}}),null!==e.recipe.description?[e.recipe.description.length>120?r("span",[e._v(" "+e._s(e.recipe.description.substr(0,120)+"…")+" ")]):e._e(),e.recipe.description.length<=120?r("span",[e._v(" "+e._s(e.recipe.description)+" ")]):e._e()]:e._e(),r("br"),e._v(" "),r("last-cooked",{attrs:{recipe:e.recipe}}),r("keywords",{staticStyle:{"margin-top":"4px"},attrs:{recipe:e.recipe}}),e.recipe.internal?e._e():r("b-badge",{attrs:{pill:"",variant:"info"}},[e._v(e._s(e.$t("External")))]),Date.parse(e.recipe.created_at)>new Date(Date.now()-6048e5)?r("b-badge",{attrs:{pill:"",variant:"success"}},[e._v(" "+e._s(e.$t("New"))+" ")]):e._e()]:[e._v(e._s(e.meal_plan.note))]],2)],1),void 0!==e.footer_text?r("b-card-footer",[r("i",{class:e.footer_icon}),e._v(" "+e._s(e.footer_text)+" ")]):e._e()],1)},i=[],o=r("fc0d"),a=r("81d5"),s=r("fa7d"),c=r("ca5b"),u=r("c1df"),d=r.n(u),p=r("a026"),h=r("830a");p["default"].prototype.moment=d.a;var l={name:"RecipeCard",mixins:[s["b"]],components:{LastCooked:h["a"],RecipeRating:c["a"],Keywords:a["a"],RecipeContextMenu:o["a"]},props:{recipe:Object,meal_plan:Object,footer_text:String,footer_icon:String},data:function(){return{recipe_image:""}},mounted:function(){null==this.recipe||null===this.recipe.image?this.recipe_image=window.IMAGE_PLACEHOLDER:this.recipe_image=this.recipe.image},methods:{clickUrl:function(){return null!==this.recipe?Object(s["g"])("view_recipe",this.recipe.id):Object(s["g"])("view_plan_entry",this.meal_plan.id)}},directives:{hover:{inserted:function(e){e.addEventListener("mouseenter",(function(){e.classList.add("shadow")})),e.addEventListener("mouseleave",(function(){e.classList.remove("shadow")}))}}}},b=l,f=r("2877"),j=Object(f["a"])(b,n,i,!1,null,"354baad6",null);t["a"]=j.exports},"6ce2":function(e){e.exports=JSON.parse('{"Import":"Importieren","import_running":"Import läuft, bitte warten!","Import_finished":"Import fertig","View_Recipes":"Rezepte Ansehen","Information":"Information","all_fields_optional":"Alle Felder sind optional und können leer gelassen werden.","convert_internal":"Zu internem Rezept wandeln","Log_Recipe_Cooking":"Kochen protokollieren","External_Recipe_Image":"Externes Rezept Bild","Add_to_Book":"Zu Buch hinzufügen","Add_to_Shopping":"Zu Einkaufsliste hinzufügen","Add_to_Plan":"Zu Plan hinzufügen","Step_start_time":"Schritt Startzeit","Select_Book":"Buch wählen","Recipe_Image":"Rezept Bild","Log_Cooking":"Kochen protokollieren","Proteins":"Proteine","Fats":"Fette","Carbohydrates":"Kohlenhydrate","Calories":"Kalorien","Nutrition":"Nährwerte","Keywords":"Stichwörter","Books":"Bücher","show_only_internal":"Nur interne Rezepte anzeigen","Ingredients":"Zutaten","min":"Min","Servings":"Portionen","Waiting":"Wartezeit","Preparation":"Vorbereitung","Edit":"Bearbeiten","Open":"Öffnen","Save":"Speichern","Step":"Schritt","Search":"Suchen","Print":"Drucken","New_Recipe":"Neues Rezept","Url_Import":"URL Import","Reset_Search":"Suche zurücksetzen","or":"oder","and":"und","Recently_Viewed":"Kürzlich angesehen","External":"Extern","Settings":"Einstellungen","Meal_Plan":"Speiseplan","Date":"Datum","Share":"Teilen","Export":"Exportieren","Rating":"Bewertung","Close":"Schließen","Add":"Hinzufügen","Copy":"Kopieren","New":"Neu","Categories":"Kategorien","Category":"Kategorie","Selected":"Ausgewählt","Supermarket":"Supermarkt","Files":"Dateien","Size":"Größe","success_fetching_resource":"Ressource erfolgreich abgerufen!","Download":"Herunterladen","Success":"Erfolgreich","err_fetching_resource":"Ein Fehler trat während dem Abrufen einer Ressource auf!","err_creating_resource":"Ein Fehler trat während dem Erstellen einer Ressource auf!","err_updating_resource":"Ein Fehler trat während dem Aktualisieren einer Ressource auf!","success_creating_resource":"Ressource erfolgreich erstellt!","success_updating_resource":"Ressource erfolgreich aktualisiert!","File":"Datei","Delete":"Löschen","err_deleting_resource":"Ein Fehler trat während dem Löschen einer Ressource auf!","Cancel":"Abbrechen","success_deleting_resource":"Ressource erfolgreich gelöscht!","Load_More":"Mehr laden","Ok":"Öffnen"}')},7432:function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("multiselect",{attrs:{options:e.objects,"close-on-select":!0,"clear-on-select":!0,"hide-selected":!0,"preserve-search":!0,placeholder:e.placeholder,label:e.label,"track-by":"id",multiple:e.multiple,loading:e.loading},on:{"search-change":e.search,input:e.selectionChanged},model:{value:e.selected_objects,callback:function(t){e.selected_objects=t},expression:"selected_objects"}})},i=[],o=(r("ac1f"),r("841c"),r("99af"),r("8e5f")),a=r.n(o),s=r("2b2d"),c={name:"GenericMultiselect",components:{Multiselect:a.a},data:function(){return{loading:!1,objects:[],selected_objects:[]}},props:{placeholder:String,search_function:String,label:String,parent_variable:{type:String,default:void 0},sticky_options:{type:Array,default:function(){return[]}},initial_selection:{type:Array,default:function(){return[]}},multiple:{type:Boolean,default:!0},tree_api:{type:Boolean,default:!1}},watch:{initial_selection:function(e,t){this.selected_objects=e}},mounted:function(){this.search("")},methods:{search:function(e){var t=this,r=new s["a"];if(this.tree_api){var n=1,i=void 0,o=void 0,a=10;""===e&&(e=void 0),r[this.search_function](e,i,o,n,a).then((function(e){t.objects=t.sticky_options.concat(e.data.results)}))}else r[this.search_function]({query:{query:e,limit:10}}).then((function(e){t.objects=t.sticky_options.concat(e.data)}))},selectionChanged:function(){this.$emit("change",{var:this.parent_variable,val:this.selected_objects})}}},u=c,d=r("2877"),p=Object(d["a"])(u,n,i,!1,null,"abc99b66",null);t["a"]=p.exports},"7c15":function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"d",(function(){return s})),r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return u}));var n=r("bc3a"),i=r.n(n),o=r("fa7d");function a(e){var t=Object(o["g"])("api:recipe-detail",e);return void 0!==window.SHARE_UID&&(t+="?share="+window.SHARE_UID),i.a.get(t).then((function(e){return e.data})).catch((function(e){d(e,"There was an error loading a resource!","danger")}))}function s(e){return i.a.post(Object(o["g"])("api:cooklog-list"),e).then((function(e){Object(o["f"])("Saved","Cook Log entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function c(e){return i.a.get(Object(o["g"])("api:recipebook-list")+"?query="+e).then((function(e){return e.data})).catch((function(e){}))}function u(e){return i.a.post(Object(o["g"])("api:recipebookentry-list"),e).then((function(e){Object(o["f"])("Saved","Recipe Book entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function d(e,t){if("response"in e){console.log(e.response);var r="statusText"in e.response?e.response.statusText:Object(o["e"])("Error");t+="\n\n"+JSON.stringify(e.response.data),Object(o["f"])(r,t,"danger")}else Object(o["f"])("Error",t,"danger"),console.log(e)}i.a.defaults.xsrfCookieName="csrftoken",i.a.defaults.xsrfHeaderName="X-CSRFTOKEN"},"81d5":function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.recipe.keywords.length>0?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"}')},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("Add_to_Book"),"ok-title":e.$t("Add"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.addToBook()}}},[r("multiselect",{attrs:{options:e.books,"preserve-search":!0,placeholder:e.$t("Select_Book"),label:"name","track-by":"id",id:"id_books",multiple:!1},on:{"search-change":e.loadBook},model:{value:e.selected_book,callback:function(t){e.selected_book=t},expression:"selected_book"}})],1)],1)},i=[],o=(r("a9e3"),r("8e5f")),a=r.n(o),s=r("c1df"),c=r.n(s),u=r("a026"),d=r("5f5b"),p=r("7c15");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:[],selected_book:null}},mounted:function(){this.loadBook("")},methods:{loadBook:function(e){var t=this;Object(p["b"])(e).then((function(e){t.books=e}))},addToBook:function(){Object(p["a"])({recipe:this.recipe.id,book:this.selected_book.id})}}},l=h,b=(r("60bc"),r("2877")),f=Object(b["a"])(l,n,i,!1,null,null,null);t["a"]=f.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},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_Book":"Add to Book","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","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","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","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}.","Download":"Download","Root":"Root"}')},fa7d:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"f",(function(){return s})),r.d(t,"a",(function(){return c})),r.d(t,"e",(function(){return u})),r.d(t,"b",(function(){return d})),r.d(t,"g",(function(){return p})),r.d(t,"d",(function(){return l}));var n=r("53ca"),i=(r("99af"),r("59e4"));function o(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 a={methods:{makeToast:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return s(e,t,r)}}};function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=new i["a"];n.$bvToast.toast(t,{title:e,variant:r,toaster:"b-toaster-top-center",solid:!0})}var c={methods:{_:function(e){return u(e)}}};function u(e){return window.gettext(e)}var d={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(e,t)}}};function p(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 h(e){return window.USER_PREF[e]}function l(e,t){if(h("use_fractions")){var r="",n=o(e*t,9,!0);return n[0]>0&&(r+=n[0]),n[1]>0&&(r+=" ".concat(n[1],"").concat(n[2],"")),r}return b(e*t)}function b(e){var t=h("user_fractions")?h("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("Add_to_Book"))+" ")])]),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"),h=r("7c15");d["default"].prototype.moment=u.a,d["default"].use(p["a"]);var l={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(h["d"])(this.logObject)}}},b=l,f=r("2877"),j=Object(f["a"])(b,a,s,!1,null,null,null),O=j.exports,v=r("bc3a"),g=r.n(v),m=r("d46a"),y={name:"RecipeContextMenu",mixins:[o["b"]],components:{AddRecipeToBook:m["a"],CookLog:O},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;g.a.get(Object(o["g"])("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["f"])(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)}}},S=y,_=Object(f["a"])(S,n,i,!1,null,null,null);t["a"]=_.exports}}); \ No newline at end of file diff --git a/cookbook/templates/sw.js b/cookbook/templates/sw.js index fcc44a6d..4ee54236 100644 --- a/cookbook/templates/sw.js +++ b/cookbook/templates/sw.js @@ -1 +1 @@ -(function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="249e")})({"00ee":function(t,e,n){var r=n("b622"),o=r("toStringTag"),i={};i[o]="z",t.exports="[object z]"===String(i)},"06cf":function(t,e,n){var r=n("83ab"),o=n("d1e7"),i=n("5c6c"),a=n("fc6a"),c=n("c04e"),s=n("5135"),u=n("0cfb"),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=a(t),e=c(e,!0),u)try{return l(t,e)}catch(n){}if(s(t,e))return i(!o.f.call(t,e),t[e])}},"0719":function(t,e,n){"use strict";try{self["workbox:core:6.1.5"]&&_()}catch(r){}},"0cfb":function(t,e,n){var r=n("83ab"),o=n("d039"),i=n("cc12");t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},"14c3":function(t,e,n){var r=n("c6b6"),o=n("9263");t.exports=function(t,e){var n=t.exec;if("function"===typeof n){var i=n.call(t,e);if("object"!==typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(t))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},"1d80":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"23cb":function(t,e,n){var r=n("a691"),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},"23e7":function(t,e,n){var r=n("da84"),o=n("06cf").f,i=n("9112"),a=n("6eeb"),c=n("ce4e"),s=n("e893"),u=n("94ca");t.exports=function(t,e){var n,l,h,f,p,d,g=t.target,y=t.global,m=t.stat;if(l=y?r:m?r[g]||c(g,{}):(r[g]||{}).prototype,l)for(h in e){if(p=e[h],t.noTargetGet?(d=o(l,h),f=d&&d.value):f=l[h],n=u(y?h:g+(m?".":"#")+h,t.forced),!n&&void 0!==f){if(typeof p===typeof f)continue;s(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),a(l,h,p,t)}}},"241c":function(t,e,n){var r=n("ca84"),o=n("7839"),i=o.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},"249e":function(t,e,n){"use strict";n.r(e);n("d3b7");function r(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(u){return void n(u)}c.done?e(s):Promise.resolve(s).then(r,o)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,s,"next",t)}function s(t){r(a,o,i,c,s,"throw",t)}c(void 0)}))}}n("ac1f"),n("466d"),n("4d63"),n("25f0"),n("96cf"),n("0719");const i=(t,...e)=>{let n=t;return e.length>0&&(n+=" :: "+JSON.stringify(e)),n},a=i;class c extends Error{constructor(t,e){const n=a(t,e);super(n),this.name=t,this.details=e}}const s={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},u=t=>[s.prefix,t,s.suffix].filter(t=>t&&t.length>0).join("-"),l=t=>{for(const e of Object.keys(s))t(e)},h={updateDetails:t=>{l(e=>{"string"===typeof t[e]&&(s[e]=t[e])})},getGoogleAnalyticsName:t=>t||u(s.googleAnalytics),getPrecacheName:t=>t||u(s.precache),getPrefix:()=>s.prefix,getRuntimeName:t=>t||u(s.runtime),getSuffix:()=>s.suffix};n("c700");let f;function p(){if(void 0===f){const e=new Response("");if("body"in e)try{new Response(e.body),f=!0}catch(t){f=!1}f=!1}return f}async function d(t,e){let n=null;if(t.url){const e=new URL(t.url);n=e.origin}if(n!==self.location.origin)throw new c("cross-origin-copy-response",{origin:n});const r=t.clone(),o={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},i=e?e(o):o,a=p()?r.body:await r.blob();return new Response(a,i)}const g=t=>{const e=new URL(String(t),location.href);return e.href.replace(new RegExp("^"+location.origin),"")};function y(t,e){const n=new URL(t);for(const r of e)n.searchParams.delete(r);return n.href}async function m(t,e,n,r){const o=y(e.url,n);if(e.url===o)return t.match(e,r);const i={...r,ignoreSearch:!0},a=await t.keys(e,i);for(const c of a){const e=y(c.url,n);if(o===e)return t.match(c,r)}}class v{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}}const w=new Set;async function b(){for(const t of w)await t()}function x(t){return new Promise(e=>setTimeout(e,t))}n("6aa8");function _(t){return"string"===typeof t?new Request(t):t}class E{constructor(t,e){this._cacheKeys={},Object.assign(this,e),this.event=e.event,this._strategy=t,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...t.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(t){const{event:e}=this;let n=_(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(i){throw new c("plugin-error-request-will-fetch",{thrownError:i})}const o=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this._strategy.fetchOptions);for(const n of this.iterateCallbacks("fetchDidSucceed"))t=await n({event:e,request:o,response:t});return t}catch(a){throw r&&await this.runCallbacks("fetchDidFail",{error:a,event:e,originalRequest:r.clone(),request:o.clone()}),a}}async fetchAndCachePut(t){const e=await this.fetch(t),n=e.clone();return this.waitUntil(this.cachePut(t,n)),e}async cacheMatch(t){const e=_(t);let n;const{cacheName:r,matchOptions:o}=this._strategy,i=await this.getCacheKey(e,"read"),a={...o,cacheName:r};n=await caches.match(i,a);for(const c of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await c({cacheName:r,matchOptions:o,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(t,e){const n=_(t);await x(0);const r=await this.getCacheKey(n,"write");if(!e)throw new c("cache-put-with-no-response",{url:g(r.url)});const o=await this._ensureResponseSafeToCache(e);if(!o)return!1;const{cacheName:i,matchOptions:a}=this._strategy,s=await self.caches.open(i),u=this.hasCallback("cacheDidUpdate"),l=u?await m(s,r.clone(),["__WB_REVISION__"],a):null;try{await s.put(r,u?o.clone():o)}catch(h){throw"QuotaExceededError"===h.name&&await b(),h}for(const c of this.iterateCallbacks("cacheDidUpdate"))await c({cacheName:i,oldResponse:l,newResponse:o.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){if(!this._cacheKeys[e]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=_(await t({mode:e,request:n,event:this.event,params:this.params}));this._cacheKeys[e]=n}return this._cacheKeys[e]}hasCallback(t){for(const e of this._strategy.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const n of this.iterateCallbacks(t))await n(e)}*iterateCallbacks(t){for(const e of this._strategy.plugins)if("function"===typeof e[t]){const n=this._pluginStateMap.get(e),r=r=>{const o={...r,state:n};return e[t](o)};yield r}}waitUntil(t){return this._extendLifetimePromises.push(t),t}async doneWaiting(){let t;while(t=this._extendLifetimePromises.shift())await t}destroy(){this._handlerDeferred.resolve()}async _ensureResponseSafeToCache(t){let e=t,n=!1;for(const r of this.iterateCallbacks("cacheWillUpdate"))if(e=await r({request:this.request,response:e,event:this.event})||void 0,n=!0,!e)break;return n||e&&200!==e.status&&(e=void 0),e}}class R{constructor(t={}){this.cacheName=h.getRuntimeName(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,n="string"===typeof t.request?new Request(t.request):t.request,r="params"in t?t.params:void 0,o=new E(this,{event:e,request:n,params:r}),i=this._getResponse(o,n,e),a=this._awaitComplete(i,o,n,e);return[i,a]}async _getResponse(t,e,n){await t.runCallbacks("handlerWillStart",{event:n,request:e});let r=void 0;try{if(r=await this._handle(e,t),!r||"error"===r.type)throw new c("no-response",{url:e.url})}catch(o){for(const i of t.iterateCallbacks("handlerDidError"))if(r=await i({error:o,event:n,request:e}),r)break;if(!r)throw o}for(const i of t.iterateCallbacks("handlerWillRespond"))r=await i({event:n,request:e,response:r});return r}async _awaitComplete(t,e,n,r){let o,i;try{o=await t}catch(i){}try{await e.runCallbacks("handlerDidRespond",{event:r,request:n,response:o}),await e.doneWaiting()}catch(a){i=a}if(await e.runCallbacks("handlerDidComplete",{event:r,request:n,response:o,error:i}),e.destroy(),i)throw i}}class S extends R{constructor(t={}){t.cacheName=h.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=!1!==t.fallbackToNetwork,this.plugins.push(S.copyRedirectedCacheableResponsesPlugin)}async _handle(t,e){const n=await e.cacheMatch(t);return n||(e.event&&"install"===e.event.type?await this._handleInstall(t,e):await this._handleFetch(t,e))}async _handleFetch(t,e){let n;if(!this._fallbackToNetwork)throw new c("missing-precache-entry",{cacheName:this.cacheName,url:t.url});return n=await e.fetch(t),n}async _handleInstall(t,e){this._useDefaultCacheabilityPluginIfNeeded();const n=await e.fetch(t),r=await e.cachePut(t,n.clone());if(!r)throw new c("bad-precaching-response",{url:t.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let t=null,e=0;for(const[n,r]of this.plugins.entries())r!==S.copyRedirectedCacheableResponsesPlugin&&(r===S.defaultPrecacheCacheabilityPlugin&&(t=n),r.cacheWillUpdate&&e++);0===e?this.plugins.push(S.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}S.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:t}){return!t||t.status>=400?null:t}},S.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:t}){return t.redirected?await d(t):t}};n("e6d2");const O="GET",P=t=>t&&"object"===typeof t?t:{handle:t};class N{constructor(t,e,n=O){this.handler=P(e),this.match=t,this.method=n}setCatchHandler(t){this.catchHandler=P(t)}}class T extends N{constructor(t,e,n){const r=({url:e})=>{const n=t.exec(e.href);if(n&&(e.origin===location.origin||0===n.index))return n.slice(1)};super(r,e,n)}}class j{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",t=>{const{request:e}=t,n=this.handleRequest({request:e,event:t});n&&t.respondWith(n)})}addCacheListener(){self.addEventListener("message",t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data;0;const n=Promise.all(e.urlsToCache.map(e=>{"string"===typeof e&&(e=[e]);const n=new Request(...e);return this.handleRequest({request:n,event:t})}));t.waitUntil(n),t.ports&&t.ports[0]&&n.then(()=>t.ports[0].postMessage(!0))}})}handleRequest({request:t,event:e}){const n=new URL(t.url,location.href);if(!n.protocol.startsWith("http"))return void 0;const r=n.origin===location.origin,{params:o,route:i}=this.findMatchingRoute({event:e,request:t,sameOrigin:r,url:n});let a=i&&i.handler;const c=t.method;if(!a&&this._defaultHandlerMap.has(c)&&(a=this._defaultHandlerMap.get(c)),!a)return void 0;let s;try{s=a.handle({url:n,request:t,event:e,params:o})}catch(l){s=Promise.reject(l)}const u=i&&i.catchHandler;return s instanceof Promise&&(this._catchHandler||u)&&(s=s.catch(async r=>{if(u){0;try{return await u.handle({url:n,request:t,event:e,params:o})}catch(i){r=i}}if(this._catchHandler)return this._catchHandler.handle({url:n,request:t,event:e});throw r})),s}findMatchingRoute({url:t,sameOrigin:e,request:n,event:r}){const o=this._routes.get(n.method)||[];for(const i of o){let o;const a=i.match({url:t,sameOrigin:e,request:n,event:r});if(a)return o=a,(Array.isArray(a)&&0===a.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"===typeof a)&&(o=void 0),{route:i,params:o}}return{}}setDefaultHandler(t,e=O){this._defaultHandlerMap.set(e,P(t))}setCatchHandler(t){this._catchHandler=P(t)}registerRoute(t){this._routes.has(t.method)||this._routes.set(t.method,[]),this._routes.get(t.method).push(t)}unregisterRoute(t){if(!this._routes.has(t.method))throw new c("unregister-route-but-not-found-with-method",{method:t.method});const e=this._routes.get(t.method).indexOf(t);if(!(e>-1))throw new c("unregister-route-route-not-registered");this._routes.get(t.method).splice(e,1)}}let k;const C=()=>(k||(k=new j,k.addFetchListener(),k.addCacheListener()),k);function q(t,e,n){let r;if("string"===typeof t){const o=new URL(t,location.href);0;const i=({url:t})=>t.href===o.href;r=new N(i,e,n)}else if(t instanceof RegExp)r=new T(t,e,n);else if("function"===typeof t)r=new N(t,e,n);else{if(!(t instanceof N))throw new c("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});r=t}const o=C();return o.registerRoute(r),r}function A(t){const e=C();e.setCatchHandler(t)}class L extends R{async _handle(t,e){let n,r=await e.cacheMatch(t);if(r)0;else{0;try{r=await e.fetchAndCachePut(t)}catch(o){n=o}0}if(!r)throw new c("no-response",{url:t.url,error:n});return r}}const M={cacheWillUpdate:async({response:t})=>200===t.status||0===t.status?t:null};class I extends R{constructor(t={}){super(t),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(M),this._networkTimeoutSeconds=t.networkTimeoutSeconds||0}async _handle(t,e){const n=[];const r=[];let o;if(this._networkTimeoutSeconds){const{id:i,promise:a}=this._getTimeoutPromise({request:t,logs:n,handler:e});o=i,r.push(a)}const i=this._getNetworkPromise({timeoutId:o,request:t,logs:n,handler:e});r.push(i);const a=await e.waitUntil((async()=>await e.waitUntil(Promise.race(r))||await i)());if(!a)throw new c("no-response",{url:t.url});return a}_getTimeoutPromise({request:t,logs:e,handler:n}){let r;const o=new Promise(e=>{const o=async()=>{e(await n.cacheMatch(t))};r=setTimeout(o,1e3*this._networkTimeoutSeconds)});return{promise:o,id:r}}async _getNetworkPromise({timeoutId:t,request:e,logs:n,handler:r}){let o,i;try{i=await r.fetchAndCachePut(e)}catch(a){o=a}return t&&clearTimeout(t),!o&&i||(i=await r.cacheMatch(e)),i}}class U extends R{constructor(t){super(t),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(M)}async _handle(t,e){const n=e.fetchAndCachePut(t).catch(()=>{});let r,o=await e.cacheMatch(t);if(o)0;else{0;try{o=await n}catch(i){r=i}}if(!o)throw new c("no-response",{url:t.url,error:r});return o}}function D(t){t.then(()=>{})}class F{constructor(t,e,{onupgradeneeded:n,onversionchange:r}={}){this._db=null,this._name=t,this._version=e,this._onupgradeneeded=n,this._onversionchange=r||(()=>this.close())}get db(){return this._db}async open(){if(!this._db)return this._db=await new Promise((t,e)=>{let n=!1;setTimeout(()=>{n=!0,e(new Error("The open request was blocked and timed out"))},this.OPEN_TIMEOUT);const r=indexedDB.open(this._name,this._version);r.onerror=()=>e(r.error),r.onupgradeneeded=t=>{n?(r.transaction.abort(),r.result.close()):"function"===typeof this._onupgradeneeded&&this._onupgradeneeded(t)},r.onsuccess=()=>{const e=r.result;n?e.close():(e.onversionchange=this._onversionchange.bind(this),t(e))}}),this}async getKey(t,e){return(await this.getAllKeys(t,e,1))[0]}async getAll(t,e,n){return await this.getAllMatching(t,{query:e,count:n})}async getAllKeys(t,e,n){const r=await this.getAllMatching(t,{query:e,count:n,includeKeys:!0});return r.map(t=>t.key)}async getAllMatching(t,{index:e,query:n=null,direction:r="next",count:o,includeKeys:i=!1}={}){return await this.transaction([t],"readonly",(a,c)=>{const s=a.objectStore(t),u=e?s.index(e):s,l=[],h=u.openCursor(n,r);h.onsuccess=()=>{const t=h.result;t?(l.push(i?t:t.value),o&&l.length>=o?c(l):t.continue()):c(l)}})}async transaction(t,e,n){return await this.open(),await new Promise((r,o)=>{const i=this._db.transaction(t,e);i.onabort=()=>o(i.error),i.oncomplete=()=>r(),n(i,t=>r(t))})}async _call(t,e,n,...r){const o=(n,o)=>{const i=n.objectStore(e),a=i[t].apply(i,r);a.onsuccess=()=>o(a.result)};return await this.transaction([e],n,o)}close(){this._db&&(this._db.close(),this._db=null)}}F.prototype.OPEN_TIMEOUT=2e3;const W={readonly:["get","count","getKey","getAll","getAllKeys"],readwrite:["add","put","clear","delete"]};for(const[Z,tt]of Object.entries(W))for(const t of tt)t in IDBObjectStore.prototype&&(F.prototype[t]=async function(e,...n){return await this._call(t,e,Z,...n)});const H=async t=>{await new Promise((e,n)=>{const r=indexedDB.deleteDatabase(t);r.onerror=()=>{n(r.error)},r.onblocked=()=>{n(new Error("Delete blocked"))},r.onsuccess=()=>{e()}})};n("d8a5");const K="workbox-expiration",G="cache-entries",B=t=>{const e=new URL(t,location.href);return e.hash="",e.href};class z{constructor(t){this._cacheName=t,this._db=new F(K,1,{onupgradeneeded:t=>this._handleUpgrade(t)})}_handleUpgrade(t){const e=t.target.result,n=e.createObjectStore(G,{keyPath:"id"});n.createIndex("cacheName","cacheName",{unique:!1}),n.createIndex("timestamp","timestamp",{unique:!1}),H(this._cacheName)}async setTimestamp(t,e){t=B(t);const n={url:t,timestamp:e,cacheName:this._cacheName,id:this._getId(t)};await this._db.put(G,n)}async getTimestamp(t){const e=await this._db.get(G,this._getId(t));return e.timestamp}async expireEntries(t,e){const n=await this._db.transaction(G,"readwrite",(n,r)=>{const o=n.objectStore(G),i=o.index("timestamp").openCursor(null,"prev"),a=[];let c=0;i.onsuccess=()=>{const n=i.result;if(n){const r=n.value;r.cacheName===this._cacheName&&(t&&r.timestamp=e?a.push(n.value):c++),n.continue()}else r(a)}}),r=[];for(const o of n)await this._db.delete(G,o.id),r.push(o.url);return r}_getId(t){return this._cacheName+"|"+B(t)}}class Y{constructor(t,e={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=e.maxEntries,this._maxAgeSeconds=e.maxAgeSeconds,this._matchOptions=e.matchOptions,this._cacheName=t,this._timestampModel=new z(t)}async expireEntries(){if(this._isRunning)return void(this._rerunRequested=!0);this._isRunning=!0;const t=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,e=await this._timestampModel.expireEntries(t,this._maxEntries),n=await self.caches.open(this._cacheName);for(const r of e)await n.delete(r,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,D(this.expireEntries()))}async updateTimestamp(t){await this._timestampModel.setTimestamp(t,Date.now())}async isURLExpired(t){if(this._maxAgeSeconds){const e=await this._timestampModel.getTimestamp(t),n=Date.now()-1e3*this._maxAgeSeconds;return e{if(!r)return null;const o=this._isResponseDateFresh(r),i=this._getCacheExpiration(n);D(i.expireEntries());const a=i.updateTimestamp(e.url);if(t)try{t.waitUntil(a)}catch(c){0}return o?r:null},this.cacheDidUpdate=async({cacheName:t,request:e})=>{const n=this._getCacheExpiration(t);await n.updateTimestamp(e.url),await n.expireEntries()},this._config=t,this._maxAgeSeconds=t.maxAgeSeconds,this._cacheExpirations=new Map,t.purgeOnQuotaError&&$(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(t){if(t===h.getRuntimeName())throw new c("expire-custom-caches-only");let e=this._cacheExpirations.get(t);return e||(e=new Y(t,this._config),this._cacheExpirations.set(t,e)),e}_isResponseDateFresh(t){if(!this._maxAgeSeconds)return!0;const e=this._getDateHeaderTimestamp(t);if(null===e)return!0;const n=Date.now();return e>=n-1e3*this._maxAgeSeconds}_getDateHeaderTimestamp(t){if(!t.headers.has("date"))return null;const e=t.headers.get("date"),n=new Date(e),r=n.getTime();return isNaN(r)?null:r}async deleteCacheAndMetadata(){for(const[t,e]of this._cacheExpirations)await self.caches.delete(t),await e.delete();this._cacheExpirations=new Map}}var V="offline-html",J="undefined"!==typeof window?localStorage.getItem("SCRIPT_NAME"):"/",X=J+"offline/";self.addEventListener("install",function(){var t=o(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.waitUntil(caches.open(V).then((function(t){return t.add(new Request(X,{cache:"reload"}))})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),[{'url':'static/vue/css/chunk-vendors.css'},{'url':'static/vue/css/keyword_list_view.css'},{'url':'static/vue/import_response_view.html'},{'url':'static/vue/js/chunk-vendors.js'},{'url':'static/vue/js/import_response_view.js'},{'url':'static/vue/js/keyword_list_view.js'},{'url':'static/vue/js/offline_view.js'},{'url':'static/vue/js/recipe_search_view.js'},{'url':'static/vue/js/recipe_view.js'},{'url':'static/vue/js/supermarket_view.js'},{'url':'static/vue/js/user_file_view.js'},{'url':'static/vue/keyword_list_view.html'},{'url':'static/vue/manifest.json'},{'url':'static/vue/offline_view.html'},{'url':'static/vue/recipe_search_view.html'},{'url':'static/vue/recipe_view.html'},{'url':'static/vue/supermarket_view.html'},{'url':'static/vue/user_file_view.html'}],A((function(t){var e=t.event;switch(e.request.destination){case"document":return console.log("Triggered fallback HTML"),caches.open(V).then((function(t){return t.match(X)}));default:return console.log("Triggered response ERROR"),Response.error()}})),q((function(t){var e=t.request;return"image"===e.destination}),new L({cacheName:"images",plugins:[new Q({maxEntries:20})]})),q((function(t){var e=t.request;return"script"===e.destination||"style"===e.destination}),new U({cacheName:"assets"})),q(new RegExp("jsreverse"),new U({cacheName:"assets"})),q(new RegExp("jsi18n"),new U({cacheName:"assets"})),q(new RegExp("api/recipe/([0-9]+)"),new I({cacheName:"api-recipe",plugins:[new Q({maxEntries:50})]})),q(new RegExp("api/*"),new I({cacheName:"api",plugins:[new Q({maxEntries:50})]})),q((function(t){var e=t.request;return"document"===e.destination}),new I({cacheName:"html",plugins:[new Q({maxAgeSeconds:2592e3,maxEntries:50})]}))},"25f0":function(t,e,n){"use strict";var r=n("6eeb"),o=n("825a"),i=n("d039"),a=n("ad6d"),c="toString",s=RegExp.prototype,u=s[c],l=i((function(){return"/a/b"!=u.call({source:"a",flags:"b"})})),h=u.name!=c;(l||h)&&r(RegExp.prototype,c,(function(){var t=o(this),e=String(t.source),n=t.flags,r=String(void 0===n&&t instanceof RegExp&&!("flags"in s)?a.call(t):n);return"/"+e+"/"+r}),{unsafe:!0})},2626:function(t,e,n){"use strict";var r=n("d066"),o=n("9bf2"),i=n("b622"),a=n("83ab"),c=i("species");t.exports=function(t){var e=r(t),n=o.f;a&&e&&!e[c]&&n(e,c,{configurable:!0,get:function(){return this}})}},"2d00":function(t,e,n){var r,o,i=n("da84"),a=n("342f"),c=i.process,s=c&&c.versions,u=s&&s.v8;u?(r=u.split("."),o=r[0]<4?1:r[0]+r[1]):a&&(r=a.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/),r&&(o=r[1]))),t.exports=o&&+o},"342f":function(t,e,n){var r=n("d066");t.exports=r("navigator","userAgent")||""},"3bbe":function(t,e,n){var r=n("861d");t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},"428f":function(t,e,n){var r=n("da84");t.exports=r},"44ad":function(t,e,n){var r=n("d039"),o=n("c6b6"),i="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},"44e7":function(t,e,n){var r=n("861d"),o=n("c6b6"),i=n("b622"),a=i("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[a])?!!e:"RegExp"==o(t))}},"466d":function(t,e,n){"use strict";var r=n("d784"),o=n("825a"),i=n("50c4"),a=n("1d80"),c=n("8aa5"),s=n("14c3");r("match",1,(function(t,e,n){return[function(e){var n=a(this),r=void 0==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var a=o(t),u=String(this);if(!a.global)return s(a,u);var l=a.unicode;a.lastIndex=0;var h,f=[],p=0;while(null!==(h=s(a,u))){var d=String(h[0]);f[p]=d,""===d&&(a.lastIndex=c(u,i(a.lastIndex),l)),p++}return 0===p?null:f}]}))},4930:function(t,e,n){var r=n("2d00"),o=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},"4d63":function(t,e,n){var r=n("83ab"),o=n("da84"),i=n("94ca"),a=n("7156"),c=n("9bf2").f,s=n("241c").f,u=n("44e7"),l=n("ad6d"),h=n("9f7f"),f=n("6eeb"),p=n("d039"),d=n("69f3").enforce,g=n("2626"),y=n("b622"),m=y("match"),v=o.RegExp,w=v.prototype,b=/a/g,x=/a/g,_=new v(b)!==b,E=h.UNSUPPORTED_Y,R=r&&i("RegExp",!_||E||p((function(){return x[m]=!1,v(b)!=b||v(x)==x||"/a/i"!=v(b,"i")})));if(R){var S=function(t,e){var n,r=this instanceof S,o=u(t),i=void 0===e;if(!r&&o&&t.constructor===S&&i)return t;_?o&&!i&&(t=t.source):t instanceof S&&(i&&(e=l.call(t)),t=t.source),E&&(n=!!e&&e.indexOf("y")>-1,n&&(e=e.replace(/y/g,"")));var c=a(_?new v(t,e):v(t,e),r?this:w,S);if(E&&n){var s=d(c);s.sticky=!0}return c},O=function(t){t in S||c(S,t,{configurable:!0,get:function(){return v[t]},set:function(e){v[t]=e}})},P=s(v),N=0;while(P.length>N)O(P[N++]);w.constructor=S,S.prototype=w,f(o,"RegExp",S)}g("RegExp")},"4d64":function(t,e,n){var r=n("fc6a"),o=n("50c4"),i=n("23cb"),a=function(t){return function(e,n,a){var c,s=r(e),u=o(s.length),l=i(a,u);if(t&&n!=n){while(u>l)if(c=s[l++],c!=c)return!0}else for(;u>l;l++)if((t||l in s)&&s[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},"50c4":function(t,e,n){var r=n("a691"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},5135:function(t,e,n){var r=n("7b0b"),o={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return o.call(r(t),e)}},5692:function(t,e,n){var r=n("c430"),o=n("c6cd");(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.14.0",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,e,n){var r=n("d066"),o=n("241c"),i=n("7418"),a=n("825a");t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(a(t)),n=i.f;return n?e.concat(n(t)):e}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6547:function(t,e,n){var r=n("a691"),o=n("1d80"),i=function(t){return function(e,n){var i,a,c=String(o(e)),s=r(n),u=c.length;return s<0||s>=u?t?"":void 0:(i=c.charCodeAt(s),i<55296||i>56319||s+1===u||(a=c.charCodeAt(s+1))<56320||a>57343?t?c.charAt(s):i:t?c.slice(s,s+2):a-56320+(i-55296<<10)+65536)}};t.exports={codeAt:i(!1),charAt:i(!0)}},"69f3":function(t,e,n){var r,o,i,a=n("7f9a"),c=n("da84"),s=n("861d"),u=n("9112"),l=n("5135"),h=n("c6cd"),f=n("f772"),p=n("d012"),d="Object already initialized",g=c.WeakMap,y=function(t){return i(t)?o(t):r(t,{})},m=function(t){return function(e){var n;if(!s(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}};if(a||h.state){var v=h.state||(h.state=new g),w=v.get,b=v.has,x=v.set;r=function(t,e){if(b.call(v,t))throw new TypeError(d);return e.facade=t,x.call(v,t,e),e},o=function(t){return w.call(v,t)||{}},i=function(t){return b.call(v,t)}}else{var _=f("state");p[_]=!0,r=function(t,e){if(l(t,_))throw new TypeError(d);return e.facade=t,u(t,_,e),e},o=function(t){return l(t,_)?t[_]:{}},i=function(t){return l(t,_)}}t.exports={set:r,get:o,has:i,enforce:y,getterFor:m}},"6aa8":function(t,e,n){"use strict";try{self["workbox:strategies:6.1.5"]&&_()}catch(r){}},"6eeb":function(t,e,n){var r=n("da84"),o=n("9112"),i=n("5135"),a=n("ce4e"),c=n("8925"),s=n("69f3"),u=s.get,l=s.enforce,h=String(String).split("String");(t.exports=function(t,e,n,c){var s,u=!!c&&!!c.unsafe,f=!!c&&!!c.enumerable,p=!!c&&!!c.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),s=l(n),s.source||(s.source=h.join("string"==typeof e?e:""))),t!==r?(u?!p&&t[e]&&(f=!0):delete t[e],f?t[e]=n:o(t,e,n)):f?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||c(this)}))},7156:function(t,e,n){var r=n("861d"),o=n("d2bb");t.exports=function(t,e,n){var i,a;return o&&"function"==typeof(i=e.constructor)&&i!==n&&r(a=i.prototype)&&a!==n.prototype&&o(t,a),t}},7418:function(t,e){e.f=Object.getOwnPropertySymbols},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,e,n){var r=n("1d80");t.exports=function(t){return Object(r(t))}},"7f9a":function(t,e,n){var r=n("da84"),o=n("8925"),i=r.WeakMap;t.exports="function"===typeof i&&/native code/.test(o(i))},"825a":function(t,e,n){var r=n("861d");t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},"83ab":function(t,e,n){var r=n("d039");t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"861d":function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},8925:function(t,e,n){var r=n("c6cd"),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return o.call(t)}),t.exports=r.inspectSource},"8aa5":function(t,e,n){"use strict";var r=n("6547").charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},"90e3":function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+r).toString(36)}},9112:function(t,e,n){var r=n("83ab"),o=n("9bf2"),i=n("5c6c");t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},9263:function(t,e,n){"use strict";var r=n("ad6d"),o=n("9f7f"),i=n("5692"),a=RegExp.prototype.exec,c=i("native-string-replace",String.prototype.replace),s=a,u=function(){var t=/a/,e=/b*/g;return a.call(t,"a"),a.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),l=o.UNSUPPORTED_Y||o.BROKEN_CARET,h=void 0!==/()??/.exec("")[1],f=u||h||l;f&&(s=function(t){var e,n,o,i,s=this,f=l&&s.sticky,p=r.call(s),d=s.source,g=0,y=t;return f&&(p=p.replace("y",""),-1===p.indexOf("g")&&(p+="g"),y=String(t).slice(s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==t[s.lastIndex-1])&&(d="(?: "+d+")",y=" "+y,g++),n=new RegExp("^(?:"+d+")",p)),h&&(n=new RegExp("^"+d+"$(?!\\s)",p)),u&&(e=s.lastIndex),o=a.call(f?n:s,y),f?o?(o.input=o.input.slice(g),o[0]=o[0].slice(g),o.index=s.lastIndex,s.lastIndex+=o[0].length):s.lastIndex=0:u&&o&&(s.lastIndex=s.global?o.index+o[0].length:e),h&&o&&o.length>1&&c.call(o[0],n,(function(){for(i=1;i=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}(t.exports);try{regeneratorRuntime=r}catch(o){Function("r","regeneratorRuntime = r")(r)}},"9bf2":function(t,e,n){var r=n("83ab"),o=n("0cfb"),i=n("825a"),a=n("c04e"),c=Object.defineProperty;e.f=r?c:function(t,e,n){if(i(t),e=a(e,!0),i(n),o)try{return c(t,e,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},"9f7f":function(t,e,n){"use strict";var r=n("d039");function o(t,e){return RegExp(t,e)}e.UNSUPPORTED_Y=r((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),e.BROKEN_CARET=r((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},a691:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},ac1f:function(t,e,n){"use strict";var r=n("23e7"),o=n("9263");r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},ad6d:function(t,e,n){"use strict";var r=n("825a");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},b041:function(t,e,n){"use strict";var r=n("00ee"),o=n("f5df");t.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},b622:function(t,e,n){var r=n("da84"),o=n("5692"),i=n("5135"),a=n("90e3"),c=n("4930"),s=n("fdbf"),u=o("wks"),l=r.Symbol,h=s?l:l&&l.withoutSetter||a;t.exports=function(t){return i(u,t)&&(c||"string"==typeof u[t])||(c&&i(l,t)?u[t]=l[t]:u[t]=h("Symbol."+t)),u[t]}},c04e:function(t,e,n){var r=n("861d");t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},c430:function(t,e){t.exports=!1},c6b6:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},c6cd:function(t,e,n){var r=n("da84"),o=n("ce4e"),i="__core-js_shared__",a=r[i]||o(i,{});t.exports=a},c700:function(t,e,n){"use strict";try{self["workbox:precaching:6.1.5"]&&_()}catch(r){}},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},ca84:function(t,e,n){var r=n("5135"),o=n("fc6a"),i=n("4d64").indexOf,a=n("d012");t.exports=function(t,e){var n,c=o(t),s=0,u=[];for(n in c)!r(a,n)&&r(c,n)&&u.push(n);while(e.length>s)r(c,n=e[s++])&&(~i(u,n)||u.push(n));return u}},cc12:function(t,e,n){var r=n("da84"),o=n("861d"),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},ce4e:function(t,e,n){var r=n("da84"),o=n("9112");t.exports=function(t,e){try{o(r,t,e)}catch(n){r[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var r=n("428f"),o=n("da84"),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][e]||o[t]&&o[t][e]}},d1e7:function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},d2bb:function(t,e,n){var r=n("825a"),o=n("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(n,[]),e=n instanceof Array}catch(i){}return function(n,i){return r(n),o(i),e?t.call(n,i):n.__proto__=i,n}}():void 0)},d3b7:function(t,e,n){var r=n("00ee"),o=n("6eeb"),i=n("b041");r||o(Object.prototype,"toString",i,{unsafe:!0})},d784:function(t,e,n){"use strict";n("ac1f");var r=n("6eeb"),o=n("9263"),i=n("d039"),a=n("b622"),c=n("9112"),s=a("species"),u=RegExp.prototype,l=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),h=function(){return"$0"==="a".replace(/./,"$0")}(),f=a("replace"),p=function(){return!!/./[f]&&""===/./[f]("a","$0")}(),d=!i((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));t.exports=function(t,e,n,f){var g=a(t),y=!i((function(){var e={};return e[g]=function(){return 7},7!=""[t](e)})),m=y&&!i((function(){var e=!1,n=/a/;return"split"===t&&(n={},n.constructor={},n.constructor[s]=function(){return n},n.flags="",n[g]=/./[g]),n.exec=function(){return e=!0,null},n[g](""),!e}));if(!y||!m||"replace"===t&&(!l||!h||p)||"split"===t&&!d){var v=/./[g],w=n(g,""[t],(function(t,e,n,r,i){var a=e.exec;return a===o||a===u.exec?y&&!i?{done:!0,value:v.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}),{REPLACE_KEEPS_$0:h,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),b=w[0],x=w[1];r(String.prototype,t,b),r(u,g,2==e?function(t,e){return x.call(t,this,e)}:function(t){return x.call(t,this)})}f&&c(u[g],"sham",!0)}},d8a5:function(t,e,n){"use strict";try{self["workbox:expiration:6.1.5"]&&_()}catch(r){}},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n("c8ba"))},e6d2:function(t,e,n){"use strict";try{self["workbox:routing:6.1.5"]&&_()}catch(r){}},e893:function(t,e,n){var r=n("5135"),o=n("56ef"),i=n("06cf"),a=n("9bf2");t.exports=function(t,e){for(var n=o(e),c=a.f,s=i.f,u=0;u{let n=t;return e.length>0&&(n+=" :: "+JSON.stringify(e)),n},a=i;class c extends Error{constructor(t,e){const n=a(t,e);super(n),this.name=t,this.details=e}}const s={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},u=t=>[s.prefix,t,s.suffix].filter(t=>t&&t.length>0).join("-"),l=t=>{for(const e of Object.keys(s))t(e)},h={updateDetails:t=>{l(e=>{"string"===typeof t[e]&&(s[e]=t[e])})},getGoogleAnalyticsName:t=>t||u(s.googleAnalytics),getPrecacheName:t=>t||u(s.precache),getPrefix:()=>s.prefix,getRuntimeName:t=>t||u(s.runtime),getSuffix:()=>s.suffix};n("c700");let f;function p(){if(void 0===f){const e=new Response("");if("body"in e)try{new Response(e.body),f=!0}catch(t){f=!1}f=!1}return f}async function d(t,e){let n=null;if(t.url){const e=new URL(t.url);n=e.origin}if(n!==self.location.origin)throw new c("cross-origin-copy-response",{origin:n});const r=t.clone(),o={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},i=e?e(o):o,a=p()?r.body:await r.blob();return new Response(a,i)}const g=t=>{const e=new URL(String(t),location.href);return e.href.replace(new RegExp("^"+location.origin),"")};function y(t,e){const n=new URL(t);for(const r of e)n.searchParams.delete(r);return n.href}async function m(t,e,n,r){const o=y(e.url,n);if(e.url===o)return t.match(e,r);const i={...r,ignoreSearch:!0},a=await t.keys(e,i);for(const c of a){const e=y(c.url,n);if(o===e)return t.match(c,r)}}class v{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}}const w=new Set;async function b(){for(const t of w)await t()}function x(t){return new Promise(e=>setTimeout(e,t))}n("6aa8");function _(t){return"string"===typeof t?new Request(t):t}class E{constructor(t,e){this._cacheKeys={},Object.assign(this,e),this.event=e.event,this._strategy=t,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...t.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(t){const{event:e}=this;let n=_(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(i){throw new c("plugin-error-request-will-fetch",{thrownError:i})}const o=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this._strategy.fetchOptions);for(const n of this.iterateCallbacks("fetchDidSucceed"))t=await n({event:e,request:o,response:t});return t}catch(a){throw r&&await this.runCallbacks("fetchDidFail",{error:a,event:e,originalRequest:r.clone(),request:o.clone()}),a}}async fetchAndCachePut(t){const e=await this.fetch(t),n=e.clone();return this.waitUntil(this.cachePut(t,n)),e}async cacheMatch(t){const e=_(t);let n;const{cacheName:r,matchOptions:o}=this._strategy,i=await this.getCacheKey(e,"read"),a={...o,cacheName:r};n=await caches.match(i,a);for(const c of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await c({cacheName:r,matchOptions:o,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(t,e){const n=_(t);await x(0);const r=await this.getCacheKey(n,"write");if(!e)throw new c("cache-put-with-no-response",{url:g(r.url)});const o=await this._ensureResponseSafeToCache(e);if(!o)return!1;const{cacheName:i,matchOptions:a}=this._strategy,s=await self.caches.open(i),u=this.hasCallback("cacheDidUpdate"),l=u?await m(s,r.clone(),["__WB_REVISION__"],a):null;try{await s.put(r,u?o.clone():o)}catch(h){throw"QuotaExceededError"===h.name&&await b(),h}for(const c of this.iterateCallbacks("cacheDidUpdate"))await c({cacheName:i,oldResponse:l,newResponse:o.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){if(!this._cacheKeys[e]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=_(await t({mode:e,request:n,event:this.event,params:this.params}));this._cacheKeys[e]=n}return this._cacheKeys[e]}hasCallback(t){for(const e of this._strategy.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const n of this.iterateCallbacks(t))await n(e)}*iterateCallbacks(t){for(const e of this._strategy.plugins)if("function"===typeof e[t]){const n=this._pluginStateMap.get(e),r=r=>{const o={...r,state:n};return e[t](o)};yield r}}waitUntil(t){return this._extendLifetimePromises.push(t),t}async doneWaiting(){let t;while(t=this._extendLifetimePromises.shift())await t}destroy(){this._handlerDeferred.resolve()}async _ensureResponseSafeToCache(t){let e=t,n=!1;for(const r of this.iterateCallbacks("cacheWillUpdate"))if(e=await r({request:this.request,response:e,event:this.event})||void 0,n=!0,!e)break;return n||e&&200!==e.status&&(e=void 0),e}}class R{constructor(t={}){this.cacheName=h.getRuntimeName(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,n="string"===typeof t.request?new Request(t.request):t.request,r="params"in t?t.params:void 0,o=new E(this,{event:e,request:n,params:r}),i=this._getResponse(o,n,e),a=this._awaitComplete(i,o,n,e);return[i,a]}async _getResponse(t,e,n){await t.runCallbacks("handlerWillStart",{event:n,request:e});let r=void 0;try{if(r=await this._handle(e,t),!r||"error"===r.type)throw new c("no-response",{url:e.url})}catch(o){for(const i of t.iterateCallbacks("handlerDidError"))if(r=await i({error:o,event:n,request:e}),r)break;if(!r)throw o}for(const i of t.iterateCallbacks("handlerWillRespond"))r=await i({event:n,request:e,response:r});return r}async _awaitComplete(t,e,n,r){let o,i;try{o=await t}catch(i){}try{await e.runCallbacks("handlerDidRespond",{event:r,request:n,response:o}),await e.doneWaiting()}catch(a){i=a}if(await e.runCallbacks("handlerDidComplete",{event:r,request:n,response:o,error:i}),e.destroy(),i)throw i}}class S extends R{constructor(t={}){t.cacheName=h.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=!1!==t.fallbackToNetwork,this.plugins.push(S.copyRedirectedCacheableResponsesPlugin)}async _handle(t,e){const n=await e.cacheMatch(t);return n||(e.event&&"install"===e.event.type?await this._handleInstall(t,e):await this._handleFetch(t,e))}async _handleFetch(t,e){let n;if(!this._fallbackToNetwork)throw new c("missing-precache-entry",{cacheName:this.cacheName,url:t.url});return n=await e.fetch(t),n}async _handleInstall(t,e){this._useDefaultCacheabilityPluginIfNeeded();const n=await e.fetch(t),r=await e.cachePut(t,n.clone());if(!r)throw new c("bad-precaching-response",{url:t.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let t=null,e=0;for(const[n,r]of this.plugins.entries())r!==S.copyRedirectedCacheableResponsesPlugin&&(r===S.defaultPrecacheCacheabilityPlugin&&(t=n),r.cacheWillUpdate&&e++);0===e?this.plugins.push(S.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}S.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:t}){return!t||t.status>=400?null:t}},S.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:t}){return t.redirected?await d(t):t}};n("e6d2");const O="GET",P=t=>t&&"object"===typeof t?t:{handle:t};class N{constructor(t,e,n=O){this.handler=P(e),this.match=t,this.method=n}setCatchHandler(t){this.catchHandler=P(t)}}class T extends N{constructor(t,e,n){const r=({url:e})=>{const n=t.exec(e.href);if(n&&(e.origin===location.origin||0===n.index))return n.slice(1)};super(r,e,n)}}class j{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",t=>{const{request:e}=t,n=this.handleRequest({request:e,event:t});n&&t.respondWith(n)})}addCacheListener(){self.addEventListener("message",t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data;0;const n=Promise.all(e.urlsToCache.map(e=>{"string"===typeof e&&(e=[e]);const n=new Request(...e);return this.handleRequest({request:n,event:t})}));t.waitUntil(n),t.ports&&t.ports[0]&&n.then(()=>t.ports[0].postMessage(!0))}})}handleRequest({request:t,event:e}){const n=new URL(t.url,location.href);if(!n.protocol.startsWith("http"))return void 0;const r=n.origin===location.origin,{params:o,route:i}=this.findMatchingRoute({event:e,request:t,sameOrigin:r,url:n});let a=i&&i.handler;const c=t.method;if(!a&&this._defaultHandlerMap.has(c)&&(a=this._defaultHandlerMap.get(c)),!a)return void 0;let s;try{s=a.handle({url:n,request:t,event:e,params:o})}catch(l){s=Promise.reject(l)}const u=i&&i.catchHandler;return s instanceof Promise&&(this._catchHandler||u)&&(s=s.catch(async r=>{if(u){0;try{return await u.handle({url:n,request:t,event:e,params:o})}catch(i){r=i}}if(this._catchHandler)return this._catchHandler.handle({url:n,request:t,event:e});throw r})),s}findMatchingRoute({url:t,sameOrigin:e,request:n,event:r}){const o=this._routes.get(n.method)||[];for(const i of o){let o;const a=i.match({url:t,sameOrigin:e,request:n,event:r});if(a)return o=a,(Array.isArray(a)&&0===a.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"===typeof a)&&(o=void 0),{route:i,params:o}}return{}}setDefaultHandler(t,e=O){this._defaultHandlerMap.set(e,P(t))}setCatchHandler(t){this._catchHandler=P(t)}registerRoute(t){this._routes.has(t.method)||this._routes.set(t.method,[]),this._routes.get(t.method).push(t)}unregisterRoute(t){if(!this._routes.has(t.method))throw new c("unregister-route-but-not-found-with-method",{method:t.method});const e=this._routes.get(t.method).indexOf(t);if(!(e>-1))throw new c("unregister-route-route-not-registered");this._routes.get(t.method).splice(e,1)}}let k;const C=()=>(k||(k=new j,k.addFetchListener(),k.addCacheListener()),k);function q(t,e,n){let r;if("string"===typeof t){const o=new URL(t,location.href);0;const i=({url:t})=>t.href===o.href;r=new N(i,e,n)}else if(t instanceof RegExp)r=new T(t,e,n);else if("function"===typeof t)r=new N(t,e,n);else{if(!(t instanceof N))throw new c("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});r=t}const o=C();return o.registerRoute(r),r}function A(t){const e=C();e.setCatchHandler(t)}class L extends R{async _handle(t,e){let n,r=await e.cacheMatch(t);if(r)0;else{0;try{r=await e.fetchAndCachePut(t)}catch(o){n=o}0}if(!r)throw new c("no-response",{url:t.url,error:n});return r}}const M={cacheWillUpdate:async({response:t})=>200===t.status||0===t.status?t:null};class I extends R{constructor(t={}){super(t),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(M),this._networkTimeoutSeconds=t.networkTimeoutSeconds||0}async _handle(t,e){const n=[];const r=[];let o;if(this._networkTimeoutSeconds){const{id:i,promise:a}=this._getTimeoutPromise({request:t,logs:n,handler:e});o=i,r.push(a)}const i=this._getNetworkPromise({timeoutId:o,request:t,logs:n,handler:e});r.push(i);const a=await e.waitUntil((async()=>await e.waitUntil(Promise.race(r))||await i)());if(!a)throw new c("no-response",{url:t.url});return a}_getTimeoutPromise({request:t,logs:e,handler:n}){let r;const o=new Promise(e=>{const o=async()=>{e(await n.cacheMatch(t))};r=setTimeout(o,1e3*this._networkTimeoutSeconds)});return{promise:o,id:r}}async _getNetworkPromise({timeoutId:t,request:e,logs:n,handler:r}){let o,i;try{i=await r.fetchAndCachePut(e)}catch(a){o=a}return t&&clearTimeout(t),!o&&i||(i=await r.cacheMatch(e)),i}}class U extends R{constructor(t){super(t),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(M)}async _handle(t,e){const n=e.fetchAndCachePut(t).catch(()=>{});let r,o=await e.cacheMatch(t);if(o)0;else{0;try{o=await n}catch(i){r=i}}if(!o)throw new c("no-response",{url:t.url,error:r});return o}}function D(t){t.then(()=>{})}class F{constructor(t,e,{onupgradeneeded:n,onversionchange:r}={}){this._db=null,this._name=t,this._version=e,this._onupgradeneeded=n,this._onversionchange=r||(()=>this.close())}get db(){return this._db}async open(){if(!this._db)return this._db=await new Promise((t,e)=>{let n=!1;setTimeout(()=>{n=!0,e(new Error("The open request was blocked and timed out"))},this.OPEN_TIMEOUT);const r=indexedDB.open(this._name,this._version);r.onerror=()=>e(r.error),r.onupgradeneeded=t=>{n?(r.transaction.abort(),r.result.close()):"function"===typeof this._onupgradeneeded&&this._onupgradeneeded(t)},r.onsuccess=()=>{const e=r.result;n?e.close():(e.onversionchange=this._onversionchange.bind(this),t(e))}}),this}async getKey(t,e){return(await this.getAllKeys(t,e,1))[0]}async getAll(t,e,n){return await this.getAllMatching(t,{query:e,count:n})}async getAllKeys(t,e,n){const r=await this.getAllMatching(t,{query:e,count:n,includeKeys:!0});return r.map(t=>t.key)}async getAllMatching(t,{index:e,query:n=null,direction:r="next",count:o,includeKeys:i=!1}={}){return await this.transaction([t],"readonly",(a,c)=>{const s=a.objectStore(t),u=e?s.index(e):s,l=[],h=u.openCursor(n,r);h.onsuccess=()=>{const t=h.result;t?(l.push(i?t:t.value),o&&l.length>=o?c(l):t.continue()):c(l)}})}async transaction(t,e,n){return await this.open(),await new Promise((r,o)=>{const i=this._db.transaction(t,e);i.onabort=()=>o(i.error),i.oncomplete=()=>r(),n(i,t=>r(t))})}async _call(t,e,n,...r){const o=(n,o)=>{const i=n.objectStore(e),a=i[t].apply(i,r);a.onsuccess=()=>o(a.result)};return await this.transaction([e],n,o)}close(){this._db&&(this._db.close(),this._db=null)}}F.prototype.OPEN_TIMEOUT=2e3;const W={readonly:["get","count","getKey","getAll","getAllKeys"],readwrite:["add","put","clear","delete"]};for(const[Z,tt]of Object.entries(W))for(const t of tt)t in IDBObjectStore.prototype&&(F.prototype[t]=async function(e,...n){return await this._call(t,e,Z,...n)});const H=async t=>{await new Promise((e,n)=>{const r=indexedDB.deleteDatabase(t);r.onerror=()=>{n(r.error)},r.onblocked=()=>{n(new Error("Delete blocked"))},r.onsuccess=()=>{e()}})};n("d8a5");const K="workbox-expiration",G="cache-entries",B=t=>{const e=new URL(t,location.href);return e.hash="",e.href};class z{constructor(t){this._cacheName=t,this._db=new F(K,1,{onupgradeneeded:t=>this._handleUpgrade(t)})}_handleUpgrade(t){const e=t.target.result,n=e.createObjectStore(G,{keyPath:"id"});n.createIndex("cacheName","cacheName",{unique:!1}),n.createIndex("timestamp","timestamp",{unique:!1}),H(this._cacheName)}async setTimestamp(t,e){t=B(t);const n={url:t,timestamp:e,cacheName:this._cacheName,id:this._getId(t)};await this._db.put(G,n)}async getTimestamp(t){const e=await this._db.get(G,this._getId(t));return e.timestamp}async expireEntries(t,e){const n=await this._db.transaction(G,"readwrite",(n,r)=>{const o=n.objectStore(G),i=o.index("timestamp").openCursor(null,"prev"),a=[];let c=0;i.onsuccess=()=>{const n=i.result;if(n){const r=n.value;r.cacheName===this._cacheName&&(t&&r.timestamp=e?a.push(n.value):c++),n.continue()}else r(a)}}),r=[];for(const o of n)await this._db.delete(G,o.id),r.push(o.url);return r}_getId(t){return this._cacheName+"|"+B(t)}}class Y{constructor(t,e={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=e.maxEntries,this._maxAgeSeconds=e.maxAgeSeconds,this._matchOptions=e.matchOptions,this._cacheName=t,this._timestampModel=new z(t)}async expireEntries(){if(this._isRunning)return void(this._rerunRequested=!0);this._isRunning=!0;const t=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,e=await this._timestampModel.expireEntries(t,this._maxEntries),n=await self.caches.open(this._cacheName);for(const r of e)await n.delete(r,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,D(this.expireEntries()))}async updateTimestamp(t){await this._timestampModel.setTimestamp(t,Date.now())}async isURLExpired(t){if(this._maxAgeSeconds){const e=await this._timestampModel.getTimestamp(t),n=Date.now()-1e3*this._maxAgeSeconds;return e{if(!r)return null;const o=this._isResponseDateFresh(r),i=this._getCacheExpiration(n);D(i.expireEntries());const a=i.updateTimestamp(e.url);if(t)try{t.waitUntil(a)}catch(c){0}return o?r:null},this.cacheDidUpdate=async({cacheName:t,request:e})=>{const n=this._getCacheExpiration(t);await n.updateTimestamp(e.url),await n.expireEntries()},this._config=t,this._maxAgeSeconds=t.maxAgeSeconds,this._cacheExpirations=new Map,t.purgeOnQuotaError&&$(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(t){if(t===h.getRuntimeName())throw new c("expire-custom-caches-only");let e=this._cacheExpirations.get(t);return e||(e=new Y(t,this._config),this._cacheExpirations.set(t,e)),e}_isResponseDateFresh(t){if(!this._maxAgeSeconds)return!0;const e=this._getDateHeaderTimestamp(t);if(null===e)return!0;const n=Date.now();return e>=n-1e3*this._maxAgeSeconds}_getDateHeaderTimestamp(t){if(!t.headers.has("date"))return null;const e=t.headers.get("date"),n=new Date(e),r=n.getTime();return isNaN(r)?null:r}async deleteCacheAndMetadata(){for(const[t,e]of this._cacheExpirations)await self.caches.delete(t),await e.delete();this._cacheExpirations=new Map}}var V="offline-html",J="undefined"!==typeof window?localStorage.getItem("SCRIPT_NAME"):"/",X=J+"offline/";self.addEventListener("install",function(){var t=o(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.waitUntil(caches.open(V).then((function(t){return t.add(new Request(X,{cache:"reload"}))})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),[{'url':'static/vue/css/chunk-vendors.css'},{'url':'static/vue/css/food_list_view.css'},{'url':'static/vue/css/keyword_list_view.css'},{'url':'static/vue/food_list_view.html'},{'url':'static/vue/import_response_view.html'},{'url':'static/vue/js/chunk-vendors.js'},{'url':'static/vue/js/food_list_view.js'},{'url':'static/vue/js/import_response_view.js'},{'url':'static/vue/js/keyword_list_view.js'},{'url':'static/vue/js/offline_view.js'},{'url':'static/vue/js/recipe_search_view.js'},{'url':'static/vue/js/recipe_view.js'},{'url':'static/vue/js/supermarket_view.js'},{'url':'static/vue/js/user_file_view.js'},{'url':'static/vue/keyword_list_view.html'},{'url':'static/vue/manifest.json'},{'url':'static/vue/offline_view.html'},{'url':'static/vue/recipe_search_view.html'},{'url':'static/vue/recipe_view.html'},{'url':'static/vue/supermarket_view.html'},{'url':'static/vue/user_file_view.html'}],A((function(t){var e=t.event;switch(e.request.destination){case"document":return console.log("Triggered fallback HTML"),caches.open(V).then((function(t){return t.match(X)}));default:return console.log("Triggered response ERROR"),Response.error()}})),q((function(t){var e=t.request;return"image"===e.destination}),new L({cacheName:"images",plugins:[new Q({maxEntries:20})]})),q((function(t){var e=t.request;return"script"===e.destination||"style"===e.destination}),new U({cacheName:"assets"})),q(new RegExp("jsreverse"),new U({cacheName:"assets"})),q(new RegExp("jsi18n"),new U({cacheName:"assets"})),q(new RegExp("api/recipe/([0-9]+)"),new I({cacheName:"api-recipe",plugins:[new Q({maxEntries:50})]})),q(new RegExp("api/*"),new I({cacheName:"api",plugins:[new Q({maxEntries:50})]})),q((function(t){var e=t.request;return"document"===e.destination}),new I({cacheName:"html",plugins:[new Q({maxAgeSeconds:2592e3,maxEntries:50})]}))},"25f0":function(t,e,n){"use strict";var r=n("6eeb"),o=n("825a"),i=n("d039"),a=n("ad6d"),c="toString",s=RegExp.prototype,u=s[c],l=i((function(){return"/a/b"!=u.call({source:"a",flags:"b"})})),h=u.name!=c;(l||h)&&r(RegExp.prototype,c,(function(){var t=o(this),e=String(t.source),n=t.flags,r=String(void 0===n&&t instanceof RegExp&&!("flags"in s)?a.call(t):n);return"/"+e+"/"+r}),{unsafe:!0})},2626:function(t,e,n){"use strict";var r=n("d066"),o=n("9bf2"),i=n("b622"),a=n("83ab"),c=i("species");t.exports=function(t){var e=r(t),n=o.f;a&&e&&!e[c]&&n(e,c,{configurable:!0,get:function(){return this}})}},"2d00":function(t,e,n){var r,o,i=n("da84"),a=n("342f"),c=i.process,s=c&&c.versions,u=s&&s.v8;u?(r=u.split("."),o=r[0]<4?1:r[0]+r[1]):a&&(r=a.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/),r&&(o=r[1]))),t.exports=o&&+o},"342f":function(t,e,n){var r=n("d066");t.exports=r("navigator","userAgent")||""},"3bbe":function(t,e,n){var r=n("861d");t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},"428f":function(t,e,n){var r=n("da84");t.exports=r},"44ad":function(t,e,n){var r=n("d039"),o=n("c6b6"),i="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},"44e7":function(t,e,n){var r=n("861d"),o=n("c6b6"),i=n("b622"),a=i("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[a])?!!e:"RegExp"==o(t))}},"466d":function(t,e,n){"use strict";var r=n("d784"),o=n("825a"),i=n("50c4"),a=n("1d80"),c=n("8aa5"),s=n("14c3");r("match",1,(function(t,e,n){return[function(e){var n=a(this),r=void 0==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var a=o(t),u=String(this);if(!a.global)return s(a,u);var l=a.unicode;a.lastIndex=0;var h,f=[],p=0;while(null!==(h=s(a,u))){var d=String(h[0]);f[p]=d,""===d&&(a.lastIndex=c(u,i(a.lastIndex),l)),p++}return 0===p?null:f}]}))},4930:function(t,e,n){var r=n("2d00"),o=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},"4d63":function(t,e,n){var r=n("83ab"),o=n("da84"),i=n("94ca"),a=n("7156"),c=n("9bf2").f,s=n("241c").f,u=n("44e7"),l=n("ad6d"),h=n("9f7f"),f=n("6eeb"),p=n("d039"),d=n("69f3").enforce,g=n("2626"),y=n("b622"),m=y("match"),v=o.RegExp,w=v.prototype,b=/a/g,x=/a/g,_=new v(b)!==b,E=h.UNSUPPORTED_Y,R=r&&i("RegExp",!_||E||p((function(){return x[m]=!1,v(b)!=b||v(x)==x||"/a/i"!=v(b,"i")})));if(R){var S=function(t,e){var n,r=this instanceof S,o=u(t),i=void 0===e;if(!r&&o&&t.constructor===S&&i)return t;_?o&&!i&&(t=t.source):t instanceof S&&(i&&(e=l.call(t)),t=t.source),E&&(n=!!e&&e.indexOf("y")>-1,n&&(e=e.replace(/y/g,"")));var c=a(_?new v(t,e):v(t,e),r?this:w,S);if(E&&n){var s=d(c);s.sticky=!0}return c},O=function(t){t in S||c(S,t,{configurable:!0,get:function(){return v[t]},set:function(e){v[t]=e}})},P=s(v),N=0;while(P.length>N)O(P[N++]);w.constructor=S,S.prototype=w,f(o,"RegExp",S)}g("RegExp")},"4d64":function(t,e,n){var r=n("fc6a"),o=n("50c4"),i=n("23cb"),a=function(t){return function(e,n,a){var c,s=r(e),u=o(s.length),l=i(a,u);if(t&&n!=n){while(u>l)if(c=s[l++],c!=c)return!0}else for(;u>l;l++)if((t||l in s)&&s[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},"50c4":function(t,e,n){var r=n("a691"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},5135:function(t,e,n){var r=n("7b0b"),o={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return o.call(r(t),e)}},5692:function(t,e,n){var r=n("c430"),o=n("c6cd");(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.14.0",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,e,n){var r=n("d066"),o=n("241c"),i=n("7418"),a=n("825a");t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(a(t)),n=i.f;return n?e.concat(n(t)):e}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6547:function(t,e,n){var r=n("a691"),o=n("1d80"),i=function(t){return function(e,n){var i,a,c=String(o(e)),s=r(n),u=c.length;return s<0||s>=u?t?"":void 0:(i=c.charCodeAt(s),i<55296||i>56319||s+1===u||(a=c.charCodeAt(s+1))<56320||a>57343?t?c.charAt(s):i:t?c.slice(s,s+2):a-56320+(i-55296<<10)+65536)}};t.exports={codeAt:i(!1),charAt:i(!0)}},"69f3":function(t,e,n){var r,o,i,a=n("7f9a"),c=n("da84"),s=n("861d"),u=n("9112"),l=n("5135"),h=n("c6cd"),f=n("f772"),p=n("d012"),d="Object already initialized",g=c.WeakMap,y=function(t){return i(t)?o(t):r(t,{})},m=function(t){return function(e){var n;if(!s(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}};if(a||h.state){var v=h.state||(h.state=new g),w=v.get,b=v.has,x=v.set;r=function(t,e){if(b.call(v,t))throw new TypeError(d);return e.facade=t,x.call(v,t,e),e},o=function(t){return w.call(v,t)||{}},i=function(t){return b.call(v,t)}}else{var _=f("state");p[_]=!0,r=function(t,e){if(l(t,_))throw new TypeError(d);return e.facade=t,u(t,_,e),e},o=function(t){return l(t,_)?t[_]:{}},i=function(t){return l(t,_)}}t.exports={set:r,get:o,has:i,enforce:y,getterFor:m}},"6aa8":function(t,e,n){"use strict";try{self["workbox:strategies:6.1.5"]&&_()}catch(r){}},"6eeb":function(t,e,n){var r=n("da84"),o=n("9112"),i=n("5135"),a=n("ce4e"),c=n("8925"),s=n("69f3"),u=s.get,l=s.enforce,h=String(String).split("String");(t.exports=function(t,e,n,c){var s,u=!!c&&!!c.unsafe,f=!!c&&!!c.enumerable,p=!!c&&!!c.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),s=l(n),s.source||(s.source=h.join("string"==typeof e?e:""))),t!==r?(u?!p&&t[e]&&(f=!0):delete t[e],f?t[e]=n:o(t,e,n)):f?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||c(this)}))},7156:function(t,e,n){var r=n("861d"),o=n("d2bb");t.exports=function(t,e,n){var i,a;return o&&"function"==typeof(i=e.constructor)&&i!==n&&r(a=i.prototype)&&a!==n.prototype&&o(t,a),t}},7418:function(t,e){e.f=Object.getOwnPropertySymbols},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,e,n){var r=n("1d80");t.exports=function(t){return Object(r(t))}},"7f9a":function(t,e,n){var r=n("da84"),o=n("8925"),i=r.WeakMap;t.exports="function"===typeof i&&/native code/.test(o(i))},"825a":function(t,e,n){var r=n("861d");t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},"83ab":function(t,e,n){var r=n("d039");t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"861d":function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},8925:function(t,e,n){var r=n("c6cd"),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return o.call(t)}),t.exports=r.inspectSource},"8aa5":function(t,e,n){"use strict";var r=n("6547").charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},"90e3":function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+r).toString(36)}},9112:function(t,e,n){var r=n("83ab"),o=n("9bf2"),i=n("5c6c");t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},9263:function(t,e,n){"use strict";var r=n("ad6d"),o=n("9f7f"),i=n("5692"),a=RegExp.prototype.exec,c=i("native-string-replace",String.prototype.replace),s=a,u=function(){var t=/a/,e=/b*/g;return a.call(t,"a"),a.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),l=o.UNSUPPORTED_Y||o.BROKEN_CARET,h=void 0!==/()??/.exec("")[1],f=u||h||l;f&&(s=function(t){var e,n,o,i,s=this,f=l&&s.sticky,p=r.call(s),d=s.source,g=0,y=t;return f&&(p=p.replace("y",""),-1===p.indexOf("g")&&(p+="g"),y=String(t).slice(s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==t[s.lastIndex-1])&&(d="(?: "+d+")",y=" "+y,g++),n=new RegExp("^(?:"+d+")",p)),h&&(n=new RegExp("^"+d+"$(?!\\s)",p)),u&&(e=s.lastIndex),o=a.call(f?n:s,y),f?o?(o.input=o.input.slice(g),o[0]=o[0].slice(g),o.index=s.lastIndex,s.lastIndex+=o[0].length):s.lastIndex=0:u&&o&&(s.lastIndex=s.global?o.index+o[0].length:e),h&&o&&o.length>1&&c.call(o[0],n,(function(){for(i=1;i=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}(t.exports);try{regeneratorRuntime=r}catch(o){Function("r","regeneratorRuntime = r")(r)}},"9bf2":function(t,e,n){var r=n("83ab"),o=n("0cfb"),i=n("825a"),a=n("c04e"),c=Object.defineProperty;e.f=r?c:function(t,e,n){if(i(t),e=a(e,!0),i(n),o)try{return c(t,e,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},"9f7f":function(t,e,n){"use strict";var r=n("d039");function o(t,e){return RegExp(t,e)}e.UNSUPPORTED_Y=r((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),e.BROKEN_CARET=r((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},a691:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},ac1f:function(t,e,n){"use strict";var r=n("23e7"),o=n("9263");r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},ad6d:function(t,e,n){"use strict";var r=n("825a");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},b041:function(t,e,n){"use strict";var r=n("00ee"),o=n("f5df");t.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},b622:function(t,e,n){var r=n("da84"),o=n("5692"),i=n("5135"),a=n("90e3"),c=n("4930"),s=n("fdbf"),u=o("wks"),l=r.Symbol,h=s?l:l&&l.withoutSetter||a;t.exports=function(t){return i(u,t)&&(c||"string"==typeof u[t])||(c&&i(l,t)?u[t]=l[t]:u[t]=h("Symbol."+t)),u[t]}},c04e:function(t,e,n){var r=n("861d");t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},c430:function(t,e){t.exports=!1},c6b6:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},c6cd:function(t,e,n){var r=n("da84"),o=n("ce4e"),i="__core-js_shared__",a=r[i]||o(i,{});t.exports=a},c700:function(t,e,n){"use strict";try{self["workbox:precaching:6.1.5"]&&_()}catch(r){}},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},ca84:function(t,e,n){var r=n("5135"),o=n("fc6a"),i=n("4d64").indexOf,a=n("d012");t.exports=function(t,e){var n,c=o(t),s=0,u=[];for(n in c)!r(a,n)&&r(c,n)&&u.push(n);while(e.length>s)r(c,n=e[s++])&&(~i(u,n)||u.push(n));return u}},cc12:function(t,e,n){var r=n("da84"),o=n("861d"),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},ce4e:function(t,e,n){var r=n("da84"),o=n("9112");t.exports=function(t,e){try{o(r,t,e)}catch(n){r[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var r=n("428f"),o=n("da84"),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][e]||o[t]&&o[t][e]}},d1e7:function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},d2bb:function(t,e,n){var r=n("825a"),o=n("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(n,[]),e=n instanceof Array}catch(i){}return function(n,i){return r(n),o(i),e?t.call(n,i):n.__proto__=i,n}}():void 0)},d3b7:function(t,e,n){var r=n("00ee"),o=n("6eeb"),i=n("b041");r||o(Object.prototype,"toString",i,{unsafe:!0})},d784:function(t,e,n){"use strict";n("ac1f");var r=n("6eeb"),o=n("9263"),i=n("d039"),a=n("b622"),c=n("9112"),s=a("species"),u=RegExp.prototype,l=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),h=function(){return"$0"==="a".replace(/./,"$0")}(),f=a("replace"),p=function(){return!!/./[f]&&""===/./[f]("a","$0")}(),d=!i((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));t.exports=function(t,e,n,f){var g=a(t),y=!i((function(){var e={};return e[g]=function(){return 7},7!=""[t](e)})),m=y&&!i((function(){var e=!1,n=/a/;return"split"===t&&(n={},n.constructor={},n.constructor[s]=function(){return n},n.flags="",n[g]=/./[g]),n.exec=function(){return e=!0,null},n[g](""),!e}));if(!y||!m||"replace"===t&&(!l||!h||p)||"split"===t&&!d){var v=/./[g],w=n(g,""[t],(function(t,e,n,r,i){var a=e.exec;return a===o||a===u.exec?y&&!i?{done:!0,value:v.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}),{REPLACE_KEEPS_$0:h,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),b=w[0],x=w[1];r(String.prototype,t,b),r(u,g,2==e?function(t,e){return x.call(t,this,e)}:function(t){return x.call(t,this)})}f&&c(u[g],"sham",!0)}},d8a5:function(t,e,n){"use strict";try{self["workbox:expiration:6.1.5"]&&_()}catch(r){}},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n("c8ba"))},e6d2:function(t,e,n){"use strict";try{self["workbox:routing:6.1.5"]&&_()}catch(r){}},e893:function(t,e,n){var r=n("5135"),o=n("56ef"),i=n("06cf"),a=n("9bf2");t.exports=function(t,e){for(var n=o(e),c=a.f,s=i.f,u=0;u +
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+ {{ this.$t('New_Food') }} +
+
+ +
+ +
+
+ + {{ this.$t('show_split_screen') }} + +
+
+ +
+
+
+
+
+ +
+ +
+ + + + + + + + + +
+ + +
+ + + +
+
+ + +
+
+ + + +
+ +
+ + + +
+
+
+ + +
+
+ +
+
+ + + + +
+ + + + + + + +
+ + + {{this.$t("delete_confimation", {'kw': this_item.name})}} {{this_item.name}} + + + + {{ this.$t("move_selection", {'child': this_item.name}) }} + + + + + + {{ this.$t("merge_selection", {'source': this_item.name, 'type': this.$t('keyword')}) }} + + + +
+ + + + + + + diff --git a/vue/src/apps/FoodListView/main.js b/vue/src/apps/FoodListView/main.js new file mode 100644 index 00000000..47eeb90b --- /dev/null +++ b/vue/src/apps/FoodListView/main.js @@ -0,0 +1,10 @@ +import Vue from 'vue' +import App from './FoodListView' +import i18n from '@/i18n' + +Vue.config.productionTip = false + +new Vue({ + i18n, + render: h => h(App), +}).$mount('#app') diff --git a/vue/src/apps/KeywordListView/KeywordListView.vue b/vue/src/apps/KeywordListView/KeywordListView.vue index 2f7fe60b..257baf45 100644 --- a/vue/src/apps/KeywordListView/KeywordListView.vue +++ b/vue/src/apps/KeywordListView/KeywordListView.vue @@ -368,7 +368,6 @@ export default { }, delKeyword: function (id) { let apiClient = new ApiApiFactory() - let p_id = null apiClient.destroyKeyword(id).then(response => { this.destroyCard(id) diff --git a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue index ad1a5a1f..43e757d8 100644 --- a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue +++ b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue @@ -159,11 +159,15 @@
- + v-bind:placeholder="$t('Ingredients')"> --> + +
+ + + + + + + + +
{{ food.name }}
+
{{ food.description }}
+
+ + +
+
+
+
+
+ + +
+
+
+ +
+
+ + +
+
+ +
+
+
+ + +
+
+
+ + + + {{$t('Move')}}: {{$t('move_confirmation', {'child': source.name,'parent':food.name})}} + + + {{$t('Merge')}}: {{ $t('merge_confirmation', {'source': source.name,'target':food.name}) }} + + + {{$t('Cancel')}} + + + + +
+ + + + + \ No newline at end of file diff --git a/vue/vue.config.js b/vue/vue.config.js index debdf012..c34ed465 100644 --- a/vue/vue.config.js +++ b/vue/vue.config.js @@ -29,6 +29,10 @@ const pages = { entry: './src/apps/KeywordListView/main.js', chunks: ['chunk-vendors'] }, + 'food_list_view': { + entry: './src/apps/FoodListView/main.js', + chunks: ['chunk-vendors'] + }, } module.exports = { diff --git a/vue/webpack-stats.json b/vue/webpack-stats.json index 793d46a9..58fbdd17 100644 --- a/vue/webpack-stats.json +++ b/vue/webpack-stats.json @@ -1 +1 @@ -{"status":"done","chunks":{"recipe_search_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/recipe_search_view.js"],"recipe_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/recipe_view.js"],"offline_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/offline_view.js"],"import_response_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/import_response_view.js"],"supermarket_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/supermarket_view.js"],"user_file_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/user_file_view.js"],"keyword_list_view":["css/chunk-vendors.css","js/chunk-vendors.js","css/keyword_list_view.css","js/keyword_list_view.js"]},"assets":{"../../templates/sw.js":{"name":"../../templates/sw.js","path":"../../templates/sw.js"},"css/chunk-vendors.css":{"name":"css/chunk-vendors.css","path":"css/chunk-vendors.css"},"js/chunk-vendors.js":{"name":"js/chunk-vendors.js","path":"js/chunk-vendors.js"},"js/import_response_view.js":{"name":"js/import_response_view.js","path":"js/import_response_view.js"},"css/keyword_list_view.css":{"name":"css/keyword_list_view.css","path":"css/keyword_list_view.css"},"js/keyword_list_view.js":{"name":"js/keyword_list_view.js","path":"js/keyword_list_view.js"},"js/offline_view.js":{"name":"js/offline_view.js","path":"js/offline_view.js"},"js/recipe_search_view.js":{"name":"js/recipe_search_view.js","path":"js/recipe_search_view.js"},"js/recipe_view.js":{"name":"js/recipe_view.js","path":"js/recipe_view.js"},"js/supermarket_view.js":{"name":"js/supermarket_view.js","path":"js/supermarket_view.js"},"js/user_file_view.js":{"name":"js/user_file_view.js","path":"js/user_file_view.js"},"recipe_search_view.html":{"name":"recipe_search_view.html","path":"recipe_search_view.html"},"recipe_view.html":{"name":"recipe_view.html","path":"recipe_view.html"},"offline_view.html":{"name":"offline_view.html","path":"offline_view.html"},"import_response_view.html":{"name":"import_response_view.html","path":"import_response_view.html"},"supermarket_view.html":{"name":"supermarket_view.html","path":"supermarket_view.html"},"user_file_view.html":{"name":"user_file_view.html","path":"user_file_view.html"},"keyword_list_view.html":{"name":"keyword_list_view.html","path":"keyword_list_view.html"},"manifest.json":{"name":"manifest.json","path":"manifest.json"}}} \ No newline at end of file +{"status":"done","chunks":{"recipe_search_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/recipe_search_view.js"],"recipe_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/recipe_view.js"],"offline_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/offline_view.js"],"import_response_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/import_response_view.js"],"supermarket_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/supermarket_view.js"],"user_file_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/user_file_view.js"],"keyword_list_view":["css/chunk-vendors.css","js/chunk-vendors.js","css/keyword_list_view.css","js/keyword_list_view.js"],"food_list_view":["css/chunk-vendors.css","js/chunk-vendors.js","css/food_list_view.css","js/food_list_view.js"]},"assets":{"../../templates/sw.js":{"name":"../../templates/sw.js","path":"../../templates/sw.js"},"css/chunk-vendors.css":{"name":"css/chunk-vendors.css","path":"css/chunk-vendors.css"},"js/chunk-vendors.js":{"name":"js/chunk-vendors.js","path":"js/chunk-vendors.js"},"css/food_list_view.css":{"name":"css/food_list_view.css","path":"css/food_list_view.css"},"js/food_list_view.js":{"name":"js/food_list_view.js","path":"js/food_list_view.js"},"js/import_response_view.js":{"name":"js/import_response_view.js","path":"js/import_response_view.js"},"css/keyword_list_view.css":{"name":"css/keyword_list_view.css","path":"css/keyword_list_view.css"},"js/keyword_list_view.js":{"name":"js/keyword_list_view.js","path":"js/keyword_list_view.js"},"js/offline_view.js":{"name":"js/offline_view.js","path":"js/offline_view.js"},"js/recipe_search_view.js":{"name":"js/recipe_search_view.js","path":"js/recipe_search_view.js"},"js/recipe_view.js":{"name":"js/recipe_view.js","path":"js/recipe_view.js"},"js/supermarket_view.js":{"name":"js/supermarket_view.js","path":"js/supermarket_view.js"},"js/user_file_view.js":{"name":"js/user_file_view.js","path":"js/user_file_view.js"},"recipe_search_view.html":{"name":"recipe_search_view.html","path":"recipe_search_view.html"},"recipe_view.html":{"name":"recipe_view.html","path":"recipe_view.html"},"offline_view.html":{"name":"offline_view.html","path":"offline_view.html"},"import_response_view.html":{"name":"import_response_view.html","path":"import_response_view.html"},"supermarket_view.html":{"name":"supermarket_view.html","path":"supermarket_view.html"},"user_file_view.html":{"name":"user_file_view.html","path":"user_file_view.html"},"keyword_list_view.html":{"name":"keyword_list_view.html","path":"keyword_list_view.html"},"food_list_view.html":{"name":"food_list_view.html","path":"food_list_view.html"},"manifest.json":{"name":"manifest.json","path":"manifest.json"}}} \ No newline at end of file