File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/5742.e62e10fdd70206c5.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[5742,2697,5553,7934,1337,315],{55553:(F,C,o)=>{o.d(C,{h:()=>a});var _=o(77897),S=o(56610),u=o(41683),I=o(13721),k=o(22882),t=o(37222),T=o(36594),r=o(2978);let a=(()=>{class p{static#t=this.\u0275fac=function(y){return new(y||p)};static#e=this.\u0275mod=r.$C({type:p});static#i=this.\u0275inj=r.G2t({imports:[S.MD,_.bv,I.h,u.Y,k.h.forChild(),t.YN,T.rJ]})}return p})()},81337:(F,C,o)=>{o.d(C,{O:()=>t});var _=o(2978),S=o(56610),u=o(77897);function I(T,r){if(1&T&&_.nrm(0,"img",5),2&T){const a=_.XpG();_.FS9("src",a.emptySettingsSlide.urlImage,_.B4B)}}function k(T,r){if(1&T&&(_.j41(0,"p"),_.EFF(1),_.k0s()),2&T){const a=_.XpG();_.R7$(1),_.SpI(" ",a.emptySettingsSlide.text," ")}}let t=(()=>{class T{constructor(){this.emptySettingsSlide=[],this.slideOpts={allowSlidePrev:!1,allowSlideNext:!1,initialSlide:1,speed:400}}ngOnInit(){}static#t=this.\u0275fac=function(p){return new(p||T)};static#e=this.\u0275cmp=_.VBU({type:T,selectors:[["app-empty-component"]],inputs:{emptySettingsSlide:"emptySettingsSlide"},decls:6,vars:3,consts:[["pager","false",3,"options"],[1,"slide_center"],[1,"slide"],["alt","image_camponent",3,"src",4,"ngIf"],[4,"ngIf"],["alt","image_camponent",3,"src"]],template:function(p,f){1&p&&(_.j41(0,"ion-slides",0)(1,"ion-slide",1)(2,"div",2),_.DNE(3,I,1,1,"img",3),_.j41(4,"ion-label"),_.DNE(5,k,2,1,"p",4),_.k0s()()()()),2&p&&(_.Y8G("options",f.slideOpts),_.R7$(3),_.Y8G("ngIf",f.emptySettingsSlide.showImage),_.R7$(2),_.Y8G("ngIf",f.emptySettingsSlide.showText))},dependencies:[S.bT,u.he,u.q3,u.tR],styles:["ion-slides[_ngcontent-%COMP%]{height:100%}.swiper-slide[_ngcontent-%COMP%]{display:block}.swiper-slide[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin-top:2.8rem}.swiper-slide[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:50%;max-width:40%;margin:60px 0 40px;pointer-events:none}b[_ngcontent-%COMP%]{font-weight:500}p[_ngcontent-%COMP%]{padding:0 40px;font-size:14px;line-height:1.5;color:var(--ion-color-step-600, #60646b)}p[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{color:var(--ion-text-color, #000000)}.slide_center[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center}"]})}return T})()},35742:(F,C,o)=>{o.r(C),o.d(C,{FlashTicketsPageModule:()=>vt});var _=o(56610),S=o(37222),u=o(77897),I=o(36075),k=o(73308),t=o(2978),T=o(29885),r=o(57291),a=o(55467),p=o(54171),f=o(22882),b=o(88885),y=o(69942),g=o(81337),x=o(58901),M=o(60822);const R=["content"];function $(i,l){if(1&i&&t.nrm(0,"app-empty-component",11),2&i){const e=t.XpG(2);t.Y8G("emptySettingsSlide",e.emptySettingsSlide)}}function G(i,l){if(1&i&&t.nrm(0,"img",16),2&i){const e=t.XpG(3);t.FCK("src","",e.flashTicketIcon,"?_dc=",e.time,"",t.B4B)}}function j(i,l){if(1&i&&(t.j41(0,"ion-select-option",17),t.EFF(1),t.k0s()),2&i){const e=l.$implicit;t.Y8G("value",e.id),t.R7$(1),t.SpI(" ",e.name,"")}}const B=function(){return{cssClass:"mycomponent-wider-popover"}};function O(i,l){if(1&i){const e=t.RV6();t.j41(0,"ion-list",12),t.DNE(1,G,1,2,"img",13),t.j41(2,"ion-item")(3,"ion-select",14),t.bIt("ngModelChange",function(s){t.eBV(e);const c=t.XpG(2);return t.Njj(c.matchEventId=s)})("ngModelChange",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.getTribunesParentFlashTicket(s.matchEventId))}),t.nI1(4,"translate"),t.DNE(5,j,2,2,"ion-select-option",15),t.k0s()()()}if(2&i){const e=t.XpG(2);t.R7$(1),t.Y8G("ngIf",e.showImgSport),t.R7$(2),t.FS9("placeholder",t.bMT(4,5,"flash_tickets.options")),t.Y8G("ngModel",e.matchEventId)("interfaceOptions",t.lJ4(7,B)),t.R7$(2),t.Y8G("ngForOf",e.matchEvents)}}function D(i,l){if(1&i){const e=t.RV6();t.j41(0,"ion-list",12)(1,"h2"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"ion-item",18)(5,"ion-input",19),t.bIt("ngModelChange",function(s){t.eBV(e);const c=t.XpG(2);return t.Njj(c.currentCupon=s)})("keypress",function(s){t.eBV(e);const c=t.XpG(2);return t.Njj(c.onKeyPress(s))}),t.nI1(6,"translate"),t.k0s(),t.j41(7,"ion-button",20),t.bIt("click",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.inputCupon())}),t.EFF(8),t.nI1(9,"translate"),t.k0s()()()}if(2&i){const e=t.XpG(2);t.R7$(2),t.JRh(t.bMT(3,7,"flash_tickets.available_coupon")),t.R7$(3),t.FS9("placeholder",t.bMT(6,9,"flash_tickets.coupon_code")),t.Y8G("ngModel",e.currentCupon)("disabled",!e.availableInputCupon),t.R7$(2),t.Y8G("disabled",0===e.currentCupon.trim().length)("disabled",0===e.currentCupon.trim().length||!e.availableInputCupon),t.R7$(1),t.JRh(t.bMT(9,11,"flash_tickets.apply_coupon"))}}function A(i,l){if(1&i&&(t.j41(0,"ion-select-option",28),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&i){const e=l.$implicit;t.Y8G("value",e.id)("disabled",e.availabled<1),t.R7$(1),t.E5c(" ",e.zone.name," (",e.availabled," ",t.bMT(2,5,"flash_tickets.availabled"),") ")}}function w(i,l){if(1&i){const e=t.RV6();t.j41(0,"ion-list",25)(1,"ion-item")(2,"ion-label"),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"ion-select",26),t.bIt("ngModelChange",function(s){t.eBV(e);const c=t.XpG(3);return t.Njj(c.tribuneParentId=s)})("ngModelChange",function(){t.eBV(e);const s=t.XpG(3);return t.Njj(s.getActiveTribunesParent(s.tribuneParentId))}),t.DNE(6,A,3,7,"ion-select-option",27),t.k0s()()()}if(2&i){const e=t.XpG(3);t.R7$(3),t.JRh(t.bMT(4,4,"flash_tickets.tribunes_flash")),t.R7$(2),t.Y8G("ngModel",e.tribuneParentId)("multiple",!0),t.R7$(1),t.Y8G("ngForOf",e.tribunesParent)}}function Y(i,l){1&i&&t.nrm(0,"p",45)}function N(i,l){if(1&i&&t.nrm(0,"img",46),2&i){const e=t.XpG().$implicit,n=t.XpG(4);t.FS9("alt",e.zone.name),t.FCK("src","",e.image,"?_dc=",n.time,"",t.B4B)}}function X(i,l){if(1&i&&t.nrm(0,"img",47),2&i){const e=t.XpG().$implicit;t.FS9("alt",e.zone.name)}}function U(i,l){if(1&i&&(t.j41(0,"ion-label"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(1),t.Lme("",t.bMT(2,2,"Descripci\xf3n"),": ",e.description,"")}}function L(i,l){if(1&i&&(t.j41(0,"ion-label",2),t.EFF(1),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(1),t.JRh(e.quantity)}}function V(i,l){1&i&&(t.j41(0,"ion-label",2),t.EFF(1,"0"),t.k0s())}function K(i,l){if(1&i&&(t.j41(0,"h4"),t.EFF(1),t.nI1(2,"formatCurrency"),t.k0s()),2&i){const e=t.XpG().$implicit,n=t.XpG(4);t.R7$(1),t.SpI("",t.i5U(2,1,n.validatePrice(e),n.currency)," ")}}function W(i,l){if(1&i&&(t.j41(0,"h4"),t.EFF(1),t.nI1(2,"formatCurrency"),t.k0s()),2&i){const e=t.XpG(5);t.R7$(1),t.JRh(t.i5U(2,1,0,e.currency))}}function z(i,l){1&i&&t.nrm(0,"p",48)}function J(i,l){if(1&i){const e=t.RV6();t.j41(0,"div"),t.DNE(1,Y,1,0,"p",33),t.j41(2,"ion-row")(3,"ion-card"),t.DNE(4,N,1,3,"img",34),t.DNE(5,X,1,1,"img",35),t.j41(6,"ion-card-header")(7,"ion-card-title"),t.EFF(8),t.k0s(),t.j41(9,"ion-card-subtitle")(10,"ion-label"),t.EFF(11),t.nI1(12,"translate"),t.k0s()()(),t.j41(13,"ion-card-content",36),t.DNE(14,U,3,4,"ion-label",6),t.j41(15,"div",37)(16,"div",30)(17,"h4",31),t.EFF(18),t.nI1(19,"formatCurrency"),t.k0s()(),t.j41(20,"div",30)(21,"ion-item",38)(22,"ion-button",39),t.bIt("click",function(){const c=t.eBV(e).$implicit,h=t.XpG(4);return t.Njj(h.removeTicketCart(c))}),t.nrm(23,"ion-icon",40),t.k0s(),t.DNE(24,L,2,1,"ion-label",41),t.DNE(25,V,2,0,"ion-label",41),t.j41(26,"ion-button",42),t.bIt("click",function(){const c=t.eBV(e).$implicit,h=t.XpG(4);return t.Njj(h.addTicketCart(c))}),t.nrm(27,"ion-icon",43),t.k0s()()(),t.j41(28,"div",30),t.DNE(29,K,3,4,"h4",6),t.DNE(30,W,3,4,"h4",6),t.k0s()()()()(),t.DNE(31,z,1,0,"p",44),t.k0s()}if(2&i){const e=l.$implicit,n=l.last,s=t.XpG(4);t.R7$(1),t.Y8G("ngIf",!n||1==s.activeTribunesParent.length),t.R7$(3),t.Y8G("ngIf",e.show_image&&e.image),t.R7$(1),t.Y8G("ngIf",e.show_image&&!e.image),t.R7$(3),t.JRh(e.zone.name),t.R7$(3),t.Lme("",t.bMT(12,15,"tickets.image_1"),": ",e.availabled,""),t.R7$(3),t.Y8G("ngIf",e.description),t.R7$(4),t.SpI(" ",t.i5U(19,17,s.validatePrice(e),s.currency)," "),t.R7$(4),t.Y8G("disabled",!e.quantity||0==e.quantity),t.R7$(2),t.Y8G("ngIf",e.quantity),t.R7$(1),t.Y8G("ngIf",!e.quantity),t.R7$(1),t.Y8G("disabled",e.quantity>=e.availabled||s.disableAddButton),t.R7$(3),t.Y8G("ngIf",e.priceTickets),t.R7$(1),t.Y8G("ngIf",!e.priceTickets),t.R7$(1),t.Y8G("ngIf",!n)}}function q(i,l){if(1&i&&(t.j41(0,"div")(1,"h1",2),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"div",29)(5,"div",30)(6,"h3",31),t.EFF(7),t.nI1(8,"translate"),t.k0s()(),t.j41(9,"div",30)(10,"h3",31),t.EFF(11),t.nI1(12,"translate"),t.k0s()(),t.j41(13,"div",30)(14,"h3",31),t.EFF(15),t.nI1(16,"translate"),t.k0s()()(),t.DNE(17,J,32,20,"div",32),t.k0s()),2&i){const e=t.XpG(3);t.R7$(2),t.JRh(t.bMT(3,5,"flash_tickets.purchase_detail")),t.R7$(5),t.JRh(t.bMT(8,7,"flash_tickets.ticket_price")),t.R7$(4),t.JRh(t.bMT(12,9,"flash_tickets.tickets")),t.R7$(4),t.JRh(t.bMT(16,11,"flash_tickets.purchase_value")),t.R7$(2),t.Y8G("ngForOf",e.activeTribunesParent)}}function Q(i,l){if(1&i&&(t.j41(0,"ion-list",21)(1,"div",22),t.nrm(2,"img",23),t.DNE(3,w,7,6,"ion-list",24),t.DNE(4,q,18,13,"div",6),t.k0s()()),2&i){const e=t.XpG(2);t.R7$(2),t.xc7("width",e.widthStadiumImage),t.FCK("src","",e.flashStadiumImage,"?_dc=",e.time,"",t.B4B),t.R7$(1),t.Y8G("ngIf",e.tribunesParent.length>1),t.R7$(1),t.Y8G("ngIf",e.activeTribunesParent&&e.activeTribunesParent.length)}}function H(i,l){if(1&i&&(t.j41(0,"div",7),t.DNE(1,$,1,1,"app-empty-component",8),t.DNE(2,O,6,8,"ion-list",9),t.DNE(3,D,10,13,"ion-list",9),t.DNE(4,Q,5,6,"ion-list",10),t.k0s()),2&i){const e=t.XpG();t.R7$(1),t.Y8G("ngIf",e.matchEvents&&!e.matchEvents.length),t.R7$(1),t.Y8G("ngIf",e.matchEvents&&e.matchEvents.length),t.R7$(1),t.Y8G("ngIf",e.matchEvents&&e.matchEvents.length&&e.showCouponInput),t.R7$(1),t.Y8G("ngIf",e.tribunesParent&&e.tribunesParent.length)}}function Z(i,l){if(1&i&&t.nrm(0,"app-empty-component",11),2&i){const e=t.XpG(2);t.Y8G("emptySettingsSlide",e.emptySettingsSlide)}}function tt(i,l){1&i&&t.nrm(0,"p",45)}function et(i,l){1&i&&(t.j41(0,"p"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&i&&(t.R7$(1),t.JRh(t.bMT(2,1,"flash_tickets.buy_state_ticket")))}function it(i,l){if(1&i){const e=t.RV6();t.j41(0,"ion-checkbox",51),t.bIt("ionChange",function(s){t.eBV(e);const c=t.XpG(4);return t.Njj(c.changePurchaseStatus(s))}),t.k0s()}if(2&i){const e=t.XpG().$implicit;t.FS9("value",e.id)}}function st(i,l){1&i&&t.nrm(0,"p",48)}function nt(i,l){if(1&i&&(t.j41(0,"div"),t.DNE(1,tt,1,0,"p",33),t.j41(2,"div",49)(3,"div",30)(4,"p"),t.EFF(5),t.k0s()(),t.j41(6,"div",30)(7,"p"),t.EFF(8),t.nI1(9,"formatCurrency"),t.k0s()(),t.j41(10,"div",30),t.DNE(11,et,3,3,"p",6),t.DNE(12,it,1,1,"ion-checkbox",50),t.k0s()(),t.DNE(13,st,1,0,"p",44),t.k0s()),2&i){const e=l.$implicit,n=l.last,s=t.XpG(3);t.R7$(1),t.Y8G("ngIf",!n||1==s.preSubscriberTickets.length),t.R7$(4),t.JRh(e.seat_name),t.R7$(3),t.JRh(t.i5U(9,6,e.price,s.currency)),t.R7$(3),t.Y8G("ngIf",e.payment),t.R7$(1),t.Y8G("ngIf",!e.payment),t.R7$(1),t.Y8G("ngIf",!n)}}function at(i,l){if(1&i&&(t.j41(0,"ion-list")(1,"div",22),t.nrm(2,"img",23),t.j41(3,"h1",2),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"div",29)(7,"div",30)(8,"h3",31),t.EFF(9),t.nI1(10,"translate"),t.k0s()(),t.j41(11,"div",30)(12,"h3",31),t.EFF(13),t.nI1(14,"translate"),t.k0s()(),t.j41(15,"div",30)(16,"h3",31),t.EFF(17),t.nI1(18,"translate"),t.k0s()()(),t.DNE(19,nt,14,9,"div",32),t.k0s()()),2&i){const e=t.XpG(2);t.R7$(2),t.xc7("width",e.widthStadiumImage),t.FCK("src","",e.flashStadiumImage,"?_dc=",e.time,"",t.B4B),t.R7$(2),t.JRh(t.bMT(5,9,"flash_tickets.presubscriber_purchase_detail")),t.R7$(5),t.JRh(t.bMT(10,11,"flash_tickets.seat")),t.R7$(4),t.JRh(t.bMT(14,13,"flash_tickets.price")),t.R7$(4),t.JRh(t.bMT(18,15,"flash_tickets.select")),t.R7$(2),t.Y8G("ngForOf",e.preSubscriberTickets)}}function rt(i,l){if(1&i&&(t.j41(0,"div",7),t.DNE(1,Z,1,1,"app-empty-component",8),t.DNE(2,at,20,17,"ion-list",6),t.k0s()),2&i){const e=t.XpG();t.R7$(1),t.Y8G("ngIf",e.preSubscriberTickets&&!e.preSubscriberTickets.length),t.R7$(1),t.Y8G("ngIf",e.preSubscriberTickets&&e.preSubscriberTickets.length)}}function ct(i,l){1&i&&(t.j41(0,"p",52),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&i&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"service_label")," "))}function ot(i,l){if(1&i&&(t.j41(0,"p",52),t.EFF(1),t.nI1(2,"formatCurrency"),t.k0s()),2&i){const e=t.XpG(2);t.R7$(1),t.SpI(" ",t.i5U(2,1,e.serviceCharge,e.currency)," ")}}function lt(i,l){if(1&i&&t.nrm(0,"app-coin-info",57),2&i){const e=t.XpG(2);t.Y8G("price",e.total)}}function _t(i,l){if(1&i){const e=t.RV6();t.j41(0,"ion-button",58),t.bIt("click",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.validateCreateBlocks())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}2&i&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"flash_tickets.buy_tickets")," "))}function ut(i,l){if(1&i){const e=t.RV6();t.j41(0,"ion-button",58),t.bIt("click",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.createPurchaseSubscribers())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}2&i&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"flash_tickets.buy_subscriptions")," "))}function pt(i,l){if(1&i&&(t.j41(0,"ion-footer")(1,"ion-item",18)(2,"ion-label")(3,"p",52),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.DNE(6,ct,3,3,"p",53),t.j41(7,"h2"),t.EFF(8),t.nI1(9,"translate"),t.k0s()(),t.j41(10,"ion-label",54)(11,"p",52),t.EFF(12),t.nI1(13,"formatCurrency"),t.k0s(),t.DNE(14,ot,3,4,"p",53),t.j41(15,"h2"),t.EFF(16),t.nI1(17,"formatCurrency"),t.k0s(),t.DNE(18,lt,1,1,"app-coin-info",55),t.k0s()(),t.j41(19,"ion-item",18),t.DNE(20,_t,3,3,"ion-button",56),t.DNE(21,ut,3,3,"ion-button",56),t.k0s()()),2&i){const e=t.XpG();t.R7$(4),t.SpI(" ",t.bMT(5,9,"subtotal_label")," "),t.R7$(2),t.Y8G("ngIf",e.serviceChargeEnabled&&e.serviceCharge),t.R7$(2),t.SpI(" ",t.bMT(9,11,"total_label")," "),t.R7$(4),t.SpI(" ",t.i5U(13,13,e.subtotal,e.currency)," "),t.R7$(2),t.Y8G("ngIf",e.serviceChargeEnabled&&e.serviceCharge),t.R7$(2),t.SpI(" ",t.i5U(17,16,e.total,e.currency)," "),t.R7$(2),t.Y8G("ngIf",e.enablePaymentWithCoins),t.R7$(2),t.Y8G("ngIf",!e.isSubscriptionPurchase),t.R7$(1),t.Y8G("ngIf",e.isSubscriptionPurchase)}}const dt=[{path:"",component:(()=>{class i{constructor(e,n,s,c,h,d,v,m,P,E,ft,kt){this.userProvider=e,this.storage=n,this.ticketsService=s,this.utilsService=c,this.translateService=h,this.alertController=d,this.navCtrl=v,this.currencyPipe=m,this.router=P,this.parameterService=E,this.route=ft,this.corporateIdentityService=kt,this.emptySettingsSlide={},this.matchEvents=[],this.tribunesParent=[],this.activeTribunesParent=[],this.buyTickets=[],this.tickets=[],this.ticketTypeId=1,this.subtotal=0,this.serviceChargeEnabled=!1,this.serviceCharge=0,this.oldTotal=0,this.currentCoinsInMoney=0,this.payWithCoins=!1,this.credit_locked=!0,this.maximum=0,this.purchased=0,this.availabled=0,this.quantity=0,this.disableAddButton=!1,this.flashTicketIcon="assets/img/appicon.png",this.flashStadiumImage="assets/img/appicon.png",this.widthStadiumImage="50%",this.infoUser={},this.isSubscriptionPurchase=!1,this.preSubscriberTickets=[],this.enablePaymentWithCoins=!1,this.currentCupon="",this.availableCupon="no",this.showCouponInput=!1,this.availableInputCupon=!0,this.presuscription=0,this.currency=this.corporateIdentityService.getCurrency()}ngOnInit(){var e=this;return(0,k.A)(function*(){e.matchEventId=parseInt(e.route.snapshot.paramMap.get("matchEventId"))??0,e.presuscription=parseInt(e.route.snapshot.paramMap.get("presuscription"))??0,e.time=(new Date).getTime(),e.parameterService.getParameters("flash_ticket_icon,flash_stadium_image,service_charge_enabled").then(n=>{e.parameters=n.parameters,e.parameters.flash_ticket_icon&&(e.flashTicketIcon=e.parameters.flash_ticket_icon),e.parameters.flash_stadium_image&&(e.flashStadiumImage=e.parameters.flash_stadium_image,e.widthStadiumImage="100%"),e.parameters.service_charge_enabled&&(e.serviceChargeEnabled=e.parameters.service_charge_enabled),e.presuscription>0?(e.emptySettingsSlide={showImage:!1,urlImage:"",showText:!0,text:e.translateService.instant("tickets.empty_subscriptions")},e.isSubscriptionPurchase=!0,e.storage.get("infoUser").then(s=>{e.infoUser=s,e.getTicketsSubscriptions(s.document)})):(e.emptySettingsSlide={showImage:!1,urlImage:"",showText:!0,text:e.translateService.instant("tickets.empty_events")},e.isSubscriptionPurchase=!1,e.getMatchEvents(e.matchEventId))})})()}getMatchEvents(e=null){var n=this;this.buyTickets=[],this.matchEvents=[],this.quantity=0,e?(this.matchEvents=this.ticketsService.matchEvents,this.getTribunesParentFlashTicket(e)):this.storage.get("token").then(function(){var s=(0,k.A)(function*(c){n.utilsService.presentLoading(n.translateService.instant("all.loading")),(yield n.ticketsService.getMatchEvents(c.access_token)).subscribe(h=>{n.utilsService.dismissLoading(),n.showImgSport=!0,h.forEach(d=>{n.utilsService.validateDate(d.event_start_sale,"start")&&n.utilsService.validateDate(d.event_end_sale,"end")&&n.matchEvents.push(d)}),1==n.matchEvents.length&&n.getTribunesParentFlashTicket(n.matchEvents[0].id)},h=>{n.utilsService.dismissLoading(),n.utilsService.presentToast(3e3,"danger","top",n.translateService.instant("all.error_request")),console.log("error getMatchEvents: ",h)})});return function(c){return s.apply(this,arguments)}}())}getTribunesParentFlashTicket(e,n=!1){var s=this;if(this.availableInputCupon=!0,e){this.showImgSport=!1,this.buyTickets=[],this.tribunesParent=[],this.activeTribunesParent=[],this.maximum=0,this.purchased=0,this.availabled=0,this.quantity=0,this.tribuneParentId=null;let c=this.matchEvents.find(h=>h.id===e);this.matchEventId=e,this.seasonId=c.season_id,this.storage.get("token").then(function(){var h=(0,k.A)(function*(d){s.utilsService.presentLoading(s.translateService.instant("all.loading")),(yield s.ticketsService.validateUserTickets(d.access_token,s.ticketTypeId,s.matchEventId)).subscribe(function(){var v=(0,k.A)(function*(m){m.r?(s.maximum=m.maximum,s.purchased=m.purchased,s.availabled=m.maximum-m.purchased,s.utilsService.presentToast(5e3,"success","top",s.translateService.instant("flash_tickets.msg_match_ticket_summary",{availabled:s.availabled,purchased:s.purchased})),(yield s.ticketsService.getTribunesParentFlashTicket(d.access_token,s.matchEventId,n,s.currentCupon)).subscribe(P=>{s.showCouponInput=P.validateCouponexits,P.flashTicket.forEach(E=>{"special_price"==E.apply_coupon_type&&E.coupon==s.currentCupon&&(E.price=E.special_price)}),P=P.flashTicket,s.utilsService.dismissLoading(),s.tribunesParent=P,1==P.length&&(s.activeTribunesParent=P,s.scrollToBottom()),s.serviceChargeEnabled&&(s.serviceCharge=Math.max(...s.tribunesParent.map(E=>E.service_charge)))},P=>{s.utilsService.dismissLoading(),s.utilsService.presentToast(3e3,"danger","top",s.translateService.instant("all.error_request")),console.log("error getTribunesParentFlashTicket: ",P)})):(s.utilsService.dismissLoading(),s.utilsService.presentToast(4e3,"warning","top",m.m))});return function(m){return v.apply(this,arguments)}}(),v=>{s.utilsService.dismissLoading(),s.utilsService.presentToast(3e3,"danger","top",s.translateService.instant("all.error_request")),console.log("error validateUserTickets: ",v)})});return function(d){return h.apply(this,arguments)}}())}}getActiveTribunesParent(e){this.activeTribunesParent=[],this.activeTribunesParent=this.tribunesParent.filter(n=>e.includes(n.id)),this.tribunesParent=this.tribunesParent.map(n=>(e.includes(n.id)||(n.quantity=0),n)),this.buyTickets=this.buyTickets.filter(n=>e.includes(n.id)),this.disabledAddButtonOptions(),this.calculateTotal(),this.scrollToBottom()}removeTicketCart(e){e.quantity||(e.quantity=0);let s=this.buyTickets.find(c=>c.id===e.id);s&&(e.quantity--,e.priceTickets=e.quantity*e.price,s.quantity=e.quantity,s.priceTickets=e.priceTickets,0===s.quantity&&(this.buyTickets=this.buyTickets.filter(c=>c!==s))),this.disabledAddButtonOptions(),this.calculateTotal(),this.scrollToBottom()}addTicketCart(e){let n="price";e.quantity||(e.quantity=0);let s=this.buyTickets.find(c=>c.id===e.id);s?(e.quantity++,e.priceTickets=e.quantity*e[n],s.quantity=e.quantity,s.priceTickets=e.priceTickets):(e.quantity=1,e.priceTickets=e[n],this.buyTickets.push({id:e.id,zone_id:e.zone_id,match_event_id:this.matchEventId,quantity:e.quantity,price:e[n],priceTickets:e.priceTickets})),this.disabledAddButtonOptions(),this.calculateTotal(),this.scrollToBottom()}calculateTotal(){this.subtotal=0,this.buyTickets.length&&(this.subtotal=this.buyTickets.reduce((e,n)=>e+n.priceTickets,0)),this.total=this.subtotal+this.serviceCharge}scrollToBottom(){setTimeout(()=>{this.content.scrollToBottom(500)},200)}disabledAddButtonOptions(){this.quantity=this.buyTickets.reduce((e,n)=>e+n.quantity,0),this.disableAddButton=this.quantity===this.availabled}validateCreateBlocks(){var e=this;this.userProvider.validateAlertsUseApp()&&(this.tickets=[],this.storage.get("token").then(function(){var n=(0,k.A)(function*(s){e.utilsService.presentLoading(e.translateService.instant("all.loading")),(yield e.ticketsService.validateSeatsAvailableByCapacity(s.access_token,e.buyTickets)).subscribe(c=>{e.utilsService.dismissLoading();for(let h=0;h<c.length;h++){let d=c[h];if(!d.seats){e.utilsService.dismissLoading();let v=e.tribunesParent.find(m=>m.id===d.id);return e.utilsService.presentToast(4e3,"warning","top",e.translateService.instant("flash_tickets.msg_maximum_capacity",{location:v.zone.name})),!1}for(let v=0;v<d.seats.length;v++){let m=d.seats[v];e.tickets.push({seat:{id:m.id,zone_id:m.zone_id},match_event_id:e.matchEventId,ticket_type_id:e.ticketTypeId,price:d.price})}}e.createBlocks()},c=>{e.utilsService.dismissLoading(),e.utilsService.presentToast(3e3,"danger","top",e.translateService.instant("all.error_request")),console.log("error validateCreateBlocks: ",c)})});return function(s){return n.apply(this,arguments)}}()))}createBlocks(){var e=this;this.storage.get("token").then(function(){var n=(0,k.A)(function*(s){e.utilsService.presentLoading(e.translateService.instant("all.loading"));let c={tickets:e.tickets,type_process:"block",subtotal:e.subtotal,serviceCharge:e.serviceCharge,amount:e.total,ticket_type_id:e.ticketTypeId,season_id:e.seasonId,payWithCoins:e.payWithCoins,coinsInMoney:e.oldTotal,coinsUsed:Math.round(e.oldTotal/e.valuePointsCoin),currentValuePoint:e.valuePointsCoin};(yield e.ticketsService.createBlocks(s.access_token,c)).subscribe(function(){var h=(0,k.A)(function*(d){d.r?e.payWithCoins?(yield e.ticketsService.generateTicketBycoins(s.access_token,d.data)).subscribe(v=>{e.utilsService.dismissLoading(),v.r?e.alertForceBack(e.translateService.instant("tickets.alert"),e.translateService.instant("tickets.msg_ticketByCoins")):(v.locked&&(e.credit_locked=!0),e.utilsService.presentToast(4e3,"warning","top",v.m))},v=>{e.utilsService.dismissLoading(),e.utilsService.presentToast(3e3,"danger","top",e.translateService.instant("all.error_request")),console.log("error generateTicketBycoins: ",v)}):(e.utilsService.dismissLoading(),e.utilsService.presentToast(5e3,"success","top",d.m.replaceAll("\\n","\n"),!0),e.router.navigate(["/payment-gateway-selection"],{state:{ticketId:d.data}})):(e.utilsService.dismissLoading(),e.utilsService.presentToast(4e3,"warning","top",d.m))});return function(d){return h.apply(this,arguments)}}(),h=>{e.utilsService.dismissLoading(),e.utilsService.presentToast(3e3,"danger","top",e.translateService.instant("all.error_request")),console.log("error createBlocks: ",h)})});return function(s){return n.apply(this,arguments)}}())}presentAlertConfirmExit(){var e=this;return(0,k.A)(function*(){yield(yield e.alertController.create({header:e.translateService.instant("tickets.alert"),message:e.translateService.instant("tickets.exit_alert"),buttons:[{text:"No",role:"cancel",cssClass:"secondary",handler:()=>{}},{text:"Si",handler:()=>{e.back()}}]})).present()})()}alertForceBack(e,n){var s=this;return(0,k.A)(function*(){yield(yield s.alertController.create({header:e,message:n,backdropDismiss:!1,buttons:[{text:"Ok",handler:()=>{s.back()}}]})).present()})()}back(){this.navCtrl.back()}getCurrency(e){return this.currencyPipe.transform(e,"USD","symbol","1.0-0")}getTicketsSubscriptions(e){var n=this;this.buyTickets=[],this.preSubscriberTickets=[],this.storage.get("token").then(function(){var s=(0,k.A)(function*(c){n.utilsService.presentLoading(n.translateService.instant("all.loading")),(yield n.ticketsService.getTicketsSubscriptions(c.access_token,e)).subscribe(h=>{n.utilsService.dismissLoading(),h.r?h.pre_subscriber&&h.pre_subscriber.forEach(d=>{d.seat_name=d.seat.zone.zone.name+" - "+d.seat.zone.name+" - "+d.seat.letter.name+" - "+d.seat.code,n.preSubscriberTickets.push(d)}):n.alertForceBack(n.translateService.instant("tickets.alert"),h.message.replaceAll("\\n","\n"))},h=>{n.utilsService.dismissLoading(),n.utilsService.presentToast(3e3,"danger","top",n.translateService.instant("all.error_request")),console.log("error getTicketsSubscriptions: ",h)})});return function(c){return s.apply(this,arguments)}}())}changePurchaseStatus(e){let n=parseInt(e.detail.value),s=this.buyTickets.find(c=>c.id===n);s?this.buyTickets=this.buyTickets.filter(c=>c!==s):(s=this.preSubscriberTickets.find(c=>c.id===n),this.buyTickets.push({id:n,priceTickets:s.price})),this.calculateTotal(),this.scrollToBottom()}createPurchaseSubscribers(){var e=this;this.userProvider.validateAlertsUseApp()&&this.parameterService.getParameters("presuscription").then(n=>{if(this.parameters=n.parameters,!this.parameters.presuscription)return void this.utilsService.presentToast(4e3,"warning","top",this.parameters.msj_inactivity_subscriber_ticket_sales??this.translateService.instant("tickets.title_message_9"));let h={abonados_array:this.buyTickets.map(d=>d.id),user_abonado:this.infoUser.document,match_event_id:this.matchEventId};this.storage.get("token").then(function(){var d=(0,k.A)(function*(v){e.utilsService.presentLoading(e.translateService.instant("all.loading")),(yield e.ticketsService.createPurchaseSubscribers(v.access_token,h)).subscribe(m=>{e.utilsService.dismissLoading(),m.r?(e.utilsService.presentToast(5e3,"success","top",m.m),e.router.navigate(["/payment-gateway-selection"],{state:{ticketId:m.data}})):e.utilsService.presentToast(4e3,"warning","top",m.m.replaceAll("\\n","\n"))},m=>{e.utilsService.dismissLoading(),e.utilsService.presentToast(3e3,"danger","top",e.translateService.instant("all.error_request")),console.log("error createPurchaseSubscribers: ",m)})});return function(v){return d.apply(this,arguments)}}())})}onKeyPress(e){" "===e.key&&e.preventDefault()}inputCupon(){0!=this.currentCupon.trim().length&&(this.currentCupon=this.currentCupon.trim(),this.ticketsService.validateCouponExist(this.matchEventId,this.currentCupon).then(e=>{e.status?(this.getTribunesParentFlashTicket(this.matchEventId,!0),this.availableInputCupon=!1,this.utilsService.presentToast(4e3,"success","top",e.message)):this.utilsService.presentToast(4e3,"warning","top",e.message)}))}validatePrice(e){return e.price}static#t=this.\u0275fac=function(n){return new(n||i)(t.rXU(T.D),t.rXU(r.n),t.rXU(a.t),t.rXU(p.T),t.rXU(f.c$),t.rXU(u.hG),t.rXU(u.q9),t.rXU(_.oe),t.rXU(I.Ix),t.rXU(b.f),t.rXU(I.nX),t.rXU(y.r))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["app-flash-tickets"]],viewQuery:function(n,s){if(1&n&&t.GBs(R,5),2&n){let c;t.mGM(c=t.lsd())&&(s.content=c.first)}},decls:11,vars:6,consts:[[1,"ion-no-border"],["slot","start"],[1,"ion-text-center"],[1,"ion-text-center","ion-no-padding"],["content",""],["class","xc",4,"ngIf"],[4,"ngIf"],[1,"xc"],[3,"emptySettingsSlide",4,"ngIf"],["class","listSelect",4,"ngIf"],["style","width: 94%; margin: 5px 0px;",4,"ngIf"],[3,"emptySettingsSlide"],[1,"listSelect"],["class","imgSport",3,"src",4,"ngIf"],["interface","popover","disabled","",1,"myCustomSelect",3,"ngModel","placeholder","interfaceOptions","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"imgSport",3,"src"],[3,"value"],["lines","none"],["required","",3,"placeholder","ngModel","disabled","ngModelChange","keypress"],["size","medium","slot","end",2,"font-size","min(4vw, 14px)","margin","0px 0px 0px 5px",3,"disabled","click"],[2,"width","94%","margin","5px 0px"],[1,"ion-margin-top","divDetail"],["onerror","if (this.src != 'error.jpg') this.src = '../../assets/img/appicon.png';",3,"src"],["class","paddingBottomItem",4,"ngIf"],[1,"paddingBottomItem"],["interface","action-sheet",1,"myCustomSelect",3,"ngModel","multiple","ngModelChange"],[3,"value","disabled",4,"ngFor","ngForOf"],[3,"value","disabled"],[1,"row","separatorItem"],[1,"column"],[1,"uppercaseText"],[4,"ngFor","ngForOf"],["class","paddingItem",4,"ngIf"],[3,"alt","src",4,"ngIf"],["src","https://ionicframework.com/docs/img/demos/card-media.png",3,"alt",4,"ngIf"],[1,"cardContent"],[1,"row",2,"padding-top","10px"],["lines","none",1,"containerQuantity"],["slot","start","color","secondary","size","small","fill","clear",1,"ion-no-margin",3,"disabled","click"],["name","remove-outline",1,"ion-no-margin"],["class","ion-text-center",4,"ngIf"],["slot","end","color","secondary","size","small","fill","clear",1,"ion-no-margin",3,"disabled","click"],["name","add-outline",1,"ion-no-margin"],["class","separatorItem",4,"ngIf"],[1,"paddingItem"],[3,"alt","src"],["src","https://ionicframework.com/docs/img/demos/card-media.png",3,"alt"],[1,"separatorItem"],[1,"row"],["color","primary","checked","false",3,"value","ionChange",4,"ngIf"],["color","primary","checked","false",3,"value","ionChange"],[1,"detailPayment"],["class","detailPayment",4,"ngIf"],["slot","end"],[3,"price",4,"ngIf"],["class","payButton","size","large",3,"click",4,"ngIf"],[3,"price"],["size","large",1,"payButton",3,"click"]],template:function(n,s){1&n&&(t.j41(0,"ion-header",0)(1,"ion-toolbar"),t.nrm(2,"ion-back-button",1),t.j41(3,"ion-title",2),t.EFF(4),t.nI1(5,"translate"),t.k0s()()(),t.j41(6,"ion-content",3,4),t.DNE(8,H,5,4,"div",5),t.DNE(9,rt,3,2,"div",5),t.k0s(),t.DNE(10,pt,22,19,"ion-footer",6)),2&n&&(t.R7$(4),t.JRh(t.bMT(5,4,"LABEL_TTITLE_9")),t.R7$(4),t.Y8G("ngIf",!s.isSubscriptionPurchase),t.R7$(1),t.Y8G("ngIf",s.isSubscriptionPurchase),t.R7$(1),t.Y8G("ngIf",s.buyTickets&&s.buyTickets.length))},dependencies:[_.Sq,_.bT,S.BC,S.YS,S.vS,u.el,u.Jm,u.b_,u.I9,u.ME,u.HW,u.tN,u.eY,u.W9,u.M0,u.eU,u.iq,u.$w,u.uz,u.he,u.nf,u.ln,u.Nm,u.Ip,u.BC,u.ai,u.hB,u.Je,u.Gw,u.tY,g.O,x.F,f.D9,M.P],styles:['ion-label[_ngcontent-%COMP%]{white-space:normal!important}ion-card[_ngcontent-%COMP%]{margin:5px;width:100%}h2[_ngcontent-%COMP%]{margin:0}.xc[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex-flow:column;min-height:-webkit-fill-available}.listSelect[_ngcontent-%COMP%]{box-shadow:0 1px 6px gray;border-radius:10px;margin:5px 0;display:flex;align-items:center;justify-content:center;flex-flow:column;width:94%}.imgSport[_ngcontent-%COMP%]{width:70%}.imgStadium[_ngcontent-%COMP%]{width:75%}.column[_ngcontent-%COMP%]{float:left;width:33.33%}.row[_ngcontent-%COMP%]:after{content:"";display:table;clear:both}.myCustomSelect[_ngcontent-%COMP%]{width:235px!important;white-space:normal!important} .mycomponent-wider-popover{--width: 95%;--max-width: 400px}.divDetail[_ngcontent-%COMP%]{border:1px solid gray;border-radius:10px;margin:0;padding:5px}.paddingItem[_ngcontent-%COMP%]{margin-top:10px}.paddingBottomItem[_ngcontent-%COMP%]{margin-bottom:15px}.separatorItem[_ngcontent-%COMP%]{border-bottom:.5px solid grey}.uppercaseText[_ngcontent-%COMP%]{text-transform:uppercase;font-weight:700}.containerQuantity[_ngcontent-%COMP%]{border:1px solid #d3d3d3!important;border-radius:5px!important}.textAvailabled[_ngcontent-%COMP%]{font-size:min(3vw,10px);margin:0}.payButton[_ngcontent-%COMP%]{width:100%}.detailPayment[_ngcontent-%COMP%]{--min-height: 5px;--padding-start: 0px;align-items:baseline;display:flex}.cardContent[_ngcontent-%COMP%]{display:flex;flex-flow:column;font-size:min(3vw,10px);padding-inline-start:5px;padding-inline-end:5px}']})}return i})()}];let ht=(()=>{class i{static#t=this.\u0275fac=function(n){return new(n||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[I.iI.forChild(dt),I.iI]})}return i})();var gt=o(55553),mt=o(41683);let vt=(()=>{class i{static#t=this.\u0275fac=function(n){return new(n||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[_.MD,S.YN,u.bv,ht,gt.h,f.h.forChild(),mt.Y]})}return i})()},55467:(F,C,o)=>{o.d(C,{t:()=>k});var _=o(73308),S=o(2978),u=o(3366),I=o(54171);let k=(()=>{class t{constructor(r,a){this.api=r,this.utilsService=a,this.parameters={},this.matchEvents={}}getMatchEvents(r){return this.api.get("tickets/match_events",r)}loadStadiumZones(r,a){return this.api.get("tickets/loadStadiumZones",r,a)}getSeats(r,a,p){return this.api.get(`tickets/get_seats/${a}/${p}`,r)}getSeatPrice(r,a,p){return this.api.get(`tickets/get_seat_price/${a}/${p}`,r)}generateBlock(r,a){return this.api.post("tickets/createBlock",a,r)}getMatchEventsSuscription(r,a){return this.api.get("tickets/getMatchEventsSuscription",r,a)}isPreabonado(r,a){return this.api.get(`tickets/isPreabonado/${a}`,r)}createBlocks(r,a){return this.api.post("tickets/createBlocks",a,r)}purchaseTickets(r){let p=`${this.api.getUrl()}/tickets/purchase?id=`+r;this.utilsService.openLink(p)}purchaseAbonos(){let a=`${this.api.getUrl()}/abonados/abonados.html`;this.utilsService.openLink(a)}getTickets(r,a){return this.api.get(`tickets/get_tickets/${r}/${a}`)}getPdf(r,a){var p=this;return(0,_.A)(function*(){return p.api.post("tickets/pdf",{code:r,platform:a},yield p.utilsService.getAccessToken())})()}generateTicketBycoins(r,a){return this.api.get(`coins/generateTickets/${a}`,r)}validateUserTickets(r,a,p){return this.api.get(`flash_tickets/validateUserTickets/${a}/${p}`,r)}getTribunesParentFlashTicket(r,a,p,f){return this.api.get(`flash_tickets/getTribunesParent/${a}?availableCupon=${p}&cuponCode=${f}`,r)}validateSeatsAvailableByCapacity(r,a){return this.api.post("flash_tickets/validateSeatsAvailableByCapacity",a,r)}getTicketsSubscriptions(r,a){return this.api.get(`tickets/getTicketsSubscriptions/${a}`,r)}createPurchaseSubscribers(r,a){return this.api.post("tickets/createPurchaseSubscribers",a,r)}validateCouponExist(r,a){var p=this;return(0,_.A)(function*(){let f=yield p.utilsService.getAccessToken();return new Promise(function(){var b=(0,_.A)(function*(y,g){(yield p.api.get(`flash_tickets/validateACoupon/${r}/${a}`,f)).subscribe(x=>{y(x)},x=>{console.error("Error validateCouponExist",x),g(x)})});return function(y,g){return b.apply(this,arguments)}}())})()}userTransferTickets(r){var a=this;return(0,_.A)(function*(){let p=yield a.utilsService.getAccessToken();return new Promise(function(){var f=(0,_.A)(function*(b,y){(yield a.api.post("tickets/transfer",r,p)).subscribe(g=>{b(g)},g=>{console.error("Error userTransferTickets",g),y(g)})});return function(b,y){return f.apply(this,arguments)}}())})()}userInformation(r){var a=this;return(0,_.A)(function*(){let p=yield a.utilsService.getAccessToken();return new Promise(function(){var f=(0,_.A)(function*(b,y){(yield a.api.post("tickets/userInformationToTransferTicket",r,p)).subscribe(g=>{b(g)},g=>{console.error("Error userInformation",g),y(g)})});return function(b,y){return f.apply(this,arguments)}}())})()}getParameters(r){var a=this;return new Promise(function(){var p=(0,_.A)(function*(f,b){(yield a.api.get("tickets/parameters/info"+(r?"?keys="+r:""))).subscribe(g=>{"success"==g.status&&(r||(a.parameters=g.parameters)),f(g)},g=>{console.error("Error provider getParameters",g),b(g)})});return function(f,b){return p.apply(this,arguments)}}())}static#t=this.\u0275fac=function(a){return new(a||t)(S.KVO(u.G),S.KVO(I.T))};static#e=this.\u0275prov=S.jDH({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})()}}]);