@sensorario/sg-components 0.0.104 → 0.0.106

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.
Files changed (36) hide show
  1. package/dist/auth/index.d.ts +10 -0
  2. package/dist/components/AuthPage/AuthPage.d.ts +11 -0
  3. package/dist/components/AuthPage/AuthPage.stories.d.ts +8 -0
  4. package/dist/components/Avatar/Avatar.d.ts +10 -0
  5. package/dist/components/Avatar/Avatar.stories.d.ts +8 -0
  6. package/dist/components/Badge/Badge.d.ts +17 -0
  7. package/dist/components/Badge/Badge.stories.d.ts +8 -0
  8. package/dist/components/Button/Button.d.ts +1 -0
  9. package/dist/components/Button/Button.stories.d.ts +1 -0
  10. package/dist/components/Card/Card.d.ts +20 -0
  11. package/dist/components/Card/Card.stories.d.ts +9 -0
  12. package/dist/components/ConfirmModal/ConfirmModal.d.ts +18 -0
  13. package/dist/components/ConfirmModal/ConfirmModal.stories.d.ts +7 -0
  14. package/dist/components/FormField/FormField.d.ts +19 -0
  15. package/dist/components/FormField/FormField.stories.d.ts +6 -0
  16. package/dist/components/LoginPrompt/LoginPrompt.d.ts +13 -0
  17. package/dist/components/LoginPrompt/LoginPrompt.stories.d.ts +8 -0
  18. package/dist/components/PasswordInput/PasswordInput.d.ts +1 -0
  19. package/dist/components/ProgressBar/ProgressBar.d.ts +16 -0
  20. package/dist/components/ProgressBar/ProgressBar.stories.d.ts +10 -0
  21. package/dist/components/RegisterForm/RegisterForm.d.ts +9 -0
  22. package/dist/components/Select/Select.d.ts +7 -0
  23. package/dist/components/StatusMessage/StatusMessage.d.ts +13 -0
  24. package/dist/components/StatusMessage/StatusMessage.stories.d.ts +10 -0
  25. package/dist/components/Table/Table.stories.d.ts +5 -0
  26. package/dist/components/Tabs/Tabs.d.ts +19 -0
  27. package/dist/components/Tabs/Tabs.stories.d.ts +8 -0
  28. package/dist/components/Textarea/Textarea.d.ts +7 -0
  29. package/dist/components/Toggle/Toggle.d.ts +5 -1
  30. package/dist/components/Toggle/Toggle.stories.d.ts +1 -0
  31. package/dist/components/VersionNumber/VersionNumber.d.ts +8 -0
  32. package/dist/components/VersionNumber/VersionNumber.stories.d.ts +5 -0
  33. package/dist/index.d.ts +16 -0
  34. package/dist/index.es.js +717 -354
  35. package/dist/sg-components.css +1 -1
  36. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -1,174 +1,174 @@
1
- import e, { forwardRef as t, useEffect as n, useId as r, useImperativeHandle as i, useRef as a, useState as o } from "react";
2
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
3
- import { setI18n as u, useTranslation as d } from "react-i18next";
4
- import f from "i18next";
1
+ import e, { cloneElement as t, createElement as n, forwardRef as r, isValidElement as i, useEffect as a, useId as o, useImperativeHandle as s, useRef as c, useState as l } from "react";
2
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
3
+ import { setI18n as p, useTranslation as m } from "react-i18next";
4
+ import h from "i18next";
5
5
  //#region src/components/Icon/Icon.tsx
6
- var p = {
7
- menu: /* @__PURE__ */ l(s, { children: [
8
- /* @__PURE__ */ c("line", {
6
+ var g = {
7
+ menu: /* @__PURE__ */ f(u, { children: [
8
+ /* @__PURE__ */ d("line", {
9
9
  x1: "3",
10
10
  y1: "6",
11
11
  x2: "21",
12
12
  y2: "6"
13
13
  }),
14
- /* @__PURE__ */ c("line", {
14
+ /* @__PURE__ */ d("line", {
15
15
  x1: "3",
16
16
  y1: "12",
17
17
  x2: "21",
18
18
  y2: "12"
19
19
  }),
20
- /* @__PURE__ */ c("line", {
20
+ /* @__PURE__ */ d("line", {
21
21
  x1: "3",
22
22
  y1: "18",
23
23
  x2: "21",
24
24
  y2: "18"
25
25
  })
26
26
  ] }),
27
- layout: /* @__PURE__ */ l(s, { children: [
28
- /* @__PURE__ */ c("rect", {
27
+ layout: /* @__PURE__ */ f(u, { children: [
28
+ /* @__PURE__ */ d("rect", {
29
29
  x: "3",
30
30
  y: "3",
31
31
  width: "18",
32
32
  height: "18",
33
33
  rx: "2"
34
34
  }),
35
- /* @__PURE__ */ c("line", {
35
+ /* @__PURE__ */ d("line", {
36
36
  x1: "3",
37
37
  y1: "9",
38
38
  x2: "21",
39
39
  y2: "9"
40
40
  }),
41
- /* @__PURE__ */ c("line", {
41
+ /* @__PURE__ */ d("line", {
42
42
  x1: "9",
43
43
  y1: "9",
44
44
  x2: "9",
45
45
  y2: "21"
46
46
  })
47
47
  ] }),
48
- edit: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("path", { d: "M4 20l1-4L16 5l3 3L8 19l-4 1z" }), /* @__PURE__ */ c("line", {
48
+ edit: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("path", { d: "M4 20l1-4L16 5l3 3L8 19l-4 1z" }), /* @__PURE__ */ d("line", {
49
49
  x1: "14",
50
50
  y1: "7",
51
51
  x2: "17",
52
52
  y2: "10"
53
53
  })] }),
54
- "help-circle": /* @__PURE__ */ l(s, { children: [
55
- /* @__PURE__ */ c("circle", {
54
+ "help-circle": /* @__PURE__ */ f(u, { children: [
55
+ /* @__PURE__ */ d("circle", {
56
56
  cx: "12",
57
57
  cy: "12",
58
58
  r: "9"
59
59
  }),
60
- /* @__PURE__ */ c("path", { d: "M9.5 9a2.5 2.5 0 0 1 5 0c0 2-2.5 2-2.5 4" }),
61
- /* @__PURE__ */ c("line", {
60
+ /* @__PURE__ */ d("path", { d: "M9.5 9a2.5 2.5 0 0 1 5 0c0 2-2.5 2-2.5 4" }),
61
+ /* @__PURE__ */ d("line", {
62
62
  x1: "12",
63
63
  y1: "17",
64
64
  x2: "12",
65
65
  y2: "17.01"
66
66
  })
67
67
  ] }),
68
- check: /* @__PURE__ */ c("polyline", { points: "4 12 9 17 20 6" }),
69
- x: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("line", {
68
+ check: /* @__PURE__ */ d("polyline", { points: "4 12 9 17 20 6" }),
69
+ x: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("line", {
70
70
  x1: "6",
71
71
  y1: "6",
72
72
  x2: "18",
73
73
  y2: "18"
74
- }), /* @__PURE__ */ c("line", {
74
+ }), /* @__PURE__ */ d("line", {
75
75
  x1: "18",
76
76
  y1: "6",
77
77
  x2: "6",
78
78
  y2: "18"
79
79
  })] }),
80
- "file-plus": /* @__PURE__ */ l(s, { children: [
81
- /* @__PURE__ */ c("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
82
- /* @__PURE__ */ c("polyline", { points: "14 3 14 8 19 8" }),
83
- /* @__PURE__ */ c("line", {
80
+ "file-plus": /* @__PURE__ */ f(u, { children: [
81
+ /* @__PURE__ */ d("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
82
+ /* @__PURE__ */ d("polyline", { points: "14 3 14 8 19 8" }),
83
+ /* @__PURE__ */ d("line", {
84
84
  x1: "12",
85
85
  y1: "12",
86
86
  x2: "12",
87
87
  y2: "17"
88
88
  }),
89
- /* @__PURE__ */ c("line", {
89
+ /* @__PURE__ */ d("line", {
90
90
  x1: "9.5",
91
91
  y1: "14.5",
92
92
  x2: "14.5",
93
93
  y2: "14.5"
94
94
  })
95
95
  ] }),
96
- link: /* @__PURE__ */ l(s, { children: [
97
- /* @__PURE__ */ c("path", { d: "M9 15l6-6" }),
98
- /* @__PURE__ */ c("path", { d: "M8 13.5 5.5 16a3 3 0 0 0 4.24 4.24l2.5-2.5" }),
99
- /* @__PURE__ */ c("path", { d: "M16 10.5 18.5 8a3 3 0 0 0-4.24-4.24l-2.5 2.5" })
96
+ link: /* @__PURE__ */ f(u, { children: [
97
+ /* @__PURE__ */ d("path", { d: "M9 15l6-6" }),
98
+ /* @__PURE__ */ d("path", { d: "M8 13.5 5.5 16a3 3 0 0 0 4.24 4.24l2.5-2.5" }),
99
+ /* @__PURE__ */ d("path", { d: "M16 10.5 18.5 8a3 3 0 0 0-4.24-4.24l-2.5 2.5" })
100
100
  ] }),
101
- "share-2": /* @__PURE__ */ l(s, { children: [
102
- /* @__PURE__ */ c("circle", {
101
+ "share-2": /* @__PURE__ */ f(u, { children: [
102
+ /* @__PURE__ */ d("circle", {
103
103
  cx: "6",
104
104
  cy: "12",
105
105
  r: "2.4"
106
106
  }),
107
- /* @__PURE__ */ c("circle", {
107
+ /* @__PURE__ */ d("circle", {
108
108
  cx: "18",
109
109
  cy: "6",
110
110
  r: "2.4"
111
111
  }),
112
- /* @__PURE__ */ c("circle", {
112
+ /* @__PURE__ */ d("circle", {
113
113
  cx: "18",
114
114
  cy: "18",
115
115
  r: "2.4"
116
116
  }),
117
- /* @__PURE__ */ c("line", {
117
+ /* @__PURE__ */ d("line", {
118
118
  x1: "8.2",
119
119
  y1: "10.8",
120
120
  x2: "15.8",
121
121
  y2: "7.2"
122
122
  }),
123
- /* @__PURE__ */ c("line", {
123
+ /* @__PURE__ */ d("line", {
124
124
  x1: "8.2",
125
125
  y1: "13.2",
126
126
  x2: "15.8",
127
127
  y2: "16.8"
128
128
  })
129
129
  ] }),
130
- download: /* @__PURE__ */ l(s, { children: [
131
- /* @__PURE__ */ c("path", { d: "M12 3v12" }),
132
- /* @__PURE__ */ c("polyline", { points: "7 11 12 16 17 11" }),
133
- /* @__PURE__ */ c("path", { d: "M5 19h14" })
130
+ download: /* @__PURE__ */ f(u, { children: [
131
+ /* @__PURE__ */ d("path", { d: "M12 3v12" }),
132
+ /* @__PURE__ */ d("polyline", { points: "7 11 12 16 17 11" }),
133
+ /* @__PURE__ */ d("path", { d: "M5 19h14" })
134
134
  ] }),
135
- book: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("path", { d: "M4 5.5A2.5 2.5 0 0 1 6.5 3H12v18H6.5A2.5 2.5 0 0 1 4 18.5z" }), /* @__PURE__ */ c("path", { d: "M20 5.5A2.5 2.5 0 0 0 17.5 3H12v18h5.5a2.5 2.5 0 0 0 2.5-2.5z" })] }),
136
- printer: /* @__PURE__ */ l(s, { children: [
137
- /* @__PURE__ */ c("path", { d: "M6 9V3h12v6" }),
138
- /* @__PURE__ */ c("rect", {
135
+ book: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("path", { d: "M4 5.5A2.5 2.5 0 0 1 6.5 3H12v18H6.5A2.5 2.5 0 0 1 4 18.5z" }), /* @__PURE__ */ d("path", { d: "M20 5.5A2.5 2.5 0 0 0 17.5 3H12v18h5.5a2.5 2.5 0 0 0 2.5-2.5z" })] }),
136
+ printer: /* @__PURE__ */ f(u, { children: [
137
+ /* @__PURE__ */ d("path", { d: "M6 9V3h12v6" }),
138
+ /* @__PURE__ */ d("rect", {
139
139
  x: "4",
140
140
  y: "9",
141
141
  width: "16",
142
142
  height: "8",
143
143
  rx: "1.5"
144
144
  }),
145
- /* @__PURE__ */ c("path", { d: "M6 17v4h12v-4" })
145
+ /* @__PURE__ */ d("path", { d: "M6 17v4h12v-4" })
146
146
  ] }),
147
- eye: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("path", { d: "M2 12c2.5-5 7-8 10-8s7.5 3 10 8c-2.5 5-7 8-10 8s-7.5-3-10-8z" }), /* @__PURE__ */ c("circle", {
147
+ eye: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("path", { d: "M2 12c2.5-5 7-8 10-8s7.5 3 10 8c-2.5 5-7 8-10 8s-7.5-3-10-8z" }), /* @__PURE__ */ d("circle", {
148
148
  cx: "12",
149
149
  cy: "12",
150
150
  r: "3"
151
151
  })] }),
152
- columns: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("rect", {
152
+ columns: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("rect", {
153
153
  x: "3",
154
154
  y: "4",
155
155
  width: "8",
156
156
  height: "16",
157
157
  rx: "1.5"
158
- }), /* @__PURE__ */ c("rect", {
158
+ }), /* @__PURE__ */ d("rect", {
159
159
  x: "13",
160
160
  y: "4",
161
161
  width: "8",
162
162
  height: "16",
163
163
  rx: "1.5"
164
164
  })] }),
165
- "sidebar-left": /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("rect", {
165
+ "sidebar-left": /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("rect", {
166
166
  x: "3",
167
167
  y: "4",
168
168
  width: "18",
169
169
  height: "16",
170
170
  rx: "2"
171
- }), /* @__PURE__ */ c("rect", {
171
+ }), /* @__PURE__ */ d("rect", {
172
172
  x: "4",
173
173
  y: "5",
174
174
  width: "6",
@@ -177,13 +177,13 @@ var p = {
177
177
  fill: "currentColor",
178
178
  stroke: "none"
179
179
  })] }),
180
- "sidebar-right": /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("rect", {
180
+ "sidebar-right": /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("rect", {
181
181
  x: "3",
182
182
  y: "4",
183
183
  width: "18",
184
184
  height: "16",
185
185
  rx: "2"
186
- }), /* @__PURE__ */ c("rect", {
186
+ }), /* @__PURE__ */ d("rect", {
187
187
  x: "14",
188
188
  y: "5",
189
189
  width: "6",
@@ -192,29 +192,29 @@ var p = {
192
192
  fill: "currentColor",
193
193
  stroke: "none"
194
194
  })] }),
195
- play: /* @__PURE__ */ c("polygon", { points: "5 3 19 12 5 21 5 3" }),
196
- pause: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("rect", {
195
+ play: /* @__PURE__ */ d("polygon", { points: "5 3 19 12 5 21 5 3" }),
196
+ pause: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("rect", {
197
197
  x: "6",
198
198
  y: "4",
199
199
  width: "4",
200
200
  height: "16",
201
201
  rx: "1"
202
- }), /* @__PURE__ */ c("rect", {
202
+ }), /* @__PURE__ */ d("rect", {
203
203
  x: "14",
204
204
  y: "4",
205
205
  width: "4",
206
206
  height: "16",
207
207
  rx: "1"
208
208
  })] }),
209
- "volume-2": /* @__PURE__ */ l(s, { children: [
210
- /* @__PURE__ */ c("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
211
- /* @__PURE__ */ c("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" }),
212
- /* @__PURE__ */ c("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" })
209
+ "volume-2": /* @__PURE__ */ f(u, { children: [
210
+ /* @__PURE__ */ d("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
211
+ /* @__PURE__ */ d("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" }),
212
+ /* @__PURE__ */ d("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" })
213
213
  ] }),
214
- "tech-node": /* @__PURE__ */ c("polygon", { points: "12,3 19.8,7.5 19.8,16.5 12,21 4.2,16.5 4.2,7.5" }),
215
- "tech-go": /* @__PURE__ */ c("polygon", { points: "12,3 21,12 12,21 3,12" }),
216
- "tech-php": /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("path", { d: "M9 4c-1.5 0-2.5 1-2.5 2.5v3c0 1-.5 1.5-1.5 2.5 1 1 1.5 1.5 1.5 2.5v3c0 1.5 1 2.5 2.5 2.5" }), /* @__PURE__ */ c("path", { d: "M15 4c1.5 0 2.5 1 2.5 2.5v3c0 1 .5 1.5 1.5 2.5-1 1-1.5 1.5-1.5 2.5v3c0 1.5-1 2.5-2.5 2.5" })] }),
217
- grid: /* @__PURE__ */ c("g", {
214
+ "tech-node": /* @__PURE__ */ d("polygon", { points: "12,3 19.8,7.5 19.8,16.5 12,21 4.2,16.5 4.2,7.5" }),
215
+ "tech-go": /* @__PURE__ */ d("polygon", { points: "12,3 21,12 12,21 3,12" }),
216
+ "tech-php": /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("path", { d: "M9 4c-1.5 0-2.5 1-2.5 2.5v3c0 1-.5 1.5-1.5 2.5 1 1 1.5 1.5 1.5 2.5v3c0 1.5 1 2.5 2.5 2.5" }), /* @__PURE__ */ d("path", { d: "M15 4c1.5 0 2.5 1 2.5 2.5v3c0 1 .5 1.5 1.5 2.5-1 1-1.5 1.5-1.5 2.5v3c0 1.5-1 2.5-2.5 2.5" })] }),
217
+ grid: /* @__PURE__ */ d("g", {
218
218
  fill: "currentColor",
219
219
  stroke: "none",
220
220
  children: [
@@ -225,20 +225,20 @@ var p = {
225
225
  5,
226
226
  12,
227
227
  19
228
- ].map((t) => /* @__PURE__ */ c("circle", {
228
+ ].map((t) => /* @__PURE__ */ d("circle", {
229
229
  cx: t,
230
230
  cy: e,
231
231
  r: "2"
232
232
  }, `${t}-${e}`)))
233
233
  }),
234
- lock: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("rect", {
234
+ lock: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("rect", {
235
235
  x: "5",
236
236
  y: "11",
237
237
  width: "14",
238
238
  height: "10",
239
239
  rx: "2"
240
- }), /* @__PURE__ */ c("path", { d: "M8 11V7a4 4 0 0 1 8 0v4" })] })
241
- }, m = ({ name: e, size: t = 18, ...n }) => /* @__PURE__ */ c("svg", {
240
+ }), /* @__PURE__ */ d("path", { d: "M8 11V7a4 4 0 0 1 8 0v4" })] })
241
+ }, _ = ({ name: e, size: t = 18, ...n }) => /* @__PURE__ */ d("svg", {
242
242
  className: "sg-icon",
243
243
  width: t,
244
244
  height: t,
@@ -250,50 +250,51 @@ var p = {
250
250
  strokeLinejoin: "round",
251
251
  "aria-hidden": "true",
252
252
  ...n,
253
- children: p[e]
254
- }), h = ({ label: e, icon: t, iconOnly: n, className: r, title: i, ...a }) => /* @__PURE__ */ l("button", {
253
+ children: g[e]
254
+ }), v = ({ label: e, icon: t, iconOnly: n, variant: r = "primary", className: i, title: a, ...o }) => /* @__PURE__ */ f("button", {
255
255
  className: [
256
256
  "custom-button",
257
+ r === "primary" ? "" : `custom-button--${r}`,
257
258
  t ? "custom-button-with-icon" : "",
258
- r
259
+ i
259
260
  ].filter(Boolean).join(" "),
260
- title: i ?? (n ? e : void 0),
261
- ...a,
262
- children: [t && /* @__PURE__ */ c(m, { name: t }), /* @__PURE__ */ c("span", {
261
+ title: a ?? (n ? e : void 0),
262
+ ...o,
263
+ children: [t && /* @__PURE__ */ d(_, { name: t }), /* @__PURE__ */ d("span", {
263
264
  className: n ? "custom-button-label-visually-hidden" : void 0,
264
265
  children: e
265
266
  })]
266
- }), g = ({ copyright: e = "© 2026 My Company", href: t = "#", links: n = [] }) => /* @__PURE__ */ l("footer", {
267
+ }), y = ({ copyright: e = "© 2026 My Company", href: t = "#", links: n = [] }) => /* @__PURE__ */ f("footer", {
267
268
  className: "footer",
268
- children: [/* @__PURE__ */ c("span", { children: /* @__PURE__ */ c("a", {
269
+ children: [/* @__PURE__ */ d("span", { children: /* @__PURE__ */ d("a", {
269
270
  href: t,
270
271
  children: e
271
- }) }), n.length > 0 && /* @__PURE__ */ c("nav", { children: n.map(({ label: e, href: t }) => /* @__PURE__ */ c("a", {
272
+ }) }), n.length > 0 && /* @__PURE__ */ d("nav", { children: n.map(({ label: e, href: t }) => /* @__PURE__ */ d("a", {
272
273
  href: t,
273
274
  style: { marginLeft: "16px" },
274
275
  children: e
275
276
  }, t)) })]
276
- }), _ = "simonegentili.com-cookie-consent", v = 3600 * 24 * 365;
277
- function y() {
278
- return document.cookie.split("; ").some((e) => e.startsWith(`${_}=`));
277
+ }), b = "simonegentili.com-cookie-consent", x = 3600 * 24 * 365;
278
+ function S() {
279
+ return document.cookie.split("; ").some((e) => e.startsWith(`${b}=`));
279
280
  }
280
- function b() {
281
- document.cookie = `${_}=accepted; path=/; domain=.simonegentili.com; max-age=${v}; secure; samesite=strict`;
281
+ function C() {
282
+ document.cookie = `${b}=accepted; path=/; domain=.simonegentili.com; max-age=${x}; secure; samesite=strict`;
282
283
  }
283
- var x = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
284
- let [t, r] = o(!1);
285
- return n(() => {
286
- r(!y());
287
- }, []), t ? /* @__PURE__ */ l("div", {
284
+ var w = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
285
+ let [t, n] = l(!1);
286
+ return a(() => {
287
+ n(!S());
288
+ }, []), t ? /* @__PURE__ */ f("div", {
288
289
  className: "cookie-consent",
289
290
  role: "region",
290
291
  "aria-label": "Informativa sui cookie",
291
- children: [/* @__PURE__ */ l("p", {
292
+ children: [/* @__PURE__ */ f("p", {
292
293
  className: "cookie-consent-text",
293
294
  children: [
294
295
  "Questo sito utilizza esclusivamente cookie tecnici necessari al funzionamento (es. autenticazione). Non sono presenti cookie di profilazione o di terze parti. Per saperne di più consulta la",
295
296
  " ",
296
- /* @__PURE__ */ c("a", {
297
+ /* @__PURE__ */ d("a", {
297
298
  href: e,
298
299
  target: "_blank",
299
300
  rel: "noopener noreferrer",
@@ -301,15 +302,15 @@ var x = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
301
302
  }),
302
303
  "."
303
304
  ]
304
- }), /* @__PURE__ */ c(h, {
305
+ }), /* @__PURE__ */ d(v, {
305
306
  label: "Accetta",
306
307
  onClick: () => {
307
- b(), r(!1);
308
+ C(), n(!1);
308
309
  },
309
310
  className: "cookie-consent-accept"
310
311
  })]
311
312
  }) : null;
312
- }, S = [
313
+ }, T = [
313
314
  {
314
315
  label: "guitar",
315
316
  href: "https://guitar.simonegentili.com"
@@ -330,33 +331,45 @@ var x = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
330
331
  label: "code2image",
331
332
  href: "https://code2image.simonegentili.com"
332
333
  }
333
- ], C = () => /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(g, {
334
+ ], E = () => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(y, {
334
335
  href: "https://simonegentili.com",
335
336
  copyright: "© 2026 simonegentili.com",
336
- links: S
337
- }), /* @__PURE__ */ c(x, {})] }), w = ({ onNavigate: e, title: t = "Simone Gentili - senior web developer, tech author and chess enthusiast", homePageKey: n = "home", children: r, className: i }) => /* @__PURE__ */ c("header", {
337
+ links: T
338
+ }), /* @__PURE__ */ d(w, {})] }), D = ({ onNavigate: e, title: t = "Simone Gentili - senior web developer, tech author and chess enthusiast", homePageKey: n = "home", children: r, className: i }) => /* @__PURE__ */ d("header", {
338
339
  className: i ? `header ${i}` : "header",
339
- children: /* @__PURE__ */ l("div", {
340
+ children: /* @__PURE__ */ f("div", {
340
341
  className: "header-container",
341
- children: [/* @__PURE__ */ c("div", {
342
+ children: [/* @__PURE__ */ d("div", {
342
343
  className: "logo",
343
344
  onClick: () => {
344
345
  e?.(n);
345
346
  },
346
- children: /* @__PURE__ */ c("h1", {
347
+ children: /* @__PURE__ */ d("h1", {
347
348
  className: "logo-text",
348
349
  children: t
349
350
  })
350
- }), r && /* @__PURE__ */ c("div", {
351
+ }), r && /* @__PURE__ */ d("div", {
351
352
  className: "header-actions",
352
353
  children: r
353
354
  })]
354
355
  })
355
- }), T = ({ onNavigate: e }) => /* @__PURE__ */ c(w, {
356
+ }), O = ({ onNavigate: e }) => /* @__PURE__ */ d(D, {
356
357
  onNavigate: e,
357
358
  title: "Simone Gentili - senior web developer, tech author and chess enthusiast",
358
359
  homePageKey: "home"
359
- }), E = {
360
+ }), k = "simonegentili.com-access-token", ee = (e) => document.cookie.split("; ").find((t) => t.startsWith(`${e}=`))?.slice(e.length + 1) || null, te = () => (window.location.hostname.endsWith("simonegentili.com") ? "; domain=.simonegentili.com" : "") + (window.location.protocol === "https:" ? "; secure" : ""), A = (e, t, n, r = "strict") => {
361
+ document.cookie = `${e}=${t}; path=/; max-age=${n}; samesite=${r}${te()}`;
362
+ }, j = (e = k) => ee(e), ne = (e, t = 168 * 3600, n = k) => A(n, e, t), re = (e = k) => {
363
+ A(e, "", 0), document.cookie = `${e}=; path=/; max-age=0`;
364
+ }, M = (e = j(), t = "sub") => {
365
+ if (!e) return null;
366
+ try {
367
+ let n = JSON.parse(atob(e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/")));
368
+ return typeof n[t] == "string" ? n[t] : null;
369
+ } catch {
370
+ return null;
371
+ }
372
+ }, ie = {
360
373
  auth: {
361
374
  login: "Accedi",
362
375
  logout: "Esci",
@@ -387,8 +400,24 @@ var x = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
387
400
  errorEmpty: "Inserisci e conferma la nuova password.",
388
401
  errorMismatch: "Le password non coincidono."
389
402
  },
390
- languageSwitcher: { label: "Lingua" }
391
- }, D = {
403
+ languageSwitcher: { label: "Lingua" },
404
+ status: { loading: "Caricamento…" },
405
+ badge: { remove: "Rimuovi" },
406
+ confirm: {
407
+ confirm: "Conferma",
408
+ cancel: "Annulla"
409
+ },
410
+ version: { label: "Versione" },
411
+ loginPrompt: { message: "Accedi per continuare." },
412
+ register: {
413
+ title: "Registrati",
414
+ email: "Email",
415
+ placeholder: "La tua email",
416
+ submit: "Registrati",
417
+ sending: "Invio…",
418
+ sent: "Controlla la tua email: ti abbiamo inviato un link per completare la registrazione."
419
+ }
420
+ }, ae = {
392
421
  auth: {
393
422
  login: "Log in",
394
423
  logout: "Log out",
@@ -419,8 +448,24 @@ var x = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
419
448
  errorEmpty: "Enter and confirm the new password.",
420
449
  errorMismatch: "The passwords don't match."
421
450
  },
422
- languageSwitcher: { label: "Language" }
423
- }, O = {
451
+ languageSwitcher: { label: "Language" },
452
+ status: { loading: "Loading…" },
453
+ badge: { remove: "Remove" },
454
+ confirm: {
455
+ confirm: "Confirm",
456
+ cancel: "Cancel"
457
+ },
458
+ version: { label: "Version" },
459
+ loginPrompt: { message: "Log in to continue." },
460
+ register: {
461
+ title: "Sign up",
462
+ email: "Email",
463
+ placeholder: "Your email",
464
+ submit: "Sign up",
465
+ sending: "Sending…",
466
+ sent: "Check your email: we sent you a link to complete your registration."
467
+ }
468
+ }, oe = {
424
469
  auth: {
425
470
  login: "Se connecter",
426
471
  logout: "Se déconnecter",
@@ -451,8 +496,24 @@ var x = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
451
496
  errorEmpty: "Saisissez et confirmez le nouveau mot de passe.",
452
497
  errorMismatch: "Les mots de passe ne correspondent pas."
453
498
  },
454
- languageSwitcher: { label: "Langue" }
455
- }, k = {
499
+ languageSwitcher: { label: "Langue" },
500
+ status: { loading: "Chargement…" },
501
+ badge: { remove: "Retirer" },
502
+ confirm: {
503
+ confirm: "Confirmer",
504
+ cancel: "Annuler"
505
+ },
506
+ version: { label: "Version" },
507
+ loginPrompt: { message: "Connectez-vous pour continuer." },
508
+ register: {
509
+ title: "S’inscrire",
510
+ email: "E-mail",
511
+ placeholder: "Votre e-mail",
512
+ submit: "S’inscrire",
513
+ sending: "Envoi…",
514
+ sent: "Consultez votre e-mail : nous vous avons envoyé un lien pour terminer l’inscription."
515
+ }
516
+ }, se = {
456
517
  auth: {
457
518
  login: "Anmelden",
458
519
  logout: "Abmelden",
@@ -483,8 +544,24 @@ var x = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
483
544
  errorEmpty: "Gib das neue Passwort ein und bestätige es.",
484
545
  errorMismatch: "Die Passwörter stimmen nicht überein."
485
546
  },
486
- languageSwitcher: { label: "Sprache" }
487
- }, A = {
547
+ languageSwitcher: { label: "Sprache" },
548
+ status: { loading: "Wird geladen…" },
549
+ badge: { remove: "Entfernen" },
550
+ confirm: {
551
+ confirm: "Bestätigen",
552
+ cancel: "Abbrechen"
553
+ },
554
+ version: { label: "Version" },
555
+ loginPrompt: { message: "Melde dich an, um fortzufahren." },
556
+ register: {
557
+ title: "Registrieren",
558
+ email: "E-Mail",
559
+ placeholder: "Deine E-Mail",
560
+ submit: "Registrieren",
561
+ sending: "Wird gesendet…",
562
+ sent: "Prüfe deine E-Mails: Wir haben dir einen Link zum Abschließen der Registrierung geschickt."
563
+ }
564
+ }, ce = {
488
565
  auth: {
489
566
  login: "Iniciar sesión",
490
567
  logout: "Cerrar sesión",
@@ -515,8 +592,24 @@ var x = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
515
592
  errorEmpty: "Introduce y confirma la nueva contraseña.",
516
593
  errorMismatch: "Las contraseñas no coinciden."
517
594
  },
518
- languageSwitcher: { label: "Idioma" }
519
- }, ee = {
595
+ languageSwitcher: { label: "Idioma" },
596
+ status: { loading: "Cargando…" },
597
+ badge: { remove: "Quitar" },
598
+ confirm: {
599
+ confirm: "Confirmar",
600
+ cancel: "Cancelar"
601
+ },
602
+ version: { label: "Versión" },
603
+ loginPrompt: { message: "Inicia sesión para continuar." },
604
+ register: {
605
+ title: "Registrarse",
606
+ email: "Correo electrónico",
607
+ placeholder: "Tu correo electrónico",
608
+ submit: "Registrarse",
609
+ sending: "Enviando…",
610
+ sent: "Revisa tu correo: te hemos enviado un enlace para completar el registro."
611
+ }
612
+ }, le = {
520
613
  auth: {
521
614
  login: "ログイン",
522
615
  logout: "ログアウト",
@@ -547,84 +640,97 @@ var x = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
547
640
  errorEmpty: "新しいパスワードを入力して確認してください。",
548
641
  errorMismatch: "パスワードが一致しません。"
549
642
  },
550
- languageSwitcher: { label: "言語" }
551
- }, j = [
643
+ languageSwitcher: { label: "言語" },
644
+ status: { loading: "読み込み中…" },
645
+ badge: { remove: "削除" },
646
+ confirm: {
647
+ confirm: "確認",
648
+ cancel: "キャンセル"
649
+ },
650
+ version: { label: "バージョン" },
651
+ loginPrompt: { message: "続行するにはログインしてください。" },
652
+ register: {
653
+ title: "新規登録",
654
+ email: "メールアドレス",
655
+ placeholder: "メールアドレス",
656
+ submit: "登録する",
657
+ sending: "送信中…",
658
+ sent: "メールを確認してください。登録を完了するためのリンクを送信しました。"
659
+ }
660
+ }, N = [
552
661
  "it",
553
662
  "en",
554
663
  "fr",
555
664
  "de",
556
665
  "es",
557
666
  "ja"
558
- ], M = {
667
+ ], P = {
559
668
  it: "Italiano",
560
669
  en: "English",
561
670
  fr: "Français",
562
671
  de: "Deutsch",
563
672
  es: "Español",
564
673
  ja: "日本語"
565
- }, N = "sg-language", P = "it", te = (e) => !!e && j.includes(e), F = () => {
566
- let e = document.cookie.split("; ").find((e) => e.startsWith(`${N}=`))?.slice(12);
567
- return te(e) ? e : null;
568
- }, I = (e) => {
569
- let t = window.location.hostname.endsWith("simonegentili.com") ? "; domain=.simonegentili.com; secure" : "";
570
- document.cookie = `${N}=${e}; path=/; max-age=31536000; samesite=lax${t}`;
571
- }, L = f.createInstance();
572
- L.init({
674
+ }, F = "sg-language", I = "it", ue = (e) => !!e && N.includes(e), L = () => {
675
+ let e = document.cookie.split("; ").find((e) => e.startsWith(`${F}=`))?.slice(12);
676
+ return ue(e) ? e : null;
677
+ }, de = (e) => A(F, e, 31536e3, "lax"), R = h.createInstance();
678
+ R.init({
573
679
  resources: {
574
- it: { sg: E },
575
- en: { sg: D },
576
- fr: { sg: O },
577
- de: { sg: k },
578
- es: { sg: A },
579
- ja: { sg: ee }
680
+ it: { sg: ie },
681
+ en: { sg: ae },
682
+ fr: { sg: oe },
683
+ de: { sg: se },
684
+ es: { sg: ce },
685
+ ja: { sg: le }
580
686
  },
581
- lng: F() ?? P,
582
- fallbackLng: P,
583
- supportedLngs: [...j],
687
+ lng: L() ?? I,
688
+ fallbackLng: I,
689
+ supportedLngs: [...N],
584
690
  ns: ["sg", "translation"],
585
691
  defaultNS: "translation",
586
692
  initAsync: !1,
587
693
  interpolation: { escapeValue: !1 }
588
- }), L.on("languageChanged", I);
589
- var ne = ({ resources: e }) => {
590
- for (let [t, n] of Object.entries(e)) L.addResourceBundle(t, "translation", n, !0, !0);
591
- return u(L), L;
592
- }, R = "https://api.simonegentili.com/heimdall", z = (e) => e.endsWith("/") ? e : `${e}/`, re = (e) => {
593
- let t = z(window.location.origin + window.location.pathname);
594
- return e.filter((e) => t.startsWith(z(e.url))).sort((e, t) => t.url.length - e.url.length)[0] ?? null;
595
- }, B = ({ token: e, heimdallUrl: t = R }) => {
596
- let { t: r } = d("sg", { i18n: L }), [i, a] = o(null), [u, f] = o(!1), [p, m] = o(!1);
597
- n(() => {
598
- e && fetch(`${t}/access`, { headers: { Authorization: `Bearer ${e}` } }).then((e) => e.ok ? e.json() : Promise.reject(e.status)).then((t) => a({
694
+ }), R.on("languageChanged", de);
695
+ var fe = ({ resources: e }) => {
696
+ for (let [t, n] of Object.entries(e)) R.addResourceBundle(t, "translation", n, !0, !0);
697
+ return p(R), R;
698
+ }, z = "https://api.simonegentili.com/heimdall", B = (e) => e.endsWith("/") ? e : `${e}/`, pe = (e) => {
699
+ let t = B(window.location.origin + window.location.pathname);
700
+ return e.filter((e) => t.startsWith(B(e.url))).sort((e, t) => t.url.length - e.url.length)[0] ?? null;
701
+ }, V = ({ token: e, heimdallUrl: t = z }) => {
702
+ let { t: n } = m("sg", { i18n: R }), [r, i] = l(null), [o, s] = l(!1), [c, p] = l(!1);
703
+ a(() => {
704
+ e && fetch(`${t}/access`, { headers: { Authorization: `Bearer ${e}` } }).then((e) => e.ok ? e.json() : Promise.reject(e.status)).then((t) => i({
599
705
  token: e,
600
- app: re(t.apps)
601
- })).catch(() => a({
706
+ app: pe(t.apps)
707
+ })).catch(() => i({
602
708
  token: e,
603
709
  app: null
604
710
  }));
605
711
  }, [e, t]);
606
- let g = i?.token === e ? i.app : null;
607
- return !e || g === null || g.access === "open" || g.access === "approved" ? null : /* @__PURE__ */ c("div", {
712
+ let h = r?.token === e ? r.app : null;
713
+ return !e || h === null || h.access === "open" || h.access === "approved" ? null : /* @__PURE__ */ d("div", {
608
714
  className: "sg-access-gate",
609
715
  role: "dialog",
610
716
  "aria-modal": "true",
611
717
  "aria-labelledby": "sg-access-gate-title",
612
- children: /* @__PURE__ */ l("div", {
718
+ children: /* @__PURE__ */ f("div", {
613
719
  className: "sg-access-gate-card",
614
- children: [/* @__PURE__ */ c("h2", {
720
+ children: [/* @__PURE__ */ d("h2", {
615
721
  id: "sg-access-gate-title",
616
- children: r("accessGate.title", { app: g.name })
617
- }), g.access === "pending" ? /* @__PURE__ */ c("p", { children: r("accessGate.pending") }) : /* @__PURE__ */ l(s, { children: [
618
- /* @__PURE__ */ c("p", { children: g.access === "rejected" ? r("accessGate.rejected") : r("accessGate.none") }),
619
- p && /* @__PURE__ */ c("p", {
722
+ children: n("accessGate.title", { app: h.name })
723
+ }), h.access === "pending" ? /* @__PURE__ */ d("p", { children: n("accessGate.pending") }) : /* @__PURE__ */ f(u, { children: [
724
+ /* @__PURE__ */ d("p", { children: h.access === "rejected" ? n("accessGate.rejected") : n("accessGate.none") }),
725
+ c && /* @__PURE__ */ d("p", {
620
726
  className: "sg-access-gate-error",
621
- children: r("accessGate.failed")
727
+ children: n("accessGate.failed")
622
728
  }),
623
- /* @__PURE__ */ c(h, {
624
- label: r(u ? "accessGate.sending" : "accessGate.request"),
625
- disabled: u,
729
+ /* @__PURE__ */ d(v, {
730
+ label: n(o ? "accessGate.sending" : "accessGate.request"),
731
+ disabled: o,
626
732
  onClick: async () => {
627
- f(!0), m(!1);
733
+ s(!0), p(!1);
628
734
  try {
629
735
  let n = await fetch(`${t}/access-requests`, {
630
736
  method: "POST",
@@ -632,98 +738,98 @@ var ne = ({ resources: e }) => {
632
738
  Authorization: `Bearer ${e}`,
633
739
  "Content-Type": "application/json"
634
740
  },
635
- body: JSON.stringify({ app: g.slug })
741
+ body: JSON.stringify({ app: h.slug })
636
742
  });
637
- n.ok || n.status === 409 ? a({
743
+ n.ok || n.status === 409 ? i({
638
744
  token: e,
639
745
  app: {
640
- ...g,
746
+ ...h,
641
747
  access: "pending"
642
748
  }
643
- }) : m(!0);
749
+ }) : p(!0);
644
750
  } catch {
645
- m(!0);
751
+ p(!0);
646
752
  } finally {
647
- f(!1);
753
+ s(!1);
648
754
  }
649
755
  }
650
756
  })
651
757
  ] })]
652
758
  })
653
759
  });
654
- }, V = "https://api.simonegentili.com/heimdall/launcher", H = ({ appsUrl: e = V, label: t, token: r = null }) => {
655
- let { t: i } = d("sg", { i18n: L }), s = t ?? i("launcher.label"), [u, f] = o(!1), [p, h] = o(null), g = p?.token === r ? p.apps : null, [_, v] = o(!1), y = a(null);
656
- return n(() => {
657
- !u || g !== null || fetch(e, r ? { headers: { Authorization: `Bearer ${r}` } } : void 0).then((e) => e.ok ? e.json() : Promise.reject(e.status)).then((e) => h({
658
- token: r,
760
+ }, H = "https://api.simonegentili.com/heimdall/launcher", U = ({ appsUrl: e = H, label: t, token: n = null }) => {
761
+ let { t: r } = m("sg", { i18n: R }), i = t ?? r("launcher.label"), [o, s] = l(!1), [u, p] = l(null), h = u?.token === n ? u.apps : null, [g, v] = l(!1), y = c(null);
762
+ return a(() => {
763
+ !o || h !== null || fetch(e, n ? { headers: { Authorization: `Bearer ${n}` } } : void 0).then((e) => e.ok ? e.json() : Promise.reject(e.status)).then((e) => p({
764
+ token: n,
659
765
  apps: e.apps
660
766
  })).catch(() => v(!0));
661
767
  }, [
662
- u,
663
- g,
768
+ o,
769
+ h,
664
770
  e,
665
- r
666
- ]), n(() => {
667
- if (!u) return;
771
+ n
772
+ ]), a(() => {
773
+ if (!o) return;
668
774
  let e = (e) => {
669
- y.current?.contains(e.target) || f(!1);
775
+ y.current?.contains(e.target) || s(!1);
670
776
  }, t = (e) => {
671
- e.key === "Escape" && f(!1);
777
+ e.key === "Escape" && s(!1);
672
778
  };
673
779
  return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
674
780
  document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
675
781
  };
676
- }, [u]), /* @__PURE__ */ l("div", {
782
+ }, [o]), /* @__PURE__ */ f("div", {
677
783
  className: "sg-app-launcher",
678
784
  ref: y,
679
- children: [/* @__PURE__ */ c("button", {
785
+ children: [/* @__PURE__ */ d("button", {
680
786
  type: "button",
681
787
  className: "sg-app-launcher-toggle",
682
- "aria-label": s,
683
- title: s,
684
- "aria-expanded": u,
788
+ "aria-label": i,
789
+ title: i,
790
+ "aria-expanded": o,
685
791
  onClick: () => {
686
- u || v(!1), f(!u);
792
+ o || v(!1), s(!o);
687
793
  },
688
- children: /* @__PURE__ */ c(m, {
794
+ children: /* @__PURE__ */ d(_, {
689
795
  name: "grid",
690
796
  size: 22
691
797
  })
692
- }), u && /* @__PURE__ */ c("div", {
798
+ }), o && /* @__PURE__ */ d("div", {
693
799
  className: "sg-app-launcher-panel",
694
- children: _ ? /* @__PURE__ */ c("p", {
800
+ children: g ? /* @__PURE__ */ d("p", {
695
801
  className: "sg-app-launcher-message",
696
- children: i("launcher.loadFailed")
697
- }) : g === null ? /* @__PURE__ */ c("p", {
802
+ children: r("launcher.loadFailed")
803
+ }) : h === null ? /* @__PURE__ */ d("p", {
698
804
  className: "sg-app-launcher-message",
699
- children: i("launcher.loading")
700
- }) : /* @__PURE__ */ c("ul", {
805
+ children: r("launcher.loading")
806
+ }) : /* @__PURE__ */ d("ul", {
701
807
  className: "sg-app-launcher-grid",
702
- children: g.map((e) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ l("a", {
808
+ children: h.map((e) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ f("a", {
703
809
  href: e.url,
704
810
  className: [
705
811
  "sg-app-launcher-app",
706
812
  new URL(e.url).origin === window.location.origin ? "current" : "",
707
813
  e.locked ? "locked" : ""
708
814
  ].filter(Boolean).join(" "),
709
- title: e.locked ? `${e.name}: ${i("launcher.locked")}` : void 0,
710
- children: [/* @__PURE__ */ l("span", {
815
+ title: e.locked ? `${e.name}: ${r("launcher.locked")}` : void 0,
816
+ children: [/* @__PURE__ */ f("span", {
711
817
  className: "sg-app-launcher-tile",
712
818
  "aria-hidden": "true",
713
- children: [e.name.charAt(0).toUpperCase(), e.locked && /* @__PURE__ */ c("span", {
819
+ children: [e.name.charAt(0).toUpperCase(), e.locked && /* @__PURE__ */ d("span", {
714
820
  className: "sg-app-launcher-lock",
715
- children: /* @__PURE__ */ c(m, {
821
+ children: /* @__PURE__ */ d(_, {
716
822
  name: "lock",
717
823
  size: 12
718
824
  })
719
825
  })]
720
- }), /* @__PURE__ */ l("span", {
826
+ }), /* @__PURE__ */ f("span", {
721
827
  className: "sg-app-launcher-name",
722
- children: [e.name, e.locked && /* @__PURE__ */ l("span", {
828
+ children: [e.name, e.locked && /* @__PURE__ */ f("span", {
723
829
  className: "sg-visually-hidden",
724
830
  children: [
725
831
  " (",
726
- i("launcher.locked"),
832
+ r("launcher.locked"),
727
833
  ")"
728
834
  ]
729
835
  })]
@@ -732,34 +838,48 @@ var ne = ({ resources: e }) => {
732
838
  })
733
839
  })]
734
840
  });
735
- }, U = ({ isLoggedIn: e, handleLogin: t, handleLogout: n }) => {
736
- let { t: r } = d("sg", { i18n: L });
737
- return /* @__PURE__ */ c(s, { children: e ? /* @__PURE__ */ c("button", {
841
+ }, W = ({ src: e, name: t, size: n = 32, className: r }) => {
842
+ let i = ["sg-avatar", r].filter(Boolean).join(" "), a = { "--avatar-size": `${n}px` };
843
+ return e ? /* @__PURE__ */ d("img", {
844
+ className: i,
845
+ style: a,
846
+ src: e,
847
+ alt: t ?? ""
848
+ }) : /* @__PURE__ */ d("span", {
849
+ className: i,
850
+ style: a,
851
+ role: "img",
852
+ "aria-label": t ?? void 0,
853
+ children: t?.trim().charAt(0).toUpperCase() || "?"
854
+ });
855
+ }, G = ({ isLoggedIn: e, handleLogin: t, handleLogout: n }) => {
856
+ let { t: r } = m("sg", { i18n: R });
857
+ return /* @__PURE__ */ d(u, { children: e ? /* @__PURE__ */ d("button", {
738
858
  onClick: n,
739
859
  className: "sg-authenticator-button",
740
860
  children: r("auth.logout")
741
- }) : /* @__PURE__ */ c("button", {
861
+ }) : /* @__PURE__ */ d("button", {
742
862
  onClick: t,
743
863
  className: "sg-authenticator-button",
744
864
  children: r("auth.login")
745
865
  }) });
746
- }, ie = 220, W = ({ open: t, onClose: r, title: i, icon: a, children: s, buttons: u, footer: f, closeLabel: p, className: m }) => {
747
- let { t: g } = d("sg", { i18n: L }), [_, v] = o(!1), [y, b] = o({
866
+ }, me = 220, K = ({ open: t, onClose: n, title: r, icon: i, children: o, buttons: s, footer: c, closeLabel: u, className: p }) => {
867
+ let { t: h } = m("sg", { i18n: R }), [g, _] = l(!1), [y, b] = l({
748
868
  x: 0,
749
869
  y: 0
750
- }), x = e.useRef(null), [S, C] = o(!1), w = (e) => {
751
- _ || (v(!0), setTimeout(() => {
752
- v(!1), e();
753
- }, ie));
870
+ }), x = e.useRef(null), [S, C] = l(!1), w = (e) => {
871
+ g || (_(!0), setTimeout(() => {
872
+ _(!1), e();
873
+ }, me));
754
874
  };
755
- n(() => {
875
+ a(() => {
756
876
  if (!t) return;
757
877
  let e = (e) => {
758
- e.key === "Escape" && w(r);
878
+ e.key === "Escape" && w(n);
759
879
  };
760
880
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
761
- }, [t, r]);
762
- let [T, E] = o(t);
881
+ }, [t, n]);
882
+ let [T, E] = l(t);
763
883
  if (t !== T && (E(t), t && b({
764
884
  x: 0,
765
885
  y: 0
@@ -783,117 +903,121 @@ var ne = ({ resources: e }) => {
783
903
  function k() {
784
904
  x.current = null, C(!1);
785
905
  }
786
- return /* @__PURE__ */ c("div", {
787
- className: `modal-overlay${_ ? " modal-overlay-closing" : ""}`,
788
- onClick: () => w(r),
789
- children: /* @__PURE__ */ l("div", {
790
- className: `modal-content${m ? ` ${m}` : ""}${_ ? " modal-content-closing" : ""}`,
906
+ return /* @__PURE__ */ d("div", {
907
+ className: `modal-overlay${g ? " modal-overlay-closing" : ""}`,
908
+ onClick: () => w(n),
909
+ children: /* @__PURE__ */ f("div", {
910
+ className: `modal-content${p ? ` ${p}` : ""}${g ? " modal-content-closing" : ""}`,
791
911
  style: {
792
912
  "--drag-x": `${y.x}px`,
793
913
  "--drag-y": `${y.y}px`
794
914
  },
795
915
  onClick: (e) => e.stopPropagation(),
796
916
  children: [
797
- /* @__PURE__ */ l("div", {
917
+ /* @__PURE__ */ f("div", {
798
918
  className: `modal-header${S ? " modal-header-dragging" : ""}`,
799
919
  onPointerDown: D,
800
920
  onPointerMove: O,
801
921
  onPointerUp: k,
802
922
  onPointerCancel: k,
803
923
  children: [
804
- a && /* @__PURE__ */ c("span", {
924
+ i && /* @__PURE__ */ d("span", {
805
925
  className: "modal-icon",
806
- children: a
926
+ children: i
807
927
  }),
808
- i && /* @__PURE__ */ c("h2", {
928
+ r && /* @__PURE__ */ d("h2", {
809
929
  className: "modal-title",
810
- children: i
930
+ children: r
811
931
  }),
812
- /* @__PURE__ */ c("button", {
932
+ /* @__PURE__ */ d("button", {
813
933
  type: "button",
814
934
  className: "modal-close",
815
- "aria-label": p ?? g("modal.close"),
816
- onClick: () => w(r),
817
- disabled: _,
935
+ "aria-label": u ?? h("modal.close"),
936
+ onClick: () => w(n),
937
+ disabled: g,
818
938
  children: "×"
819
939
  })
820
940
  ]
821
941
  }),
822
- /* @__PURE__ */ c("div", {
942
+ /* @__PURE__ */ d("div", {
823
943
  className: "modal-children",
824
- children: s
944
+ children: o
825
945
  }),
826
- u && /* @__PURE__ */ c("div", {
946
+ s && /* @__PURE__ */ d("div", {
827
947
  className: "modal-footer",
828
- children: u.map((e, t) => /* @__PURE__ */ c(h, {
948
+ children: s.map((e, t) => /* @__PURE__ */ d(v, {
829
949
  label: e.label,
830
950
  onClick: () => w(e.onClick),
831
- disabled: _
951
+ disabled: g
832
952
  }, t))
833
953
  }),
834
- f && /* @__PURE__ */ c("div", {
954
+ c && /* @__PURE__ */ d("div", {
835
955
  className: "modal-footer",
836
- children: f
956
+ children: c
837
957
  })
838
958
  ]
839
959
  })
840
960
  });
841
- }, G = ({ label: e, invalid: t, className: n, id: i, ...a }) => {
842
- let o = r(), s = i ?? o;
843
- return /* @__PURE__ */ l("div", {
961
+ }, q = ({ label: e, invalid: t, className: n, id: r, ...i }) => {
962
+ let a = o(), s = r ?? a;
963
+ return /* @__PURE__ */ f("div", {
844
964
  className: "input-wrapper",
845
- children: [e && /* @__PURE__ */ c("label", {
965
+ children: [e && /* @__PURE__ */ d("label", {
846
966
  className: "input-label",
847
967
  htmlFor: s,
848
968
  children: e
849
- }), /* @__PURE__ */ c("input", {
969
+ }), /* @__PURE__ */ d("input", {
850
970
  id: s,
851
971
  className: [
852
972
  "input-field",
853
973
  t ? "input-field--invalid" : "",
854
974
  n
855
975
  ].filter(Boolean).join(" "),
856
- ...a
976
+ ...i
857
977
  })]
858
978
  });
859
- }, K = ({ label: e, className: t, id: n, ...i }) => {
860
- let a = r(), o = n ?? a;
861
- return /* @__PURE__ */ l("div", {
979
+ }, J = ({ label: e, invalid: t, className: n, id: r, ...i }) => {
980
+ let a = o(), s = r ?? a;
981
+ return /* @__PURE__ */ f("div", {
862
982
  className: "input-wrapper",
863
- children: [e && /* @__PURE__ */ c("label", {
983
+ children: [e && /* @__PURE__ */ d("label", {
864
984
  className: "input-label",
865
- htmlFor: o,
985
+ htmlFor: s,
866
986
  children: e
867
- }), /* @__PURE__ */ c("input", {
868
- id: o,
987
+ }), /* @__PURE__ */ d("input", {
988
+ id: s,
869
989
  type: "password",
870
- className: ["input-field", t].filter(Boolean).join(" "),
990
+ className: [
991
+ "input-field",
992
+ t ? "input-field--invalid" : "",
993
+ n
994
+ ].filter(Boolean).join(" "),
871
995
  ...i
872
996
  })]
873
997
  });
874
- }, q = ({ open: e, onClose: t, onLogin: n }) => {
875
- let { t: r } = d("sg", { i18n: L }), [i, a] = o(""), [s, u] = o("");
876
- return /* @__PURE__ */ c(W, {
998
+ }, he = ({ open: e, onClose: t, onLogin: n }) => {
999
+ let { t: r } = m("sg", { i18n: R }), [i, a] = l(""), [o, s] = l("");
1000
+ return /* @__PURE__ */ d(K, {
877
1001
  open: e,
878
1002
  onClose: t,
879
1003
  title: r("auth.login"),
880
- children: /* @__PURE__ */ l("form", {
1004
+ children: /* @__PURE__ */ f("form", {
881
1005
  onSubmit: (e) => {
882
- e.preventDefault(), n(i, s);
1006
+ e.preventDefault(), n(i, o);
883
1007
  },
884
1008
  children: [
885
- /* @__PURE__ */ c(G, {
1009
+ /* @__PURE__ */ d(q, {
886
1010
  label: r("auth.username"),
887
1011
  value: i,
888
1012
  onChange: (e) => a(e.target.value),
889
1013
  autoFocus: !0
890
1014
  }),
891
- /* @__PURE__ */ c(K, {
1015
+ /* @__PURE__ */ d(J, {
892
1016
  label: r("auth.password"),
893
- value: s,
894
- onChange: (e) => u(e.target.value)
1017
+ value: o,
1018
+ onChange: (e) => s(e.target.value)
895
1019
  }),
896
- /* @__PURE__ */ c(h, {
1020
+ /* @__PURE__ */ d(v, {
897
1021
  label: r("auth.login"),
898
1022
  type: "submit",
899
1023
  style: { width: "100%" }
@@ -901,83 +1025,70 @@ var ne = ({ resources: e }) => {
901
1025
  ]
902
1026
  })
903
1027
  });
904
- }, J = "simonegentili.com-access-token", Y = "sg-avatar-change", X = (e) => document.cookie.split("; ").some((t) => t.startsWith(`${e}=`) && t.slice(e.length + 1).length > 0), ae = (e) => {
905
- let t = document.cookie.split("; ").find((t) => t.startsWith(`${e}=`));
906
- return t ? t.slice(e.length + 1) : null;
907
- }, oe = (e, t) => {
908
- try {
909
- return JSON.parse(atob(e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/")))[t] ?? null;
910
- } catch {
911
- return null;
912
- }
913
- }, Z = t(({ title: e = "Quadrato", homePageKey: t = "home", onNavigate: r, cookieName: a = J, username: u = null, usernameJwtField: d = "sub", onLogin: f, onLogout: p, onUserAuthenticated: m, appsUrl: h, heimdallUrl: g = R }, _) => {
914
- let [v, y] = o(() => X(a)), [b, x] = o(!1);
915
- i(_, () => ({ openLoginModal: () => x(!0) }));
916
- let S = v ? ae(a) : null, C = u ?? (S ? oe(S, d) : null), [T, E] = o(null), D = S && T?.token === S ? T.src : null;
917
- return n(() => {
1028
+ }, Y = "sg-avatar-change", X = (e) => j(e) !== null, Z = r(({ title: e = "Quadrato", homePageKey: t = "home", onNavigate: n, cookieName: r = k, username: i = null, usernameJwtField: o = "sub", onLogin: c, onLogout: p, onUserAuthenticated: m, appsUrl: h, heimdallUrl: g = z }, _) => {
1029
+ let [v, y] = l(() => X(r)), [b, x] = l(!1);
1030
+ s(_, () => ({ openLoginModal: () => x(!0) }));
1031
+ let S = v ? j(r) : null, C = i ?? M(S, o), [w, T] = l(null), E = S && w?.token === S ? w.src : null;
1032
+ return a(() => {
918
1033
  if (!S) return;
919
1034
  let e = !1;
920
1035
  return fetch(`${g}/me/avatar`, { headers: { Authorization: `Bearer ${S}` } }).then((e) => e.ok ? e.json() : null).then((t) => {
921
- e || E({
1036
+ e || T({
922
1037
  token: S,
923
1038
  src: t?.avatar ?? null
924
1039
  });
925
1040
  }).catch(() => {}), () => {
926
1041
  e = !0;
927
1042
  };
928
- }, [S, g]), n(() => {
1043
+ }, [S, g]), a(() => {
929
1044
  if (!S) return;
930
- let e = (e) => E({
1045
+ let e = (e) => T({
931
1046
  token: S,
932
1047
  src: e.detail
933
1048
  });
934
1049
  return window.addEventListener(Y, e), () => window.removeEventListener(Y, e);
935
- }, [S]), n(() => {
1050
+ }, [S]), a(() => {
936
1051
  m?.(v, v ? C : null);
937
- }, []), /* @__PURE__ */ l(s, { children: [
938
- /* @__PURE__ */ l(w, {
939
- onNavigate: r,
1052
+ }, []), /* @__PURE__ */ f(u, { children: [
1053
+ /* @__PURE__ */ f(D, {
1054
+ onNavigate: n,
940
1055
  title: e,
941
1056
  homePageKey: t,
942
1057
  className: "quadrato-header",
943
- children: [/* @__PURE__ */ c(H, {
1058
+ children: [/* @__PURE__ */ d(U, {
944
1059
  appsUrl: h,
945
1060
  token: S
946
- }), /* @__PURE__ */ l("div", {
1061
+ }), /* @__PURE__ */ f("div", {
947
1062
  className: "quadrato-header-auth",
948
1063
  children: [
949
- v && D && /* @__PURE__ */ c("img", {
950
- className: "quadrato-header-avatar",
951
- src: D,
952
- alt: ""
953
- }),
954
- v && C && /* @__PURE__ */ c("span", {
1064
+ v && E && /* @__PURE__ */ d(W, { src: E }),
1065
+ v && C && /* @__PURE__ */ d("span", {
955
1066
  className: "quadrato-header-username",
956
1067
  children: C
957
1068
  }),
958
- /* @__PURE__ */ c(U, {
1069
+ /* @__PURE__ */ d(G, {
959
1070
  isLoggedIn: v,
960
1071
  handleLogin: () => x(!0),
961
1072
  handleLogout: () => {
962
1073
  p?.();
963
- let e = X(a);
1074
+ let e = X(r);
964
1075
  y(e), m?.(e, null);
965
1076
  }
966
1077
  })
967
1078
  ]
968
1079
  })]
969
1080
  }),
970
- /* @__PURE__ */ c(B, {
1081
+ /* @__PURE__ */ d(V, {
971
1082
  token: S,
972
1083
  heimdallUrl: g
973
1084
  }),
974
- /* @__PURE__ */ c(q, {
1085
+ /* @__PURE__ */ d(he, {
975
1086
  open: b,
976
1087
  onClose: () => x(!1),
977
1088
  onLogin: async (e, t) => {
978
- await f(e, t);
979
- let n = X(a);
980
- y(n), x(!1), m?.(n, n ? u ?? e : null);
1089
+ await c(e, t);
1090
+ let n = X(r);
1091
+ y(n), x(!1), m?.(n, n ? i ?? e : null);
981
1092
  }
982
1093
  })
983
1094
  ] });
@@ -985,42 +1096,42 @@ var ne = ({ resources: e }) => {
985
1096
  Z.displayName = "QuadratoHeader";
986
1097
  //#endregion
987
1098
  //#region src/components/SetPasswordModal/SetPasswordModal.tsx
988
- var se = ({ open: e, onClose: t, onSubmit: n }) => {
989
- let { t: r } = d("sg", { i18n: L }), [i, a] = o(""), [s, u] = o(""), [f, p] = o("");
990
- return /* @__PURE__ */ c(W, {
1099
+ var ge = ({ open: e, onClose: t, onSubmit: n }) => {
1100
+ let { t: r } = m("sg", { i18n: R }), [i, a] = l(""), [o, s] = l(""), [c, u] = l("");
1101
+ return /* @__PURE__ */ d(K, {
991
1102
  open: e,
992
1103
  onClose: t,
993
1104
  title: r("setPassword.title"),
994
- children: /* @__PURE__ */ l("form", {
1105
+ children: /* @__PURE__ */ f("form", {
995
1106
  className: "set-password-modal-form",
996
1107
  onSubmit: (e) => {
997
- if (e.preventDefault(), i === "" || s === "") {
998
- p(r("setPassword.errorEmpty"));
1108
+ if (e.preventDefault(), i === "" || o === "") {
1109
+ u(r("setPassword.errorEmpty"));
999
1110
  return;
1000
1111
  }
1001
- if (i !== s) {
1002
- p(r("setPassword.errorMismatch"));
1112
+ if (i !== o) {
1113
+ u(r("setPassword.errorMismatch"));
1003
1114
  return;
1004
1115
  }
1005
- p(""), n(i);
1116
+ u(""), n(i);
1006
1117
  },
1007
1118
  children: [
1008
- /* @__PURE__ */ c(K, {
1119
+ /* @__PURE__ */ d(J, {
1009
1120
  label: r("setPassword.newPassword"),
1010
1121
  value: i,
1011
1122
  onChange: (e) => a(e.target.value),
1012
1123
  autoFocus: !0
1013
1124
  }),
1014
- /* @__PURE__ */ c(K, {
1125
+ /* @__PURE__ */ d(J, {
1015
1126
  label: r("setPassword.confirmPassword"),
1016
- value: s,
1017
- onChange: (e) => u(e.target.value)
1127
+ value: o,
1128
+ onChange: (e) => s(e.target.value)
1018
1129
  }),
1019
- f && /* @__PURE__ */ c("p", {
1130
+ c && /* @__PURE__ */ d("p", {
1020
1131
  className: "set-password-modal-error",
1021
- children: f
1132
+ children: c
1022
1133
  }),
1023
- /* @__PURE__ */ c(h, {
1134
+ /* @__PURE__ */ d(v, {
1024
1135
  label: r("setPassword.submit"),
1025
1136
  type: "submit",
1026
1137
  style: { width: "100%" }
@@ -1028,48 +1139,48 @@ var se = ({ open: e, onClose: t, onSubmit: n }) => {
1028
1139
  ]
1029
1140
  })
1030
1141
  });
1031
- }, Q = ({ value: e, onChange: t, swatches: r }) => {
1032
- let [i, s] = o(!1), u = a(null);
1033
- return n(() => {
1034
- if (!i) return;
1142
+ }, _e = ({ value: e, onChange: t, swatches: n }) => {
1143
+ let [r, i] = l(!1), o = c(null);
1144
+ return a(() => {
1145
+ if (!r) return;
1035
1146
  let e = (e) => {
1036
- u.current && !u.current.contains(e.target) && s(!1);
1147
+ o.current && !o.current.contains(e.target) && i(!1);
1037
1148
  }, t = (e) => {
1038
- e.key === "Escape" && s(!1);
1149
+ e.key === "Escape" && i(!1);
1039
1150
  };
1040
1151
  return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
1041
1152
  document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
1042
1153
  };
1043
- }, [i]), /* @__PURE__ */ l("div", {
1044
- ref: u,
1154
+ }, [r]), /* @__PURE__ */ f("div", {
1155
+ ref: o,
1045
1156
  className: "sg-color-picker",
1046
- children: [/* @__PURE__ */ l("button", {
1157
+ children: [/* @__PURE__ */ f("button", {
1047
1158
  type: "button",
1048
1159
  className: "sg-color-picker-toggle",
1049
- onClick: () => s((e) => !e),
1050
- children: [/* @__PURE__ */ c("span", {
1160
+ onClick: () => i((e) => !e),
1161
+ children: [/* @__PURE__ */ d("span", {
1051
1162
  className: "sg-color-picker-swatch",
1052
1163
  style: { background: e }
1053
- }), /* @__PURE__ */ c("span", {
1164
+ }), /* @__PURE__ */ d("span", {
1054
1165
  className: "sg-color-picker-toggle-label",
1055
1166
  children: e
1056
1167
  })]
1057
- }), i && /* @__PURE__ */ l("div", {
1168
+ }), r && /* @__PURE__ */ f("div", {
1058
1169
  className: "sg-color-picker-popover",
1059
- children: [/* @__PURE__ */ c("div", {
1170
+ children: [/* @__PURE__ */ d("div", {
1060
1171
  className: "sg-color-picker-grid",
1061
- children: r.map((n) => /* @__PURE__ */ c("button", {
1172
+ children: n.map((n) => /* @__PURE__ */ d("button", {
1062
1173
  type: "button",
1063
1174
  title: n,
1064
1175
  className: `sg-color-picker-swatch-button${n.toLowerCase() === e?.toLowerCase() ? " active" : ""}`,
1065
1176
  style: { background: n },
1066
1177
  onClick: () => {
1067
- t(n), s(!1);
1178
+ t(n), i(!1);
1068
1179
  }
1069
1180
  }, n))
1070
- }), /* @__PURE__ */ l("label", {
1181
+ }), /* @__PURE__ */ f("label", {
1071
1182
  className: "sg-color-picker-custom",
1072
- children: ["Colore personalizzato", /* @__PURE__ */ c("input", {
1183
+ children: ["Colore personalizzato", /* @__PURE__ */ d("input", {
1073
1184
  type: "color",
1074
1185
  value: e,
1075
1186
  onChange: (e) => t(e.target.value)
@@ -1077,76 +1188,328 @@ var se = ({ open: e, onClose: t, onSubmit: n }) => {
1077
1188
  })]
1078
1189
  })]
1079
1190
  });
1080
- }, $ = (e) => e.split(",")[0].replace(/'/g, ""), ce = ({ value: e, onChange: t, options: r }) => {
1081
- let [i, s] = o(!1), u = a(null);
1082
- return n(() => {
1083
- if (!i) return;
1191
+ }, Q = (e) => e.split(",")[0].replace(/'/g, ""), ve = ({ value: e, onChange: t, options: n }) => {
1192
+ let [r, i] = l(!1), o = c(null);
1193
+ return a(() => {
1194
+ if (!r) return;
1084
1195
  let e = (e) => {
1085
- u.current && !u.current.contains(e.target) && s(!1);
1196
+ o.current && !o.current.contains(e.target) && i(!1);
1086
1197
  }, t = (e) => {
1087
- e.key === "Escape" && s(!1);
1198
+ e.key === "Escape" && i(!1);
1088
1199
  };
1089
1200
  return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
1090
1201
  document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
1091
1202
  };
1092
- }, [i]), /* @__PURE__ */ l("div", {
1093
- ref: u,
1203
+ }, [r]), /* @__PURE__ */ f("div", {
1204
+ ref: o,
1094
1205
  className: "sg-font-picker",
1095
- children: [/* @__PURE__ */ l("button", {
1206
+ children: [/* @__PURE__ */ f("button", {
1096
1207
  type: "button",
1097
1208
  className: "sg-font-picker-toggle",
1098
- onClick: () => s((e) => !e),
1209
+ onClick: () => i((e) => !e),
1099
1210
  style: { fontFamily: e },
1100
- children: [/* @__PURE__ */ c("span", {
1211
+ children: [/* @__PURE__ */ d("span", {
1101
1212
  className: "sg-font-picker-toggle-label",
1102
- children: $(e)
1103
- }), /* @__PURE__ */ c("span", {
1213
+ children: Q(e)
1214
+ }), /* @__PURE__ */ d("span", {
1104
1215
  className: "sg-font-picker-toggle-caret",
1105
- children: i ? "▲" : "▼"
1216
+ children: r ? "▲" : "▼"
1106
1217
  })]
1107
- }), i && /* @__PURE__ */ c("ul", {
1218
+ }), r && /* @__PURE__ */ d("ul", {
1108
1219
  className: "sg-font-picker-list",
1109
- children: r.map((n) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c("button", {
1220
+ children: n.map((n) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d("button", {
1110
1221
  type: "button",
1111
1222
  className: `sg-font-picker-option${n === e ? " active" : ""}`,
1112
1223
  onClick: () => {
1113
- t(n), s(!1);
1224
+ t(n), i(!1);
1114
1225
  },
1115
1226
  style: { fontFamily: n },
1116
- children: $(n)
1227
+ children: Q(n)
1117
1228
  }) }, n))
1118
1229
  })]
1119
1230
  });
1120
- }, le = ({ checked: e, onChange: t, label: n }) => /* @__PURE__ */ l("label", {
1121
- className: "sg-toggle",
1231
+ }, ye = ({ checked: e, onChange: t, label: n, icons: r, layout: i = "inline" }) => /* @__PURE__ */ f("label", {
1232
+ className: i === "row" ? "sg-toggle sg-toggle--row" : "sg-toggle",
1122
1233
  children: [
1123
- /* @__PURE__ */ c("input", {
1234
+ /* @__PURE__ */ d("input", {
1124
1235
  type: "checkbox",
1125
1236
  checked: e,
1126
1237
  onChange: (e) => t(e.target.checked),
1127
1238
  className: "sg-toggle-input"
1128
1239
  }),
1129
- /* @__PURE__ */ c("span", {
1240
+ /* @__PURE__ */ d("span", {
1130
1241
  className: "sg-toggle-track",
1131
- children: /* @__PURE__ */ c("span", { className: "sg-toggle-thumb" })
1242
+ children: /* @__PURE__ */ d("span", { className: "sg-toggle-thumb" })
1132
1243
  }),
1133
- /* @__PURE__ */ c("span", {
1244
+ /* @__PURE__ */ d("span", {
1134
1245
  className: "sg-toggle-label",
1135
1246
  children: n
1247
+ }),
1248
+ r && /* @__PURE__ */ d("span", {
1249
+ className: "sg-toggle-icons",
1250
+ children: r
1136
1251
  })
1137
1252
  ]
1138
- }), ue = ({ className: e }) => {
1139
- let { t, i18n: n } = d("sg", { i18n: L });
1140
- return /* @__PURE__ */ c("select", {
1253
+ }), be = ({ className: e }) => {
1254
+ let { t, i18n: n } = m("sg", { i18n: R });
1255
+ return /* @__PURE__ */ d("select", {
1141
1256
  className: ["sg-language-switcher", e].filter(Boolean).join(" "),
1142
1257
  value: n.resolvedLanguage,
1143
1258
  onChange: (e) => n.changeLanguage(e.target.value),
1144
1259
  "aria-label": t("languageSwitcher.label"),
1145
- children: j.map((e) => /* @__PURE__ */ c("option", {
1260
+ children: N.map((e) => /* @__PURE__ */ d("option", {
1146
1261
  value: e,
1147
- children: M[e]
1262
+ children: P[e]
1148
1263
  }, e))
1149
1264
  });
1265
+ }, xe = ({ value: e, max: t = 100, label: n, ariaLabel: r, tone: i = "accent", size: a = "md", className: o }) => {
1266
+ let s = t > 0 ? Math.min(100, Math.max(0, e / t * 100)) : 0;
1267
+ return /* @__PURE__ */ f("div", {
1268
+ className: [
1269
+ "sg-progress",
1270
+ `sg-progress--${i}`,
1271
+ `sg-progress--${a}`,
1272
+ o
1273
+ ].filter(Boolean).join(" "),
1274
+ children: [/* @__PURE__ */ d("div", {
1275
+ className: "sg-progress-track",
1276
+ role: "progressbar",
1277
+ "aria-valuemin": 0,
1278
+ "aria-valuemax": t,
1279
+ "aria-valuenow": e,
1280
+ "aria-label": r,
1281
+ children: /* @__PURE__ */ d("div", {
1282
+ className: "sg-progress-fill",
1283
+ style: { width: `${s}%` }
1284
+ })
1285
+ }), n !== void 0 && /* @__PURE__ */ d("span", {
1286
+ className: "sg-progress-label",
1287
+ children: n
1288
+ })]
1289
+ });
1290
+ }, $ = ({ kind: e = "info", boxed: t = !1, children: n, className: r }) => {
1291
+ let { t: i } = m("sg", { i18n: R });
1292
+ return /* @__PURE__ */ f("p", {
1293
+ className: [
1294
+ "sg-status",
1295
+ `sg-status--${e}`,
1296
+ t ? "sg-status--boxed" : "",
1297
+ r
1298
+ ].filter(Boolean).join(" "),
1299
+ role: e === "error" ? "alert" : e === "loading" ? "status" : void 0,
1300
+ children: [e === "loading" && /* @__PURE__ */ d("span", {
1301
+ className: "sg-status-spinner",
1302
+ "aria-hidden": "true"
1303
+ }), n ?? (e === "loading" ? i("status.loading") : null)]
1304
+ });
1305
+ }, Se = ({ header: e, actions: t, children: r, variant: i = "default", interactive: a = !1, as: o = "div", href: s, className: c }) => n(o, {
1306
+ className: [
1307
+ "sg-card",
1308
+ `sg-card--${i}`,
1309
+ a ? "sg-card--interactive" : "",
1310
+ c
1311
+ ].filter(Boolean).join(" "),
1312
+ href: s
1313
+ }, e && /* @__PURE__ */ d("div", {
1314
+ className: "sg-card-header",
1315
+ children: e
1316
+ }), r, t && /* @__PURE__ */ d("div", {
1317
+ className: "sg-card-actions",
1318
+ children: t
1319
+ })), Ce = ({ children: e, tone: t = "neutral", onClick: n, selected: r = !1, onRemove: i, removeLabel: a, className: o }) => {
1320
+ let { t: s } = m("sg", { i18n: R });
1321
+ return /* @__PURE__ */ f("span", {
1322
+ className: [
1323
+ "sg-badge",
1324
+ `sg-badge--${t}`,
1325
+ r ? "sg-badge--selected" : "",
1326
+ o
1327
+ ].filter(Boolean).join(" "),
1328
+ children: [n ? /* @__PURE__ */ d("button", {
1329
+ type: "button",
1330
+ className: "sg-badge-toggle",
1331
+ "aria-pressed": r,
1332
+ onClick: n,
1333
+ children: e
1334
+ }) : e, i && /* @__PURE__ */ d("button", {
1335
+ type: "button",
1336
+ className: "sg-badge-remove",
1337
+ "aria-label": a ?? s("badge.remove"),
1338
+ onClick: i,
1339
+ children: "×"
1340
+ })]
1341
+ });
1342
+ }, we = ({ open: e, title: t, children: n, onConfirm: r, onCancel: i, confirmLabel: a, cancelLabel: o, danger: s = !1, icon: c }) => {
1343
+ let { t: l } = m("sg", { i18n: R });
1344
+ return /* @__PURE__ */ d(K, {
1345
+ open: e,
1346
+ onClose: i,
1347
+ title: t,
1348
+ icon: c,
1349
+ footer: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(v, {
1350
+ variant: "secondary",
1351
+ label: o ?? l("confirm.cancel"),
1352
+ onClick: i
1353
+ }), /* @__PURE__ */ d(v, {
1354
+ variant: s ? "danger" : "primary",
1355
+ label: a ?? l("confirm.confirm"),
1356
+ onClick: r,
1357
+ autoFocus: !0
1358
+ })] }),
1359
+ children: n && /* @__PURE__ */ d("div", {
1360
+ className: "sg-confirm-message",
1361
+ children: n
1362
+ })
1363
+ });
1364
+ }, Te = ({ invalid: e, className: t, rows: n = 3, ...r }) => /* @__PURE__ */ d("textarea", {
1365
+ rows: n,
1366
+ className: [
1367
+ "input-field",
1368
+ "sg-textarea",
1369
+ e ? "input-field--invalid" : "",
1370
+ t
1371
+ ].filter(Boolean).join(" "),
1372
+ ...r
1373
+ }), Ee = ({ invalid: e, className: t, children: n, ...r }) => /* @__PURE__ */ d("select", {
1374
+ className: [
1375
+ "input-field",
1376
+ "sg-select",
1377
+ e ? "input-field--invalid" : "",
1378
+ t
1379
+ ].filter(Boolean).join(" "),
1380
+ ...r,
1381
+ children: n
1382
+ }), De = ({ label: e, children: n, hint: r, error: a, className: s }) => {
1383
+ let c = o(), l = i(n) ? n : null, u = l?.props.id ?? c, p = `${u}-note`, m = a ?? r;
1384
+ return /* @__PURE__ */ f("div", {
1385
+ className: ["sg-field", s].filter(Boolean).join(" "),
1386
+ children: [
1387
+ /* @__PURE__ */ d("label", {
1388
+ className: "input-label",
1389
+ htmlFor: u,
1390
+ children: e
1391
+ }),
1392
+ l ? t(l, {
1393
+ id: u,
1394
+ "aria-describedby": m ? p : l.props["aria-describedby"],
1395
+ ...a ? { "aria-invalid": !0 } : {},
1396
+ ...a && typeof l.type != "string" ? { invalid: !0 } : {}
1397
+ }) : n,
1398
+ m && /* @__PURE__ */ d("p", {
1399
+ id: p,
1400
+ className: a ? "sg-field-error" : "sg-field-hint",
1401
+ children: m
1402
+ })
1403
+ ]
1404
+ });
1405
+ }, Oe = ({ items: e, value: t, onChange: n, variant: r = "underline", ariaLabel: i, className: a }) => {
1406
+ let o = c(null);
1407
+ return /* @__PURE__ */ d("div", {
1408
+ ref: o,
1409
+ role: "tablist",
1410
+ "aria-label": i,
1411
+ className: [
1412
+ "sg-tabs",
1413
+ `sg-tabs--${r}`,
1414
+ a
1415
+ ].filter(Boolean).join(" "),
1416
+ onKeyDown: (r) => {
1417
+ let i = e.filter((e) => !e.disabled), a = i.findIndex((e) => e.value === t), s = r.key === "ArrowRight" ? i[(a + 1) % i.length] : r.key === "ArrowLeft" ? i[(a - 1 + i.length) % i.length] : r.key === "Home" ? i[0] : r.key === "End" ? i[i.length - 1] : null;
1418
+ s && (r.preventDefault(), n(s.value), o.current?.querySelector(`[data-value="${String(s.value)}"]`)?.focus());
1419
+ },
1420
+ children: e.map((e) => {
1421
+ let r = e.value === t;
1422
+ return /* @__PURE__ */ d("button", {
1423
+ type: "button",
1424
+ role: "tab",
1425
+ "data-value": String(e.value),
1426
+ "aria-selected": r,
1427
+ tabIndex: r ? 0 : -1,
1428
+ disabled: e.disabled,
1429
+ className: r ? "sg-tab sg-tab--active" : "sg-tab",
1430
+ onClick: () => n(e.value),
1431
+ children: e.label
1432
+ }, e.value);
1433
+ })
1434
+ });
1435
+ }, ke = ({ version: e, className: t }) => {
1436
+ let { t: n } = m("sg", { i18n: R });
1437
+ return /* @__PURE__ */ f("p", {
1438
+ className: ["sg-version", t].filter(Boolean).join(" "),
1439
+ children: [
1440
+ n("version.label"),
1441
+ " v",
1442
+ e
1443
+ ]
1444
+ });
1445
+ }, Ae = ({ children: e, onLogin: t, footer: n, className: r }) => {
1446
+ let { t: i } = m("sg", { i18n: R });
1447
+ return /* @__PURE__ */ f("div", {
1448
+ className: ["sg-login-prompt", r].filter(Boolean).join(" "),
1449
+ children: [
1450
+ /* @__PURE__ */ d("p", {
1451
+ className: "sg-login-prompt-message",
1452
+ children: e ?? i("loginPrompt.message")
1453
+ }),
1454
+ t && /* @__PURE__ */ d(v, {
1455
+ label: i("auth.login"),
1456
+ onClick: t
1457
+ }),
1458
+ n && /* @__PURE__ */ d("div", {
1459
+ className: "sg-login-prompt-footer",
1460
+ children: n
1461
+ })
1462
+ ]
1463
+ });
1464
+ }, je = ({ title: e, children: t, footer: n, className: r }) => /* @__PURE__ */ f("div", {
1465
+ className: ["sg-auth-page", r].filter(Boolean).join(" "),
1466
+ children: [/* @__PURE__ */ f("div", {
1467
+ className: "sg-auth-page-card",
1468
+ children: [/* @__PURE__ */ d("h1", {
1469
+ className: "sg-auth-page-title",
1470
+ children: e
1471
+ }), t]
1472
+ }), n && /* @__PURE__ */ d("div", {
1473
+ className: "sg-auth-page-footer",
1474
+ children: n
1475
+ })]
1476
+ }), Me = ({ onRegister: e, onRegistered: t }) => {
1477
+ let { t: n } = m("sg", { i18n: R }), [r, i] = l(""), [a, o] = l(!1), [s, c] = l(!1), [u, p] = l(null);
1478
+ return s ? /* @__PURE__ */ d($, {
1479
+ boxed: !0,
1480
+ children: n("register.sent")
1481
+ }) : /* @__PURE__ */ f("form", {
1482
+ className: "sg-register-form",
1483
+ onSubmit: async (n) => {
1484
+ n.preventDefault();
1485
+ let i = r.trim();
1486
+ o(!0), p(null);
1487
+ try {
1488
+ await e(i), t ? t(i) : c(!0);
1489
+ } catch (e) {
1490
+ p(e instanceof Error ? e.message : String(e));
1491
+ } finally {
1492
+ o(!1);
1493
+ }
1494
+ },
1495
+ children: [/* @__PURE__ */ d(De, {
1496
+ label: n("register.email"),
1497
+ error: u ?? void 0,
1498
+ children: /* @__PURE__ */ d("input", {
1499
+ className: "input-field",
1500
+ type: "email",
1501
+ autoComplete: "email",
1502
+ placeholder: n("register.placeholder"),
1503
+ value: r,
1504
+ onChange: (e) => i(e.target.value),
1505
+ required: !0
1506
+ })
1507
+ }), /* @__PURE__ */ d(v, {
1508
+ type: "submit",
1509
+ label: n(a ? "register.sending" : "register.submit"),
1510
+ disabled: a || r.trim() === ""
1511
+ })]
1512
+ });
1150
1513
  };
1151
1514
  //#endregion
1152
- export { Y as AVATAR_CHANGE_EVENT, B as AppAccessGate, H as AppLauncher, U as Authenticator, h as Button, Q as ColorPicker, x as CookieConsent, V as DEFAULT_APPS_URL, R as DEFAULT_HEIMDALL_URL, ce as FontPicker, g as Footer, w as Header, m as Icon, G as Input, N as LANGUAGE_COOKIE, M as LANGUAGE_NAMES, ue as LanguageSwitcher, W as Modal, K as PasswordInput, Z as QuadratoHeader, C as SGFooter, T as SGHeader, j as SUPPORTED_LANGUAGES, se as SetPasswordModal, le as Toggle, ne as createI18n, F as readLanguageCookie, L as sgI18n };
1515
+ export { k as ACCESS_TOKEN_COOKIE, Y as AVATAR_CHANGE_EVENT, V as AppAccessGate, U as AppLauncher, je as AuthPage, G as Authenticator, W as Avatar, Ce as Badge, v as Button, Se as Card, _e as ColorPicker, we as ConfirmModal, w as CookieConsent, H as DEFAULT_APPS_URL, z as DEFAULT_HEIMDALL_URL, ve as FontPicker, y as Footer, De as FormField, D as Header, _ as Icon, q as Input, F as LANGUAGE_COOKIE, P as LANGUAGE_NAMES, be as LanguageSwitcher, Ae as LoginPrompt, K as Modal, J as PasswordInput, xe as ProgressBar, Z as QuadratoHeader, Me as RegisterForm, E as SGFooter, O as SGHeader, N as SUPPORTED_LANGUAGES, Ee as Select, ge as SetPasswordModal, $ as StatusMessage, Oe as Tabs, Te as Textarea, ye as Toggle, ke as VersionNumber, re as clearAccessToken, fe as createI18n, j as getAccessToken, M as getTokenClaim, L as readLanguageCookie, ne as setAccessToken, R as sgI18n };