"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(51609),c=a(86087),n=a(58168),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,r.forwardRef)(((e,t)=>{const{__scopeSwitch:a,name:c,checked:u,defaultChecked:d,required:i,disabled:m,value:h="on",onCheckedChange:b,...v}=e,[g,w]=(0,r.useState)(null),C=(0,o.s)(t,(e=>w(e))),z=(0,r.useRef)(!1),_=!g||Boolean(g.closest("form")),[x=!1,y]=(0,s.i)({prop:u,defaultProp:d,onChange:b});return(0,r.createElement)(f,{scope:a,checked:x,disabled:m},(0,r.createElement)(p.sG.button,(0,n.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,r.createElement)(k,{control:g,bubbles:!z.current,name:c,value:h,checked:x,required:i,disabled:m,style:{transform:"translateX(-100%)"}}))})),k=e=>{const{control:t,checked:a,bubbles:c=!0,...l}=e,o=(0,r.useRef)(null),u=(0,d.Z)(a),s=(0,i.X)(t);return(0,r.useEffect)((()=>{const e=o.current,t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==a&&r){const t=new Event("click",{bubbles:c});r.call(e,a),e.dispatchEvent(t)}}),[u,a,c]),(0,r.createElement)("input",(0,n.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,r.forwardRef)(((e,t)=>{const{__scopeSwitch:a,...c}=e,l=v("SwitchThumb",a);return(0,r.createElement)(p.sG.span,(0,n.A)({"data-state":E(l.checked),"data-disabled":l.disabled?"":void 0},c,{ref:t}))}));var z=a(4219);const _=(0,c.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:()=>c});var r=a(51609);const c=(0,r.memo)((({value:e,onChange:t,required:a,disabled:c,id:n,name:l,placeholder:o})=>{const u=n||l,[s,d]=(0,r.useState)("");return(0,r.useEffect)((()=>{d(e||"")}),[e]),(0,r.useEffect)((()=>{if(e===s)return;const a=setTimeout((()=>{t(s)}),400);return()=>{clearTimeout(a)}}),[s]),(0,r.createElement)("div",{className:"cmplz-input-group cmplz-text-input-group"},(0,r.createElement)("input",{type:"text",id:u,name:l,value:s,onChange:e=>(e=>{d(e)})(e.target.value),required:a,disabled:c,className:"cmplz-text-input-group__input",placeholder:o}))}))},51361:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var r=a(51609),c=a(32489),n=a(10800),l=a(27723);const o=(0,r.memo)((({label:e,value:t,onChange:a,placeholder:o=""})=>{const[u,s]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t.show?s(!1):s(!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:o,disabled:u}),(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])}}}]);