import{_ as __}from"./wordpress.chunk.BVds2GcU.js";import{aL as e,i as s,bm as t}from"./main.chunk.N-eZ2ybB.js";import{d as i,f as a,n as l,h as d,q as u,g as r,Z as n,e as o}from"./forms.chunk.Bz8aaTWe.js";const m=i({id:r.string(),title:a({message:__("The reward item title is required.","growfund")}),type:u(["digital","physical"],{errorMap:()=>({message:__("The reward item type is required.","growfund")})}),image:e.nullish(),asset_type:u(["file","url"]).nullish(),can_download:d().nullish(),asset:e.nullish(),asset_url:a().nullish(),description:a().nullish(),quantity:l().nullish(),created_at:a().optional()}),p=m.omit({id:!0,created_at:!0}).superRefine((e,i)=>{if("digital"===e.type){if(!s(e.asset_type))return void i.addIssue({code:n.custom,message:__("Please select an asset type.","growfund"),path:["asset_type"]});"file"!==e.asset_type||s(e.asset)||i.addIssue({code:n.custom,message:__("File is required.","growfund"),path:["asset"]}),"url"!==e.asset_type||s(e.asset_url)&&""!==e.asset_url.trim()||i.addIssue({code:n.custom,message:__("URL is required.","growfund"),path:["asset_url"]}),"url"===e.asset_type&&(s(e.asset_url)&&""!==e.asset_url.trim()?t(e.asset_url)||i.addIssue({code:n.custom,message:__("Please enter a valid URL","growfund"),path:["asset_url"]}):i.addIssue({code:n.custom,message:__("URL is required.","growfund"),path:["asset_url"]}))}}),c=m,_=m,h=i({title:a({message:"The reward title is required."}),amount:l({message:"The pledge amount is required."}),description:a().nullish(),image:e.nullish(),quantity_type:u(["unlimited","limited"]).default("unlimited"),quantity_limit:l().nullish(),time_limit_type:u(["no-limit","specific-date"]).default("specific-date"),limit_start_date:r.date().nullish(),limit_end_date:r.date().nullish(),reward_type:u(["physical-goods","digital-goods","physical-and-digital-goods"]).default("physical-goods"),estimated_delivery_date:r.date().nullish(),shipping_costs:o(i({location:a(),cost:l()})).nullish(),allow_local_pickup:d().default(!1),local_pickup_instructions:a().nullish(),items:o(i({id:r.string(),quantity:l()})).default([])}),g=h.omit({items:!0}).extend({id:r.string(),reward_left:l().nullish(),number_of_contributors:l().nullish(),created_at:a().nullish(),items:o(c)});export{_ as R,p as a,h as b,g as c};
