%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/client/
Upload File :
Create Path :
Current File : //home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/client/cabb4bf.js

(window.webpackJsonp=window.webpackJsonp||[]).push([[50,36],{409:function(t,e,r){"use strict";r.r(e);var n=r(0),o=(r(3),r(30),{props:{value:{required:!0},selected_slots:{type:Object,required:!0},working:{type:Boolean,required:!0},button_text:{type:String,required:!0},nextStep:{type:Function,required:!0}},data:function(){return{loading:!0}},computed:{therapist:function(){return this.$store.state.booking.therapist},sessions:function(){return this.$store.state.booking.summary.sessions},totals:function(){return this.$store.state.booking.summary.totals},selected_session:function(){return this.$store.state.booking.summary.session}},mounted:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("booking/summary/get",{user_id:t.therapist.user.id,sessions:t.selected_slots,sessions_count:Object.keys(t.selected_slots).length}).then((function(){t.loading=!1}));case 2:case"end":return e.stop()}}),e)})))()},methods:{goBack:function(){this.$emit("input",1)}}}),l=r(10),component=Object(l.a)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("span",{staticClass:"block text-center text-3xl font-bold mb-6"},[t._v("Summary")]),t._v(" "),r("p",[t._v("You are nearly there. Please carefully check all details are correct before proceeding to payment.")]),t._v(" "),r("div",{staticClass:"my-2 mb-6"},[r("div",{staticClass:"grid grid-cols-3 gap-3 border-b-2 border-gray py-6"},[r("span",{staticClass:"uppercase text-sm"},[t._v("Therapist")]),t._v(" "),r("span",{staticClass:"col-span-2 text-sm"},[t._v(t._s(t.therapist.user.full_name))])]),t._v(" "),0==t.loading?r("div",{staticClass:"border-b-2 border-gray py-4"},[r("div",{staticClass:"grid grid-cols-3 gap-3 py-2"},[r("span",{staticClass:"uppercase text-sm"},[t._v("No. Of Sessions")]),t._v(" "),r("span",{staticClass:"text-sm"},[t._v(t._s(Object.keys(t.selected_slots).length))])]),t._v(" "),t._l(t.sessions,(function(e,n){return r("div",{key:n},[r("div",{staticClass:"grid grid-cols-6 gap-3 py-2"},[r("span",{staticClass:"col-span-2 uppercase text-sm"},[t._v("Session "+t._s(n+1))]),t._v(" "),r("span",{staticClass:"col-span-3 text-sm"},[t._v(t._s(t.$moment.utc(e.slot.start).format("D MMM Y - H:mm")+" - "+t.$moment.utc(e.slot.end).format("H:mm")))]),t._v(" "),r("div",{staticClass:"col-span-1 flex items-center justify-end"},[r("span",{staticClass:"text-sm"},[t._v(t._s(e.item_total.formatted))])])]),t._v(" "),r("div",{staticClass:"grid grid-cols-3 gap-3 py-2"},[r("span",{staticClass:"uppercase text-sm"},[t._v("Session Type")]),t._v(" "),r("span",{staticClass:"text-sm"},[t._v(t._s(e.session_name))]),t._v(" "),r("div",{staticClass:"flex items-center justify-end"},[r("button",{staticClass:"text-sm uppercase underline",attrs:{type:"button"},on:{click:t.goBack}},[t._v("Change")])])])])}))],2):t._e(),t._v(" "),0==t.loading?r("div",{staticClass:"grid grid-cols-2 gap-2 border-b-2 border-gray py-6"},[r("span",{staticClass:"uppercase text-sm"},[t._v("Total Price")]),t._v(" "),r("span",{staticClass:"uppercase font-bold flex items-center justify-end"},[t._v(t._s(t.totals.formatted))])]):r("div",{staticClass:"flex items-center justify-center py-6"},[r("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v("\n      Loading...\n    ")])]),t._v(" "),r("div",{staticClass:"flex flex-col items-center justify-center"},[r("button",{staticClass:"btn btn-primary btn-small rounded-full w-full sm:w-auto",attrs:{disabled:t.selected_slots.length<1,type:"button"},on:{click:function(e){return t.nextStep()}}},[0==t.working?r("span",[t._v(t._s(t.button_text))]):r("span",{staticClass:"flex items-center justify-center"},[r("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v(" "),r("span",[t._v("Processing")])])]),t._v(" "),r("button",{staticClass:"mt-6 uppercase text-blue-light text-sm",attrs:{type:"button"},on:{click:t.goBack}},[t._v("Go Back")])])])}),[],!1,null,null,null);e.default=component.exports},503:function(t,e,r){"use strict";r.r(e);r(28),r(47),r(27),r(48);var n=r(0),o=r(13),l=r(25);r(3),r(214),r(31),r(30),r(60),r(53),r(61);function c(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}return e}function d(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var m={head:function(){return{titleTemplate:"New Booking | %s"}},data:function(){return{step:1,isLoaded:!0,loading:!1,working:!1,timer:null,minDate:null,maxDate:null,availability:{},available_dates:[],selected_dates:[],selected_slots:{}}},computed:{therapist:function(){return this.$store.state.booking.therapist},client:function(){return this.$store.state.booking.client},totals:function(){return this.$store.state.booking.summary.totals},isSlotSelected:function(){for(var object=this.selected_slots,t=0,e=Object.entries(object);t<e.length;t++){var r=Object(l.a)(e[t],2),n=(r[0],r[1]);if(null!==n.slot&&null!==n.session_id&&null!==n.product_id)return!0}return!1},selectedSlots:function(){var t=this.selected_slots;return Object.keys(t).filter((function(e){return null!==t[e].slot&&null!==t[e].session_id&&null!==t[e].product_id})).reduce((function(e,r){return d(d({},e),{},Object(o.a)({},r,t[r]))}),{})}},mounted:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.$route.query,r=new Date,t.minDate=t.$moment(r).add(1,"days").format("Y-MM-DD"),e.next=5,t.$axios.post("/availability/"+t.therapist.id,{dates:t.selected_dates}).then((function(e){t.loading=!1,t.availability=e.data.availability,t.available_dates=e.data.available_dates,t.minDate=t.available_dates[0],t.maxDate=t.available_dates[t.available_dates.length-1],t.selected_dates=[t.available_dates[0]]})).catch((function(e){t.loading=!1,t.$toast.error(e).goAway(3e3)}));case 5:case"end":return e.stop()}}),e)})))()},asyncData:function(t){return Object(n.a)(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.store,n=t.params,e.next=3,r.dispatch("booking/get",n.therapist_slug);case 3:return e.next=5,r.dispatch("booking/getClient",n.id);case 5:case"end":return e.stop()}}),e)})))()},methods:{changeDates:function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((function(){t.getTimes()}),250)},getTimes:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.$route.query,t.loading=!0,e.next=4,t.$axios.post("/availability/"+t.therapist.id,{dates:t.selected_dates}).then((function(e){t.loading=!1,t.availability=e.data.availability,t.available_dates=e.data.available_dates,t.selected_slots=e.data.selected_slots,t.minDate=t.available_dates[0],t.maxDate=t.available_dates[t.available_dates.length-1],1==t.isLoaded&&void 0!==r.time&&void 0!==r.date&&(t.selected_slots[r.date].slot=r.time,t.selected_slots[r.date].session_types=t.availability[r.date][0].session_types,t.selected_slots[r.date].session_id=t.availability[r.date][0].session_types[0].id,t.selected_slots[r.date].product_id=t.therapist.products[0].id,t.isLoaded=!1)})).catch((function(e){t.loading=!1,t.$toast.error(e).goAway(3e3)}));case 4:case"end":return e.stop()}}),e)})))()},nextStep:function(t){var e=this;this.$refs.form.validate().then((function(r){r&&(e.step=t)}))},createBooking:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.working=!0,e.next=3,t.$axios.post("/therapist/bookings/create/"+t.client.id,{sessions:t.selectedSlots,amount:t.totals.amount,therapist_id:t.therapist.id}).then((function(e){200==e.status&&(t.$toast.success(e.data).goAway(3e3),t.$router.push("/therapist/clients/"+t.client.id))})).catch((function(e){t.$toast.error(e.response.data).goAway(3e3),t.working=!1}));case 3:case"end":return e.stop()}}),e)})))()},getDisabledDates:function(t){var e=this.$moment(t).format("Y-MM-DD");return!this.available_dates.includes(e)}}},v=r(10),component=Object(v.a)(m,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"page-wrapper"},[r("div",{staticClass:"py-10 sm:py-20 bg-white"},[r("div",{staticClass:"relative z-20 text-center"},[r("figure",{staticClass:"relative inline-block w-32 mb-4 sm:mb-8"},[r("div",{staticClass:"absolute top-0 left-0 w-full h-full border-15",class:"tas-border-"+t.therapist.colour}),t._v(" "),r("img",{staticClass:"block w-full",attrs:{src:t.client.photo_url,alt:t.client.first_name}})]),t._v(" "),r("h1",{staticClass:"mb-6"},[r("span",{staticClass:"block w-full text-5xl md:text-7xl leading-none "},[t._v(t._s(t.client.first_name))]),t._v(" "),r("span",{staticClass:"block w-full uppercase text-2xl"},[t._v(t._s(t.client.last_name))])]),t._v(" "),r("NuxtLink",{staticClass:"uppercase text-blue-light",attrs:{to:"/therapist/clients"}},[t._v("Back to Clients")])],1)]),t._v(" "),r("div",{staticClass:"bg-gray px-4 py-6 sm:py-10 sm:px-8 md:py-20"},[r("div",{staticClass:"max-w-lg w-full mx-auto"},[r("div",{staticClass:"py-8 px-6 sm:py-12 sm:px-16 rounded-xl bg-white"},[1==t.step?[r("ValidationObserver",{ref:"form"},[r("form",{attrs:{role:"form",method:"POST"},on:{submit:function(e){return e.preventDefault(),t.nextStep(2)}}},[r("span",{staticClass:"block text-center text-3xl font-bold mb-6"},[t._v("Your Session")]),t._v(" "),r("t-calendar",{attrs:{multiple:"",minDate:t.minDate,maxDate:t.maxDate,yearsPerView:1,disabledDates:t.getDisabledDates,inline:""},on:{"user-date-changed":t.changeDates},model:{value:t.selected_dates,callback:function(e){t.selected_dates=e},expression:"selected_dates"}}),t._v(" "),r("div",{staticClass:"mb-6"},[r("span",{staticClass:"block font-bold mb-3"},[t._v("Select time")]),t._v(" "),1==t.loading?r("div",{staticClass:"flex items-center justify-center"},[r("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v("\n                  Loading Times...\n                ")]):0!==t.availability.length||null==t.availability.length?r("div",t._l(t.availability,(function(e,n){return r("div",{key:n,staticClass:"mb-3"},[e.length>0?[r("span",{staticClass:"block mb-2 font-bold"},[t._v(t._s(t.$moment(n).format("DD/MM/Y")))]),t._v(" "),r("div",{staticClass:"grid grid-cols-2 sm:grid-cols-3 gap-3"},t._l(e,(function(slot,e){return r("label",{key:e,staticClass:"border border-black px-3 py-2 rounded-md cursor-pointer text-center text-sm",class:t.selected_slots[n].slot==slot.start?"bg-yellow":""},[r("input",{directives:[{name:"model",rawName:"v-model",value:t.selected_slots[n].slot,expression:"selected_slots[key].slot"}],staticClass:"hidden",attrs:{type:"radio",id:"times-"+e,name:"times-"+e},domProps:{value:slot.start,checked:t._q(t.selected_slots[n].slot,slot.start)},on:{change:[function(e){return t.$set(t.selected_slots[n],"slot",slot.start)},function(e){t.selected_slots[n].session_types=slot.session_types}]}}),t._v("\n                          "+t._s(t.$moment.utc(slot.start).format("H:mm"))+"\n                        ")])})),0),t._v(" "),r("div",{staticClass:"mt-4 mb-6"},[r("span",{staticClass:"block text-sm font-bold mb-2"},[t._v("Session type")]),t._v(" "),t.selected_slots[n].session_types?r("div",{staticClass:"grid grid-cols-2 sm:grid-cols-3 gap-3 mb-3"},t._l(t.selected_slots[n].session_types,(function(e,o){return r("label",{key:o,staticClass:"border border-black px-3 py-2 rounded-md cursor-pointer text-center text-sm",class:e.id==t.selected_slots[n].session_id?"bg-yellow":""},[r("input",{directives:[{name:"model",rawName:"v-model",value:t.selected_slots[n].session_id,expression:"selected_slots[key].session_id"}],staticClass:"hidden",attrs:{type:"radio",name:"session-"+n},domProps:{value:e.id,checked:t._q(t.selected_slots[n].session_id,e.id)},on:{change:function(r){return t.$set(t.selected_slots[n],"session_id",e.id)}}}),t._v("\n                            "+t._s(e.name)+"\n                          ")])})),0):t._e(),t._v(" "),r("t-radio-group",{attrs:{classes:{groupWrapper:"grid grid-cols-2 sm:grid-cols-3 gap-3",label:"block pl-2.5",input:"rounded-md w-5 h-5 text-black transition duration-100 ease-in-out border-gray-300 shadow-sm focus:border-black focus:ring-2 focus:ring-black focus:outline-none focus:ring-opacity-50 focus:ring-offset-0  disabled:opacity-50 disabled:cursor-not-allowed",inputWrapper:"inline-flex",wrapper:"flex items-center my-1"},textAttribute:"type",valueAttribute:"id",name:"product-"+n,options:t.therapist.products},model:{value:t.selected_slots[n].product_id,callback:function(e){t.$set(t.selected_slots[n],"product_id",e)},expression:"selected_slots[key].product_id"}})],1)]:[r("span",{staticClass:"block mb-2 text-sm font-bold"},[t._v(t._s(t.$moment(n).format("DD/MM/Y")))]),t._v(" "),r("p",[t._v("No availability for this day")])]],2)})),0):r("div",[r("p",[t._v("No availability found")])])]),t._v(" "),r("div",{staticClass:"mt-6 flex items-center justify-center"},[r("button",{staticClass:"btn btn-primary btn-small rounded-full w-full sm:w-auto",attrs:{disabled:0==t.isSlotSelected,type:"submit"}},[0==t.working?r("span",[t._v("Next")]):r("span",{staticClass:"flex items-center justify-center"},[r("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v(" "),r("span",[t._v("Processing")])])])])],1)])]:r("SummaryStep",{attrs:{selected_slots:t.selectedSlots,working:t.working,nextStep:t.createBooking,button_text:"Create Booking"},model:{value:t.step,callback:function(e){t.step=e},expression:"step"}})],2)])])])}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{SummaryStep:r(409).default})}}]);

Zerion Mini Shell 1.0