"use strict";(globalThis.webpackChunkhelpgent=globalThis.webpackChunkhelpgent||[]).push([[227],{14292:(e,t,a)=>{a.d(t,{A:()=>n}),a(51609);const n="data:image/svg+xml;base64,PHN2ZyBpZD0iY2hlY2stdGhpbiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTQiIGhlaWdodD0iMTAuMTA2IiB2aWV3Qm94PSIwIDAgMTQgMTAuMTA2Ij4KICA8cGF0aCBpZD0iUGF0aF8xNjI0IiBkYXRhLW5hbWU9IlBhdGggMTYyNCIgZD0iTTQuNTIsODAuNjc5YTEuNSwxLjUsMCwwLDEtMS4wNTktLjQzOWwtMy4yLTMuMmEuODgzLjg4MywwLDAsMSwwLTEuMjQ4aDBhLjg4My44ODMsMCwwLDEsMS4yNDgsMEw0LjUyLDc4LjhsNy45NzMtNy45NzNhLjg4My44ODMsMCwwLDEsMS4yNDgsMGgwYS44ODMuODgzLDAsMCwxLDAsMS4yNDhMNS41OCw4MC4yNEExLjUsMS41LDAsMCwxLDQuNTIsODAuNjc5WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNzAuNTczKSIgZmlsbD0iIzY1NTFmMiIvPgo8L3N2Zz4K"},14971:(e,t,a)=>{a.d(t,{A:()=>n}),a(51609);const n="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMy41MSIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDEzLjUxIDE0Ij4KICA8ZyBpZD0iR3JvdXBfMjk5OSIgZGF0YS1uYW1lPSJHcm91cCAyOTk5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjAwMikiPgogICAgPHBhdGggaWQ9IlBhdGhfMTU4OSIgZGF0YS1uYW1lPSJQYXRoIDE1ODkiIGQ9Ik0uODU1LDQuMzE5SDYuOTk0YTMuMzQ2LDMuMzQ2LDAsMCwwLDMuMiwyLjU0NSwzLjM3OCwzLjM3OCwwLDAsMCwzLjMxMy0zLjQzMkEzLjM3NywzLjM3NywwLDAsMCwxMC4xOTQsMGEzLjM0NSwzLjM0NSwwLDAsMC0zLjIsMi41NDZILjg1NWEuODg3Ljg4NywwLDAsMCwwLDEuNzczWk04LjU5NCwzLjQzYTEuNiwxLjYsMCwxLDEsMy4yLDAsMS42LDEuNiwwLDEsMS0zLjIsMFoiIGZpbGw9IiMzYzNjM2MiLz4KICAgIDxwYXRoIGlkPSJQYXRoXzE1OTAiIGRhdGEtbmFtZT0iUGF0aCAxNTkwIiBkPSJNMTIuNjUsOS42ODFINi41MTNhMy4zNDYsMy4zNDYsMCwwLDAtMy4yLTIuNTQ1aDBhMy40MzUsMy40MzUsMCwwLDAsMCw2Ljg2NSwzLjM0NywzLjM0NywwLDAsMCwzLjItMi41NDZIMTIuNjVhLjg4Ny44ODcsMCwwLDAsMC0xLjc3M1pNMy4zMTMsMTIuMjI3YTEuNjYsMS42NiwwLDAsMSwwLTMuMzE4LDEuNjYsMS42NiwwLDAsMSwwLDMuMzE4WiIgZmlsbD0iIzNjM2MzYyIvPgogIDwvZz4KPC9zdmc+Cg=="},26944:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(51609),l=a(4286);function r(e){const{type:t,currentValue:a,contentFlow:r}=e;return(0,n.createElement)(l.F2,{className:`helpgent-progress-bar helpgent-progress-bar-${t} helpgent-progress-bar-${r}`},(0,n.createElement)("div",{className:"helpgent-progress-bar__status",style:{["vertical"===r?"height":"width"]:`${a}%`}}))}},29016:(e,t,a)=>{a.d(t,{d:()=>l});var n=a(86087);function l(e,t){const[a,l]=(0,n.useState)(e);return(0,n.useEffect)(()=>{const a=setTimeout(()=>{l(e)},t);return()=>clearTimeout(a)},[e,t]),a}},41620:(e,t,a)=>{function n(e,t){return isNaN(e)||isNaN(t)||0===t?0:(e/t*100).toFixed(2).replace(/\.00$/,"")}a.d(t,{A:()=>n})},57708:(e,t,a)=>{a.d(t,{$v:()=>i,Dg:()=>o,F4:()=>l,UJ:()=>r,dt:()=>s});var n=a(38267);const l=n.Ay.div`
    margin-bottom: 22px;
    @media only screen and (max-width: 575px){
        justify-content: center;
    }
    .helpgent-page-header-title{
        font-size: 22px;
        font-weight: 500;
        color: var(--helpgent-color-dark);
    }
    .helpgent-page-header-btn{
        ${({theme:e})=>"ltr"===e.direction?"margin-inline-start":"margin-inline-end"}: 20px;
    }
    .helpgent-header-left{
        display: flex;
        align-items: center;
    }
    .helpgent-form-filter{
        display: flex;
        align-items: center;
        gap: 10px;
        .helpgent-select__menu,
        .helpgent-select__control{
            min-width: 134px;
        }
    }
    .helpgent-form-types{
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        border: 1px solid var(--helpgent-color-bg-gray);
        border-radius: 8px;
        background: #fff;
        padding: 5px;
        margin-top: 16px;
        margin-bottom: -6px;
        .helpgent-form-types-item{
            text-decoration: none;
            transition: var(--helpgent-transition);
            line-height: 30px;
            border-radius: 6px;
            color: var(--helpgent-color-gray);
            font-size: 14px;
            font-weight: 500;
            padding: 0 13px;
        }
        .helpgent-form-types-item--active{
            background: var(--helpgent-color-dark);
            color: #fff;
        }
    }
    .helpgent-form-filters{
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 26px;
        .helpgent-forms-type{
            .helpgent-select .helpgent-select__control{
                background: #fff;
                border: 1px solid var(--helpgent-color-border-light);
                border-radius: 8px;
                padding-top: 5px;
                padding-bottom: 5px;
                min-width: 200px;
            }
        }
        .helpgent-form-search-filter{
            display: flex;
            align-items: center;
            gap: 10px;
            margin-left: auto;
            .helpgent-form-search{
                width: 280px;
                border: 1px solid var(--helpgent-color-border-light);
                background: #fff;
                border-radius: 8px;
                min-height: 40px;
                display: flex;
                align-items: center;
                gap: 5px;
                padding: 0 15px;
                box-sizing: border-box;
                input{
                    padding: 0;
                    border: 0 none;
                    width: 100%;
                    font-size: 14px;
                    &:focus{
                        border: 0 none;
                        outline: 0;
                        box-shadow: none;
                    }
                }
            }
            .helpgent-form-filter-btn{
                border: 1px solid var(--helpgent-color-border-light);
                min-height: 42px;
                font-size: 14px;
                font-weight: 500;
                color: var(--helpgent-color-gray);
                padding: 0 15px;
                transition: var(--helpgent-transition);
                &:hover{
                    background: #fff;
                    color: var(--helpgent-color-dark);
                    svg,
                    svg path{
                        fill: var(--helpgent-color-dark);
                    }
                }
                svg{
                    width: 12px;
                    height: 12px;
                    transition: var(--helpgent-transition);
                }
                &.helpgent-form-filter-btn--active{
                    color: var(--helpgent-color-primary);
                    svg,
                    svg path{
                        fill: var(--helpgent-color-primary);
                    }
                }
            }
            .helpgent-form-filter-clear{
                svg,
                svg path{
                    width: 10px;
                    height: 10px;
                    fill: #fff !important;
                }
            }
            .helpgent-form-sort-btn{
                border: 1px solid var(--helpgent-color-border-light);
                min-height: 42px;
                padding: 0 13px;
                svg{
                    width: 14px;
                    height: 14px;
                    fill: var(--helpgent-color-gray);
                    transition: var(--helpgent-transition);
                }
                &.helpgent-form-sort-btn--active{
                    svg,
                    path{
                        fill: var(--helpgent-color-primary);
                    }
                    &:hover{
                        svg,
                        svg path{
                            fill: #fff;
                        }
                    }
                }
            }
            .helpgent-form-filter{
                position: relative;
            }
            .helpgent-form-filter-contents{
                width: 350px;
                position: absolute;
                right: 42px;
                top: 100%;
                z-index: 9999;
                background: #fff;
                padding: 20px;
                border-radius: 10px;
                box-shadow: 0 6px 20px rgba(0,0,0,0.10);
                box-sizing: border-box;
                .helpgent-select-radio{
                    margin-bottom: 10px;
                    line-height: normal;
                    input{
                        display: none;
                        &:checked + .helpgent-single-select__option:before{
                            border: 5px solid var(--helpgent-color-primary);
                        }
                    }
                    label{
                        margin-bottom: 0;
                    }
                    .helpgent-single-select__option{
                        position: relative;
                        padding-left: 27px;
                        color: var(--helpgent-color-gray);
                        font-size: 14px;
                        cursor: pointer;
                        &:before{
                            content: '';
                            position: absolute;
                            width: 18px;
                            height: 18px;
                            inset-inline-start: 24px;
                            top: 50%;
                            left: 0;
                            transform: translateY(-50%);
                            border-radius: 50%;
                            border: 2px solid #a2a2a2;
                            z-index: 10;
                            box-sizing: border-box;
                        }
                    }
                }
            }
            .helpgent-form-sort-contents{
                width: 220px;
                position: absolute;
                right: -10px;
                top: 100%;
                z-index: 9999;
                background: #fff;
                padding: 9px 20px;
                border-radius: 10px;
                box-shadow: 0 6px 20px rgba(0,0,0,0.10);
                box-sizing: border-box;
                border: 1px solid #ecedee;
                display: flex;
                flex-direction: column;
                .helpgent-form-sort-item{
                    text-decoration: none;
                    font-size: 14px;
                    font-weight: 500;
                    color: var(--helpgent-color-gray);
                    padding: 11px 0;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    &.helpgent-form-sort-item--active{
                        color: var(--helpgent-color-primary);
                    }
                    &:focus{
                        box-shadow: none;
                        border: 0 none;
                        outline: 0;
                    }
                }
            }
        }
        .helpgent-form-filter-by-date-range{
            .helpgent-date-range-picker{
                position: absolute;
                right: 100%;
                top: 212px;
                box-shadow: 0 0px 10px rgba(0,0,0,0.1);
                border-radius: 12px;
                overflow: hidden;
            }
            .rdrDefinedRangesWrapper {
                display: none;
            }
            .rdrSelected,
            .rdrInRange,
            .rdrStartEdge,
            .rdrEndEdge,
            .rdrDayToday .rdrDayNumber span:after{
                background: var(--helpgent-color-primary);
            }
            .rdrCalendarWrapper:not(.rdrDateRangeWrapper) .rdrDayHovered .rdrDayNumber:after{
                border: 1px solid var(--helpgent-color-primary);
            }
            .rdrDay{
                width: 36px;
                height: 36px;
                line-height: 36px;
                &:not(:hover):not(:active):not(.has-background){
                    background: #fff;
                }
            }
            .rdrDayNumber{
                font-weight: 500;
            }
            select:hover{
                background: #ffffff12;
            }
            button.rdrNextPrevButton {
                background: rgba(101,81,242,0.18);
                border-radius: 50%;
                color: #fff;
                margin: 0 20px;
                transition: var(--helpgent-transition);
                i{
                    transition: var(--helpgent-transition);
                }
                &:hover{
                    background: var(--helpgent-color-primary);
                }
                &.rdrPprevButton{
                    &:hover{
                        i{
                            border-color: transparent rgb(255, 255, 255) transparent transparent;
                        }
                    }
                }
                &.rdrNextButton{
                    &:hover{
                        i{
                            border-color: transparent transparent transparent rgb(255, 255, 255);
                        }
                    }
                }
            }
        }
        .helpgent-form-filter-select-timeframe{
            background: var(--helpgent-color-bg-light);
            margin-top: 25px;
            padding: 15px;
            border-radius: 8px;
            > span{
                font-size: 14px;
                color: var(--helpgent-color-gray);
            }
            input {
                padding: 0;
                border: 0 none;
                background: none;
                width: 110px;
                text-align: center;
                font-size: 14px;
                &:focus {
                    border: 0 none;
                    outline: 0;
                    box-shadow: none;
                }
            }
            svg{
                width: 12px;
                height: 12px;
                flex: none;
            }
        }
        .helpgent-form-filter-select-dates{
            background: #fff;
            border: 1px solid var(--helpgent-color-bg-gray);
            display: flex;
            align-items: center;
            gap: 5px;
            border-radius: 8px;
            padding: 5px 10px;
            margin-top: 6px;
        }
    }
`,r=n.Ay.div`
    margin-bottom: 30px;
    @media only screen and (max-width: 1399px){
        padding: 15px;
    }
    .helpgent-pagination{
        margin-top: 18px;
        padding-top: 40px;
        border-top: 1px solid var(--helpgent-color-bg-light);
        justify-content: center;
    }
    .helpgent-table-wrap{
        position: relative;
        min-height: 200px;
    }
    .helpgent-table-forms-list{
        .helpgent-table tr{
            td{
                &:first-child{
                    position: relative;
                    border-left: 2px solid transparent;
                    transition: var(--helpgent-transition);
                    padding-right: 0;
                }
            }
            &.helpgent-welcome-wrapper{
                td:first-child{
                    border-left: 0 none;
                    border-radius: 12px;
                }
                &:hover{
                    background: #fff;
                }
                .helpgent-form-not-found{
                    font-size: 18px;
                    font-weight: 600;
                    color: var(--helpgent-color-gray);
                    margin: 15px 0;
                }
            }
            &:hover{
                td:first-child{
                    border-left-color: var(--helpgent-color-primary);
                }
                .helpgent-title{
                    color: var(--helpgent-color-primary);
                }
                .helpgent-form-action{
                    opacity: 1;
                    visibility: visible;
                }
                .helpgent-titleBox-meta{
                    opacity: 0;
                    visibility: hidden;
                }
            }
        }
    }
    .helpgent-forms-pagination{
        display: flex;
        align-items: center;
        gap: 20px;
        margin-top: 20px;
        .helpgent-pagination{
            margin: 0;
            padding: 0;
        }
        .helpgent-forms-count{
            span{
                color: var(--helpgent-color-light-gray);
                font-size: 13px;
                font-weight: 500;
            }
        }
    }
    .helpgent-form-responses{
        a{
            font-size: 14px;
            font-weight: 500;
            text-decoration: none;
            color: var(--helpgent-color-text);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            &:hover{
                color: var(--helpgent-color-primary);
            }
            &:focus{
                outline: none;
                box-shadow: 0 0;
            }
        }
    }
    .helpgent-form-date{
        color: var(--helpgent-color-gray);
    }
    .helpgent-form-status{
        .components-toggle-control__label{
            color: var(--helpgent-color-light-gray);
            font-size: 14px;
        }
    }
    .helpgent-table-loader{
        display: flex;
        align-items: center;
        justify-content: center;
        padding-top: 50px;
    }
    .helpgent-table{
        tbody{
            tr{
                background: #fff;
                &.helpgent-welcome-wrapper{
                    &:hover{
                        background: none;
                    }
                    h2{
                        text-align: center;
                    }
                }
                td{
                    box-sizing: border-box;
                    .helpgent-toggle{
                        display: flex;
                        align-items: center;
                        gap: 10px;
                    }
                    .is-checked{
                        & + .components-toggle-control__label{
                            color: var(--helpgent-color-primary);
                        }
                    }
                }
                .helpgent-form-shortcode{
                    position: relative;
                    svg{
                        position: absolute;
                        width: 12px;
                        height: 12px;
                        left: 28px;
                        top: 50%;
                        margin-top: -6px;
                        path{
                            fill: var(--helpgent-color-light-gray);
                        }
                        @media only screen and (max-width: 1399px){
                            left: 22px;
                        }
                    }
                    input {
                        border: 0 none;
                        background: var(--helpgent-color-bg-gray);
                        color: var(--helpgent-color-gray);
                        border-radius: 5px;
                        text-align: center;
                        cursor: copy;
                        font-size: 12px;
                        font-weight: 400;
                        padding: 0 3px 0 20px;
                        width: 100%;
                        box-sizing: border-box;
                        &:focus{
                            border: 0 none;
                            outline: 0;
                            box-shadow: none;
                        }
                    }
                    .helpgent-share-popup-notice{
                        display: block;
                        padding: 8px 15px;
                        text-align: center;
                        color: #fff;
                        position: fixed;
                        background: var(--helpgent-color-dark);
                        min-width: 180px;
                        box-sizing: border-box;
                        border-radius: 10px;
                        z-index: 1;
                        animation: fadeIn 0.3s;
                    }
                    .helpgent-form-shortcode__copied{
                        svg{
                            left: 73px;
                        }
                    }
                    .helpgent-form-shortcode__copying{
                        display: inline-block;
                        position: relative;
                        svg{
                            left: 50%;
                            margin-left: -6px;
                            animation: helpgentSpinner 900ms infinite linear forwards;
                        }
                    }
                    label{
                        width: 100%;
                        display: block;
                    }
                }
                .helpgent-form-checkbox{
                    padding-right: 0;
                    width: 35px;
                }
                .helpgent-form-name{
                    width: 564px;
                    min-width: 564px;
                    @media only screen and (max-width: 1699px){
                        min-width: 400px;
                    }
                    @media only screen and (max-width: 1550px){
                        min-width: 300px;
                    }
                }
                .helpgent-form-shortcode{
                    width: 280px;
                    min-width: 110px;
                }
                .helpgent-form-responses{
                    width: 229px;
                    min-width: 110px;
                }
                .helpgent-form-username{
                    width: 200px;
                    min-width: 150px;
                }
                .helpgent-form-status{
                    width: 204px;
                }
                .helpgent-form-date{
                    width: 239px;
                    min-width: 170px;
                    @media only screen and (max-width: 1499px){
                        min-width: 135px;
                    }
                }
                .helpgent-form-action{
                    width: 144px;
                    padding-left: 0;
                }
            }
        }
        th{
            &.helpgent-head-checkbox{
                padding-right: 0;
                width: 35px;
            }
            &.helpgent-head-name{
                width: 564px;
                min-width: 564px;
                @media only screen and (max-width: 1699px){
                    min-width: 400px;
                }
                @media only screen and (max-width: 1550px){
                    min-width: 300px;
                }
            }
            &.helpgent-head-shortCode{
                width: 280px;
                min-width: 110px;
            }
            &.helpgent-head-response{
                width: 229px;
                min-width: 110px;
            }
            &.helpgent-head-created-by{
                width: 200px;
                min-width: 150px;
            }
            &.helpgent-head-status{
                width: 204px;
            }
            &.helpgent-head-action{
                width: 144px;
            }
            &.helpgent-head-updated-at{
                width: 239px;
                min-width: 170px;
                @media only screen and (max-width: 1499px){
                    min-width: 135px;
                }
            }
        }
        .helpgent-form-responses{
            a{
                max-width: 86px;
                text-align: center;
                color: var(--helpgent-color-info);
            }
        }
        thead tr th{
            box-sizing: border-box;
        }
    }
`,o=n.Ay.div`
    display: flex;
    align-items: center;
    gap: 20px;
    .helpgent-titleBox__editor{
        input{
            border-top: 0px none;
            border-inline-end: 0px none;
            border-bottom: 1px solid #ededed;
            border-inline-start: 0px none;
            border-image: initial;
            background-color: transparent;
            border-radius: 0px;
            padding: 4px 0;
            line-height: 2;
            min-height: 30px;
            color: #2c3338;
            transition: var(--helpgent-transition);
            &:active,
            &:focus{
                border: 0 none;
                border-bottom: 1px solid var(--helpgent-color-dark);
                outline: 0;
                box-shadow: none;
            }
        }
        span{
            font-size: 13px;
            color: var(--helpgent-color-danger);
            display: block;
            margin-top: 10px;
        }
    }
    .helpgent-titleBox__actions{
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .helpgent-titleBox-action-item{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        cursor: pointer ;
        border-radius: 50%;
        transition: var(--helpgent-transition);
        &.helpgent-titleBox__actions-yes{
            background-color: var(--helpgent-color-success);
            border: 1px solid var(--helpgent-color-success);
        }
        &.helpgent-titleBox__actions-cancel{
            background-color: var(--helpgent-color-danger);
            border: 1px solid var(--helpgent-color-danger);
        }
        svg{
            width: 10px;
            height: 10px;
            path{
                fill: #fff;
                transition: var(--helpgent-transition);
            }
        }
        .helpgent-circle-loader {
            border-color: #fff;
            border-bottom-color: transparent;
            transition: var(--helpgent-transition);
        }
        &:hover{
            background: none;
            svg{
                path{
                    fill: var(--helpgent-color-dark);
                }
            }
            .helpgent-circle-loader {
                border-color: var(--helpgent-primary-color);
                border-bottom-color: transparent;
            }
        }
    }
    .helpgent-titleBox__content{
        display: flex;
        align-items: center;
        gap: 12px;
        .helpgent-titleBox-media__form{
            width: 44px;
            height: 44px;
            border-radius: 10px;
            display: block;
        }
        img{
            width: 38px;
            height: 38px;
            object-fit: cover;
            border-radius: 8px;
        }
    }
    .helpgent-titleBox-media{
        flex: none;
    }
    .helpgent-titleBox-text{
        text-align: left;
        position: relative;
        transition: var(--helpgent-transition);
        a{
            text-decoration: none;
        }
        .helpgent-title{
            font-size: 15px;
            font-weight: 600;
            color: var(--helpgent-color-dark);
            transition: var(--helpgent-transition);
        }
    }
   .helpgent-titleBox-meta{
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 10px 0 0;
        transition: var(--helpgent-transition);
        .helpgent-titleBox-meta__id{
            position: relative;
            &::after{
                content: '';
                width: 2px;
                height: 2px;
                background: #6e6e6e;
                border-radius: 50%;
                display: block;
                position: absolute;
                inset-inline-end: -7px;
                top: 50%;
                transform: translateY(-50%);
            }
        }
        li{
            font-size: 12px;
            font-weight: 500;
            color: var(--helpgent-color-light-gray);
            margin: 0;
        }
    }
    .helpgent-form-action{
        display: flex;
        align-items: center;
        gap: 6px;
        position: absolute;
        white-space: nowrap;
        left: 0;
        bottom: -8px;
        margin: 0;
        visibility: hidden;
        opacity: 0;
        transition: var(--helpgent-transition);
        .helpgent-btn{
            color: var(--helpgent-color-dark);
            &:hover{
                background: var(--helpgent-color-primary);
                border-color: var(--helpgent-color-primary);
                color: #fff;
            }
        }
        li{
            margin: 0;
        }
    }
`,i=n.Ay.div`
    width: fit-content;
    margin: 100px auto;
    border-radius: 20px;
    text-align: center;
    padding: 54px clamp(15px, 10%, 112.5px);

    .helpgent-welcome-top{
        margin-bottom: 6px;
    }
    .helpgent-welcome-top{
    }
    .helpgent-welcome-top__icon{
        margin-bottom: 30px;
        svg{
            width: 130px;
            height: 105px;
        }
    }
    .helpgent-welcome-top__title{
        font-size: 22px;
        font-weight: 600;
        margin: 0 0 15px;
        color: var(--helpgent-color-dark);
    }
    p{
        font-size: 16px;
        margin: 0;
        font-weight: 400;
    }
    .helpgent-btn-create{
        padding: 0 30px;
        min-height: 46px;
        margin-top: 23px;
        border-radius: 10px;
    }
`,s=n.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;
    }
`;n.Ay.div`
    width: 100%;
    min-width: 320px;
    .helpgent-import-attachment__title{
        font-size: 18px;
        color: var(--helpgent-color-dark);
    }
    .helpgent-import-attachment__progress{
        display: flex;
        align-items: center;
    }
    .helpgent-import-attachment__percentage{
        margin-left: 15px;
    }
`},63176:(e,t,a)=>{a.d(t,{A:()=>n}),a(51609);const n="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMy40MTciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxMy40MTcgMTQiPgogIDxnIGlkPSJzb3J0LWFtb3VudC1kb3duLWFsdCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEpIj4KICAgIDxwYXRoIGlkPSJQYXRoXzE1NzQiIGRhdGEtbmFtZT0iUGF0aCAxNTc0IiBkPSJNMTcuMjkyLDFIMTAuODc1YS44NzUuODc1LDAsMCwwLDAsMS43NWg2LjQxN2EuODc1Ljg3NSwwLDEsMCwwLTEuNzVaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMy43NSAtMC40MTcpIiBmaWxsPSIjNmU2ZTZlIi8+CiAgICA8cGF0aCBpZD0iUGF0aF8xNTc1IiBkYXRhLW5hbWU9IlBhdGggMTU3NSIgZD0iTTE0Ljk1OCw3SDEwLjg3NWEuODc1Ljg3NSwwLDAsMCwwLDEuNzVoNC4wODNhLjg3NS44NzUsMCwwLDAsMC0xLjc1WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMuNzUgLTIuOTE3KSIgZmlsbD0iIzZlNmU2ZSIvPgogICAgPHBhdGggaWQ9IlBhdGhfMTU3NiIgZGF0YS1uYW1lPSJQYXRoIDE1NzYiIGQ9Ik0xMi42MjUsMTNoLTEuNzVhLjg3NS44NzUsMCwwLDAsMCwxLjc1aDEuNzVhLjg3NS44NzUsMCwwLDAsMC0xLjc1WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMuNzUgLTUuNDE3KSIgZmlsbD0iIzZlNmU2ZSIvPgogICAgPHBhdGggaWQ9IlBhdGhfMTU3NyIgZGF0YS1uYW1lPSJQYXRoIDE1NzciIGQ9Ik01Ljc2NywxMC43NDJINC41Vi44NzVhLjg3NS44NzUsMCwwLDAtMS43NSwwdjkuODY3SDEuNTgzYS41ODMuNTgzLDAsMCwwLS40MTIsMWwyLjA5MiwyLjA5MmEuNTg0LjU4NCwwLDAsMCwuODI1LDBMNi4xOCwxMS43MzdhLjU4My41ODMsMCwwLDAtLjQxMi0xWiIgZmlsbD0iIzZlNmU2ZSIvPgogIDwvZz4KPC9zdmc+Cg=="},64197:(e,t,a)=>{a.d(t,{A:()=>n});const n=new(a(5054).E)},64943:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(9421),l=a(68360),r=a(90212);function o(e,t,a){const{data:o,isLoading:i,error:s,isError:p,isFetching:c,isSuccess:g,isRefetching:d}=(0,n.I)(e,async()=>{const e=await(0,l.A)(t,a?.parser||{});return a&&"function"==typeof a.afterLoadedData&&a.afterLoadedData(e),e},a?.queryConfig||{refetchOnWindowFocus:!1,keepPreviousData:!0,staleTime:1e4});return{data:s||i?null:o,isLoading:i,errorMessage:s?(0,r.A)(s?s?.data?.status:""):"",isError:!!p,isFetching:c,isSuccess:g,isRefetching:d}}},68357:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(51609),l=a(4286);function r({style:e}){const t={minHeight:"500px",maxHeight:"550px"};return e=e?{...t,...e}:t,(0,n.createElement)(l.vY,{style:e,className:"helpgent-content-loading"},(0,n.createElement)("span",{className:"helpgent-shimmer-effect"}),(0,n.createElement)("span",{className:"helpgent-shimmer-effect"}),(0,n.createElement)("span",{className:"helpgent-shimmer-effect"}))}},68360:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(1455),l=a.n(n);async function r(e,t){return await l()({path:e,...t}).then(e=>e).catch(e=>{throw e})}},73424:(e,t,a)=>{a.d(t,{A:()=>F});var n=a(51609),l=a(86087),r=a(56427),o=a(65604),i=a(5556),s=a.n(i),p=a(27723);function c(e){const{title:t,subtitle:a}=e;return(0,n.createElement)("div",{className:"helpgent-createPopup__header"},t&&(0,n.createElement)("h4",null,t),a&&(0,n.createElement)("p",null,a))}c.propTypes={title:s().string,subtitle:s().string};var g=a(6945);function d(e){const{routeLink:t}=(0,g.Xd)("helpgent_router_references",null),{icon:a,text:l,step:r,url:i,moduleState:s,setModuleState:p}=e;function c(e,t){e.preventDefault(),"scratch"===t?p({...s,addBackBtn:!0,createFormStage:"scratch"}):"template"===t&&p({...s,createFormStage:"template"})}return i?(0,n.createElement)(t,{to:i||"#",className:"helpgent-createPopup__action",onClick:e=>r?c(e,r):null},(0,n.createElement)("div",{className:"helpgent-createPopup__action-icon"},(0,n.createElement)(o.A,{src:a})),l&&(0,n.createElement)("span",{className:"helpgent-createPopup__action-text"},l)):(0,n.createElement)("span",{className:"helpgent-createPopup__action",onClick:e=>r?c(e,r):null},(0,n.createElement)("div",{className:"helpgent-createPopup__action-icon"},(0,n.createElement)(o.A,{src:a})),l&&(0,n.createElement)("span",{className:"helpgent-createPopup__action-text"},l))}function m(e){const{moduleState:t,setModuleState:a}=e;return(0,n.createElement)("div",{className:"helpgent-createPopup"},(0,n.createElement)(c,{title:(0,p.__)("Create a New Form","helpgent"),subtitle:(0,p.__)("You can select a template to assist you, or start from scratch.","helpgent")}),(0,n.createElement)("div",{className:"helpgent-createPopup__body"},(0,n.createElement)("div",{className:"helpgent-createPopup__actions"},[{icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj4KICA8ZyBpZD0iR3JvdXBfMjYxOCIgZGF0YS1uYW1lPSJHcm91cCAyNjE4IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNzk5Ljc0NyAtMzAzLjIyOSkiPgogICAgPHBhdGggaWQ9IlBhdGhfMTQ3OCIgZGF0YS1uYW1lPSJQYXRoIDE0NzgiIGQ9Ik0zNC4yMTIsMTguMzM3bC0uOTM3LjkzN2ExMC43ODEsMTAuNzgxLDAsMCwwLTMuNzEyLS42NUExMC45NTIsMTAuOTUyLDAsMCwwLDE4LjYyNiwyOS41NWExMC43NTYsMTAuNzU2LDAsMCwwLC42NTEsMy43MDlMMTcuNzUsMzQuNzg0bC0zLjMxMy0zLjMxTDExLjIsMjguMjM5bC4xLS4xTDI2Ljk1OSwxMi41bC42ODgtLjY4NywzLjE2MywzLjE0N0wzNC4yLDE4LjMyMmwuMDEzLjAxNVpNMTAuNjc4LDI5LjQ4NSw4LjA1MSwzNi43MjFhLjk2Ljk2LDAsMCwwLC4yMjUuOTg3Ljk3Ni45NzYsMCwwLDAsLjk4Ni4yMjVsNy4yNDMtMi42MjQtNS44MjctNS44MjRaTTM2LjYsOS4zMzJhNC44MjksNC44MjksMCwwLDAtMy4yODctMS4zNDksNC42MzMsNC42MzMsMCwwLDAtMy4yNjIsMS4zODZsLTEuNTI2LDEuNTU3LjAwNy4wMDYsMy4xNjMsMy4xNDcsMy4zODYsMy4zNTcuMDA2LjAwNywxLjU1MS0xLjU4MWE0LjU2Miw0LjU2MiwwLDAsMCwxLjMzNy0zLjIzNXYtLjA1MUE0LjUyMiw0LjUyMiwwLDAsMCwzNi42LDkuMzMyWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNzkxLjc0OCAyOTUuMjQ2KSIvPgogICAgPHBhdGggaWQ9IlBhdGhfMTQ3OSIgZGF0YS1uYW1lPSJQYXRoIDE0NzkiIGQ9Ik0yMy40MzcsMTVhOC40MzcsOC40MzcsMCwxLDAsOC40MzcsOC40MzdBOC40NDcsOC40NDcsMCwwLDAsMjMuNDM3LDE1Wm0zLjQzNyw5LjY4NkgyNC42ODZ2Mi4xODhhMS4yNTEsMS4yNTEsMCwwLDEtMi41LDBWMjQuNjgzSDIwYTEuMjUxLDEuMjUxLDAsMCwxLDAtMi41aDIuMTg4VjE5Ljk5NGExLjI1MSwxLjI1MSwwLDEsMSwyLjUsMHYyLjE4OGgyLjE4OGExLjI1MSwxLjI1MSwwLDEsMSwwLDIuNVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDc5Ny44NzMgMzAxLjM1NykiLz4KICA8L2c+Cjwvc3ZnPgo=",text:"Create From Scratch",step:"scratch"},{icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj4KICA8cGF0aCBpZD0idGVtcGxhdGUiIGQ9Ik0yOS42NjcsM0g2LjMzM0EzLjMzMywzLjMzMywwLDAsMCwzLDYuMzMzVjEzYTMuMzMzLDMuMzMzLDAsMCwwLDMuMzMzLDMuMzMzSDI5LjY2N0EzLjMzMywzLjMzMywwLDAsMCwzMywxM1Y2LjMzM0EzLjMzMywzLjMzMywwLDAsMCwyOS42NjcsM1pNNi4zMzMsMTNWNi4zMzNIMjkuNjY3VjEzWm0xMCw1aC0xMEEzLjMzMywzLjMzMywwLDAsMCwzLDIxLjMzM3Y4LjMzM0EzLjMzMywzLjMzMywwLDAsMCw2LjMzMywzM2gxMGEzLjMzMywzLjMzMywwLDAsMCwzLjMzMy0zLjMzM1YyMS4zMzNBMy4zMzMsMy4zMzMsMCwwLDAsMTYuMzMzLDE4Wm0tMTAsMTEuNjY3VjIxLjMzM2gxMHY4LjMzM1pNMjkuNjY3LDE4aC01YTMuMzMzLDMuMzMzLDAsMCwwLTMuMzMzLDMuMzMzdjguMzMzQTMuMzMzLDMuMzMzLDAsMCwwLDI0LjY2NywzM2g1QTMuMzMzLDMuMzMzLDAsMCwwLDMzLDI5LjY2N1YyMS4zMzNBMy4zMzMsMy4zMzMsMCwwLDAsMjkuNjY3LDE4Wm0tNSwxMS42NjdWMjEuMzMzaDV2OC4zMzNaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMyAtMykiLz4KPC9zdmc+Cg==",text:"Start From A Template",url:"pre-made-templates"}].map((e,l)=>(0,n.createElement)(d,{icon:e.icon,text:e.text,step:e.step,url:e.url,moduleState:t,setModuleState:a,key:l})))))}d.propTypes={icon:s().string,text:s().string,step:s().string,url:s().string},m.propTypes={};var h=a(49876),u=a(88869),f=a(63064),M=a(49785),x=a(52619),b=a(29898);async function w(e,t,a,n,l,r,o){const i=(0,b.vf)().filter(e=>"welcome"===e.element_type||"end"===e.element_type||"user_validation"===e.element_type);let s=null,c={};const g={color_style:{icon:{value:"#3C3C3C"},title:{value:"#000000"},description:{value:"#3C3C3C"},chat_title_color:{value:"#000000"},button:{value:"#6551F2"},button_text:{value:"#ffffff"},footer_text_color:{value:"#6E6E6E"},options_color:{value:"#3c3c3c"}},corner:"round",element_size:"md",specialElement_size:"md",background_image:null,background_color:"#ffffff",background_style:{background_overlay:{isActive:"1"},overlay_color:{value:"#000000"},overlay_opacity:{value:"50"}},font_family:{family:"Inter",category:"sans-serif"},font_weight_variations:[400,500,600]};if(r){const e=Object.assign({},JSON.parse(r).global),t=JSON.parse(r).elements;c={...e,...g},s=JSON.stringify({elements:t,global:c})}else{c={...g,action_btn:{isActive:"1"},go_to_next_text:{value:"OK"},submission_text:{value:"Submit"},helpgent_branding:{isActive:"1"},save_incomplete_data:{isActive:"0"},anonymous_submission:{isActive:"0"},progress_count:{isActive:"1"},bubble:{background_type:{type:"",screen:"",color:"",upload:{}},overlay_text:"",shape:"circle",border:{has_border:"1",color:"#6551F2"},position:"left",offset_x:"30",offset_y:"30",size:"medium"},media:{max_video_duration:{value:"2"},max_voice_duration:{value:"2"},max_upload_size:{value:"300",unit:"mb"}},email_notification:{admin_notification:{notify_on_new_response:{isActive:"1"},new_response_subject:{value:"New Form Submission Alert"},new_response_body:{value:"<p>Hello {{TO_NAME}},</p><p>You have received a new submission for the {{FROM_NAME}}. Here are the details:</p><ul><li>User Name: {{FROM_EMAIL}}</li><li>IP Address: {{IP_ADDRESS}}</li><li>Submission Date and Time: {{NOW}}</li></ul><p>To access the complete submission details, kindly navigate to the admin panel by clicking on the link below: {{DASHBOARD_LINK}}</p><p>Best regards,</p><p>{{SITE_NAME}}</p>"},notify_on_user_message:{isActive:"1"},user_message_subject:{value:"New Message Received Alert"},user_message_body:{value:"<p>Hello {{TO_NAME}},</p><p>You have received a new message for the {{FROM_NAME}}. Here are the details: </p><ul><li>User Name: {{FROM_EMAIL}}</li><li>Submission Date and Time: {{NOW}}</li></ul><p>To continue the conversation, kindly visit the admin panel by clicking on this link: {{DASHBOARD_LINK}}</p><p>Best regards, </p><p>{{SITE_NAME}}</p>"}},user_notification:{notify_on_new_response:{isActive:"1"},new_response_subject:{value:"New Submission"},new_response_body:{value:"<p>Hello {{TO_NAME}},</p><p>Greetings and welcome to our platform!</p><p>We're delighted to inform you that your submission was successful, and we've received your message. </p><p>You can view your submission and continue the conversation through your dashboard by clicking on the following link: {{DASHBOARD_LINK}}</p><p>Thanks,</p><p>The Administrator of {{SITE_NAME}} </p>"},notify_on_admin_message:{isActive:"1"},admin_message_subject:{value:"New message form {{SITE_NAME}}"},admin_message_body:{value:"<p>Hello {{TO_NAME}},</p><p>You have received a new response from the admin. Here are the details:</p><ul><li>Message: {{MESSAGE}}</li><li>Submission Date and Time: {{NOW}}</li></ul><p>You can view the response and continue the conversation through your dashboard by clicking on the following link: {{DASHBOARD_LINK}}</p><p>Thanks, </p><p>The Administrator of {{SITE_NAME}} </p>"}}}};const e=i.filter(e=>"end"===e.element_type)[0];i[0].controls.elementLogic.default_target=e?.id,s=JSON.stringify({elements:i,global:c})}const d={status:"draft",content:s},m=e.available_pages?e.available_pages:"";d.title=e.title,d.available_pages=m||[],d.is_chat_bubble=e.displayChatBubble||"0";try{const e=await t(d);e&&n(`/${o.forms}/${e.form_id}/edit`),l.invalidateQueries("helpgent-single-form"),l.invalidateQueries("helpgent-form"),(0,x.doAction)("helpgent-toast",{message:e.message})}catch(e){let t={};e.message?t.internal=e.message:t.internal=(0,p.__)("Server Error","helpgent"),a(t)}}var y=a(92300),v=a(26374),_=a(7012);var N=a(38267);const L=N.Ay.div`
    width: fit-content;
    margin: 0 auto;
    @media only screen and (max-width: 575px){
        width: 100%;
    }
    .helpgent-createPopup{
        text-align: center;
        margin: 50px 0;
        .helpgent-toggle-inline{
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            .helpgent-toggle__label{
                display: flex;
                align-items: center;
                font-size: 15px;
                font-weight: 500;
                color: var(--helpgent-color-dark);
                cursor: pointer;
            }
        }
    }

    .helpgent-select__option{
        display: flex;
        .helpgent-checkbox{
            margin-right: 10px;
        }
    }

    .helpgent-createPopup__header{
        h4{
            font-size: 30px;
            font-weight: 600;
            margin: 0 0 15px;
            line-height: 1.27;
            color: var(--helpgent-color-dark);
        }
        p{
            font-size: 16px;
            font-weight: 400;
            margin: 0;
        }
    }

    .helpgent-createPopup__actions{
        display: flex;
        align-items: center;
        margin-top: 32px;
        @media only screen and (max-width: 400px){
            flex-wrap: wrap;
        }
    }

    .helpgent-createPopup__action{
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 15px;
        border-radius: 20px;
        padding: 40px 52px;
        text-decoration: none;
        cursor: pointer;
        background-color: var(--helpgent-color-bg-light);
        transition: var(--helpgent-transition);
        &:hover{
            background-color: var(--helpgent-color-bg-deep);
        }
        @media only screen and (max-width: 480px){
            width: 50%;
            padding: 20px 0;
        }
        @media only screen and (max-width: 400px){
            width: 100%;
        }
    }

    .helpgent-createPopup__action-icon{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 80px;
        height: 80px;
        border-radius: 20px;
        background-color: var(--helpgent-color-white);
        svg{
            fill: var(--helpgent-color-primary);
        }
    }

    .helpgent-createPopup__action-text{
        display: block;
        font-size: 16px;
        font-weight: 500;
        max-width: 96px;
        margin-top: 20px;
        line-height: 1.38;
        color: var(--helpgent-color-dark);
    }

    .helpgent-validate-danger{
        display: block;
    }

    .helpgent-form-group{
        flex-direction: column;
        &__element{
            font-size: 16px;
            min-height: 50px;
            padding-inline-start: 20px;
            padding-inline-end: 20px;
            border-radius: 12px;
        }
    }

    .helpgent-btn {
        min-height: 50px;
    }
`,z=N.Ay.div`
    width: 100%;
    min-width: 320px;
    .helpgent-import-attachment__title{
        font-size: 18px;
        color: var(--helpgent-color-dark);
    }
    .helpgent-import-attachment__progress{
        display: flex;
        align-items: center;
    }
    .helpgent-import-attachment__percentage{
        margin-left: 15px;
    }
`,D=N.Ay.div`
    text-align: start;
    margin-top: 50px;
    .helpgent-form-group{
        width: 450px;
        @media only screen and (max-width: 575px){
            width: 100%;
        }
    }
    .helpgent-btn-block{
        margin-top: 30px;
    }
    .helpgent-tooltip-toggle{
        position: relative;
        top: 1px;
        display: inline-block;
        margin-inline-start: 10px;
        line-height: .85;
        cursor: pointer;
    }
    .helpgent-form__element,
    .helpgent-form__element-inline{
        border-radius: 12px;
        background-color: var(--helpgent-color-bg-light);
    }
    .helpgent-form__element{
        &::placeholder{
            color: #3C3C3C;
        }
    }
    .helpgent-form__element-inline{
        display: flex;
        justify-content: space-between;
        padding: 15px 20px;
    }
    .helpgent-form__label{
        display: flex;
        align-items: center;
        font-size: 15px;
        font-weight: 600;
        color: var(--helpgent-color-dark);
    }
    .helpgent-select {
        margin-top: 12px;
        &__control{
            background-color: var(--helpgent-color-bg-light);
        }
    }
`;var E=a(28050),S=a(41620),A=a(26944),j=a(16622);function I(e){const{formData:t,createFormMutation:a,setServerErrors:r,navigate:o,queryClient:i,moduleState:s,setModuleState:c,baseLinkRoute:g}=e,[d,m]=(0,l.useState)(0),[h,u]=(0,l.useState)(0),[f,M]=(0,l.useState)(0),[x,b]=(0,l.useState)(0),{templateElements:y,selectedTemplate:v}=s,{mutateAsync:_,isLoading:N}=(0,E.A)("/helpgent/form/media");return(0,l.useEffect)(()=>{if(y?.elements?.length>0){c({...s,isImportingAttachment:!0}),fetch(j._V+"/import/"+v.id);const e=y?.elements;let t=0,a=0;e.map(async(n,l)=>{if(n?.media?.url){const r={url:n.media.url};try{const n=await _(r);201===n?.data?.status?(e[l].media.url=n.url,a+=1,m(a)):(e[l].media.url=null,t+=1,u(t))}catch(a){e[l].media.url=null,t+=1,u(t)}}else t+=1,u(t);"picture_select"===n?.element_type&&n?.controls?.general?.options?.length>0&&(b(n?.controls?.general?.options?.length),n?.controls?.general?.options.map(async(e,l)=>{if(e?.url){const r={url:e?.url};try{const e=await _(r);201===e?.data?.status?(n.controls.general.options[l].url=e?.url,a+=1,m(a)):(n.controls.general.options[l].url=null,t+=1,u(t))}catch(e){n.controls.general.options[l].url=null,t+=1,u(t)}}else t+=1,u(t)}))})}},[y?.elements]),(0,l.useEffect)(()=>{const e=(0,S.A)(d+h,y?.elements?.length+x),n=JSON.stringify({elements:y.elements,global:y.global});100===parseInt(e)&&w(t,a,r,o,i,n,g),M(e)},[d,h]),(0,n.createElement)(z,null,(0,n.createElement)("h4",{className:"helpgent-import-attachment__title"},(0,p.__)("Import attachment progress","helpgent")),(0,n.createElement)("div",{className:"helpgent-import-attachment__progress"},(0,n.createElement)(A.A,{type:"success",currentValue:f,contentFlow:"horizontal"}),(0,n.createElement)("span",{className:"helpgent-import-attachment__percentage"},Math.floor(f),"%")))}var C=a(88589);function T(e){const{control:t,baseApiRoute:a}=e;return(0,n.createElement)("div",{className:"helpgent-form-group"},(0,n.createElement)("label",{htmlFor:"helpgent-page-select",className:"helpgent-form__label"},a.availablePages.text,(0,n.createElement)(r.Tooltip,{text:(0,p.__)("Control where your form bubble appears by specifying the pages it's displayed on.","helpgent"),delay:"0"},(0,n.createElement)("span",{className:"helpgent-tooltip-toggle"},(0,n.createElement)(o.A,{src:C.A})))),(0,n.createElement)(u.SelectField,{name:"available_pages",control:t,isMulti:!0,optionsAPI:a.availablePages.api,placeholder:(0,p.__)("Select...","helpgent")}))}function k(e){const{navigationHook:t}=(0,g.Xd)("helpgent_router_references",null),{moduleState:a,setModuleState:r,baseApiRoute:o,baseLinkRoute:i}=e,{selectedTemplate:s}=a,d=t(),m=(0,f.jE)(),[x,b]=(0,l.useState)({}),[N,L]=(0,l.useState)(null),[z,E]=(0,l.useState)(!1),[S,A]=(0,l.useState)("0"),[j,C]=(0,l.useState)("form"),{register:k,handleSubmit:O,setValue:F,formState:{errors:P},control:Y}=(0,M.mN)({mode:"all"}),{mutateAsync:B,isLoading:Z}=(G=`${o?.forms}`,(0,v.n)(e=>(0,_.A)(G,e)));var G;return(0,l.useEffect)(()=>{s&&F("title",s?.title||null)},[s]),(0,n.createElement)(n.Fragment,null,"form"===j&&(0,n.createElement)("div",{className:"helpgent-createPopup"},(0,n.createElement)(c,{title:(0,p.__)("Let’s get started","helpgent")}),(0,n.createElement)(D,null,(0,n.createElement)("form",{onSubmit:O(e=>function(e){r({...a,addBackBtn:!1}),s?(C("attachmentImport"),L(e)):w(e,B,b,d,m,null,i)}(e))},(0,n.createElement)("div",{className:"helpgent-form-group"},(0,n.createElement)("input",{type:"text",className:"helpgent-form-group__element",name:"title",placeholder:(0,p.__)("Form Name","helpgent"),...k("title",{required:{value:!0,message:(0,p.__)("The title field is required","helpgent")},validate:{isOnlySpace:e=>0!==e.trim().length||(0,p.__)("Only spaces not allowed","helpgent"),minLength:e=>e.trim().length>=5||(0,p.__)("The title field must be at least 5 characters.","helpgent")}})}),"required"===P.title?.type?(0,y.A)(P.title.message):x.title?(0,y.A)(x.title):null,"isOnlySpace"===P.title?.type?(0,y.A)(P.title.message):x.title?(0,y.A)(x.title):null,"minLength"===P.title?.type?(0,y.A)(P.title.message):x.title?(0,y.A)(x.title):null),(0,n.createElement)("div",{className:"helpgent-form-group"},(0,n.createElement)("div",{className:"helpgent-form__element-inline"},(0,n.createElement)(u.Switch,{handleToggle:()=>function(e,t,a,n,l){e(!a),t("displayChatBubble",!a),n("0"===l?"1":"0")}(E,F,z,A,S),label:(0,p.__)("Enable Form Bubble?","helpgent"),isActive:S,tooltip:!0,tooltipText:(0,p.__)("Enable the Form Bubble to add a floating icon to your website. When activated, users can easily access and expand the form with a single click.","helpgent")}))),z&&(0,n.createElement)(n.Fragment,null,(0,n.createElement)(T,{control:Y,baseApiRoute:o}),(0,h.$)("helpgent_form_create_modal_bubble_controls",{},{control:Y})),(0,h.$)("helpgent_form_modal_before_submit",{},{control:Y,displayChatBubble:z}),(0,n.createElement)("button",{type:"submit",className:"helpgent-btn helpgent-btn-md helpgent-btn-primary helpgent-btn-block "+(0!==Object.keys(P).length||0!==Object.keys(x).length||Z?"helpgent-btn-disabled":""),disabled:!(0===Object.keys(P).length&&0===Object.keys(x).length&&!Z)},Z?(0,p.__)("Creating","helpgent"):(0,p.__)("Create Form","helpgent")),x.internal&&(0,y.A)(x.internal)))),"attachmentImport"===j&&(0,n.createElement)(I,{formData:N,createFormMutation:B,setServerErrors:b,navigate:d,queryClient:m,moduleState:a,setModuleState:r,baseLinkRoute:i}))}var O=a(22057);const F=function(e){const{moduleState:t,setModuleState:a,baseApiRoute:i,baseLinkRoute:s}=e,{isImportingAttachment:c,isCreatePopupOpen:g,createFormStage:d,addBackBtn:h}=t;return g&&(0,n.createElement)(l.Fragment,null,(0,n.createElement)(r.Modal,{overlayClassName:"helpgent-modal helpgent-create-modal-wrap "+(c?"helpgent-attachment-importing":""),shouldCloseOnClickOutside:!c,onRequestClose:()=>c?{}:void a({...t,createFormStage:"initial",addBackBtn:!1,isCreatePopupOpen:!1}),isDismissible:!c},"scratch"===d&&h&&(0,n.createElement)("span",{className:"helpgent-btn-back",onClick:function(){a({...t,createFormStage:"initial",addBackBtn:!1})}},(0,n.createElement)(o.A,{src:O.A})," ",(0,p.__)("Back","helpgent")),(0,n.createElement)(L,{className:"helpgent-create-form-modal "+("prepared-elements"===d?"helpgent-create-loader-active":"")},"prepared-elements"===d&&(0,n.createElement)(r.Spinner,null),"initial"===d?(0,n.createElement)(m,{moduleState:t,setModuleState:a}):"scratch"===d?(0,n.createElement)(k,{moduleState:t,setModuleState:a,baseApiRoute:i,baseLinkRoute:s}):void 0)))}},85227:(e,t,a)=>{a.r(t),a.d(t,{default:()=>F});var n=a(51609),l=a(86087),r=a(93832),o=a(63064),i=a(38267),s=a(64197),p=a(64943),c=a(73424),g=a(68357),d=a(89122),m=a(27723),h=a(57708),u=a(52619),f=a(5556),M=a.n(f),x=a(65604),b=a(97792),w=a(14971),y=a(46958),v=a(63176),_=a(14292),N=a(90781),L=a(27716),z=a(30020),D=a(92998),E=a(88869);function S(e){const{statusTotal:t}=e,{formTableState:a,setFormTableState:r}=(0,d.B)(),[o,i]=(0,l.useState)("all");(0,l.useEffect)(()=>{i("all")},[]);const s=parseInt(t.find(e=>"draft"===e.status)?.total),p=parseInt(t.find(e=>"publish"===e.status)?.total),c=isNaN(s)?0:s,g=isNaN(p)?0:p,h=[{label:`${(0,m.__)("All Forms","helpgent")} (${c+g})`,value:"all"},{label:`${(0,m.__)("Active","helpgent")} (${g})`,value:"publish"},{label:`${(0,m.__)("Inactive","helpgent")} (${c})`,value:"draft"}];return(0,n.createElement)("div",{className:"helpgent-forms-type"},(0,n.createElement)(E.Select,{inputId:"helpgent-form-type",className:"helpgent-select helpgent-form-type",classNamePrefix:"helpgent-select",placeholder:"Select",options:h,value:h.find(e=>e.value===o),onChange:e=>{(async e=>{await r({...a,fetchParams:{...a?.fetchParams,status:e}}),i(e)})(e.value)}}))}function A(e){const{formTableState:t,setFormTableState:a,totalAdminForms:l,totalListingOwnerForms:r,formType:o,setDateType:i}=e,s=(0,u.applyFilters)("helpgent_form_table_tabs",[{label:(0,m.__)("My Forms","helpgent"),value:"admin_forms"}]);return s.length>1&&(0,n.createElement)("div",{className:"helpgent-form-types"},s.map((e,s)=>(0,n.createElement)("a",{className:"helpgent-form-types-item "+(e.value===o?"helpgent-form-types-item--active":""),key:s,href:"","data-value":e.value,onClick:n=>{var l;l=e.value,n.preventDefault(),a({...t,filterKey:l,fetchParams:{...t?.fetchParams,type:l,s:"",date_type:"all","date_frame[from]":"","date_frame[to]":"",page:1},filterParams:{[l]:"1"}}),i("all")}},e.label," ","admin_forms"===e.value?`(${l})`:`(${r})`)))}function j(e){const{forms:t,setSearchText:a,handleDateFilter:r,handleTimeFrame:o,dateType:i,setDateType:s,statusTotal:p,handleDateSorting:c,handleClearFilter:g,totalAdminForms:u,totalListingOwnerForms:f}=e,{formTableState:M,setFormTableState:E}=(0,d.B)(),[j,I]=(0,l.useState)(!1),[C,T]=(0,l.useState)(!1),[k,O]=(0,l.useState)(!1),{fetchParams:F}=M,[P,Y]=(0,l.useState)([{startDate:new Date,endDate:(0,D.default)(new Date,0),key:"selection"}]);(0,l.useEffect)(()=>{"date_frame"!==i&&Y([{startDate:new Date,endDate:(0,D.default)(new Date,0),key:"selection"}])},[i]);const B=(0,l.useRef)(),Z=(0,l.useRef)(),G=(0,l.useRef)(),R=[{label:(0,m.__)("All","helpgent"),value:"all"},{label:(0,m.__)("Today","helpgent"),value:"today"},{label:(0,m.__)("Yesterday","helpgent"),value:"yesterday"},{label:(0,m.__)("Last Week","helpgent"),value:"last_week"},{label:(0,m.__)("Last Month","helpgent"),value:"last_month"},{label:(0,m.__)("Custom","helpgent"),value:"date_frame"}],U=[{label:(0,m.__)("Date Created","helpgent"),value:"date_created"},{label:(0,m.__)("Last Modified","helpgent"),value:"last_modified"},{label:(0,m.__)("Alphabetical","helpgent"),value:"alphabetical"},{label:(0,m.__)("Last Submission","helpgent"),value:"last_submission"},{label:(0,m.__)("Unread","helpgent"),value:"unread"}];function W(){O(!0)}return(0,l.useEffect)(()=>{(0,L.A)(j,I,B),(0,L.A)(C,T,B),O(!1)},[j,C]),(0,l.useEffect)(()=>{(0,L.A)(k,O,Z)},[k]),(0,l.useEffect)(()=>{""===F?.s&&(G.current.value="")},[F?.s]),(0,l.useEffect)(()=>{window.location.href.includes("/edit")||(sessionStorage.removeItem("isFullscreenActive"),document.querySelector(".helpgent-root").classList.remove("helpgent-single-form-fullscreen"))},[t]),(0,n.createElement)(h.F4,null,(0,n.createElement)("div",{className:"helpgent-header-left"},(0,n.createElement)("h1",{className:"helpgent-page-header-title"},(0,m.__)("All Forms","helpgent")),u&&0!==u||0!==f?(0,n.createElement)("button",{className:"helpgent-btn helpgent-btn-dark helpgent-page-header-btn",onClick:()=>E({...M,selectedTemplate:null,templateElements:null,isCreatePopupOpen:!0})},(0,m.__)("Create New","helpgent")):null),(0,n.createElement)(A,{formTableState:M,setFormTableState:E,totalAdminForms:u,totalListingOwnerForms:f,formType:F?.type,setDateType:s}),(0,n.createElement)("div",{className:"helpgent-form-filters"},(0,n.createElement)(S,{statusTotal:p}),(0,n.createElement)("div",{className:"helpgent-form-search-filter"},(0,n.createElement)("div",{className:"helpgent-form-search"},(0,n.createElement)(x.A,{src:b.A}),(0,n.createElement)("input",{ref:G,type:"text",placeholder:(0,m.__)("Search form","helpgent"),onChange:e=>{a(e)}})),(0,n.createElement)("div",{className:"helpgent-form-filter",ref:B},(0,n.createElement)("button",{className:"helpgent-btn helpgent-btn-white helpgent-form-filter-btn "+("all"!==i?"helpgent-form-filter-btn--active":""),onClick:e=>{!function(e){e.preventDefault(),T(!1),I(!j)}(e)}},(0,m.__)("Filter","helpgent")," ",(0,n.createElement)(x.A,{src:w.A}),"all"!==i?(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"helpgent-badge helpgent-badge-light helpgent-badge-circle helpgent-form-filter-clear",onClick:()=>{I(!1),g()}},(0,n.createElement)(x.A,{src:N.A}))):null),j&&(0,n.createElement)("div",{className:"helpgent-form-filter-contents"},(0,n.createElement)("div",{className:"helpgent-form-filter-by-time"},R.map((e,t)=>(0,n.createElement)("div",{className:"helpgent-select-radio",key:t},(0,n.createElement)("input",{type:"radio",name:"filter-by-time",value:e.value,id:`helpgent-select-option-${e.value}`,onChange:e=>{r(e)},checked:i===e.value}),(0,n.createElement)("label",{htmlFor:`helpgent-select-option-${e.value}`,className:"helpgent-single-select__option"},e.label)))),"date_frame"===i&&(0,n.createElement)("div",{className:"helpgent-form-filter-by-date-range",ref:Z},(0,n.createElement)("div",{className:"helpgent-form-filter-select-timeframe"},(0,n.createElement)("span",null,(0,m.__)("Select a Timeframe","helpgent")),(0,n.createElement)("div",{className:"helpgent-form-filter-select-dates"},(0,n.createElement)(x.A,{src:y.A}),(0,n.createElement)("input",{type:"text",placeholder:"Start date",value:new Date(P[0].startDate).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}).replace(/(\d+)(\s+)([a-zA-Z]+)(\s+)(\d+)/,"$1$2$3,$4$5"),onChange:()=>{},onClick:W}),"-",(0,n.createElement)("input",{type:"text",placeholder:"End date",value:new Date(P[0].endDate).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}).replace(/(\d+)(\s+)([a-zA-Z]+)(\s+)(\d+)/,"$1$2$3,$4$5"),onChange:()=>{},onClick:W}))),k&&(0,n.createElement)(z.Ur,{className:"helpgent-date-range-picker",onChange:e=>{Y([e.selection]),o(e.selection)},showSelectionPreview:!0,moveRangeOnFirstSelection:!1,months:2,ranges:P,direction:"horizontal",showDateDisplay:!1,inputRanges:[],staticRanges:[]}))),(0,n.createElement)("button",{className:"helpgent-btn helpgent-btn-white helpgent-form-sort-btn "+(C?"helpgent-form-sort-btn--active":""),onClick:e=>{!function(e){e.preventDefault(),I(!1),T(!C)}(e)}},(0,n.createElement)(x.A,{src:v.A})),C&&(0,n.createElement)("div",{className:"helpgent-form-sort-contents"},U.map((e,t)=>(0,n.createElement)("a",{href:"",className:"helpgent-form-sort-item "+(e.value===F?.sort?"helpgent-form-sort-item--active":""),key:t,"data-value":e.value,onClick:e=>{c(e)}},e.label,e.value===F?.sort?(0,n.createElement)(x.A,{src:_.A}):"")))))))}j.propTypes={forms:M().array};const I=j;var C=a(49876),T=a(29016);const k=(0,l.lazy)(()=>a.e(798).then(a.bind(a,87798))),O=e=>{const{baseApiRoute:t,baseLinkRoute:a}=e,{formTableState:o,setFormTableState:i}=(0,d.B)(),{fetchParams:s,filterParams:m,filterKey:h}=o,[u,f]=(0,l.useState)("all"),[M,x]=(0,l.useState)(""),b=(0,T.d)(M,250),[w,y]=(0,l.useState)([]),{data:v,isError:_,errorMessage:N}=(0,p.A)([`helpgent-form-${h}-${s?.page}`,`helpgent-form-${h}-${s?.type}`,`helpgent-form-${h}-${s?.s}`,`helpgent-form-${h}-${s?.date_type}`,`helpgent-form-${h}-${s?.["date_frame[from]"]}`,`helpgent-form-${h}-${s?.["date_frame[to]"]}`,`helpgent-form-${h}-${s?.sort}`,`helpgent-form-${h}-${s?.status}`],(0,r.addQueryArgs)(t?.forms,{...s,...m}));(0,l.useEffect)(()=>{i({...o,fetchParams:{...o.fetchParams,s:b}})},[b]);const L=(0,C.$)("helpgent_form_page_head",{});return(0,n.createElement)("div",{className:"helpgent-page-inner"},v&&(0,n.createElement)(l.Fragment,null,L,(0,n.createElement)(I,{forms:v.forms,setSearchText:e=>{x(e.target.value)},handleDateFilter:e=>{i({...o,fetchParams:{...o.fetchParams,date_type:e.target.value,"date_frame[from]":"","date_frame[to]":""}}),f(e.target.value)},handleTimeFrame:e=>{const t=6e4*(new Date).getTimezoneOffset(),a=new Date(e.startDate.getTime()-t),n=new Date(e.endDate.getTime()-t),l=`${a.toISOString().split("T")[0]} 00:00:01`,r=`${n.toISOString().split("T")[0]} 23:59:59`;i({...o,fetchParams:{...o.fetchParams,"date_frame[from]":l,"date_frame[to]":r}})},dateType:u,setDateType:f,statusTotal:v?.status_totals,handleDateSorting:e=>{e.preventDefault(),i({...o,fetchParams:{...o.fetchParams,sort:e.target.dataset.value}})},handleClearFilter:()=>{i({...o,fetchParams:{...o.fetchParams,date_type:"all","date_frame[from]":"","date_frame[to]":""}}),f("all")},totalAdminForms:v?.admin_total_forms,totalListingOwnerForms:v?.directorist_total_forms}),(0,n.createElement)(l.Suspense,{fallback:(0,n.createElement)(g.A,null)},(0,n.createElement)(k,{forms:v.forms,total:v?.total,isFetchError:_,formErrorMessage:N,baseApiRoute:t,baseLinkRoute:a,perPage:s?.per_page,handlePageClick:e=>{i({...o,fetchParams:{...o.fetchParams,page:e.selected+1}}),y([])},currentPage:s?.page,searchText:s?.s,formType:s?.type,checkedItems:w,setCheckedItems:y,statusTotal:v?.status_totals,dateType:s?.date_type,totalAdminForms:v?.admin_total_forms,totalListingOwnerForms:v?.directorist_total_forms})),(0,n.createElement)(c.A,{moduleState:o,setModuleState:i,baseApiRoute:t,baseLinkRoute:a})))};function F(e){const[t,a]=(0,l.useState)("ltr"),r={direction:t};return(0,l.useEffect)(()=>{"rtl"===document.documentElement.getAttribute("dir")?a("rtl"):a("ltr")},[]),(0,n.createElement)(o.Ht,{client:s.A},(0,n.createElement)(d.l,null,(0,n.createElement)(i.NP,{theme:r},(0,n.createElement)(O,{...e}))))}},88589:(e,t,a)=>{a.d(t,{A:()=>n}),a(51609);const n="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBpZD0iSWNvbl9hd2Vzb21lLXF1ZXN0aW9uLWNpcmNsZSIgZGF0YS1uYW1lPSJJY29uIGF3ZXNvbWUtcXVlc3Rpb24tY2lyY2xlIiBkPSJNMTYuNTYzLDguNTYzYTgsOCwwLDEsMS04LThBOCw4LDAsMCwxLDE2LjU2Myw4LjU2M1pNOC43NzcsMy4yMDhhNC4xNzgsNC4xNzgsMCwwLDAtMy43NiwyLjA1Ny4zODguMzg4LDAsMCwwLC4wODguNTI0bDEuMTE5Ljg0OWEuMzg3LjM4NywwLDAsMCwuNTM4LS4wNjhjLjU3Ni0uNzMxLjk3MS0xLjE1NSwxLjg0OC0xLjE1NS42NTksMCwxLjQ3NC40MjQsMS40NzQsMS4wNjMsMCwuNDgzLS40LjczMS0xLjA0OSwxLjFDOC4yNzYsOCw3LjI3Miw4LjUyOCw3LjI3Miw5Ljg1M3YuMTI5YS4zODcuMzg3LDAsMCwwLC4zODcuMzg3SDkuNDY2YS4zODcuMzg3LDAsMCwwLC4zODctLjM4N1Y5LjkzOWMwLS45MTgsMi42ODMtLjk1NiwyLjY4My0zLjQ0MUMxMi41MzYsNC42MjcsMTAuNiwzLjIwOCw4Ljc3NywzLjIwOFptLS4yMTUsOGExLjQ4NCwxLjQ4NCwwLDEsMCwxLjQ4NCwxLjQ4NEExLjQ4NiwxLjQ4NiwwLDAsMCw4LjU2MywxMS4yMDhaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC41NjMgLTAuNTYzKSIgZmlsbD0iIzZlNmU2ZSIvPgo8L3N2Zz4K"},89122:(e,t,a)=>{a.d(t,{B:()=>o,l:()=>i});var n=a(51609),l=a(86087);const r=(0,l.createContext)(),o=()=>(0,l.useContext)(r),i=({children:e})=>{const[t,a]=(0,l.useState)({formInputTitle:"",titleRenaming:!1,addBackBtn:!1,isCreatePopupOpen:!1,selectedTemplate:null,templateElements:null,createFormStage:"initial",filterKey:"all",fetchParams:{per_page:10,page:1,type:"admin_forms",s:"",date_type:"all","date_frame[from]":"","date_frame[to]":"",status:"all",sort:"date_created"},filterParams:{all:"1"}});return(0,n.createElement)(r.Provider,{value:{formTableState:t,setFormTableState:a}},e)}},90212:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(27723);function l(e){let t="";switch(e){case 404:t=(0,n.__)("Resource not found","helpgent");break;case 400:t=(0,n.__)("Invalid Request","helpgent");break;case 422:t=(0,n.__)("Invalid data","helpgent");break;case 500:t=(0,n.__)("Internal server error","helpgent");break;default:t=(0,n.__)("Technical error","helpgent")}return t}}}]);