"use strict";(globalThis.webpackChunkhelpgent=globalThis.webpackChunkhelpgent||[]).push([[31],{31:(e,t,n)=>{n.r(t),n.d(t,{default:()=>X});var i=n(51609),a=n(63064),l=n(64943),s=n(64197),c=n(45907),r=n(86087);const N=(0,r.createContext)(),M=()=>(0,r.useContext)(N),o=({children:e})=>{const[t,n]=(0,r.useState)({activeScreen:"all"});return(0,i.createElement)(N.Provider,{value:{summaryState:t,setSummaryState:n}},e)};var g=n(10426),u=n(65604),L=n(38267);const I=L.Ay.div`
    .helpgent-summary-top{
        margin-bottom: 39px;
        .helpgent-btn{
            align-items: center;
            justify-content: flex-start;
            gap: 10px;
            width: 100%;
            padding: 8px 12px;
            .helpgent-btn-round-icon{
                width: 34px;
                height: 34px;
                background: #fff;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                svg{
                    width: 16px;
                    height: 16px;
                    margin: 0;
                    path{
                        fill: var(--helpgent-color-primary);
                    }
                }
            }
            &.helpgent-active{
                background: var(--helpgent-color-primary);
                color: #fff;
            }
        }
    }
    .helpgent-summary-content{
        .helpgent-summary-content__label{
            font-size: 15px;
            font-weight: 500;
            display: block;
            color: var(--helpgent-color-dark);
        }
        .helpgent-summary-content__list{
            overflow-y: auto;
            height: calc(100vh - 350px);
            padding: 0 7px 7px 7px;
            margin: 16px 0 0 -27px;
            .helpgent-single-screen{
                display: flex;
                align-items: center;
                gap: 12px;
                border-radius: 12px;
                background: transparent;
                padding: 14px 20px;
                cursor: pointer;
                transition: var(--helpgent-transition);
                &__icon{
                    width: 40px;
                    height: 40px;
                    border-radius: 50%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    flex: none;
                    background: var(--helpgent-color-gray);
                    position: relative;
                    transition: var(--helpgent-transition);
                    svg{
                        width: 16px;
                        path{
                            fill: #fff;
                        }
                    }
                    .helpgent-badge{
                        width: 16px;
                        height: 16px;
                        position: absolute;
                        left: -5px;
                        top: -5px;
                        border: 2px solid #fff;
                        font-size: 11px;
                    }
                }
                &__label{
                    font-size: 15px;
                    font-weight: 500;
                    color: var(--helpgent-color-dark);
                }
                &.helpgent-active{
                    background: #fff;
                    .helpgent-single-screen__icon{
                        background: var(--helpgent-color-primary);
                    }
                }
            }
        }
        .helpgent-single-screen__label{
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            flex: 0 0 284px;
            word-break: break-word;
            overflow: hidden;
            line-height: 1.5;
            p,
            strong{
                margin: 0;
                font-size: inherit;
                font-weight: inherit;
                line-height: inherit;
            }
        }
    }
`,p=L.Ay.div`

`;L.Ay.div`

`;var j=n(16622);function d(e){const{screen:t,count:n,dashboardWidth:a,conversationWidth:l}=e,{summaryState:s,setSummaryState:c}=M(),{activeScreen:r}=s;return(0,i.createElement)(p,{className:"helpgent-single-screen "+(r.id===t.id?"helpgent-active":""),onClick:()=>(t.element_type,c({...s,activeScreen:t}),void((a<768||l<768)&&function(){const e=document.querySelector(".helpgent-conversation-main"),t=document.querySelector(".helpgent-sidebar");e.classList.add("helpgent-conversation-main--active"),t.classList.remove("helpgent-sidebar--active")}()))},(0,i.createElement)("div",{className:"helpgent-single-screen__icon"},(0,i.createElement)("span",{className:"helpgent-badge helpgent-badge-circle helpgent-badge-light"},n),(0,i.createElement)(u.A,{src:j.hr[t.element_type]})),(0,i.createElement)("span",{className:"helpgent-single-screen__label",dangerouslySetInnerHTML:{__html:t?.title}}))}var m=n(27723);function z(){const{summaryState:e,setSummaryState:t}=M(),{activeScreen:n}=e,{getStoreData:a}=(0,g.A)(),l=a(["helpgent-response-screen"]),[s,c]=(0,r.useState)(),[N,o]=(0,r.useState)();return(0,r.useEffect)(()=>{const e=document.querySelector(".helpgent-user-dashboard"),t=document.querySelector(".helpgent-conversation-wrapper");if(e){const t=e.clientWidth;c(t)}if(t){const e=t.clientWidth;o(e)}},[]),(0,i.createElement)(I,null,(0,i.createElement)("div",{className:"helpgent-summary-top"},(0,i.createElement)("button",{href:"#",className:"helpgent-btn helpgent-btn-light helpgent-btn-lg "+("all"===n?"helpgent-active":""),onClick:()=>{t({...e,activeScreen:"all"}),(s<768||N<768)&&function(){const e=document.querySelector(".helpgent-conversation-main"),t=document.querySelector(".helpgent-sidebar");e.classList.add("helpgent-conversation-main--active"),t.classList.remove("helpgent-sidebar--active")}()}},(0,i.createElement)("span",{className:"helpgent-btn-round-icon"},(0,i.createElement)(u.A,{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBpZD0icG9sbC1oIiBkPSJNMTIuMzMzLDBIMy42NjdBMy42NzMsMy42NzMsMCwwLDAsMCwzLjY2N3Y4LjY2N0EzLjY3MywzLjY3MywwLDAsMCwzLjY2NywxNmg4LjY2N0EzLjY3MywzLjY3MywwLDAsMCwxNiwxMi4zMzNWMy42NjdBMy42NzMsMy42NzMsMCwwLDAsMTIuMzMzLDBaTTE0LDEyLjMzM0ExLjY2NywxLjY2NywwLDAsMSwxMi4zMzMsMTRIMy42NjdBMS42NjcsMS42NjcsMCwwLDEsMiwxMi4zMzNWMy42NjdBMS42NjcsMS42NjcsMCwwLDEsMy42NjcsMmg4LjY2N0ExLjY2NywxLjY2NywwLDAsMSwxNCwzLjY2N1ptLTEwLjY2Ny04YTEsMSwwLDAsMSwxLTFIOS42NjdhMSwxLDAsMSwxLDAsMkg0LjMzM0ExLDEsMCwwLDEsMy4zMzMsNC4zMzNaTTEyLjY2Nyw4YTEsMSwwLDAsMS0xLDFINC4zMzNhMSwxLDAsMSwxLDAtMmg3LjMzM0ExLDEsMCwwLDEsMTIuNjY3LDhabS02LDMuNjY3YTEsMSwwLDAsMS0xLDFINC4zMzNhMSwxLDAsMSwxLDAtMkg1LjY2N0ExLDEsMCwwLDEsNi42NjcsMTEuNjY3WiIgZmlsbD0iIzY1NTFmMiIvPgo8L3N2Zz4K"}))," ",(0,i.createElement)("span",null,(0,m.__)("Response Summary","helpgent")))),(0,i.createElement)("div",{className:"helpgent-summary-content"},(0,i.createElement)("span",{className:"helpgent-summary-content__label"},(0,m.__)("View individual element summary","helpgent")),(0,i.createElement)("div",{className:"helpgent-summary-content__list helpgent-scrollbar-style"},l&&0!==l.elements.length&&l.elements.map((e,t)=>(0,i.createElement)(d,{screen:e,count:t+1,key:t,dashboardWidth:s,conversationWidth:N})))))}var w=n(71474),h=n(88887),D=n(85692),y=n(11351),T=n(6945),A=n(93832),S=n(68357),x=n(33764),C=n(26944),Y=n(41620),E=n(74509);const k=(0,r.forwardRef)((e,t)=>{const{elementId:n,answer:a}=e,{getStoreData:l}=(0,g.A)(),s=l(["helpgent-response-screen"]),c=s&&s.elements.filter(e=>e.id===n);return(0,i.createElement)(h.$G,{className:"helpgent-progress-single "+(a?.url?"helpgent-progress-single--image":"")},a?.url&&(0,i.createElement)("div",{className:"helpgent-progress-single__img"},(0,i.createElement)("img",{src:a?.url,alt:a?.label})),(0,i.createElement)("div",{className:"helpgent-progress-single__contents"},(0,i.createElement)("div",{className:"helpgent-progress-single__info",ref:t||null},(0,i.createElement)("span",{className:"helpgent-progress-single__label"},a.label),(0,i.createElement)("div",{className:"helpgent-progress-single__statistics"},(0,i.createElement)("span",{className:"helpgent-progress-single__statistics-response-count"},(0,i.createElement)(u.A,{src:E.A}),(0,i.createElement)("span",null,a.total," responses")),(0,i.createElement)("span",{className:"helpgent-progress-single__statistics-percentage"},(0,Y.A)(parseInt(a?.total),parseInt(c[0]?.total_response)),"%"))),(0,i.createElement)(C.A,{type:"dark",currentValue:(0,Y.A)(parseInt(a?.total),parseInt(c[0]?.total_response)),contentFlow:"horizontal"})))});var b=n(96870),O=n(44724),v=n(28029),f=n(88141),U=n(38745),G=n(54869),Q=n(111),Z=n(13777);function _(e){const{data:t}=e,n=[],a=[],l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{t&&t.pages&&(t.pages.map(e=>e.map(e=>{n.push(JSON.parse(e.value))})),new G.aH({apiKey:helpgent_localization.google_map_api_key,version:"weekly",libraries:["places","marker"]}).load().then(()=>{const e=n[0],t=new google.maps.Map(l.current,{center:e,zoom:10,streetViewControl:!1,scrollwheel:!1,mapTypeControl:!1,mapId:"DEMO_MAP_ID"}),i=new google.maps.Geocoder;n.forEach(e=>{const n=document.createElement("img");n.src=Z.A;const l=new google.maps.marker.AdvancedMarkerElement({position:e,map:t,content:n});a.push(l),i.geocode({location:e},(e,n)=>{if("OK"!==n)return void console.log("Geocoder failed due to: "+n);if(!e[0])return void console.log("No results found");const i=`<div class="helpgent-map-info-window">\n\t\t\t\t\t\t\t<span>${e[0].formatted_address}</span>\n\t\t\t\t\t\t</div>`,a=new google.maps.InfoWindow({content:i,ariaLabel:"Address Info"});l.addListener("click",()=>{a.open(t,l)})})});const s={render:({count:e,position:t})=>new google.maps.Marker({label:{text:String(e),color:"#000000",fontSize:"13px",fontWeight:"600",lineHeight:"0"},icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjEgLTEgNjQgNjQiPgogIDxkZWZzPgogICAgPGZpbHRlciBpZD0iRWxsaXBzZV8zMTgiIHg9IjAiIHk9IjAiIHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KICAgICAgPGZlT2Zmc2V0IGR5PSIyIiBpbnB1dD0iU291cmNlQWxwaGEiLz4KICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNSIgcmVzdWx0PSJibHVyIi8+CiAgICAgIDxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAuMjUxIi8+CiAgICAgIDxmZUNvbXBvc2l0ZSBvcGVyYXRvcj0iaW4iIGluMj0iYmx1ciIvPgogICAgICA8ZmVDb21wb3NpdGUgaW49IlNvdXJjZUdyYXBoaWMiLz4KICAgIDwvZmlsdGVyPgogIDwvZGVmcz4KICA8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxLCAwLCAwLCAxLCAwLCAwKSIgZmlsdGVyPSJ1cmwoI0VsbGlwc2VfMzE4KSI+CiAgICA8Y2lyY2xlIGlkPSJFbGxpcHNlXzMxOC0yIiBkYXRhLW5hbWU9IkVsbGlwc2UgMzE4IiBjeD0iMTgiIGN5PSIxOCIgcj0iMTgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1IDEzKSIgZmlsbD0iI2ZmZiIvPgogIDwvZz4KPC9zdmc+Cg==",position:t,zIndex:Number(google.maps.Marker.MAX_ZINDEX)+e})};new Q.w1({map:t,markers:a,renderer:s})}))},[t,a]),(0,i.createElement)("div",{className:"helpgent-map-summary-wrapper",ref:l})}function W(e){const{uiType:t,elementType:n,elementId:a,labels:l,elementTitle:s,baseApiRoute:c}=e,N=(0,U.L)(),{paramsHook:M}=(0,T.Xd)("helpgent_router_references",null);if(!N&&("multi_select"===n||"picture_select"===n))return(0,i.createElement)("div",{className:"helpgent-summery-pro"}," ",s," ",(0,m.__)("summery is not available in free version","helpgent"));const{id:o}=M(),g={element_id:a,element_type:n,per_page:10},{data:u,isSuccess:L,isRefetching:I,hasNextPage:p,fetchNextPage:j,isFetchingNextPage:d,isError:z,errorMessage:w}=(0,y.A)([`helpgent-responses-${a}`],(0,A.addQueryArgs)(`${c?.forms}/${o}/summary`,g),10,{refetchOnWindowFocus:!0,keepPreviousData:!0,staleTime:1e4}),{ref:h,inView:C}=(0,D.Wx)();return(0,r.useEffect)(()=>{C&&p&&j()},[C,j,p]),L?(0,i.createElement)(r.Fragment,null,u.pages.map(e=>e.map((s,c)=>{if("text"===t&&"map"===n)e.map(e=>e.value);else{if("text"===t)return(0,i.createElement)(r.Fragment,null,(0,i.createElement)(x.A,{ref:e.length===c+1?h:null,key:c,conversationType:"answer",elementType:n,textContent:s.value,passedTime:(0,T.Mi)(s.created_at)}));if("verticalProgress"===t)return(0,i.createElement)(k,{ref:e.length===c+1?h:null,key:c,elementId:a,answer:s});if("horizontalProgress-infinity"===t)return(0,i.createElement)(r.Fragment,null);if("info"===t)return(0,i.createElement)(b.A,{ref:e.length===c+1?h:null,key:c,answer:s.contact_info||s.address,labels:l});if("openEnd"===t){if("open_ended_text"===s.element_type)return(0,i.createElement)(b.A,{ref:e.length===c+1?h:null,key:c,labels:l,answer:s.open_ended_text_inners});if("open_ended_voice"===s.element_type)return(0,i.createElement)(O.A,{ref:e.length===c+1?h:null,key:c,file:s.attachment});if("open_ended_video"===s.element_type||"open_ended_screen"===s.element_type)return(0,i.createElement)(v.A,{ref:e.length===c+1?h:null,key:c,file:s.attachment})}else if("fileUpload"===t)return s?.attachments.map((t,n)=>(0,i.createElement)(f.A,{ref:e.length===n+1?h:null,key:n,file:t}))}})),"text"===t&&"map"===n&&(0,i.createElement)(_,{data:u}),d&&(0,i.createElement)("span",null,(0,m.__)("Loading","helpgent"))):(0,i.createElement)(S.A,null)}function R(e){const{ratingIcon:t,answers:n,index:a,position:l}=e,s=n.reduce((e,t)=>{const n=t.value,i=parseInt(t.total,10);return e[n]=(e[n]||0)+i,e},{})[l]||0,c=n.reduce((e,t)=>e+parseInt(t.total,10),0);return(0,i.createElement)(h.Jp,{className:"helpgent-bar-chart"},(0,i.createElement)("div",{className:"helpgent-bar-chart__statistics"},(0,i.createElement)("span",{className:"helpgent-bar-chart__statistics-percentage"},(0,Y.A)(s,c)," %"),(0,i.createElement)("span",{className:"helpgent-bar-chart__statistics-response-count"}," ",(0,i.createElement)("span",null,s)," ",(0,i.createElement)(u.A,{src:E.A}))),(0,i.createElement)(C.A,{type:"dark",currentValue:(0,Y.A)(s,c),contentFlow:"vertical"}),(0,i.createElement)("span",{className:"helpgent-bar-chart__count"},l,t&&(0,i.createElement)(u.A,{src:j.Yi[t].normal})))}function F(e){const{uiType:t,elementId:n,elementType:a,elementTitle:s,baseApiRoute:c}=e,r=(0,U.L)(),{paramsHook:N}=(0,T.Xd)("helpgent_router_references",null),{id:M}=N();if(!r&&("promoter_score"===a||"rating_star"===a||"range_slider"===a))return(0,i.createElement)("div",{className:"helpgent-summery-pro"}," ",s," ",(0,m.__)("summery is not available in free version","helpgent"));const o={element_id:n,element_type:a},{data:g,isLoading:u,isError:L,errorMessage:I,isFetching:p}=(0,l.A)([`helpgent-response-${n}`],(0,A.addQueryArgs)(`${c?.forms}/${M}/summary`,o));let j=11;return g&&("rating_star"===a?j=parseInt(g.rating_amount):"range_slider"===a&&(j=parseInt(g.max_value)+1)),u?(0,i.createElement)(S.A,null):(0,i.createElement)("div",{className:"helpgent-no-pagination-answer"},(0,i.createElement)("div",{className:"helpgent-no-pagination-answer__average"}),(0,i.createElement)("div",{className:"helpgent-bar-chart-wrapper"},[...Array(j)].map((e,t)=>(0,i.createElement)(R,{key:t,ratingIcon:g.rating_icon||null,answers:g.answers,index:t,position:"rating_star"===a?t+1:t}))),g&&(g.low_rating_text||g.high_rating_text)&&(0,i.createElement)("div",{className:"helpgent-no-pagination-answer__progress-text"},(0,i.createElement)("span",{className:"helpgent-no-pagination-answer__progress-down"},g.low_rating_text&&g.low_rating_text),(0,i.createElement)("span",{className:"helpgent-no-pagination-answer__progress-up"},g.high_rating_text&&g.high_rating_text)))}var B=n(22057);function P(e){const{baseApiRoute:t}=e,{summaryState:n}=M(),{activeScreen:a}=n,{getStoreData:l}=(0,g.A)(),s=l(["helpgent-response-screen"]),c=l(["helpgent-response-form"]),[N,o]=(0,r.useState)(),[L,I]=(0,r.useState)(),p=c&&parseInt(c.form.total_response.completed)+parseInt(c.form.total_response.incompleted);return(0,r.useEffect)(()=>{const e=document.querySelector(".helpgent-user-dashboard"),t=document.querySelector(".helpgent-conversation-wrapper");if(e){const t=e.clientWidth;o(t)}if(t){const e=t.clientWidth;I(e)}},[]),(0,i.createElement)(h.x9,null,(0,i.createElement)("div",{className:"helpgent-summary-header"},(N<768||L<768)&&(0,i.createElement)("span",{className:"helpgent-back-user-list",onClick:function(){const e=document.querySelector(".helpgent-conversation-main"),t=document.querySelector(".helpgent-sidebar");e.classList.remove("helpgent-conversation-main--active"),t.classList.add("helpgent-sidebar--active")}},(0,i.createElement)(u.A,{src:B.A})),(0,m.__)("Response summary","helpgent")),(0,i.createElement)("div",{className:"helpgent-summary-content"},s&&s.elements.map((e,n)=>{const l="all"===a||a.id===e.id;let s="vertical";return"range_slider"!==e.element_type&&"rating_star"!==e.element_type&&"promoter_score"!==e.element_type||(s="horizontal"),l&&(0,i.createElement)("div",{className:"helpgent-summary__item",key:n},(0,i.createElement)("div",{className:"helpgent-conversation__top helpgent-d-flex"},(0,i.createElement)("div",{className:"helpgent-conversation__icon"},(0,i.createElement)(u.A,{src:j.hr[e.element_type]})),(0,i.createElement)("div",{className:"helpgent-conversation__title"},(0,i.createElement)("h4",{dangerouslySetInnerHTML:{__html:e?.title}}))),(0,i.createElement)("span",{className:"helpgent-summary-label"},(0,m.sprintf)((0,m.__)("%s out of %s people answered this element","helpgent"),e.total_response,p||0)),(0,i.createElement)("div",{className:"helpgent-summary__element-list "+("horizontal"===s?"helpgent-progress-horizontal":"helpgent-scrollbar-style")},function(e){let n="";return["long_text","short_text","date","time","email","phone_number","website","number","map"].includes(e.element_type)?n="text":["dropdown","single_select","multi_select","yes_no","picture_select"].includes(e.element_type)?n="verticalProgress":["rating_star","promoter_score","range_slider"].includes(e.element_type)?n="horizontalProgress":["contact_info","address"].includes(e.element_type)?n="info":["open_ended"].includes(e.element_type)?n="openEnd":"file_upload"===e.element_type&&(n="fileUpload"),!n||"text"!==n&&"verticalProgress"!==n&&"info"!==n&&"openEnd"!==n&&"fileUpload"!==n?(0,i.createElement)(F,{elementType:e.element_type,elementId:e.id,elementTitle:e.title,baseApiRoute:t}):(0,i.createElement)(W,{uiType:n,elementType:e.element_type,elementId:e.id,labels:e.labels||null,elementTitle:e.title,baseApiRoute:t})}(e)))})))}const H=e=>{const{baseApiRoute:t,baseLinkRoute:n}=e,{paramsHook:s}=(0,T.Xd)("helpgent_router_references",null),{summaryState:r,setSummaryState:N}=M(),o=(0,a.jE)(),{id:g}=s(),{data:u,isLoading:L,isError:I,errorMessage:p,isFetching:j}=(0,l.A)(["helpgent-response-screen"],`${t?.forms}/${g}/summary/element`);return(0,i.createElement)(c.A,{sidebarTop:(0,i.createElement)(w.A,{moduleState:r,setModuleState:N,queryClient:o,baseApiRoute:t,baseLinkRoute:n}),sidebarChild:(0,i.createElement)(z,null),mainChild:(0,i.createElement)(P,{baseApiRoute:t})})};function X(e){return(0,i.createElement)(a.Ht,{client:s.A},(0,i.createElement)(o,null,(0,i.createElement)(H,{...e})))}},2192:(e,t,n)=>{n.d(t,{A:()=>i}),n(51609);const i="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8ZyBpZD0icm90YXRlLXJpZ2h0IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMS4xNTIgMCkiPgogICAgPHBhdGggaWQ9IlBhdGhfMTIyOSIgZGF0YS1uYW1lPSJQYXRoIDEyMjkiIGQ9Ik0xNi4xNDUsNy45OTJhMS4wMTQsMS4wMTQsMCwwLDAtMSwuODgxLDYuMDIsNi4wMiwwLDEsMS0yLjA1NS01LjQ0M2wtLjc1OC43NTRhLjY2Ny42NjcsMCwwLDAsLjQ3NiwxLjEzOWgzLjA3NGEuNjY5LjY2OSwwLDAsMCwuNjctLjY2N1YxLjU5NWEuNjcxLjY3MSwwLDAsMC0xLjE0NC0uNDcybC0uODkzLjg4OWE4LjA2Miw4LjA2MiwwLDAsMC0xMS4zNDQuNjgzLDcuOTc1LDcuOTc1LDAsMCwwLC42ODYsMTEuMjkzLDguMDM4LDguMDM4LDAsMCwwLDEzLjI4LTQuODI1LDEuMDE0LDEuMDE0LDAsMCwwLS45OTQtMS4xN1oiIGZpbGw9IiNhMmEyYTIiLz4KICA8L2c+Cjwvc3ZnPgo="},10426:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(63064);function a(){const e=(0,i.jE)();return{setStoreData:(t,n)=>{e.setQueryData(t,n)},getStoreData:t=>e.getQueryData(t),removeStoreData:t=>{e.removeQueries(t)}}}},11351:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(14426),a=n(68360),l=n(90212),s=n(93832);function c(e,t,n,c){const{data:r,isSuccess:N,isRefetching:M,hasNextPage:o,fetchNextPage:g,isFetchingNextPage:u,error:L,isLoading:I}=(0,i.q)(e,({pageParam:e=1})=>(0,a.A)((0,s.addQueryArgs)(t,{page:e})),{getNextPageParam:(e,t)=>e.length===n?t.length+1:void 0,...c});return{data:L||!N?null:r,isSuccess:N,isRefetching:M,hasNextPage:o,fetchNextPage:g,isFetchingNextPage:u,isLoading:I,error:L,errorMessage:L?(0,l.A)(null!=L?L:L.data.status):"",isError:!!L}}},17955:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(51609),a=n(92609),l=n(91636);const s="data:image/svg+xml;base64, ";function c(e){const{audioCurrentTime:t,audioDuration:n,audioPaused:c}=e;function r(){const e=t/n;return isNaN(e)?0:100*e}return(0,i.createElement)("span",{className:"helpgent-audio-range"},(0,i.createElement)("span",{style:{display:"block",position:"relative",margin:"5px",width:"100%",height:"20px"}},(0,i.createElement)("span",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"inline-block",backgroundPositionX:"0px",backgroundRepeat:"no-repeat",backgroundImage:"url( "+l.A+" )",zIndex:0}}),c&&100!==r()?(0,i.createElement)("span",{style:{width:r()+"%",position:"absolute",left:0,right:0,top:0,bottom:0,display:"inline-block",backgroundPositionX:"0px",backgroundRepeat:"no-repeat",backgroundImage:"url( "+a.A+" )",zIndex:1,transition:"all 300ms ease-in-out 0s"}}):(0,i.createElement)("span",{style:{width:r()+"%",position:"absolute",left:0,right:0,top:0,bottom:0,display:"inline-block",backgroundPositionX:"0px",backgroundRepeat:"no-repeat",backgroundImage:"url( "+s+" )",zIndex:1,transition:"all 300ms ease-in-out 0s"}})))}},20978:(e,t,n)=>{n.d(t,{A:()=>i}),n(51609);const i="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMjAgNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMS4yIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMjcyIDYzLjFsLTMyIDBjLTI2LjUxIDAtNDggMjEuNDktNDggNDcuMXYyODhjMCAyNi41MSAyMS40OSA0OCA0OCA0OEwyNzIgNDQ4YzI2LjUxIDAgNDgtMjEuNDkgNDgtNDh2LTI4OEMzMjAgODUuNDkgMjk4LjUgNjMuMSAyNzIgNjMuMXpNODAgNjMuMWwtMzIgMGMtMjYuNTEgMC00OCAyMS40OS00OCA0OHYyODhDMCA0MjYuNSAyMS40OSA0NDggNDggNDQ4bDMyIDBjMjYuNTEgMCA0OC0yMS40OSA0OC00OHYtMjg4QzEyOCA4NS40OSAxMDYuNSA2My4xIDgwIDYzLjF6Ii8+PC9zdmc+"},26944:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(51609),a=n(4286);function l(e){const{type:t,currentValue:n,contentFlow:l}=e;return(0,i.createElement)(a.F2,{className:`helpgent-progress-bar helpgent-progress-bar-${t} helpgent-progress-bar-${l}`},(0,i.createElement)("div",{className:"helpgent-progress-bar__status",style:{["vertical"===l?"height":"width"]:`${n}%`}}))}},28029:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(51609),a=n(86087),l=n(65604),s=n(67076),c=n(33410),r=n(20978),N=n(88887),M=n(6945),o=n(27723);const g=(0,a.forwardRef)((e,t)=>{const{type:n,file:g}=e,u=(0,a.useRef)(),[L,I]=(0,a.useState)(!1);return(0,i.createElement)(N.CB,{className:"helpgent-open-ended-answer-content"},(0,i.createElement)("div",{className:"helpgent-open-ended-answer helpgent-d-flex",ref:t||null},(0,i.createElement)("div",{className:"helpgent-open-ended-answer__video"},(0,i.createElement)("div",{className:"helpgent-open-ended-answer__video-inner"},(0,i.createElement)("video",{ref:u,src:g.url,preload:"auto",onPlay:()=>{I(!0)},onPause:()=>{I(!1)},playsInline:!0}),(0,i.createElement)("a",{href:"#",className:"helpgent-video-conversation__toggle",onClick:e=>{e.preventDefault(),u.current&&(u.current.paused?(I(!0),u.current.play()):(u.current.pause(),I(!1)))}},L?(0,i.createElement)(l.A,{src:r.A}):(0,i.createElement)(l.A,{src:c.A}))),(0,i.createElement)("div",{className:"helpgent-open-ended-answer__video-info"},"open_ended_video"===n?(0,i.createElement)("span",null,(0,o.__)("Video Record","helpgent")):(0,i.createElement)("span",null,(0,o.__)("Screen Record","helpgent")),(0,i.createElement)("span",null,(0,M.w3)(g.file_size)))),L?null:(0,i.createElement)("a",{href:g.url,className:"helpgent-video-conversation__download",download:!0},(0,i.createElement)(l.A,{src:s.A}))))})},30814:(e,t,n)=>{n.d(t,{A:()=>i}),n(51609);const i="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzLjExMSIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDMuMTExIDE0Ij4KICA8cGF0aCBpZD0iZWxsaXBzaXMtaCIgZD0iTTEwLDEwYTEuNTU2LDEuNTU2LDAsMSwwLDEuNTU2LDEuNTU2QTEuNTU2LDEuNTU2LDAsMCwwLDEwLDEwWk00LjU1NiwxMGExLjU1NiwxLjU1NiwwLDEsMCwxLjU1NiwxLjU1NkExLjU1NiwxLjU1NiwwLDAsMCw0LjU1NiwxMFptMTAuODg5LDBBMS41NTYsMS41NTYsMCwxLDAsMTcsMTEuNTU2LDEuNTU2LDEuNTU2LDAsMCwwLDE1LjQ0NCwxMFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMCAxNykgcm90YXRlKC05MCkiIGZpbGw9IiNhMmEyYTIiLz4KPC9zdmc+Cg=="},33764:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(51609),a=n(86087),l=n(65604),s=n(44220),c=n(88887),r=n(46958),N=n(87446),M=n(27723),o=n(6945);function g({time:e}){const t=(0,o.fU)(e);if(!t)return"";const n=t.data&&t.data.timezone?t.data.timezone:"";return(0,i.createElement)("span",{className:"helpgent-time"},t.formattedTime,n?(0,i.createElement)("span",{className:"helpgent-text-muted helpgent-ml-5"},"(",n,")"):"")}const u=(0,a.forwardRef)((e,t)=>{const{conversationType:n,elementType:a,textContent:o,passedTime:u,form:L}=e;let I=null;if(o){const e=(0,s.A)(o),c={ref:t||null};"message"===n?I=(0,i.createElement)("p",{dangerouslySetInnerHTML:{__html:e},className:"helpgent-scrollbar-style"}):"answer"===n&&(I="long_text"===a||"short_text"===a?(0,i.createElement)("p",{dangerouslySetInnerHTML:{__html:e},className:"helpgent-scrollbar-style"}):"date"===a?(0,i.createElement)("div",{className:"helpgent-answer__inline-icon"},(0,i.createElement)(l.A,{src:r.A}),(0,i.createElement)("p",{dangerouslySetInnerHTML:{__html:e}})):"map"===a?(0,i.createElement)("h1",null,e):"time"===a?(0,i.createElement)("div",{className:"helpgent-answer__inline-icon"},(0,i.createElement)(l.A,{src:N.A}),(0,i.createElement)("p",null,(0,i.createElement)(g,{time:e}))):(0,i.createElement)("span",{className:"helpgent-answer__highlight-text",...c,dangerouslySetInnerHTML:{__html:e}}))}return(0,i.createElement)(c.zD,{className:`helpgent-answer-text helpgent-answer-${a}`},I,u&&(0,i.createElement)("div",{className:"helpgent-passed-time"},(0,i.createElement)("span",null,u," ",(0,M.__)("ago","helpgent"))))})},35747:(e,t,n)=>{n.d(t,{A:()=>i}),n(51609);const i="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxMy45OTUiIHZpZXdCb3g9IjAgMCAxNCAxMy45OTUiPgogIDxnIGlkPSJwZW5jaWwiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNDMuMjY1IC00LjI5NikiPgogICAgPGcgaWQ9Ikdyb3VwXzI3ODkiIGRhdGEtbmFtZT0iR3JvdXAgMjc4OSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTQzLjI2NSA0LjI5NikiPgogICAgICA8ZyBpZD0iR3JvdXBfMjc4OCIgZGF0YS1uYW1lPSJHcm91cCAyNzg4Ij4KICAgICAgICA8cGF0aCBpZD0iUGF0aF8xNTYxIiBkYXRhLW5hbWU9IlBhdGggMTU2MSIgZD0iTTE1Ni4yMDksNS4zNDdhMy42MzUsMy42MzUsMCwwLDAtNS4xLS4wMDlsLTYuMzkzLDYuMzkzYTQuOTI4LDQuOTI4LDAsMCwwLTEuNDQ3LDMuNXYyLjExNWEuOTQzLjk0MywwLDAsMCwuOTQ0Ljk0NGgyLjExNWE0LjkyOSw0LjkyOSwwLDAsMCwzLjUtMS40NDhsNi4zODUtNi4zODVBMy42MjIsMy42MjIsMCwwLDAsMTU2LjIwOSw1LjM0N1ptLTcuNzE4LDEwLjE2YTMuMDUxLDMuMDUxLDAsMCwxLTIuMTY2LjloLTEuMTcxVjE1LjIzMWEzLjA1MSwzLjA1MSwwLDAsMSwuODk0LTIuMTY1bDQuMjE1LTQuMjE1LDIuNDQyLDIuNDQyWm02LjM4My02LjM4My0uODM0LjgzNEwxNTEuNiw3LjUxNmwuODM0LS44MzRhMS43MjcsMS43MjcsMCwwLDEsMi40NDIsMi40NDJaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTQzLjI2NSAtNC4yOTYpIiBmaWxsPSIjNmU2ZTZlIi8+CiAgICAgIDwvZz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo="},41620:(e,t,n)=>{function i(e,t){return isNaN(e)||isNaN(t)||0===t?0:(e/t*100).toFixed(2).replace(/\.00$/,"")}n.d(t,{A:()=>i})},44220:(e,t,n)=>{function i(e){return e.replace(/(https?:\/\/[^\s]+)/g,'<a href="$1" target="_blank">$1</a>')}n.d(t,{A:()=>i})},44724:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(51609),a=n(86087),l=n(17955),s=n(65604),c=n(66582),r=n(67076),N=n(33410),M=n(20978),o=n(88887);const g=(0,a.forwardRef)((e,t)=>{const{file:n}=e,g=(0,a.useRef)(new Audio(n.url)),[u,L]=(0,a.useState)(!1),[I,p]=(0,a.useState)(0),[j,d]=(0,a.useState)(0);return(0,a.useEffect)(()=>{u&&0===j-I&&L(!1)},[I]),(0,a.useEffect)(()=>{if(!g.current)return;const e=e=>p(e.target.currentTime),t=e=>d(e.target.duration);return g.current.addEventListener("timeupdate",e),g.current.addEventListener("loadeddata",t),()=>{g.current.removeEventListener("timeupdate",e),g.current.removeEventListener("loadeddata",t)}},[]),(0,i.createElement)(o.CB,{className:"helpgent-open-ended-answer-content"},(0,i.createElement)("div",{className:"helpgent-open-ended-answer helpgent-d-flex",ref:t||null},(0,i.createElement)("audio",{src:n.url}),(0,i.createElement)("div",{className:"helpgent-open-ended-answer__voice helpgent-d-flex"},(0,i.createElement)("a",{href:"#",className:"helpgent-open-ended-answer__toggle "+(u?"helpgent-open-ended-answer__toggle--playing":""),onClick:function(e){e.preventDefault(),g.current&&(g.current.paused?(g.current.play(),L(!0)):(g.current.pause(),L(!1)))}},u?(0,i.createElement)(s.A,{src:M.A}):(0,i.createElement)(s.A,{src:N.A})),(0,i.createElement)(l.A,{audioCurrentTime:I,audioDuration:j}),(0,i.createElement)("div",{className:"helpgent-open-ended-answer__time"},(0,i.createElement)("span",null,function(){const e=j-I;return(0,c.C1)(e)}()))),(0,i.createElement)("a",{href:n.url,className:"helpgent-open-ended-answer__download",download:!0},(0,i.createElement)(s.A,{src:r.A}))))})},45907:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(51609),a=n(86087),l=n(4286);function s(e){const{sidebarTop:t,sidebarChild:n,mainChild:s}=e;return(0,a.useEffect)(()=>{const e=document.querySelector(".helpgent-conversation-wrapper").clientWidth,t=document.querySelector(".helpgent-conversation-main"),n=document.querySelector(".helpgent-sidebar");e<768&&t&&n&&(t.classList.remove("helpgent-conversation-main--active"),n.style.display="none",n.classList.add("helpgent-sidebar--active"))},[]),(0,i.createElement)(l.Yn,{className:"helpgent-conversation-wrapper"},(0,i.createElement)(a.Fragment,null,(0,i.createElement)("aside",{className:"helpgent-sidebar"},t,n),(0,i.createElement)("main",{className:"helpgent-conversation-main helpgent-conversation-main--active"},s)))}},49615:(e,t,n)=>{n.d(t,{A:()=>i}),n(51609);const i="data:image/svg+xml;base64,PHN2ZyBpZD0iYm94IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNC4wMDMiIGhlaWdodD0iMTQuMDAzIiB2aWV3Qm94PSIwIDAgMTQuMDAzIDE0LjAwMyI+CiAgPHBhdGggaWQ9IlBhdGhfMTU1MSIgZGF0YS1uYW1lPSJQYXRoIDE1NTEiIGQ9Ik0xNCwzLjIwOUEzLjIxMywzLjIxMywwLDAsMCwxMC43OTQsMEgzLjIwOUEzLjIxMywzLjIxMywwLDAsMCwwLDMuMjA5di41ODNBMi4wMzQsMi4wMzQsMCwwLDAsLjU4Myw1LjIxN3Y1LjU3N0EzLjIxMywzLjIxMywwLDAsMCwzLjc5MiwxNEgxMC4yMWEzLjIxMiwzLjIxMiwwLDAsMCwzLjIwOS0zLjIwOVY1LjIxN0EyLjAzMywyLjAzMywwLDAsMCwxNCwzLjc5MlptLTEyLjI1MywwQTEuNDU5LDEuNDU5LDAsMCwxLDMuMjA5LDEuNzVoNy41ODVhMS40NTksMS40NTksMCwwLDEsMS40NTksMS40NTl2LjU4M2EuMjkyLjI5MiwwLDAsMS0uMjkyLjI5MkgyLjA0MmEuMjkyLjI5MiwwLDAsMS0uMjkyLS4yOTJabTkuOTE5LDcuNTg1YTEuNDU5LDEuNDU5LDAsMCwxLTEuNDU5LDEuNDU5SDMuNzkyYTEuNDU5LDEuNDU5LDAsMCwxLTEuNDU5LTEuNDU5VjUuODM1aDkuMzM1djQuOTU5WiIgZmlsbD0iIzZlNmU2ZSIvPgogIDxwYXRoIGlkPSJQYXRoXzE1NTIiIGRhdGEtbmFtZT0iUGF0aCAxNTUyIiBkPSJNMTcxLjU0MiwyNTZoMi45MTdhLjg3NS44NzUsMCwwLDEsLjg3NS44NzVoMGEuODc1Ljg3NSwwLDAsMS0uODc1Ljg3NWgtMi45MTdhLjg3NS44NzUsMCwwLDEtLjg3NS0uODc1aDBBLjg3NS44NzUsMCwwLDEsMTcxLjU0MiwyNTZaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTY1Ljk5OSAtMjQ4Ljk5OSkiIGZpbGw9IiM2ZTZlNmUiLz4KPC9zdmc+Cg=="},60518:(e,t,n)=>{n.d(t,{A:()=>i}),n(51609);const i="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMy4zMzMiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxMy4zMzMgMTYiPgogIDxwYXRoIGlkPSJkb2N1bWVudCIgZD0iTTEwLDQuNjY3Vi4zMDdhNC42NTEsNC42NTEsMCwwLDEsMS42NDMsMS4wNmwyLjMyMywyLjMyNGE0LjYzNiw0LjYzNiwwLDAsMSwxLjA2MSwxLjY0M2gtNC4zNkEuNjY3LjY2NywwLDAsMSwxMCw0LjY2N1pNMTUuMzMzLDYuOTl2NS42NzdBMy4zMzcsMy4zMzcsMCwwLDEsMTIsMTZINS4zMzNBMy4zMzcsMy4zMzcsMCwwLDEsMiwxMi42NjdWMy4zMzNBMy4zMzcsMy4zMzcsMCwwLDEsNS4zMzMsMGgzLjAxYy4xMDksMCwuMjE2LjAwOS4zMjMuMDE2VjQuNjY3YTIsMiwwLDAsMCwyLDJoNC42NTFjLjAwNy4xMDcuMDE2LjIxNS4wMTYuMzIzWk0xMCwxMi42NjdBLjY2Ny42NjcsMCwwLDAsOS4zMzMsMTJINmEuNjY3LjY2NywwLDAsMCwwLDEuMzMzSDkuMzMzQS42NjcuNjY3LDAsMCwwLDEwLDEyLjY2N1pNMTIsMTBhLjY2Ny42NjcsMCwwLDAtLjY2Ny0uNjY3SDZhLjY2Ny42NjcsMCwwLDAsMCwxLjMzM2g1LjMzM0EuNjY3LjY2NywwLDAsMCwxMiwxMFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yKSIgZmlsbD0iIzFiODNmYiIvPgo8L3N2Zz4K"},64197:(e,t,n)=>{n.d(t,{A:()=>i});const i=new(n(5054).E)},64943:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(9421),a=n(68360),l=n(90212);function s(e,t,n){const{data:s,isLoading:c,error:r,isError:N,isFetching:M,isSuccess:o,isRefetching:g}=(0,i.I)(e,async()=>{const e=await(0,a.A)(t,n?.parser||{});return n&&"function"==typeof n.afterLoadedData&&n.afterLoadedData(e),e},n?.queryConfig||{refetchOnWindowFocus:!1,keepPreviousData:!0,staleTime:1e4});return{data:r||c?null:s,isLoading:c,errorMessage:r?(0,l.A)(r?r?.data?.status:""):"",isError:!!N,isFetching:M,isSuccess:o,isRefetching:g}}},67076:(e,t,n)=>{n.d(t,{A:()=>i}),n(51609);const i="data:image/svg+xml;base64,PHN2ZyBpZD0iZG93bmxvYWQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEyIiBoZWlnaHQ9IjEyIiB2aWV3Qm94PSIwIDAgMTIgMTIiPgogIDxwYXRoIGlkPSJQYXRoXzE1NTYiIGRhdGEtbmFtZT0iUGF0aCAxNTU2IiBkPSJNMTEzLjEzNCw4Ljg0YTIuMjU1LDIuMjU1LDAsMCwwLDMuMTg1LDBoMGwxLjYwNy0xLjZhLjc1Ljc1LDAsMSwwLTEuMDQzLTEuMDc4bC0uMDE4LjAxOC0xLjM5MywxLjM4OUwxMTUuNDYxLjc0OUEuNzUuNzUsMCwwLDAsMTE0LjcxLDBoMGEuNzUuNzUsMCwwLDAtLjc1MS43NDlsLjAxLDYuODA2LTEuMzgyLTEuMzc5YS43NS43NSwwLDAsMC0xLjA2MSwxLjA1OVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDguNzEpIiBmaWxsPSIjNmU2ZTZlIi8+CiAgPHBhdGggaWQ9IlBhdGhfMTU1NyIgZGF0YS1uYW1lPSJQYXRoIDE1NTciIGQ9Ik0xMS4yNSwzMDkuMzMzYS43NS43NSwwLDAsMC0uNzUuNzQ5djIuMjkzYS4yLjIsMCwwLDEtLjIuMkgxLjdhLjIuMiwwLDAsMS0uMi0uMnYtMi4yOTNhLjc1Ljc1LDAsMCwwLTEuNSwwdjIuMjkzYTEuNzA2LDEuNzA2LDAsMCwwLDEuNywxLjdIMTAuM2ExLjcwNSwxLjcwNSwwLDAsMCwxLjctMS43di0yLjI5M0EuNzUuNzUsMCwwLDAsMTEuMjUsMzA5LjMzM1oiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwMi4wNzgpIiBmaWxsPSIjNmU2ZTZlIi8+Cjwvc3ZnPgo="},68357:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(51609),a=n(4286);function l({style:e}){const t={minHeight:"500px",maxHeight:"550px"};return e=e?{...t,...e}:t,(0,i.createElement)(a.vY,{style:e,className:"helpgent-content-loading"},(0,i.createElement)("span",{className:"helpgent-shimmer-effect"}),(0,i.createElement)("span",{className:"helpgent-shimmer-effect"}),(0,i.createElement)("span",{className:"helpgent-shimmer-effect"}))}},68360:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(1455),a=n.n(i);async function l(e,t){return await a()({path:e,...t}).then(e=>e).catch(e=>{throw e})}},71474:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(51609),a=n(65604),l=n(93832),s=n(92283),c=n(50481),r=n(86087),N=n(64943),M=n(6945),o=n(22057),g=n(35747),u=n(49615),L=n(30814),I=n(2192),p=n(23142),j=n(27723);function d({isArchiveAvailable:e,moduleState:t,setModuleState:n,queryClient:d,baseApiRoute:m,baseLinkRoute:z}){const{navigationHook:w,paramsHook:h,routeLink:D,routerNavLink:y}=(0,M.Xd)("helpgent_router_references",null),{id:T}=h(),{status:A,responseQueryKey:S,messageQueryKey:x,responseAgentQueryKey:C,formFetchingEnabled:Y}=t,E=w(),{data:k,isLoading:b,isError:O,errorMessage:v,isFetching:f}=(0,N.A)(["helpgent-response-form"],(0,l.addQueryArgs)(m?.responseForm,{form_id:T}),{queryConfig:{refetchOnWindowFocus:!0,keepPreviousData:!0,staleTime:1e4,enabled:Y}});O&&E(`${z}`),(0,r.useEffect)(()=>{k&&n(e=>({...e,formResponse:k.form}))},[k]);const U=k&&parseInt(k.form.total_response.completed)+parseInt(k.form.total_response.incompleted);return(0,i.createElement)("div",{className:"helpgent-sidebar__top"},(0,i.createElement)(D,{to:z,className:"helpgent-sidebar__back"},(0,i.createElement)(a.A,{src:o.A})," ",(0,j.__)("Back to all forms","helpgent")),(0,i.createElement)("div",{className:"helpgent-sidebar__content helpgent-d-flex helpgent-space-between"},(0,i.createElement)("div",{className:"helpgent-sidebar__element helpgent-d-flex"},k&&k.form.featured_image?(0,i.createElement)(c.A,{src:k?.form?.featured_image,alt:(0,j.__)("Helpgent Media","helpgent")}):(0,i.createElement)("span",{className:"helpgent-form-color-box",style:{backgroundColor:k&&k?.form?.color}}),(0,i.createElement)("span",{className:"helpgent-sidebar__element-title"},k&&k.form.title)),(0,i.createElement)("div",{className:"helpgent-sidebar__action"},(0,i.createElement)(D,{to:`${z}/${T}/edit`},(0,i.createElement)(a.A,{src:g.A})))),"archive"!==A&&(0,i.createElement)("div",{className:"helpgent-sidebar__navigation-wrap helpgent-d-flex"},(0,i.createElement)("div",{className:"helpgent-sidebar__navigation"},(0,i.createElement)(y,{to:`${z}/${T}/responses`,className:({isActive:e})=>e?"helpgent-active":""},(0,j.__)("Responses","helpgent")," (",U,")"),(0,i.createElement)(y,{to:`${z}/${T}/summary`,className:({isActive:e})=>e?"helpgent-active":""},(0,j.__)("Summary","helpgent"))),(0,i.createElement)("div",{className:"helpgent-sidebar__quick-action helpgent-d-flex"},(0,i.createElement)(D,{to:"#",className:"helpgent-sidebar__quick-action-link helpgent-sidebar__quick-action-refresh "+(f?"helpgent-sidebar__quick-action-refreshing":""),onClick:e=>function(e){e.preventDefault(),d.invalidateQueries([`helpgent-responses-${S}`]),d.invalidateQueries(["helpgent-response-form"]),d.invalidateQueries([`helpgent-${x}`]),d.invalidateQueries([`helpgent-${C}`])}(e)},(0,i.createElement)(a.A,{src:I.A})),e&&(0,i.createElement)("div",{className:"helpgent-sidebar__quick-action-link helpgent-sidebar__quick-action-dropdown"},(0,i.createElement)(s.A,{className:"helpgent-quick-action-dropdown",dropDownIcon:L.A,dropdownList:[{name:"archive",icon:u.A,text:(0,j.__)("Archive","helpgent")}],placement:"left",handleDropdownTrigger:function(e,i){e.preventDefault(),"archive"===i&&(n({...t,status:"archive",responseQueryKey:"archive"}),d.invalidateQueries([`helpgent-responses-${S}`]),d.invalidateQueries([`helpgent-${x}`]))},Link:D})))),"archive"===A&&e&&(0,i.createElement)("div",{className:"helpgent-sidebar__archive helpgent-d-flex"},(0,i.createElement)("span",{className:"helpgent-sidebar__archive-title"},(0,i.createElement)(a.A,{src:u.A}),(0,i.createElement)("span",null,(0,j.__)("Archive","helpgent"))),(0,i.createElement)("div",{className:"helpgent-sidebar__archive-remove",onClick:function(){n({...t,status:null,responseQueryKey:"all"}),d.invalidateQueries([`helpgent-responses-${S}`]),d.invalidateQueries([`helpgent-${x}`])}},(0,i.createElement)(a.A,{src:p.A}))))}},71899:(e,t,n)=>{n.d(t,{A:()=>i}),n(51609);const i="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGQ9Ik0zMDQgNDhhNDggNDggMCAxIDAgLTk2IDAgNDggNDggMCAxIDAgOTYgMHptMCA0MTZhNDggNDggMCAxIDAgLTk2IDAgNDggNDggMCAxIDAgOTYgMHpNNDggMzA0YTQ4IDQ4IDAgMSAwIDAtOTYgNDggNDggMCAxIDAgMCA5NnptNDY0LTQ4YTQ4IDQ4IDAgMSAwIC05NiAwIDQ4IDQ4IDAgMSAwIDk2IDB6TTE0Mi45IDQzN0E0OCA0OCAwIDEgMCA3NSAzNjkuMSA0OCA0OCAwIDEgMCAxNDIuOSA0Mzd6bTAtMjk0LjJBNDggNDggMCAxIDAgNzUgNzVhNDggNDggMCAxIDAgNjcuOSA2Ny45ek0zNjkuMSA0MzdBNDggNDggMCAxIDAgNDM3IDM2OS4xIDQ4IDQ4IDAgMSAwIDM2OS4xIDQzN3oiLz48L3N2Zz4K"},88141:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(51609),a=n(86087),l=n(65604),s=n(16622),c=n(67076),r=n(60518),N=n(5781),M=n(87855),o=n(6945),g=n(88887);const u=(0,a.forwardRef)((e,t)=>{const{file:n}=e;return(0,i.createElement)(g.bn,null,(0,i.createElement)("div",{className:"helpgent-file-upload-answer",ref:t||null},(0,i.createElement)("div",{className:"helpgent-file-upload-answer__info"},(0,i.createElement)("div",{className:"helpgent-file-upload-answer__media"},"picture"===s.O9[n?.mime_type]&&(0,i.createElement)("img",{src:n.url,alt:""}),"video"===s.O9[n?.mime_type]&&(0,i.createElement)("video",{src:n.url}),"voice"===s.O9[n?.mime_type]&&(0,i.createElement)(l.A,{src:N.A}),"pdf"===s.O9[n?.mime_type]&&(0,i.createElement)(l.A,{src:M.A}),"pdf"!==s.O9[n?.mime_type]&&"voice"!==s.O9[n?.mime_type]&&"video"!==s.O9[n?.mime_type]&&"picture"!==s.O9[n?.mime_type]&&(0,i.createElement)(l.A,{src:r.A})),(0,i.createElement)("div",{className:"helpgent-file-upload-answer__text"},(0,i.createElement)("span",{className:"helpgent-file-upload-answer__filename"},n?.title),(0,i.createElement)("span",{className:"helpgent-file-upload-answer__fileSize"},(0,o.w3)(n?.file_size)))),(0,i.createElement)("div",{className:"helpgent-file-upload-answer__action"},(0,i.createElement)("a",{href:n?.url,className:"helpgent-file-upload-answer__download"},(0,i.createElement)(l.A,{src:c.A,download:!0})))))})},88887:(e,t,n)=>{n.d(t,{$G:()=>s,CB:()=>r,Jp:()=>N,Yn:()=>c,bn:()=>M,x9:()=>a,zD:()=>l});var i=n(38267);const a=i.Ay.div`
    display: flex;
    flex-direction: column;
    position: relative;
    justify-content: space-between;
    height: 100%;
    .helpgent-summary-header{
        padding: 32px 40px;
        font-size: 22px;
        font-weight: 600;
        color: var(--helpgent-color-dark);
        border-bottom: 1px solid #ededed;
        @media only screen and (max-width: 757px){
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .helpgent-back-user-list{
            line-height: 0;
        }
    }
    .helpgent-summary-content{
        height: 500px;
        padding: 30px;
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        &::-webkit-scrollbar {
            width: 5px;
        }
        &::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }
        &::-webkit-scrollbar-thumb {
            background: var(--helpgent-color-bg-deep);
            transition: var(--helpgent-transition);
            border-radius: 3px;
        }
        &::-webkit-scrollbar-thumb:hover {
            background: var(--helpgent-color-primary);
        }
        .helpgent-summary__item{
            max-width: 650px;
            margin: 0 auto;
            .helpgent-conversation__top{
                align-items: center;
            }
            .helpgent-conversation__title{
                h4{
                    margin: 0;
                    font-size: 20px;
                    font-weight: 600;
                    line-height: 1.2;
                    color: var(--helpgent-color-dark);
                    p,
                    strong{
                        font-size: inherit;
                        font-weight: inherit;
                        margin: 0;
                    }
                }
            }
            .helpgent-summary-label{
                display: block;
                margin: 14px 0 20px;
                font-size: 14px;
                color: var(--helpgent-color-light-gray);

            }
            &:not(:last-child){
                margin-bottom: 60px;
            }
        }
    }
    .helpgent-summary__element-list{
        display: flex;
        flex-direction: column;
        max-height: 380px;
        padding-right: 20px;
        @media only screen and (max-width: 575px){
            width: 100%;
        }
        &.helpgent-progress-horizontal{
            height: auto;
            flex-direction: row;
            padding-right: 0;
        }
        .helpgent-passed-time{
            margin-top: 16px;
            span{
                display: block;
                font-weight: 400;
                font-size: 12px;
                color: var(--helpgent-color-light-gray);
            }
        }
        .helpgent-answer-text{
            &:not(:last-child){
                margin-bottom: 10px;
            }
        }
        .helpgent-answer-long_text,
        .helpgent-answer-short_text{
            p{
                font-size: 16px;
                color: var(--helpgent-color-gray);
                line-height: 1.625;
            }
        }
        &.helpgent-progress-horizontal{
            .helpgent-no-pagination-answer{
                width: 100%;
                .helpgent-bar-chart-wrapper{
                    display: flex;
                    align-items: flex-end;
                    justify-content: space-between;
                    gap: 21px;
                    max-width: 650px;
                    overflow-x: auto;
                    overflow-y: hidden;
                    padding-bottom: 20px;
                    &::-webkit-scrollbar {
                        height: 5px;
                    }
                    &::-webkit-scrollbar-track {
                        background: #f1f1f1;
                        border-radius: 3px;
                    }
                    &::-webkit-scrollbar-thumb {
                        background: var(--helpgent-color-bg-deep);
                        transition: var(--helpgent-transition);
                        border-radius: 3px;
                    }
                    &::-webkit-scrollbar-thumb:hover {
                        background: var(--helpgent-color-primary);
                    }
                }
                .helpgent-no-pagination-answer__average:empty{
                    display: none;
                }
                .helpgent-bar-chart{
                    flex: 1;
                    .helpgent-progress-bar-vertical{
                        width: 100%;
                        min-width: 40px;
                        height: 150px;
                        background: var(--helpgent-color-border-light);
                        border-radius: 4px;
                        display: flex;
                        align-items: flex-end;
                        overflow: hidden;
                        .helpgent-progress-bar__status{
                            width: 100%;
                            border-radius: 0 0 4px 4px;
                        }
                    }
                    .helpgent-bar-chart__statistics-percentage{
                        display: block;
                        text-align: center;
                        color: var(--helpgent-color-dark);
                        font-size: 14px;
                        font-weight: 500;
                        margin-bottom: 7px;
                        white-space: nowrap;
                    }
                    .helpgent-bar-chart__statistics-response-count{
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        gap: 5px;
                        margin-bottom: 7px;
                        span{
                            font-size: 12px;
                            color: var(--helpgent-color-light-gray);
                        }
                        svg{
                            width: 9px;
                            path{
                                fill: var(--helpgent-color-extra-light);
                            }
                        }
                    }
                    .helpgent-bar-chart__count{
                        font-size: 14px;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        gap: 10px;
                        color: var(--helpgent-color-gray);
                        margin-top: 9px;
                        svg{
                            width: 12px;
                            path{
                                fill: var(--helpgent-color-light-gray);
                            }
                        }
                    }
                }
                .helpgent-no-pagination-answer__progress-text{
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    span{
                        font-size: 14px;
                        color: var(--helpgent-color-light-gray);
                    }
                }
            }
        }
        .helpgent-info-answer-content,
        .helpgent-open-ended-answer-content{
            &:not(:last-child){
                margin-bottom: 10px;
            }
        }

        .helpgent-progress-single{
            &:not(:last-child){
                margin-bottom: 24px;
            }
            &--image{
                display: flex;
                align-items: center;
            }
            .helpgent-progress-single__info{
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin-bottom: 12px;
            }
            .helpgent-progress-single__label{
                font-size: 14px;
                font-weight: 500;
                color: var(--helpgent-color-gray);
            }
            .helpgent-progress-single__statistics{
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 25px;
                width: 195px;
                .helpgent-progress-single__statistics-response-count{
                    display: flex;
                    align-items: center;
                    gap: 7px;
                    svg {
                        width: 9px;
                        path{
                            fill: var(--helpgent-color-extra-light);
                        }
                    }
                    font-size: 13px;
                    color: var(--helpgent-color-light-gray);
                }
                .helpgent-progress-single__statistics-percentage{
                    font-size: 14px;
                    font-weight: 500;
                    color: var(--helpgent-color-dark);
                }
            }
            .helpgent-progress-bar-horizontal{
                height: 15px;
                border-radius: 4px;
                overflow: hidden;
                .helpgent-progress-bar__status{
                    border-radius: 4px 0 0 4px;
                }
            }
            .helpgent-progress-single__contents{
                flex: 1;
            }
            .helpgent-progress-single__img{
                width: 50px;
                height: 50px;
                margin-right: 15px;
                flex: none;
                img{
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    border-radius: 10px;
                }
            }
        }
        .helpgent-map-summary-wrapper{
            width: 650px;
            height: 344px;
            border-radius: 16px;
        }
    }
    .helpgent-conversation__icon{
        position: relative;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        margin-right: 14px;
        background-color: var(--helpgent-color-primary);
        flex: none;
        svg{
            width: 16px;
            height: 16px;
            path{
                fill: var(--helpgent-color-white);
            }
        }
    }

    .helpgent-summery-pro{
        font-size: 14px;
        font-weight: 500;
        padding: 8px 15px;
        border-radius: 10px;
        width: fit-content;
        color: var(--helpgent-color-success);
        background-color: var(--helpgent-color-bg-badge-success)
    }
`,l=i.Ay.div`
    padding: 15px 20px;
    border-radius: 14px;
    background-color: var(--helpgent-color-bg-light);
    &.helpgent-answer-long_text{
        font-size: 16px;
        padding: 20px;
    }
    &.helpgent-answer-date,
    &.helpgent-answer-number,
    &.helpgent-answer-email{
        border-radius: 10px;
    }
    p{
        font-size: 14px;
        font-weight: 400;
        line-height: 1.5;
        margin: 0;
        color: var(--helpgent-color-gray);
    }
    .helpgent-answer__inline-icon{
        display: flex;
        align-items: center;
        svg{
            margin-right: 10px;
            path{
                fill: var(--helpgent-color-extra-light);
            }
        }
        p{
            font-size: 14px;
            font-weight: 500;
            margin: 0;
            color: var(--helpgent-color-dark);
        }
    }
    .helpgent-answer__highlight-text{
        font-size: 14px;
        font-weight: 500;
        color: var(--helpgent-color-dark);
        word-break: break-word;
        word-wrap: break-word;
    }
    &.helpgent-answer-text{
        a{
            font-size: 14px;
            font-weight: 400;
            transition: .3s;
            color: var(--helpgent-color-dark);
            &:hover{
                color: var(--helpgent-color-info);
            }
        }

        p{
            max-height: 80px;
            overflow-y: auto;
            white-space: pre-wrap;
            word-wrap: break-word;
            word-break: break-word;
        }
    }
`,s=i.Ay.div`

`,c=i.Ay.div`
    padding: 20px;
    border-radius: 12px;
    background-color: var(--helpgent-color-bg-light);
    .helpgent-info-answer{
        display: flex;
        @media only screen and (max-width: 480px){
            flex-wrap: wrap;
        }
        &:not(:last-child){
            margin-bottom: 8px;
        }
        .helpgent-info-answer__label{
            font-size: 14px;
            font-weight: 400;
            min-width: 185px;
            text-transform: capitalize;
            color: var(--helpgent-color-light-gray);
            @media only screen and (max-width: 575px){
                min-width: 150px;
            }
            @media only screen and (max-width: 480px){
                min-width: 100%;
            }
        }
        .helpgent-info-answer__text{
            font-size: 14px;
            font-weight: 500;
            color: var(--helpgent-color-dark);
        }
        .helpgent-open-end-file{
            display: flex;
            align-items: center;
        }
        .helpgent-file-name{
            font-size: 14px;
            word-break: break-word;
            flex: 1;
            margin: 0 20px 0 8px;
        }
        .helpgent-file-download{
            display: flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: 7px;
            background-color: var(--helpgent-color-white);
            &:hover{
                svg{
                    path{
                        fill: var(--helpgent-color-white);
                    }
                }
                background-color: var(--helpgent-color-primary);
            }
        }
        .helpgent-file-icon{
            line-height: 1;
            svg{
                width: 16px;
                height: 16px;
                path{
                    fill: var(--helpgent-color-extra-light);
                }
            }
        }
    }
`,r=i.Ay.div`
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    background-color: var(--helpgent-color-bg-light);
    .helpgent-open-ended-answer__voice{
        flex: 1;
        align-items: center;
        padding: 8px 10px;
        border-radius: 10px;
        background-color: var(--helpgent-color-white);
        .helpgent-open-ended-answer__toggle{
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--helpgent-color-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 10px;
            border: 2px solid transparent;
            svg{
                width: 10px;
                height: 10px;
                path{
                    fill: #fff;
                }
            }
            &--playing{
                background: transparent;
                border: 2px solid var(--helpgent-color-primary);
                svg{
                    path{
                        fill: var(--helpgent-color-primary);
                    }
                }
            }
        }
        .helpgent-open-ended-answer__time{
            span{
                font-size: 13px;
                font-weight: 500;
                color: var(--helpgent-color-gray);
            }
        }
    }
    .helpgent-audio-range{
        flex: 1;
    }
    .helpgent-open-ended-answer{
        justify-content: space-between;
        align-items: center;
        gap: 20px;
        .helpgent-open-ended-answer__download,
        .helpgent-video-conversation__download{
            width: 28px;
            height: 28px;
            background: #fff;
            border-radius: 7px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--helpgent-transition);
            margin-right: 3px;
            svg{
                width: 12px;
                height: 12px;
                transition: var(--helpgent-transition);
            }
            &:hover{
                background: var(--helpgent-color-primary);
                svg path{
                    fill: #fff;
                }
            }
        }
    }
    .helpgent-open-ended-answer__video{
        display: flex;
        align-items: center;
        gap: 16px;
    }
    .helpgent-open-ended-answer__video-inner{
        width: 100px;
        height: 70px;
        position: relative;
        &:before{
            position: absolute;
            content: '';
            width: 100%;
            height: 100%;
            left: 0;
            top: 0;
            background: rgba(0,0,0,0.6);
            visibility: hidden;
            opacity: 0;
            transition: var(--helpgent-transition);
            z-index: 1;
            border-radius: 10px;
        }
        video{
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 10px;
        }
        .helpgent-video-conversation__toggle{
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            visibility: hidden;
            opacity: 0;
            transition: var(--helpgent-transition);
            z-index: 2;
            svg{
                width: 10px;
                height: 10px;
                path{
                    fill: var(--helpgent-color-primary);
                }
            }
        }
        &:hover{
            &:before,
            .helpgent-video-conversation__toggle{
                visibility: visible;
                opacity: 1;
            }
        }
    }
    .helpgent-open-ended-answer__video-info{
        span{
            display: flex;
            &:first-child{
                font-size: 14px;
                font-weight: 500;
                color: var(--helpgent-color-gray);
            }
            &:last-child{
                font-size: 11px;
                color: var(--helpgent-color-light-gray);
            }
        }
    }
`,N=i.Ay.div`

`,M=i.Ay.div`
    padding: 10px 15px;
    background-color: var(--helpgent-color-bg-light);
    border-radius: 10px;
    &:not(:last-child){
        margin-bottom: 10px;
    }
    .helpgent-file-upload-answer{
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
        .helpgent-file-upload-answer__download{
            width: 28px;
            height: 28px;
            background: #fff;
            border-radius: 7px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--helpgent-transition);
            margin-right: 3px;
            svg{
                width: 12px;
                height: 12px;
                transition: var(--helpgent-transition);
            }
            &:hover{
                background: var(--helpgent-color-primary);
                svg path{
                    fill: #fff;
                }
            }
        }
        .helpgent-file-upload-answer__info{
            display: flex;
            align-items: center;
            gap: 12px;
            .helpgent-file-upload-answer__media{
                min-width: 40px;
                display: flex;
                align-items: center;
                justify-content: center;
                video,
                img{
                    width: 40px;
                    height: 40px;
                    border-radius: 8px;
                    object-fit: cover;
                }
                svg{
                    width: 40px;
                    height: 40px;
                    path{
                        fill: var(--helpgent-color-extra-light);
                    }
                }
            }
            .helpgent-file-upload-answer__text{
                span{
                    display: block;
                }
                .helpgent-file-upload-answer__filename{
                    font-size: 14px;
                    color: var(--helpgent-color-dark);
                    margin-bottom: 2px;
                }
                .helpgent-file-upload-answer__fileSize{
                    font-size: 11px;
                    color: var(--helpgent-color-light-gray);
                }
            }
        }
    }

`},90212:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(27723);function a(e){let t="";switch(e){case 404:t=(0,i.__)("Resource not found","helpgent");break;case 400:t=(0,i.__)("Invalid Request","helpgent");break;case 422:t=(0,i.__)("Invalid data","helpgent");break;case 500:t=(0,i.__)("Internal server error","helpgent");break;default:t=(0,i.__)("Technical error","helpgent")}return t}},92283:(e,t,n)=>{n.d(t,{A:()=>M});var i=n(51609),a=n(86087),l=n(65604),s=n(27716),c=n(5591),r=n(74618),N=n(71899);function M({className:e,dropDownText:t,dropDownIcon:n,dropdownList:M,placement:o,handleDropdownTrigger:g,Link:u,tooltipText:L,customItem:I,topPosition:p}){M=Array.isArray(M)?M.map(e=>({...e,isLoading:!1})):[];const j=(0,a.useRef)(null),[d,m]=(0,a.useState)(M),[z,w]=(0,a.useState)(!1),h=`helpgent-dropdown ${z?"helpgent-dropdown-open ":""}${e&&e} helpgent-dropdown-${o}`;function D(e,t,n){return e.map((e,i)=>i!==t?e:{...e,...n})}return(0,r.A)(".helpgent-dropdown-open",".helpgent-dropdown__content",40),(0,a.useEffect)(()=>{(0,s.A)(z,w,j)},[z]),(0,i.createElement)("div",{className:h,ref:j},(0,i.createElement)("a",{href:"#",className:"helpgent-dropdown__toggle helpgent-dropdown__toggle-icon-only",onClick:function(e){e.preventDefault(),w(!z),(0,c.A)(e,".helpgent-dropdown",".helpgent-dropdown__content",null,p||40,!1,"right")},"data-tooltip":""!==L?L:""},t||null,n?(0,i.createElement)("span",{className:"helpgent-dropdown-icon"},(0,i.createElement)(l.A,{src:n})):null),(0,i.createElement)("ul",{className:z?"helpgent-dropdown__content helpgent-show":"helpgent-dropdown__content"},(0,i.createElement)("li",null,I),d&&d.map((e,t)=>{let n=null;return n="blank"===e.target&&e.url?e.url:"blank"!==e.target&&e.url?`/${e.url}`:"#",(0,i.createElement)("li",{key:t},u?(0,i.createElement)(u,{to:n,onClick:async i=>{if("#"!==n)return void w(!1);if(e.isLoading)return;let a=D(d,t,{isLoading:!0});m(a),await g(i,e.name),a=D(a,t,{isLoading:!1}),m(a),w(!1)},className:e.className?e.className:"",target:"blank"===e.target?"_blank":null},e.isLoading||e.icon?(0,i.createElement)("span",{className:"helpgent-dropdown-item-icon"+(e.isLoading?" helpgent-animate-spin":"")},(0,i.createElement)(l.A,{src:e.isLoading?N.A:e.icon})):"",e.text):(0,i.createElement)("a",{href:n,onClick:t=>"#"===n&&(w(!1),g(t,e.name)),className:e.className?e.className:"",target:"blank"===e.target?"_blank":null},e.icon?(0,i.createElement)("span",{className:"helpgent-dropdown-item-icon"},(0,i.createElement)(l.A,{src:e.icon})):"",e.text))})))}},96870:(e,t,n)=>{n.d(t,{A:()=>M});var i=n(51609),a=n(86087),l=n(65604),s=n(16622),c=n(67076),r=n(60518),N=n(88887);const M=(0,a.forwardRef)((e,t)=>{const{answer:n,labels:a}=e;return(0,i.createElement)(N.Yn,{className:"helpgent-info-answer-content helpgent-open-ended-answer-content"},(0,i.createElement)("div",{className:"helpgent-info-answer-wrap",ref:t||null},Object.entries(null!=a?a:{}).map((e,t)=>{if(n?.[e[0]])return(0,i.createElement)("div",{className:"helpgent-info-answer",key:t},(0,i.createElement)("div",{className:"helpgent-info-answer__label"},e[1]),"file"===e[0]?(0,i.createElement)("div",{className:"helpgent-open-end-file"},(0,i.createElement)("span",{className:"helpgent-file-icon"},(0,i.createElement)(l.A,{src:s.de[n.attachment&&n.attachment.mime_type]||r.A})),(0,i.createElement)("span",{className:"helpgent-file-name"},n.attachment&&n.attachment.title),(0,i.createElement)("a",{href:n.attachment&&n.attachment.url,className:"helpgent-file-download",download:!0},(0,i.createElement)(l.A,{src:c.A}))):(0,i.createElement)("div",{className:"helpgent-info-answer__text"},n[e[0]]))})))})}}]);