text: (window.webpackJsonp=window.webpackJsonp||[]).push([[1],[,,,,function(t,e,o){var i=o(25);"string"==typeof i&&(i=[[t.i,i,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};o(10)(i,a);i.locals&&(t.exports=i.locals)},function(t,e,o){var i=o(27);"string"==typeof i&&(i=[[t.i,i,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};o(10)(i,a);i.locals&&(t.exports=i.locals)},function(t,e,o){"use strict";var i={data:function(){return{types:[]}},props:["availability","reservation","booking","errors","mode"],methods:{checkAvailability:function(){this.$emit("checkAvailability")},clear:function(){this.$emit("clear")}},mounted:function(){var t=this;fetch("api/typesRoom").then((function(t){return t.json()})).then((function(e){return t.types=e.typesRoom}))}},a=o(1),n=Object(a.a)(i,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[t.reservation?o("div",[o("h1",[t._v(t._s("edit"==t.mode?"Reservation updated":"Thanks for your reservation"))]),t._v(" "),o("p",[t._v("We have saved a reservation for "+t._s(t.reservation.client_name)+". We'll wait for you on "+t._s(t.reservation.checkin))])]):o("div",["edit"==t.mode?o("div",{staticClass:"input-group mb-3"},[t._m(0),t._v(" "),o("select",{directives:[{name:"model",rawName:"v-model",value:t.booking.type_id,expression:"booking.type_id"}],staticClass:"custom-select",attrs:{id:"inputGroupSelect01"},on:{change:function(e){var o=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.booking,"type_id",e.target.multiple?o:o[0])}}},[o("option",[t._v("Choose...")]),t._v(" "),t._l(t.types,(function(e){return o("option",{key:e.id,domProps:{value:e.id}},[t._v(t._s(e.name))])}))],2)]):t._e(),t._v(" "),o("p",[t._v("Check availability in our family room service. Indicate the desired date for your reservation.")]),t._v(" "),o("div",{staticClass:"row"},[o("div",{staticClass:"form-group col-6 pr-0"},[o("label",{attrs:{for:"dateCheckin"}},[t._v("From")]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.booking.checkin,expression:"booking.checkin"}],staticClass:"form-control",attrs:{type:"date",id:"dateCheckin","aria-describedby":"emailHelp"},domProps:{value:t.booking.checkin},on:{input:function(e){e.target.composing||t.$set(t.booking,"checkin",e.target.value)}}}),t._v(" "),o("small",{staticClass:"form-text text-danger",attrs:{id:"emailHelp"}},[t._v(t._s(t.errors.checkin?t.errors.checkin[0]:""))])]),t._v(" "),o("div",{staticClass:"form-group col-6 pl-0"},[o("label",{attrs:{for:"dateCheckout"}},[t._v("To")]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.booking.checkout,expression:"booking.checkout"}],staticClass:"form-control",attrs:{type:"date",id:"dateCheckout","aria-describedby":"emailHelp"},domProps:{value:t.booking.checkout},on:{input:function(e){e.target.composing||t.$set(t.booking,"checkout",e.target.value)}}}),t._v(" "),o("small",{staticClass:"form-text text-danger",attrs:{id:"emailHelp"}},[t._v(t._s(t.errors.checkout?t.errors.checkout[0]:""))])])]),t._v(" "),null==t.availability?o("button",{staticClass:"btn btn-success",attrs:{type:"button"},on:{click:t.checkAvailability}},[t._v("Check availability")]):t._e(),t._v(" "),t.availability>0||"edit"==t.mode?[t.availability>0||"edit"==t.mode?o("div",{staticClass:"form-group"},[t.availability>0?o("p",[t._v("\n          YES! We have "+t._s(t.availability)+" rooms in this period. Complete this form for save your reservation, or\n          "),o("br"),t._v(" "),o("button",{staticClass:"btn btn-success",on:{click:t.clear}},[t._v("Check other date")])]):t._e(),t._v(" "),o("label",{attrs:{for:"clientName"}},[t._v("Your name")]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.booking.client_name,expression:"booking.client_name"}],staticClass:"form-control",attrs:{type:"text",id:"clientName","aria-describedby":"emailHelp"},domProps:{value:t.booking.client_name},on:{input:function(e){e.target.composing||t.$set(t.booking,"client_name",e.target.value)}}}),t._v(" "),o("small",{staticClass:"form-text text-danger",attrs:{id:"emailHelp"}},[t._v(t._s(t.errors.client_name?t.errors.client_name[0]:""))])]):o("div",[o("p",[t._v("Sorry! There are not availability in this date range.")])])]:t._e()],2)])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"input-group-prepend"},[e("label",{staticClass:"input-group-text",attrs:{for:"inputGroupSelect01"}},[this._v("Type")])])}],!1,null,null,null);e.a=n.exports},function(t,e,o){"use strict";var i={props:{title:{type:String,default:"Título"},showModal:{type:Boolean,default:!0}},data:function(){return{name:null}},methods:{close:function(){this.$emit("update:showModal",!1)}}},a=(o(24),o(1)),n=Object(a.a)(i,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"modal-mask"},[o("div",{staticClass:"modal-wrapper"},[o("div",{staticClass:"modal-dialog"},[o("div",{staticClass:"modal-content"},[o("div",{staticClass:"modal-header"},[o("h2",{staticClass:"modal-title"},[t._v(t._s(t.title))]),t._v(" "),o("button",{staticClass:"close",attrs:{type:"button","aria-label":"close"},on:{click:t.close}},[o("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])]),t._v(" "),o("div",{staticClass:"modal-body"},[t._t("content")],2),t._v(" "),o("div",{staticClass:"modal-footer"},[t._t("actions")],2)])])])])}),[],!1,null,null,null);e.a=n.exports},,,,,,,,,,,,,,,,,function(t,e,o){"use strict";var i=o(4);o.n(i).a},function(t,e,o){(t.exports=o(9)(!1)).push([t.i,".modal-mask{position:fixed;z-index:9998;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.5);display:table;transition:opacity .3s ease}.modal-wrapper{display:table-cell;vertical-align:middle}",""])},function(t,e,o){"use strict";var i=o(5);o.n(i).a},function(t,e,o){(t.exports=o(9)(!1)).push([t.i,".container{margin-bottom:40px!important}",""])},,function(t,e,o){"use strict";o.r(e);var i=o(7),a=o(6);function n(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,i)}return o}function r(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?n(Object(o),!0).forEach((function(e){s(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function s(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var l={data:function(){return{showModal:!1,reservation:null,typesRoom:[],availability:null,booking:{type_id:null,client_name:"",checkin:null,checkout:null},errors:[]}},components:{ModalMessage:i.a,FormBooking:a.a},methods:{clear:function(){this.availability=null,this.booking.client_name="",this.booking.checkin=null,this.booking.checkout=null},openModal:function(t){this.showModal=!0,this.booking.type_id=t},closeModal:function(t){this.clear(),this.showModal=!1,this.availability=null,this.booking.type_id=null},checkAvailability:function(){var t=this;fetch("api/room/availability?"+new URLSearchParams(this.booking)).then((function(t){return t.json()})).then((function(e){e.ok?(t.availability=e.availability,t.errors=[]):t.errors=e.errors}))},saveReservation:function(){var t=this;fetch("api/room/reservation",{method:"POST",body:JSON.stringify(this.booking),headers:{"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(e){e.ok?(t.reservation=e.reservation,t.errors=[]):t.errors=e.errors}))}},mounted:function(){var t=this;fetch("api/typesRoom").then((function(t){return t.json()})).then((function(e){return t.typesRoom=e.typesRoom.map((function(t){return r(r({},t),{},{image:"../../../images/room".concat(t.id,".png")})}))}))}},c=(o(26),o(1)),u=Object(c.a)(l,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"container m-auto pt-5"},[o("h2",{staticClass:"text-center mb-3"},[t._v("Services")]),t._v(" "),o("p",{staticClass:"display-4 text-center"},[t._v("What are you looking for?")]),t._v(" "),o("div",{staticClass:"card-deck"},t._l(t.typesRoom,(function(e){return o("div",{key:e.id,staticClass:"card"},[o("img",{staticClass:"card-img-top",attrs:{src:e.image,alt:e.name}}),t._v(" "),o("div",{staticClass:"card-body"},[o("h4",{staticClass:"card-title"},[t._v(t._s(e.name))]),t._v(" "),o("p",{staticClass:"card-text"},[t._v("This room is perfect if your are looking for "+t._s(e.bed_quantity)+" beds.")])]),t._v(" "),o("div",{staticClass:"card-footer"},[o("button",{staticClass:"btn btn-primary btn-warning",on:{click:function(o){return t.openModal(e.id)}}},[t._v("Booking")]),t._v(" "),o("small",{staticClass:"text-muted"},[t._v("Price $ 189,00")])])])})),0),t._v(" "),t.showModal?o("transition",{attrs:{name:"modal"}},[o("modal-message",{attrs:{title:"Booking",showModal:t.showModal},on:{"update:showModal":function(e){t.showModal=e},"update:show-modal":function(e){t.showModal=e}}},[o("template",{slot:"content"},[o("form-booking",{attrs:{mode:"create",availability:t.availability,reservation:t.reservation,booking:t.booking,errors:t.errors},on:{checkAvailability:t.checkAvailability,clear:t.clear}})],1),t._v(" "),o("template",{slot:"actions"},[o("button",{staticClass:"btn btn-secondary",on:{click:t.closeModal}},[t._v("Close")]),t._v(" "),t.reservation?t._e():o("button",{staticClass:"btn btn-warning",on:{click:t.saveReservation}},[t._v("Done")])])],2)],1):t._e()],1)}),[],!1,null,null,null);e.default=u.exports}]]);