@antistatique/leckerli 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc ADDED
@@ -0,0 +1,225 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "jest": true,
5
+ "jquery": true,
6
+ "node": true
7
+ },
8
+ "extends": [
9
+ "airbnb",
10
+ "airbnb-typescript",
11
+ "plugin:@typescript-eslint/recommended",
12
+ "plugin:import/errors",
13
+ "plugin:import/warnings",
14
+ "plugin:prettier/recommended",
15
+ "plugin:react/recommended",
16
+ "plugin:tailwind/recommended",
17
+ "prettier"
18
+ ],
19
+ "parser": "@typescript-eslint/parser",
20
+ "parserOptions": {
21
+ "ecmaFeatures": {
22
+ "jsx": true
23
+ },
24
+ "ecmaVersion": 2022,
25
+ "project": "./tsconfig.eslint.json",
26
+ "sourceType": "module"
27
+ },
28
+ "plugins": [
29
+ "html",
30
+ "import",
31
+ "prettier",
32
+ "react-hooks",
33
+ "simple-import-sort"
34
+ ],
35
+ "rules": {
36
+ "@typescript-eslint/no-unused-vars": [
37
+ "error",
38
+ {
39
+ "varsIgnorePattern": "React"
40
+ }
41
+ ],
42
+ "arrow-body-style": [
43
+ 2,
44
+ "as-needed"
45
+ ],
46
+ "comma-dangle": 0,
47
+ "func-names": 0,
48
+ "import": 0,
49
+ "import/extensions": 0,
50
+ "import/no-extraneous-dependencies": [
51
+ "error",
52
+ {
53
+ "packageDir": "./"
54
+ }
55
+ ],
56
+ "import/no-named-as-default": 0,
57
+ "import/order": "off",
58
+ "import/prefer-default-export": 0,
59
+ "jsx-a11y/accessible-emoji": 0,
60
+ "jsx-a11y/anchor-is-valid": [
61
+ "warn",
62
+ {
63
+ "aspects": [
64
+ "invalidHref"
65
+ ]
66
+ }
67
+ ],
68
+ "jsx-a11y/control-has-associated-label": [
69
+ 2,
70
+ {
71
+ "ignoreElements": [
72
+ "link"
73
+ ]
74
+ }
75
+ ],
76
+ "jsx-a11y/href-no-hash": "off",
77
+ "max-len": 0,
78
+ "no-alert": 0,
79
+ "no-await-in-loop": 0,
80
+ "no-console": 0,
81
+ "no-debugger": 0,
82
+ "no-param-reassign": [
83
+ 2,
84
+ {
85
+ "props": false
86
+ }
87
+ ],
88
+ "no-restricted-exports": 0,
89
+ "no-restricted-syntax": [
90
+ 2,
91
+ "ForInStatement",
92
+ "LabeledStatement",
93
+ "WithStatement"
94
+ ],
95
+ "no-return-assign": [
96
+ "error",
97
+ "except-parens"
98
+ ],
99
+ "no-shadow": [
100
+ 2,
101
+ {
102
+ "allow": [
103
+ "resolve",
104
+ "reject",
105
+ "done",
106
+ "next",
107
+ "err",
108
+ "error"
109
+ ],
110
+ "hoist": "all"
111
+ }
112
+ ],
113
+ "no-underscore-dangle": 0,
114
+ "no-unused-expressions": [
115
+ 2,
116
+ {
117
+ "allowTaggedTemplates": true
118
+ }
119
+ ],
120
+ "no-unused-vars": 0,
121
+ "prefer-const": [
122
+ "error",
123
+ {
124
+ "destructuring": "all"
125
+ }
126
+ ],
127
+ "prettier/prettier": [
128
+ "error",
129
+ {
130
+ "arrowParens": "avoid",
131
+ "singleQuote": true,
132
+ "trailingComma": "es5"
133
+ }
134
+ ],
135
+ "quotes": [
136
+ 2,
137
+ "single",
138
+ {
139
+ "allowTemplateLiterals": true,
140
+ "avoidEscape": true
141
+ }
142
+ ],
143
+ "react/function-component-definition": [
144
+ 2,
145
+ {
146
+ "namedComponents": "arrow-function"
147
+ }
148
+ ],
149
+ "react-hooks/rules-of-hooks": "error",
150
+ "react/display-name": 1,
151
+ "react/forbid-prop-types": 0,
152
+ "react/jsx-filename-extension": [
153
+ 1,
154
+ {
155
+ "extensions": [
156
+ ".js",
157
+ ".jsx",
158
+ ".ts",
159
+ ".tsx"
160
+ ]
161
+ }
162
+ ],
163
+ "react/jsx-props-no-spreading": 0,
164
+ "react/no-array-index-key": 0,
165
+ "react/no-unescaped-entities": 0,
166
+ "react/require-default-props": 0,
167
+ "react/react-in-jsx-scope": 0,
168
+ react-hooks/exhaustive-deps": 0,
169
+ "simple-import-sort/imports": [
170
+ "error",
171
+ {
172
+ "groups": [
173
+ [
174
+ "^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)"
175
+ ],
176
+ [
177
+ "^react",
178
+ "^@?\\w"
179
+ ],
180
+ [
181
+ "^(@|assets|components|config|contexts|hooks|locales|pages|sections|services|store|styles|types|utils)(/.*|$)"
182
+ ],
183
+ [
184
+ "^\\u0000"
185
+ ],
186
+ [
187
+ "^\\.\\.(?!/?$)",
188
+ "^\\.\\./?$"
189
+ ],
190
+ [
191
+ "^\\./(?=.*/)(?!/?$)",
192
+ "^\\.(?!/?$)",
193
+ "^\\./?$"
194
+ ],
195
+ [
196
+ "^.+\\.s?css$"
197
+ ]
198
+ ]
199
+ }
200
+ ],
201
+ "space-before-function-paren": 0
202
+ },
203
+ "settings": {
204
+ "import/parsers": {
205
+ "@typescript-eslint/parser": [
206
+ ".ts",
207
+ ".tsx"
208
+ ]
209
+ },
210
+ "import/resolver": {
211
+ "node": {
212
+ "paths": [
213
+ "./src"
214
+ ]
215
+ },
216
+ "react": {
217
+ "version": "detect"
218
+ },
219
+ "typescript": {
220
+ "alwaysTryTypes": true,
221
+ "project": "./"
222
+ }
223
+ }
224
+ }
225
+ }
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ yarn lint-staged && yarn build && git add dist
package/.lintstagedrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "src/**/*.{js,jsx,ts,tsx}": "eslint --ext .js,.jsx,.ts,.tsx --max-warnings=0",
3
+ }
package/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.0.3] - 2023-06-28
10
+ ### Fixed
11
+ - Fix build config and linter warnings
12
+
9
13
  ## [1.0.2] - 2023-06-28
10
14
  ### Changed
11
15
  - Improve documentation
@@ -19,7 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
19
23
  ### Added
20
24
  - First POC
21
25
 
22
- [Unreleased]: https://github.com/antistatique/leckerli/compare/v1.0.2...HEAD
26
+ [Unreleased]: https://github.com/antistatique/leckerli/compare/v1.0.3...HEAD
27
+ [1.0.3]: https://github.com/antistatique/leckerli/compare/v1.0.2...v1.0.3
23
28
  [1.0.2]: https://github.com/antistatique/leckerli/compare/v1.0.1...v1.0.2
24
29
  [1.0.1]: https://github.com/antistatique/leckerli/compare/v1.0.0...v1.0.1
25
30
  [1.0.0]: https://github.com/antistatique/leckerli/releases/tag/v1.0.0
@@ -1,4 +1,4 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const _ of o.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&r(_)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var V,a,Ze,R,Pe,Qe,pe,Xe,X={},et=[],Zt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,oe=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function tt(e){var t=e.parentNode;t&&t.removeChild(e)}function S(e,t,n){var r,i,o,_={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:_[o]=t[o];if(arguments.length>2&&(_.children=arguments.length>3?V.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)_[o]===void 0&&(_[o]=e.defaultProps[o]);return I(e,_,r,i,null)}function I(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++Ze};return i==null&&a.vnode!=null&&a.vnode(o),o}function nt(){return{current:null}}function C(e){return e.children}function E(e,t){this.props=e,this.context=t}function F(e,t){if(t==null)return e.__?F(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?F(e):null}function rt(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return rt(e)}}function de(e){(!e.__d&&(e.__d=!0)&&R.push(e)&&!ee.__r++||Pe!==a.debounceRendering)&&((Pe=a.debounceRendering)||Qe)(ee)}function ee(){var e,t,n,r,i,o,_,c;for(R.sort(pe);e=R.shift();)e.__d&&(t=R.length,r=void 0,i=void 0,_=(o=(n=e).__v).__e,(c=n.__P)&&(r=[],(i=w({},o)).__v=o.__v+1,ye(c,o,i,n.__n,c.ownerSVGElement!==void 0,o.__h!=null?[_]:null,r,_??F(o),o.__h),ct(r,o),o.__e!=_&&rt(o)),R.length>t&&R.sort(pe));ee.__r=0}function ot(e,t,n,r,i,o,_,c,s,p){var u,h,f,l,d,$,g,b=r&&r.__k||et,x=b.length;for(n.__k=[],u=0;u<t.length;u++)if((l=n.__k[u]=(l=t[u])==null||typeof l=="boolean"||typeof l=="function"?null:typeof l=="string"||typeof l=="number"||typeof l=="bigint"?I(null,l,null,null,l):oe(l)?I(C,{children:l},null,null,null):l.__b>0?I(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l)!=null){if(l.__=n,l.__b=n.__b+1,(f=b[u])===null||f&&l.key==f.key&&l.type===f.type)b[u]=void 0;else for(h=0;h<x;h++){if((f=b[h])&&l.key==f.key&&l.type===f.type){b[h]=void 0;break}f=null}ye(e,l,f=f||X,i,o,_,c,s,p),d=l.__e,(h=l.ref)&&f.ref!=h&&(g||(g=[]),f.ref&&g.push(f.ref,null,l),g.push(h,l.__c||d,l)),d!=null?($==null&&($=d),typeof l.type=="function"&&l.__k===f.__k?l.__d=s=it(l,s,e):s=ut(e,l,f,b,d,s),typeof n.type=="function"&&(n.__d=s)):s&&f.__e==s&&s.parentNode!=e&&(s=F(f))}for(n.__e=$,u=x;u--;)b[u]!=null&&(typeof n.type=="function"&&b[u].__e!=null&&b[u].__e==n.__d&&(n.__d=_t(r).nextSibling),lt(b[u],b[u]));if(g)for(u=0;u<g.length;u++)st(g[u],g[++u],g[++u])}function it(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t=typeof r.type=="function"?it(r,t,n):ut(n,r,r,i,r.__e,t));return t}function P(e,t){return t=t||[],e==null||typeof e=="boolean"||(oe(e)?e.some(function(n){P(n,t)}):t.push(e)),t}function ut(e,t,n,r,i,o){var _,c,s;if(t.__d!==void 0)_=t.__d,t.__d=void 0;else if(n==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(i),_=null;else{for(c=o,s=0;(c=c.nextSibling)&&s<r.length;s+=1)if(c==i)break e;e.insertBefore(i,o),_=o}return _!==void 0?_:i.nextSibling}function _t(e){var t,n,r;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=_t(n)))return r}return null}function Qt(e,t,n,r,i){var o;for(o in n)o==="children"||o==="key"||o in t||te(e,o,null,n[o],r);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||n[o]===t[o]||te(e,o,t[o],n[o],r)}function Ne(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Zt.test(t)?n:n+"px"}function te(e,t,n,r,i){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ne(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Ne(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?Re:De,o):e.removeEventListener(t,o?Re:De,o);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function De(e){return this.l[e.type+!1](a.event?a.event(e):e)}function Re(e){return this.l[e.type+!0](a.event?a.event(e):e)}function ye(e,t,n,r,i,o,_,c,s){var p,u,h,f,l,d,$,g,b,x,z,H,Oe,q,se,k=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(s=n.__h,c=t.__e=n.__e,t.__h=null,o=[c]),(p=a.__b)&&p(t);try{e:if(typeof k=="function"){if(g=t.props,b=(p=k.contextType)&&r[p.__c],x=p?b?b.props.value:p.__:r,n.__c?$=(u=t.__c=n.__c).__=u.__E:("prototype"in k&&k.prototype.render?t.__c=u=new k(g,x):(t.__c=u=new E(g,x),u.constructor=k,u.render=en),b&&b.sub(u),u.props=g,u.state||(u.state={}),u.context=x,u.__n=r,h=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),k.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=w({},u.__s)),w(u.__s,k.getDerivedStateFromProps(g,u.__s))),f=u.props,l=u.state,u.__v=t,h)k.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(k.getDerivedStateFromProps==null&&g!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(g,x),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(g,u.__s,x)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(K){K&&(K.__=t)}),z=0;z<u._sb.length;z++)u.__h.push(u._sb[z]);u._sb=[],u.__h.length&&_.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(g,u.__s,x),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,l,d)})}if(u.context=x,u.props=g,u.__P=e,H=a.__r,Oe=0,"prototype"in k&&k.prototype.render){for(u.state=u.__s,u.__d=!1,H&&H(t),p=u.render(u.props,u.state,u.context),q=0;q<u._sb.length;q++)u.__h.push(u._sb[q]);u._sb=[]}else do u.__d=!1,H&&H(t),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++Oe<25);u.state=u.__s,u.getChildContext!=null&&(r=w(w({},r),u.getChildContext())),h||u.getSnapshotBeforeUpdate==null||(d=u.getSnapshotBeforeUpdate(f,l)),ot(e,oe(se=p!=null&&p.type===C&&p.key==null?p.props.children:p)?se:[se],t,n,r,i,o,_,c,s),u.base=t.__e,t.__h=null,u.__h.length&&_.push(u),$&&(u.__E=u.__=null),u.__e=!1}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Xt(n.__e,t,n,r,i,o,_,s);(p=a.diffed)&&p(t)}catch(K){t.__v=null,(s||o!=null)&&(t.__e=c,t.__h=!!s,o[o.indexOf(c)]=null),a.__e(K,t,n)}}function ct(e,t){a.__c&&a.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){a.__e(r,n.__v)}})}function Xt(e,t,n,r,i,o,_,c){var s,p,u,h=n.props,f=t.props,l=t.type,d=0;if(l==="svg"&&(i=!0),o!=null){for(;d<o.length;d++)if((s=o[d])&&"setAttribute"in s==!!l&&(l?s.localName===l:s.nodeType===3)){e=s,o[d]=null;break}}if(e==null){if(l===null)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",l):document.createElement(l,f.is&&f),o=null,c=!1}if(l===null)h===f||c&&e.data===f||(e.data=f);else{if(o=o&&V.call(e.childNodes),p=(h=n.props||X).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!c){if(o!=null)for(h={},d=0;d<e.attributes.length;d++)h[e.attributes[d].name]=e.attributes[d].value;(u||p)&&(u&&(p&&u.__html==p.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(Qt(e,f,h,i,c),u)t.__k=[];else if(ot(e,oe(d=t.props.children)?d:[d],t,n,r,i&&l!=="foreignObject",o,_,o?o[0]:n.__k&&F(n,0),c),o!=null)for(d=o.length;d--;)o[d]!=null&&tt(o[d]);c||("value"in f&&(d=f.value)!==void 0&&(d!==e.value||l==="progress"&&!d||l==="option"&&d!==h.value)&&te(e,"value",d,h.value,!1),"checked"in f&&(d=f.checked)!==void 0&&d!==e.checked&&te(e,"checked",d,h.checked,!1))}return e}function st(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){a.__e(r,n)}}function lt(e,t,n){var r,i;if(a.unmount&&a.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||st(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){a.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&lt(r[i],t,n||typeof e.type!="function");n||e.__e==null||tt(e.__e),e.__=e.__e=e.__d=void 0}function en(e,t,n){return this.constructor(e,n)}function j(e,t,n){var r,i,o;a.__&&a.__(e,t),i=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],ye(t,e=(!r&&n||t).__k=S(C,null,[e]),i||X,X,t.ownerSVGElement!==void 0,!r&&n?[n]:i?null:t.firstChild?V.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),ct(o,e)}function at(e,t){j(e,t,at)}function tn(e,t,n){var r,i,o,_,c=w({},e.props);for(o in e.type&&e.type.defaultProps&&(_=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?i=t[o]:c[o]=t[o]===void 0&&_!==void 0?_[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?V.call(arguments,2):n),I(e.type,c,r||e.key,i||e.ref,null)}function ft(e,t){var n={__c:t="__cC"+Xe++,__:e,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(_){this.props.value!==_.value&&i.some(function(c){c.__e=!0,de(c)})},this.sub=function(_){i.push(_);var c=_.componentWillUnmount;_.componentWillUnmount=function(){i.splice(i.indexOf(_),1),c&&c.call(_)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}V=et.slice,a={__e:function(e,t,n,r){for(var i,o,_;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),_=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),_=i.__d),_)return i.__E=i}catch(c){e=c}throw e}},Ze=0,E.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof e=="function"&&(e=e(w({},n),this.props)),e&&w(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),de(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),de(this))},E.prototype.render=C,R=[],Qe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pe=function(e,t){return e.__v.__b-t.__v.__b},ee.__r=0,Xe=0;var N,m,le,Ue,T=0,pt=[],Y=[],Ae=a.__b,Me=a.__r,je=a.diffed,Te=a.__c,Le=a.unmount;function U(e,t){a.__h&&a.__h(m,e,T||t),T=0;var n=m.__H||(m.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Y}),n.__[e]}function ie(e){return T=1,ge(gt,e)}function ge(e,t,n){var r=U(N++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):gt(void 0,t),function(c){var s=r.__N?r.__N[0]:r.__[0],p=r.t(s,c);s!==p&&(r.__N=[p,r.__[1]],r.__c.setState({}))}],r.__c=m,!m.u)){var i=function(c,s,p){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(f){return f.__c});if(u.every(function(f){return!f.__N}))return!o||o.call(this,c,s,p);var h=!1;return u.forEach(function(f){if(f.__N){var l=f.__[0];f.__=f.__N,f.__N=void 0,l!==f.__[0]&&(h=!0)}}),!(!h&&r.__c.props===c)&&(!o||o.call(this,c,s,p))};m.u=!0;var o=m.shouldComponentUpdate,_=m.componentWillUpdate;m.componentWillUpdate=function(c,s,p){if(this.__e){var u=o;o=void 0,i(c,s,p),o=u}_&&_.call(this,c,s,p)},m.shouldComponentUpdate=i}return r.__N||r.__}function ue(e,t){var n=U(N++,3);!a.__s&&ke(n.__H,t)&&(n.__=e,n.i=t,m.__H.__h.push(n))}function B(e,t){var n=U(N++,4);!a.__s&&ke(n.__H,t)&&(n.__=e,n.i=t,m.__h.push(n))}function dt(e){return T=5,_e(function(){return{current:e}},[])}function ht(e,t,n){T=6,B(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function _e(e,t){var n=U(N++,7);return ke(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function mt(e,t){return T=8,_e(function(){return e},t)}function vt(e){var t=m.context[e.__c],n=U(N++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(m)),t.props.value):e.__}function be(e,t){a.useDebugValue&&a.useDebugValue(t?t(e):e)}function nn(e){var t=U(N++,10),n=ie();return t.__=e,m.componentDidCatch||(m.componentDidCatch=function(r,i){t.__&&t.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function yt(){var e=U(N++,11);if(!e.__){for(var t=m.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function rn(){for(var e;e=pt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Z),e.__H.__h.forEach(he),e.__H.__h=[]}catch(t){e.__H.__h=[],a.__e(t,e.__v)}}a.__b=function(e){m=null,Ae&&Ae(e)},a.__r=function(e){Me&&Me(e),N=0;var t=(m=e.__c).__H;t&&(le===m?(t.__h=[],m.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Y,n.__N=n.i=void 0})):(t.__h.forEach(Z),t.__h.forEach(he),t.__h=[],N=0)),le=m},a.diffed=function(e){je&&je(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(pt.push(t)!==1&&Ue===a.requestAnimationFrame||((Ue=a.requestAnimationFrame)||on)(rn)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Y&&(n.__=n.__V),n.i=void 0,n.__V=Y})),le=m=null},a.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Z),n.__h=n.__h.filter(function(r){return!r.__||he(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],a.__e(r,n.__v)}}),Te&&Te(e,t)},a.unmount=function(e){Le&&Le(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Z(r)}catch(i){t=i}}),n.__H=void 0,t&&a.__e(t,n.__v))};var He=typeof requestAnimationFrame=="function";function on(e){var t,n=function(){clearTimeout(r),He&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);He&&(t=requestAnimationFrame(n))}function Z(e){var t=m,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),m=t}function he(e){var t=m;e.__c=e.__(),m=t}function ke(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function gt(e,t){return typeof t=="function"?t(e):t}function v(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function O(e){return function t(n){return arguments.length===0||v(n)?t:e.apply(this,arguments)}}function D(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return v(n)?t:O(function(i){return e(n,i)});default:return v(n)&&v(r)?t:v(n)?O(function(i){return e(i,r)}):v(r)?O(function(i){return e(n,i)}):e(n,r)}}}function bt(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return v(n)?t:D(function(o,_){return e(n,o,_)});case 2:return v(n)&&v(r)?t:v(n)?D(function(o,_){return e(o,r,_)}):v(r)?D(function(o,_){return e(n,o,_)}):O(function(o){return e(n,r,o)});default:return v(n)&&v(r)&&v(i)?t:v(n)&&v(r)?D(function(o,_){return e(o,_,i)}):v(n)&&v(i)?D(function(o,_){return e(o,r,_)}):v(r)&&v(i)?D(function(o,_){return e(n,o,_)}):v(n)?O(function(o){return e(o,r,i)}):v(r)?O(function(o){return e(n,o,i)}):v(i)?O(function(o){return e(n,r,o)}):e(n,r,i)}}}function J(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Ie(e){return Object.prototype.toString.call(e)==="[object Object]"}var kt=O(function(t){return t==null}),un=O(function(t){return!kt(t)});const xe=un;var _n=bt(function(t,n,r){var i={},o;n=n||{},r=r||{};for(o in n)J(o,n)&&(i[o]=J(o,r)?t(o,n[o],r[o]):n[o]);for(o in r)J(o,r)&&!J(o,i)&&(i[o]=r[o]);return i}),cn=bt(function e(t,n,r){return _n(function(i,o,_){return Ie(o)&&Ie(_)?e(t,o,_):t(i,o,_)},n,r)}),sn=D(function(t,n){return cn(function(r,i,o){return o},t,n)});const ln=sn,We=e=>{let t;const n=new Set,r=(s,p)=>{const u=typeof s=="function"?s(t):s;if(!Object.is(u,t)){const h=t;t=p??typeof u!="object"?u:Object.assign({},t,u),n.forEach(f=>f(t,h))}},i=()=>t,c={setState:r,getState:i,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,c),c},an=e=>e?We(e):We;function xt(e,t){for(var n in t)e[n]=t[n];return e}function me(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function ae(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function ne(e){this.props=e}function Et(e,t){function n(i){var o=this.props.ref,_=o==i.ref;return!_&&o&&(o.call?o(null):o.current=null),t?!t(this.props,i)||!_:me(this.props,i)}function r(i){return this.shouldComponentUpdate=n,S(e,i)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(ne.prototype=new E).isPureReactComponent=!0,ne.prototype.shouldComponentUpdate=function(e,t){return me(this.props,e)||me(this.state,t)};var Fe=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Fe&&Fe(e)};var fn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function St(e){function t(n){var r=xt({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=fn,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Ve=function(e,t){return e==null?null:P(P(e).map(t))},Ct={map:Ve,forEach:Ve,count:function(e){return e?P(e).length:0},only:function(e){var t=P(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:P},pn=a.__e;a.__e=function(e,t,n,r){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}pn(e,t,n,r)};var Be=a.unmount;function $t(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=xt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return $t(r,t,n)})),e}function wt(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return wt(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function W(){this.__u=0,this.t=null,this.__b=null}function Ot(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Pt(e){var t,n,r;function i(o){if(t||(t=e()).then(function(_){n=_.default||_},function(_){r=_}),r)throw r;if(!n)throw t;return S(n,o)}return i.displayName="Lazy",i.__f=!0,i}function A(){this.u=null,this.o=null}a.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Be&&Be(e)},(W.prototype=new E).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var i=Ot(r.__v),o=!1,_=function(){o||(o=!0,n.__R=null,i?i(c):c())};n.__R=_;var c=function(){if(!--r.__u){if(r.state.__a){var p=r.state.__a;r.__v.__k[0]=wt(p,p.__c.__P,p.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.t.pop();)u.forceUpdate()}},s=t.__h===!0;r.__u++||s||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(_,_)},W.prototype.componentWillUnmount=function(){this.t=[]},W.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=$t(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&S(C,null,e.fallback);return i&&(i.__h=null),[S(C,null,t.__a?null:e.children),i]};var ze=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function dn(e){return this.getChildContext=function(){return e.context},e.children}function hn(e){var t=this,n=e.i;t.componentWillUnmount=function(){j(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),j(S(dn,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Nt(e,t){var n=S(hn,{__v:e,i:t});return n.containerInfo=t,n}(A.prototype=new E).__a=function(e){var t=this,n=Ot(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),ze(t,e,r)):i()};n?n(o):o()}},A.prototype.render=function(e){this.u=null,this.o=new Map;var t=P(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},A.prototype.componentDidUpdate=A.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){ze(e,n,t)})};var Dt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,mn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,vn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,yn=/[A-Z0-9]/g,gn=typeof document<"u",bn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Rt(e,t,n){return t.__k==null&&(t.textContent=""),j(e,t),typeof n=="function"&&n(),e?e.__c:null}function Ut(e,t,n){return at(e,t),typeof n=="function"&&n(),e?e.__c:null}E.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(E.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var qe=a.event;function kn(){}function xn(){return this.cancelBubble}function En(){return this.defaultPrevented}a.event=function(e){return qe&&(e=qe(e)),e.persist=kn,e.isPropagationStopped=xn,e.isDefaultPrevented=En,e.nativeEvent=e};var Ee,Sn={enumerable:!1,configurable:!0,get:function(){return this.class}},Ke=a.vnode;a.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,i={};for(var o in n){var _=n[o];if(!(o==="value"&&"defaultValue"in n&&_==null||gn&&o==="children"&&r==="noscript"||o==="class"||o==="className")){var c=o.toLowerCase();o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&_===!0?_="":c==="ondoubleclick"?o="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||bn(n.type)?c==="onfocus"?o="onfocusin":c==="onblur"?o="onfocusout":vn.test(o)?o=c:r.indexOf("-")===-1&&mn.test(o)?o=o.replace(yn,"-$&").toLowerCase():_===null&&(_=void 0):c=o="oninput",c==="oninput"&&i[o=c]&&(o="oninputCapture"),i[o]=_}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=P(n.children).forEach(function(s){s.props.selected=i.value.indexOf(s.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=P(n.children).forEach(function(s){s.props.selected=i.multiple?i.defaultValue.indexOf(s.props.value)!=-1:i.defaultValue==s.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",Sn)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),t.props=i}(e),e.$$typeof=Dt,Ke&&Ke(e)};var Je=a.__r;a.__r=function(e){Je&&Je(e),Ee=e.__c};var Ge=a.diffed;a.diffed=function(e){Ge&&Ge(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Ee=null};var At={ReactCurrentDispatcher:{current:{readContext:function(e){return Ee.__n[e.__c].props.value}}}},Cn="17.0.2";function Mt(e){return S.bind(null,e)}function Se(e){return!!e&&e.$$typeof===Dt}function jt(e){return Se(e)?tn.apply(null,arguments):e}function Tt(e){return!!e.__k&&(j(null,e),!0)}function Lt(e){return e&&(e.base||e.nodeType===1&&e)||null}var Ht=function(e,t){return e(t)},It=function(e,t){return e(t)},Wt=C;function Ce(e){e()}function Ft(e){return e}function Vt(){return[!1,Ce]}var Bt=B;function zt(e,t){var n=t(),r=ie({h:{__:n,v:t}}),i=r[0].h,o=r[1];return B(function(){i.__=n,i.v=t,ae(i.__,t())||o({h:i})},[e,n,t]),ue(function(){return ae(i.__,i.v())||o({h:i}),e(function(){ae(i.__,i.v())||o({h:i})})},[e]),n}var $n={useState:ie,useId:yt,useReducer:ge,useEffect:ue,useLayoutEffect:B,useInsertionEffect:Bt,useTransition:Vt,useDeferredValue:Ft,useSyncExternalStore:zt,startTransition:Ce,useRef:dt,useImperativeHandle:ht,useMemo:_e,useCallback:mt,useContext:vt,useDebugValue:be,version:"17.0.2",Children:Ct,render:Rt,hydrate:Ut,unmountComponentAtNode:Tt,createPortal:Nt,createElement:S,createContext:ft,createFactory:Mt,cloneElement:jt,createRef:nt,Fragment:C,isValidElement:Se,findDOMNode:Lt,Component:E,PureComponent:ne,memo:Et,forwardRef:St,flushSync:It,unstable_batchedUpdates:Ht,StrictMode:Wt,Suspense:W,SuspenseList:A,lazy:Pt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:At};const wn=Object.freeze(Object.defineProperty({__proto__:null,Children:Ct,Component:E,Fragment:C,PureComponent:ne,StrictMode:Wt,Suspense:W,SuspenseList:A,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:At,cloneElement:jt,createContext:ft,createElement:S,createFactory:Mt,createPortal:Nt,createRef:nt,default:$n,findDOMNode:Lt,flushSync:It,forwardRef:St,hydrate:Ut,isValidElement:Se,lazy:Pt,memo:Et,render:Rt,startTransition:Ce,unmountComponentAtNode:Tt,unstable_batchedUpdates:Ht,useCallback:mt,useContext:vt,useDebugValue:be,useDeferredValue:Ft,useEffect:ue,useErrorBoundary:nn,useId:yt,useImperativeHandle:ht,useInsertionEffect:Bt,useLayoutEffect:B,useMemo:_e,useReducer:ge,useRef:dt,useState:ie,useSyncExternalStore:zt,useTransition:Vt,version:Cn},Symbol.toStringTag,{value:"Module"}));function On(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var qt={exports:{}},Kt={};const Jt=Pn(wn);var Gt={exports:{}},Yt={};/**
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const _ of o.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&r(_)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var V,a,Ze,R,Oe,Qe,pe,Xe,X={},et=[],Zt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,oe=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function tt(e){var t=e.parentNode;t&&t.removeChild(e)}function S(e,t,n){var r,i,o,_={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:_[o]=t[o];if(arguments.length>2&&(_.children=arguments.length>3?V.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)_[o]===void 0&&(_[o]=e.defaultProps[o]);return I(e,_,r,i,null)}function I(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++Ze};return i==null&&a.vnode!=null&&a.vnode(o),o}function nt(){return{current:null}}function C(e){return e.children}function E(e,t){this.props=e,this.context=t}function F(e,t){if(t==null)return e.__?F(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?F(e):null}function rt(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return rt(e)}}function de(e){(!e.__d&&(e.__d=!0)&&R.push(e)&&!ee.__r++||Oe!==a.debounceRendering)&&((Oe=a.debounceRendering)||Qe)(ee)}function ee(){var e,t,n,r,i,o,_,c;for(R.sort(pe);e=R.shift();)e.__d&&(t=R.length,r=void 0,i=void 0,_=(o=(n=e).__v).__e,(c=n.__P)&&(r=[],(i=w({},o)).__v=o.__v+1,ye(c,o,i,n.__n,c.ownerSVGElement!==void 0,o.__h!=null?[_]:null,r,_??F(o),o.__h),ct(r,o),o.__e!=_&&rt(o)),R.length>t&&R.sort(pe));ee.__r=0}function ot(e,t,n,r,i,o,_,c,l,p){var u,h,f,s,d,$,g,b=r&&r.__k||et,x=b.length;for(n.__k=[],u=0;u<t.length;u++)if((s=n.__k[u]=(s=t[u])==null||typeof s=="boolean"||typeof s=="function"?null:typeof s=="string"||typeof s=="number"||typeof s=="bigint"?I(null,s,null,null,s):oe(s)?I(C,{children:s},null,null,null):s.__b>0?I(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null){if(s.__=n,s.__b=n.__b+1,(f=b[u])===null||f&&s.key==f.key&&s.type===f.type)b[u]=void 0;else for(h=0;h<x;h++){if((f=b[h])&&s.key==f.key&&s.type===f.type){b[h]=void 0;break}f=null}ye(e,s,f=f||X,i,o,_,c,l,p),d=s.__e,(h=s.ref)&&f.ref!=h&&(g||(g=[]),f.ref&&g.push(f.ref,null,s),g.push(h,s.__c||d,s)),d!=null?($==null&&($=d),typeof s.type=="function"&&s.__k===f.__k?s.__d=l=it(s,l,e):l=ut(e,s,f,b,d,l),typeof n.type=="function"&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=F(f))}for(n.__e=$,u=x;u--;)b[u]!=null&&(typeof n.type=="function"&&b[u].__e!=null&&b[u].__e==n.__d&&(n.__d=_t(r).nextSibling),st(b[u],b[u]));if(g)for(u=0;u<g.length;u++)lt(g[u],g[++u],g[++u])}function it(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t=typeof r.type=="function"?it(r,t,n):ut(n,r,r,i,r.__e,t));return t}function O(e,t){return t=t||[],e==null||typeof e=="boolean"||(oe(e)?e.some(function(n){O(n,t)}):t.push(e)),t}function ut(e,t,n,r,i,o){var _,c,l;if(t.__d!==void 0)_=t.__d,t.__d=void 0;else if(n==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(i),_=null;else{for(c=o,l=0;(c=c.nextSibling)&&l<r.length;l+=1)if(c==i)break e;e.insertBefore(i,o),_=o}return _!==void 0?_:i.nextSibling}function _t(e){var t,n,r;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=_t(n)))return r}return null}function Qt(e,t,n,r,i){var o;for(o in n)o==="children"||o==="key"||o in t||te(e,o,null,n[o],r);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||n[o]===t[o]||te(e,o,t[o],n[o],r)}function Pe(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Zt.test(t)?n:n+"px"}function te(e,t,n,r,i){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Pe(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Pe(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?Re:De,o):e.removeEventListener(t,o?Re:De,o);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function De(e){return this.l[e.type+!1](a.event?a.event(e):e)}function Re(e){return this.l[e.type+!0](a.event?a.event(e):e)}function ye(e,t,n,r,i,o,_,c,l){var p,u,h,f,s,d,$,g,b,x,z,H,Ne,q,le,k=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(l=n.__h,c=t.__e=n.__e,t.__h=null,o=[c]),(p=a.__b)&&p(t);try{e:if(typeof k=="function"){if(g=t.props,b=(p=k.contextType)&&r[p.__c],x=p?b?b.props.value:p.__:r,n.__c?$=(u=t.__c=n.__c).__=u.__E:("prototype"in k&&k.prototype.render?t.__c=u=new k(g,x):(t.__c=u=new E(g,x),u.constructor=k,u.render=en),b&&b.sub(u),u.props=g,u.state||(u.state={}),u.context=x,u.__n=r,h=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),k.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=w({},u.__s)),w(u.__s,k.getDerivedStateFromProps(g,u.__s))),f=u.props,s=u.state,u.__v=t,h)k.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(k.getDerivedStateFromProps==null&&g!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(g,x),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(g,u.__s,x)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(K){K&&(K.__=t)}),z=0;z<u._sb.length;z++)u.__h.push(u._sb[z]);u._sb=[],u.__h.length&&_.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(g,u.__s,x),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,s,d)})}if(u.context=x,u.props=g,u.__P=e,H=a.__r,Ne=0,"prototype"in k&&k.prototype.render){for(u.state=u.__s,u.__d=!1,H&&H(t),p=u.render(u.props,u.state,u.context),q=0;q<u._sb.length;q++)u.__h.push(u._sb[q]);u._sb=[]}else do u.__d=!1,H&&H(t),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++Ne<25);u.state=u.__s,u.getChildContext!=null&&(r=w(w({},r),u.getChildContext())),h||u.getSnapshotBeforeUpdate==null||(d=u.getSnapshotBeforeUpdate(f,s)),ot(e,oe(le=p!=null&&p.type===C&&p.key==null?p.props.children:p)?le:[le],t,n,r,i,o,_,c,l),u.base=t.__e,t.__h=null,u.__h.length&&_.push(u),$&&(u.__E=u.__=null),u.__e=!1}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Xt(n.__e,t,n,r,i,o,_,l);(p=a.diffed)&&p(t)}catch(K){t.__v=null,(l||o!=null)&&(t.__e=c,t.__h=!!l,o[o.indexOf(c)]=null),a.__e(K,t,n)}}function ct(e,t){a.__c&&a.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){a.__e(r,n.__v)}})}function Xt(e,t,n,r,i,o,_,c){var l,p,u,h=n.props,f=t.props,s=t.type,d=0;if(s==="svg"&&(i=!0),o!=null){for(;d<o.length;d++)if((l=o[d])&&"setAttribute"in l==!!s&&(s?l.localName===s:l.nodeType===3)){e=l,o[d]=null;break}}if(e==null){if(s===null)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s,f.is&&f),o=null,c=!1}if(s===null)h===f||c&&e.data===f||(e.data=f);else{if(o=o&&V.call(e.childNodes),p=(h=n.props||X).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!c){if(o!=null)for(h={},d=0;d<e.attributes.length;d++)h[e.attributes[d].name]=e.attributes[d].value;(u||p)&&(u&&(p&&u.__html==p.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(Qt(e,f,h,i,c),u)t.__k=[];else if(ot(e,oe(d=t.props.children)?d:[d],t,n,r,i&&s!=="foreignObject",o,_,o?o[0]:n.__k&&F(n,0),c),o!=null)for(d=o.length;d--;)o[d]!=null&&tt(o[d]);c||("value"in f&&(d=f.value)!==void 0&&(d!==e.value||s==="progress"&&!d||s==="option"&&d!==h.value)&&te(e,"value",d,h.value,!1),"checked"in f&&(d=f.checked)!==void 0&&d!==e.checked&&te(e,"checked",d,h.checked,!1))}return e}function lt(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){a.__e(r,n)}}function st(e,t,n){var r,i;if(a.unmount&&a.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||lt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){a.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&st(r[i],t,n||typeof e.type!="function");n||e.__e==null||tt(e.__e),e.__=e.__e=e.__d=void 0}function en(e,t,n){return this.constructor(e,n)}function j(e,t,n){var r,i,o;a.__&&a.__(e,t),i=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],ye(t,e=(!r&&n||t).__k=S(C,null,[e]),i||X,X,t.ownerSVGElement!==void 0,!r&&n?[n]:i?null:t.firstChild?V.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),ct(o,e)}function at(e,t){j(e,t,at)}function tn(e,t,n){var r,i,o,_,c=w({},e.props);for(o in e.type&&e.type.defaultProps&&(_=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?i=t[o]:c[o]=t[o]===void 0&&_!==void 0?_[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?V.call(arguments,2):n),I(e.type,c,r||e.key,i||e.ref,null)}function ft(e,t){var n={__c:t="__cC"+Xe++,__:e,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(_){this.props.value!==_.value&&i.some(function(c){c.__e=!0,de(c)})},this.sub=function(_){i.push(_);var c=_.componentWillUnmount;_.componentWillUnmount=function(){i.splice(i.indexOf(_),1),c&&c.call(_)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}V=et.slice,a={__e:function(e,t,n,r){for(var i,o,_;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),_=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),_=i.__d),_)return i.__E=i}catch(c){e=c}throw e}},Ze=0,E.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof e=="function"&&(e=e(w({},n),this.props)),e&&w(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),de(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),de(this))},E.prototype.render=C,R=[],Qe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pe=function(e,t){return e.__v.__b-t.__v.__b},ee.__r=0,Xe=0;var P,m,se,Ue,T=0,pt=[],Y=[],Ae=a.__b,Me=a.__r,je=a.diffed,Te=a.__c,Le=a.unmount;function U(e,t){a.__h&&a.__h(m,e,T||t),T=0;var n=m.__H||(m.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Y}),n.__[e]}function ie(e){return T=1,ge(gt,e)}function ge(e,t,n){var r=U(P++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):gt(void 0,t),function(c){var l=r.__N?r.__N[0]:r.__[0],p=r.t(l,c);l!==p&&(r.__N=[p,r.__[1]],r.__c.setState({}))}],r.__c=m,!m.u)){var i=function(c,l,p){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(f){return f.__c});if(u.every(function(f){return!f.__N}))return!o||o.call(this,c,l,p);var h=!1;return u.forEach(function(f){if(f.__N){var s=f.__[0];f.__=f.__N,f.__N=void 0,s!==f.__[0]&&(h=!0)}}),!(!h&&r.__c.props===c)&&(!o||o.call(this,c,l,p))};m.u=!0;var o=m.shouldComponentUpdate,_=m.componentWillUpdate;m.componentWillUpdate=function(c,l,p){if(this.__e){var u=o;o=void 0,i(c,l,p),o=u}_&&_.call(this,c,l,p)},m.shouldComponentUpdate=i}return r.__N||r.__}function ue(e,t){var n=U(P++,3);!a.__s&&ke(n.__H,t)&&(n.__=e,n.i=t,m.__H.__h.push(n))}function B(e,t){var n=U(P++,4);!a.__s&&ke(n.__H,t)&&(n.__=e,n.i=t,m.__h.push(n))}function dt(e){return T=5,_e(function(){return{current:e}},[])}function ht(e,t,n){T=6,B(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function _e(e,t){var n=U(P++,7);return ke(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function mt(e,t){return T=8,_e(function(){return e},t)}function vt(e){var t=m.context[e.__c],n=U(P++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(m)),t.props.value):e.__}function be(e,t){a.useDebugValue&&a.useDebugValue(t?t(e):e)}function nn(e){var t=U(P++,10),n=ie();return t.__=e,m.componentDidCatch||(m.componentDidCatch=function(r,i){t.__&&t.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function yt(){var e=U(P++,11);if(!e.__){for(var t=m.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function rn(){for(var e;e=pt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Z),e.__H.__h.forEach(he),e.__H.__h=[]}catch(t){e.__H.__h=[],a.__e(t,e.__v)}}a.__b=function(e){m=null,Ae&&Ae(e)},a.__r=function(e){Me&&Me(e),P=0;var t=(m=e.__c).__H;t&&(se===m?(t.__h=[],m.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Y,n.__N=n.i=void 0})):(t.__h.forEach(Z),t.__h.forEach(he),t.__h=[],P=0)),se=m},a.diffed=function(e){je&&je(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(pt.push(t)!==1&&Ue===a.requestAnimationFrame||((Ue=a.requestAnimationFrame)||on)(rn)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Y&&(n.__=n.__V),n.i=void 0,n.__V=Y})),se=m=null},a.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Z),n.__h=n.__h.filter(function(r){return!r.__||he(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],a.__e(r,n.__v)}}),Te&&Te(e,t)},a.unmount=function(e){Le&&Le(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Z(r)}catch(i){t=i}}),n.__H=void 0,t&&a.__e(t,n.__v))};var He=typeof requestAnimationFrame=="function";function on(e){var t,n=function(){clearTimeout(r),He&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);He&&(t=requestAnimationFrame(n))}function Z(e){var t=m,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),m=t}function he(e){var t=m;e.__c=e.__(),m=t}function ke(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function gt(e,t){return typeof t=="function"?t(e):t}/*! js-cookie v3.0.5 | MIT */function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var un={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function me(e,t){function n(i,o,_){if(!(typeof document>"u")){_=J({},t,_),typeof _.expires=="number"&&(_.expires=new Date(Date.now()+_.expires*864e5)),_.expires&&(_.expires=_.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var l in _)_[l]&&(c+="; "+l,_[l]!==!0&&(c+="="+_[l].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+c}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],_={},c=0;c<o.length;c++){var l=o[c].split("="),p=l.slice(1).join("=");try{var u=decodeURIComponent(l[0]);if(_[u]=e.read(p,u),i===u)break}catch{}}return i?_[i]:_}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",J({},o,{expires:-1}))},withAttributes:function(i){return me(this.converter,J({},this.attributes,i))},withConverter:function(i){return me(J({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Q=me(un,{path:"/"});function v(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function N(e){return function t(n){return arguments.length===0||v(n)?t:e.apply(this,arguments)}}function D(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return v(n)?t:N(function(i){return e(n,i)});default:return v(n)&&v(r)?t:v(n)?N(function(i){return e(i,r)}):v(r)?N(function(i){return e(n,i)}):e(n,r)}}}function bt(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return v(n)?t:D(function(o,_){return e(n,o,_)});case 2:return v(n)&&v(r)?t:v(n)?D(function(o,_){return e(o,r,_)}):v(r)?D(function(o,_){return e(n,o,_)}):N(function(o){return e(n,r,o)});default:return v(n)&&v(r)&&v(i)?t:v(n)&&v(r)?D(function(o,_){return e(o,_,i)}):v(n)&&v(i)?D(function(o,_){return e(o,r,_)}):v(r)&&v(i)?D(function(o,_){return e(n,o,_)}):v(n)?N(function(o){return e(o,r,i)}):v(r)?N(function(o){return e(n,o,i)}):v(i)?N(function(o){return e(n,r,o)}):e(n,r,i)}}}function G(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Ie(e){return Object.prototype.toString.call(e)==="[object Object]"}var kt=N(function(t){return t==null}),_n=N(function(t){return!kt(t)});const xe=_n;var cn=bt(function(t,n,r){var i={},o;n=n||{},r=r||{};for(o in n)G(o,n)&&(i[o]=G(o,r)?t(o,n[o],r[o]):n[o]);for(o in r)G(o,r)&&!G(o,i)&&(i[o]=r[o]);return i}),ln=bt(function e(t,n,r){return cn(function(i,o,_){return Ie(o)&&Ie(_)?e(t,o,_):t(i,o,_)},n,r)}),sn=D(function(t,n){return ln(function(r,i,o){return o},t,n)});const an=sn,We=e=>{let t;const n=new Set,r=(l,p)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const h=t;t=p??typeof u!="object"?u:Object.assign({},t,u),n.forEach(f=>f(t,h))}},i=()=>t,c={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,c),c},fn=e=>e?We(e):We;function xt(e,t){for(var n in t)e[n]=t[n];return e}function ve(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function ae(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function ne(e){this.props=e}function Et(e,t){function n(i){var o=this.props.ref,_=o==i.ref;return!_&&o&&(o.call?o(null):o.current=null),t?!t(this.props,i)||!_:ve(this.props,i)}function r(i){return this.shouldComponentUpdate=n,S(e,i)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(ne.prototype=new E).isPureReactComponent=!0,ne.prototype.shouldComponentUpdate=function(e,t){return ve(this.props,e)||ve(this.state,t)};var Fe=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Fe&&Fe(e)};var pn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function St(e){function t(n){var r=xt({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=pn,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Ve=function(e,t){return e==null?null:O(O(e).map(t))},Ct={map:Ve,forEach:Ve,count:function(e){return e?O(e).length:0},only:function(e){var t=O(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:O},dn=a.__e;a.__e=function(e,t,n,r){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}dn(e,t,n,r)};var Be=a.unmount;function $t(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=xt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return $t(r,t,n)})),e}function wt(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return wt(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function W(){this.__u=0,this.t=null,this.__b=null}function Nt(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ot(e){var t,n,r;function i(o){if(t||(t=e()).then(function(_){n=_.default||_},function(_){r=_}),r)throw r;if(!n)throw t;return S(n,o)}return i.displayName="Lazy",i.__f=!0,i}function A(){this.u=null,this.o=null}a.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Be&&Be(e)},(W.prototype=new E).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var i=Nt(r.__v),o=!1,_=function(){o||(o=!0,n.__R=null,i?i(c):c())};n.__R=_;var c=function(){if(!--r.__u){if(r.state.__a){var p=r.state.__a;r.__v.__k[0]=wt(p,p.__c.__P,p.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.t.pop();)u.forceUpdate()}},l=t.__h===!0;r.__u++||l||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(_,_)},W.prototype.componentWillUnmount=function(){this.t=[]},W.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=$t(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&S(C,null,e.fallback);return i&&(i.__h=null),[S(C,null,t.__a?null:e.children),i]};var ze=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function hn(e){return this.getChildContext=function(){return e.context},e.children}function mn(e){var t=this,n=e.i;t.componentWillUnmount=function(){j(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),j(S(hn,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Pt(e,t){var n=S(mn,{__v:e,i:t});return n.containerInfo=t,n}(A.prototype=new E).__a=function(e){var t=this,n=Nt(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),ze(t,e,r)):i()};n?n(o):o()}},A.prototype.render=function(e){this.u=null,this.o=new Map;var t=O(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},A.prototype.componentDidUpdate=A.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){ze(e,n,t)})};var Dt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,vn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,yn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,gn=/[A-Z0-9]/g,bn=typeof document<"u",kn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Rt(e,t,n){return t.__k==null&&(t.textContent=""),j(e,t),typeof n=="function"&&n(),e?e.__c:null}function Ut(e,t,n){return at(e,t),typeof n=="function"&&n(),e?e.__c:null}E.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(E.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var qe=a.event;function xn(){}function En(){return this.cancelBubble}function Sn(){return this.defaultPrevented}a.event=function(e){return qe&&(e=qe(e)),e.persist=xn,e.isPropagationStopped=En,e.isDefaultPrevented=Sn,e.nativeEvent=e};var Ee,Cn={enumerable:!1,configurable:!0,get:function(){return this.class}},Ke=a.vnode;a.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,i={};for(var o in n){var _=n[o];if(!(o==="value"&&"defaultValue"in n&&_==null||bn&&o==="children"&&r==="noscript"||o==="class"||o==="className")){var c=o.toLowerCase();o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&_===!0?_="":c==="ondoubleclick"?o="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||kn(n.type)?c==="onfocus"?o="onfocusin":c==="onblur"?o="onfocusout":yn.test(o)?o=c:r.indexOf("-")===-1&&vn.test(o)?o=o.replace(gn,"-$&").toLowerCase():_===null&&(_=void 0):c=o="oninput",c==="oninput"&&i[o=c]&&(o="oninputCapture"),i[o]=_}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=O(n.children).forEach(function(l){l.props.selected=i.value.indexOf(l.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=O(n.children).forEach(function(l){l.props.selected=i.multiple?i.defaultValue.indexOf(l.props.value)!=-1:i.defaultValue==l.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",Cn)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),t.props=i}(e),e.$$typeof=Dt,Ke&&Ke(e)};var Je=a.__r;a.__r=function(e){Je&&Je(e),Ee=e.__c};var Ge=a.diffed;a.diffed=function(e){Ge&&Ge(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Ee=null};var At={ReactCurrentDispatcher:{current:{readContext:function(e){return Ee.__n[e.__c].props.value}}}},$n="17.0.2";function Mt(e){return S.bind(null,e)}function Se(e){return!!e&&e.$$typeof===Dt}function jt(e){return Se(e)?tn.apply(null,arguments):e}function Tt(e){return!!e.__k&&(j(null,e),!0)}function Lt(e){return e&&(e.base||e.nodeType===1&&e)||null}var Ht=function(e,t){return e(t)},It=function(e,t){return e(t)},Wt=C;function Ce(e){e()}function Ft(e){return e}function Vt(){return[!1,Ce]}var Bt=B;function zt(e,t){var n=t(),r=ie({h:{__:n,v:t}}),i=r[0].h,o=r[1];return B(function(){i.__=n,i.v=t,ae(i.__,t())||o({h:i})},[e,n,t]),ue(function(){return ae(i.__,i.v())||o({h:i}),e(function(){ae(i.__,i.v())||o({h:i})})},[e]),n}var wn={useState:ie,useId:yt,useReducer:ge,useEffect:ue,useLayoutEffect:B,useInsertionEffect:Bt,useTransition:Vt,useDeferredValue:Ft,useSyncExternalStore:zt,startTransition:Ce,useRef:dt,useImperativeHandle:ht,useMemo:_e,useCallback:mt,useContext:vt,useDebugValue:be,version:"17.0.2",Children:Ct,render:Rt,hydrate:Ut,unmountComponentAtNode:Tt,createPortal:Pt,createElement:S,createContext:ft,createFactory:Mt,cloneElement:jt,createRef:nt,Fragment:C,isValidElement:Se,findDOMNode:Lt,Component:E,PureComponent:ne,memo:Et,forwardRef:St,flushSync:It,unstable_batchedUpdates:Ht,StrictMode:Wt,Suspense:W,SuspenseList:A,lazy:Ot,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:At};const Nn=Object.freeze(Object.defineProperty({__proto__:null,Children:Ct,Component:E,Fragment:C,PureComponent:ne,StrictMode:Wt,Suspense:W,SuspenseList:A,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:At,cloneElement:jt,createContext:ft,createElement:S,createFactory:Mt,createPortal:Pt,createRef:nt,default:wn,findDOMNode:Lt,flushSync:It,forwardRef:St,hydrate:Ut,isValidElement:Se,lazy:Ot,memo:Et,render:Rt,startTransition:Ce,unmountComponentAtNode:Tt,unstable_batchedUpdates:Ht,useCallback:mt,useContext:vt,useDebugValue:be,useDeferredValue:Ft,useEffect:ue,useErrorBoundary:nn,useId:yt,useImperativeHandle:ht,useInsertionEffect:Bt,useLayoutEffect:B,useMemo:_e,useReducer:ge,useRef:dt,useState:ie,useSyncExternalStore:zt,useTransition:Vt,version:$n},Symbol.toStringTag,{value:"Module"}));function On(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var qt={exports:{}},Kt={};const Jt=Pn(Nn);var Gt={exports:{}},Yt={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var L=Jt;function Nn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dn=typeof Object.is=="function"?Object.is:Nn,Rn=L.useState,Un=L.useEffect,An=L.useLayoutEffect,Mn=L.useDebugValue;function jn(e,t){var n=t(),r=Rn({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return An(function(){i.value=n,i.getSnapshot=t,fe(i)&&o({inst:i})},[e,n,t]),Un(function(){return fe(i)&&o({inst:i}),e(function(){fe(i)&&o({inst:i})})},[e]),Mn(n),n}function fe(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dn(e,n)}catch{return!0}}function Tn(e,t){return t()}var Ln=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Tn:jn;Yt.useSyncExternalStore=L.useSyncExternalStore!==void 0?L.useSyncExternalStore:Ln;Gt.exports=Yt;var Hn=Gt.exports;/**
9
+ */var L=Jt;function Dn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Rn=typeof Object.is=="function"?Object.is:Dn,Un=L.useState,An=L.useEffect,Mn=L.useLayoutEffect,jn=L.useDebugValue;function Tn(e,t){var n=t(),r=Un({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Mn(function(){i.value=n,i.getSnapshot=t,fe(i)&&o({inst:i})},[e,n,t]),An(function(){return fe(i)&&o({inst:i}),e(function(){fe(i)&&o({inst:i})})},[e]),jn(n),n}function fe(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Rn(e,n)}catch{return!0}}function Ln(e,t){return t()}var Hn=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ln:Tn;Yt.useSyncExternalStore=L.useSyncExternalStore!==void 0?L.useSyncExternalStore:Hn;Gt.exports=Yt;var In=Gt.exports;/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim/with-selector.production.min.js
12
12
  *
@@ -14,4 +14,4 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ce=Jt,In=Hn;function Wn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fn=typeof Object.is=="function"?Object.is:Wn,Vn=In.useSyncExternalStore,Bn=ce.useRef,zn=ce.useEffect,qn=ce.useMemo,Kn=ce.useDebugValue;Kt.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Bn(null);if(o.current===null){var _={hasValue:!1,value:null};o.current=_}else _=o.current;o=qn(function(){function s(l){if(!p){if(p=!0,u=l,l=r(l),i!==void 0&&_.hasValue){var d=_.value;if(i(d,l))return h=d}return h=l}if(d=h,Fn(u,l))return d;var $=r(l);return i!==void 0&&i(d,$)?d:(u=l,h=$)}var p=!1,u,h,f=n===void 0?null:n;return[function(){return s(t())},f===null?void 0:function(){return s(f())}]},[t,n,r,i]);var c=Vn(e,o[0],o[1]);return zn(function(){_.hasValue=!0,_.value=c},[c]),Kn(c),c};qt.exports=Kt;var Jn=qt.exports;const Gn=On(Jn),{useSyncExternalStoreWithSelector:Yn}=Gn;function Zn(e,t=e.getState,n){const r=Yn(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return be(r),r}const Ye=e=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?an(e):e,n=(r,i)=>Zn(t,r,i);return Object.assign(n,t),n},Qn=e=>e?Ye(e):Ye,Xn={name:"leckerli",banner:{title:"This website uses cookies.",description:'We use cookies to improve your browsing experience, deliver personalised advertising or content and analyse our traffic. By clicking on "Accept all", you consent to our use of cookies.',accept:"Accept all",reject:"Deny",customise:"Customize"},permissions:[{slug:"settings",title:"Preferences",description:"Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in."}],baseData:{},cookie:{},choiceMade:!1,settingsOpen:!1};/*! js-cookie v3.0.5 | MIT */function G(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var er={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ve(e,t){function n(i,o,_){if(!(typeof document>"u")){_=G({},t,_),typeof _.expires=="number"&&(_.expires=new Date(Date.now()+_.expires*864e5)),_.expires&&(_.expires=_.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var s in _)_[s]&&(c+="; "+s,_[s]!==!0&&(c+="="+_[s].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+c}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],_={},c=0;c<o.length;c++){var s=o[c].split("="),p=s.slice(1).join("=");try{var u=decodeURIComponent(s[0]);if(_[u]=e.read(p,u),i===u)break}catch{}}return i?_[i]:_}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",G({},o,{expires:-1}))},withAttributes:function(i){return ve(this.converter,G({},this.attributes,i))},withConverter:function(i){return ve(G({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Q=ve(er,{path:"/"});const M=ln(Xn,window.leckerliSettings??{}),re=Q.get(M.name);M.cookie=xe(re)?JSON.parse(re):M.permissions.reduce((e,t)=>({...e,[t.slug]:!1}),M.baseData);M.choiceMade=xe(re);const $e=Qn((e,t)=>({...M,init:()=>{kt(re)&&t().choiceMade&&Q.set(t().name,JSON.stringify(t().cookie)),document.addEventListener("leckerli:open-banner",()=>t().setChoice(!1)),document.addEventListener("leckerli:close-banner",()=>t().setChoice(!0)),document.addEventListener("leckerli:open-modal",()=>t().setModal(!0)),document.addEventListener("leckerli:close-modal",()=>t().setModal(!1))},setChoice:n=>e(r=>({...r,choiceMade:n})),setModal:n=>e(r=>(document.dispatchEvent(new CustomEvent(`leckerli:modal-${n?"opened":"closed"}`)),{...r,settingsOpen:n})),setPermissions:(n,r)=>e(i=>{const o=Array.isArray(n)?n:[n],_=i.permissions.reduce((c,s)=>(o.includes(s.slug)?c[s.slug]=r:c[s.slug]=i.cookie[s.slug]??!1,c),i.baseData);return Q.set(i.name,JSON.stringify(_)),document.dispatchEvent(new CustomEvent("leckerli:permissions-updated")),{...i,choiceMade:!0,cookie:_}}),togglePermission:n=>e(r=>{const i=r.permissions.reduce((o,_)=>(n===_.slug?o[_.slug]=xe(r.cookie[_.slug])?!r.cookie[_.slug]:!0:o[_.slug]=r.cookie[_.slug]??!1,o),r.baseData);return Q.set(r.name,JSON.stringify(i)),document.dispatchEvent(new CustomEvent("leckerli:permissions-updated")),{...r,choiceMade:!0,cookie:i}}),acceptAll:()=>{t().setPermissions(t().permissions.map(n=>n.slug),!0)},rejectAll:()=>{t().setPermissions(t().permissions.map(n=>n.slug),!1)}}));var tr=0;function y(e,t,n,r,i,o){var _,c,s={};for(c in t)c=="ref"?_=t[c]:s[c]=t[c];var p={type:e,props:s,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--tr,__source:i,__self:o};if(typeof e=="function"&&(_=e.defaultProps))for(c in _)s[c]===void 0&&(s[c]=_[c]);return a.vnode&&a.vnode(p),p}const nr=()=>{const{banner:e,acceptAll:t,rejectAll:n,setModal:r}=$e();return y("div",{class:"fixed z-[9998] bottom-0 left-0 max-w-md bg-background m-2 px-5 py-4 space-y-4 font-primary text-foreground rounded-md",children:[y("h3",{class:"m-0 font-primary font-semibold text-lg md:text-xl",children:e.title}),y("p",{class:"m-0 leading-snug font-primary text-sm md:text-base",children:e.description}),y("div",{class:"pt-2 space-y-2",children:[y("button",{type:"button",class:"rounded mr-2 bg-background font-primary font-semibold text-primary px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors",onClick:()=>r(!0),children:e.customise}),y("button",{type:"button",class:"rounded mr-2 bg-background font-primary font-semibold text-primary px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors",onClick:n,children:e.reject}),y("button",{type:"button",class:"rounded mr-2 bg-primary font-primary font-semibold text-background px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:bg-primary-hover hover:border-primary-hover active:bg-primary-active active:border-primary-active transition-colors",onClick:t,children:e.accept})]})]})},rr=()=>{const{permissions:e,cookie:t,togglePermission:n,banner:r,setModal:i}=$e();return y("div",{class:"fixed z-[9999] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md bg-background text-foreground m-2 px-5 py-4 font-primary text-black rounded-md max-h-full",children:[y("div",{class:"space-y-6",children:[y("h3",{class:"w-10/12 m-0 font-primary font-semibold text-xl md:text-2xl",children:r.customise}),e.map(({slug:o,title:_,description:c})=>y("div",{children:[y("div",{class:"flex items-start justify-between",children:[y("h3",{class:"m-0 font-primary font-semibold text-lg",children:_}),y("button",{type:"button",class:`${t[o]?"bg-primary":"bg-gray-200"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 mt-0.5`,role:"switch","aria-checked":"false",onClick:()=>n(o),children:[y("span",{class:"sr-only",children:"Toggle"}),y("span",{"aria-hidden":"true",class:`${t[o]?"translate-x-5":"translate-x-0"} pointer-events-none inline-block h-5 w-5 transform rounded-full bg-background shadow ring-0 transition duration-200 ease-in-out`})]})]}),y("p",{class:"m-0 mt-2 leading-snug font-primary text-sm md:text-base",children:c})]},`setting-${o}`))]}),y("button",{class:"absolute top-0 right-0 w-8 h-8 mt-0 text-xl rounded-full",onClick:()=>i(!1),children:"×"})]})},or=()=>{const{choiceMade:e,init:t,settingsOpen:n}=$e();return ue(()=>{t()},[]),y(C,{children:[!e&&!n&&y(nr,{}),n&&y(rr,{})]})};const we=document.createElement("div");we.id="lkrl-wrapper";document.body.appendChild(we);j(y(or,{}),we);
17
+ */var ce=Jt,Wn=In;function Fn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vn=typeof Object.is=="function"?Object.is:Fn,Bn=Wn.useSyncExternalStore,zn=ce.useRef,qn=ce.useEffect,Kn=ce.useMemo,Jn=ce.useDebugValue;Kt.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=zn(null);if(o.current===null){var _={hasValue:!1,value:null};o.current=_}else _=o.current;o=Kn(function(){function l(s){if(!p){if(p=!0,u=s,s=r(s),i!==void 0&&_.hasValue){var d=_.value;if(i(d,s))return h=d}return h=s}if(d=h,Vn(u,s))return d;var $=r(s);return i!==void 0&&i(d,$)?d:(u=s,h=$)}var p=!1,u,h,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var c=Bn(e,o[0],o[1]);return qn(function(){_.hasValue=!0,_.value=c},[c]),Jn(c),c};qt.exports=Kt;var Gn=qt.exports;const Yn=On(Gn),{useSyncExternalStoreWithSelector:Zn}=Yn;function Qn(e,t=e.getState,n){const r=Zn(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return be(r),r}const Ye=e=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?fn(e):e,n=(r,i)=>Qn(t,r,i);return Object.assign(n,t),n},Xn=e=>e?Ye(e):Ye,er={name:"leckerli",banner:{title:"This website uses cookies.",description:'We use cookies to improve your browsing experience, deliver personalised advertising or content and analyse our traffic. By clicking on "Accept all", you consent to our use of cookies.',accept:"Accept all",reject:"Deny",customise:"Customize"},permissions:[{slug:"settings",title:"Preferences",description:"Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in."}],baseData:{},cookie:{},choiceMade:!1,settingsOpen:!1},M=an(er,window.leckerliSettings??{}),re=Q.get(M.name);M.cookie=xe(re)?JSON.parse(re):M.permissions.reduce((e,t)=>({...e,[t.slug]:!1}),M.baseData);M.choiceMade=xe(re);const $e=Xn((e,t)=>({...M,init:()=>{kt(re)&&t().choiceMade&&Q.set(t().name,JSON.stringify(t().cookie)),document.dispatchEvent(new CustomEvent("leckerli:initialised",{detail:{cookie:t().choiceMade?t().cookie:null}})),document.addEventListener("leckerli:open-banner",()=>t().setChoice(!1)),document.addEventListener("leckerli:close-banner",()=>t().setChoice(!0)),document.addEventListener("leckerli:open-modal",()=>t().setModal(!0)),document.addEventListener("leckerli:close-modal",()=>t().setModal(!1))},setChoice:n=>e(r=>({...r,choiceMade:n})),setModal:n=>e(r=>(document.dispatchEvent(new CustomEvent(`leckerli:modal-${n?"opened":"closed"}`)),{...r,settingsOpen:n})),setPermissions:(n,r)=>e(i=>{const o=Array.isArray(n)?n:[n],_=i.permissions.reduce((c,l)=>(o.includes(l.slug)?c[l.slug]=r:c[l.slug]=i.cookie[l.slug]??!1,c),i.baseData);return Q.set(i.name,JSON.stringify(_)),document.dispatchEvent(new CustomEvent("leckerli:permissions-updated",{detail:{cookie:_}})),{...i,choiceMade:!0,cookie:_}}),togglePermission:n=>e(r=>{const i=r.permissions.reduce((o,_)=>(n===_.slug?o[_.slug]=xe(r.cookie[_.slug])?!r.cookie[_.slug]:!0:o[_.slug]=r.cookie[_.slug]??!1,o),r.baseData);return Q.set(r.name,JSON.stringify(i)),document.dispatchEvent(new CustomEvent("leckerli:permissions-updated",{detail:{cookie:i}})),{...r,choiceMade:!0,cookie:i}}),acceptAll:()=>{t().setPermissions(t().permissions.map(n=>n.slug),!0)},rejectAll:()=>{t().setPermissions(t().permissions.map(n=>n.slug),!1)}}));var tr=0;function y(e,t,n,r,i,o){var _,c,l={};for(c in t)c=="ref"?_=t[c]:l[c]=t[c];var p={type:e,props:l,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--tr,__source:i,__self:o};if(typeof e=="function"&&(_=e.defaultProps))for(c in _)l[c]===void 0&&(l[c]=_[c]);return a.vnode&&a.vnode(p),p}const nr=()=>{const{banner:e,acceptAll:t,rejectAll:n,setModal:r}=$e();return y("div",{className:"fixed bottom-0 left-0 max-w-md px-5 py-4 m-2 z-[9998] bg-background space-y-4 font-primary text-foreground rounded-md",children:[y("h3",{className:"m-0 text-lg font-semibold font-primary md:text-xl",children:e.title}),y("p",{className:"m-0 text-sm leading-snug font-primary md:text-base",children:e.description}),y("div",{className:"pt-2 space-y-2",children:[y("button",{type:"button",className:"px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-background font-primary text-primary md:px-3.5 py-1.5 md:py-2.5 border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors",onClick:()=>r(!0),children:e.customise}),y("button",{type:"button",className:"px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-background font-primary text-primary md:px-3.5 py-1.5 md:py-2.5 border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors",onClick:n,children:e.reject}),y("button",{type:"button",className:"px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-primary font-primary text-background md:px-3.5 py-1.5 md:py-2.5 border-primary hover:bg-primary-hover hover:border-primary-hover active:bg-primary-active active:border-primary-active transition-colors",onClick:t,children:e.accept})]})]})},rr=()=>{const{permissions:e,cookie:t,togglePermission:n,banner:r,setModal:i}=$e();return y("div",{className:"fixed w-full max-w-md max-h-full px-5 py-4 m-2 text-black z-[9999] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-background text-foreground font-primary rounded-md",children:[y("div",{className:"space-y-6",children:[y("h3",{className:"w-10/12 m-0 text-xl font-semibold font-primary md:text-2xl",children:r.customise}),e.map(({slug:o,title:_,description:c})=>y("div",{children:[y("div",{className:"flex items-start justify-between",children:[y("h3",{className:"m-0 text-lg font-semibold font-primary",children:_}),y("button",{type:"button",className:`${t[o]?"bg-primary":"bg-gray-200"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 mt-0.5`,role:"switch","aria-checked":"false",onClick:()=>n(o),children:[y("span",{className:"sr-only",children:"Toggle"}),y("span",{"aria-hidden":"true",className:`${t[o]?"translate-x-5":"translate-x-0"} pointer-events-none inline-block h-5 w-5 transform rounded-full bg-background shadow ring-0 transition duration-200 ease-in-out`})]})]}),y("p",{className:"m-0 mt-2 text-sm leading-snug font-primary md:text-base",children:c})]},`setting-${o}`))]}),y("button",{type:"button",className:"absolute top-0 right-0 w-8 h-8 mt-0 text-xl rounded-full",onClick:()=>i(!1),children:"×"})]})},or=()=>{const{choiceMade:e,init:t,settingsOpen:n}=$e();return ue(()=>{t()},[]),y(C,{children:[!e&&!n&&y(nr,{}),n&&y(rr,{})]})};const we=document.createElement("div");we.id="lkrl-wrapper";document.body.appendChild(we);j(y(or,{}),we);
package/dist/index.html CHANGED
@@ -11,40 +11,30 @@
11
11
  <h1>Your website here 🤗</h1>
12
12
 
13
13
 
14
-
14
+
15
15
 
16
16
  <script>
17
- window.leckerliSettings.banner = {
18
- baseData: {
19
- consentid: 'b638a4a9-a846-475a-a29b-d2bb596cb735',
20
- },
21
- banner: {
22
- title: 'Nous respectons votre vie privée.',
23
- description: 'Nous utilisons des cookies pour améliorer votre expérience de navigation, diffuser des publicités ou des contenus personnalisés et analyser notre trafic. En cliquant sur « Tout accepter », vous consentez à notre utilisation des cookies.',
24
- accept: 'Accepter tout',
25
- reject: 'Tout rejeter',
26
- customise: 'Personnaliser',
27
- },
28
- permissions: [
29
- {
30
- slug: 'ga',
31
- title: 'Google analytics',
32
- description: 'To track all your actions.'
33
-
34
- },
35
- {
36
- slug: 'settings',
37
- title: 'Preferences',
38
- description: 'Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in.'
39
-
40
- }
41
- ],
42
- }
43
- */
44
-
45
- document.addEventListener('leckerli:modal-closed', () => console.log('modal closed'))
46
- document.addEventListener('leckerli:modal-opened', () => console.log('modal opened'))
47
- document.addEventListener('leckerli:permissions-updated', () => console.log('permissions updated'))
17
+ // To listen the initialisation
18
+ document.addEventListener('leckerli:initialised', (event) => {
19
+ // to get cookie data OR null if the user's choice has not been made
20
+ console.log('init', event.detail.cookie);
21
+ });
22
+
23
+ // To listen to the permissions / cookie's updates
24
+ document.addEventListener('leckerli:permissions-updated', (event) => {
25
+ // to get cookie data
26
+ console.log('update', event.detail.cookie);
27
+ });
28
+
29
+ // To listen the modal states
30
+ document.addEventListener('leckerli:modal-opened', () => {
31
+ // react to modal opened
32
+ console.log('modal opened')
33
+ });
34
+ document.addEventListener('leckerli:modal-closed', () => {
35
+ // react to modal closed
36
+ console.log('modal closed')
37
+ });
48
38
  </script>
49
39
 
50
40
  <style>
package/index.html CHANGED
@@ -9,45 +9,9 @@
9
9
  <h1>Your website here 🤗</h1>
10
10
 
11
11
 
12
- <!-- <script defer type="module" src="/src/index.tsx"></script>-->
12
+ <script defer type="module" src="/src/index.tsx"></script>
13
13
 
14
14
  <script>
15
- window.leckerliSettings = {};
16
-
17
- window.leckerliSettings.banner = {
18
- title: 'Nous respectons votre vie privée.',
19
- description: 'Nous utilisons des cookies pour améliorer votre expérience de navigation, diffuser des publicités ou des contenus personnalisés et analyser notre trafic. En cliquant sur « Tout accepter », vous consentez à notre utilisation des cookies.',
20
- accept: 'Accepter tout',
21
- reject: 'Tout rejeter',
22
- customise: 'Personnaliser',
23
- };
24
- </script>
25
-
26
- <script>
27
- window.leckerliSettings.permissions = [
28
- {
29
- slug: 'ga',
30
- title: 'Google analytics',
31
- description: 'To track all your actions.'
32
-
33
- },
34
- {
35
- slug: 'settings',
36
- title: 'Preferences',
37
- description: 'Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in.'
38
-
39
- }
40
- ];
41
-
42
- const leckerliScript = document.createElement('script');
43
- leckerliScript.src = '//www.unpkg.com/@antistatique/leckerli/dist/assets/leckerli.min.js';
44
- document.body.appendChild(leckerliScript);
45
-
46
- const leckerliStyles = document.createElement('link');
47
- leckerliStyles.rel = 'stylesheet';
48
- leckerliStyles.href = '//www.unpkg.com/@antistatique/leckerli/dist/assets/leckerli.min.css';
49
- document.head.appendChild(leckerliStyles);
50
-
51
15
  // To listen the initialisation
52
16
  document.addEventListener('leckerli:initialised', (event) => {
53
17
  // to get cookie data OR null if the user's choice has not been made
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antistatique/leckerli",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Lightweight and customisable GDPR cookie consent manager",
5
5
  "private": false,
6
6
  "repository": "https://github.com/antistatique/leckerli",
@@ -10,7 +10,12 @@
10
10
  "scripts": {
11
11
  "dev": "vite",
12
12
  "build": "tsc && vite build",
13
- "preview": "vite preview"
13
+ "preview": "vite preview",
14
+ "prepublishOnly": "yarn run build && pinst --disable",
15
+ "lint:js": "eslint --ext js,jsx,ts,tsx ./ --max-warnings=0",
16
+ "fix:js": "eslint --ext js,jsx,ts,tsx ./ --max-warnings=0 --fix",
17
+ "_postinstall": "husky install",
18
+ "postpublish": "pinst --enable"
14
19
  },
15
20
  "dependencies": {
16
21
  "@types/ramda": "^0.29.2",
@@ -22,11 +27,31 @@
22
27
  "devDependencies": {
23
28
  "@preact/preset-vite": "^2.5.0",
24
29
  "@types/js-cookie": "^3.0.3",
30
+ "@typescript-eslint/eslint-plugin": "^5.60.1",
31
+ "@typescript-eslint/parser": "^5.60.1",
25
32
  "autoprefixer": "^10.4.14",
33
+ "babel-eslint": "^10.1.0",
34
+ "eslint": "^8.43.0",
35
+ "eslint-config-airbnb": "^19.0.4",
36
+ "eslint-config-airbnb-typescript": "^17.0.0",
37
+ "eslint-config-prettier": "^8.8.0",
38
+ "eslint-import-resolver-typescript": "^3.5.5",
39
+ "eslint-plugin-html": "^7.1.0",
40
+ "eslint-plugin-import": "^2.27.5",
41
+ "eslint-plugin-jsx-a11y": "^6.7.1",
42
+ "eslint-plugin-prettier": "^4.2.1",
43
+ "eslint-plugin-react": "^7.32.2",
44
+ "eslint-plugin-react-hooks": "^4.6.0",
45
+ "eslint-plugin-simple-import-sort": "^10.0.0",
46
+ "eslint-plugin-tailwind": "^0.2.1",
47
+ "husky": "^8.0.3",
48
+ "lint-staged": "^13.2.3",
49
+ "pinst": "^3.0.0",
26
50
  "postcss": "^8.4.24",
27
51
  "postcss-prefixwrap": "^1.39.1",
52
+ "prettier": "^2.8.8",
28
53
  "tailwindcss": "^3.3.2",
29
- "typescript": "^5.0.2",
54
+ "typescript": "^5.1.5",
30
55
  "vite": "^4.3.9"
31
56
  }
32
- }
57
+ }
@@ -1,11 +1,12 @@
1
1
  import { useEffect } from 'preact/hooks';
2
2
 
3
+ import useSettings from '../hooks/useSettings';
4
+
3
5
  import Banner from './Banner';
4
6
  import Settings from './Settings';
5
- import useSettings from '../hooks/useSettings';
6
7
 
7
8
  const App = () => {
8
- const { choiceMade, init, settingsOpen } = useSettings();
9
+ const { choiceMade, init, settingsOpen } = useSettings();
9
10
 
10
11
  useEffect(() => {
11
12
  init();
@@ -13,10 +14,10 @@ const App = () => {
13
14
 
14
15
  return (
15
16
  <>
16
- {!choiceMade && !settingsOpen && <Banner/>}
17
- {settingsOpen && <Settings/>}
17
+ {!choiceMade && !settingsOpen && <Banner />}
18
+ {settingsOpen && <Settings />}
18
19
  </>
19
20
  );
20
- }
21
+ };
21
22
 
22
23
  export default App;
@@ -1,36 +1,36 @@
1
1
  import useSettings from '../hooks/useSettings';
2
2
 
3
3
  const Banner = () => {
4
- const { banner, acceptAll, rejectAll, setModal } = useSettings();
4
+ const { banner, acceptAll, rejectAll, setModal } = useSettings();
5
5
 
6
6
  return (
7
- <div class="fixed z-[9998] bottom-0 left-0 max-w-md bg-background m-2 px-5 py-4 space-y-4 font-primary text-foreground rounded-md">
8
- <h3 class="m-0 font-primary font-semibold text-lg md:text-xl">
7
+ <div className="fixed bottom-0 left-0 max-w-md px-5 py-4 m-2 z-[9998] bg-background space-y-4 font-primary text-foreground rounded-md">
8
+ <h3 className="m-0 text-lg font-semibold font-primary md:text-xl">
9
9
  {banner.title}
10
10
  </h3>
11
11
 
12
- <p class="m-0 leading-snug font-primary text-sm md:text-base">
12
+ <p className="m-0 text-sm leading-snug font-primary md:text-base">
13
13
  {banner.description}
14
14
  </p>
15
15
 
16
- <div class="pt-2 space-y-2">
16
+ <div className="pt-2 space-y-2">
17
17
  <button
18
18
  type="button"
19
- class="rounded mr-2 bg-background font-primary font-semibold text-primary px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors"
19
+ className="px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-background font-primary text-primary md:px-3.5 py-1.5 md:py-2.5 border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors"
20
20
  onClick={() => setModal(true)}
21
21
  >
22
22
  {banner.customise}
23
23
  </button>
24
24
  <button
25
25
  type="button"
26
- class="rounded mr-2 bg-background font-primary font-semibold text-primary px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors"
26
+ className="px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-background font-primary text-primary md:px-3.5 py-1.5 md:py-2.5 border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors"
27
27
  onClick={rejectAll}
28
28
  >
29
29
  {banner.reject}
30
30
  </button>
31
31
  <button
32
32
  type="button"
33
- class="rounded mr-2 bg-primary font-primary font-semibold text-background px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:bg-primary-hover hover:border-primary-hover active:bg-primary-active active:border-primary-active transition-colors"
33
+ className="px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-primary font-primary text-background md:px-3.5 py-1.5 md:py-2.5 border-primary hover:bg-primary-hover hover:border-primary-hover active:bg-primary-active active:border-primary-active transition-colors"
34
34
  onClick={acceptAll}
35
35
  >
36
36
  {banner.accept}
@@ -1,47 +1,56 @@
1
1
  import useSettings from '../hooks/useSettings';
2
2
 
3
3
  const Settings = () => {
4
- const { permissions, cookie, togglePermission, banner, setModal } = useSettings();
4
+ const { permissions, cookie, togglePermission, banner, setModal } =
5
+ useSettings();
5
6
 
6
7
  return (
7
- <div class="fixed z-[9999] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md bg-background text-foreground m-2 px-5 py-4 font-primary text-black rounded-md max-h-full">
8
- <div class="space-y-6">
9
- <h3 class="w-10/12 m-0 font-primary font-semibold text-xl md:text-2xl">
10
- {banner.customise}
11
- </h3>
8
+ <div className="fixed w-full max-w-md max-h-full px-5 py-4 m-2 text-black z-[9999] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-background text-foreground font-primary rounded-md">
9
+ <div className="space-y-6">
10
+ <h3 className="w-10/12 m-0 text-xl font-semibold font-primary md:text-2xl">
11
+ {banner.customise}
12
+ </h3>
12
13
 
13
- {permissions.map(({slug, title, description}) => (
14
- <div key={`setting-${slug}`}>
15
- <div class="flex items-start justify-between">
16
- <h3 class="m-0 font-primary font-semibold text-lg">
17
- {title}
18
- </h3>
14
+ {permissions.map(({ slug, title, description }) => (
15
+ <div key={`setting-${slug}`}>
16
+ <div className="flex items-start justify-between">
17
+ <h3 className="m-0 text-lg font-semibold font-primary">
18
+ {title}
19
+ </h3>
19
20
 
20
- <button
21
- type="button"
22
- class={`${cookie[slug] ? 'bg-primary' : 'bg-gray-200'} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 mt-0.5`}
23
- role="switch" aria-checked="false"
24
- onClick={() => togglePermission(slug)}
25
- >
26
- <span class="sr-only">Toggle</span>
27
- <span aria-hidden="true"
28
- class={`${cookie[slug] ? 'translate-x-5' : 'translate-x-0'} pointer-events-none inline-block h-5 w-5 transform rounded-full bg-background shadow ring-0 transition duration-200 ease-in-out`}></span>
29
- </button>
30
- </div>
31
-
32
- <p class="m-0 mt-2 leading-snug font-primary text-sm md:text-base">
33
- {description}
34
- </p>
21
+ <button
22
+ type="button"
23
+ className={`${
24
+ cookie[slug] ? 'bg-primary' : 'bg-gray-200'
25
+ } relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 mt-0.5`}
26
+ role="switch"
27
+ aria-checked="false"
28
+ onClick={() => togglePermission(slug)}
29
+ >
30
+ <span className="sr-only">Toggle</span>
31
+ <span
32
+ aria-hidden="true"
33
+ className={`${
34
+ cookie[slug] ? 'translate-x-5' : 'translate-x-0'
35
+ } pointer-events-none inline-block h-5 w-5 transform rounded-full bg-background shadow ring-0 transition duration-200 ease-in-out`}
36
+ />
37
+ </button>
35
38
  </div>
36
- ))}
37
- </div>
38
- <button
39
- class="absolute top-0 right-0 w-8 h-8 mt-0 text-xl rounded-full"
40
- onClick={() => setModal(false)}
41
- >
42
- &times;
43
- </button>
39
+
40
+ <p className="m-0 mt-2 text-sm leading-snug font-primary md:text-base">
41
+ {description}
42
+ </p>
43
+ </div>
44
+ ))}
44
45
  </div>
46
+ <button
47
+ type="button"
48
+ className="absolute top-0 right-0 w-8 h-8 mt-0 text-xl rounded-full"
49
+ onClick={() => setModal(false)}
50
+ >
51
+ &times;
52
+ </button>
53
+ </div>
45
54
  );
46
55
  };
47
56
 
@@ -1,10 +1,10 @@
1
+ import cookies from 'js-cookie';
1
2
  import { isNil, isNotNil, mergeDeepRight } from 'ramda';
2
- import { create } from 'zustand'
3
+ import { create } from 'zustand';
3
4
 
5
+ import defaultSettings from '../defaultSettings.ts';
6
+ import Cookie from '../types/cookie';
4
7
  import type Settings from '../types/settings';
5
- import Cookie from "../types/cookie";
6
- import defaultSettings from "../defaultSettings.ts";
7
- import cookies from "js-cookie";
8
8
 
9
9
  type SettingsStore = Settings & {
10
10
  choiceMade: boolean;
@@ -31,10 +31,13 @@ const initialCookie = cookies.get(initialState.name);
31
31
  // Set store's cookie value based on existing cookie or settings permissions
32
32
  initialState.cookie = isNotNil(initialCookie)
33
33
  ? JSON.parse(initialCookie)
34
- : initialState.permissions.reduce((acc, val) => ({
35
- ...acc,
36
- [val.slug]: false,
37
- }), initialState.baseData);
34
+ : initialState.permissions.reduce(
35
+ (acc, val) => ({
36
+ ...acc,
37
+ [val.slug]: false,
38
+ }),
39
+ initialState.baseData
40
+ );
38
41
 
39
42
  // With the existing cookie or not, set the choiceMade
40
43
  initialState.choiceMade = isNotNil(initialCookie);
@@ -57,24 +60,34 @@ const useSettings = create<SettingsStore>((set, getState) => ({
57
60
  );
58
61
 
59
62
  // Open banner by resseting choiceMade
60
- document.addEventListener('leckerli:open-banner', () => getState().setChoice(false));
61
- document.addEventListener('leckerli:close-banner', () => getState().setChoice(true));
63
+ document.addEventListener('leckerli:open-banner', () =>
64
+ getState().setChoice(false)
65
+ );
66
+ document.addEventListener('leckerli:close-banner', () =>
67
+ getState().setChoice(true)
68
+ );
62
69
 
63
70
  // Manage modal
64
- document.addEventListener('leckerli:open-modal', () => getState().setModal(true));
65
- document.addEventListener('leckerli:close-modal', () => getState().setModal(false));
71
+ document.addEventListener('leckerli:open-modal', () =>
72
+ getState().setModal(true)
73
+ );
74
+ document.addEventListener('leckerli:close-modal', () =>
75
+ getState().setModal(false)
76
+ );
66
77
  },
67
78
 
68
79
  // Manage banner display
69
- setChoice: (value: boolean) => set(state => {
70
- return { ...state, choiceMade: value };
71
- }),
80
+ setChoice: (value: boolean) =>
81
+ set(state => ({ ...state, choiceMade: value })),
72
82
 
73
83
  // Manage modal display
74
- setModal: (value: boolean) => set(state => {
75
- document.dispatchEvent(new CustomEvent(`leckerli:modal-${value ? 'opened' : 'closed'}`));
76
- return { ...state, settingsOpen: value };
77
- }),
84
+ setModal: (value: boolean) =>
85
+ set(state => {
86
+ document.dispatchEvent(
87
+ new CustomEvent(`leckerli:modal-${value ? 'opened' : 'closed'}`)
88
+ );
89
+ return { ...state, settingsOpen: value };
90
+ }),
78
91
 
79
92
  // Set cookie permission(s)
80
93
  setPermissions: (slugs: string | string[], value: boolean) =>
@@ -83,7 +96,7 @@ const useSettings = create<SettingsStore>((set, getState) => ({
83
96
 
84
97
  const newCookie = state.permissions.reduce((acc, val) => {
85
98
  if (list.includes(val.slug)) {
86
- acc[val.slug] = value;
99
+ acc[val.slug] = value;
87
100
  } else {
88
101
  acc[val.slug] = state.cookie[val.slug] ?? false;
89
102
  }
@@ -107,7 +120,9 @@ const useSettings = create<SettingsStore>((set, getState) => ({
107
120
  set(state => {
108
121
  const newCookie = state.permissions.reduce((acc, val) => {
109
122
  if (slug === val.slug) {
110
- acc[val.slug] = isNotNil(state.cookie[val.slug]) ? !state.cookie[val.slug] : true;
123
+ acc[val.slug] = isNotNil(state.cookie[val.slug])
124
+ ? !state.cookie[val.slug]
125
+ : true;
111
126
  } else {
112
127
  acc[val.slug] = state.cookie[val.slug] ?? false;
113
128
  }
@@ -1,12 +1,13 @@
1
- import defaultSettings from "../defaultSettings.ts";
1
+ import defaultSettings from '../defaultSettings.ts';
2
2
 
3
3
  type Settings = typeof defaultSettings & {
4
- baseData: any,
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ baseData: any;
5
6
  permissions: {
6
7
  slug: string;
7
8
  title: string;
8
9
  description: string;
9
- }[]
10
+ }[];
10
11
  };
11
12
 
12
13
  export default Settings;
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "exclude": [
4
+ "node_modules"
5
+ ]
6
+ }