"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[1361,800,2489],{10800:(e,t,a)=>{a.r(t),a.d(t,{default:()=>_});var r=a(86087),c=a(58168),n=a(51609),l=a(9957),o=a(91071),u=a(62133),s=a(81351),d=a(85357),i=a(31769),p=a(12579);const m="Switch",[h,b]=(0,u.A)(m),[f,v]=h(m),g=(0,n.forwardRef)(((e,t)=>{const{__scopeSwitch:a,name:r,checked:u,defaultChecked:d,required:i,disabled:m,value:h="on",onCheckedChange:b,...v}=e,[g,w]=(0,n.useState)(null),C=(0,o.s)(t,(e=>w(e))),z=(0,n.useRef)(!1),_=!g||Boolean(g.closest("form")),[x=!1,y]=(0,s.i)({prop:u,defaultProp:d,onChange:b});return(0,n.createElement)(f,{scope:a,checked:x,disabled:m},(0,n.createElement)(p.sG.button,(0,c.A)({type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":E(x),"data-disabled":m?"":void 0,disabled:m,value:h},v,{ref:C,onClick:(0,l.m)(e.onClick,(e=>{y((e=>!e)),_&&(z.current=e.isPropagationStopped(),z.current||e.stopPropagation())}))})),_&&(0,n.createElement)(k,{control:g,bubbles:!z.current,name:r,value:h,checked:x,required:i,disabled:m,style:{transform:"translateX(-100%)"}}))})),k=e=>{const{control:t,checked:a,bubbles:r=!0,...l}=e,o=(0,n.useRef)(null),u=(0,d.Z)(a),s=(0,i.X)(t);return(0,n.useEffect)((()=>{const e=o.current,t=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==a&&c){const t=new Event("click",{bubbles:r});c.call(e,a),e.dispatchEvent(t)}}),[u,a,r]),(0,n.createElement)("input",(0,c.A)({type:"checkbox","aria-hidden":!0,defaultChecked:a},l,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function E(e){return e?"checked":"unchecked"}const w=g,C=(0,n.forwardRef)(((e,t)=>{const{__scopeSwitch:a,...r}=e,l=v("SwitchThumb",a);return(0,n.createElement)(p.sG.span,(0,c.A)({"data-state":E(l.checked),"data-disabled":l.disabled?"":void 0},r,{ref:t}))}));var z=a(4219);const _=(0,r.memo)((({value:e,onChange:t,required:a,disabled:c,className:n,label:l,id:o})=>{const{getField:u}=(0,z.default)();let s=e;return"0"!==e&&"1"!==e||(s="1"===e),(0,r.createElement)("div",{className:"cmplz-input-group cmplz-switch-group"},(0,r.createElement)(w,{className:"cmplz-switch-root "+n,checked:s,onCheckedChange:e=>{"banner"===u(o).data_target&&(e=e?"1":"0"),t(e)},disabled:c,required:a},(0,r.createElement)(C,{className:"cmplz-switch-thumb"})))}))},32489:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});var r=a(86087),c=a(51609);const n=(0,c.memo)((({value:e,onChange:t,required:a,disabled:n,id:l,name:o,placeholder:u})=>{const s=l||o,[d,i]=(0,c.useState)("");return(0,c.useEffect)((()=>{i(e||"")}),[e]),(0,c.useEffect)((()=>{if(e===d)return;const a=setTimeout((()=>{t(d)}),400);return()=>{clearTimeout(a)}}),[d]),(0,r.createElement)("div",{className:"cmplz-input-group cmplz-text-input-group"},(0,r.createElement)("input",{type:"text",id:s,name:o,value:d,onChange:e=>(e=>{i(e)})(e.target.value),required:a,disabled:n,className:"cmplz-text-input-group__input",placeholder:u}))}))},51361:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var r=a(86087),c=a(32489),n=a(10800),l=a(27723),o=a(51609);const u=(0,o.memo)((({label:e,value:t,onChange:a,placeholder:u=""})=>{const[s,d]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{t.show?d(!1):d(!0)}),[t]),(0,r.createElement)("div",{className:"cmplz-text-checkbox-input"},(0,r.createElement)(c.default,{value:t.text,onChange:e=>{let r={...t};r.text=e,a(r)},placeholder:u,disabled:s}),(0,r.createElement)(n.default,{label:(0,l.__)("Show","complianz-gdpr"),value:t.show,onChange:e=>{let r={...t};r.show=e,a(r)}}))}))},85357:(e,t,a)=>{a.d(t,{Z:()=>c});var r=a(51609);function c(e){const t=(0,r.useRef)({value:e,previous:e});return(0,r.useMemo)((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}}}]);