(function(){"use strict";var Ii,Fi,Bi;var Ls={exports:{}},hr={},Ps={exports:{}},xe={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ao;function ku(){if(Ao)return xe;Ao=1;var o=Symbol.for("react.element"),i=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),m=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),S=Symbol.iterator;function L(k){return k===null||typeof k!="object"?null:(k=S&&k[S]||k["@@iterator"],typeof k=="function"?k:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,P={};function N(k,M,de){this.props=k,this.context=M,this.refs=P,this.updater=de||z}N.prototype.isReactComponent={},N.prototype.setState=function(k,M){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,M,"setState")},N.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function D(){}D.prototype=N.prototype;function I(k,M,de){this.props=k,this.context=M,this.refs=P,this.updater=de||z}var A=I.prototype=new D;A.constructor=I,C(A,N.prototype),A.isPureReactComponent=!0;var W=Array.isArray,$=Object.prototype.hasOwnProperty,O={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function Q(k,M,de){var he,oe={},fe=null,Y=null;if(M!=null)for(he in M.ref!==void 0&&(Y=M.ref),M.key!==void 0&&(fe=""+M.key),M)$.call(M,he)&&!K.hasOwnProperty(he)&&(oe[he]=M[he]);var ve=arguments.length-2;if(ve===1)oe.children=de;else if(1>>1,M=V[k];if(0>>1;kd(oe,q))fed(Y,oe)?(V[k]=Y,V[fe]=q,k=fe):(V[k]=oe,V[he]=q,k=he);else if(fed(Y,q))V[k]=Y,V[fe]=q,k=fe;else break e}}return ae}function d(V,ae){var q=V.sortIndex-ae.sortIndex;return q!==0?q:V.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var g=performance;o.unstable_now=function(){return g.now()}}else{var m=Date,f=m.now();o.unstable_now=function(){return m.now()-f}}var v=[],w=[],x=1,S=null,L=3,z=!1,C=!1,P=!1,N=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(V){for(var ae=c(w);ae!==null;){if(ae.callback===null)p(w);else if(ae.startTime<=V)p(w),ae.sortIndex=ae.expirationTime,i(v,ae);else break;ae=c(w)}}function W(V){if(P=!1,A(V),!C)if(c(v)!==null)C=!0,ge($);else{var ae=c(w);ae!==null&&_e(W,ae.startTime-V)}}function $(V,ae){C=!1,P&&(P=!1,D(Q),Q=-1),z=!0;var q=L;try{for(A(ae),S=c(v);S!==null&&(!(S.expirationTime>ae)||V&&!J());){var k=S.callback;if(typeof k=="function"){S.callback=null,L=S.priorityLevel;var M=k(S.expirationTime<=ae);ae=o.unstable_now(),typeof M=="function"?S.callback=M:S===c(v)&&p(v),A(ae)}else p(v);S=c(v)}if(S!==null)var de=!0;else{var he=c(w);he!==null&&_e(W,he.startTime-ae),de=!1}return de}finally{S=null,L=q,z=!1}}var O=!1,K=null,Q=-1,Z=5,T=-1;function J(){return!(o.unstable_now()-TV||125k?(V.sortIndex=q,i(w,V),c(v)===null&&V===c(w)&&(P?(D(Q),Q=-1):P=!0,_e(W,q-k))):(V.sortIndex=M,i(v,V),C||z||(C=!0,ge($))),V},o.unstable_shouldYield=J,o.unstable_wrapCallback=function(V){var ae=L;return function(){var q=L;L=ae;try{return V.apply(this,arguments)}finally{L=q}}}})(Rs)),Rs}var Oo;function bu(){return Oo||(Oo=1,Ts.exports=Cu()),Ts.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Uo;function Lu(){if(Uo)return tn;Uo=1;var o=Es(),i=bu();function c(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,w=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,x={},S={};function L(e){return v.call(S,e)?!0:v.call(x,e)?!1:w.test(e)?S[e]=!0:(x[e]=!0,!1)}function z(e,n,r,l){if(r!==null&&r.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,n,r,l){if(n===null||typeof n>"u"||z(e,n,r,l))return!0;if(l)return!1;if(r!==null)switch(r.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function P(e,n,r,l,s,a,u){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=n,this.sanitizeURL=a,this.removeEmptyString=u}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new P(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];N[n]=new P(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new P(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new P(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){N[e]=new P(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new P(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new P(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new P(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new P(e,5,!1,e.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function I(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(D,I);N[n]=new P(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(D,I);N[n]=new P(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(D,I);N[n]=new P(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new P(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new P("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new P(e,1,!1,e.toLowerCase(),null,!0,!0)});function A(e,n,r,l){var s=N.hasOwnProperty(n)?N[n]:null;(s!==null?s.type!==0:l||!(2h||s[u]!==a[h]){var y=` `+s[u].replace(" at new "," at ");return e.displayName&&y.includes("")&&(y=y.replace("",e.displayName)),y}while(1<=u&&0<=h);break}}}finally{de=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?M(e):""}function oe(e){switch(e.tag){case 5:return M(e.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return e=he(e.type,!1),e;case 11:return e=he(e.type.render,!1),e;case 1:return e=he(e.type,!0),e;default:return""}}function fe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case O:return"Portal";case Z:return"Profiler";case Q:return"StrictMode";case te:return"Suspense";case ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case J:return(e.displayName||"Context")+".Consumer";case T:return(e._context.displayName||"Context")+".Provider";case me:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ie:return n=e.displayName||null,n!==null?n:fe(e.type)||"Memo";case ge:n=e._payload,e=e._init;try{return fe(e(n))}catch{}}return null}function Y(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(n);case 8:return n===Q?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function ve(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function je(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Je(e){var n=je(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,a=r.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return s.call(this)},set:function(u){l=""+u,a.call(this,u)}}),Object.defineProperty(e,n,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(u){l=""+u},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Dn(e){e._valueTracker||(e._valueTracker=Je(e))}function vl(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),l="";return e&&(l=je(e)?e.checked?"true":"false":e.value),e=l,e!==r?(n.setValue(e),!0):!1}function kn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _r(e,n){var r=n.checked;return q({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function yl(e,n){var r=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;r=ve(n.value!=null?n.value:r),e._wrapperState={initialChecked:l,initialValue:r,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function xr(e,n){n=n.checked,n!=null&&A(e,"checked",n,!1)}function Ft(e,n){xr(e,n);var r=ve(n.value),l=n.type;if(r!=null)l==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Bt(e,n.type,r):n.hasOwnProperty("defaultValue")&&Bt(e,n.type,ve(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function jr(e,n,r){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,r||n===e.value||(e.value=n),e.defaultValue=n}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Bt(e,n,r){(n!=="number"||kn(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var jt=Array.isArray;function Qn(e,n,r,l){if(e=e.options,n){n={};for(var s=0;s"+n.valueOf().toString()+"",n=wt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function qn(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var Zn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_l=["Webkit","ms","Moz","O"];Object.keys(Zn).forEach(function(e){_l.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Zn[n]=Zn[e]})});function Sr(e,n,r){return n==null||typeof n=="boolean"||n===""?"":r||typeof n!="number"||n===0||Zn.hasOwnProperty(e)&&Zn[e]?(""+n).trim():n+"px"}function Cr(e,n){e=e.style;for(var r in n)if(n.hasOwnProperty(r)){var l=r.indexOf("--")===0,s=Sr(r,n[r],l);r==="float"&&(r="cssFloat"),l?e.setProperty(r,s):e[r]=s}}var xl=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $t(e,n){if(n){if(xl[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(c(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(c(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(c(61))}if(n.style!=null&&typeof n.style!="object")throw Error(c(62))}}function Wt(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Te=null;function Ys(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qs=null,Gt=null,Ht=null;function Oi(e){if(e=Qr(e)){if(typeof qs!="function")throw Error(c(280));var n=e.stateNode;n&&(n=Wl(n),qs(e.stateNode,e.type,n))}}function Ui(e){Gt?Ht?Ht.push(e):Ht=[e]:Gt=e}function $i(){if(Gt){var e=Gt,n=Ht;if(Ht=Gt=null,Oi(e),n)for(e=0;e>>=0,e===0?32:31-(t3(e)/r3|0)|0}var Sl=64,Cl=4194304;function Er(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function bl(e,n){var r=e.pendingLanes;if(r===0)return 0;var l=0,s=e.suspendedLanes,a=e.pingedLanes,u=r&268435455;if(u!==0){var h=u&~s;h!==0?l=Er(h):(a&=u,a!==0&&(l=Er(a)))}else u=r&~s,u!==0?l=Er(u):a!==0&&(l=Er(a));if(l===0)return 0;if(n!==0&&n!==l&&(n&s)===0&&(s=l&-l,a=n&-n,s>=a||s===16&&(a&4194240)!==0))return n;if((l&4)!==0&&(l|=r&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0r;r++)n.push(e);return n}function Dr(e,n,r){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Nn(n),e[n]=r}function o3(e,n){var r=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0=Br),gc=" ",vc=!1;function yc(e,n){switch(e){case"keyup":return A3.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _c(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qt=!1;function I3(e,n){switch(e){case"compositionend":return _c(n);case"keypress":return n.which!==32?null:(vc=!0,gc);case"textInput":return e=n.data,e===gc&&vc?null:e;default:return null}}function F3(e,n){if(Qt)return e==="compositionend"||!ha&&yc(e,n)?(e=uc(),Tl=ia=tt=null,Qt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-e};e=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Cc(r)}}function Lc(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Lc(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Pc(){for(var e=window,n=kn();n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=kn(e.document)}return n}function va(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function K3(e){var n=Pc(),r=e.focusedElem,l=e.selectionRange;if(n!==r&&r&&r.ownerDocument&&Lc(r.ownerDocument.documentElement,r)){if(l!==null&&va(r)){if(n=l.start,e=l.end,e===void 0&&(e=n),"selectionStart"in r)r.selectionStart=n,r.selectionEnd=Math.min(e,r.value.length);else if(e=(n=r.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,a=Math.min(l.start,s);l=l.end===void 0?a:Math.min(l.end,s),!e.extend&&a>l&&(s=l,l=a,a=s),s=bc(r,a);var u=bc(r,l);s&&u&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&(n=n.createRange(),n.setStart(s.node,s.offset),e.removeAllRanges(),a>l?(e.addRange(n),e.extend(u.node,u.offset)):(n.setEnd(u.node,u.offset),e.addRange(n)))}}for(n=[],e=r;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Yt=null,ya=null,Wr=null,_a=!1;function Ec(e,n,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;_a||Yt==null||Yt!==kn(l)||(l=Yt,"selectionStart"in l&&va(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Wr&&$r(Wr,l)||(Wr=l,l=Ol(ya,"onSelect"),0er||(e.current=Da[er],Da[er]=null,er--)}function Le(e,n){er++,Da[er]=e.current,e.current=n}var at={},Ye=st(at),rn=st(!1),St=at;function nr(e,n){var r=e.type.contextTypes;if(!r)return at;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in r)s[a]=n[a];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=s),s}function ln(e){return e=e.childContextTypes,e!=null}function Gl(){Ee(rn),Ee(Ye)}function Hc(e,n,r){if(Ye.current!==at)throw Error(c(168));Le(Ye,n),Le(rn,r)}function Vc(e,n,r){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return r;l=l.getChildContext();for(var s in l)if(!(s in n))throw Error(c(108,Y(e)||"Unknown",s));return q({},r,l)}function Hl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||at,St=Ye.current,Le(Ye,e),Le(rn,rn.current),!0}function Kc(e,n,r){var l=e.stateNode;if(!l)throw Error(c(169));r?(e=Vc(e,n,St),l.__reactInternalMemoizedMergedChildContext=e,Ee(rn),Ee(Ye),Le(Ye,e)):Ee(rn),Le(rn,r)}var Un=null,Vl=!1,Ta=!1;function Qc(e){Un===null?Un=[e]:Un.push(e)}function s0(e){Vl=!0,Qc(e)}function ot(){if(!Ta&&Un!==null){Ta=!0;var e=0,n=Ce;try{var r=Un;for(Ce=1;e>=u,s-=u,$n=1<<32-Nn(n)+s|r<pe?(He=ue,ue=null):He=ue.sibling;var Ne=F(b,ue,E[pe],H);if(Ne===null){ue===null&&(ue=He);break}e&&ue&&Ne.alternate===null&&n(b,ue),_=a(Ne,_,pe),ce===null?se=Ne:ce.sibling=Ne,ce=Ne,ue=He}if(pe===E.length)return r(b,ue),De&&bt(b,pe),se;if(ue===null){for(;pepe?(He=ue,ue=null):He=ue.sibling;var gt=F(b,ue,Ne.value,H);if(gt===null){ue===null&&(ue=He);break}e&&ue&>.alternate===null&&n(b,ue),_=a(gt,_,pe),ce===null?se=gt:ce.sibling=gt,ce=gt,ue=He}if(Ne.done)return r(b,ue),De&&bt(b,pe),se;if(ue===null){for(;!Ne.done;pe++,Ne=E.next())Ne=U(b,Ne.value,H),Ne!==null&&(_=a(Ne,_,pe),ce===null?se=Ne:ce.sibling=Ne,ce=Ne);return De&&bt(b,pe),se}for(ue=l(b,ue);!Ne.done;pe++,Ne=E.next())Ne=X(ue,b,pe,Ne.value,H),Ne!==null&&(e&&Ne.alternate!==null&&ue.delete(Ne.key===null?pe:Ne.key),_=a(Ne,_,pe),ce===null?se=Ne:ce.sibling=Ne,ce=Ne);return e&&ue.forEach(function(B0){return n(b,B0)}),De&&bt(b,pe),se}function Ie(b,_,E,H){if(typeof E=="object"&&E!==null&&E.type===K&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case $:e:{for(var se=E.key,ce=_;ce!==null;){if(ce.key===se){if(se=E.type,se===K){if(ce.tag===7){r(b,ce.sibling),_=s(ce,E.props.children),_.return=b,b=_;break e}}else if(ce.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===ge&&e1(se)===ce.type){r(b,ce.sibling),_=s(ce,E.props),_.ref=Yr(b,ce,E),_.return=b,b=_;break e}r(b,ce);break}else n(b,ce);ce=ce.sibling}E.type===K?(_=At(E.props.children,b.mode,H,E.key),_.return=b,b=_):(H=xs(E.type,E.key,E.props,null,b.mode,H),H.ref=Yr(b,_,E),H.return=b,b=H)}return u(b);case O:e:{for(ce=E.key;_!==null;){if(_.key===ce)if(_.tag===4&&_.stateNode.containerInfo===E.containerInfo&&_.stateNode.implementation===E.implementation){r(b,_.sibling),_=s(_,E.children||[]),_.return=b,b=_;break e}else{r(b,_);break}else n(b,_);_=_.sibling}_=Eo(E,b.mode,H),_.return=b,b=_}return u(b);case ge:return ce=E._init,Ie(b,_,ce(E._payload),H)}if(jt(E))return re(b,_,E,H);if(ae(E))return le(b,_,E,H);ql(b,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,_!==null&&_.tag===6?(r(b,_.sibling),_=s(_,E),_.return=b,b=_):(r(b,_),_=Po(E,b.mode,H),_.return=b,b=_),u(b)):r(b,_)}return Ie}var sr=n1(!0),t1=n1(!1),Zl=st(null),Xl=null,ar=null,Fa=null;function Ba(){Fa=ar=Xl=null}function Oa(e){var n=Zl.current;Ee(Zl),e._currentValue=n}function Ua(e,n,r){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===r)break;e=e.return}}function or(e,n){Xl=e,Fa=ar=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(sn=!0),e.firstContext=null)}function yn(e){var n=e._currentValue;if(Fa!==e)if(e={context:e,memoizedValue:n,next:null},ar===null){if(Xl===null)throw Error(c(308));ar=e,Xl.dependencies={lanes:0,firstContext:e}}else ar=ar.next=e;return n}var Lt=null;function $a(e){Lt===null?Lt=[e]:Lt.push(e)}function r1(e,n,r,l){var s=n.interleaved;return s===null?(r.next=r,$a(n)):(r.next=s.next,s.next=r),n.interleaved=r,Gn(e,l)}function Gn(e,n){e.lanes|=n;var r=e.alternate;for(r!==null&&(r.lanes|=n),r=e,e=e.return;e!==null;)e.childLanes|=n,r=e.alternate,r!==null&&(r.childLanes|=n),r=e,e=e.return;return r.tag===3?r.stateNode:null}var it=!1;function Wa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function l1(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Hn(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function ct(e,n,r){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(ke&2)!==0){var s=l.pending;return s===null?n.next=n:(n.next=s.next,s.next=n),l.pending=n,Gn(e,r)}return s=l.interleaved,s===null?(n.next=n,$a(l)):(n.next=s.next,s.next=n),l.interleaved=n,Gn(e,r)}function Jl(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,r|=l,n.lanes=r,ra(e,r)}}function s1(e,n){var r=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,r===l)){var s=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var u={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?s=a=u:a=a.next=u,r=r.next}while(r!==null);a===null?s=a=n:a=a.next=n}else s=a=n;r={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:l.shared,effects:l.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}function es(e,n,r,l){var s=e.updateQueue;it=!1;var a=s.firstBaseUpdate,u=s.lastBaseUpdate,h=s.shared.pending;if(h!==null){s.shared.pending=null;var y=h,R=y.next;y.next=null,u===null?a=R:u.next=R,u=y;var B=e.alternate;B!==null&&(B=B.updateQueue,h=B.lastBaseUpdate,h!==u&&(h===null?B.firstBaseUpdate=R:h.next=R,B.lastBaseUpdate=y))}if(a!==null){var U=s.baseState;u=0,B=R=y=null,h=a;do{var F=h.lane,X=h.eventTime;if((l&F)===F){B!==null&&(B=B.next={eventTime:X,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,next:null});e:{var re=e,le=h;switch(F=n,X=r,le.tag){case 1:if(re=le.payload,typeof re=="function"){U=re.call(X,U,F);break e}U=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=le.payload,F=typeof re=="function"?re.call(X,U,F):re,F==null)break e;U=q({},U,F);break e;case 2:it=!0}}h.callback!==null&&h.lane!==0&&(e.flags|=64,F=s.effects,F===null?s.effects=[h]:F.push(h))}else X={eventTime:X,lane:F,tag:h.tag,payload:h.payload,callback:h.callback,next:null},B===null?(R=B=X,y=U):B=B.next=X,u|=F;if(h=h.next,h===null){if(h=s.shared.pending,h===null)break;F=h,h=F.next,F.next=null,s.lastBaseUpdate=F,s.shared.pending=null}}while(!0);if(B===null&&(y=U),s.baseState=y,s.firstBaseUpdate=R,s.lastBaseUpdate=B,n=s.shared.interleaved,n!==null){s=n;do u|=s.lane,s=s.next;while(s!==n)}else a===null&&(s.shared.lanes=0);Dt|=u,e.lanes=u,e.memoizedState=U}}function a1(e,n,r){if(e=n.effects,n.effects=null,e!==null)for(n=0;nr?r:4,e(!0);var l=Qa.transition;Qa.transition={};try{e(!1),n()}finally{Ce=r,Qa.transition=l}}function S1(){return _n().memoizedState}function c0(e,n,r){var l=ft(e);if(r={lane:l,action:r,hasEagerState:!1,eagerState:null,next:null},C1(e))b1(n,r);else if(r=r1(e,n,r,l),r!==null){var s=nn();En(r,e,l,s),L1(r,n,l)}}function u0(e,n,r){var l=ft(e),s={lane:l,action:r,hasEagerState:!1,eagerState:null,next:null};if(C1(e))b1(n,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=n.lastRenderedReducer,a!==null))try{var u=n.lastRenderedState,h=a(u,r);if(s.hasEagerState=!0,s.eagerState=h,Sn(h,u)){var y=n.interleaved;y===null?(s.next=s,$a(n)):(s.next=y.next,y.next=s),n.interleaved=s;return}}catch{}finally{}r=r1(e,n,s,l),r!==null&&(s=nn(),En(r,e,l,s),L1(r,n,l))}}function C1(e){var n=e.alternate;return e===ze||n!==null&&n===ze}function b1(e,n){Jr=rs=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function L1(e,n,r){if((r&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,r|=l,n.lanes=r,ra(e,r)}}var as={readContext:yn,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useInsertionEffect:qe,useLayoutEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useMutableSource:qe,useSyncExternalStore:qe,useId:qe,unstable_isNewReconciler:!1},d0={readContext:yn,useCallback:function(e,n){return An().memoizedState=[e,n===void 0?null:n],e},useContext:yn,useEffect:v1,useImperativeHandle:function(e,n,r){return r=r!=null?r.concat([e]):null,ls(4194308,4,x1.bind(null,n,e),r)},useLayoutEffect:function(e,n){return ls(4194308,4,e,n)},useInsertionEffect:function(e,n){return ls(4,2,e,n)},useMemo:function(e,n){var r=An();return n=n===void 0?null:n,e=e(),r.memoizedState=[e,n],e},useReducer:function(e,n,r){var l=An();return n=r!==void 0?r(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=c0.bind(null,ze,e),[l.memoizedState,e]},useRef:function(e){var n=An();return e={current:e},n.memoizedState=e},useState:m1,useDebugValue:no,useDeferredValue:function(e){return An().memoizedState=e},useTransition:function(){var e=m1(!1),n=e[0];return e=i0.bind(null,e[1]),An().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,r){var l=ze,s=An();if(De){if(r===void 0)throw Error(c(407));r=r()}else{if(r=n(),Ge===null)throw Error(c(349));(Et&30)!==0||u1(l,n,r)}s.memoizedState=r;var a={value:r,getSnapshot:n};return s.queue=a,v1(p1.bind(null,l,a,e),[e]),l.flags|=2048,tl(9,d1.bind(null,l,a,r,n),void 0,null),r},useId:function(){var e=An(),n=Ge.identifierPrefix;if(De){var r=Wn,l=$n;r=(l&~(1<<32-Nn(l)-1)).toString(32)+r,n=":"+n+"R"+r,r=el++,0<\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=u.createElement(r,{is:l.is}):(e=u.createElement(r),r==="select"&&(u=e,l.multiple?u.multiple=!0:l.size&&(u.size=l.size))):e=u.createElementNS(e,r),e[Rn]=n,e[Kr]=l,Q1(e,n,!1,!1),n.stateNode=e;e:{switch(u=Wt(r,l),r){case"dialog":Pe("cancel",e),Pe("close",e),s=l;break;case"iframe":case"object":case"embed":Pe("load",e),s=l;break;case"video":case"audio":for(s=0;spr&&(n.flags|=128,l=!0,rl(a,!1),n.lanes=4194304)}else{if(!l)if(e=ns(u),e!==null){if(n.flags|=128,l=!0,r=e.updateQueue,r!==null&&(n.updateQueue=r,n.flags|=4),rl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!De)return Ze(n),null}else 2*Me()-a.renderingStartTime>pr&&r!==1073741824&&(n.flags|=128,l=!0,rl(a,!1),n.lanes=4194304);a.isBackwards?(u.sibling=n.child,n.child=u):(r=a.last,r!==null?r.sibling=u:n.child=u,a.last=u)}return a.tail!==null?(n=a.tail,a.rendering=n,a.tail=n.sibling,a.renderingStartTime=Me(),n.sibling=null,r=Re.current,Le(Re,l?r&1|2:r&1),n):(Ze(n),null);case 22:case 23:return Co(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(mn&1073741824)!==0&&(Ze(n),n.subtreeFlags&6&&(n.flags|=8192)):Ze(n),null;case 24:return null;case 25:return null}throw Error(c(156,n.tag))}function _0(e,n){switch(za(n),n.tag){case 1:return ln(n.type)&&Gl(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ir(),Ee(rn),Ee(Ye),Ka(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Ha(n),null;case 13:if(Ee(Re),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(c(340));lr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Ee(Re),null;case 4:return ir(),null;case 10:return Oa(n.type._context),null;case 22:case 23:return Co(),null;case 24:return null;default:return null}}var us=!1,Xe=!1,x0=typeof WeakSet=="function"?WeakSet:Set,ne=null;function ur(e,n){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(l){Ae(e,n,l)}else r.current=null}function ho(e,n,r){try{r()}catch(l){Ae(e,n,l)}}var Z1=!1;function j0(e,n){if(Sa=El,e=Pc(),va(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var l=r.getSelection&&r.getSelection();if(l&&l.rangeCount!==0){r=l.anchorNode;var s=l.anchorOffset,a=l.focusNode;l=l.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var u=0,h=-1,y=-1,R=0,B=0,U=e,F=null;n:for(;;){for(var X;U!==r||s!==0&&U.nodeType!==3||(h=u+s),U!==a||l!==0&&U.nodeType!==3||(y=u+l),U.nodeType===3&&(u+=U.nodeValue.length),(X=U.firstChild)!==null;)F=U,U=X;for(;;){if(U===e)break n;if(F===r&&++R===s&&(h=u),F===a&&++B===l&&(y=u),(X=U.nextSibling)!==null)break;U=F,F=U.parentNode}U=X}r=h===-1||y===-1?null:{start:h,end:y}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ca={focusedElem:e,selectionRange:r},El=!1,ne=n;ne!==null;)if(n=ne,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ne=e;else for(;ne!==null;){n=ne;try{var re=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(re!==null){var le=re.memoizedProps,Ie=re.memoizedState,b=n.stateNode,_=b.getSnapshotBeforeUpdate(n.elementType===n.type?le:bn(n.type,le),Ie);b.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var E=n.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(c(163))}}catch(H){Ae(n,n.return,H)}if(e=n.sibling,e!==null){e.return=n.return,ne=e;break}ne=n.return}return re=Z1,Z1=!1,re}function ll(e,n,r){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var s=l=l.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&ho(n,r,a)}s=s.next}while(s!==l)}}function ds(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do{if((r.tag&e)===e){var l=r.create;r.destroy=l()}r=r.next}while(r!==n)}}function mo(e){var n=e.ref;if(n!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof n=="function"?n(e):n.current=e}}function X1(e){var n=e.alternate;n!==null&&(e.alternate=null,X1(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Rn],delete n[Kr],delete n[Ea],delete n[r0],delete n[l0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function J1(e){return e.tag===5||e.tag===3||e.tag===4}function eu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||J1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function go(e,n,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?r.nodeType===8?r.parentNode.insertBefore(e,n):r.insertBefore(e,n):(r.nodeType===8?(n=r.parentNode,n.insertBefore(e,r)):(n=r,n.appendChild(e)),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=$l));else if(l!==4&&(e=e.child,e!==null))for(go(e,n,r),e=e.sibling;e!==null;)go(e,n,r),e=e.sibling}function vo(e,n,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(vo(e,n,r),e=e.sibling;e!==null;)vo(e,n,r),e=e.sibling}var Ve=null,Ln=!1;function ut(e,n,r){for(r=r.child;r!==null;)nu(e,n,r),r=r.sibling}function nu(e,n,r){if(Tn&&typeof Tn.onCommitFiberUnmount=="function")try{Tn.onCommitFiberUnmount(Nl,r)}catch{}switch(r.tag){case 5:Xe||ur(r,n);case 6:var l=Ve,s=Ln;Ve=null,ut(e,n,r),Ve=l,Ln=s,Ve!==null&&(Ln?(e=Ve,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ve.removeChild(r.stateNode));break;case 18:Ve!==null&&(Ln?(e=Ve,r=r.stateNode,e.nodeType===8?Pa(e.parentNode,r):e.nodeType===1&&Pa(e,r),Mr(e)):Pa(Ve,r.stateNode));break;case 4:l=Ve,s=Ln,Ve=r.stateNode.containerInfo,Ln=!0,ut(e,n,r),Ve=l,Ln=s;break;case 0:case 11:case 14:case 15:if(!Xe&&(l=r.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){s=l=l.next;do{var a=s,u=a.destroy;a=a.tag,u!==void 0&&((a&2)!==0||(a&4)!==0)&&ho(r,n,u),s=s.next}while(s!==l)}ut(e,n,r);break;case 1:if(!Xe&&(ur(r,n),l=r.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=r.memoizedProps,l.state=r.memoizedState,l.componentWillUnmount()}catch(h){Ae(r,n,h)}ut(e,n,r);break;case 21:ut(e,n,r);break;case 22:r.mode&1?(Xe=(l=Xe)||r.memoizedState!==null,ut(e,n,r),Xe=l):ut(e,n,r);break;default:ut(e,n,r)}}function tu(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new x0),n.forEach(function(l){var s=E0.bind(null,e,l);r.has(l)||(r.add(l),l.then(s,s))})}}function Pn(e,n){var r=n.deletions;if(r!==null)for(var l=0;ls&&(s=u),l&=~a}if(l=s,l=Me()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*k0(l/1960))-l,10e?16:e,pt===null)var l=!1;else{if(e=pt,pt=null,gs=0,(ke&6)!==0)throw Error(c(331));var s=ke;for(ke|=4,ne=e.current;ne!==null;){var a=ne,u=a.child;if((ne.flags&16)!==0){var h=a.deletions;if(h!==null){for(var y=0;yMe()-xo?Rt(e,0):_o|=r),on(e,n)}function mu(e,n){n===0&&((e.mode&1)===0?n=1:(n=Cl,Cl<<=1,(Cl&130023424)===0&&(Cl=4194304)));var r=nn();e=Gn(e,n),e!==null&&(Dr(e,n,r),on(e,r))}function P0(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),mu(e,r)}function E0(e,n){var r=0;switch(e.tag){case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(c(314))}l!==null&&l.delete(n),mu(e,r)}var gu;gu=function(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps||rn.current)sn=!0;else{if((e.lanes&r)===0&&(n.flags&128)===0)return sn=!1,v0(e,n,r);sn=(e.flags&131072)!==0}else sn=!1,De&&(n.flags&1048576)!==0&&Yc(n,Ql,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;cs(e,n),e=n.pendingProps;var s=nr(n,Ye.current);or(n,r),s=qa(null,n,l,e,s,r);var a=Za();return n.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,ln(l)?(a=!0,Hl(n)):a=!1,n.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Wa(n),s.updater=os,n.stateNode=s,s._reactInternals=n,ro(n,l,e,r),n=oo(null,n,l,!0,a,r)):(n.tag=0,De&&a&&Ra(n),en(null,n,s,r),n=n.child),n;case 16:l=n.elementType;e:{switch(cs(e,n),e=n.pendingProps,s=l._init,l=s(l._payload),n.type=l,s=n.tag=T0(l),e=bn(l,e),s){case 0:n=ao(null,n,l,e,r);break e;case 1:n=$1(null,n,l,e,r);break e;case 11:n=I1(null,n,l,e,r);break e;case 14:n=F1(null,n,l,bn(l.type,e),r);break e}throw Error(c(306,l,""))}return n;case 0:return l=n.type,s=n.pendingProps,s=n.elementType===l?s:bn(l,s),ao(e,n,l,s,r);case 1:return l=n.type,s=n.pendingProps,s=n.elementType===l?s:bn(l,s),$1(e,n,l,s,r);case 3:e:{if(W1(n),e===null)throw Error(c(387));l=n.pendingProps,a=n.memoizedState,s=a.element,l1(e,n),es(n,l,null,r);var u=n.memoizedState;if(l=u.element,a.isDehydrated)if(a={element:l,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},n.updateQueue.baseState=a,n.memoizedState=a,n.flags&256){s=cr(Error(c(423)),n),n=G1(e,n,l,r,s);break e}else if(l!==s){s=cr(Error(c(424)),n),n=G1(e,n,l,r,s);break e}else for(hn=lt(n.stateNode.containerInfo.firstChild),fn=n,De=!0,Cn=null,r=t1(n,null,l,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(lr(),l===s){n=Vn(e,n,r);break e}en(e,n,l,r)}n=n.child}return n;case 5:return o1(n),e===null&&Ma(n),l=n.type,s=n.pendingProps,a=e!==null?e.memoizedProps:null,u=s.children,ba(l,s)?u=null:a!==null&&ba(l,a)&&(n.flags|=32),U1(e,n),en(e,n,u,r),n.child;case 6:return e===null&&Ma(n),null;case 13:return H1(e,n,r);case 4:return Ga(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=sr(n,null,l,r):en(e,n,l,r),n.child;case 11:return l=n.type,s=n.pendingProps,s=n.elementType===l?s:bn(l,s),I1(e,n,l,s,r);case 7:return en(e,n,n.pendingProps,r),n.child;case 8:return en(e,n,n.pendingProps.children,r),n.child;case 12:return en(e,n,n.pendingProps.children,r),n.child;case 10:e:{if(l=n.type._context,s=n.pendingProps,a=n.memoizedProps,u=s.value,Le(Zl,l._currentValue),l._currentValue=u,a!==null)if(Sn(a.value,u)){if(a.children===s.children&&!rn.current){n=Vn(e,n,r);break e}}else for(a=n.child,a!==null&&(a.return=n);a!==null;){var h=a.dependencies;if(h!==null){u=a.child;for(var y=h.firstContext;y!==null;){if(y.context===l){if(a.tag===1){y=Hn(-1,r&-r),y.tag=2;var R=a.updateQueue;if(R!==null){R=R.shared;var B=R.pending;B===null?y.next=y:(y.next=B.next,B.next=y),R.pending=y}}a.lanes|=r,y=a.alternate,y!==null&&(y.lanes|=r),Ua(a.return,r,n),h.lanes|=r;break}y=y.next}}else if(a.tag===10)u=a.type===n.type?null:a.child;else if(a.tag===18){if(u=a.return,u===null)throw Error(c(341));u.lanes|=r,h=u.alternate,h!==null&&(h.lanes|=r),Ua(u,r,n),u=a.sibling}else u=a.child;if(u!==null)u.return=a;else for(u=a;u!==null;){if(u===n){u=null;break}if(a=u.sibling,a!==null){a.return=u.return,u=a;break}u=u.return}a=u}en(e,n,s.children,r),n=n.child}return n;case 9:return s=n.type,l=n.pendingProps.children,or(n,r),s=yn(s),l=l(s),n.flags|=1,en(e,n,l,r),n.child;case 14:return l=n.type,s=bn(l,n.pendingProps),s=bn(l.type,s),F1(e,n,l,s,r);case 15:return B1(e,n,n.type,n.pendingProps,r);case 17:return l=n.type,s=n.pendingProps,s=n.elementType===l?s:bn(l,s),cs(e,n),n.tag=1,ln(l)?(e=!0,Hl(n)):e=!1,or(n,r),E1(n,l,s),ro(n,l,s,r),oo(null,n,l,!0,e,r);case 19:return K1(e,n,r);case 22:return O1(e,n,r)}throw Error(c(156,n.tag))};function vu(e,n){return qi(e,n)}function D0(e,n,r,l){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(e,n,r,l){return new D0(e,n,r,l)}function Lo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function T0(e){if(typeof e=="function")return Lo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===me)return 11;if(e===ie)return 14}return 2}function mt(e,n){var r=e.alternate;return r===null?(r=jn(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function xs(e,n,r,l,s,a){var u=2;if(l=e,typeof e=="function")Lo(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case K:return At(r.children,s,a,n);case Q:u=8,s|=8;break;case Z:return e=jn(12,r,n,s|2),e.elementType=Z,e.lanes=a,e;case te:return e=jn(13,r,n,s),e.elementType=te,e.lanes=a,e;case ee:return e=jn(19,r,n,s),e.elementType=ee,e.lanes=a,e;case _e:return js(r,s,a,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:u=10;break e;case J:u=9;break e;case me:u=11;break e;case ie:u=14;break e;case ge:u=16,l=null;break e}throw Error(c(130,e==null?e:typeof e,""))}return n=jn(u,r,n,s),n.elementType=e,n.type=l,n.lanes=a,n}function At(e,n,r,l){return e=jn(7,e,l,n),e.lanes=r,e}function js(e,n,r,l){return e=jn(22,e,l,n),e.elementType=_e,e.lanes=r,e.stateNode={isHidden:!1},e}function Po(e,n,r){return e=jn(6,e,null,n),e.lanes=r,e}function Eo(e,n,r){return n=jn(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function R0(e,n,r,l,s){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ta(0),this.expirationTimes=ta(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ta(0),this.identifierPrefix=l,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Do(e,n,r,l,s,a,u,h,y){return e=new R0(e,n,r,h,y),n===1?(n=1,a===!0&&(n|=8)):n=0,a=jn(3,null,null,n),e.current=a,a.stateNode=e,a.memoizedState={element:l,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wa(a),e}function z0(e,n,r){var l=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(i){console.error(i)}}return o(),Ds.exports=Lu(),Ds.exports}var Go;function Pu(){if(Go)return cl;Go=1;var o=Wo();return cl.createRoot=o.createRoot,cl.hydrateRoot=o.hydrateRoot,cl}var Eu=Pu(),j=Es();function Du({tabs:o,activeTab:i,onTabChange:c}){return t.jsx("div",{className:"cn-tab-nav",children:o.map(p=>t.jsx("button",{className:`cn-tab-nav__item${i===p.id?" cn-tab-nav__item--active":""}`,onClick:()=>c(p.id),type:"button",children:p.label},p.id))})}function Tu({type:o="info",dismissible:i=!1,onDismiss:c,children:p}){const d={success:"notice-success",error:"notice-error",warning:"notice-warning",info:"notice-info"}[o]||"notice-info";return t.jsxs("div",{className:`notice ${d}${i?" is-dismissible":""}`,children:[t.jsx("p",{children:p}),i&&c&&t.jsx("button",{type:"button",className:"notice-dismiss",onClick:c,children:t.jsx("span",{className:"screen-reader-text",children:"Dismiss this notice."})})]})}function Be(){const o=window.cnReactData||{},i=o.app_id||"",c=(o.subscription||"").toLowerCase(),p=!!i;let d="basic";return p&&c==="pro"?d="pro":p&&(d="free"),{tier:d,isBasic:d==="basic",isFree:d==="free",isPro:d==="pro",isConnected:p,version:o.version||""}}const Ru={basic:"Basic (Not Connected)",free:"Free Plan",pro:"Pro Plan"};function zu(){const{tier:o,version:i}=Be();return t.jsxs("div",{className:"cn-footer",children:[t.jsxs("span",{className:"cn-footer__version",children:["Compliance by Hu-manity.co v",i||"—"," — ",Ru[o]||""]}),t.jsxs("span",{className:"cn-footer__links",children:[t.jsx("a",{href:"https://cookie-compliance.co/documentation/",target:"_blank",rel:"noopener noreferrer",children:"Documentation"})," | ",t.jsx("a",{href:"https://cookie-compliance.co/support/",target:"_blank",rel:"noopener noreferrer",children:"Support"})," | ",t.jsx("a",{href:"https://cookie-compliance.co/privacy-policy/",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"})]})]})}const Ho=j.createContext({dashboard:null,refetchDashboard:()=>{},isLoadingDashboard:!1});function vt(){return j.useContext(Ho)}const Vo=j.createContext({config:null,isLoadingConfig:!1,refetchConfig:()=>{}});function Mt(){return j.useContext(Vo)}const zs=o=>"cn_setup_wizard_complete_"+(o||"default"),As=o=>"cn_has_platform_config_"+(o||""),Au=o=>"cn_setup_just_finished_"+(o||"default"),Ko=j.createContext(null);function Mu({onLawSave:o,onConsentClose:i,children:c}){const[p,d]=j.useState(!1),[g,m]=j.useState(0),[f,v]=j.useState(!1),[w,x]=j.useState(!1),[S,L]=j.useState(0),[z,C]=j.useState(!1),[P,N]=j.useState(!1),[D,I]=j.useState(0),[A,W]=j.useState(!1),$=j.useMemo(()=>{var ee,ie;try{const ge=((ie=(ee=window.cnReactData)==null?void 0:ee.options)==null?void 0:ie.app_id)||"";return!!ge&&localStorage.getItem(As(ge))==="1"}catch{return!1}},[]),O=j.useCallback(()=>{d(!1),v(!1),x(!1),C(!1),N(!1),W(!1)},[]),K=j.useCallback(()=>{O(),d(!0),m(ee=>ee+1)},[O]),Q=j.useCallback(()=>{O(),x(!0),L(ee=>ee+1)},[O]),Z=j.useCallback(()=>{O(),N(!0),I(ee=>ee+1)},[O]),T=j.useCallback(()=>{v(!0),setTimeout(()=>{d(!1),v(!1)},160)},[]),J=j.useCallback(()=>{C(!0),setTimeout(()=>{x(!1),C(!1),o&&o()},160)},[o]),me=j.useCallback(()=>{W(!0),setTimeout(()=>{N(!1),W(!1),i&&i()},160)},[i]),te={showBannerWizard:p,bannerScrollTrigger:g,bannerClosing:f,showLawWizard:w,lawScrollTrigger:S,lawClosing:z,showConsentPanel:P,consentScrollTrigger:D,consentClosing:A,hasPlatformConfig:$,openBannerWizard:K,openLawWizard:Q,openConsentPanel:Z,closeBannerWizard:T,closeLawWizard:J,closeConsentPanel:me,closeAllPanels:O};return t.jsx(Ko.Provider,{value:te,children:c})}function mr(){const o=j.useContext(Ko);if(!o)throw new Error("usePanels() must be used inside .");return o}async function cn(o,i={}){var m;const c=window.cnReactData||{},p=new FormData;p.append("action",o),p.append("nonce",c.nonce||""),c.network&&p.append("cn_network","1"),Object.entries(i).forEach(([f,v])=>{p.append(f,v)});const d=await fetch(c.ajaxURL||"/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",body:p});if(!d.ok)throw new Error(`AJAX error: ${d.status}`);const g=await d.json();if(!g.success)throw new Error(((m=g.data)==null?void 0:m.error)||"Request failed");return g.data}async function In(o,i={},c="",p=""){const d=window.cnReactData||{},g=new FormData;g.append("action","cn_api_request"),g.append("nonce",p||d.welcomeNonce||""),g.append("request",o),g.append("cn_nonce",c),d.network&&g.append("cn_network","1"),Object.entries(i).forEach(([v,w])=>{g.append(v,w)});const m=await fetch(d.ajaxURL||"/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",body:g});if(!m.ok)throw new Error(`Request failed: ${m.status}`);const f=await m.json();if(f&&f.error)throw new Error(f.error);return f}const Iu=()=>{const o=window.cnReactData||{},i={};if(o.devMode){const p=new URLSearchParams(window.location.search).get("cn_usage");p!==null&&(i.cn_usage=p)}return cn("cn_react_dashboard",i)},Fu=()=>cn("cn_react_config"),Bu=(o={})=>cn("cn_react_consent_logs",o),Ou=(o={})=>cn("cn_react_export_consent_logs",o),Ms=(o={})=>cn("cn_react_save_options",o),Uu=()=>cn("cn_react_dismiss_welcome"),Is=()=>cn("cn_react_complete_setup_wizard"),$u=o=>cn("cn_react_apply_template",{template:o}),Wu=o=>cn("cn_react_rule_values",{param:o}),Gu=(o=[])=>{const i={};return o.forEach((c,p)=>{i[`languages[${p}]`]=c}),cn("cn_react_apply_languages",i)},ul=(o={},i={},c={})=>{const p={};return Object.entries(o).forEach(([d,g])=>{p[`design[${d}]`]=g}),Object.entries(i).forEach(([d,g])=>{p[`config[${d}]`]=g}),Object.entries(c).forEach(([d,g])=>{p[`consentConfig[${d}]`]=g}),cn("cn_react_update_design",p)},Hu=()=>cn("cn_react_rescan_scripts"),Vu=()=>cn("cn_react_dev_reset"),Ku=()=>{const o=window.cnReactData||{},i={};return o.network&&(i.cn_network="1"),In("sync_config",i,"",o.welcomeNonce||"")},Qu=async()=>{const o=window.cnReactData||{},i=new FormData;i.append("action","cn_purge_cache"),i.append("nonce",o.purgeNonce||""),o.network&&i.append("cn_network","1");const c=await fetch(o.ajaxURL||"/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",body:i});if(!c.ok)throw new Error(`Purge cache failed: ${c.status}`)},Qe=((Ii=window.cnReactData)==null?void 0:Ii.appUrl)||"https://app.hu-manity.co",Fs={gdpr:"GDPR",ccpa:"CCPA",otherus:"US State Laws",ukpecr:"UK PECR",lgpd:"LGPD",pipeda:"PIPEDA",popia:"POPIA"},Qo={GDPR:{flag:"🇪🇺",geo:"EU"},CCPA:{flag:"🇺🇸",geo:"US"},"US State Laws":{flag:"🇺🇸",geo:"US"},"UK PECR":{flag:"🇬🇧",geo:"UK"},LGPD:{flag:"🇧🇷",geo:"Brazil"},PIPEDA:{flag:"🇨🇦",geo:"Canada"},POPIA:{flag:"🇿🇦",geo:"South Africa"}};function Yo(o){return o?Object.entries(o).filter(([,i])=>!!i).map(([i])=>i):[]}function qo(o={}){const i=o.google_consent_default,c=o.facebook_consent_default,p=o.microsoft_consent_default;return{google:!!i&&Object.keys(i).length>0,facebook:!!c&&Object.keys(c).length>0,microsoft:!!p&&Object.keys(p).length>0,gpc:!!o.gpc_support,dnt:!!o.do_not_track}}function Zo(o={}){const i=o.providers||[],c=i.length,p=i.filter(g=>!g.CategoryID).length,d=c-p;return{total:c,uncategorized:p,categorized:d,allCategorized:c>0&&p===0}}function yt({children:o,sidebar:i}){return t.jsxs("div",{className:"cn-page-layout",children:[t.jsx("div",{className:"cn-main",children:o}),i&&t.jsx("div",{className:"cn-sidebar",children:i})]})}function Fn({title:o,children:i}){return t.jsxs("div",{className:"cn-side-card",children:[o&&t.jsx("h3",{children:o}),i]})}function $e({variant:o="primary",size:i="md",children:c,...p}){return t.jsx("button",{className:`cn-button cn-button--${o} cn-button--${i}`,type:"button",...p,children:c})}function Se({label:o,type:i="text",value:c,onChange:p,placeholder:d,options:g,error:m,helper:f,required:v,children:w,...x}){const S=x.id||`cn-field-${o==null?void 0:o.toLowerCase().replace(/\s+/g,"-")}`,L=()=>i==="textarea"?t.jsx("textarea",{id:S,className:`cn-form-field__input cn-form-field__textarea${m?" cn-form-field__input--error":""}`,value:c,onChange:z=>p==null?void 0:p(z.target.value),placeholder:d,...x}):i==="select"?t.jsx("select",{id:S,className:`cn-form-field__input cn-form-field__select${m?" cn-form-field__input--error":""}`,value:c,onChange:z=>p==null?void 0:p(z.target.value),...x,children:g==null?void 0:g.map(z=>t.jsx("option",{value:z.value,children:z.label},z.value))}):t.jsx("input",{id:S,type:i,className:`cn-form-field__input${m?" cn-form-field__input--error":""}`,value:c,onChange:z=>p==null?void 0:p(z.target.value),placeholder:d,...x});return t.jsxs("div",{className:"cn-form-field",children:[o&&t.jsxs("label",{className:"cn-form-field__label",htmlFor:S,children:[o,v&&t.jsx("span",{className:"cn-form-field__req",children:"*"})]}),w||L(),m&&t.jsx("div",{className:"cn-form-field__error",children:m}),f&&!m&&t.jsx("div",{className:"cn-form-field__helper",children:f})]})}function wn(){return t.jsx("span",{className:"cn-pro-badge",children:"PRO"})}const Xo={basic:0,free:1,pro:2};function Jo({requiredTier:o="pro",children:i,message:c,onCta:p}){const{tier:d}=Be();if(Xo[d]>=Xo[o])return i;const m=o==="free"?"Connect to Cookie Compliance to unlock this feature.":"Upgrade to Cookie Compliance Pro to unlock this feature.",f=o==="free"?"Connect Now":"Upgrade Now",v=p?t.jsx("button",{type:"button",onClick:p,className:`cn-button cn-button--${o==="free"?"primary":"upgrade"}`,children:f}):t.jsx("a",{href:o==="free"?"#":"https://cookie-compliance.co/pricing/",className:`cn-button cn-button--${o==="free"?"primary":"upgrade"}`,target:o==="pro"?"_blank":void 0,rel:o==="pro"?"noopener noreferrer":void 0,children:f});return t.jsxs("div",{className:"cn-tier-gate",children:[t.jsx("div",{className:"cn-tier-gate__content",children:i}),t.jsx("div",{className:"cn-tier-gate__overlay",children:t.jsxs("div",{className:"cn-tier-gate__cta",children:[o==="pro"&&t.jsx(wn,{}),t.jsx("p",{children:c||m}),v]})})]})}const be={thumb:"_thumb_1g9ys_1",chrome:"_chrome_1g9ys_12",dot:"_dot_1g9ys_23",urlBar:"_urlBar_1g9ys_31",page:"_page_1g9ys_39",lines:"_lines_1g9ys_45",banner:"_banner_1g9ys_57","bar-bottom":"_bar-bottom_1g9ys_69","bar-top":"_bar-top_1g9ys_75",floating:"_floating_1g9ys_81",fixed:"_fixed_1g9ys_87","panel-left":"_panel-left_1g9ys_92","panel-right":"_panel-right_1g9ys_99",panelFloating:"_panelFloating_1g9ys_106",panelFixed:"_panelFixed_1g9ys_110",popup:"_popup_1g9ys_115",bannerHeader:"_bannerHeader_1g9ys_124",toolbarDots:"_toolbarDots_1g9ys_131",pills:"_pills_1g9ys_143",pill:"_pill_1g9ys_143",pillDot:"_pillDot_1g9ys_160",saveBtn:"_saveBtn_1g9ys_167",footerLinks:"_footerLinks_1g9ys_174",link:"_link_1g9ys_181","anim-slide-bottom":"_anim-slide-bottom_1g9ys_188",huPreviewSlideUp:"_huPreviewSlideUp_1g9ys_1","anim-slide-top":"_anim-slide-top_1g9ys_192",huPreviewSlideDown:"_huPreviewSlideDown_1g9ys_1","anim-slide-left":"_anim-slide-left_1g9ys_196",huPreviewSlideLeft:"_huPreviewSlideLeft_1g9ys_1","anim-slide-right":"_anim-slide-right_1g9ys_200",huPreviewSlideRight:"_huPreviewSlideRight_1g9ys_1","anim-slide-center":"_anim-slide-center_1g9ys_204",huPreviewScaleIn:"_huPreviewScaleIn_1g9ys_1","anim-fade":"_anim-fade_1g9ys_208",huPreviewFade:"_huPreviewFade_1g9ys_1"},Yu=["#c4c4c4","#d5b565","#9891b1"];function qu(o){const i=o.replace("#",""),c=parseInt(i.slice(0,2),16),p=parseInt(i.slice(2,4),16),d=parseInt(i.slice(4,6),16);return(c*299+p*587+d*114)/1e3>155}function ei({preset:o,isActive:i}){const{position:c="bottom",displayType:p="floating",bannerColor:d="#4d4d4d",primaryColor:g="#20c19e",btnBorderRadius:m="25px",animation:f="fade"}=o,v=qu(d),w=v?"rgba(0,0,0,.25)":"rgba(255,255,255,.4)",x=v?"rgba(0,0,0,.18)":"rgba(255,255,255,.35)",S=c==="left"||c==="right",L=c==="center",z=p==="floating",C=Math.max(2,Math.round(parseInt(m)*.18))+"px",P=f==="slide"?be[`anim-slide-${c}`]:be["anim-fade"],N=[be.banner,S?be[`panel-${c}`]:null,S&&z?be.panelFloating:null,S&&!z?be.panelFixed:null,L?be.popup:null,!S&&!L?be[`bar-${c}`]:null,!S&&!L&&z?be.floating:null,!S&&!L&&!z?be.fixed:null,be[P]||P].filter(Boolean).join(" ");return t.jsxs("div",{className:be.thumb,children:[t.jsxs("div",{className:be.chrome,children:[t.jsx("span",{className:be.dot}),t.jsx("span",{className:be.dot}),t.jsx("span",{className:be.dot}),t.jsx("div",{className:be.urlBar})]}),t.jsxs("div",{className:be.page,children:[t.jsxs("div",{className:be.lines,children:[t.jsx("div",{style:{width:"75%"}}),t.jsx("div",{style:{width:"55%"}}),t.jsx("div",{style:{width:"65%"}}),t.jsx("div",{style:{width:"45%"}})]}),t.jsxs("div",{className:N,style:{backgroundColor:d},children:[t.jsx("div",{className:be.bannerHeader,children:t.jsxs("div",{className:be.toolbarDots,style:{"--dot-color":w},children:[t.jsx("span",{}),t.jsx("span",{}),t.jsx("span",{})]})}),t.jsx("div",{className:be.pills,children:Yu.map((D,I)=>t.jsx("div",{className:be.pill,style:{borderColor:D},children:t.jsx("span",{className:be.pillDot,style:{backgroundColor:D}})},I))}),t.jsx("div",{className:be.saveBtn,style:{backgroundColor:g,borderRadius:C}}),t.jsxs("div",{className:be.footerLinks,children:[t.jsx("div",{className:be.link,style:{background:x}}),t.jsx("div",{className:be.link,style:{background:x}})]})]})]})]})}const gr=[{key:"minimal",label:"Minimal",position:"left",displayType:"floating",bannerColor:"#f0f0f0",primaryColor:"#20c19e"},{key:"standard",label:"Standard",position:"bottom",displayType:"floating",bannerColor:"#2d3436",primaryColor:"#20c19e"},{key:"bold",label:"Bold",position:"top",displayType:"fixed",bannerColor:"#1a1a2e",primaryColor:"#20c19e"},{key:"popup",label:"Popup",position:"center",displayType:"floating",bannerColor:"#2c3e50",primaryColor:"#20c19e"},{key:"panel",label:"Side Panel",position:"right",displayType:"floating",bannerColor:"#34495e",primaryColor:"#3498db"},{key:"compact",label:"Compact",position:"top",displayType:"floating",bannerColor:"#1a1a2e",primaryColor:"#e67e22"}];function Zu(o){if(!o||!o.position)return null;const i=gr.find(c=>c.position===o.position&&(c.bannerColor||"").toLowerCase()===(o.bannerColor||"").toLowerCase()&&(c.primaryColor||"").toLowerCase()===(o.primaryColor||"").toLowerCase());return i?i.key:"custom"}const Xu={"left|floating":"Left Panel · Floating","bottom|floating":"Bottom Bar · Floating","top|fixed":"Top Bar · Fixed","center|floating":"Center Modal","right|floating":"Right Panel · Floating","top|floating":"Top Bar · Floating","bottom|fixed":"Bottom Bar · Fixed"};function ni(o,i){return Xu[`${o}|${i}`]||`${o} · ${i}`}const Ju={google:"Google",facebook:"Facebook",microsoft:"Microsoft",gpc:"GPC",dnt:"DNT"},ed=["google","facebook","microsoft","gpc","dnt"];function ti({appliedTemplateKey:o,onTemplateApplied:i,siteUrl:c,onOpenTrackers:p,autoblockingEnabled:d,onTabChange:g}){var k,M,de,he;const{isConnected:m}=Be(),{dashboard:f}=vt(),{config:v}=Mt(),{openBannerWizard:w,openLawWizard:x,openConsentPanel:S,hasPlatformConfig:L}=mr(),z=gr.find(oe=>oe.key===o)||null,C=o?"ok":"warn",P=o?"Active":"No template set",N=z?`${z.label} · ${ni(z.position,z.displayType)}`:o?"Custom template":"Choose a template to go live",D=((k=f==null?void 0:f.appConfig)==null?void 0:k.regulations)||{},A=Yo(D).map(oe=>Fs[oe]||oe),$=((M=f==null?void 0:f.appConfig)!=null&&M.language?Array.isArray(f.appConfig.language)?f.appConfig.language:[f.appConfig.language]:["en"]).length,O=`${$} language${$!==1?"s":""}`,K=A.length,Q=K>0||L?"ok":"crit",Z=[...new Set(A.map(oe=>{var fe;return(fe=Qo[oe])==null?void 0:fe.geo}).filter(Boolean))],T=K>0?`${K} law${K!==1?"s":""} · ${O}`:"No laws set",J=K>0&&Z.length>0?`Covering ${Z.join(", ")}`:L?"Configured in portal":"Add your applicable laws below",me=(v==null?void 0:v.blocking)||{},te=qo(me),{total:ee,uncategorized:ie,allCategorized:ge}=Zo(me),_e=d!==void 0?!!d:!!((he=(de=window.cnReactData)==null?void 0:de.options)!=null&&he.app_blocking),V=ie>0?"warn":_e?"ok":"warn",ae=ie>0?`${ie} uncategorized`:ee>0?`${ee} tracked`:"Protected",q=ie>0?`${ie} tracker${ie!==1?"s":""} firing without consent`:_e?ge&&ee>0?"All trackers categorized ✓":"Consent modes active":"Autoblocking off — trackers may fire unblocked";return t.jsxs("div",{className:"cn-card-grid cn-card-grid--3",children:[t.jsxs("div",{className:"cn-card",children:[t.jsxs("div",{className:"cn-card__top",children:[t.jsx("div",{className:"cn-card__icon",children:t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"4",width:"16",height:"10",rx:"2",stroke:`var(--cn-${C}-icon)`,strokeWidth:"1.5"}),t.jsx("line",{x1:"7",y1:"19",x2:"15",y2:"19",stroke:`var(--cn-${C}-icon)`,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("line",{x1:"11",y1:"14",x2:"11",y2:"19",stroke:`var(--cn-${C}-icon)`,strokeWidth:"1.2"})]})}),t.jsx("div",{className:`cn-card__dot cn-card__dot--${C}`})]}),z&&t.jsx("div",{className:"cn-card__preview",children:t.jsx(ei,{preset:z})}),t.jsx("div",{className:`cn-card__main cn-card__main--${C}`,children:P}),t.jsx("div",{className:"cn-card__sub",children:N}),t.jsxs("div",{className:"cn-card__foot",children:[c&&o&&t.jsx("a",{href:`${c}?cn_preview=1`,target:"_blank",rel:"noreferrer",children:"Preview →"}),m&&o&&!z?t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noopener noreferrer",children:"Edit in portal →"}):t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",onClick:()=>w(),children:[o?"Change template":"Choose template"," →"]}),t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noopener noreferrer",children:"Edit colors & text →"})]})]})]}),t.jsxs("div",{className:`cn-card${Q==="crit"?" cn-card--crit":""}`,children:[t.jsxs("div",{className:"cn-card__top",children:[t.jsx("div",{className:"cn-card__icon",children:t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M11 2v18M5 7h12M4 7l2.5 7h9L18 7",stroke:`var(--cn-${Q}-icon)`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("circle",{cx:"7",cy:"14",r:"3",stroke:`var(--cn-${Q}-icon)`,strokeWidth:"1.2"}),t.jsx("circle",{cx:"15",cy:"14",r:"3",stroke:`var(--cn-${Q}-icon)`,strokeWidth:"1.2"})]})}),t.jsx("div",{className:`cn-card__dot cn-card__dot--${Q}`})]}),t.jsx("div",{className:`cn-card__main cn-card__main--${Q}`,children:T}),t.jsx("div",{className:"cn-card__sub",children:J}),t.jsx("div",{className:"cn-card__pills",children:A.map(oe=>{const fe=Qo[oe];return t.jsxs("span",{className:"cn-card__pill cn-card__pill--ok",children:[fe?`${fe.flag} `:"",oe]},oe)})}),t.jsxs("div",{className:"cn-card__foot",children:[t.jsxs("button",{type:"button",onClick:()=>x(),children:[K>0?"Edit laws":"Add laws"," →"]}),t.jsx("a",{href:`${Qe}/#/languages`,target:"_blank",rel:"noopener noreferrer",children:"Manage Languages ↗"})]})]}),t.jsxs("div",{className:`cn-card${V==="warn"?" cn-card--warn":""}`,children:[t.jsxs("div",{className:"cn-card__top",children:[t.jsx("div",{className:"cn-card__icon",children:t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M11 2L3 5.5v5C3 15.09 6.36 19.5 11 21c4.64-1.5 8-5.91 8-10.5v-5L11 2z",stroke:`var(--cn-${V}-icon)`,strokeWidth:"1.5",strokeLinejoin:"round"}),V==="ok"?t.jsx("polyline",{points:"7.5,11 10,13.5 14.5,9",stroke:`var(--cn-${V}-icon)`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"11",y1:"8",x2:"11",y2:"12",stroke:`var(--cn-${V}-icon)`,strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"11",cy:"14.5",r:".8",fill:`var(--cn-${V}-icon)`})]})]})}),t.jsx("div",{className:`cn-card__dot cn-card__dot--${V}`})]}),t.jsx("div",{className:`cn-card__main cn-card__main--${V}`,children:ae}),t.jsx("div",{className:`cn-card__sub${V==="warn"?" cn-card__sub--warn":""}`,children:q}),t.jsx("div",{className:"cn-card__pills",children:ed.filter(oe=>!!te[oe]).map(oe=>t.jsx("span",{className:"cn-card__pill cn-card__pill--ok",children:Ju[oe]},oe))}),t.jsxs("div",{className:"cn-card__foot",children:[t.jsx("button",{type:"button",onClick:()=>S(),children:"Consent modes →"}),p&&t.jsx("button",{type:"button",onClick:()=>p(),children:"View Trackers →"}),!_e&&g&&t.jsx("button",{type:"button",onClick:()=>{g("settings"),setTimeout(()=>{const oe=document.getElementById("cn-compliance-behavior");oe&&oe.scrollIntoView({behavior:"smooth",block:"start"})},80)},children:"Configure autoblocking →"}),t.jsx("a",{href:`${Qe}/#/autoblocking`,target:"_blank",rel:"noopener noreferrer",children:"Manage in portal ↗"})]})]})]})}function dl({showPortalLink:o=!0,addNotice:i}){var $,O,K,Q,Z;const{isPro:c,isConnected:p}=Be(),{dashboard:d}=vt(),g=(($=window.cnReactData)==null?void 0:$.lastSynced)||"",[m,f]=j.useState(!1),[v,w]=j.useState(null),[x,S]=j.useState(((K=(O=window.cnReactData)==null?void 0:O.options)==null?void 0:K.app_id)||""),[L,z]=j.useState(((Z=(Q=window.cnReactData)==null?void 0:Q.options)==null?void 0:Z.app_key)||""),[C,P]=j.useState(!1),[N,D]=j.useState(""),I=d!=null&&d.domainUrl?(()=>{try{return new URL(d.domainUrl).hostname}catch{return window.location.hostname}})():window.location.hostname,A=async()=>{f(!0),w(null);try{await Ku(),w("success"),i&&i("Configuration synced. Reloading…","success"),setTimeout(()=>window.location.reload(),800)}catch(T){w("error"),i&&i(T.message||"Sync failed. Please try again.","error"),f(!1)}},W=async()=>{P(!0),D("");try{await Ms({app_id:x,app_key:L});try{const T=await In("sync_config");if(T!=null&&T.success){try{await Is()}catch{}try{localStorage.setItem(zs(x),"1"),localStorage.setItem(As(x),"1")}catch{}}}catch{}window.location.reload()}catch(T){D(T.message||"Save failed"),P(!1)}};return t.jsxs(Fn,{title:"Domain Info",children:[t.jsxs("div",{className:"cn-dom-rows",children:[t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Domain"}),t.jsx("span",{className:"cn-dom-row__v",children:I})]}),t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Protection"}),t.jsx("span",{className:"cn-dom-row__v",children:p?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cn-dot cn-dot--green"})," Active"]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"cn-dot cn-dot--gray"})," Not Connected"]})})]}),t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Plan"}),t.jsx("span",{className:"cn-dom-row__v",children:c?t.jsxs(t.Fragment,{children:["Pro ",t.jsx(wn,{})]}):"Free Plan"})]})]}),t.jsxs("div",{className:"cn-dom-credentials",children:[t.jsx(Se,{label:"App ID",value:x,onChange:S,placeholder:"Your application ID",autoComplete:"off"}),t.jsx(Se,{label:"App Key",type:"password",value:L,onChange:z,placeholder:"Your application key",autoComplete:"new-password"}),N&&t.jsx("div",{className:"cn-conn-error",children:N}),t.jsx($e,{variant:"primary",onClick:W,disabled:C,children:C?"Saving…":"Save and Connect"})]}),t.jsxs("div",{className:"cn-pull-config",children:[t.jsxs("div",{className:"cn-pull-config__row",children:[t.jsx($e,{variant:"secondary",onClick:A,disabled:m,children:m?"Syncing…":"Pull Configuration"}),t.jsx("span",{className:"cn-pull-config__timestamp",children:g?`Last synced (UTC): ${g}`:"Not synced yet"})]}),v==="error"&&t.jsx("p",{className:"cn-pull-config__desc cn-pull-config__desc--error",children:"Sync failed. Please try again."}),!v&&t.jsx("p",{className:"cn-pull-config__desc",children:"Manually pull the latest configuration including autoblocking. Syncs automatically every 24 hours."})]}),o&&c&&t.jsx("a",{className:"cn-dom-link",href:`${Qe}/#/configuration`,target:"_blank",rel:"noopener noreferrer",children:"Advanced Configuration →"})]})}function ri(){var N,D;const{tier:o}=Be(),{dashboard:i}=vt(),[c,p]=j.useState(()=>new Set),d=j.useCallback(I=>{p(A=>new Set([...A,I]))},[]),g=((N=window.cnReactData)==null?void 0:N.notificationRules)||[],m=i===null,f=(D=i==null?void 0:i.analytics)==null?void 0:D.cycleUsage,v=(f==null?void 0:f.visits)||0,w=(f==null?void 0:f.threshold)||0,x=w>0?v/w*100:0,S=o==="free"&&w>0&&v>=w,L=o==="free"&&w>0&&v>=w*.7&&v{var A,W;if(m)return{};const I={};for(const $ of g){if((A=$.condition)!=null&&A.tier&&$.condition.tier!==o)continue;if((W=$.condition)!=null&&W.usagePercent){const[K,Q]=$.condition.usagePercent;if(K!==null&&x=Q)continue}if(c.has($.id))continue;const O=I[$.slot];(!O||$.priority>O.priority)&&(I[$.slot]=$)}return I},[m,g,o,x,c]);function C(I){return I&&I.replace(/\{sessionTotal\}/g,w.toLocaleString()).replace(/\{sessionUsed\}/g,v.toLocaleString()).replace(/\{usagePercent\}/g,String(Math.round(x)))}function P(I){return I?{...I,title:C(I.title),description:C(I.description),headline:C(I.headline)}:null}return{topBar:P(z.topBar||null),sidebar:P(z.sidebar||null),dismiss:d,thresholdLocked:S,isNearLimit:L}}function li({onOpenPricingModal:o}){const{sidebar:i}=ri();return i?t.jsx(Fn,{title:"Upgrade to Pro",children:t.jsxs("div",{className:"cn-upsell-card",children:[t.jsx("p",{className:"cn-upsell-card__headline",children:i.headline}),t.jsx("ul",{className:"cn-upsell-card__features",children:i.features.map(c=>t.jsx("li",{children:c},c))}),t.jsx("button",{type:"button",className:"cn-button cn-button--upgrade cn-button--sm cn-upsell-card__cta",onClick:()=>o&&o(),children:i.cta.label})]})}):null}function nd({onActivate:o}){return t.jsxs("div",{className:"cn-score-hero",children:[t.jsx("div",{className:"cn-score-hero__icon","aria-hidden":"true",children:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),t.jsxs("div",{className:"cn-score-hero__body",children:[t.jsx("div",{className:"cn-score-hero__title",children:"You have a banner. Not compliance."}),t.jsx("div",{className:"cn-score-hero__summary",children:"A banner tells visitors about cookies. Compliance actually enforces the law."}),t.jsx("div",{className:"cn-score-hero__sub",children:"Free · Takes 60 seconds · No credit card"})]}),t.jsx("div",{className:"cn-score-hero__actions",children:t.jsx("button",{type:"button",className:"cn-score-hero__cta",onClick:o,children:"Activate Compliance →"})})]})}function td({sessionUsed:o=0,sessionTotal:i=0,activeLawsCount:c=0,uncategorizedScripts:p=0,autoblockingEnabled:d=!0}){const{tier:g,isPro:m}=Be(),v={basic:"Connect your site to unlock compliance features.",pro:c===0?"No regulations selected — add laws to activate consent enforcement":d?p>0?`${p} uncategorized tracker${p!==1?"s":""} need review`:"All protections active — trackers blocked, consent recorded":"Autoblocking disabled — trackers may load before consent"},w=t.jsxs(t.Fragment,{children:["Your visitors","’"," choices are being recorded ","—"," trackers are blocked."]});return t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Your Compliance Dashboard"}),t.jsxs("p",{className:"cn-protection-header__subtitle",children:[g==="free"?w:v[g]||"",m&&t.jsxs(t.Fragment,{children:[" ",t.jsx(wn,{})]})]})]})}const Bs=3;function si({onApply:o}){const[i,c]=j.useState(null),[p,d]=j.useState(!1),[g,m]=j.useState(""),[f,v]=j.useState(""),[w,x]=j.useState(0),S=Math.ceil(gr.length/Bs),L=gr.slice(w*Bs,(w+1)*Bs),z=async C=>{c(C.key),d(!0),m(""),v("");try{const P=await $u(C.key);P.warning&&m(P.warning),o&&o(C)}catch(P){c(null),v(P.message||"Failed to apply template. Please try again.")}finally{d(!1)}};return t.jsxs("div",{className:"cn-template-presets",children:[t.jsx("span",{className:"cn-section-label",children:"Choose a Template"}),g&&t.jsx("div",{className:"cn-template-presets__warning",children:g}),f&&t.jsx("div",{className:"cn-template-presets__error",children:f}),t.jsx("div",{className:"cn-template-presets__grid",children:L.map(C=>t.jsxs("div",{className:"cn-template-presets__card"+(i===C.key?" cn-template-presets__card--active":"")+(p?" cn-template-presets__card--loading":""),onClick:()=>!p&&z(C),children:[t.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"120px"},children:t.jsx(ei,{preset:C,isActive:i===C.key})}),t.jsx("div",{className:"cn-template-presets__label",children:C.label}),t.jsx("div",{className:"cn-template-card__descriptor",children:ni(C.position,C.displayType)})]},C.key))},w),S>1&&t.jsxs("div",{className:"cn-template-presets__pagination",children:[t.jsx("button",{className:"cn-template-presets__page-btn",disabled:w===0,onClick:()=>x(w-1),"aria-label":"Previous page",children:"‹"}),t.jsxs("span",{className:"cn-template-presets__page-count",children:["Page ",w+1," of ",S," (",gr.length," templates)"]}),t.jsx("button",{className:"cn-template-presets__page-btn",disabled:w===S-1,onClick:()=>x(w+1),"aria-label":"Next page",children:"›"})]})]})}const we={container:"_container_nva6m_2",grid:"_grid_nva6m_8",card:"_card_nva6m_16",cardSelected:"_cardSelected_nva6m_32",geoArt:"_geoArt_nva6m_38",lawName:"_lawName_nva6m_47",jurisdiction:"_jurisdiction_nva6m_54",hiddenCheckbox:"_hiddenCheckbox_nva6m_60",checkmark:"_checkmark_nva6m_72",autoBadge:"_autoBadge_nva6m_88",detail:"_detail_nva6m_102",detailHeader:"_detailHeader_nva6m_112",detailTitle:"_detailTitle_nva6m_119",detailJurisdiction:"_detailJurisdiction_nva6m_125",detailClose:"_detailClose_nva6m_131",detailSection:"_detailSection_nva6m_144",detailSectionLabel:"_detailSectionLabel_nva6m_148",detailOverview:"_detailOverview_nva6m_157",detailList:"_detailList_nva6m_163",detailListItem:"_detailListItem_nva6m_172",detailEnforcement:"_detailEnforcement_nva6m_188",detailEmpty:"_detailEmpty_nva6m_197",detailEmptyArrow:"_detailEmptyArrow_nva6m_208",detailEmptyText:"_detailEmptyText_nva6m_215",detailDnsHelp:"_detailDnsHelp_nva6m_222",dnsInput:"_dnsInput_nva6m_263"},Os=[{key:"gdpr",name:"GDPR",jurisdiction:"European Union",description:"General Data Protection Regulation",locales:["de","fr","it","es","nl","pl","pt","sv","el","de_DE","fr_FR","it_IT","es_ES","nl_NL","pl_PL","pt_PT","sv_SE","el_GR","da_DK","fi","ro_RO","bg_BG","cs_CZ","et","hr","hu_HU","lt_LT","lv","sk_SK","sl_SI"],overview:"The EU’s gold standard for data privacy. Applies to any site with visitors from the 27 EU member states — regardless of where your business is based.",requirements:["Prior, informed consent before any non-essential cookies","Clear opt-out that’s as easy as opting in","Right to erasure (‘be forgotten’) on request","Data processing records & DPO for large processors"],product:["Consent banner with granular category controls","Consent proof stored per visitor","GDPR-mode autoblocking holds scripts until consent"],enforcement:"Fines up to €20M or 4% of global annual revenue. Enforced by national DPAs."},{key:"ccpa",name:"CCPA / CPRA",jurisdiction:"California, USA",description:"California Consumer Privacy Act",locales:["en_US"],overview:"California’s comprehensive privacy law, upgraded by CPRA in 2023. If you serve California residents, it applies — even if you’re outside the US.",requirements:["Opt-out of sale or sharing of personal data","Honor Global Privacy Control (GPC) signals automatically","Annual privacy policy updates","Right to know, delete, and correct personal data"],product:["GPC signal detection and automatic opt-out","Do Not Sell link insertion","Consent-mode compatible analytics opt-out"],enforcement:"Fines up to $7,500 per intentional violation. Enforced by the California Privacy Protection Agency."},{key:"otherus",name:"US State Laws",jurisdiction:"United States",description:"Virginia, Colorado, Connecticut, and more",locales:["en_US"],overview:"Virginia, Colorado, Connecticut, Utah, Montana, Texas, Oregon, and more have passed comprehensive privacy laws. The landscape is evolving fast.",requirements:["Consent for sensitive data processing","Universal opt-out mechanism support (like GPC)","Right to access, correct, delete, and opt out of targeted advertising","Data protection assessments for high-risk processing"],product:["State-specific banner rules via geolocation","Opt-out of targeted advertising flow","Consent records per jurisdiction"],enforcement:"Fines from $7,500–$20,000 per violation depending on state. Enforced by state attorneys general."},{key:"ukpecr",name:"UK PECR",jurisdiction:"United Kingdom",description:"Privacy and Electronic Communications Regulations",locales:["en_GB"],overview:"The UK’s post-Brexit equivalent to GDPR’s cookie rules. Applies to any site with UK visitors. Enforced by the ICO, which has been increasingly active.",requirements:["Prior consent for analytics and marketing cookies","Clear information about what cookies do","Easy withdrawal of consent","Legitimate interest cannot be used for tracking cookies"],product:["UK-specific consent banner variant","ICO-compliant consent language","Consent proof storage"],enforcement:"Fines up to £17.5M or 4% of global turnover. Enforced by the ICO."},{key:"lgpd",name:"LGPD",jurisdiction:"Brazil",description:"Lei Geral de Proteção de Dados",locales:["pt_BR"],overview:"Brazil’s General Data Protection Law covers 214 million people. Modeled on GDPR, it requires a lawful basis for processing and strong user rights.",requirements:["Valid lawful basis for each data processing activity","Clear, granular consent for non-essential cookies","Right to access, correct, delete, and revoke consent","Report breaches within 2 business days"],product:["LGPD-mode consent banner with Portuguese language support","Consent revocation flow","Breach-ready consent audit trail"],enforcement:"Fines up to 2% of Brazil revenue, capped at R$50M per violation. Enforced by the ANPD."},{key:"pipeda",name:"PIPEDA",jurisdiction:"Canada",description:"Personal Information Protection and Electronic Documents Act",locales:["en_CA","fr_CA"],overview:"Canada’s federal privacy law. Bill C-27 (CPPA) reform is underway and will bring requirements closer to GDPR. Applies to commercial activity across Canada.",requirements:["Express consent for collection, use, and disclosure of personal data","Privacy policy clearly explaining data use","Individual access and correction rights","Breach reporting to the Privacy Commissioner"],product:["PIPEDA-compliant consent banner","English + French bilingual support","Consent records with timestamps"],enforcement:"Fines up to CAD $100,000. Enforced by the Office of the Privacy Commissioner of Canada."},{key:"popia",name:"POPIA",jurisdiction:"South Africa",description:"Protection of Personal Information Act",locales:["af_ZA"],overview:"South Africa’s Protection of Personal Information Act took full effect in 2021. Applies to any business processing data about South African residents.",requirements:["Lawful basis for all personal information processing","Consent for direct marketing and cookie use","Data subject rights: access, correction, deletion","Appoint an Information Officer"],product:["POPIA-compliant consent banner","Afrikaans language support","Consent audit trail"],enforcement:"Fines up to ZAR 10M or 10 years imprisonment. Enforced by the Information Regulator."}];function rd(o){if(!o)return[];const i=o.toLowerCase(),c=i.split("_")[0];return Os.filter(p=>p.locales.some(d=>d.toLowerCase()===i||d.toLowerCase()===c)).map(p=>p.key)}const ld=["M40.00,4.80L40.75,6.96L43.04,7.01L41.22,8.40L41.88,10.59L40.00,9.28L38.12,10.59L38.78,8.40L36.96,7.01L39.25,6.96Z","M50.60,7.64L50.17,9.89L52.13,11.08L49.86,11.36L49.33,13.59L48.36,11.52L46.08,11.71L47.75,10.15L46.86,8.03L48.87,9.14Z","M58.36,15.40L56.86,17.13L57.97,19.14L55.85,18.25L54.29,19.92L54.48,17.64L52.41,16.67L54.64,16.14L54.92,13.87L56.11,15.83Z","M61.20,26.00L59.04,26.75L58.99,29.04L57.60,27.22L55.41,27.88L56.72,26.00L55.41,24.12L57.60,24.78L58.99,22.96L59.04,25.25Z","M58.36,36.60L56.11,36.17L54.92,38.13L54.64,35.86L52.41,35.33L54.48,34.36L54.29,32.08L55.85,33.75L57.97,32.86L56.86,34.87Z","M50.60,44.36L48.87,42.86L46.86,43.97L47.75,41.85L46.08,40.29L48.36,40.48L49.33,38.41L49.86,40.64L52.13,40.92L50.17,42.11Z","M40.00,47.20L39.25,45.04L36.96,44.99L38.78,43.60L38.12,41.41L40.00,42.72L41.88,41.41L41.22,43.60L43.04,44.99L40.75,45.04Z","M29.40,44.36L29.83,42.11L27.87,40.92L30.14,40.64L30.67,38.41L31.64,40.48L33.92,40.29L32.25,41.85L33.14,43.97L31.13,42.86Z","M21.64,36.60L23.14,34.87L22.03,32.86L24.15,33.75L25.71,32.08L25.52,34.36L27.59,35.33L25.36,35.86L25.08,38.13L23.89,36.17Z","M18.80,26.00L20.96,25.25L21.01,22.96L22.40,24.78L24.59,24.12L23.28,26.00L24.59,27.88L22.40,27.22L21.01,29.04L20.96,26.75Z","M21.64,15.40L23.89,15.83L25.08,13.87L25.36,16.14L27.59,16.67L25.52,17.64L25.71,19.92L24.15,18.25L22.03,19.14L23.14,17.13Z","M29.40,7.64L31.13,9.14L33.14,8.03L32.25,10.15L33.92,11.71L31.64,11.52L30.67,13.59L30.14,11.36L27.87,11.08L29.83,9.89Z"];function sd(){return t.jsx("svg",{viewBox:"0 0 80 52",fill:"none",style:{width:"100%",height:"auto"},children:ld.map((o,i)=>t.jsx("path",{d:o,fill:"#20c19e",opacity:"0.9"},i))})}function ad(){return t.jsx("svg",{viewBox:"0 0 80 52",style:{width:"100%",height:"auto"},children:t.jsx("path",{d:"M37.513,42.904L38.238,43.379L37.825,43.645ZM37.052,44.75L37.717,45.823L37.272,45.618ZM35.977,42.471L35.977,42.471L35.977,42.471ZM35.268,39.936L35.268,39.936L35.268,39.936ZM33.989,42.904L33.989,42.904L33.989,42.904ZM33.676,39.32L34.798,39.964L33.73,39.76ZM32.497,39.347L33.222,39.384L32.807,39.892ZM31.86,39.021L31.86,39.021L31.86,39.021ZM29.205,3L32.401,3.908L38.713,5.758L41.841,6.576L41.84,6.58L38.653,18.933L41.444,23.13L44.007,26.988L48.051,33.092L52.339,39.534L52.222,40.059L52.645,40.847L52.88,42.027L53.42,42.959L52.253,43.484L51.779,44.08L51.723,45.075L51.378,45.722L50.695,46.134L50.495,47.457L51.101,47.842L50.851,48.976L50.148,49L41.666,47.998L41.371,47.343L41.515,45.403L41.115,44.386L39.247,42.072L38.422,41.969L38.28,40.638L37.359,40.575L36.115,39.635L36.034,39.084L35.246,38.245L34.184,37.993L33.352,37.495L32.221,37.309L31.791,36.609L32.419,34.386L31.689,33.643L31.931,33.211L30.973,31.644L30.057,29.011L29.65,28.484L29.661,27.639L30.53,26.451L30.232,25.596L29.675,25.538L28.998,24.284L29.024,22.847L29.328,21.783L29.707,21.754L29.599,22.695L30.309,23.509L30.302,22.525L29.816,21.111L30.434,20.929L30.14,20.407L29.328,21.612L28.616,20.617L28.022,20.414L28.453,19.444L28.184,18.476L27.692,17.819L26.886,15.851L27.158,15.473L27.119,14.107L27.54,13.351L27.621,12.162L26.58,9.935L26.661,9.167L27.876,7.733L28.302,6.532L28.962,5.414L29.033,4.098L28.808,3.838Z",fill:"rgba(32,193,158,0.15)",stroke:"#20c19e",strokeWidth:1.2,strokeLinejoin:"round"})})}function od(){return t.jsx("div",{style:{width:46,height:46,margin:"0 auto"},children:t.jsx("div",{"data-geo":"us",style:{width:"100%",height:"100%",lineHeight:0},dangerouslySetInnerHTML:{__html:` Created by potrace 1.10, written by Peter Selinger 2001-2011 `}})})}function id(){return t.jsx("div",{style:{width:46,height:46,margin:"0 auto"},children:t.jsx("div",{"data-geo":"gb",style:{width:"100%",height:"100%",lineHeight:0},dangerouslySetInnerHTML:{__html:` Created by potrace 1.10, written by Peter Selinger 2001-2011 `}})})}function cd(){return t.jsx("div",{style:{width:46,height:46,margin:"0 auto"},children:t.jsx("div",{"data-geo":"br",style:{width:"100%",height:"100%",lineHeight:0},dangerouslySetInnerHTML:{__html:` Created by potrace 1.10, written by Peter Selinger 2001-2011 `}})})}function ud(){return t.jsx("div",{style:{width:46,height:46,margin:"0 auto"},children:t.jsx("div",{"data-geo":"ca",style:{width:"100%",height:"100%",lineHeight:0},dangerouslySetInnerHTML:{__html:` Created by potrace 1.10, written by Peter Selinger 2001-2011 `}})})}function dd(){return t.jsx("div",{style:{width:46,height:46,margin:"0 auto"},children:t.jsx("div",{"data-geo":"za",style:{width:"100%",height:"100%",lineHeight:0},dangerouslySetInnerHTML:{__html:` Created by potrace 1.10, written by Peter Selinger 2001-2011 `}})})}const pd={gdpr:sd,ccpa:ad,otherus:od,ukpecr:id,lgpd:cd,pipeda:ud,popia:dd};function ai({selected:o,onChange:i,dnsUrl:c,onDnsUrlChange:p}){const g=(window.cnReactData||{}).siteLocale||"",[m,f]=j.useState([]),[v,w]=j.useState(null),[x,S]=j.useState(null),L=o,z=x??L;j.useEffect(()=>{const A=rd(g);f(A),o.length===0&&A.length>0&&i(A),A.length>0&&w(A[0])},[]);const C=A=>{w(A);const W=x??L,$=W.includes(A)?W.filter(O=>O!==A):[...W,A];S($),i&&i($)},P=(A,W)=>{A.stopPropagation();const $=x??L,O=$.includes(W)?$.filter(K=>K!==W):[...$,W];S(O),i&&i(O)},N=()=>{w(null)},D=v?Os.find(A=>A.key===v):null,I=D&&(D.key==="ccpa"||D.key==="otherus");return t.jsxs("div",{className:we.container,children:[t.jsx("div",{children:t.jsx("div",{className:we.grid,children:Os.map(A=>{const W=z.includes(A.key),$=m.includes(A.key),O=pd[A.key];return t.jsxs("div",{className:we.card+(W?" "+we.cardSelected:""),onClick:()=>C(A.key),role:"button",tabIndex:0,onKeyDown:K=>{(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),C(A.key))},children:[$&&t.jsx("span",{className:we.autoBadge,children:"Auto-detected"}),W&&t.jsx("span",{className:we.checkmark,children:"✓"}),t.jsx("input",{type:"checkbox",className:we.hiddenCheckbox,checked:W,onChange:K=>P(K,A.key),onClick:K=>K.stopPropagation(),tabIndex:-1,"aria-label":`Select ${A.name}`}),t.jsx("div",{className:we.geoArt,children:O&&t.jsx(O,{})}),t.jsx("div",{className:we.lawName,children:A.name}),t.jsx("div",{className:we.jurisdiction,children:A.jurisdiction})]},A.key)})})}),D?t.jsxs("div",{className:we.detail,children:[t.jsxs("div",{className:we.detailHeader,children:[t.jsxs("div",{children:[t.jsx("div",{className:we.detailTitle,children:D.name}),t.jsx("div",{className:we.detailJurisdiction,children:D.jurisdiction})]}),t.jsx("button",{className:we.detailClose,onClick:N,type:"button","aria-label":"Close detail panel",children:"×"})]}),t.jsxs("div",{className:we.detailSection,children:[t.jsx("div",{className:we.detailSectionLabel,children:"What it covers"}),t.jsx("div",{className:we.detailOverview,children:D.overview})]}),t.jsxs("div",{className:we.detailSection,children:[t.jsx("div",{className:we.detailSectionLabel,children:"Key requirements"}),t.jsx("ul",{className:we.detailList,children:D.requirements.map((A,W)=>t.jsx("li",{className:we.detailListItem,children:A},W))})]}),t.jsxs("div",{className:we.detailSection,children:[t.jsx("div",{className:we.detailSectionLabel,children:"What Cookie Compliance does"}),t.jsx("ul",{className:we.detailList,children:D.product.map((A,W)=>t.jsx("li",{className:we.detailListItem,children:A},W))})]}),t.jsx("div",{className:we.detailEnforcement,children:D.enforcement}),I&&t.jsxs("div",{className:we.detailSection,style:{marginTop:14},children:[t.jsx("div",{className:we.detailSectionLabel,children:"Do Not Sell URL"}),t.jsx("p",{className:we.detailDnsHelp,children:"Required if you advertise to California residents. This is a page on your site where visitors can request you stop selling or sharing their personal data."}),t.jsx("input",{id:"cn-dns-url",type:"url",className:we.dnsInput,value:c||"",onChange:A=>p&&p(A.target.value),placeholder:"https://example.com/do-not-sell"}),t.jsx("a",{href:"https://oag.ca.gov/privacy/ccpa",target:"_blank",rel:"noreferrer",style:{fontSize:12,color:"#0073aa",display:"inline-block",marginTop:4},children:"What is this? →"})]})]},D.key):t.jsxs("div",{className:we.detailEmpty,children:[t.jsx("div",{className:we.detailEmptyArrow,children:"←"}),t.jsx("div",{className:we.detailEmptyText,children:"Select a law to see what it covers and what compliance looks like for your site."})]})]})}const oi=[{code:"fr",name:"French"},{code:"es",name:"Spanish"},{code:"de",name:"German"},{code:"it",name:"Italian"},{code:"el",name:"Greek"},{code:"nl",name:"Dutch"},{code:"pt",name:"Portuguese"},{code:"pl",name:"Polish"},{code:"sv",name:"Swedish"}];function fd({onComplete:o,onOpenPricingModal:i}){const p=(window.cnReactData||{}).siteLocale||"",{isFree:d}=Be(),[g,m]=j.useState([]),[f,v]=j.useState(!1),[w,x]=j.useState(""),[S,L]=j.useState(!1);j.useEffect(()=>{var N;const P=(N=p.split("_")[0])==null?void 0:N.toLowerCase();P&&P!=="en"&&oi.some(D=>D.code===P)&&m([P])},[]);const z=P=>{m(N=>N.includes(P)?(L(!1),N.filter(D=>D!==P)):d?(N.length>=1&&L(!0),[P]):[...N,P])},C=async()=>{if(!f){v(!0),x("");try{await Gu(g),o&&o(g)}catch(P){x(P.message||"Failed to apply languages.")}finally{v(!1)}}};return t.jsxs("div",{className:"cn-language-picker",children:[d?t.jsxs("div",{style:{background:"#fff8f0",border:"1px solid #fed7aa",color:"#92400e",padding:"10px 14px",borderRadius:"6px",marginBottom:"12px",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"14px"},children:[t.jsx("span",{children:"Free plan: 1 language included"}),t.jsx("button",{type:"button",onClick:()=>i&&i(),style:{background:"none",border:"none",color:"#20c19e",fontWeight:600,cursor:"pointer",textDecoration:"underline",padding:0},children:"Upgrade to Pro for all 9 →"})]}):t.jsx("div",{style:{background:"#f0fdf4",border:"1px solid #a7f3d0",color:"#065f46",padding:"10px 14px",borderRadius:"6px",marginBottom:"12px",fontSize:"14px"},children:"Pro plan — all languages available ✓"}),t.jsx("p",{className:"cn-language-picker__hint",children:"Without a configured language, non-English visitors see browser-automated translations — unreviewed and potentially inaccurate. Selecting a language gives you full control over what they read."}),t.jsx("div",{className:"cn-language-picker__grid",children:oi.map(P=>{const N=g.includes(P.code),D=d&&!N&&g.length>=1;return t.jsxs("button",{type:"button",className:"cn-language-picker__badge"+(N?" cn-language-picker__badge--active":"")+(D?" cn-language-picker__badge--locked":""),onClick:()=>{D?i&&i():z(P.code)},"aria-label":D?`${P.name} — upgrade to Pro to unlock`:P.name,children:[P.name,D?" 🔒":""]},P.code)})}),S&&d&&t.jsx("div",{style:{color:"#92400e",fontSize:"13px",marginTop:"8px"},children:t.jsx("button",{type:"button",onClick:()=>i&&i(),style:{background:"none",border:"none",color:"#20c19e",fontWeight:600,cursor:"pointer",textDecoration:"underline",padding:0},children:"Upgrade to Pro to unlock all 9 languages →"})}),w&&t.jsx("div",{className:"cn-language-picker__error",children:w}),t.jsx("div",{className:"cn-language-picker__actions",children:t.jsx("button",{className:"cn-button cn-button--primary",onClick:C,disabled:f,type:"button",children:f?"Applying…":"Apply Languages"})})]})}const pl=[{key:"template",label:"Template"},{key:"laws",label:"Laws"},{key:"languages",label:"Languages"}];function hd({onTemplateApplied:o,initialLaws:i=[],onOpenPricingModal:c,totalScripts:p=0,uncategorizedScripts:d=0,isLoadingConfig:g=!1}){var te;const m=window.cnReactData||{},[f,v]=j.useState(0),w=zs((te=m.options)==null?void 0:te.app_id),[x,S]=j.useState(!!m.setupWizardComplete||localStorage.getItem(w)==="1"),[L,z]=j.useState(!1),[C,P]=j.useState(i),[N,D]=j.useState(""),[I,A]=j.useState(!1),[W,$]=j.useState(!1),[O,K]=j.useState("");if(x)return null;const Q=()=>{v(ee=>Math.min(ee+1,pl.length-1))},Z=async()=>{if(f===1&&C.length>0){$(!0),K("");try{const ee={};C.forEach((ie,ge)=>{ee[`cn_laws[${ge}]`]=ie}),await In("configure",{...ee,cn_revoke_consent:"1"},m.configureNonce||"")}catch{K("Failed to save laws. Please try again."),$(!1);return}$(!1)}v(ee=>Math.min(ee+1,pl.length-1))},T=()=>{v(ee=>Math.max(ee-1,0))},J=async()=>{var ee;A(!0);try{await Is()}catch{}window.cnReactData&&(window.cnReactData.setupWizardComplete=!0);try{localStorage.setItem(w,"1"),localStorage.setItem("cn_setup_just_finished_"+(((ee=m.options)==null?void 0:ee.app_id)||"default"),"1")}catch{}window.location.reload()},me=f===pl.length-1;return t.jsxs(t.Fragment,{children:[f===0&&t.jsxs("div",{className:"cn-first-run__connected-notice",children:[t.jsx("span",{className:"cn-first-run__connected-check",children:"✓"}),t.jsxs("div",{children:[t.jsx("strong",{children:"Your account is connected."})," ","Select your template, laws, and languages to finalize your setup.",t.jsxs("span",{className:"cn-first-run__connected-hint",children:[" ",g?t.jsx("span",{style:{opacity:.7},children:"Checking site for trackers..."}):t.jsxs(t.Fragment,{children:[p>0?`We found ${p} tracker${p!==1?"s":""} on your site. `:"","When done, you will be guided to select your consent modes",p>0?` and review ${d>0?`${d} uncategorized tracker${d!==1?"s":""}`:"your trackers"}.`:" and set up your tracker protection."]})]})]})]}),t.jsxs("div",{className:"cn-first-run",children:[t.jsxs("div",{className:"cn-first-run__header",children:[t.jsx("h2",{className:"cn-first-run__title",children:"Complete Your Setup"}),t.jsx("button",{className:"cn-first-run__dismiss",onClick:J,type:"button",children:"×"})]}),t.jsx("div",{className:"cn-first-run__progress",children:pl.map((ee,ie)=>t.jsxs("div",{className:"cn-first-run__step-indicator"+(ie===f?" cn-first-run__step-indicator--active":"")+(ie{z(!0),o&&o(ee.key)}}),L&&t.jsxs("p",{className:"cn-first-run__applied",children:["✓"," Template applied"]})]}),f===1&&t.jsxs("div",{className:"cn-first-run__step",children:[t.jsx("h3",{children:"Select Your Laws"}),t.jsx("p",{children:"Choose which privacy regulations apply to your site."}),t.jsx(ai,{selected:C,onChange:ee=>{P(ee),K("")},dnsUrl:N,onDnsUrlChange:D}),O&&t.jsx("p",{style:{color:"var(--cn-red)",fontSize:13,marginTop:8},children:O})]}),f===2&&t.jsxs("div",{className:"cn-first-run__step",children:[t.jsx("h3",{children:"Add Languages"}),t.jsx("p",{children:"Select additional languages for your consent banner."}),t.jsx(fd,{onComplete:J,onOpenPricingModal:c})]})]}),t.jsxs("div",{className:"cn-first-run__nav",children:[f>0&&t.jsx("button",{className:"cn-button cn-button--outline",onClick:T,type:"button",children:"← Back"}),t.jsxs("div",{className:"cn-first-run__nav-right",children:[!me&&t.jsx("button",{className:"cn-button cn-button--ghost",onClick:Q,type:"button",children:"Skip"}),!me&&t.jsx("button",{className:"cn-button cn-button--primary",onClick:Z,disabled:W,type:"button",children:W?"Saving…":"Next →"}),me&&t.jsx("button",{className:"cn-button cn-button--primary",onClick:J,disabled:I,type:"button",children:I?"Finishing…":"Apply & Finish"})]})]})]})]})}function md(){return"Updated "+new Date().toLocaleDateString("en-US",{month:"short",year:"numeric"})}function gd({consentModes:o={},regulations:i={}}){const c=!!o.google,p=!!(i.ccpa||i.otherus),m=[{tag:"enforcement",tagLabel:"Enforcement",title:"France fined a bakery chain €150,000 for cookie violations",desc:"The bakery’s website used Google Analytics without asking visitors first. The fine was 3× their monthly revenue.",status:c?"You’re protected — Google Analytics is blocked until visitors consent":"Unprotected — enable Google Consent Mode to fix this",statusVariant:c?"ok":"warn"},{tag:"update",tagLabel:"Update",title:"Google ending third-party cookies delayed again",desc:"Google pushed back their timeline to late 2026. Sites that already have consent management won’t need to change anything.",status:"No action needed — your consent banner already handles this",statusVariant:"ok"},{tag:"regulation",tagLabel:"Regulation",title:"New US state privacy laws take effect July 2026",desc:"Four more states are adding GDPR-like requirements. Sites serving US visitors will need consent mechanisms.",status:p?"You’re covered — your banner applies to US visitors":"No US law configured — add CCPA or US States in your regulation settings",statusVariant:p?"ok":"warn"}];return t.jsxs("div",{className:"cn-threat-section",children:[t.jsxs("div",{className:"cn-threat-section__header",children:[t.jsx("span",{className:"cn-threat-section__title",children:"Threat Intelligence"}),t.jsx("span",{className:"cn-threat-section__updated",children:md()})]}),t.jsx("div",{className:"cn-threat-list",children:m.map((f,v)=>t.jsxs("div",{className:"cn-threat-item",children:[t.jsxs("div",{className:"cn-threat-item__title",children:[t.jsx("span",{className:`cn-threat-tag cn-threat-tag--${f.tag}`,children:f.tagLabel}),f.title]}),t.jsx("div",{className:"cn-threat-item__desc",children:f.desc}),t.jsx("div",{className:`cn-threat-item__status cn-threat-item__status--${f.statusVariant}`,children:f.status})]},v))})]})}function It({title:o,onClose:i,children:c,footer:p,scrollTrigger:d,isClosing:g,onExitComplete:m}){const f=j.useRef(null);return j.useEffect(()=>{var v;g||(v=f.current)==null||v.scrollIntoView({behavior:"smooth",block:"start"})},[d,g]),t.jsxs("div",{className:`cn-inline-panel${g?" cn-inline-panel--closing":""}`,ref:f,onTransitionEnd:g?m:void 0,children:[t.jsxs("div",{className:"cn-inline-panel__header",children:[t.jsx("h3",{className:"cn-inline-panel__title",children:o}),t.jsx("button",{className:"cn-inline-panel__dismiss",onClick:i,"aria-label":"Close",children:"×"})]}),t.jsx("div",{className:"cn-inline-panel__body",children:c}),p&&t.jsx("div",{className:"cn-inline-panel__footer",children:p})]})}const ye={loading:"_loading_1lg0v_1",stepContent:"_stepContent_1lg0v_8",stepDesc:"_stepDesc_1lg0v_12",scanSummary:"_scanSummary_1lg0v_19",scanStat:"_scanStat_1lg0v_30",scanStatWarn:"_scanStatWarn_1lg0v_36",scanDivider:"_scanDivider_1lg0v_40",catList:"_catList_1lg0v_45",catSection:"_catSection_1lg0v_51",catHeader:"_catHeader_1lg0v_58",catHeaderLeft:"_catHeaderLeft_1lg0v_73",catDot:"_catDot_1lg0v_79",catName:"_catName_1lg0v_87",catCount:"_catCount_1lg0v_93",catWarnBadge:"_catWarnBadge_1lg0v_98",catChevron:"_catChevron_1lg0v_107",catDesc:"_catDesc_1lg0v_112",catDescInner:"_catDescInner_1lg0v_119",catBody:"_catBody_1lg0v_126",providerRow:"_providerRow_1lg0v_130",providerInfo:"_providerInfo_1lg0v_141",providerName:"_providerName_1lg0v_148",providerUrl:"_providerUrl_1lg0v_154",providerMeta:"_providerMeta_1lg0v_163",patternCount:"_patternCount_1lg0v_170",statusPillOk:"_statusPillOk_1lg0v_175",statusPillWarn:"_statusPillWarn_1lg0v_184",issueBanner:"_issueBanner_1lg0v_193",lastSynced:"_lastSynced_1lg0v_211",portalLink:"_portalLink_1lg0v_219",basicPanel:"_basicPanel_1lg0v_229",basicIcon:"_basicIcon_1lg0v_234",basicTitle:"_basicTitle_1lg0v_239",basicDesc:"_basicDesc_1lg0v_246"},vd=[{id:1,name:"Basic Operations",color:"#20c19e",dot:"green",desc:"Essential for your site to function"},{id:2,name:"Content Personalization",color:"#3b82f6",dot:"blue",desc:"Personalize content for visitors"},{id:3,name:"Site Optimization",color:"#eab308",dot:"yellow",desc:"Measure traffic and performance"},{id:4,name:"Ad Personalization",color:"#ef4444",dot:"red",desc:"Show targeted advertising"}],yd={id:0,name:"Uncategorized",color:"#9ca3af",dot:"gray",desc:"These trackers run before visitors agree — highest compliance risk"};function _d({color:o}){return t.jsx("span",{className:ye.catDot,style:{background:o}})}function xd({provider:o,patternCount:i}){return t.jsxs("div",{className:ye.providerRow,children:[t.jsxs("div",{className:ye.providerInfo,children:[t.jsx("span",{className:ye.providerName,children:o.ProviderName||o.Name||o.ProviderID||"Unknown tracker"}),o.ProviderURL&&t.jsx("span",{className:ye.providerUrl,children:o.ProviderURL})]}),t.jsxs("div",{className:ye.providerMeta,children:[t.jsxs("span",{className:ye.patternCount,children:[i," pattern",i!==1?"s":""]}),o.CategoryID>0?t.jsx("span",{className:ye.statusPillOk,children:"Categorized"}):t.jsx("span",{className:ye.statusPillWarn,children:"Fires without consent"})]})]})}function ii({category:o,providers:i,patterns:c,defaultOpen:p}){const[d,g]=j.useState(p),m=j.useMemo(()=>{const f={};return i.forEach(v=>{f[v.ProviderID]=(c||[]).filter(w=>String(w.ProviderID)===String(v.ProviderID)).length}),f},[i,c]);return t.jsxs("div",{className:ye.catSection,children:[t.jsxs("button",{className:ye.catHeader,onClick:()=>g(f=>!f),type:"button",children:[t.jsxs("div",{className:ye.catHeaderLeft,children:[t.jsx(_d,{color:o.color}),t.jsx("span",{className:ye.catName,children:o.name}),t.jsxs("span",{className:ye.catCount,children:["(",i.length,")"]}),o.id===0&&t.jsx("span",{className:ye.catWarnBadge,children:"Firing without consent"})]}),t.jsx("span",{className:ye.catChevron,children:d?"▾":"▸"})]}),!d&&t.jsx("div",{className:ye.catDesc,children:o.desc}),d&&t.jsxs("div",{className:ye.catBody,children:[t.jsx("div",{className:ye.catDescInner,children:o.desc}),i.map(f=>t.jsx(xd,{provider:f,patternCount:m[f.ProviderID]||0},f.ProviderID))]})]})}function jd({onOpenWelcomeModal:o}){return t.jsxs("div",{className:ye.basicPanel,children:[t.jsx("div",{className:ye.basicIcon,children:"🛡️"}),t.jsx("h4",{className:ye.basicTitle,children:"Your banner shows — but trackers run before visitors agree"}),t.jsx("p",{className:ye.basicDesc,children:"Without tracker protection, trackers like Google Analytics, Meta Pixel, and ad tags run immediately when your page loads — before visitors have a chance to agree or decline. This can violate GDPR, CCPA, and other privacy regulations."}),t.jsx($e,{variant:"primary",onClick:o,children:"Connect to auto-detect and block trackers →"})]})}function wd({onClose:o,onOpenWelcomeModal:i,scrollTrigger:c}){var W,$;const{config:p,isLoadingConfig:d,refetchConfig:g}=Mt(),{isBasic:m}=Be(),f=(p==null?void 0:p.blocking)||{},v=f.providers||[],w=f.patterns||[],[x,S]=j.useState(!1),[L,z]=j.useState(null),C=j.useMemo(()=>{const O={};return v.forEach(K=>{const Q=K.CategoryID||0;O[Q]||(O[Q]=[]),O[Q].push(K)}),O},[v]),P=C[0]||[],N=v.length,D=N-P.length,I=async()=>{S(!0),z(null),v.length;try{await Hu(),await g(),z({text:"Sync complete.",type:"success"})}catch(O){z({text:(O==null?void 0:O.message)||"Sync failed. Please try again.",type:"error"})}finally{S(!1)}};if(m)return t.jsx(It,{title:"Your Trackers",onClose:o,scrollTrigger:c,children:t.jsx(jd,{onOpenWelcomeModal:i})});const A=t.jsxs(t.Fragment,{children:[t.jsx("a",{href:Qe+"/#/autoblocking",target:"_blank",rel:"noopener noreferrer",className:ye.portalLink,children:"Manage trackers in portal"}),t.jsx($e,{variant:"secondary",onClick:I,disabled:x,children:x?"Refreshing…":"Refresh"})]});return t.jsxs(It,{title:"Your Trackers",onClose:o,footer:A,scrollTrigger:c,children:[d&&t.jsx("div",{className:ye.loading,children:"Loading script data…"}),L&&t.jsx("div",{className:ye.stepContent,style:{padding:"6px 0"},children:t.jsx("p",{style:{color:L.type==="error"?"var(--cn-crit-icon, #dc3545)":"var(--cn-ok-icon, #20c19e)",margin:0,fontSize:"var(--cn-text-sm)"},children:L.text})}),!d&&v.length===0&&t.jsx("div",{className:ye.stepContent,children:t.jsx("p",{className:ye.stepDesc,children:f.lastUpdated?"No known trackers found in the provider database for your site. Your banner is active and blocking is configured.":"Your domain was recently added. Tracker data typically populates within 24–48 hours as your configuration syncs. Click Refresh to check now."})}),!d&&v.length>0&&t.jsxs("div",{className:ye.stepContent,children:[t.jsxs("div",{className:ye.scanSummary,children:[t.jsxs("span",{className:ye.scanStat,children:[N," tracker",N!==1?"s":""," detected"]}),t.jsx("span",{className:ye.scanDivider,children:"·"}),t.jsxs("span",{className:ye.scanStat,children:[D," categorized"]}),P.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:ye.scanDivider,children:"·"}),t.jsxs("span",{className:ye.scanStat+" "+ye.scanStatWarn,children:[P.length," uncategorized"]})]})]}),t.jsx("span",{className:ye.lastSynced,children:f.lastUpdated||(W=window.cnReactData)!=null&&W.lastSynced?`Last refreshed: ${f.lastUpdated||(($=window.cnReactData)==null?void 0:$.lastSynced)}`:"Not yet synced"}),P.length>0&&t.jsxs("div",{className:ye.issueBanner,children:["⚠"," ",P.length," tracker",P.length!==1?"s":""," firing without consent —"," ",t.jsx("a",{href:Qe+"/#/autoblocking",target:"_blank",rel:"noopener noreferrer",children:"manage in portal"})]}),t.jsxs("div",{className:ye.catList,children:[C[0]&&C[0].length>0&&t.jsx(ii,{category:yd,providers:C[0],patterns:w,defaultOpen:!0}),vd.map(O=>{const K=C[O.id]||[];return K.length===0?null:t.jsx(ii,{category:O,providers:K,patterns:w,defaultOpen:!1},O.id)})]})]})]})}function ci({onClose:o,onTemplateApplied:i,scrollTrigger:c,isClosing:p,appliedTemplateKey:d}){const[g,m]=j.useState(!1),[f,v]=j.useState(null),{hasPlatformConfig:w}=mr(),x=!d&&w,S=C=>{if(x&&!f){v(C);return}m(!0),i&&i(C.key||C)},L=()=>{f&&(m(!0),i&&i(f.key||f),v(null))},z=()=>{v(null)};return t.jsx(It,{title:"Banner Template",onClose:o,scrollTrigger:c,isClosing:p,children:f?t.jsxs("div",{className:"cn-wizard-confirm",children:[t.jsx("p",{className:"cn-wizard-confirm__text",children:"Your banner is currently configured in the Admin Portal. Applying this template will override your custom design."}),t.jsxs("div",{className:"cn-wizard-confirm__actions",children:[t.jsx("button",{className:"cn-button cn-button--outline",onClick:z,type:"button",children:"Cancel"}),t.jsx("button",{className:"cn-button cn-button--primary",onClick:L,type:"button",children:"Apply Template"})]})]}):g?t.jsxs("div",{className:"cn-wizard-success",children:[t.jsx("div",{className:"cn-wizard-success__icon",children:"✓"}),t.jsx("h3",{className:"cn-wizard-success__heading",children:"Template applied — your banner is live."}),t.jsx("p",{className:"cn-wizard-success__sub",children:"Customize text, colors, and advanced design in the web app."}),t.jsx("button",{className:"cn-button cn-button--primary",onClick:o,children:"Done"})]}):t.jsx(si,{onApply:S})})}function kd(){const[o,i]=j.useState(()=>{var d;const p=((d=window.cnReactData)==null?void 0:d.selectedLaws)||[];return Array.isArray(p)?p:Object.values(p)});return[o,p=>{i(p),window.cnReactData&&(window.cnReactData.selectedLaws=p)}]}function ui({onClose:o,onSave:i,scrollTrigger:c,isClosing:p}){const[d,g]=kd(),[m,f]=j.useState(""),[v,w]=j.useState(!1),[x,S]=j.useState(""),[L,z]=j.useState(!1);j.useEffect(()=>{var D,I;f(((I=(D=window.cnReactData)==null?void 0:D.options)==null?void 0:I.cn_do_not_sell_url)||""),S("")},[]);const C=async()=>{var D,I;w(!0),S("");try{const A={};d.forEach((W,$)=>{A["cn_laws["+$+"]"]=W}),await In("configure",{...A,cn_revoke_consent:"1"},((D=window.cnReactData)==null?void 0:D.configureNonce)||""),g(d),(I=window.cnReactData)!=null&&I.options&&(window.cnReactData.options.cn_do_not_sell_url=m),z(!0)}catch(A){S(A.message||"Failed to save laws.")}finally{w(!1)}},P=()=>{i&&i(d),o()};if(L)return t.jsx(It,{title:"Privacy Laws",onClose:P,scrollTrigger:c,isClosing:p,children:t.jsxs("div",{className:"cn-wizard-success",children:[t.jsx("div",{className:"cn-wizard-success__icon",children:"✓"}),t.jsx("h3",{className:"cn-wizard-success__heading",children:"Laws updated"}),t.jsx("button",{className:"cn-button cn-button--primary",onClick:P,children:"Done"})]})});const N=t.jsxs(t.Fragment,{children:[t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noreferrer",className:"cn-layer__link-btn",children:"Manage regulations in web app →"}),t.jsxs("div",{style:{display:"flex",gap:8},children:[t.jsx($e,{variant:"secondary",onClick:o,children:"Cancel"}),t.jsx($e,{variant:"primary",onClick:C,disabled:v,children:v?"Saving…":"Save laws"})]})]});return t.jsxs(It,{title:"Privacy Laws",onClose:o,scrollTrigger:c,isClosing:p,footer:N,children:[t.jsx(ai,{selected:d,onChange:g,dnsUrl:m,onDnsUrlChange:f}),x&&t.jsx("p",{style:{color:"var(--cn-red)",fontSize:13,marginTop:8},children:x})]})}const G={layout:"_layout_19w0d_48",modeList:"_modeList_19w0d_55",modeSection:"_modeSection_19w0d_63",modeSectionLabel:"_modeSectionLabel_19w0d_69",modeCard:"_modeCard_19w0d_79",modeCardActive:"_modeCardActive_19w0d_94",modeCardLocked:"_modeCardLocked_19w0d_100",modeCardProOverlay:"_modeCardProOverlay_19w0d_106",lockIconLarge:"_lockIconLarge_19w0d_121",modeCardProLabel:"_modeCardProLabel_19w0d_125",modeCardTop:"_modeCardTop_19w0d_131",modeCardName:"_modeCardName_19w0d_138",modeCardDesc:"_modeCardDesc_19w0d_144",statusDot:"_statusDot_19w0d_150",statusDotOn:"_statusDotOn_19w0d_158",statusDotOff:"_statusDotOff_19w0d_162",detailCol:"_detailCol_19w0d_166",detail:"_detail_19w0d_166",detailHeader:"_detailHeader_19w0d_179",detailTitle:"_detailTitle_19w0d_186",detailDesc:"_detailDesc_19w0d_192",detailFooter:"_detailFooter_19w0d_199",enableToggle:"_enableToggle_19w0d_207",enableToggleInput:"_enableToggleInput_19w0d_215",enableToggleTrack:"_enableToggleTrack_19w0d_222",enableToggleThumb:"_enableToggleThumb_19w0d_236",enableToggleLabel:"_enableToggleLabel_19w0d_251",signalConfig:"_signalConfig_19w0d_257",signalConfigTitle:"_signalConfigTitle_19w0d_265",groupRow:"_groupRow_19w0d_274",groupLabel:"_groupLabel_19w0d_281",groupSelect:"_groupSelect_19w0d_287",groupHint:"_groupHint_19w0d_305",advancedToggle:"_advancedToggle_19w0d_312",advancedGrid:"_advancedGrid_19w0d_327",advancedRow:"_advancedRow_19w0d_336",advancedLabel:"_advancedLabel_19w0d_343",subToggles:"_subToggles_19w0d_348",subToggleTitle:"_subToggleTitle_19w0d_354",subToggleRow:"_subToggleRow_19w0d_363",proGate:"_proGate_19w0d_373",proGateLink:"_proGateLink_19w0d_387"},_t=[{key:"google",name:"Google Consent Mode v2",shortName:"Google",group:"platform",pro:!1,description:"Required for GDPR compliance if you use Google Analytics, Google Ads, or Tag Manager"},{key:"facebook",name:"Facebook",shortName:"Facebook",group:"platform",pro:!0,description:"Required if you run Facebook Ads — stops Meta Pixel from firing before visitors agree"},{key:"microsoft",name:"Microsoft",shortName:"Microsoft",group:"platform",pro:!0,description:"Required if you use Microsoft Ads or Clarity — keeps Bing and analytics trackers compliant"},{key:"gpc",name:"Global Privacy Control",shortName:"GPC",group:"browser",pro:!0,description:"Honors visitors who’ve told their browser they don’t want to be tracked — required in California"},{key:"dnt",name:"Do Not Track",shortName:"DNT",group:"browser",pro:!1,description:"Honors the legacy ‘Do Not Track’ browser setting — good practice, not legally required"}],Nd=[{value:"passive",label:"Show passive notice",help:"Brief auto-dismiss confirmation that GPC was honored."},{value:"hidden",label:"Silent",help:"No on-screen indication. GPC is honored without notifying the visitor."},{value:"banner",label:"Show full banner",help:"The standard consent banner is still shown, even when GPC fires."}];function fl(o){return o===2?[{value:1,label:"Always (even on Reject)"},{value:4,label:"On Accept"}]:[{value:1,label:"Always (even on Reject)"},{value:3,label:"Balanced or above"},{value:4,label:"Accept All only"}]}function Sd(o,i={}){const c=o.google_consent_default||{},p=o.facebook_consent_default||{},d=o.microsoft_consent_default||{},g=Object.keys(c).length>0,m=Object.keys(p).length>0,f=Object.keys(d).length>0;return{googleEnabled:g,googleAdvertising:c.ad_storage??4,googleAnalytics:c.analytics_storage??3,googleFunctional:c.functionality_storage??3,googleAdStorage:c.ad_storage??4,googleAdPersonalization:c.ad_personalization??4,googleAdUserData:c.ad_user_data??4,googleAnalyticsStorage:c.analytics_storage??3,googleFunctionalityStorage:c.functionality_storage??3,googlePersonalizationStorage:c.personalization_storage??3,googleSecurityStorage:c.security_storage??3,facebookEnabled:m,facebookConsent:p.consent??4,microsoftEnabled:f,microsoftAdStorage:d.ad_storage??4,microsoftAnalyticsStorage:d.analytics_storage??3,microsoftPixie:!!d.pixie,microsoftClarity:!!d.clarity,gpcEnabled:!!(o.gpc_support??0),gpcBannerMode:i.gpcBannerMode||"passive",doNotTrack:!!(o.do_not_track??0)}}function Us(o){return{googleConsentMapAdStorage:o.googleEnabled?o.googleAdStorage:"",googleConsentMapAdPersonalization:o.googleEnabled?o.googleAdPersonalization:"",googleConsentMapAdUserData:o.googleEnabled?o.googleAdUserData:"",googleConsentMapAnalytics:o.googleEnabled?o.googleAnalyticsStorage:"",googleConsentMapFunctionality:o.googleEnabled?o.googleFunctionalityStorage:"",googleConsentMapPersonalization:o.googleEnabled?o.googlePersonalizationStorage:"",googleConsentMapSecurity:o.googleEnabled?o.googleSecurityStorage:"",facebookConsentMapConsent:o.facebookEnabled?o.facebookConsent:"",microsoftConsentMapAdStorage:o.microsoftEnabled?o.microsoftAdStorage:"",microsoftConsentMapAnalyticsStorage:o.microsoftEnabled?o.microsoftAnalyticsStorage:"",microsoftConsentModePixie:o.microsoftPixie?1:0,microsoftConsentModeClarity:o.microsoftClarity?1:0,gpcSupport:o.gpcEnabled?1:0,gpcBannerMode:o.gpcEnabled?o.gpcBannerMode||"passive":"",doNotTrack:o.doNotTrack?1:0}}function di({enabled:o}){return t.jsx("span",{className:`${G.statusDot} ${o?G.statusDotOn:G.statusDotOff}`})}function $s({label:o,value:i,onChange:c,consentChoices:p,disabled:d}){const g=fl(p);return t.jsxs("div",{className:G.groupRow,children:[t.jsx("span",{className:G.groupLabel,children:o}),t.jsx("select",{className:G.groupSelect,value:i,onChange:m=>c(Number(m.target.value)),disabled:d,children:g.map(m=>t.jsx("option",{value:m.value,children:m.label},m.value))})]})}function vr({label:o,checked:i,onChange:c}){return t.jsxs("label",{className:G.enableToggle,children:[t.jsx("input",{type:"checkbox",checked:i,onChange:p=>c(p.target.checked),className:G.enableToggleInput}),t.jsx("span",{className:G.enableToggleTrack,children:t.jsx("span",{className:G.enableToggleThumb})}),t.jsx("span",{className:G.enableToggleLabel,children:o})]})}function hl({locked:o,platformName:i,onUpgrade:c}){return t.jsxs("div",{className:G.proGate,children:[t.jsx("span",{children:o==="pro"?`Upgrade to Pro to enable ${i} Consent Mode.`:`Monthly visit limit reached — ${i} Consent Mode is paused until your visit count resets. Upgrade for unlimited visits.`}),t.jsx("button",{type:"button",className:G.proGateLink,onClick:c,children:"Upgrade →"})]})}function ml({onApply:o,hasChanges:i,saving:c,savedFlash:p,locked:d}){return t.jsx("div",{className:G.detailFooter,children:t.jsx($e,{variant:"primary",size:"sm",onClick:o,disabled:!i||c||d,children:c?"Applying…":p?"Saved ✓":"Apply"})})}function Cd({staged:o,set:i,consentChoices:c,proLocked:p,saving:d,hasChanges:g,savedFlash:m,onApply:f,onUpgrade:v}){const[w,x]=j.useState(!1),S=N=>{i("googleAdvertising",N),i("googleAdStorage",N),i("googleAdPersonalization",N),i("googleAdUserData",N)},L=N=>{i("googleAnalytics",N),i("googleAnalyticsStorage",N)},z=N=>{i("googleFunctional",N),i("googleFunctionalityStorage",N),i("googlePersonalizationStorage",N),i("googleSecurityStorage",N)},C=p,P=fl(c);return t.jsxs("div",{className:G.detail,children:[t.jsxs("div",{className:G.detailHeader,children:[t.jsx("div",{className:G.detailTitle,children:"Google Consent Mode v2"}),C==="pro"&&t.jsx(wn,{})]}),t.jsx("p",{className:G.detailDesc,children:"If you use Google Analytics, Google Ads, or Tag Manager, this tells Google how to handle your visitors’ data based on whether they consented. Required for GDPR compliance with Google tools."}),C?t.jsx(hl,{locked:C,platformName:"Google",onUpgrade:v}):t.jsxs(t.Fragment,{children:[t.jsx(vr,{label:o.googleEnabled?"Enabled":"Disabled",checked:o.googleEnabled,onChange:N=>i("googleEnabled",N)}),o.googleEnabled&&t.jsxs("div",{className:G.signalConfig,children:[t.jsx("div",{className:G.signalConfigTitle,children:"Signal mapping"}),t.jsx($s,{label:"Advertising",value:o.googleAdvertising,onChange:S,consentChoices:c}),t.jsx("p",{className:G.groupHint,children:"ad_storage, ad_personalization, ad_user_data — default: Accept All only. Most conservative."}),t.jsx($s,{label:"Analytics",value:o.googleAnalytics,onChange:L,consentChoices:c}),t.jsx("p",{className:G.groupHint,children:"analytics_storage — default: Balanced or above."}),t.jsx($s,{label:"Functional",value:o.googleFunctional,onChange:z,consentChoices:c}),t.jsx("p",{className:G.groupHint,children:"functionality_storage, personalization_storage, security_storage — default: Balanced or above."}),t.jsx("button",{className:G.advancedToggle,onClick:()=>x(N=>!N),type:"button",children:w?"▾ Hide per-signal controls":"▸ Advanced — per-signal control"}),w&&t.jsx("div",{className:G.advancedGrid,children:[["Ad Storage","googleAdStorage",P],["Ad Personalization","googleAdPersonalization",P],["Ad User Data","googleAdUserData",P],["Analytics Storage","googleAnalyticsStorage",P],["Functionality Storage","googleFunctionalityStorage",P],["Personalization Storage","googlePersonalizationStorage",P],["Security Storage","googleSecurityStorage",P]].map(([N,D,I])=>t.jsxs("div",{className:G.advancedRow,children:[t.jsx("span",{className:G.advancedLabel,children:N}),t.jsx("select",{className:G.groupSelect,value:o[D],onChange:A=>i(D,Number(A.target.value)),children:I.map(A=>t.jsx("option",{value:A.value,children:A.label},A.value))})]},D))})]})]}),t.jsx(ml,{onApply:f,hasChanges:g,saving:d,savedFlash:m,locked:C})]})}function bd({staged:o,set:i,consentChoices:c,proLocked:p,saving:d,hasChanges:g,savedFlash:m,onApply:f,onUpgrade:v}){const w=fl(c);return t.jsxs("div",{className:G.detail,children:[t.jsxs("div",{className:G.detailHeader,children:[t.jsx("div",{className:G.detailTitle,children:"Facebook"}),p==="pro"&&t.jsx(wn,{})]}),t.jsx("p",{className:G.detailDesc,children:"Stops the Meta Pixel from tracking your visitors until they agree. Without this, Facebook can receive data about visitors who never consented — a GDPR violation if you serve EU visitors."}),p?t.jsx(hl,{locked:p,platformName:"Facebook",onUpgrade:v}):t.jsxs(t.Fragment,{children:[t.jsx(vr,{label:o.facebookEnabled?"Enabled":"Disabled",checked:o.facebookEnabled,onChange:x=>i("facebookEnabled",x)}),o.facebookEnabled&&t.jsxs("div",{className:G.signalConfig,children:[t.jsx("div",{className:G.signalConfigTitle,children:"Signal mapping"}),t.jsxs("div",{className:G.groupRow,children:[t.jsx("span",{className:G.groupLabel,children:"Grant Pixel at"}),t.jsx("select",{className:G.groupSelect,value:o.facebookConsent,onChange:x=>i("facebookConsent",Number(x.target.value)),children:w.map(x=>t.jsx("option",{value:x.value,children:x.label},x.value))})]}),t.jsx("p",{className:G.groupHint,children:"Default: Accept All only."})]})]}),t.jsx(ml,{onApply:f,hasChanges:g,saving:d,savedFlash:m,locked:p})]})}function Ld({staged:o,set:i,consentChoices:c,proLocked:p,saving:d,hasChanges:g,savedFlash:m,onApply:f,onUpgrade:v}){const w=fl(c);return t.jsxs("div",{className:G.detail,children:[t.jsxs("div",{className:G.detailHeader,children:[t.jsx("div",{className:G.detailTitle,children:"Microsoft"}),p==="pro"&&t.jsx(wn,{})]}),t.jsx("p",{className:G.detailDesc,children:"Keeps Microsoft Advertising (Bing) and Clarity analytics compliant with consent rules. Trackers only fire after visitors agree."}),p?t.jsx(hl,{locked:p,platformName:"Microsoft",onUpgrade:v}):t.jsxs(t.Fragment,{children:[t.jsx(vr,{label:o.microsoftEnabled?"Enabled":"Disabled",checked:o.microsoftEnabled,onChange:x=>i("microsoftEnabled",x)}),o.microsoftEnabled&&t.jsxs("div",{className:G.signalConfig,children:[t.jsx("div",{className:G.signalConfigTitle,children:"Signal mapping"}),t.jsxs("div",{className:G.groupRow,children:[t.jsx("span",{className:G.groupLabel,children:"Advertising (UET)"}),t.jsx("select",{className:G.groupSelect,value:o.microsoftAdStorage,onChange:x=>i("microsoftAdStorage",Number(x.target.value)),children:w.map(x=>t.jsx("option",{value:x.value,children:x.label},x.value))})]}),t.jsxs("div",{className:G.groupRow,style:{marginTop:8},children:[t.jsx("span",{className:G.groupLabel,children:"Analytics"}),t.jsx("select",{className:G.groupSelect,value:o.microsoftAnalyticsStorage,onChange:x=>i("microsoftAnalyticsStorage",Number(x.target.value)),children:w.map(x=>t.jsx("option",{value:x.value,children:x.label},x.value))})]}),t.jsxs("div",{className:G.subToggles,children:[t.jsx("div",{className:G.subToggleTitle,children:"Sub-products"}),t.jsxs("label",{className:G.subToggleRow,children:[t.jsx("input",{type:"checkbox",checked:o.microsoftPixie,onChange:x=>i("microsoftPixie",x.target.checked)}),t.jsx("span",{children:"Pixie"})]}),t.jsxs("label",{className:G.subToggleRow,children:[t.jsx("input",{type:"checkbox",checked:o.microsoftClarity,onChange:x=>i("microsoftClarity",x.target.checked)}),t.jsx("span",{children:"Clarity"})]})]})]})]}),t.jsx(ml,{onApply:f,hasChanges:g,saving:d,savedFlash:m,locked:p})]})}function Pd({staged:o,set:i,saving:c,hasChanges:p,savedFlash:d,onApply:g,proLocked:m,onUpgrade:f,grandfathered:v}){const w=o.gpcBannerMode||"passive";return t.jsxs("div",{className:G.detail,children:[t.jsxs("div",{className:G.detailHeader,children:[t.jsx("div",{className:G.detailTitle,children:"Global Privacy Control (GPC)"}),m==="pro"&&t.jsx(wn,{})]}),m?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:G.detailDesc,children:"Honors visitors who’ve told their browser they don’t want to be tracked. Required for CCPA / CPRA compliance."}),t.jsx(hl,{locked:m,platformName:"Global Privacy Control",onUpgrade:f}),t.jsx(ml,{onApply:g,hasChanges:p,saving:c,savedFlash:d,locked:m})]}):t.jsxs(t.Fragment,{children:[t.jsx(vr,{label:o.gpcEnabled?"Enabled":"Disabled",checked:o.gpcEnabled,onChange:x=>i("gpcEnabled",x)}),v&&t.jsx("p",{className:G.detailDesc,style:{marginTop:8,fontStyle:"italic"},children:"GPC is now a Pro feature. Your site keeps it because it was already enabled. If you turn it off, you’ll need Pro to re-enable it."}),o.gpcEnabled&&t.jsxs("fieldset",{style:{marginTop:16,padding:0,border:0},children:[t.jsx("legend",{className:G.detailDesc,style:{padding:0,marginBottom:8,fontWeight:600},children:"When GPC fires, what should visitors see?"}),Nd.map(x=>t.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:8,padding:"6px 0",cursor:"pointer"},children:[t.jsx("input",{type:"radio",name:"gpcBannerMode",value:x.value,checked:w===x.value,onChange:()=>i("gpcBannerMode",x.value),style:{marginTop:3}}),t.jsxs("span",{children:[t.jsx("span",{style:{fontWeight:500},children:x.label}),t.jsx("span",{className:G.detailDesc,style:{display:"block",marginTop:2},children:x.help})]})]},x.value))]}),t.jsx("p",{className:G.detailDesc,style:{marginTop:16},children:"Some visitors set their browser to automatically opt out of tracking. This setting respects that choice — and it’s legally required in California (CPRA). When a visitor sends this signal, tracking is blocked automatically."}),t.jsx("div",{className:G.detailFooter,children:t.jsx($e,{variant:"primary",size:"sm",onClick:g,disabled:!p||c,children:c?"Applying…":d?"Saved ✓":"Apply"})})]})]})}function Ed({staged:o,set:i,saving:c,hasChanges:p,savedFlash:d,onApply:g}){return t.jsxs("div",{className:G.detail,children:[t.jsx("div",{className:G.detailHeader,children:t.jsx("div",{className:G.detailTitle,children:"Do Not Track (DNT)"})}),t.jsx("p",{className:G.detailDesc,style:{color:"#b56e00",marginBottom:12},children:"Do Not Track is an older browser setting that most sites ignore. Enabling this is a good-faith gesture but isn’t required by any law. When a visitor has DNT enabled, tracking is blocked automatically."}),t.jsx(vr,{label:o.doNotTrack?"Enabled":"Disabled",checked:o.doNotTrack,onChange:m=>i("doNotTrack",m)}),t.jsxs("p",{className:G.detailDesc,style:{marginTop:12},children:["When enabled, visitors with DNT set receive ",t.jsx("strong",{children:"Private (level 1)"})," consent automatically."]}),t.jsx("div",{className:G.detailFooter,children:t.jsx($e,{variant:"primary",size:"sm",onClick:g,disabled:!p||c,children:c?"Applying…":d?"Saved ✓":"Apply"})})]})}function pi({isOpen:o,onClose:i,isWizard:c=!1,addNotice:p,onOpenPricingModal:d,onApplied:g,scrollTrigger:m}){var oe,fe;const{config:f,refetchConfig:v}=Mt(),{dashboard:w}=vt(),{tier:x}=Be(),S=(f==null?void 0:f.blocking)||{},L=(f==null?void 0:f.config)||{},z=((oe=w==null?void 0:w.appConfig)==null?void 0:oe.consentChoices)??3,[C,P]=j.useState({}),[N,D]=j.useState("google"),[I,A]=j.useState(!1),[W,$]=j.useState(null),[O,K]=j.useState(!1),Q=j.useRef(null);if(j.useEffect(()=>{if(c?f:o){const Y=Sd(S,L);P(Y),$(JSON.stringify(Us(Y))),D("google")}},[c?f:o,f]),!c&&!o)return null;const Z=(Y,ve)=>P(je=>({...je,[Y]:ve})),T=JSON.stringify(Us(C)),J=T!==W,me=async()=>{A(!0),K(!1);try{await ul({googleConsentMode:C.googleEnabled?"1":"0",facebookConsentMode:C.facebookEnabled?"1":"0",microsoftConsentMode:C.microsoftEnabled?"1":"0"},{},Us(C)),$(T),g&&g({google:C.googleEnabled,facebook:C.facebookEnabled,microsoft:C.microsoftEnabled,gpc:C.gpcEnabled,dnt:C.doNotTrack}),K(!0),clearTimeout(Q.current),Q.current=setTimeout(()=>K(!1),2e3),v()}catch(Y){p&&p((Y==null?void 0:Y.message)||"Could not save — please try again.")}finally{A(!1)}},te=(fe=w==null?void 0:w.analytics)==null?void 0:fe.cycleUsage,ee=(te==null?void 0:te.visits)||0,ie=(te==null?void 0:te.threshold)||0,ge=ie>0&&ee>=ie,_e=x==="pro",V=!!L.gpcSupportMode,ae=Y=>Y.key==="gpc"&&Y.pro&&!_e&&!V||Y.pro&&!_e&&Y.key!=="gpc"?"pro":Y.key==="google"&&ge?"threshold":!1,q={google:C.googleEnabled,facebook:C.facebookEnabled,microsoft:C.microsoftEnabled,gpc:C.gpcEnabled,dnt:C.doNotTrack},k=t.jsxs("div",{className:G.layout,children:[t.jsxs("div",{className:G.modeList,children:[t.jsxs("div",{className:G.modeSection,children:[t.jsx("div",{className:G.modeSectionLabel,children:"Platform Integrations"}),_t.filter(Y=>Y.group==="platform").map(Y=>{const ve=ae(Y);return t.jsxs("button",{className:G.modeCard+(N===Y.key?" "+G.modeCardActive:"")+(ve?" "+G.modeCardLocked:""),onClick:()=>D(Y.key),type:"button",children:[t.jsxs("div",{className:G.modeCardTop,children:[t.jsx("span",{className:G.modeCardName,children:Y.name}),ve==="pro"?t.jsx(wn,{}):t.jsx(di,{enabled:q[Y.key]})]}),t.jsx("div",{className:G.modeCardDesc,children:Y.description}),ve&&t.jsxs("div",{className:G.modeCardProOverlay,role:"button",tabIndex:0,onClick:je=>{je.stopPropagation(),d&&d()},onKeyDown:je=>{(je.key==="Enter"||je.key===" ")&&(je.stopPropagation(),d&&d())},"aria-label":ve==="pro"?`${Y.name} requires Pro.`:`${Y.name} paused — visit limit reached. Upgrade for unlimited visits.`,children:[t.jsx("span",{className:G.lockIconLarge,children:"🔒"}),t.jsx("span",{className:G.modeCardProLabel,children:ve==="pro"?"Upgrade to Pro →":"Visit limit reached →"})]})]},Y.key)})]}),t.jsxs("div",{className:G.modeSection,children:[t.jsx("div",{className:G.modeSectionLabel,children:"Browser Signals"}),_t.filter(Y=>Y.group==="browser").map(Y=>t.jsxs("button",{className:G.modeCard+(N===Y.key?" "+G.modeCardActive:""),onClick:()=>D(Y.key),type:"button",children:[t.jsxs("div",{className:G.modeCardTop,children:[t.jsx("span",{className:G.modeCardName,children:Y.name}),t.jsx(di,{enabled:q[Y.key]})]}),t.jsx("div",{className:G.modeCardDesc,children:Y.description})]},Y.key))]})]}),t.jsxs("div",{className:G.detailCol,children:[N==="google"&&t.jsx(Cd,{staged:C,set:Z,consentChoices:z,proLocked:ae(_t.find(Y=>Y.key==="google")),saving:I,hasChanges:J,savedFlash:O,onApply:me,onUpgrade:()=>d&&d()}),N==="facebook"&&t.jsx(bd,{staged:C,set:Z,consentChoices:z,proLocked:ae(_t.find(Y=>Y.key==="facebook")),saving:I,hasChanges:J,savedFlash:O,onApply:me,onUpgrade:()=>d&&d()}),N==="microsoft"&&t.jsx(Ld,{staged:C,set:Z,consentChoices:z,proLocked:ae(_t.find(Y=>Y.key==="microsoft")),saving:I,hasChanges:J,savedFlash:O,onApply:me,onUpgrade:()=>d&&d()}),N==="gpc"&&t.jsx(Pd,{staged:C,set:Z,proLocked:ae(_t.find(Y=>Y.key==="gpc")),grandfathered:V,saving:I,hasChanges:J,savedFlash:O,onApply:me,onUpgrade:()=>d&&d()}),N==="dnt"&&t.jsx(Ed,{staged:C,set:Z,saving:I,hasChanges:J,savedFlash:O,onApply:me})]})]}),M=_t.filter(Y=>q[Y.key]).map(Y=>Y.shortName),de=M.length>0?`${M.length} active: ${M.join(", ")}`:"No consent modes enabled",he=t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noreferrer",className:"cn-layer__link-btn",children:"Advanced settings in web app →"}),t.jsxs("span",{style:{fontSize:"var(--cn-text-sm)",color:M.length>0?"var(--cn-ok-icon)":"var(--cn-off-val)"},children:[M.length>0?"✓ ":"",de]})]}),t.jsx($e,{variant:"primary",onClick:i,children:"Done"})]});return c?k:t.jsx(It,{title:"Consent Protection Settings",onClose:i,scrollTrigger:m,footer:he,children:k})}function Dd({addNotice:o,onOpenWelcomeModal:i,onOpenPricingModal:c,onTabChange:p,appliedTemplateKey:d,onTemplateApplied:g}){var Ut,wt,Nr,qn,Zn,_l,Sr,Cr,xl,$t,Wt;const{tier:m}=Be(),{dashboard:f}=vt(),{config:v,isLoadingConfig:w,refetchConfig:x}=Mt(),{hasPlatformConfig:S,showBannerWizard:L,bannerScrollTrigger:z,bannerClosing:C,closeBannerWizard:P,showLawWizard:N,lawScrollTrigger:D,lawClosing:I,closeLawWizard:A,showConsentPanel:W,consentScrollTrigger:$,consentClosing:O,closeConsentPanel:K,openBannerWizard:Q,openConsentPanel:Z,openLawWizard:T}=mr(),[J,me]=j.useState(((wt=(Ut=window.cnReactData)==null?void 0:Ut.options)==null?void 0:wt.app_id)||""),[te,ee]=j.useState(((qn=(Nr=window.cnReactData)==null?void 0:Nr.options)==null?void 0:qn.app_key)||""),[ie,ge]=j.useState(!1),[_e,V]=j.useState(""),ae=async()=>{ge(!0),V("");try{await Ms({app_id:J,app_key:te});try{const Te=await In("sync_config");if(Te!=null&&Te.success){try{await Is()}catch{}try{localStorage.setItem(zs(J),"1"),localStorage.setItem(As(J),"1")}catch{}}}catch{}window.location.reload()}catch(Te){V(Te.message||"Save failed"),ge(!1)}},q=d||"",k=Te=>{g&&g(Te)},[M,de]=j.useState(!1),[he,oe]=j.useState(0),fe=f==null?void 0:f.analytics,Y=(f==null?void 0:f.appConfig)||{},ve=(v==null?void 0:v.blocking)||{},je=qo(ve),{total:Je,uncategorized:Dn}=Zo(ve),vl=!!((_l=(Zn=window.cnReactData)==null?void 0:Zn.options)!=null&&_l.app_blocking),kn=fe==null?void 0:fe.cycleUsage,_r=(kn==null?void 0:kn.visits)||0,yl=(kn==null?void 0:kn.threshold)||0;if(m==="basic")return t.jsxs(yt,{sidebar:t.jsxs(t.Fragment,{children:[t.jsxs(Fn,{title:"Domain Info",children:[t.jsxs("div",{className:"cn-dom-rows",children:[t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Domain"}),t.jsx("span",{className:"cn-dom-row__v",children:window.location.hostname})]}),t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Status"}),t.jsxs("span",{className:"cn-dom-row__v",children:[t.jsx("span",{className:"cn-dot cn-dot--gray"})," Not Connected"]})]})]}),t.jsx(Se,{label:"App ID",value:J,onChange:me,placeholder:"Your application ID",autoComplete:"off"}),t.jsx(Se,{label:"Secret Key",type:"password",value:te,onChange:ee,placeholder:"Your application key",autoComplete:"new-password"}),t.jsxs("p",{className:"cn-conn-hint cn-conn-hint--returning",children:["Already have an account?"," ",t.jsx("a",{href:Qe,target:"_blank",rel:"noopener noreferrer",children:"Find your App ID and Secret Key at app.hu-manity.co"})]}),_e&&t.jsx("div",{className:"cn-conn-error",children:_e}),t.jsx($e,{variant:"primary",onClick:ae,disabled:ie,children:ie?"Saving…":"Connect Your Site"})]}),t.jsxs(Fn,{title:"What you get with compliance",children:[t.jsxs("ul",{className:"cn-benefit-list",children:[t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Stop tracking scripts from firing before visitors agree"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Build a legal evidence trail regulators can verify"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Cover GDPR, CCPA, and 40+ global regulations automatically"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Real compliance in under 60 seconds — free to start"})]})]}),t.jsxs("div",{className:"cn-connect-cta",children:[t.jsx("button",{type:"button",className:"cn-button cn-button--primary cn-button--block",onClick:()=>i&&i(),children:"Set up compliance →"}),t.jsx("div",{className:"cn-connect-cta__caption",children:"No credit card required"})]})]})]}),children:[t.jsx(nd,{onActivate:()=>i&&i()}),t.jsx(Jo,{requiredTier:"free",message:"Script blocking, consent records, regulatory alerts & more",onCta:i,children:t.jsx("div",{className:"cn-pro-gate-placeholder",children:t.jsx("div",{className:"cn-placeholder-charts"})})})]});const xr=((Sr=window.cnReactData)==null?void 0:Sr.siteUrl)||"",Ft=Yo(Y.regulations),jr=Ft.map(Te=>Fs[Te]||Te.toUpperCase()),Bt=Au((xl=(Cr=window.cnReactData)==null?void 0:Cr.options)==null?void 0:xl.app_id),[jt,Qn]=j.useState(()=>{try{const Te=localStorage.getItem(Bt)==="1";return Te&&localStorage.removeItem(Bt),Te}catch{return!1}}),Ot=xr&&q?`${xr}?cn_preview=1`:"",wr=((($t=window.cnReactData)==null?void 0:$t.detectedPlugins)||[]).includes("google"),Yn=[];!q&&!S&&Yn.push("banner template"),jr.length===0&&!S&&Yn.push("laws"),Dn>0&&Yn.push(`${Dn} uncategorized tracker${Dn!==1?"s":""}`),wr&&!je.google&&Yn.push("Google Consent Mode review");const kr=Yn.slice(0,3);return t.jsxs(yt,{sidebar:t.jsxs(t.Fragment,{children:[t.jsx(dl,{addNotice:o}),t.jsx(li,{onOpenPricingModal:()=>c&&c()})]}),children:[t.jsx(td,{sessionUsed:_r,sessionTotal:yl,activeLawsCount:jr.length,uncategorizedScripts:Dn,autoblockingEnabled:vl}),jt&&t.jsxs("div",{className:"cn-inline-notice cn-inline-notice--success",children:[t.jsxs("div",{className:"cn-inline-notice__message",children:[t.jsx("strong",{children:"✓ Your banner is live."})," ","Visitors will now see your selected template and your chosen laws/languages are active."]}),t.jsxs("div",{className:"cn-inline-notice__actions",children:[Ot&&t.jsx("a",{className:"cn-layer__link-btn",href:Ot,target:"_blank",rel:"noreferrer",children:"Preview your live banner →"}),t.jsx("button",{type:"button",className:"cn-layer__link-btn",onClick:()=>Qn(!1),children:"Dismiss"})]})]}),kr.length>0&&t.jsx("div",{className:"cn-inline-notice cn-inline-notice--info",children:t.jsxs("div",{className:"cn-inline-notice__message",children:[t.jsx("strong",{children:"Still missing:"})," ",kr.join(", "),"."]})}),wr&&!je.google&&t.jsxs("div",{className:"cn-inline-notice cn-inline-notice--warning",children:[t.jsxs("div",{className:"cn-inline-notice__message",children:[t.jsx("strong",{children:"Google tools detected."})," ","Review Google Consent Mode before you consider setup complete."]}),t.jsx("button",{type:"button",className:"cn-layer__link-btn",onClick:()=>Z(),children:"Review consent modes →"})]}),t.jsx(hd,{onTemplateApplied:Te=>k(Te),initialLaws:Ft,onOpenPricingModal:c,totalScripts:Je,uncategorizedScripts:Dn,isLoadingConfig:w}),M&&t.jsx(wd,{onClose:()=>{de(!1),x()},onOpenWelcomeModal:i,scrollTrigger:he}),!M&&t.jsx(ti,{appliedTemplateKey:q,onTemplateApplied:g,siteUrl:((Wt=window.cnReactData)==null?void 0:Wt.siteUrl)||"",onOpenTrackers:()=>{de(!0),oe(Te=>Te+1)},onTabChange:p}),L&&t.jsx(ci,{onClose:P,onTemplateApplied:Te=>{k(Te),P()},scrollTrigger:z,isClosing:C,appliedTemplateKey:q}),W&&t.jsx(pi,{isOpen:!0,onClose:K,addNotice:o,onOpenPricingModal:c,onApplied:()=>{},scrollTrigger:$,isClosing:O}),N&&t.jsx(ui,{onClose:A,scrollTrigger:D,isClosing:I}),t.jsx(gd,{consentModes:je,regulations:Y.regulations||{}})]})}function fi(o,i){const[c,p]=j.useState(null),[d,g]=j.useState(!0),[m,f]=j.useState(null),v=j.useRef(null),w=j.useCallback(async()=>{if(v.current){p(v.current),g(!1);return}g(!0),f(null);try{const S=await o(i);v.current=S,p(S)}catch(S){f(S.message||"An error occurred")}finally{g(!1)}},[o,i]);j.useEffect(()=>{w()},[w]);const x=j.useCallback(()=>{v.current=null,w()},[w]);return{data:c,loading:d,error:m,refetch:x}}function Td(){return fi(Iu)}function Rd(){return fi(Fu)}function zd(){const o=(window.cnReactData||{}).options||{},[i,c]=j.useState(o),[p,d]=j.useState(!1),[g,m]=j.useState(null),[f,v]=j.useState(!1),w=j.useCallback((L,z)=>{c(C=>({...C,[L]:z})),v(!1)},[]),x=j.useCallback((L,z,C)=>{c(P=>({...P,[L]:{...P[L]||{},[z]:C}})),v(!1)},[]),S=j.useCallback(async()=>{d(!0),m(null),v(!1);try{const L={};return Object.entries(i).forEach(([z,C])=>{z==="see_more_opt"&&typeof C=="object"?(L["see_more_opt[text]"]=C.text||"",L["see_more_opt[link_type]"]=C.link_type||"page",L["see_more_opt[id]"]=C.id||0,L["see_more_opt[link]"]=C.link||"",L["see_more_opt[sync]"]=C.sync?"1":""):z==="colors"&&typeof C=="object"?(L.bar_opacity=C.bar_opacity||100,L.color_bar=C.bar||"",L.color_text=C.text||"",L.color_button=C.button||""):z==="conditional_rules"?L[z]=JSON.stringify(C||[]):z==="excluded_handles"?L[z]=Array.isArray(C)?C.join(` `):C||"":z==="refuse_code"||z==="refuse_code_head"?L[z]=C||"":typeof C=="boolean"?L[z]=C?"1":"":L[z]=C}),await Ms(L),window.cnReactData&&(window.cnReactData.options={...i}),v(!0),!0}catch(L){return m(L.message||"Save failed"),!1}finally{d(!1)}},[i]);return{options:i,update:w,updateNested:x,save:S,loading:p,error:g,saved:f}}function Ad(){const[o,i]=j.useState(!1),[c,p]=j.useState(null);return{exportCsv:j.useCallback(async g=>{i(!0),p(null);try{const m=await Ou(g);if(m.csv){const f=new Blob([m.csv],{type:"text/csv;charset=utf-8;"}),v=URL.createObjectURL(f),w=document.createElement("a");w.href=v,w.download=`consent-logs-${g.start_date||"export"}.csv`,w.click(),URL.revokeObjectURL(v)}return m}catch(m){throw p(m.message||"Export failed"),m}finally{i(!1)}},[]),loading:o,error:c}}const Md=[{key:"top",label:"Top",posClass:"pos-top"},{key:"bottom",label:"Bottom",posClass:"pos-bottom"}],Id=[{key:"top",label:"Top",posClass:"pos-top"},{key:"bottom",label:"Bottom",posClass:"pos-bottom"},{key:"left",label:"Left",posClass:"pos-left"},{key:"right",label:"Right",posClass:"pos-right"},{key:"center",label:"Popup",posClass:"pos-center",proOnly:!0}];function Fd({options:o,update:i,save:c,loading:p,saved:d,error:g}){const{isBasic:m,isPro:f}=Be(),v=m?Md:Id,[w,x]=j.useState(!1),[S,L]=j.useState(!1),[z,C]=j.useState(""),[P,N]=j.useState(!1),[D,I]=j.useState(o.displayType||"fixed"),A=Z=>{const T=o.position||"bottom";Z!==T&&(m?(i("position",Z),x(!0)):(L(!0),C(""),N(!1),ul({position:Z,displayType:D}).then(()=>{N(!0),i("position",Z)}).catch(J=>C(J.message||"Save failed.")).finally(()=>L(!1))))},W=Z=>{Z!==D&&(I(Z),m?(i("displayType",Z),x(!0)):(L(!0),C(""),N(!1),ul({position:o.position||"bottom",displayType:Z}).then(()=>{N(!0),i("displayType",Z)}).catch(T=>C(T.message||"Save failed.")).finally(()=>L(!1))))};j.useEffect(()=>{w&&m&&(x(!1),c())},[o.position,o.displayType,w,c,m]);const $=o.position||"bottom",O=m?p:S,K=m?d:P,Q=m?g:z;return t.jsxs("div",{className:"cn-banner-selector",children:[t.jsxs("div",{className:"cn-banner-selector__header",children:[t.jsx("span",{className:"cn-section-label",children:"Banner Position"}),K&&t.jsx("span",{className:"cn-saved-indicator",children:"✓ Saved"}),Q&&t.jsx("span",{className:"cn-error-indicator",children:Q})]}),!m&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:"cn-banner-selector__toggle-row",children:[t.jsx("span",{className:"cn-banner-selector__size-label",children:"Banner Size"}),t.jsxs("div",{className:"cn-banner-selector__size-opts",children:[t.jsx("button",{className:`cn-banner-selector__size-opt${D==="floating"?" cn-banner-selector__size-opt--on":""}`,onClick:()=>W("floating"),children:"Floating"}),t.jsx("button",{className:`cn-banner-selector__size-opt${D==="fixed"?" cn-banner-selector__size-opt--on":""}`,onClick:()=>W("fixed"),children:"Fixed"})]}),t.jsx("span",{className:"cn-banner-selector__size-desc",children:D==="floating"?"Fills only as much space as necessary.":"Expands to fill all available space."})]})}),t.jsx("div",{className:`cn-banner-selector__grid${!m&&D==="floating"?" cn-banner-selector__grid--floating":""}`,children:v.map(Z=>{const T=Z.proOnly&&!f;return t.jsxs("div",{className:"cn-banner-selector__card"+($===Z.key?" cn-banner-selector__card--active":"")+(O&&!T?" cn-banner-selector__card--saving":"")+(T?" cn-banner-selector__card--locked":""),onClick:()=>!T&&A(Z.key),title:T?"Upgrade to Pro to use the Popup position":void 0,children:[T&&t.jsx("span",{className:"cn-banner-selector__pro-badge",children:t.jsx(wn,{})}),t.jsx("div",{className:"cn-banner-selector__thumb",children:t.jsx("div",{className:`cn-banner-selector__pos ${Z.posClass}${T?" cn-banner-selector__pos--locked":""}`})}),t.jsxs("div",{className:"cn-banner-selector__meta",children:[t.jsx("span",{className:"cn-banner-selector__name",children:Z.label}),$===Z.key&&!T&&t.jsx("span",{className:"cn-banner-selector__active-pill",children:"Active"}),T&&t.jsx("span",{className:"cn-banner-selector__locked-label",children:"Pro only"})]})]},Z.key)})}),!m&&t.jsx("div",{className:"cn-banner-selector__portal-link",children:t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noopener noreferrer",children:"Customize in Admin Portal →"})})]})}const Ws={size:24,color:"currentColor"};function un({size:o,color:i,className:c,style:p}={},d){return{xmlns:"http://www.w3.org/2000/svg",width:o||Ws.size,height:o||Ws.size,viewBox:"0 0 24 24",fill:"none",stroke:i||Ws.color,strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",className:c||"",style:p,...d}}function Bd(o){return t.jsxs("svg",{...un(o),children:[t.jsx("path",{d:"M12 2L3 6v5.5c0 4.5 3.8 8.7 9 10 5.2-1.3 9-5.5 9-10V6l-9-4z"}),t.jsx("polyline",{points:"8.5 12 11 14.5 15.5 9.5"})]})}function Od(o){return t.jsxs("svg",{...un(o),children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("ellipse",{cx:"12",cy:"12",rx:"4",ry:"10"}),t.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})}function Ud(o){return t.jsxs("svg",{...un(o),children:[t.jsx("rect",{x:"4",y:"14",width:"4",height:"7",rx:"1"}),t.jsx("rect",{x:"10",y:"9",width:"4",height:"12",rx:"1"}),t.jsx("rect",{x:"16",y:"4",width:"4",height:"17",rx:"1"})]})}function hi(o){return t.jsxs("svg",{...un(o),children:[t.jsx("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2"}),t.jsx("line",{x1:"9",y1:"8",x2:"15",y2:"8"}),t.jsx("line",{x1:"9",y1:"12",x2:"15",y2:"12"}),t.jsx("line",{x1:"9",y1:"16",x2:"13",y2:"16"})]})}function Gs(o){return t.jsxs("svg",{...un(o),children:[t.jsx("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),t.jsx("path",{d:"M8 11V7a4 4 0 0 1 8 0v4"})]})}function mi(o){return t.jsxs("svg",{...un(o),children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("path",{d:"M9 12l2 2 4-4"})]})}function gi(o){return t.jsxs("svg",{...un(o),children:[t.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),t.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),t.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}function $d(o){return t.jsxs("svg",{...un(o),children:[t.jsx("circle",{cx:"12",cy:"12",r:"3"}),t.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1.08-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1.08 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1.08z"})]})}function Wd(o){return t.jsxs("svg",{...un(o),children:[t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"}),t.jsx("line",{x1:"9",y1:"21",x2:"15",y2:"21"}),t.jsx("line",{x1:"3.5",y1:"8",x2:"20.5",y2:"8"}),t.jsx("line",{x1:"3.5",y1:"8",x2:"3.5",y2:"13"}),t.jsx("path",{d:"M1.5 13Q3.5 16.5 5.5 13"}),t.jsx("line",{x1:"20.5",y1:"8",x2:"20.5",y2:"13"}),t.jsx("path",{d:"M18.5 13Q20.5 16.5 22.5 13"})]})}function Gd(o){return t.jsx("svg",{...un(o),children:t.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})}function Hd(o){return t.jsxs("svg",{...un(o),children:[t.jsx("rect",{x:"2",y:"2",width:"20",height:"16",rx:"2.5"}),t.jsx("line",{x1:"2",y1:"13",x2:"22",y2:"13"}),t.jsx("line",{x1:"6",y1:"7",x2:"11",y2:"7"}),t.jsx("line",{x1:"6",y1:"10",x2:"9",y2:"10"}),t.jsx("rect",{x:"14",y:"14.5",width:"5",height:"2",rx:"1",fill:"currentColor",stroke:"none"}),t.jsx("line",{x1:"4",y1:"15.5",x2:"10",y2:"15.5"})]})}function Vd(o){return t.jsx("svg",{...un(o),children:t.jsx("polyline",{points:"6 9 12 15 18 9"})})}function Kd(o){return t.jsxs("svg",{...un(o),children:[t.jsx("path",{d:"M7 15l5 5 5-5"}),t.jsx("path",{d:"M7 9l5-5 5 5"})]})}function xt({title:o,subtitle:i,defaultOpen:c=!1,children:p}){return t.jsxs("details",{className:"cn-accordion",open:c||void 0,children:[t.jsxs("summary",{className:"cn-accordion__summary",children:[t.jsxs("div",{className:"cn-accordion__left",children:[t.jsx("span",{className:"cn-accordion__title",children:o}),i&&t.jsx("span",{className:"cn-accordion__subtitle",children:i})]}),t.jsx("span",{className:"cn-accordion__chevron",children:t.jsx(Vd,{size:16})})]}),t.jsx("div",{className:"cn-accordion__body",children:p})]})}function Hs({label:o,value:i,onChange:c}){const p=`cn-color-${o==null?void 0:o.toLowerCase().replace(/\s+/g,"-")}`;return t.jsxs("div",{className:"cn-form-field",children:[o&&t.jsx("label",{className:"cn-form-field__label",htmlFor:p,children:o}),t.jsxs("div",{className:"cn-color-picker__row",children:[t.jsx("input",{type:"color",className:"cn-color-picker__swatch",value:i||"#000000",onChange:d=>c==null?void 0:c(d.target.value)}),t.jsx("input",{id:p,type:"text",className:"cn-form-field__input",value:i||"",onChange:d=>c==null?void 0:c(d.target.value),placeholder:"#000000",style:{flex:1}})]})]})}const Qd=[{value:"bottom",label:"Bottom"},{value:"top",label:"Top"}],Yd=[{value:"fade",label:"Fade"},{value:"slide",label:"Slide"},{value:"none",label:"None"}];function gl({label:o,value:i}){return t.jsxs("div",{className:"cn-form-readonly",children:[t.jsx("label",{className:"cn-form-readonly__label",children:o}),t.jsx("span",{className:"cn-form-readonly__value",children:i||"(default)"}),t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noreferrer",className:"cn-form-readonly__link",children:"Edit text in web-app →"})]})}function qd({options:o,update:i,updateNested:c}){const p=o.colors||{};o.see_more_opt;const{isConnected:d,isBasic:g}=Be();return t.jsx(xt,{title:"Banner Design",subtitle:"Texts, colors, position, and animation",defaultOpen:!0,children:t.jsxs("div",{className:"cn-banner-design__grid",children:[t.jsxs("div",{className:"cn-banner-design__col",children:[d?t.jsx(gl,{label:"Banner Message",value:o.message_text}):t.jsx(Se,{label:"Banner Message",type:"textarea",value:o.message_text||"",onChange:m=>i("message_text",m)}),d?t.jsx(gl,{label:"Accept Button",value:o.accept_text}):t.jsx(Se,{label:"Accept Button",value:o.accept_text||"",onChange:m=>i("accept_text",m),placeholder:"Accept All"}),d?t.jsx(gl,{label:"Reject Button",value:o.refuse_text}):t.jsx(Se,{label:"Reject Button",value:o.refuse_text||"",onChange:m=>i("refuse_text",m),placeholder:"Reject All"}),!g&&(d?t.jsx(gl,{label:"Preferences Button",value:o.revoke_text}):t.jsx(Se,{label:"Preferences Button",value:o.revoke_text||"",onChange:m=>i("revoke_text",m),placeholder:"Manage Preferences"})),t.jsx(Se,{label:"Banner Position",type:"select",value:o.position||"bottom",onChange:m=>i("position",m),options:Qd}),t.jsx(Se,{label:"Dismiss Animation",type:"select",value:o.hide_effect||"fade",onChange:m=>i("hide_effect",m),options:Yd})]}),t.jsxs("div",{className:"cn-banner-design__col",children:[t.jsx(Hs,{label:"Background Color",value:p.bar||"#32323a",onChange:m=>c("colors","bar",m)}),t.jsx(Hs,{label:"Text Color",value:p.text||"#ffffff",onChange:m=>c("colors","text",m)}),t.jsx(Hs,{label:"Button Color",value:p.button||"#00a99d",onChange:m=>c("colors","button",m)})]})]})})}function Zd({onConnect:o}){return t.jsxs("div",{className:"cn-tier-gate-inline",children:[t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:.5},children:[t.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),t.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Advanced features require a connection"}),t.jsx("p",{style:{margin:"4px 0 0",color:"var(--cn-muted)",fontSize:"var(--cn-text-sm)"},children:"Connect your site to unlock Autoblocking, Cookie Categories, Consent Records, and Analytics."})]}),t.jsx("button",{type:"button",className:"cn-button cn-button--primary",onClick:o,children:"Connect Your Site — It’s Free"})]})}const Xd={gpcSupportMode:{title:"GPC support",summary:"GPC (Global Privacy Control) tells browsers to signal opt-out of data sale automatically. Required for CCPA compliance.",navPath:["Compliance","Privacy Settings","GPC Support"],action:"Toggle GPC Support on, then save.",deepLink:"/#/configuration"},onClose:{title:"Accept on close",summary:"Accepting consent when users dismiss the banner is not allowed under GDPR and UK PECR.",navPath:["Compliance","Consent Settings","Accept on Close"],action:"Ensure Accept on Close is set to Off.",deepLink:"/#/configuration"},uiBlocking:{title:"Cookie wall (UI blocking)",summary:'Blocking site access until consent is given (a "cookie wall") violates GDPR — consent must be freely given.',navPath:["Compliance","Blocking Settings","Cookie Wall"],action:"Ensure Cookie Wall is set to Off.",deepLink:"/#/configuration"}},Jd=()=>t.jsxs("svg",{viewBox:"0 0 28 28",fill:"none",width:"28",height:"28","aria-hidden":"true",children:[t.jsx("path",{d:"M14 3L4 7v7c0 6.627 4.477 12.5 10 14.5C19.523 26.5 24 20.627 24 14V7L14 3z",stroke:"rgba(255,255,255,.75)",strokeWidth:"1.5",strokeLinejoin:"round"}),t.jsx("path",{d:"M9 14l3.5 3.5L19 11",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});function e2({settingKey:o,accountEmail:i,onClose:c,onSynced:p}){const[d,g]=j.useState(!1),[m,f]=j.useState(""),v=Xd[o];if(!v)return null;const w=v.deepLink?Qe+v.deepLink:Qe,x=async()=>{g(!0),f("");try{await In("sync_config"),p==null||p(),c==null||c()}catch{f("Sync failed. Please try again or refresh the page.")}finally{g(!1)}};return t.jsx("div",{className:"cn-portal-bridge-overlay",role:"dialog","aria-modal":"true","aria-label":`Configure ${v.title} in web app`,children:t.jsxs("div",{className:"cn-portal-bridge",children:[t.jsxs("div",{className:"cn-portal-bridge__header",children:[t.jsx("div",{className:"cn-portal-bridge__header-icon",children:t.jsx(Jd,{})}),t.jsxs("div",{children:[t.jsxs("div",{className:"cn-portal-bridge__header-title",children:[v.title," is configured in your web account"]}),t.jsx("div",{className:"cn-portal-bridge__header-sub",children:"Takes about 60 seconds"})]})]}),t.jsxs("div",{className:"cn-portal-bridge__body",children:[t.jsx("p",{className:"cn-portal-bridge__summary",children:v.summary}),i&&t.jsxs("div",{className:"cn-portal-bridge__context",children:[t.jsx("div",{className:"cn-portal-bridge__context-dot"}),t.jsxs("div",{className:"cn-portal-bridge__context-text",children:["Sign in with ",t.jsx("strong",{children:i})," to access this setting."]})]}),t.jsxs("div",{className:"cn-portal-bridge__steps",children:[t.jsxs("div",{className:"cn-portal-bridge__step",children:[t.jsx("div",{className:"cn-portal-bridge__step-num",children:"1"}),t.jsxs("div",{className:"cn-portal-bridge__step-body",children:[t.jsx("div",{className:"cn-portal-bridge__step-title",children:"Open your web account"}),t.jsx("div",{className:"cn-portal-bridge__step-desc",children:"Opens in a new tab."})]})]}),t.jsxs("div",{className:"cn-portal-bridge__step",children:[t.jsx("div",{className:"cn-portal-bridge__step-num",children:"2"}),t.jsxs("div",{className:"cn-portal-bridge__step-body",children:[t.jsx("div",{className:"cn-portal-bridge__step-title",children:"Navigate to the setting"}),t.jsx("div",{className:"cn-portal-bridge__step-desc",children:v.navPath.join(" → ")})]})]}),t.jsxs("div",{className:"cn-portal-bridge__step",children:[t.jsx("div",{className:"cn-portal-bridge__step-num",children:"3"}),t.jsxs("div",{className:"cn-portal-bridge__step-body",children:[t.jsx("div",{className:"cn-portal-bridge__step-title",children:"Make the change"}),t.jsx("div",{className:"cn-portal-bridge__step-desc",children:v.action})]})]})]}),m&&t.jsx("div",{className:"cn-portal-bridge__error",children:m}),t.jsxs("div",{className:"cn-portal-bridge__actions",children:[t.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"cn-portal-bridge__btn cn-portal-bridge__btn--primary",children:"Open web app →"}),t.jsx("button",{type:"button",className:"cn-portal-bridge__btn cn-portal-bridge__btn--secondary",onClick:x,disabled:d,children:d?"Checking…":"I've made the change"})]})]}),t.jsx("div",{className:"cn-portal-bridge__dismiss",children:t.jsx("button",{type:"button",onClick:c,className:"cn-portal-bridge__dismiss-btn",children:"Not now"})})]})})}const vi={banner:"Banner shown",hidden:"Silent",passive:"Passive notice"},n2=[{key:"app_blocking",wpKey:"app_blocking",label:"Autoblocking",desc:"Scripts wait for visitor consent before firing",valueType:"toggle",requiredFor:[],activeLaws:[],activeValue:!0},{key:"onScroll",label:"Accept on scroll",desc:"Consent granted automatically if visitor scrolls",valueType:"bool-inverted",requiredFor:["gdpr","ukpecr","lgpd","popia"],activeLaws:["gdpr","ukpecr","lgpd","popia"],activeValue:!1},{key:"onClick",label:"Accept on click",desc:"Consent granted automatically on any page click",valueType:"bool-inverted",requiredFor:["gdpr","ukpecr","lgpd","popia"],activeLaws:["gdpr","ukpecr","lgpd","popia"],activeValue:!1},{key:"onClose",label:"Accept on close",desc:"Consent granted automatically if banner is closed",valueType:"bool-inverted",requiredFor:["gdpr","ukpecr","popia"],activeLaws:["gdpr","ukpecr","popia"],activeValue:!1,portalOnly:!0},{key:"refuse_opt",wpKey:"refuse_opt",label:"Refuse button",desc:"Display a button allowing visitors to decline tracking",valueType:"bool",requiredFor:["gdpr","ukpecr","lgpd","pipeda","popia"],activeLaws:["gdpr","ukpecr","lgpd","pipeda","popia"],activeValue:!0},{key:"revokeConsent",label:"Revoke consent",desc:"Floating widget allowing visitors to change preferences",valueType:"bool",requiredFor:[],activeLaws:["gdpr","ccpa","otherus","ukpecr","lgpd","pipeda","popia"],activeValue:!0},{key:"gpcSupportMode",label:"GPC support",desc:"Honor browser-level opt-out signals automatically",valueType:"bool",requiredFor:[],activeLaws:["ccpa","otherus"],activeValue:!0,portalOnly:!0,pro:!0,globalNote:"Required for all connected sites (CCPA/CPRA mandate)"},{key:"consentExpiry",label:"Consent expiry",desc:"How long before visitors are prompted again",valueType:"expiry-array",requiredFor:["gdpr","ukpecr"],activeLaws:["gdpr","ukpecr"]},{key:"uiBlocking",label:"Cookie wall",desc:"Block access to site content until consent is given",valueType:"bool-inverted",requiredFor:["gdpr"],activeLaws:["gdpr"],activeValue:!1,portalOnly:!0}],Bn={shield:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M11 3L4 6v5c0 4 3.5 7 7 8 3.5-1 7-4 7-8V6L11 3z",stroke:o,strokeWidth:"1.5",strokeLinejoin:"round"}),t.jsx("polyline",{points:"8,11 10,13 14,9",stroke:o,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),scroll:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("rect",{x:"4",y:"3",width:"14",height:"16",rx:"3",stroke:o,strokeWidth:"1.5"}),t.jsx("polyline",{points:"9,13 11,16 13,13",stroke:o,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("line",{x1:"11",y1:"9",x2:"11",y2:"16",stroke:o,strokeWidth:"1.2",strokeLinecap:"round"})]}),click:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M8.5 10.5V5.5a1.5 1.5 0 013 0v5",stroke:o,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M11.5 8.5V5a1.5 1.5 0 013 0V10",stroke:o,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M14.5 8a1.5 1.5 0 013 0v4c0 3.314-2.686 6-6 6h-1a5 5 0 01-5-5v-2.5a1.5 1.5 0 013 0",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),close:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"3",width:"16",height:"16",rx:"3",stroke:o,strokeWidth:"1.5"}),t.jsx("line",{x1:"8",y1:"8",x2:"14",y2:"14",stroke:o,strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("line",{x1:"14",y1:"8",x2:"8",y2:"14",stroke:o,strokeWidth:"1.4",strokeLinecap:"round"})]}),refuse:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"7",width:"16",height:"8",rx:"3",stroke:o,strokeWidth:"1.5"}),t.jsx("line",{x1:"7",y1:"11",x2:"15",y2:"11",stroke:o,strokeWidth:"1.3",strokeLinecap:"round"})]}),revoke:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M4 8h7a6 6 0 110 12H6",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("polyline",{points:"4,4 4,8 8,8",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),gpc:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("path",{d:"M8 10V5a1.5 1.5 0 013 0v5",stroke:o,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M11 8V4.5a1.5 1.5 0 013 0V9",stroke:o,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M14 7.5a1.5 1.5 0 013 0V12c0 3.314-2.686 6-6 6h-1a5 5 0 01-5-5v-2a1.5 1.5 0 013 0",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),clock:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("circle",{cx:"11",cy:"11",r:"9",stroke:o,strokeWidth:"1.5"}),t.jsx("polyline",{points:"11,6 11,11 14,14",stroke:o,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),wall:({color:o})=>t.jsxs("svg",{viewBox:"0 0 22 22",fill:"none",width:"22",height:"22","aria-hidden":"true",children:[t.jsx("rect",{x:"2",y:"5",width:"18",height:"12",rx:"2",stroke:o,strokeWidth:"1.5"}),t.jsx("line",{x1:"2",y1:"9",x2:"20",y2:"9",stroke:o,strokeWidth:"1.2"}),t.jsx("line",{x1:"11",y1:"9",x2:"11",y2:"17",stroke:o,strokeWidth:"1.2"})]})},t2={app_blocking:Bn.shield,onScroll:Bn.scroll,onClick:Bn.click,onClose:Bn.close,refuse_opt:Bn.refuse,revokeConsent:Bn.revoke,gpcSupportMode:Bn.gpc,consentExpiry:Bn.clock,uiBlocking:Bn.wall};function r2(o,i,c,p){return o.key==="gpcSupportMode"&&!c&&p.some(g=>g==="ccpa"||g==="otherus")||o.key==="uiBlocking"&&!c&&p.includes("gdpr")?"crit":c?"ok":"warn"}function l2({setting:o,activeLawKeys:i,wpOptions:c,configData:p,onOpenPortal:d,update:g,thresholdLocked:m,onUpgrade:f,isPro:v}){const{key:w,label:x,desc:S,valueType:L,activeLaws:z,portalOnly:C,wpKey:P}=o,N=o.key==="gpcSupportMode"&&!!p.gpcSupportMode,D=!!o.pro&&!v&&!N,I=z.filter(J=>i.includes(J)),A=P||w,W=P?c:p;let $,O;const K=o.key==="app_blocking"&&m;if(L==="bool"){const J=W[A],me=A==="app_blocking"&&J===void 0?!0:!!J;if(O=me===o.activeValue,o.key==="gpcSupportMode"&&me){const te=W.gpcBannerMode||"passive",ee=vi[te]||vi.passive;$=t.jsxs(t.Fragment,{children:["On",t.jsx("div",{style:{fontSize:"var(--cn-text-sm)",fontWeight:"normal",color:"var(--cn-muted)",marginTop:2},children:ee})]})}else $=me?"On":"Off"}else if(L==="bool-inverted"){const J=!!W[A];$=J?"On":"Off",O=J===o.activeValue}else if(L==="toggle"){const J=W[A]??!0;$=K?t.jsx("span",{style:{color:"var(--cn-warn-icon)",fontWeight:500},children:"Paused"}):t.jsxs("label",{className:"cn-toggle-row__label",style:{cursor:"pointer",margin:0,justifyContent:"flex-start"},children:[t.jsx("input",{type:"checkbox",className:"cn-toggle-row__input",checked:J,onChange:me=>g&&g(A,me.target.checked),style:{marginRight:"6px"}}),J?"On":"Off"]}),O=K?!1:J===o.activeValue}else if(L==="expiry-array"){const J=Array.isArray(W[A])?W[A]:[30,182,365],me=Math.max(...J);$=J.map(te=>te>=365?`${Math.round(te/365)}y`:te>=30?`${Math.round(te/30)}mo`:`${te}d`).join(" / "),O=me<=365}const Q=r2(o,$,O,i),Z=`var(--cn-${Q}-icon)`,T=t2[w]||null;return t.jsxs("div",{className:`cn-card${Q==="crit"?" cn-card--crit":""}`,children:[t.jsxs("div",{className:"cn-card__top",children:[t.jsx("div",{className:"cn-card__icon",children:T&&t.jsx(T,{color:Z})}),t.jsx("div",{className:`cn-card__dot cn-card__dot--${Q}`})]}),t.jsx("div",{className:`cn-card__main cn-card__main--${Q}`,children:$}),t.jsx("div",{className:"cn-card__sub",children:x}),S&&t.jsx("div",{className:"cn-card__desc",style:{marginTop:4,fontSize:"var(--cn-text-sm)",color:"var(--cn-muted)"},children:S}),t.jsx("div",{className:"cn-card__pills",children:I.map(J=>t.jsx("span",{className:`cn-card__pill cn-card__pill--${Q}`,children:Fs[J]||J.toUpperCase()},J))}),t.jsx("div",{className:"cn-card__foot",children:D?t.jsxs(t.Fragment,{children:[t.jsx(wn,{}),t.jsx("button",{type:"button",onClick:f,children:"Upgrade to Pro →"})]}):C&&t.jsx("button",{type:"button",onClick:()=>d==null?void 0:d(o.key),children:"Manage in web app →"})}),K&&t.jsxs("div",{className:"cn-card__threshold-banner",style:{marginTop:8,padding:"8px 10px",background:"var(--cn-warn-bg, #fef3cd)",borderRadius:6,fontSize:"var(--cn-text-sm)"},children:["Monthly visit limit reached ","—"," autoblocking is paused until your cycle resets."," ",t.jsx("button",{type:"button",className:"cn-card__threshold-upgrade",style:{background:"none",border:"none",color:"var(--cn-link)",cursor:"pointer",padding:0,font:"inherit",textDecoration:"underline"},onClick:f,children:"Upgrade →"})]})]})}function s2({wpOptions:o,update:i,save:c,onOpenPricingModal:p}){var Q,Z;const{dashboard:d,refetchDashboard:g}=vt(),{config:m,refetchConfig:f}=Mt(),{isPro:v}=Be(),w=(Q=d==null?void 0:d.analytics)==null?void 0:Q.cycleUsage,x=(w==null?void 0:w.visits)||0,S=(w==null?void 0:w.threshold)||0,L=S>0&&x>=S,z=j.useRef(!1),C=j.useRef(null),P=j.useRef(o==null?void 0:o.app_blocking);j.useEffect(()=>{const T=o==null?void 0:o.app_blocking;if(T!==P.current)return P.current=T,z.current||(z.current=!0),z.current&&c&&(clearTimeout(C.current),C.current=setTimeout(()=>c(),300)),()=>clearTimeout(C.current)},[o==null?void 0:o.app_blocking,c]);const N=((Z=d==null?void 0:d.appConfig)==null?void 0:Z.regulations)||{},D=Object.entries(N).filter(([,T])=>T).map(([T])=>T),I=(d==null?void 0:d.accountEmail)||"",A=(m==null?void 0:m.config)||{},[W,$]=j.useState(null),O=D.length>0,K=n2.filter(T=>T.requiredFor.length===0?!0:T.requiredFor.some(J=>D.includes(J)));return t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:"cn-compliance-behavior",className:"cn-compliance-behavior",children:[t.jsx("div",{className:"cn-card-grid cn-card-grid--auto",children:K.map(T=>t.jsx(l2,{setting:T,activeLawKeys:D,wpOptions:o,configData:A,onOpenPortal:$,update:i,thresholdLocked:L,onUpgrade:p,isPro:v},T.key))}),t.jsxs("div",{className:"cn-compliance-behavior__footer",children:[O?"These settings were automatically configured based on your selected laws. ":"Select laws to see recommendations tied to your jurisdictions. ",t.jsx("a",{href:`${Qe}/#/configuration`,target:"_blank",rel:"noreferrer",className:"cn-form-readonly__link",children:O?"Configure in Admin Portal →":"Select laws in Admin Portal →"})]})]}),W&&t.jsx(e2,{settingKey:W,accountEmail:I,onClose:()=>$(null),onSynced:()=>{g(),f(),$(null)}})]})}const a2=((Fi=window.cnReactData)==null?void 0:Fi.ruleParams)||[],o2=((Bi=window.cnReactData)==null?void 0:Bi.ruleOperators)||[];function i2({rule:o,onChange:i,onRemove:c}){const[p,d]=j.useState([]),[g,m]=j.useState(!1),[f,v]=j.useState(!1),w=j.useCallback(async S=>{if(!S){d([]);return}m(!0);try{const L=await Wu(S),z=(L==null?void 0:L.values)||[];z.length>0&&z[0].group?v(!0):v(!1),d(z)}catch{d([])}finally{m(!1)}},[]);j.useEffect(()=>{w(o.param)},[o.param,w]);const x=S=>{i({...o,param:S,value:""})};return t.jsxs("div",{className:"cn-rule-row",children:[t.jsxs("select",{className:"cn-rule-row__param",value:o.param,onChange:S=>x(S.target.value),children:[t.jsx("option",{value:"",children:"-- Select --"}),a2.map(S=>t.jsx("option",{value:S.value,children:S.label},S.value))]}),t.jsx("select",{className:"cn-rule-row__operator",value:o.operator,onChange:S=>i({...o,operator:S.target.value}),children:o2.map(S=>t.jsx("option",{value:S.value,children:S.label},S.value))}),t.jsxs("select",{className:"cn-rule-row__value",value:o.value,onChange:S=>i({...o,value:S.target.value}),disabled:g,children:[t.jsx("option",{value:"",children:g?"Loading…":"-- Select --"}),f?p.map(S=>t.jsx("optgroup",{label:S.group,children:S.items.map(L=>t.jsx("option",{value:L.value,children:L.label},L.value))},S.group)):p.map(S=>t.jsx("option",{value:S.value,children:S.label},S.value))]}),t.jsx("button",{type:"button",className:"cn-rule-row__remove",onClick:c,title:"Remove rule",children:"×"})]})}function c2({group:o,groupIndex:i,onChange:c,onRemove:p}){const d=(f,v)=>{const w=[...o];w[f]=v,c(w)},g=f=>{if(o.length===1){p();return}c(o.filter((v,w)=>w!==f))},m=()=>{c([...o,{param:"",operator:"equal",value:""}])};return t.jsxs("div",{className:"cn-rule-group",children:[i>0&&t.jsx("div",{className:"cn-rule-group__or",children:"OR"}),t.jsxs("div",{className:"cn-rule-group__card",children:[o.map((f,v)=>t.jsxs("div",{children:[v>0&&t.jsx("div",{className:"cn-rule-group__and",children:"AND"}),t.jsx(i2,{rule:f,onChange:w=>d(v,w),onRemove:()=>g(v)})]},v)),t.jsx("button",{type:"button",className:"cn-rule-group__add-rule",onClick:m,children:"+ Add rule"})]})]})}function u2({rules:o,onChange:i}){const c=!o||Array.isArray(o)&&o.length===0?[]:Array.isArray(o)?o.map(w=>Array.isArray(w)?w.map(x=>({param:x.param||"",operator:x.operator||"equal",value:x.value||""})):Object.values(w).map(x=>({param:x.param||"",operator:x.operator||"equal",value:x.value||""}))):Object.values(o).map(w=>Object.values(w).map(x=>({param:x.param||"",operator:x.operator||"equal",value:x.value||""}))),[p,d]=j.useState(c),g=w=>{d(w),i(w)},m=(w,x)=>{const S=[...p];S[w]=x,g(S)},f=w=>{g(p.filter((x,S)=>S!==w))},v=()=>{g([...p,[{param:"",operator:"equal",value:""}]])};return t.jsxs("div",{className:"cn-rule-builder",children:[p.length===0&&t.jsx("p",{className:"cn-rule-builder__empty",children:"No rules configured. Add a rule group to control where the banner appears."}),p.map((w,x)=>t.jsx(c2,{group:w,groupIndex:x,onChange:S=>m(x,S),onRemove:()=>f(x)},x)),t.jsx("button",{type:"button",className:"cn-rule-builder__add-group",onClick:v,children:"+ Add rule group"})]})}const yi=[{value:"hour",label:"An hour"},{value:"day",label:"1 day"},{value:"week",label:"1 week"},{value:"month",label:"1 month"},{value:"3months",label:"3 months"},{value:"6months",label:"6 months"},{value:"year",label:"1 year"},{value:"infinity",label:"Infinity"}];function dn({label:o,checked:i,onChange:c,description:p}){const d=`cn-toggle-${o.toLowerCase().replace(/\s+/g,"-")}`;return t.jsxs("div",{className:"cn-toggle-row",children:[t.jsxs("label",{className:"cn-toggle-row__label",htmlFor:d,children:[t.jsx("input",{id:d,type:"checkbox",className:"cn-toggle-row__input",checked:i,onChange:g=>c(g.target.checked)}),t.jsx("span",{className:"cn-toggle-row__text",children:o})]}),p&&t.jsx("div",{className:"cn-toggle-row__desc",children:p})]})}function yr({label:o,name:i,value:c,options:p,onChange:d}){return t.jsxs("div",{className:"cn-radio-group",children:[o&&t.jsx("div",{className:"cn-radio-group__label",children:o}),t.jsx("div",{className:"cn-radio-group__options",children:p.map(g=>t.jsxs("label",{className:"cn-radio-group__option",children:[t.jsx("input",{type:"radio",name:i,value:g.value,checked:c===g.value,onChange:()=>d(g.value)}),t.jsx("span",{children:g.label})]},g.value))})]})}function _i({addNotice:o,options:i,update:c,updateNested:p,save:d,loading:g,saved:m,error:f,onOpenConsentPanel:v}){var N,D,I,A,W,$,O,K,Q,Z;const w=((N=window.cnReactData)==null?void 0:N.wpPages)||[],{isConnected:x}=Be(),[S,L]=j.useState(!1),[z,C]=j.useState("head"),P=async()=>{var J,me,te,ee;if(await d()){if(x){const ie={};(J=i.colors)!=null&&J.bar&&(ie.bannerColor=i.colors.bar),(me=i.colors)!=null&&me.text&&(ie.textColor=i.colors.text),(te=i.colors)!=null&&te.button&&(ie.primaryColor=i.colors.button),i.position&&(ie.position=i.position),i.hide_effect&&(ie.animation=i.hide_effect),((ee=i.colors)==null?void 0:ee.bar_opacity)!==void 0&&(ie.bannerOpacity=(i.colors.bar_opacity??100)/100);const ge={};if(i.revoke_cookies!==void 0&&(ge.revokeConsent=i.revoke_cookies),i.revoke_cookies_opt&&(ge.revokeMethod=i.revoke_cookies_opt),i.on_scroll!==void 0&&(ge.onScroll=i.on_scroll),i.on_scroll_offset!==void 0&&(ge.onScrollOffset=i.on_scroll_offset),i.on_click!==void 0&&(ge.onClick=i.on_click),Object.keys(ie).length||Object.keys(ge).length){try{await ul(ie,ge),o&&o("Settings saved and published to your live site.","success")}catch{o&&o("Settings saved locally. Live banner sync failed—your live site was not updated. Please try again.","warning")}return}}o&&o("Settings saved successfully.","success")}};return t.jsxs("div",{className:"cn-plugin-settings",children:[!x&&t.jsxs(t.Fragment,{children:[t.jsxs(xt,{title:"Consent Behavior",defaultOpen:!0,children:[t.jsx(dn,{label:"Enable refuse button",checked:!!i.refuse_opt,onChange:T=>c("refuse_opt",T),description:"Allow visitors to refuse cookie consent"}),i.refuse_opt&&t.jsx(Se,{label:"Refuse button text",value:i.refuse_text||"",onChange:T=>c("refuse_text",T),placeholder:"No"}),t.jsx(dn,{label:"Enable revoke consent",checked:!!i.revoke_cookies,onChange:T=>c("revoke_cookies",T),description:"Allow visitors to revoke their consent after accepting"}),i.revoke_cookies&&t.jsxs(t.Fragment,{children:[t.jsx(yr,{label:"Revoke method",name:"revoke_cookies_opt",value:i.revoke_cookies_opt||"automatic",options:[{value:"automatic",label:"Automatic"},{value:"manual",label:"Manual"}],onChange:T=>c("revoke_cookies_opt",T)}),t.jsx(Se,{label:"Revoke button text",value:i.revoke_text||"",onChange:T=>c("revoke_text",T),placeholder:"Revoke consent"}),t.jsx(Se,{label:"Revoke message",type:"textarea",value:i.revoke_message_text||"",onChange:T=>c("revoke_message_text",T)})]}),t.jsx(dn,{label:"Accept on scroll",checked:!!i.on_scroll,onChange:T=>c("on_scroll",T),description:"Automatically accept consent when the user scrolls"}),i.on_scroll&&t.jsx(Se,{label:"Scroll distance (px)",type:"number",value:i.on_scroll_offset||100,onChange:T=>c("on_scroll_offset",parseInt(T,10)||0)}),t.jsx(dn,{label:"Accept on click",checked:!!i.on_click,onChange:T=>c("on_click",T),description:"Automatically accept consent on any page click"}),t.jsx(dn,{label:"Reload page on accept",checked:!!i.redirection,onChange:T=>c("redirection",T),description:"Reload the page after the visitor accepts consent"})]}),t.jsxs(xt,{title:"Cookie Expiry",defaultOpen:!0,children:[t.jsx(Se,{label:"Accepted expiry",type:"select",value:i.time||"month",onChange:T=>c("time",T),options:yi}),t.jsx(Se,{label:"Rejected expiry",type:"select",value:i.time_rejected||"month",onChange:T=>c("time_rejected",T),options:yi})]})]}),t.jsxs(xt,{title:"Privacy Policy",defaultOpen:!0,children:[t.jsx(dn,{label:"Enable privacy policy link",checked:!!i.see_more,onChange:T=>c("see_more",T)}),i.see_more&&t.jsxs(t.Fragment,{children:[t.jsx(Se,{label:"Link text",value:((D=i.see_more_opt)==null?void 0:D.text)||"",onChange:T=>p("see_more_opt","text",T),placeholder:"Privacy policy"}),t.jsx(yr,{label:"Link type",name:"see_more_link_type",value:((I=i.see_more_opt)==null?void 0:I.link_type)||"page",options:[{value:"page",label:"Page link"},{value:"custom",label:"Custom link"}],onChange:T=>p("see_more_opt","link_type",T)}),((A=i.see_more_opt)==null?void 0:A.link_type)==="page"&&w.length>0&&t.jsx(Se,{label:"Select page",type:"select",value:((W=i.see_more_opt)==null?void 0:W.id)||"",onChange:T=>p("see_more_opt","id",parseInt(T,10)||0),options:[{value:"",label:"— Select a page —"},...w.map(T=>({value:String(T.id),label:T.title}))]}),(($=i.see_more_opt)==null?void 0:$.link_type)==="custom"&&t.jsx(Se,{label:"Custom URL",value:((O=i.see_more_opt)==null?void 0:O.link)||"",onChange:T=>p("see_more_opt","link",T),placeholder:"https://"}),t.jsx(dn,{label:"Sync with WordPress Privacy Page",checked:!!((K=i.see_more_opt)!=null&&K.sync),onChange:T=>p("see_more_opt","sync",T)}),t.jsx(yr,{label:"Open link in",name:"link_target",value:i.link_target||"_blank",options:[{value:"_blank",label:"New tab"},{value:"_self",label:"Same tab"}],onChange:T=>c("link_target",T)}),t.jsx(yr,{label:"Link position",name:"link_position",value:i.link_position||"banner",options:[{value:"banner",label:"Banner"},{value:"message",label:"Message"}],onChange:T=>c("link_position",T)})]})]}),t.jsxs(xt,{title:"Custom Scripts",defaultOpen:!0,children:[t.jsxs("div",{className:"cn-pill-toggle",children:[t.jsx("button",{type:"button",className:`cn-pill-toggle__btn${z==="head"?" cn-pill-toggle__btn--active":""}`,onClick:()=>C("head"),children:"Head"}),t.jsx("button",{type:"button",className:`cn-pill-toggle__btn${z==="body"?" cn-pill-toggle__btn--active":""}`,onClick:()=>C("body"),children:"Body"})]}),z==="head"?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"cn-pill-toggle-desc",children:"Code to be added in your site header, before the closing head tag."}),t.jsx(Se,{type:"textarea",value:i.refuse_code_head||"",onChange:T=>c("refuse_code_head",T),placeholder:"",rows:6})]}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"cn-pill-toggle-desc",children:"Code to be added in your site footer, before the closing body tag."}),t.jsx(Se,{type:"textarea",value:i.refuse_code||"",onChange:T=>c("refuse_code",T),placeholder:"",rows:6})]}),t.jsx("p",{className:"cn-pill-toggle-note",children:"Enter non-functional cookies JavaScript code (e.g. Google Analytics) to be used after the visitor consent is given."})]}),t.jsxs(xt,{title:"Display & Animation",defaultOpen:!0,children:[t.jsxs("div",{className:"cn-form-field",children:[t.jsxs("label",{className:"cn-form-field__label",htmlFor:"cn-bar-opacity",children:["Bar opacity: ",((Q=i.colors)==null?void 0:Q.bar_opacity)??100,"%"]}),t.jsx("input",{id:"cn-bar-opacity",type:"range",className:"cn-opacity-slider",min:50,max:100,value:((Z=i.colors)==null?void 0:Z.bar_opacity)??100,onChange:T=>p("colors","bar_opacity",parseInt(T.target.value,10))})]}),t.jsx(Se,{label:"Custom button CSS class",value:i.css_class||"",onChange:T=>c("css_class",T),placeholder:"e.g. my-custom-btn",helper:"Add custom CSS classes to the accept button"})]}),t.jsxs(xt,{title:"Technical Settings",defaultOpen:!0,children:[x&&t.jsxs(t.Fragment,{children:[t.jsx(dn,{label:"Bot detection",checked:!!(i.bot_detection??!0),onChange:T=>c("bot_detection",T),description:"Automatically detect and handle bots/crawlers"}),t.jsx(dn,{label:"AMP support",checked:!!i.amp_support,onChange:T=>c("amp_support",T),description:"Enable AMP-compatible consent notice"}),t.jsx(dn,{label:"Caching compatibility",checked:!!(i.caching_compatibility??!0),onChange:T=>c("caching_compatibility",T),description:"Improve compatibility with caching plugins"}),t.jsx(dn,{label:"Debug mode",checked:!!i.debug_mode,onChange:T=>c("debug_mode",T),description:"Enable debug logging for troubleshooting"}),t.jsx(Se,{label:"Excluded script handles",type:"textarea",value:Array.isArray(i.excluded_handles)?i.excluded_handles.join(` `):i.excluded_handles||"",onChange:T=>c("excluded_handles",T),placeholder:`elementor-frontend my-analytics-init`,rows:4,helper:"Enter WordPress script handles to exclude from autoblocking, one per line. These scripts will be marked as Essential (Category 1) and never blocked."})]}),!x&&t.jsx(yr,{label:"Script placement",name:"script_placement",value:i.script_placement||"header",options:[{value:"header",label:"Header"},{value:"footer",label:"Footer"}],onChange:T=>c("script_placement",T)}),t.jsx(dn,{label:"Conditional display",checked:!!i.conditional_active,onChange:T=>c("conditional_active",T),description:"Show or hide the banner on specific pages"}),i.conditional_active&&t.jsxs(t.Fragment,{children:[t.jsx(Se,{label:"Display rule",type:"select",value:i.conditional_display||"hide",onChange:T=>c("conditional_display",T),options:[{value:"hide",label:"Hide the banner"},{value:"show",label:"Show the banner"}]}),t.jsx(u2,{rules:i.conditional_rules||[],onChange:T=>c("conditional_rules",T)})]}),t.jsx(dn,{label:"Delete data on deactivation",checked:!!i.deactivation_delete,onChange:T=>c("deactivation_delete",T),description:"Remove all plugin data when the plugin is deactivated"}),x&&t.jsxs("div",{className:"cn-purge-cache",children:[t.jsx($e,{variant:"secondary",onClick:async()=>{L(!0);try{await Qu(),o&&o("Cache purged successfully.","success")}catch(T){o&&o(T.message||"Purge failed. Please try again.","error")}finally{L(!1)}},disabled:S,children:S?"Purging…":"Purge Cache"}),t.jsx("p",{className:"cn-purge-cache__desc",children:"Click to refresh the app configuration cache."})]})]}),t.jsxs("div",{className:"cn-plugin-settings__actions",children:[t.jsx($e,{variant:"primary",onClick:P,disabled:g,children:g?"Saving…":x?"Save WordPress Settings":"Save Settings"}),m&&t.jsxs("span",{className:"cn-plugin-settings__saved",children:["✓"," Saved"]}),f&&t.jsx("span",{className:"cn-plugin-settings__error",children:f})]})]})}function d2({onConnect:o}){return t.jsxs(t.Fragment,{children:[t.jsx(Fn,{title:"Domain Info",children:t.jsxs("div",{className:"cn-dom-rows",children:[t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Domain"}),t.jsx("span",{className:"cn-dom-row__v",children:window.location.hostname})]}),t.jsxs("div",{className:"cn-dom-row",children:[t.jsx("span",{className:"cn-dom-row__k",children:"Status"}),t.jsxs("span",{className:"cn-dom-row__v",children:[t.jsx("span",{className:"cn-dot cn-dot--gray"})," Not Connected"]})]})]})}),t.jsxs(Fn,{title:"Why Connect?",children:[t.jsxs("ul",{className:"cn-benefit-list",children:[t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Automated script blocking before visitor consent"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Cookie categorization across your entire site"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Consent proof collection for legal audit trails"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Visitor analytics and consent rate reporting"})]}),t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-icon",children:"✓"}),t.jsx("span",{children:"Google Consent Mode v2, Facebook & Microsoft signals"})]})]}),t.jsx("div",{className:"cn-connect-cta",children:t.jsx("button",{className:"cn-button cn-button--primary cn-connect-cta__btn",onClick:o,type:"button",children:"Connect Your Site →"})})]})]})}function p2({addNotice:o,onOpenPricingModal:i}){return t.jsxs(t.Fragment,{children:[t.jsx(dl,{addNotice:o}),t.jsx(li,{onOpenPricingModal:i})]})}function f2({addNotice:o,onOpenWelcomeModal:i,onTabChange:c,appliedTemplateKey:p,onTemplateApplied:d,onOpenPricingModal:g}){var O,K;const{isBasic:m}=Be(),f=zd(),v=p||"",w=Q=>{d&&d(Q)},{showBannerWizard:x,bannerClosing:S,bannerScrollTrigger:L,closeBannerWizard:z,showLawWizard:C,lawClosing:P,lawScrollTrigger:N,closeLawWizard:D,showConsentPanel:I,consentClosing:A,consentScrollTrigger:W,closeConsentPanel:$}=mr();return m?t.jsxs(yt,{sidebar:t.jsx(d2,{onConnect:i}),children:[t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Plugin Settings"}),t.jsx("p",{className:"cn-protection-header__subtitle",children:"Connect your site to enable consent management features."})]}),t.jsx(Fd,{options:f.options,update:f.update,save:f.save,loading:f.loading,saved:f.saved,error:f.error}),t.jsx(qd,{options:f.options,update:f.update,updateNested:f.updateNested}),t.jsx(Zd,{onConnect:i}),t.jsx(_i,{addNotice:o,options:f.options,update:f.update,updateNested:f.updateNested,save:f.save,loading:f.loading,saved:f.saved,error:f.error})]}):t.jsxs(yt,{sidebar:t.jsx(p2,{addNotice:o,onOpenPricingModal:g}),children:[t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Settings"}),t.jsx("p",{className:"cn-protection-header__subtitle",children:"Manage your banner template, laws, consent modes, and languages."})]}),t.jsx(ti,{appliedTemplateKey:v,onTemplateApplied:w,siteUrl:((O=window.cnReactData)==null?void 0:O.siteUrl)||"",onOpenTrackers:null,autoblockingEnabled:!!((K=f.options)!=null&&K.app_blocking),onTabChange:c}),x&&t.jsx(ci,{onClose:z,onTemplateApplied:Q=>{w(Q),z()},scrollTrigger:L,isClosing:S,appliedTemplateKey:v}),C&&t.jsx(ui,{onClose:D,onSave:D,scrollTrigger:N,isClosing:P}),I&&t.jsx(pi,{isOpen:!0,onClose:$,addNotice:o,onOpenPricingModal:g,onApplied:()=>{},scrollTrigger:W,isClosing:A}),t.jsx(s2,{wpOptions:f.options,update:f.update,save:f.save,onOpenPricingModal:g}),t.jsx(_i,{addNotice:o,options:f.options,update:f.update,updateNested:f.updateNested,save:f.save,loading:f.loading,saved:f.saved,error:f.error})]})}function xi({title:o,action:i,onAction:c}){return t.jsxs("div",{className:"cn-section-header",children:[t.jsx("h2",{children:o}),i&&t.jsx("button",{type:"button",className:"cn-section-header__action",onClick:c,children:i})]})}function h2({onActivate:o}){return t.jsxs("div",{className:"cn-empty-hero",children:[t.jsxs("svg",{className:"cn-empty-hero__icon",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("circle",{cx:"40",cy:"40",r:"40",fill:"#f0faf7"}),t.jsx("rect",{x:"22",y:"16",width:"36",height:"46",rx:"4",fill:"#fff",stroke:"#e0e4e8",strokeWidth:"1.5"}),t.jsx("rect",{x:"29",y:"26",width:"22",height:"2.5",rx:"1.25",fill:"#e0e4e8"}),t.jsx("rect",{x:"29",y:"33",width:"18",height:"2.5",rx:"1.25",fill:"#e0e4e8"}),t.jsx("rect",{x:"29",y:"40",width:"20",height:"2.5",rx:"1.25",fill:"#e0e4e8"}),t.jsx("circle",{cx:"54",cy:"56",r:"14",fill:"#20c19e"}),t.jsx("path",{d:"M54 44.5l-7 3.5v5.25c0 4.594 2.975 8.881 7 9.931 4.025-1.05 7-5.337 7-9.931V48l-7-3.5z",fill:"white",fillOpacity:"0.9"}),t.jsx("path",{d:"M52.1 56.45l-2.1-2.1.96-.96 1.14 1.14 3.06-3.06.96.96-4.02 4.02z",fill:"#20c19e"})]}),t.jsx("div",{className:"cn-empty-hero__heading",children:"No Compliance Records"}),t.jsx("div",{className:"cn-empty-hero__sub",children:"Connect to Cookie Compliance to start collecting consent proofs, audit logs, and compliance evidence."}),t.jsx($e,{variant:"primary",onClick:o,children:"Activate Protection"}),t.jsx("div",{className:"cn-empty-hero__footnote",children:"Connect your site · Free · Takes 60 seconds"})]})}function ji({breakdown:o,loading:i}){const c=o&&o.total>0,p=(o==null?void 0:o.levelLabels)||{},d=p.level3||"Accept",g=p.level2||"Custom",m=p.level1||"Reject",f=c?[{value:o.total.toLocaleString(),label:"Total Consents"},{value:`${o.acceptRate}%`,label:d},{value:`${o.customRate}%`,label:g},{value:`${o.rejectRate}%`,label:m}]:[{value:i?"…":"—",label:"Total Consents"},{value:i?"…":"—",label:d},{value:i?"…":"—",label:g},{value:i?"…":"—",label:m}];return t.jsx("div",{className:"cn-consent-stats",children:f.map(v=>t.jsxs("div",{className:"cn-consent-stat",children:[t.jsx("div",{className:"cn-consent-stat__value",children:v.value}),t.jsx("div",{className:"cn-consent-stat__label",children:v.label})]},v.label))})}function m2({columns:o,rows:i,expandable:c=!1,renderExpanded:p,pageSize:d=20,currentPage:g=1,totalPages:m=1,onPageChange:f,onSort:v,sortColumn:w,sortDirection:x="asc",emptyMessage:S="No data available"}){const[L,z]=j.useState(new Set),C=D=>{c&&z(I=>{const A=new Set(I);return A.has(D)?A.delete(D):A.add(D),A})},P=D=>{if(!D.sortable||!v)return;const I=w===D.key&&x==="asc"?"desc":"asc";v(D.key,I)},N=D=>D.sortable?w!==D.key?t.jsx("span",{className:"cn-data-table__sort",children:t.jsx(Kd,{size:14})}):t.jsx("span",{className:"cn-data-table__sort cn-data-table__sort--active",children:x==="asc"?"↑":"↓"}):null;return t.jsxs("div",{className:"cn-data-table",children:[t.jsxs("table",{className:"cn-data-table__table",children:[t.jsx("thead",{children:t.jsx("tr",{className:"cn-data-table__header",children:o.map(D=>t.jsxs("th",{className:`cn-data-table__th${D.sortable?" cn-data-table__th--sortable":""}`,onClick:()=>P(D),children:[D.label,N(D)]},D.key))})}),t.jsxs("tbody",{children:[(!i||i.length===0)&&t.jsx("tr",{children:t.jsx("td",{className:"cn-data-table__td cn-data-table__empty",colSpan:o.length,children:S})}),i==null?void 0:i.map((D,I)=>t.jsxs(t.Fragment,{children:[t.jsx("tr",{className:`cn-data-table__row${c?" cn-data-table__row--expandable":""}${L.has(I)?" cn-data-table__row--expanded":""}`,onClick:()=>C(I),children:o.map(A=>t.jsx("td",{className:"cn-data-table__td",children:D[A.key]??"—"},A.key))},I),c&&L.has(I)&&p&&t.jsx("tr",{className:"cn-data-table__expanded-row",children:t.jsx("td",{colSpan:o.length,className:"cn-data-table__expanded",children:p(D,I)})},`${I}-expanded`)]}))]})]}),m>1&&t.jsxs("div",{className:"cn-data-table__pagination",children:[t.jsx("button",{type:"button",className:"cn-data-table__page-btn",disabled:g<=1,onClick:()=>f==null?void 0:f(g-1),"aria-label":"Previous page",children:"«"}),t.jsxs("span",{className:"cn-data-table__page-info",children:["Page ",g," of ",m]}),t.jsx("button",{type:"button",className:"cn-data-table__page-btn",disabled:g>=m,onClick:()=>f==null?void 0:f(g+1),"aria-label":"Next page",children:"»"})]})]})}function wi({startDate:o,endDate:i,onChange:c,maxRange:p,disabled:d}){const g=v=>{const w=v.target.value;let x=i;if(p&&x){const S=new Date(w),L=new Date(x);if(Math.ceil((L-S)/(1e3*60*60*24))>p){const C=new Date(S);C.setDate(C.getDate()+p),x=C.toISOString().split("T")[0]}}c==null||c({startDate:w,endDate:x})},m=v=>{const w=v.target.value;let x=o;if(p&&x){const S=new Date(x),L=new Date(w);if(Math.ceil((L-S)/(1e3*60*60*24))>p){const C=new Date(L);C.setDate(C.getDate()-p),x=C.toISOString().split("T")[0]}}c==null||c({startDate:x,endDate:w})},f=new Date().toISOString().split("T")[0];return t.jsxs("div",{className:"cn-date-range",children:[t.jsx("input",{type:"date",className:"cn-form-field__input cn-date-range__input",value:o||"",onChange:g,max:i||f,disabled:d}),t.jsx("span",{className:"cn-date-range__separator",children:"to"}),t.jsx("input",{type:"date",className:"cn-form-field__input cn-date-range__input",value:i||"",onChange:m,min:o||void 0,max:f,disabled:d}),p&&t.jsxs("span",{className:"cn-date-range__limit",children:[p,"-day max"]})]})}const g2={3:"accept",2:"custom",1:"reject"},v2={Essential:"essential",Analytics:"analytics",Marketing:"marketing",Functional:"functional"},y2=[{key:"id",label:"Consent ID",sortable:!0},{key:"level",label:"Consent Level",sortable:!0},{key:"categories",label:"Categories",sortable:!1},{key:"date",label:"Date / Time",sortable:!0},{key:"ip",label:"IP Address",sortable:!1}];function _2(o){return{id:t.jsx("span",{className:"cn-consent-id",children:o.id}),level:t.jsx("span",{className:`cn-level-pill cn-level-pill--${g2[o.levelNum]||"custom"}`,children:o.level}),categories:t.jsx("div",{className:"cn-cat-tags",children:(o.categories||[]).map(i=>t.jsx("span",{className:`cn-cat-tag cn-cat-tag--${v2[i]||"essential"}`,children:i},i))}),date:o.date,ip:t.jsxs("span",{className:"cn-ip-masked",children:[o.ip," ",t.jsx(Gs,{size:14,style:{verticalAlign:"middle"}})]})}}function ki({maxRange:o,onStatsUpdate:i}){const c=new Date().toISOString().split("T")[0],p=new Date(Date.now()-10080*60*1e3).toISOString().split("T")[0],[d,g]=j.useState({startDate:p,endDate:c}),[m,f]=j.useState(1),[v,w]=j.useState("date"),[x,S]=j.useState("desc"),[L,z]=j.useState([]),[C,P]=j.useState(0),[N,D]=j.useState(0),[I,A]=j.useState(!0),[W,$]=j.useState(null),O=j.useRef(""),K=j.useCallback(async()=>{A(!0),$(null);const T=`${d.startDate}|${d.endDate}`;try{const J=await Bu({page:m,start_date:d.startDate,end_date:d.endDate,sort:v,order:x});z((J.logs||[]).map(_2)),P(J.totalPages||0),D(J.total||0),i&&T!==O.current&&(O.current=T,i(J.consentBreakdown||null))}catch(J){$(J.message||"Failed to load consent logs."),i&&T!==O.current&&(O.current=T,i(null))}finally{A(!1)}},[m,d,v,x]);j.useEffect(()=>{K()},[K]);const Q=T=>{g(T),f(1)},Z=(T,J)=>{w(T),S(J),f(1)};return t.jsxs("div",{className:"cn-consent-log-table",children:[t.jsxs("div",{className:"cn-consent-log-table__controls",children:[t.jsx(wi,{startDate:d.startDate,endDate:d.endDate,onChange:Q,maxRange:o}),N>0&&t.jsxs("span",{className:"cn-consent-log-table__count",children:[N.toLocaleString()," record",N!==1?"s":""]})]}),W&&t.jsx("div",{className:"cn-notice cn-notice--error",children:W}),t.jsx(m2,{columns:y2,rows:L,pageSize:10,currentPage:m,totalPages:C,onPageChange:f,onSort:Z,sortColumn:v,sortDirection:x,loading:I,emptyMessage:"No consent records found for selected date range."})]})}const Ni={pass:{icon:t.jsx(mi,{size:16}),cls:"pass"},warn:{icon:t.jsx(gi,{size:16}),cls:"warn"},fail:{icon:"○",cls:"fail"},na:{icon:"–",cls:"na"}};function x2({items:o}){return t.jsx("div",{className:"cn-evidence-panel",children:o.map((i,c)=>{const p=Ni[i.status]||Ni.na;return t.jsxs("div",{className:"cn-evidence-item",children:[t.jsx("span",{className:`cn-evidence-item__icon cn-evidence-item__icon--${p.cls}`,children:p.icon}),t.jsx("span",{className:"cn-evidence-item__text",children:i.text})]},c)})})}function Si({proLocked:o=!1,onOpenPricingModal:i}){const[c,p]=j.useState("gdpr"),{dashboard:d}=vt(),{config:g}=Mt(),m=(g==null?void 0:g.blocking)||{},f=m.providers||[],v=f.length>0,w=f.filter(A=>!A.CategoryID).length,x=v&&w===0,S=v&&w>0,L=!!m.gpc_support,z=(d==null?void 0:d.consentCount)??0,C=[{status:"pass",text:"Consent banner active on all pages"},{status:x?"pass":S?"warn":"na",text:x?"Cookie categories clearly defined":S?"Cookie categories — some trackers still uncategorized":"Cookie categories — run a script scan to assess"},{status:"na",text:"Data retention policy — verify in web app"},{status:"na",text:"DPO contact details — verify in web app"}],P=[{status:L?"pass":"warn",text:L?"Do Not Sell / Share signal honored (GPC active)":"Do Not Sell / Share signal — enable GPC in Consent Modes"},{status:"pass",text:"Opt-out mechanism functional"},{status:"na",text:"Privacy policy link in banner — verify in web app"},{status:"na",text:"Consumer rights request handling — verify in web app"}],N=[{status:x?"pass":S?"fail":"na",text:x?"Prior consent obtained before non-essential cookies":S?"Prior consent — uncategorized trackers firing without consent":"Prior consent — run a script scan to assess"},{status:z>0?"pass":"warn",text:z>0?"Consent withdrawal mechanism available and in use":"Consent withdrawal — no consent records yet; verify banner is live"},{status:"na",text:"Cookie lifetime disclosure — verify in web app"},{status:"na",text:"Legitimate interest assessment — verify in web app"}],D=[{key:"gdpr",label:"GDPR",items:C,locked:!1},{key:"ccpa",label:"CCPA",items:P,locked:!1},{key:"eprivacy",label:"ePrivacy",items:N,locked:o}],I=D.find(A=>A.key===c);return t.jsxs("div",{className:"cn-compliance-evidence",children:[t.jsx("nav",{className:"cn-evidence-tabs",children:D.map(A=>t.jsxs("button",{type:"button",className:`cn-evidence-tab${c===A.key?" cn-evidence-tab--active":""}`,onClick:()=>p(A.key),children:[A.label,A.locked&&t.jsx(wn,{})]},A.key))}),I!=null&&I.locked?t.jsx("div",{className:"cn-evidence-panel cn-evidence-panel--locked",children:t.jsxs("div",{className:"cn-evidence-lock",children:[t.jsx("span",{className:"cn-evidence-lock__icon",children:t.jsx(Gs,{size:24})}),t.jsx("p",{className:"cn-evidence-lock__msg",children:"ePrivacy compliance evidence is available on Pro. Upgrade to unlock."}),t.jsx("button",{type:"button",className:"cn-button cn-button--upgrade",onClick:()=>i&&i(),children:"Upgrade to Pro"})]})}):t.jsx(x2,{items:(I==null?void 0:I.items)||[]})]})}function j2({isPro:o=!1,onOpenPricingModal:i}){const c=new Date().toISOString().split("T")[0],p=new Date(Date.now()-720*60*60*1e3).toISOString().split("T")[0],[d,g]=j.useState({startDate:p,endDate:c}),{exportCsv:m,loading:f,error:v}=Ad(),w=()=>{m==null||m({start_date:d.startDate,end_date:d.endDate})};return o?t.jsxs("div",{className:"cn-export-section",children:[t.jsx("div",{className:"cn-export-section__label",children:"Export Consent Log"}),t.jsx(wi,{startDate:d.startDate,endDate:d.endDate,onChange:g}),t.jsx($e,{variant:"primary",onClick:w,disabled:f,children:f?"Exporting…":"Export CSV"}),v&&t.jsx("div",{className:"cn-export-section__error",children:v})]}):t.jsx(Jo,{requiredTier:"pro",message:"Upgrade to Pro to export consent logs as CSV.",onCta:i,children:t.jsxs("div",{className:"cn-export-section cn-export-section--locked",children:[t.jsx("div",{className:"cn-export-section__label",children:"Export Consent Log"}),t.jsx($e,{variant:"outline",disabled:!0,children:"Export CSV"})]})})}function w2(){const o=[{id:"CID-7F2A9C",level:"Personalized",levelNum:3,date:"2026-02-26 14:37",ip:"192.168.x.x"},{id:"CID-4B1E3D",level:"Balanced",levelNum:2,date:"2026-02-26 13:58",ip:"10.0.x.x"},{id:"CID-9A0F12",level:"Private",levelNum:1,date:"2026-02-26 13:21",ip:"172.16.x.x"},{id:"CID-C3D8E5",level:"Personalized",levelNum:3,date:"2026-02-26 12:04",ip:"192.168.x.x"},{id:"CID-2E6B7A",level:"Balanced",levelNum:2,date:"2026-02-25 22:49",ip:"10.0.x.x"}],i=[{type:"banner",what:"Position changed to Bottom",when:"Feb 25, 14:03"},{type:"setting",what:"GDPR regulation enabled",when:"Feb 23, 09:41"},{type:"scan",what:"3 new scripts detected & categorized",when:"Feb 22, 16:18"},{type:"setting",what:"Google Consent Mode v2 activated",when:"Feb 20, 11:05"}],c={3:"accept",2:"custom",1:"reject"},p={banner:"Banner",setting:"Setting",scan:"Scan"};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"cn-blurred-teaser__section",children:[t.jsxs("div",{className:"cn-blurred-teaser__section-header",children:[t.jsx("span",{className:"cn-blurred-teaser__section-title",children:"Cookie Consent Log"}),t.jsx("span",{className:"cn-blurred-teaser__section-meta",children:"3,241 total records — showing 1–5"})]}),t.jsxs("table",{className:"cn-blurred-teaser__table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Consent ID"}),t.jsx("th",{children:"Consent Level"}),t.jsx("th",{children:"Date / Time"}),t.jsx("th",{children:"IP Address"})]})}),t.jsx("tbody",{children:o.map(d=>t.jsxs("tr",{children:[t.jsx("td",{children:t.jsx("span",{className:"cn-consent-id",children:d.id})}),t.jsx("td",{children:t.jsx("span",{className:`cn-level-pill cn-level-pill--${c[d.levelNum]}`,children:d.level})}),t.jsx("td",{children:d.date}),t.jsx("td",{children:t.jsx("span",{className:"cn-ip-masked",children:d.ip})})]},d.id))})]})]}),t.jsxs("div",{className:"cn-blurred-teaser__section",children:[t.jsxs("div",{className:"cn-blurred-teaser__section-header",children:[t.jsx("span",{className:"cn-blurred-teaser__section-title",children:"Config Change History"}),t.jsx("span",{className:"cn-blurred-teaser__section-meta",children:"Last 30 days"})]}),t.jsx("div",{className:"cn-blurred-teaser__timeline",children:i.map((d,g)=>t.jsxs("div",{className:"cn-blurred-teaser__tl-row",children:[t.jsx("div",{className:`cn-blurred-teaser__tl-dot cn-blurred-teaser__tl-dot--${d.type}`}),t.jsxs("div",{className:"cn-blurred-teaser__tl-text",children:[t.jsxs("div",{className:"cn-blurred-teaser__tl-what",children:[t.jsx("span",{className:`cn-change-badge cn-change-badge--${d.type}`,children:p[d.type]}),d.what]}),t.jsx("div",{className:"cn-blurred-teaser__tl-when",children:d.when})]})]},g))})]})]})}function k2(){return t.jsxs(t.Fragment,{children:[t.jsx(dl,{showPortalLink:!1}),t.jsx(Fn,{title:"Why Connect?",children:t.jsx("ul",{className:"cn-benefit-list",children:["Timestamped consent proofs for every visitor interaction","Searchable audit log for GDPR and CCPA regulators","Config change history — who changed what and when","Exportable compliance evidence in one click","Prove compliance if you ever face a regulatory inquiry"].map((o,i)=>t.jsxs("li",{className:"cn-benefit-item",children:[t.jsx("span",{className:"cn-benefit-item__icon",children:t.jsx(mi,{size:16})}),t.jsx("span",{children:o})]},i))})})]})}function Ci({isPro:o,onOpenPricingModal:i,addNotice:c}){return t.jsxs(t.Fragment,{children:[t.jsx(dl,{addNotice:c}),t.jsxs(Fn,{title:"Data Retention",children:[t.jsxs("div",{className:`cn-retention-info${o?" cn-retention-info--pro":""}`,children:[t.jsxs("span",{className:"cn-retention-info__value",children:[o?"Unlimited":"7-day"," retention"]}),t.jsx("span",{className:"cn-retention-info__label",children:o?"Pro plan":"Free plan"})]}),!o&&t.jsx("p",{className:"cn-retention-info__note",children:"Upgrade to Pro for unlimited history."})]}),t.jsx(Fn,{title:"Export",children:t.jsx(j2,{isPro:o,onOpenPricingModal:i??void 0})})]})}function N2({addNotice:o,onOpenWelcomeModal:i,onOpenPricingModal:c}){const{isBasic:p,isFree:d}=Be();if(p)return t.jsxs(yt,{sidebar:t.jsx(k2,{}),children:[t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Audit Trail"}),t.jsx("p",{className:"cn-protection-header__subtitle",children:"Consent logs, compliance evidence, and configuration history."})]}),t.jsx(h2,{onActivate:()=>i&&i()}),t.jsxs("div",{className:"cn-blurred-teaser",children:[t.jsx("div",{className:"cn-blurred-teaser__blur",children:t.jsx(w2,{})}),t.jsxs("div",{className:"cn-blurred-teaser__overlay",children:[t.jsx("span",{className:"cn-blurred-teaser__overlay-icon",children:t.jsx(hi,{size:24})}),t.jsx("div",{className:"cn-blurred-teaser__overlay-label",children:"Full Compliance Audit Trail"}),t.jsx("div",{className:"cn-blurred-teaser__overlay-sub",children:"Consent logs, config timeline, compliance evidence & more"}),t.jsx($e,{variant:"primary",onClick:()=>i&&i(),children:"Activate Protection"})]})]})]});const[g,m]=j.useState(null),[f,v]=j.useState(!0),w=x=>{m(x),v(!1)};return d?t.jsxs(yt,{sidebar:t.jsx(Ci,{isPro:!1,onOpenPricingModal:c,addNotice:o}),children:[t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Audit Trail"}),t.jsx("p",{className:"cn-protection-header__subtitle",children:"Consent logs and compliance evidence for your site."})]}),t.jsx(ji,{breakdown:g,loading:f}),t.jsx(ki,{maxRange:7,onStatsUpdate:w}),t.jsx(xi,{title:"Compliance Evidence"}),t.jsx(Si,{proLocked:!0,onOpenPricingModal:c})]}):t.jsxs(yt,{sidebar:t.jsx(Ci,{isPro:!0,onOpenPricingModal:c,addNotice:o}),children:[t.jsxs("div",{className:"cn-protection-header",children:[t.jsx("h1",{className:"cn-protection-header__title",children:"Audit Trail"}),t.jsx("p",{className:"cn-protection-header__subtitle",children:"Full consent log history, compliance evidence, and configuration timeline."})]}),t.jsx(ji,{breakdown:g,loading:f}),t.jsx(ki,{onStatsUpdate:w}),t.jsx(xi,{title:"Compliance Evidence"}),t.jsx(Si,{proLocked:!1,onOpenPricingModal:c})]})}var S2=Wo();const bi={sm:480,md:720,lg:960},Li='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Pi({isOpen:o,onClose:i,size:c="md",title:p,children:d}){const g=j.useRef(null),m=j.useRef(null),f=j.useCallback(S=>{if(S.key==="Escape"&&i){i();return}if(S.key==="Tab"&&g.current){const L=g.current.querySelectorAll(Li);if(L.length===0){S.preventDefault();return}const z=L[0],C=L[L.length-1];S.shiftKey&&document.activeElement===z?(S.preventDefault(),C.focus()):!S.shiftKey&&document.activeElement===C&&(S.preventDefault(),z.focus())}},[i]);if(j.useEffect(()=>{let S;return o&&(m.current=document.activeElement,document.addEventListener("keydown",f),document.body.style.overflow="hidden",S=setTimeout(()=>{if(g.current){const L=g.current.querySelector(Li);L?L.focus():g.current.focus()}},50)),()=>{clearTimeout(S),document.removeEventListener("keydown",f),document.body.style.overflow="",m.current&&typeof m.current.focus=="function"&&(m.current.focus(),m.current=null)}},[o,f]),!o)return null;const v=S=>{S.target===S.currentTarget&&i&&i()},w={position:"fixed",top:0,right:0,bottom:0,left:0,background:"rgba(0,0,0,0.6)",zIndex:1e5,display:"flex",alignItems:"center",justifyContent:"center",padding:"32px"},x=p?"cn-modal-title":void 0;return S2.createPortal(t.jsx("div",{className:"cn-modal-overlay",style:w,onClick:v,children:t.jsxs("div",{ref:g,className:`cn-modal cn-modal--${c}`,style:{maxWidth:bi[c]||bi.md},role:"dialog","aria-modal":"true","aria-labelledby":x,tabIndex:-1,children:[t.jsx("button",{className:"cn-modal__close",onClick:i,type:"button","aria-label":"Close",children:"×"}),p&&t.jsx("div",{className:"cn-modal__header",id:x,children:p}),t.jsx("div",{className:"cn-modal__content",children:d})]})}),document.body)}function C2({steps:o,currentStep:i=0,onStepClick:c}){return t.jsx("div",{className:"cn-step-dots",role:"group","aria-label":"Progress",children:o.map((p,d)=>{const g=dc(d):void 0,style:g&&c?{cursor:"pointer"}:void 0,tabIndex:g&&c?0:-1},d)})})}function b2({onBannerOnly:o,onProtect:i,onComply:c,onLearnMore:p}){var m;const g=(((m=window.cnReactData)==null?void 0:m.detectedPlugins)||[]).includes("google");return t.jsxs("div",{className:"cn-welcome-step cn-welcome-step--choose",children:[t.jsx("h1",{className:"cn-choose__heading",children:"Choose your protection level"}),g&&t.jsxs("div",{className:"cn-choose__google-notice",children:[t.jsx("strong",{children:"Google tools detected."})," ","Make sure Google Consent Mode is configured during setup."]}),t.jsxs("div",{className:"cn-protection-cards",children:[t.jsxs("div",{className:"cn-protection-card",children:[t.jsx("span",{className:"cn-protection-card__badge cn-protection-card__badge--risk",children:"Banner Only"}),t.jsx("div",{className:"cn-protection-card__icon cn-protection-card__icon--banner",children:t.jsx(Hd,{size:32})}),t.jsx("h4",{className:"cn-protection-card__title",children:"I just want a banner"}),t.jsx("p",{className:"cn-protection-card__subtitle",children:"Display-only notice, no compliance features"}),t.jsx("div",{className:"cn-protection-card__divider"}),t.jsx("div",{className:"cn-protection-card__price-label",children:"Banner Only"}),t.jsx("span",{className:"cn-protection-card__price-note cn-protection-card__price-note--danger",children:"Does not meet GDPR requirements"}),t.jsxs("ul",{className:"cn-protection-card__features",children:[t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Cookie notice banner"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Accept / Reject buttons"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Custom colors & text"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--excluded",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✗"}),"No consent records"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--excluded",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✗"}),"No script blocking"]})]}),t.jsx("div",{className:"cn-protection-card__footer",children:t.jsx("button",{type:"button",className:"cn-protection-card__btn cn-protection-card__btn--ghost",onClick:o,children:"Just the Banner"})})]}),t.jsxs("div",{className:"cn-protection-card cn-protection-card--recommended",children:[t.jsx("span",{className:"cn-protection-card__badge cn-protection-card__badge--rec",children:"Recommended"}),t.jsx("div",{className:"cn-protection-card__icon cn-protection-card__icon--protect",children:t.jsx(Bd,{size:32})}),t.jsx("h4",{className:"cn-protection-card__title",children:"For small sites"}),t.jsx("p",{className:"cn-protection-card__subtitle",children:"Essential compliance, no credit card required"}),t.jsx("div",{className:"cn-protection-card__divider"}),t.jsx("div",{className:"cn-protection-card__price-label",children:"Sign Up Free"}),t.jsx("span",{className:"cn-protection-card__price-note",children:"Up to 1,000 visits / month"}),t.jsxs("ul",{className:"cn-protection-card__features",children:[t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Best for sites without ads"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Google Consent Mode v2"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Global Privacy Control"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Tracker blocking"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Standard Support"]})]}),t.jsx("div",{className:"cn-protection-card__footer",children:t.jsx("button",{type:"button",className:"cn-protection-card__btn cn-protection-card__btn--primary",onClick:i,children:"Protect My Business"})})]}),t.jsxs("div",{className:"cn-protection-card",children:[t.jsx("span",{className:"cn-protection-card__badge cn-protection-card__badge--max",children:"Full Compliance"}),t.jsx("div",{className:"cn-protection-card__icon cn-protection-card__icon--comply",children:t.jsx(Wd,{size:32})}),t.jsx("h4",{className:"cn-protection-card__title",children:"Ensure full compliance"}),t.jsx("p",{className:"cn-protection-card__subtitle",children:"Full coverage for EU, US & growing businesses"}),t.jsx("div",{className:"cn-protection-card__divider"}),t.jsx("div",{className:"cn-protection-card__price-label",children:"$14.95/mo"}),t.jsx("span",{className:"cn-protection-card__price-note",children:"Unlimited visitors protected"}),t.jsxs("ul",{className:"cn-protection-card__features",children:[t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Best for sites with analytics"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Google, Facebook & Microsoft Consent Modes"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Geolocation rules — show right banner by country"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Lifetime audit trail & consent records"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Advanced autoblocking + script categorization"]}),t.jsxs("li",{className:"cn-protection-card__feature cn-protection-card__feature--included",children:[t.jsx("span",{className:"cn-protection-card__feature-icon",children:"✓"}),"Priority Support"]})]}),t.jsx("div",{className:"cn-protection-card__footer",children:t.jsx("button",{type:"button",className:"cn-protection-card__btn cn-protection-card__btn--secondary",onClick:c,children:"Ensure Full Compliance"})})]})]})]})}const L2=[{domains:1,monthly:14.95,yearly:149.5,perDomain:null,popular:!0},{domains:5,monthly:29.95,yearly:299.5,perDomain:5.99},{domains:10,monthly:49.95,yearly:499.5,perDomain:4.99}];function P2({onSelectPlan:o,onBack:i}){const[c,p]=j.useState("monthly");return t.jsxs("div",{className:"cn-welcome-step cn-welcome-step--pro-pricing",children:[t.jsx("button",{type:"button",className:"cn-pro-pricing__back cn-pro-pricing__back--top",onClick:i,children:"← Back to protection options"}),t.jsxs("div",{className:"cn-pro-pricing__hero",children:[t.jsx("h1",{className:"cn-pro-pricing__heading",children:"Compliance by Hu‑manity.co — Professional"}),t.jsx("p",{className:"cn-pro-pricing__sub",children:"Everything you need to protect your business from privacy regulations worldwide."})]}),t.jsxs("div",{className:"cn-pro-pricing__features-band",children:[t.jsx("span",{className:"cn-pro-pricing__features-label",children:"Everything in Free, plus:"}),t.jsxs("ul",{className:"cn-pro-pricing__features-list",children:[t.jsx("li",{children:"🌍 Geolocation rules — show the right banner by country"}),t.jsx("li",{children:"📊 Google Consent Mode v2 — required for Google Analytics & Ads"}),t.jsx("li",{children:"♾️ Unlimited visits & lifetime consent records"}),t.jsx("li",{children:"🔒 Advanced autoblocking & script categorization"})]})]}),t.jsxs("div",{className:"cn-pill-toggle",style:{margin:"0 auto 24px"},children:[t.jsx("button",{type:"button",className:`cn-pill-toggle__btn${c==="monthly"?" cn-pill-toggle__btn--active":""}`,onClick:()=>p("monthly"),children:"Monthly"}),t.jsxs("button",{type:"button",className:`cn-pill-toggle__btn${c==="yearly"?" cn-pill-toggle__btn--active":""}`,onClick:()=>p("yearly"),children:["Yearly ",t.jsx("span",{className:"cn-pill-toggle__badge",children:"Save 17%"})]})]}),t.jsx("div",{className:"cn-pro-pricing__cards",children:L2.map(d=>t.jsxs("div",{className:`cn-pro-pricing__card${d.popular?" cn-pro-pricing__card--popular":""}`,children:[d.popular&&t.jsx("span",{className:"cn-pro-pricing__card-badge",children:"Most Popular"}),t.jsx("div",{className:"cn-pro-pricing__card-domains",children:d.domains}),t.jsx("span",{className:"cn-pro-pricing__card-domains-label",children:d.domains===1?"Domain":"Domains"}),t.jsxs("div",{className:"cn-pro-pricing__card-price",children:[t.jsx("sup",{children:"$"}),c==="monthly"?d.monthly.toFixed(2):d.yearly.toFixed(2),t.jsxs("sub",{children:["/ ",c==="monthly"?"mo":"yr"]})]}),d.perDomain&&t.jsxs("span",{className:"cn-pro-pricing__card-per-domain",children:["$",d.perDomain.toFixed(2)," per domain"]}),t.jsx("button",{type:"button",className:`cn-pro-pricing__card-btn${d.popular?" cn-pro-pricing__card-btn--primary":""}`,onClick:()=>o(d.domains,c,d[c]),children:"Select Plan"})]},d.domains))}),t.jsx("p",{className:"cn-pro-pricing__guarantee",children:"✓ 30-day money-back guarantee on all plans"}),c==="yearly"&&t.jsx("p",{className:"cn-pro-pricing__billing-note",children:"Billed annually. Cancel anytime."}),t.jsxs("div",{className:"cn-pro-pricing__legal",children:[t.jsx("a",{href:"https://hu-manity.co/terms",target:"_blank",rel:"noreferrer",children:"Terms of Service"})," · ",t.jsx("a",{href:"https://hu-manity.co/privacy",target:"_blank",rel:"noreferrer",children:"Privacy Policy"})]}),t.jsx("div",{className:"cn-pro-pricing__maybe-later",children:t.jsx("button",{type:"button",className:"cn-pro-pricing__maybe-later-btn",onClick:i,children:"Maybe later — stay on free"})})]})}const E2=[{text:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Consent records"})," — no proof if a regulator asks"]})},{text:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Cookie autoblocking"})," — scripts fire before consent"]})},{text:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Audit trail"})," — no evidence if investigated"]})},{text:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Google Consent Mode"})," — EU ads may be flagged"]})}];function D2({onDismissToSettings:o,onBackToChoose:i}){const[c,p]=j.useState(!1);return t.jsx("div",{className:"cn-welcome-step cn-welcome-step--warning",children:t.jsxs("div",{className:"cn-warning-modal",children:[t.jsx("div",{className:"cn-warning-modal__icon",children:t.jsx(gi,{size:32})}),t.jsx("h3",{className:"cn-warning-modal__heading",children:"Are you sure?"}),t.jsxs("p",{className:"cn-warning-modal__text",children:["Without Cookie Compliance, ",t.jsx("strong",{children:"all liability falls on you."})]}),t.jsxs("div",{className:"cn-warning-modal__consequences",children:[t.jsx("h5",{children:"You won’t have:"}),t.jsx("ul",{children:E2.map((d,g)=>t.jsxs("li",{children:[t.jsx("span",{className:"cn-warning-modal__consequence-icon",children:"❌"}),t.jsx("span",{children:d.text})]},g))})]}),t.jsxs("label",{className:"cn-warning-modal__checkbox",children:[t.jsx("input",{type:"checkbox",checked:c,onChange:d=>p(d.target.checked)}),t.jsxs("span",{children:["I understand ",t.jsx("strong",{children:"all liability falls on me and my business."})]})]}),t.jsxs("div",{className:"cn-warning-modal__actions",children:[t.jsx("button",{type:"button",className:"cn-warning-modal__btn cn-warning-modal__btn--danger",disabled:!c,onClick:o,children:"Don’t protect my business"}),t.jsx("button",{type:"button",className:"cn-warning-modal__btn cn-warning-modal__btn--safe",onClick:i,children:"Protect my business →"})]})]})})}const Ei=/^(?=.*[A-Z])(?=.*\d)[\w !"#$%&'()*+,\-./:;<=>?@[\]^\x60{|}~\\]{8,}$/;function T2({onComplete:o,onCompleteWithSubscriptions:i}){const[c,p]=j.useState("register"),[d,g]=j.useState(""),[m,f]=j.useState(""),[v,w]=j.useState(""),[x,S]=j.useState(!1),[L,z]=j.useState(!1),[C,P]=j.useState(null),N=window.cnReactData||{},D=W=>{p(W),P(null)},I=()=>{if(!d)return"Email is required.";if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d))return"Please enter a valid email address.";if(c==="register"){if(!m)return"Password is required.";if(!Ei.test(m))return"Password must be 8+ characters with at least 1 capital letter and 1 number.";if(m!==v)return"Passwords do not match.";if(!x)return"Please accept the Terms of Service to continue."}else if(!m)return"Password is required.";return null},A=async W=>{W.preventDefault(),P(null);const $=I();if($){P($);return}z(!0);try{const O=c==="register"?N.registerNonce||"":N.loginNonce||"",Q=await In(c,c==="register"?{email:d,pass:m,pass2:v,terms:"1",language:"en"}:{email:d,pass:m},O);if(Q===!0||Q===1)o();else if(Q&&Q.error)P(Q.error);else if(Q!=null&&Q.app_has_subscription)o();else{const Z=Array.isArray(Q==null?void 0:Q.subscriptions)?Q.subscriptions.filter(T=>parseInt(T.availablelicense,10)>0).sort((T,J)=>parseInt(J.availablelicense,10)-parseInt(T.availablelicense,10)):[];Z.length>0&&i?i(Z,Q.fresh_nonce||""):o()}}catch(O){P(O.message||"Something went wrong. Please try again.")}finally{z(!1)}};return t.jsxs("div",{className:"cn-welcome-step cn-welcome-step--account",children:[t.jsx("h2",{className:"cn-account-heading",children:c==="register"?"Create your account":"Welcome back"}),t.jsx("p",{className:"cn-account-subtitle",children:c==="register"?"Takes 30 seconds. No credit card required.":"Log in to connect your existing Cookie Compliance account."}),t.jsxs("div",{className:"cn-pill-toggle",style:{minWidth:280,alignSelf:"center",marginBottom:24},children:[t.jsx("button",{type:"button",className:"cn-pill-toggle__btn"+(c==="register"?" cn-pill-toggle__btn--active":""),onClick:()=>D("register"),children:"Create Account"}),t.jsx("button",{type:"button",className:"cn-pill-toggle__btn"+(c==="login"?" cn-pill-toggle__btn--active":""),onClick:()=>D("login"),children:"Sign In"})]}),C==="email_exists"&&c==="register"?t.jsxs("div",{className:"cn-auth-form__error",children:["An account with this email already exists."," ",t.jsx("button",{type:"button",className:"cn-auth-form__switch-link",onClick:()=>{const W=d;D("login"),g(W)},children:"Sign in instead →"})]}):C?t.jsx("div",{className:"cn-auth-form__error",children:C}):null,c==="register"?t.jsxs(t.Fragment,{children:[t.jsxs("form",{className:"cn-auth-form",onSubmit:A,children:[t.jsx(Se,{label:"Email address",type:"email",value:d,onChange:g,placeholder:"you@company.com",autoComplete:"email"}),t.jsx(Se,{label:"Password",type:"password",value:m,onChange:f,placeholder:"Min. 8 characters, 1 capital, 1 number",autoComplete:"new-password"}),m&&!Ei.test(m)&&t.jsx("p",{className:"cn-auth-form__field-hint",children:"Min. 8 characters, at least 1 capital letter and 1 number"}),t.jsx(Se,{label:"Confirm Password",type:"password",value:v,onChange:w,placeholder:"Confirm password",autoComplete:"new-password"}),t.jsxs("label",{className:"cn-auth-form__terms",children:[t.jsx("input",{type:"checkbox",checked:x,onChange:W=>S(W.target.checked),required:!0})," ","I have read and agree to the"," ",t.jsx("a",{href:"https://hu-manity.co/terms",target:"_blank",rel:"noreferrer",children:"Terms of Service"})]}),t.jsx("div",{className:"cn-auth-form__actions",children:t.jsx("button",{type:"submit",className:"cn-button cn-button--primary cn-button--block",disabled:L||!x,children:L?"Creating account…":"Create Account"})})]}),t.jsx("div",{className:"cn-auth-or",children:t.jsx("span",{children:"OR"})}),t.jsxs("div",{className:"cn-auth-signin-teaser",children:[t.jsx("p",{className:"cn-auth-signin-teaser__heading",children:"Already have an account?"}),t.jsx("button",{type:"button",className:"cn-button cn-button--outline-primary",onClick:()=>D("login"),children:"Sign In"})]})]}):t.jsxs("form",{className:"cn-auth-form",onSubmit:A,autoComplete:"off",children:[t.jsxs("div",{"aria-hidden":"true",style:{position:"absolute",left:"-9999px",width:"1px",height:"1px",overflow:"hidden"},children:[t.jsx("input",{type:"text",name:"username",autoComplete:"username",tabIndex:-1,defaultValue:""}),t.jsx("input",{type:"password",name:"password",autoComplete:"current-password",tabIndex:-1,defaultValue:""})]}),t.jsx(Se,{label:"Email address",type:"email",name:"cn-account-email",value:d,onChange:g,placeholder:"you@company.com",autoComplete:"username",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1}),t.jsx(Se,{label:"Password",type:"password",name:"cn-account-password",value:m,onChange:f,placeholder:"Your password",autoComplete:"new-password"}),t.jsx("div",{className:"cn-auth-form__forgot",children:t.jsx("a",{href:`${Qe}/forgot`,target:"_blank",rel:"noreferrer",children:"Forgot password?"})}),t.jsx("div",{className:"cn-auth-form__actions",children:t.jsx("button",{type:"submit",className:"cn-button cn-button--primary cn-button--block",disabled:L,children:L?"Logging in…":"Sign In"})})]})]})}async function R2({plan:o,paymentNonce:i,method:c,identifier:p}){const d=window.cnReactData||{},g=new FormData;g.append("action","cn_api_request"),g.append("nonce",d.welcomeNonce||""),g.append("request","payment"),g.append("cn_payment_nonce",d.paymentNonce||""),g.append("plan",o),g.append("payment_nonce",i),g.append("method",c),g.append("cn_payment_identifier",p||""),d.network&&g.append("cn_network","1");const m=await fetch(d.ajaxURL||"/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",body:g});if(!m.ok)throw new Error(`Payment request failed: ${m.status}`);return m.json()}const Di="https://js.braintreegateway.com/web/3.71.0/js";function Ti(o){return new Promise((i,c)=>{if(document.querySelector(`script[src="${o}"]`)){i();return}const p=document.createElement("script");p.src=o,p.async=!0,p.onload=i,p.onerror=()=>c(new Error(`Failed to load: ${o}`)),document.head.appendChild(p)})}function Ri({plan:o,onComplete:i,onBack:c=null,backLabel:p="Back"}){const[d,g]=j.useState("loading"),[m,f]=j.useState(null),[v,w]=j.useState(""),[x,S]=j.useState(!1),L=j.useRef(null);j.useEffect(()=>{let N=!1;async function D(){var $,O,K,Q;const I=["localhost","127.0.0.1"].includes(window.location.hostname);if(window.location.protocol!=="https:"&&!I){f("Secure payment requires HTTPS. Please contact your host."),g("error");return}try{await Ti(`${Di}/client.min.js`),await Ti(`${Di}/hosted-fields.min.js`)}catch{N||(f("Payment currently unavailable. Please try again later."),g("error"));return}if(typeof((O=($=window.braintree)==null?void 0:$.client)==null?void 0:O.create)!="function"||typeof((Q=(K=window.braintree)==null?void 0:K.hostedFields)==null?void 0:Q.create)!="function"){N||(f("Payment currently unavailable. Please try again later."),g("error"));return}let A;try{const Z=await In("get_bt_init_token");A=Z==null?void 0:Z.token}catch{A=null}if(!A){N||(f("Unable to initialize payment. Please refresh and try again."),g("error"));return}let W;try{W=await window.braintree.client.create({authorization:A})}catch{N||(f("Unable to initialize payment. Please refresh and try again."),g("error"));return}try{const Z=await window.braintree.hostedFields.create({client:W,styles:{input:{"font-size":"14px","font-family":"Lato, sans-serif",color:"#434f58"},"input.invalid":{color:"#e74c3c"},"input.valid":{color:"#434f58"}},fields:{number:{container:"#cn_card_number",placeholder:"•••• •••• •••• ••••"},expirationDate:{container:"#cn_expiration_date",placeholder:"MM / YY"},cvv:{container:"#cn_cvv",placeholder:"CVV"}}});if(N){Z.teardown();return}L.current=Z,Z.on("validityChange",()=>{const T=Z.getState(),J=Object.values(T.fields).every(me=>me.isValid);S(J)}),g("ready")}catch{N||(f("Unable to initialize payment. Please refresh and try again."),g("error"))}}return D(),()=>{N=!0,L.current&&(L.current.teardown(),L.current=null)}},[]);const z=async N=>{var D;if(N.preventDefault(),!(!L.current||d==="submitting")){g("submitting"),f(null);try{const I=await L.current.tokenize(),A=I.nonce,W=((D=I.details)==null?void 0:D.lastFour)||"",$=await R2({plan:o.planKey,paymentNonce:A,method:"credit_card",identifier:W});if($&&typeof $=="string"&&$.length>0)i();else{const O=($==null?void 0:$.error)||($==null?void 0:$.message)||"Payment failed. Please try again.";f(O),g("ready")}}catch(I){f(I.message||"Card error. Please check your details and try again."),g("ready")}}},C=(o==null?void 0:o.billing)==="yearly"?"Yearly":"Monthly",P=o?`${o.domains} Domain${o.domains>1?"s":""} — $${o.price.toFixed(2)} / ${C}`:"";return t.jsxs("div",{className:"cn-welcome-step cn-payment-step",children:[t.jsx("h2",{className:"cn-payment-step__heading",children:"Complete Your Order"}),o&&t.jsx("div",{className:"cn-payment-step__plan-pill",children:P}),m&&t.jsx("div",{className:"cn-payment-step__error",role:"alert",children:m}),d==="loading"&&!m&&t.jsx("p",{className:"cn-payment-step__loading",children:"Initializing secure payment form…"}),t.jsxs("form",{className:"cn-payment-step__form",onSubmit:z,style:{display:d==="loading"||d==="error"?"none":"block"},children:[t.jsxs("div",{className:"cn-payment-step__field",children:[t.jsx("label",{className:"cn-payment-step__label",htmlFor:"cn_card_name",children:"Cardholder Name"}),t.jsx("input",{id:"cn_card_name",type:"text",className:"cn-payment-step__input",value:v,onChange:N=>w(N.target.value),placeholder:"Name on card",autoComplete:"cc-name"})]}),t.jsxs("div",{className:"cn-payment-step__field",children:[t.jsx("label",{className:"cn-payment-step__label",children:"Card Number"}),t.jsx("div",{id:"cn_card_number",className:"cn-payment-step__hosted-field"})]}),t.jsxs("div",{className:"cn-payment-step__row",children:[t.jsxs("div",{className:"cn-payment-step__field",children:[t.jsx("label",{className:"cn-payment-step__label",children:"Expiry"}),t.jsx("div",{id:"cn_expiration_date",className:"cn-payment-step__hosted-field"})]}),t.jsxs("div",{className:"cn-payment-step__field",children:[t.jsx("label",{className:"cn-payment-step__label",children:"CVV"}),t.jsx("div",{id:"cn_cvv",className:"cn-payment-step__hosted-field"})]})]}),t.jsx("div",{className:"cn-payment-step__braintree-badge",children:"🔒 Secured by Braintree"}),t.jsx("button",{type:"submit",className:"cn-button cn-button--primary cn-button--block cn-payment-step__submit",disabled:d==="submitting"||!x||!v.trim(),children:d==="submitting"?"Processing…":"Complete Purchase"}),c&&t.jsx("button",{type:"button",className:"cn-button cn-button--outline-primary cn-button--block cn-payment-step__back",onClick:c,children:p}),t.jsx("p",{className:"cn-payment-step__guarantee",children:"🛡️ 30-day money-back guarantee"}),t.jsxs("p",{className:"cn-payment-step__legal",children:["By completing your purchase you agree to our",t.jsx("a",{href:"https://hu-manity.co/terms",target:"_blank",rel:"noopener noreferrer",className:"cn-link",children:"Terms of Service"}),"and",t.jsx("a",{href:"https://cookie-compliance.co/privacy-policy/",target:"_blank",rel:"noopener noreferrer",className:"cn-link",children:"Privacy Policy"}),"."]})]}),c&&(d==="loading"||d==="error")&&t.jsx("button",{type:"button",className:"cn-button cn-button--outline-primary cn-button--block cn-payment-step__back cn-payment-step__back--standalone",onClick:c,children:p})]})}function z2({subscriptions:o,selectedPlan:i,nonce:c,onSuccess:p,onPayInstead:d,onFreeInstead:g}){var P;const[m,f]=j.useState(((P=o[0])==null?void 0:P.subscriptionid)??null),[v,w]=j.useState(!1),[x,S]=j.useState(!1),[L,z]=j.useState(null);o.reduce((N,D)=>N+parseInt(D.availablelicense,10),0);const C=async()=>{if(!(!m||v||x)){w(!0),z(null);try{const N=await In("use_license",{subscriptionID:m},"",c);if(N&&N.error)z(N.error),w(!1);else{S(!0);const D=o.find(A=>A.subscriptionid===m),I=D?Math.max(0,parseInt(D.availablelicense,10)-1):null;p(I)}}catch(N){z(N.message||"Something went wrong. Please try again."),w(!1)}}};return i?t.jsxs("div",{className:"cn-welcome-step cn-license-select",children:[t.jsx("h2",{className:"cn-license-select__heading",children:"You have unused Pro licenses — do you want to use one for this domain?"}),t.jsx("p",{className:"cn-license-select__sub",children:"Your existing plan covers this site. We’ll connect it now — no payment needed."}),o.length===1?t.jsxs("div",{className:"cn-license-select__single-card",children:[t.jsx("span",{className:"cn-license-select__card-name",children:"Compliance Pro"}),t.jsxs("span",{className:"cn-license-select__card-slots",children:[parseInt(o[0].availablelicense,10)," ","domain",parseInt(o[0].availablelicense,10)!==1?"s":""," remaining"]})]}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"cn-license-select__choose-label",children:"You have multiple plans with available sites. Choose one to connect this site to:"}),t.jsx("div",{className:"cn-license-select__cards",role:"radiogroup",children:o.map(N=>{const D=parseInt(N.availablelicense,10);return t.jsxs("label",{className:"cn-license-select__card"+(m===N.subscriptionid?" cn-license-select__card--selected":""),children:[t.jsx("input",{type:"radio",name:"cn_subscription",value:N.subscriptionid,checked:m===N.subscriptionid,onChange:()=>f(N.subscriptionid),className:"cn-license-select__radio"}),t.jsxs("div",{className:"cn-license-select__card-body",children:[t.jsx("span",{className:"cn-license-select__card-name",children:"Compliance Pro"}),t.jsxs("span",{className:"cn-license-select__card-slots",children:[D," domain",D!==1?"s":""," remaining"]})]})]},N.subscriptionid)})})]}),L&&t.jsx("div",{className:"cn-license-select__error",role:"alert",children:L}),t.jsx("div",{className:"cn-license-select__actions",children:t.jsx("button",{type:"button",className:"cn-button cn-button--primary cn-button--block",onClick:C,disabled:v||x||!m,children:v?"Connecting…":o.length>1?"Connect This Site to Selected Plan":"Connect This Site"})}),d&&t.jsx("button",{type:"button",className:"cn-license-select__free-link",onClick:d,children:"Need a different plan? Purchase a new subscription instead"})]}):t.jsxs("div",{className:"cn-welcome-step cn-license-select cn-license-select--upsell",children:[t.jsx("div",{className:"cn-license-select__upsell-icon",children:"✅"}),t.jsx("h2",{className:"cn-license-select__heading",children:"Good news — your account already has a Pro plan with available slots. Activate it here, free."}),t.jsx("p",{className:"cn-license-select__sub",children:"You have unused Pro license slots available. Connect this site to your existing plan at no extra cost — or continue with the free version."}),o.length>1&&t.jsx("div",{className:"cn-license-select__cards",role:"radiogroup",children:o.map(N=>{const D=parseInt(N.availablelicense,10);return t.jsxs("label",{className:"cn-license-select__card"+(m===N.subscriptionid?" cn-license-select__card--selected":""),children:[t.jsx("input",{type:"radio",name:"cn_subscription",value:N.subscriptionid,checked:m===N.subscriptionid,onChange:()=>f(N.subscriptionid),className:"cn-license-select__radio"}),t.jsxs("div",{className:"cn-license-select__card-body",children:[t.jsx("span",{className:"cn-license-select__card-name",children:"Compliance Pro"}),t.jsxs("span",{className:"cn-license-select__card-slots",children:[D," domain",D!==1?"s":""," remaining"]})]})]},N.subscriptionid)})}),L&&t.jsx("div",{className:"cn-license-select__error",role:"alert",children:L}),t.jsx("div",{className:"cn-license-select__actions",children:t.jsx("button",{type:"button",className:"cn-button cn-button--primary cn-button--block",onClick:C,disabled:v||x||!m,children:v?"Activating…":"Upgrade to Pro — No Extra Charge"})}),t.jsx("button",{type:"button",className:"cn-license-select__free-link",onClick:g,children:"Continue with free version instead"})]})}const A2=[{label:"Choose Protection"},{label:"Confirm"},{label:"Create Account"}];function zi(o){return o==="choose"||o==="pro-pricing"?0:o==="warning"?1:2}const M2=(o,i)=>"compliance_"+i+"_"+(o===1?"notrial":String(o));function I2({isOpen:o,onClose:i,onDismissToSettings:c}){const[p,d]=j.useState("choose"),[g,m]=j.useState(null),[f,v]=j.useState([]),[w,x]=j.useState(""),S=()=>{d("choose"),m(null),v([]),x(""),c?c():i&&i()},L=()=>{g?d("payment"):window.location.reload()},z=(N,D)=>{v(N),x(D),d("license-select")},C=N=>{const D=zi(p);N{switch(p){case"choose":return t.jsx(b2,{onBannerOnly:()=>d("warning"),onProtect:()=>d("account"),onComply:()=>d("pro-pricing"),onLearnMore:()=>d("pro-pricing")});case"pro-pricing":return t.jsx(P2,{onSelectPlan:(N,D,I)=>{m({planKey:M2(N,D),domains:N,billing:D,price:I}),d("account")},onBack:()=>{m(null),d("choose")}});case"warning":return t.jsx(D2,{onDismissToSettings:S,onBackToChoose:()=>d("choose")});case"account":return t.jsx(T2,{onComplete:L,onCompleteWithSubscriptions:z});case"license-select":return t.jsx(z2,{subscriptions:f,selectedPlan:g,nonce:w,onSuccess:N=>{const D=new URL(window.location.href);D.searchParams.set("license_assigned","1"),N!=null&&D.searchParams.set("slots_remaining",String(N)),window.location.href=D.toString()},onPayInstead:g?()=>d("payment"):null,onFreeInstead:()=>window.location.reload()});case"payment":return t.jsx(Ri,{plan:g,onComplete:()=>window.location.reload(),onBack:()=>d("account"),backLabel:"Back"});default:return null}};return t.jsxs(Pi,{isOpen:o,onClose:S,size:"lg",children:[P(),t.jsx(C2,{steps:A2,currentStep:zi(p),onStepClick:C})]})}const F2=[{icon:t.jsx(Gs,{size:24}),title:"Autoblocking",desc:"Scripts wait for visitor consent before firing."},{icon:t.jsx(Od,{size:24}),title:"Geographic Enforcement",desc:"Apply different rules by visitor location."},{icon:t.jsx(hi,{size:24}),title:"Consent Proofs",desc:"Exportable audit trail for every consent event."},{icon:t.jsx(Gd,{size:24}),title:"Priority Support",desc:"Fast, expert help when you need it."},{icon:t.jsx(Ud,{size:24}),title:"Advanced Analytics",desc:"Consent rates, geography, and trend data."},{icon:t.jsx($d,{size:24}),title:"Script Wizard",desc:"Register and manage third-party scripts easily."}],B2=[{domains:1,monthly:14.95,yearly:149.5,perDomain:null},{domains:5,monthly:29.95,yearly:299.5,perDomain:5.99,popular:!0,tagline:"Best for dev + staging + production"},{domains:10,monthly:49.95,yearly:499.5,perDomain:4.99,tagline:"For agencies & multi-site networks"}],O2=(o,i)=>"compliance_"+i+"_"+(o===1?"notrial":String(o));function U2({isOpen:o,onClose:i}){const[c,p]=j.useState("monthly"),[d,g]=j.useState(null),{isFree:m}=Be(),f=()=>{g(null),i()};return t.jsx(Pi,{isOpen:o,onClose:f,size:"lg",children:d?t.jsx("div",{className:"cn-welcome-step",children:t.jsx(Ri,{plan:d,onComplete:()=>window.location.reload(),onBack:()=>g(null),backLabel:"Back to plans"})}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"cn-pricing-hero",children:[t.jsx("h2",{className:"cn-pricing-hero__heading",children:"Compliance by Hu‑manity.co — Professional"}),t.jsx("p",{className:"cn-pricing-hero__sub",children:"Everything you need to stay compliant, protect your visitors, and prove it."})]}),t.jsx("div",{className:"cn-benefit-grid",children:F2.map((v,w)=>t.jsxs("div",{className:"cn-benefit-card",children:[t.jsx("div",{className:"cn-benefit-card__icon",children:v.icon}),t.jsx("div",{className:"cn-benefit-card__title",children:v.title}),t.jsx("div",{className:"cn-benefit-card__desc",children:v.desc})]},w))}),t.jsxs("div",{className:"cn-pill-toggle",style:{margin:"0 auto 20px"},children:[t.jsx("button",{className:`cn-pill-toggle__btn${c==="monthly"?" cn-pill-toggle__btn--active":""}`,type:"button",onClick:()=>p("monthly"),children:"Monthly"}),t.jsxs("button",{className:`cn-pill-toggle__btn${c==="yearly"?" cn-pill-toggle__btn--active":""}`,type:"button",onClick:()=>p("yearly"),children:["Yearly",t.jsx("span",{className:"cn-pill-toggle__badge",children:"Save 17%"})]})]}),t.jsx("div",{className:"cn-pricing-cards",children:B2.map(v=>t.jsxs("div",{className:`cn-pricing-card${v.popular?" cn-pricing-card--popular":""}`,children:[v.popular&&t.jsx("div",{className:"cn-pricing-card__popular-badge",children:"Most Popular"}),t.jsx("div",{className:"cn-pricing-card__domains",children:v.domains}),t.jsx("div",{className:"cn-pricing-card__domains-label",children:v.domains===1?"domain":"domains"}),v.tagline&&t.jsx("div",{className:"cn-pricing-card__tagline",children:v.tagline}),t.jsxs("div",{className:"cn-pricing-card__price",children:[t.jsx("sup",{children:"$"}),c==="monthly"?v.monthly.toFixed(2):(v.yearly/12).toFixed(2),t.jsx("sub",{children:" / mo"})]}),t.jsxs("div",{className:"cn-pricing-card__billed-note",style:c==="monthly"?{visibility:"hidden"}:void 0,children:["$",v.yearly.toFixed(2)," billed annually"]}),t.jsx($e,{variant:v.popular?"primary":"outline",size:"md",style:{width:"100%"},onClick:()=>{if(m)g({planKey:O2(v.domains,c),domains:v.domains,billing:c,price:c==="monthly"?v.monthly:v.yearly});else{const w=window.cnReactData&&window.cnReactData.uiMode==="react";window.location.href=w?"?page=cookie-notice&cn_react_welcome=1":"?page=cookie-notice&welcome=1"}},children:m?"Select Plan":"Get Started"})]},v.domains))}),t.jsx("p",{className:"cn-pricing-footer__learn-more",children:t.jsx("a",{href:"https://cookie-compliance.co/pricing/",target:"_blank",rel:"noopener noreferrer",className:"cn-link",children:"Learn more about Pro plans →"})}),t.jsx("p",{className:"cn-pricing-footer__dismiss",children:t.jsx("button",{type:"button",className:"cn-link-btn",onClick:f,children:"Maybe later — stay on Free"})})]})})}function $2(){const o=!!(window.cnReactData||{}).devMode,{tier:i}=Be(),c=new URLSearchParams(window.location.search),p=c.get("cn_tier")||i,d=parseInt(c.get("cn_usage")||"0",10),g=(window.cnReactData||{}).uiMode||"legacy",[m,f]=j.useState(d),[v,w]=j.useState(!1);if(!o)return null;function x(){window.confirm(`⚠️ Reset plugin to fresh-activation state? This clears: welcome flag, setup wizard flag, app_id, app_key, and subscription status.`)&&(w(!0),Vu().then(()=>{const P=new URL(window.location.href);P.searchParams.delete("cn_tier"),P.searchParams.delete("cn_usage"),window.location.href=P.toString()}).catch(P=>{alert("Reset failed: "+(P.message||"Unknown error")),w(!1)}))}function S(P,N=null){const D=new URLSearchParams(window.location.search);D.set("cn_tier",P),P==="free"&&N!==null?D.set("cn_usage",N):D.delete("cn_usage"),window.location.search=D.toString()}function L(P){const N=new URLSearchParams(window.location.search);N.set("ui_mode",P),P==="legacy"&&(N.delete("cn_tier"),N.delete("cn_usage")),window.location.search=N.toString()}const z=[{id:"basic",label:"Basic"},{id:"free",label:"Free"},{id:"pro",label:"Pro"}],C=[{id:"react",label:"React"},{id:"legacy",label:"Legacy"}];return t.jsxs("div",{className:"cn-dev-switcher",children:[t.jsxs("div",{className:"cn-dev-switcher__header",children:[t.jsx("span",{className:"cn-dev-switcher__icon",children:"🛠"}),t.jsx("span",{className:"cn-dev-switcher__title",children:"DEV MODE"})]}),t.jsx("div",{className:"cn-dev-switcher__label",children:"Account type"}),t.jsx("div",{className:"cn-dev-switcher__buttons",children:z.map(P=>t.jsx("button",{className:"cn-dev-switcher__btn"+(p===P.id?" cn-dev-switcher__btn--active":""),onClick:()=>S(P.id,P.id==="free"?m:null),children:P.label},P.id))}),t.jsx("div",{className:"cn-dev-switcher__label",children:"Admin UI"}),t.jsx("div",{className:"cn-dev-switcher__buttons",children:C.map(P=>t.jsx("button",{className:"cn-dev-switcher__btn"+(g===P.id?" cn-dev-switcher__btn--active":""),onClick:()=>L(P.id),children:P.label},P.id))}),p==="free"&&t.jsxs("div",{className:"cn-dev-switcher__usage",children:[t.jsxs("div",{className:"cn-dev-switcher__usage-row",children:[t.jsx("span",{className:"cn-dev-switcher__usage-label",children:"Usage"}),t.jsxs("span",{className:"cn-dev-switcher__usage-val",children:[m,"%"]})]}),t.jsx("input",{type:"range",min:"0",max:"100",value:m,className:"cn-dev-switcher__slider",onChange:P=>f(Number(P.target.value)),onMouseUp:P=>{P.stopPropagation(),S("free",m)},onTouchEnd:P=>{P.stopPropagation(),S("free",m)}})]}),t.jsx("div",{className:"cn-dev-switcher__divider"}),t.jsx("button",{className:"cn-dev-switcher__reset-btn",onClick:x,disabled:v,title:"Clears welcome flag, setup wizard, app connection & subscription status",children:v?"↺ Resetting…":"↺ Reset Plugin"})]})}class Ai extends j.Component{constructor(i){super(i),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(i,c){console.error("ErrorBoundary caught:",i,c)}render(){return this.state.hasError?t.jsxs("div",{className:"cn-error-boundary",children:[t.jsx("p",{className:"cn-error-boundary__message",children:"Something went wrong while loading this section."}),t.jsx("button",{type:"button",className:"button button-primary",onClick:()=>window.location.reload(),children:"Reload page"})]}):this.props.children}}function W2({onOpenPricingModal:o}){const{topBar:i,dismiss:c}=ri();if(i===null)return null;const d={critical:"crit",warning:"warning",info:"info"}[i.type]||"info";let g=null;return i.icon==="error"?g=t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"24",height:"24",children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}):i.icon==="warning"?g=t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"24",height:"24",children:[t.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),t.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),t.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}):i.icon==="info"&&(g=t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"24",height:"24",children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})),t.jsxs("div",{className:`cn-alert cn-alert--${d}`,style:{marginBottom:24},children:[t.jsx("div",{className:"cn-alert__icon",children:g}),t.jsxs("div",{className:"cn-alert__content",children:[t.jsx("h3",{className:"cn-alert__title",children:i.title}),t.jsx("p",{className:"cn-alert__desc",children:i.description})]}),t.jsx("div",{className:"cn-alert__actions",children:t.jsx("button",{type:"button",className:"cn-button cn-button--upgrade",onClick:o,children:i.cta.label})}),i.dismissible&&t.jsx("button",{type:"button",className:"cn-alert__dismiss",onClick:()=>c(i.id),"aria-label":"Dismiss",children:t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"18",height:"18",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}const Vs=[{id:"protection",label:"Protection"},{id:"settings",label:"Settings"},{id:"audit-trail",label:"Audit Trail"}];function G2({dashboard:o,refetchDashboard:i,refetchConfig:c,notices:p,removeNotice:d,addNotice:g,activeTab:m,setActiveTab:f,appliedTemplateKey:v,handleTemplateApplied:w,showWelcomeModal:x,setShowWelcomeModal:S,showPricingModal:L,setShowPricingModal:z}){const{closeAllPanels:C}=mr(),P=j.useCallback(I=>{C(),f(I);const A=new URLSearchParams(window.location.search);A.delete("tab");const W=window.location.pathname+(A.toString()?"?"+A.toString():"")+"#"+I;window.history.replaceState({},"",W)},[C,f]),N=()=>{switch(m){case"protection":return t.jsx(Dd,{addNotice:g,onOpenWelcomeModal:()=>S(!0),onOpenPricingModal:()=>z(!0),onTabChange:P,appliedTemplateKey:v,onTemplateApplied:w});case"settings":return t.jsx(f2,{addNotice:g,onOpenWelcomeModal:()=>S(!0),onTabChange:P,appliedTemplateKey:v,onTemplateApplied:w,onOpenPricingModal:()=>z(!0)});case"audit-trail":return t.jsx(N2,{addNotice:g,onOpenWelcomeModal:()=>S(!0),onOpenPricingModal:()=>z(!0)});default:return null}},D=j.useCallback(()=>{S(!1),P("settings"),Uu().catch(()=>{})},[P,S]);return t.jsxs("div",{className:"cn-admin-app",children:[t.jsx($2,{}),p.map(I=>t.jsx(Tu,{type:I.type,dismissible:!0,onDismiss:()=>d(I.id),children:I.message},I.id)),t.jsx(Du,{tabs:Vs,activeTab:m,onTabChange:P}),t.jsxs("div",{className:"cn-tab-content",children:[t.jsx(W2,{onOpenPricingModal:()=>z(!0)}),t.jsx(Ai,{children:N()},m)]}),t.jsx(zu,{}),t.jsx(I2,{isOpen:x,onClose:()=>S(!1),onDismissToSettings:D}),t.jsx(U2,{isOpen:L,onClose:()=>z(!1)})]})}function H2(){var T,J,me;const{data:o,refetch:i}=Td(),{data:c,loading:p,refetch:d}=Rd(),[g,m]=j.useState([]),[f,v]=j.useState(null),w=Zu(((T=o==null?void 0:o.appConfig)==null?void 0:T.design)||((J=window.cnReactData)==null?void 0:J.bannerDesign)||null),x=f||w||"",S=j.useCallback(te=>{v(te)},[]),[L,z]=j.useState(()=>{var ge;const te=new URLSearchParams(window.location.search).get("tab");if(te==="consent-logs")return"audit-trail";if(Vs.find(_e=>_e.id===te))return te;const ee=window.location.hash.replace("#","");return Vs.find(_e=>_e.id===ee)?ee:!((ge=window.cnReactData)!=null&&ge.app_id)?"settings":"protection"}),{isBasic:C}=Be(),P=j.useRef(Date.now()),N=j.useRef(null);j.useEffect(()=>{const te=()=>{document.visibilityState==="visible"&&(Date.now()-P.current<1e4||(clearTimeout(N.current),N.current=setTimeout(()=>{i()},2e3)))};return document.addEventListener("visibilitychange",te),()=>{document.removeEventListener("visibilitychange",te),clearTimeout(N.current)}},[i]);const D=j.useRef(null);j.useEffect(()=>{var ie;const te=(ie=o==null?void 0:o.appConfig)==null?void 0:ie.design,ee=JSON.stringify(te||null);if(D.current===null){D.current=ee;return}ee!==D.current&&(D.current=ee,v(null))},[(me=o==null?void 0:o.appConfig)==null?void 0:me.design]);const[I,A]=j.useState(()=>{const te=new URLSearchParams(window.location.search),ee=te.get("cn_react_welcome")==="1";if(ee){te.delete("cn_react_welcome");const ie=window.location.pathname+(te.toString()?"?"+te.toString():"")+window.location.hash;window.history.replaceState({},"",ie)}return ee}),[W,$]=j.useState(!1);j.useEffect(()=>{var ie;if(!C)return;const te=(ie=window.cnReactData)==null?void 0:ie.welcomeDismissedAt;if(!te){A(!0);return}const ee=Date.now()-720*60*60*1e3;new Date(te).getTime(){const ie=Date.now();m(ge=>[...ge,{id:ie,message:te,type:ee}]),setTimeout(()=>m(ge=>ge.filter(_e=>_e.id!==ie)),5e3)},[]),K=j.useCallback(te=>{m(ee=>ee.filter(ie=>ie.id!==te))},[]),Q=j.useCallback(()=>{i()},[i]),Z=j.useCallback(()=>{i(),d()},[i,d]);return t.jsx(Ho.Provider,{value:{dashboard:o,refetchDashboard:i,isLoadingDashboard:!o},children:t.jsx(Vo.Provider,{value:{config:c,isLoadingConfig:p,refetchConfig:d},children:t.jsx(Mu,{onLawSave:Q,onConsentClose:Z,children:t.jsx(G2,{dashboard:o,refetchDashboard:i,refetchConfig:d,notices:g,removeNotice:K,addNotice:O,activeTab:L,setActiveTab:z,appliedTemplateKey:x,handleTemplateApplied:S,showWelcomeModal:I,setShowWelcomeModal:A,showPricingModal:W,setShowPricingModal:$})})})})}const Ks=document.getElementById("cn-react-root"),Mi=typeof window.cnReactData=="object"&&window.cnReactData!==null&&typeof window.cnReactData.ajaxURL=="string"&&typeof window.cnReactData.nonce=="string";Ks&&Mi?Eu.createRoot(Ks).render(t.jsx(Ai,{children:t.jsx(H2,{})})):Ks&&!Mi&&console.error("[Compliance] cnReactData missing or malformed — admin UI will not mount.",{cnReactData:window.cnReactData})})();