1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8167,692],{6211:function(e,t,o){"use strict";o.d(t,{Z:function(){return a}});var n=o(5893);o(7294);var r=o(7977);function a(e){let{checkoutResumeComponent:t,children:o,...a}=e,i=(0,r.dD)(991);return(0,n.jsx)("div",{className:"checkout-layout",children:(0,n.jsxs)("div",{className:"".concat(i?"container-fluid":"container-fixed"),...a,children:[(0,n.jsx)("section",{className:(0,r.ze)("checkout-layout__content",!t&&"checkout-layout__content--full",a.className),children:o}),t&&(0,n.jsx)("aside",{className:"checkout-layout__resume",children:t})]})})}},3397:function(e,t,o){"use strict";o.d(t,{EP:function(){return n}});let n={ApiEndpoint:"https://magento.bss-prd.directvgo.com/graphql",mseEcommerceHandler:"https://kong-api.bss-prd.directvgo.com/api/msecommercehandler/global",HOME_CAROUSELS_API:"https://hub.directvgo.com/ssla/v2/carousel",HOME_CAROUSELS_API_KEY:"vM8GLAHwYJ4BiPGEoN0nk2duaERWa6RXa4EVm1Y7",KONG_BASE_URL_BUYFLOW:"https://kong-api.bss-prd.directvgo.com/api/msbuyflowmw/global",RECAPTCHA_KEY:"6LfGO2QqAAAAAK11FLA2Rgu7_E-b4jBPyJMI1PEu",DNI_VALIDATION_ARG:"https://api.app.directvla.com/ecommerce/v2/identityValidatorDniCheck",CPF_VALIDATION_BR:"https://api.bss-stg.directvgo.com/document/v1/statusdocumentbr",PAYMENT_METHOD_VIEW_KEY:"tZOEqFyfgV39EUXO5XVIf3cN57Y6XOgea8DAYAW7",POSTCODE_ARG:"https://api.app.directvla.com/ecommerce/v2/address/validation",POSTCODE_API_KEY:"tZOEqFyfgV39EUXO5XVIf3cN57Y6XOgea8DAYAW7",CC_IFRAME_BASE_URL:"https://iframe.prod-cc.pe.grpw.io",OTP_GENERATE_API:"https://api.bss-prd.directvgo.com/otp/v1/generate",OTP_VALIDATE_API:"https://api.bss-prd.directvgo.com/otp/v1/validate",API_MQTT_AUTH:"https://api.directvgo.com/mqttauth/v1/auth",API_BSS_DIRECTVGO_BASE_URL:"https://api.bss-prd.directvgo.com",ACCOUNT_STATUS_API_KEY:"x3N27XCvtC7Wvtxcr1Qz043Cl9WIl1JM55B47R7P",API_PIX_FLOW_SUBSCRIPTION_UPDATE_DISPATCHER:"https://api.bss-prd.directvgo.com/account/v2/subscription/update/dispatcher",API_PIX_FLOW_CHANGE_PLAN_DISPATCHER:"https://api.bss-prd.directvgo.com/account/v2/change/plan/dispatcher",BSS_API_KEY:"sWRXU89TrM2tU3GKV1vKb8m7r9x5pdzwUwSlDES2",API_PIX_FLOW_UNPAID_INVOICES:"https://api.bss-prd.directvgo.com/account/v2/unpaid-invoices",ECOMMERCE_GRAPHQL:"https://api-ecom.bss-prd.directvgo.com/graphql",DEVICES_BASE_URL:"https://api.directvgo.com",API_DIRECTVGO_BASE_URL:"https://api.bss-prd.directvgo.com",API_GLOBAL_DIRECTVGO_BASE_URL:"https://global.digital.directvgo.com",INVOICE_STATUS_API_KEY:"yrCOnl8gop5dNqsu7BI6Z7fNcjY4TBIVaodxNE9c",SUBSCRIPTION_ENTITLEMENTS_API_KEY:"sWRXU89TrM2tU3GKV1vKb8m7r9x5pdzwUwSlDES2",STATUS_PRIME_VIDEO_API_KEY:"JIhlDcbNqU75zn0nHwoalajcPCczJ7m16pueEwIX"}},6490:function(e,t,o){"use strict";o.d(t,{s:function(){return s}});var n=o(1163),r=o(7294),a=o(9657),i=o(5317),l=o(9071);let s=()=>{let{locale:e}=(0,a.bU)(),t=(0,n.useRouter)(),o=(0,r.useCallback)(o=>{let{market:n,pathKey:r,params:a,slug:s,replace:c=!1}=o,u=l.vf[n][r],d={...(0,i.W)(),...a},_=s?"/".concat(s):"",m=Object.keys(d).length>0?"?".concat(new URLSearchParams(d).toString()):"";return c?t.replace("".concat(e,"/").concat(u).concat(_).concat(m),void 0,{locale:e}):t.push("".concat(e,"/").concat(u).concat(_).concat(m),void 0,{locale:e})},[e]);return o}},7992:function(e,t,o){"use strict";o.d(t,{K:function(){return l}});var n=o(3934),r=o(3397),a=o(9071);let i=async e=>{let{store:t,token:o}=e,n=await fetch("".concat(r.EP.KONG_BASE_URL_BUYFLOW,"/v1/order/token"),{method:"GET",headers:{"Content-Type":"application/json",store:t,Authorization:"Bearer ".concat(o)}});if(!n.ok){let e=await n.json().catch(()=>null);return Promise.reject(null!=e?e:{success:!1,code:""})}return n.json()},l=e=>{let{store:t,token:o}=e;return(0,n.a)({queryKey:["order-token",t],queryFn:()=>i({store:t,token:o}),enabled:!!t&&!!o,...a.Cd,staleTime:0,gcTime:0})}},3365:function(e,t,o){"use strict";o.d(t,{z:function(){return i}});var n=o(8029),r=o(3397);let a=async e=>{let{store:t,token:o,idToken:n}=e,a=await fetch("".concat(r.EP.KONG_BASE_URL_BUYFLOW,"/v1/order/reorder"),{method:"POST",headers:{store:t,Authorization:"Bearer ".concat(o),auth:"".concat(n)}});if(!a.ok){let e=await a.json();return Promise.reject(e)}return a.json()},i=e=>{let{onSuccessCallback:t,onErrorCallback:o}=e;return(0,n.D)({mutationFn:e=>a(e),onSuccess:(e,o)=>{if(console.log("Reorder success",e),t)return t(e,o.source)},onError:e=>{if(console.error("Reorder error",e),o)return o(e)}})}},6085:function(e,t,o){"use strict";o.d(t,{F:function(){return s}});var n=o(3934),r=o(3191),a=o(3397),i=o(4688);let l=async e=>{let{token:t,idToken:o,store:n}=e,r=await fetch("".concat(a.EP.KONG_BASE_URL_BUYFLOW,"/v1/summary/order"),{headers:{Authorization:"Bearer ".concat(t),...o&&{Auth:o},Store:n}});if(!r.ok){let e=Error("Failed to fetch summary order");throw e.status=r.status,e}return r.json()},s=e=>{let{token:t,idToken:o,store:a,enabled:s=!0}=e;return(0,n.a)({queryKey:[i.U.SUMMARY],queryFn:()=>l({token:t,idToken:o,store:a}),enabled:s,...r.C})}},5317:function(e,t,o){"use strict";o.d(t,{W:function(){return m},n:function(){return E}});var n=o(9332),r=o(7294),a=o(9071);let i=[{urlKey:"dclid",storageKey:a.dA.DCLID,timestampKey:a.dA.DCLID_TIMESTAMP}
1,{urlKey:"gclid",storageKey:a.dA.GCLID,timestampKey:a.dA.GCLID_TIMESTAMP}],l=()=>{try{if(null!==window.localStorage.getItem(a.dA.CAMPAIGN_PARAMS_TTL_OVERRIDE))return 1e4}catch(e){}return 2592e6},s=()=>String(Date.now()+l()),c=e=>{if(!e)return!1;let t=Number(e);return!Number.isNaN(t)&&Date.now()>t},u=(e,t)=>{window.localStorage.removeItem(e),window.localStorage.removeItem(t)},d=()=>{try{let e=window.localStorage.getItem(a.dA.UTM_PARAMS_TIMESTAMP);if(c(e))return u(a.dA.UTM_PARAMS,a.dA.UTM_PARAMS_TIMESTAMP),window.sessionStorage.removeItem(a.sO.UTM_PARAMS),{};let t=window.localStorage.getItem(a.dA.UTM_PARAMS);return t?JSON.parse(t):{}}catch(e){return console.error("Error reading UTM params from localStorage:",e),{}}},_=e=>{try{let t=window.localStorage.getItem(e.timestampKey);if(c(t)){u(e.storageKey,e.timestampKey);return}return window.localStorage.getItem(e.storageKey)||void 0}catch(t){console.error("Error reading ".concat(e.urlKey," from localStorage:"),t);return}},m=()=>{let e=d(),t={};return e.utm_source&&(t.utm_source=e.utm_source),e.utm_medium&&(t.utm_medium=e.utm_medium),e.utm_campaign&&(t.utm_campaign=e.utm_campaign),e.utm_content&&(t.utm_content=e.utm_content),e.utm_term&&(t.utm_term=e.utm_term),i.forEach(e=>{let o=_(e);o&&(t[e.urlKey]=o)}),t},E=()=>{let[e,t]=(0,r.useState)(d),[o,l]=(0,r.useState)(()=>Object.fromEntries(i.map(e=>[e.urlKey,_(e)]))),c=(0,n.useSearchParams)(),u=o=>{let n={...e,...o},r=JSON.stringify(n);try{window.localStorage.setItem(a.dA.UTM_PARAMS,r),window.localStorage.setItem(a.dA.UTM_PARAMS_TIMESTAMP,s()),window.sessionStorage.setItem(a.sO.UTM_PARAMS,r)}catch(e){console.error("Error saving UTM params to localStorage:",e)}t(n)},m=(e,t)=>{let o=i.find(t=>t.urlKey===e);if(o){try{window.localStorage.setItem(o.storageKey,t),window.localStorage.setItem(o.timestampKey,s())}catch(t){console.error("Error saving ".concat(e," to localStorage:"),t)}l(o=>({...o,[e]:t}))}},E=()=>{if(c.has("utm_source")){let e={utm_source:c.get("utm_source")||void 0,utm_medium:c.get("utm_medium")||void 0,utm_campaign:c.get("utm_campaign")||void 0,utm_content:c.get("utm_content")||void 0,utm_term:c.get("utm_term")||void 0},t=d(),o=Object.keys(e).some(o=>e[o]!==t[o]);o&&u(e)}i.forEach(e=>{if(!c.has(e.urlKey))return;let t=c.get(e.urlKey)||void 0,o=_(e);t&&t!==o&&m(e.urlKey,t)})};return(0,r.useEffect)(()=>{E()},[c]),{utmParams:e,singleParams:o,setUtmParam:u,setSingleParam:m,extractAndSetCampaignParams:E}}},8643:function(e,t,o){"use strict";o.d(t,{q:function(){return d}});var n=o(9071);let r=["ssla-ott","br-ott","latam-ott","latam-dth"],a=["sky-dth","ssla-dth"];var i=o(9657);let l={ARGENTINA:"ar",BRAZIL:"br",CHILE:"cl",COLOMBIA:"co",ECUADOR:"ec",MEXICO:"mx",PERU:"pe",URUGUAY:"uy",PORTO_RICO:"pr"},s={ES:"es",PT:"pt"},c={[l.ARGENTINA]:s.ES,[l.BRAZIL]:s.PT,[l.CHILE]:s.ES,[l.COLOMBIA]:s.ES,[l.ECUADOR]:s.ES,[l.MEXICO]:s.ES,[l.PERU]:s.ES,[l.URUGUAY]:s.ES,[l.PORTO_RICO]:s.ES};var u=o(7494);let d=()=>{var e,t,o,l,d,_,m,E,p;let{user:A}=(0,u.a)(),S=function(){let{locale:e}=(0,i.bU)();return c[e]||s.ES}(),I=JSON.parse(sessionStorage.getItem(n.dA.SUBSCRIPTION_ENTITLEMENTS)||"{}"),v=sessionStorage.getItem(n.sO.STATUS_ACCOUNT),g=(null==I?void 0:null===(e=I.billingState)||void 0===e?void 0:e.toLowerCase())||("1"==v?"cancelled":"2"!=v?"newClient":"active"),y=A&&"businessUnit"in A?null==A?void 0:null===(t=A.businessUnit)||void 0===t?void 0:t.toLowerCase():null,T=JSON.parse(localStorage.getItem(n.dA.PROFILE)||"{}"),P=T&&"ageRating"in T?T.ageRating:"not-logged",C=T&&"isMainProfile"in T?T.isMainProfile.toString():"not-logged",f=T&&"id"in T?T.id:"not-logged",N=T&&"isNotRatedContentAllowed"in T?T.isNotRatedContentAllowed.toString():"not-logged",h=g?r.includes(g)?"ott-d2c":a.includes(g)?"tve":"ott-b2b2c":"not-logged",R=null!==(_=null==T?void 0:null===(o=T.interactivities)||void 0===o?void 0:null===(l=o.isBetAllowed)||void 0===l?void 0:l.toString())&&void 0!==_?_:"false",O={v_client_id:null!==(m=function(){let e=function(e){let t=e+"=",o=decodeURIComponent(document.cookie),n=o.split(";");for(let e=0;e<n.length;e++){let o=n[e];for(;" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}(n.y$.GA_CLIENT_ID);return e?e.substring(6):null}())&&void 0!==m?m:"not-logged",v_user_id:null!==(E=null==A?void 0:A.uid)&&void 0!==E?E:"not-logged",v_billing_status:null!=g?g:"not-logged",v_profile_custom_age:P,v_mso:null!=y?y:"not-logged",v_language:S,v_admin_profile:C,v_profile_id:f,v_app_name:"".concat("dgo","-web"),v_profile_unrated_content:N,v_login_type:h,v_betting_enable:R,v_isocode:null!==(p=null==A?void 0:null===(d=A.iso2Code)||void 0===d?void 0:d.toLowerCase())&&void 0!==p?p:"not-logged"};return O}},1093:function(e,t,o){"use strict";o.d(t,{L:function(){return _}});var n=o(3513),r=o(4529),a=o(782),i=o(4838),l=o(9071);let s=e=>Object.fromEntries(Object.entries(e).filter(e=>{let[,t]=e;return null!=t&&""!==t})),c=(e,t)=>{let o={...e};return Object.keys(t).forEach(n=>{let r=t[n],a=e[n];"object"!=typeof r||null===r||Array.isArray(r)?o[n]=r:o[n]=c(a||{},r)}),o},u=()=>!0,d=()=>({country:null,personalInfo:{},billingAddress:{},paymentMethod:{hasCoupon:!1,hasCard:!1,totalCoveredByAccountBalance:!1,paymentData:{hasCard:!1}},meta:{cartId:u()&&sessionStorage.getItem(l.sO.CART_ID)?sessionStorage.getItem(l.sO.CART_ID):""},_hasHydrated:!1}),_=(0,r.Ue)()((0,a.tJ)((0,a.mW)((e,t)=>{var o,r,a,u,_,m,E;let p=i.k.getAuthFromStorage();return{...d(),country:["BR","AR"].includes(null!==(_=null===(o=p.user)||void 0===o?void 0:o.country)&&void 0!==_?_:"")?null===(r=p.user)||void 0===r?void 0:r.country:"SSLA",personalInfo:{firstname:null!==(m=null===(a=p.user)||void 0===a?void 0:a.givenName)&&void 0!==m?m:"",lastname:null!==(E=null===(u=p.user)||void 0===u?void 0:u.familyName)&&void 0!==E?E:""},setHasHydrated:t=>e({_hasHydrated:t}),setCountry:t=>e((0,n.Uy)(e=>{e.country=t,"AR"===t&&(e.paymentMethod.paymentData=c(e.paymentMethod.paymentData||{},{dni:{verifiedUserComplete:"false"}}))})),setPersonalInfo:t=>e((0,n.Uy)(e=>{e.personalInfo=c(e.personalInfo,s(t))})),setBillingAddress:t=>e((0,n.Uy)(e=>{e.billingAddress=c(e.billingAddress,s(t))})),setPaymentMethod:t=>e((0,n.Uy)(e=>{e.paymentMethod=c(e.paymentMethod,s(t))})),removePaymentMethod:()=>e((0,n.Uy)(e=>{e.paymentMethod={hasCard:!1,hasCoupon:!1,totalCoveredByAccountBalance:!1,paymentData:{hasCard:!1}}})),updateCartId:t=>e((0,n.Uy)(e=>{e.meta.cartId=t})),updateDocumentId:t=>e((0,n.Uy)(e=>{e.meta.documentId=t})),updateBirthDate:t=>e((0,n.Uy)(e=>{e.meta.birthDate=t})),setLyraData:t=>e((0,n.Uy)(e=>{e.paymentMethod.paymentData=c(e.paymentMethod.paymentData||{},s(t))})),setCheckoutData:t=>e((0,n.Uy)(e=>{e.paymentMethod.paymentData=c(e.paymentMethod.paymentData||{},s(t))})),getOrderPayload:()=>{let e=t(),o=null;if(!e.meta.cartId||"SSLA"!==e.country&&!e.meta.documentId)return null;try{let e=window.localStorage.getItem(l.dA.UTM_PARAMS);e&&(o=JSON.parse(e))}catch(e){console.error("Error reading UTM params from localStorage:",e)}return{...l.sx,cartId:e.meta.cartId,documentId:e.meta.documentId,setBillingAddressOnCart:{...e.personalInfo,...e.billingAddress},setPaymentMethodOnCart:{...e.paymentMethod,paymentData:{...e.paymentMethod.paymentData,...o?{utmCampaign:o.utm_campaign,utmContent:o.utm_c
1ontent,utmMedium:o.utm_medium,utmSource:o.utm_source,utmTerm:o.utm_term}:{}}}}},reset:()=>e(d())}}),{name:"create-order-payload",storage:(0,a.FL)(()=>sessionStorage),onRehydrateStorage:()=>e=>{null==e||e.setHasHydrated(!0)}}))},2632:function(e,t,o){"use strict";o.d(t,{R:function(){return r}});var n=o(4529);let r=(0,n.Ue)(e=>({currentStep:1,totalSteps:0,calculatedPercentage:0,setCurrentStep:(t,o)=>e(()=>({currentStep:t,totalSteps:o,calculatedPercentage:t/o*100}))}))},4317:function(e,t,o){"use strict";o.d(t,{E:function(){return r}});var n=o(4529);let r=(0,n.Ue)(e=>({active:null,showToast:t=>e({active:{id:t}}),hideToast:t=>e(e=>{var o;return{active:(null===(o=e.active)||void 0===o?void 0:o.id)===t?null:e.active}})}))},4431:function(e,t,o){"use strict";o.d(t,{O:function(){return n}});let n={PLACE_ORDER_OTP_MISSING:"CUS0344",TOO_MANY_REQUESTS_PIX:"PSE1001",INVALID_CPF_RFB:"PSE1004",PLACE_ORDER_NO_BASE_PLAN:"ORD0001",PLACE_ORDER_MULTIPLE_PLANS:"ORD0002"}},3109:function(e,t,o){"use strict";o.d(t,{z:function(){return n}});let n={HASHES:{SELFCARE_SUBSCRIPTION:{PAGE_VIEW:"p-002.209.000.000.000.000",PLAN:"e-002.209.066.000.000.068",INVOICE:"e-002.209.091.000.000.256",DEVICES:"e-002.209.092.000.000.068",ADDITIONAL:"e-002.209.067.000.000.068",ADD_EXTRA:"e-002.209.093.000.000.278",ACTIVATE:"e-002.209.097.000.000.061",CHANGE_PLAN:"e-002.209.066.000.000.090",CANCEL_PLAN:"e-002.209.066.000.000.051",MENU_SUBSCRIPTION:"e-002.209.094.000.000.248",MENU_SETTINGS:"e-002.209.095.000.000.248",MENU_HELP:"e-002.209.096.000.000.248"},SELFCARE_RECURRING_PAYMENT_PIX:{PAGE_VIEW:"p-015.190.000.000.000.000"},SELFCARE_PENDING_INVOICE_PIX:{PAGE_VIEW:"p-015.189.000.000.000.000"},SELFCARE_ERROR_PAYMENT_PIX:{PAGE_VIEW:"p-041.023.000.000.000.000",TRY_AGAIN_BUTTON:"e-015.194.001.000.000.117",CHANGE_PAYMENT_BUTTON:"e-015.194.001.000.000.298"}},EVENTS:{PAGE:"page",INTERACTION:"interaction"}}},4688:function(e,t,o){"use strict";o.d(t,{U:function(){return n}});let n={SUMMARY:"summary_query",EMAIL_CONFIRMATION_STATUS:"email-confirmation-status",EXTRAS_STORE:"extras_store",DEVICES_COUNT:"devices_count",INVOCE_STATUS:"invoice_status",BASIC_PLAN:"basic_plan",SUBSCRIPTION_ENTITLEMENTS:"subscription_entitlements",STATUS_DISNEY_PLUS:"status_disney_plus",GET_LINK_DISNEY_PLUS:"get_link_disney_plus",STATUS_PRIME_VIDEO:"status_prime_video",GET_LINK_PRIME_VIDEO:"get_link_disney_plus",ACCOUNT_STATUS:"account_status",SUBSCRIPTION_CANCELATION_STATUS:"subscription_cancelation_status"}},9576:function(e,t,o){"use strict";o.d(t,{e:function(){return function e(t){return"object"!=typeof t||null===t?t:Array.isArray(t)?t.map(t=>"null"===t||""===t||"[]"===t?"":"true"===t||"false"!==t&&e(t)):Object.entries(t).reduce((t,o)=>{let[n,r]=o;switch(r){case"null":case"":t[n]="";break;case"[]":t[n]=[];break;case"true":t[n]=!0;break;case"false":t[n]=!1;break;default:t[n]="object"==typeof r?e(r):r}return t},{})}}})},8167:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return U}});var n=o(5893),r=o(1163),a=o(7294),i=o(8742),l=o(7230),s=o(9657),c=o(1310),u=o(7494),d=o(1093),_=o(2632),m=o(4317),E=o(6490),p=o(7992),A=o(3365),S=o(6085),I=o(8643),v=o(8029),g=o(3397);let y=async e=>{let{idToken:t}=e,o=await fetch(g.EP.API_MQTT_AUTH,{method:"POST",headers:{Authorization:t,"Content-Type":"text/plain"}});if(!o.ok){let e=await o.json();throw e}return o.json()};var T=o(9498),P=o(4847),C=o(9071),f=o(4431),N=o(3109),h=o(9576),R=o(6211),O=o(7465),M=o.n(O);let L={SF_CHANGE_PAYMENT_METHOD:{title:"Autorize o Pix recorrente",description:"Pra ativar esta forma de pagamento, faca um Pix sem custos."},SF_CHANGE_PLAN:{title:"Pague com Pix",description:""},SF_ADD_ADDONS:{title:"Pague com Pix",description:""},SF_PENDING_INVOICE:{title:"Pague com Pix",description:"Este Pix \xe9 avulso e a sua chave n\xe3o ser\xe1 cadastrada como recorrente."}};function U(e){var t;let{liferayFields:o}=e,{PriceTitle:g,InputLabel:O,PrimaryButtonLabel:U,Timer:b,ButtonLink:D}=(0,a.useMemo)(()=>(0,h.e)(o),[o]),{market:w,locale:B,brand:k}=(0,s.bU)(),x="br"===w?"br":"ssla",G=(0,s.oR)(),K=(0,r.useRouter)(),V=(0,E.s)(),Y=(0,d.L)(e=>
1e.updateCartId),{token:F,idToken:H,user:j,hydrate:X}=(0,u.a)(),{showToast:W}=(0,m.E)(),{setCurrentStep:q}=(0,_.R)(),{dataLayerPush:z}=(0,T._0)(),Q=(0,I.q)(),J=(0,a.useRef)(null),Z=(0,a.useRef)(!1),$=(0,a.useRef)(!1),ee=(0,a.useRef)(""),[et,eo]=a.useState(!1),[en,er]=a.useState(null),[ea,ei]=a.useState(!1),[el,es]=a.useState(""),[ec,eu]=a.useState(!1),[ed,e_]=a.useState(!1),em={br:{TITLE:"Quer mesmo voltar pra alterar seu pedido?",DESCRIPTION:"",ICON_NAME:"empty-cart",PRIMARY_BTN_LABEL:"Continuar com o Pix",SECONDARY_BTN_LABEL:"Voltar"},ssla:{TITLE:"Ya empezaste un pedido",DESCRIPTION:"Termin\xe1 tu compra ahora y disfrut\xe1 del mejor contenido.",ICON_NAME:"empty-cart",PRIMARY_BTN_LABEL:"Continuar con el Pix",SECONDARY_BTN_LABEL:"Volver"}};(0,a.useEffect)(()=>{X()},[X]),(0,a.useEffect)(()=>{ea&&!$.current&&((null==en?void 0:en.type)==="SF_CHANGE_PAYMENT_METHOD"?z({hash:N.z.HASHES.SELFCARE_RECURRING_PAYMENT_PIX.PAGE_VIEW,event:N.z.EVENTS.PAGE,v_page_name:"settings/change-payment-recurring-payment-pix",...Q}):(null==en?void 0:en.type)==="SF_PENDING_INVOICE"?z({hash:N.z.HASHES.SELFCARE_PENDING_INVOICE_PIX.PAGE_VIEW,event:N.z.EVENTS.PAGE,v_page_name:"settings/change-payment-pix-pending",...Q}):z({event:"pix_payment",section:"datos de pago",location:B}),$.current=!0)},[z,Q,ea,B,null==en?void 0:en.type]),(0,a.useEffect)(()=>{try{let e=H||localStorage.getItem(C.dA.ID_TOKEN)||localStorage.getItem(C.dA.SESSION_TOKEN)||"";es(e)}catch(e){es(H||"")}finally{eu(!0)}},[H]),(0,a.useEffect)(()=>{try{let e=sessionStorage.getItem(C.sO.PIX_FLOW);er(e?JSON.parse(e):null)}catch(e){er(null)}finally{ei(!0)}},[]),(0,a.useEffect)(()=>{if(ea){if(en){q(0,1);return}q(4,4)}},[ea,en,q]);let eE=(0,a.useCallback)(e=>e&&"string"!=typeof e?Array.isArray(e)?e[0]||null:e:null,[]),ep=(0,a.useCallback)(e=>{e&&console.error(e),J.current&&J.current.end(),V({market:w,pathKey:"ERROR",slug:C.jL.ERROR_PAYMENT_UPDATE})},[w,V]),eA=(0,a.useCallback)(e=>(null==e?void 0:e.success)===!1&&e.code||"",[]),eS=(0,a.useCallback)(e=>{let t=eA(e);if(null==t?void 0:t.includes(f.O.TOO_MANY_REQUESTS_PIX)){V({market:w,pathKey:"ERROR",slug:C.jL.ERROR_PIX_BLOCK});return}V({market:w,pathKey:"ERROR",slug:C.jL.ERROR_PAYMENT_UPDATE})},[eA,w,V]),{mutate:eI,isPending:ev}=(0,A.z)({onSuccessCallback:(e,t)=>{var o,n,r,a,i,l;sessionStorage.setItem(C.sO.CART_ID,null!==(i=null==e?void 0:null===(o=e.reorderItems)||void 0===o?void 0:null===(n=o.cart)||void 0===n?void 0:n.id)&&void 0!==i?i:""),Y(null!==(l=null==e?void 0:null===(r=e.reorderItems)||void 0===r?void 0:null===(a=r.cart)||void 0===a?void 0:a.id)&&void 0!==l?l:""),"user"===t?V({market:w,pathKey:"PLANS"}):V({market:w,pathKey:"BILLING"})},onErrorCallback:e=>{console.log("Reorder Error",e)}}),eg=(0,a.useCallback)((e,t)=>(null==en?void 0:en.type)==="SF_CHANGE_PAYMENT_METHOD"?"dgo/v1/".concat(e,"/change/payment_method"):(null==en?void 0:en.type)==="SF_CHANGE_PLAN"?"dgo/v1/".concat(e,"/change/plan"):(null==en?void 0:en.type)==="SF_ADD_ADDONS"?"dgo/v1/".concat(e,"/subscription/add"):(null==en?void 0:en.type)==="SF_PENDING_INVOICE"?"dgo/v1/".concat(e,"/invoices/pay"):(null==t?void 0:t.includes("REACTIVATION"))?"dgo/v1/".concat(e,"/reactivation"):"dgo/v1/".concat(e,"/buyflow"),[en]),{mutate:ey,isPending:eT}=function(e){let{idToken:t,...o}=e;return(0,v.D)({mutationFn:()=>y({idToken:t}),...o})}({idToken:el,onSuccess:(0,a.useCallback)(e=>{var t;console.log("MQTT Auth success:",e);let o="string"==typeof(null==j?void 0:j.uid)?j.uid:null;if(!o){ep("User uid not found in localStorage.user");return}if(!(null==e?void 0:null===(t=e.urlInfo)||void 0===t?void 0:t.completeUrl)){ep("MQTT completeUrl not found in response");return}let n=e.urlInfo.completeUrl.replace(/&/g,"&"),r=c.Z.connect(n,{protocol:"wss",clientId:e.subscriberId,clean:!1,reconnectPeriod:0});J.current=r,r.on("connect",()=>{console.log("Connected MQTT");let e=eg(o,G);console.log("Subscribing to topic:",e),eo(!0),r.subscribe(e,{qos:1},t=>{if(t){ep("Error subscribe: ".concat(t.message));return}console.log("Subscribed successfully to:",e)})}),r.on("message",(e,t)=>{let o=t.toString(),n=JSON.parse(o),r=String((null==n?void 0:n.status)||"").toLowerCase();if(console.log("Message received:",r),"valid"===r||"success"===r){if(J.current&&J.current.end(),en){sessionStorage.setItem(C.sO.PIX_PAYMENT_STATUS,"SUCCESS"),sessionStorage.removeItem(C.sO.PIX_FLOW),(null==en?void 0:en.type)==="SF_CHANGE_PLAN"?(localStorage.setItem("typeChangePlan","isUpgradeWithPayment"),sessionStorage.removeItem("consultSubscription"),sessionStorage.removeItem("statusPaymentByProduct"),window.location.href="/autoatendimento/assinatura"):window.location.href=en.originPage;return}sessionStorage.removeItem(C.sO.CART_ID),V({market:w,pathKey:"WELCOME"})}else"cancelled"===r&&ep("Payment failed with status: ".concat(r))}),r.on("error",e=>{ep("Error MQTT: ".concat(e.message))})},[ep,eg,G,w,V,j]),onError:(0,a.useCallback)(e=>{ep("MQTT Auth error: ".concat(e.message))},[ep])}),{data:eP,isLoading:eC,isError:ef,error:eN,failureCount:eh,failureReason:eR}=(0,p.K)({store:G,token:!ea||en?"":F||""}),{data:eO,isLoading:eM}=(0,S.F)({token:F||"",idToken:el,store:G,enabled:ea&&!en}),eL=(0,a.useMemo)(()=>{var e,t;return(null==en?void 0:null===(e=en.paymentSessionPix)||void 0===e?void 0:e.status)||(null==eP?void 0:null===(t=eP.sessionData)||void 0===t?void 0:t.status)||""},[en,eP]),eU=(0,a.useMemo)(()=>{var e,t;return(null==en?void 0:null===(e=en.paymentSessionPix)||void 0===e?void 0:e.qrCodeBase64)||(null==eP?void 0:null===(t=eP.sessionData)||void 0===t?void 0:t.qrCodeBase64)||""},[en,eP]),eb=(0,a.useMemo)(()=>{var e,t;return(null==en?void 0:null===(e=en.paymentSessionPix)||void 0===e?void 0:e.pixCopyPaste)||(null==eP?void 0:null===(t=eP.sessionData)||void 0===t?void 0:t.pixCopyPaste)||""},[en,eP]),eD=(0,a.useMemo)(()=>{let e=(null==en?void 0:en.paymentAmount)||(null==eO?void 0:eO.grandTotalValue)||"0",t=C.S8[B];return(0,P.ti)({price:e,locale:B,currency:t})},[en,eO,B]),ew=(0,a.useMemo)(()=>!ea||!en&&(eC||eM)||!en&&eT||!en&&!et,[ea,en,eC,eM,eT,et]),eB=(0,a.useMemo)(()=>eE(b),[b,eE]),ek=(0,a.useMemo)(()=>eE(D),[D,eE]),ex=(0,a.useMemo)(()=>(null==en?void 0:en.type)&&L[en.type]||null,[null==en?void 0:en.type]);(0,a.useEffect)(()=>
1{if(!ea||!ex)return;let e=document.getElementById("main-content")||document.body,t=()=>{let t=e.querySelector('[class*="StepTitle__title--text"]');t&&(t.textContent=ex.title);let o=e.querySelector('[class*="StepTitle__description--text"]');o&&(o.textContent=ex.description);let n=e.querySelector('[class*="StepTitle__label--text"]');n&&(n.textContent="");let r=e.querySelector('[class*="StepTitle__label"]');r&&(r.style.display="none")};t();let o=requestAnimationFrame(()=>{t()});return()=>{cancelAnimationFrame(o)}},[ex,ea]),(0,a.useEffect)(()=>{if(ec&&!el){ep("MQTT auth token not found");return}return el&&ee.current!==el&&(ee.current=el,ey()),()=>{J.current&&J.current.end()}},[ec,el,ey,ep]);let eG=(0,a.useCallback)(()=>{V({market:w,pathKey:"ERROR",slug:C.jL.ERROR_PIX_TIMEOUT})},[w,V]);(0,a.useEffect)(()=>{!ea||en||Z.current||eh<1&&!ef||(Z.current=!0,eS(eR||eN))},[ea,en,eh,eR,ef,eN,eS]),(0,a.useEffect)(()=>{if(eC||ef||!eP)return;let e=null==eL?void 0:eL.toLowerCase();eL&&"valid"!==e&&ep("Invalid payment status: "+eL)},[eL,eP,eC,ef,ep]);let eK=(0,a.useCallback)(async()=>{if(eb)try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(eb);else{let e=document.createElement("textarea");e.value=eb,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select(),document.execCommand("copy"),e.remove()}W(C.Je.TOAST_SUCCESS_COPYPIXPAYMENTCODE)}catch(e){console.error("Failed to copy PIX code:",e)}},[eb,W]),eV=(0,a.useCallback)(()=>{if(en){sessionStorage.removeItem(C.sO.PIX_FLOW),window.location.href=en.originPage;return}eI({token:null!=F?F:"",store:G,idToken:null!=H?H:"",source:"user"})},[en,eI,F,G,H]);return(0,a.useEffect)(()=>(window.history.pushState(null,"",window.location.href),K.beforePopState(e=>{let{as:t}=e;return window.history.pushState(null,"",window.location.href),t===K.asPath||(e_(!0),window.history.pushState(null,"",K.asPath),!1)}),()=>K.beforePopState(()=>!0)),[K]),(0,n.jsx)(R.Z,{checkoutResumeComponent:null,children:(0,n.jsxs)("div",{className:M().pixPaymentView,children:[(0,n.jsx)(l.Z,{isOpen:ed,project:k,onClose:()=>e_(!1),title:em[x].TITLE,description:em[x].DESCRIPTION,primaryButtonLabel:em[x].PRIMARY_BTN_LABEL,secondaryButtonLabel:em[x].SECONDARY_BTN_LABEL,sizeModal:"l",showIcon:!0,iconName:em[x].ICON_NAME,isActiveSecondaryButton:!0,onClickSecondaryButton:eV,isActivePrimaryButton:!0,onClickPrimaryButton:()=>e_(!1),secondaryButton:{type:"secondary",appearance:"outline",loading:ev}}),ew?(0,n.jsx)("div",{className:"skeleton-pulse-dark ".concat(M().pixPaymentSkeleton)}):(0,n.jsx)(i.Z,{title:g,price:eD,inputLabel:O,button:{children:U,onClick:eK},timerText:null==eB?void 0:eB.TimerText,timer:{background:null==eB?void 0:eB.Background,compactTimer:null==eB?void 0:eB.CompactTimer,icon:null==eB?void 0:eB.Icon,initialSeconds:Number(null!==(t=null==eB?void 0:eB.InitialSeconds)&&void 0!==t?t:1800),size:null==eB?void 0:eB.Size,onComplete:eG},showButtonLink:null==ek?void 0:ek.ShowButtonLink,buttonLink:{children:null==ek?void 0:ek.ButtonLinkLabel,iconLeft:"help"},pixCode:eb,qrCode:{alt:"QR code Pix",src:eU}})]})})}},7465:function(e){e.exports={pixPaymentView:"CheckoutPaymentMethodPixView_pixPaymentView__Cz4l1",pixPaymentSkeleton:"CheckoutPaymentMethodPixView_pixPaymentSkeleton__uuoQb"}}}]); 2//# sourceMappingURL=8167.1fdde101c1c81694.js.map
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.