const t={name:200,email:254,phone:30,subject:200,message:5e3,description:5e3,profileUrl:500,listingUrl:500,conversationId:200,dateOfIncident:20},m=["profile","listing","message","other"],f=/[^\s\p{Cf}]/u;function l(e){return f.test(e)}function o(e){return e.trim()}function s(e){const n=e==null?void 0:e.trim();return n&&l(n)?n:void 0}function i(e,n,r){if(!l(e))return`${n} is required and must contain visible text.`;if(e.length>r)return`${n} must be ${r.toLocaleString("en-US")} characters or fewer.`}function a(e,n,r){if(e&&e.length>r)return`${n} must be ${r.toLocaleString("en-US")} characters or fewer.`}function g(e){const n={name:o(e.name),email:o(e.email),phone:s(e.phone),subject:o(e.subject),message:o(e.message)},r=i(n.name,"Name",t.name)??i(n.email,"Email",t.email)??a(n.phone,"Phone",t.phone)??i(n.subject,"Subject",t.subject)??i(n.message,"Message",t.message);return r?{ok:!1,error:r}:{ok:!0,value:n}}function u(e){const n=o(e.category),r={name:o(e.name),email:o(e.email),category:n,description:o(e.description),profileUrl:s(e.profileUrl),listingUrl:s(e.listingUrl),conversationId:s(e.conversationId),dateOfIncident:s(e.dateOfIncident)},d=m.includes(r.category),c=i(r.name,"Name",t.name)??i(r.email,"Email",t.email)??(d?void 0:"Please select a valid report category.")??i(r.description,"Description",t.description)??a(r.profileUrl,"Profile URL or username",t.profileUrl)??a(r.listingUrl,"Listing or service URL",t.listingUrl)??a(r.conversationId,"Conversation details",t.conversationId)??a(r.dateOfIncident,"Date of incident",t.dateOfIncident);return c?{ok:!1,error:c}:{ok:!0,value:r}}export{u as a,g as v};