@keepist/react-gdpr-cookie-banner
Version:
GDPR compliant cookie banner for react
28 lines • 29.3 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReactCookieLaw=t():e.ReactCookieLaw=t()}(global,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}([function(e,t,n){"use strict";e.exports=n(4)},function(e,t,n){e.exports=n(5)()},function(e,t,n){"use strict";
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},r=t||{},c=e.split(i),s=r.decode||o,l=0;l<c.length;l++){var u=c[l],f=u.indexOf("=");if(!(f<0)){var p=u.substr(0,f).trim(),y=u.substr(++f,u.length).trim();'"'==y[0]&&(y=y.slice(1,-1)),void 0==n[p]&&(n[p]=a(y,s))}}return n},t.serialize=function(e,t,n){var o=n||{},i=o.encode||r;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!c.test(e))throw new TypeError("argument name is invalid");var a=i(t);if(a&&!c.test(a))throw new TypeError("argument val is invalid");var s=e+"="+a;if(null!=o.maxAge){var l=o.maxAge-0;if(isNaN(l))throw new Error("maxAge should be a Number");s+="; Max-Age="+Math.floor(l)}if(o.domain){if(!c.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain="+o.domain}if(o.path){if(!c.test(o.path))throw new TypeError("option path is invalid");s+="; Path="+o.path}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw new TypeError("option expires is invalid");s+="; Expires="+o.expires.toUTCString()}o.httpOnly&&(s+="; HttpOnly");o.secure&&(s+="; Secure");if(o.sameSite){var u="string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite;switch(u){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;default:throw new TypeError("option sameSite is invalid")}}return s};var o=decodeURIComponent,r=encodeURIComponent,i=/; */,c=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function a(e,t){try{return t(e)}catch(t){return e}}},function(e,t,n){"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,c,a=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var l in n=Object(arguments[s]))r.call(n,l)&&(a[l]=n[l]);if(o){c=o(n);for(var u=0;u<c.length;u++)i.call(n,c[u])&&(a[c[u]]=n[c[u]])}}return a}},function(e,t,n){"use strict";
/** @license React v16.6.0
* 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 o=n(3),r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,c=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,f=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.concurrent_mode"):60111,y=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,v="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=0;o<t;o++)n+="&args[]="+encodeURIComponent(arguments[o+1]);!function(e,t,n,o,r,i,c,a){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,o,r,i,c,a],l=0;(e=Error(t.replace(/%s/g,function(){return s[l++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k={};function O(e,t,n){this.props=e,this.context=t,this.refs=k,this.updater=n||b}function w(){}function S(e,t,n){this.props=e,this.context=t,this.refs=k,this.updater=n||b}O.prototype.isReactComponent={},O.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&g("85"),this.updater.enqueueSetState(this,e,t,"setState")},O.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=O.prototype;var x=S.prototype=new w;x.constructor=S,o(x,O.prototype),x.isPureReactComponent=!0;var _={current:null,currentDispatcher:null},C=Object.prototype.hasOwnProperty,P={key:!0,ref:!0,__self:!0,__source:!0};function T(e,t,n){var o=void 0,r={},c=null,a=null;if(null!=t)for(o in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(c=""+t.key),t)C.call(t,o)&&!P.hasOwnProperty(o)&&(r[o]=t[o]);var s=arguments.length-2;if(1===s)r.children=n;else if(1<s){for(var l=Array(s),u=0;u<s;u++)l[u]=arguments[u+2];r.children=l}if(e&&e.defaultProps)for(o in s=e.defaultProps)void 0===r[o]&&(r[o]=s[o]);return{$$typeof:i,type:e,key:c,ref:a,props:r,_owner:_.current}}function j(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var E=/\/+/g,A=[];function $(e,t,n,o){if(A.length){var r=A.pop();return r.result=e,r.keyPrefix=t,r.func=n,r.context=o,r.count=0,r}return{result:e,keyPrefix:t,func:n,context:o,count:0}}function L(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>A.length&&A.push(e)}function M(e,t,n){return null==e?0:function e(t,n,o,r){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var s=!1;if(null===t)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case i:case c:s=!0}}if(s)return o(r,t,""===n?"."+I(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;l<t.length;l++){var u=n+I(a=t[l],l);s+=e(a,u,o,r)}else if(u=null===t||"object"!=typeof t?null:"function"==typeof(u=v&&t[v]||t["@@iterator"])?u:null,"function"==typeof u)for(t=u.call(t),l=0;!(a=t.next()).done;)s+=e(a=a.value,u=n+I(a,l++),o,r);else"object"===a&&g("31","[object Object]"==(o=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":o,"");return s}(e,"",t,n)}function I(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function N(e,t){e.func.call(e.context,t,e.count++)}function R(e,t,n){var o=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?D(e,o,n,function(e){return e}):null!=e&&(j(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(E,"$&/")+"/")+n)),o.push(e))}function D(e,t,n,o,r){var i="";null!=n&&(i=(""+n).replace(E,"$&/")+"/"),M(e,R,t=$(t,i,o,r)),L(t)}var F={Children:{map:function(e,t,n){if(null==e)return e;var o=[];return D(e,o,null,t,n),o},forEach:function(e,t,n){if(null==e)return e;M(e,N,t=$(null,null,t,n)),L(t)},count:function(e){return M(e,function(){return null},null)},toArray:function(e){var t=[];return D(e,t,null,function(e){return e}),t},only:function(e){return j(e)||g("143"),e}},createRef:function(){return{current:null}},Component:O,PureComponent:S,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,Provider:null,Consumer:null}).Provider={$$typeof:u,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:y,render:e}},lazy:function(e){return{$$typeof:m,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:h,type:e,compare:void 0===t?null:t}},Fragment:a,StrictMode:s,unstable_ConcurrentMode:p,Suspense:d,unstable_Profiler:l,createElement:T,cloneElement:function(e,t,n){(null===e||void 0===e)&&g("267",e);var r=void 0,c=o({},e.props),a=e.key,s=e.ref,l=e._owner;if(null!=t){void 0!==t.ref&&(s=t.ref,l=_.current),void 0!==t.key&&(a=""+t.key);var u=void 0;for(r in e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)C.call(t,r)&&!P.hasOwnProperty(r)&&(c[r]=void 0===t[r]&&void 0!==u?u[r]:t[r])}if(1===(r=arguments.length-2))c.children=n;else if(1<r){u=Array(r);for(var f=0;f<r;f++)u[f]=arguments[f+2];c.children=u}return{$$typeof:i,type:e.type,key:a,ref:s,props:c,_owner:l}},createFactory:function(e){var t=T.bind(null,e);return t.type=e,t},isValidElement:j,version:"16.6.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:_,assign:o}},U={default:F},B=U&&F||U;e.exports=B.default||B},function(e,t,n){"use strict";var o=n(6);function r(){}e.exports=function(){function e(e,t,n,r,i,c){if(c!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var o=n(8),r=(n(0),{childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0}),i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},c={};c[o.ForwardRef]={$$typeof:!0,render:!0};var a=Object.defineProperty,s=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,o){if("string"!=typeof n){if(p){var y=f(n);y&&y!==p&&e(t,y,o)}var d=s(n);l&&(d=d.concat(l(n)));for(var h=c[t.$$typeof]||r,m=c[n.$$typeof]||r,v=0;v<d.length;++v){var g=d[v];if(!(i[g]||o&&o[g]||m&&m[g]||h&&h[g])){var b=u(n,g);try{a(t,g,b)}catch(e){}}}return t}return t}},function(e,t,n){"use strict";e.exports=n(9)},function(e,t,n){"use strict";
/** @license React v16.5.0
* react-is.production.min.js
*
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&Symbol.for,r=o?Symbol.for("react.element"):60103,i=o?Symbol.for("react.portal"):60106,c=o?Symbol.for("react.fragment"):60107,a=o?Symbol.for("react.strict_mode"):60108,s=o?Symbol.for("react.profiler"):60114,l=o?Symbol.for("react.provider"):60109,u=o?Symbol.for("react.context"):60110,f=o?Symbol.for("react.async_mode"):60111,p=o?Symbol.for("react.forward_ref"):60112,y=o?Symbol.for("react.placeholder"):60113;function d(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case f:case c:case s:case a:return e;default:switch(e=e&&e.$$typeof){case u:case p:case l:return e;default:return t}}case i:return t}}}t.typeOf=d,t.AsyncMode=f,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=p,t.Fragment=c,t.Profiler=s,t.Portal=i,t.StrictMode=a,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===c||e===f||e===s||e===a||e===y||"object"==typeof e&&null!==e&&("function"==typeof e.then||e.$$typeof===l||e.$$typeof===u||e.$$typeof===p)},t.isAsyncMode=function(e){return d(e)===f},t.isContextConsumer=function(e){return d(e)===u},t.isContextProvider=function(e){return d(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return d(e)===p},t.isFragment=function(e){return d(e)===c},t.isProfiler=function(e){return d(e)===s},t.isPortal=function(e){return d(e)===i},t.isStrictMode=function(e){return d(e)===a}},function(e,t,n){"use strict";n.r(t);var o=n(0),r=n.n(o),i=n(1),c=n.n(i),a=n(2);function s(e,t){if(void 0===t&&(t={}),function(e,t){return void 0===t&&(t=!e||"{"!==e[0]&&"["!==e[0]&&'"'!==e[0]),!t}(e,t.doNotParse))try{return JSON.parse(e)}catch(e){}return e}var l,u=n(3),f=function(){function e(e){this.changeListeners=[],this.cookies=function(e){return"string"==typeof e?a.parse(e):"object"==typeof e&&null!==e?e:{}}(e),this.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie}return e.prototype._updateBrowserValues=function(){this.HAS_DOCUMENT_COOKIE&&(this.cookies=a.parse(document.cookie))},e.prototype._emitChange=function(e){for(var t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)},e.prototype.get=function(e,t){return void 0===t&&(t={}),this._updateBrowserValues(),s(this.cookies[e],t)},e.prototype.getAll=function(e){void 0===e&&(e={}),this._updateBrowserValues();var t={};for(var n in this.cookies)t[n]=s(this.cookies[n],e);return t},e.prototype.set=function(e,t,n){var o;"object"==typeof t&&(t=JSON.stringify(t)),this.cookies=u({},this.cookies,((o={})[e]=t,o)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=a.serialize(e,t,n)),this._emitChange({name:e,value:t,options:n})},e.prototype.remove=function(e,t){var n=t=u({},t,{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=u({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=a.serialize(e,"",n)),this._emitChange({name:e,value:void 0,options:t})},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){var t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)},e}(),p=f,y=(l=o.createContext(new f)).Provider,d=(l.Consumer,function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}());(function(e){function t(t){var n=e.call(this,t)||this;return t.cookies?n.cookies=t.cookies:n.cookies=new f,n}d(t,e),t.prototype.render=function(){return o.createElement(y,{value:this.cookies},this.props.children)}})(o.Component),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)}}(),n(7);var h=function(){return"undefined"==typeof navigator};function m(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var v=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cookies=new p}return function(e,t,n){t&&m(e.prototype,t),n&&m(e,n)}(e,[{key:"get",value:function(e){return this.cookies.get(e)}},{key:"set",value:function(e,t){this.cookies.set(e,!0,{expires:t||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:365,n=e?new Date(e):new Date;return n.setTime(n.getTime()+24*t*60*60*1e3),n}()})}},{key:"remove",value:function(e){return this.cookies.remove(e)}}]),e}();function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function k(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var x=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?S(e):t}(this,O(t).call(this,e));var o=e.checked,r=void 0!==o&&o;return n.state={checked:r},n.handleOnChange=n.handleOnChange.bind(S(S(n))),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(t,r.a.Component),function(e,t,n){t&&k(e.prototype,t),n&&k(e,n)}(t,[{key:"handleOnChange",value:function(){var e=this.props.onChange,t=void 0===e?Function:e,n=!this.state.checked;this.setState({checked:n}),t(n)}},{key:"render",value:function(){var e=this.props,t=e.id,n=void 0===t?"":t,o=e.text,i=void 0===o?"":o,c=e.styles,a=void 0===c?{}:c,s=e.disabled,l=void 0!==s&&s,u=l?{disabled:l}:{},f=this.state.checked,p=a.optionWrapperStyle,y=a.optionLabelStyle,d=a.checkboxStyle;return r.a.createElement("div",{className:"react-cookie-law-option-wrapper",style:p},r.a.createElement("label",{style:y},r.a.createElement("input",b({type:"checkbox",id:n,className:"react-cookie-law-option-checkbox",style:d,checked:f,onChange:this.handleOnChange},u)),i))}}]),t}(),_={dialog:{position:"fixed",top:"0",left:"0",right:"0",zIndex:"100000",backgroundColor:"#f8f7f7",padding:"10px"},container:{maxWidth:"960px",marginLeft:"auto",marginRight:"auto",overflow:"hidden"},message:{minHeight:"32px",fontSize:"10pt",fontWeight:"400",lineHeight:"130%",padding:"10px 0",color:"#000000"},policy:{fontSize:"10pt",marginLeft:"10px",color:"#000000",textDecoration:"underline"},selectPane:{display:"table-cell",padding:"3px 0px 10px 0px"},optionWrapper:{display:"inline-block",position:"relative",marginRight:"7px",marginLeft:"7px",float:"left"},optionLabel:{height:"auto",width:"auto",minHeight:"14px",fontSize:"12pt",color:"#c6c6c6",display:"inline-block",padding:"1px 0 0 20px",position:"relative",top:"0",left:"0",zIndex:"1",cursor:"default",verticalAlign:"top"},checkbox:{position:"absolute",top:"4px",left:"0",width:"14px",height:"14px",zIndex:"2",cursor:"pointer"},buttonWrapper:{float:"right"},button:{display:"inline-block",backgroundColor:"#000000",padding:"3px",minWidth:"80px",color:"#ffffff",textDecoration:"none",fontSize:"10pt",fontWeight:"400",marginRight:"5px",marginLeft:"5px",textAlign:"center",whiteSpace:"nowrap",cursor:"pointer"}};function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.styles,n=void 0===t?{}:t,o=e.className,i=void 0===o?"":o,c=e.message,a=void 0===c?"No text":c,s=e.policyLink,l=void 0===s?"/#":s,u=e.privacyPolicyLinkText,f=void 0===u?"Privacy Policy":u,p=e.necessaryOptionText,y=void 0===p?"Necessary":p,d=e.preferencesOptionText,h=void 0===d?"Preferences":d,m=e.statisticsOptionText,v=void 0===m?"Statistics":m,g=e.marketingOptionText,b=void 0===g?"Marketing":g,k=e.showAcceptSelectionButton,O=void 0!==k&&k,w=e.acceptAllButtonText,S=void 0===w?"Accept All":w,P=e.acceptSelectionButtonText,T=void 0===P?"Accept Selection":P,j=e.showPreferencesOption,E=void 0===j||j,A=e.showStatisticsOption,$=void 0===A||A,L=e.showMarketingOption,M=void 0===L||L,I=e.preferencesOptionInitiallyChecked,N=void 0!==I&&I,R=e.statisticsOptionInitiallyChecked,D=void 0!==R&&R,F=e.marketingOptionInitiallyChecked,U=void 0!==F&&F,B=e.onTogglePreferencesCookies,W=void 0===B?Function:B,z=e.onToggleStatisticsCookies,q=void 0===z?Function:z,H=e.onToggleMarketingCookies,V=void 0===H?Function:H,K=e.onConfirmSelection,J=void 0===K?Function:K,Y=e.onConfirmAll,G=void 0===Y?Function:Y,Q=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){C(e,t,n[t])})}return e}({},_,n),X=Q.dialog,Z=Q.container,ee=Q.message,te=Q.policy,ne=Q.selectPane,oe=Q.optionWrapper,re=Q.optionLabel,ie=Q.checkbox,ce=Q.buttonWrapper,ae=Q.button,se={optionWrapperStyle:oe,optionLabelStyle:re,checkboxStyle:ie};return r.a.createElement("div",{className:"react-cookie-law-dialog ".concat(i),style:X},r.a.createElement("div",{className:"react-cookie-law-container",style:Z},r.a.createElement("div",{className:"react-cookie-law-msg",style:ee},a),r.a.createElement("div",{className:"react-cookie-law-select-pane",style:ne},r.a.createElement(x,{id:"check-required-cookies",text:y,styles:se,disabled:!0,checked:!0}),E&&r.a.createElement(x,{id:"check-preferences-cookies",text:h,styles:se,onChange:W,checked:N}),$&&r.a.createElement(x,{id:"check-statistics-cookies",text:v,styles:se,onChange:q,checked:D}),M&&r.a.createElement(x,{id:"check-marketing-cookies",text:b,styles:se,onChange:V,checked:U})),r.a.createElement("a",{href:l,className:"react-cookie-law-policy",style:te},f),r.a.createElement("div",{className:"react-cookie-law-button-wrapper",style:ce},O&&r.a.createElement("button",{type:"button",className:"react-cookie-law-accept-selection-btn",style:ae,onClick:function(){return J()}},r.a.createElement("span",null,T)),r.a.createElement("button",{type:"button",className:"react-cookie-law-accept-all-btn",style:ae,onClick:function(){return G()}},r.a.createElement("span",null,S)))))};function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var L=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?$(e):t}(this,E(t).call(this,e))).state={preferencesCookies:n.props.preferencesOptionInitiallyChecked||!1,statisticsCookies:n.props.statisticsOptionInitiallyChecked||!1,marketingCookies:n.props.marketingOptionInitiallyChecked||!1},n.onScroll=n.onScroll.bind($($(n))),n.onTogglePreferencesCookies=n.onTogglePreferencesCookies.bind($($(n))),n.onToggleStatisticsCookies=n.onToggleStatisticsCookies.bind($($(n))),n.onToggleMarketingCookies=n.onToggleMarketingCookies.bind($($(n))),n.confirmAll=n.confirmAll.bind($($(n))),n.confirmSelection=n.confirmSelection.bind($($(n))),n.consetsCallback=n.consetsCallback.bind($($(n))),n.cookies=new v,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(t,r.a.Component),function(e,t,n){t&&j(e.prototype,t),n&&j(e,n)}(t,[{key:"componentDidMount",value:function(){var e=this.props.dismissOnScroll;h()||!0!==e||(window.addEventListener?window.addEventListener("scroll",this.onScroll):window.attachEvent&&window.attachEvent("onscroll",this.onScroll))}},{key:"componentWillUnmount",value:function(){h()||(window.removeEventListener?window.removeEventListener("scroll",this.onScroll):window.detachEvent&&window.detachEvent("onscroll",this.onScroll))}},{key:"onScroll",value:function(){this.confirmAll()}},{key:"onTogglePreferencesCookies",value:function(){var e=this.state.preferencesCookies;this.setState({preferencesCookies:!e})}},{key:"onToggleStatisticsCookies",value:function(){var e=this.state.statisticsCookies;this.setState({statisticsCookies:!e})}},{key:"onToggleMarketingCookies",value:function(){var e=this.state.marketingCookies;this.setState({marketingCookies:!e})}},{key:"confirmAll",value:function(){this.cookies.set("rcl_consent_given"),this.cookies.set("rcl_preferences_consent"),this.cookies.set("rcl_statistics_consent"),this.cookies.set("rcl_marketing_consent"),this.forceUpdate()}},{key:"confirmSelection",value:function(){var e=this.state,t=e.preferencesCookies,n=e.statisticsCookies,o=e.marketingCookies;this.cookies.set("rcl_consent_given"),t?this.cookies.set("rcl_preferences_consent"):this.cookies.remove("rcl_preferences_consent"),n?this.cookies.set("rcl_statistics_consent"):this.cookies.remove("rcl_statistics_consent"),o?this.cookies.set("rcl_marketing_consent"):this.cookies.remove("rcl_marketing_consent"),this.forceUpdate()}},{key:"consetsCallback",value:function(){var e=this.props,t=e.onAccept,n=void 0===t?Function:t,o=e.onAcceptPreferences,r=void 0===o?Function:o,i=e.onAcceptStatistics,c=void 0===i?Function:i,a=e.onAcceptMarketing,s=void 0===a?Function:a,l=e.onDeclinePreferences,u=void 0===l?Function:l,f=e.onDeclineStatistics,p=void 0===f?Function:f,y=e.onDeclineMarketing,d=void 0===y?Function:y,h=this.cookies.get("rcl_preferences_consent"),m=this.cookies.get("rcl_statistics_consent"),v=this.cookies.get("rcl_marketing_consent");n(),h?r():u(),m?c():p(),v?s():d()}},{key:"render",value:function(){var e=this.props,t=e.styles,n=e.className,o=e.message,i=e.policyLink,c=e.privacyPolicyLinkText,a=e.necessaryOptionText,s=e.preferencesOptionText,l=e.statisticsOptionText,u=e.marketingOptionText,f=e.showAcceptSelectionButton,p=e.acceptAllButtonText,y=e.acceptSelectionButtonText,d=e.showPreferencesOption,h=e.showStatisticsOption,m=e.showMarketingOption;if(this.cookies.get("rcl_consent_given"))return this.consetsCallback(),null;var v={styles:t,className:n,message:o,policyLink:i,privacyPolicyLinkText:c,necessaryOptionText:a,preferencesOptionText:s,statisticsOptionText:l,marketingOptionText:u,showAcceptSelectionButton:f,acceptAllButtonText:p,acceptSelectionButtonText:y,showPreferencesOption:d,showStatisticsOption:h,showMarketingOption:m,preferencesOptionInitiallyChecked:this.props.preferencesOptionInitiallyChecked,statisticsOptionInitiallyChecked:this.props.statisticsOptionInitiallyChecked,marketingOptionInitiallyChecked:this.props.marketingOptionInitiallyChecked,onTogglePreferencesCookies:this.onTogglePreferencesCookies,onToggleStatisticsCookies:this.onToggleStatisticsCookies,onToggleMarketingCookies:this.onToggleMarketingCookies,onConfirmSelection:this.confirmSelection,onConfirmAll:this.confirmAll};return r.a.createElement(P,v)}}]),t}();L.protoTypes={className:c.a.string,styles:c.a.object,message:c.a.string.isRequired,policyLink:c.a.string,privacyPolicyLinkText:c.a.string,necessaryOptionText:c.a.string,preferencesOptionText:c.a.string,statisticsOptionText:c.a.string,marketingOptionText:c.a.string,acceptAllButtonText:c.a.string,acceptSelectionButtonText:c.a.string,showAcceptSelectionButton:c.a.bool,dismissOnScroll:c.a.bool,showPreferencesOption:c.a.bool,showStatisticsOption:c.a.bool,showMarketingOption:c.a.bool,preferencesOptionInitiallyChecked:c.a.bool,statisticsOptionInitiallyChecked:c.a.bool,marketingOptionInitiallyChecked:c.a.bool,onAccept:c.a.func,onAcceptPreferences:c.a.func,onAcceptStatistics:c.a.func,onAcceptMarketing:c.a.func,onDeclinePreferences:c.a.func,onDeclineStatistics:c.a.func,onDeclineMarketing:c.a.func};var M=L;n.d(t,"CookieBanner",function(){return I});var I=function(e){return h()?null:r.a.createElement(M,e)}}])});