1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5977],{96380:function(t,e,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/edit-site",function(){return o(26029)}])},26029:function(t,e,o){"use strict";o.r(e);var n=o(85893),i=o(67294),r=o(11163),s=o(88144),l=o(98643),d=o(49673),a=o(38628),c=o(26632),x=o(33613),g=o(78164),u=o(41056),p=o(58120),m=o(6734),b=o(8898),h=o(66242),f=o(83321),j=o(67720),Z=o(15861),v=o(97097),w=o(87357),C=o(14534),k=o(93946),S=o(86886),y=o(2734),P=o(18972),L=o(44267),B=o(14564),D=o(94054),F=o(48189),A=o(90703),z=o(66476),W=o(36005),R=o(49639),T=o(33564);o(32658);var I=o(55525),E=o(15428),O=o(98396),M=o(81931),_=o(51517);let V=(t,e)=>(0,n.jsxs)(w.Z,{sx:{mb:3},children:[(0,n.jsx)(w.Z,{sx:{mb:1},children:(0,n.jsxs)(Z.Z,{variant:"h4",sx:{fontWeight:700,lineHeight:"24px"},children:[t("widget.editSite")," (",e.domain,")"]})}),(0,n.jsx)(Z.Z,{sx:{mb:2,color:"text.secondary"},children:t("widget.activateDescription")})]}),q=t=>{let{title:e,color:o,updateColor:r,contrastIssue:s,popoverId:l,openPopUp:d,anchorEl:a,handlePopupClose:c,handlePopupOpen:g,matchesMD:u,restoreDefault:p}=t,{t:b}=(0,m.$G)(),j=(0,y.Z)(),P=(0,M.Z)();(0,O.Z)(j.breakpoints.up("lg")),(0,O.Z)(j.breakpoints.down("sm"));let D="dark"==j.palette.mode,z=j.palette.text.primary,W=(0,i.useRef)(null);(0,i.useEffect)(()=>(s?W.current&&(x.C.dismiss(W.current),W.current=null):W.current||(W.current=x.C.error(b("widget.contrastIssue"),{duration:1/0})),()=>{W.current&&(x.C.dismiss(W.current),W.current=null)}),[s,b]);let R=()=>{W.current&&(x.C.dismiss(W.current),W.current=null),p()};return(0,n.jsx)(w.Z,{sx:{position:"relative",mb:6,mt:5},children:(0,n.jsxs)(h.Z,{sx:{backgroundColor:D?"#373C55":"#ffffff",border:D?"none":"1px solid rgb(213, 213, 213)",borderRadius:"10px",boxShadow:D?"0 2px 4px rgba(0, 0, 0, 0.15)":"none",...!s&&{outline:"2px solid",outlineColor:"#ea5455"}},children:[(0,n.jsx)(L.Z,{children:(0,n.jsxs)(S.ZP,{container:!0,alignItems:"center",spacing:1,sx:{justifyContent:{xs:"center",md:"flex-start"}},children:[(0,n.jsx)(S.ZP,{item:!0,xs:12,md:3,lg:4,xl:3,sx:{textAlign:{xs:"center",md:"left"}},children:(0,n.jsx)(Z.Z,{variant:"subtitle1",children:e})}),(0,n.jsx)(S.ZP,{item:!0,xs:12,md:3,lg:4,xl:3,sx:{display:"flex",justifyContent:{xs:"center",md:"flex-start"}},children:(0,n.jsx)(A.Z,{colors:["#97693B","#C2544C","#9C27B0","#673AB7","#3F51B5","#137DD6"],color:o,onChange:t=>{r(t.hex)}})}),(0,n.jsx)(S.ZP,{item:!0,xs:12,md:1,lg:4,xl:1,sx:{display:"flex",justifyContent:{xs:"center",md:"flex-start"}},children:(0,n.jsx)(k.Z,{color:"secondary","aria-label":"pick-color","aria-describedby":l,onClick:g,sx:{transition:"all 0.3s ease-in-out",...D?{backgroundColor:"rgba(255, 255, 255, 0.1)",color:z,borderColor:z,"&:hover":{borderColor:z,backgroundColor:"rgba(255, 255, 255, 0.3)",boxShadow:"0 0px 5px 0px rgba(255, 255, 255, .2)"}}:{backgroundColor:"rgba(0, 0, 0, 0.04)",boxShadow:"0 3px 5px 2px rgba(0, 0, 0, .1)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.08)",boxShadow:"0 5px 8px 2px rgba(0, 0, 0, .2)"}}},children:(0,n.jsx)(C.Z,{})})}),(0,n.jsx)(S.ZP,{item:!0,xs:12,md:5,lg:12,xl:5,children:(0,n.jsx)(w.Z,{sx:{display:"flex",justifyContent:{xs:"center",lg:"flex-end"}},children:(0,n.jsx)(f.Z,{"aria-describedby":l,size:"small",onClick:R,startIcon:(0,n.jsx)(v.Z,{}),sx:{height:29,padding:4,borderRadius:1,color:"white",backgroundColor:"#3B3F44",fontSize:13,fontWeight:400,"&:hover":{backgroundColor:"#3B3F44",cursor:"pointer"},...D&&{backgroundColor:P.enterpriseLight.backgroundColor,color:P.enterpriseLight.color,borderColor:z,"&:hover":{backgroundColor:P.enterpriseLight.backgroundColor,borderColor:z,cursor:"pointer"}}},children:b("widget.restoreDefault")})})})]})}),(0,n.jsx)(B.ZP,{id:l,open:d,anchorEl:a,onClose:c,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:(0,n.jsx)(F.Z,{color:o,inputType:"rgba",showAlpha:!1,onChange:t=>{r(t.hex)}})})]})})},H=()=>{let{t}=(0,m.$G)(),[e,o]=(0,i.useState)(null),[v,C]=(0,i.useState)(null),[k,B]=(0,i.useState)(null),[F,A]=(0,i.useState)("left"),[H,N]=(0,i.useState)([]),[J,G]=(0,i.useState)(!1),[U,X]=(0,i.useState)(!1),[$,K]=(0,i.useState)(!1),[Y,Q]=(0,i.useState)(!1),[tt,te]=(0,i.useState)(null),to=(0,O.Z)(t=>t.breakpoints.up("md")),tn=(0,O.Z)(t=>t.breakpoints.up("lg"));(0,M.Z)();let ti=(0,i.useRef)([]),tr=(0,r.useRouter)(),ts=(0,g.f4)(),tl=async e=>{let{data:o}=await l.Z.get("/api/v1/site/".concat(e)),n=o.data;
1if(n.state={settingOpen:!0,isDomainValid:!0,moveToInput:!1,domainTaken:!1},n.licenseExpiration){let e=new Date(n.licenseExpiration),o=new Date;if(e<o)throw Error(t("messages.error.licenseExpired",{date:e.toLocaleDateString()}));console.log(t("messages.success.licenseValid",{days:Math.ceil((e-o)/864e5)}))}else throw Error(t("messages.error.noLicenseDate"));N([n]),A(n.widgetLocation);let i="small"===n.widgetSize;return X(i),te({site:{...n},showSmallWidget:i}),n},td=(0,s.a)({queryKey:["fetchSite"],queryFn:()=>tl(e),enabled:!!e,refetchOnWindowFocus:!1});(0,i.useEffect)(()=>{if(!tr.isReady)return;let{id:t}=tr.query;o(t)},[tr.isReady,tr.query]),(0,i.useEffect)(()=>{let{sites:t,index:e}=tr.query;if(t){let o=JSON.parse(t);N(o=o.map((t,o)=>({...t,state:{settingOpen:e==o,isDomainValid:!0,moveToInput:!1}})))}},[tr.query]),(0,i.useEffect)(()=>{ti.current=ti.current.slice(0,H.length)},[H.length]);let ta=t=>{C(t.currentTarget)},tc=()=>{C(null)},tx=t=>{B(t.currentTarget)},tg=()=>{B(null)},tu=!!v,tp=!!k,tm=tu?"widget-color-popover":void 0,tb=tp?"trigger-color-popover":void 0,th=(0,y.Z)(),tf=(0,O.Z)(th.breakpoints.down("sm")),tj=t=>{G(!0),N(e=>e.map((e,o)=>t==o?{...e,state:{...e.state,settingOpen:!0}}:{...e,state:{...e.state,settingOpen:!1}}))},tZ=t=>{G(!0),N(e=>e.filter((e,o)=>o!==t))},tv=(t,e,o)=>{N(n=>n.map((n,i)=>({...n,[t]:i===o?e:n[t],state:{...n.state}})))},tw=(t,e,o)=>{N(n=>n.map((n,i)=>({...n,state:{...n.state,[t]:i===o?e:n.state[t]}})))};(0,i.useEffect)(()=>{for(let t=0;t<H.length;t++){let e=H[t];e.state.moveToInput&&(ti.current[t].scrollIntoView({behavior:"smooth",block:"center"}),tw("moveToInput",!1,t))}},[H]);let tC=(0,i.useMemo)(()=>{if(!tt||0===H.length)return!1;let{state:t,...e}=H[0],{state:o,...n}=tt.site;return JSON.stringify(e)!==JSON.stringify(n)||U!==tt.showSmallWidget},[H,U,tt]),tk=()=>{tr.push({pathname:"/ai-widget"})},tS=async()=>{var o;if(!e){x.C.error(t("messages.error.noSiteId"));return}for(let e=0;e<H.length;e++){if(!(0,d.jv)(H[e].domain)){tj(e),tw("moveToInput",!0,e);return}let o=(0,d.d6)(H[e].widgetColor||"#170b28","#ffffff"),n=(0,d.d6)(H[e].triggerColor||"#170b28","#ffffff");if(!o||!n){tv("widgetColor",null,e),tv("triggerColor",null,e),x.C.error(t("widget.contrastValidationFailed"));return}}let n={...H[0],language:(null===(o=H[0])||void 0===o?void 0:o.language)||"us",widgetSize:U?"small":"large",buttonSize:H[0].buttonSize||"large",buttonLocation:H[0].buttonLocation||"bottom",buttonAdjustments:H[0].buttonAdjustments||{desktop:{},mobile:{}}};ts.mutate({siteId:e,siteData:n},{onSuccess:()=>{te({site:{...H[0]},showSmallWidget:U})}})},ty=async(e,o)=>{try{N(t=>t.map((t,n)=>n===o?{...t,buttonSize:e,widgetSize:U?"small":"large"}:t))}catch(e){console.error(t("messages.error.updateButtonSize"),e),x.C.error(t("messages.error.updateButtonSize"))}},tP=(e,o,i)=>{var r,s,l,a,x,g,m,C,y,B,F,O,M,N,J,G,tt,te,ti,tr,ts,tl,td,tf;let tj="dark"==th.palette.mode,tZ=(0,d.d6)(H[e].widgetColor||"#170b28","#ffffff"),tw=(0,d.d6)(H[e].triggerColor||"#170b28","#ffffff");(0,d.jv)(H[e].domain),H[e].state.domainTaken;let tC=_.M.find(t=>t.acronym==H[e].language)||_.M[0];return(0,n.jsxs)(L.Z,{sx:{p:["".concat(th.spacing(6)," !important"),"".concat(th.spacing(10)," !important")]},children:[V(t,H[e]),(0,n.jsx)(j.Z,{}),(0,n.jsxs)(S.ZP,{container:!0,spacing:1,sx:{...tn?{py:4,width:"100%",pr:{lg:0,xs:4}}:{}},children:[(0,n.jsxs)(S.ZP,{item:!0,xl:8,lg:12,md:12,xs:12,sx:{...tn?{px:4,my:{lg:0,xs:4}}:{}},children:[(0,n.jsx)(w.Z,{sx:{mb:6,mt:2},children:(0,n.jsx)(S.ZP,{item:!0,xs:12,md:12,children:(0,n.jsxs)(S.ZP,{container:!0,alignItems:"center",spacing:7,children:[(0,n.jsx)(S.ZP,{item:!0,xs:3,md:2,children:(0,n.jsx)(Z.Z,{variant:"subtitle1",children:t("widget.language")})}),(0,n.jsx)(S.ZP,{item:!0,xs:9,md:4,children:(0,n.jsx)(D.Z,{fullWidth:!0,children:(0,n.jsx)(E.Z,{value:tC,index:e,setLangFunction:tv})})}),(0,n.jsx)(S.ZP,{item:!0,xs:3,md:2,lg:2,xl:"it"===b.Z.language?2:1,children:(0,n.jsx)(Z.Z,{variant:"subtitle1",children:t("widget.platform")})}),(0,n.jsx)(S.ZP,{item:!0,xs:9,md:4,lg:4,xl:"it"===b.Z.language?4:5,children:(0,n.jsx)(w.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,n.jsx)(D.Z,{children:(0,n.jsx)(z.Z,{select:!0,native:"true",sx:{width:"270px"},SelectProps:{MenuProps:{PaperProps:{style:{maxHeight:300}}}},defaultValue:"Other",onChange:t=>{tv("platform",t.target.value,e)},children:c.Z.map((e,o)=>(0,n.jsx)(P.Z,{value:e,children:t("widget.platforms.".concat(e.toLowerCase().replace(/\s+/g,"")))},o))})})})})]})})}),(0,n.jsx)(j.Z,{}),(0,n.jsx)(w.Z,{sx:{mb:12,mt:12},children:(0,n.jsx)(Z.Z,{variant:"h5",sx:{fontWeight:700,lineHeight:"24px"},children:t("widget.widgetDesign")})}),(0,n.jsx)(q,{title:t("widget.widgetColor"),color:H[e].widgetColor||"#3B3F44",updateColor:t=>tv("widgetColor",t,e),contrastIssue:tZ,popoverId:tm,openPopUp:tu,anchorEl:v,handlePopupClose:tc,handlePopupOpen:ta,matchesMD:to,restoreDefault:()=>tv("widgetColor",null,e)}),(0,n.jsx)(w.Z,{sx:{position:"relative",mb:6,mt:5},children:(0,n.jsx)(h.Z,{sx:{backgroundColor:tj?"#373C55":"#ffffff",border:tj?"none":"1px solid rgb(213, 213, 213)",borderRadius:"10px",boxShadow:tj?"0 2px 4px rgba(0, 0, 0, 0.15)":"none"},children:(0,n.jsx)(L.Z,{children:(0,n.jsxs)(S.ZP,{container:!0,alignItems:"center",spacing:2,children:[(0,n.jsx)(S.ZP,{item:!0,xs:12,md:3,children:(0,n.jsx)(Z.Z,{variant:"subtitle1",children:t("widget.widgetSize")})}
1),(0,n.jsx)(S.ZP,{item:!0,xs:12,md:9,sx:{display:"flex",justifyContent:{xs:"center",md:"flex-end"}},children:(0,n.jsxs)(w.Z,{sx:{display:"inline-flex",borderRadius:100,border:"1px solid ".concat(th.palette.divider),backgroundColor:th.palette.background.paper,padding:"2px",position:"relative",overflow:"hidden"},children:[(0,n.jsx)(f.Z,{onClick:()=>X(!1),sx:{minWidth:100,padding:"6px 16px",borderRadius:100,textTransform:"none",fontWeight:500,fontSize:13,color:U?"text.primary":"white",backgroundColor:U?"transparent":tj?"#585B6D":"#3B3F44","&:hover":{backgroundColor:U?"transparent":tj?"#585B6D":"#3B3F44"}},children:t("widget.normal")}),(0,n.jsx)(f.Z,{onClick:()=>X(!0),sx:{minWidth:100,padding:"6px 16px",borderRadius:100,textTransform:"none",fontWeight:500,fontSize:13,color:U?"white":"text.primary",backgroundColor:U?tj?"#585B6D":"#3B3F44":"transparent","&:hover":{backgroundColor:U?tj?"#585B6D":"#3B3F44":"transparent"}},children:t("widget.small")})]})})]})})})}),(0,n.jsx)(w.Z,{sx:{mb:12,mt:12},children:(0,n.jsx)(Z.Z,{variant:"h5",sx:{fontWeight:700,lineHeight:"24px"},children:t("widget.triggerButton")})}),(0,n.jsx)(q,{title:t("widget.buttonColor"),color:H[e].triggerColor||"#3B3F44",updateColor:t=>tv("triggerColor",t,e),contrastIssue:tw,popoverId:tb,openPopUp:tp,anchorEl:k,handlePopupClose:tg,handlePopupOpen:tx,matchesMD:to,restoreDefault:()=>tv("triggerColor",null,e)}),(0,n.jsx)(w.Z,{sx:{position:"relative",mb:6,mt:5},children:(0,n.jsx)(h.Z,{sx:{backgroundColor:tj?"#373C55":"#ffffff",border:tj?"none":"1px solid rgb(213, 213, 213)",borderRadius:"10px",boxShadow:tj?"0 2px 4px rgba(0, 0, 0, 0.15)":"none"},children:(0,n.jsx)(L.Z,{children:(0,n.jsxs)(S.ZP,{container:!0,alignItems:"center",spacing:2,children:[(0,n.jsx)(S.ZP,{item:!0,xs:12,md:3,children:(0,n.jsx)(Z.Z,{variant:"subtitle1",children:t("widget.buttonSize")})}),(0,n.jsx)(S.ZP,{item:!0,xs:12,md:9,sx:{display:"flex",justifyContent:{xs:"center",md:"flex-end"}},children:(0,n.jsxs)(w.Z,{sx:{display:"inline-flex",borderRadius:100,border:"1px solid ".concat(th.palette.divider),backgroundColor:th.palette.background.paper,padding:"2px",position:"relative",overflow:"hidden"},children:[(0,n.jsx)(f.Z,{onClick:()=>ty("large",e),sx:{minWidth:100,padding:"6px 16px",borderRadius:100,textTransform:"none",fontWeight:500,fontSize:13,color:"large"===(H[e].buttonSize||"large")?"white":"text.primary",backgroundColor:"large"===(H[e].buttonSize||"large")?tj?"#585B6D":"#3B3F44":"transparent","&:hover":{backgroundColor:"large"===(H[e].buttonSize||"large")?tj?"#585B6D":"#3B3F44":"transparent"}},children:t("widget.normal")}),(0,n.jsx)(f.Z,{onClick:()=>ty("small",e),sx:{minWidth:100,padding:"6px 16px",borderRadius:100,textTransform:"none",fontWeight:500,fontSize:13,color:"small"===H[e].buttonSize?"white":"text.primary",backgroundColor:"small"===H[e].buttonSize?tj?"#585B6D":"#3B3F44":"transparent","&:hover":{backgroundColor:"small"===H[e].buttonSize?tj?"#585B6D":"#3B3F44":"transparent"}},children:t("widget.small")})]})})]})})})}),(0,n.jsx)(w.Z,{sx:{position:"relative",mb:6,mt:5},children:(0,n.jsx)(h.Z,{sx:{backgroundColor:tj?"#373C55":"#ffffff",border:tj?"none":"1px solid rgb(213, 213, 213)",borderRadius:"10px",boxShadow:"none"},children:(0,n.jsxs)(L.Z,{children:[(0,n.jsxs)(S.ZP,{container:!0,alignItems:"center",spacing:2,children:[(0,n.jsx)(S.ZP,{item:!0,xs:12,md:3,children:(0,n.jsx)(Z.Z,{variant:"subtitle1",children:t("widget.horizontalPosition")})}),(0,n.jsx)(S.ZP,{item:!0,xs:12,md:9,sx:{display:"flex",justifyContent:{xs:"center",md:"flex-end"}},children:(0,n.jsxs)(w.Z,{sx:{display:"inline-flex",borderRadius:100,border:"1px solid ".concat(th.palette.divider),backgroundColor:th.palette.background.paper,padding:"2px",position:"relative",overflow:"hidden"},children:[(0,n.jsx)(f.Z,{onClick:()=>{tv("widgetLocation","left",e),A("left");let t=H[e].buttonAdjustments||{},{right:o,...n}=t.desktop||{},{right:i,...r}=t.mobile||{};tv("buttonAdjustments",{...t,desktop:n,mobile:r},e)},sx:{minWidth:100,padding:"6px 16px",borderRadius:100,textTransform:"none",fontWeight:500,fontSize:13,color:"left"===H[e].widgetLocation?"white":"text.primary",backgroundColor:"left"
1===H[e].widgetLocation?tj?"#585B6D":"#3B3F44":"transparent","&:hover":{backgroundColor:"left"===H[e].widgetLocation?tj?"#585B6D":"#3B3F44":"transparent"}},children:t("widget.left")}),(0,n.jsx)(f.Z,{onClick:()=>{tv("widgetLocation","right",e),A("right");let t=H[e].buttonAdjustments||{},{left:o,...n}=t.desktop||{},{left:i,...r}=t.mobile||{};tv("buttonAdjustments",{...t,desktop:n,mobile:r},e)},sx:{minWidth:100,padding:"6px 16px",borderRadius:100,textTransform:"none",fontWeight:500,fontSize:13,color:"right"===H[e].widgetLocation?"white":"text.primary",backgroundColor:"right"===H[e].widgetLocation?tj?"#585B6D":"#3B3F44":"transparent","&:hover":{backgroundColor:"right"===H[e].widgetLocation?tj?"#585B6D":"#3B3F44":"transparent"}},children:t("widget.right")})]})})]}),(0,n.jsx)(p.Dq,{title:t("widget.horizontalPosition"),isExpanded:$,onToggle:K,desktopLabel:"left"===H[e].widgetLocation?t("widget.distanceFromLeft"):t("widget.distanceFromRight"),mobileLabel:"left"===H[e].widgetLocation?t("widget.distanceFromLeft"):t("widget.distanceFromRight"),desktopValue:"left"===H[e].widgetLocation?null===(r=H[e].buttonAdjustments)||void 0===r?void 0:null===(s=r.desktop)||void 0===s?void 0:s.left:null===(l=H[e].buttonAdjustments)||void 0===l?void 0:null===(a=l.desktop)||void 0===a?void 0:a.right,mobileValue:"left"===H[e].widgetLocation?null===(x=H[e].buttonAdjustments)||void 0===x?void 0:null===(g=x.mobile)||void 0===g?void 0:g.left:null===(m=H[e].buttonAdjustments)||void 0===m?void 0:null===(C=m.mobile)||void 0===C?void 0:C.right,onDesktopChange:t=>{let o="left"===H[e].widgetLocation,n=H[e].buttonAdjustments||{},{left:i,right:r,...s}=n.desktop||{};tv("buttonAdjustments",{...n,desktop:{...s,...o?{left:t}:{right:t}}},e)},onMobileChange:t=>{let o="left"===H[e].widgetLocation,n=H[e].buttonAdjustments||{},{left:i,right:r,...s}=n.mobile||{};tv("buttonAdjustments",{...n,mobile:{...s,...o?{left:t}:{right:t}}},e)},isDisabled:!1})]})})}),(0,n.jsx)(w.Z,{sx:{position:"relative",mb:6,mt:5},children:(0,n.jsx)(h.Z,{sx:{backgroundColor:tj?"#373C55":"#ffffff",border:tj?"none":"1px solid rgb(213, 213, 213)",borderRadius:"10px",boxShadow:"none"},children:(0,n.jsxs)(L.Z,{children:[(0,n.jsxs)(S.ZP,{container:!0,alignItems:"center",spacing:2,children:[(0,n.jsx)(S.ZP,{item:!0,xs:12,md:3,children:(0,n.jsx)(Z.Z,{variant:"subtitle1",children:t("widget.verticalPosition")})}),(0,n.jsx)(S.ZP,{item:!0,xs:12,md:9,sx:{display:"flex",justifyContent:{xs:"center",md:"flex-end"}},children:(0,n.jsxs)(w.Z,{sx:{display:"inline-flex",borderRadius:100,border:"1px solid ".concat(th.palette.divider),backgroundColor:th.palette.background.paper,padding:"2px",position:"relative",overflow:"hidden"},children:[(0,n.jsx)(f.Z,{onClick:()=>{tv("buttonLocation","bottom",e);let t=H[e].buttonAdjustments||{},{top:o,...n}=t.desktop||{},{top:i,...r}=t.mobile||{};tv("buttonAdjustments",{...t,desktop:n,mobile:r},e)},sx:{minWidth:100,padding:"6px 16px",borderRadius:100,textTransform:"none",fontWeight:500,fontSize:13,color:"bottom"===(H[e].buttonLocation||"bottom")?"white":"text.primary",backgroundColor:"bottom"===(H[e].buttonLocation||"bottom")?tj?"#585B6D":"#3B3F44":"transparent","&:hover":{backgroundColor:"bottom"===(H[e].buttonLocation||"bottom")?tj?"#585B6D":"#3B3F44":"transparent"}},children:t("widget.bottom")}),(0,n.jsx)(f.Z,{onClick:()=>{tv("buttonLocation","center",e);let t=H[e].buttonAdjustments||{},{top:o,bottom:n,...i}=t.desktop||{},{top:r,bottom:s,...l}=t.mobile||{};tv("buttonAdjustments",{...t,desktop:i,mobile:l},e)},sx:{minWidth:100,padding:"6px 16px",borderRadius:100,textTransform:"none",fontWeight:500,fontSize:13,color:"center"===H[e].buttonLocation?"white":"text.primary",backgroundColor:"center"===H[e].buttonLocation?tj?"#585B6D":"#3B3F44":"transparent","&:hover":{backgroundColor:"center"===H[e].buttonLocation?tj?"#585B6D":"#3B3F44":"transparent"}},children:t("widget.center")}),(0,n.jsx)(f.Z,{onClick:()=>{tv("buttonLocation","top",e);let t=H[e].buttonAdjustments||{},{bottom:o,...n}=t.desktop||{},{bottom:i,...r}=t.mobile||{};tv("buttonAdjustments",{...t,desktop:n,mobile:r},e)},sx:{minWidth:100,padding:"6px 16px",borderRadius:100,textTransform:"none",fontWeight:500,fontSize:13,color:"top"===H[e].buttonLocation?"white":"text.primary",backgroundColor:"top"===H[e].buttonLocation?tj?"#585B6D":"#3B3F44":"transparent","&:hover":{backgroundColor:"top"===H[e].buttonLocation?tj?"#585B6D":"#3B3F44":"transparent"}},children:t("widget.top")})]})})]}),(0,n.jsx)(p.Dq,{title:t("widget.verticalPosition"),isExpanded:Y,onToggle:Q,desktopLabel:"bottom"===(H[e].buttonLocation||"bottom")?t("widget.distanceFromBottom"):t("widget.distanceFromTop"),mobileLabel:"bottom"===(H[e].buttonLocation||"bottom")?t("widget.distanceFromBottom"):t("widget.distanceFromTop"),desktopValue:"bottom"===(H[e].buttonLocation||"bottom")?
1null===(y=H[e].buttonAdjustments)||void 0===y?void 0:null===(B=y.desktop)||void 0===B?void 0:B.bottom:null===(F=H[e].buttonAdjustments)||void 0===F?void 0:null===(O=F.desktop)||void 0===O?void 0:O.top,mobileValue:"bottom"===(H[e].buttonLocation||"bottom")?null===(M=H[e].buttonAdjustments)||void 0===M?void 0:null===(N=M.mobile)||void 0===N?void 0:N.bottom:null===(J=H[e].buttonAdjustments)||void 0===J?void 0:null===(G=J.mobile)||void 0===G?void 0:G.top,onDesktopChange:t=>{let o="bottom"===(H[e].buttonLocation||"bottom"),n=H[e].buttonAdjustments||{},{top:i,bottom:r,...s}=n.desktop||{};tv("buttonAdjustments",{...n,desktop:{...s,...o?{bottom:t}:{top:t}}},e)},onMobileChange:t=>{let o="bottom"===(H[e].buttonLocation||"bottom"),n=H[e].buttonAdjustments||{},{top:i,bottom:r,...s}=n.mobile||{};tv("buttonAdjustments",{...n,mobile:{...s,...o?{bottom:t}:{top:t}}},e)},isDisabled:"center"===H[e].buttonLocation})]})})}),(0,n.jsx)(w.Z,{sx:{position:"relative",mb:6,mt:5},children:(0,n.jsx)(h.Z,{sx:{backgroundColor:tj?"#373C55":"#ffffff",border:tj?"none":"1px solid rgb(213, 213, 213)",borderRadius:"10px",boxShadow:tj?"0 2px 4px rgba(0, 0, 0, 0.15)":"none"},children:(0,n.jsx)(L.Z,{children:(0,n.jsxs)(S.ZP,{container:!0,alignItems:"center",spacing:2,children:[(0,n.jsx)(S.ZP,{item:!0,xs:12,md:3,children:(0,n.jsx)(Z.Z,{variant:"subtitle1",children:t("widget.icon")})}),(0,n.jsx)(S.ZP,{item:!0,xs:12,md:9,sx:{display:"flex",justifyContent:"flex-end"},children:(0,n.jsx)(I.Z,{value:H[e].triggerIcon,index:e,setSelectedIcon:(t,e,o)=>tv(t,e,o),translations:{person1:t("widget.icons.person1"),person2:t("widget.icons.person2"),person3:t("widget.icons.person3"),person4:t("widget.icons.person4")}})})]})})})})]}),(0,n.jsxs)(S.ZP,{item:!0,xl:4,lg:12,md:12,xs:12,sx:{px:4,my:{lg:0,xs:4}},children:[(0,n.jsxs)(S.ZP,{container:!0,children:[(0,n.jsx)(S.ZP,{item:!0,xs:12,children:(0,n.jsx)(w.Z,{sx:{mb:7,mt:2,ml:6,textAlign:{xs:"center",lg:"center",xl:"left"}},children:(0,n.jsx)(Z.Z,{variant:"h5",sx:{fontWeight:700,lineHeight:"24px"},children:t("widget.widgetPreview")})})}),(0,n.jsx)(S.ZP,{item:!0,xs:12,children:(0,n.jsx)(w.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",paddingLeft:"0rem",paddingRight:"1rem",ml:-1,mt:o?-20:-5},children:U?(0,n.jsx)(w.Z,{sx:{mt:{xs:15,md:10,lg:6},mr:{xs:1,lg:10},ml:{xs:10,lg:20,xl:10}},children:(0,n.jsx)(u.Z,{color:H[e].widgetColor})}):(0,n.jsx)(w.Z,{sx:{ml:{xs:10,lg:10,xl:0}},children:(0,n.jsx)(W.Z,{color:H[e].widgetColor,size:o?300:330})})})})]}),(0,n.jsxs)(S.ZP,{container:!0,children:[(0,n.jsx)(S.ZP,{item:!0,xs:12,sx:{mt:10,ml:6},children:(0,n.jsx)(w.Z,{sx:{textAlign:{xs:"center",lg:"center",xl:"left"}},children:(0,n.jsx)(Z.Z,{variant:"h5",sx:{fontWeight:700,lineHeight:"24px"},children:t("widget.triggerButtonPreview")})})}),(0,n.jsx)(S.ZP,{item:!0,xs:12,children:(0,n.jsx)(w.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",paddingLeft:"0rem",paddingRight:"1rem",ml:o?1:-1,mt:o?10:7},children:(0,n.jsxs)(w.Z,{sx:{position:"relative",width:335,height:210},children:[(0,n.jsx)(w.Z,{sx:{position:"absolute",inset:0},children:(0,n.jsx)(T.Z,{width:335,height:210,triggerColor:H[e].triggerColor||"#3B3F44"})}),(0,n.jsx)(w.Z,{sx:{position:"absolute",..."right"===H[e].widgetLocation?{right:5+(((null===(tt=H[e].buttonAdjustments)||void 0===tt?void 0:null===(te=tt.desktop)||void 0===te?void 0:te.right)||24)-24)}:{left:5+(((null===(ti=H[e].buttonAdjustments)||void 0===ti?void 0:null===(tr=ti.desktop)||void 0===tr?void 0:tr.left)||24)-24)},..."bottom"===(H[e].buttonLocation||"bottom")?{bottom:10+(((null===(ts=H[e].buttonAdjustments)||void 0===ts?void 0:null===(tl=ts.desktop)||void 0===tl?void 0:tl.bottom)||24)-24)}:"center"===H[e].buttonLocation?{top:"50%",transform:"translateY(-50%)"}:{top:40+(((null===(td=H[e].buttonAdjustments)||void 0===td?void 0:null===(tf=td.desktop)||void 0===tf?void 0:tf.top)||24)-24)},zIndex:1,transition:"all 0.2s ease-in-out"},children:(0,n.jsx)(R.Z,{selected:H[e].triggerIcon,triggerHex:H[e].triggerColor||"#3B3F44",size:H[e].buttonSize||"large",previewSize:36})})]})})})]})]})]})]})};return!e||td.isLoading?(0,n.jsx)("div",{children:t("common.loading")}):td.isError?(0,n.jsxs)("div",{children:[t("common.error"),": ",td.error.message]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w.Z,{sx:{mb:2},children:(0,n.jsx)("img",{src:tf?"/images/pages/edit-widget-mobile.png":"/images/pages/edit-widget.png",alt:t("widget.editSite"),style:{width:"100%",height:"auto",objectFit:"contain"}})}),(0,n.jsx)(a.Z,{addedSites:H,siteSettings:tP,deletedSite:J,addSiteTitle:V,isValidUrl:d.jv,openCloseSiteSetting:tj,deleteSite:tZ,triggerColorId:tb}),(0,n.jsx)(w.Z,{sx:{mt:12},children:(0,n.jsxs)(S.ZP,{container:!0,justifyContent:"flex-end",alignItems:"center",spacing:2,children:[(0,n.jsx)(S.ZP,{item:!0,children:(0,n.jsx)(f.Z,{onClick:tk,color:"primary",variant:"contained",children:t("common.exit")})}),(0,n.jsx)(S.ZP,{item:!0,children:(0,n.jsx)(f.Z,{onClick:tS,color:"primary",variant:"contained",disabled:ts.isLoading||!tC,sx:{"&.Mui-disabled":{opacity:.5}},children:ts.isLoading?t("common.loading"):t("common.save")})})]})})]})};e.default=H},26632:function(t,e,o){"use strict";o.d(e,{Z:function(){return n}});let n=["Other","BigCommerce","Drupal","Duda","Elementor","Google Tag Manager","HTML","HubSpot","Joomla","Magento","Moodle","PrestaShop","Shopify","Squarespace","Tilda","Webflow","Weebly","Wix","WordPress"]}},function(t){t.O(0,[6886,5434,3362,3463,8096,8120,9774,2888,179],function(){return t(t.s=96380)}),_N_E=t.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.