"use strict";(self.webpackChunkhostinger_reach=self.webpackChunkhostinger_reach||[]).push([[132,247],{132:function(e,l,t){t.r(l),t.d(l,{default:function(){return u}});var a=t(425);const o=(0,a.KR)(0),n=(0,a.KR)(null),d={class:"base-modal"},s={class:"base-modal__header"},i={key:0,class:"base-modal__title"};var c=(0,a.pM)({__name:"BaseModal",props:{title:{},subtitle:{},titleAlignment:{default:"left"},disableScroll:{type:Boolean,default:!0}},setup(e){const l=e,{lockScroll:t,unlockScroll:c}={lockScroll:()=>{if(o.value++,1===o.value){n.value={overflow:document.body.style.overflow,paddingRight:document.body.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",e>0&&(document.body.style.paddingRight=`${e}px`)}},unlockScroll:()=>{o.value=Math.max(0,o.value-1),0===o.value&&n.value&&(document.body.style.overflow=n.value.overflow,document.body.style.paddingRight=n.value.paddingRight,n.value=null)},isLocked:()=>o.value>0};return(0,a.sV)(()=>{l.disableScroll&&t()}),(0,a.hi)(()=>{l.disableScroll&&c()}),(e,l)=>((0,a.uX)(),(0,a.CE)("div",d,[(0,a.Lk)("div",s,[(0,a.RG)(e.$slots,"back-button"),(0,a.Lk)("span",{class:(0,a.C4)(["base-modal__title-container",{"base-modal__title-container--centered":"centered"===e.titleAlignment}])},[(0,a.RG)(e.$slots,"title-icon"),e.title?((0,a.uX)(),(0,a.CE)("h2",i,(0,a.v_)(e.title),1)):(0,a.Q3)("v-if",!0)],2)]),e.subtitle?((0,a.uX)(),(0,a.CE)("p",{key:0,class:(0,a.C4)(["base-modal__subtitle",{"base-modal__subtitle--centered":"centered"===e.titleAlignment}])},(0,a.v_)(e.subtitle),3)):(0,a.Q3)("v-if",!0),(0,a.RG)(e.$slots,"default")]))}});var u=(0,t(262).A)(c,[["__scopeId","data-v-120282a3"]])},247:function(e,l,t){t.r(l),t.d(l,{default:function(){return m}});var a=t(425),o=t(259),n=t(132),d=t(408);const s={class:"select-page-modal"},i={class:"select-page-modal__content"},c={key:0,class:"select-page-modal__pages"},u=["onClick"],r={key:0,class:"select-page-modal__page-loading"},_={class:"select-page-modal__page-content"},p={key:1,class:"select-page-modal__no-pages"},g={class:"select-page-modal__footer"};var v=(0,a.pM)({__name:"SelectPageModal",props:{title:{},pages:{},data:{}},setup(e){const l=e,t=(0,a.KR)(null),v=(0,a.KR)(!1),m=()=>{v.value||(v.value=!0,window.location.href="/wp-admin/post-new.php?post_type=page&hostinger_reach_add_block=1")},b=()=>{const e=l.data?.backButtonRedirectAction;e&&e()};return(e,l)=>{const k=(0,a.g2)("HIcon"),h=(0,a.g2)("HText"),f=(0,a.g2)("HButton");return(0,a.uX)(),(0,a.Wv)(n.default,{"title-alignment":"centered",title:e.title},(0,a.eX)({default:(0,a.k6)(()=>[(0,a.Lk)("div",s,[(0,a.Lk)("div",i,[e.pages&&e.pages.length>0?((0,a.uX)(),(0,a.CE)("div",c,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(e.pages,e=>((0,a.uX)(),(0,a.CE)("div",{key:e.id,class:(0,a.C4)(["select-page-modal__page-item",{"select-page-modal__page-item--selected":e.isAdded,"select-page-modal__page-item--loading":t.value===e.id}]),onClick:l=>(e=>{t.value||(t.value=e.id,window.location.href=e.link)})(e)},[t.value===e.id?((0,a.uX)(),(0,a.CE)("div",r,[(0,a.bF)((0,a.R1)(o.Lc),{width:"60%",height:"20px","border-radius":"sm"})])):((0,a.uX)(),(0,a.CE)(a.FK,{key:1},[(0,a.Lk)("div",_,[(0,a.bF)(h,{variant:"body-2-bold",as:"span",class:"select-page-modal__page-name"},{default:(0,a.k6)(()=>[(0,a.eW)((0,a.v_)(e.name||(0,a.R1)(d.T)("hostinger_reach_forms_no_title")),1)]),_:2},1024)]),(0,a.Lk)("div",null,[(0,a.bF)(k,{name:e.isAdded?"ic-checkmark-circle-filled-24":"ic-circle-empty-24",color:e.isAdded?"primary--500":"neutral--200"},null,8,["name","color"])])],64))],10,u))),128))])):((0,a.uX)(),(0,a.CE)("div",p,[(0,a.bF)(h,{variant:"body-2",as:"p",class:"select-page-modal__no-pages-text"},{default:(0,a.k6)(()=>[(0,a.eW)((0,a.v_)((0,a.R1)(d.T)("hostinger_reach_forms_no_pages_available")),1)]),_:1})]))]),(0,a.Lk)("div",g,[(0,a.bF)(f,{variant:"outline",color:"neutral",size:"small","icon-prepend":v.value?void 0:"ic-add-16","is-loading":v.value,onClick:m},{default:(0,a.k6)(()=>[(0,a.eW)((0,a.v_)((0,a.R1)(d.T)("hostinger_reach_forms_new_page_text")),1)]),_:1},8,["icon-prepend","is-loading"])])])]),_:2},[e.data?.backButtonRedirectAction?{name:"back-button",fn:(0,a.k6)(()=>[(0,a.Lk)("button",{class:"select-page-modal__back-button",type:"button",onClick:b},[(0,a.bF)(k,{name:"ic-chevron-left-16",color:"neutral--600"})])]),key:"0"}:void 0]),1032,["title"])}}});var m=(0,t(262).A)(v,[["__scopeId","data-v-7f76cdba"]])}}]);