1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[48248],{48248:(e,t,s)=>{s.r(t),s.d(t,{default:()=>v});var a=s(95155),n=s(52619),r=s.n(n),i=s(20063),o=s(12115),l=s(35441),c=s(57355),d=s(30926);let h=(0,d.createServerReference)("40bcde6c07f67ce1fc9d2959d943d08ff6f92aa8a3",d.callServer,void 0,d.findSourceMapURL,"mintChatAccessToken"),u=(0,d.createServerReference)("40c8c6649e4e4d151d9aa8fefc799110a9ce97a4aa",d.callServer,void 0,d.findSourceMapURL,"startChatSession"),x="coraa_chat_v3",p=[{title:"What does CORAA do?",subtitle:"The platform, in plain English",prompt:"What does CORAA do, and which parts of an audit can it help with?"},{title:"Ledger scrutiny",subtitle:"How full-population testing works",prompt:"How does CORAA handle ledger scrutiny and full-population testing?"},{title:"Connect client data",subtitle:"Tally, SAP, Excel and more",prompt:"How do I connect client data from Tally, SAP, Zoho or Excel to CORAA?"},{title:"Pricing and trial",subtitle:"Plans and the first free audit",prompt:"How does CORAA pricing work, and what is included in the free trial?"}];function f(e){return e.split(/(\[[^\]]+\]\(https?:\/\/[^\s)]+\)|\*\*[^*]+\*\*|`[^`]+`)/g).filter(Boolean).map((e,t)=>{let s=e.match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);return s?(0,a.jsx)("a",{href:s[2],target:"_blank",rel:"noopener noreferrer",className:"font-medium text-[#1f6b3a] underline decoration-[#b6cbb8] underline-offset-2 hover:
1decoration-[#1f6b3a]",children:s[1]},"".concat(t,"-").concat(e)):e.startsWith("**")&&e.endsWith("**")?(0,a.jsx)("strong",{className:"font-semibold text-[#0e1410]",children:e.slice(2,-2)},"".concat(t,"-").concat(e)):e.startsWith("`")&&e.endsWith("`")?(0,a.jsx)("code",{className:"rounded bg-[#edf1eb] px-1 py-0.5 font-mono text-[0.9em]",children:e.slice(1,-1)},"".concat(t,"-").concat(e)):e})}function m(e){let{content:t}=e,s=t.trim().split(/\n{2,}/);return(0,a.jsx)("div",{className:"space-y-2.5 text-[13.5px] leading-[1.58] text-[#253029]",children:s.map((e,t)=>{let s=e.split("\n").filter(Boolean);return s.length>0&&s.every(e=>/^[-*]\s+/.test(e))?(0,a.jsx)("ul",{className:"list-disc space-y-1 pl-4 marker:text-[#539948]",children:s.map((e,t)=>(0,a.jsx)("li",{children:f(e.replace(/^[-*]\s+/,""))},"".concat(t,"-").concat(e)))},"".concat(t,"-").concat(e.slice(0,12))):(0,a.jsx)("p",{children:s.map((e,t)=>(0,a.jsxs)("span",{children:[f(e.replace(/^#{1,4}\s+/,"")),t<s.length-1&&(0,a.jsx)("br",{})]},"".concat(t,"-").concat(e)))},"".concat(t,"-").concat(e.slice(0,12)))})})}function b(){try{let e=window.sessionStorage.getItem(x);if(!e)return null;let t=JSON.parse(e);return(null==t?void 0:t.chatId)?t:null}catch(e){return null}}function g(e){try{window.sessionStorage.setItem(x,JSON.stringify({...e,messages:e.messages.slice(-20)}))}catch(e){}}function v(){var e;let t=(0,i.usePathname)(),[s,n]=(0,o.useState)(!1),[d,f]=(0,o.useState)(!0),[v,w]=(0,o.useState)(null),[j,y]=(0,o.useState)(""),[k,N]=(0,o.useState)(""),[C,A]=(0,o.useState)(!1),[S,_]=(0,o.useState)(null),M=(0,o.useRef)(null),R=(0,o.useRef)(null);(0,o.useEffect)(()=>{var e;n(!0),w(null!=(e=b())?e:{chatId:crypto.randomUUID(),messages:[]})},[]);let E=(0,c.Bj)({task:"site-chat",accessToken:async e=>{let{chatId:t}=e;try{return await h(t)}catch(e){throw A(!0),Error("Chat is unavailable right now.")}},startSession:async e=>{let{chatId:t,clientData:s}=e;try{return await u({chatId:t,clientData:s})}catch(e){throw A(!0),Error("Chat is unavailable right now.")}},clientData:{pageUrl:null!=t?t:void 0},sessions:(null==v?void 0:v.session)?{[v.chatId]:v.session}:void 0,onSessionChange:(e,t)=>
1{var s,a;g({chatId:e,messages:null!=(a=null==(s=b())?void 0:s.messages)?a:[],session:t})}}),{messages:O,sendMessage:L,status:W,stop:I}=(0,l.Y_)({id:null==v?void 0:v.chatId,messages:null!=(e=null==v?void 0:v.messages)?e:[],transport:E,resume:!!(null==v?void 0:v.messages.length),onError:e=>N(e instanceof Error?e.message:"CORAA chat could not answer that just now.")}),T=(0,o.useMemo)(()=>O.flatMap(e=>{if("user"!==e.role&&"assistant"!==e.role)return[];let t=e.parts.filter(e=>"text"===e.type).map(e=>e.text).join("").trim();return t?[{id:e.id,role:e.role,content:t}]:[]}),[O]),B="submitted"===W||"streaming"===W,H=(0,o.useMemo)(()=>{var e;return"submitted"===W?"Connecting to CORAAâ¦":(null==(e=O.at(-1))?void 0:e.parts.some(e=>e.type.startsWith("tool-")&&"state"in e&&"output-available"!==e.state))?"Searching CORAAâs documentationâ¦":""},[W,O]);(0,o.useEffect)(()=>{var e;s&&v&&g({chatId:v.chatId,messages:O,session:null==(e=b())?void 0:e.session})},[O,s,v]),(0,o.useEffect)(()=>{if(!d)return;let e=setTimeout(()=>{var e;return null==(e=M.current)?void 0:e.focus()},180),t=e=>{"Escape"===e.key&&f(!1)};return window.addEventListener("keydown",t),()=>{clearTimeout(e),window.removeEventListener("keydown",t)}},[d]),(0,o.useEffect)(()=>{var e;null==(e=R.current)||e.scrollTo({top:R.current.scrollHeight,behavior:"smooth"})},[T,B,k]);let U=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,t=e.trim();!t||B||C||(y(""),N(""),L({text:t}))},D=async e=>{try{await navigator.clipboard.writeText(e.content),_(e.id),setTimeout(()=>_(null),1400)}catch(e){}};return s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("section",{className:"fixed z-[60] bottom-22 right-2 sm:right-6 w-[calc(100vw-1rem)] sm:w-[410px]\n h-[min(680px,calc(100dvh-6.5rem))] overflow-hidden rounded-[18px]\n border border-[#d9e0d6] bg-[#f8faf7]\n shadow-[0_24px_70px_-24px_rgba(14,20,16,0.34),0_8px_24px_-12px_rgba(14,20,16,0.20)]\n transition-[opacity,transform,visibility] duration-200 ease-out print:hidden\n ".concat(d?"visible translate-y-0 opacity-100":"invisible translate-y-3 opacity-0 pointer-events-none"),role:"dialog","aria-modal":"false","aria-label":"Chat with CORAA","aria-hidden":!d,children:(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[(0,a.jsxs)("header",{className:"flex h-[62px] shrink-0 items-center justify-between border-b border-[#e1e7de] bg-white px-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,a.jsx)("div",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-[9px] bg-[#539948] font-mono text-xs font-bold tracking-wide text-white",children:"C"}),(0,a.jsxs)("div",{className:"min-w-0 leading-tight",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-semibold text-[13.5px] text-[#0e1410]",children:"Chat with CORAA"}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[9px] uppercase tracking-[0.12em] text-[#4d6a52]",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[#35a14f]"})," Live"]})]}),(0,a.jsx)("div",{className:"mt-0.5 truncate text-[10.5px] text-[#7a8480]",children:"Answers from CORAA's published knowledge"})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{I();try{window.sessionStorage.removeItem(x)}catch(e){}w({chatId:crypto.randomUUID(),messages:[]}),y(""),N(""),setTimeout(()=>{var e;return null==(e=M.current)?void 0:e.focus()},0)},className:"grid h-10 w-10 place-items-center rounded-lg text-[#7a8480] transition hover:bg-[#edf1eb] hover:text-[#0e1410] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[#1f6b3a]","aria-label":"Start a new conversation",title:"New conversation",children:(0,a.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,a.jsx)("path",{d:"M12 5v14M5 12h14"})})}),(0,a.jsx)("button",{type:"button",onClick:()=>f(!1),className:"grid h-10 w-10 place-items-center rounded-lg text-[#7a8480] transition hover:bg-[#edf1eb] hover:text-[#0e1410] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[#1f6b3a]","aria-label":"Close chat",children:(0,a.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",children:(0,a.jsx)("path",{d:"M6 6l12 12M18 6L6 18"})})})]})]}),(0,a.jsx)("div",{ref:R,className:"flex-1 overflow-y-auto overscroll-contain px-4 py-4","aria-live":"polite",children:0!==T.length||B?(0,a.jsxs)("div",{className:"space-y-4",children:[T.map(e=>(0,a.jsxs)("article",{className:"flex gap-2.5 ".concat("user"===e.role?"justify-end":"justify-start"),children:["assistant"===e.role&&(0,a.jsx)("div",{className:"mt-0.5 grid h-6 w-6 shrink-0 place-items-center rounded-[7px] bg-[#539948] font-mono text-[9px] font-bold text-white",children:"C"}),(0,a.jsxs)("div",{className:"min-w-0 ".concat("user"===e.role?"max-w-[84%]":"max-w-[calc(100%-34px)]"),children:[(0,a.jsx)("div",{className:"user"===e.role?"rounded-[14px] rounded-br-[4px] bg-[#1f6b3a] px-3.5 py-2.5 text-[13.5px] leading-[1.55] text-white":"rounded-[12px] rounded-tl-[4px] border border-[#e0e6dd] bg-white px-3.5 py-3 shadow-[0_1px_2px_rgba(14,20,16,0.03)]",children:"assistant"===e.role?(0,a.jsx)(m,{content:e.content}):e.content}),"assistant"===e.role&&(0,a.jsxs)("button",{type:"button",onClick:()=>void D(e),className:"mt-1.5 inline-flex items-center gap-1 rounded px-1.5 py-1 font-mono text-[9.5px] uppercase tracking-[0.08em] text-[#7a8480] transition hover:bg-[#e9eee7] hover:text-[#1f6b3a] focu
1s-visible:outline-2 focus-visible:outline-[#1f6b3a]",children:[(0,a.jsxs)("svg",{className:"h-3 w-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,a.jsx)("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),(0,a.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),S===e.id?"Copied":"Copy"]})]})]},e.id)),B&&(0,a.jsxs)("div",{className:"flex gap-2.5",children:[(0,a.jsx)("div",{className:"mt-0.5 grid h-6 w-6 shrink-0 place-items-center rounded-[7px] bg-[#539948] font-mono text-[9px] font-bold text-white",children:"C"}),(0,a.jsx)("div",{className:"rounded-[12px] rounded-tl-[4px] border border-[#e0e6dd] bg-white px-3.5 py-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[12px] text-[#657068]",children:[(0,a.jsxs)("span",{className:"flex gap-1","aria-hidden":"true",children:[(0,a.jsx)("span",{className:"coraa-chat-dot h-1.5 w-1.5 rounded-full bg-[#539948]"}),(0,a.jsx)("span",{className:"coraa-chat-dot h-1.5 w-1.5 rounded-full bg-[#539948]"}),(0,a.jsx)("span",{className:"coraa-chat-dot h-1.5 w-1.5 rounded-full bg-[#539948]"})]}),H||"Working on itâ¦"]})})]}),(k||C)&&(0,a.jsxs)("div",{className:"ml-8 rounded-[10px] border border-[#e5c4b9] bg-[#fff8f5] px-3.5 py-3 text-[12.5px] leading-relaxed text-[#7b3525]",children:[C?"The assistant is offline for a moment.":k," ",(0,a.jsx)(r(),{href:"/contact",className:"font-semibold underline underline-offset-2",children:"Talk to the team"})]})]}):(0,a.jsxs)("div",{className:"flex min-h-full flex-col justify-center py-2",children:[(0,a.jsxs)("div",{className:"mb-5 border-l-2 border-[#539948] pl-4",children:[(0,a.jsx)("div",{className:"mb-2 font-mono text-[9.5px] uppercase tracking-[0.16em] text-[#6d796f]",children:"Coraa knowledge desk"}),(0,a.jsx)("h2",{className:"font-serif text-[22px] leading-tight text-[#0e1410]",children:"Hey â what are you working through?"}),(0,a.jsx)("p",{className:"mt-2 text-[13px] leading-relaxed text-[#59645b]",children:"Ask about a module, your first audit, pricing, security, integrations, or a free Coraa resource. I'll stay grounded in what Coraa has published."})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:p.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>void U(e.prompt),className:"group flex w-full items-center justify-between rounded-[10px] border border-[#e0e6dd] bg-white px-3.5 py-2.5 text-left transition hover:border-[#b8cbb7] hover:bg-[#f3f7f1] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[#1f6b3a]",children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-[12.5px] font-semibold text-[#18201a]",children:e.title}),(0,a.jsx)("span",{className:"mt-0.5 block text-[10.5px] text-[#7a8480]",children:e.subt
1itle})]}),(0,a.jsx)("svg",{className:"h-3.5 w-3.5 shrink-0 text-[#9aa49b] transition group-hover:translate-x-0.5 group-hover:text-[#539948]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,a.jsx)("path",{d:"M5 12h14M13 5l7 7-7 7"})})]},e.title))})]})}),(0,a.jsxs)("footer",{className:"shrink-0 border-t border-[#dde4da] bg-white px-3 py-3",children:[(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),U()},className:"flex items-end gap-2 rounded-[12px] border border-[#d9e0d6] bg-white p-1.5 pl-3 shadow-[0_1px_2px_rgba(14,20,16,0.04)] transition focus-within:border-[#539948] focus-within:ring-3 focus-within:ring-[#539948]/10",children:[(0,a.jsx)("textarea",{ref:M,value:j,onChange:e=>y(e.target.value.slice(0,2e3)),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),U())},rows:1,disabled:B,placeholder:"Ask CORAA anythingâ¦",className:"max-h-24 min-h-9 flex-1 resize-none bg-transparent py-2 text-[13.5px] leading-5 text-[#0e1410] outline-none placeholder:text-[#9aa49b] disabled:cursor-wait","aria-label":"Message CORAA"}),(0,a.jsx)("button",{type:"submit",disabled:!j.trim()||B,className:"grid h-9 w-9 shrink-0 place-items-center rounded-[9px] bg-[#539948] text-white transition hover:bg-[#3f7437] active:scale-95 disabled:cursor-not-allowed disabled:bg-[#c9d2c8] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#1f6b3a]","aria-label":"Send message",children:(0,a.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M5 12h14M13 5l7 7-7 7"})})})]}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-2 px-1 font-mono text-[9px] uppercase tracking-[0.08em] text-[#8a948b]",children:[(0,a.jsx)("span",{children:"Enter to send \xb7 Shift + Enter for a new line"}),(0,a.jsx)(r(),{href:"/contact",className:"shrink-0 text-[#55725a] hover:text-[#1f6b3a]",children:"Ask a human â"})]})]})]})}),(0,a.jsx)("button",{type:"button",onClick:()=>f(e=>!e),className:"fixed z-[60] bottom-4 right-3 grid h-14 w-14 place-items-center rounded-full text-white\n shadow-[0_14px_30px_-10px_rgba(31,107,58,0.5)] transition duration-200\n hover:-translate-y-0.5 hover:scale-[1.03] active:translate-y-0 active:scale-95\n focus-visible:outline-2 focus-visible:outline-offset-3 focus-visible:outline-[#1f6b3a] sm:right-6 print:hidden\n ".concat(d?"bg-[#18201a] hover:bg-[#0e1410]":"bg-[#539948] hover:bg-[#3f7437]"),"aria-label":d?"Close CORAA chat":"Open CORAA chat","aria-expanded":d,children:d?(0,a.jsx)("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",children:(0,a.jsx)("path",{d:"M6 6l12 12M18 6L6 18"})}):(0,a.jsxs)("svg",{className:"h-6 w-6",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"}),(0,a.jsx)("path",{d:"M16.5 6.5v3M15 8h3"})]})})]}):null}}}]);
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.