"use strict";exports.id=4949,exports.ids=[4949],exports.modules={54949:(e,t,s)=>{s.a(e,async(e,r)=>{try{s.r(t),s.d(t,{default:()=>AbuseReportForm});var a=s(20997),o=s(64165),d=s(61175),l=s(54574),m=s(75609),i=s(66644),n=s(13330),c=s(60802),x=s(45009),u=s(86201),p=s(11377),h=e([l,i,u]);[l,i,u]=h.then?(await h)():h;let f=m.object().shape({message:m.string().required("You must need to provide a message")});function AbuseReportForm(){let{data:e}=(0,x.X9)(),{closeModal:t}=(0,x.SO)(),{t:s}=(0,p.useTranslation)("common"),{mutate:r,isLoading:m}=(0,d.useMutation)(l.Z.abuse.create,{onSuccess:()=>{u.default.success(s("text-abuse-report"))},onError:e=>{let{response:{data:t}}=e??{};t?.message?.includes("YOU_HAVE_ALREADY_GIVEN_ABUSIVE_REPORT_FOR_THIS")?u.default.error(s("text-report-error-message")):u.default.error(t?.message)},onSettled:()=>{t()}});return(0,a.jsxs)("div",{className:"flex h-full min-h-screen w-screen flex-col justify-center bg-light p-6 text-left dark:bg-dark-250 xs:h-auto xs:min-h-0 xs:max-w-[400px] md:max-w-[590px] md:rounded-md md:p-7 lg:max-w-[650px]",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center pt-3 pb-7 md:pt-5 md:pb-9",children:[a.jsx(o.c,{className:"h-14 w-14 md:h-[60px] md:w-[60px]"}),a.jsx("h2",{className:"mt-4 text-15px font-medium tracking-[-0.3px] text-dark dark:text-light",children:s("text-about-report-title")})]}),a.jsx(i.l,{onSubmit:function(t){r({model_id:e.reviewId,model_type:"Review",...t})},validationSchema:f,useFormProps:{defaultValues:{message:""}},children:({register:e,formState:{errors:t}})=>(0,a.jsxs)("div",{className:"space-y-5",children:[a.jsx(n.Z,{label:"text-report-input-placeholder",...e("message"),error:t?.message?.message}),a.jsx(c.Z,{className:"text-sm",disabled:m,isLoading:m,children:s("text-report-button")})]})})]})}r()}catch(e){r(e)}})}};