PageSourceSearch

https://www.liverpoolphil.com/dist/assets/quick-buy-oWmzg-IZ.js

js liverpoolphil.com collected 2026-10-02 03:44:55 UTC 4,560 bytes, 2 lines download raw bytes

1import{c as a,o as n,d as i,r as o,t as l,a as d,n as c,w as k,k as u}from"./app-BZOzIUJT.js";import{_ as p}from"./_plugin-vue_export-helper-DlAUqK2U.js";const h={name:"quick-buy",data:function(){return{loading:!1,filteredTickets:null,alreadyInBasket:!1,seatsAvailable:!0,error:null,success:null,info:null,seatType:"",haveSeats:!1,currentBasketIds:[],currentInstanceIds:[],currentPlanIds:[],currentEventIds:[],currentPlan:"",allPlanIds:[],instancePlanId:"",currentTickets:[],currentAreaId:"",currentSeatIds:[],currentUnnamedSeats:{}}},props:{spektrixUrl:{type:String},spektrixInstanceId:{type:String},basketUrl:{type:String},enabled:{type:Boolean,default:!0},clickHandler:{type:Function,default:e=>e()}},computed:{basketSeats(){if(this.seatType=="Named")return this.currentPlan+" "+this.currentBasketIds.join(", ");if(Object.keys(this.currentUnnamedSeats).length){let e=[];for(const[s,t]of Object.entries(this.currentUnnamedSeats))e.push("x".concat(t," ").concat(s));return e.join(", ")}else return""},buttonText(){return this.seatsAvailable?this.currentBasketIds.length||Object.keys(this.currentUnnamedSeats).length?"Add seats":"Your basket does not contain seats for this venue":"Unavailable"},basketData(){return this.$store.state.spektrixBasket},hasVenueInBasket(){return this.allPlanIds.includes(this.instancePlanId)},isEmpty(){return!(this.info&&this.enabled||this.hasVenueInBasket&&!this.alreadyInBasket&&this.enabled||this.enabled&&(this.loading||this.error||this.success))}},mounted(){this.$store.dispatch("getSpektrixBasket",{url:this.spektrixUrl})},methods:{processBasket(){const e=this;e.basketData.tickets.length==0||(e.haveSeats=!0,u.get(e.$props.spektrixUrl+"/api/v3/instances/"+e.$props.spektrixInstanceId,{withCredentials:!0}).then(function(s){e.instancePlanId=s.data.planId,e.basketData.tickets.forEach(t=>{t.instance.planId==s.data.planId&&(e.currentPlan=t.planName,e.currentAreaId=t.planId,e.allPlanIds.push(t.instance.planId),(t.event.i
1d!=e.currentEventId||t.instance.id!=e.currentInstanceId)&&(e.currentEventId=t.event.id,e.currentInstanceId=t.instance.id,e.currentBasketIds=[],e.currentTickets=[],e.currentSeatIds=[]),t.instance.id==e.$props.spektrixInstanceId?(e.alreadyInBasket=!0,e.info="This event is already in your basket"):t.seatName.length?(e.seatType="Named",e.currentSeatIds.push(t.seat.id),e.currentBasketIds.push(t.seatName),e.currentTickets.push({Instance:e.$props.spektrixInstanceId,Seat:t.seat.id?t.seat.id:!1,TicketType:t.type.id})):(e.seatType="Unnamed",e.increment(e.currentUnnamedSeats,t.ticketType.name),e.currentTickets.push({Instance:e.$props.spektrixInstanceId,TicketType:t.type.id,SeatingPlan:t.planId})))})}))},bookCurrentSeats(){const e=this;e.loading=!0,e.seatsAvailable&&u.post(e.$props.spektrixUrl+"/api/v3/basket/tickets",e.currentTickets,{withCredentials:!0}).then(function(s){e.loading=!1,s.status==200?(e.alreadyInBasket=!0,e.success="Successfully added, go to basket"):e.error="Same seats not available"}).catch(function(s){e.loading=!1,s.response.data.status==409,e.error="Same seats not available"})},increment(e,s){e[s]=e[s]||0,e[s]++}},watch:{basketData:function(e){this.processBasket()}}},f=["textContent"],b={key:1,class:"c-quick-buy-action__seats"},I={key:0,class:"c-quick-buy-action__seats-info"},y=["disabled","textContent"],m={key:2,class:"c-quick-buy-action__live","aria-live":"polite"},v={key:0,class:"c-quick-buy-action__info"},_=["textContent"],S=["href","textContent"];function B(e,s,t,g,T,r){return n(),a("div",{class:c(["c-quick-buy-action",{"is-empty":r.isEmpty}])},[e.info&&t.enabled?(n(),a("p",{key:0,class:"c-quick-buy-action__info",textContent:l(e.info)},null,8,f)):i("",!0),o(e.$slots,"default"),r.hasVenueInBasket&&!e.alreadyInBasket&&t.enabled?(n(),a("div",b,[e.alreadyInBasket?i("",!0):(n(),a("p",I,l(r.basketSeats),1)),d("button",{onClick:s[0]||(s[0]=k(C=>t.clickHandler(r.bookCurrentSeats),["prevent"])),class:c(["o-button o-button--primary-invert",{"o-button--loading":e.loading,"o-button--disabled":!e.seatsAvailable}]),disabled:!e.seatsAvailable,textContent:l(r.buttonText)},null,10,y)])):i("",!0),t.enabled?(n(),a("div",m,[e.loading?(n(),a("p",v," Checking availability ")):e.error?(n(),a("p",{key:1,class:"c-quick-buy-action__info c-quick-buy-action__info--error",textContent:l(e.error)},null,8,_)):e.success?(n(),a("a",{key:2,class:"c-quick-buy-action__info c-quick-buy-action__info--success",href:t.basketUrl,textContent:l(e.success)},null,8,S)):i("",!0)])):i("",!0)],2)}const q=p(h,[["render",B]]);export{q as default};
2//# sourceMappingURL=quick-buy-oWmzg-IZ.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.