react-cookify
Version:
Simple, customizable open source cookie consent banner for GDPR law
17 lines (14 loc) • 45.7 kB
JavaScript
import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import{useState as t,useEffect as a,createContext as c,useContext as n}from"react";import i from"js-cookie";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function d(e,r){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(t=Object.getOwnPropertySymbols(e);a<t.length;a++)r.indexOf(t[a])<0&&Object.prototype.propertyIsEnumerable.call(e,t[a])&&(o[t[a]]=e[t[a]])}return o}const l=e=>{const r={name:(null==e?void 0:e.name)||"cookify-consent",store:(null==e?void 0:e.store)||"cookies",saveWithChange:(null==e?void 0:e.saveWithChange)||!1,saveByDefault:(null==e?void 0:e.saveByDefault)||!1,typeDefault:(null==e?void 0:e.typeDefault)||"necessary",consentObject:()=>({viewed:!1,data:Object.assign({[r.typeDefault]:!0},(null==e?void 0:e.types)||{}),uuid:"",created_at:new Date,updated_at:new Date,revision:(null==e?void 0:e.revision)||0}),jscookie:i.withAttributes((null==e?void 0:e.jscookie)||{expires:365,path:"/"})},o=e=>{g(e),p(!1),h()},[c,n]=t(r.consentObject()),[d,l]=t(!1),[s,b]=t(0),g=e=>{n(e)},p=e=>{l(e)},h=()=>{b(s+1)};return a((()=>{var e;const o=(()=>{if("storage"===r.store){let e;return"undefined"!=typeof window&&(e=localStorage.getItem(r.name)),"string"==typeof e&&JSON.parse(atob(e))}{const e=r.jscookie.get(r.name);return void 0!==e&&JSON.parse(atob(e))}})(),t=c;if(t.uuid=[1e7,-1e3,-4e3,-8e3,-1e11].join("").replace(/[018]/g,(e=>(parseInt(e,10)^self.crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e,10)/4).toString(16))),"object"==typeof o&&t.revision==(null==o?void 0:o.revision)){t.viewed=o.viewed;for(const r in t.data)t.data[r]=null!==(e=o.data[r])&&void 0!==e&&e;t.uuid=o.uuid,t.created_at=new Date(o.created_at),t.updated_at=new Date(o.updated_at)}g(t),p(!t.viewed),!0===r.saveByDefault&&(n(Object.assign(Object.assign({},c),{updated_at:new Date})),h())}),[]),a((()=>{0!==s&&(console.log("saving"),((e=c)=>{const o=btoa(JSON.stringify(e));"storage"===r.store?"undefined"!=typeof window&&localStorage.setItem(r.name,o):r.jscookie.set(r.name,o)})())}),[s]),{consentObject:c,consentDisplayed:d,handleConsentDisplayedChange:p,consentTracking:s,actionCheckbox:e=>{e!==r.typeDefault&&(!0===r.saveWithChange?(n(Object.assign(Object.assign({},c),{updated_at:new Date})),h()):n(Object.assign(Object.assign({},c),{data:Object.assign(Object.assign({},c.data),{[e]:!c.data[e]})})))},actionAccept:()=>{o(Object.assign(Object.assign({},c),{viewed:!0,updated_at:new Date}))},actionNecessary:()=>{const e={};for(const o in c.data)o===r.typeDefault?e[o]=!0:e[o]=!1;o(Object.assign(Object.assign({},c),{viewed:!0,data:Object.assign(Object.assign({},c.data),e),updated_at:new Date}))},actionAll:()=>{const e={};for(const r in c.data)e[r]=!0;o(Object.assign(Object.assign({},c),{viewed:!0,data:Object.assign(Object.assign({},c.data),e),updated_at:new Date}))}}},s=c({consentObject:{viewed:!1,data:{},uuid:"",created_at:new Date,updated_at:new Date,revision:0},consentDisplayed:!1,handleConsentDisplayedChange:()=>{},consentTracking:0,actionCheckbox:()=>{},actionAccept:()=>{},actionNecessary:()=>{},actionAll:()=>{}}),b=({options:r,children:o})=>{s.Consumer;const{consentObject:t,consentDisplayed:a,handleConsentDisplayedChange:c,consentTracking:n,actionCheckbox:i,actionAccept:d,actionNecessary:b,actionAll:g}=l(r),p={consentObject:t,consentDisplayed:a,handleConsentDisplayedChange:c,consentTracking:n,actionCheckbox:i,actionAccept:d,actionNecessary:b,actionAll:g};return e(s.Provider,Object.assign({value:p},{children:o}))},g=()=>n(s),p=r=>{var{name:o}=r,t=d(r,["name"]);const{consentObject:a,actionCheckbox:c}=g();return e("input",Object.assign({},t,{name:o,checked:a.data[o],onChange:e=>(e=>{c(e.currentTarget.name)})(e)}))};!function(e,r){void 0===r&&(r={});var o=r.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===o&&t.firstChild?t.insertBefore(a,t.firstChild):t.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}('/*! tailwindcss v3.2.7 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.\\!collapse{visibility:collapse!important}.collapse{visibility:collapse}.fixed{position:fixed}.relative{position:relative}.inset-0{bottom:0;left:0;right:0;top:0}.inset-x-3{left:.75rem;right:.75rem}.bottom-3{bottom:.75rem}.z-10{z-index:10}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mr-auto{margin-right:auto}.mt-1{margin-top:.25rem}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-6{height:1.5rem}.h-screen{height:100vh}.min-h-full{min-height:100%}.w-11{width:2.75rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.max-w-sm{max-width:24rem}.grow{flex-grow:1}.grow-0{flex-grow:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-\\[var\\(--c-border-radius\\)\\]{border-radius:var(--c-border-radius)}.rounded-\\[var\\(--c-btn-border-radius\\)\\]{border-radius:var(--c-btn-border-radius)}.rounded-\\[var\\(--c-c-bar-badge-border-radius\\)\\]{border-radius:var(--c-c-bar-badge-border-radius)}.rounded-\\[var\\(--c-c-bar-border-radius\\)\\]{border-radius:var(--c-c-bar-border-radius)}.rounded-\\[var\\(--c-open-border-radius\\)\\]{border-radius:var(--c-open-border-radius)}.rounded-\\[var\\(--c-ref-border-radius\\)\\]{border-radius:var(--c-ref-border-radius)}.rounded-full{border-radius:9999px}.rounded-b-\\[var\\(--c-c-extend-border-radius\\)\\]{border-bottom-left-radius:var(--c-c-extend-border-radius);border-bottom-right-radius:var(--c-c-extend-border-radius)}.border-2{border-width:2px}.border-x-2{border-left-width:2px;border-right-width:2px}.border-b-2{border-bottom-width:2px}.border-t-2{border-top-width:2px}.border-\\[var\\(--c-border-color\\)\\]{border-color:var(--c-border-color)}.border-\\[var\\(--c-c-extend-border-color\\)\\]{border-color:var(--c-c-extend-border-color)}.border-\\[var\\(--c-ref-border-color\\)\\]{border-color:var(--c-ref-border-color)}.bg-\\[var\\(--c-bg-overlay-color\\)\\]{background-color:var(--c-bg-overlay-color)}.bg-\\[var\\(--c-bg-primary-color\\)\\]{background-color:var(--c-bg-primary-color)}.bg-\\[var\\(--c-bg-secondary-color\\)\\]{background-color:var(--c-bg-secondary-color)}.bg-\\[var\\(--c-btn-strong-bg-color\\)\\]{background-color:var(--c-btn-strong-bg-color)}.bg-\\[var\\(--c-btn-week-bg-color\\)\\]{background-color:var(--c-btn-week-bg-color)}.bg-\\[var\\(--c-c-bar-badge-bg-color\\)\\]{background-color:var(--c-c-bar-badge-bg-color)}.bg-\\[var\\(--c-c-bar-bg-color\\)\\]{background-color:var(--c-c-bar-bg-color)}.bg-\\[var\\(--c-c-bar-toggle-off-color\\)\\]{background-color:var(--c-c-bar-toggle-off-color)}.bg-\\[var\\(--c-c-extend-bg-color\\)\\]{background-color:var(--c-c-extend-bg-color)}.bg-\\[var\\(--c-c-extend-table-bg-header-color\\)\\]{background-color:var(--c-c-extend-table-bg-header-color)}.bg-\\[var\\(--c-open-bg-color\\)\\]{background-color:var(--c-open-bg-color)}.fill-\\[var\\(--c-c-bar-text-color\\)\\]{fill:var(--c-c-bar-text-color)}.p-1{padding:.25rem}.p-3{padding:.75rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-\\[var\\(--c-c-extend-padding\\)\\]{padding-left:var(--c-c-extend-padding);padding-right:var(--c-c-extend-padding)}.py-0{padding-bottom:0;padding-top:0}.py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-4{line-height:1rem}.text-\\[var\\(--c-btn-strong-text-color\\)\\]{color:var(--c-btn-strong-text-color)}.text-\\[var\\(--c-btn-week-text-color\\)\\]{color:var(--c-btn-week-text-color)}.text-\\[var\\(--c-c-bar-badge-text-color\\)\\]{color:var(--c-c-bar-badge-text-color)}.text-\\[var\\(--c-c-bar-text-color\\)\\]{color:var(--c-c-bar-text-color)}.text-\\[var\\(--c-c-extend-text-color\\)\\]{color:var(--c-c-extend-text-color)}.text-\\[var\\(--c-open-text-color\\)\\]{color:var(--c-open-text-color)}.text-\\[var\\(--c-text-by-color\\)\\]{color:var(--c-text-by-color)}.text-\\[var\\(--c-text-color\\)\\]{color:var(--c-text-color)}.text-\\[var\\(--c-text-title-color\\)\\]{color:var(--c-text-title-color)}.underline{text-decoration-line:underline}.shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.shadow-2xl,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-500{transition-duration:.5s}#cookify .scrollbar{scrollbar-color:var(--c-sb-thumb-color) var(--c-sb-track-color)}#cookify .scrollbar::-webkit-scrollbar{width:var(--c-sb-width)}#cookify .scrollbar::-webkit-scrollbar-track{background:var(--c-sb-track-color)}#cookify .scrollbar::-webkit-scrollbar-thumb{background:var(--c-sb-thumb-color);background-clip:content-box;border:var(--c-sb-thumb-border-width) solid transparent;border-radius:var(--c-sb-thumb-border-radius)}#cookify .scrollbar::-webkit-scrollbar-thumb:hover{background:var(--c-sb-thumb-hover-color);background-clip:content-box}.cookify-theme-light{--c-text-color:#000;--c-text-title-color:#000;--c-text-by-color:silver;--c-border-color:#e5e7eb;--c-border-radius:0.5rem;--c-bg-primary-color:#fff;--c-bg-secondary-color:#f3f4f6;--c-bg-overlay-color:rgba(0,0,0,.3);--c-c-bar-bg-color:#d1d5db;--c-c-bar-bg-hover-color:#b6b9bf;--c-c-bar-text-color:#000;--c-c-bar-border-radius:0.5rem;--c-c-bar-badge-bg-color:#2463eb;--c-c-bar-badge-text-color:#fff;--c-c-bar-badge-border-radius:0.5rem;--c-c-bar-toggle-off-color:#374151;--c-c-bar-toggle-on-color:#2463eb;--c-c-bar-toggle-knob-color:#fff;--c-c-bar-toggle-ring-color:#1d40af;--c-c-extend-bg-color:#f2f3f5;--c-c-extend-text-color:#000;--c-c-extend-border-color:#e5e7eb;--c-c-extend-border-radius:0.5rem;--c-c-extend-padding:0.5rem;--c-c-extend-table-bg-header-color:#e1e4e8;--c-c-extend-table-bg-hover-color:#ecedf0;--c-ref-border-color:#e5e7eb;--c-ref-border-radius:0.5rem;--c-btn-strong-bg-color:#2463eb;--c-btn-strong-text-color:#fff;--c-btn-week-bg-color:#4b5563;--c-btn-week-text-color:#fff;--c-btn-border-radius:0.375rem;--c-sb-width:16px;--c-sb-track-color:transparent;--c-sb-thumb-color:rgba(0,0,0,.6);--c-sb-thumb-hover-color:rgba(0,0,0,.4);--c-sb-thumb-border-width:4px;--c-sb-thumb-border-radius:8px;--c-open-bg-color:#2563eb;--c-open-bg-hover-color:#3b82f6;--c-open-text-color:#000;--c-open-border-radius:9999px}.cookify-theme-dark{--c-text-color:#fff;--c-text-title-color:#fff;--c-text-by-color:#8a8a8a;--c-border-color:#222;--c-border-radius:0.5rem;--c-bg-primary-color:#141414;--c-bg-secondary-color:#000;--c-bg-overlay-color:rgba(0,0,0,.3);--c-c-bar-bg-color:#464646;--c-c-bar-bg-hover-color:#505050;--c-c-bar-text-color:#fff;--c-c-bar-border-radius:0.5rem;--c-c-bar-badge-bg-color:#2463eb;--c-c-bar-badge-text-color:#fff;--c-c-bar-badge-border-radius:0.5rem;--c-c-bar-toggle-off-color:#c6cbd4;--c-c-bar-toggle-on-color:#2463eb;--c-c-bar-toggle-knob-color:#000;--c-c-bar-toggle-ring-color:#1d40af;--c-c-extend-bg-color:#272727;--c-c-extend-text-color:#fff;--c-c-extend-border-color:#000;--c-c-extend-border-radius:0.5rem;--c-c-extend-padding:0.5rem;--c-c-extend-table-bg-header-color:#585858;--c-c-extend-table-bg-hover-color:#555;--c-ref-border-color:#fff;--c-ref-border-radius:0.5rem;--c-btn-strong-bg-color:#2463eb;--c-btn-strong-text-color:#fff;--c-btn-week-bg-color:#4b5563;--c-btn-week-text-color:#fff;--c-btn-border-radius:0.375rem;--c-sb-width:16px;--c-sb-track-color:transparent;--c-sb-thumb-color:#fff;--c-sb-thumb-hover-color:hsla(0,0%,100%,.8);--c-sb-thumb-border-width:4px;--c-sb-thumb-border-radius:8px;--c-open-bg-color:#2563eb;--c-open-bg-hover-color:#3b82f6;--c-open-text-color:#fff;--c-open-border-radius:9999px}.cookify-theme-high-contrast{--c-text-color:#fff;--c-text-title-color:#fff;--c-text-by-color:#ff0;--c-border-color:#fff;--c-border-radius:0rem;--c-bg-primary-color:#000;--c-bg-secondary-color:#000;--c-bg-overlay-color:rgba(0,0,0,.3);--c-c-bar-bg-color:#fff;--c-c-bar-bg-hover-color:#fff;--c-c-bar-text-color:#000;--c-c-bar-border-radius:0rem;--c-c-bar-badge-bg-color:#000;--c-c-bar-badge-text-color:#fff;--c-c-bar-badge-border-radius:0rem;--c-c-bar-toggle-off-color:#000;--c-c-bar-toggle-on-color:#3ef23e;--c-c-bar-toggle-knob-color:#fff;--c-c-bar-toggle-ring-color:#fff;--c-c-extend-bg-color:#000;--c-c-extend-text-color:#fff;--c-c-extend-border-color:#fff;--c-c-extend-border-radius:0rem;--c-c-extend-padding:0rem;--c-c-extend-table-bg-header-color:#000;--c-c-extend-table-bg-hover-color:#000;--c-ref-border-color:#fff;--c-ref-border-radius:0rem;--c-btn-strong-bg-color:#ff0;--c-btn-strong-text-color:#000;--c-btn-week-bg-color:#fff;--c-btn-week-text-color:#000;--c-btn-border-radius:0rem;--c-sb-width:16px;--c-sb-track-color:transparent;--c-sb-thumb-color:#fff;--c-sb-thumb-hover-color:#ff0;--c-sb-thumb-border-width:4px;--c-sb-thumb-border-radius:8px;--c-open-bg-color:#000;--c-open-bg-hover-color:#000;--c-open-text-color:#fff;--c-open-border-radius:none}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:left-\\[2px\\]:after{content:var(--tw-content);left:2px}.after\\:top-0:after{content:var(--tw-content);top:0}.after\\:top-0\\.5:after{content:var(--tw-content);top:.125rem}.after\\:h-5:after{content:var(--tw-content);height:1.25rem}.after\\:w-5:after{content:var(--tw-content);width:1.25rem}.after\\:rounded-full:after{border-radius:9999px;content:var(--tw-content)}.after\\:bg-\\[var\\(--c-c-bar-toggle-knob-color\\)\\]:after{background-color:var(--c-c-bar-toggle-knob-color);content:var(--tw-content)}.after\\:transition-all:after{content:var(--tw-content);transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.after\\:content-\\[\\\'\\\'\\]:after{--tw-content:"";content:var(--tw-content)}.hover\\:bg-\\[var\\(--c-btn-strong-bg-hover-color\\)\\]:hover{background-color:var(--c-btn-strong-bg-hover-color)}.hover\\:bg-\\[var\\(--c-btn-week-bg-hover-color\\)\\]:hover{background-color:var(--c-btn-week-bg-hover-color)}.hover\\:bg-\\[var\\(--c-c-bar-bg-hover-color\\)\\]:hover{background-color:var(--c-c-bar-bg-hover-color)}.hover\\:bg-\\[var\\(--c-c-extend-table-bg-hover-color\\)\\]:hover{background-color:var(--c-c-extend-table-bg-hover-color)}.hover\\:bg-\\[var\\(--c-open-bg-hover-color\\)\\]:hover{background-color:var(--c-open-bg-hover-color)}.peer:checked~.peer-checked\\:bg-\\[var\\(--c-c-bar-toggle-on-color\\)\\]{background-color:var(--c-c-bar-toggle-on-color)}.peer:checked~.peer-checked\\:after\\:translate-x-full:after{--tw-translate-x:100%;content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:focus~.peer-focus\\:ring-4{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.peer:focus~.peer-focus\\:ring-\\[var\\(--c-c-bar-toggle-ring-color\\)\\]{--tw-ring-color:var(--c-c-bar-toggle-ring-color)}.peer:disabled~.peer-disabled\\:opacity-50{opacity:.5}@media not all and (min-width:768px){.max-md\\:flex{display:flex}.max-md\\:hidden{display:none}.max-md\\:w-2\\/6{width:33.333333%}.max-md\\:w-4\\/6{width:66.666667%}.max-md\\:flex-row{flex-direction:row}.max-md\\:flex-col{flex-direction:column}.max-md\\:gap-1{gap:.25rem}.max-md\\:px-3{padding-left:.75rem;padding-right:.75rem}.max-md\\:py-2{padding-bottom:.5rem;padding-top:.5rem}}@media (min-width:640px){.sm\\:inset-x-5{left:1.25rem;right:1.25rem}.sm\\:bottom-5{bottom:1.25rem}.sm\\:my-8{margin-bottom:2rem;margin-top:2rem}.sm\\:max-h-\\[36rem\\]{max-height:36rem}.sm\\:w-fit{width:-moz-fit-content;width:fit-content}.sm\\:w-full{width:100%}.sm\\:max-w-xl{max-width:36rem}.sm\\:flex-row-reverse{flex-direction:row-reverse}.sm\\:items-center{align-items:center}.sm\\:rounded-\\[var\\(--c-border-radius\\)\\]{border-radius:var(--c-border-radius)}.sm\\:rounded-b-\\[var\\(--c-border-radius\\)\\]{border-bottom-left-radius:var(--c-border-radius);border-bottom-right-radius:var(--c-border-radius)}.sm\\:rounded-t-\\[var\\(--c-border-radius\\)\\]{border-top-left-radius:var(--c-border-radius);border-top-right-radius:var(--c-border-radius)}.sm\\:border-2{border-width:2px}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width:768px){.md\\:hidden{display:none}.md\\:max-w-2xl{max-width:42rem}.md\\:px-3{padding-left:.75rem;padding-right:.75rem}.md\\:py-2{padding-bottom:.5rem;padding-top:.5rem}}@media (min-width:1024px){.lg\\:max-w-3xl{max-width:48rem}}',{insertAt:"top"});const h=({icon:o,title:t,desc:a})=>e("div",Object.assign({className:"fixed inset-x-3 sm:inset-x-5 bottom-3 sm:bottom-5 bg-[var(--c-bg-primary-color)] max-w-sm mr-auto shadow-lg border-2 border-[var(--c-border-color)] rounded-[var(--c-border-radius)] w-fit"},{children:r("div",Object.assign({className:"px-4 py-3 flex gap-3 items-center text-[var(--c-text-color)]"},{children:[e("p",Object.assign({className:"text-2xl"},{children:o})),r("div",{children:[e("p",Object.assign({className:"text-xl font-semibold"},{children:t})),e("p",{children:a})]})]}))})),u=()=>r("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 1024 1024",width:36,height:36},{children:[e("path",{fill:"#A47B4B",d:"M902.56 452.648c26.178 20.859 59.327 33.329 95.366 33.329 8.624 0 17.084-.714 25.314-2.085.5 9.291.76 18.67.76 28.108 0 282.58-229.42 512-512 512C229.42 1024 0 794.58 0 512 0 229.42 229.42 0 512 0l.581.001c3.777 51.632 25.769 98.244 59.565 133.417-6.063 15.061-9.401 31.515-9.401 48.742 0 70.908 56.561 128.71 126.995 130.711-5.136 14.011-7.941 29.152-7.941 44.943 0 72.172 58.594 130.765 130.765 130.765 34.859 0 66.55-13.669 89.996-35.931z"}),e("path",{d:"M902.56 452.648c26.178 20.859 59.327 33.329 95.366 33.329 8.624 0 17.084-.714 25.314-2.085.5 9.291.76 18.67.76 28.108 0 282.58-229.42 512-512 512C229.42 1024 0 794.58 0 512 0 229.42 229.42 0 512 0l.581.001c3.777 51.632 25.769 98.244 59.565 133.417-6.063 15.061-9.401 31.515-9.401 48.742 0 70.908 56.561 128.71 126.995 130.711-5.136 14.011-7.941 29.152-7.941 44.943 0 72.172 58.594 130.765 130.765 130.765 34.859 0 66.55-13.669 89.996-35.931zM473.915 47.379C234.429 66.758 45.833 267.528 45.833 512c0 257.284 208.883 466.167 466.167 466.167 250.981 0 455.902-198.773 465.79-447.375a197.524 197.524 0 01-73.238-22.23c-26.794 16.398-58.296 25.851-91.988 25.851-97.467 0-176.598-79.131-176.598-176.599 0-2.884.069-5.752.213-8.603-69.364-23.821-119.268-89.652-119.268-167.051 0-13.014 1.415-25.701 4.096-37.913-21.93-28.244-38.2-61.105-47.092-96.868z"}),e("path",{d:"M786.968 131.266c17.522 0 31.748 14.226 31.748 31.748s-14.226 31.748-31.748 31.748-31.748-14.226-31.748-31.748 14.226-31.748 31.748-31.748zm0 19.899c6.54 0 11.849 5.309 11.849 11.849 0 6.539-5.309 11.849-11.849 11.849-6.539 0-11.848-5.31-11.848-11.849 0-6.54 5.309-11.849 11.848-11.849z",transform:"translate(-1062.33 -223.122) scale(2.30328)"}),e("path",{d:"M786.968 131.266c17.522 0 31.748 14.226 31.748 31.748s-14.226 31.748-31.748 31.748-31.748-14.226-31.748-31.748 14.226-31.748 31.748-31.748zm0 37.34a5.595 5.595 0 01-5.592-5.592 5.595 5.595 0 015.592-5.592 5.594 5.594 0 015.592 5.592 5.594 5.594 0 01-5.592 5.592z",transform:"translate(-142.571 144.17) scale(1.22746)"}),r("g",Object.assign({transform:"translate(-96.57 -27.954)"},{children:[e("circle",{cx:"369.005",cy:"607.533",r:"124.523",fill:"#824C2D"}),e("path",{d:"M369.005 483.01c68.726 0 124.523 55.797 124.523 124.523 0 68.727-55.797 124.524-124.523 124.524-68.727 0-124.524-55.797-124.524-124.524 0-68.726 55.797-124.523 124.524-124.523zm0 45.833c43.43 0 78.69 35.26 78.69 78.69s-35.26 78.69-78.69 78.69c-43.431 0-78.691-35.26-78.691-78.69s35.26-78.69 78.691-78.69z"})]})),r("g",Object.assign({transform:"translate(-53.987 -53.367)"},{children:[e("circle",{cx:"649.182",cy:"814.013",r:"81.957",fill:"#824C2D"}),e("path",{d:"M649.182 732.057c45.233 0 81.957 36.723 81.957 81.956 0 45.234-36.724 81.957-81.957 81.957s-81.956-36.723-81.956-81.957c0-45.233 36.723-81.956 81.956-81.956zm0 45.833c19.937 0 36.124 16.186 36.124 36.123 0 19.937-16.187 36.124-36.124 36.124s-36.123-16.187-36.123-36.124 16.186-36.123 36.123-36.123z"})]})),r("g",Object.assign({transform:"translate(-88.858 -49.889)"},{children:[e("circle",{cx:"485.817",cy:"394.152",r:"88.858",fill:"#824C2D"}),e("path",{d:"M485.817 305.294c49.042 0 88.858 39.816 88.858 88.858s-39.816 88.858-88.858 88.858-88.858-39.816-88.858-88.858 39.816-88.858 88.858-88.858zm0 45.833c23.746 0 43.024 19.279 43.024 43.025s-19.278 43.024-43.024 43.024c-23.746 0-43.025-19.278-43.025-43.024 0-23.746 19.279-43.025 43.025-43.025z"})]}))]})),f=()=>e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"1.5",clipRule:"evenodd",viewBox:"0 0 1024 1024",width:36,height:36},{children:r("g",Object.assign({fill:"none",stroke:"#000",strokeWidth:"37.5"},{children:[e("path",{d:"M113.55 231.032c-17.159 29.456-31.375 60.664-42.873 92.393-29.744 82.079-27.791 171.696-22.686 257.495 2.57 43.181 6.927 86.295 13.193 129.123M958 648.553c-15.887-20.5-27.969-43.679-38.665-67.206-24.902-54.777-48.806-110.003-73.385-164.925-30.461-68.066-61.959-135.085-104.597-196.544-44.47-64.099-109.985-115.601-180.035-148.979-74.386-35.444-160.067-39.442-237.636-15.77M232.788 915.26a1944.378 1944.378 0 01-28.153-83.069c-25.293-80.65-45.805-163.27-53.515-247.638M312.62 957.5c-6.741-15.828-13.305-31.928-19.943-48.57-14.933-37.437-31.028-82.619-42.662-121.218-6.713-22.272-13.079-44.665-18.58-67.268-5.598-22.996-10.224-46.224-14.7-69.464-3.457-17.953-7.838-51.761-9.282-69.98-8.268-104.308 3.559-227.172 89.022-299.135 16.123-13.577 30.33-24.467 49.118-34.219 26.61-13.812 48.495-22.289 77.572-29.646"}),e("path",{d:"M389.825 978.965c-35.637-70.638-65.251-144.313-90.371-219.292-21.403-63.881-34.374-130.192-39.155-197.374-4.829-67.868 2.935-141.465 42.673-198.613 53.809-77.385 157.116-128.069 251.138-102.569 37.505 10.172 70.925 32.382 98.258 59.594 35.855 35.696 61.073 80.679 79.664 127.373 31.664 79.528 47.501 168.206 103.605 235.78 24.169 29.111 56.496 53.091 92.218 67.447"}),e("path",{d:"M467.148 996.59c-37.646-67.958-69.661-139.083-99.107-210.868-37.928-92.46-80.901-195.969-53.964-297.498 19.945-75.177 77.707-145.248 154.412-166.613 36.804-10.251 78.855-9.891 111.518 12.005 41.269 27.666 66.608 72.457 87.794 116.076 38.118 78.48 56.725 165.668 102.677 240.452 14.661 23.859 30.045 48.571 52.282 66.31 21.657 17.277 46.025 31.814 71.913 42.659"}),e("path",{d:"M532.773 996.59a1670.906 1670.906 0 01-93.311-189.941c-15.557-37.502-28.891-73.743-40.441-112.683-22.132-74.617-37.58-153.631-12.041-229.503 2.991-8.886 9.758-21.531 15.413-28.971 27.126-35.693 68.129-74.568 117.132-60.065 7.01 2.074 17.08 7.02 23.051 11.227 72.837 51.303 96.764 145.84 125.939 223.718 8.175 21.822 20.782 49.666 31.603 70.288 35.319 67.308 87.19 135.199 158.042 164.147"}),e("path",{d:"M712.999 946.399a374.98 374.98 0 01-3.34-3.79c-9.988-11.489-19.402-23.479-28.571-35.632-21.248-28.161-40.217-55.85-57.599-86.583-13.215-23.365-26.055-46.966-37.876-71.067-11.822-24.101-22.727-48.661-33.015-73.456C530.198 621.878 516.359 579.772 499 524c-2.678-8.603 5.695 17.106 9 25.489a2652.874 2652.874 0 0026.989 65.794c20.623 48.461 45.888 94.862 74.189 139.245 40.165 62.989 88.202 127.802 149.428 172.666M658.798 972.125C633.743 938.092 611.352 902.147 593 864"}),e("path",{d:"M605.937 988.423c-37.632-59.853-71.882-121.838-101.731-185.942-26.76-57.472-31.269-70.507-51.056-130.703-15.453-47.014-27.986-98.059-16.56-147.46 1.666-7.2 3.362-14.444 6.033-21.335 2.711-6.998 6.125-13.75 10.042-20.151 13.641-22.293 41.881-50.681 70.548-35.892 3.471 1.791 6.525 4.324 9.529 6.82 20.909 17.37 26.475 46.773 34.971 70.802 14.53 41.096 23.185 65.229 41.281 104.923 14.085 30.892 28.637 57.229 45.479 86.675 37.743 65.992 84.871 135.556 149.218 177.621"}),e("path",{d:"M739.953 464.698c-16.794-38.622-37.997-75.172-59.731-111.161-42.984-71.18-96.834-151.628-180.601-178.376-24.649-7.87-50.76-10.647-76.558-10.204-19.285.332-38.402 2.536-57.149 6.99-29.026 6.895-56.692 18.987-81.803 35.041-30.638 19.587-57.184 45.064-79.92 73.34-36.744 45.696-63.072 98.926-83.053 153.777-22.11 60.696-20.494 128.18-12.602 191.261 9.542 76.269 21.103 145.587 42.584 219.441"}),e("path",{d:"M950.833 704.801c-33.767-12.816-58.703-42.716-77.28-72.741-22.525-36.405-37.241-76.935-52.948-116.502-24.565-61.88-24.881-65.73-51.401-126.817-14.927-34.385-34.326-66.686-55.681-97.432-46.538-67.003-103.152-131.588-178.606-166.432-33.986-15.694-71.609-23.797-109.08-22.41-28.04 1.038-48.654 3.62-75.695 11.336-28.506 8.134-44.708 16.167-70.735 30.124-112.408 60.28-161.476 192.912-171.965 313.39-3.283 37.707-7.286 76.607-3.672 114.349M637.383 36.751c34.101 19.88 64.766 46.092 92.563 73.94 66.016 66.139 115.615 147.222 156.811 230.545 29.163 58.983 78.889 163.574 108.523 222.327M865.183 170.096c38.097 53.551 67.77 112.669 94.639 172.501 10.337 23.016 20.529 46.109 30.705 69.213"})]}))})),m=({icon:r})=>{const{consentDisplayed:o,handleConsentDisplayedChange:t}=g();return e("div",Object.assign({onClick:()=>t(!0),className:"fixed inset-x-3 sm:inset-x-5 bottom-3 sm:bottom-5 bg-[var(--c-open-bg-color)] hover:bg-[var(--c-open-bg-hover-color)] max-w-sm mr-auto shadow-lg border-2 border-[var(--c-border-color)] rounded-[var(--c-open-border-radius)] w-fit cursor-pointer transition text-[var(--c-open-text-color)] "+(o?"hidden":"")},{children:e("div",Object.assign({className:"p-1"},{children:(()=>{switch(r){case"cookie":return e(u,{});case"fingerprint":return e(f,{});default:return e("p",{children:r})}})()}))}))},v=r=>{var{children:o}=r,t=d(r,["children"]);return e("div",Object.assign({},t,{children:e("div",Object.assign({className:"flex min-h-full items-end justify-center text-center sm:items-center"},{children:e("div",Object.assign({className:"flex flex-col h-screen sm:max-h-[36rem] w-screen sm:w-fit sm:max-w-xl md:max-w-2xl lg:max-w-3xl transform sm:border-2 border-[var(--c-border-color)] sm:rounded-[var(--c-border-radius)] bg-[var(--c-bg-primary-color)] text-[var(--c-text-color)] text-left shadow-2xl transition-all sm:my-8"},{children:o}))}))}))},w=({display:o})=>o?r("div",Object.assign({className:"text-sm mt-1 text-[var(--c-text-by-color)]"},{children:["Powered by"," ",e("a",Object.assign({className:"font-bold",href:"https://cookify.jersyfi.dev"},{children:"Cookify"}))]})):null,x=({title:o})=>r("div",Object.assign({className:"sm:rounded-t-[var(--c-border-radius)] grow-0 bg-[var(--c-bg-secondary-color)] px-4 py-3 sm:px-6"},{children:[e("h2",Object.assign({className:"text-2xl font-semibold text-[var(--c-text-title-color)]"},{children:o})),e(w,{display:!0})]})),y=()=>e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},{children:e("path",{d:"M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"})})),k=()=>e("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},{children:e("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})})),j=({type:o,tableHeaders:a,typeDefault:c})=>{var n,i;const[d,l]=t(!1),s={body:o.body||[]},b=()=>o.for==c;return r("div",Object.assign({className:"overflow-hidden"},{children:[r("div",Object.assign({className:"bg-[var(--c-c-bar-bg-color)] hover:bg-[var(--c-c-bar-bg-hover-color)] rounded-[var(--c-c-bar-border-radius)] p-3 flex gap-3"},{children:[r("div",Object.assign({onClick:()=>{l(!d)},className:"flex items-center gap-1 mr-auto font-bold cursor-pointer text-[var(--c-c-bar-text-color)]"},{children:[e("span",Object.assign({className:"inline-block w-3.5 fill-[var(--c-c-bar-text-color)]"},{children:e(d?y:k,{})})),o.title,(null===(n=s.body)||void 0===n?void 0:n.length)>0&&e("span",Object.assign({className:"inline-block relative bg-[var(--c-c-bar-badge-bg-color)] rounded-[var(--c-c-bar-badge-border-radius)] px-2 py-0.5 text-xs text-[var(--c-c-bar-badge-text-color)] font-bold leading-4"},{children:s.body.length}))]})),r("label",Object.assign({className:"grow-0 relative inline-flex items-center "+(b()?"cursor-not-allowed":"cursor-pointer")},{children:[e(p,{className:"sr-only peer",type:"checkbox",name:o.for,disabled:b()}),e("div",{className:"relative w-11 h-6 bg-[var(--c-c-bar-toggle-off-color)] rounded-full peer-focus:ring-4 peer-focus:ring-[var(--c-c-bar-toggle-ring-color)] peer-checked:after:translate-x-full after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-[var(--c-c-bar-toggle-knob-color)] after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-[var(--c-c-bar-toggle-on-color)] peer-disabled:opacity-50"})]}))]})),e("div",Object.assign({className:"px-[var(--c-c-extend-padding)] "+(d?"":"hidden")},{children:r("div",Object.assign({className:"bg-[var(--c-c-extend-bg-color)] rounded-b-[var(--c-c-extend-border-radius)] border-x-2 border-b-2 border-[var(--c-c-extend-border-color)] overflow-hidden text-[var(--c-c-extend-text-color)]"},{children:[e("div",Object.assign({className:"p-3"},{children:e("div",{children:o.desc})})),(null===(i=s.body)||void 0===i?void 0:i.length)>0&&e("div",Object.assign({className:""},{children:r("table",Object.assign({className:"w-full border-t-2 border-[var(--c-c-extend-border-color)]"},{children:[e("thead",{children:e("tr",Object.assign({className:"max-md:hidden border-b-2 border-[var(--c-c-extend-border-color)] bg-[var(--c-c-extend-table-bg-header-color)]"},{children:a.map(((r,o)=>e("th",Object.assign({scope:"col",className:"px-3 py-2 whitespace-nowrap"},{children:r}),o)))}))}),e("tbody",{children:s.body.map(((o,t)=>e("tr",Object.assign({className:"max-md:px-3 max-md:py-2 max-md:flex max-md:flex-col max-md:gap-1 hover:bg-[var(--c-c-extend-table-bg-hover-color)] border-[var(--c-c-extend-border-color)] "+(t+1<s.body.length?"border-b-2":"")},{children:o.map(((o,t)=>r("td",Object.assign({className:"max-md:flex max-md:flex-row md:px-3 md:py-2 whitespace-nowrap"},{children:[e("span",Object.assign({className:"max-md:w-2/6 md:hidden font-medium"},{children:a[t]||"?"})),e("span",Object.assign({className:"max-md:w-4/6 whitespace-pre-wrap"},{children:o}))]}),t)))}),t)))})]}))}))]}))}))]}))},O=({desc:o,table:c,reference:n})=>{const{consentObject:i}=g(),[d,l]=t({created:"",updated:""});return a((()=>{l({created:new Date(i.created_at).toUTCString(),updated:new Date(i.updated_at).toUTCString()})}),[i]),e("div",Object.assign({className:"scrollbar grow overflow-y-auto px-4 py-3 sm:px-6"},{children:r("div",Object.assign({className:"grid gap-6"},{children:[e("p",{children:o}),c.types.length>0&&e("div",Object.assign({className:"grid gap-3"},{children:c.types.map(((r,o)=>e(j,{type:r,tableHeaders:c.headers,typeDefault:c.typeDefault},o)))})),"object"==typeof n&&r("div",Object.assign({className:"border-2 border-[var(--c-ref-border-color)] rounded-[var(--c-ref-border-radius)] p-3"},{children:[e("p",Object.assign({className:"mb-3"},{children:n.desc})),r("p",{children:[r("b",{children:[n.uuid,":"]})," ",i.uuid]}),r("p",{children:[r("b",{children:[n.accepted,":"]})," ",d.created]}),r("p",{children:[r("b",{children:[n.updated,":"]})," ",d.updated]})]}))]}))}))},N=({buttons:r})=>{const{actionAccept:o,actionNecessary:t,actionAll:a}=g();return e("div",Object.assign({className:"relative sm:rounded-b-[var(--c-border-radius)] grow-0 bg-[var(--c-bg-secondary-color)] px-4 py-3 sm:px-6 grid gap-3"},{children:e("div",Object.assign({className:"flex flex-col sm:flex-row-reverse gap-3"},{children:r.map(((r,c)=>{let n,i;switch(r.action){case"necessary":n=t;break;case"accept":n=o;break;case"all":n=a}return"week"==r.schema?i="bg-[var(--c-btn-week-bg-color)] hover:bg-[var(--c-btn-week-bg-hover-color)] text-[var(--c-btn-week-text-color)]":"strong"==r.schema&&(i="bg-[var(--c-btn-strong-bg-color)] hover:bg-[var(--c-btn-strong-bg-hover-color)] text-[var(--c-btn-strong-text-color)]"),e("button",Object.assign({className:"inline-flex font-medium justify-center sm:w-full px-4 py-2 rounded-[var(--c-btn-border-radius)] transition duration-500 "+i,onClick:n},{children:r.label}),c)}))}))}))},z=({show:o,content:t,table:a,support:c})=>r(v,Object.assign({className:"fixed inset-0 z-10 bg-[var(--c-bg-overlay-color)]"+(o?"":" hidden")},{children:[e(x,{title:t.title,support:c}),e(O,{desc:t.desc,table:a,reference:t.reference()}),e(N,{buttons:t.buttons})]})),C=r=>{var{children:o}=r,t=d(r,["children"]);return e("div",Object.assign({},t,{children:e("div",Object.assign({className:"fixed inset-x-3 sm:inset-x-5 bottom-3 sm:bottom-5 bg-[var(--c-bg-primary-color)] max-w-sm mr-auto shadow-lg border-2 border-[var(--c-border-color)] rounded-[var(--c-border-radius)] w-fit"},{children:e("div",Object.assign({className:"px-4 py-3 grid gap-6 items-center text-[var(--c-text-color)]"},{children:o}))}))}))},D=({buttons:r,openManage:o})=>{const{actionNecessary:t,actionAccept:a,actionAll:c}=g();return e("div",Object.assign({className:"flex flex-col gap-3"},{children:r.map(((r,n)=>{let i,d;switch(r.action){case"necessary":i=t;break;case"accept":i=a;break;case"all":i=c;break;default:i=o}return"week"==r.schema?d="bg-[var(--c-btn-week-bg-color)] hover:bg-[var(--c-btn-week-bg-hover-color)] text-[var(--c-btn-week-text-color)]":"strong"==r.schema&&(d="bg-[var(--c-btn-strong-bg-color)] hover:bg-[var(--c-btn-strong-bg-hover-color)] text-[var(--c-btn-strong-text-color)]"),e("button",Object.assign({className:"inline-flex font-medium justify-center sm:w-full px-4 py-2 rounded-[var(--c-btn-border-radius)] transition duration-500 "+d,onClick:i},{children:r.label}),n)}))}))},M=({show:o,force:t,content:a,openManage:c,support:n})=>r(C,Object.assign({className:(t&&"fixed inset-0 z-10 bg-[var(--c-bg-overlay-color)]")+(o?"":" hidden")},{children:[r("div",{children:[e("p",Object.assign({className:"text-2xl font-semibold mb-1 text-[var(--c-text-title-color)]"},{children:a.title})),e(w,{display:n})]}),e("p",{children:a.desc}),e(D,{buttons:a.buttons,openManage:c})]})),A=({consent:c})=>{var n,i,d,l,s,b,p,u,f,v,w,x,y,k,j;const{consentObject:O,consentDisplayed:N}=g(),[C,D]=t(""),[A,S]=t(!1),[_,T]=t(!1),B={support:null===(n=null==c?void 0:c.support)||void 0===n||n,theme:["light","dark","high-contrast","custom"].includes((null==c?void 0:c.theme)||"")?null==c?void 0:c.theme:"light",first:(null==c?void 0:c.first)||"info",force:null!==(i=null==c?void 0:c.force)&&void 0!==i&&i,icon:(null==c?void 0:c.icon)||"cookie",reopen:null===(d=null==c?void 0:c.reopen)||void 0===d||d,paused:{title:(null===(l=null==c?void 0:c.paused)||void 0===l?void 0:l.title)||"Consent Manger Notice",desc:(null===(s=null==c?void 0:c.paused)||void 0===s?void 0:s.desc)||"The consent manager is paused on this side to read the privacy policy.",icon:(null===(b=null==c?void 0:c.paused)||void 0===b?void 0:b.icon)||"⚠️",url:(null===(p=null==c?void 0:c.paused)||void 0===p?void 0:p.url)||"undefined"},info:{title:(null===(u=null==c?void 0:c.info)||void 0===u?void 0:u.title)||"We use cookies!",desc:(null===(f=null==c?void 0:c.info)||void 0===f?void 0:f.desc)||r(o,{children:["Welcome! To enhance your experience, we use cookies and comply with GDPR. For more information feel free to check out our"," ",e("a",Object.assign({href:"#",style:{textDecoration:"underline",fontWeight:500}},{children:"privacy policy"})),"."]}),buttons:(null===(v=null==c?void 0:c.info)||void 0===v?void 0:v.buttons)||[{action:"manage",label:"Manage settings",schema:"week"},{action:"all",label:"Accept all",schema:"strong"}]},detail:{title:(null===(w=null==c?void 0:c.detail)||void 0===w?void 0:w.title)||"Manage your consent settings",desc:(null===(x=null==c?void 0:c.detail)||void 0===x?void 0:x.desc)||r(o,{children:["We want your visit to our website to be awesome, so we use cookies to give you the best expirience and for remembering preferences. You can manage your cookie preferences at any time. To learn more about our use of cookies feel free to check out our"," ",e("a",Object.assign({href:"#",style:{textDecoration:"underline",fontWeight:500}},{children:"privacy policy"})),"."]}),reference:()=>{var e,r,o,t,a,n,i,d,l,s,b;const g=null===(r=null===(e=null==c?void 0:c.detail)||void 0===e?void 0:e.reference)||void 0===r||r;return("object"==typeof g||1==g)&&!1!==(null===(o=null==c?void 0:c.detail)||void 0===o?void 0:o.reference)&&{desc:(null===(a=null===(t=null==c?void 0:c.detail)||void 0===t?void 0:t.reference)||void 0===a?void 0:a.desc)||"Please provide the below information when you hand in a request about cookies.",uuid:(null===(i=null===(n=null==c?void 0:c.detail)||void 0===n?void 0:n.reference)||void 0===i?void 0:i.uuid)||"UUID",accepted:(null===(l=null===(d=null==c?void 0:c.detail)||void 0===d?void 0:d.reference)||void 0===l?void 0:l.accepted)||"Accepted",updated:(null===(b=null===(s=null==c?void 0:c.detail)||void 0===s?void 0:s.reference)||void 0===b?void 0:b.updated)||"Updated"}},buttons:(null===(y=null==c?void 0:c.detail)||void 0===y?void 0:y.buttons)||[{action:"necessary",label:"Only necessary",schema:"week"},{action:"accept",label:"Accept selected",schema:"week"},{action:"all",label:"Accept all",schema:"strong"}]},table:{headers:(null===(k=null==c?void 0:c.table)||void 0===k?void 0:k.headers)||[],types:(null===(j=null==c?void 0:c.table)||void 0===j?void 0:j.types)||[],typeDefault:"necessary"}};return a((()=>{D(window.location.pathname)}),[]),a((()=>{!0===N?(B.force&&document.body.classList.add("overflow-y-hidden"),"info"==B.first&&!1===O.viewed?S(!0):T(!0)):(document.body.classList.remove("overflow-y-hidden"),S(!1),T(!1))}),[N]),e("div",Object.assign({id:"cookify",className:"cookify-theme-"+B.theme},{children:"undefined"!==B.paused.url&&B.paused.url==C&&!1===O.viewed?e(h,{icon:B.paused.icon,title:B.paused.title,desc:B.paused.desc}):r(o,{children:[e(m,{icon:B.icon}),e(M,{show:A,force:B.force,content:B.info,openManage:()=>{S(!1),T(!0)},support:B.support}),e(z,{show:_,content:B.detail,table:B.table,support:B.support})]})}))},S=({settings:o,children:t})=>{const{options:a,consent:c}=o;return r(b,Object.assign({options:a},{children:[t,e(A,{consent:c})]}))};export{S as CookifyConsent,p as CookifyInput,b as CookifyProvider,g as useCookifyProvider};
//# sourceMappingURL=index.js.map