encore-api-services
Advanced tools
Comparing version 0.0.21 to 0.0.22
@@ -0,4 +1,3 @@ | ||
import { Product } from '../../content-service/models'; | ||
import { BasketItemData, ProductType, Seat } from '../typings'; | ||
import { Product } from '../../content-service/models'; | ||
import { Image } from '../../content-service/typings'; | ||
import { Amount } from '../../typings'; | ||
@@ -12,8 +11,10 @@ export declare class BasketItem { | ||
private readonly faceValue; | ||
private readonly originalSalePrice; | ||
private readonly salePrice; | ||
private readonly adjustedAmount; | ||
private readonly date; | ||
private readonly seats; | ||
private readonly venueId; | ||
private productPromise; | ||
private images; | ||
private readonly repository; | ||
private productDetails; | ||
constructor(basketItemData: BasketItemData); | ||
@@ -32,5 +33,10 @@ getId(): string; | ||
getSalePrice(): Amount; | ||
getOriginalSalePrice(): Amount; | ||
getAdjustedAmount(): Amount; | ||
getFaceValueAmount(): number; | ||
getSalePriceAmount(): number; | ||
getOriginalSalePriceAmount(): number; | ||
hasDiscount(): boolean; | ||
getPromotionDiscount(): number; | ||
hasPromotionDiscount(): boolean; | ||
getDiscount(): number; | ||
@@ -41,7 +47,9 @@ getTotalPrice(): number; | ||
getSeats(): Seat[]; | ||
setProductDetails(product: Promise<Product>): void; | ||
getProductDetails(): Promise<Product>; | ||
setImages(images: Image[]): Image[]; | ||
getImages(): Image[]; | ||
getImages(): any; | ||
getVenueId(): string; | ||
isTicket(): boolean; | ||
isUkShow(): Promise<boolean>; | ||
isUsaShow(): Promise<boolean>; | ||
getCountryCode(): Promise<string>; | ||
} |
@@ -16,2 +16,3 @@ import { BasketItem } from './basket-item'; | ||
getPostage(): BasketItem; | ||
getTickets(): BasketItem[]; | ||
} |
import { BasketData } from '../typings'; | ||
import { BasketItemsCollection } from './basket-items-collection'; | ||
import { BasketItem } from './basket-item'; | ||
import { Delivery } from './delivery'; | ||
@@ -10,3 +11,4 @@ export declare class Basket { | ||
private readonly reference; | ||
private deliveriesPromise; | ||
private deliveries; | ||
private repository; | ||
constructor(basketData: BasketData); | ||
@@ -18,3 +20,2 @@ getExpiredDate(): Date; | ||
getItemsCollection(): BasketItemsCollection; | ||
setDeliveries(deliveries: Promise<Delivery[]>): void; | ||
getDeliveries(): Promise<Delivery[]>; | ||
@@ -27,3 +28,7 @@ isEmpty(): boolean; | ||
getBasketData(): BasketData; | ||
getUkShows(): BasketItem[]; | ||
getUsaShows(): BasketItem[]; | ||
isMixedBasket(): Promise<boolean>; | ||
private getCountyCodes; | ||
private reduceBasketItemsAmount; | ||
} |
@@ -5,3 +5,4 @@ import { Amount } from '../../typings'; | ||
Postage = "postage", | ||
Eticket = "eticket" | ||
Eticket = "eticket", | ||
Evoucher = "evoucher" | ||
} | ||
@@ -14,2 +15,3 @@ export declare enum BasketStatus { | ||
export interface Seat { | ||
itemReference: string; | ||
blockId: string; | ||
@@ -37,4 +39,5 @@ blockName: string; | ||
quantity: number; | ||
seats: Seat[]; | ||
items: Seat[]; | ||
salePrice: Amount; | ||
originalSalePrice: Amount; | ||
faceValue: Amount; | ||
@@ -62,6 +65,7 @@ adjustedAmount: Amount; | ||
interface RequestSeat { | ||
blockId: string; | ||
blockName: string; | ||
row: string; | ||
number: string; | ||
itemReference: string; | ||
blockId?: string; | ||
blockName?: string; | ||
row?: string; | ||
number?: string; | ||
locationDescription?: string; | ||
@@ -74,2 +78,3 @@ } | ||
quantity: number; | ||
items?: RequestSeat[]; | ||
id?: string; | ||
@@ -79,3 +84,2 @@ productName?: string; | ||
venueName?: string; | ||
seats?: RequestSeat[]; | ||
salePrice?: Amount; | ||
@@ -96,2 +100,7 @@ faceValue?: Amount; | ||
} | ||
export declare enum BasketLocationType { | ||
USA = "USA", | ||
UK = "GBR", | ||
Mixed = "Mixed" | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("apiServices",[],e):"object"==typeof exports?exports.apiServices=e():t.apiServices=e()}(window,function(){return 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}return 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=8)}([function(t,e,n){"use strict";var r=n(2),o=n(10),i=Object.prototype.toString;function u(t){return"[object Array]"===i.call(t)}function a(t){return null!==t&&"object"==typeof t}function s(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),u(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:u,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:s,isStream:function(t){return a(t)&&s(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";var r=n(0),o=n(12),i={"Content-Type":"application/x-www-form-urlencoded"};function u(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a={adapter:function(){var t;return"undefined"!=typeof XMLHttpRequest?t=n(3):"undefined"!=typeof process&&(t=n(3)),t}(),transformRequest:[function(t,e){return o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(u(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(u(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(t){a.headers[t]={}}),r.forEach(["post","put","patch"],function(t){a.headers[t]=r.merge(i)}),t.exports=a},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(0),o=n(13),i=n(15),u=n(16),a=n(17),s=n(4),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(18);t.exports=function(t){return new Promise(function(e,f){var l=t.data,p=t.headers;r.isFormData(l)&&delete p["Content-Type"];var h=new XMLHttpRequest,d="onreadystatechange",y=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||a(t.url)||(h=new window.XDomainRequest,d="onload",y=!0,h.onprogress=function(){},h.ontimeout=function(){}),t.auth){var v=t.auth.username||"",m=t.auth.password||"";p.Authorization="Basic "+c(v+":"+m)}if(h.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,h[d]=function(){if(h&&(4===h.readyState||y)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?u(h.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?h.response:h.responseText,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:n,config:t,request:h};o(e,f,r),h=null}},h.onerror=function(){f(s("Network Error",t,null,h)),h=null},h.ontimeout=function(){f(s("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var g=n(19),b=(t.withCredentials||a(t.url))&&t.xsrfCookieName?g.read(t.xsrfCookieName):void 0;b&&(p[t.xsrfHeaderName]=b)}if("setRequestHeader"in h&&r.forEach(p,function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete p[e]:h.setRequestHeader(e,t)}),t.withCredentials&&(h.withCredentials=!0),t.responseType)try{h.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){h&&(h.abort(),f(t),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(t,e,n){"use strict";var r=n(14);t.exports=function(t,e,n,o,i){var u=new Error(t);return r(u,e,n,o,i)}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){t.exports=n(9)},function(t,e,n){"use strict";var r,o,i,u;n.r(e),function(t){t.Dev="dev",t.Qa="qa",t.Staging="staging",t.Prod="prod"}(r||(r={})),function(t){t.Collection="collection",t.Postage="postage",t.Eticket="eticket"}(o||(o={})),function(t){t.Active="active",t.Expired="expired",t.Confirmed="confirmed"}(i||(i={})),function(t){t.Show="SHW",t.Attraction="ATT",t.Flexitickets="FLX",t.GiftVoucher="GVC",t.Postage="PST"}(u||(u={}));var a,s,c,f,l,p=n(7),h=n.n(p),d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},y=function(t){var e={baseURL:t},n=h.a.create(e);return n.interceptors.response.use(v,m),n},v=function(t){var e=t.data;return e?d({},t,{data:e.response}):t},m=function(t){var e=t.response;return e?e.data.context.errors:[]},g=((a={})[r.Dev]="https://basket.dev.aws.encoretix.co.uk/api/v1",a[r.Qa]="https://basket.qa.aws.encoretix.co.uk/api/v1",a[r.Staging]="https://basket.staging.aws.encoretix.co.uk/api/v1",a[r.Prod]="https://basket.prod.aws.encoretix.co.uk/api/v1",a),b=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},w=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},x=function(t){var e=y(g[t]);return{upsertBasket:function(t){return b(void 0,void 0,void 0,function(){return w(this,function(n){switch(n.label){case 0:return[4,e.patch("/baskets",t)];case 1:return[2,n.sent().data]}})})},getBasket:function(t){return b(void 0,void 0,void 0,function(){var n;return w(this,function(r){switch(r.label){case 0:return n="/baskets/"+t,[4,e.get(n)];case 1:return[2,r.sent().data]}})})},getDeliveries:function(t){return b(void 0,void 0,void 0,function(){var n;return w(this,function(r){switch(r.label){case 0:return n="/baskets/"+t+"/deliveryOptions",[4,e.get(n)];case 1:return[2,r.sent().data]}})})}}},k=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},S=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},P=function(){function t(t){var e=t.id,n=t.quantity,r=t.productId,o=t.productName,i=t.productType,u=t.faceValue,a=t.salePrice,s=t.date,c=t.seats,f=t.venueId;this.id=e,this.quantity=n,this.productId=r,this.productName=o,this.productType=i,this.faceValue=u,this.salePrice=a,this.date=new Date(s),this.seats=c,this.venueId=f}return t.prototype.getId=function(){return this.id},t.prototype.getQuantity=function(){return this.quantity},t.prototype.getProductId=function(){return this.productId},t.prototype.getProductName=function(){return this.productName},t.prototype.isVoucher=function(){return this.productType===u.GiftVoucher},t.prototype.isPostage=function(){return this.productType===u.Postage},t.prototype.isFlexiticket=function(){return this.productType===u.Flexitickets},t.prototype.isShow=function(){return this.productType===u.Show},t.prototype.isAttraction=function(){return this.productType===u.Attraction},t.prototype.getProductType=function(){return this.productType},t.prototype.getFaceValue=function(){return this.faceValue},t.prototype.getSalePrice=function(){return this.salePrice},t.prototype.getFaceValueAmount=function(){return this.faceValue.value},t.prototype.getSalePriceAmount=function(){return this.salePrice.value},t.prototype.hasDiscount=function(){return this.getFaceValueAmount()>this.getSalePriceAmount()},t.prototype.getDiscount=function(){return this.hasDiscount()?this.quantity*(this.getFaceValueAmount()-this.getSalePriceAmount()):0},t.prototype.getTotalPrice=function(){return this.quantity*this.getSalePriceAmount()},t.prototype.getPriceBeforeDiscount=function(){return this.quantity*this.getFaceValueAmount()},t.prototype.getDate=function(){return this.date},t.prototype.getSeats=function(){return this.seats},t.prototype.setProductDetails=function(t){this.productPromise=t},t.prototype.getProductDetails=function(){return k(this,void 0,void 0,function(){return S(this,function(t){return[2,this.productPromise]})})},t.prototype.setImages=function(t){return this.images=t},t.prototype.getImages=function(){return this.images},t.prototype.getVenueId=function(){return this.venueId},t}(),A=function(){return(A=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},C=function(){function t(t){this.items=[],this.items=t.map(function(t,e){return new P(A({},t,{id:(e+1).toString()}))})}return t.prototype.getItems=function(){return this.items.slice()},t.prototype.hasVoucher=function(){return this.items.some(function(t){return t.isVoucher()})},t.prototype.hasPostage=function(){return this.items.some(function(t){return t.isPostage()})},t.prototype.hasFlexiticket=function(){return this.items.some(function(t){return t.isFlexiticket()})},t.prototype.hasShow=function(){return this.items.some(function(t){return t.isShow()})},t.prototype.hasAttraction=function(){return this.items.some(function(t){return t.isAttraction()})},t.prototype.getLength=function(){return this.items.length},t.prototype.getAttractions=function(){return this.items.filter(function(t){return t.isAttraction()})},t.prototype.getFlexitickets=function(){return this.items.filter(function(t){return t.isFlexiticket()})},t.prototype.getPostage=function(){return this.items.find(function(t){return t.isPostage()})},t}(),T=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},D=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},E=function(){function t(t){this.basketData=t;var e=t.reservations,n=t.expiredAt,r=t.status,o=t.reference;this.itemsCollection=new C(e),this.expiredAt=new Date(n),this.status=r,this.reference=o}return t.prototype.getExpiredDate=function(){return this.expiredAt},t.prototype.isExpired=function(){return this.status===i.Expired||this.expiredAt<new Date},t.prototype.isPaid=function(){return this.status===i.Confirmed},t.prototype.getReference=function(){return this.reference},t.prototype.getItemsCollection=function(){return this.itemsCollection},t.prototype.setDeliveries=function(t){this.deliveriesPromise=t},t.prototype.getDeliveries=function(){return T(this,void 0,void 0,function(){return D(this,function(t){return[2,this.deliveriesPromise]})})},t.prototype.isEmpty=function(){return!this.itemsCollection.getLength()},t.prototype.getTotalPrice=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getTotalPrice()})},t.prototype.getTotalDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getDiscount()})},t.prototype.getTotalPriceBeforeDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getPriceBeforeDiscount()})},t.prototype.hasDiscount=function(){return this.itemsCollection.getItems().some(function(t){return t.hasDiscount()})},t.prototype.getBasketData=function(){return this.basketData},t.prototype.reduceBasketItemsAmount=function(t){return this.itemsCollection.getItems().reduce(t,0)},t}(),B=((s={})[o.Collection]={name:"Collect at the Box Office",voucherName:"Free postal delivery",attractionName:"Print at home voucher"},s[o.Postage]={name:"By Post – UK Addresses only"},s[o.Eticket]={name:"Print at Home"},s),j=function(){function t(t,e){var n=t.method,r=t.charge;this.amount=r,this.method=n,this.setName(e)}return t.prototype.getAmount=function(){return this.amount},t.prototype.getMethod=function(){return this.method},t.prototype.getName=function(){return this.name},t.prototype.setName=function(t){this.name=this.method===o.Collection?this.getCollectionDeliveryName(t):B[this.method].name},t.prototype.getCollectionDeliveryName=function(t){var e=B[o.Collection];return t.hasVoucher()?e.voucherName:t.hasAttraction()?e.attractionName:e.name},t}(),R=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},N=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},I=function(t){var e=x(t);return{getBasket:function(t){return R(void 0,void 0,void 0,function(){var n;return N(this,function(r){switch(r.label){case 0:return[4,e.getBasket(t)];case 1:return n=r.sent(),[2,new E(n)]}})})},getDeliveries:function(t,n){return R(void 0,void 0,void 0,function(){return N(this,function(r){switch(r.label){case 0:return[4,e.getDeliveries(t)];case 1:return[2,r.sent().map(function(t){return new j(t,n)})]}})})},createBasket:function(t){return R(void 0,void 0,void 0,function(){var n;return N(this,function(r){switch(r.label){case 0:return[4,e.upsertBasket(t)];case 1:return n=r.sent(),[2,new E(n)]}})})},addItems:function(t,n){return R(void 0,void 0,void 0,function(){var r,o;return N(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).reservations=r.reservations.concat(n),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new E(o)]}})})},removeItem:function(t,n){return R(void 0,void 0,void 0,function(){var r,o;return N(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).reservations.splice(n,1),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new E(o)]}})})}}};!function(t){t.Products="products"}(c||(c={})),function(t){t.Square="square",t.Landscape="landscape",t.Portrait="portrait",t.Default="default"}(f||(f={}));var O,q,F,L=((l={})[r.Dev]={api:"https://content-service.devtixuk.io/api/v1",images:"https://content-service.devtixuk.com/images"},l[r.Qa]={api:"https://content-service.qatixuk.io/api/v1",images:"https://content-service.qatixuk.com/images"},l[r.Staging]={api:"https://content-service.stagetixuk.io/api/v1",images:"https://content-service.stagetixuk.com/images"},l[r.Prod]={api:"https://content-service.tixuk.io/api/v1",images:"https://content-service.tixuk.com/images"},l),V=((O={})[f.Default]=[{screenSize:"xxl",imageSize:80},{screenSize:"xl",imageSize:64},{screenSize:"lg",imageSize:48},{screenSize:"md",imageSize:64},{screenSize:"sm",imageSize:64}],O),U=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},z=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},_=function(t){var e=L[t],n=y(e.api);return{getProduct:function(t){return U(void 0,void 0,void 0,function(){var e;return z(this,function(r){switch(r.label){case 0:return e="/products/"+t,[4,n.get(e)];case 1:return[2,r.sent().data]}})})},getImages:function(t,n,r){return void 0===r&&(r=f.Default),V[r].map(function(o){var i=o.screenSize,u=o.imageSize;return{screenSize:i,url:e.images+"/"+t+"/"+n+"/"+r+"?width="+u}})}}},G=function(){function t(t){var e=t.name,n=t.showType,r=t.venue,o=t.id;this.name=e,this.type=n,this.venue=r,this.id=o}return t.prototype.getName=function(){return this.name},t.prototype.getType=function(){return this.type},t.prototype.getVenue=function(){return this.venue},t}(),H=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},M=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},X=function(t){var e=_(t),n=e.getImages,r=e.getProduct;return{getProduct:function(t){return H(void 0,void 0,void 0,function(){var e;return M(this,function(n){switch(n.label){case 0:return[4,r(t)];case 1:return e=n.sent(),[2,new G(e)]}})})},getImages:n}};!function(t){t.Negative="negative",t.Positive="positive",t.Neutral="neutral"}(q||(q={}));var Q=((F={})[r.Dev]="https://venue-service.devtixuk.io/api/v1",F[r.Qa]="https://venue-service.qatixuk.io/api/v1",F[r.Staging]="https://venue-service.stagetixuk.io/api/api/v1",F[r.Prod]="https://venue-service.tixuk.io/api/v1",F),J=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},K=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},$=function(t){var e=y(Q[t]);return{getSeatAttributes:function(t){return J(void 0,void 0,void 0,function(){return K(this,function(n){switch(n.label){case 0:return[4,e.get("/venues/"+t+"/seats/attributes")];case 1:return[2,n.sent().data]}})})}}},W=function(){function t(t){this.seats=t}return t.prototype.getSeats=function(){return this.seats},t.prototype.getBlockName=function(){var t=this.seats[0];return t?t.area:""},t}(),Y=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{s(r.next(t))}catch(t){i(t)}}function a(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,a)}s((r=r.apply(t,e||[])).next())})},Z=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},tt=function(t){var e=$(t);return{getSeats:function(t){return Y(void 0,void 0,void 0,function(){var n;return Z(this,function(r){switch(r.label){case 0:return[4,e.getSeatAttributes(t)];case 1:return n=r.sent(),[2,new W(n)]}})})}}};n.d(e,"Environment",function(){return r}),n.d(e,"getBasketApi",function(){return x}),n.d(e,"getBasketRepository",function(){return I}),n.d(e,"DeliveryMethod",function(){return o}),n.d(e,"BasketStatus",function(){return i}),n.d(e,"ProductType",function(){return u}),n.d(e,"Basket",function(){return E}),n.d(e,"Delivery",function(){return j}),n.d(e,"BasketItemsCollection",function(){return C}),n.d(e,"BasketItem",function(){return P}),n.d(e,"getContentServiceRepository",function(){return X}),n.d(e,"getContentServiceApi",function(){return _}),n.d(e,"Product",function(){return G}),n.d(e,"EntityType",function(){return c}),n.d(e,"ImageOrientation",function(){return f}),n.d(e,"getVenueApi",function(){return $}),n.d(e,"getVenueRepository",function(){return tt}),n.d(e,"SeatsCollection",function(){return W})},function(t,e,n){"use strict";var r=n(0),o=n(2),i=n(11),u=n(1);function a(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var s=a(u);s.Axios=i,s.create=function(t){return a(r.merge(u,t))},s.Cancel=n(6),s.CancelToken=n(25),s.isCancel=n(5),s.all=function(t){return Promise.all(t)},s.spread=n(26),t.exports=s,t.exports.default=s},function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)} | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("apiServices",[],e):"object"==typeof exports?exports.apiServices=e():t.apiServices=e()}(window,function(){return 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}return 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=8)}([function(t,e,n){"use strict";var r=n(2),o=n(10),i=Object.prototype.toString;function u(t){return"[object Array]"===i.call(t)}function s(t){return null!==t&&"object"==typeof t}function a(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),u(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:u,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:a,isStream:function(t){return s(t)&&a(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";var r=n(0),o=n(12),i={"Content-Type":"application/x-www-form-urlencoded"};function u(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var s={adapter:function(){var t;return"undefined"!=typeof XMLHttpRequest?t=n(3):"undefined"!=typeof process&&(t=n(3)),t}(),transformRequest:[function(t,e){return o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(u(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(u(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(t){s.headers[t]={}}),r.forEach(["post","put","patch"],function(t){s.headers[t]=r.merge(i)}),t.exports=s},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(0),o=n(13),i=n(15),u=n(16),s=n(17),a=n(4),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(18);t.exports=function(t){return new Promise(function(e,f){var l=t.data,p=t.headers;r.isFormData(l)&&delete p["Content-Type"];var h=new XMLHttpRequest,d="onreadystatechange",y=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||s(t.url)||(h=new window.XDomainRequest,d="onload",y=!0,h.onprogress=function(){},h.ontimeout=function(){}),t.auth){var v=t.auth.username||"",g=t.auth.password||"";p.Authorization="Basic "+c(v+":"+g)}if(h.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,h[d]=function(){if(h&&(4===h.readyState||y)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?u(h.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?h.response:h.responseText,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:n,config:t,request:h};o(e,f,r),h=null}},h.onerror=function(){f(a("Network Error",t,null,h)),h=null},h.ontimeout=function(){f(a("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var m=n(19),w=(t.withCredentials||s(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;w&&(p[t.xsrfHeaderName]=w)}if("setRequestHeader"in h&&r.forEach(p,function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete p[e]:h.setRequestHeader(e,t)}),t.withCredentials&&(h.withCredentials=!0),t.responseType)try{h.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){h&&(h.abort(),f(t),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(t,e,n){"use strict";var r=n(14);t.exports=function(t,e,n,o,i){var u=new Error(t);return r(u,e,n,o,i)}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){t.exports=n(9)},function(t,e,n){"use strict";var r,o,i,u,s;n.r(e),function(t){t.Dev="dev",t.Qa="qa",t.Staging="staging",t.Prod="prod"}(r||(r={})),function(t){t.Collection="collection",t.Postage="postage",t.Eticket="eticket",t.Evoucher="evoucher"}(o||(o={})),function(t){t.Active="active",t.Expired="expired",t.Confirmed="confirmed"}(i||(i={})),function(t){t.Show="SHW",t.Attraction="ATT",t.Flexitickets="FLX",t.GiftVoucher="GVC",t.Postage="PST"}(u||(u={})),function(t){t.USA="USA",t.UK="GBR",t.Mixed="Mixed"}(s||(s={}));var a,c,f,l,p=n(7),h=n.n(p),d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},y=function(t){var e={baseURL:t},n=h.a.create(e);return n.interceptors.response.use(v,g),n},v=function(t){var e=t.data;return e?d({},t,{data:e.response}):t},g=function(t){var e=t.response;return e?e.data.context.errors:[]},m=((a={})[r.Dev]="https://basket.dev.aws.encoretix.co.uk/api/v1",a[r.Qa]="https://basket.qa.aws.encoretix.co.uk/api/v1",a[r.Staging]="https://basket.staging.aws.encoretix.co.uk/api/v1",a[r.Prod]="https://basket.prod.aws.encoretix.co.uk/api/v1",a),w=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},b=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},x=function(t){var e=y(m[t]);return{upsertBasket:function(t){return w(void 0,void 0,void 0,function(){return b(this,function(n){switch(n.label){case 0:return[4,e.patch("/baskets",t)];case 1:return[2,n.sent().data]}})})},getBasket:function(t){return w(void 0,void 0,void 0,function(){var n;return b(this,function(r){switch(r.label){case 0:return n="/baskets/"+t,[4,e.get(n)];case 1:return[2,r.sent().data]}})})},getDeliveries:function(t){return w(void 0,void 0,void 0,function(){var n;return b(this,function(r){switch(r.label){case 0:return n="/baskets/"+t+"/deliveryOptions",[4,e.get(n)];case 1:return[2,r.sent().data]}})})}}};!function(t){t.Products="products"}(c||(c={})),function(t){t.Square="square",t.Landscape="landscape",t.Portrait="portrait",t.Default="default"}(f||(f={}));var k,S,P,C,A,D=((l={})[r.Dev]={api:"https://content-service.qatixuk.io/api/v1",images:"https://content-service.devtixuk.com/images"},l[r.Qa]={api:"https://content-service.qatixuk.io/api/v1",images:"https://content-service.qatixuk.com/images"},l[r.Staging]={api:"https://content-service.stagetixuk.io/api/v1",images:"https://content-service.stagetixuk.com/images"},l[r.Prod]={api:"https://content-service.tixuk.io/api/v1",images:"https://content-service.tixuk.com/images"},l),T=((k={})[f.Default]=[{screenSize:"xxl",imageSize:80},{screenSize:"xl",imageSize:64},{screenSize:"lg",imageSize:48},{screenSize:"md",imageSize:64},{screenSize:"sm",imageSize:64}],k),E=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},B=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},j=function(t){var e=D[t],n=y(e.api);return{getProduct:function(t){return E(void 0,void 0,void 0,function(){var e;return B(this,function(r){switch(r.label){case 0:return e="/products/"+t,[4,n.get(e)];case 1:return[2,r.sent().data]}})})},getImages:function(t,n,r){return void 0===r&&(r=f.Default),T[r].map(function(o){var i=o.screenSize,u=o.imageSize;return{screenSize:i,url:e.images+"/"+t+"/"+n+"/"+r+"?width="+u}})}}},R=function(){function t(t){var e=t.name,n=t.showType,r=t.venue,o=t.id;this.name=e,this.type=n,this.venue=r,this.id=o}return t.prototype.getName=function(){return this.name},t.prototype.getType=function(){return this.type},t.prototype.getVenue=function(){return this.venue},t}(),I=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},O=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},N=function(t){var e=j(t),n=e.getImages,r=e.getProduct;return{getProduct:function(t){return I(void 0,void 0,void 0,function(){var e;return O(this,function(n){switch(n.label){case 0:return[4,r(t)];case 1:return e=n.sent(),[2,new R(e)]}})})},getImages:n}},q={setEnvironment:function(t){S=t},getRepository:function(){if(!S)return null;var t=N(S),e=J(S);return{getShowDetails:t.getProduct,getImages:t.getImages,getDeliveries:e.getDeliveries}}},U=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},L=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},F=function(){function t(t){this.repository=q.getRepository();var e=t.id,n=t.quantity,r=t.productId,o=t.productName,i=t.productType,u=t.faceValue,s=t.salePrice,a=t.originalSalePrice,c=t.adjustedAmount,f=t.date,l=t.items,p=t.venueId;this.id=e,this.quantity=n,this.productId=r,this.productName=o,this.productType=i,this.faceValue=u,this.salePrice=s,this.originalSalePrice=a,this.adjustedAmount=c,this.date=new Date(f),this.seats=l,this.venueId=p}return t.prototype.getId=function(){return this.id},t.prototype.getQuantity=function(){return this.quantity},t.prototype.getProductId=function(){return this.productId},t.prototype.getProductName=function(){return this.productName},t.prototype.isVoucher=function(){return this.productType===u.GiftVoucher},t.prototype.isPostage=function(){return this.productType===u.Postage},t.prototype.isFlexiticket=function(){return this.productType===u.Flexitickets},t.prototype.isShow=function(){return this.productType===u.Show},t.prototype.isAttraction=function(){return this.productType===u.Attraction},t.prototype.getProductType=function(){return this.productType},t.prototype.getFaceValue=function(){return this.faceValue},t.prototype.getSalePrice=function(){return this.salePrice},t.prototype.getOriginalSalePrice=function(){return this.originalSalePrice},t.prototype.getAdjustedAmount=function(){return this.adjustedAmount},t.prototype.getFaceValueAmount=function(){return this.faceValue.value},t.prototype.getSalePriceAmount=function(){return this.salePrice.value},t.prototype.getOriginalSalePriceAmount=function(){return this.originalSalePrice.value},t.prototype.hasDiscount=function(){return this.getFaceValueAmount()>this.getOriginalSalePriceAmount()},t.prototype.getPromotionDiscount=function(){return this.adjustedAmount.value},t.prototype.hasPromotionDiscount=function(){return!!this.getPromotionDiscount()},t.prototype.getDiscount=function(){return this.hasDiscount()?this.quantity*(this.getFaceValueAmount()-this.getOriginalSalePriceAmount()):0},t.prototype.getTotalPrice=function(){return this.quantity*this.getSalePriceAmount()},t.prototype.getPriceBeforeDiscount=function(){return this.quantity*this.getFaceValueAmount()},t.prototype.getDate=function(){return this.date},t.prototype.getSeats=function(){return this.seats},t.prototype.getProductDetails=function(){return U(this,void 0,void 0,function(){return L(this,function(t){return this.isTicket()?(this.productDetails||(this.productDetails=this.repository.getShowDetails(this.getProductId())),[2,this.productDetails]):[2,null]})})},t.prototype.getImages=function(){return this.repository.getImages(c.Products,this.getProductId())},t.prototype.getVenueId=function(){return this.venueId},t.prototype.isTicket=function(){return!this.isFlexiticket()&&!this.isPostage()},t.prototype.isUkShow=function(){return U(this,void 0,void 0,function(){return L(this,function(t){switch(t.label){case 0:return[4,this.getCountryCode()];case 1:return[2,t.sent()===s.UK]}})})},t.prototype.isUsaShow=function(){return U(this,void 0,void 0,function(){return L(this,function(t){switch(t.label){case 0:return[4,this.getCountryCode()];case 1:return[2,t.sent()===s.USA]}})})},t.prototype.getCountryCode=function(){return U(this,void 0,void 0,function(){return L(this,function(t){switch(t.label){case 0:return[4,this.getProductDetails()];case 1:return[2,t.sent().getVenue().address.country.isoCode]}})})},t}(),V=function(){return(V=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},z=function(){function t(t){this.items=[],this.items=t.map(function(t,e){return new F(V({},t,{id:(e+1).toString()}))})}return t.prototype.getItems=function(){return this.items.slice()},t.prototype.hasVoucher=function(){return this.items.some(function(t){return t.isVoucher()})},t.prototype.hasPostage=function(){return this.items.some(function(t){return t.isPostage()})},t.prototype.hasFlexiticket=function(){return this.items.some(function(t){return t.isFlexiticket()})},t.prototype.hasShow=function(){return this.items.some(function(t){return t.isShow()})},t.prototype.hasAttraction=function(){return this.items.some(function(t){return t.isAttraction()})},t.prototype.getLength=function(){return this.items.length},t.prototype.getAttractions=function(){return this.items.filter(function(t){return t.isAttraction()})},t.prototype.getFlexitickets=function(){return this.items.filter(function(t){return t.isFlexiticket()})},t.prototype.getPostage=function(){return this.items.find(function(t){return t.isPostage()})},t.prototype.getTickets=function(){return this.items.filter(function(t){return t.isTicket()})},t}(),_=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},G=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},M=function(){function t(t){this.repository=q.getRepository(),this.basketData=t;var e=t.reservations,n=t.expiredAt,r=t.status,o=t.reference;this.itemsCollection=new z(e),this.expiredAt=new Date(n),this.status=r,this.reference=o}return t.prototype.getExpiredDate=function(){return this.expiredAt},t.prototype.isExpired=function(){return this.status===i.Expired||this.expiredAt<new Date},t.prototype.isPaid=function(){return this.status===i.Confirmed},t.prototype.getReference=function(){return this.reference},t.prototype.getItemsCollection=function(){return this.itemsCollection},t.prototype.getDeliveries=function(){return _(this,void 0,void 0,function(){return G(this,function(t){return this.deliveries||(this.deliveries=this.repository.getDeliveries(this.getReference(),this.getItemsCollection())),[2,this.deliveries]})})},t.prototype.isEmpty=function(){return!this.itemsCollection.getLength()},t.prototype.getTotalPrice=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getTotalPrice()})},t.prototype.getTotalDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getDiscount()})},t.prototype.getTotalPriceBeforeDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getPriceBeforeDiscount()})},t.prototype.hasDiscount=function(){return this.itemsCollection.getItems().some(function(t){return t.hasDiscount()})},t.prototype.getBasketData=function(){return this.basketData},t.prototype.getUkShows=function(){var t=this;return this.itemsCollection.getTickets().filter(function(e){return _(t,void 0,void 0,function(){return G(this,function(t){switch(t.label){case 0:return[4,e.getCountryCode()];case 1:return[2,t.sent()===s.UK]}})})})},t.prototype.getUsaShows=function(){var t=this;return this.itemsCollection.getTickets().filter(function(e){return _(t,void 0,void 0,function(){return G(this,function(t){switch(t.label){case 0:return[4,e.getCountryCode()];case 1:return[2,t.sent()===s.USA]}})})})},t.prototype.isMixedBasket=function(){return _(this,void 0,void 0,function(){var t;return G(this,function(e){switch(e.label){case 0:return[4,this.getCountyCodes()];case 1:return[2,!(t=e.sent()).every(function(e){return e===t[0]})]}})})},t.prototype.getCountyCodes=function(){return _(this,void 0,void 0,function(){var t,e=this;return G(this,function(n){return t=this.itemsCollection.getItems().map(function(t){return _(e,void 0,void 0,function(){return G(this,function(e){return t.isFlexiticket()||t.isVoucher()?[2,s.UK]:[2,t.getCountryCode()]})})}),[2,Promise.all(t)]})})},t.prototype.reduceBasketItemsAmount=function(t){return this.itemsCollection.getItems().reduce(t,0)},t}(),H=((P={})[o.Collection]={name:"Collect at the Box Office",voucherName:"Free postal delivery",attractionName:"Print at home voucher"},P[o.Postage]={name:"By Post – UK Addresses only"},P[o.Eticket]={name:"Print at Home"},P),X=function(){function t(t,e){var n=t.method,r=t.charge;this.amount=r,this.method=n,this.setName(e)}return t.prototype.getAmount=function(){return this.amount},t.prototype.getMethod=function(){return this.method},t.prototype.getName=function(){return this.name},t.prototype.setName=function(t){this.name=this.method===o.Collection?this.getCollectionDeliveryName(t):H[this.method].name},t.prototype.getCollectionDeliveryName=function(t){var e=H[o.Collection];return t.hasVoucher()?e.voucherName:t.hasAttraction()?e.attractionName:e.name},t}(),K=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},Q=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},J=function(t){var e=x(t);q.setEnvironment(t);return{getBasket:function(t){return K(void 0,void 0,void 0,function(){var n;return Q(this,function(r){switch(r.label){case 0:return[4,e.getBasket(t)];case 1:return n=r.sent(),[2,new M(n)]}})})},getDeliveries:function(t,n){return K(void 0,void 0,void 0,function(){return Q(this,function(r){switch(r.label){case 0:return[4,e.getDeliveries(t)];case 1:return[2,r.sent().map(function(t){return new X(t,n)})]}})})},createBasket:function(t){return K(void 0,void 0,void 0,function(){var n;return Q(this,function(r){switch(r.label){case 0:return[4,e.upsertBasket(t)];case 1:return n=r.sent(),[2,new M(n)]}})})},addItems:function(t,n){return K(void 0,void 0,void 0,function(){var r,o;return Q(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).reservations=r.reservations.concat(n),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})},removeItem:function(t,n){return K(void 0,void 0,void 0,function(){var r,o;return Q(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).reservations.splice(n,1),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})}}};!function(t){t.Negative="negative",t.Positive="positive",t.Neutral="neutral"}(C||(C={}));var $=((A={})[r.Dev]="https://venue-service.devtixuk.io/api/vLatest",A[r.Qa]="https://venue-service.qatixuk.io/api/vLatest",A[r.Staging]="https://venue-service.stagetixuk.io/api/api/vLatest",A[r.Prod]="https://venue-service.tixuk.io/api/vLatest",A),W=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},Y=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Z=function(t){var e=y($[t]);return{getSeatAttributes:function(t){return W(void 0,void 0,void 0,function(){return Y(this,function(n){switch(n.label){case 0:return[4,e.get("/venues/"+t+"/seats/attributes")];case 1:return[2,n.sent().data]}})})}}},tt=function(){function t(t){this.seats=t}return t.prototype.getSeats=function(){return this.seats},t.prototype.getBlockName=function(){var t=this.seats[0];return t?t.area:""},t}(),et=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},nt=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},rt=function(t){var e=Z(t);return{getSeats:function(t){return et(void 0,void 0,void 0,function(){var n;return nt(this,function(r){switch(r.label){case 0:return[4,e.getSeatAttributes(t)];case 1:return n=r.sent(),[2,new tt(n)]}})})}}};n.d(e,"Environment",function(){return r}),n.d(e,"getBasketApi",function(){return x}),n.d(e,"getBasketRepository",function(){return J}),n.d(e,"DeliveryMethod",function(){return o}),n.d(e,"BasketStatus",function(){return i}),n.d(e,"ProductType",function(){return u}),n.d(e,"BasketLocationType",function(){return s}),n.d(e,"Basket",function(){return M}),n.d(e,"Delivery",function(){return X}),n.d(e,"BasketItemsCollection",function(){return z}),n.d(e,"BasketItem",function(){return F}),n.d(e,"getContentServiceRepository",function(){return N}),n.d(e,"getContentServiceApi",function(){return j}),n.d(e,"Product",function(){return R}),n.d(e,"EntityType",function(){return c}),n.d(e,"ImageOrientation",function(){return f}),n.d(e,"getVenueApi",function(){return Z}),n.d(e,"getVenueRepository",function(){return rt}),n.d(e,"SeatsCollection",function(){return tt})},function(t,e,n){"use strict";var r=n(0),o=n(2),i=n(11),u=n(1);function s(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var a=s(u);a.Axios=i,a.create=function(t){return s(r.merge(u,t))},a.Cancel=n(6),a.CancelToken=n(25),a.isCancel=n(5),a.all=function(t){return Promise.all(t)},a.spread=n(26),t.exports=a,t.exports.default=a},function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)} | ||
/*! | ||
@@ -8,2 +8,2 @@ * Determine if an object is a Buffer | ||
*/ | ||
t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";var r=n(1),o=n(0),i=n(20),u=n(21);function a(t){this.defaults=t,this.interceptors={request:new i,response:new i}}a.prototype.request=function(t){"string"==typeof t&&(t=o.merge({url:arguments[0]},arguments[1])),(t=o.merge(r,{method:"get"},this.defaults,t)).method=t.method.toLowerCase();var e=[u,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},o.forEach(["delete","get","head","options"],function(t){a.prototype[t]=function(e,n){return this.request(o.merge(n||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){a.prototype[t]=function(e,n,r){return this.request(o.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=a},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(4);t.exports=function(t,e,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t}},function(t,e,n){"use strict";var r=n(0);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var u=[];r.forEach(e,function(t,e){null!==t&&void 0!==t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),u.push(o(e)+"="+o(t))}))}),i=u.join("&")}return i&&(t+=(-1===t.indexOf("?")?"?":"&")+i),t}},function(t,e,n){"use strict";var r=n(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,u={};return t?(r.forEach(t.split("\n"),function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(u[e]&&o.indexOf(e)>=0)return;u[e]="set-cookie"===e?(u[e]?u[e]:[]).concat([n]):u[e]?u[e]+", "+n:n}}),u):u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(){this.message="String contains an invalid character"}o.prototype=new Error,o.prototype.code=5,o.prototype.name="InvalidCharacterError",t.exports=function(t){for(var e,n,i=String(t),u="",a=0,s=r;i.charAt(0|a)||(s="=",a%1);u+=s.charAt(63&e>>8-a%1*8)){if((n=i.charCodeAt(a+=.75))>255)throw new o;e=e<<8|n}return u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,u){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),!0===u&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(0);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},function(t,e,n){"use strict";var r=n(0),o=n(22),i=n(5),u=n(1),a=n(23),s=n(24);function c(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return c(t),t.baseURL&&!a(t.url)&&(t.url=s(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||u.adapter)(t).then(function(e){return c(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(c(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(6);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}}])}); | ||
t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";var r=n(1),o=n(0),i=n(20),u=n(21);function s(t){this.defaults=t,this.interceptors={request:new i,response:new i}}s.prototype.request=function(t){"string"==typeof t&&(t=o.merge({url:arguments[0]},arguments[1])),(t=o.merge(r,{method:"get"},this.defaults,t)).method=t.method.toLowerCase();var e=[u,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},o.forEach(["delete","get","head","options"],function(t){s.prototype[t]=function(e,n){return this.request(o.merge(n||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){s.prototype[t]=function(e,n,r){return this.request(o.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=s},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(4);t.exports=function(t,e,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t}},function(t,e,n){"use strict";var r=n(0);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var u=[];r.forEach(e,function(t,e){null!==t&&void 0!==t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),u.push(o(e)+"="+o(t))}))}),i=u.join("&")}return i&&(t+=(-1===t.indexOf("?")?"?":"&")+i),t}},function(t,e,n){"use strict";var r=n(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,u={};return t?(r.forEach(t.split("\n"),function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(u[e]&&o.indexOf(e)>=0)return;u[e]="set-cookie"===e?(u[e]?u[e]:[]).concat([n]):u[e]?u[e]+", "+n:n}}),u):u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(){this.message="String contains an invalid character"}o.prototype=new Error,o.prototype.code=5,o.prototype.name="InvalidCharacterError",t.exports=function(t){for(var e,n,i=String(t),u="",s=0,a=r;i.charAt(0|s)||(a="=",s%1);u+=a.charAt(63&e>>8-s%1*8)){if((n=i.charCodeAt(s+=.75))>255)throw new o;e=e<<8|n}return u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,u){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===u&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(0);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},function(t,e,n){"use strict";var r=n(0),o=n(22),i=n(5),u=n(1),s=n(23),a=n(24);function c(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return c(t),t.baseURL&&!s(t.url)&&(t.url=a(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||u.adapter)(t).then(function(e){return c(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(c(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(6);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}}])}); |
@@ -30,2 +30,5 @@ interface Region { | ||
} | ||
export interface Repository { | ||
[key: string]: Function; | ||
} | ||
export {}; |
{ | ||
"name": "encore-api-services", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
55053
36
568