import{_ as __}from"./wordpress.chunk.BVds2GcU.js";import{b as i}from"./campaign.chunk.BU0ryCmb.js";import{bg as t,i as e,bS as n}from"./main.chunk.N-eZ2ybB.js";import{c as a}from"./pledge.chunk.Dci8K-_V.js";import{d as s,q as o,h as r,f as u,n as d,g as _,Z as c}from"./forms.chunk.Bz8aaTWe.js";const l=o(["pending","completed","failed","cancelled","refunded","trashed"]),p=s({amount:d().nullish(),payment_status:a.nullish(),payment_method:s({name:u(),logo:u(),type:o(["online-payment","manual-payment"]),label:u(),instruction:u().nullish()}),transaction_id:u().nullish()}),m=(i,t)=>{if(!e(i.tribute_type)&&!e(i.tribute_notification_type))return;!i.tribute_type&&i.tribute_notification_type&&t.addIssue({path:["tribute_type"],code:c.custom,message:__("Tribute type is required","growfund")}),i.tribute_salutation||t.addIssue({path:["tribute_salutation"],code:c.custom,message:__("Tribute prepended label is required","growfund")}),i.tribute_to||t.addIssue({path:["tribute_to"],code:c.custom,message:__("Tribute to is required","growfund")}),i.tribute_notification_type||t.addIssue({path:["tribute_notification_type"],code:c.custom,message:__("Notification type is required","growfund")}),i.tribute_notification_recipient_name||t.addIssue({path:["tribute_notification_recipient_name"],code:c.custom,message:__("Recipient name is required","growfund")});const n="send-post-mail"===i.tribute_notification_type||"send-ecard-and-post-mail"===i.tribute_notification_type;n||(i.tribute_notification_recipient_email||t.addIssue({path:["tribute_notification_recipient_email"],code:c.custom,message:__("Recipient email is required","growfund")}),i.tribute_notification_recipient_phone||t.addIssue({path:["tribute_notification_recipient_phone"],code:c.custom,message:__("Recipient phone is required","growfund")}));!!n&&!(e(i.tribute_notification_recipient_address)&&i.tribute_notification_recipient_address.address&&i.tribute_notification_recipient_address.city&&i.tribute_notification_recipient_address.zip_code&&i.tribute_notification_recipient_address.country)&&t.addIssue({path:["tribute_notification_recipient_address"],code:c.custom,message:__("Address is required for mail notifications","growfund")})},f=s({tribute_type:u().nullish(),tribute_salutation:u().nullish(),tribute_to:u().nullish(),tribute_notification_type:o(["send-ecard","send-post-mail","send-ecard-and-post-mail"]).nullish(),tribute_notification_recipient_name:u().nullish(),tribute_notification_recipient_phone:u().nullish(),tribute_notification_recipient_email:u().email(__("Invalid email address","growfund")).nullish(),tribute_notification_recipient_address:t.nullish()}).superRefine(m),h=s({id:_.string().nullish(),status:l.default("pending"),campaign_id:u({message:"Campaign is required"}),user_id:u({message:"Donor is required"}),fund_id:u().nullish(),amount:d({message:"The amount is required."}),notes:u().nullish(),created_at:u().nullish(),updated_at:u().nullish(),is_anonymous:r().default(!1)}).merge(p);s({id:_.string(),donor:n,fund:s({id:_.string(),title:u()}).nullish(),campaign:i.pick({id:!0,title:!0,status:!0,fund_raised:!0,goal_type:!0,goal_amount:!0,images:!0,start_date:!0,author:!0,fundraiser:!0,collaborators:!0,is_launched:!0}),status:l.default("pending"),notes:u().nullish(),is_anonymous:r().default(!1),is_manual:r().default(!1),updated_at:u().nullish(),created_at:u()}).merge(f._def.schema).merge(p.omit({amount:!0}).extend({amount:d()}));export{h as D,f as T,l as a,m as u};
