"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[28937],{28937:(e,r,t)=>{t.d(r,{B:()=>_});var a=t(19002),s=t(31336),o=t(70444),i=t(31055),n=t(1459),l=t(82576),d=t(34145),c=t(52623),u=t(95836),m=t(61237),p=t(42553),f=t(82187),x=t(40399),g=t(12569);let h=(0,g.createServerReference)("7fbaf3a76eaa7252a8c95b0fd43d21cf256015a840",g.callServer,void 0,g.findSourceMapURL,"sendFeedback");var v=t(28986),b=t(14382),y=t(56479),N=t(79526),w=t(31001);let j=w.z.object({category:w.z.nativeEnum(o.E,{required_error:"Category is required",invalid_type_error:"Cateogry must be a string"}),message:w.z.string({required_error:"Message is required.",invalid_type_error:"Message must be a string."}).trim().min(1,"Message is required.").max(4e3,"Maximum 4000 characters allowed."),url:w.z.string({required_error:"URL is required.",invalid_type_error:"URL must be a string."}).url("Must be a valid URL")}),_=s.Ay.create(()=>{let e=(0,v.$)(),r=(0,p.U)(f.H.MdUp,{ssr:!1}),t=window.location.href,s=(0,b.L)({schema:j,mode:"onSubmit",defaultValues:{category:o.E.SUGGESTION,message:"",url:t}}),g="Feedback",w="Create an internal issue by filling out the form below.",_=!s.formState.isSubmitting&&(!s.formState.isSubmitted||s.formState.isDirty),C=async r=>{if(!_)return;let t=window.location.href,a=await h({...r,url:t});if((null==a?void 0:a.serverError)||(null==a?void 0:a.validationErrors)){if(null==a?void 0:a.validationErrors){var s,o;if(null===(s=a.validationErrors._errors)||void 0===s?void 0:s[0])u.o.error(a.validationErrors._errors[0]);else{let e=Object.values(a.validationErrors).find(e=>"object"==typeof e&&null!==e&&"_errors"in e&&Array.isArray(e._errors)&&e._errors.length>0);(null==e?void 0:null===(o=e._errors)||void 0===o?void 0:o[0])?u.o.error(e._errors[0]):u.o.error("Validation error. Please check your input.")}}else(null==a?void 0:a.serverError)?u.o.error(a.serverError):u.o.error("Couldn't send feedback");console.error("Feedback submission error:",a)}else u.o.success("Feedback sent"),e.handleClose()},E=(0,a.jsxs)("form",{className:(0,x.cn)("space-y-4",!r&&"p-4"),onSubmit:s.handleSubmit(C),children:[(0,a.jsx)(d.zB,{control:s.control,name:"category",render:e=>{let{field:r}=e;return(0,a.jsxs)(d.eI,{className:"flex w-full flex-col",children:[(0,a.jsx)(d.lR,{required:!0,children:"Topic"}),(0,a.jsx)(d.MJ,{children:(0,a.jsxs)(c.l6,{required:!0,value:r.value,onValueChange:r.onChange,disabled:s.formState.isSubmitting,children:[(0,a.jsx)(c.bq,{className:"w-full",children:(0,a.jsx)(c.yv,{})}),(0,a.jsx)(c.gC,{children:Object.entries(N.X4).map(e=>{let[r]=e,t=o.E[r];return(0,a.jsx)(c.eb,{value:t,children:y.tC[t]},r)})})]})}),(0,a.jsx)(d.C5,{})]})}}),(0,a.jsx)(d.zB,{control:s.control,name:"message",render:e=>{let{field:r}=e;return(0,a.jsxs)(d.eI,{className:"flex flex-col",children:[(0,a.jsx)(d.lR,{required:!0,children:"Message"}),(0,a.jsx)(d.MJ,{children:(0,a.jsx)(m.T,{required:!0,rows:4,autoFocus:!0,disabled:s.formState.isSubmitting,...r})}),(0,a.jsx)(d.C5,{})]})}})]}),T=()=>{s.reset(),e.handleClose()},R=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.$,{type:"button",variant:"outline",onClick:T,children:"Cancel"}),(0,a.jsx)(i.$,{type:"button",variant:"default",disabled:!_,loading:s.formState.isSubmitting,onClick:s.handleSubmit(C),children:"Send"})]});return(0,a.jsx)(d.Op,{...s,children:r?(0,a.jsx)(n.lG,{open:e.visible,children:(0,a.jsxs)(n.Cf,{className:"max-w-sm",onClose:T,onAnimationEndCapture:e.handleAnimationEndCapture,children:[(0,a.jsxs)(n.c7,{children:[(0,a.jsx)(n.L3,{children:g}),(0,a.jsx)(n.rr,{className:"sr-only",children:w})]}),E,(0,a.jsx)(n.Es,{children:R})]})}):(0,a.jsx)(l._s,{open:e.visible,onOpenChange:r=>{r?e.handleOpenChange(r):T()},children:(0,a.jsxs)(l.zj,{children:[(0,a.jsxs)(l.BE,{className:"text-left",children:[(0,a.jsx)(l.gk,{children:g}),(0,a.jsx)(l.I6,{className:"sr-only",children:w})]}),E,(0,a.jsx)(l.tb,{className:"flex-col-reverse pt-4",children:R})]})})})})},28986:(e,r,t)=>{t.d(r,{$:()=>s});var a=t(31336);function s(){let e=a.Ay.useModal();return{...e,handleAnimationEndCapture:()=>{e.resolveHide(),e.visible||e.keepMounted||e.remove()},handleClose:()=>{e.hide()},handleOpenChange:r=>{r||(e.hide(),e.resolveHide(),e.visible||e.keepMounted||e.remove())}}}},14382:(e,r,t)=>{t.d(r,{L:()=>o});var a=t(56060),s=t(68733);function o(e){return(0,s.mN)({...e,resolver:(0,a.u)(e.schema,void 0,{raw:!0})})}},56479:(e,r,t)=>{t.d(r,{g9:()=>d,tC:()=>n,RG:()=>l});var a=t(65993),s=t(35435),o=function(e){return e.Testing="testing",e.Free="free",e.Tier1="tier-1",e.Tier1PendingCancel="tier-1-pending-cancel",e.Tier2="tier-2",e.Tier2PendingCancel="tier-2-pending-cancel",e.Tier3="tier-3",e.Tier3PendingCancel="tier-3-pending-cancel",e}({}),i=t(70444);let n={[i.E.SUGGESTION]:"Suggestion",[i.E.PROBLEM]:"Problem",[i.E.QUESTION]:"Question"},l={[s.K.Credentials]:"Credentials",[s.K.TotpCode]:"TOTP code",[s.K.RecoveryCode]:"Recovery code",[s.K.Google]:"Google",[s.K.Discord]:"Discord",[s.K.GitHub]:"GitHub"};o.Testing,o.Free,o.Tier1,o.Tier1PendingCancel,o.Tier2,o.Tier2PendingCancel,o.Tier3,o.Tier3PendingCancel;let d={[a._5.NewEmailConflict]:"Email already exists.",[a._5.UnverifiedEmail]:"Email is not verified.",[a._5.AccountClaimRequired]:"Your learning account was migrated. Claim it to restore access.",[a._5.IncorrectEmailOrPassword]:"Email or password is not correct.",[a._5.TotpCodeRequired]:"TOTP code is required.",[a._5.IncorrectTotpCode]:"The TOTP code is not correct.",[a._5.MissingRecoveryCodes]:"Missing recovery codes.",[a._5.IncorrectRecoveryCode]:"The recovery code is not correct.",[a._5.RequestExpired]:"Request has expired.",[a._5.RateLimitExceeded]:"Rate limit exceeded.",[a._5.IllegalOAuthProvider]:"Illegal OAuth provider.",[a._5.OAuthAccountNotLinked]:"This account is already linked to another user. Please try a different account or contact support.",[a._5.InternalServerError]:"Something went wrong. Please try again later.",[a._5.UnknownError]:"Unknown error."}},70444:(e,r,t)=>{t.d(r,{E:()=>a.Eq});var a=t(26935)},65993:(e,r,t)=>{t.d(r,{_5:()=>a}),t(88709);var a=function(e){return e.NewEmailConflict="new_email_conflict",e.UnverifiedEmail="unverified_email",e.AccountClaimRequired="account_claim_required",e.IncorrectEmailOrPassword="incorrect_email_or_password",e.TotpCodeRequired="totp_code_required",e.IncorrectTotpCode="incorrect_totp_code",e.MissingRecoveryCodes="missing_recovery_codes",e.IncorrectRecoveryCode="incorrect_recovery_code",e.RequestExpired="request_expired",e.RateLimitExceeded="rate_limit_exceeded",e.IllegalOAuthProvider="illegal_oauth_provider",e.OAuthAccountNotLinked="oauth_account_not_linked",e.InternalServerError="internal_server_error",e.UnknownError="unknown_error",e}({})},35435:(e,r,t)=>{t.d(r,{K:()=>a,L:()=>s});var a=function(e){return e.Credentials="credentials",e.TotpCode="totp-code",e.RecoveryCode="recovery-code",e.Google="google",e.Discord="discord",e.GitHub="github",e}({}),s=function(e){return e.Google="google",e.Discord="discord",e.GitHub="github",e}({})},26935:(e,r,t)=>{t.d(r,{Eq:()=>a,nv:()=>s,s9:()=>o});let a={SUGGESTION:"suggestion",PROBLEM:"problem",QUESTION:"question"},s={VIDEO:"VIDEO",ARTICLE:"ARTICLE",DOWNLOAD:"DOWNLOAD",QUIZ:"QUIZ",SLIDES:"SLIDES",NOTEBOOK:"NOTEBOOK",MULTIMEDIA:"MULTIMEDIA",INTERACTIVE_ARTICLE:"INTERACTIVE_ARTICLE"},o={PENDING:"PENDING",CLAIMED:"CLAIMED"}},82576:(e,r,t)=>{t.d(r,{BE:()=>u,I6:()=>f,_s:()=>n,gk:()=>p,tb:()=>m,zj:()=>c});var a=t(19002),s=t(52114),o=t(4637),i=t(40399);let n=e=>{let{shouldScaleBackground:r=!0,...t}=e;return(0,a.jsx)(o._s.Root,{shouldScaleBackground:r,...t})};n.displayName="Drawer",o._s.Trigger;let l=o._s.Portal;o._s.Close;let d=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)(o._s.Overlay,{ref:r,className:(0,i.cn)("fixed inset-0 z-50 bg-black/80",t),...s})});d.displayName=o._s.Overlay.displayName;let c=s.forwardRef((e,r)=>{let{className:t,children:s,...n}=e;return(0,a.jsxs)(l,{children:[(0,a.jsx)(d,{}),(0,a.jsxs)(o._s.Content,{ref:r,className:(0,i.cn)("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",t),...n,children:[(0,a.jsx)("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),s]})]})});c.displayName="DrawerContent";let u=e=>{let{className:r,...t}=e;return(0,a.jsx)("div",{className:(0,i.cn)("grid gap-1.5 p-4 text-center sm:text-left",r),...t})};u.displayName="DrawerHeader";let m=e=>{let{className:r,...t}=e;return(0,a.jsx)("div",{className:(0,i.cn)("mt-auto flex flex-col gap-2 p-4",r),...t})};m.displayName="DrawerFooter";let p=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)(o._s.Title,{ref:r,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",t),...s})});p.displayName=o._s.Title.displayName;let f=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)(o._s.Description,{ref:r,className:(0,i.cn)("text-sm text-muted-foreground",t),...s})});f.displayName=o._s.Description.displayName},34145:(e,r,t)=>{t.d(r,{C5:()=>v,MJ:()=>g,Op:()=>d,Rr:()=>h,Wd:()=>m,eI:()=>f,lR:()=>x,zB:()=>u});var a=t(19002),s=t(52114),o=t(4302),i=t(68733),n=t(40399),l=t(2071);let d=i.Op,c=s.createContext({}),u=e=>{let{...r}=e;return(0,a.jsx)(c.Provider,{value:{name:r.name},children:(0,a.jsx)(i.xI,{...r})})},m=()=>{let e=s.useContext(c),r=s.useContext(p),{getFieldState:t,formState:a}=(0,i.xW)(),o=t(e.name,a);if(!e)throw Error("useFormField should be used within ");let{id:n}=r;return{id:n,name:e.name,formItemId:"".concat(n,"-form-item"),formDescriptionId:"".concat(n,"-form-item-description"),formMessageId:"".concat(n,"-form-item-message"),...o}},p=s.createContext({}),f=s.forwardRef((e,r)=>{let{className:t,...o}=e,i=s.useId();return(0,a.jsx)(p.Provider,{value:{id:i},children:(0,a.jsx)("div",{ref:r,className:(0,n.cn)("space-y-2",t),...o})})});f.displayName="FormItem";let x=s.forwardRef((e,r)=>{let{required:t,children:s,className:o,...i}=e,{error:d,formItemId:c}=m();return(0,a.jsxs)(l.J,{ref:r,className:(0,n.cn)(d&&"text-destructive",o),htmlFor:c,...i,children:[s,t&&(0,a.jsx)("span",{className:"align-top",children:"*"})]})});x.displayName="FormLabel";let g=s.forwardRef((e,r)=>{let{...t}=e,{error:s,formItemId:i,formDescriptionId:n,formMessageId:l}=m();return(0,a.jsx)(o.DX,{ref:r,id:i,"aria-describedby":s?"".concat(n," ").concat(l):"".concat(n),"aria-invalid":!!s,...t})});g.displayName="FormControl";let h=s.forwardRef((e,r)=>{let{className:t,...s}=e,{formDescriptionId:o}=m();return(0,a.jsx)("p",{ref:r,id:o,className:(0,n.cn)("text-[0.8rem] text-muted-foreground",t),...s})});h.displayName="FormDescription";let v=s.forwardRef((e,r)=>{let{className:t,children:s,...o}=e,{error:i,formMessageId:l}=m(),d=i?String(null==i?void 0:i.message):s;return d?(0,a.jsx)("p",{ref:r,id:l,className:(0,n.cn)("text-[0.8rem] font-medium text-destructive",t),...o,children:d}):null});v.displayName="FormMessage"},2071:(e,r,t)=>{t.d(r,{J:()=>d});var a=t(19002),s=t(52114),o=t(71821),i=t(42030),n=t(40399);let l=(0,i.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)(o.b,{ref:r,className:(0,n.cn)(l(),t),...s})});d.displayName=o.b.displayName},52623:(e,r,t)=>{t.d(r,{bq:()=>m,eb:()=>g,gC:()=>x,l6:()=>c,mi:()=>h,yv:()=>u});var a=t(19002),s=t(52114),o=t(58342),i=t(47659),n=t(86042),l=t(45359),d=t(40399);let c=o.bL;o.YJ;let u=o.WT,m=s.forwardRef((e,r)=>{let{className:t,children:s,...n}=e;return(0,a.jsxs)(o.l9,{ref:r,className:(0,d.cn)("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[s,(0,a.jsx)(o.In,{asChild:!0,children:(0,a.jsx)(i.A,{className:"size-4 shrink-0 opacity-50"})})]})});m.displayName=o.l9.displayName;let p=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)(o.PP,{ref:r,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",t),...s,children:(0,a.jsx)(n.A,{className:"h-4 w-4"})})});p.displayName=o.PP.displayName;let f=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)(o.wn,{ref:r,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",t),...s,children:(0,a.jsx)(i.A,{className:"h-4 w-4"})})});f.displayName=o.wn.displayName;let x=s.forwardRef((e,r)=>{let{className:t,children:s,position:i="popper",...n}=e;return(0,a.jsx)(o.ZL,{children:(0,a.jsxs)(o.UC,{ref:r,className:(0,d.cn)("relative z-50 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"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:i,...n,children:[(0,a.jsx)(p,{}),(0,a.jsx)(o.LM,{className:(0,d.cn)("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),(0,a.jsx)(f,{})]})})});x.displayName=o.UC.displayName,s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)(o.JU,{ref:r,className:(0,d.cn)("px-2 py-1.5 text-sm font-semibold",t),...s})}).displayName=o.JU.displayName;let g=s.forwardRef((e,r)=>{let{className:t,children:s,...i}=e;return(0,a.jsxs)(o.q7,{ref:r,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...i,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(o.VF,{children:(0,a.jsx)(l.A,{className:"size-4 shrink-0"})})}),(0,a.jsx)(o.p4,{children:s})]})});g.displayName=o.q7.displayName;let h=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)(o.wv,{ref:r,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",t),...s})});h.displayName=o.wv.displayName},95836:(e,r,t)=>{t.d(r,{Toaster:()=>i,o:()=>s.oR});var a=t(19002);t(52114);var s=t(26912),o=t(7828);function i(e){let{theme:r="system"}=(0,o.D)();return(0,a.jsx)(s.l$,{theme:r,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})}i.displayName="Toaster"},61237:(e,r,t)=>{t.d(r,{T:()=>i});var a=t(19002),s=t(52114),o=t(40399);let i=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,a.jsx)("textarea",{className:(0,o.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...s})});i.displayName="Textarea"},7828:(e,r,t)=>{t.d(r,{D:()=>a.D,N:()=>a.N});var a=t(92335)},82187:(e,r,t)=>{t.d(r,{H:()=>a});var a=function(e){return e.SmUp="(min-width: 640px)",e.MdUp="(min-width: 768px)",e.LgUp="(min-width: 1024px)",e.XlUp="(min-width: 1280px)",e.TwoXlUp="(min-width: 1536px)",e.SmDown="(max-width: 640px)",e.MdDown="(max-width: 768px)",e.LgDown="(max-width: 1024px)",e.XlDown="(max-width: 1280px)",e.TwoXlDown="(max-width: 1536px)",e}({})}}]);