PageSourceSearch

https://pagos.usek.cl/_nuxt/b073474e/BmwCyo7F.js

js usek.cl collected 2026-09-24 22:59:07 UTC 5,574 bytes, 1 lines download raw bytes

1import{u as _e,_ as Se}from"./nWmk2mYZ.js";import{C as be}from"./wNSGIzw6.js";import{_ as he}from"./e-2vJSxi.js";import{d as ge,h as ke,aA as ye,c as l,r as _,L as we,aQ as Ce,bI as Pe,a3 as Ie,w as V,K as xe,t as n,b as e,z as i,n as o,q as C,v as h,m as x,$ as q,A as p,B as m,_ as A,x as Ae,M as Ee,R as Ne,X as E,bz as Me,bA as Le,I as Be}from"./BOH5IRVW.js";import{u as Fe,S as Re,a as De}from"./DMhAizGV.js";import{u as Te}from"./B1zdMm_9.js";import{u as ze}from"./DUwr9jCW.js";import{u as $e}from"./BDdNfvWj.js";import{u as Q}from"./_WlVQju8.js";import{u as Ve}from"./BvpD8Lty.js";import{u as qe}from"./DbPzi-8z.js";import"./DEHv7peM.js";import"./gW4ofI-w.js";import"./BhZZGsyC.js";import"./CClg45q6.js";import"./DF8UEJfA.js";import"./DgZ2fmsb.js";import"./Cpe9Ej5e.js";import"./Hc49PKlK.js";import"./rFjxoBU8.js";import"./C8d0I7BZ.js";import"./DnmQYn0B.js";const Qe={key:1,class:"select-subscription__subscriptions-container"},Oe={class:"select-subscription__subscriptions-list"},Ge={key:0,class:"select-subscription__button-container"},Ke=ge({__name:"index",setup(Xe){const{t:v}=ke(),[N,M]=ye(!1),{allSubscriptions:O,isPending:G,isLoading:K,isSuccess:X,isError:j}=$e(),r=l(()=>O.value.filter(t=>t.allow_payment_method_enrollment||t.allow_payment_method_update)),H=l(()=>N.value?r.value:r.value.slice(0,4)),{isActive:J,isLoading:L}=Q("multi_subscription_enrollment_flag"),a=l(()=>J.value),g=l(()=>X.value&&!L.value),u=_(null),{handleNextStep:B,loading:U,errorMessage:W}=Ve(),{selectedSubscriptionIds:S,lockedSubscriptionIds:Y,toggleSubscription:P}=Fe(r),{customerId:Z,flowName:ee}=Te(),F=we(),te=Ce(),se=Pe(te),{navigateToCheckout:oe}=qe(),{ensureSessionStillOpen:ae,sessionExpired:R}=_e(),{isActive:ie}=Q("checkout_spa_navigation_flag"),c=_(!1),k=_(null),re=t=>{if(a.value){if(c.value)return;P(t.id);return}u.value=t},le=t=>a.value?S.value.has(t.id):u.value?.id===t.id,ne=t=>a.value&&Y.value.has(t.id),ue=()=>{u.value&&B(u.value)},D=async t=>{const s=[...S.value];if(!s.length||c.value)return;if(c.value=!0,k.value=null,!await ae()){c.value=!1;return}let f;try{f=(await se.mutateAsync({customerId:String(Z),subscriptionIds:s,flowName:ee??"0",customerPortalSessionId:F.query.sessionId??null,additionalQueryParameters:Le(F.query),productNames:Me({subscriptions:r.value.filter(y=>S.value.has(y.id))})})).id_checkout_session}catch(d){if(d?.data?.code==="customer_portal_session_not_open"){R.value=!0,c.value=!1;return}k.value=v("customerPortal.goToCheckout.error"),c.value=!1;return}try{await oe(f,{replace:t?.replace??!1,external:!ie.value})}catch{k.value=v("customerPortal.goToCheckout.error"),c.value=!1}},ce=()=>a.value?D():ue(),{selectedSubscriptionIds:de}=Ie(ze()),T=_(!1);V(g,t=>{if(!t||T.value)return;T.value=!0;const s=r.value.filter(d=>de.value.has(d.id)),[f]=s;if(f){if(!a.value){u.value=f;return}s.forEach(d=>P(d.id))}},{immediate:!0});const z=_(!1),b=_(!1);V(g,async t=>{if(!t||z.value||r.value.length!==1)return;const s=r.value[0];if(s){z.value=!0,b.value=!0;try{a.value?(S.value.has(s.id)||P(s.id),await D({replace:!0})):(u.value=s,await B(s,{replace:!0}))}finally{I.value&&(b.value=!1)}}},{immediate:!0});const $=l(()=>a.value?c.value:U.value),I=l(()=>a.value?k.value:W.value),pe=l(()=>a.value?S.value.size>0:!!u.value),me=l(()=>a.value?v("customerPortal.selectSubscription.multiDescription"):v("customerPortal.selectSubscription.description")),ve=l(()=>a.value?v("customerPortal.selectSubscription.associateButton"):u.value?.payment_method?v("customerPortal.selectSubscription.updateButton"):v("customerPortal.selectSubscription.enrollButton")),{isDesktop:fe}=xe();return(t,s)=>{const f=Se,d=be,y=he;return e(R)?(o(),n(f,{key:0})):(o(),n(y,{key:1,"hide-details-box":"","hide-go-back-to-commerce":""},{title:i(()=>[C(e(q),{as:"h1",variant:"b2","font-weight":"semibold",class:"select-subscription__header-text"},{default:i(()=>[p(m(t.$t("customerPortal.selectSubscription.title")),1)]),_:1})]),main:i(()=>[C(e(q),{variant:e(fe)?"b2":"b3",class:"select-subscription__header-text"},{default:i(()=>[p(m(e(me)),1)]),_:1},8,["variant"]),e(j)?(o(),n(e(A),{key:0,variant:"error","full-width":"",icon:"x-circle-solid"},{default:i(()=>[p(m(t.$t("customerPortal.selectSubscription.fetchError")),1)]),_:1})):h("",!0),e(g)&&!e(b)?(o(),x("div",Qe,[Ae("div",Oe,[(o(!0),x(Ee,null,Ne(e(H),w=>(o(),n(Re,{key:w.id,subscription:w,selected:le(w),locked:ne(w),onSelect:re},null,8,["subscription","selected","locked"]))),128))]),e(r).length>4?(o(),x("div",Ge,[e(N)?(o(),n(e(E),{key:1,variant:"tertiary",size:"small",class:"select-subscription__button",onClick:e(M)},{default:i(()=>[p(m(t.$t("customerPortal.sections.subscription.list.pagination.showLess")),1)]),_:1},8,["onClick"])):(o(),n(e(E),{key:0,variant:"tertiary",size:"small",class:"select-subscription__button",onClick:e(M)},{default:i(()=>[p(m(t.$t("customerPortal.sections.subscription.list.pagination.showAll",{totalSubscriptions:e(r).length})),1)]),_:1},8,["onClick"]))])):h("",!0)])):e(G)||e(K)||e(L)||e(b)?(o(),n(De,{key:2})):h("",!0),C(d,null,{default:i(()=>[C(e(A),{variant:"info",icon:"information-circle-solid","full-width":""},{default:i(()=>[p(m(t.$t("customerPortal.selectSubscription.disclaimer")),1)]),_:1}),e(I)?(o(),n(e(A),{key:0,variant:"error","full-width":"",icon:"x-circle-solid"},{default:i(()=>[p(m(e(I)),1)]),_:1})):h("",!0),e(g)&&!e(b)?(o(),n(e(E),{key:1,"full-width":"",disabled:e($)||!e(pe),loading:e($),size:"small",onClick:ce},{default:i(()=>[p(m(e(ve)),1)]),_:1},8,["disabled","loading"])):h("",!0)]),_:1})]),_:1}))}}}),ft=Be(Ke,[["__scopeId","data-v-3c917036"]]);export{ft 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.