1import{_ as L,j as f,b as E,c as n,o as i,a as t,g as r,e as _,d as R,w as u,Z as y,t as o,F as T,f as C,s as m,aq as S}from"./index-sUPB-bMu.js";const A={name:"UserEventTickets",props:{eventId:{type:[String,Number],required:!0}},data(){return{tickets:null,hasApiError:!1,loading:!1,showCancelModal:!1,selectedTicket:null}},computed:{...f(["userInpeaceAccount","appEmbed"]),contentLoaded(){return!!this.tickets},ticketsCount(){return this.tickets.length},showAlertMessage(){return this.hasApiError||this.contentLoaded&&!this.ticketsCount},alertMessage(){return!this.hasApiError&&!this.ticketsCount?{type:"warning",message:this.$t("USER.EVENT.TICKETS.ERROR.TICKETS_NOT_FOUND")}:{type:"error",message:this.$t("GLOBAL.ERROR.GENERIC_ERROR")}}},created(){this.$useHead({title:this.$t("USER.EVENT.TICKETS.TITLE.PAGE")}),this.fetchTicket()},methods:{goBack(){this.$router.go(-1)},dateContent(e){const a=this.$dayjs(e.evento.dataInicio),l=this.$dayjs(e.evento.dataFim),h=(window.navigator.userLanguage||window.navigator.language).substring(0,2);return!a.isSame(l,"year")||!a.isSame(l,"month")?{start:a.utc().format("LL"),end:l.utc().format("LL")}:h==="en"?{start:a.utc().format("MMMM DD"),end:l.utc().format("DD, YYYY")}:{start:a.utc().format("DD"),end:l.utc().format("LL")}},eventDate(e){return this.$dayjs.utc(e.evento.dataInicio).isSame(this.$dayjs.utc(e.evento.dataFim),"day")?this.$t("EVENT.GLOBAL.TEXT.DATE.SAME",{start:this.$dayjs(e.evento.dataInicio).utc().format("LL")}):this.$t("EVENT.GLOBAL.TEXT.DATE.DIFFERENT",this.dateContent(e))},async fetchTicket(){try{const e=await S.getEventTickets({params:{userId:this.userInpeaceAccount.id,eventId:this.eventId}});this.tickets=e.data.inscricoes}catch{this.hasApiError=!0}},async submitCancelTicket(){this.showCancelModal=!1;try{this.loading=!0,await S.postCancelTicket({subscriptionId:this.selectedTicket.id}),await this.fetchTicket()}catch{}finally{this.loading=!1}},openCancelModal(e){this.selectedTicket=e,this.showCancelModal=!0}}},b={class:"user-event-tickets page-content__desktop-large"},K={key:0,class:"fullscreen-loading"},M={class:"user-event-tickets__content container"},D={key:0,class:"user-event-tickets__content__inline-content"},U={class:"title"},V={class:"page-content__content"},$={key:0,class:"tickets"},w={class:"tickets__title"},F={class:"tickets__title__text"},B={class:"tickets__list"},O={class:"ticket"},G={class:"ticket__content"},j={class:"ticket__content__column"},Y={class:"ticket-data"},P={class:"ticket-data__title"},X={class:"ticket-data__data"},q={class:"ticket-data"},z={class:"ticket-data__title"},H={class:"ticket-data__data"},W={class:"ticket-data"},Z={class:"ticket-data__title"},J={class:"ticket-data__data"},Q={key:0,class:"ticket-data__data ticket-data__data--content"},x={class:"ticket-data"},tt={class:"ticket-data__title"},et={class:"ticket-data__data"},st={class:"ticket__content__column"},ot={class:"ticket-data"},at={class:"ticket-data__title"},it={class:"ticket-data__data"},nt={class:"ticket-data"},ct={class:"ticket-data__title"},dt={class:"ticket-data__data"},_t={class:"ticket-data ticket-data--align-end"},lt={class:"ticket-data__title"},rt={class:"ticket-data__data"},Et={key:0,class:"ticket__content__action"},Tt={class:"btn__text"},ut={key:1,class:"ticket__content__action button"},ht={class:"text--expired"},kt={key:2,class:"ticket__content__qrcode"},vt=["src","alt"],It=["onClick"],Ct={class:"btn__text"},mt={key:1,class:"loading"},St={class:"loading__title"},gt={class:"loading__list"},pt={class:"cancel-ticket"},Nt={class:"cancel-ticket__title"},Lt={class:"cancel-ticket__text"},ft={class:"cancel-ticket__buttons"};function Rt(e,a,l,h,d,c){const g=E("AlertBox"),k=E("SvgElement"),p=E("router-link"),v=E("SkeletonElement"),N=E("ModalElement");return i(),n(T,null,[t("div",b,[d.loading?(i(),n("div",K)):_("",!0),t("div",M,[c.showAlertMessage?(i(),R(g,{key:0,type:c.alertMessage.type},{default:u(()=>[y(o(c.alertMessage.message),1)]),_:1},8,["type"])):(i(),n(T,{key:1},[e.appEmbed?_("",!0):(i(),n("div",D,[t("button",{class:"goBack",onClick:a[0]||(a[0]=C(s=>c.goBack(),["prevent"]))},[r(k,{name:"ArrowLeft",width:"1.4rem"}
1)]),t("h1",U,o(e.$t("USER.EVENT.SUBSCRIBED.TITLE.INTERNAL")),1)])),t("div",V,[c.contentLoaded?(i(),n("div",$,[t("div",w,[t("h2",F,o(e.$t("USER.EVENT.TICKETS.TEXT.PAGE_MESSAGE")),1)]),t("div",B,[(i(!0),n(T,null,m(d.tickets,(s,I)=>(i(),n("div",{key:I,class:"tickets__list__item"},[a[4]||(a[4]=t("div",{class:"tickets__list__item__arc"},null,-1)),a[5]||(a[5]=t("div",{class:"tickets__list__item__arc-background"},null,-1)),t("div",O,[t("div",G,[t("div",j,[t("div",Y,[t("div",P,o(e.$t("USER.EVENT.TICKETS.TICKET_FIELD.BUYER")),1),t("div",X,o(`${s.usuario.nome} ${s.usuario.sobrenome}`),1)]),t("div",q,[t("div",z,o(e.$t("USER.EVENT.TICKETS.TICKET_FIELD.USER")),1),t("div",H,o(s.utilizador),1)]),t("div",W,[t("div",Z,o(e.$t("USER.EVENT.TICKETS.TICKET_FIELD.TICKET")),1),t("div",J,o(s.tipoIngresso.descricao),1),s.tipoIngresso.flagPossuiConteudo?(i(),n("div",Q,o(e.$t("USER.EVENT.TICKETS.TEXT.EXCLUSIVE_CONTENT")),1)):_("",!0)]),t("div",x,[t("div",tt,o(e.$t("USER.EVENT.TICKETS.TICKET_FIELD.DATE")),1),t("div",et,o(c.eventDate(s)),1)])]),t("div",st,[t("div",ot,[t("div",at,o(e.$t("USER.EVENT.TICKETS.TICKET_FIELD.TICKETS")),1),t("div",it,o(I+1)+"/"+o(c.ticketsCount),1)]),t("div",nt,[t("div",ct,o(e.$t("USER.EVENT.TICKETS.TICKET_FIELD.EVENT_NAME")),1),t("div",dt,o(s.evento.nome),1)]),t("div",_t,[t("div",lt,o(e.$t("USER.EVENT.TICKETS.TICKET_FIELD.TIME")),1),t("div",rt,o(e.$t("USER.EVENT.TICKETS.TEXT.START_FINISH_TIME",{start:e.$dayjs(s.evento.dataInicio).utc().format("LT"),finish:e.$dayjs(s.evento.dataFim).utc().format("LT")})),1)])]),s.tipoIngresso.flagPossuiConteudo&&s.tipoIngresso.flagConteudoAtivoNaoExpirado?(i(),n("div",Et,[r(p,{to:{name:"userEventTicketContent",params:{eventId:s.evento.id,ticketId:s.id}},class:"btn btn--outline-primary button"},{default:u(()=>[r(k,{name:"ContentTicket",width:"100%",class:"icon"}),t("span",Tt,o(e.$t("USER.EVENT.TICKETS.BTN.VIEW_CONTENT")),1)]),_:1},8,["to"])])):_("",!0),s.tipoIngresso.flagPossuiConteudo&&!s.tipoIngresso.flagConteudoAtivoNaoExpirado?(i(),n("div",ut,[t("span",ht,o(e.$t("USER.EVENT.TICKETS.BTN.EXPIRED")),1)])):_("",!0),s.qrCodeUrl?(i(),n("div",kt,[t("img",{class:"ticket-qrcode",src:s.qrCodeUrl,alt:s.evento.nome},null,8,vt)])):_("",!0),s.tipoIngresso.flagGratuito?(i(),n("button",{key:3,class:"ticket__content__cancel btn btn--text-black",onClick:yt=>c.openCancelModal(s)},[t("span",Ct,o(e.$t("FORM.BUTTON.CANCEL")),1)],8,It)):_("",!0)])])]))),128))])])):(i(),n("div",mt,[t("div",St,[r(v,{height:"2rem",width:"18rem"})]),t("div",gt,[(i(),n(T,null,m(3,s=>r(v,{key:s,class:"skeleton"})),64))])]))])],64))])]),r(N,{"modal-id":"cancel-ticket","mobile-bottom":!0,width:"355px","click-to-close":!0,"close-button":!0,show:d.showCancelModal,onClosed:a[3]||(a[3]=s=>d.showCancelModal=!1)},{default:u(()=>[t("div",pt,[t("p",Nt,o(e.$t("USER.EVENT.TICKETS.TICKET_FIELD.MODAL.TITLE",{ticketName:d.selectedTicket.tipoIngresso.descricao,userName:d.selectedTicket.utilizador})),1),t("p",Lt,o(e.$t("USER.EVENT.TICKETS.TICKET_FIELD.MODAL.SUBTITLE")),1),t("div",ft,[t("button",{class:"btn btn--color-red",onClick:a[1]||(a[1]=C(s=>c.submitCancelTicket(),["prevent"]))},o(e.$t("USER.EVENT.TICKETS.TICKET_FIELD.MODAL.BUTTON.YES")),1),t("button",{class:"btn btn--text-black",onClick:a[2]||(a[2]=s=>d.showCancelModal=!1)},o(e.$t("USER.EVENT.TICKETS.TICKET_FIELD.MODAL.BUTTON.CANCEL")),1)])])]),_:1},8,["show"])],64)}const bt=L(A,[["render",Rt],["__scopeId","data-v-1ea2765a"]]);export{bt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.