PageSourceSearch

https://cp.pt/js/index-BuXduLDf.js

js cp.pt collected 2026-10-01 09:16:23 UTC 2,999 bytes, 1 lines download raw bytes

1import{j as e}from"./forms-CQIHuKgG.js";import{u as s,r as a,i as t}from"./i18n-Da3IOi1c.js";import{B as o}from"./ButtonCustom-okNO1jHW.js";/* empty css                                  */import{d as r,e as c}from"./index-CqACRIXY.js";import{k as i}from"./ticketing-service-DwdP6NJ5.js";import{C as n}from"./ColorDiv-DCSjoc16.js";import{d as l}from"./redux-B_RFUBXH.js";import{a as m}from"./pdfUtils-UAbo-tKn.js";import{u}from"./useSEO-D5w_OURl.js";import{a as d,u as h}from"./router-CeOKvF5U.js";import{C as v,R as p,a as f}from"./ui-C0dJowBQ.js";import"./utils-CLBY9Uzt.js";import"./query-CNvpHjp-.js";const j=()=>{const j=d(),g=h(),{t:y}=s(),{authenticated:x}=r(),[S,D]=a.useState([]),[I,b]=a.useState(""),[_,k]=a.useState(""),{voucherData:C}=(c({query:"(max-width: 768px)"}),l(e=>e.voucher)),{SEOComponent:N}=u({pageKey:"successVouchersPayment",robotsNoIndex:!0});a.useEffect(()=>{g.state&&j("/",{replace:!0,state:{}})},[g,j]);const P=a.useCallback(async()=>{var e,s;try{let a=null==(e=null==C?void 0:C.saleID)?void 0:e.toString(),t=null==(s=null==C?void 0:C.clientData)?void 0:s.clientID;if(a&&t||(a=localStorage.getItem("voucherSaleID")||void 0,t=localStorage.getItem("voucherClientID")||void 0),a&&t){const e=await i(a,t);e&&(D([e]),b(e.reference),k(a),localStorage.removeItem("voucherSaleID"),localStorage.removeItem("voucherClientID"),localStorage.removeItem("voucherData"))}}catch(a){throw console.error("Erro ao confirmar venda de voucher:",a),a}},[C]);a.useEffect(()=>{P()},[P]);return e.jsxs(e.Fragment,{children:[e.jsx(N,{}),e.jsx(v,{fluid:!1,style:{marginTop:"0"},children:e.jsx(p,{children:e.jsxs(f,{children:[e.jsxs("div",{className:"online-shopping-form-header banner-default",children:[e.jsx(n,{style:{margin:"0"}}),e.jsx("div",{className:"online-shopping-form-header__content"})]}),e.jsx("div",{className:"vouchers-payment-feedback",children:e.jsxs("div",{className:"vouchers-payment-feedback__container",children:[e.jsxs("div",{className:"vouchers-payment-feedback__content",children:[e.jsx("img",{className:"vouchers-payment-feedback__icon",src:"/assets/images/comboio-mensagem-sucesso.svg",alt:"train"}),e.jsx("h1",{className:"vouchers-payment-feedback__title",children:y("SuccessVoucherPaymentPageTitle")}),e.jsx("p",{className:"vouchers-payment-feedback__desc",children:y("SuccessVoucherPaymentPageMessage")})]}),e.jsxs("div",{className:"vouchers-payment-feedback__submit",children:[e.jsx(o,{type:"button",onClick:async()=>{j(x?`/${t.language}/mycp/carteira/metodos-pagamento`:`/${t.language}`)},text:y(x?"MyCPMobilityWalletSeeWallet":"FormLoadingSucessBtn"),variant:"secondary",style:{minWidth:"180px"}}),e.jsx(o,{type:"submit",style:{minWidth:"180px"},text:y("SeeVouchers"),onClick:async()=>{var e;try{if(S&&S.length>0&&S[0].vouchers){const s=null==(e=S[0].clientData)?void 0:e.clientID;s&&I&&_&&await m({saleID:_,clientID:s,reference:I,voucherData:S[0].vouchers})}}catch(s){console.error("Erro ao gerar PDFs dos vouchers:",s)}}})]})]})})]})})})]})};export{j 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.