"use strict";(globalThis.webpackChunkhelpgent=globalThis.webpackChunkhelpgent||[]).push([[447],{20447:(e,t,a)=>{a.r(t),a.d(t,{default:()=>O});var n=a(51609),l=a(86087),i=a(56427),r=a(63064),s=a(73424);const o=(0,l.createContext)(),p=()=>(0,l.useContext)(o),c=({children:e})=>{const[t,a]=(0,l.useState)({isImportingAttachment:!1,isCreatePopupOpen:!1,selectedTemplate:null,templateElements:null,createFormStage:"initial",activeCategory:"all",templateSearchText:""});return(0,n.createElement)(o.Provider,{value:{preMadeTemplateState:t,setPreMadeTemplateState:a}},e)};var g=a(64197),m=a(38267);const d=m.Ay.div`
    min-width: 320px;
    padding: 30px 0 0 30px;
    margin-right: 30px;
    position: relative;
    transition: var(--helpgent-transition);
    box-sizing: border-box;
    @media only screen and (max-width: 1199px){
        min-width: 240px;
    }
    &.helpgent-preMade-sidebar--sm{
        min-width: 230px;
    }
    &.helpgent-preMade-sidebar--active{
        min-width: 250px;
    }
    .helpgent-back-btn{
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        color: var(--helpgent-color-light-gray);
        svg{
            path{
                fill: var(--helpgent-color-light-gray)
            }
        }
        &:hover{
            color: var(--helpgent-color-primary);
            svg path{
                fill: var(--helpgent-color-primary);
            }
        }
    }
    .helpgent-preMade-sidebar__label{
        font-size: 18px;
        font-weight: 600;
        margin: 100px 0 15px;
        color: var(--helpgent-color-dark);
    }
    .helpgent-preMade-sidebar__list{
        margin: 0;
        padding: 0;
    }
    .helpgent-sidebar-item{
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 20px;
        border-radius: 10px;
        margin: 0;
        cursor: pointer;
        &:hover,
        &.helpgent-active{
            background-color: var(--helpgent-color-white);
        }
        .helpgent-badge{
            width: auto;
            height: 24px;
            padding: 0 11.5px;
        }
        .helpgent-badge-light{
            color: var(--helpgent-color-gray);
            background-color: var(--helpgent-color-bg-deep);
        }
    }
    .helpgent-sidebar-item__label{
        font-size: 15px;
        font-weight: 500;
        color: var(--helpgent-color-dark);
    }
    .helpgent-premade-template-sidebar-close{
        width: 30px;
        height: 30px;
        background: var(--helpgent-color-bg-deep);
        position: absolute;
        right: 15px;
        top: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        svg{
            width: 10px;
            height: 10px;
            path{
                fill: var(--helpgent-color-gray);
                transition: var(--helpgent-transition);
            }
        }
        &:hover{
            svg path{
                fill: var(--helpgent-color-danger);
            }
        }
    }

    &.helpgent-preMade-sidebar--active{
        position: absolute;
        background: #fff;
        z-index: 99;
        height: 100%;
        left: 0;
        box-shadow: 0 0 15px rgba(0,0,0,0.15);
        margin-right: 0;
        padding: 20px;
        .helpgent-sidebar-item:hover,
        .helpgent-sidebar-item.helpgent-active{
            background: var(--helpgent-color-bg-gray);
        }
    }
    &.helpgent-preMade-sidebar--collapsed{
        position: absolute;
        left: -110%;
    }
`,M=m.Ay.div`
    flex: 1;
    height: 100vh;
    padding: 70px 30px;
    background-color: var(--helpgent-color-white);
    overflow-y: auto;
    .helpgent-preMade-list{
        position: relative;
        &:after{
            position: absolute;
            left: 0;
            top: 10px;
            width: 100%;
            height: 1px;
            content: '';
            z-index: -1;
            background-color: var(--helpgent-color-bg-light);
        }
        .helpgent-preMade-list__title{
            position: relative;
            font-size: 16px;
            font-weight: 500;
            margin: 0;
            width: fit-content;
            padding-right: 20px;
            z-index: 10;
            text-transform: uppercase;
            background-color: var(--helpgent-color-white);
            color: var(--helpgent-color-dark);
        }
    }
    .helpgent-preMade-list__grid{
        display: flex;
        flex-wrap: wrap;
        margin: 0 -15px;
        &.helpgent-preMade-list__grid--sm{
            .helpgent-preMade-item{
                flex: 0 0 50%;
                @media only screen and (max-width: 575px){
                    flex: 0 0 100%;
                }
            }
        }
    }
    .helpgent-premade-template-sidebar-collapse{
        cursor: pointer;
        svg{
            width: 16px;
            height: 16px;
            path{
                fill: var(--helpgent-color-gray);
            }
        }
    }
`,h=m.Ay.div`
    text-align: center;
    .helpgent-preMade-header__title{
        font-size: 24px;
        font-weight: 600;
        color: var(--helpgent-color-dark);
    }
    .helpgent-preMade-header__subtitle{
        font-size: 15px;
        font-weight: 500;
        color: var(--helpgent-color-gray);
    }
    .helpgent-preMade-header__search{
        margin: 30px 0;
        .helpgent-form-group{
            margin: 0;
        }
        .helpgent-form-group__element{
            min-height: 44px;
            border-radius: 10px;
            background-color: var(--helpgent-color-bg-gray);
        }
    }
`,u=m.Ay.div`
    flex: 0 0 33.33%;
    padding: 15px;
    box-sizing: border-box;
    @media only screen and (max-width: 1199px){
        flex: 0 0 50%;
    }
    @media only screen and (max-width: 480px){
        flex: 0 0 100%;
    }
    figure{
        margin: 0;
    }
    .helpgent-preMade-item__img{
        position: relative;
        border-radius: 14px;
        height: 300px;
        @media only screen and (max-width: 1499px){
            height: 200px;
        }
        @media only screen and (max-width: 1299px){
            height: 150px;
        }
        @media only screen and (max-width: 1199px){
            height: 200px;
        }
        img{
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: inherit;
        }
        &:before{
            position: absolute;
            content: '';
            width: 100%;
            height: 100%;
            border-radius: inherit;
            left: 0;
            top: 0;
            background: rgba(0,0,0,0.5);
            visibility: hidden;
            opacity: 0;
            transition: var(--helpgent-transition);
        }
        &:hover{
            &:before{
                visibility: visible;
                opacity: 1;
            }
            .helpgent-preMade-item__action{
                visibility: visible;
                opacity: 1;
            }
        }
        &.helpgent-preMade-item__img--loading{
            background: #fff;
            &:after{
                content: '';
                position: absolute;
                left: 50%;
                top: 50%;
                width: 20px;
                height: 20px;
                border: 2px solid var(--helpgent-color-gray);
                border-bottom-color: transparent;
                z-index: 1;
                border-radius: 50%;
                margin-left: -10px;
                margin-top: -10px;
                animation: helpgentSpinner 900ms infinite linear forwards;
            }
        }
    }
    .helpgent-preMade-item__action{
        position: absolute;
        left: 50%;
        top: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        transform: translate(-50%, -50%);
        margin: -5px;
        visibility: hidden;
        opacity: 0;
        transition: var(--helpgent-transition);
        .helpgent-btn{
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            width: 100%;
            padding: 5px 10.5px;
            justify-content: center;
            width: 175px;
            margin: 5px;
            border-radius: 10px;
            &:hover{
                svg{
                    path,
                    circle{
                        fill: var(--helpgent-color-white);
                    }
                }
            }
        }
    }
    .helpgent-preMade-item__img--coming-soon{
        overflow: hidden;
        &:before{
            content: none;
        }
        img{
            filter: blur(3px);
        }
    }
    .helpgent-preMade-item__coming-soon{
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        background: rgba(255,255,255,0.6);
        border-radius: inherit;
        span{
            display: flex;
            align-items: center;
            justify-content: center;
            width: 175px;
            height: 40px;
            border-radius: 10px;
            background: var(--helpgent-color-dark);
            color: #fff;
            font-size: 16px;
            font-weight: 600;
            @media only screen and (max-width: 1299px){
                width: 130px;
                height: 36px;
                font-size: 15px;
            }
        }
    }
    .helpgent-preMade-item__title{
        font-size: 16px;
        font-weight: 500;
        max-width: 350px;
        margin: 0;
        color: var(--helpgent-color-dark);
    }
    figcaption{
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 8px 0 0;
        .helpgent-badge{
            height: 20px;
            padding: 4px 4px 3px 4px;
            box-sizing: border-box;
            font-size: 11px;
            margin-left: 14px;
        }
    }
`;var w=a(65604),y=a(97792),N=a(52619),b=a(27723);function x(){const{preMadeTemplateState:e,setPreMadeTemplateState:t}=p(),{templateSearchText:a}=e;return(0,n.createElement)(h,{className:"helpgent-preMade-header"},(0,N.applyFilters)("helpgent_template_header"),(0,n.createElement)("h2",{className:"helpgent-preMade-header__title"},(0,b.__)("Template gallery","helpgent")),(0,n.createElement)("span",{className:"helpgent-preMade-header__subtitle"},(0,b.__)("Not sure where to start? To get started, look through our pre-made templates.","helpgent")),(0,n.createElement)("div",{className:"helpgent-preMade-header__search"},(0,n.createElement)("div",{className:"helpgent-form-group helpgent-form-icon-left"},(0,n.createElement)("span",{className:"helpgent-input-icon"},(0,n.createElement)(w.A,{src:y.A})),(0,n.createElement)("input",{type:"text",className:"helpgent-form-group__element",placeholder:"Search in all templates",value:a,onChange:a=>function(a){t({...e,templateSearchText:a.target.value})}(a)}))))}var _=a(54899),L=a(47643),z=a(88869),v=a(6945),f=a(38745);function E(e){const{navigationHook:t}=(0,v.Xd)("helpgent_router_references",null),a=(0,f.L)(),{preMadeTemplateState:i,setPreMadeTemplateState:r}=p(),{template:s,baseLinkRoute:o}=e,c=t(),[g,m]=(0,l.useState)(!1);return(0,n.createElement)(u,{className:"helpgent-preMade-item"},(0,n.createElement)("figure",null,(0,n.createElement)("div",{className:`helpgent-preMade-item__img ${s.is_coming_soon?"helpgent-preMade-item__img--coming-soon":""} ${g?"":"helpgent-preMade-item__img--loading"}`},(0,n.createElement)("img",{src:s?.screenshot_src,alt:(0,b.__)("Helpgent Pre Made Template","helpgent"),loading:"lazy",onLoad:function(){m(!0)}}),s.is_coming_soon?(0,n.createElement)("div",{className:"helpgent-preMade-item__coming-soon"},(0,n.createElement)("span",null,(0,b.__)("Coming Soon","helpgent"))):(0,n.createElement)("div",{className:"helpgent-preMade-item__action"},(0,n.createElement)("button",{onClick:function(){c(`${o.preview}/${s?.id}`)},className:"helpgent-btn helpgent-btn-white helpgent-btn-sm"},(0,n.createElement)(w.A,{src:_.A})," ",(0,b.__)("Preview","helpgent")),(0,n.createElement)("button",{className:"helpgent-btn helpgent-btn-white helpgent-btn-sm "+((0,N.applyFilters)("helpgent_disable_template_use_button",!a&&s.is_pro)?"helpgent-btn-disabled":""),onClick:function(){s.json_path&&(r({...i,isCreatePopupOpen:!0,selectedTemplate:s,createFormStage:"prepared-elements"}),fetch(s.json_path).then(e=>{if(!e.ok)throw new Error((0,b.__)("Network response was not ok","helpgent"));return e.json()}).then(e=>{r({...i,isCreatePopupOpen:!0,selectedTemplate:s,createFormStage:"scratch",templateElements:e})}).catch(e=>{console.error((0,b.__)("There was a problem with the fetch operation:","helpgent"),e)}))}},(0,n.createElement)(w.A,{src:L.A})," ",(0,b.__)("Use this template","helpgent")))),(0,n.createElement)("figcaption",null,(0,n.createElement)("h5",{className:"helpgent-preMade-item__title"},s?.title),s.is_pro&&!a?(0,n.createElement)(z.Badge,{type:"success",text:"PRO",modifier:"helpgent-badge-round"}):"")))}var j=a(47274);function S(e){const{baseLinkRoute:t,templates:a,preMadeWrapWidth:i}=e,[r,s]=(0,l.useState)([]),{preMadeTemplateState:o}=p(),{activeCategory:c,templateSearchText:g}=o;return(0,l.useEffect)(()=>{let e=[];for(const t in a){let n=a[t];"all"!==c&&n.category!==c||(""===g||n.title.toLowerCase().includes(g.toLowerCase()))&&e.push(n)}s(e)},[a,g,c]),(0,n.createElement)(M,{className:"helpgent-preMade-content"},i<768&&(0,n.createElement)("span",{className:"helpgent-premade-template-sidebar-collapse",onClick:()=>{!function(){const e=document.querySelector(".helpgent-preMade-sidebar");e.classList.add("helpgent-preMade-sidebar--active"),e.classList.remove("helpgent-preMade-sidebar--collapsed")}()}},(0,n.createElement)(w.A,{src:j.A})),(0,n.createElement)(x,null),0===r?.length?(0,n.createElement)("span",{className:"helpgent-not-found-text"},(0,b.__)("No template found","helpgent")):(0,n.createElement)("div",{className:"helpgent-preMade-list"},(0,n.createElement)("h4",{className:"helpgent-preMade-list__title"},c),(0,n.createElement)("div",{className:"helpgent-preMade-list__grid "+(i<1060?"helpgent-preMade-list__grid--sm":"")},r.map((e,a)=>(0,n.createElement)(E,{key:a,template:e,baseLinkRoute:t})))))}var D=a(22057),A=a(23142);function I({categories:e,baseLinkRoute:t,preMadeWrapWidth:a}){const{routeLink:l}=(0,v.Xd)("helpgent_router_references",null),{preMadeTemplateState:i,setPreMadeTemplateState:r}=p(),{activeCategory:s}=i;function o(e){r({...i,activeCategory:e,templateSearchText:""})}return(0,n.createElement)(d,{className:`helpgent-preMade-sidebar ${a<768?"helpgent-preMade-sidebar--collapsed":""} ${a<1060?"helpgent-preMade-sidebar--sm":""}`},a<768&&(0,n.createElement)("span",{className:"helpgent-premade-template-sidebar-close",onClick:()=>{!function(){const e=document.querySelector(".helpgent-preMade-sidebar");e.classList.remove("helpgent-preMade-sidebar--active"),e.classList.add("helpgent-preMade-sidebar--collapsed")}()}},(0,n.createElement)(w.A,{src:A.A})),(0,n.createElement)(l,{className:"helpgent-back-btn",to:`/${t.forms}`},(0,n.createElement)(w.A,{src:D.A})," ",(0,b.__)("Back to all forms","helpgent")),(0,n.createElement)("h4",{className:"helpgent-preMade-sidebar__label"},(0,b.__)("Categories","helpgent")),(0,n.createElement)("ul",{className:"helpgent-preMade-sidebar__list"},(0,n.createElement)("li",{className:"helpgent-sidebar-item "+("all"===s?"helpgent-active":""),onClick:()=>o("all")},(0,n.createElement)("div",{className:"helpgent-sidebar-item__label"},(0,b.__)("All","helpgent")),(0,n.createElement)("span",{className:"helpgent-sidebar-item__badge helpgent-badge helpgent-badge-light"},e.total)),Object.keys(e.items)?.map((t,a)=>(0,n.createElement)("li",{className:"helpgent-sidebar-item "+(s===t?"helpgent-active":""),key:a,onClick:()=>o(t)},(0,n.createElement)("div",{className:"helpgent-sidebar-item__label"},t),(0,n.createElement)("span",{className:"helpgent-sidebar-item__badge helpgent-badge helpgent-badge-light"},e.items[t])))))}const C=m.Ay.div`
    .helpgent-message-error{
        font-size: 1rem;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .components-spinner {
        position: absolute;
        inset-inline-start: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
    }
    .helpgent-preMade-templates{
        display: flex;
        position: relative;
    }
    .helpgent-page-initial{
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        height: 50vh;
        max-width: 100%;
        border-radius: 14px;
        margin: 20px 20px 0;
        background-color: var(--helpgent-color-white);
        box-sizing: border-box;
    }
`;var T=a(16622);const k=e=>{const{baseApiRoute:t,baseLinkRoute:a}=e,{preMadeTemplateState:r,setPreMadeTemplateState:o}=p(),[c,g]=(0,l.useState)({total:0,items:{}}),[m,d]=(0,l.useState)([]),[M,h]=(0,l.useState)(!0),[u,w]=(0,l.useState)();return(0,l.useEffect)(()=>{fetch(T._V).then(async e=>{const t=await e.json(),{templates:a,urls:n}=t;let l={},i=[],r=0;for(const e in a){const t=a[e];t.json_path=n.json_path+"/"+t.id,t.preview_url=n.preview_url+"/"+t.id,t.id=e,l[t.category]?l[t.category]+=1:l[t.category]=1,r+=1,i.push(t)}g({total:r,items:l}),d(i),h(!1)})},[]),(0,l.useEffect)(()=>{const e=document.querySelector(".helpgent-preMade-templates");e&&w(e.clientWidth)},[m]),(0,n.createElement)(C,null,!m||M?(0,n.createElement)("div",{className:"helpgent-page-initial"},M?(0,n.createElement)(i.Spinner,null):null):(0,n.createElement)("div",{className:"helpgent-preMade-templates"},(0,n.createElement)(I,{categories:c,baseLinkRoute:a,preMadeWrapWidth:u}),(0,n.createElement)(S,{templates:m,baseLinkRoute:a,preMadeWrapWidth:u}),(0,n.createElement)(s.A,{moduleState:r,setModuleState:o,baseApiRoute:t,baseLinkRoute:a})))};function O(e){return(0,n.createElement)(r.Ht,{client:g.A},(0,n.createElement)(c,null,(0,n.createElement)(k,{...e})))}},26944:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(51609),l=a(4286);function i(e){const{type:t,currentValue:a,contentFlow:i}=e;return(0,n.createElement)(l.F2,{className:`helpgent-progress-bar helpgent-progress-bar-${t} helpgent-progress-bar-${i}`},(0,n.createElement)("div",{className:"helpgent-progress-bar__status",style:{["vertical"===i?"height":"width"]:`${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})},47274:(e,t,a)=>{a.d(t,{A:()=>n}),a(51609);const n="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXN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jEuNjU4YTYuMzc2LDYuMzc2LDAsMCwxLDUuMzQ2LDIuOTc1QTEuNTYzLDEuNTYzLDAsMCwxLDEyLjg0Niw2Ni4zOTJaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDApIiBmaWxsPSIjNmU2ZTZlIi8+CiAgICA8Y2lyY2xlIGlkPSJFbGxpcHNlXzI4MyIgZGF0YS1uYW1lPSJFbGxpcHNlIDI4MyIgY3g9IjIuNTIxIiBjeT0iMi41MjEiIHI9IjIuNTIxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0Ljk3OCA2Mi45OTEpIiBmaWxsPSIjNmU2ZTZlIi8+CiAgPC9nPgo8L3N2Zz4K"},64197:(e,t,a)=>{a.d(t,{A:()=>n});const n=new(a(5054).E)},73424:(e,t,a)=>{a.d(t,{A:()=>Y});var n=a(51609),l=a(86087),i=a(56427),r=a(65604),s=a(5556),o=a.n(s),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:o().string,subtitle:o().string};var g=a(6945);function m(e){const{routeLink:t}=(0,g.Xd)("helpgent_router_references",null),{icon:a,text:l,step:i,url:s,moduleState:o,setModuleState:p}=e;function c(e,t){e.preventDefault(),"scratch"===t?p({...o,addBackBtn:!0,createFormStage:"scratch"}):"template"===t&&p({...o,createFormStage:"template"})}return s?(0,n.createElement)(t,{to:s||"#",className:"helpgent-createPopup__action",onClick:e=>i?c(e,i):null},(0,n.createElement)("div",{className:"helpgent-createPopup__action-icon"},(0,n.createElement)(r.A,{src:a})),l&&(0,n.createElement)("span",{className:"helpgent-createPopup__action-text"},l)):(0,n.createElement)("span",{className:"helpgent-createPopup__action",onClick:e=>i?c(e,i):null},(0,n.createElement)("div",{className:"helpgent-createPopup__action-icon"},(0,n.createElement)(r.A,{src:a})),l&&(0,n.createElement)("span",{className:"helpgent-createPopup__action-text"},l))}function d(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,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj4KICA8ZyBpZD0iR3JvdXBfMjYxOCIgZGF0YS1uYW1lPSJHcm91cCAyNjE4IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNzk5Ljc0NyAtMzAzLjIyOSkiPgogICAgPHBhdGggaWQ9IlBhdGhfMTQ3OCIgZGF0YS1uYW1lPSJQYXRoIDE0NzgiIGQ9Ik0zNC4yMTIsMTguMzM3bC0uOTM3LjkzN2ExMC43ODEsMTAuNzgxLDAsMCwwLTMuNzEyLS42NUExMC45NTIsMTAuOTUyLDAsMCwwLDE4LjYyNiwyOS41NWExMC43NTYsMTAuNzU2LDAsMCwwLC42NTEsMy43MDlMMTcuNzUsMzQuNzg0bC0zLjMxMy0zLjMxTDExLjIsMjguMjM5bC4xLS4xTDI2Ljk1OSwxMi41bC42ODgtLjY4NywzLjE2MywzLjE0N0wzNC4yLDE4LjMyMmwuMDEzLjAxNVpNMTAuNjc4LDI5LjQ4NSw4LjA1MSwzNi43MjFhLjk2Ljk2LDAsMCwwLC4yMjUuOTg3Ljk3Ni45NzYsMCwwLDAsLjk4Ni4yMjVsNy4yNDMtMi42MjQtNS44MjctNS44MjRaTTM2LjYsOS4zMzJhNC44MjksNC44MjksMCwwLDAtMy4yODctMS4zNDksNC42MzMsNC42MzMsMCwwLDAtMy4yNjIsMS4zODZsLTEuNTI2LDEuNTU3LjAwNy4wMDYsMy4xNjMsMy4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aC0xMEEzLjMzMywzLjMzMywwLDAsMCwzLDIxLjMzM3Y4LjMzM0EzLjMzMywzLjMzMywwLDAsMCw2LjMzMywzM2gxMGEzLjMzMywzLjMzMywwLDAsMCwzLjMzMy0zLjMzM1YyMS4zMzNBMy4zMzMsMy4zMzMsMCwwLDAsMTYuMzMzLDE4Wm0tMTAsMTEuNjY3VjIxLjMzM2gxMHY4LjMzM1pNMjkuNjY3LDE4aC01YTMuMzMzLDMuMzMzLDAsMCwwLTMuMzMzLDMuMzMzdjguMzMzQTMuMzMzLDMuMzMzLDAsMCwwLDI0LjY2NywzM2g1QTMuMzMzLDMuMzMzLDAsMCwwLDMzLDI5LjY2N1YyMS4zMzNBMy4zMzMsMy4zMzMsMCwwLDAsMjkuNjY3LDE4Wm0tNSwxMS42NjdWMjEuMzMzaDV2OC4zMzNaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMyAtMykiLz4KPC9zdmc+Cg==",text:"Start From A Template",url:"pre-made-templates"}].map((e,l)=>(0,n.createElement)(m,{icon:e.icon,text:e.text,step:e.step,url:e.url,moduleState:t,setModuleState:a,key:l})))))}m.propTypes={icon:o().string,text:o().string,step:o().string,url:o().string},d.propTypes={};var M=a(49876),h=a(88869),u=a(63064),w=a(49785),y=a(52619),N=a(29898);async function b(e,t,a,n,l,i,r){const s=(0,N.vf)().filter(e=>"welcome"===e.element_type||"end"===e.element_type||"user_validation"===e.element_type);let o=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(i){const e=Object.assign({},JSON.parse(i).global),t=JSON.parse(i).elements;c={...e,...g},o=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=s.filter(e=>"end"===e.element_type)[0];s[0].controls.elementLogic.default_target=e?.id,o=JSON.stringify({elements:s,global:c})}const m={status:"draft",content:o},d=e.available_pages?e.available_pages:"";m.title=e.title,m.available_pages=d||[],m.is_chat_bubble=e.displayChatBubble||"0";try{const e=await t(m);e&&n(`/${r.forms}/${e.form_id}/edit`),l.invalidateQueries("helpgent-single-form"),l.invalidateQueries("helpgent-form"),(0,y.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 x=a(92300),_=a(26374),L=a(7012);var z=a(38267);const v=z.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;
    }
`,f=z.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;
    }
`,E=z.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 j=a(28050),S=a(41620),D=a(26944),A=a(16622);function I(e){const{formData:t,createFormMutation:a,setServerErrors:i,navigate:r,queryClient:s,moduleState:o,setModuleState:c,baseLinkRoute:g}=e,[m,d]=(0,l.useState)(0),[M,h]=(0,l.useState)(0),[u,w]=(0,l.useState)(0),[y,N]=(0,l.useState)(0),{templateElements:x,selectedTemplate:_}=o,{mutateAsync:L,isLoading:z}=(0,j.A)("/helpgent/form/media");return(0,l.useEffect)(()=>{if(x?.elements?.length>0){c({...o,isImportingAttachment:!0}),fetch(A._V+"/import/"+_.id);const e=x?.elements;let t=0,a=0;e.map(async(n,l)=>{if(n?.media?.url){const i={url:n.media.url};try{const n=await L(i);201===n?.data?.status?(e[l].media.url=n.url,a+=1,d(a)):(e[l].media.url=null,t+=1,h(t))}catch(a){e[l].media.url=null,t+=1,h(t)}}else t+=1,h(t);"picture_select"===n?.element_type&&n?.controls?.general?.options?.length>0&&(N(n?.controls?.general?.options?.length),n?.controls?.general?.options.map(async(e,l)=>{if(e?.url){const i={url:e?.url};try{const e=await L(i);201===e?.data?.status?(n.controls.general.options[l].url=e?.url,a+=1,d(a)):(n.controls.general.options[l].url=null,t+=1,h(t))}catch(e){n.controls.general.options[l].url=null,t+=1,h(t)}}else t+=1,h(t)}))})}},[x?.elements]),(0,l.useEffect)(()=>{const e=(0,S.A)(m+M,x?.elements?.length+y),n=JSON.stringify({elements:x.elements,global:x.global});100===parseInt(e)&&b(t,a,i,r,s,n,g),w(e)},[m,M]),(0,n.createElement)(f,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)(D.A,{type:"success",currentValue:u,contentFlow:"horizontal"}),(0,n.createElement)("span",{className:"helpgent-import-attachment__percentage"},Math.floor(u),"%")))}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)(i.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)(r.A,{src:C.A})))),(0,n.createElement)(h.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:i,baseApiRoute:r,baseLinkRoute:s}=e,{selectedTemplate:o}=a,m=t(),d=(0,u.jE)(),[y,N]=(0,l.useState)({}),[z,v]=(0,l.useState)(null),[f,j]=(0,l.useState)(!1),[S,D]=(0,l.useState)("0"),[A,C]=(0,l.useState)("form"),{register:k,handleSubmit:O,setValue:Y,formState:{errors:P},control:Z}=(0,w.mN)({mode:"all"}),{mutateAsync:F,isLoading:B}=(W=`${r?.forms}`,(0,_.n)(e=>(0,L.A)(W,e)));var W;return(0,l.useEffect)(()=>{o&&Y("title",o?.title||null)},[o]),(0,n.createElement)(n.Fragment,null,"form"===A&&(0,n.createElement)("div",{className:"helpgent-createPopup"},(0,n.createElement)(c,{title:(0,p.__)("Let’s get started","helpgent")}),(0,n.createElement)(E,null,(0,n.createElement)("form",{onSubmit:O(e=>function(e){i({...a,addBackBtn:!1}),o?(C("attachmentImport"),v(e)):b(e,F,N,m,d,null,s)}(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,x.A)(P.title.message):y.title?(0,x.A)(y.title):null,"isOnlySpace"===P.title?.type?(0,x.A)(P.title.message):y.title?(0,x.A)(y.title):null,"minLength"===P.title?.type?(0,x.A)(P.title.message):y.title?(0,x.A)(y.title):null),(0,n.createElement)("div",{className:"helpgent-form-group"},(0,n.createElement)("div",{className:"helpgent-form__element-inline"},(0,n.createElement)(h.Switch,{handleToggle:()=>function(e,t,a,n,l){e(!a),t("displayChatBubble",!a),n("0"===l?"1":"0")}(j,Y,f,D,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")}))),f&&(0,n.createElement)(n.Fragment,null,(0,n.createElement)(T,{control:Z,baseApiRoute:r}),(0,M.$)("helpgent_form_create_modal_bubble_controls",{},{control:Z})),(0,M.$)("helpgent_form_modal_before_submit",{},{control:Z,displayChatBubble:f}),(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(y).length||B?"helpgent-btn-disabled":""),disabled:!(0===Object.keys(P).length&&0===Object.keys(y).length&&!B)},B?(0,p.__)("Creating","helpgent"):(0,p.__)("Create Form","helpgent")),y.internal&&(0,x.A)(y.internal)))),"attachmentImport"===A&&(0,n.createElement)(I,{formData:z,createFormMutation:F,setServerErrors:N,navigate:m,queryClient:d,moduleState:a,setModuleState:i,baseLinkRoute:s}))}var O=a(22057);const Y=function(e){const{moduleState:t,setModuleState:a,baseApiRoute:s,baseLinkRoute:o}=e,{isImportingAttachment:c,isCreatePopupOpen:g,createFormStage:m,addBackBtn:M}=t;return g&&(0,n.createElement)(l.Fragment,null,(0,n.createElement)(i.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"===m&&M&&(0,n.createElement)("span",{className:"helpgent-btn-back",onClick:function(){a({...t,createFormStage:"initial",addBackBtn:!1})}},(0,n.createElement)(r.A,{src:O.A})," ",(0,p.__)("Back","helpgent")),(0,n.createElement)(v,{className:"helpgent-create-form-modal "+("prepared-elements"===m?"helpgent-create-loader-active":"")},"prepared-elements"===m&&(0,n.createElement)(i.Spinner,null),"initial"===m?(0,n.createElement)(d,{moduleState:t,setModuleState:a}):"scratch"===m?(0,n.createElement)(k,{moduleState:t,setModuleState:a,baseApiRoute:s,baseLinkRoute:o}):void 0)))}},88589:(e,t,a)=>{a.d(t,{A:()=>n}),a(51609);const n="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBpZD0iSWNvbl9hd2Vzb21lLXF1ZXN0aW9uLWNpcmNsZSIgZGF0YS1uYW1lPSJJY29uIGF3ZXNvbWUtcXVlc3Rpb24tY2lyY2xlIiBkPSJNMTYuNTYzLDguNTYzYTgsOCwwLDEsMS04LThBOCw4LDAsMCwxLDE2LjU2Myw4LjU2M1pNOC43NzcsMy4yMDhhNC4xNzgsNC4xNzgsMCwwLDAtMy43NiwyLjA1Ny4zODguMzg4LDAsMCwwLC4wODguNTI0bDEuMTE5Ljg0OWEuMzg3LjM4NywwLDAsMCwuNTM4LS4wNjhjLjU3Ni0uNzMxLjk3MS0xLjE1NSwxLjg0OC0xLjE1NS42NTksMCwxLjQ3NC40MjQsMS40NzQsMS4wNjMsMCwuNDgzLS40LjczMS0xLjA0OSwxLjFDOC4yNzYsOCw3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