function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _possibleConstructorReturn(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:n}function _inherits(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}function Quickbook_FilterItem(n){return React.createElement("div",{className:"quickbook-attributes__item "+(n.isActive?"isActive":""),onClick:function(){return n.handleSelect(n.attributeId)}},React.createElement("div",{className:"quickbook-attributes__item-content"},n.attributeImage?React.createElement("img",{src:n.attributeImage,alt:n.attributeName}):React.createElement("span",null,n.attributeName)))}var _extends=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},_typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol?"symbol":typeof n},_createClass=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),QuickBook_App=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n)),r=new Date,u=new Date;return u.setDate(u.getDate()+1),i.state={hasStateFromProps:!1,filtersLoading:!1,loading:!1,noResults:!1,selectedCinemaId:-1,selectedCinemaGroupId:-1,selectedType:CinemaSelectorSelectedType.NotSelected,cinemaSelectorIsOpen:!1,availableDates:[],filterDate:r.getFullYear()+"-"+("0"+(r.getMonth()+1)).slice(-2)+"-"+r.getDate(),selectedPickerDate:"today",fiilterDateDisplay:"Pick a date",attributes:[],cmsAttributes:[],popUpAttributes:[],selectedAttributeId:0,splitByAttributes:!0,popUpIsOpen:!1,popUpTitle:null,popUpMessage:null,popUpLink:null,sessions:[],totalFilms:0,flickityActive:!1,displaySessions:!1,selectedFilmId:null,selectedFilmSessions:null,selectedFilmTitle:"",selectedFilmImage:"",selectedFilmExperiences:[]},i.showPopup=i.showPopup.bind(i),i.hidePopUp=i.hidePopUp.bind(i),i.toggleCinemaSelector=i.toggleCinemaSelector.bind(i),i.handleCinemaSelectorSelect=i.handleCinemaSelectorSelect.bind(i),i.closeCinemaSelector=i.closeCinemaSelector.bind(i),i.getDatepickerDates=i.getDatepickerDates.bind(i),i.setupDatepicker=i.setupDatepicker.bind(i),i.handleSelectedPickerDate=i.handleSelectedPickerDate.bind(i),i.handleFilterSelect=i.handleFilterSelect.bind(i),i.getAttributes=i.getAttributes.bind(i),i.handleNowShowing=i.handleNowShowing.bind(i),i.displaySessions=i.displaySessions.bind(i),i.handleHideSessions=i.handleHideSessions.bind(i),i.toggleLoading=i.toggleLoading.bind(i),i.toggleFiltersLoading=i.toggleFiltersLoading.bind(i),i}return _inherits(t,n),_createClass(t,null,[{key:"getDerivedStateFromProps",value:function(n,t){if(t.hasStateFromProps===!1){var i=CinemaSelectorSelectedType.NotSelected;return n.selectedCinemaId>0&&(i=CinemaSelectorSelectedType.Cinema),{hasStateFromProps:!0,selectedCinemaGroupId:n.selectedCinemaGroupId,selectedCinemaId:n.selectedCinemaId,selectedType:i}}return null}}]),_createClass(t,[{key:"componentDidMount",value:function(){var n=this,t=-1;t=this.props.selectedCinemaId>0?CinemaSelectorSelectedType.Cinema:CinemaSelectorSelectedType.NotSelected;this.setState({selectedCinemaId:this.props.selectedCinemaId,selectedCinemaGroupId:this.props.selectedCinemaGroupId,selectedType:t},function(){n.handleNowShowing();n.getAttributes();n.getDatepickerDates()});document.addEventListener("click",this.closeCinemaSelector)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.closeCinemaSelector)}},{key:"showPopup",value:function(n,t){var i=this.state.popUpAttributes.filter(function(t){return t.ExternalId===n})[0];this.setState({popUpIsOpen:!0,popUpTitle:i.PopupTitle,popUpMessage:i.PopupText,popUpLink:t})}},{key:"hidePopUp",value:function(){this.setState({popUpIsOpen:!1})}},{key:"closeCinemaSelector",value:function(n){var t=document.getElementById("quickbuy-cinema");t===null||t.contains(n.target)||this.toggleCinemaSelector(!1)}},{key:"toggleCinemaSelector",value:function(n){this.setState({cinemaSelectorIsOpen:n})}},{key:"handleSelectedPickerDate",value:function(n){this.setState({selectedPickerDate:n})}},{key:"handleFilterSelect",value:function(n){this.setState({selectedAttributeId:n},function(){this.handleNowShowing(this.state.selectedPickerDate==="today"?!1:this.state.filterDate)})}},{key:"handleCinemaSelectorSelect",value:function(n,t,i){var r=this;t>0&&(i=CinemaSelectorSelectedType.CinemaGroup);n>0&&(i=CinemaSelectorSelectedType.Cinema);this.setState({cinemaSelectorIsOpen:!1,selectedCinemaId:n,selectedCinemaGroupId:t,prevSelectedCinemaGroupId:t,prevSelectedCinemaId:n,selectedType:i},function(){r.handleNowShowing(r.state.selectedPickerDate==="today"?!1:r.state.filterDate);r.getAttributes(r.state.selectedPickerDate==="today"?!1:r.state.filterDate);r.getDatepickerDates()})}},{key:"getDatepickerDates",value:function(){var n=this;fetch("/Umbraco/Api/QuickbookApi/GetScheduledDates?"+(this.state.selectedCinemaId>0?"&cinemaNodeId="+this.state.selectedCinemaId:"")).then(function(n){return n.json()}).then(function(t){n.setState({availableDates:t.Result||[]},function(){n.setupDatepicker()})})}},{key:"setupDatepicker",value:function(){var n=this.state.availableDates,t=this.handleNowShowing,i=this.getAttributes;(function(r){var u=r("#qb-datepicker-btn");if(typeof u!="undefined"&&u!==null&&u.length!==0){u.data("datepicker")&&u.datepicker("destroy").off("changeDate");u.datepicker({format:"yyyy-mm-dd",maxViewMode:2,startDate:"today",orientation:"bottom right",container:"#QBDatePicker",beforeShowDay:function(t){var r=!1,u=n.length,f,i;if(t.setHours(0,0,0,0),f=t.valueOf(),u>0)for(i=0;i<u;i++)if(t=parseInt(dateObjFromString(n[i].Date).getTime().toFixed(0)),f===t){r=!0;break}return r}}).on("changeDate",function(n){t(n.format("yyyy-mm-dd"));i(n.format("yyyy-mm-dd"));r(".datepicker__close").hide();r(this).datepicker("hide")}).on("show",function(){r(this).addClass("datepickerActive");r(".datepicker__close").show()}).on("hide",function(){r(this).removeClass("datepickerActive").removeClass("is-open");r(".datepicker__close").hide()})}})(jQuery)}},{key:"getAttributes",value:function(){var i=this,n=arguments.length<=0||arguments[0]===undefined?!1:arguments[0],t,r;this.toggleFiltersLoading(!0);n===!1&&(t=new Date,n=t.getFullYear()+"-"+("00"+(t.getMonth()+1)).slice(-2)+"-"+("00"+t.getDate()).slice(-2));r="/Umbraco/Api/AttributeApi/GetAttributesOnSchedules?cinemaNodeId="+this.state.selectedCinemaId+(n?"&startDate="+n+"&days=0":"");fetch(r).then(function(n){return n.json()}).then(function(n){(n!==null||typeof n=="undefined")&&function(){var t=[];n.forEach(function(n){n.PopupText.length>0&&t.push(n)});i.setState({popUpAttributes:t,cmsAttributes:n})}();i.toggleFiltersLoading(!1)})}},{key:"handleNowShowing",value:function(){var r=this,n=arguments.length<=0||arguments[0]===undefined?!1:arguments[0],t,i,u;this.toggleLoading();this.handleHideSessions();n===!1&&(t=new Date,n=t.getFullYear()+"-"+("00"+(t.getMonth()+1)).slice(-2)+"-"+("00"+t.getDate()).slice(-2));i="";this.state.selectedAttributeId!==0&&(i="&attributes="+this.state.selectedAttributeId);u="/Umbraco/Api/MovieApi/GetNowShowingFilmsByCinema?cinemaId="+this.state.selectedCinemaId+(n?"&startDate="+n+"&days=0":"")+"&splitByAttributes=true"+i+"&includeAdvanceBooking=true";this.state.selectedType!==CinemaSelectorSelectedType.NotSelected?fetch(u).then(function(n){return n.json()}).then(function(t){var i=dateObjFromString(n.toString()),u=pc.labels.dayFull[i.getDay()]+" "+pc.labels.monthShort[i.getMonth()]+" "+i.getDate()+pc.labels.ordinal(i.getDate()),f=t.Result!==undefined?t.Result.length>0:t.length>0;jQuery("#qb-datepicker-btn").datepicker("update",i);r.state.flickityActive&&jQuery(".quickbuy__result").flickity("destroy");r.setState({sessions:t.Result!==undefined?t.Result:t,noResults:t.Result!==undefined?!t.Result.length>0:!t.length>0,totalFilms:t.Result!==undefined?t.Result.length:t.length,filterDate:n,filterDateDisplay:u,loading:!1},function(){if(f){var n=getTotalFilmsThatFit(170,170,jQuery(".quickbuy__result").width());jQuery(".quickbuy__result").flickity({cellAlign:"center",pageDots:!1,wrapAround:this.state.totalFilms>n,prevNextButtons:!1,freeScroll:!0,groupCells:!0});this.setState({flickityActive:!0})}})}):this.setState({sessions:[],noResults:!0,loading:!1,flickityActive:!1})}},{key:"displaySessions",value:function(n){var t=this.state.sessions.filter(function(t){return t.FilmId===n}).map(function(n){return n.MediaItems.Poster})[0],i=pc.placeholders.oneSheet;t&&(i="https://images.tbco.app/blob-image/"+t.replace(/(^\w+:|^)\/\//,"")+"?width=160");this.setState({selectedFilmId:n,selectedFilmSessions:this.state.sessions.filter(function(t){return t.FilmId===n})[0]||null,selectedFilmTitle:this.state.sessions.filter(function(t){return t.FilmId===n}).map(function(n){return n.Title})||null,selectedFilmExperiences:this.state.sessions.filter(function(t){return t.FilmId===n}).map(function(n){return n.Experiences})[0]||null,selectedFilmImage:i,displaySessions:!0})}},{key:"handleHideSessions",value:function(){this.setState({displaySessions:!1})}},{key:"toggleLoading",value:function(){this.setState(function(n){return{loading:!n.check}})}},{key:"toggleFiltersLoading",value:function(n){this.setState({filtersLoading:n})}},{key:"render",value:function(){var n=this;return React.createElement(React.Fragment,null,this.state.popUpIsOpen&&React.createElement(Showtimes_PopUp,{hidePopUp:this.hidePopUp,isOpen:this.state.popUpIsOpen,title:this.state.popUpTitle,link:this.state.popUpLink,message:this.state.popUpMessage}),React.createElement("div",{id:"quickbuy-wrapper",className:"quickbuy "+(this.state.loading||this.state.filtersLoading?"loading":"")},React.createElement("div",{className:"quickbuy__filter"},React.createElement("div",{className:"filter-bar__section"},React.createElement("div",{className:"container container--no-padding container--narrow f-container f-container--small container--has-border"},React.createElement("div",{id:"quickbuy-cinema",className:"location-selector__section"},React.createElement(Quickbook_CinemaSelector,{appendType:this.props.appendType,baseUrlSegment:this.props.baseUrlSegment,cinemaGroups:this.props.cinemaGroups,handleCinemaSelectorSelect:this.handleCinemaSelectorSelect,isOpen:this.state.cinemaSelectorIsOpen,label:this.props.label,labelPostFixDefault:this.props.labelPostFixDefault,labelType:this.props.labelType,movieUrlSegment:this.props.movieUrlSegment,selectedCinemaGroupId:this.props.selectedCinemaGroupId,selectedCinemaId:this.props.selectedCinemaId,selectorCinemas:this.props.selectorCinemas,toggleCinemaSelector:this.toggleCinemaSelector})),React.createElement(Shared_DateFilter,{disabled:this.state.selectedCinemaId===-1,isHome:!1,isQuickbook:!0,availableDates:this.availableDates,filterDateDisplay:this.state.filterDateDisplay,handleSelectedPickerDate:this.handleSelectedPickerDate,handleNowShowing:this.handleNowShowing,handleEventMovies:!1,handleComingSoon:!1}))),this.state.selectedCinemaId>-1&&React.createElement("div",{className:"container  container--narrow f-container quickbuy__attribute-filter "+(this.state.displaySessions&&"hasBorder")},React.createElement(Quickbook_FilterList,{disabled:this.state.selectedCinemaId===-1,isHidden:this.state.displaySessions,cmsAttributes:this.state.cmsAttributes,selectedCinemaId:this.state.selectedCinemaId,selectedAttributeId:this.state.selectedAttributeId,handleSelect:this.handleFilterSelect}),this.state.displaySessions&&React.createElement("button",{className:"quickbuy__back",onClick:function(){return n.handleHideSessions()}},React.createElement("svg",null,React.createElement("use",{xlinkHref:"/css/libs/svg/icon-library.svg#left-arrow"})),React.createElement("p",null,"GO BACK")))),React.createElement(QBSessionWrapper,{showPopup:this.showPopup,popUpAttributes:this.state.popUpAttributes,isActive:this.state.displaySessions,selectedFilmTitle:this.state.selectedFilmTitle,selectedFilmImage:this.state.selectedFilmImage,placeholder:pc.placeholders.oneSheet,selectedFilmSessions:this.state.selectedFilmSessions,sessions:this.state.sessions,handleHideSessions:this.handleHideSessions,selectedDate:this.state.filterDateDisplay,splitByAttributes:this.state.splitByAttributes,selectedCinemaId:this.state.selectedCinemaId}),this.state.selectedCinemaId<=0&&this.state.selectedCinemaGroupId<=0?React.createElement("div",{className:"ta__center"},React.createElement("h3",null,"Please select a Location")):React.createElement(QBFilmsList,{noResults:this.state.noResults,placeholder:pc.placeholders.oneSheet,sessions:this.state.sessions,isActive:!this.state.displaySessions,handleClick:this.displaySessions})))}}]),t}(React.Component),Quickbook_FilterList=function(n){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,n),_createClass(t,[{key:"render",value:function(){var n=this,t=[];return t.push(React.createElement(Quickbook_FilterItem,{attributeName:"All",attributeId:0,isActive:this.props.selectedAttributeId===0?!0:!1,handleSelect:this.props.handleSelect,attributeImage:null,key:999})),this.props.cmsAttributes&&this.props.cmsAttributes.length>0&&this.props.cmsAttributes.forEach(function(i,r){typeof i.FilterImage!="undefined"&&i.FilterImage!==null&&typeof i.FilterImage.Src!="undefined"&&i.FilterImage.Src!==null&&(n.props.selectedCinemaId>0?i.Cinemas.includes(n.props.selectedCinemaId.toString())&&t.push(React.createElement(Quickbook_FilterItem,{attributeName:i.ExternalId,attributeId:i.Id,isActive:n.props.selectedAttributeId===i.Id?!0:!1,handleSelect:n.props.handleSelect,attributeImage:i.FilterImage.Src,key:r})):t.push(React.createElement(Quickbook_FilterItem,{attributeName:i.ExternalId,attributeId:i.Id,isActive:n.props.selectedAttributeId===i.Id?!0:!1,handleSelect:n.props.handleSelect,attributeImage:i.FilterImage.Src,key:r})))}),React.createElement("div",{className:"quickbook-attributes__list "+(this.props.isHidden?"isHidden":"")+" "+(this.props.disabled?"disabled-clicks":"")},React.createElement("div",{className:"quickbook-attributes__list-title hidden-mobile"},React.createElement("span",null,"FILTER SHOWTIMES:")),t)}}]),t}(React.Component);QuickBook_App.propTypes={appendType:PropTypes.oneOf([0,1,2,3]).isRequired,baseUrlSegment:PropTypes.string.isRequired,cinemaGroups:PropTypes.arrayOf(CinemaGroup),movieUrlSegment:PropTypes.string,selectedCinemaId:PropTypes.number.isRequired,selectorCinemas:PropTypes.arrayOf(SelectorCinema)};var QBAttributeFilter=function(n){return React.createElement("div",{className:"filter-attributes-qb"},n.attributes.map(function(t,i){return React.createElement("label",{key:i,className:"filter-label "+t.ExternalId.replace(" ","").toLowerCase()},React.createElement("input",{type:"radio",name:"attribute-qb-selector",onChange:function(){return n.handleAttributeSelector(t.Id)},value:t.Id}),t.QuickBuyImage.Title!=null?React.createElement("span",null,React.createElement("img",{src:t.QuickBuyImage.Src,alt:t.QuickBuyImage.Title})):React.createElement("span",null,t.Title))}),React.createElement("label",{className:"filter-label"},React.createElement("input",{defaultChecked:!0,onChange:function(){return n.handleAttributeSelector("-1")},type:"radio",name:"attribute-qb-selector",value:"-1"}),React.createElement("span",null,"All")))},QBDateFilter=function(n){return React.createElement("div",{className:"container container--narrow f-container"},React.createElement("button",{className:"filter-bar__item "+(n.todayDate===n.selectedDate?"is-active":""),onClick:function(){return n.handleDateSelector(n.todayDate)}},React.createElement("span",{className:"filter-bar__label"},"Today")),React.createElement("button",{className:"filter-bar__item "+(n.tomorrowDate===n.selectedDate?"is-active":""),onClick:function(){return n.handleDateSelector(n.tomorrowDate)}},React.createElement("span",{className:"filter-bar__label"},"Tomorrow")),React.createElement("button",{id:"qb-datepicker-btn",className:"filter-bar__item"},React.createElement("span",{className:"filter-bar__label"},"Select A Date")))},Quickbook_CinemaSelector=function(n){function t(n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,n));return i.dropdown=React.createRef(),i.state={hasStateFromProps:!1,selectedCinemaId:-1,selectedCinemaGroupId:-1,selectorItems:[],label:"SELECT A LOCATION"},i.buildLabel=i.buildLabel.bind(i),i.handleOnSelect=i.handleOnSelect.bind(i),i.handleSharedCinemaSelectorUpdate=i.handleSharedCinemaSelectorUpdate.bind(i),i}return _inherits(t,n),_createClass(t,null,[{key:"buildCinemaName",value:function(n,t){var i=n;return t!==""&&(i+=", "+t),i}},{key:"getDerivedStateFromProps",value:function(n,i){if(i.hasStateFromProps===!1){var r=function(){var i=[];return n.selectorCinemas&&n.selectorCinemas.length>0&&n.cinemaGroups.forEach(function(r){r.Level===0&&i.push({cinemaId:-1,groupId:r.NodeId,itemType:CinemaSelectorItemEnum.GroupHeader,name:r.Name,url:r.Urls[0].Url});var u=!1;return r.CinemaIds.forEach(function(f){var e=n.selectorCinemas.find(function(n){return n.CinemaNodeId===f}),o;if(e!==null&&typeof e!="undefined"&&u===!1&&(i.push({cinemaId:-1,groupId:r.NodeId,itemType:CinemaSelectorItemEnum.CinemaGroupOption,name:r.Name,url:r.Urls[0].Url}),u=!0),e!==null&&typeof e!="undefined"){o="";switch(n.appendType){case CinemaSelectorAppendType.StateCode:o=t.buildCinemaName(e.CinemaName,e.StateCode);break;case CinemaSelectorAppendType.StateName:o=t.buildCinemaName(e.CinemaName,e.StateName);break;case CinemaSelectorAppendType.CinemaGroupName:o=t.buildCinemaName(e.CinemaName,e.CinemaGroupName);break;case CinemaSelectorAppendType.NotUsed:default:o=t.buildCinemaName(e.CinemaName,"")}i.push({cinemaId:e.CinemaNodeId,groupId:r.NodeId,itemType:CinemaSelectorItemEnum.CinemaOption,name:o,url:e.UrlFriendlyName})}}),!0}),{v:{hasStateFromProps:!0,selectedCinemaId:n.selectedCinemaId,selectedCinemaGroupId:n.selectedCinemaGroupId,selectorItems:i}}}();if((typeof r=="undefined"?"undefined":_typeof(r))==="object")return r.v}return null}}]),_createClass(t,[{key:"componentDidMount",value:function(){var n=this;if(typeof EventEmitterClient!="undefined"&&EventEmitterClient!==null)EventEmitterClient.on("UpdatedSharedCinemaSelector",this.handleSharedCinemaSelectorUpdate);typeof this.dropdown.current!="undefined"&&this.dropdown.current!==null&&function(){var t=n.dropdown.current;(function(n){var i=n(t);typeof i.data("jsp")!="undefined"&&i.data("jsp")!==null?i.data("jsp").reinitialise():i.jScrollPane()})(jQuery)}();this.buildLabel()}},{key:"componentWillUnmount",value:function(){typeof EventEmitterClient!="undefined"&&EventEmitterClient!==null&&typeof EventEmitterClient.removeListener!="undefined"&&EventEmitterClient.removeListener!==null&&EventEmitterClient.removeListener("UpdatedSharedCinemaSelector",this.handleSharedCinemaSelectorUpdate)}},{key:"buildLabel",value:function(){var i=this,t="",n;this.state.selectedCinemaId<=0?t="<span>SELECT A LOCATION<\/span>":(n=this.state.selectorItems.find(function(n){return i.state.selectedCinemaId>0?n.cinemaId===i.state.selectedCinemaId:null}),t=n!==null&&typeof n!="undefined"?"AT: <span>"+n.name+"<\/span>":this.props.label);this.setState({label:t})}},{key:"handleOnSelect",value:function(n,t,i){var o=this,u=CinemaSelectorSelectedType.NotSelected,f=-1,r=-1,e="";switch(i){case CinemaSelectorItemEnum.CinemaGroupOption:u=CinemaSelectorSelectedType.CinemaGroup;r=t;break;case CinemaSelectorItemEnum.CinemaOption:u=CinemaSelectorSelectedType.Cinema;f=n;r=t;e=this.state.selectorItems.filter(function(t){return t.cinemaId===n})[0].name}this.setState({selectedCinemaId:f,selectedCinemaGroupId:r,label:"AT: <span>"+e+"<\/span>"},function(){o.props.handleCinemaSelectorSelect(f,r,u)})}},{key:"handleSharedCinemaSelectorUpdate",value:function(n){var t=this;n!==null&&typeof n!="undefined"&&n.selectedCinemaId!==null&&typeof n.selectedCinemaId!="undefined"&&n.selectedCinemaGroupId!==null&&typeof n.selectedCinemaGroupId!="undefined"&&function(){var i=CinemaSelectorSelectedType.NotSelected;n.selectedCinemaGroupId>0&&n.selectedCinemaId>0&&(i=CinemaSelectorSelectedType.Cinema);n.selectedCinemaGroupId<=0&&n.selectedCinemaId>0&&(i=CinemaSelectorSelectedType.CinemaGroup);t.setState({selectedCinemaId:n.selectedCinemaId,selectedCinemaGroupId:n.selectedCinemaGroupId},function(){t.buildLabel();t.props.handleCinemaSelectorSelect(n.selectedCinemaId,n.selectedCinemaGroupId,i)})}()}},{key:"render",value:function(){var n=this;return React.createElement("div",{className:"location-dropdown"},React.createElement("button",_extends({onClick:function(){return n.props.toggleCinemaSelector(n.props.isOpen?!1:!0)},className:"location-dropdown__trigger location-dropdown__trigger--quickbuy","aria-controls":"location","aria-expanded":this.props.isOpen},{"data-nr-qb-theatrebtn":""}),React.createElement("div",{className:"icon-text icon-text--lrg icon-text--quickbuy"},React.createElement("svg",null,React.createElement("use",{xlinkHref:"/css/libs/svg/icon-library.svg#location"})),React.createElement("div",{dangerouslySetInnerHTML:{__html:this.state.label}}),React.createElement("svg",{className:"chevron"},React.createElement("use",{xlinkHref:"/css/libs/svg/icon-library.svg#chevron-down"})))),React.createElement("div",{id:"location",className:"location-dropdown__menu location-dropdown__menu--quickbuy "+(this.props.isOpen?"is-open":"")},React.createElement("div",{className:"location-dropdown__container"},React.createElement("div",{className:"location-dropdown__title h4 tt__uc"},"Select your theatre"),React.createElement("div",{className:"location-dropdown__list",ref:this.dropdown},this.state.selectorItems.map(function(t,i){switch(t.itemType){case CinemaSelectorItemEnum.GroupHeader:return React.createElement(Shared_CinemaSelectorHeader,{key:i,name:t.name});case CinemaSelectorItemEnum.CinemaGroupOption:return React.createElement(Shared_CinemaSelectorItem,{handleOnSelect:n.handleOnSelect,cinemaId:t.cinemaId,groupId:t.groupId,key:i,itemType:CinemaSelectorItemEnum.CinemaGroupOption,name:t.name});case CinemaSelectorItemEnum.CinemaOption:return React.createElement(Shared_CinemaSelectorItem,{handleOnSelect:n.handleOnSelect,cinemaId:t.cinemaId,groupId:t.groupId,key:i,itemType:CinemaSelectorItemEnum.CinemaOption,name:t.name,customAttributes:{"data-nr-qb-theatrename":""}});default:return null}})))))}}]),t}(React.Component);Quickbook_CinemaSelector.propTypes={appendType:PropTypes.oneOf([0,1,2,3]).isRequired,baseUrlSegment:PropTypes.string.isRequired,cinemaGroups:PropTypes.arrayOf(CinemaGroup),handleCinemaSelectorSelect:PropTypes.func.isRequired,isOpen:PropTypes.bool.isRequired,movieUrlSegment:PropTypes.string,selectedCinemaGroupId:PropTypes.number.isRequired,selectedCinemaId:PropTypes.number.isRequired,selectorCinemas:PropTypes.arrayOf(SelectorCinema),toggleCinemaSelector:PropTypes.func.isRequired};var QBFilmsItem=function(n){return React.createElement("div",{className:"quickbuy__carousel-item"},React.createElement("div",{className:"poster poster--quickbuy"},n.image&&React.createElement("img",{className:"poster__image",src:n.image,alt:n.title,title:n.title}),React.createElement("div",{className:"poster__content"},React.createElement("button",{onClick:function(){return n.handleClick(n.filmID)},className:"btn btn--white","data-nr-qb-filmname":""},"Showtimes"))),React.createElement("div",{className:"quickbuy__film-title"},n.title))},QBFilmsList=function(n){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,n),_createClass(t,[{key:"render",value:function(){var n=this,t=[];return this.props.sessions&&this.props.sessions.length>0&&this.props.sessions.forEach(function(i){var r=n.props.placeholder;i.MediaItems.Poster&&(r="https://images.tbco.app/blob-image/"+i.MediaItems.Poster.replace(/(^\w+:|^)\/\//,"")+"?width=160");t.push(React.createElement(QBFilmsItem,{session:i,title:i.Title,image:r,handleClick:n.props.handleClick,filmID:i.FilmId,key:i.FilmId}))}),React.createElement("div",{className:this.props.isActive?"quickbuy__open":"quickbuy__closed"},this.props.noResults?React.createElement("div",{className:"ta__center"},React.createElement("h3",{className:"textCenter"},"Please try a different date or location")):React.createElement("div",{className:"quickbuy__result"},t))}}]),t}(React.Component),SelectedFilmImage=function(n){return React.createElement("img",{src:n.selectedFilmImage,alt:n.selectedFilmTitle,title:n.selectedFilmTitle,className:"poster-image"})},QBFilmSessions=function(n){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,n),_createClass(t,[{key:"render",value:function(){var n=this,t=[];return this.props.sessions&&this.props.sessions.length>0&&this.props.sessions.forEach(function(i){var r=n.props.splitByAttributes?getSessionItemsByAttribute(i.ExperienceTypes,n.props.title,i.DisplayDate,n.props.selectedCinemaId,i.NewDate,!1,n.props.popUpAttributes,n.props.showPopup,!0,{"data-nr-qb-time":""}):getSessionItemsByDate(i.Times,n.props.title,i.DisplayDate,n.props.selectedCinemaId,i.NewDate,{"data-nr-qb-time":""});r.length>0&&t.push(React.createElement(SessionsDates_Wrapper,{displayDate:!1,newDate:i.NewDate,filmID:n.props.filmID,sessionItems:r,showDate:n.props.showDate,key:t.length}))}),React.createElement("div",{className:"qbPanelFilmSessions "},t)}}]),t}(React.Component),QBSessionWrapper=function(n){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,n),_createClass(t,[{key:"render",value:function(){return React.createElement("div",{className:this.props.isActive?"quickbuy__open":"quickbuy__closed"},React.createElement("div",{className:"quickbuy__listing"},React.createElement("div",{className:"container container--narrow"},React.createElement("div",{className:"listing"},React.createElement("div",{className:"listing__poster-column"},React.createElement("div",{className:"listing__poster"},React.createElement(SelectedFilmImage,{placeholder:this.props.placeholder,selectedFilmTitle:this.props.selectedFilmTitle,selectedFilmImage:this.props.selectedFilmImage})),React.createElement("div",{className:"quickbuy__film-title"},this.props.selectedFilmTitle)),React.createElement("div",{className:"listing__main"},React.createElement("div",{className:"listing__details"},React.createElement("h3",{className:"quickbuy__session-titletext"},React.createElement("span",{className:"quickbuy__title-intro"},"Select your showtime for:")," ",this.props.selectedFilmTitle),React.createElement("div",{className:"quickbuy__session-date"},this.props.selectedDate)),React.createElement("div",{className:"listing__showtimes"},this.props.selectedFilmSessions&&React.createElement(QBFilmSessions,{showPopup:this.props.showPopup,popUpAttributes:this.props.popUpAttributes,sessions:this.props.selectedFilmSessions.Sessions,display:this.props.displaySessions,handleHideSessions:this.props.handleHideSessions,selectedDate:this.props.selectedDate,selectedCinemaId:this.props.selectedCinemaId,splitByAttributes:this.props.splitByAttributes})))))))}}]),t}(React.Component)