/home/awneajlw/faizastore.com/wp-content/plugins/popup-builder-block/build/789.js
"use strict";(globalThis.webpackChunkpopup_builder_block=globalThis.webpackChunkpopup_builder_block||[]).push([[789],{8789:(e,o,l)=>{l.r(o),l.d(o,{default:()=>c});var n=l(7723),i=l(6087),a=l(7143),r=l(6427),t=l(5573),p=l(790);const s=(0,p.jsx)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,p.jsx)(t.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),b=(0,p.jsx)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,p.jsx)(t.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),u=(0,p.jsx)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,p.jsx)(t.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})}),c=(0,i.memo)(({attributes:e,setAttributes:o,device:l,clientId:t})=>{const{GkitBoxShadow:c,GkitColor:d,GkitPanelBody:h,GkitResponsive:k,GkitSwitcher:_,GkitTabs:x,GkitTypography:m,GkitBackgrounGroup:v,GkitChoose:C,GkitAdvancedUrl:g,GkitRangeUnit:j,GkitText:w,GkitIconPicker:B,GkitBoxControl:S,GkitBorderControl:G,GkitSelect:y,GkitRepeater:H,GkitNumber:P}=window.popupBuilderBlock.components,{gkitResponsiveValue:f,useFontFamilyinBlock:V,responsiveHelper:A,boxControlUnit:I,useHasProActive:F}=window.popupBuilderBlock.helpers,T=F({windowVariable:"popupBuilderBlock",hookName:"pbb.is-pro-active",cookieName:"isPopupkitValid",apiPath:"pbb"});V([e?.typography]);const{clickEvents:N,stepOptions:R}=(0,i.useMemo)(()=>{let e=[{label:(0,n.__)("None","popup-builder-block"),value:"none"},{label:(0,n.__)("Open URL","popup-builder-block"),value:"openUrl"},{label:(0,n.__)("Close Current Campaign","popup-builder-block"),value:"closeCampaign"},{label:(0,n.__)("Download File","popup-builder-block"),value:"downloadFile"},{label:T?(0,n.__)("Cookie Consent","popup-builder-block"):(0,n.__)("Cookie Consent (Pro)","popup-builder-block"),value:"cookieConsent",disabled:!T}],o=[];const l=(0,a.select)("core/block-editor").getBlockParentsByBlockName(t,"popup-builder-block/steps");if(l.length>0){const i=(0,a.select)("core/block-editor").getBlockAttributes(l[0]);o=i?.steps.map((e,o)=>({label:e.title||"",value:o}))||[],e=[...e,{label:(0,n.__)("Go to a Step","popup-builder-block"),value:"step"}]}return{clickEvents:e,stepOptions:o}},[t]);return(0,p.jsx)(x,{type:"top-level",tabs:[{name:"content",title:(0,n.__)("Content","popup-builder-block")},{name:"style",title:(0,n.__)("Style","popup-builder-block")}],children:i=>"content"===i.name?(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)(h,{title:(0,n.__)("Content","popup-builder-block"),initialOpen:!0,children:[(0,p.jsx)(y,{label:(0,n.__)("Click Events","popup-builder-block"),value:e?.onClickAction,options:N,onChange:e=>{const l={onClickAction:e};if("closeCampaign"===e){const e=(0,a.select)("core/editor").getCurrentPostId();l.closeCampaign={value:e}}o(l)}}),"cookieConsent"===e?.onClickAction&&(0,p.jsx)("p",{className:"components-base-control__help",children:(0,n.__)("Campaign will be closed if the user consents to cookies.","popup-builder-block")}),("openUrl"===e?.onClickAction||"downloadFile"===e?.onClickAction)&&(0,p.jsx)(g,{isSupportDynamicContent:!1,value:e?.url,onChange:e=>o({url:e}),isSettingsDisable:"downloadFile"===e?.onClickAction}),"step"===e?.onClickAction&&(0,p.jsx)(y,{label:(0,n.__)("Select Step","popup-builder-block"),value:e?.step,onChange:e=>o({step:e}),options:R}),"cookieConsent"===e.onClickAction&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r.__experimentalHeading,{children:(0,n.__)("Set Cookies","popup-builder-block")}),(0,p.jsxs)(H,{onChange:e=>{o({cookies:e})},itemLabelName:"name",repeaterFields:e.cookies,isClone:!0,buttonLabel:(0,n.__)("Add Cookies","popup-builder-block"),children:[(0,p.jsx)(w,{name:"name",label:(0,n.__)("Cookie Name","popup-builder-block"),placeholder:(0,n.__)("Enter Cookie Name","popup-builder-block"),labelBlock:"block"}),(0,p.jsx)(w,{name:"value",label:(0,n.__)("Cookie Value","popup-builder-block"),placeholder:(0,n.__)("Enter Cookie Value","popup-builder-block"),labelBlock:"block"}),(0,p.jsx)(P,{name:"expires",label:(0,n.__)("Cookie Expires (in days)","popup-builder-block"),placeholder:(0,n.__)("Enter Cookie Expires","popup-builder-block"),default:365,min:1,max:3650})]}),(0,p.jsx)(r.__experimentalDivider,{})]}),(0,p.jsx)(_,{label:(0,n.__)("Track Conversion","popup-builder-block"),value:e?.istrackConversion,onChange:e=>o({istrackConversion:e}),help:(0,n.__)("Enable to track conversions when the button is clicked.","popup-builder-block")}),(0,p.jsx)(r.__experimentalDivider,{}),(0,p.jsx)(_,{label:(0,n.__)("Add Icon","popup-builder-block"),value:e?.iconsSwitch,onChange:e=>o({iconsSwitch:e})}),e?.iconsSwitch&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(B,{apiPath:"pbb",label:(0,n.__)("Icon","popup-builder-block"),value:e.buttonIcon,onChange:e=>o({buttonIcon:e})}),(0,p.jsx)(y,{label:(0,n.__)("Button Position","popup-builder-block"),value:e.iconPosition,onChange:e=>o({iconPosition:e}),options:[{value:"before",label:"Before"},{value:"after",label:"After"}]}),(0,p.jsx)(j,{label:(0,n.__)("Between Space","popup-builder-block"),value:e.betweenSpace,onChange:e=>o({betweenSpace:e}),units:{px:{min:0,max:100,step:1},rem:{min:0,max:10,step:.1},em:{min:0,max:10,step:.1}}})]}),(0,p.jsx)(k,{children:(0,p.jsx)(C,{label:(0,n.__)("Alignment","popup-builder-block"),options:[{label:(0,n.__)("Left","popup-builder-block"),value:"left",icon:s},{label:(0,n.__)("Center","popup-builder-block"),value:"center",icon:b},{label:(0,n.__)("Right","popup-builder-block"),value:"right",icon:u}],value:f(e,"align",l),onChange:e=>A("align",e,l,o)})})]})}):"style"===i.name?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(h,{title:(0,n.__)("Button","popup-builder-block"),initialOpen:!0,children:[(0,p.jsx)(k,{children:(0,p.jsx)(j,{label:(0,n.__)("Width","popup-builder-block"),value:f(e,"width",l),onChange:e=>A("width",e,l,o),units:{px:{min:0,max:500,step:1},"%":{min:0,max:100,step:1}}})}),(0,p.jsx)(k,{children:(0,p.jsx)(S,{label:(0,n.__)("Padding","popup-builder-block"),values:f(e,"textPadding",l),onChange:e=>A("textPadding",e,l,o)})}),(0,p.jsx)(k,{children:(0,p.jsx)(S,{label:(0,n.__)("Margin","popup-builder-block"),values:f(e,"btnMargin",l),onChange:e=>A("btnMargin",e,l,o)})}),(0,p.jsx)(m,{label:(0,n.__)("Typography","popup-builder-block"),value:e?.typography,onChange:e=>o({typography:e})}),(0,p.jsx)(c,{label:(0,n.__)("Text Shadow","popup-builder-block"),value:e?.shadow,selectedType:"text",onChange:e=>o({shadow:e}),exclude:{spread:!0,position:!0}}),e?.iconsSwitch&&(0,p.jsx)(k,{children:(0,p.jsx)(j,{label:(0,n.__)("Icon Size","popup-builder-block"),value:f(e,"buttonIconSize",l),onChange:e=>A("buttonIconSize",e,l,o),units:{px:{min:0,max:100,step:1},rem:{min:0,max:10,step:.1},em:{min:0,max:10,step:.1}}})}),(0,p.jsx)(x,{type:"normal",tabs:[{name:"normal-tab",title:(0,n.__)("Normal","popup-builder-block")},{name:"hover-tab",title:(0,n.__)("Hover","popup-builder-block")}],children:l=>"normal-tab"===l.name?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(d,{label:(0,n.__)("Color","popup-builder-block"),onChange:e=>o({textColor:e}),value:e?.textColor}),(0,p.jsx)(v,{onChange:e=>o({bgColor:e}),value:e?.bgColor,exclude:{video:!0,image:!0}}),e?.iconsSwitch&&(0,p.jsx)(d,{label:(0,n.__)("Icon Color","popup-builder-block"),value:e.buttonIconColor,onChange:e=>o({buttonIconColor:e})})]}):"hover-tab"===l.name?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(d,{label:(0,n.__)("Color","popup-builder-block"),onChange:e=>o({hoverColor:e}),value:e?.hoverColor}),(0,p.jsx)(v,{onChange:e=>o({bgHoverColor:e}),value:e?.bgHoverColor,exclude:{video:!0,image:!0}}),e?.iconsSwitch&&(0,p.jsx)(d,{label:(0,n.__)("Icon Color","popup-builder-block"),value:e.buttonHoverIconColor,onChange:e=>o({buttonHoverIconColor:e})}),(0,p.jsx)(j,{label:(0,n.__)("Transform Y","popup-builder-block"),value:e?.backgroundHoverTransformY,onChange:e=>o({backgroundHoverTransformY:e}),units:{px:{min:-50,max:100,step:1}}}),(0,p.jsx)(j,{label:(0,n.__)("Transform X","popup-builder-block"),value:e?.backgroundHoverTransformX,onChange:e=>o({backgroundHoverTransformX:e}),units:{px:{min:-50,max:100,step:1}}})]}):void 0})]}),(0,p.jsx)(h,{title:(0,n.__)("Border","popup-builder-block"),children:(0,p.jsx)(x,{type:"normal",tabs:[{name:"normal-tab",title:(0,n.__)("Normal","popup-builder-block")},{name:"hover-tab",title:(0,n.__)("Hover","popup-builder-block")}],children:i=>"normal-tab"===i.name?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(k,{children:(0,p.jsx)(G,{label:(0,n.__)("Border","popup-builder-block"),value:f(e,"border",l),onChange:e=>A("border",e,l,o)})}),(0,p.jsx)(k,{children:(0,p.jsx)(S,{label:(0,n.__)("Border Radius","popup-builder-block"),units:I,values:f(e,"borderRadius",l),onChange:e=>A("borderRadius",e,l,o)})})]}):"hover-tab"===i.name?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(k,{children:(0,p.jsx)(G,{label:(0,n.__)("Border","popup-builder-block"),value:f(e,"hoverBorder",l),onChange:e=>A("hoverBorder",e,l,o)})}),(0,p.jsx)(k,{children:(0,p.jsx)(S,{label:(0,n.__)("Border Radius","popup-builder-block"),units:I,values:f(e,"hoverBorderRadius",l),onChange:e=>A("hoverBorderRadius",e,l,o)})})]}):void 0})}),(0,p.jsx)(h,{title:(0,n.__)("Shadow","popup-builder-block"),children:(0,p.jsx)(x,{type:"normal",tabs:[{name:"shadow-normal-tab",title:(0,n.__)("Normal","popup-builder-block")},{name:"shadow-hover-tab",title:(0,n.__)("Hover","popup-builder-block")}],children:l=>"shadow-normal-tab"===l.name?(0,p.jsx)(c,{value:e?.boxShadowGroup,onChange:e=>o({boxShadowGroup:e})}):"shadow-hover-tab"===l.name?(0,p.jsx)(c,{value:e?.boxShadowGroupHover,onChange:e=>o({boxShadowGroupHover:e})}):void 0})})]}):void 0})})}}]);