1"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__=globalThis.__LOADABLE_LOADED_CHUNKS__||[]).push([[8443],{21353(e,t,n){n.r(t),n.d(t,{OPPORTUNITY_AGENT_FLAG:()=>F,default:()=>$});var o=n(41594),a=n.n(o),r=n(98483),l=n(26926),i=n(3602),c=n(84685),s=n(2596),m=n(51904),d=n(28420),u=n(73021),p=n(47203),b=n(42732),g=n(20652),h=n(95132),f=n(75158),x=n(55068),E=n(73481);const v="skubot",y="Ask me anything about your commonsku data...";function C(e){var t;const{userName:n,input:o,onInputChange:r,onSend:l,suggestions:i=[],disabled:c=!1,className:s,aboveInput:m,dockInput:d=!1}=e,u=a().createElement(h.BJ,{className:"skubot-welcome-content",w:"full",maxW:"700px",align:"center",gap:"5",overflow:"auto"},a().createElement(h.az,{w:"100px",h:"60px",display:"flex",alignItems:"center",justifyContent:"center"},a().createElement(h.X0,{color:"skuBlue.600",size:"2xl",height:"100px",width:"100px"})),a().createElement(h.DZ,{as:"h1",fontSize:"2xl",fontWeight:"medium",color:"gray.900"},"Hi, I'm {botName}.".replace("{userName}",n).replace("{botName}",v)),d?null:a().createElement(a().Fragment,null,m?a().createElement(h.az,{w:"full"},m):null,a().createElement(E.V,{value:o,onChange:r,onSubmit:()=>l(),placeholder:y,disabled:c})),(null!==(t=null==i?void 0:i.length)&&void 0!==t?t:0)>0?a().createElement(a().Fragment,null,a().createElement(h.EY,{mt:"2",fontFamily:"body",fontSize:"sm",color:"gray.500",mb:"0",pb:"16px"},"You can ask ",v," about:"),a().createElement(h.BJ,{w:"full",gap:"0"},i.map(e=>a().createElement(h.$n,{key:e,type:"button",variant:"ghost",h:"40px",justifyContent:"space-between",px:"4",borderRadius:"0",borderBottom:"none",borderRight:"none",borderLeft:"none",borderTop:"1px solid var(--chakra-colors-gray-100)",color:"gray.900",_hover:{bg:"gray.50"},onClick:()=>{c||r(e)},disabled:c},a().createElement(h.EY,{fontFamily:"body",fontSize:"sm",fontWeight:"medium",margin:"0",padding:"0",lineHeight:"20px"},e),a().createElement(h.tK,{size:"md"}))))):null);return d?a().createElement(h.so,{className:s,flex:"1",minH:0,direction:"column"},a().createElement(h.so,{flex:"1",minH:0,align:"center",justify:"center",px:{base:"5",md:"10"},overflow:"auto"},u),a().createElement(h.az,{className:"skubot-welcome-input-section",w:"full",flexShrink:0},a().createElement(h.BJ,{w:"full",maxW:"700px",mx:"auto",align:"center",gap:"16px"},m?a().createElement(h.az,{w:"full"},m):null,a().createElement(E.V,{value:o,onChange:r,onSubmit:()=>l(),placeholder:y,disabled:c})))):a().createElement(h.so,{className:s,flex:"1",align:"center",justify:"center",px:{base:"5",md:"10"},overflow:"auto"},u)}var k=n(59391);function w(e){const{conversations:t,activeId:n,onNewChat:o,onSelectConversation:r}=e;return a().createElement(h.so,{as:"aside",direction:"column",w:"250px",flexShrink:0,bg:"white",borderRight:"1px solid",borderColor:"border.muted",minH:0},a().createElement(h.so,{h:"56px",px:"16px",align:"center",justify:"space-between",flexShrink:0,borderBottom:"1px solid",borderColor:"border.muted",fontFamily:"heading",fontWeight:"700",fontSize:"16px",color:"black"},"skubot chats"),a().createElement(h.az,{px:"8px",pt:"16px",pb:"8px",flexShrink:0},a().createElement(h.so,{as:h.$n,w:"100%",h:"36px",align:"center",gap:"8px",px:"12px",rounded:"md",justifyContent:"start",fontFamily:"heading",fontSize:"14px",color:null===n?"brand.fg":"gray.800",bg:null===n?"brand.muted":"transparent",_hover:{bg:null===n?"brand.muted":"gray.100"},transition:"background 120ms ease",onClick:o},a().createElement(h.J4,{size:"md"})," New chat")),a().createElement(h.BJ,{flex:"1",minH:0,gap:"2px",px:"8px",py:"16px",overflowY:"auto"},t.map(e=>{const t=e.sessionId===n;return a().createElement(h.$n,{key:e.sessionId,type:"button",variant:"ghost",size:"sm",justifyContent:"flex-start",px:"3",borderRadius:"md",color:t?"brand.fg":"gray.800",bg:t?"brand.muted":"transparent",_hover:{bg:t?"brand.muted":"gray.100"},onClick:()=>r(e.sessionId)},a().createElement(h.EY,{fontSize:"sm",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",margin:"0",padding:"0"},e.title))})))}const S=["Incorrect or Incomplete","Not what I asked for","Slow or buggy","Poor style or tone","Other"];function z(e){const{open:t,onOpenChange:n,onSubmit:r}=e,[l,i]=(0,o.useState)(null),[c,s]=(0,o.useState)("");function m(){i(null),s(""),n(!1)}return(0,o.useEffect)(()=>{t&&(i(null),s(""))},[t]),a().createElement(h.aF,{open:t,onOpenChange:e=>{e.open||m()},lazyMount:!0},a().createElement(h.kd,{bg:"rgba(15, 23, 42, 0.35)"}),a().createElement(h.gG,null,a().createElement(h.$m,{w:"min(430px, calc(100vw - 32px))",mx:"4",borderRadius:"md",boxShadow:"0 18px 45px rgba(15, 23, 42, 0.22)"},a().createElement(h.rQ,{px:"6",pb:0,mb:0},a().createElement(h.wt,{fontSize:"md",fontWeight:"semibold",fontFamily:"heading",margin:"0",pb:"0"},"Submit feedback"),a().createElement(h.uN,null,"â")),a().createElement(h.cw,{px:"6",pb:"4"},a().createElement(h.BJ,{gap:"4"},a().createElement(h.zt,{gap:"2",flexWrap:"wrap"},S.map(e=>{const t=l===e;return a().createElement(_,{key:e,selected:t,onClick:()=>i(t=>t===e?null:e)},e)})),a().createElement(h.az,null,a().createElement(h.EY,{mb:"1.5",fontSize:"sm",fontWeight:"medium",mt:"0",mx:"0"},"Feedback details"),a().createElement(I,{value:c,onChange:e=>s(e)})),a().createElement(h.az,{bg:"gray.50",borderRadius:"md",px:"3",py:"3"},a().createElement(h.EY,{fontSize:"xs",color:"gray.700",lineHeight:"1.4",margin:"0"},"Your conversation will be included with your feedback to help improve skubot.")))),a().createElement(h.CI,{px:"6",pt:"2",pb:"4",gap:"2",justifyContent:"flex-end"},a().createElement(h.$n,{variant:"outline",bg:"white",boxShadow:"none",outline:"none",borderWidth:"1px",borderStyle:"solid",borderColor:"border.muted",backgroundColor:"white",color:"gray.800",_hover:{bg:"gray.50",borderColor:"border.subtle"},onClick:m},"Cancel"),a().createElement(h.$n,{bg:"brand.fg",color:"white",_hover:{bg:"brand.fg",opacity:.9},onClick:function(){const e=c.trim(),t=l&&"Other"!==l?`${l}: ${e}`.trim():e;r(t),i(null),s(""),n(!1)}},"Submit")))))}function _(e){let{children:t,selected:n,onClick:o}=e;return a().createElement(h.$n,{type:"button","aria-pressed":n?"true":"false",size:"sm",h:"36px",px:"3.5",borderRadius:"full",variant:"outline",fontWeight:"normal",fontSize:"sm",fontFamily:"body",bg:n?"gray.100":"white",boxShadow:"none",outline:"none",borderWidth:"1px",borderStyle:"solid",borderColor:n?"cyan.subtle":"border.muted",backgroundColor:n?"cyan.subtle":"white",color:n?"cyan.800":"gray.800",_hover:{bg:n?"cyan.subtle":"gray.50",borderColor:n?"cyan.subtle":"border.muted"},onClick:o},t)}function I(e){let{value:t,onChange:n,placeholder:o="Share details here..."}=e;return a().createElement(h.TM,{"aria-label":"Feedback details",value:t,minH:"96px",resize:"vertical",placeholder:o,fontSize:"sm",boxShadow:"none",outline:"none",borderWidth:"1px",borderStyle:"solid",borderColor:"border.muted",bg:"white",color:"gray.800",_placeholder:{color:"gray.400"},_focus:{borderColor:"brand.focusRing",boxShadow:"0 0 0 2px var(--chakra-colors-brand-subtle)"},_focusVisible:{borderColor:"brand.focusRing",boxShadow:"0 0 0 2px var(--chakra-colors-brand-subtle)",outline:"none"},onChange:e=>n(e.target.value)})}var W=n(9599);function N(e){const{open:t,onOpenChange:n,onConfirm:o}=e;return a().createElement(h.aF,{open:t,onOpenChange:e=>n(e.open),role:"alertdialog",placement:"center",size:"sm"},a().createElement(h.kd,{bg:"rgba(0, 0, 0, 0.45)"}),a().createElement(h.gG,{fontFamily:"body"},a().createElement(h.$m,{mx:"4",minH:"160px",w:"calc(100vw - 32px)",maxW:"400px",borderRadius:"8px"},a().createElement(h.rQ,{px:"24px",pt:"24px",pb:"0",flexDirection:"column",gap:"8px"},a().createElement(h.wt,{className:"modal-title-override",fontFamily:"heading",fontSize:"md",fontWeight:"semibold",lineHeight:"24px",color:"text.fg"},"Delete chat"),a().createElement(h.EY,{fontSize:"sm",fontWeight:"normal",color:"fg.default",verticalAlign:"middle",lineHeight:"20px"},"Are you sure you want to delete this chat?")),a().createElement(h.CI,{gap:"8px"},a().createElement(h.$n,{width:"75px",height:"36px",minWidth:"size.9",variant:"outline",bg:"white",color:"bg.default",borderColor:"neutral.muted",_hover:{bg:"neutral.subtle"},onClick:()=>n(!1),padding:"2px Spacing.3_5 2px Spacing.3_5",gap:"spacing.2"},"Cancel"),a().createElement(h.$n,{width:"75px",height:"36px",minWidth:"size.9",bg:"red.600",color:"white",_hover:{bg:"red.700"},onClick:o,padding:"2px Spacing.3_5 2px Spacing.3_5",gap:"spacing.2"}
1,"Delete")))))}function O(e){const{conversation:t,onRenameConversation:n,onDeleteConversation:r}=e,[l,i]=(0,o.useState)(!1),[c,s]=(0,o.useState)(t.title),[m,d]=(0,o.useState)(!1);function u(){s(t.title),i(!1)}function p(){const e=c.trim();e&&(n(t.sessionId,e),i(!1))}return(0,o.useEffect)(()=>{i(!1),s(t.title),d(!1)},[t.sessionId]),(0,o.useEffect)(()=>{l||s(t.title)},[t.title,l]),a().createElement(h.so,{h:"56px",flexShrink:0,align:"center",px:"16px",bg:"white",borderBottom:"1px solid",borderColor:"border.muted"},l?a().createElement(h.so,{align:"center",gap:"4px",w:"100%"},a().createElement(h.pd,{value:c,autoFocus:!0,size:"xs",rounded:"md",fontSize:"14px",maxW:{base:"220px",md:"360px"},border:"1px solid var(--chakra-colors-brand-focus-ring)",boxShadow:"0 0 0 2px var(--chakra-colors-brand-subtle)",outline:"none",_focus:{borderColor:"brand.focusRing",boxShadow:"0 0 0 2px var(--chakra-colors-brand-subtle)"},_focusVisible:{outline:"none",borderColor:"brand.focusRing",boxShadow:"0 0 0 2px var(--chakra-colors-brand-subtle)"},onChange:e=>s(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p()),"Escape"===e.key&&(e.preventDefault(),u())}}),a().createElement(h.K0,{label:"Save chat title",size:"xs",variant:"ghost",rounded:"sm",color:"success.solid",_hover:{color:"success.solid",bg:"success.subtle"},_active:{color:"success.solid",bg:"success.subtle"},disabled:!c.trim(),onClick:p},a().createElement(W.sk9,{size:16})),a().createElement(h.K0,{label:"Cancel rename",size:"xs",variant:"ghost",rounded:"sm",color:"critical.solid",_hover:{color:"critical.solid",bg:"critical.subtle"},_active:{color:"critical.solid",bg:"critical.subtle"},onClick:u},a().createElement(W.SXS,{size:16}))):a().createElement(h.W1.Root,{positioning:{placement:"bottom-start",strategy:"fixed"},onSelect:e=>{"rename"===e.value&&(s(t.title),i(!0)),"delete"===e.value&&d(!0)}},a().createElement(h.W1.Trigger,{asChild:!0},a().createElement(h.$n,{type:"button",variant:"ghost",size:"sm",h:"32px",px:"2",borderRadius:"md",_hover:{bg:"gray.100"},_open:{bg:"brand.muted"}},a().createElement(h.zt,{gap:"1",minW:0},a().createElement(h.EY,{fontSize:"sm",fontWeight:"semibold",maxW:{base:"220px",md:"360px"},overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",margin:"0",padding:"0"},t.title),a().createElement(W.zrT,{size:15})))),a().createElement(h.W1.Positioner,null,a().createElement(h.W1.Content,{minW:"148px",p:"8px",boxShadow:"0 0 1px 0 rgba(24, 24, 27, 0.30), 0 8px 16px 0 rgba(24, 24, 27, 0.10)"},a().createElement(h.W1.Item,{value:"rename",h:"32px",alignItems:"center"},a().createElement(h.zt,{align:"center",px:"10px",py:"2px",rounded:"md",fontSize:"13px"},a().createElement(h.EY,{fontSize:"sm",m:"0",fontFamily:"body"},"Rename"))),a().createElement(h.W1.Item,{value:"delete",h:"32px",alignItems:"center",color:"red.700",_highlighted:{bg:"red.50",color:"red.800"}},a().createElement(h.zt,{align:"center",px:"10px",py:"2px",rounded:"md",fontSize:"13px"},a().createElement(h.EY,{fontSize:"sm",m:"0",fontFamily:"body"},"Delete")))))),a().createElement(N,{open:m,onOpenChange:d,onConfirm:function(){d(!1),r(t.sessionId)}}))}const R=["Who are my top 5 customers in {previous_year}?","What were Q3 sales for {company_name}?","Show all open orders for {company_name}?","What was the average order size last year?","Which client had the highest order volume?"];function A(){var e;const t=(new Date).getFullYear().toString(),n=(parseInt(t)-1).toString(),l=(0,r.wA)(),i=(0,f.Us)(),c=(0,r.d4)(x.Nz),s=(0,o.useRef)(null),m=(0,r.d4)(x.GC),d=(0,r.d4)(x.N5),u=(0,r.d4)(x.pL),p=(0,r.d4)(x.IQ),[b,g]=(0,o.useState)(""),[E,v]=(0,o.useState)({open:!1,messageId:null}),y=(0,o.useCallback)(e=>{const t=null!=e?e:b;t&&(l((0,x.gJ)(t)),g(""))},[l,b]),S=(0,o.useCallback)(e=>{l((0,x.n6)(e)),l((0,x.qC)(e))},[l]),_=(0,o.useCallback)((e,t)=>{"positive"===t?l((0,x.Wz)({messageId:e,feedback:"positive"})):v({open:!0,messageId:e})},[l]),I=(0,o.useCallback)(e=>{E.messageId&&l((0,x.Wz)({messageId:E.messageId,feedback:"negative",comment:e})),v({open:!1,messageId:null})},[l,E.messageId]),W=(0,o.useCallback)((e,t)=>{l((0,x.xJ)({conversationId:e,title:t}))},[l]),N=(0,o.useCallback)(e=>{l((0,x.ly)(e))},[l]);return(0,o.useEffect)(()=>
1{l((0,x.bX)())},[l]),(0,o.useEffect)(()=>{let e=null;const t=document.querySelector(".header-container");return t&&t instanceof HTMLElement&&(e=new ResizeObserver(e=>{for(const t of e)if(t.target instanceof HTMLElement){const e=t.target.offsetHeight;s.current&&(s.current.style.height=`calc(100dvh - ${e}px)`)}}),e.observe(t)),()=>{e&&e.disconnect()}},[]),a().createElement("div",{ref:s,style:{display:"flex",height:"calc(100dvh - 88px)",overflow:"hidden",background:"#fafafa",color:"var(--chakra-colors-gray-950)"}},a().createElement(w,{conversations:u,activeId:null!==(e=null==m?void 0:m.sessionId)&&void 0!==e?e:null,onNewChat:()=>l((0,x.n6)(null)),onSelectConversation:S}),a().createElement(h.az,{display:"flex",flex:"1",minW:0,minH:0,h:"full",flexDirection:"column"},m?a().createElement(a().Fragment,null,a().createElement(O,{conversation:m,onRenameConversation:W,onDeleteConversation:N}),a().createElement(k.t,{messages:d,input:b,onInputChange:e=>g(e),onSend:y,onFeedback:_,isLoading:c,errorMessage:p})):a().createElement(C,{userName:`${i.user_first_name} ${i.user_last_name}`.trim(),input:b,onInputChange:e=>g(e),onSend:y,suggestions:R.map(e=>e.replace("{company_name}",i.company_name).replace("{previous_year}",n).replace("{current_year}",t))})),a().createElement(z,{open:E.open,onOpenChange:e=>v(t=>Object.assign(Object.assign({},t),{open:e})),onSubmit:I}))}const F="OPPORTUNITY-AGENT",H=(0,c.DU)(e=>`\n body {\n font-family: 'skufont-demibold', "museo-sans", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;\n background: ${e.bodyBg||"initial"};\n }\n .resku .main-content.skubot-main-content {\n margin-top: 0;\n }\n .resku .header-space-holder {\n min-height: 0;\n }\n .resku .modal-title-override {\n margin-bottom: 0;\n }\n @media screen and (min-width: 40em) {\n .resku .main-content.skubot-main-content {\n padding-left: 176px;\n }\n }\n`),D=a().memo(()=>{const e=(0,p.zy)();return a().createElement(g.A,{location:e})});function $(e){let{location:t}=e;return a().createElement(b.Kd,{basename:t},a().createElement(p.BV,null,a().createElement(p.qh,{path:"/skubot_chats.php",element:a().createElement(B,null),ErrorBoundary:s.A}),a().createElement(p.qh,{path:"*",element:a().createElement(D,null),ErrorBoundary:s.A})))}function B(){const e=(0,f.Ju)(F),t=(0,r.d4)(l.ag);return e?a().createElement(i.Theme,{theme:i.themeOptions},a().createElement(H,null),a().createElement(s.A,null,a().createElement("div",{style:{background:"var(--color-neutrals-20)",minHeight:"100vh"}},a().createElement(u.A,null),a().createElement(m.A,{popups:t},a().createElement(i.Csku,{as:"div",className:"main-content skubot-main-content"},a().createElement(h.Kq,null,a().createElement(A,null))))),a().createElement(d.A,{popups:t}))):a().createElement(D,null)}}}]); 2//# sourceMappingURL=SkubotChatsApp.4aae2a25.chunk.js.map
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.