"use strict";(globalThis.webpackChunkhelpgent=globalThis.webpackChunkhelpgent||[]).push([[844],{2192:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8ZyBpZD0icm90YXRlLXJpZ2h0IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMS4xNTIgMCkiPgogICAgPHBhdGggaWQ9IlBhdGhfMTIyOSIgZGF0YS1uYW1lPSJQYXRoIDEyMjkiIGQ9Ik0xNi4xNDUsNy45OTJhMS4wMTQsMS4wMTQsMCwwLDAtMSwuODgxLDYuMDIsNi4wMiwwLDEsMS0yLjA1NS01LjQ0M2wtLjc1OC43NTRhLjY2Ny42NjcsMCwwLDAsLjQ3NiwxLjEzOWgzLjA3NGEuNjY5LjY2OSwwLDAsMCwuNjctLjY2N1YxLjU5NWEuNjcxLjY3MSwwLDAsMC0xLjE0NC0uNDcybC0uODkzLjg4OWE4LjA2Miw4LjA2MiwwLDAsMC0xMS4zNDQuNjgzLDcuOTc1LDcuOTc1LDAsMCwwLC42ODYsMTEuMjkzLDguMDM4LDguMDM4LDAsMCwwLDEzLjI4LTQuODI1LDEuMDE0LDEuMDE0LDAsMCwwLS45OTQtMS4xN1oiIGZpbGw9IiNhMmEyYTIiLz4KICA8L2c+Cjwvc3ZnPgo="},8748:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(51609),i=n(86087),r=n(20533),o=n(35629);const l=function({isOpen:e,className:t,onClose:n,position:l="left",clearDomAfterClosed:s=!0,isBackDropActive:c=!0,children:p}){const g=(0,i.useRef)(document.querySelector("body")),d=(0,i.useRef)(document.getElementById("helpgent-drawer")||function(){const e=document.createElement("div");return e.setAttribute("id","helpgent-drawer"),e}()),h=(0,r.A)(e,300);return(0,i.useEffect)(()=>(g.current.appendChild(d.current),()=>{d.current.remove(),g.current.style.overflow=""}),[]),(0,i.useEffect)(()=>{if(e){g.current.style.overflow="hidden";const e=sessionStorage.getItem("isFullscreenActive");if(null===e)return;const t=document.querySelector(".helpgent-drawer-content");"1"===e?t.classList.add("helpgent-drawer-content--top-none"):t.classList.remove("helpgent-drawer-content--top-none")}else g.current.style.overflow=""},[e]),h||!s||e?(0,i.createPortal)((0,a.createElement)(o.H,{"aria-hidden":!e,className:`${t} ${e?"helpgent-drawer-active":""} ${h?"helpgent-in":""}`},(0,a.createElement)("div",{className:`helpgent-drawer-content helpgent-drawer-${l}`,role:"dialog"},p),c&&(0,a.createElement)("div",{className:"helpgent-drawer-backdrop",onClick:n})),d.current):null}},10155:(e,t,n)=>{n.d(t,{BT:()=>o,jD:()=>i,oF:()=>r,yY:()=>l});var a=n(38267);const i=a.Ay.div`
    display: flex;
    justify-content: center;
    align-items: center;
    &.helpgent-permission-modal{
        width: auto;
        padding: 0;
    }
    .helpgent-media-preview{
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        height: calc(100vh - 160px);
    }
`,r=a.Ay.div`
    position: relative;
    padding-top: 52.54%;
    width: 100%;

    .helpgent-video-recorder-wrap {
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        left: 0;
    }

    .helpgent-video-recorder-container {
        position: relative;
        height: 100%;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
        background: var(--helpgent-color-dark);
        border-radius: 30px;
        &.helpgent-record-screen{
            .helpgent-sec{
                font-size: 50px;
                font-weight: 500;
                color: var(--helpgent-color-text);
            }
        }
        &.helpgent-record-audio--start{
            .helpgent-record-btn{
                position: relative;
                background-color: transparent;
                &:after{
                    position: absolute;
                    width: 30px;
                    height: 30px;
                    left: 50%;
                    top: 50%;
                    border-radius: 8px;
                    content: "";
                    background-color: rgb(252, 73, 93);
                    transform: translate(-50%, -50%);
                }
                svg{
                    display: none;
                }
            }
        }
        &.helpgent-video-recorder{
            position: relative;
            &:after,
            &:before{
                position: absolute;
                left: 0px;
                top: 0px;
                width: 100%;
                height: 20%;
                content: "";
                z-index: 1;
                opacity: 0.8;
                background-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgb(0, 0, 0));
            }
            &:before{
                top: auto;
                bottom: 0px;
                border-radius: 0px 0px 23px 23px;
                opacity: 0.6;
                background-image: linear-gradient(rgba(0, 0, 0, 0), rgb(0, 0, 0));
            }
            video{
                position: absolute;
                width: 100%;
                height: 100%;
                border-radius: 25px;
                object-fit: cover;
                inset: 0px;
            }
            .helpgent-video-recorder-countdown-container {
                position: absolute;
                width: 100%;
                height: 100%;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                .helpgent-countdown-timer {
                    color: #ffffff;
                }
            }
            .helpgent-timer{
                position: absolute;
                display: block;
                top: 20px;
                left: 65px;
                z-index: 2;
                .helpgent-sec{
                    font-size: 20px;
                    color: var(--helpgent-color-white);
                    font-family: var(--font-family);
                }
            }
            .helpgent-record-action{
                position: relative;
                margin: auto 0 calc(var(--helpgent-bottom-extras-height) + 20px);
                padding: 0;
                z-index: 101;
                &.helpgent-record-start{
                    .helpgent-record-btn{
                        &::after{
                            width: 30px;
                            height: 30px;
                            border-radius: 6px;
                        }
                    }
                }
            }
            .helpgent-record-btn{
                position: relative;
                display: block;
                width: 70px;
                height: 70px;
                margin: 0px auto;
                border-radius: 50%;
                border: 5px solid var(--helpgent-color-white);
                background-color: var(--helpgent-color-white);
                &:after{
                    position: absolute;
                    left: 50%;
                    top: 50%;
                    transform: translate(-50%, -50%);
                    width: calc(100%);
                    height: calc(100%);
                    border-radius: 50%;
                    content: "";
                    z-index: 101;
                    transition-property: width, height, border-radius;
                    transition-duration: 0.2s;
                    transition-timing-function: ease-in;
                    background-color: rgb(252, 73, 93);
                }
            }
        }
        .helpgent-btn-back{
            position: absolute;
            left: 15px;
            top: 15px;
            z-index: 99;
        }
        .helpgent-timer{
            &.helpgent-timer-start{
                .helpgent-sec{
                    color: rgb(252, 73, 93);
                }
            }
            .helpgent-sec{
                font-size: 50px;
                font-weight: 500;
                color: var(--helpgent-color-text)
            }
        }

        .helpgent-record-action{
            padding-top: 200px;
        }
        .helpgent-record-action-inner{
            position: relative;
        }
        .helpgent-record-btn{
            display: flex;
            align-items: center;
            justify-content: center;
            width: 110px;
            height: 110px;
            margin: 0px auto;
            border-radius: 50%;
            transition: background-color 0.3s ease-in-out 0s;
            background-color: rgb(252, 73, 93);
            border: 2px solid rgb(252, 73, 93);
            &:hover{
                color: rgb(252, 73, 93);
                background-color: rgb(255, 255, 255);
                svg{
                    path{
                        fill: rgb(252, 73, 93);
                    }
                }
            }
            svg{
                width: 36px;
                height: 36px;
                path{
                    fill: var(--helpgent-color-white);
                }
            }
        }
        .helpgent-btn-record-right{
            display: flex;
            justify-content: center;
            align-items: center;
            width: 55px;
            height: 55px;
            position: absolute;
            right: 30px;
            top: 50%;
            transform: translateY(-50%);
            border-radius: 50%;
            background-color: rgb(180, 180, 180);
            border: 2px solid transparent;
            text-decoration: none;
            transition: background-color 0.3s ease-in-out 0s;
            color: var(--helpgent-color-white);
            svg{
                width: 20px;
                height: 20px;
                path{
                    fill: var(--helpgent-color-white);
                }
            }
            &:hover{
                background-color: transparent;
                border-color: rgb(180, 180, 180);
                svg{
                    path{
                        fill: rgb(180, 180, 180);
                    }
                }
            }
        }
    }
`,o=a.Ay.div`
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 25px 25px;
    height: 100%;
    max-width: 300px;
    background-color: #fff;
    border-radius: 20px;
    .helpgent-permission-title {
        font-size: 18px;
        font-weight: 500;
        margin: 0px 0px 30px;
        font-family: var(--font-family);
    }

    img {
        width: 100%;
        max-width: 370px;
        margin-bottom: 26px;
    }

    .helpgent-text-right {
        text-align: right;
    }

    .helpgent-header-action {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        margin-bottom: 15px;
    }

    .helpgent-header-action-item {
        flex-grow: 1;
    }

    .helpgent-action-icon {
        padding: 5px;
        outline: none;
        box-shadow: none;
        &:active, &:focus {
            outline: none;
            box-shadow: none;
        }
        svg {
            width: 15px;
            height: 15px;

            path {
                fill: #2188ff;
            }
        }
    }

    .helpgent-btn {
        justify-content: center;
    }
`,l=a.Ay.div`
    display: block;
    .helpgent-video-recorder-container-area {
        width: calc( 80vw - 40px );

        @media only screen and (max-width: 1400px) {
            width: calc( 80vw - 20px );
        }

        @media only screen and (max-width: 1200px) {
            width: calc( 90vw - 20px );
        }

        @media only screen and (max-width: 992px) {
            width: calc( 100vw - 20px );
        }

        @media only screen and (max-width: 768px) {
            width: calc( 100vw - 40px );
        }

        @media only screen and (max-width: 576px) {
            width: calc( 100vw - 20px );
        }
    }

    .helpgent-media-preview-container {
        width: calc( 70vw - 40px );

        @media only screen and (max-width: 1400px) {
            width: calc( 80vw - 20px );
        }

        @media only screen and (max-width: 1200px) {
            width: calc( 90vw - 20px );
        }

        @media only screen and (max-width: 992px) {
            width: calc( 100vw - 20px );
        }

        @media only screen and (max-width: 768px) {
            width: calc( 100vw - 40px );
        }

        @media only screen and (max-width: 576px) {
            width: calc( 100vw - 20px );
        }
    }
`},10426:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(63064);function i(){const e=(0,a.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:()=>l});var a=n(14426),i=n(68360),r=n(90212),o=n(93832);function l(e,t,n,l){const{data:s,isSuccess:c,isRefetching:p,hasNextPage:g,fetchNextPage:d,isFetchingNextPage:h,error:u,isLoading:m}=(0,a.q)(e,({pageParam:e=1})=>(0,i.A)((0,o.addQueryArgs)(t,{page:e})),{getNextPageParam:(e,t)=>e.length===n?t.length+1:void 0,...l});return{data:u||!c?null:s,isSuccess:c,isRefetching:p,hasNextPage:g,fetchNextPage:d,isFetchingNextPage:h,isLoading:m,error:u,errorMessage:u?(0,r.A)(null!=u?u:u.data.status):"",isError:!!u}}},14426:(e,t,n)=>{n.d(t,{q:()=>s});var a=n(12295),i=n(1522),r=n(97502);class o extends i.${constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:(0,r.PL)()},t)}getOptimisticResult(e){return e.behavior=(0,r.PL)(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...t}={}){return this.fetch({...t,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...t}={}){return this.fetch({...t,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,t){var n,a,i,o,l,s;const{state:c}=e,p=super.createResult(e,t),{isFetching:g,isRefetching:d}=p,h=g&&"forward"===(null==(n=c.fetchMeta)||null==(a=n.fetchMore)?void 0:a.direction),u=g&&"backward"===(null==(i=c.fetchMeta)||null==(o=i.fetchMore)?void 0:o.direction);return{...p,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,r.rB)(t,null==(l=c.data)?void 0:l.pages),hasPreviousPage:(0,r.RQ)(t,null==(s=c.data)?void 0:s.pages),isFetchingNextPage:h,isFetchingPreviousPage:u,isRefetching:d&&!h&&!u}}}var l=n(58024);function s(e,t,n){const i=(0,a.vh)(e,t,n);return(0,l.t)(i,o)}},14971:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMy41MSIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDEzLjUxIDE0Ij4KICA8ZyBpZD0iR3JvdXBfMjk5OSIgZGF0YS1uYW1lPSJHcm91cCAyOTk5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjAwMikiPgogICAgPHBhdGggaWQ9IlBhdGhfMTU4OSIgZGF0YS1uYW1lPSJQYXRoIDE1ODkiIGQ9Ik0uODU1LDQuMzE5SDYuOTk0YTMuMzQ2LDMuMzQ2LDAsMCwwLDMuMiwyLjU0NSwzLjM3OCwzLjM3OCwwLDAsMCwzLjMxMy0zLjQzMkEzLjM3NywzLjM3NywwLDAsMCwxMC4xOTQsMGEzLjM0NSwzLjM0NSwwLDAsMC0zLjIsMi41NDZILjg1NWEuODg3Ljg4NywwLDAsMCwwLDEuNzczWk04LjU5NCwzLjQzYTEuNiwxLjYsMCwxLDEsMy4yLDAsMS42LDEuNiwwLDEsMS0zLjIsMFoiIGZpbGw9IiMzYzNjM2MiLz4KICAgIDxwYXRoIGlkPSJQYXRoXzE1OTAiIGRhdGEtbmFtZT0iUGF0aCAxNTkwIiBkPSJNMTIuNjUsOS42ODFINi41MTNhMy4zNDYsMy4zNDYsMCwwLDAtMy4yLTIuNTQ1aDBhMy40MzUsMy40MzUsMCwwLDAsMCw2Ljg2NSwzLjM0NywzLjM0NywwLDAsMCwzLjItMi41NDZIMTIuNjVhLjg4Ny44ODcsMCwwLDAsMC0xLjc3M1pNMy4zMTMsMTIuMjI3YTEuNjYsMS42NiwwLDAsMSwwLTMuMzE4LDEuNjYsMS42NiwwLDAsMSwwLDMuMzE4WiIgZmlsbD0iIzNjM2MzYyIvPgogIDwvZz4KPC9zdmc+Cg=="},17955:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(51609),i=n(92609),r=n(91636);const o="data:image/svg+xml;base64, ";function l(e){const{audioCurrentTime:t,audioDuration:n,audioPaused:l}=e;function s(){const e=t/n;return isNaN(e)?0:100*e}return(0,a.createElement)("span",{className:"helpgent-audio-range"},(0,a.createElement)("span",{style:{display:"block",position:"relative",margin:"5px",width:"100%",height:"20px"}},(0,a.createElement)("span",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"inline-block",backgroundPositionX:"0px",backgroundRepeat:"no-repeat",backgroundImage:"url( "+r.A+" )",zIndex:0}}),l&&100!==s()?(0,a.createElement)("span",{style:{width:s()+"%",position:"absolute",left:0,right:0,top:0,bottom:0,display:"inline-block",backgroundPositionX:"0px",backgroundRepeat:"no-repeat",backgroundImage:"url( "+i.A+" )",zIndex:1,transition:"all 300ms ease-in-out 0s"}}):(0,a.createElement)("span",{style:{width:s()+"%",position:"absolute",left:0,right:0,top:0,bottom:0,display:"inline-block",backgroundPositionX:"0px",backgroundRepeat:"no-repeat",backgroundImage:"url( "+o+" )",zIndex:1,transition:"all 300ms ease-in-out 0s"}})))}},20533:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(51609);const i=(e,t)=>{const[n,i]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let a;return e&&!n?i(!0):!e&&n&&(a=setTimeout(()=>i(!1),t)),()=>{clearTimeout(a)}},[t,e,n]),n}},20978:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMjAgNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMS4yIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMjcyIDYzLjFsLTMyIDBjLTI2LjUxIDAtNDggMjEuNDktNDggNDcuMXYyODhjMCAyNi41MSAyMS40OSA0OCA0OCA0OEwyNzIgNDQ4YzI2LjUxIDAgNDgtMjEuNDkgNDgtNDh2LTI4OEMzMjAgODUuNDkgMjk4LjUgNjMuMSAyNzIgNjMuMXpNODAgNjMuMWwtMzIgMGMtMjYuNTEgMC00OCAyMS40OS00OCA0OHYyODhDMCA0MjYuNSAyMS40OSA0NDggNDggNDQ4bDMyIDBjMjYuNTEgMCA0OC0yMS40OSA0OC00OHYtMjg4QzEyOCA4NS40OSAxMDYuNSA2My4xIDgwIDYzLjF6Ii8+PC9zdmc+"},28029:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(51609),i=n(86087),r=n(65604),o=n(67076),l=n(33410),s=n(20978),c=n(88887),p=n(6945),g=n(27723);const d=(0,i.forwardRef)((e,t)=>{const{type:n,file:d}=e,h=(0,i.useRef)(),[u,m]=(0,i.useState)(!1);return(0,a.createElement)(c.CB,{className:"helpgent-open-ended-answer-content"},(0,a.createElement)("div",{className:"helpgent-open-ended-answer helpgent-d-flex",ref:t||null},(0,a.createElement)("div",{className:"helpgent-open-ended-answer__video"},(0,a.createElement)("div",{className:"helpgent-open-ended-answer__video-inner"},(0,a.createElement)("video",{ref:h,src:d.url,preload:"auto",onPlay:()=>{m(!0)},onPause:()=>{m(!1)},playsInline:!0}),(0,a.createElement)("a",{href:"#",className:"helpgent-video-conversation__toggle",onClick:e=>{e.preventDefault(),h.current&&(h.current.paused?(m(!0),h.current.play()):(h.current.pause(),m(!1)))}},u?(0,a.createElement)(r.A,{src:s.A}):(0,a.createElement)(r.A,{src:l.A}))),(0,a.createElement)("div",{className:"helpgent-open-ended-answer__video-info"},"open_ended_video"===n?(0,a.createElement)("span",null,(0,g.__)("Video Record","helpgent")):(0,a.createElement)("span",null,(0,g.__)("Screen Record","helpgent")),(0,a.createElement)("span",null,(0,p.w3)(d.file_size)))),u?null:(0,a.createElement)("a",{href:d.url,className:"helpgent-video-conversation__download",download:!0},(0,a.createElement)(r.A,{src:o.A}))))})},29016:(e,t,n)=>{n.d(t,{d:()=>i});var a=n(86087);function i(e,t){const[n,i]=(0,a.useState)(e);return(0,a.useEffect)(()=>{const n=setTimeout(()=>{i(e)},t);return()=>clearTimeout(n)},[e,t]),n}},30814:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzLjExMSIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDMuMTExIDE0Ij4KICA8cGF0aCBpZD0iZWxsaXBzaXMtaCIgZD0iTTEwLDEwYTEuNTU2LDEuNTU2LDAsMSwwLDEuNTU2LDEuNTU2QTEuNTU2LDEuNTU2LDAsMCwwLDEwLDEwWk00LjU1NiwxMGExLjU1NiwxLjU1NiwwLDEsMCwxLjU1NiwxLjU1NkExLjU1NiwxLjU1NiwwLDAsMCw0LjU1NiwxMFptMTAuODg5LDBBMS41NTYsMS41NTYsMCwxLDAsMTcsMTEuNTU2LDEuNTU2LDEuNTU2LDAsMCwwLDE1LjQ0NCwxMFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMCAxNykgcm90YXRlKC05MCkiIGZpbGw9IiNhMmEyYTIiLz4KPC9zdmc+Cg=="},33764:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(51609),i=n(86087),r=n(65604),o=n(44220),l=n(88887),s=n(46958),c=n(87446),p=n(27723),g=n(6945);function d({time:e}){const t=(0,g.fU)(e);if(!t)return"";const n=t.data&&t.data.timezone?t.data.timezone:"";return(0,a.createElement)("span",{className:"helpgent-time"},t.formattedTime,n?(0,a.createElement)("span",{className:"helpgent-text-muted helpgent-ml-5"},"(",n,")"):"")}const h=(0,i.forwardRef)((e,t)=>{const{conversationType:n,elementType:i,textContent:g,passedTime:h,form:u}=e;let m=null;if(g){const e=(0,o.A)(g),l={ref:t||null};"message"===n?m=(0,a.createElement)("p",{dangerouslySetInnerHTML:{__html:e},className:"helpgent-scrollbar-style"}):"answer"===n&&(m="long_text"===i||"short_text"===i?(0,a.createElement)("p",{dangerouslySetInnerHTML:{__html:e},className:"helpgent-scrollbar-style"}):"date"===i?(0,a.createElement)("div",{className:"helpgent-answer__inline-icon"},(0,a.createElement)(r.A,{src:s.A}),(0,a.createElement)("p",{dangerouslySetInnerHTML:{__html:e}})):"map"===i?(0,a.createElement)("h1",null,e):"time"===i?(0,a.createElement)("div",{className:"helpgent-answer__inline-icon"},(0,a.createElement)(r.A,{src:c.A}),(0,a.createElement)("p",null,(0,a.createElement)(d,{time:e}))):(0,a.createElement)("span",{className:"helpgent-answer__highlight-text",...l,dangerouslySetInnerHTML:{__html:e}}))}return(0,a.createElement)(l.zD,{className:`helpgent-answer-text helpgent-answer-${i}`},m,h&&(0,a.createElement)("div",{className:"helpgent-passed-time"},(0,a.createElement)("span",null,h," ",(0,p.__)("ago","helpgent"))))})},35629:(e,t,n)=>{n.d(t,{H:()=>a});const a=n(38267).Ay.div`

    &.helpgent-drawer-active.helpgent-in{
        .helpgent-drawer-content{
            transform: translateX(0);
        }

        .helpgent-drawer-backdrop{
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }
    }
    &.helpgent-builder-close-drawer{
        .helpgent-drawer-content{
            width: 360px;
        }
    }
    .helpgent-drawer-content{
        position: fixed;
        right: 0;
        top: 0;
        width: 400px;
        height: 100vh;
        transform: translateX(400px);
        transition: transform .3s ease-in-out;
        z-index: 1000000;
        background-color: var(--helpgent-color-white);
        @media only screen and (max-width: 400px){
            width: calc(100% - 20px);
        }
    }
    .helpgent-drawer-backdrop{
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        opacity: 0;
        visibility: hidden;
        z-index: 100000;
        transition: opacity .3s ease-in-out, visibility .3s ease-in-out;
        background-color: rgba(0,0,0,.5);
    }
    .helpgent-media-filter{
        &__top{
            border-bottom: 1px solid #EDEDED;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 28px 25px;
            .helpgent-select .helpgent-select__menu{
                width: 130px;
                right: 0;
            }
        }
        &__close{
            width: 34px;
            height: 34px;
            border-radius: 50%;
            background: var(--helpgent-color-bg-light);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            svg{
                width: 10px;
                height: 10px;
                path{
                    fill: var(--helpgent-color-gray);
                }
            }
        }
        &__label{
            font-size: 18px;
            font-weight: 600;
            color: var(--helpgent-color-dark);
        }
        .helpgent-select__control{
            background: none;
            min-width: 80px;
            padding: 0;
            min-height: unset;
            .helpgent-select__value-container,
            .helpgent-select__indicator{
                padding: 0;
                gap: 0;
            }
            .helpgent-select__single-value{
                font-size: 14px;
                font-weight: 500;
                color: var(--helpgent-color-gray);
                text-align: right;
            }
        }
        &__content{
            padding: 25px;
            overflow-y: scroll;
            height: calc(100vh - 91px);
            .helpgent-user-block{
                align-items: center;
            }
            .helpgent-media-filter__media{
                padding-bottom: 30px;
            }
        }
        &__media-item{
            &:last-child{
                margin-bottom: 50px;
            }
            .helpgent-media-item-content{
                margin: 10px 0 20px;
                .helpgent-video-conversation{
                    position: relative;
                    border-radius: 20px;
                    text-align: center;
                    display: flex;
                    &::before{
                        content: '';
                        position: absolute;
                        width: 100%;
                        height: 100%;
                        left: 0;
                        top: 0;
                        background: rgba(0,0,0,0.3);
                        border-radius:20px;
                    }
                    video{
                        border-radius: 20px;
                        width: 100%;
                        max-height: 260px;
                    }
                    .helpgent-video-conversation__toggle{
                        position: absolute;
                        left: 50%;
                        top: 50%;
                        transform: translate(-50%, -50%);
                        width: 70px;
                        height: 70px;
                        border-radius: 50%;
                        background: #fff;
                        z-index: 1;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        visibility: hidden;
                        opacity: 0;
                        transition: var(--helpgent-transition);
                        svg{
                            width: 20px;
                            height: 20px;
                            path{
                                fill: var(--helpgent-color-primary);
                            }
                        }
                    }
                    .helpgent-video-conversation__download{
                        position: absolute;
                        right: 15px;
                        bottom: 15px;
                        width: 28px;
                        height: 28px;
                        border-radius: 7px;
                        background: #fff;
                        z-index: 1;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        transition: var(--helpgent-transition);
                        svg{
                            width: 12px;
                            height: 12px;
                            path{
                                fill: var(--helpgent-color-light-gray);
                                transition: var(--helpgent-transition);
                            }
                        }
                        &:hover{
                            background: var(--helpgent-color-primary);
                            svg path{
                                fill: #fff;
                            }
                        }
                    }
                    .helpgent-video-conversation__visualization{
                        position: absolute;
                        right: 20px;
                        top: 20px;
                        z-index: 1;
                        svg{
                            width: 18px;
                            height: 18px;
                            path{
                                fill: #fff;
                                transition: var(--helpgent-transition);
                            }
                        }
                        &:hover{
                            svg path{
                                fill: var(--helpgent-color-primary);
                            }
                        }
                    }
                    &:hover{
                        .helpgent-video-conversation__toggle{
                            visibility: visible;
                            opacity: 1;
                        }
                    }
                }
                .helpgent-voice-conversation{
                    background: var(--helpgent-color-bg-light);
                    border-radius: 20px;
                    margin-bottom: 5px;
                    .helpgent-voice-conversation__player{
                        align-items: center;
                        height: 42px;
                        padding: 10px;
                    }
                    .helpgent-voice-conversation__toggle{
                        width: 22px;
                        height: 22px;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        border-radius: 50%;
                        background: var(--helpgent-color-primary);
                        margin-right: 10px;
                        svg{
                            width: 9px;
                            height: 9px;
                            path{
                                fill: var(--helpgent-color-white);
                            }
                        }
                    }
                    .helpgent-audio-range{
                        flex: 1;
                    }
                    .helpgent-voice-conversation__control{
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        margin-top: 10px;
                        padding: 0 10px 10px;
                        .helpgent-voice-conversation__download{
                            width: 28px;
                            height: 28px;
                            background: #fff;
                            border-radius: 7px;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            transition: var(--helpgent-transition);
                            svg{
                                width: 12px;
                                height: 12px;
                                transition: var(--helpgent-transition);
                            }
                            &:hover{
                                background: var(--helpgent-color-primary);
                                svg path{
                                    fill: #fff;
                                }
                            }
                        }
                    }
                }
                .helpgent-media-reveal{
                    display: flex;
                    align-items: center;
                    justify-content: flex-end;
                    gap: 6px;
                    color: var(--helpgent-color-primary);
                    cursor: pointer;
                    font-size: 12px;
                    svg{
                        width: 12px;
                        path{
                            fill: var(--helpgent-color-primary);
                        }
                    }
                }
            }
        }
        &__media{
            .helpgent-loading{
                display: block;
                padding-bottom: 100px;
                text-align: center;
            }
        }
    }
`},35747:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxMy45OTUiIHZpZXdCb3g9IjAgMCAxNCAxMy45OTUiPgogIDxnIGlkPSJwZW5jaWwiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNDMuMjY1IC00LjI5NikiPgogICAgPGcgaWQ9Ikdyb3VwXzI3ODkiIGRhdGEtbmFtZT0iR3JvdXAgMjc4OSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTQzLjI2NSA0LjI5NikiPgogICAgICA8ZyBpZD0iR3JvdXBfMjc4OCIgZGF0YS1uYW1lPSJHcm91cCAyNzg4Ij4KICAgICAgICA8cGF0aCBpZD0iUGF0aF8xNTYxIiBkYXRhLW5hbWU9IlBhdGggMTU2MSIgZD0iTTE1Ni4yMDksNS4zNDdhMy42MzUsMy42MzUsMCwwLDAtNS4xLS4wMDlsLTYuMzkzLDYuMzkzYTQuOTI4LDQuOTI4LDAsMCwwLTEuNDQ3LDMuNXYyLjExNWEuOTQzLjk0MywwLDAsMCwuOTQ0Ljk0NGgyLjExNWE0LjkyOSw0LjkyOSwwLDAsMCwzLjUtMS40NDhsNi4zODUtNi4zODVBMy42MjIsMy42MjIsMCwwLDAsMTU2LjIwOSw1LjM0N1ptLTcuNzE4LDEwLjE2YTMuMDUxLDMuMDUxLDAsMCwxLTIuMTY2LjloLTEuMTcxVjE1LjIzMWEzLjA1MSwzLjA1MSwwLDAsMSwuODk0LTIuMTY1bDQuMjE1LTQuMjE1LDIuNDQyLDIuNDQyWm02LjM4My02LjM4My0uODM0LjgzNEwxNTEuNiw3LjUxNmwuODM0LS44MzRhMS43MjcsMS43MjcsMCwwLDEsMi40NDIsMi40NDJaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTQzLjI2NSAtNC4yOTYpIiBmaWxsPSIjNmU2ZTZlIi8+CiAgICAgIDwvZz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo="},38769:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(26374),i=n(1455),r=n.n(i);const o=e=>(0,a.n)(t=>async function(e,t){return await r()({path:e,method:"PATCH",data:t}).then(e=>e)}(e,t))},38930:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNC42NjciIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNC42NjcgMTYiPgogIDxnIGlkPSJ0cmFzaF8xXyIgZGF0YS1uYW1lPSJ0cmFzaCAoMSkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMS4zMzMpIj4KICAgIDxwYXRoIGlkPSJQYXRoXzE1MDgiIGRhdGEtbmFtZT0iUGF0aCAxNTA4IiBkPSJNMzYsM2ExLDEsMCwwLDAtMS0xSDMyLjQ4MmEzLDMsMCwwLDAtMi44MTYtMmgtMkEzLDMsMCwwLDAsMjQuODUsMkgyMi4zMzNhMSwxLDAsMCwwLTEsMWgwYTEsMSwwLDAsMCwxLDFoLjMzM3Y4LjMzM0EzLjY2NywzLjY2NywwLDAsMCwyNi4zMzMsMTZIMzFhMy42NjcsMy42NjcsMCwwLDAsMy42NjctMy42NjdWNEgzNUExLDEsMCwwLDAsMzYsM1ptLTMuMzMzLDkuMzMzQTEuNjY3LDEuNjY3LDAsMCwxLDMxLDE0SDI2LjMzM2ExLjY2NywxLjY2NywwLDAsMS0xLjY2Ny0xLjY2N1Y0aDhaIiBmaWxsPSIjNmU2ZTZlIi8+CiAgICA8cGF0aCBpZD0iUGF0aF8xNTA5IiBkYXRhLW5hbWU9IlBhdGggMTUwOSIgZD0iTTE3MS42NjcsMTk4YTEsMSwwLDAsMCwxLTF2LTRhMSwxLDAsMCwwLTIsMHY0QTEsMSwwLDAsMCwxNzEuNjY3LDE5OFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNDQuNjY3IC0xODYpIiBmaWxsPSIjNmU2ZTZlIi8+CiAgICA8cGF0aCBpZD0iUGF0aF8xNTEwIiBkYXRhLW5hbWU9IlBhdGggMTUxMCIgZD0iTTI3OC4zMzMsMTk4YTEsMSwwLDAsMCwxLTF2LTRhMSwxLDAsMCwwLTIsMHY0QTEsMSwwLDAsMCwyNzguMzMzLDE5OFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNDggLTE4NikiIGZpbGw9IiM2ZTZlNmUiLz4KICA8L2c+Cjwvc3ZnPgo="},44220:(e,t,n)=>{function a(e){return e.replace(/(https?:\/\/[^\s]+)/g,'<a href="$1" target="_blank">$1</a>')}n.d(t,{A:()=>a})},44724:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(51609),i=n(86087),r=n(17955),o=n(65604),l=n(66582),s=n(67076),c=n(33410),p=n(20978),g=n(88887);const d=(0,i.forwardRef)((e,t)=>{const{file:n}=e,d=(0,i.useRef)(new Audio(n.url)),[h,u]=(0,i.useState)(!1),[m,M]=(0,i.useState)(0),[N,w]=(0,i.useState)(0);return(0,i.useEffect)(()=>{h&&0===N-m&&u(!1)},[m]),(0,i.useEffect)(()=>{if(!d.current)return;const e=e=>M(e.target.currentTime),t=e=>w(e.target.duration);return d.current.addEventListener("timeupdate",e),d.current.addEventListener("loadeddata",t),()=>{d.current.removeEventListener("timeupdate",e),d.current.removeEventListener("loadeddata",t)}},[]),(0,a.createElement)(g.CB,{className:"helpgent-open-ended-answer-content"},(0,a.createElement)("div",{className:"helpgent-open-ended-answer helpgent-d-flex",ref:t||null},(0,a.createElement)("audio",{src:n.url}),(0,a.createElement)("div",{className:"helpgent-open-ended-answer__voice helpgent-d-flex"},(0,a.createElement)("a",{href:"#",className:"helpgent-open-ended-answer__toggle "+(h?"helpgent-open-ended-answer__toggle--playing":""),onClick:function(e){e.preventDefault(),d.current&&(d.current.paused?(d.current.play(),u(!0)):(d.current.pause(),u(!1)))}},h?(0,a.createElement)(o.A,{src:p.A}):(0,a.createElement)(o.A,{src:c.A})),(0,a.createElement)(r.A,{audioCurrentTime:m,audioDuration:N}),(0,a.createElement)("div",{className:"helpgent-open-ended-answer__time"},(0,a.createElement)("span",null,function(){const e=N-m;return(0,l.C1)(e)}()))),(0,a.createElement)("a",{href:n.url,className:"helpgent-open-ended-answer__download",download:!0},(0,a.createElement)(o.A,{src:s.A}))))})},45907:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(51609),i=n(86087),r=n(4286);function o(e){const{sidebarTop:t,sidebarChild:n,mainChild:o}=e;return(0,i.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,a.createElement)(r.Yn,{className:"helpgent-conversation-wrapper"},(0,a.createElement)(i.Fragment,null,(0,a.createElement)("aside",{className:"helpgent-sidebar"},t,n),(0,a.createElement)("main",{className:"helpgent-conversation-main helpgent-conversation-main--active"},o)))}},47539:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxMy45OTciIHZpZXdCb3g9IjAgMCAxNCAxMy45OTciPgogIDxnIGlkPSJwYXBlci1wbGFuZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtMC4wNDkpIj4KICAgIDxwYXRoIGlkPSJQYXRoXzE1NzIiIGRhdGEtbmFtZT0iUGF0aCAxNTcyIiBkPSJNMTMuNDE2LjYzMkExLjk1OCwxLjk1OCwwLDAsMCwxMS41NjMuMUwyLjY0NiwxLjk3OEEzLjEsMy4xLDAsMCwwLC45MDgsNy4yMzZsLjk1Ni45NTdhLjIzMy4yMzMsMCwwLDEsLjA2OS4xNjd2MS43NjRhMS45OSwxLjk5LDAsMCwwLDEuOTg4LDEuOTg4SDUuNjg1YS4yMzguMjM4LDAsMCwxLC4xNjguMDY5bC45NTYuOTU2YTMuMDgyLDMuMDgyLDAsMCwwLDIuMTg0LjkxLDMuMTIxLDMuMTIxLDAsMCwwLDEtLjE2NEEzLjA4MSwzLjA4MSwwLDAsMCwxMi4wNjcsMTEuNGwxLjg3NC04Ljg4OUExLjk3MywxLjk3MywwLDAsMCwxMy40MTYuNjMyWk0xLjgyLDQuNjE0YTEuMzI1LDEuMzI1LDAsMCwxLDEuMS0uOTA3bC4wNjEtLjAxLDcuNzctMS42MzNMMy42ODMsOS4xMjVWOC4zNkExLjk3MywxLjk3MywwLDAsMCwzLjEsNi45NTVMMi4xNDUsNkExLjMyNiwxLjMyNiwwLDAsMSwxLjgyLDQuNjE0Wm04LjUyOCw2LjQ1NWMwLC4wMi0uMDA4LjA0MS0uMDEuMDYxYTEuMzUsMS4zNSwwLDAsMS0yLjI5Mi43NzJsLS45NTUtLjk1NWExLjk3MywxLjk3MywwLDAsMC0xLjQwNi0uNTgzSDQuOTJMMTEuOTg0LDMuM1oiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDApIiBmaWxsPSIjM2MzYzNjIi8+CiAgPC9nPgo8L3N2Zz4K"},47977:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(51609),i=n(86087);const r=n(38267).Ay.div`
    display: none;
    position: fixed;
    justify-content: center;
    align-items: center;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    background-color: rgba( 0, 0, 0, 0.5 );
    overflow-y: auto;
    z-index: 999999;

    &.--active {
        display: flex;
    }
`,o=function({children:e,isActive:t,onChange:n,className:o}){const l=(0,i.useRef)(),[s,c]=(0,i.useState)("boolean"==typeof t&&t);return(0,i.useEffect)(()=>{c(t)},[t]),s?(0,a.createElement)(r,{ref:l,className:`helpgent-modal-container --active ${o}`,onClick:function(e){e.target===l.current&&(c(!1),"function"==typeof n&&n(!1))}},e):""}},49615:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyBpZD0iYm94IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNC4wMDMiIGhlaWdodD0iMTQuMDAzIiB2aWV3Qm94PSIwIDAgMTQuMDAzIDE0LjAwMyI+CiAgPHBhdGggaWQ9IlBhdGhfMTU1MSIgZGF0YS1uYW1lPSJQYXRoIDE1NTEiIGQ9Ik0xNCwzLjIwOUEzLjIxMywzLjIxMywwLDAsMCwxMC43OTQsMEgzLjIwOUEzLjIxMywzLjIxMywwLDAsMCwwLDMuMjA5di41ODNBMi4wMzQsMi4wMzQsMCwwLDAsLjU4Myw1LjIxN3Y1LjU3N0EzLjIxMywzLjIxMywwLDAsMCwzLjc5MiwxNEgxMC4yMWEzLjIxMiwzLjIxMiwwLDAsMCwzLjIwOS0zLjIwOVY1LjIxN0EyLjAzMywyLjAzMywwLDAsMCwxNCwzLjc5MlptLTEyLjI1MywwQTEuNDU5LDEuNDU5LDAsMCwxLDMuMjA5LDEuNzVoNy41ODVhMS40NTksMS40NTksMCwwLDEsMS40NTksMS40NTl2LjU4M2EuMjkyLjI5MiwwLDAsMS0uMjkyLjI5MkgyLjA0MmEuMjkyLjI5MiwwLDAsMS0uMjkyLS4yOTJabTkuOTE5LDcuNTg1YTEuNDU5LDEuNDU5LDAsMCwxLTEuNDU5LDEuNDU5SDMuNzkyYTEuNDU5LDEuNDU5LDAsMCwxLTEuNDU5LTEuNDU5VjUuODM1aDkuMzM1djQuOTU5WiIgZmlsbD0iIzZlNmU2ZSIvPgogIDxwYXRoIGlkPSJQYXRoXzE1NTIiIGRhdGEtbmFtZT0iUGF0aCAxNTUyIiBkPSJNMTcxLjU0MiwyNTZoMi45MTdhLjg3NS44NzUsMCwwLDEsLjg3NS44NzVoMGEuODc1Ljg3NSwwLDAsMS0uODc1Ljg3NWgtMi45MTdhLjg3NS44NzUsMCwwLDEtLjg3NS0uODc1aDBBLjg3NS44NzUsMCwwLDEsMTcxLjU0MiwyNTZaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTY1Ljk5OSAtMjQ4Ljk5OSkiIGZpbGw9IiM2ZTZlNmUiLz4KPC9zdmc+Cg=="},51893:(e,t,n)=>{function a(e,t){e.preventDefault(),t.current.requestFullscreen?t.current.requestFullscreen():t.current.webkitRequestFullscreen?t.current.webkitRequestFullscreen():t.current.msRequestFullscreen&&t.current.msRequestFullscreen()}n.d(t,{A:()=>a})},54899:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNSIgaGVpZ2h0PSIxMS40NzkiIHZpZXdCb3g9IjAgMCAxNSAxMS40NzkiPgogIDxnIGlkPSJleWVfM18iIGRhdGEtbmFtZT0iZXllICgzKSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNTkuNzczKSI+CiAgICA8cGF0aCBpZD0iUGF0aF8xNTI0IiBkYXRhLW5hbWU9IlBhdGggMTUyNCIgZD0iTTE0LjQsNjMuNTY1YTguMzE1LDguMzE1LDAsMCwwLTYuOS0zLjc5MkE4LjMxNSw4LjMxNSwwLDAsMCwuNiw2My41NjVhMy40NTUsMy40NTUsMCwwLDAsMCwzLjg5MSw4LjMxNSw4LjMxNSwwLDAsMCw2LjksMy44LDguMzE1LDguMzE1LDAsMCwwLDYuOS0zLjc5MkEzLjQ1NSwzLjQ1NSwwLDAsMCwxNC40LDYzLjU2NVptLTEuNTUzLDIuODI3QTYuMzc2LDYuMzc2LDAsMCwxLDcuNSw2OS4zNjhhNi4zNzYsNi4zNzYsMCwwLDEtNS4zNDYtMi45NzUsMS41NjMsMS41NjMsMCwwLDEsMC0xLjc1OUE2LjM3Niw2LjM3NiwwLDAsMSw3LjUsNjEuNjU4YTYuMzc2LDYuMzc2LDAsMCwxLDUuMzQ2LDIuOTc1QTEuNTYzLDEuNTYzLDAsMCwxLDEyLjg0Niw2Ni4zOTJaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDApIiBmaWxsPSIjNmU2ZTZlIi8+CiAgICA8Y2lyY2xlIGlkPSJFbGxpcHNlXzI4MyIgZGF0YS1uYW1lPSJFbGxpcHNlIDI4MyIgY3g9IjIuNTIxIiBjeT0iMi41MjEiIHI9IjIuNTIxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0Ljk3OCA2Mi45OTEpIiBmaWxsPSIjNmU2ZTZlIi8+CiAgPC9nPgo8L3N2Zz4K"},57945:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBpZD0icGVuLW5pYiIgZD0iTTE1LjcwOCw0Ljk1OWExLDEsMCwwLDAtMS40MTQsMGwtLjk1OS45NTlMMTAuMDgyLDIuNjY2bC45NTktLjk1OUExLDEsMCwxLDAsOS42MjcuMjkzTDguMTA2LDEuODE0LDQuNTUxLDMuMjM2QTMuNzU5LDMuNzU5LDAsMCwwLDIuMzI4LDUuNjgxTC4wODYsMTMuMzJhMi4wOSwyLjA5LDAsMCwwLDIuNTk0LDIuNTk0bDcuNjM5LTIuMjQxYTMuNzU3LDMuNzU3LDAsMCwwLDIuNDQ1LTIuMjIzTDE0LjE4Nyw3LjlsMS41MjEtMS41MjFhMSwxLDAsMCwwLDAtMS40MTRabS00LjgsNS43NDhhMS43NjksMS43NjksMCwwLDEtMS4xNTIsMS4wNDdsLTUuOCwxLjcsMi44MTEtMi44MTFBMS42MywxLjYzLDAsMCwwLDcsMTAuNjY2LDEuNjY3LDEuNjY3LDAsMSwwLDUuMzM0LDlhMS42MiwxLjYyLDAsMCwwLC4wMjMuMjI5TDIuNTQ3LDEyLjA0bDEuNy01LjhBMS43NywxLjc3LDAsMCwxLDUuMjkzLDUuMDkzTDguNDI3LDMuODM5bDMuNzM0LDMuNzM0LTEuMjUzLDMuMTMzWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTAuMDAxIDApIiBmaWxsPSIjNmU2ZTZlIi8+Cjwvc3ZnPgo="},60518:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMy4zMzMiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxMy4zMzMgMTYiPgogIDxwYXRoIGlkPSJkb2N1bWVudCIgZD0iTTEwLDQuNjY3Vi4zMDdhNC42NTEsNC42NTEsMCwwLDEsMS42NDMsMS4wNmwyLjMyMywyLjMyNGE0LjYzNiw0LjYzNiwwLDAsMSwxLjA2MSwxLjY0M2gtNC4zNkEuNjY3LjY2NywwLDAsMSwxMCw0LjY2N1pNMTUuMzMzLDYuOTl2NS42NzdBMy4zMzcsMy4zMzcsMCwwLDEsMTIsMTZINS4zMzNBMy4zMzcsMy4zMzcsMCwwLDEsMiwxMi42NjdWMy4zMzNBMy4zMzcsMy4zMzcsMCwwLDEsNS4zMzMsMGgzLjAxYy4xMDksMCwuMjE2LjAwOS4zMjMuMDE2VjQuNjY3YTIsMiwwLDAsMCwyLDJoNC42NTFjLjAwNy4xMDcuMDE2LjIxNS4wMTYuMzIzWk0xMCwxMi42NjdBLjY2Ny42NjcsMCwwLDAsOS4zMzMsMTJINmEuNjY3LjY2NywwLDAsMCwwLDEuMzMzSDkuMzMzQS42NjcuNjY3LDAsMCwwLDEwLDEyLjY2N1pNMTIsMTBhLjY2Ny42NjcsMCwwLDAtLjY2Ny0uNjY3SDZhLjY2Ny42NjcsMCwwLDAsMCwxLjMzM2g1LjMzM0EuNjY3LjY2NywwLDAsMCwxMiwxMFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yKSIgZmlsbD0iIzFiODNmYiIvPgo8L3N2Zz4K"},62947:(e,t,n)=>{n.d(t,{A:()=>b});var a=n(51609),i=n(86087),r=n(44253),o=n(10155),l=n(65604),s=n(50481),c=n(22057),p=n(90781),g=n(72235),d=n(27723);function h({recorder:e,afterGrantPermission:t,onBack:n,onExit:i}){let r=e.getRecorderConfig("checkPermissions");return(0,a.createElement)(o.BT,{className:"helpgent-video-recorder-permission-container"},"function"==typeof i&&(0,a.createElement)("div",{className:"helpgent-close-btn"},(0,a.createElement)("a",{href:"#",className:"helpgent-close-btn-icon",onClick:e=>{e.preventDefault(),i()}},(0,a.createElement)(l.A,{src:p.A}))),("function"==typeof n||"function"==typeof i)&&(0,a.createElement)("div",{className:"helpgent-header-action"},"function"==typeof n&&(0,a.createElement)("div",{className:"helpgent-header-action-item"},(0,a.createElement)("a",{href:"#",className:"helpgent-btn-back helpgent-action-icon",onClick:e=>{e.preventDefault(),n()}},(0,a.createElement)(l.A,{src:c.A})))),(0,a.createElement)("h4",{className:"helpgent-permission-title"},(0,d.sprintf)((0,d.__)("To Record %s, your browser will need to request access to your %s.","helpgent"),e.getRecorderType(),r.length?r.join(", "):"")),(0,a.createElement)(s.A,{src:g,alt:"helpgent video support"}),(0,a.createElement)("div",{className:"helpgent-btn helpgent-btn-lg helpgent-btn-primary",onClick:n=>{n.preventDefault(),async function(){await e.requestPermission()&&t()}()}},(0,d.__)("Request Permission","helpgent")),e.isPermissionDenied&&(0,a.createElement)("div",{className:"helpgent-mt-10 helpgent-notice helpgent-notice-danger helpgent-text-center"},(0,d.__)("Please grant the requested permission","helpgent")))}var u=n(82902),m=n(62064),M=n(33410);function N({recorder:e,onCancel:t}){function n(){return e.isRecording||e.isPaused}return(0,i.useEffect)(()=>{e.setupStream()},[]),(0,a.createElement)(o.oF,{className:"helpgent-video-recorder-container-area"},(0,a.createElement)("div",{className:"helpgent-video-recorder-wrap"},(0,a.createElement)("div",{className:"helpgent-video-recorder-container helpgent-video-recorder"},(0,a.createElement)("a",{href:"#",className:"helpgent-btn-back",onClick:e=>{e.preventDefault(),t()}},(0,a.createElement)(l.A,{src:c.A})),(0,a.createElement)("video",{ref:e.videoPreviewStreamRef,muted:!0,playsInline:!0}),(0,a.createElement)("div",{className:"helpgent-timer"},(0,a.createElement)("span",{className:"helpgent-sec"},e.getFormattedRecordedTime())),e.isActiveCountdown&&(0,a.createElement)("div",{className:"helpgent-video-recorder-countdown-container"},(0,a.createElement)(u.A,{value:e.getCountdownTimeReversed(),onClick:e.skipCountdown,hint:(0,d.__)("Click anywhere to skip the countdown","helpgent")})),!e.isActiveCountdown&&(0,a.createElement)("div",{className:"helpgent-record-action"+(n()?" helpgent-record-start":"")},(0,a.createElement)("a",{href:"#",className:"helpgent-record-btn",onClick:t=>{t.preventDefault(),async function(){n()?e.stop():await e.start()}()}}),n()&&(0,a.createElement)("a",{href:"#",className:"helpgent-btn-record-right helpgent-btn-"+(e.isPaused?"play":"pause"),onClick:t=>{t.preventDefault(),async function(){e.isPaused?e.resume():e.pause()}()}}," ",(0,a.createElement)(l.A,{src:e.isPaused?M.A:m.A})," ")))))}var w=n(69466);const x=n(38267).Ay.div`
    position: relative;
    padding-top: calc( 56.25% + 79px );
    margin-right: 80px;
    margin-left: 80px;
    border-radius: 20px;
    box-sizing: border-box;
    background: #fff;
    overflow: hidden;
    height: unset !important;

    .helpgent-media-preview-wrap {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
    }

    .helpgent-media-preview-close-action{
        position: absolute;
        right: 25px;
        top: 10px;
        z-index: 10;
        .helpgent-media-preview-close-action-link{
            svg{
                width: 12px;
                height: 12px;
                path{
                    fill: var(--helpgent-color-dark);
                    transition: var(--helpgent-transition);
                }
            }
            &:hover{
                svg path{
                    fill: var(--helpgent-color-danger);
                }
            }
        }
    }
    .helpgent-media-preview__media {
        height: calc( 100% - 79px );
        .helpgent-media-preview__video{
            height: 100%;
        }
        video{
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 0;
        }
    }

    .helpgent-media-preview__actions {
        display: flex;
        flex-direction: column;
        background: var(--helpgent-color-bg-light);
        h4{
            padding: 25px;
            margin: 0;
            font-size: 20px;
        }
        .helpgent-media-preview-message{
            height: 100%;
            textarea{
                background: none;
                resize: none;
                border: 0 none;
                width: 100%;
                height: 100%;
                padding: 0 25px 15px;
                font-size: 18px;
                &:focus{
                    border: 0 none;
                    box-shadow: none;
                }
                &::-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-media-preview-buttons{
            margin-top: auto;
            display: flex;
            align-items: center;
            background: #fff;
            a{
                flex: 1;
                display: flex;
                align-items:center;
                justify-content: center;
                gap: 10px;
                font-size: 15px;
                color: var(--helpgent-color-gray);
                text-decoration: none;
                padding: 30px 15px;
                transition: var(--helpgent-transition);
                &:not(:last-child){
                    border-right: 1px solid var(--helpgent-color-border-light);
                }
                svg{
                    path{
                        fill: var(--helpgent-color-gray);
                        transition: var(--helpgent-transition);
                    }
                }
                &:hover{
                    color: var(--helpgent-color-primary);
                    svg path{
                        fill: var(--helpgent-color-primary);
                    }
                }
            }
        }
    }

    .helpgent-btn-recorded {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 70px;
        height: 70px;
        margin: 0px auto;
        border-radius: 50%;
        z-index: 101;
        transition: box-shadow 0.2s ease-in 0s;
        background-color: var(--color-white);
        box-shadow: rgba(0, 0, 0, 0.15) 0px 5px 50px;
        &:hover{
            box-shadow: rgba(0, 0, 0, 0.2) 0px 20px 60px;
        }
        svg{
            path{
                fill: var(--helpgent-color-primary);
            }
        }
        &.helpgent-btn-recorded-pause{

        }
    }
    .helpgent-audio-range{
        width: calc(100% + 50px);
        display: block;
        margin: 100px 0px 0px -30px;
    }
    .helpgent-recorded-preview__bottom{
        margin-top: 35px;
        h4{
            font-size: 20px;
            font-weight: 600;
            margin: 0px 0px 20px;
        }
    }
    .helpgent-recorded-preview__bottom-actions{
        a{
            display: flex;
            justify-content: center;
            width: 100%;
            text-align: center;
            box-sizing: border-box;
            border-radius: 14px;
        }
        a + a{
            margin-top: 10px;
        }
    }
`;var y=n(21192),L=n(52973),v=n(23142),I=n(47539);function f({file:e,onSubmit:t,onBack:n,onExit:r,submitButtonLabel:o}){const[s,p]=(0,i.useState)(""),[g,h]=(0,i.useState)(""),[u,m]=(0,i.useState)(!1);return o=o||"Save",(0,i.useEffect)(()=>{if(!e||"object"!=typeof e)return;let t=e.type.match(/^[^/]+/);t=t?t[0]:"",h(t),p(URL.createObjectURL(e))},[]),(0,a.createElement)(x,{className:"helpgent-media-preview"},(0,a.createElement)("div",{className:"helpgent-media-preview-wrap"},(0,a.createElement)("div",{className:"helpgent-media-preview-close-action"},(0,a.createElement)("a",{href:"#",className:"helpgent-media-preview-close-action-link",onClick:e=>{e.preventDefault(),r()}},(0,a.createElement)(l.A,{src:v.A}))),(0,a.createElement)("div",{className:"helpgent-media-preview__media"},"audio"===g&&(0,a.createElement)(y.A,{mediaURL:s}),"video"===g&&(0,a.createElement)(L.A,{mediaURL:s})),(0,a.createElement)("div",{className:"helpgent-media-preview__actions"},(0,a.createElement)("div",{className:"helpgent-media-preview-buttons"},("function"==typeof n||"function"==typeof r)&&(0,a.createElement)("a",{href:"#",onClick:function(e){e.preventDefault(),"function"!=typeof n?"function"!=typeof r||r():n()}},(0,a.createElement)(l.A,{src:c.A}),(0,d.__)("Cancel","helpgent")),(0,a.createElement)("a",{href:"#",onClick:async function(n){if(n.preventDefault(),"function"!=typeof t)return;if(u)return;if(!e)return;m(!0);const a=await t(e,g);m(!1),a&&a.success&&"function"==typeof r&&r()}},u?(0,d.__)("Please wait...","helpgent"):o,(0,a.createElement)(l.A,{src:I.A}))))))}function b({fileUploader:e,onSubmit:t,onExit:n,maxRecordLength:l,videoResolution:s,previewMode:c,submitButtonLabel:p}){const[g,d]=(0,i.useState)("recorder"),[u,m]=(0,i.useState)(""),M={default:f,previewWithText:w.A};c=c||"default";const x=M.hasOwnProperty(c)?M[c]:M.default,y={recorderType:"video",maxRecordLength:l?parseInt(l):120,countdownTimer:3,videoResolution:s?parseInt(s):null,afterStopRecording:function(t){t&&(e&&e.setFile(t.blob),d("mediaPreview"))}},L=(0,r.A)(y),v=()=>{L.reset(),n()},I={permission:(0,a.createElement)(h,{recorder:L,onExit:v,afterGrantPermission:()=>{d("recorder")}}),recorder:(0,a.createElement)(N,{recorder:L,onCancel:v}),mediaPreview:(0,a.createElement)("div",{className:"helpgent-media-preview-container"},(0,a.createElement)(x,{file:e&&e.hasFile()?e.getFile().file:L.recordedBlob,onSubmit:(n,a,i)=>t(e?e.files:n,a),onBack:()=>{L.reset(),d("recorder")},onExit:v,submitButtonLabel:p}))};return(0,i.useEffect)(()=>(async function(){await L.checkPermission()?d("recorder"):(d("permission"),m("helpgent-permission-modal"))}(),()=>{L.reset()}),[]),(0,a.createElement)(o.jD,{className:u},(b=g,I.hasOwnProperty(b)?I[b]:""));var b}},63176:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMy40MTciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxMy40MTcgMTQiPgogIDxnIGlkPSJzb3J0LWFtb3VudC1kb3duLWFsdCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEpIj4KICAgIDxwYXRoIGlkPSJQYXRoXzE1NzQiIGRhdGEtbmFtZT0iUGF0aCAxNTc0IiBkPSJNMTcuMjkyLDFIMTAuODc1YS44NzUuODc1LDAsMCwwLDAsMS43NWg2LjQxN2EuODc1Ljg3NSwwLDEsMCwwLTEuNzVaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMy43NSAtMC40MTcpIiBmaWxsPSIjNmU2ZTZlIi8+CiAgICA8cGF0aCBpZD0iUGF0aF8xNTc1IiBkYXRhLW5hbWU9IlBhdGggMTU3NSIgZD0iTTE0Ljk1OCw3SDEwLjg3NWEuODc1Ljg3NSwwLDAsMCwwLDEuNzVoNC4wODNhLjg3NS44NzUsMCwwLDAsMC0xLjc1WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMuNzUgLTIuOTE3KSIgZmlsbD0iIzZlNmU2ZSIvPgogICAgPHBhdGggaWQ9IlBhdGhfMTU3NiIgZGF0YS1uYW1lPSJQYXRoIDE1NzYiIGQ9Ik0xMi42MjUsMTNoLTEuNzVhLjg3NS44NzUsMCwwLDAsMCwxLjc1aDEuNzVhLjg3NS44NzUsMCwwLDAsMC0xLjc1WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMuNzUgLTUuNDE3KSIgZmlsbD0iIzZlNmU2ZSIvPgogICAgPHBhdGggaWQ9IlBhdGhfMTU3NyIgZGF0YS1uYW1lPSJQYXRoIDE1NzciIGQ9Ik01Ljc2NywxMC43NDJINC41Vi44NzVhLjg3NS44NzUsMCwwLDAtMS43NSwwdjkuODY3SDEuNTgzYS41ODMuNTgzLDAsMCwwLS40MTIsMWwyLjA5MiwyLjA5MmEuNTg0LjU4NCwwLDAsMCwuODI1LDBMNi4xOCwxMS43MzdhLjU4My41ODMsMCwwLDAtLjQxMi0xWiIgZmlsbD0iIzZlNmU2ZSIvPgogIDwvZz4KPC9zdmc+Cg=="},64197:(e,t,n)=>{n.d(t,{A:()=>a});const a=new(n(5054).E)},64943:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(9421),i=n(68360),r=n(90212);function o(e,t,n){const{data:o,isLoading:l,error:s,isError:c,isFetching:p,isSuccess:g,isRefetching:d}=(0,a.I)(e,async()=>{const e=await(0,i.A)(t,n?.parser||{});return n&&"function"==typeof n.afterLoadedData&&n.afterLoadedData(e),e},n?.queryConfig||{refetchOnWindowFocus:!1,keepPreviousData:!0,staleTime:1e4});return{data:s||l?null:o,isLoading:l,errorMessage:s?(0,r.A)(s?s?.data?.status:""):"",isError:!!c,isFetching:p,isSuccess:g,isRefetching:d}}},67076:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyBpZD0iZG93bmxvYWQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEyIiBoZWlnaHQ9IjEyIiB2aWV3Qm94PSIwIDAgMTIgMTIiPgogIDxwYXRoIGlkPSJQYXRoXzE1NTYiIGRhdGEtbmFtZT0iUGF0aCAxNTU2IiBkPSJNMTEzLjEzNCw4Ljg0YTIuMjU1LDIuMjU1LDAsMCwwLDMuMTg1LDBoMGwxLjYwNy0xLjZhLjc1Ljc1LDAsMSwwLTEuMDQzLTEuMDc4bC0uMDE4LjAxOC0xLjM5MywxLjM4OUwxMTUuNDYxLjc0OUEuNzUuNzUsMCwwLDAsMTE0LjcxLDBoMGEuNzUuNzUsMCwwLDAtLjc1MS43NDlsLjAxLDYuODA2LTEuMzgyLTEuMzc5YS43NS43NSwwLDAsMC0xLjA2MSwxLjA1OVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDguNzEpIiBmaWxsPSIjNmU2ZTZlIi8+CiAgPHBhdGggaWQ9IlBhdGhfMTU1NyIgZGF0YS1uYW1lPSJQYXRoIDE1NTciIGQ9Ik0xMS4yNSwzMDkuMzMzYS43NS43NSwwLDAsMC0uNzUuNzQ5djIuMjkzYS4yLjIsMCwwLDEtLjIuMkgxLjdhLjIuMiwwLDAsMS0uMi0uMnYtMi4yOTNhLjc1Ljc1LDAsMCwwLTEuNSwwdjIuMjkzYTEuNzA2LDEuNzA2LDAsMCwwLDEuNywxLjdIMTAuM2ExLjcwNSwxLjcwNSwwLDAsMCwxLjctMS43di0yLjI5M0EuNzUuNzUsMCwwLDAsMTEuMjUsMzA5LjMzM1oiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwMi4wNzgpIiBmaWxsPSIjNmU2ZTZlIi8+Cjwvc3ZnPgo="},68357:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(51609),i=n(4286);function r({style:e}){const t={minHeight:"500px",maxHeight:"550px"};return e=e?{...t,...e}:t,(0,a.createElement)(i.vY,{style:e,className:"helpgent-content-loading"},(0,a.createElement)("span",{className:"helpgent-shimmer-effect"}),(0,a.createElement)("span",{className:"helpgent-shimmer-effect"}),(0,a.createElement)("span",{className:"helpgent-shimmer-effect"}))}},68360:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(1455),i=n.n(a);async function r(e,t){return await i()({path:e,...t}).then(e=>e).catch(e=>{throw e})}},68469:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(1455),i=n.n(a);async function r(e,t,n){return n=n||{},await i()({path:e,method:"DELETE",data:t,...n}).then(e=>e)}},69466:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(51609),i=n(86087);const r=n(38267).Ay.div`
    display: flex;
    box-sizing: border-box;
    background: #fff;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin-left: 80px;
    margin-right: 80px;
    height: calc(100vh - 160px);
    @media only screen and (max-width: 575px){
        flex-wrap: wrap;
        flex-direction: column;
    }

    .helpgent-media-preview-close-action{
        position: absolute;
        right: 25px;
        top: 10px;
        .helpgent-media-preview-close-action-link{
            svg{
                width: 12px;
                height: 12px;
                path{
                    fill: var(--helpgent-color-dark);
                    transition: var(--helpgent-transition);
                }
            }
            &:hover{
                svg path{
                    fill: var(--helpgent-color-danger);
                }
            }
        }
    }
    .helpgent-media-preview__media {
        flex: 1;
        position: relative;
        .helpgent-media-preview__video{
            height: 100%;
        }
        video{
            width: 100%;
            height: calc(100% + 1px);
            object-fit: cover;
            border-radius: 0;
        }
    }

    .helpgent-media-preview__actions {
        flex: 1;
        display: flex;
        flex-direction: column;
        background: var(--helpgent-color-bg-light);
        h4{
            padding: 25px;
            margin: 0;
            font-size: 20px;
        }
        .helpgent-media-preview-message{
            height: 100%;
            textarea{
                background: none;
                resize: none;
                border: 0 none;
                width: 100%;
                height: 100%;
                padding: 0 25px 15px;
                font-size: 18px;
                &:focus{
                    border: 0 none;
                    box-shadow: none;
                }
                &::-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-media-preview-buttons{
            margin-top: auto;
            display: flex;
            align-items: center;
            background: #fff;
            a{
                flex: 1;
                display: flex;
                align-items:center;
                justify-content: center;
                gap: 10px;
                font-size: 15px;
                color: var(--helpgent-color-gray);
                text-decoration: none;
                padding: 30px 15px;
                transition: var(--helpgent-transition);
                &:not(:last-child){
                    border-right: 1px solid var(--helpgent-color-border-light);
                }
                svg{
                    path{
                        fill: var(--helpgent-color-gray);
                        transition: var(--helpgent-transition);
                    }
                }
                &:hover{
                    color: var(--helpgent-color-primary);
                    svg path{
                        fill: var(--helpgent-color-primary);
                    }
                }
            }
        }
    }

    .helpgent-btn-recorded {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 70px;
        height: 70px;
        margin: 0px auto;
        border-radius: 50%;
        z-index: 101;
        transition: box-shadow 0.2s ease-in 0s;
        background-color: var(--color-white);
        box-shadow: rgba(0, 0, 0, 0.15) 0px 5px 50px;
        &:hover{
            box-shadow: rgba(0, 0, 0, 0.2) 0px 20px 60px;
        }
        svg{
            path{
                fill: var(--helpgent-color-primary);
            }
        }
        &.helpgent-btn-recorded-pause{

        }
    }
    .helpgent-audio-range{
        width: calc(100% + 50px);
        display: block;
        margin: 100px 0px 0px -30px;
    }
    .helpgent-recorded-preview__bottom{
        margin-top: 35px;
        h4{
            font-size: 20px;
            font-weight: 600;
            margin: 0px 0px 20px;
        }
    }
    .helpgent-recorded-preview__bottom-actions{
        a{
            display: flex;
            justify-content: center;
            width: 100%;
            text-align: center;
            box-sizing: border-box;
            border-radius: 14px;
        }
        a + a{
            margin-top: 10px;
        }
    }
`;var o=n(21192),l=n(52973),s=n(65604),c=n(23142),p=n(22057),g=n(47539),d=n(27723);function h({file:e,onSubmit:t,onBack:n,onExit:h,submitButtonLabel:u}){const[m,M]=(0,i.useState)(""),[N,w]=(0,i.useState)(""),[x,y]=(0,i.useState)(""),[L,v]=(0,i.useState)(""),[I,f]=(0,i.useState)(!1);return u=u||(0,d.__)("Save","helpgent"),(0,i.useEffect)(()=>{if(!e||"object"!=typeof e)return;let t=e.type.match(/^[^/]+/);t=t?t[0]:"",w(t),M(URL.createObjectURL(e))},[]),(0,a.createElement)(r,{className:"helpgent-media-preview"},(0,a.createElement)("div",{className:"helpgent-media-preview-close-action"},(0,a.createElement)("a",{href:"#",className:"helpgent-media-preview-close-action-link",onClick:e=>{e.preventDefault(),h()}},(0,a.createElement)(s.A,{src:c.A}))),(0,a.createElement)("div",{className:"helpgent-media-preview__media"},"audio"===N&&(0,a.createElement)(o.A,{mediaURL:m}),"video"===N&&(0,a.createElement)(l.A,{mediaURL:m})),(0,a.createElement)("div",{className:"helpgent-media-preview__actions"},(0,a.createElement)("h4",null,(0,d.__)("Ready to Send?","helpgent")),(0,a.createElement)("div",{className:"helpgent-media-preview-message"},(0,a.createElement)("textarea",{onChange:e=>y(e.target.value),value:x,placeholder:(0,d.__)("Type your text here","helpgent")})),L&&(0,a.createElement)("div",null,L),(0,a.createElement)("div",{className:"helpgent-media-preview-buttons"},("function"==typeof n||"function"==typeof h)&&(0,a.createElement)("a",{href:"#",onClick:function(e){e.preventDefault(),"function"!=typeof n?"function"!=typeof h||h():n()}},(0,a.createElement)(s.A,{src:p.A}),(0,d.__)("Cancel","helpgent")),(0,a.createElement)("a",{href:"#",onClick:async function(n){if(n.preventDefault(),"function"!=typeof t)return;if(I)return;if(v(""),!e)return void v((0,d.__)("Please select a file","helpgent"));f(!0);const a=await t(e,x,N);a&&(f(!1),a.success?"function"==typeof h&&h():v(a.message))}},I?(0,d.__)("Please wait...","helpgent"):u,(0,a.createElement)(s.A,{src:g.A})))))}},71474:(e,t,n)=>{n.d(t,{A:()=>w});var a=n(51609),i=n(65604),r=n(93832),o=n(92283),l=n(50481),s=n(86087),c=n(64943),p=n(6945),g=n(22057),d=n(35747),h=n(49615),u=n(30814),m=n(2192),M=n(23142),N=n(27723);function w({isArchiveAvailable:e,moduleState:t,setModuleState:n,queryClient:w,baseApiRoute:x,baseLinkRoute:y}){const{navigationHook:L,paramsHook:v,routeLink:I,routerNavLink:f}=(0,p.Xd)("helpgent_router_references",null),{id:b}=v(),{status:j,responseQueryKey:D,messageQueryKey:z,responseAgentQueryKey:_,formFetchingEnabled:A}=t,E=L(),{data:C,isLoading:T,isError:S,errorMessage:k,isFetching:Y}=(0,c.A)(["helpgent-response-form"],(0,r.addQueryArgs)(x?.responseForm,{form_id:b}),{queryConfig:{refetchOnWindowFocus:!0,keepPreviousData:!0,staleTime:1e4,enabled:A}});S&&E(`${y}`),(0,s.useEffect)(()=>{C&&n(e=>({...e,formResponse:C.form}))},[C]);const O=C&&parseInt(C.form.total_response.completed)+parseInt(C.form.total_response.incompleted);return(0,a.createElement)("div",{className:"helpgent-sidebar__top"},(0,a.createElement)(I,{to:y,className:"helpgent-sidebar__back"},(0,a.createElement)(i.A,{src:g.A})," ",(0,N.__)("Back to all forms","helpgent")),(0,a.createElement)("div",{className:"helpgent-sidebar__content helpgent-d-flex helpgent-space-between"},(0,a.createElement)("div",{className:"helpgent-sidebar__element helpgent-d-flex"},C&&C.form.featured_image?(0,a.createElement)(l.A,{src:C?.form?.featured_image,alt:(0,N.__)("Helpgent Media","helpgent")}):(0,a.createElement)("span",{className:"helpgent-form-color-box",style:{backgroundColor:C&&C?.form?.color}}),(0,a.createElement)("span",{className:"helpgent-sidebar__element-title"},C&&C.form.title)),(0,a.createElement)("div",{className:"helpgent-sidebar__action"},(0,a.createElement)(I,{to:`${y}/${b}/edit`},(0,a.createElement)(i.A,{src:d.A})))),"archive"!==j&&(0,a.createElement)("div",{className:"helpgent-sidebar__navigation-wrap helpgent-d-flex"},(0,a.createElement)("div",{className:"helpgent-sidebar__navigation"},(0,a.createElement)(f,{to:`${y}/${b}/responses`,className:({isActive:e})=>e?"helpgent-active":""},(0,N.__)("Responses","helpgent")," (",O,")"),(0,a.createElement)(f,{to:`${y}/${b}/summary`,className:({isActive:e})=>e?"helpgent-active":""},(0,N.__)("Summary","helpgent"))),(0,a.createElement)("div",{className:"helpgent-sidebar__quick-action helpgent-d-flex"},(0,a.createElement)(I,{to:"#",className:"helpgent-sidebar__quick-action-link helpgent-sidebar__quick-action-refresh "+(Y?"helpgent-sidebar__quick-action-refreshing":""),onClick:e=>function(e){e.preventDefault(),w.invalidateQueries([`helpgent-responses-${D}`]),w.invalidateQueries(["helpgent-response-form"]),w.invalidateQueries([`helpgent-${z}`]),w.invalidateQueries([`helpgent-${_}`])}(e)},(0,a.createElement)(i.A,{src:m.A})),e&&(0,a.createElement)("div",{className:"helpgent-sidebar__quick-action-link helpgent-sidebar__quick-action-dropdown"},(0,a.createElement)(o.A,{className:"helpgent-quick-action-dropdown",dropDownIcon:u.A,dropdownList:[{name:"archive",icon:h.A,text:(0,N.__)("Archive","helpgent")}],placement:"left",handleDropdownTrigger:function(e,a){e.preventDefault(),"archive"===a&&(n({...t,status:"archive",responseQueryKey:"archive"}),w.invalidateQueries([`helpgent-responses-${D}`]),w.invalidateQueries([`helpgent-${z}`]))},Link:I})))),"archive"===j&&e&&(0,a.createElement)("div",{className:"helpgent-sidebar__archive helpgent-d-flex"},(0,a.createElement)("span",{className:"helpgent-sidebar__archive-title"},(0,a.createElement)(i.A,{src:h.A}),(0,a.createElement)("span",null,(0,N.__)("Archive","helpgent"))),(0,a.createElement)("div",{className:"helpgent-sidebar__archive-remove",onClick:function(){n({...t,status:null,responseQueryKey:"all"}),w.invalidateQueries([`helpgent-responses-${D}`]),w.invalidateQueries([`helpgent-${z}`])}},(0,a.createElement)(i.A,{src:M.A}))))}},71899:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGQ9Ik0zMDQgNDhhNDggNDggMCAxIDAgLTk2IDAgNDggNDggMCAxIDAgOTYgMHptMCA0MTZhNDggNDggMCAxIDAgLTk2IDAgNDggNDggMCAxIDAgOTYgMHpNNDggMzA0YTQ4IDQ4IDAgMSAwIDAtOTYgNDggNDggMCAxIDAgMCA5NnptNDY0LTQ4YTQ4IDQ4IDAgMSAwIC05NiAwIDQ4IDQ4IDAgMSAwIDk2IDB6TTE0Mi45IDQzN0E0OCA0OCAwIDEgMCA3NSAzNjkuMSA0OCA0OCAwIDEgMCAxNDIuOSA0Mzd6bTAtMjk0LjJBNDggNDggMCAxIDAgNzUgNzVhNDggNDggMCAxIDAgNjcuOSA2Ny45ek0zNjkuMSA0MzdBNDggNDggMCAxIDAgNDM3IDM2OS4xIDQ4IDQ4IDAgMSAwIDM2OS4xIDQzN3oiLz48L3N2Zz4K"},78242:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(51609),i=n(56427),r=n(4286),o=n(27723);function l(e){const{children:t,title:n,className:l,AlertContent:s,onCancel:c,onFooterCancel:p,onSubmit:g,hasCancelButton:d,hasSubmitButton:h,isDisableAction:u,submitText:m,cancelText:M,cancelBtnType:N,submitBtnType:w="danger",isDismissible:x}=e;return(0,a.createElement)(i.Modal,{title:n,overlayClassName:`helpgent-modal helpgent-modal-default ${l}`,onRequestClose:c,isDismissible:x},(0,a.createElement)(r.jN,null,t,!u&&(0,a.createElement)("div",{className:`helpgent-modal-action ${l}-action`},d&&(0,a.createElement)("a",{href:"#",className:`helpgent-btn helpgent-btn-${N||"light"} helpgent-btn-md helpgent-modal-action__cancel`,onClick:e=>{e.preventDefault(),p?p():c()}},M||(0,o.__)("Cancel","helpgent")),h&&(0,a.createElement)("a",{href:"#",className:`helpgent-btn helpgent-btn-md helpgent-modal-action__btn helpgent-btn-${w}`,onClick:e=>{e.preventDefault(),g()}},m))))}},80444:(e,t,n)=>{n.d(t,{A:()=>a}),n(51609);const a="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOS4wMzEiIGhlaWdodD0iMTkuMDMxIiB2aWV3Qm94PSIwIDAgMTkuMDMxIDE5LjAzMSI+CiAgPGcgaWQ9ImV4cGFuZCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAwKSI+CiAgICA8cGF0aCBpZD0iUGF0aF8xMjQ5IiBkYXRhLW5hbWU9IlBhdGggMTI0OSIgZD0iTTIxLjA2OSwxNS41YTEuMTkzLDEuMTkzLDAsMCwwLTEuMTkzLDEuMTkzdjEuMTkzYTEuOTg5LDEuOTg5LDAsMCwxLTEuOTg5LDEuOTg5SDE2LjY5M2ExLjE5MywxLjE5MywwLDAsMCwwLDIuMzg3aDEuMTkzYTQuMzgsNC4zOCwwLDAsMCw0LjM3Ni00LjM3NlYxNi42OTNBMS4xOTMsMS4xOTMsMCwwLDAsMjEuMDY5LDE1LjVaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMy4yMzEgLTMuMjMxKSIgZmlsbD0iI2ZmZiIvPgogICAgPHBhdGggaWQ9IlBhdGhfMTI1MCIgZGF0YS1uYW1lPSJQYXRoIDEyNTAiIGQ9Ik01LjU2OSwwSDQuMzc2QTQuMzgsNC4zOCwwLDAsMCwwLDQuMzc2VjUuNTY5YTEuMTkzLDEuMTkzLDAsMCwwLDIuMzg3LDBWNC4zNzZBMS45ODksMS45ODksMCwwLDEsNC4zNzYsMi4zODdINS41NjlBMS4xOTMsMS4xOTMsMCwwLDAsNS41NjksMFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMCkiIGZpbGw9IiNmZmYiLz4KICAgIDxwYXRoIGlkPSJQYXRoXzEyNTEiIGRhdGEtbmFtZT0iUGF0aCAxMjUxIiBkPSJNNS41NjksMTkuODc2SDQuMzc2YTEuOTg5LDEuOTg5LDAsMCwxLTEuOTg5LTEuOTg5VjE2LjY5M2ExLjE5MywxLjE5MywwLDAsMC0yLjM4NywwdjEuMTkzYTQuMzgsNC4zOCwwLDAsMCw0LjM3Niw0LjM3Nkg1LjU2OWExLjE5MywxLjE5MywwLDEsMCwwLTIuMzg3WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtMy4yMzEpIiBmaWxsPSIjZmZmIi8+CiAgICA8cGF0aCBpZD0iUGF0aF8xMjUyIiBkYXRhLW5hbWU9IlBhdGggMTI1MiIgZD0iTTE3Ljg4NywwSDE2LjY5M2ExLjE5MywxLjE5MywwLDAsMCwwLDIuMzg3aDEuMTkzYTEuOTg5LDEuOTg5LDAsMCwxLDEuOTg5LDEuOTg5VjUuNTY5YTEuMTkzLDEuMTkzLDAsMSwwLDIuMzg3LDBWNC4zNzZBNC4zOCw0LjM4LDAsMCwwLDE3Ljg4NywwWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMuMjMxIDApIiBmaWxsPSIjZmZmIi8+CiAgPC9nPgo8L3N2Zz4K"},85692:(e,t,n)=>{n.d(t,{Wx:()=>c});var a=n(51609),i=(Object.defineProperty,new Map),r=new WeakMap,o=0,l=void 0;function s(e,t,n={},a=l){if(void 0===window.IntersectionObserver&&void 0!==a){const i=e.getBoundingClientRect();return t(a,{isIntersecting:a,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:s,observer:c,elements:p}=function(e){const t=function(e){return Object.keys(e).sort().filter(t=>void 0!==e[t]).map(t=>{return`${t}_${"root"===t?(n=e.root,n?(r.has(n)||(o+=1,r.set(n,o.toString())),r.get(n)):"0"):e[t]}`;var n}).toString()}(e);let n=i.get(t);if(!n){const a=new Map;let r;const o=new IntersectionObserver(t=>{t.forEach(t=>{var n;const i=t.isIntersecting&&r.some(e=>t.intersectionRatio>=e);e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(n=a.get(t.target))||n.forEach(e=>{e(i,t)})})},e);r=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:a},i.set(t,n)}return n}(n),g=p.get(e)||[];return p.has(e)||p.set(e,g),g.push(t),c.observe(e),function(){g.splice(g.indexOf(t),1),0===g.length&&(p.delete(e),c.unobserve(e)),0===p.size&&(c.disconnect(),i.delete(s))}}function c({threshold:e,delay:t,trackVisibility:n,rootMargin:i,root:r,triggerOnce:o,skip:l,initialInView:c,fallbackInView:p,onChange:g}={}){var d;const[h,u]=a.useState(null),m=a.useRef(g),[M,N]=a.useState({inView:!!c,entry:void 0});m.current=g,a.useEffect(()=>{if(l||!h)return;let a;return a=s(h,(e,t)=>{N({inView:e,entry:t}),m.current&&m.current(e,t),t.isIntersecting&&o&&a&&(a(),a=void 0)},{root:r,rootMargin:i,threshold:e,trackVisibility:n,delay:t},p),()=>{a&&a()}},[Array.isArray(e)?e.toString():e,h,r,i,o,l,n,p,t]);const w=null==(d=M.entry)?void 0:d.target,x=a.useRef(void 0);h||!w||o||l||x.current===w||(x.current=w,N({inView:!!c,entry:void 0}));const y=[u,M.inView,M.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}a.Component},88039:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(26374),i=n(68469);const r=(e,t)=>(0,a.n)(n=>"object"==typeof n?(n.id&&n.data&&(e=`${e}/${n.id}`,n=n.data),(0,i.A)(e,n,t)):(e=n?`${e}/${n}`:e,(0,i.A)(e,n||{},t)))},88141:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(51609),i=n(86087),r=n(65604),o=n(16622),l=n(67076),s=n(60518),c=n(5781),p=n(87855),g=n(6945),d=n(88887);const h=(0,i.forwardRef)((e,t)=>{const{file:n}=e;return(0,a.createElement)(d.bn,null,(0,a.createElement)("div",{className:"helpgent-file-upload-answer",ref:t||null},(0,a.createElement)("div",{className:"helpgent-file-upload-answer__info"},(0,a.createElement)("div",{className:"helpgent-file-upload-answer__media"},"picture"===o.O9[n?.mime_type]&&(0,a.createElement)("img",{src:n.url,alt:""}),"video"===o.O9[n?.mime_type]&&(0,a.createElement)("video",{src:n.url}),"voice"===o.O9[n?.mime_type]&&(0,a.createElement)(r.A,{src:c.A}),"pdf"===o.O9[n?.mime_type]&&(0,a.createElement)(r.A,{src:p.A}),"pdf"!==o.O9[n?.mime_type]&&"voice"!==o.O9[n?.mime_type]&&"video"!==o.O9[n?.mime_type]&&"picture"!==o.O9[n?.mime_type]&&(0,a.createElement)(r.A,{src:s.A})),(0,a.createElement)("div",{className:"helpgent-file-upload-answer__text"},(0,a.createElement)("span",{className:"helpgent-file-upload-answer__filename"},n?.title),(0,a.createElement)("span",{className:"helpgent-file-upload-answer__fileSize"},(0,g.w3)(n?.file_size)))),(0,a.createElement)("div",{className:"helpgent-file-upload-answer__action"},(0,a.createElement)("a",{href:n?.url,className:"helpgent-file-upload-answer__download"},(0,a.createElement)(r.A,{src:l.A,download:!0})))))})},88887:(e,t,n)=>{n.d(t,{$G:()=>o,CB:()=>s,Jp:()=>c,Yn:()=>l,bn:()=>p,x9:()=>i,zD:()=>r});var a=n(38267);const i=a.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)
    }
`,r=a.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;
        }
    }
`,o=a.Ay.div`

`,l=a.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);
                }
            }
        }
    }
`,s=a.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);
            }
        }
    }
`,c=a.Ay.div`

`,p=a.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:()=>i});var a=n(27723);function i(e){let t="";switch(e){case 404:t=(0,a.__)("Resource not found","helpgent");break;case 400:t=(0,a.__)("Invalid Request","helpgent");break;case 422:t=(0,a.__)("Invalid data","helpgent");break;case 500:t=(0,a.__)("Internal server error","helpgent");break;default:t=(0,a.__)("Technical error","helpgent")}return t}},92283:(e,t,n)=>{n.d(t,{A:()=>p});var a=n(51609),i=n(86087),r=n(65604),o=n(27716),l=n(5591),s=n(74618),c=n(71899);function p({className:e,dropDownText:t,dropDownIcon:n,dropdownList:p,placement:g,handleDropdownTrigger:d,Link:h,tooltipText:u,customItem:m,topPosition:M}){p=Array.isArray(p)?p.map(e=>({...e,isLoading:!1})):[];const N=(0,i.useRef)(null),[w,x]=(0,i.useState)(p),[y,L]=(0,i.useState)(!1),v=`helpgent-dropdown ${y?"helpgent-dropdown-open ":""}${e&&e} helpgent-dropdown-${g}`;function I(e,t,n){return e.map((e,a)=>a!==t?e:{...e,...n})}return(0,s.A)(".helpgent-dropdown-open",".helpgent-dropdown__content",40),(0,i.useEffect)(()=>{(0,o.A)(y,L,N)},[y]),(0,a.createElement)("div",{className:v,ref:N},(0,a.createElement)("a",{href:"#",className:"helpgent-dropdown__toggle helpgent-dropdown__toggle-icon-only",onClick:function(e){e.preventDefault(),L(!y),(0,l.A)(e,".helpgent-dropdown",".helpgent-dropdown__content",null,M||40,!1,"right")},"data-tooltip":""!==u?u:""},t||null,n?(0,a.createElement)("span",{className:"helpgent-dropdown-icon"},(0,a.createElement)(r.A,{src:n})):null),(0,a.createElement)("ul",{className:y?"helpgent-dropdown__content helpgent-show":"helpgent-dropdown__content"},(0,a.createElement)("li",null,m),w&&w.map((e,t)=>{let n=null;return n="blank"===e.target&&e.url?e.url:"blank"!==e.target&&e.url?`/${e.url}`:"#",(0,a.createElement)("li",{key:t},h?(0,a.createElement)(h,{to:n,onClick:async a=>{if("#"!==n)return void L(!1);if(e.isLoading)return;let i=I(w,t,{isLoading:!0});x(i),await d(a,e.name),i=I(i,t,{isLoading:!1}),x(i),L(!1)},className:e.className?e.className:"",target:"blank"===e.target?"_blank":null},e.isLoading||e.icon?(0,a.createElement)("span",{className:"helpgent-dropdown-item-icon"+(e.isLoading?" helpgent-animate-spin":"")},(0,a.createElement)(r.A,{src:e.isLoading?c.A:e.icon})):"",e.text):(0,a.createElement)("a",{href:n,onClick:t=>"#"===n&&(L(!1),d(t,e.name)),className:e.className?e.className:"",target:"blank"===e.target?"_blank":null},e.icon?(0,a.createElement)("span",{className:"helpgent-dropdown-item-icon"},(0,a.createElement)(r.A,{src:e.icon})):"",e.text))})))}},93844:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_t});var a=n(51609),i=n(86087),r=n(64943),o=n(45907),l=n(71474),s=n(65604),c=n(2192),p=n(27723);function g(e){const{moduleState:t,queryClient:n}=e;return(0,a.createElement)("div",{className:"helpgent-user-sidebar-top"},(0,a.createElement)("h2",{className:"helpgent-sidebar__title"},(0,p.__)("List of Messages","helpgent")),(0,a.createElement)("a",{href:"#",className:"helpgent-sidebar__quick-action-link helpgent-sidebar__quick-action-refresh",onClick:e=>function(e){e.preventDefault(),n.invalidateQueries([`helpgent-responses-${t?.responseQueryKey}`]),n.invalidateQueries(["helpgent-response-form"]),n.invalidateQueries([`helpgent-${t?.messageQueryKey}`]),n.invalidateQueries([`helpgent-${t?.responseAgentQueryKey}`])}(e)},(0,a.createElement)(s.A,{src:c.A})))}var d=n(11351),h=n(6945),u=n(18562);const m=(0,i.createContext)(),M=()=>(0,i.useContext)(m),N=({children:e})=>{const t={responseData:null,activeResponse:null,orderBy:"latest",status:null,responseQueryKey:(0,u.A)(),messageQueryKey:(0,u.A)(),answerQueryKey:(0,u.A)(),mediaQueryKey:(0,u.A)(),responseAgentQueryKey:"agent-"+(0,u.A)(),responseFormQueryKey:"response-form-"+(0,u.A)(),replyingMessageId:null,conversationMode:"action",replyActivatedIds:[],responseSearchText:"",responseCache:{},sentResponse:[],sentUser:[],forwardSearchInput:"",responseAutoActivate:!0,isActiveResponseDeleteAlert:!1,isConversationSearchActive:!1,messageSearchText:"",debouncedMessageSearchText:"",isConversationDrawerOpen:!1,mediaFilterType:"all",unreadMessages:[],filterByTags:[],messageFetchingEnabled:!0,answerFetchingEnabled:!0,formFetchingEnabled:!0,responseSidebarTopComponent:null,isFormInfoFetchingEnabled:!1},[n,r]=(0,i.useState)(t);return(0,a.createElement)(m.Provider,{value:{responseState:n,setResponseState:r}},e)};var w=n(10426),x=n(38267);const y=x.Ay.ul`
    padding: 4px !important;
    border-radius: 10px;
    background-color: var(--helpgent-color-white);
    gap: 10px;
    li{
        font-size: 14px;
        font-weight: 500;
        padding: 7px 10px;
        cursor: pointer;
        border-radius: 8px;
        margin-bottom: 0;
        color: var(--helpgent-color-light-gray);
        text-align: center;
        &.helpgent-active{
            color: var(--helpgent-color-white);
            background-color: var(--helpgent-color-primary);
            &:hover{
                color: var(--helpgent-color-white);
            }
        }
        &:hover{
            color: var(--helpgent-color-primary);
        }
    }
`,L=x.Ay.div`
    &.helpgent-response-search{
        &.helpgent-response-search-active{
            .helpgent-form-group__element{
                background-color: var(--helpgent-color-white);
            }
        }
    }
    .helpgent-tag-search{
        position: absolute;
        right: 6px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        cursor: pointer;
        background-color: var(--helpgent-color-bg-gray);
    }
    .helpgent-badge{
        position: absolute;
        top: -4px;
        left: -6px;
        font-size: 10px;
        font-weight: 700;
        width: 18px;
        height: 18px;
        box-sizing: border-box;
    }
    .helpgent-form-group__element{
        border-radius: 10px;
        height: 44px;
        box-shadow: 0 2px 5px rgba(144,144,144,.10);
        background-color: var(--helpgent-color-bg-deep);
    }
`,v=x.Ay.div`
    margin-bottom: 7px;
    .helpgent-response-filter__archive{
        cursor: pointer;
    }
    .helpgent-response-filter__archive,
    .helpgent-response-filter__right{
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        font-weight: 500;
        color: var(--helpgent-color-light-gray);
        width: 100%;
    }
    .helpgent-response-filter__right{
        .helpgent-select{
            width: calc(100% + 20px);
        }
        .helpgent-select__control{
            min-width: auto;
            &--is-focused{
                outline: 0;
                box-shadow: none;
                border: 0 none;
            }
        }
        .helpgent-select__menu{
            width: calc(100% + 20px);
            margin-left: -20px;
            margin-top: 3px;
        }
    }
    .helpgent-select__control{
        padding: 0;
        background: none;
        min-width: 55px;
    }
    .helpgent-select__value-container{
        padding: 0;
    }
    .helpgent-select__single-value{
        font-size: 14px;
        font-weight: 500;
        color: var(--helpgent-color-light-gray);
    }
`,I=x.Ay.ul`
    height: calc(100% - 320px);
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0 -10px;
    @media only screen and (max-width: 1399px){
        height: calc(100% - 260px);
    }
    @media only screen and (max-width: 991px){
        height: 300px;
    }
    .helpgent-response-item{
        display: flex;
        align-items: flex-start;
        padding: 15px;
        border-radius: 10px;
        margin-bottom: 0;
        transition: .3s background-color ease-in-out;
        background-color: transparent;
        cursor: pointer;
        position: relative;
        &:hover,
        &.helpgent-active {
            background-color: var(--helpgent-color-white);
        }
        @media only screen and (max-width: 991px){
            gap: 10px;
        }
        .helpgent-response-item__action{
            @media only screen and (max-width: 991px){
                position: absolute;
                right: 0;
                top: 10px;
            }
        }
    }
    .helpgent-response-item__icon{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin-right: 12px;
        background-color: var(--helpgent-color-dark);
    }
    .helpgent-response-item__media{
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin-right: 12px;
        flex: none;
        @media only screen and (max-width: 991px){
            margin-right: 0;
        }
        img{
            width: 40px;
            height: 40px;
            border-radius: 50%;
        }
    }
    .helpgent-response-item__content{
        flex: 1;
    }
    .helpgent-response-item__name{
        font-size: 16px;
        font-weight: 600;
        margin: 0 0 6px;
        color: var(--helpgent-color-dark);
    }
    .helpgent-response-item__last-message{
        font-size: 13px;
        width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--helpgent-color-gray);
    }
    .helpgent-response-item__last-attachment{
        align-items: center;
        svg{
            width: 13px;
            height: 13px;
            margin-right: 6px;
            path{
                fill: var(--helpgent-color-extra-light);
            }
        }
        .helpgent-response-item__last-attachment-name{
            font-size: 13px;
            font-weight: 400;
            color: var(--helpgent-color-gray);
        }
    }
    .helpgent-response-item__last-message-time{
        font-size: 12px;
        margin-top: 1px;
        color: var(--helpgent-color-light-gray);
    }
    .helpgent-response-item__assigned-tags{
        display: flex;
        flex-wrap: wrap;
        margin: 8px 0 0;
        gap: 5px;
        &:empty{
            display: none;
        }
        li{
            &.helpgent-tag-badge{
                font-size: 10px;
                font-weight: 600;
                line-height: 1.2;
                padding: 2px 5px;
                border-radius: 5px;
                text-transform: uppercase;
                background-color: var(--helpgent-color-bg-deep);
                word-wrap: break-word;
                word-break: break-word;
                transition: var(--helpgent-transition);
                &:hover{
                    color: var(--helpgent-color-white);
                    background-color: var(--helpgent-color-dark);
                }
            }
        }
    }
    .helpgent-response-item__action{
        display: flex;
        align-items: center;
    }
    .helpgent-unread-pointer{
        display: block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        margin-right: 6px;
        background-color: var(--helpgent-color-danger);
    }
    .helpgent-response-dropdown{
        .helpgent-dropdown__toggle{
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background-color: transparent;
            span{
                line-height: 0;
            }
            &:hover,
            &.helpgent-dropdown-open{
                background-color: var(--helpgent-color-bg-deep);
            }
        }
        .helpgent-dropdown__content{
            margin-top: 15px;
            li:last-child{
                border-top: 1px solid var(--helpgent-color-border-light);
                a{
                    margin-top: 10px;
                }
            }
        }
    }
`,f=x.Ay.div`
    padding: 0 30px 25px;
    .helpgent-conversation-delete__label{
        font-size: 16px;
        font-weight: 500;
        margin: 0;
        color: var(--helpgent-color-dark);
        padding: 0;
    }
`;function b(e){const{paramsHook:t}=(0,h.Xd)("helpgent_router_references",null),{id:n}=t(),{getStoreData:i}=(0,w.A)(),r=i(["helpgent-response-form"]),{responseState:o,setResponseState:l}=M(),{status:s}=o,c=r&&r.form.total_response.completed,g=r&&r.form.total_response.incompleted,d=r&&parseInt(c)+parseInt(g);function u(e){l({...o,status:e,responseQueryKey:e}),(0,h.CS)("helpgent_responseQueryKey",e)}return(0,a.createElement)(y,{className:"helpgent-d-flex"},(0,a.createElement)("li",{className:null===s?"helpgent-response-tab-single helpgent-active":"helpgent-response-tab-single",onClick:()=>u(null)},(0,p.__)("All","helpgent")," (",d||0,")"),(0,a.createElement)("li",{className:"completed"===s?"helpgent-response-tab-single helpgent-active":"helpgent-response-tab-single",onClick:()=>u("completed")},(0,p.__)("Completed","helpgent")," (",c||0,")"),(0,a.createElement)("li",{className:"incompleted"===s?"helpgent-response-tab-single helpgent-active":"helpgent-response-tab-single",onClick:()=>u("incompleted")},(0,p.__)("Incomplete","helpgent")," (",g||0,")"))}var j=n(63064),D=n(29016),z=n(78242),_=n(97792),A=n(14971),E=n(23371);function C(e){const{paramsHook:t}=(0,h.Xd)("helpgent_router_references",null),{assignedTagList:n,setAssignedTagList:o,baseApiRoute:l}=e,{responseState:s,setResponseState:c}=M(),[g,d]=(0,i.useState)([]),{activeResponse:u}=s,{id:m}=t(),{data:N,isLoading:w,isError:x,errorMessage:y,isFetching:L}=(0,r.A)(["helpgent-form-tag-list"],`${l.forms}/${m}/tags`);function v(){const e=N.tags.slice(0,8);d(e)}return(0,i.useEffect)(()=>{N&&(N.tags.length>8?v():d(N.tags))},[w]),(0,a.createElement)("div",{className:"helpgent-modal-filter-inner"},(0,a.createElement)("div",{className:"helpgent-modal-filter__tags"},(0,a.createElement)("span",{className:"helpgent-modal-filter__tags-label"},(0,p.__)("Search By Tags","helpgent")),(0,a.createElement)("div",{className:"helpgent-modal-filter__tags-inner"},w?(0,a.createElement)(a.Fragment,null,(0,p.__)("Loading","helpgent")):0===g.length?(0,a.createElement)("span",{className:"helpgent-no-tags"},(0,p.__)("There are no tags in this form","helpgent")):(0,a.createElement)(a.Fragment,null,(0,a.createElement)("ul",{className:"helpgent-modal-filter__tags-list helpgent-scrollbar-style"},g.map((e,t)=>(0,a.createElement)("li",{className:"helpgent-modal-filter__tags-item",key:t},(0,a.createElement)(E.A,{id:`helpgent-response-tag-${e.id}`,label:e.title&&e.title,onChange:()=>function(e){if(n.includes(e)){const t=n.filter(t=>t!==e);o(t)}else o([...n,e])}(e.id),checked:!!n.some(t=>t===e.id)})))),N.tags.length>8&&(0,a.createElement)("span",{className:"helpgent-show-more",onClick:e=>{!function(e){g.length>8?(v(),e.target.classList.remove("helpgent-show-more--active")):(d(N.tags),e.target.classList.add("helpgent-show-more--active"))}(e)}},(0,p.__)("Show","helpgent")," ",g.length>8?(0,p.__)("less","helpgent"):(0,p.__)("more","helpgent"))))))}function T(e){const{isClientModeActive:t,baseApiRoute:n}=e,r=(0,j.jE)(),{responseState:o,setResponseState:l}=M(),{getStoreData:c}=(0,w.A)(),[g,d]=(0,i.useState)([]),{activeResponse:u,responseQueryKey:m,filterByTags:N}=o,[x,y]=(0,i.useState)(""),[v,I]=(0,i.useState)(!1),f=(0,D.d)(x,250);return(0,i.useEffect)(()=>{l({...o,responseQueryKey:`${m}-${f}`,responseSearchText:f}),(0,h.CS)("helpgent_responseQueryKey",`${m}-${f}`),r.invalidateQueries([`helpgent-responses-${m}`])},[f]),(0,i.useEffect)(()=>{d([...N])},[N]),(0,a.createElement)(L,{className:N.length>0?"helpgent-response-search helpgent-response-search-active":"helpgent-response-search"},(0,a.createElement)("div",{className:"helpgent-form-group helpgent-form-icon-left"},(0,a.createElement)("span",{className:"helpgent-input-icon"},(0,a.createElement)(s.A,{src:_.A})),(0,a.createElement)("input",{type:"text",className:"helpgent-form-group__element",placeholder:(0,p.__)("Search","helpgent"),value:x,onChange:e=>y(e.target.value)}),!t&&(0,a.createElement)("span",{className:"helpgent-tag-search",onClick:function(){I(!0)}},N.length>0&&(0,a.createElement)("span",{className:"helpgent-badge helpgent-badge-primary helpgent-badge-circle"},N.length),(0,a.createElement)(s.A,{src:A.A}))),v&&(0,a.createElement)(z.A,{title:(0,p.__)("Filter","helpgent"),className:"helpgent-modal-filter",onCancel:function(){I(!1)},onFooterCancel:function(){d([])},onSubmit:function(){l({...o,responseQueryKey:`tag-filter-${m}`,filterByTags:[...g]}),(0,h.CS)("helpgent_responseQueryKey",`tag-filter-${m}`),r.invalidateQueries([`helpgent-responses-${m}`]),I(!1)},cancelText:(0,p.__)("Clear all","helpgent"),submitText:(0,p.__)("Apply","helpgent"),hasCancelButton:!0,hasSubmitButton:!0,submitBtnType:"primary"},(0,a.createElement)(C,{assignedTagList:g,setAssignedTagList:d,baseApiRoute:n})))}var S=n(85692),k=n(52619),Y=n(92283),O=n(50481),U=n(88039),Q=n(28050);function G(e){const t="1"===e?.is_guest?e?.user_guest:e?.user;return t?(t.isGuest=e?.is_guest,t?.ID&&(t.id=t.ID,delete t.ID),(t?.first_name||""===t?.first_name||t?.last_name||""===t?.last_name)&&(t.display_name=`${t?.first_name} ${t?.last_name}`,delete t.first_name,delete t.last_name),t?.name&&(t.display_name=t.name,delete t.name),(t?.user_email||""===t?.user_email)&&(t.email=t.user_email,delete t.user_email),t):null}var Z=n(16622),R=n(30814),F=n(38930),P=n(49615);const W="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDE0IDE0Ij4KICA8cGF0aCBpZD0iZW52ZWxvcGUtb3BlbiIgZD0iTTEzLjAxMiw0LjU2Niw5LjE5NC45MDhBMy4xLDMuMSwwLDAsMCw0LjgxOS45TC45ODgsNC41NjZBMy4yMjQsMy4yMjQsMCwwLDAsMCw2Ljg4M3YzLjkwOEEzLjIxMiwzLjIxMiwwLDAsMCwzLjIwOCwxNGg3LjU4M0EzLjIxMiwzLjIxMiwwLDAsMCwxNCwxMC43OTJWNi44ODNhMy4yMjQsMy4yMjQsMCwwLDAtLjk4OC0yLjMxOFpNNi4wNDMsMi4xNDdhMS4zNTksMS4zNTksMCwwLDEsMS45MjUuMDEybDMuMTQsMy4wMDhMOC4wMyw4LjMyM2ExLjQ5MywxLjQ5MywwLDAsMS0yLjA2MywwTDIuODUxLDUuMlptNi4yMDcsOC42NDVhMS40NTgsMS40NTgsMCwwLDEtMS40NTgsMS40NThIMy4yMDhBMS40NTgsMS40NTgsMCwwLDEsMS43NSwxMC43OTJWNi44ODNhMS40MDYsMS40MDYsMCwwLDEsLjAyOS0uMjc2TDQuNzMxLDkuNTYxYTMuMjIyLDMuMjIyLDAsMCwwLDQuNTQ1LS4wMDhsMi45MzEtM2ExLjQzMiwxLjQzMiwwLDAsMSwuMDQzLjMzNVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMCkiLz4KPC9zdmc+Cg==";var B=n(60518);function H(){return(0,a.createElement)(f,null,(0,a.createElement)("div",{className:"helpgent-alert-content"},(0,a.createElement)("p",null,(0,p.__)("All data associated with this response will be deleted forever.","helpgent")),(0,a.createElement)("p",null,(0,a.createElement)("em",null,(0,p.__)("Once deleted, responses cannot be recovered.","helpgent")))))}const J=(0,i.forwardRef)((e,t)=>{const{response:n,data:r,isClientModeActive:o,baseApiRoute:l}=e,{responseState:c,setResponseState:g}=M(),[d,u]=(0,i.useState)(!1),{activeResponse:m,responseQueryKey:N,messageQueryKey:w,answerQueryKey:x}=c,y=m&&m.id,L=n&&G(n),v=n&&n?.message&&G(n?.message),I=(0,j.jE)(),{mutateAsync:f,isLoading:b,error:D}=(0,U.A)(`${l?.responses}/${n?.id}`),{mutateAsync:_,isLoading:A}=(0,Q.A)(`${l?.responses}/${n?.id}/read`),{mutateAsync:E,isLoading:C}=(0,Q.A)(`/helpgent/message/${m?.message?.id}/read`),{mutateAsync:T,isLoading:S}=(0,Q.A)(`${l?.responses}/${n.id}/archive`);return(0,a.createElement)("li",{className:y===n?.id?"helpgent-response-item helpgent-active":"helpgent-response-item",ref:t||null,onClick:e=>async function(e,t,a){if(e.target.closest(".helpgent-response-item__action"))return;if(g({...c,activeResponse:n,answerQueryKey:`answer-${t}`,messageQueryKey:`message-${t}`,responseAgentQueryKey:`agent-${t}`,responseFormQueryKey:`response-form-${t}`,debouncedMessageSearchText:"",isConversationSearchActive:!1,answerFetchingEnabled:!0,messageFetchingEnabled:!0}),m.id!==t&&"0"===a&&!o)try{const e={is_read:1};await _(e),I.invalidateQueries(`helpgent-responses-${N}`)}catch(e){console.log(e)}if(o&&n?.message){const e=async()=>{try{const e={response_id:n?.id,is_read:1};await E(e),I.invalidateQueries(`helpgent-responses-${N}`)}catch(e){console.log(e)}};("0"===n?.message?.is_read&&L?.id!==v?.id||L?.id===v?.id&&n?.is_guest!==n?.message?.is_guest)&&await e()}const i=document.querySelector(".helpgent-conversation-main"),r=document.querySelector(".helpgent-sidebar");i.classList.add("helpgent-conversation-main--active"),r.classList.remove("helpgent-sidebar--active")}(e,n?.id,n?.is_read)},L?(0,a.createElement)("div",{className:"helpgent-response-item__media"},L?.avatar_url?(0,a.createElement)(O.A,{src:L?.avatar_url,alt:(0,p.__)("Helpgent Media","helpgent")}):(0,a.createElement)("span",null,L?.display_name.slice(0,2))):(0,a.createElement)("div",{className:"helpgent-response-item__icon"},(0,a.createElement)(s.A,{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOS45OTgiIGhlaWdodD0iMTguNTU0IiB2aWV3Qm94PSIwIDAgMTkuOTk4IDE4LjU1NCI+CiAgPGcgaWQ9IkhlbHBHZW50X0ljb24iIGRhdGEtbmFtZT0iSGVscEdlbnQgSWNvbiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEgLTE5LjUpIiBvcGFjaXR5PSIwLjUiPgogICAgPHBhdGggaWQ9IlBhdGhfMTU3OCIgZGF0YS1uYW1lPSJQYXRoIDE1NzgiIGQ9Ik0yMC4yMjYsMjQuMTcxQTEuMywxLjMsMCwwLDAsMTguOCwyNC40bC0xLjU2OSwxLjQ1OXYtMS40YzAtLjA3NSwwLS4xNDksMC0uMjI0QTQuOTUyLDQuOTUyLDAsMCwwLDEyLjI3NiwxOS41SDUuOTUzQTQuOTQ2LDQuOTQ2LDAsMCwwLDEsMjQuNDUzdjYuMzE0YTQuOTYsNC45NiwwLDAsMCwzLjc2NSw0LjgxNnYxLjUzN2EuOTUyLjk1MiwwLDAsMCwuMS40MTYuOTM4LjkzOCwwLDAsMCwxLjI1NS40Mmw0LjQtMi4yMDgsMS4zNjktLjAyNGguMzg0cS4xNzEsMCwuMzQxLS4wMTJhNC41MjEsNC41MjEsMCwwLDAsLjYwOC0uMDc4LDQuOTU4LDQuOTU4LDAsMCwwLDQuMDA4LTQuNjQ0YzAtLjA3NSwwLS4xNDksMC0uMjI0di0uODE2bDEuNTczLDEuNDU5YTEuMzIzLDEuMzIzLDAsMCwwLC44OTQuMzQ1LDEuMjg0LDEuMjg0LDAsMCwwLC41MjktLjExNEExLjIzNCwxLjIzNCwwLDAsMCwyMSwzMC41VjI1LjMwOEExLjIyMiwxLjIyMiwwLDAsMCwyMC4yMjYsMjQuMTcxWk05LjU4MSwzMy4yNDYsNy41LDM0LjI5YS4zNzEuMzcxLDAsMCwxLS4xNTcuMDM5LjM1NS4zNTUsMCwwLDEtLjM1Ny0uMzUzVjMyLjgzOUE1LjUyOCw1LjUyOCwwLDAsMSwzLjYsMjcuNzQ0aDBhNS41MjcsNS41MjcsMCwwLDEsNS41MjYtNS41MjZoMGE1LjUyNCw1LjUyNCwwLDAsMSwuNDU1LDExLjAyOVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDApIiBmaWxsPSIjZmZmIi8+CiAgICA8ZyBpZD0iR3JvdXBfMjg0OCIgZGF0YS1uYW1lPSJHcm91cCAyODQ4IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1LjU5NyAyNi45NDcpIj4KICAgICAgPGNpcmNsZSBpZD0iRWxsaXBzZV8zMjMiIGRhdGEtbmFtZT0iRWxsaXBzZSAzMjMiIGN4PSIwLjc5MiIgY3k9IjAuNzkyIiByPSIwLjc5MiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNS4yMzUgMC4xNjIpIiBmaWxsPSIjZmZmIi8+CiAgICAgIDxjaXJjbGUgaWQ9IkVsbGlwc2VfMzI0IiBkYXRhLW5hbWU9IkVsbGlwc2UgMzI0IiBjeD0iMC43OTIiIGN5PSIwLjc5MiIgcj0iMC43OTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIuNjk4IDAuMTYyKSIgZmlsbD0iI2ZmZiIvPgogICAgICA8Y2lyY2xlIGlkPSJFbGxpcHNlXzMyNSIgZGF0YS1uYW1lPSJFbGxpcHNlIDMyNSIgY3g9IjAuNzkyIiBjeT0iMC43OTIiIHI9IjAuNzkyIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDAuMzY0KSByb3RhdGUoLTEzLjI4NikiIGZpbGw9IiNmZmYiLz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo="})),(0,a.createElement)("div",{className:"helpgent-response-item__content"},L?(0,a.createElement)("h4",{className:"helpgent-response-item__name"},L?.display_name):(0,a.createElement)("h4",{className:"helpgent-response-item__name"},(0,p.__)("Anonymous","helpgent")," (#",n?.id,")"),n?.message&&(0,a.createElement)("div",{className:"helpgent-response-item__last-message"},n?.message?.message&&n?.message?.message,n?.message?.attachment&&(0,a.createElement)("div",{className:"helpgent-response-item__last-attachment helpgent-d-flex"},(0,a.createElement)(s.A,{src:Z.de[n?.message?.attachment?.mime_type]||B.A}),(0,a.createElement)("span",{className:"helpgent-response-item__last-attachment-name"},n?.message?.attachment?.title))),(0,a.createElement)("div",{className:"helpgent-response-item__last-message-time"},(0,h.Mi)(n?.message?n?.message?.created_at:n?.created_at),null!==n?.message&&(0,a.createElement)("span",null," ago")),0!==n?.tags?.length&&(0,a.createElement)("ul",{className:"helpgent-response-item__assigned-tags"},n?.tags?.map((e,t)=>(0,a.createElement)("li",{className:"helpgent-tag-badge",style:{backgroundColor:e?.color},key:t},e?.title)))),(0,a.createElement)("div",{className:"helpgent-response-item__action"},(o?"0"===n?.message?.is_read&&L?.id!==v?.id||"0"===n?.message?.is_read&&L?.id===v?.id&&n?.is_guest!==n?.message?.is_guest:"0"===n?.is_read||helpgent_current_user?.id!==parseInt(v?.id)&&"0"===n?.message?.is_read&&L?.id===v?.id&&n?.is_guest===n?.message?.is_guest)&&(0,a.createElement)("span",{className:"helpgent-unread-pointer"}),d&&(0,a.createElement)(z.A,{title:(0,p.__)("Delete Response","helpgent"),onCancel:function(){u(!1)},onSubmit:async function(){try{const e=await f();g({...c,activeResponse:null}),u(!1),(0,k.doAction)("helpgent-toast",{message:e.message}),I.invalidateQueries([`helpgent-responses-${N}`]),I.invalidateQueries(["helpgent-response-form"]),I.invalidateQueries([`helpgent-${w}`])}catch(e){}},hasCancelButton:!0,hasSubmitButton:!0,isActiveSubmit:!0,submitText:b?(0,p.__)("Deleting","helpgent"):(0,p.__)("Delete","helpgent"),className:"helpgent-response-delete-alert"},(0,a.createElement)(H,null)),o?null:(0,a.createElement)(Y.A,{className:"helpgent-response-dropdown",dropDownIcon:R.A,dropdownList:(()=>{let e=[{name:"read",icon:W,text:(0,p.__)("Mark as read","helpgent")},{name:"unread",icon:W,text:(0,p.__)("Mark as unread","helpgent")},{name:"archive",icon:P.A,text:(0,p.__)("Archive","helpgent")},{name:"active",icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNOTYgODBjMC0yNi41IDIxLjUtNDggNDgtNDhINDMyYzI2LjUgMCA0OCAyMS41IDQ4IDQ4VjM4NEg5NlY4MHptMzEzIDQ3Yy05LjQtOS40LTI0LjYtOS40LTMzLjkgMGwtMTExIDExMS00Ny00N2MtOS40LTkuNC0yNC42LTkuNC0zMy45IDBzLTkuNCAyNC42IDAgMzMuOWw2NCA2NGM5LjQgOS40IDI0LjYgOS40IDMzLjkgMEw0MDkgMTYxYzkuNC05LjQgOS40LTI0LjYgMC0zMy45ek0wIDMzNmMwLTI2LjUgMjEuNS00OCA0OC00OEg2NFY0MTZINTEyVjI4OGgxNmMyNi41IDAgNDggMjEuNSA0OCA0OHY5NmMwIDI2LjUtMjEuNSA0OC00OCA0OEg0OGMtMjYuNSAwLTQ4LTIxLjUtNDgtNDhWMzM2eiIvPjwvc3ZnPg==",text:(0,p.__)("Active","helpgent")},{name:"delete",icon:F.A,text:(0,p.__)("Delete Response","helpgent")}];return e="0"===n.is_read?e.filter(e=>"unread"!==e.name):e.filter(e=>"read"!==e.name),o&&(e=e.filter(e=>"archive"!==e.name)),e="0"===n.is_archive?e.filter(e=>"active"!==e.name):e.filter(e=>"archive"!==e.name),e})(),placement:"right",handleDropdownTrigger:async function(e,t){switch(e.preventDefault(),t){case"delete":u(!0);break;case"read":try{const e={is_read:1};if(m?.message){const e={response_id:m?.id,is_read:1};await E(e)}const t=await _(e);g({...c,answerFetchingEnabled:!1,messageFetchingEnabled:!1}),(0,k.doAction)("helpgent-toast",{message:t?.message}),I.invalidateQueries(`helpgent-responses-${N}`)}catch(e){console.log(e)}break;case"unread":try{const e={is_read:0};if(m?.message){const e={response_id:m.id,is_read:0};await E(e)}const t=await _(e);g({...c,answerFetchingEnabled:!1,messageFetchingEnabled:!1}),(0,k.doAction)("helpgent-toast",{message:t?.message}),I.invalidateQueries(`helpgent-responses-${N}`)}catch(e){console.log(e)}break;case"archive":try{const e={is_archive:1},t=await T(e);(0,k.doAction)("helpgent-toast",{message:t?.message}),I.invalidateQueries(`helpgent-responses-${N}`)}catch(e){console.log(e)}break;case"active":try{const e={is_archive:0},t=await T(e);(0,k.doAction)("helpgent-toast",{message:t.message}),I.invalidateQueries(`helpgent-responses-${N}`)}catch(e){console.log(e)}}}})))});function X(e){const{data:t,isSuccess:n,isFetchingNextPage:r,hasNextPage:o,fetchNextPage:l,isClientModeActive:s,baseApiRoute:c}=e,{ref:g,inView:d}=(0,S.Wx)();return(0,i.useEffect)(()=>{d&&o&&l()},[d,l,o]),(0,a.createElement)(I,{className:"helpgent-scrollbar-style"},n&&t&&t.pages.map(e=>e.map((n,i)=>e.length===i+1?(0,a.createElement)(J,{ref:g,key:i,data:t,response:n,isClientModeActive:s,baseApiRoute:c}):(0,a.createElement)(J,{key:i,data:t,response:n,isClientModeActive:s,baseApiRoute:c}))),r&&(0,a.createElement)("span",null,(0,p.__)("Loading","helpgent")))}var K=n(88869),V=n(63176);function $(){const{responseState:e,setResponseState:t}=M(),{messageQueryKey:n}=e,i=((0,j.jE)(),[{label:(0,p.__)("Latest","helpgent"),value:"latest"},{label:(0,p.__)("Unread","helpgent"),value:"unread"},{label:(0,p.__)("Read","helpgent"),value:"read"},{label:(0,p.__)("Oldest","helpgent"),value:"oldest"}]);return(0,a.createElement)(v,{className:"helpgent-response-filter helpgent-d-flex helpgent-space-between"},(0,a.createElement)("div",{className:"helpgent-response-filter__right helpgent-d-flex"},(0,a.createElement)(s.A,{src:V.A}),(0,a.createElement)(K.Select,{options:i,defaultValue:i[0],components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null},inputId:"helpgent-response-filter__select",className:"helpgent-select",classNamePrefix:"helpgent-select",isSearchable:!1,placeholder:null,onChange:n=>function(n){t({...e,orderBy:n.value,responseQueryKey:n.value}),(0,h.CS)("helpgent_responseQueryKey",n.value)}(n)})))}function q(e){const{data:t,isSuccess:n,isFetchingNextPage:i,hasNextPage:r,fetchNextPage:o,isClientModeActive:l,baseApiRoute:s}=e,{responseState:c}=M(),{status:p}=c;return(0,a.createElement)(a.Fragment,null,"archive"!==p&&(0,a.createElement)(T,{data:t,isClientModeActive:l,baseApiRoute:s}),"archive"!==p&&!l&&(0,a.createElement)(b,{data:t}),"archive"!==p&&(0,a.createElement)($,null),(0,a.createElement)(X,{data:t,isSuccess:n,isFetchingNextPage:i,hasNextPage:r,fetchNextPage:o,isClientModeActive:l,baseApiRoute:s}))}var ee=n(93832);const te=x.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-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;
                    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-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)
    }
`,ne=x.Ay.div`
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #EDEDED;
    @media only screen and (max-width: 991px){
        flex-wrap: wrap;
    }
    @media only screen and (max-width: 576px){
        flex-wrap: wrap;
    }
    .helpgent-header-top-user-loader{
        min-height: 50px;
        display: flex;
        align-items: center;
        svg{
            width: 20px;
            height: 20px;
            margin: 0;
            &.components-spinner circle, 
            &.components-spinner path{
                stroke-width: 2px;
            }
        }
    }
    .helpgent-form-info-view{
        align-items: center;
        .helpgent-image-wrapper{
            width: 50px;
            height: 50px;
            border-radius: 50%;
            margin-right: 14px;
            img{
                width: 50px;
                height: 50px;
                border-radius: 50%;
            }
        }
    }
    .helpgent-form-info-color-box{
        display: block;
        width: 50px;
        height: 50px;
        margin-right: 14px;
        border-radius: 50%;
    }
    .helpgent-form-info-title{
        display: flex;
        align-items: center;
        font-size: 22px;
        font-weight: 600;
        margin: 0;
        line-height: 1.5;
        color: var(--helpgent-color-dark);
    }
    .helpgent-user-view{
        align-items: center;
        @media only screen and (max-width: 400px){
            flex-wrap: wrap;
        }
    }
    .helpgent-user-view__icon{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        margin-right: 14px;
        background-color: var(--helpgent-color-dark);
    }
    .helpgent-user-view__media{
        width: 50px;
        height: 50px;
        border-radius: 50%;
        margin-right: 14px;
        flex: none;
        .helpgent-image-wrapper{
            width: 100%;
            height: 100%;
        }
        img{
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }
    }
    .helpgent-user-view__name-wrap{
        display: flex;
        align-items: center;
        @media only screen and (max-width: 575px){
            flex-wrap: wrap;
            flex-direction: column;
            align-items: flex-start;
        }
    }
    
    .helpgent-form-title{
        display: block;
        font-size: 15px;
        color: var(--helpgent-color-light-gray);
    }
    .helpgent-user-view__name{
        display: flex;
        align-items: center;
        font-size: 22px;
        font-weight: 600;
        margin: 0;
        line-height: 1.5;
        color: var(--helpgent-color-dark);
    }
    .helpgent-user-verification{
        position: relative;
        top: 1px;
        line-height: 1;
        margin-left: 8px;
        display: flex;
        align-items: center;
        gap: 5px;
        flex: none;
        span{
            font-size: 13px;
            font-weight: 500;
            line-height: 1.25;
            color: var(--helpgent-color-success);
        }
        &.helpgent-unverified{
            span{
                color: var(--helpgent-color-extra-light);
            }
            .helpgent-user-verification__icon{
                background-color: var(--helpgent-color-extra-light);
            }
        }
    }

    .helpgent-user-verification__icon{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background-color: var(--helpgent-color-success);
        svg{
            width: 8px;
            height: 8px;
        }
    }
    .helpgent-user-view__email{
        font-size: 15px;
        color: var(--helpgent-color-light-gray);
    }
    .helpgent-warning-text{
        font-size: 15px;
        font-weight: 400;
        color: var(--helpgent-color-warning);
    }
    .helpgent-user-action{
        align-items: center;
        gap: 15px;
        @media only screen and (max-width: 576px){
            width: 100%;
            justify-content: center;
            margin-top: 10px;
        }
        &.helpgent-user-action--search-active{
            width: 100%;
            .helpgent-user-action__item{
                margin: 0;
            }
        }
        .helpgent-user-action__search{
            width: 100%;
            display: flex;
            align-items: center;
            @media only screen and (max-width: 576px){
                width: auto;
            }
        }
        .helpgent-user-action__search-field{
            flex: 1;
            input{
                font-size: 14px;
                width: 100%;
                min-height: 52px;
                padding: 0;
                border: 0 none;
                box-shadow: 0 0;
                color: var(--helpgent-color-gray);
                background: none;
                &:focus{
                    outline: none;
                }
            }
        }
    }
    .helpgent-user-action__search-toggle{
        svg{
            width: 14px;
            height: 14px;
            path{
                fill: var(--helpgent-color-gray);
            }
        }
    }
    .helpgent-user-action__search-toggle{
        line-height: 0;
        cursor: pointer;
    }
    .helpgent-user-action__item{
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        line-height: 1;
        color: var(--helpgent-color-gray);
        white-space: nowrap;
        svg{
            flex: none;
        }
    }

    .helpgent-conversation-tag{
        padding-left: 25px;
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px 20px;
        line-height: 33px;
        &:before{
            position: absolute;
            content: '';
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            width: 1px;
            height: 18px;
            background: var(--helpgent-color-bg-gray);
        }
        @media only screen and (max-width: 575px){
            padding-left: 0;
            flex-wrap: wrap;
            &:before{
                content: none;
            }
        }
    }
    .helpgent-conversation-tag__add{
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 14px;
        font-weight: 500;
        color: var(--helpgent-color-light-gray);
        text-decoration: none;
        flex: none;
        svg{
            width: 14px;
            height: 14px;
            path{
                fill: var(--helpgent-color-light-gray);
            }
        }
    }
    .helpgent-conversation-tag__list{
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        max-width: 600px;

    }
    .helpgent-conversation-tag__item{
        position: relative;
        padding: 0 2px 0 5px;
        border-radius: 4px;
        display: flex;
        align-items: center;
        line-height: normal;
        min-height: 14px;
        font-size: 10px;
        font-weight: 600;
        color: var(--helpgent-color-gray);
        text-transform: uppercase;
        word-wrap: break-word;
        word-break: break-word;
    }
    .helpgent-conversation-tag__close{
        padding: 4px 3px 4px 4px;
        line-height: 1;
        cursor: pointer;
        /* svg{
            width: 12px;
            height: 12px;
        } */
        &:hover{
            svg{
                path{
                    fill: var(--helpgent-color-danger);
                }
            }
        }
    }

`,ae=x.Ay.div`
    display: flex;
    flex-direction: column-reverse;
    flex: 1;
    height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px 0;
    .helpgent-response-answer{
        .helpgent-conversation{
            margin-bottom: 55px;
        }
    }
    .helpgent-response-message{
        display: flex;
        flex-direction: column-reverse;
        .helpgent-loading{
            display: block;
            text-align: center;
        }
    }
    .helpgent-conversation__content-box{
        &.helpgent-conversation-focused{
            .helpgent-conversation__content{
                position: relative;
                border-radius: 2px 14px 14px 2px;
                box-shadow: 0 2px 20px rgba(0,0,0,.10);
                background-color: var(--helpgent-color-white);
                &:before{
                    position: absolute;
                    left: 0;
                    top: 0;
                    width: 2px;
                    height: 100%;
                    border-radius: 10px;
                    content: '';
                    background-color: var(--helpgent-color-primary);
                }
            }
        }
    }
    .helpgent-conversation__content-box-inner{
        flex: 1;
    }
    .helpgent-conversation-meta{
        display: flex;
        align-items: flex-start;
        margin: -5px -5px 8px;
    }
    .helpgent-conversation-meta__date{
        font-size: 12px;
        font-weight: 500;
        margin: 5px;
        color: var(--helpgent-color-light-gray);
    }
    .helpgent-conversation-meta__username{
        font-size: 15px;
        font-weight: 500;
        margin: 5px;
        color: var(--helpgent-color-dark);
    }
    .helpgent-conversation{
        padding: 0 30px;
        max-width: 600px;
        &.helpgent-conversation-trash{
            opacity: .5;
            user-select: none;
            cursor: not-allowed;
            p{
                color: var(--helpgent-color-dark);
            }
        }
        &.helpgent-conversation-answer{
            /* display: flex;
            flex-direction: column;
            width: 100%; */
            &.helpgent-conversation-right{
                margin-left: auto;
                .helpgent-conversation__top{
                    justify-content: flex-end;
                }
                .helpgent-conversation__icon{
                    order: 2;
                    margin-left: 14px;
                }
                .helpgent-conversation__title{
                    text-align: right;
                }
                .helpgent-conversation-pro{
                    margin-left: auto;
                }
            }
        }
        &.helpgent-conversation-message{
            display: flex;
            flex-direction: column;
            width:100%;
            &:not(:last-child){
                margin-top: 50px;
            }
            &.helpgent-conversation-right,
            &.helpgent-conversation-left{
                flex-direction: row;
                align-items: flex-start;
            }
            &.helpgent-conversation-right{
                align-items: flex-start;
                margin-left: auto;
                box-sizing: border-box;
                .helpgent-conversation__author-image{
                    order: 2;
                    margin-left: 15px;
                }
                .helpgent-conversation-meta{
                    justify-content: flex-end;
                }
                .helpgent-conversation-dropdown{
                    order: -1;
                }
                .helpgent-conversation__content {
                    &.helpgent-conversation__content-inline{
                        border-radius: 14px 0 14px 14px;
                    }
                }
                .helpgent-dropdown__toggle{
                    margin-right: 5px;
                }
            }
            .helpgent-conversation__content{
                &.helpgent-conversation__content-inline.helpgent-conversation__content-video{
                    padding: 0;
                    &.helpgent-conversation__content--deleted{
                        padding: 14px 18px;
                    }
                }
            }
            .helpgent-conversation__author-image{
                width: 40px;
                height: 40px;
                margin-right: 15px;
                border-radius: 50%;
                img{
                    width: 40px;
                    height: 40px;
                    border-radius: 50%;
                }
            }
            .helpgent-conversation__content{
                margin-top: 0;
            }
            .helpgent-conversation-dropdown{
                margin-top: 30px;
            }
            .helpgent-conversation__icon{
                margin-left: 14px;
                margin-right: 0;
            }
            .helpgent-conversation__content-box{
                display: flex;
                align-items: center;
                position: relative;
                width: 100%;
                margin-left: 5px;
                flex-wrap: wrap;
                flex: 1;
            }
            .helpgent-conversation__content{
                flex: 1;
                &.helpgent-conversation__content-inline{
                    border-radius: 0 14px 14px 14px;
                }
                &.helpgent-conversation__content-editable{
                    background: #fff;
                    box-shadow: 0 2px 20px rgba(0,0,0, 0.2);
                    border-radius: 14px;
                    textarea{
                        background: #fff;
                        padding: 0;
                    }
                }
                &.helpgent-conversation__content-editable + .helpgent-conversation-edit-action{
                    flex: 0 0 100%;
                    margin-top: 10px;
                    display: flex;
                    align-items: center;
                    gap: 15px;
                    span{
                        font-size: 14px;
                        font-weight: 500;
                        color: var(--helpgent-color-gray);
                        position: relative;
                        a{
                            text-decoration: none;
                            color: var(--helpgent-color-primary);
                        }
                        &:not(:last-child):before{
                            content: '';
                            position: absolute;
                            width: 4px;
                            height: 4px;
                            right: -8px;
                            top: 50%;
                            transform: translateY(-50%);
                            border-radius: 50%;
                            background: var(--helpgent-color-gray);
                        }
                    }
                }
            }

            .helpgent-conversation-dropdown{
                margin-top: 30px;
                .helpgent-dropdown__content{
                    right: 0;
                }
            }
            .helpgent-dropdown__toggle{
                display: flex;
                align-items: center;
                justify-content: center;
                width: 32px;
                height: 32px;
                border-radius: 6px;
                cursor: pointer;
                background-color: transparent;
                margin-left: 5px;
                &:hover{
                    background-color: var(--helpgent-color-bg-light);
                }
            }
            .helpgent-dropdown-icon{
                line-height: 1;
            }
            .helpgent-conversation__title{
                order: -1;
                text-align: right;
            }
        }
        &.conversation-has-parent{
            .helpgent-conversation__content{
                p{
                    margin-top: 8px;
                }
            }
        }
        .helpgent-content-loading{
            min-height: 300px;
        }

        .helpgent-conversation__icon{
            position: relative;
            margin-right: 0;
            margin-right: 14px;
            .helpgent-badge{
                position: absolute;
                top: -4px;
                left: -6px;
                font-size: 10px;
                font-weight: 700;
                width: 18px;
                height: 18px;
                border: 2px solid var(--helpgent-color-white);
                box-sizing: border-box;
            }
        }
    }
    .helpgent-conversation__content-editBox{
        width: 100%;
    }
    .helpgent-conversation__content{
        &.helpgent-conversation__content-edit{
            padding: 0;
        }
    }
    .helpgent-conversation__content-edit{
        display: flex;
        align-items: center;
        padding: 15px 20px;
        textarea{
            border: 0 none;
            border-radius: 14px;
            padding: 0 18px;
            resize: none;
            font-size: 16px;
            font-weight: 400;
            line-height: 1.5;
            min-height: 25px;
            margin: 0;
            width: 100%;
            color: var(--helpgent-color-gray);
            background-color: var(--helpgent-color-bg-light);
            &:focus{
                outline: 0 none;
                border: 0 none;
                box-shadow: 0 0;
            }
        }
    }
    .helpgent-conversation__title{
        h4{
            font-size: 20px;
            font-weight: 600;
            color: var(--helpgent-color-dark);
            margin: 0;
            p,
            strong{
                font-size: inherit;
                font-weight: inherit;
                margin: 0;
            }
        }
    }
    .helpgent-conversation__date{
        font-size: 12px;
        font-weight: 500;
        margin-top: 6px;
        color: var(--helpgent-color-light-gray);
    }
    .helpgent-single-select__option{
        padding: 13px 15px 13px 45px;
        border-radius: 10px 0 0 10px;
    }
    .helpgent-conversation__content{
        border-radius: 14px;
        margin-top: 20px;
        p{
            font-size: 16px;
            font-weight: 400;
            line-height: 1.5;
            margin: 0;
            color: var(--helpgent-color-gray);
        }
        a{
            font-size: 14px;
            font-weight: 400;
            transition: .3s;
            color: var(--helpgent-color-dark);
            &:hover{
                color: var(--helpgent-color-info);
            }
        }

        &.helpgent-conversation__content-dropdown,
        &.helpgent-conversation__content-single_select,
        &.helpgent-conversation__content-yes_no,
        &.helpgent-conversation__content-open_ended_screen,
        &.helpgent-conversation__content-multi_select,
        &.helpgent-conversation__content-open_ended_video,
        &.helpgent-conversation__content-video{
            &:not(.helpgent-conversation__content--deleted){
                background: none;
                padding-left: 0;
                padding-right: 0;
            }
        }
        &.helpgent-conversation__content--deleted{
            p{
                font-style: italic;
            }
        }
        &.helpgent-conversation__content-multi_select{
            .helpgent-multi-select__option{
                max-width: inherit;
                box-sizing: border-box;
                border-radius: 10px;
            }
        }
        &.helpgent-conversation__content-range_slider{
            padding: 0;
        }

        &.helpgent-conversation__content-open_ended_voice{
            max-width: 460px;
        }

        &.helpgent-conversation__content-reply,
        &.helpgent-conversation__content-forward,
        &.helpgent-conversation__content-promoter_score {
            background-color: var(--helpgent-color-bg-light);
            padding: 20px;
            .helpgent-answer-text{
                padding: 0;
            }
        }
        &.helpgent-conversation__content-promoter_score{
            border-radius: 12px;
            &.helpgent-conversation-free{
                background-color: transparent;
                padding: 0;
            }
            .helpgent-promoter-score__list{
                margin: 0;
                @media only screen and (max-width: 480px){
                    gap: 0;
                }
            }
            .helpgent-promoter-score__single{
                @media only screen and (max-width: 1600px){
                    width: 30px;
                    height: 30px;
                }
                @media only screen and (max-width: 575px){
                    width: 20px;
                    height: 20px;
                    font-size: 11px;
                }
                @media only screen and (max-width: 480px){
                    margin: 0 1px;
                    width: 16px;
                    height: 16px;
                    font-size: 9px;
                }
            }
        }
        &.helpgent-conversation__content-picture_select{
            .helpgent-select-picture-single{
                background: var(--helpgent-color-bg-light);
                padding: 12px 20px;
                border-radius: 10px;
                &:not(:last-child){
                    margin-bottom: 10px;
                }
                display: flex;
                align-items: center;
                gap: 12px;
                .helpgent-picture-select-badge{
                    min-width: 22px;
                    .helpgent-select-picture-single__selected{
                        width: 22px;
                        height: 22px;
                        border-radius: 50%;
                        background: var(--helpgent-color-primary);
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        svg{
                            width: 10px;
                            height: 10px;
                            path{
                                fill: #fff;
                            }
                        }
                    }
                }
                .helpgent-select-picture-single__img{
                    width: 40px;
                    height: 40px;
                    img{
                        width: 100%;
                        height: 100%;
                        object-fit: cover;
                        border-radius: 8px;
                        box-shadow: 0 0 4px rgba(0,0,0,0.2);
                    }
                }
                .helpgent-select-picture-single__caption{
                    font-size: 14px;
                    font-weight: 400;
                    color: var(--helpgent-color-gray);
                }
                &--selected{
                    .helpgent-select-picture-single__caption{
                        font-weight: 500;
                        color: var(--helpgent-color-dark);
                    }
                }
            }
        }
        &.helpgent-conversation__content-map{
            .helpgent-conversation-map-wrapper{
                width: 650px;
                height: 344px;
                border-radius: 16px;
            }
        }

        .helpgent-conversation-parent--reply{
            .helpgent-conversation-parent__label{
                display: flex;
                align-items: center;
                gap: 8px;
                color: var(--helpgent-color-light-gray);
                font-size: 13px;
                margin-bottom: 20px;
                svg{
                    width: 11px;
                    path{
                        fill: var(--helpgent-color-light-gray);
                    }
                }
            }
            .helpgent-conversation-parent__content{
                position: relative;
                cursor: pointer;
                &::before{
                    position: absolute;
                    content: '';
                    width: 30px;
                    height: calc(100% - 32px);
                    left: 0;
                    top: 10px;
                    border: 2px solid #c7c7c7;
                    border-right: 0;
                    border-bottom: 0;
                    border-radius: 12px 0 0 0;
                }
            }

            .helpgent-conversation-parent__content-top{
                display: flex;
                align-items: center;
                gap: 8px;
                padding-left: 42px;
            }
            .helpgent-conversation-parent__author{
                width: 20px;
                height: 20px;
                border-radius: 50%;
                img{
                    border-radius: inherit;
                    width: 100%;
                }
            }
            .helpgent-conversation-parent__author-info{
                display: flex;
                align-items: center;
                gap: 8px;
                .helpgent-author-name{
                    font-size: 15px;
                    font-weight: 500;
                    color: #030308;
                }
                .helpgent-conversation-time-meta{
                    font-size: 12px;
                    font-weight: 500;
                    color: var(--helpgent-color-light-gray);
                }
            }
            .helpgent-conversation-parent__content-bottom{
                padding-left: 42px;
                margin-top: 12px;
                padding-bottom: 18px;
                border-bottom: 1px solid var(--helpgent-color-bg-deep);
            }
            .helpgent-conversation-parent__attachment-info{
                span{
                    display: block;
                }
            }
        }
        .helpgent-conversation-parent__attachment{
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .helpgent-conversation-parent__attachment-video,
        .helpgent-conversation-parent__attachment-audio{
            margin-top: 15px;
        }
        .helpgent-conversation-parent__attachment-audio{
            .helpgent-voice-conversation{
                background-color: var(--helpgent-color-bg-gray);
            }
        }
        &.helpgent-conversation__content-forward{
            .helpgent-answer-text p{
                border-bottom: 1px solid #D5D5D5;
                margin-bottom: 20px;
                padding-bottom: 16px;
                word-wrap: break-word;
                word-break: break-word;
            }
        }
        .helpgent-conversation-parent--forward {
            .helpgent-conversation-parent__label{
                display: flex;
                align-items: center;
                gap: 8px;
            }
            .helpgent-conversation-parent__content{
                border-left: 2px solid #c7c7c7;
                padding-left: 16px;
                margin-top: 15px;
            }
            .helpgent-conversation-parent__attachment-info{
                display: flex;
                align-items: center;
            }
            .helpgent-attachment-name{
                display: inline-block;
            }
        }
        .helpgent-conversation-parent__attachment-icon{
            width: 24px;
            height: 24px;
            svg{
                width: 24px;
                height: 24px;
                path{
                    fill: var(--helpgent-color-light-gray)
                }
            }
        }
        .helpgent-conversation-parent__attachment-info{
            .helpgent-attachment-name{
                font-size: 13px;
                font-weight: 500;
                margin-right: 4px;
                color: var(--helpgent-color-dark);
            }
            .helpgent-attachment-size{
                font-size: 11px;
                color: var(--helpgent-color-light-gray);
            }
        }
    }
    .helpgent-conversation-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)
    }

    .helpgent-rangeControl{
        pointer-events: none;
        margin: 40px 0 0;
        .components-simple-tooltip{
            opacity: 1 !important;
            color: var(--helpgent-color-white);
            background-color: var(--helpgent-color-primary);
            &:after{
                border-top-color: var(--helpgent-color-primary);
            }
        }
    }
    .helpgent-promoter-score__list{
        margin-bottom: 0;
        li{
            margin: 0 3px;
            background-color: var(--helpgent-color-white);
            border-color: var(--helpgent-color-white);
        }
    }
    .helpgent-choice-list{
        .helpgent-choice-item{
            padding: 12.86px 20px;
            border-radius: 10px;
            background-color: var(--helpgent-color-bg-light);
            &:not(:last-child){
                margin-bottom: 10px;
            }
        }
        .helpgent-single-select__option{
            max-width: 100%;
            padding: 12.86px 20px 12.86px 45px;
        }
    }
    .helpgent-single-select,
    .helpgent-choice-item{
        height: 44px;
        background: var(--helpgent-color-bg-light);
        display: flex;
        align-items: center;
        border-radius: 10px;
        &:not(:last-child){
            margin-bottom: 10px;
        }
    }
    .helpgent-choice-item{
        padding-left: 20px;
        padding-right: 20px;
        .components-form-toggle{
            line-height: 0;
            .components-form-toggle__input{
                pointer-events: none;
            }
        }
    }
    .helpgent-dropdown-answer{
        position: relative;
        height: 44px;
        background: var(--helpgent-color-bg-light);
        display: flex;
        align-items: center;
        border-radius: 10px;
        &:not(:last-child){
            margin-bottom: 10px;
        }
        .helpgent-dropdown-answer__selected{
            position: absolute;
            left: 20px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background-color: var(--helpgent-color-primary);
            &+.helpgent-dropdown-answer__label{
                font-weight: 500;
                color: var(--helpgent-color-dark);
                padding-left: 35px;
            }
        }
        svg{
            width: 10px;
            height: 10px;
            path{
                color: var(--helpgent-color-white);
            }
        }
        .helpgent-dropdown-answer__label{
            padding-left: 35px;
        }
    }
    .helpgent-rating-star-list{
        display: flex;
        align-items: center;
        padding: 20px;
        border-radius: 12px;
        background-color: var(--helpgent-color-bg-light);
        .helpgent-rating-star{
            display: flex;
            align-items: center;
            justify-content: center;
            width: 34px;
            height: 34px;
            border-radius: 8px;
            margin-inline-end: 6px;
            background-color: var(--helpgent-color-bg-deep);
            @media only screen and (max-width: 575px){
                width: 22px;
                height: 22px;
                border-radius: 4px;
            }
            @media only screen and (max-width: 480px){
                width: 18px;
                height: 18px;
                border-radius: 3px;
            }
            svg{
                path{
                    fill: var(--helpgent-color-white);
                }
                @media only screen and (max-width: 575px){
                    width: 12px;
                    height: 12px;
                }
                @media only screen and (max-width: 480px){
                    width: 10px;
                    height: 10px;
                }
            }
            &.helpgent-active{
                background-color: var(--helpgent-color-primary);
            }
        }
    }
    .helpgent-conversation__choice{
        margin-top: 20px;
    }

    .helpgent-conversation__content-short_text,
    .helpgent-conversation__content-long_text{
        word-break: break-word;
        word-wrap: break-word;
    }
    .helpgent-conversation{
        &.helpgent-conversation-voice{
            max-width: 470px;
        }
    }
`,ie=x.Ay.div`
    position: relative;
    margin: 0 20px 20px 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 16px;
    margin-top: auto;
    background-color: var(--helpgent-color-bg-gray);
    &.helpgent-disabled{
        .helpgent-conversation-action__main{
            pointer-events: none;
            opacity: .50;
        }
    }
    .helpgent-back-to-action{
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: -10px;
        box-shadow: 0 5px 30px rgba(0,0,0,.10);
        cursor: pointer;
        background-color: var(--helpgent-color-white);
        svg{
            width: 12px;
            height: 12px;
            fill: var(--helpgent-color-gray);
        }
    }
    .helpgent-conversation-action__main{
        text-align: center;
    }
    .helpgent-conversation-action__title{
        font-size: 16px;
        font-weight: 600;
        margin: 0 0 20px;
        color: var(--helpgent-color-gray);
        @media only screen and (max-width: 1199px){
            margin: 0 0 15px;
        }
        @media only screen and (max-width: 480px){
            text-indent: 0;
        }
    }
    .helpgent-conversation-action__list{
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
        @media only screen and (max-width: 991px){
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
        }
        .helpgent-btn{
            min-height: 48px;
            border-radius: 12px;
            @media only screen and (max-width: 1199px){
                min-height: 36px;
                border-radius: 8px;
                padding: 0 15px;
            }
            @media only screen and (max-width: 480px){
                text-indent: -9999px;
                gap: 0;
            }
            &.helpgent-btn-screen-recording.--is-recording{
                text-indent: 0;
            }
            &:hover{
                svg{
                    path{
                        fill: var(--helpgent-color-white);
                    }
                }
            }
            svg{
                width: 20px;
                height: 20px;
                margin-right: 10px;
                @media only screen and (max-width: 480px){
                    margin-right: 0;
                    pointer-events: none;
                }
                path{
                    fill: var(--helpgent-color-light-gray);
                    transition: var(--helpgent-transition);
                }
            }
            @media only screen and (max-width: 991px){
                margin: 0;
            }
            .helpgent-btn{
                text-indent: 0;
                svg{
                    margin-right: 10px;
                }
            }
        }
    }
    .helpgent-reply-input{
        width: 100%;
        margin-right: 10px;
    }
    .helpgent-reply-text-send{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 50px;
        min-width: 50px;
        border-radius: 50%;
        background-color: var(--helpgent-color-primary);
        flex: 1;
        svg{
            width: 20px;
            height: 20px;
            path{
                fill: var(--helpgent-color-white)
            }
        }
        &[disabled] {
            opacity: 50%;
            pointer-events: none;
        }
    }
`,re=x.Ay.div`

`,oe=x.Ay.div`
    width: 100%;
    .helpgent-reply-text{
        width: 100%;
        font-family: "Inter";
        min-height: 50px;
        border-radius: 26px;
        padding: 15px 22px;
        border: 0 none;
        box-shadow: 0 0;
        resize: none;
        overflow: hidden;
        background-color: var(--helpgent-color-white);
        box-sizing: border-box;
    }
`,le=x.Ay.div`
    width: 100%;
    .helpgent-reply-voice{
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 52px;
        border-radius: 26px;
        padding: 0px 30px 0px 25px;
        flex: 1;
        width: 100%;
        background-color: var(--helpgent-color-bg-general);
    }
    .helpgent-reply-voice__toggle{
        min-width: 24px;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background-color: var(--helpgent-color-dark);
        text-decoration: none;
        color: var(--helpgent-color-dark);
        svg{
            width: 14px;
            height: 14px;
            path{
                fill: var(--helpgent-color-white);
            }
        }
    }
    .helpgent-audio-range{
        position: relative;
        display: block;
        width: 100%;
        min-height: 10px;
        border-radius: 100px;
        margin: 0px 25px;
        background-color: var(--helpgent-color-bg-deep);
        .helpgent-audio-range__inner{
            position: absolute;
            left: 0px;
            top: 0px;
            width: 100%;
            height: 10px;
            display: block;
            border-radius: 100px 0px 0px 100px;
            background-color: var(--helpgent-color-dark);
        }
    }
    .helpgent-voice-timer{
        font-size: 14px;
        font-weight: 500;
        white-space: nowrap;
        color: var(--helpgent-color-dark);
    }
    .helpgent-reply-text-send{
        flex: inherit;
    }
`,se=x.Ay.div`
    width: 100%;
    align-items: flex-end;
    .helpgent-reply-box{
        flex: 1;
        margin-right: 10px;
    }
    .helpgent-reply-box__top{
        display: flex;
        align-items: center;
        padding: 12px 25px;
        border-radius: 16px 16px 0 0;
        background-color: var(--helpgent-color-bg-deep);

        svg{
            margin-right: 8px;
            path{
                fill: var(--helpgent-color-light-gray);
            }
        }
    }
    .helpgent-replying-to{
        font-size: 15px;
        font-weight: 400;
        color: var(--helpgent-color-gray);
        strong{
            font-weight: 600;
            color: var(--helpgent-color-dark);
        }
    }
    .helpgent-reply-box__input{
        textarea{
            width: 100%;
            border: 0 none;
            min-height: 50px;
            padding: 15px 25px;
            border-radius: 0 0 16px 16px;
            resize: none;
            background-color: var(--helpgent-color-white);
            &:focus{
                outline: none;
                box-shadow: 0 0;
            }
        }
    }
    .helpgent-reply-text-send{
        flex: initial;
    }
`,ce=x.Ay.div`
    padding: 12px;
    border-radius: 12px;
    background-color: var(--helpgent-color-bg-light);
    &.helpgent-media-disabled{
        cursor: not-allowed;
        .helpgent-voice-conversation__download,
        .helpgent-video-conversation__expander,
        .helpgent-voice-conversation__toggle{
            pointer-events: none;
        }
    }
    .helpgent-voice-conversation__player{
        align-items: center;
        height: 42px;
        padding: 3px 10px;
        background-color: #fff;
        border-radius: 10px;
    }
    .helpgent-voice-conversation__toggle{
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--helpgent-color-primary);
        margin-right: 10px;
        svg{
            width: 9px;
            height: 9px;
            path{
                fill: #fff;
            }
        }
    }
    .helpgent-audio-range{
        flex: 1;
    }
    .helpgent-voice-conversation__control{
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 10px;
        .helpgent-voice-conversation__time-meta{
            font-size: 13px;
            font-weight: 500;
            color: var(--helpgent-color-light-gray);
        }
        .helpgent-voice-conversation__download{
            width: 28px;
            height: 28px;
            background: #fff;
            border-radius: 7px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--helpgent-transition);
            svg{
                width: 12px;
                height: 12px;
                transition: var(--helpgent-transition);
            }
            &:hover{
                background: var(--helpgent-color-primary);
                svg path{
                    fill: #fff;
                }
            }
        }
    }
`,pe=x.Ay.div`
    &.helpgent-media-disabled{
        cursor: not-allowed;
        .helpgent-video-conversation__download,
        .helpgent-video-conversation__toggle{
            pointer-events: none;
        }
    }
    &.helpgent-video-conversation{
        position: relative;
        border-radius: 20px;
        text-align: center;
        display: flex;
        &::before{
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            left: 0;
            top: 0;
            background: rgba(0,0,0,0.3);
            border-radius:20px;
        }
        video{
            border-radius: 20px;
            width: 100%;
            height: 100%;
            max-height: 350px;
        }
        .helpgent-video-conversation__toggle{
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 70px;
            height: 70px;
            border-radius: 50%;
            background: #fff;
            z-index: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            visibility: hidden;
            opacity: 0;
            transition: var(--helpgent-transition);
            svg{
                width: 20px;
                height: 20px;
                path{
                    fill: var(--helpgent-color-primary);
                }
            }
        }
        .helpgent-video-conversation__download{
            position: absolute;
            right: 15px;
            bottom: 15px;
            width: 28px;
            height: 28px;
            border-radius: 7px;
            background: #fff;
            z-index: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--helpgent-transition);
            svg{
                width: 12px;
                height: 12px;
                path{
                    fill: var(--helpgent-color-light-gray);
                    transition: var(--helpgent-transition);
                }
            }
            &:hover{
                background: var(--helpgent-color-primary);
                svg path{
                    fill: #fff;
                }
            }
        }
        .helpgent-video-conversation__visualization{
            position: absolute;
            right: 20px;
            top: 20px;
            z-index: 1;
            svg{
                width: 18px;
                height: 18px;
                path{
                    fill: #fff;
                    transition: var(--helpgent-transition);
                }
            }
            &:hover{
                svg path{
                    fill: var(--helpgent-color-primary);
                }
            }
        }
        &:hover{
            .helpgent-video-conversation__toggle{
                visibility: visible;
                opacity: 1;
            }
        }
    }
    .helpgent-voice-conversation__player{
        align-items: center;
        height: 42px;
        border-radius: 10px;
        padding: 10px;
        background-color: var(--helpgent-color-white);
    }
    .helpgent-voice-conversation__toggle{
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background-color: var(--helpgent-color-primary);
        svg{
            width: 9px;
            height: 9px;
            path{
                fill: var(--helpgent-color-white);
            }
        }
    }
    .helpgent-audio-range{
        flex: 1;
    }
`,ge=(x.Ay.div`

`,x.Ay.div`
    padding: 0 30px 30px;
    .helpgent-conversation-delete__label{
        font-size: 16px;
        font-weight: 500;
        margin: 0 0 25px;
        color: var(--helpgent-color-dark);
    }
    .helpgent-user-block{
        background: var(--helpgent-color-bg-light);
        padding: 20px 18px;
        border-radius: 10px;
    }
`),de=x.Ay.div`

    .helpgent-conversation-forward__reply,
    .helpgent-conversation-forward__user-input{
        textarea,
        input{
            width: 100%;
            border-radius: 10px;
        }
    }
    .helpgent-conversation-forward__list-group{
        max-height: 170px;
        overflow-y: auto;
        padding-right: 10px;
        margin-right: -10px;
        &::-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-conversation-forward__list-single{
        .helpgent-btn-primary:not(:hover):not(:active):not(.has-background){
            &[disabled]{
                color: var(--helpgent-color-primary);
                background-color: transparent;
                cursor: not-allowed;
            }
        }
    }
    .helpgent-conversation-forward__attachment{
        gap: 10px;
        margin-bottom: 20px;
        .helpgent-conversation-forward__attachment-content{
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100px;
            height: 100px;
            border-radius: 12px;
            background-color: var(--helpgent-color-bg-deep);
            position: relative;
            svg{
                width: 24px;
                height: 24px;
                path{
                    fill: var(--helpgent-color-gray);
                }
            }
            video{
                height: 100%;
                width: 100%;
                object-fit: cover;
                border-radius: inherit;
            }
            .helpgent-media-conversation__toggle{
                position: absolute;
                left: 50%;
                top: 50%;
                transform: translate(-50%, -50%);
                width: 35px;
                height: 35px;
                border-radius: 50%;
                background: #fff;
                z-index: 1;
                display: flex;
                align-items: center;
                justify-content: center;
                visibility: hidden;
                opacity: 0;
                transition: var(--helpgent-transition);
                cursor: pointer;
                svg{
                    width: 14px;
                    height: 14px;
                    path{
                        fill: var(--helpgent-color-primary);
                    }
                }

                &.helpgent-media-conversation__toggle--audio{
                    visibility: visible;
                    opacity: 1;
                }
            }
            &:hover{
                .helpgent-media-conversation__toggle{
                    opacity: 1;
                    visibility: visible;
                }
            }
        }
        .helpgent-conversation-forward__reply{
            flex: 1;
            margin-bottom: 0 !important;
            textarea{
                height: 100px !important;
            }
        }
    }
`;x.Ay.div`

    padding: 20px;
    border-radius: 12px;
    background-color: var(--helpgent-color-bg-light);

`,x.Ay.div`
        width: 370px;
        position: absolute;
        z-index: 999;
        left: 0;
        top: 44px;
    .helpgent-conversation-tag-add{
        padding: 8px;
        border-radius: 8px;
        box-shadow: 0 0 6px rgba(0,0,0,0.15);
        background: #fff;
        .helpgent-btn-icon{
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            border-radius: 6px;
            background-color: var(--helpgent-color-primary);
            position: absolute;
            right: 4px;
            top: 50%;
            cursor: pointer;
            transform: translateY(-50%);
            svg{
                width: 12px;
            }
            &[disabled] {
                opacity: 50%;
                pointer-events: none;
            }
        }
        .helpgent-form-group{
            position:relative;
            margin-bottom: 0;
        }
        .helpgent-form-group__element{
            background: var(--helpgent-color-bg-gray);
            border-radius: 8px;
        }
    }
    .helpgent-conversation-form-tag{
        max-height: 270px;
        overflow-y: auto;
        padding: 10px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.15);
        border: 1px solid #e6e6e6;
        border-radius: 8px;
        overflow-x: hidden;
        box-sizing: border-box;
        background: #fff;
    }
    .helpgent-conversation-form-tag__item{
        display: block;
        padding: 8px 10px 10px;
        font-size: 14px;
        color: var(--helpgent-color-gray);
        transition: var(--helpgent-transition);
        border-radius: 8px;
        line-height: normal;
        cursor: pointer;
        word-wrap: break-word;
        word-break: break-word;
        &:hover{
            background: #EBEBEB;
        }
    }

`;var he=n(44253);function ue(e,t,n,a,i){i({...a,responseCache:{...a.responseCache,[e]:{...a.responseCache[e],[t]:n}}})}function me(e,t,n){if(n.responseCache[e])return n.responseCache[e][t]}function Me(e,t,n,a){const i={...n.responseCache};i[e][t]&&(delete i[e][t],a({...n,responseCache:i}))}var Ne=n(38745),we=n(37877),xe=n(5781),ye=n(14905),Le=n(27106),ve=n(23142),Ie=n(47539);const fe="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCiAgdmlld0JveD0iMCAwIDEwMCAxMDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDAgMCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CiAgICA8cGF0aCBmaWxsPSIjZmZmIiBkPSJNNzMsNTBjMC0xMi43LTEwLjMtMjMtMjMtMjNTMjcsMzcuMywyNyw1MCBNMzAuOSw1MGMwLTEwLjUsOC41LTE5LjEsMTkuMS0xOS4xUzY5LjEsMzkuNSw2OS4xLDUwIj4KICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0KICAgICAgICAgYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIgogICAgICAgICBhdHRyaWJ1dGVUeXBlPSJYTUwiCiAgICAgICAgIHR5cGU9InJvdGF0ZSIKICAgICAgICAgZHVyPSIxcyIKICAgICAgICAgZnJvbT0iMCA1MCA1MCIKICAgICAgICAgdG89IjM2MCA1MCA1MCIKICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIC8+CiAgPC9wYXRoPgo8L3N2Zz4=";function be(e){const{baseApiRoute:t}=e,n=(0,j.jE)(),{responseState:i,setResponseState:r}=M(),{activeResponse:o,messageQueryKey:l,responseQueryKey:c}=i,g=o&&(me(o.id,"textMessageContent",i)||""),{mutateAsync:d,isLoading:h}=(0,Q.A)("/helpgent/message");async function u(e){if(e.preventDefault(),h)return;const t={response_id:o.id,message:g,replied_by:"text"};try{await d(t),n.invalidateQueries([`helpgent-${l}`]),n.invalidateQueries([`helpgent-responses-${c}`]),Me(o.id,"message",i,r),Me(o.id,"textMessageContent",i,r),r({...i,conversationMode:"action"})}catch(e){console.log(e)}}return(0,a.createElement)(oe,{className:"helpgent-d-flex"},(0,a.createElement)("div",{className:"helpgent-reply-input"},(0,a.createElement)("textarea",{style:{height:16*g.split(/\r*\n/).length+"px"},name:"helpgent-reply-text",className:"helpgent-reply-text",value:g,onChange:e=>ue(o.id,"textMessageContent",e.target.value,i,r),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||u(e)},placeholder:(0,p.__)("Type a message","helpgent")})),(0,a.createElement)("a",{href:"#",disabled:!(g.trim().length>0),className:"helpgent-reply-text-send",onClick:e=>u(e)},h?(0,a.createElement)(s.A,{style:{width:"50px",height:"50px"},src:fe}):(0,a.createElement)(s.A,{src:Ie.A})))}const je="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi45NSIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDEyLjk1IDE0Ij4KICA8cGF0aCBpZD0iUGF0aF8xNTg2IiBkYXRhLW5hbWU9IlBhdGggMTU4NiIgZD0iTTEyLjMzLDQuNzI5SDUuMzU5TDguNDg2LDEuNkEuODc5Ljg3OSwwLDAsMCw3LjI0My4zNTlMMy4wMyw0LjU3MmExLjQ2NiwxLjQ2NiwwLDAsMCwwLDIuMDcxbDQuMjEzLDQuMjEzQS44NzkuODc5LDAsMCwwLDguNDg2LDkuNjEzTDUuMzU5LDYuNDg2SDEyLjMzQTEuNDY2LDEuNDY2LDAsMCwxLDEzLjc5NCw3Ljk1djUuMjczYS44NzkuODc5LDAsMSwwLDEuNzU4LDBWNy45NTFBMy4yMjYsMy4yMjYsMCwwLDAsMTIuMzMsNC43MjlaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMi42MDIgLTAuMTAxKSIvPgo8L3N2Zz4K";function De(e){const{baseApiRoute:t}=e,n=(0,j.jE)(),{responseState:i,setResponseState:r}=M(),{activeResponse:o,replyingMessageId:l,messageQueryKey:c}=i,g=o&&me(o.id,"message",i),d=o&&(me(o.id,"textMessageContent",i)||""),h=g&&g.reply&&g.reply.messageId,{mutateAsync:u,isLoading:m}=(0,Q.A)("/helpgent/message"),N=o&&("1"===o.is_guest?o.user_guest:o.user),w=N&&(N.display_name?N.display_name:N.first_name);return(0,a.createElement)(se,{className:"helpgent-d-flex"},(0,a.createElement)("div",{className:"helpgent-reply-box"},(0,a.createElement)("div",{className:"helpgent-reply-box__top"},(0,a.createElement)(s.A,{src:je}),(0,a.createElement)("span",{className:"helpgent-replying-to"},(0,p.__)("Replying to","helpgent")," ",(0,a.createElement)("strong",null,w))),(0,a.createElement)("div",{className:"helpgent-reply-box__input"},(0,a.createElement)("textarea",{style:{height:16*d.split(/\r*\n/).length+"px"},value:d,name:"helpgent-reply-text",className:"helpgent-reply-text",onChange:e=>ue(o.id,"textMessageContent",e.target.value,i,r),placeholder:(0,p.__)("Reply...","helpgent")}))),(0,a.createElement)("a",{href:"#",disabled:!(d.trim().length>0),className:"helpgent-reply-text-send",onClick:e=>async function(e){e.preventDefault();const t={response_id:o.id,parent_id:parseInt(h),message:d,replied_by:"reply"};try{await u(t),n.invalidateQueries([`helpgent-${c}`]),Me(o.id,"message",i,r),Me(o.id,"textMessageContent",i,r)}catch(e){console.log(e)}}(e)},m?(0,a.createElement)(s.A,{style:{width:"50px",height:"50px"},src:fe}):(0,a.createElement)(s.A,{src:Ie.A})))}var ze=n(62064);function _e(e){const{recorder:t,maxRecordLength:n,isSendLoading:i,isUploadLoading:r}=e;return(0,j.jE)(),(0,a.createElement)(le,{className:"helpgent-d-flex"},(0,a.createElement)("div",{className:"helpgent-reply-voice"},(0,a.createElement)("a",{href:"#",className:"helpgent-reply-voice__toggle helpgent-reply-voice__toggle-"+(t.isPaused?"paused":"playing"),onClick:e=>function(e){e.preventDefault(),t.isPaused?t.resume():t.pause()}(e)},(0,a.createElement)(s.A,{src:t.isPaused?xe.A:ze.A})),(0,a.createElement)("span",{className:"helpgent-audio-range"},(0,a.createElement)("span",{className:"helpgent-audio-range__inner",style:{width:`${(()=>{const e=t.recordedTime/n;return isNaN(e)?0:100*e})()}%`}})),(0,a.createElement)("span",{className:"helpgent-voice-timer"},t.getFormattedRecordedTime())),(0,a.createElement)("a",{href:"#",disabled:!(t.recordedTime>=1),className:"helpgent-reply-text-send",onClick:e=>{e.preventDefault(),t.stop()}},r||i?(0,a.createElement)(s.A,{style:{width:"50px",height:"50px"},src:fe}):(0,a.createElement)(s.A,{src:Ie.A})))}var Ae=n(66663),Ee=n(47977);const Ce=x.Ay.div`
    position: relative;
    &:hover{
        .helpgent-btn{
            svg{
                path{
                    fill: var(--helpgent-color-light-gray) !important;
                }
            }
        }
    }

    &.helpgent-popup-button-active .helpgent-button-popup {
        display: block;
    }

    .helpgent-button-popup {
        display: none;
        position: absolute;
        top: -10px;
        left: 50%;
        border-radius: 30px;
        width: 525px;
        transform: translate(-50%, -100%);
        padding: 50px;
        box-shadow: rgba(0, 0, 0, 0.1) 0px 20px 50px;
        background: #fff;
        box-sizing: border-box;
        cursor: auto;
        z-index: 1;
        @media only screen and (max-width: 767px){
            left: -50px;
            transform: translate(0, -100%);
        }
        @media only screen and (max-width: 575px){
            width: 400px;
            padding: 20px;
            border-radius: 12px;
        }
        @media only screen and (max-width: 480px){
            width: 300px;
        }
        .helpgent-button-group{
            gap: 20px;
        }
        .helpgent-btn{
            &:hover{
                color: var(--helpgent-color-primary);
                svg{
                    path{
                        fill: var(--helpgent-color-primary) !important;
                    }
                }
            }
        }
    }
`;function Te({label:e,popupContent:t,isActive:n,classNames:r,onChange:o}){const l=(0,i.useRef)(),[s,c]=(0,i.useState)("boolean"==typeof n&&n);return(0,i.useEffect)(()=>{c(n)},[n]),(0,i.useEffect)(()=>{function e(e){l.current&&!l.current.contains(e.target)&&null===e.target.closest(".helpgent-button-popup")&&c(!1)}return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[]),(0,a.createElement)(Ce,{ref:l,className:function(){let e=["helpgent-btn","helpgent-btn-lg","helpgent-btn-white"];if(void 0!==typeof r&&Array.isArray(r)){e=[...e,...r];const t=(e,t,n)=>n.indexOf(e)===t;e=e.filter(t)}return e.push("helpgent-popup-button"),s&&e.push("helpgent-popup-button-active"),e.join(" ")}(),onClick:function(e){if(l.current!==e.target)return;const t=!s;c(t),"function"==typeof o&&o(t)}},(0,a.createElement)("div",{className:"helpgent-button-popup"},t),e)}var Se=n(87369);const ke=x.Ay.div`
    &.--is-recording, &.--is-recording:hover {
        color: #fff;
        background: #ff4b4b;
        border: none;
    }
`,Ye=function({label:e,classNames:t,onStop:n,maxRecordLength:i}){const r={recorderType:"screen",maxRecordLength:i||120,countdownTimer:3,afterStopRecording:function(e){e&&n(e.blob)}},o=(0,he.A)(r);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Se.A,{isActive:o.isActiveCountdown,value:o.getCountdownTimeReversed(),onClick:o.skipCountdown,hint:(0,p.__)("Click anywhere to skip the countdown","helpgent")}),(0,a.createElement)(ke,{className:function(){let e=["helpgent-btn","helpgent-btn-lg","helpgent-btn-white"];if(void 0!==typeof t&&Array.isArray(t)){e=[...e,...t];const n=(e,t,n)=>n.indexOf(e)===t;e=e.filter(n)}return e.push("helpgent-btn-screen-recording"),o.isRecording&&e.push("--is-recording"),o.isRecording&&o.recordingIsGoingToStopSoon&&e.push("--blink"),e.join(" ")}(),onClick:async function(){o.isRecording?o.stop():(await o.checkPermission()||await o.requestPermission())&&await o.setupStream()&&o.start()}},o.isRecording?o.getFormattedRecordedTime():e))};var Oe=n(62947),Ue=n(10155);const Qe=x.Ay.div`
    display: flex;
    background: #fff;
    width: 100%;
    height: calc(100vh - 160px);
    margin: 20px 80px;
    border-radius: 30px;
    overflow: hidden;
    @media only screen and (max-width: 575px){
        flex-wrap: wrap;
    }

    .helpgent-video-uploader__preview-area {
        flex-grow: 1;
        flex-basis: 100%;
        background: var(--helpgent-color-dark);
        border-top-left-radius: 30px;
        border-bottom-left-radius: 30px;
        @media only screen and (max-width: 575px){
            min-height: 250px;
            border-bottom-left-radius: 0;
        }
        video {
            width: 100%;
            height: 100%;
            object-fit: contain;
            @media only screen and (max-width: 575px){
                max-height: 250px;
            }
        }
    }

    .helpgent-video-uploader__file-picker-area {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        flex-basis: 100%;
        min-height: 400px;
        overflow: auto;
        @media only screen and (max-width: 575px){
            overflow: auto;
            height: calc(100% - 250px);
        }
    }

    .helpgent-video-uploader__file-picker-body {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        padding: 20px;
        background: #f2f2f2;
    }

    .helpgent-video-uploader__file-picker {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin: 10px 0;
        padding: 20px;
        border-radius: 14px;
        min-height: 220px;
        border: 1px dashed rgb(196, 196, 196);
        background-color: rgb(234, 234, 234);
        @media only screen and (max-width: 575px){
            padding: 24px 20px 20px;
            min-height: 125px;
        }
    }

    .helpgent-video-uploader__message {
        margin: 10px 0;
        height: 100%;
        .helpgent-input-textarea {
            width: 100%;
            height: 100%;
            border: none;
            box-shadow: none;
            background: transparent;
            box-sizing: border-box;
            font-size: 18px;
            &::-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-file-input-label {
        font-size: 14px;
        font-weight: 600;
        padding: 0px 25px;
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        border-radius: 8px;
        text-decoration: none;
        cursor: pointer;
        color: #fff;
        background-color: #030308;
    }

    .helpgent-video-uploader__info-message {
        margin: 15px 0 0;
        color: #898989;
    }

    .helpgent-video-uploader__error-message {
        margin: 10px 0 0;
        color: red;
    }

    .helpgent-video-uploader__actions {
        display: flex;
    }

    .helpgent-video-uploader-action-link {
        flex-grow: 1;
        padding: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        color: #2b2b2b;
        background: #fff;
        font-size: 15px;
        font-weight: 500;
        border-right: 1px solid #e2e2e2;
        transition: var(--helpgent-transition);
        @media only screen and (max-width: 575px){
            padding: 11px 20px;
        }
        svg{
            path{
                fill: var(--helpgent-color-gray);
                transition: var(--helpgent-transition);
            }
        }
        &:hover{
            color: var(--helpgent-color-primary);
            svg path{
                fill: var(--helpgent-color-primary);
            }
        }
    }
`;var Ge=n(22057);const Ze=function({onSubmit:e,onExit:t,fileUploader:n}){const[r,o]=(0,i.useState)(""),[l,c]=(0,i.useState)(""),[g,d]=(0,i.useState)(!1);let{acceptedExtensions:u,maxFileSize:m}=n.getRules();return u=u&&u.length?u:void 0,m=(0,h.v7)(m),(0,a.createElement)(Qe,null,(0,a.createElement)("div",{className:"helpgent-video-uploader__preview-area"},n.hasFile()&&(0,a.createElement)("video",{controls:!0,playsInline:!0,src:n.getFile().url})),(0,a.createElement)("div",{className:"helpgent-video-uploader__file-picker-area"},(0,a.createElement)("div",{className:"helpgent-video-uploader__file-picker-body"},(0,a.createElement)("div",{className:"helpgent-video-uploader__file-picker"},(0,a.createElement)("label",{className:"helpgent-file-input-label",htmlFor:"helpgent-file-input"},n.hasFile()?(0,p.__)("Change File","helpgent"):(0,p.__)("Choose File","helpgent")),(0,a.createElement)("input",{style:{display:"none"},id:"helpgent-file-input",type:"file",onChange:function(e){const t=e.target.files?e.target.files[0]:null;if(!t)return;const a=URL.createObjectURL(t),{file:i}=n.setFile(t,{url:a});i.isValid||c(i.getMessage((0,p.__)("The file is not valid","helpgent")))},accept:u,name:"attachment"}),m&&(0,a.createElement)("div",{className:"helpgent-video-uploader__info-message"},"Max file size: ",m),l&&(0,a.createElement)("div",{className:"helpgent-video-uploader__error-message"},l)),(0,a.createElement)("div",{className:"helpgent-video-uploader__message"},(0,a.createElement)("textarea",{className:"helpgent-input-textarea",placeholder:(0,p.__)("Type your text...","helpgent"),value:r,onChange:e=>o(e.target.value)}))),(0,a.createElement)("div",{className:"helpgent-video-uploader__actions"},(0,a.createElement)("a",{className:"helpgent-video-uploader-action-link",onClick:e=>{e.preventDefault,t()}},(0,a.createElement)(s.A,{src:Ge.A}),(0,p.__)("Cancel","helpgent")),(0,a.createElement)("a",{className:"helpgent-video-uploader-action-link",onClick:a=>{a.preventDefault,async function(){if(g)return;if(c(""),!n.files.length)return void c((0,p.__)("Please select a file","helpgent"));d(!0);const a=await e(n.files,r);d(!1),a.success?t():c(a.error.message)}()}},g?(0,p.__)("Sending","helpgent"):(0,p.__)("Send","helpgent"),(0,a.createElement)(s.A,{src:Ie.A})))))};var Re=n(69466);function Fe(e){const{baseApiRoute:t}=e,[n,r]=(0,i.useState)(!1),[o,l]=(0,i.useState)(!1),[c,g]=(0,i.useState)(!1),[d,u]=(0,i.useState)(null),[m,N]=(0,i.useState)(!1),[w,x]=(0,i.useState)(!1),{responseState:y,setResponseState:L}=M(),{activeResponse:v,conversationMode:I,messageQueryKey:f,responseAgentQueryKey:b}=y,D=(0,Ne.L)(),z=(0,h.Vy)(),_=60*parseFloat((0,h.CR)("formResponse.media_settings.max_voice_duration",y,2)),A=(0,h.VE)(_,z.audioRecordLength,D),E=60*parseFloat((0,h.CR)("formResponse.media_settings.max_video_duration",y,2)),C=(0,h.VE)(E,z.videoRecordLength,D),T=parseFloat((0,h.CR)("formResponse.media_settings.video_resolution",y,720)),S=(0,h.VE)(T,z.videoResolution,D),Y=(0,h.CR)("formResponse.media_settings.max_upload_size_unit",y,"kb"),O="kb"===Y?307200:300,U=(0,h.CR)("formResponse.media_settings.max_upload_size",y,O),Z=(0,h.VE)((0,h.ZJ)(U,Y),z.fileSize,D),R=v?v.id:null,F=(0,Ae.A)({type:"response",responseID:R,rules:{maxFileSize:Z,acceptedExtensions:(0,h.yQ)()}});(0,i.useEffect)(()=>{F.updateArgs({responseID:R})},[R]);const P=v&&G(v),W=(0,k.applyFilters)("helpgent_response_bottom_action_is_disabled",!v||!P||"1"!==v.is_completed||"1"!==v.is_verified,y.formResponse),B={recorderType:"audio",maxRecordLength:A,countdownTimer:0,afterStopRecording:async function(e){if(!e)return;const{files:t}=F.setFile(e.blob);await ee(async()=>await q("voice",t))}},H=(0,he.A)(B),J=(0,j.jE)(),X=v&&me(v.id,"message",y),{mutateAsync:K,isLoading:V}=(0,Q.A)("/helpgent/message");function $(e,t,n){return ee(async()=>await q(e,t,n))}async function q(e,t,n){if(w)return;if(!t.length)throw{success:!1,message:"The attachment file is missing"};const a=F.getFile(t);if(!a.isValid)throw{success:!1,message:a.messages.length?a.messages[0].message:"The file is not valid"};x(!0);const i=await F.uploadFiles(t);if(!i.success)throw i;const r=i.fileIds.length?i.fileIds[0]:0;try{const t=await(o={attachment_id:parseInt(r),message:n&&"string"==typeof n?n:"",replied_by:e},o={response_id:v.id,...o},K(o));return F.clearFiles(),x(!1),t}catch(e){throw x(!1),e}var o}async function ee(e){try{const t=await e();return function(){J.invalidateQueries([`helpgent-${f}`]),J.invalidateQueries([`helpgent-${b}`]);try{Me(v.id,"message",y,L),Me(v.id,"textMessageContent",y,L)}catch(e){}}(),{success:!0,response:t}}catch(e){let t="string"==typeof e.message?e.message:"Something went wrong";if(e.messages&&"object"==typeof e.messages){const n=Object.keys(e.messages);t=n.length?e.messages[n[0]][0]:t}return(0,k.doAction)("helpgent-toast",{message:t,type:"error"}),{success:!1,message:t}}}return(0,a.createElement)(ie,{className:W?"helpgent-conversation-action helpgent-disabled":"helpgent-conversation-action"},(0,a.createElement)(Ee.A,{isActive:o,onChange:e=>{l(e)},className:"helpgent-video-recorder-modal"},(0,a.createElement)(Ue.yY,{className:"helpgent-video-recorder-modal-contents"},(0,a.createElement)(Oe.A,{fileUploader:F,previewMode:"previewWithText",submitButtonLabel:"Send",videoResolution:S,maxRecordLength:C,onSubmit:(e,t)=>$("video",e,t),onExit:()=>l(!1)}))),(0,a.createElement)(Ee.A,{isActive:c,onChange:e=>{g(e)}},(0,a.createElement)(Ze,{fileUploader:F,onSubmit:(e,t)=>$("video",e,t),onExit:()=>g(!1)})),(0,a.createElement)(Ee.A,{isActive:m,onChange:e=>N(e)},(0,a.createElement)(Re.A,{file:d,onSubmit:(e,t)=>{const{files:n}=F.setFile(e);return $("screen_record",n,t)},onExit:()=>{u(null),N(!1)},submitButtonLabel:(0,p.__)("Send","helpgent")})),"action"!==I||X&&(0,a.createElement)("div",{className:"helpgent-back-to-action",onClick:()=>(L({...y,conversationMode:"action",replyingMessageId:null}),Me(v.id,"message",y,L),Me(v.id,"textMessageContent",y,L),void H.reset())},(0,a.createElement)(s.A,{src:ve.A})),"action"!==I||X?X&&X.send?(0,a.createElement)(be,{baseApiRoute:t}):X&&X.voice?(0,a.createElement)(_e,{recorder:H,maxRecordLength:B.maxRecordLength,isSendLoading:V,isUploadLoading:w}):X&&X.reply?(0,a.createElement)(De,{baseApiRoute:t}):void 0:(0,a.createElement)("div",{className:"helpgent-conversation-action__main"},(0,a.createElement)("h4",{className:"helpgent-conversation-action__title"},(0,p.__)("How would you like to reply?","helpgent")),(0,a.createElement)("div",{className:"helpgent-conversation-action__list helpgent-d-flex"},(0,a.createElement)(Te,{isActive:n,label:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.A,{src:we.A})," ",(0,p.__)("Video","helpgent")),onChange:e=>{r(e)},popupContent:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h4",{className:"helpgent-conversation-action__title"},(0,p.__)("How would you like to create this step?","helpgent")),(0,a.createElement)("div",{className:"helpgent-button-group"},(0,a.createElement)("div",{className:"helpgent-btn helpgent-btn-lg helpgent-btn-gray",onClick:()=>{l(!o),r(!1)}},(0,a.createElement)(s.A,{src:we.A}),(0,p.__)("Record","helpgent")),(0,a.createElement)("div",{className:"helpgent-btn helpgent-btn-lg helpgent-btn-gray",onClick:()=>{g(!c),r(!1)}},(0,a.createElement)(s.A,{src:we.A}),(0,p.__)("Upload","helpgent"))))}),(0,a.createElement)(Ye,{label:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.A,{src:Le.A}),(0,p.__)("Screen","helpgent")),maxRecordLength:C,onStop:e=>{u(e),N(!0)}}),(0,a.createElement)("div",{className:"helpgent-btn helpgent-btn-lg helpgent-btn-white",onClick:()=>async function(){if(await H.checkPermission())return ue(v.id,"message",{voice:{}},y,L),await H.setupStream(),void await H.start();!async function(){await H.requestPermission()&&(ue(v.id,"message",{voice:{}},y,L),await H.setupStream(),await H.start())}()}()},(0,a.createElement)(s.A,{src:xe.A}),(0,p.__)("Voice","helpgent")),(0,a.createElement)("div",{className:"helpgent-btn helpgent-btn-lg helpgent-btn-white",onClick:()=>{ue(v.id,"message",{send:{}},y,L)}},(0,a.createElement)(s.A,{src:ye.A}),(0,p.__)("Text","helpgent")))))}var Pe=n(38769),We=n(57945),Be=n(75836),He=n(66582),Je=n(17955),Xe=n(67076),Ke=n(33410),Ve=n(20978);function $e(e){const{file:t}=e,n=(0,i.useRef)(new Audio(t.url)),[r,o]=(0,i.useState)(!1),[l,c]=(0,i.useState)(0),[p,g]=(0,i.useState)(0),d=n.current.paused;return(0,i.useEffect)(()=>{r&&0===p-l&&o(!1)},[l]),(0,i.useEffect)(()=>{if(!n.current||n.current.error)return;const e=e=>c(e.target.currentTime),t=e=>g(e.target.duration);return n.current.addEventListener("timeupdate",e),n.current.addEventListener("loadeddata",t),()=>{n.current.removeEventListener("timeupdate",e),n.current.removeEventListener("loadeddata",t)}},[]),(0,a.createElement)(ce,{className:"helpgent-voice-conversation "+(n?.current?.error?"helpgent-media-disabled":"")},(0,a.createElement)("audio",{src:t.url}),(0,a.createElement)("div",{className:"helpgent-voice-conversation__player helpgent-d-flex"},(0,a.createElement)("a",{href:"#",className:"helpgent-voice-conversation__toggle",onClick:function(e){e.preventDefault(),n.current&&!n.current.error&&(n.current.paused?(n.current.play(),o(!0)):(n.current.pause(),o(!1)))}},r?(0,a.createElement)(s.A,{src:Ve.A}):(0,a.createElement)(s.A,{src:Ke.A})),(0,a.createElement)(Je.A,{audioCurrentTime:l,audioDuration:p,audioPaused:d})),(0,a.createElement)("div",{className:"helpgent-voice-conversation__control"},(0,a.createElement)("span",{className:"helpgent-voice-conversation__time-meta"},function(){const e=p-l;return(0,He.C1)(e)}()),(0,a.createElement)("a",{href:t.url,className:"helpgent-voice-conversation__download",download:!0},(0,a.createElement)(s.A,{src:Xe.A}))))}var qe=n(51893),et=n(80444);function tt(e){const{file:t}=e,n=(0,i.useRef)(),[r,o]=(0,i.useState)(!1);return(0,a.createElement)(pe,{className:"helpgent-video-conversation "+(n?.current?.error?"helpgent-media-disabled":"")},(0,a.createElement)("video",{ref:n,src:t?.url,preload:"auto",onPlay:()=>{o(!0)},onPause:()=>{o(!1)},playsInline:!0}),(0,a.createElement)("a",{href:"#",className:"helpgent-video-conversation__toggle",onClick:e=>{e.preventDefault(),n.current&&(n.current.paused?(o(!0),n.current.play()):(n.current.pause(),o(!1)))}},r?(0,a.createElement)(s.A,{src:Ve.A}):(0,a.createElement)(s.A,{src:Ke.A})),r?null:(0,a.createElement)("a",{href:t?.url,className:"helpgent-video-conversation__download",download:!0},(0,a.createElement)(s.A,{src:Xe.A})),r?null:(0,a.createElement)("div",{className:"helpgent-video-conversation__visualization"},(0,a.createElement)("a",{href:"#",className:"helpgent-video-conversation__expander",onClick:e=>(0,qe.A)(e,n)},(0,a.createElement)(s.A,{src:et.A}))))}var nt=n(4286);function at(e){const{user:t,message:n,attachment:i,isShowingDate:r,date:o}=e;return(0,a.createElement)(nt.ZR,{className:"helpgent-user-block helpgent-d-flex"},(0,a.createElement)("div",{className:"helpgent-user-block__left"},t.avatar_url?(0,a.createElement)(O.A,{src:t.avatar_url,alt:"helpgent Image"}):(0,a.createElement)("span",null,t.display_name.slice(0,2))),(0,a.createElement)("div",{className:"helpgent-user-block__right"},(0,a.createElement)("div",{className:"helpgent-user-block__info"},t?(0,a.createElement)("span",{className:"helpgent-user-block__username"},t.display_name):(0,a.createElement)("span",{className:"helpgent-user-block__username"},(0,p.__)("Anonymous","helpgent")),o&&(0,a.createElement)("span",{className:"helpgent-user-block__date-meta"},o)),(0,a.createElement)("div",{className:"helpgent-user-block__content"},n&&(0,a.createElement)("p",null,n),i&&(0,a.createElement)("span",{className:"helpgent-user-block__content-attachment"},(0,a.createElement)(s.A,{src:B.A}),(0,a.createElement)("span",{className:"helpgent-user-block__content-fileName"},i.title)))))}function it(e){const{user:t,message:n,attachment:i,isDeleteMessageLoading:r}=e;return(0,a.createElement)(ge,{className:"helpgent-conversation-delete"},(0,a.createElement)("h5",{className:"helpgent-conversation-delete__label"},(0,p.__)("Are you sure you want to delete this message?","helpgent")),(0,a.createElement)(at,{user:t,message:n,attachment:i,isDeleteMessageLoading:r}))}var rt=n(9716);function ot(e){const{activeResponse:t,messageContent:n,baseApiRoute:r}=e,o=G(n),{responseState:l,setResponseState:c}=M(),{responseQueryKey:g,sentResponse:h,sentUser:u,forwardSearchInput:m}=l,[N,w]=(0,i.useState)(""),{ref:x,inView:y}=(0,S.Wx)(),{ref:L,inView:v}=(0,S.Wx)(),I=(0,i.useRef)(),[f,b]=(0,i.useState)(!1),{mutateAsync:D,isLoading:z}=(0,Q.A)("/helpgent/message/forward"),{mutateAsync:_,isLoading:A}=(0,Q.A)("/helpgent/message/forward/to-user"),E=(0,j.jE)(),{data:C,isSuccess:T,hasNextPage:k,fetchNextPage:Y,isFetchingNextPage:O,isError:U,errorMessage:Z}=(0,d.A)([`helpgent-forward-responses-${m}`],(0,ee.addQueryArgs)("/helpgent/message/forward/responses",{response_id:parseInt(t.id),per_page:parseInt(5),search:m}),5,{refetchOnWindowFocus:!1,keepPreviousData:!0,staleTime:1e5}),{data:R,isSuccess:F,hasNextPage:P,fetchNextPage:W,isFetchingNextPage:B,isError:H,errorMessage:J}=(0,d.A)(["helpgent-forward-users"],(0,ee.addQueryArgs)("/helpgent/message/forward/users",{per_page:parseInt(5),search:m}),5,{refetchOnWindowFocus:!1,keepPreviousData:!0,staleTime:1e5});async function X(e,t){e.preventDefault();const a={message:N,parent_message_id:parseInt(n.id),response_id:parseInt(t)};try{let e=h;await D(a),e.push(t),c({...l,sentResponseArray:e}),E.invalidateQueries(`helpgent-responses-${g}`)}catch(e){console.log(e)}}async function K(e,t){e.preventDefault();const a={message:N,parent_message_id:parseInt(n.id),user_id:parseInt(t)};try{let e=u;await _(a),e.push(t),c({...l,sentUserArray:e}),E.invalidateQueries(`helpgent-responses-${g}`)}catch(e){console.log(e)}}function V(e){e.preventDefault(),e.stopPropagation(),I.current&&(I.current.paused?(b(!0),I.current.play()):(I.current.pause(),b(!1)))}return(0,i.useEffect)(()=>{x&&k&&Y()},[y,Y,k]),(0,i.useEffect)(()=>{L&&P&&W()},[v,W,P]),(0,a.createElement)(de,{className:"helpgent-conversation-forward"},(0,a.createElement)("div",{className:"helpgent-conversation-forward__content"},n.message&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(at,{user:o,message:n.message,isShowingDate:!0}),(0,a.createElement)("div",{className:"helpgent-conversation-forward__reply"},(0,a.createElement)("textarea",{placeholder:"Reply...",value:N,onChange:e=>w(e.target.value)}))),n.attachment&&(0,a.createElement)("div",{className:"helpgent-conversation-forward__attachment helpgent-d-flex"},(0,a.createElement)("div",{className:"helpgent-conversation-forward__attachment-content"},"audio/wav"===n.attachment.mime_type&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.A,{src:xe.A}),(0,a.createElement)("audio",{ref:I,src:n.attachment.url,preload:"auto",onPlay:()=>{b(!0)},onPause:()=>{b(!1)}},"sdf"),(0,a.createElement)("span",{className:"helpgent-media-conversation__toggle helpgent-media-conversation__toggle--audio",onClick:e=>{V(e)}},f?(0,a.createElement)(s.A,{src:Ve.A}):(0,a.createElement)(s.A,{src:Ke.A}))),("video/mp4"===n.attachment.mime_type||"video/webm"===n.attachment.mime_type)&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)("video",{ref:I,src:n.attachment.url,preload:"auto",onPlay:()=>{b(!0)},onPause:()=>{b(!1)}}),(0,a.createElement)("span",{className:"helpgent-media-conversation__toggle",onClick:e=>{V(e)}},f?(0,a.createElement)(s.A,{src:Ve.A}):(0,a.createElement)(s.A,{src:Ke.A})))),(0,a.createElement)("div",{className:"helpgent-conversation-forward__reply"},(0,a.createElement)("textarea",{placeholder:(0,p.__)("Reply...","helpgent"),value:N,onChange:e=>w(e.target.value)}))),(0,a.createElement)("div",{className:"helpgent-conversation-forward__user"},(0,a.createElement)("div",{className:"helpgent-conversation-forward__user-input"},(0,a.createElement)("input",{type:"text",placeholder:(0,p.__)("Search user or responses","helpgent"),value:m,onChange:e=>function(e){E.invalidateQueries(["helpgent-forward-users"]),E.invalidateQueries(["helpgent-forward-responses"]),c({...l,forwardSearchInput:e.target.value})}(e)})),(0,a.createElement)("div",{className:"helpgent-conversation-forward__list"},(0,a.createElement)("div",{className:"helpgent-conversation-forward__list-group"},(0,a.createElement)("span",{className:"helpgent-conversation-forward__list-label"},(0,p.__)("Conversations","helpgent")),T&&C.pages.map(e=>e.map((t,n)=>{const i=G(t);return e.length===n+1?(0,a.createElement)("div",{className:"helpgent-conversation-forward__list-single",ref:x||null,key:n},(0,a.createElement)(at,{user:i,message:t.message&&t.message.message}),(0,a.createElement)("a",{href:"#",className:"helpgent-btn helpgent-btn-xs helpgent-btn-primary "+(h.includes(t.id)?"disabled":""),onClick:e=>{h.includes(t.id)||X(e,t.id)}},(0,a.createElement)("span",null,h.includes(t.id)?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.A,{src:rt.A})," ",(0,p.__)("Sent","helpgent")):(0,a.createElement)(a.Fragment,null,(0,p.__)("Send","helpgent"))))):"1"===t.is_completed?(0,a.createElement)("div",{className:"helpgent-conversation-forward__list-single helpgent-d-flex",key:n},(0,a.createElement)(at,{user:i,message:t.message&&t.message.message}),(0,a.createElement)("a",{href:"#",className:"helpgent-btn helpgent-btn-xs helpgent-btn-primary "+(h.includes(t.id)?"disabled":""),onClick:e=>{h.includes(t.id)||X(e,t.id)}},(0,a.createElement)("span",null,h.includes(t.id)?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.A,{src:rt.A})," ",(0,p.__)("Sent","helpgent")):(0,a.createElement)(a.Fragment,null,(0,p.__)("Send","helpgent"))))):void 0})),O&&(0,a.createElement)("span",null,(0,p.__)("Loading","helpgent"))),R&&0!==R.pages[0].length&&(0,a.createElement)("div",{className:"helpgent-conversation-forward__list-group"},(0,a.createElement)("span",{className:"helpgent-conversation-forward__list-label"},(0,p.__)("Users","helpgent")),F&&R.pages.map(e=>e.map((t,n)=>e.length===n+1?(0,a.createElement)("div",{className:"helpgent-conversation-forward__list-single helpgent-d-flex",ref:L||null,key:n},(0,a.createElement)(at,{user:t}),(0,a.createElement)("a",{href:"#",className:"helpgent-btn helpgent-btn-xs helpgent-btn-primary "+(u.includes(t.ID)?"disabled":""),onClick:e=>{u.includes(t.ID)||K(e,t.ID)}},(0,a.createElement)("span",null,u.includes(t.ID)?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.A,{src:rt.A})," ",(0,p.__)("Sent","helpgent")):(0,a.createElement)(a.Fragment,null,(0,p.__)("Send","helpgent"))))):(0,a.createElement)("div",{className:"helpgent-conversation-forward__list-single helpgent-d-flex",key:n},(0,a.createElement)(at,{user:t}),(0,a.createElement)("a",{href:"#",className:"helpgent-btn helpgent-btn-xs helpgent-btn-primary "+(u.includes(t.ID)?"disabled":""),onClick:e=>{u.includes(t.ID)||K(e,t.ID)}},(0,a.createElement)("span",null,u.includes(t.ID)?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.A,{src:rt.A})," ",(0,p.__)("Sent","helpgent")):(0,a.createElement)(a.Fragment,null,(0,p.__)("Send","helpgent"))))))),B&&(0,a.createElement)("span",null,(0,p.__)("Loading","helpgent")))))))}function lt(e){const t=document.getElementById(e);t&&(t.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),t.classList.add("wpwax-vm-message-focused"),setTimeout(()=>{t.classList.remove("wpwax-vm-message-focused")},"1000"))}var st=n(44220);function ct(e){const{type:t,parent:n}=e,i=G(n),r=n.message&&(0,st.A)(n?.message);return(0,a.createElement)(re,{className:`helpgent-conversation-parent helpgent-conversation-parent--${t}`},(0,a.createElement)("span",{className:"helpgent-conversation-parent__label"},(0,a.createElement)(s.A,{src:"reply"===t?je:Be.A}),"reply"===t?(0,p.__)("Reply message","helpgent"):(0,p.__)("Forward message","helpgent")),(0,a.createElement)("div",{className:"helpgent-conversation-parent__content",onClick:()=>"reply"===t?lt(`helpgent-conversation-${n.id}`):{}},i&&(0,a.createElement)("div",{className:"helpgent-conversation-parent__content-top"},(0,a.createElement)("div",{className:"helpgent-conversation-parent__author"},i.avatar_url?(0,a.createElement)(O.A,{src:i.avatar_url,alt:(0,p.__)("Helpgent Image","helpgent")}):(0,a.createElement)("span",null,i.display_name.slice(0,2))),(0,a.createElement)("div",{className:"helpgent-conversation-parent__author-info"},(0,a.createElement)("span",{className:"helpgent-author-name"},i?.display_name),(0,a.createElement)("span",{className:"helpgent-conversation-time-meta"},(0,h.Yq)(n?.created_at)))),(0,a.createElement)("div",{className:"helpgent-conversation-parent__content-bottom"},(0,a.createElement)("p",{dangerouslySetInnerHTML:{__html:r}}),n?.attachment&&(0,a.createElement)("div",{className:"helpgent-conversation-parent__attachment"},(0,a.createElement)("div",{className:"helpgent-conversation-parent__attachment-icon"},(0,a.createElement)(s.A,{src:Z.de[n?.attachment?.mime_type]||B.A})),(0,a.createElement)("div",{className:"helpgent-conversation-parent__attachment-info"},(0,a.createElement)("span",{className:"helpgent-attachment-name"},n?.attachment?.title),(0,a.createElement)("span",{className:"helpgent-attachment-size"},(0,h.w3)(n.attachment.file_size)))),n?.attachment&&"forward"===t&&("video/mp4"===n.attachment.mime_type||"video/webm"===n.attachment.mime_type?(0,a.createElement)("div",{className:"helpgent-conversation-parent__attachment-video"},(0,a.createElement)(tt,{file:n.attachment})):(0,a.createElement)("div",{className:"helpgent-conversation-parent__attachment-audio"},(0,a.createElement)($e,{file:n.attachment}))))))}var pt=n(33764),gt=n(96870),dt=n(88141),ht=n(56427),ut=n(44724),mt=n(28029),Mt=n(54869),Nt=n(13777);const wt=(0,k.applyFilters)("helpgent_answers",{textAnswer:pt.A,infoAnswer:gt.A,fileUploadAnswer:dt.A,singleSelectAnswer:function(e){const{options:t,currentValue:n}=e;return t.map((e,t)=>(0,a.createElement)(nt.a5,{className:"helpgent-single-select",key:t},(0,a.createElement)("input",{type:"radio",name:"single_select",id:`helpgent-select-option-${t}`,checked:e.id===n,onChange:()=>{}}),(0,a.createElement)("label",{htmlFor:`helpgent-select-option-${t}`,className:"helpgent-single-select__option"},e.label)))},yesNoAnswer:function(e){const{options:t,currentValue:n}=e;return t.map((e,t)=>(0,a.createElement)("div",{className:"helpgent-toggle helpgent-choice-item",key:t},(0,a.createElement)(ht.ToggleControl,{label:e.label,checked:e.value===n,onChange:()=>{}})))},dropdownAnswer:function(e){const{options:t,currentValue:n}=e;return t.map((e,t)=>(0,a.createElement)("div",{className:"helpgent-dropdown-answer helpgent-choice-item",key:t},e.id===n&&(0,a.createElement)("span",{className:"helpgent-dropdown-answer__selected"},(0,a.createElement)(s.A,{src:rt.A})),(0,a.createElement)("span",{className:"helpgent-dropdown-answer__label"},e.label)))},openEndedVoiceAnswer:ut.A,openEndedVideoAnswer:mt.A,mapAnswer:function(e){const{locationLatLng:t}=e,n=(0,i.useRef)(null),r=JSON.parse(t);return(0,i.useEffect)(()=>{new Mt.aH({apiKey:helpgent_localization.google_map_api_key,version:"weekly",libraries:["places","marker"]}).load().then(()=>{const e=new google.maps.Map(n.current,{center:r,zoom:12,streetViewControl:!1,scrollwheel:!1,mapTypeControl:!1,mapId:"DEMO_MAP_ID"}),t=document.createElement("img");t.src=Nt.A;const a=new google.maps.marker.AdvancedMarkerElement({map:e,position:r,content:t});(new google.maps.Geocoder).geocode({location:r},(t,n)=>{if("OK"!==n)return void console.log("Geocoder failed due to: "+n);if(!t[0])return void console.log("No results found");const i=`<div class="helpgent-map-info-window">\n\t\t\t\t\t<span>${t[0].formatted_address}</span>\n\t\t\t\t</div>`,r=new google.maps.InfoWindow({content:i,ariaLabel:"Address Info"});a.addListener("click",()=>{r.open(e,a)})})})},[]),(0,a.createElement)("div",{className:"helpgent-conversation-map-wrapper",ref:n})}}),xt=(0,i.forwardRef)((e,t)=>{const n=(0,Ne.L)(),{content:r,isFirstMessage:o,isLastAnswer:l,inView:c,icon:g,contentDirection:d,contentType:u,conversationType:m,count:N,isClientModeActive:w,baseApiRoute:x}=e,{responseState:y,setResponseState:L}=M(),{activeResponse:v,responseAutoActivate:I,responseQueryKey:f,messageQueryKey:b,unreadMessages:D}=y,_=v&&me(v.id,"message",y),A=(0,j.jE)(),{mutateAsync:E,isLoading:C}=(0,Pe.A)(`/helpgent/message/${r.id}`),{mutateAsync:T,isLoading:P}=(0,Q.A)(`${x?.responses}/${v?.id}/read`),{mutateAsync:W,isLoading:B}=(0,Q.A)(`/helpgent/message/${r?.id}/read`),H=G(r),J=G(v),{mutateAsync:X,isLoading:K}=(0,U.A)((0,ee.addQueryArgs)(`/helpgent/message/${r?.id}`,{response_id:v?.id})),[V,$]=(0,i.useState)(null),[q,te]=(0,i.useState)(!1),[ne,ae]=(0,i.useState)(!1),ie=(0,i.useRef)(null),{ref:re,inView:oe}=(0,S.Wx)();async function le(){const e={response_id:v.id,is_read:1};await W(e),A.invalidateQueries(`helpgent-responses-${f}`)}function se(){if("trash"===r.status)return(0,a.createElement)("p",null,"This message was deleted");if("long_text"===r.element_type||"short_text"===r.element_type||"number"===r.element_type||"date"===r.element_type||"time"===r.element_type||"email"===r.element_type||"website"===r.element_type||"phone_number"===r.element_type||"text"===r.replied_by||"reply"===r.replied_by||"forward"===r.replied_by||"map"===r.replied_by&&wt?.textAnswer){const e=r.message||r.value,t=wt.textAnswer;return(0,a.createElement)(t,{conversationType:m,elementType:r?.element_type,textContent:e})}if("range_slider"===r.element_type){if(wt?.rangeSliderAnswer){const e=wt.rangeSliderAnswer;return(0,a.createElement)(e,{currentValue:r?.value,maxValue:r?.max_value,minValue:r?.min_value})}return(0,a.createElement)("div",{className:"helpgent-conversation-pro"},(0,p.__)("Range slider is not available in free version","helpgent"))}if("promoter_score"===r.element_type){if(wt?.promoterScoreAnswer){const e=wt.promoterScoreAnswer;return(0,a.createElement)(e,{activeScore:r.value})}return(0,a.createElement)("div",{className:"helpgent-conversation-pro"},(0,p.__)("Promoter Score is not available in free version","helpgent"))}if("single_select"===r.element_type&&wt?.singleSelectAnswer){const e=wt.singleSelectAnswer;return(0,a.createElement)(e,{options:r?.options,currentValue:r?.value})}if("multi_select"===r?.element_type){if(wt?.multiSelectAnswer){const e=wt.multiSelectAnswer;return(0,a.createElement)(e,{options:r?.options,currentValue:r?.value})}return(0,a.createElement)("div",{className:"helpgent-conversation-pro"},(0,p.__)("Multi Select is not available in free version","helpgent"))}if("picture_select"===r.element_type){if(wt?.pictureSelectAnswer){const e=wt.pictureSelectAnswer;return(0,a.createElement)(e,{options:r.options,currentValue:r.value})}return(0,a.createElement)("div",{className:"helpgent-conversation-pro"},(0,p.__)("Picture select is not available in free version","helpgent"))}if("yes_no"===r.element_type&&wt?.yesNoAnswer){const e=wt.yesNoAnswer;return(0,a.createElement)(e,{options:r.options,currentValue:r.value})}if("rating_star"===r.element_type){if(wt?.ratingStarAnswer){const e=wt.ratingStarAnswer;return(0,a.createElement)(e,{ratingAmount:r.rating_amount,currentValue:r.value})}return(0,a.createElement)("div",{className:"helpgent-conversation-pro"},(0,p.__)("Rating is not available in free version","helpgent"))}if("dropdown"===r.element_type&&wt?.dropdownAnswer){const e=wt.dropdownAnswer;return(0,a.createElement)(e,{options:r.options,currentValue:r.value})}if("file_upload"===r.element_type&&wt?.fileUploadAnswer){const e=wt.fileUploadAnswer;return r?.attachments&&r?.attachments.map((t,n)=>(0,a.createElement)(e,{file:t,key:n}))}if(("address"===r.element_type||"contact_info"===r.element_type)&&wt?.infoAnswer){const e=wt.infoAnswer;return(0,a.createElement)(e,{answer:r.address||r.contact_info,labels:r.labels||null})}if("voice"===r.replied_by)return(0,a.createElement)($e,{file:r.file||r.attachment});if("open_ended_voice"===r.element_type&&wt?.openEndedVoiceAnswer){const e=wt.openEndedVoiceAnswer;return(0,a.createElement)(e,{file:r.file||r.attachment})}if(("open_ended_screen"===r.element_type||"open_ended_video"===r.element_type)&&wt?.openEndedVideoAnswer){const e=wt.openEndedVideoAnswer;return(0,a.createElement)(e,{type:r.element_type,file:r.file||r.attachment})}if("screen_record"===r.replied_by||"video"===r.replied_by)return(0,a.createElement)(tt,{file:r.file||r.attachment});if("open_ended_text"===r.element_type&&wt?.infoAnswer){const e=wt.infoAnswer;return(0,a.createElement)(e,{answer:r.open_ended_text_inners,labels:r.labels||null})}if("map"===r.element_type&&wt?.mapAnswer){const e=wt.mapAnswer;return(0,a.createElement)(e,{locationLatLng:r.value})}}function ce(e){ie.current.value=e.target.value}function pe(e){"Enter"===e.key?(e.preventDefault(),de(e)):"Escape"===e.key&&ge(e)}function ge(e){e.preventDefault(),$(null),ie.current.value=""}async function de(e){e.preventDefault();try{const t={response_id:v.id,message:ie.current.value};await E(t),A.invalidateQueries([`helpgent-${b}`]),ge(e)}catch(e){}}(0,i.useEffect)(()=>{const e=ie.current;e&&(e.style.overflowY="hidden",e.focus(),e.value=r.message)},[V]),(0,i.useEffect)(()=>{oe&&"0"===r.is_read&&(w?(v?.message?.id===r?.id&&H?.id!==J?.id&&H?.isGuest===J?.isGuest||H?.isGuest!==J?.isGuest&&H?.id===J?.id)&&le():"0"===v?.message?.is_read&&v?.message?.id===r?.id&&H?.id===J?.id&&H?.isGuest===J?.isGuest&&le())},[oe]),(0,i.useEffect)(()=>{oe&&"0"===v.is_read&&async function(){try{const e={is_read:1};await T(e),A.invalidateQueries(`helpgent-responses-${f}`)}catch(e){console.log(e)}}()},[v?.id]);const he=_&&_.reply&&_.reply.messageId,Me=H?H?.display_name:`${(0,p.__)("Anonymous","helpgent")} (# ${v?.id})`;return(0,a.createElement)("div",{className:`helpgent-conversation helpgent-conversation-${m} helpgent-conversation-${d} helpgent-conversation-${r.status} ${r.parent?"conversation-has-parent":""} helpgent-conversation-${r.element_type||r.replied_by}`,id:`helpgent-conversation-${r.id}`,ref:t||null},"answer"===m?(0,a.createElement)("div",{className:"helpgent-conversation__top helpgent-d-flex"},(0,a.createElement)("div",{className:"helpgent-conversation__icon"},N&&(0,a.createElement)("span",{className:"helpgent-badge helpgent-badge-circle helpgent-badge-light"},N),(0,a.createElement)(s.A,{src:Z.UF[g]})),(0,a.createElement)("div",{className:"helpgent-conversation__title"},"message"===m?(0,a.createElement)("h4",null,(0,p.__)("Replied via","helpgent")," ",r.replied_by):(0,a.createElement)("h4",{dangerouslySetInnerHTML:{__html:r?.element_title}}),r.created_at&&(0,a.createElement)("div",{className:"helpgent-conversation__date"},(0,h.Yq)(r.created_at)))):"publish"===r.status?(0,a.createElement)("div",{className:"helpgent-conversation__author-image"},H?.avatar_url?(0,a.createElement)(O.A,{src:H?.avatar_url,alt:(0,p.__)("Helpgent Media","helpgent")}):(0,a.createElement)("span",null,H.display_name.slice(0,2))):void 0,(0,a.createElement)("div",{className:r.replied_by&&he===r.id?"helpgent-conversation__content-box helpgent-conversation-focused":"helpgent-conversation__content-box",ref:o||l?re:null},"choice"===u?(0,a.createElement)("div",{className:"helpgent-conversation__choice"},(0,a.createElement)("div",{className:"helpgent-choice-list"},se())):(0,a.createElement)(i.Fragment,null,(0,a.createElement)("div",{className:"helpgent-conversation__content-box-inner"},"message"===m&&"trash"!==r.status&&(0,a.createElement)("div",{className:"helpgent-conversation-meta"},(0,a.createElement)("span",{className:"helpgent-conversation-meta__date"},(0,h.Yq)(r.updated_at||r.created_at)),(0,a.createElement)("span",{className:"helpgent-conversation-meta__username"},Me)),(0,a.createElement)("div",{className:`helpgent-conversation__content helpgent-conversation__content-inline helpgent-conversation${n?"pro":"-free"} helpgent-conversation__content-${r.element_type||r.replied_by} ${V===r.id?"helpgent-conversation__content-editable":""} ${"trash"===r.status?"helpgent-conversation__content--deleted":""}`},V===r.id&&r.forward&&(0,a.createElement)("div",{className:"helpgent-conversation__content-edit"},(0,a.createElement)("textarea",{ref:ie,name:"helpgent-editable-textarea",id:"helpgent-editable-textarea",onChange:ce,onKeyDown:pe})),V!==r.id&&r.forward&&se(),(r.parent||r.forward)&&(0,a.createElement)(ct,{type:r.parent?"reply":"forward",parent:r.parent||r.forward}),V===r.id&&!r.forward&&(0,a.createElement)("div",{className:"helpgent-conversation__content-edit"},(0,a.createElement)("textarea",{ref:ie,name:"helpgent-editable-textarea",id:"helpgent-editable-textarea",onChange:ce,onKeyDown:pe})),V!==r.id&&!r.forward&&se()),V===r.id&&(0,a.createElement)("div",{className:"helpgent-conversation-edit-action"},(0,a.createElement)("span",{className:"helpgent-conversation-edit__cancel"},(0,p.__)("esc to","helpgent")," ",(0,a.createElement)("a",{href:"#",onClick:e=>ge(e)},(0,p.__)("cancel","helpgent"))),(0,a.createElement)("span",{className:"helpgent-conversation-edit__save"},(0,p.__)("enter to","helpgent")," ",(0,a.createElement)("a",{href:"#",onClick:e=>de(e)},(0,p.__)("save","helpgent")))))),"message"===m&&V!==r.id&&"publish"===r.status&&(0,a.createElement)(i.Fragment,null,q&&(0,a.createElement)(z.A,{title:(0,p.__)("Delete message","helpgent"),onCancel:function(){te(!1)},onSubmit:async function(){try{await X(),te(!1),A.invalidateQueries([`helpgent-${b}`]),A.invalidateQueries([`helpgent-responses-${f}`]),(0,k.doAction)("helpgent-toast",{message:(0,p.__)("Message deleted successfully","helpgent")})}catch(e){console.log(e)}},hasCancelButton:!0,hasSubmitButton:!0,isActiveSubmit:!0,submitText:K?(0,p.__)("Deleting","helpgent"):(0,p.__)("Delete","helpgent"),className:" helpgent-conversation-delete"},(0,a.createElement)(it,{user:G(r),message:r.message,attachment:r.attachment})),ne&&(0,a.createElement)(z.A,{title:(0,p.__)("Forward this message","helpgent"),className:"helpgent-modal-forward",onCancel:function(){ae(!1),L({...y,sentResponse:[],sentUser:[],responseAutoActivate:!0})},cancelText:(0,p.__)("Done","helpgent"),cancelBtnType:"primary",isActiveSubmit:!0,hasCancelButton:!0},(0,a.createElement)(ot,{activeResponse:v,messageContent:r,baseApiRoute:x})),(0,a.createElement)(Y.A,{className:"helpgent-conversation-dropdown",dropDownIcon:R.A,dropdownList:(()=>{let e=[{name:"edit",icon:We.A,text:(0,p.__)("Edit","helpgent")},{name:"reply",icon:je,text:(0,p.__)("Reply","helpgent")},{name:"forward",icon:Be.A,text:(0,p.__)("Forward","helpgent")},{name:"remove",icon:F.A,text:(0,p.__)("Remove","helpgent")}];const t="voice"===r.replied_by||"video"===r.replied_by||"screen_record"===r.replied_by;return w?J?.id===H?.id&&H?.isGuest===J?.isGuest?t?e.filter(e=>"edit"!==e.name):e:e.filter(e=>"edit"!==e?.name&&"remove"!==e?.name):parseInt(r.created_by)===parseInt(helpgent_current_user?.id)&&"0"===H.isGuest?t?e.filter(e=>"edit"!==e?.name):e:e.filter(e=>"edit"!==e?.name&&"remove"!==e?.name)})(),placement:"left",handleDropdownTrigger:function(e,t){switch(e.preventDefault(),t){case"edit":$(r.id);break;case"reply":ue(v.id,"message",{reply:{messageId:r.id}},y,L);break;case"remove":te(!0);break;case"forward":ae(!0),L({...y,responseAutoActivate:!1})}}}))))});var yt=n(68357);function Lt(e){const{isClientModeActive:t,baseApiRoute:n}=e,{responseState:o,setResponseState:l}=M(),{activeResponse:s,responseQueryKey:c,messageQueryKey:g,answerQueryKey:h,messageSearchText:u,debouncedMessageSearchText:m,messageFetchingEnabled:N,answerFetchingEnabled:w,isConversationSearchActive:x}=o,y={address:"marker",contact_info:"marker",date:"date",time:"clock",dropdown:"angleCircle",email:"envelope",number:"hash",phone_number:"phone",promoter_score:"chartSimple",range_slider:"slider",rating_star:"star",single_select:"scrubber",multi_select:"scrubber",long_text:"chartBar",short_text:"bar",website:"url",yes_no:"toggle",file_upload:"upload",open_ended_voice:"voice",open_ended_video:"video",open_ended_screen:"screen",open_ended_text:"text",picture_select:"picture",map:"map"},{data:L,isLoading:v,isError:I,errorMessage:f,isFetching:b}=((0,j.jE)(),(0,r.A)([`helpgent-${h}`],(0,ee.addQueryArgs)("/helpgent/message/answer",{response_id:s.id}),{queryConfig:{refetchOnWindowFocus:!1,keepPreviousData:!0,staleTime:1e4,enabled:w}})),{data:D,isSuccess:z,hasNextPage:_,fetchNextPage:A,isFetchingNextPage:E,isError:C,errorMessage:T}=(0,d.A)([`helpgent-${g}`],(0,ee.addQueryArgs)("/helpgent/message/",{response_id:s.id,per_page:10,search:m}),10,{refetchOnWindowFocus:!0,keepPreviousData:!0,staleTime:1e4,enabled:N}),k=G(s),{ref:Y,inView:O}=(0,S.Wx)();return(0,i.useEffect)(()=>{O&&_&&A()},[O,A,_]),(0,a.createElement)(ae,{className:"helpgent-scrollbar-style"},(0,a.createElement)("div",{className:"helpgent-response-message"},z&&D.pages.map(e=>e.map((i,r)=>{const o=G(i);let l="";"text"===i.replied_by?l="text":"voice"===i.replied_by?l="voice":"video"===i.replied_by?l="video":"forward"===i.replied_by?l="redo":"screen"===i.replied_by&&(l="screen");let s="";return o?.id===k?.id&&o?.isGuest===k?.isGuest?(s="left",t&&(s="right")):(s="right",t&&(s="left")),(0,a.createElement)(xt,{ref:e.length===r+1||0===r?Y:null,isFirstMessage:0===r,key:r,content:i,icon:l,contentDirection:s,conversationType:"message",isClientModeActive:t,baseApiRoute:n})})),E&&(0,a.createElement)("span",{className:"helpgent-loading"},(0,p.__)("Loading","helpgent"))),(0,a.createElement)("div",{className:"helpgent-response-answer"},v||b?(0,a.createElement)("div",{className:"helpgent-conversation"},(0,a.createElement)(yt.A,null)):I?(0,a.createElement)(a.Fragment,null):L.map((e,i)=>{return(0,a.createElement)(xt,{key:i,ref:L.length===i+1?Y:null,isLastAnswer:0===i,content:e,icon:(r=e.element_type,y[r]||"defaultIcon"),count:i+1,contentDirection:t?"right":"left",conversationType:"answer",isClientModeActive:t,baseApiRoute:n});var r})))}var vt=n(49876),It=n(54899),ft=n(8748);function bt(e){const{isClientModeActive:t,baseApiRoute:n,authorData:o}=e,l=[{label:(0,p.__)("All","helpgent"),value:"all"},{label:(0,p.__)("Links","helpgent"),value:"link"},{label:(0,p.__)("Videos","helpgent"),value:"video"},{label:(0,p.__)("Voice","helpgent"),value:"voice"}],{responseState:c,setResponseState:g}=M(),[u,m]=(0,i.useState)(),[N,w]=(0,i.useState)(),{activeResponse:x,messageQueryKey:y,responseAgentQueryKey:L,responseFormQueryKey:v,messageSearchText:I,isConversationSearchActive:f,debouncedMessageSearchText:b,isConversationDrawerOpen:z,mediaFilterType:A,isFormInfoFetchingEnabled:E}=c,C=(0,j.jE)(),T=G(x),k=(0,D.d)(I,250),{data:Y,isLoading:O,isError:U,errorMessage:Q,isFetching:Z,isRefetching:R}=(0,r.A)([`helpgent-${L}`],`helpgent/response/${x?.id}/agent`,{queryConfig:{refetchOnWindowFocus:!1,keepPreviousData:!0,staleTime:1e4,enabled:t,retry:!1}}),F=(0,r.A)([`helpgent-${L}`],`helpgent/admin/response/${x?.id}/user`,{queryConfig:{refetchOnWindowFocus:!1,keepPreviousData:!0,staleTime:1e4,enabled:!t,retry:!1}}),{data:P,isLoading:W,isError:B,errorMessage:H,isFetching:J}=(0,r.A)([`helpgent-${v}`],`helpgent/response/${x?.id}/form-info`,{queryConfig:{refetchOnWindowFocus:!1,keepPreviousData:!0,staleTime:1e4,enabled:t,retry:!1}}),{data:X,isSuccess:V,isRefetching:$,hasNextPage:q,fetchNextPage:te,isFetchingNextPage:ae,isError:ie,errorMessage:re}=(0,d.A)([`helpgent-medias-${A}`],(0,ee.addQueryArgs)("/helpgent/message/attachment",{response_id:x.id,per_page:10,type:A}),10,{refetchOnWindowFocus:!1,keepPreviousData:!0,staleTime:1e4,enabled:z}),{ref:oe,inView:le}=(0,S.Wx)();function se(){g({...c,isConversationDrawerOpen:!1,mediaFilterType:"all"})}function ce(e){const{attachment:t,message:n}=e;return t?t.mime_type.startsWith("image")?(0,a.createElement)("img",{src:"",alt:""}):t.mime_type.startsWith("video")?(0,a.createElement)(tt,{file:t}):t.mime_type.startsWith("audio")?(0,a.createElement)($e,{file:t}):t.mime_type.startsWith("application/pdf")?(0,a.createElement)("div",{className:"helpgent-media-item__file"},(0,a.createElement)("div",{className:"helpgent-media-item__file-icon"},(0,a.createElement)(s.A,null)),(0,a.createElement)("div",{className:"helpgent-media-item__file-name"}),(0,a.createElement)("a",{href:"#",className:"helpgent-media-item__file-download"},(0,a.createElement)(s.A,null))):(t.mime_type.startsWith("text"),(0,a.createElement)("div",{className:"helpgent-media-item__file"},(0,a.createElement)("div",{className:"helpgent-media-item__file-icon"},(0,a.createElement)(s.A,null)),(0,a.createElement)("div",{className:"helpgent-media-item__file-name"}),(0,a.createElement)("a",{href:t.url,className:"helpgent-media-item__file-download",download:!0},(0,a.createElement)(s.A,null)))):(0,a.createElement)(pt.A,{conversationType:"message",textContent:n})}return(0,i.useEffect)(()=>{le&&q&&te()},[le,te,q]),(0,i.useEffect)(()=>{g({...c,messageQueryKey:`${y}-${k}`,debouncedMessageSearchText:k}),C.invalidateQueries([`helpgent-${y}`]),C.invalidateQueries([`helpgent-${L}`]);const e=document.querySelector(".helpgent-user-dashboard"),t=document.querySelector(".helpgent-conversation-wrapper");if(e){const t=e.clientWidth;m(t)}if(t){const e=t.clientWidth;w(e)}},[k]),(0,a.createElement)(ne,null,!f&&(0,a.createElement)("div",{className:"helpgent-header-top helpgent-d-flex"},(O||R)&&t?(0,a.createElement)("div",{className:"helpgent-header-top-user-loader"},(0,a.createElement)(ht.Spinner,null)):(0,vt.$)("helpgent_conversation_top_user",{},{responseAgent:Y,responseForm:P,responseAuthor:T,activeResponse:x,isClientModeActive:t,baseApiRoute:n,responseState:c,setResponseState:g,dashboardWidth:u,conversationWidth:N})),(0,a.createElement)("div",{className:"helpgent-user-action helpgent-d-flex "+(f?"helpgent-user-action--search-active":"")},(0,a.createElement)("div",{className:"helpgent-user-action__item helpgent-user-action__search"},f&&(0,a.createElement)("div",{className:"helpgent-user-action__search-field"},(0,a.createElement)("input",{type:"text",placeholder:(0,p.__)("Search","helpgent"),name:"helpgent-conversation-search",id:"helpgent-conversation-search",value:I,onChange:e=>function(e){g({...c,messageSearchText:e.target.value})}(e)})),(0,a.createElement)("span",{className:"helpgent-user-action__search-toggle",onClick:()=>{g({...c,isConversationSearchActive:!f,messageSearchText:""})}},(0,a.createElement)(s.A,{src:f?ve.A:_.A}))),!f&&(0,a.createElement)("a",{href:"#",className:"helpgent-user-action__item",onClick:e=>function(e){e.preventDefault(),g({...c,isConversationDrawerOpen:!0})}(e)},(0,a.createElement)(s.A,{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxNS43NSIgdmlld0JveD0iMCAwIDE4IDE1Ljc1Ij4KICA8cGF0aCBpZD0ibWVkaWEiIGQ9Ik03LjUsNS44NzVBMS4xMjUsMS4xMjUsMCwxLDEsOC42MjUsNywxLjEyMywxLjEyMywwLDAsMSw3LjUsNS44NzVaTTE4LDUuMTI1djMuNzVBNC4xMzIsNC4xMzIsMCwwLDEsMTMuODc1LDEzaC02QTQuMTMyLDQuMTMyLDAsMCwxLDMuNzUsOC44NzVWNS4xMjVBNC4xMzIsNC4xMzIsMCwwLDEsNy44NzUsMWg2QTQuMTMyLDQuMTMyLDAsMCwxLDE4LDUuMTI1Wk02LDguODc1YTEuODc5LDEuODc5LDAsMCwwLDEuMDczLDEuN2wzLjIxLTMuMjFhMS4yLDEuMiwwLDAsMSwxLjY5NSwwbC43OC43OGExLjIsMS4yLDAsMCwwLDEuNjk1LDBsMS4yOS0xLjI5VjUuMTMzYTEuODc2LDEuODc2LDAsMCwwLTEuODc1LTEuODc1SDcuODc1QTEuODc2LDEuODc2LDAsMCwwLDYsNS4xMzN2My43NVpNMTIuMzc1LDE0LjVINC4xMjVBMS44NzYsMS44NzYsMCwwLDEsMi4yNSwxMi42MjVWNy4zNzVhMS4xMjUsMS4xMjUsMCwwLDAtMi4yNSwwdjUuMjVBNC4xMzIsNC4xMzIsMCwwLDAsNC4xMjUsMTYuNzVoOC4yNWExLjEyNSwxLjEyNSwwLDAsMCwwLTIuMjVaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIC0xKSIgZmlsbD0iI2EyYTJhMiIvPgo8L3N2Zz4K"}),(0,p.__)("Media","helpgent")),(0,vt.$)("helpgent_response_header_user_Profile",{},{responseState:c,setResponseState:g,authorData:F}),(0,vt.$)("helpgent_response_top_user_Profile",{},{responseState:c,setResponseState:g,authorData:o,queryClient:C})),(0,a.createElement)(ft.A,{isOpen:z,className:"test",onClose:se},(0,a.createElement)("div",{className:"helpgent-media-filter"},(0,a.createElement)("div",{className:"helpgent-media-filter__top"},(0,a.createElement)("span",{className:"helpgent-media-filter__close",onClick:se},(0,a.createElement)(s.A,{src:ve.A})),(0,a.createElement)("div",{className:"h4 helpgent-media-filter__label"},(0,p.__)("Media Filter","helpgent")),(0,a.createElement)("div",{className:"helpgent-media-filter__dropdown"},(0,a.createElement)(K.Select,{options:l,defaultValue:l[0],inputId:"helpgent-response-filter__select",className:"helpgent-select",classNamePrefix:"helpgent-select",isSearchable:!1,placeholder:null,onChange:e=>{var t;t=e.value,g({...c,mediaFilterType:t})}}))),(0,a.createElement)("div",{className:"helpgent-media-filter__content helpgent-scrollbar-style"},(0,a.createElement)("div",{className:"helpgent-media-filter__single"},(0,a.createElement)("div",{className:"helpgent-media-filter__user"}),(0,a.createElement)("div",{className:"helpgent-media-filter__media"},$&&(0,a.createElement)(yt.A,null),V&&!$&&X.pages.map(e=>e.map((t,n)=>{const i=G(t);return e.length===n+1?(0,a.createElement)("div",{className:"helpgent-media-filter__media-item",key:n,ref:oe},(0,a.createElement)("div",{className:"helpgent-media-item-top"},(0,a.createElement)(at,{user:i,date:(0,h.Yq)(t.updated_at||t.created_at)})),(0,a.createElement)("div",{className:"helpgent-media-item-content"},ce(t),(0,a.createElement)("span",{href:"#",className:"helpgent-media-reveal",onClick:()=>lt(`helpgent-conversation-${t.id}`)},(0,a.createElement)(s.A,{src:It.A})," ",(0,a.createElement)("span",null,(0,p.__)("Reveal in conversation","helpgent"))))):(0,a.createElement)("div",{className:"helpgent-media-filter__media-item",key:n},(0,a.createElement)("div",{className:"helpgent-media-item-top"},(0,a.createElement)(at,{user:i,date:(0,h.Yq)(t.updated_at||t.created_at)})),(0,a.createElement)("div",{className:"helpgent-media-item-content"},ce(t),(0,a.createElement)("span",{href:"#",className:"helpgent-media-reveal",onClick:()=>(lt(`helpgent-conversation-${t.id}`),void g({...c,isConversationDrawerOpen:!1}))},(0,a.createElement)(s.A,{src:It.A})," ",(0,a.createElement)("span",null,(0,p.__)("Reveal in conversation","helpgent")))))})),ae&&(0,a.createElement)("span",{className:"helpgent-loading"},(0,p.__)("Loading","helpgent"))))))))}function jt(e){const{isClientModeActive:t,baseApiRoute:n,authorData:r}=e,{responseState:o}=M();return(0,a.createElement)(te,null,o?.activeResponse&&(0,a.createElement)(i.Fragment,null,(0,a.createElement)(bt,{isClientModeActive:t,baseApiRoute:n,authorData:r}),(0,a.createElement)(Lt,{isClientModeActive:t,baseApiRoute:n})),(0,a.createElement)(Fe,{baseApiRoute:n}))}var Dt=n(64197);const zt=e=>{const{baseApiRoute:t,isClientModeActive:n,baseLinkRoute:s}=e,c=(0,h.Xd)("helpgent_filterByTags",null),{responseState:p,setResponseState:u}=M(),m=(0,j.jE)();let N=null;if(!n){const{paramsHook:e}=(0,h.Xd)("helpgent_router_references",null),{id:t}=e();N=t}const{status:w,responseQueryKey:x,activeResponse:y,orderBy:L,responseSearchText:v,responseAutoActivate:I,filterByTags:f}=p,b={per_page:10,tag_ids:f,search:v,order_by:L,is_archive:"archive"===w?"1":"0",is_completed:"completed"===w?"1":"0"};n||(b.form_id=N),w&&"archive"!==w||delete b.is_completed;const{data:D,isSuccess:z,isRefetching:_,hasNextPage:A,fetchNextPage:E,isFetchingNextPage:C,isError:T,errorMessage:S}=(0,d.A)([`helpgent-responses-${x}`],(0,ee.addQueryArgs)(t?.responses,b),10,{refetchOnWindowFocus:!0,keepPreviousData:!0,staleTime:1e4}),k=(0,r.A)(["helpgent-author-data"],"/helpgent/user",{queryConfig:{refetchOnWindowFocus:!1,keepPreviousData:!1,staleTime:1e4}});return(0,i.useEffect)(()=>{c&&u({...p,responseQueryKey:`tag-filter-${x}`,filterByTags:c})},[c]),(0,i.useEffect)(()=>{const e=D?.pages[0].filter(e=>e?.id===y?.id);if(e?.length>0)u(t=>({...t,activeResponse:e[0]}));else{const e=D&&D?.pages[0][0];u(e?t=>({...t,activeResponse:e,messageQueryKey:`message-${e.id}`,answerQueryKey:`answer-${e.id}`}):e=>({...e,activeResponse:null}))}},[z,D]),(0,a.createElement)(o.A,{sidebarTop:n?(0,a.createElement)(g,{moduleState:p,queryClient:m}):(0,a.createElement)(l.A,{moduleState:p,setModuleState:u,isArchiveAvailable:!0,queryClient:m,baseApiRoute:t,baseLinkRoute:s}),sidebarChild:(0,a.createElement)(q,{data:D,isRefetching:_,isSuccess:z,isFetchingNextPage:C,hasNextPage:A,fetchNextPage:E,baseApiRoute:t,isClientModeActive:n}),mainChild:D&&(0,a.createElement)(jt,{baseApiRoute:t,isClientModeActive:n,authorData:k})})};function _t(e){return(0,a.createElement)(j.Ht,{client:Dt.A},(0,a.createElement)(N,null,(0,a.createElement)(zt,{...e})))}},96870:(e,t,n)=>{n.d(t,{A:()=>p});var a=n(51609),i=n(86087),r=n(65604),o=n(16622),l=n(67076),s=n(60518),c=n(88887);const p=(0,i.forwardRef)((e,t)=>{const{answer:n,labels:i}=e;return(0,a.createElement)(c.Yn,{className:"helpgent-info-answer-content helpgent-open-ended-answer-content"},(0,a.createElement)("div",{className:"helpgent-info-answer-wrap",ref:t||null},Object.entries(null!=i?i:{}).map((e,t)=>{if(n?.[e[0]])return(0,a.createElement)("div",{className:"helpgent-info-answer",key:t},(0,a.createElement)("div",{className:"helpgent-info-answer__label"},e[1]),"file"===e[0]?(0,a.createElement)("div",{className:"helpgent-open-end-file"},(0,a.createElement)("span",{className:"helpgent-file-icon"},(0,a.createElement)(r.A,{src:o.de[n.attachment&&n.attachment.mime_type]||s.A})),(0,a.createElement)("span",{className:"helpgent-file-name"},n.attachment&&n.attachment.title),(0,a.createElement)("a",{href:n.attachment&&n.attachment.url,className:"helpgent-file-download",download:!0},(0,a.createElement)(r.A,{src:l.A}))):(0,a.createElement)("div",{className:"helpgent-info-answer__text"},n[e[0]]))})))})}}]);