1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8640],{20097:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/review-responder",function(){return r(60057)}])},60057:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return Home}});var n=r(85893),o=r(3180),i=r(92414),a=r(31046),l=r(6459),s=r(88329),u=r(90092),d=r(30980),c=r(82206),p=r(73244),f=r(38491),m=r(67294);function Home(e){let{apiKeyApp:t}=e,[r,x]=(0,m.useState)(""),[h,b]=(0,m.useState)(""),[g,v]=(0,m.useState)(""),[y,C]=(0,m.useState)("gpt-3.5-turbo"),[w,_]=(0,m.useState)(!1),j=(0,a.ff)("navy.700","white"),k=(0,a.ff)({color:"gray.500"},{color:"whiteAlpha.600"}),P=(0,a.ff)("gray.200","whiteAlpha.200"),F=(0,l.p)(),handleTranslate=async()=>{if(!(null==t?void 0:t.includes("sk-"))&&!(null==t?void 0:t.includes("sk-"))){alert("Please enter an API key.");return}if(!h){alert("Please enter the review.");return}if(!r){alert("Please enter the name.");return}_(!0),v("");let e=new AbortController,n=await fetch("../api/reviewAPI",{method:"POST",headers:{"Content-Type":"application/json"},signal:e.signal,body:JSON.stringify({name:r,review:h,model:y,apiKey:t})});if(!n.ok){_(!1),alert("Something went wrong went fetching from the API. Make sure to use a valid API key.");return}let o=n.body;if(!o){_(!1),alert("Something went wrong");return}let i=o.getReader(),a=new TextDecoder,l=!1,s="";for(;!l;){_(!0);let{value:e,done:t}=await i.read();l=t;let r=a.decode(e);s+=r,v(e=>e+r)}_(!1),copyToClipboard(s)},copyToClipboard=e=>{let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)};return(0,n.jsx)(s.k,{w:"100%",direction:"column",position:"relative",mt:{base:"70px",md:"0px",xl:"0px"},children:(0,n.jsxs)(s.k,{mx:"auto",w:{base:"100%",md:"100%",xl:"100%"},maxW:"100%",justify:"center",direction:{base:"column",md:"row"},children:[(0,n.jsxs)(o.Z,{minW:{base:"100%",md:"40%",xl:"476px"},maxW:{base:"100%",md:"40%",xl:"476px"},h:"min-content",me:{base:"0px",md:"20px"},mb:{base:"20px",md:"0px"},children:[(0,n.jsx)(u.x,{fontSize:"30px",color:j,fontWeight:"800",mb:"10px",children:"Review Details"}),(0,n.jsx)(u.x,{fontSize:"16px",color:"gray.500",fontWeight:"500",mb:"30px",children:"What your review response will be about?"}),(0,n.jsx)(d.l,{display:"flex",ms:"10px",htmlFor:"name",fontSize:"md",color:j,letterSpacing:"0px",fontWeight:"bold",_hover:{cursor:"pointer"},children:"Client Name"}),(0,n.jsx)(c.I,{color:j,border:"1px solid",borderRadius:"10px",borderColor:P,h:"60px",id:"name",fontWeight:"500",placeholder:"Type here your client name...",_placeholder:k,_focus:{borderColor:"none"},mb:"28px",onChange:e=>{x(e.target.value)}}),(0,n.jsx)(d.l,{display:"flex",ms:"10px",htmlFor:"review",fontSize:"md",color:j,letterSpacing:"0px",fontWeight:"bold",_hover:{cursor:"pointer"},children:"Review"}),(0,n.jsx)(p.g,{border:"1px solid",borderRadius:"10px",borderColor:P,p:"15px 20px",mb:"28px",minH:"324px",fontWeight:"500",id:"review",_focus:{borderColor:"none"},color:j,placeholder:"Enter here your review...",_placeholder:k,onChange:e=>{b(e.target.value)}}),(0,n.jsx)(f.z,{py:"20px",px:"16px",fontSize:"md",variant:"primary",borderRadius:"45px",w:{base:"100%"},mt:"28px",h:"54px",onClick:handleTranslate,isLoading:!!w,_hover:{boxShadow:"0px 21px 27px -10px rgba(96, 60, 255, 0.48) !important",bg:"linear-gradient(15.46deg, #4A25E1 26.3%, #7B5AFF 86.4%) !important",_disabled:{bg:"linear-gradient(15.46deg, #4A25E1 26.3%, #7B5AFF 86.4%)"}},children:"Generate your Response"})]}),(0,n.jsxs)(o.Z,{maxW:"100%",h:"100%",children:[(0,n.jsx)(u.x,{fontSize:"30px",color:j,fontWeight:"800",mb:"10px",children:"AI Output"}),(0,n.jsx)(u.x,{fontSize:"16px",color:"gray.500",fontWeight:"500",mb:"30px",children:"Enjoy your response for your review!"}),(0,n.jsx)(i.Z,{output:g}),(0,n.jsx)(f.z,{variant:"transparent",border:"1px solid",borderColor:P,borderRadius:"full",maxW:"160px",ms:"auto",fontSize:"md",w:{base:"300px",md:"420px"},h:"54px",onClick:()=>{g&&navigator.clipboard.writeText(g),F({title:g?"Response succesfully copied!":"Generate some review first!",position:"top",status:g?"success":"error",isClosable:!0})},children:"ã³ãã¼ãã"})]})]})})}},92414:function(e,t,r){"use strict";r.d(t,{Z:function(){return MessageBox}});
1var n=r(85893),o=r(31046),i=r(68029),a=r(5152),l=r.n(a);let s=l()(()=>Promise.all([r.e(4897),r.e(7276),r.e(2313)]).then(r.bind(r,62313)),{loadableGenerated:{webpack:()=>[62313]},ssr:!1});function MessageBox(e){let{output:t}=e,r=(0,o.ff)("navy.700","white");return(0,o.ff)("gray.200","whiteAlpha.200"),(0,n.jsx)(i.x,{maxW:"100%",p:"0px 40px",color:r,minH:"564px",fontSize:"md",fontWeight:"500",mb:"28px",cursor:"pointer",transition:"all 0.1s ease-in-out ",children:(0,n.jsx)(s,{data:t,getValueFromEditor:e.handleSaveDoc,creditUserId:e.creditUserId,onCreditReduced:e.onCreditReduced})})}},3180:function(e,t,r){"use strict";var n=r(85893),o=r(49381),i=r(73035),a=r(26277);let l=(0,o.G)((e,t)=>{let{size:r,variant:o,...l}=e,s=(0,i.m)("Card",{size:r,variant:o});return(0,n.jsx)(a.m.div,{ref:t,__css:s,...l})});t.Z=l},29062:function(e,t,r){"use strict";r.d(t,{lq:function(){return mergeRefs},qq:function(){return useMergeRefs}});var n=r(67294);function mergeRefs(...e){return t=>{e.forEach(e=>{!function(e,t){if(null!=e){if("function"==typeof e){e(t);return}try{e.current=t}catch(r){throw Error(`Cannot assign value '${t}' to ref '${e}'`)}}}(e,t)})}}function useMergeRefs(...e){return(0,n.useMemo)(()=>mergeRefs(...e),e)}},88329:function(e,t,r){"use strict";r.d(t,{k:function(){return a}});var n=r(85893),o=r(49381),i=r(26277);let a=(0,o.G)(function(e,t){let{direction:r,align:o,justify:a,wrap:l,basis:s,grow:u,shrink:d,...c}=e;return(0,n.jsx)(i.m.div,{ref:t,__css:{display:"flex",flexDirection:r,alignItems:o,justifyContent:a,flexWrap:l,flexBasis:s,flexGrow:u,flexShrink:d},...c})});a.displayName="Flex"},54506:function(e,t,r){"use strict";r.d(t,{NI:function(){return b},NJ:function(){return h},e:function(){return m}});var n=r(85893),o=r(29062),i=r(16431),a=r(80274),l=r(44509),s=r(77260),u=r(67294),d=r(49381),c=r(73035),p=r(26277);let[f,m]=(0,a.k)({name:"FormControlStylesContext",errorMessage:"useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<FormControl />\" "}),[x,h]=(0,a.k)({strict:!1,name:"FormControlContext"}),b=(0,d.G)(function(e,t){let r=(0,c.j)("Form",e),a=(0,i.L)(e),{getRootProps:d,htmlProps:m,...h}=function(e){let{id:t,isRequired:r,isInvalid:n,isDisabled:i,isReadOnly:a,...s}=e,d=(0,u.useId)(),c=t||`field-${d}`,p=`${c}-label`,f=`${c}-feedback`,m=`${c}-helptext`,[x,h]=(0,u.useState)(!1),[b,g]=(0,u.useState)(!1),[v,y]=(0,u.useState)(!1),C=(0,u.useCallback)((e={},t=null)=>({id:m,...e,ref:(0,o.lq)(t,e=>{e&&g(!0)})}),[m]),w=(0,u.useCallback)((e={},t=null)=>({...e,ref:t,"data-focus":(0,l.P)(v),"data-disabled":(0,l.P)(i),"data-invalid":(0,l.P)(n),"data-readonly":(0,l.P)(a),id:void 0!==e.id?e.id:p,htmlFor:void 0!==e.htmlFor?e.htmlFor:c}),[c,i,v,n,a,p]),_=(0,u.useCallback)((e={},t=null)=>({id:f,...e,ref:(0,o.lq)(t,e=>{e&&h(!0)}),"aria-live":"polite"}),[f]),j=(0,u.useCallback)((e={},t=null)=>({...e,...s,ref:t,role:"group","data-focus":(0,l.P)(v),"data-disabled":(0,l.P)(i),"data-invalid":(0,l.P)(n),"data-readonly":(0,l.P)(a)}),[s,i,v,n,a]),k=(0,u.useCallback)((e={},t=null)=>({...e,ref:t,role:"presentation","aria-hidden":!0,children:e.children||"*"}),[]);return{isRequired:!!r,isInvalid:!!n,isReadOnly:!!a,isDisabled:!!i,isFocused:!!v,onFocus:()=>y(!0),onBlur:()=>y(!1),hasFeedbackText:x,setHasFeedbackText:h,hasHelpText:b,setHasHelpText:g,id:c,labelId:p,feedbackId:f,helpTextId:m,htmlProps:s,getHelpTextProps:C,getErrorMessageProps:_,getRootProps:j,getLabelProps:w,getRequiredIndicatorProps:k}}(a),b=(0,s.cx)("chakra-form-control",e.className);return(0,n.jsx)(x,{value:h,children:(0,n.jsx)(f,{value:r,children:(0,n.jsx)(p.m.div,{...d({},t),className:b,__css:r.container})})})});b.displayName="FormControl";let g=(0,d.G)(function(e,t){let r=h(),o=m(),i=(0,s.cx)("chakra-form__helper-text",e.className);return(0,n.jsx)(p.m.div,{...r?.getHelpTextProps(e,t),__css:o.helperText,className:i})});g.displayName="FormHelperText"},30980:function(e,t,r){"use strict";r.d(t,{l:function(){return d}});var n=r(85893),o=r(16431),i=r(77260),a=r(54506),l=r(49381),s=r(73035),u=r(26277);let d=(0,l.G)(function(e,t){let r=(0,s.m)("FormLabel",e),l=(0,o.L)(e),{className:d,children:p,requiredIndicator:f=(0,n.jsx)(c,{}),optionalIndicator:m=null,...x}=l,h=(0,a.NJ)(),b=h?.getLabelProps(x,t)??{ref:t,...x};return(0,n.jsxs)(u.m.label,{...b,className:(0,i.cx)("chakra-form__label",l.className),__css:{display:"block",textAlign:"start",...r},children:[p,h?.isRequired?f:m]})});d.displayName="FormLabel";let c=(0,l.G)(function(e,t){let r=(0,a.NJ)(),o=(0,a.e)();if(!r?.isRequired)return null;let l=(0,i.cx)("chakra-form__required-indicator",e.className);return(0,n.jsx)(u.m.span,{...r?.getRequiredIndicatorProps(e,t),__css:o.requiredIndicator,className:l})});c.displayName="RequiredIndicator"},16013:function(e,t,r){"use strict";r.d(t,{K:function(){return useFormControlProps},Y:function(){return useFormControl}});var n=r(44509),o=r(40092),i=r(54506);function useFormControl(e){let{isDisabled:t,isInvalid:r,isReadOnly:o,isRequired:i,...a}=useFormControlProps(e);return{...a,disabled:t,readOnly:o,required:i,"aria-invalid":(0,n.Q)(r),"aria-required":(0,n.Q)(i),"aria-readonly":(0,n.Q)(o)}}function useFormControlProps(e){let t=(0,i.NJ)(),{id:r,disabled:n,readOnly:a,required:l,isRequired:s,isInvalid:u,isReadOnly:d,isDisabled:c,onFocus:p,onBlur:f,...m}=e,x=e["aria-describedby"]?[e["aria-describedby"]]:[];return t?.hasFeedbackText&&t?.isInvalid&&x.push(t.feedbackId),t?.hasHelpText&&x.push(t.helpTextId),{...m,"aria-describedby":x.join(" ")||void 0,id:r??t?.id,isDisabled:n??c??t?.isDisabled,isReadOnly:a??d??t?.isReadOnly,isRequired:l??s??t?.isRequired,isInvalid:u??t?.isInvalid,onFocus:(0,o.v)(t?.onFocus,p),onBlur:(0,o.v)(t?.onBlur,f)}}},82206:function(e,t,r){"use strict";r.d(t,{I:function(){return d}});
1var n=r(85893),o=r(16431),i=r(77260),a=r(16013),l=r(49381),s=r(73035),u=r(26277);let d=(0,l.G)(function(e,t){let{htmlSize:r,...l}=e,d=(0,s.j)("Input",l),c=(0,o.L)(l),p=(0,a.Y)(c),f=(0,i.cx)("chakra-input",e.className);return(0,n.jsx)(u.m.input,{size:r,...p,__css:d.field,ref:t,className:f})});d.displayName="Input",d.id="Input"},73244:function(e,t,r){"use strict";r.d(t,{g:function(){return p}});var n=r(85893),o=r(16431),i=r(63681),a=r(77260),l=r(16013),s=r(49381),u=r(73035),d=r(26277);let c=["h","minH","height","minHeight"],p=(0,s.G)((e,t)=>{let r=(0,u.m)("Textarea",e),{className:s,rows:p,...f}=(0,o.L)(e),m=(0,l.Y)(f),x=p?(0,i.C)(r,c):r;return(0,n.jsx)(d.m.textarea,{ref:t,rows:p,...m,className:(0,a.cx)("chakra-textarea",s),__css:x})});p.displayName="Textarea"},6459:function(e,t,r){"use strict";r.d(t,{p:function(){return useToast}});var n=r(67294),o=r(36814),i=r(60975),a=r(11065),l=r(88559),s=r(70052);function useToast(e){let{theme:t}=(0,s.uP)(),r=(0,l.OX)();return(0,n.useMemo)(()=>(function(e,t){let normalizeToastOptions=r=>({...t,...r,position:function(e,t){let r=e??"bottom";return({"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}})[r]?.[t]??r}(r?.position??t?.position,e)}),toast=e=>{let t=normalizeToastOptions(e),r=(0,i.C)(t);return a.f.notify(r,t)};return toast.update=(e,t)=>{a.f.update(e,normalizeToastOptions(t))},toast.promise=(e,t)=>{let r=toast({...t.loading,status:"loading",duration:null});e.then(e=>toast.update(r,{status:"success",duration:5e3,...(0,o.P)(t.success,e)})).catch(e=>toast.update(r,{status:"error",duration:5e3,...(0,o.P)(t.error,e)}))},toast.closeAll=a.f.closeAll,toast.close=a.f.close,toast.isActive=a.f.isActive,toast})(t.direction,{...r,...e}),[e,t.direction,r])}},40092:function(e,t,r){"use strict";function callAll(...e){return function(...t){e.forEach(e=>e?.(...t))}}function callAllHandlers(...e){return function(t){e.some(e=>(e?.(t),t?.defaultPrevented))}}r.d(t,{P:function(){return callAll},v:function(){return callAllHandlers}})},63681:function(e,t,r){"use strict";function omit(e,t=[]){let r=Object.assign({},e);for(let e of t)e in r&&delete r[e];return r}r.d(t,{C:function(){return omit}})}},function(e){e.O(0,[4055,9774,2888,179],function(){return e(e.s=20097)}),_N_E=e.O()}]);
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.