"use strict";var e=require("react/jsx-runtime"),d=require("../../primitives/button.js");require("../../primitives/checkbox.js"),require("../../primitives/dropdown-selector.js");var o=require("../../primitives/popover.js");require("../../primitives/radio.js"),require("../../primitives/segmented-control.js"),require("../../primitives/switch.js");var n=require("../../primitives/text.js"),p=require("@styled/css/css"),a=require("@styled/jsx"),l=require("react");const f=({avatarUrl:s,email:r,name:t,logoutLabel:c="Log out",onLogout:u})=>{const[x,i]=l.useState(!1);return l.useEffect(()=>{i(!1)},[s]),e.jsxs(o.Popover,{iconSize:28,placement:"bottom right",variant:"text",children:[e.jsx(o.Popover.LeadingIcon,{children:s&&!x?e.jsx("img",{style:{borderRadius:"50%"},src:s,alt:"user avatar",onError:()=>i(!0)}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",children:[e.jsx("circle",{cx:"14",cy:"14",r:"13",fill:"url(#paint0_radial_3600_63997)",stroke:"white",strokeOpacity:"0.24",strokeWidth:"0.5"}),e.jsx("defs",{children:e.jsxs("radialGradient",{id:"paint0_radial_3600_63997",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15 30.75) rotate(-90) scale(37.3333 65.833)",children:[e.jsx("stop",{offset:"0.01",stopColor:"#FFF507"}),e.jsx("stop",{offset:"0.259381",stopColor:"#F09BEB"}),e.jsx("stop",{offset:"0.598165",stopColor:"#412CB9"}),e.jsx("stop",{offset:"1",stopColor:"#18171A"})]})})]})}),e.jsx(o.Popover.Content,{className:p.css({w:t&&r?"200px":"fit-content",maxW:"200px"}),children:e.jsxs(a.Stack,{w:"full",alignItems:"start",gap:0,children:[(r||t)&&e.jsxs(a.Stack,{w:"full",gap:1,children:[t&&e.jsx(n.default,{fontWeight:"medium",children:t}),r&&e.jsx(n.default,{size:"sm",truncate:!0,fontColor:"text.secondary",children:r})]}),(r||t)&&e.jsx(a.Divider,{color:"surface.quaternary",my:3,minW:"88px"}),e.jsx(d.default,{label:c,textStyle:"negative",variant:"text",size:"sm",onPress:u})]})})]})};exports.AccountMenu=f;
//# sourceMappingURL=account-menu.js.map
