1"use strict";(globalThis.webpackChunkapp||=[]).push([[9197],{42070(e,t,a){a.r(t),a.d(t,{default:()=>J});var n=a(65043),i=a(53519),l=a(61072),o=(a(30588),a(67464),a(5561),a(81551)),s=a(77252);var r=a(92376),c=a(99239),d=a(58168),u=a(80296),h=a(80045),m=a(43024),v=a(70567),p=a(71745),g=a(42237),f=a(51051),x=a(54455),y=a(60768),A=a(74822),b=a(91917);const j=(0,b.A)(n.createElement("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star");function C(e,t){if(null==e)return e;var a=Math.round(e/t)*t;return Number(a.toFixed(function(e){var t=e.toString().split(".")[1];return t?t.length:0}(t)))}function S(e){e.value;var t=(0,h.A)(e,["value"]);return n.createElement("span",t)}var N=n.createElement(j,{fontSize:"inherit"});function E(e){return"".concat(e," Star").concat(1!==e?"s":"")}var w=n.forwardRef(function(e,t){var a=e.classes,i=e.className,l=e.defaultValue,o=void 0===l?null:l,s=e.disabled,r=void 0!==s&&s,c=e.emptyIcon,p=e.emptyLabelText,b=void 0===p?"Empty":p,j=e.getLabelText,w=void 0===j?E:j,R=e.icon,k=void 0===R?N:R,z=e.IconContainerComponent,M=void 0===z?S:z,F=e.max,T=void 0===F?5:F,L=e.name,_=e.onChange,H=e.onChangeActive,O=e.onMouseLeave,V=e.onMouseMove,I=e.precision,K=void 0===I?1:I,$=e.readOnly,B=void 0!==$&&$,X=e.size,D=void 0===X?"medium":X,W=e.value,J=(0,h.A)(e,["classes","className","defaultValue","disabled","emptyIcon","emptyLabelText","getLabelText","icon","IconContainerComponent","max","name","onChange","onChangeActive","onMouseLeave","onMouseMove","precision","readOnly","size","value"]),P=(0,g.A)(L),Y=(0,f.A)({controlled:W,default:o,name:"Rating"}),q=(0,u.A)(Y,2),Q=q[0],G=q[1],U=C(Q,K),Z=(0,v.A)(),ee=n.useState({hover:-1,focus:-1}),te=ee[0],ae=te.hover,ne=te.focus,ie=ee[1],le=U;-1!==ae&&(le=ae),-1!==ne&&(le=ne);var oe=(0,x.A)(),se=oe.isFocusVisible,re=oe.onBlurVisible,ce=oe.ref,de=n.useState(!1),ue=de[0],he=de[1],me=n.useRef(),ve=(0,y.A)(ce,me),pe=(0,y.A)(ve,t),ge=function(e){var t=parseFloat(e.target.value);G(t),_&&_(e,t)},fe=function(e){0===e.clientX&&0===e.clientY||(ie({hover:-1,focus:-1}),G(null),_&&parseFloat(e.target.value)===U&&_(e,null))},xe=function(e){se(e)&&he(!0);var t=parseFloat(e.target.value);ie(function(e){return{hover:e.hover,focus:t}}),H&&ne!==t&&H(e,t)},ye=function(e){if(-1===ae){!1!==ue&&(he(!1),re());ie(function(e){return{hover:e.hover,focus:-1}}),H&&-1!==ne&&H(e,-1)}},Ae=function(e,t){var i="".concat(P,"-").concat(String(e.value).replace(".","-")),l=n.createElement(M,{value:e.value,className:(0,m.A)(a.icon,e.filled?a.iconFilled:a.iconEmpty,e.hover&&a.iconHover,e.focus&&a.iconFocus,e.active&&a.iconActive)},c&&!e.filled?c:k);return B?n.createElement("span",(0,d.A)({key:e.value},t),l):n.createElement(n.Fragment,{key:e.value},n.createElement("label",(0,d.A)({className:a.label,htmlFor:i},t),l,n.createElement("span",{className:a.visuallyhidden},w(e.value))),n.createElement("input",{onFocus:xe,onBlur:ye,onChange:ge,onClick:fe,disabled:r,value:e.value,id:i,type:"radio",name:P,checked:e.checked,className:a.visuallyhidden}))};return n.createElement("span",(0,d.A)({ref:pe,onMouseMove:function(e){V&&V(e);var t,a=me.current,n=a.getBoundingClientRect(),i=n.right,l=n.left,o=a.firstChild.getBoundingClientRect().width;t="rtl"===Z.direction?(i-e.clientX)/(o*T):(e.clientX-l)/(o*T);var s=C(T*t+K/2,K);s=function(e,t,a){return e<t?t:e>a?a:e}(s,K,T),ie(function(e){return e.hover===s&&e.focus===s?e:{hover:s,focus:s}}),he(!1),H&&ae!==s&&H(e,s)},onMouseLeave:function(e){O&&O(e);ie({hover:-1,focus:-1}),H&&-1!==ae&&H(e,-1)},className:(0,m.A)(a.root,i,"medium"!==D&&a["size".concat((0,A.A)(D))],r&&a.disabled,ue&&a.focusVisible,B&&a.readOnly),role:B?"img":null,"aria-label":B?w(le):null},J),Array.from(new Array(T)).map(function(e,t){var i=t+1;if(K<1){var l=Array.from(new Array(1/K));return n.createElement("span",{key:i,className:(0,m.A)(a.decimal,i===Math.ceil(le)&&(-1!==ae||-1!==ne)&&a.iconActive)},l.map(function(e,t){var a=C(i-1+(t+1)*K,K);return Ae({value:a,filled:a<=le,hover:a<=ae,focus:a<=ne,checked:a===U},{style:l.length-1===t?{}:{width:a===le?"".concat((t+1)*K*100,"%"):"0%",overflow:"hidden",zIndex:1,position:"absolute"}})}))}return Ae({value:i,active:i===le&&(-1!==ae||-1!==ne),filled:i<=le,hover:i<=ae,focus:i<=ne,checked:i===U})}),!B&&!r&&null==U&&n.createElement(n.Fragment,null,n.createElement("input",{value:"",id:"".concat(P,"-empty"),type:"radio",name:P,defaultChecked:!0,className:a.visuallyhidden}),n.createElement("label",{className:a.pristine,htmlFor:"".concat(P,"-empty")},n.createElement("span",{className:a.visuallyhidden},b))))});const R=(0,p.A)(function(e){return{root:{display:"inline-flex",position:"relative",fontSize:e.typography.pxToRem(24),color:"#ffb400",cursor:"pointer",textAlign:"left",WebkitTapHighlightColor:"transparent","&$disabled":{opacity:.5,pointerEvents:"none"},"&$focusVisible $iconActive":{outline:"1px solid #999"}},sizeSmall:{fontSize:e.typography.pxToRem(18)},sizeLarge:{fontSize:e.typography.pxToRem(30)},readOnly:{pointerEvents:"none"},disabled:{},focusVisible:{},visuallyhidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,color:"#000",overflow:"hidden",padding:0,position:"absolute",top:20,width:1},pristine:{"input:focus + &":{top:0,bottom:0,position:"absolute",outline:"1px solid #999",width:"100%"}},label:{cursor:"inherit"},icon:{display:"flex",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),pointerEvents:"none"},iconEmpty:{color:e.palette.action.disabled},iconFilled:{},iconHover:{},iconFocus:{},iconActive:{transform:"scale(1.2)"}
1,decimal:{position:"relative"}}},{name:"MuiRating"})(w);var k=a(749),z=a(18219),M=a(61531),F=a(66187),T=a(17339),L=a(5571),_=a(91036),H=a(82164);const O=(0,b.A)(n.createElement("path",{d:"M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z"}),"QuestionAnswerOutlined");var V=a(84373),I=a(75010),K=a(70579);const $=(0,o.A)(e=>({root:{width:"100%",display:"grid",gap:"10px"},heading:{fontSize:e.typography.pxToRem(15),fontWeight:e.typography.fontWeightRegular}})),B=e=>{let{selectedChatbot:t,selectedCompanies:a}=e;const i=$(),[o,d]=(0,n.useState)([]),[u,h]=(0,n.useState)(0),[m,v]=(0,n.useState)(""),[p,g]=(0,n.useState)(!1),[f,x]=(0,n.useState)(!1),[y,A]=(0,n.useState)(!1),[b,j]=(0,n.useState)(!1),[C,S]=(0,n.useState)(1);(0,n.useEffect)(()=>{N(1)},[t]);const N=e=>{if(t){if(!a)return;const n=a[0].id;A(!0),(0,c.os)(t,n,e,10).then(e=>{e.data.data&&(d(e.data.data.chats),h(e.data.data.total_count),A(!1))})}},E=()=>{j(!1),v(null),g(!1),x(!1)};return(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(l.A,{hidden:!t,children:[(0,K.jsxs)(k.A,{className:"w-100",style:{margin:"1rem 3rem"},children:[(0,K.jsx)(I.A,{totalRecords:u,handleChange:(e,n)=>{if(A(!0),!a)return;const i=a[0].id;S(n),(0,c.os)(t,i,n,10).then(e=>{e.data.data&&(d(e.data.data.chats),h(e.data.data.total_count),A(!1))})},pageSize:10,page:C}),(0,K.jsx)(z.A,{style:{p:2},children:(0,K.jsx)("div",{className:i.root,children:y?[1,2,3,4].map(e=>(0,K.jsx)(V.A,{variant:"rect",height:60})):o.length?o.map((e,t)=>(console.log(e),(0,K.jsx)(H.A,{headerStyle:{lineHeight:"2.2"},ulStyle:{marginBottom:"0px"},name:(0,K.jsx)(F.A,{style:{fontSize:"1.2rem"},children:e.question}),description:"",id:`${t+1}_`,icon:(0,K.jsx)(O,{}),defaultOpen:!0,activeColor:!0,headerChildren:(0,K.jsxs)(M.A,{children:[(0,K.jsx)(M.A,{style:{position:"absolute",right:"80px",top:"18px"},children:(0,K.jsx)(M.A,{className:"d-flex",style:{alignItems:"baseline"},children:(0,K.jsx)(R,{className:"ratting-comp",name:"simple-controlled-"+e.chat_id,value:e.rating,onChange:(t,a)=>{t.preventDefault(),t.stopPropagation(),console.log(e.rating,a,"=---"),x(!0),v({...e,rating:a})}})})}),(0,K.jsx)(T.A,{component:"div",onClick:t=>((e,t)=>{e.stopPropagation(),v(t),g(!0)})(t,e),style:{position:"absolute",right:"30px",top:"12px",padding:"5px",color:"inherit"},className:"native-icon",children:(0,K.jsx)(s.A,{className:"delete-item-icon",style:{marginRight:"0px"}})})]}),children:(0,K.jsxs)(M.A,{style:{padding:"1rem 1.5rem"},children:[(0,K.jsxs)(F.A,{variant:"body1",children:[" ",e.answer]}),(0,K.jsx)(L.A,{style:{margin:"0.8rem"}})]})}))):(0,K.jsx)(M.A,{children:(0,K.jsx)(F.A,{variant:"body1",children:"No Conversations Available."})})})})]}),(0,K.jsx)(r.A,{loading:b,onSubmit:e=>{if(!a)return;const t=a[0].id;j(!0),(0,c.s_)(m.chat_id,t).then(e=>{_.oR.success("Conversation deleted successfully."),E();let t=C;var a=o.filter(e=>e.chat_id!==m.chat_id);!a.length&&C>1&&(t-=1,S(t)),N(t),d(a)})},eventHideModal:E,showModal:p,title:"Delete conversation",infoText:"Are you sure you want to delete this conversation?",submitButtonTitle:"Delete"}),(0,K.jsx)(r.A,{loading:b,onSubmit:e=>{if(!a)return;const t=a[0].id;j(!0),(0,c.uX)(m.chat_id,t,m.rating,m.answer).then(e=>{console.log(e);const t=o.map(e=>e.chat_id===m.chat_id?{...e,rating:m.rating}:e);d(t),E(),_.oR.success("Rating saved successfully.")}).catch(e=>{console.log(e),E()})},eventHideModal:E,showModal:f,title:"Submit Rating",infoText:"Are you sure you want to submit rating?",submitButtonTitle:"submit"})]})})};var X=a(61171),D=a(12836),W=a(36857);const J=e=>{const[t,a]=(0,n.useState)(0),[o,s]=(0,n.useState)(""),[r,d]=(0,n.useState)([]),u=(0,X.d4)(D.lK);var h=(0,n.useCallback)(()=>{try{if(u.length)return(0,c.oE)(u[0].id).then(e=>(e.data.data.length>0&&s(e.data.data[0].chatbot_id),{data:e.data.data}))}catch(e){_.oR.error(W.wC.error(e||e.message))}},[]);return(0,n.useEffect)(()=>{h()},[]),(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(i.A,{fluid:!0,style:{maxHeight:"calc(100vh - 165px)",overflowY:"auto",padding:"0rem 2rem"},children:(0,K.jsxs)("div",{className:"bg-white border-radius mt-3",children:[(0,K.jsx)(l.A,{children:(0,K.jsx)("h4",{className:"m-0 text-darkgray-1",style:{fontSize:"25px"},children:"Rate conversation"})}),(0,K.jsx)(B,{selectedChatbot:o,selectedCompanies:u})]})})})}},82164(e,t,a){a.d(t,{A:()=>c});var n=a(65043);var i=a(30247),l=a(75449),o=a(70579);const s=e=>
1{let{children:t,eventKey:a,callback:n,btnClass:i,storageKey:l,style:s={},show:r}=e;return(0,o.jsx)("a",{tabIndex:"0",className:`${i}${r?" active":""}`,onClick:n,style:s,children:(0,o.jsx)(o.Fragment,{children:t||null})})};var r=a(74770);const c=e=>{const{children:t,headerChildren:a=null,storageKey:c="activeAccordion",icon:d,name:u="",description:h="",id:m="",defaultOpen:v=!1,handleClick:p=()=>{},activeColor:g=!1,headerStyle:f={},ulStyle:x={},customheaderClassOnActive:y="bg-primary text-white"}=e;let[A,b]=(0,n.useState)(v),[,j]=(0,n.useState)(JSON.parse(r.A.getItem(c))||"");return(0,n.useEffect)(()=>{let e=JSON.parse(r.A.getItem(c));j(e)},[]),(0,o.jsx)(l.A,{activeKey:A?m:void 0,className:"collapsible-comp-container",children:(0,o.jsx)("ul",{className:"collapsible",style:x,children:(0,o.jsxs)("li",{className:"panel-border",children:[(0,o.jsx)(s,{callback:()=>{b(!A),p(!A)},storageKey:c,btnClass:`collapse-trigger ${g&&A&&y} ${y&&"collapse-focus"}`,eventKey:m,show:A,style:f,children:(0,o.jsxs)("span",{className:"d-flex align-items-center",children:[(0,o.jsx)("span",{className:"native-icon",children:d}),(0,o.jsxs)("span",{children:[(0,o.jsx)("div",{className:"menu-name",children:u}),(0,o.jsx)("div",{style:{fontSize:"10px"},children:h})]}),a,(0,o.jsx)("span",{className:"native-icon shevron-icon",children:(0,o.jsx)(i.A,{className:"collapse-caret"})})]})}),(0,o.jsx)(l.A.Collapse,{eventKey:m,children:(0,o.jsx)(o.Fragment,{children:t})})]})})})}},75010(e,t,a){a.d(t,{A:()=>l});var n=a(28918);var i=a(70579);function l(e){let{totalRecords:t,handleChange:a,pageSize:l,page:o}=e;return(0,i.jsx)(n.A,{count:Math.ceil(t/l),color:"primary",onChange:a,page:o})}},67464(){}}]); 2//# sourceMappingURL=9197.98a4dd05.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.