(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["branchToTakeAway","LocaleSwitcher"],{"2fa4":function(e,s,t){"use strict";t("20f6");var a=t("80d2");s["a"]=Object(a["j"])("spacer","div","v-spacer")},5733:function(e,s,t){"use strict";var a=t("8336"),i=t("62ad"),r=t("0fd9"),n=t("2fa4"),c=function(){var e=this,s=e._self._c;return s(r["a"],{staticClass:"linktree ml-1 mr-1",attrs:{justify:"center"}},[s(i["a"],{attrs:{sm:"12",md:"12",lg:"6"}},["osso"===e.instance.slug?s("h2",{staticClass:"text-sm-body-2",domProps:{innerHTML:e._s("Bienvenidos a Osso / Welcome to Osso")}}):s("h2",{staticClass:"text-sm-body-2"},[e._v(" "+e._s(e.$t("service.supplier.welcome_supplier_label",{name:e.instance.name}))+" ")]),"osso"!==e.instance.slug?s("h3",{staticClass:"text-sm-body-2"},["on_table"===e.service&&e.instance.labels_buttons.on_table.toString().length>0?s("span",{domProps:{innerHTML:e._s(e.instance.labels_buttons.on_table)}}):e._e(),"on_table"===e.service&&0===e.instance.labels_buttons.on_table.toString().length?s("span",[e._v(" "+e._s(e.$t("service.select_popup.on_table_title",{category:e.instance.category_establishment}))+" ")]):e._e(),s("br"),s("span",[e._v(e._s(e.getLabels("change_branch_office")))])]):e._e(),e.ciudad.slug.length>0?s("div",e._l(e.suppliersFilter,(function(t){return s(a["a"],{key:t.id,class:["mt-2",t.slug],attrs:{block:"",large:"","data-testid":"CityBranchSuppliers-"+t.label},domProps:{innerHTML:e._s(t.label)},on:{click:function(s){return e.GoSupplier(t)}}})})),1):e._e(),e.ciudades.length>1?s(a["a"],{staticClass:"mt-2 text-caption",attrs:{block:"",large:""},on:{click:function(s){return e.back()}}},[e._v(" "+e._s(e.$t("service.supplier.change_city_label"))+" "),s("br"),s(n["a"]),s("small",{domProps:{innerHTML:e._s(e.ciudad.label)}})],1):e._e()],1)],1)},l=[],o=(t("14d9"),t("e9f5"),t("910d"),t("2f62")),u={name:"CitysBranchSuppliers",props:{ciudad:Object,ciudades:Array,suppliers:Array},computed:{...Object(o["e"])("customer",["instance"]),...Object(o["e"])("order",["service"]),...Object(o["c"])("order",["is_ontable_service","is_room_service","is_take_away_service","is_delivery_service"]),...Object(o["c"])("customer",["is_ontable_no_incremental","is_ontable_checkout","is_ontable_plazoleta","getLabels"]),suppliersFilter(){return this.suppliers.filter(e=>null===e.ciudad_obj||e.ciudad_obj.slug===this.ciudad.slug)}},created(){1===this.suppliersFilter.length&&this.GoSupplier(this.suppliersFilter[0])},methods:{...Object(o["b"])("customer",["GetSupplier"]),back(){this.$emit("setCiudad",{id:"",slug:""})},GoSupplier(e){!this.is_ontable_service||!this.is_ontable_plazoleta&&this.is_room_service?this.is_room_service?this.goToOnServiceRoom(e):this.is_delivery_service||this.is_take_away_service?this.goToDeliveryAndTakeAwayHome(e):"book"===this.service?this.goToBooking(e):this.goToDeliveryAndTakeAwayHome(e):this.goToOnTableHome(e)},goToOnTableHome(e){this.instance.new_menu_v3?window.location.href="/newmenu/"+e.id+"/on_table/basic":this.$router.push({name:"OnTableMenuDigital",params:{supplier_id:e.slug}})},goToOnServiceRoom(e){this.$router.push({name:"ServiceRoom",params:{supplier_id:e.slug}})},goToDeliveryAndTakeAwayHome(e){this.$router.push({name:"Home",params:{supplier_id:e.slug}})},goToBooking(e){this.$router.push({name:"Book",params:{supplier_id:e.slug}})}}},d=u,p=t("2877"),_=Object(p["a"])(d,c,l,!1,null,null,null);s["a"]=_.exports},"8b64":function(e,s,t){"use strict";t.r(s);var a=t("a523"),i=function(){var e=this,s=e._self._c;return s(a["a"],{staticClass:"branch-to-take-away main-cities"},[s("img",{staticClass:"mx-auto rounded-circle",attrs:{src:e.instance.preload.logo,width:"200px"}}),""===e.ciudad.slug?s("citys-branch",{attrs:{instance:e.instance,service:e.service,ciudades:e.ciudades},on:{setCiudad:function(s){return e.setCiudad(s)}}}):e._e(),""!==e.ciudad.slug?s("citys-branch-suppliers",{attrs:{ciudad:e.ciudad,ciudades:e.ciudades,suppliers:e.instance.suppliers_take_away},on:{setCiudad:function(s){return e.setCiudad(s)}}}):e._e()],1)},r=[],n=(t("14d9"),t("e9f5"),t("f665"),t("7d54"),t("2f62")),c=t("01d9"),l=t("b51d"),o=t("5733"),u={name:"BranchToTakeAway",beforeRouteLeave(e,s,t){""!==this.ciudad.slug&&"Main"===e.name?(this.ciudad={slug:"",label:""},this.ciudades.length>1?t(!1):t()):t()},components:{CitysBranchSuppliers:o["a"],CitysBranch:l["a"]},data(){return{back_supplier_id:0,ciudades:[],ciudad:{slug:"",label:""}}},created(){this.back_supplier_id=this.supplier.id,this.instance.suppliers_take_away.forEach(e=>this.addCiudad(e.ciudad_obj)),1===this.ciudades.length&&(this.ciudad=this.ciudades[0])},computed:{...Object(n["e"])("customer",["instance","supplier"]),...Object(n["e"])("order",["service"])},methods:{...Object(n["d"])("template",["SetLoading","TemplateActiveHeader","SetAppClass"]),...Object(n["b"])("order",["setTakeAway"]),setCiudad(e){this.ciudad=e},addCiudad(e){null===e&&(e={slug:"null",label:""});const s=this.ciudades.find(s=>s.slug===e.slug);s||this.ciudades.push(e)}},mounted(){this.SetLoading(!1),this.TemplateActiveHeader({header_type:"to_main"}),this.SetAppClass("background-app"),c["a"].trackView(this,"BranchOnTable","/branch-to-book"),c["a"].trackEventCluvi({},"branch to book")}},d=u,p=t("2877"),_=Object(p["a"])(d,i,r,!1,null,null,null);s["default"]=_.exports},b51d:function(e,s,t){"use strict";var a=t("8336"),i=t("62ad"),r=t("0fd9"),n=function(){var e=this,s=e._self._c;return s(r["a"],{staticClass:"linktree ml-1 mr-1",attrs:{justify:"center"}},[s(i["a"],{attrs:{sm:"12",md:"12",lg:"6"}},[s("h2",{staticClass:"text-sm-body-2"},[e._v(e._s(e.$t("service.supplier.welcome_supplier_label",{name:e.instance.name})))]),s("h3",{staticClass:"text-sm-body-2"},[s("span",[e._v(e._s(e.$t("service.select_popup.on_table_title",{category:e.instance.category_establishment})))]),s("br"),s("span",{domProps:{innerHTML:e._s(e.$t("service.supplier.what_city_label"))}})]),e._l(e.ciudades,(function(t){return s(a["a"],{key:t.slug,staticClass:"mt-2",attrs:{block:"",large:"","data-testid":"CityBranch-"+t.label},domProps:{innerHTML:e._s(t.label)},on:{click:function(s){return e.setCiudad(t)}}})}))],2)],1)},c=[],l={name:"citysBranch",props:{instance:Object,ciudades:Array,service:String},methods:{setCiudad(e){this.$emit("setCiudad",e)}}},o=l,u=t("2877"),d=Object(u["a"])(o,n,c,!1,null,null,null);s["a"]=d.exports}}]); //# sourceMappingURL=branchToTakeAway.8a93d4a0.js.map