PageSourceSearch

https://portfolio.ecovalores.com.ar/assets/index-BDs5e0U7.js

js ecovalores.com.ar collected 2026-10-05 20:15:08 UTC 9,234 bytes, 1 lines download raw bytes

1import{c7 as Y,j as e,am as B,c8 as Z,r as h,bg as V,c9 as J,bj as X,ca as ee,cb as ae,bh as ne,cc as te,c as L,a7 as q,a9 as T,ab as H,ac as se,J as k,u as _,q as P,bZ as D,_ as j,C as p,I as F,ah as ie,cd as S,z as re,F as E,a2 as I,G as O,H as R,aK as ce,A as oe,ay as le,ag as de,Y as ue,Z as he,$ as me,ce as ge,cf as xe,a0 as fe,cg as je,aA as ve,a6 as Ce,a8 as ke,aa as be,y as U,bd as ye,be as W}from"./index-BkNDyOzF.js";import{A as Ae,a as Se,u as pe,C as Be}from"./useMyBankAccounts-DgahHElE.js";import{u as Me}from"./useRequiredAccount-BtokVac2.js";import{I as Ne}from"./IconArrowLeft-CVmtY8TY.js";const[we,Ee]=Y({name:"AvatarStylesContext",hookName:"useAvatarStyles",providerName:"<Avatar/>"});function Ie(a){const n=a.trim().split(" "),s=n[0]??"",t=n.length>1?n[n.length-1]:"";return s&&t?`${s.charAt(0)}${t.charAt(0)}`:s.charAt(0)}function $(a){const{name:n,getInitials:s,...t}=a,c=Ee();return e.jsx(B.div,{role:"img","aria-label":n,...t,__css:c.label,children:n?s==null?void 0:s(n):null})}$.displayName="AvatarName";const z=a=>e.jsxs(B.svg,{viewBox:"0 0 128 128",color:"#fff",width:"100%",height:"100%",className:"chakra-avatar__svg",...a,children:[e.jsx("path",{fill:"currentColor",d:"M103,102.1388 C93.094,111.92 79.3504,118 64.1638,118 C48.8056,118 34.9294,111.768 25,101.7892 L25,95.2 C25,86.8096 31.981,80 40.6,80 L87.4,80 C96.019,80 103,86.8096 103,95.2 L103,102.1388 Z"}),e.jsx("path",{fill:"currentColor",d:"M63.9961647,24 C51.2938136,24 41,34.2938136 41,46.9961647 C41,59.7061864 51.2938136,70 63.9961647,70 C76.6985159,70 87,59.7061864 87,46.9961647 C87,34.2938136 76.6985159,24 63.9961647,24"})]});function G(a){const{src:n,srcSet:s,onError:t,onLoad:c,getInitials:r,name:o,borderRadius:d,loading:v,iconLabel:m,icon:u=e.jsx(z,{}),ignoreFallback:i,referrerPolicy:g,crossOrigin:x}=a,C=Z({src:n,onError:t,crossOrigin:x,ignoreFallback:i})==="loaded";return!n||!C?o?e.jsx($,{className:"chakra-avatar__initials",getInitials:r,name:o}):h.cloneElement(u,{role:"img","aria-label":m}):e.jsx(B.img,{src:n,srcSet:s,alt:o??m,onLoad:c,referrerPolicy:g,crossOrigin:x??void 0,className:"chakra-avatar__img",loading:v,__css:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d}})}G.displayName="AvatarImage";const Re=te({display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",textTransform:"uppercase",fontWeight:"medium",position:"relative",flexShrink:0}),K=V((a,n)=>{const s=J("Avatar",a),[t,c]=h.useState(!1),{src:r,srcSet:o,name:d,showBorder:v,borderRadius:m="full",onError:u,onLoad:i,getInitials:g=Ie,icon:x=e.jsx(z,{}),iconLabel:b=" avatar",loading:C,children:y,borderColor:A,ignoreFallback:M,crossOrigin:N,referrerPolicy:w,...l}=X(a),f={borderRadius:m,borderWidth:v?"2px":void 0,...Re,...s.container};return A&&(f.borderColor=A),e.jsx(B.span,{ref:n,...l,className:ne("chakra-avatar",a.className),"data-loaded":ae(t),__css:f,children:e.jsxs(we,{value:s,children:[e.jsx(G,{src:r,srcSet:o,loading:C,onLoad:ee(i,()=>{c(!0)}),onError:u,getInitials:g,name:d,borderRadius:m,icon:x,iconLabel:b,ignoreFallback:M,crossOrigin:N,referrerPolicy:w}),y]})})});K.displayName="Avatar";var Le=L("building-bank","IconBuildingBank",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M3 10l18 0",key:"svg-1"}],["path",{d:"M5 6l7 -3l7 3",key:"svg-2"}],["path",{d:"M4 10l0 11",key:"svg-3"}],["path",{d:"M20 10l0 11",key:"svg-4"}],["path",{d:"M8 14l0 3",key:"svg-5"}],["path",{d:"M12 14l0 3",key:"svg-6"}
1],["path",{d:"M16 14l0 3",key:"svg-7"}]]),_e=L("edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]),Pe=L("plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);function De({cancelLabel:a="Cancelar",confirmLabel:n="Confirmar",isLoading:s=!1,...t}){const c=h.useRef(null);return e.jsx(Ae,{isOpen:t.isOpen,leastDestructiveRef:c,onClose:t.onClose,children:e.jsx(q,{children:e.jsxs(Se,{children:[e.jsx(T,{fontSize:"lg",fontWeight:"bold",children:t.title}),e.jsx(H,{children:t.message}),e.jsxs(se,{children:[e.jsx(k,{ref:c,variant:"outline",disabled:s,onClick:t.onClose,children:a}),e.jsx(k,{isLoading:s,onClick:t.onConfirm,ml:3,children:n})]})]})})})}async function Fe(a){const{data:n}=await D.post("/bank-accounts/",a);return n}function Oe(){return _({mutationFn:Fe,onSuccess:()=>{P.invalidateQueries({queryKey:["my-bank-accounts"]})}})}async function Ue(a){await D.delete(`/bank-accounts/${a}`)}function We(){return _({mutationFn:Ue,onSuccess:()=>{P.invalidateQueries({queryKey:["my-bank-accounts"]})}})}async function qe(a,n){const{data:s}=await D.patch(`/bank-accounts/${a}/`,n);return s}function Te(){return _({mutationFn:a=>qe(a.id,a.values),onSuccess:()=>{P.invalidateQueries({queryKey:["my-bank-accounts"]})}})}const He={ARS:"🇦🇷 Pesos Argentinos (ARS)",USD:"🇺🇸 Dólares Estadounidenses (USD)"};function $e(a){return e.jsxs(j,{direction:"row",justify:"space-between",align:"center",children:[e.jsxs(j,{direction:"row",align:"center",gap:4,children:[e.jsx(K,{_light:{bg:"primary.500",color:"white"},_dark:{bg:"primary.200",color:"black"},icon:e.jsx(Le,{})}),e.jsxs(j,{children:[e.jsx(p,{fontWeight:"bold",children:a.account.description}),e.jsx(p,{color:"muted",children:a.account.identifier}),e.jsx(p,{children:He[a.account.currency]})]})]}),e.jsxs(j,{direction:"row",gap:2,children:[e.jsx(F,{variant:"outline",colorScheme:"red","aria-label":"Eliminar cuenta",icon:e.jsx(ie,{}),onClick:()=>a.onDelete(a.account)}),e.jsx(F,{"aria-label":"Editar cuenta",icon:e.jsx(_e,{}),onClick:()=>a.onEdit(a.account)})]})]})}const Q=["ARS","USD"],ze=S.object({identifier:S.string().trim().min(1,"El CBU/CVU/Alias es obligatorio").max(22,"El CBU/CVU/Alias no puede tener más de 22 caracteres"),currency:S.enum(Q),description:S.string().default("")});function Ge({isLoading:a=!1,isEditing:n=!1,...s}){var c,r,o;const t=re({resolver:oe(ze),defaultValues:s.defaultValues??{identifier:"",currency:"ARS",description:""}});return e.jsx("form",{onSubmit:t.handleSubmit(s.onSubmit),children:e.jsxs(j,{gap:4,children:[e.jsxs(E,{isInvalid:!!t.formState.errors.identifier,isDisabled:n,children:[e.jsx(I,{children:"CBU/CVU/Alias"}),e.jsx(O,{placeholder:"mi.cuenta.usd, 12345678901234567890123, etc...",...t.register("identifier",{required:!0})}),e.jsx(R,{children:(c=t.formState.errors.identifier)==null?void 0:c.message})]}),e.jsxs(E,{isDisabled:n,children:[e.jsx(I,{children:"Moneda"}),e.jsx(ce,{placeholder:"Elegir moneda...",...t.register("currency"),children:Q.map(d=>e.jsx("option",{value:d,children:d},d))}),e.jsx(R,{children:(r=t.formState.errors.currency)==null?void 0:r.message})]}),e.jsxs(E,{children:[e.jsx(I,{children:"Descripción"}),e.jsx(O,{placeholder:"Descripción opcional",...t.register("description")}),e.jsx(R,{children:(o=t.formState.errors.description)==null?void 0:o.message})]}),e.jsx(k,{type:"submit",isLoading:a,children:"Guardar"})]})})}function Ke(){const a=Me(),[n,s]=h.useState(null),[t,c]=le(),{data:r}=pe({}),o=Oe(),d=Te(),v=We(),[m,u]=h.useState(!1),[i,g]=h.useState(void 0),[x,b]=h.useState(2);h.useEffect(()=>{t.get("newAccount")==="true"&&u(!0),b(x+1)},[t]);const C=de();a.es_operador_sin_retiro&&C("/app");function y(){u(!0)}function A(l){const f=()=>{U.success("Cuenta bancaria guardada"),u(!1),g(void 0)};i!=null&&i.id?d.mutate({id:i.id,values:l},{onSuccess:f}):o.mutate(l,{onSuccess:f})}function M(l){v.mutate(l,{onSuccess:()=>{U.success("Cuenta bancaria eliminada"),s(null)}})}function N(l){g(l),u(!0)}function w(){u(!1),g(void 0),c({})}return e.jsxs(ue,{allowedPermissions:[he.WITHDRAWALS_WORKFLOW],children:[e.jsxs(j,{children:[e.jsx(me,{title:"Mis Cuentas Bancarias"}),e.jsx(ge,{children:e.jsxs(xe,{children:[e.jsxs(fe,{mb:4,gap:4,justifyContent:"space-between",alignItems:"center",children:[e.jsx(k,{width:{base:"inherit",md:"fit-content"},leftIcon:e.jsx(Pe,{}),variant:"solid",onClick:y,children:"Nueva Cuenta"}),e.jsx(k,{leftIcon:e.jsx(Ne,{}),variant:"outline",onClick:()=>{C(-x)},children:"Volver"})]}),e.jsxs(j,{children:[r==null?void 0:r.map((l,f)=>e.jsxs(je.Fragment,{children:[e.jsx($e,{account:l,onDelete:s,onEdit:N}),f<r.length-1?e.jsx(ve,{}):null]},l.id)),(r==null?void 0:r.length)===0?e.jsx(p,{align:"center",children:'Todavía no agregaste ninguna cuenta bancaria. Podés hacerlo haciendo clic en "Nueva Cuenta".'}):null]})]})})]}),e.jsxs(Ce,{isOpen:m,onClose:w,children:[e.jsx(q,{}),e.jsxs(ke,{children:[e.jsxs(T,{children:[i!=null&&i.id?"Editar":"Nueva"," Cuenta Bancaria / Billetera"]}),e.jsx(be,{}),e.jsx(H,{children:e.jsx(Ge,{isLoading:o.isPending||d.isPending,isEditing:!!(i!=null&&i.id),defaultValues:i,onSubmit:A})})]})]}),e.jsx(De,{isOpen:n!==null,title:"Eliminar Cuenta Bancaria",message:`¿Estás seguro de borrar "${n==null?void 0:n.description}"? No se puede deshacer esta acción.`,confirmLabel:"Eliminar",cancelLabel:"Cancelar",isLoading:v.isPending,onClose:()=>s(null),onConfirm:()=>{n!=null&&n.id&&M(n.id)}})]})}function Je(){return e.jsx(ye,{children:e.jsx(W,{path:":clientAccountNumber",element:e.jsx(Be,{}),children:e.jsx(W,{path:"bank-accounts",element:e.jsx(Ke,{})})})})}export{Je as MyAccountRoutes};

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.