PageSourceSearch

https://www.mahendras.org/_next/static/chunks/4281-a3905251b24344ea.js

js mahendras.org collected 2026-10-02 06:38:28 UTC 16,485 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4281],{4281:(e,t,a)=>{"use strict";a.d(t,{default:()=>y});var r=a(95155),s=a(97168),n=a(88482),l=a(89852),c=a(82714),o=a(95784),i=a(12115),d=a(53999);let m=i.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("textarea",{className:(0,d.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...s})});m.displayName="Textarea";var u=a(2158),p=a(69918),x=a(94430),h=a(60720),f=a(70927);let b=f.Ik({name:f.Yj().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s]+$/,"Name can only contain letters and spaces"),email:f.Yj().email("Please enter a valid email address").max(100,"Email must be less than 100 characters"),phone:f.Yj().regex(/^[6-9]\d{9}$/,"Please enter a valid 10-digit mobile number").length(10,"Phone number must be exactly 10 digits"),branch:f.Yj().min(1,"Please select a branch"),extra_edge_branch_id:f.Yj().optional(),course:f.Yj().min(1,"Please select a course"),extra_edge_course_id:f.Yj().optional(),remark:f.Yj().max(500,"Remark must be less than 500 characters").optional(),termAndCondition:f.zM().refine(e=>!0===e,"You must accept the terms and conditions")});var _=a(63560),g=a(62177),N=a(23879),j=a.n(N);let y=e=>{let{initialBranches:t,initialCourses:a,variant:d="page",preselectedBranchId:f,lockBranch:N=!1,formId:y="contact-form",type:v=h.d.INQUIRY,onSuccess:w,sectionTitle:k="Enquire Now",sectionDescription:C="Need Help with Your Preparation?",sectionBottomText:A="Fill out the form and our team will get in touch with you soon."}=e,E=e=>String(null!=e?e:"").trim(),[S,R]=(0,i.useState)(!1),[F,P]=(0,i.useState)({type:null,message:""}),Y=(0,i.useRef)(null),[J,L]=(0,i.useState)(null!=t?t:[]),[W,U]=(0,i.useState)(null!=a?a:[]),[q,M]=(0,i.useState)(!((null==t?void 0:t.length)&&(null==a?void 0:a.length))),Q=(0,i.useMemo)(()=>{let e=new Set;return J.filter(t=>{let a=E(t.id);return!(!a||e.has(a))&&(e.add(a),!0)})},[J]),T=(0,i.useMemo)(()=>{let e=new Set;return W.filter(t=>{let a=E(t.id);return!(!a||e.has(a))&&(e.add(a),!0)})},[W]),z="compact"===d,{register:I,handleSubmit:G,setValue:D,watch:V,formState:{errors:Z},reset:H}=(0,g.mN)({resolver:(0,_.u)(b),defaultValues:{branch:E(f)}}),B=V("branch"),O=V("course");(0,i.useEffect)(()=>{if((null==t?void 0:t.length)&&(null==a?void 0:a.length))return;let e=!1;return(async()=>{try{let r=await fetch("/api/contact-options");if(!r.ok)throw Error("Failed to load form options: ".concat(r.status));let s=await r.json();if(!e&&s.success&&s.data){var t,a;L(null!=(t=s.data.branches)?t:[]),U(null!=(a=s.data.courses)?a:[])}}catch(e){console.error("Failed to load contact form options:",e)}finally{e||M(!1)}})(),()=>{e=!0}},[t,a]),(0,i.useEffect)(()=>{f&&D("branch",E(f))},[f,D]),(0,i.useEffect)(()=>()=>{var e;null==(e=Y.current)||e.abort()},[]);let K=async e=>{var t;null==(t=Y.current)||t.abort();let a=new AbortController;Y.current=a,R(!0),P({type:null,message:""});let r=E(e.branch),s=E(e.course),n=Q.find(e=>E(e.id)===r),l=T.find(e=>E(e.id)===s);try{let t={name:e.name,email:e.email,phone:e.phone,branch:r,extra_edge_branch_id:(null==n?void 0:n.extraedge_id)||"",course:s,remark:e.remark||"New Enquirys",termAndCondition:e.termAndCondition,extra_edge_course_id:(null==l?void 0:l.extra_edge_id)||"",type:(0,h.J)(v)?v:h.d.INQUIRY};if((await fetch("/api/contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),signal:a.signal})).ok)P({type:"success",message:"Thank you for your message! We'll get back to you soon."}),H({name:"",email:"",phone:"",branch:null!=f?f:"",course:"",remark:"",termAndCondition:!1}),null==w||w();else throw Error("Failed to send message")}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;P({type:"error",message:"Sorry, there was an error sending your message. Please try again."})}finally{Y.current===a&&(Y.current=null,R(!1))}},$=(0,r.jsx)("form",{id:y,onSubmit:G(K),className:z?void 0:"m-auto",children:(0,r.jsxs)(n.Zp,{className:"border-border/50",children:[(0,r.jsxs)(n.Wu,{className:"space-y-6 pt-4!",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(c.J,{htmlFor:"".concat(y,"
1-name"),children:["Full Name ",(0,r.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,r.jsx)(l.p,{id:"".concat(y,"-name"),placeholder:"Enter your full name",disabled:S,...I("name"),className:Z.name?"border-destructive":""}),Z.name&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:Z.name.message})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(c.J,{htmlFor:"".concat(y,"-email"),children:["Email Address ",(0,r.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,r.jsx)(l.p,{id:"".concat(y,"-email"),type:"email",placeholder:"Enter your email address",disabled:S,...I("email"),className:Z.email?"border-destructive":""}),Z.email&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:Z.email.message})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(c.J,{htmlFor:"".concat(y,"-phone"),children:["Phone Number ",(0,r.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,r.jsx)(l.p,{id:"".concat(y,"-phone"),type:"tel",placeholder:"Enter your 10-digit mobile number",maxLength:10,disabled:S,...I("phone"),className:Z.phone?"border-destructive":""}),Z.phone&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:Z.phone.message})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(c.J,{htmlFor:"".concat(y,"-branch"),children:["Select Branch ",(0,r.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,r.jsxs)(o.l6,{value:B||void 0,disabled:S||N,onValueChange:e=>D("branch",e),children:[(0,r.jsx)(o.bq,{id:"".concat(y,"-branch"),className:Z.branch?"border-destructive":"",children:(0,r.jsx)(o.yv,{placeholder:"Select a branch"})}),(0,r.jsx)(o.gC,{children:Q.map(e=>(0,r.jsx)(o.eb,{value:E(e.id),children:e.branch_name},E(e.id)))})]}),Z.branch&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:Z.branch.message})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(c.J,{htmlFor:"".concat(y,"-course"),children:["Select Course ",(0,r.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,r.jsxs)(o.l6,{value:O||void 0,disabled:S,onValueChange:e=>D("course",e),children:[(0,r.jsx)(o.bq,{id:"".concat(y,"-course"),className:Z.course?"border-destructive":"",children:(0,r.jsx)(o.yv,{placeholder:"Select a course"})}),(0,r.jsx)(o.gC,{children:T.map(e=>(0,r.jsx)(o.eb,{value:E(e.id),children:e.name},E(e.id)))})]}),Z.course&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:Z.course.message})]}),"branch"!==v?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(c.J,{htmlFor:"".concat(y,"-remark"),children:"Remark"}),(0,r.jsx)(m,{id:"".concat(y,"-remark"),placeholder:"Tell us more about your inquiry...",rows:z?4:6,disabled:S,...I("remark"),className:Z.remark?"border-destructive":""}),Z.remark&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:Z.remark.message})]}):null,(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(l.p,{id:"".concat(y,"-termAndCondition"),type:"checkbox",disabled:S,checked:!!V("termAndCondition"),onChange:e=>D("termAndCondition",e.target.checked,{shouldValidate:!0}),className:"mt-0.5 h-4 w-4"}),(0,r.jsxs)(c.J,{htmlFor:"".concat(y,"-termAndCondition"),className:"text-sm leading-snug font-normal cursor-pointer whitespace-nowrap flex-wrap!",children:["I accept the"," ",(0,r.jsx)("a",{href:"/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Terms and Conditions"})," ","and"," ",(0,r.jsx)("a",{href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Privacy Policy"})," ",(0,r.jsx)("span",{className:"text-destructive",children:"*"})]})]}),Z.termAndCondition&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:Z.termAndCondition.message})]}),F.type&&(0,r.jsx)("p",{className:"text-sm ".concat("success"===F.type?"text-green-600":"text-destructive"),children:F.message})]}),(0,r.jsx)(n.wL,{className:"justify-center gap-2",children:(0,r.jsx)(s.$,{type:"submit",disabled:S||q,children:S?"Sending...":"Submit"})})]})});return z?$:(0,r.jsx)(p.A,{background:"white",children:(0,r.jsxs)(u.A,{className:"justify-center flex-col ".concat(j().container),children:[(0,r.jsx)(x.A,{title:k,description:C,bottomSection:A}),$]})})}},23879:e=>{e.exports={table:"contact-form_table__Sq20H","table-compact":"contact-form_table-compact__WuUIQ","table-striped":"contact-form_table-striped__LpkDo","table-bordered":"contact-form_table-bordered__G3VGW",tableContainer:"contact-form_tableContainer__1S4o_","text-center":"contact-form_text-center__3rDsN","text-right":"contact-form_text-right__Qx6Y6","text-nowrap":"contact-form_text-nowrap__pbii7",container:"contact-form_container__UEUf6",formWrapper:"contact-form_formWrapper__DUDcL",form:"contact-form_form__Y60iq",formGrid:"contact-form_formGrid__kWseL",formGroup:"contact-form_formGroup__Kn949",label:"contact-form_label__78ZWx",input:"contact-form_input__Aavm6",textarea:"contact-form_textarea__RCQ3H",inputError:"contact-form_inputError__m7e2Q",errorMessage:"contact-form_errorMessage__FZnyX",checkboxLabel:"contact-form_checkboxLabel__Bh7E_",checkbox:"contact-form_checkbox__NqzG2",checkboxText:"contact-form_checkboxText___6Ps4",statusMessage:"contact-form_statusMessage__UpQBQ",successMessage:"contact-form_successMessage__4eN9f",submitWrapper:"contact-form_submitWrapper__5rtHF",submitButton:"contact-form_submitButton__GzLLE",spinner:"contact-form_spinner__oHOK1",spin:"contact-form_spin__QmKzZ"}},46428:e=>{e.exports={table:"section-header_table__1cEXN","table-compact":"section-header_table-compact__Uh8YW","table-striped":"section-header_table-striped__3_eyl","table-bordered":"section-header_table-bordered__vV0Y0",tableContainer:"section-header_tableContainer__tq4uW","text-center":"section-header_text-center__DxkdN","text-right":"section-header_text-right__EF1gh","text-nowrap":"section-header_text-nowrap__OhJ_2",header:"section-header_header__3u4cj",description:"section-header_description__Lwizc",title:"section-header_title__P_QUE"}},82714:(e,t,a)=>{"use strict";a.d(t,{J:()=>l});var r=a(95155);a(12115);var s=a(40968),n=a(53999);function l(e){let{className:t,...a}=e;return(0,r.jsx)(s.b,{"data-slot":"label",className:(0,n.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}},88482:(e,t,a)=>{"use strict";a.d(t,{Wu:()=>c,Zp:()=>l,wL:()=>o});var r=a(95155),s=a(12115),n=a(53999);let l=s.forwardRef((e,t)=>
1{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",a),...s})});l.displayName="Card",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("flex flex-col space-y-1.5 p-4 sm:p-6",a),...s})}).displayName="CardHeader",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("h3",{ref:t,className:(0,n.cn)("text-2xl font-semibold leading-none tracking-tight",a),...s})}).displayName="CardTitle",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("p",{ref:t,className:(0,n.cn)("text-sm text-muted-foreground",a),...s})}).displayName="CardDescription";let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("p-4 pt-0 sm:p-6 sm:pt-0",a),...s})});c.displayName="CardContent";let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("flex items-center p-4 pt-0 sm:p-6 sm:pt-0",a),...s})});o.displayName="CardFooter"},89852:(e,t,a)=>{"use strict";a.d(t,{p:()=>l});var r=a(95155),s=a(12115),n=a(53999);let l=s.forwardRef((e,t)=>{let{className:a,type:s,...l}=e;return(0,r.jsx)("input",{type:s,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a),ref:t,...l})});l.displayName="Input"},94430:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var r=a(95155),s=a(42607),n=a(46428),l=a.n(n);let c=e=>{let{description:t,title:a,variant:n="light",bottomSection:c=null}=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center w-full ".concat(l().header),children:[(0,r.jsx)("h2",{className:"text-center fluid-h2 font-bold tracking-tight  ".concat("dark"===n?"text-white":"text-primary"),children:a}),(0,r.jsx)("p",{className:"text-center text-base sm:text-lg ".concat("dark"===n?"text-white":"text-muted-foreground"),children:t}),c&&(0,r.jsx)(s.A,{className:l().description,align:"center",color:"dark"===n?"white":"gray-600",children:c})]})}},95784:(e,t,a)=>{"use strict";a.d(t,{bq:()=>u,eb:()=>f,gC:()=>h,l6:()=>d,yv:()=>m});var r=a(95155),s=a(78002),n=a(66474),l=a(47863),c=a(5196),o=a(12115),i=a(53999);let d=s.bL;s.YJ;let m=s.WT,u=o.forwardRef((e,t)=>{let{className:a,children:l,...c}=e;return(0,r.jsxs)(s.l9,{ref:t,className:(0,i.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...c,children:[l,(0,r.jsx)(s.In,{asChild:!0,children:(0,r.jsx)(n.A,{className:"h-4 w-4 opacity-50"})})]})});u.displayName=s.l9.displayName;let p=o.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.PP,{ref:t,className:(0,i.cn)("flex cursor-default items-center justify-center py-1",a),...n,children:(0,r.jsx)(l.A,{className:"h-4 w-4"})})});p.displayName=s.PP.displayName;let x=o.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,r.jsx)(s.wn,{ref:t,className:(0,i.cn)("flex cursor-default items-center justify-center py-1",a),...l,children:(0,r.jsx)(n.A,{className:"h-4 w-4"})})});x.displayName=s.wn.displayName;let h=o.forwardRef((e,t)=>{let{className:a,children:n,position:l="popper",...c}=e;return(0,r.jsx)(s.ZL,{children:(0,r.jsxs)(s.UC,{ref:t,className:(0,i.cn)("relative z-[2147483647] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:l,...c,children:[(0,r.jsx)(p,{}),(0,r.jsx)(s.LM,{className:(0,i.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,r.jsx)(x,{})]})})});h.displayName=s.UC.displayName,o.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.JU,{ref:t,className:(0,i.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...n})}).displayName=s.JU.displayName;let f=o.forwardRef((e,t)=>{let{className:a,children:n,...l}=e;return(0,r.jsxs)(s.q7,{ref:t,className:(0,i.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",a),...l,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(c.A,{className:"h-4 w-4"})})}),(0,r.jsx)(s.p4,{children:n})]})});f.displayName=s.q7.displayName,o.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.wv,{ref:t,className:(0,i.cn)("-mx-1 my-1 h-px bg-muted",a),...n})}).displayName=s.wv.displayName}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.