import{j as r}from"./router.chunk.YsRm4bSN.js";import{f as e,bM as n,Z as s,J as d,K as o,g as u,h as a,j as f,T as g,B as i,c as l,ba as c,bO as t}from"./main.chunk.N-eZ2ybB.js";import{_ as __}from"./wordpress.chunk.BVds2GcU.js";import{z as m,k as w}from"./forms.chunk.Bz8aaTWe.js";import{W as h}from"./icons.chunk.BwnSC3zE.js";const x=m.object({comment:m.string().min(1,{message:__("Comment message is required","growfund")}).default("")}),j=({onSubmit:l})=>{const{currentUser:c}=e(),t=n({first_name:c.first_name,last_name:c.last_name})||"A",m=w({resolver:d(x),defaultValues:s(x)});return r.jsx(o,{...m,children:r.jsxs("form",{className:"growfund-rounded-lg growfund-bg-background-surface growfund-shadow-md growfund-overflow-hidden growfund-mt-3",onSubmit:m.handleSubmit(r=>{l(r),m.reset()},r=>{console.error(r)}),children:[r.jsxs("div",{className:"growfund-flex growfund-items-center growfund-gap-2 growfund-p-3",children:[r.jsxs(u,{children:[r.jsx(a,{src:c.image?.url}),r.jsx(f,{children:t})]}),r.jsx(g,{control:m.control,name:"comment",placeholder:__("Leave a comment...","growfund"),className:"growfund-border-none",noErrorMessage:!0})]}),r.jsx("div",{className:"growfund-p-2 growfund-bg-background-surface-secondary growfund-w-full growfund-flex growfund-justify-end",children:r.jsx(i,{variant:"outline",type:"submit",children:__("Post","growfund")})})]})})},b=({timeline:s,onRemove:d})=>{const{currentUser:o}=e(),g=s.type!==t.TIMELINE,m=n({first_name:s.user.name});return r.jsxs("div",{className:l("growfund-px-5 growfund-py-3 growfund-pr-0 growfund-flex growfund-items-center growfund-justify-between growfund-rounded-lg growfund-group/timeline growfund-min-h-16 last:growfund-pb-0 last:growfund-min-h-0",!g&&"hover:growfund-bg-background-fill hover:growfund-shadow-md"),children:[r.jsxs("div",{className:"growfund-flex growfund-items-center growfund-gap-2",children:[g?r.jsx("div",{className:"growfund-size-6 growfund-rounded growfund-bg-background-fill growfund-flex growfund-items-center growfund-justify-center",children:r.jsx("span",{className:"growfund-size-2 growfund-rounded-full growfund-bg-icon-primary"})}):r.jsx("div",{children:r.jsxs(u,{className:"growfund-size-10 growfund-relative growfund-left-[-0.5rem]",children:[r.jsx(a,{src:s.user.image?.url,className:"growfund-bg-background-fill-special-2 growfund-border growfund-border-border"}),r.jsx(f,{className:"growfund-bg-background-surface",children:o.active_role===c.ADMIN?"A":m})]})}),r.jsxs("div",{className:"growfund-space-y-1 growfund-typo-small growfund-text-fg-primary growfund-font-medium",children:[!g&&r.jsx("div",{children:s.user.name}),r.jsx("div",{className:l("growfund-font-regular",!g&&"growfund-text-fg-secondary"),children:s.comment})]})]}),r.jsxs("div",{children:[r.jsx("div",{className:l("growfund-typo-tiny growfund-text-fg-subdued",!g&&"group-hover/timeline:growfund-hidden"),children:s.created_at}),!g&&r.jsx(i,{variant:"ghost",size:"icon",className:"hover:growfund-text-icon-critical growfund-mr-2 growfund-hidden group-hover/timeline:growfund-flex",onClick:()=>{d(s.id)},children:r.jsx(h,{})})]})]})},p=({children:e,hasItems:n})=>r.jsxs("div",{className:"growfund-relative",children:[r.jsx("div",{className:"growfund-pt-6",children:e}),n&&r.jsx("div",{className:"growfund-absolute growfund-bottom-0 growfund-left-8 growfund-w-[2px] growfund-h-full growfund-bg-border growfund-z-negative"})]}),v=({children:e})=>r.jsx("div",{className:"growfund-pt-3",children:e}),N=({children:e})=>r.jsxs("div",{className:"growfund-mt-10",children:[r.jsx("h6",{className:"growfund-typo-h6 growfund-font-semibold growfund-text-fg-primary",children:__("Timeline","growfund")}),e]});export{x as C,N as T,v as a,j as b,p as c,b as d};
