@shellui/core 0.0.11 → 0.0.13

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 (172) hide show
  1. package/README.md +0 -11
  2. package/dist/ContentView-CZG-ro_B.js +146 -0
  3. package/dist/ContentView-CZG-ro_B.js.map +1 -0
  4. package/dist/CookiePreferencesView-Bb3hFqw1.js +213 -0
  5. package/dist/CookiePreferencesView-Bb3hFqw1.js.map +1 -0
  6. package/dist/DefaultLayout-D3IpgS4j.js +406 -0
  7. package/dist/DefaultLayout-D3IpgS4j.js.map +1 -0
  8. package/dist/FullscreenLayout-Do9vAfl8.js +30 -0
  9. package/dist/FullscreenLayout-Do9vAfl8.js.map +1 -0
  10. package/dist/HomeView-DwckTuxz.js +21 -0
  11. package/dist/HomeView-DwckTuxz.js.map +1 -0
  12. package/dist/NotFoundView-DD7azhz-.js +52 -0
  13. package/dist/NotFoundView-DD7azhz-.js.map +1 -0
  14. package/dist/OverlayShell-kDY56DaN.js +642 -0
  15. package/dist/OverlayShell-kDY56DaN.js.map +1 -0
  16. package/dist/SettingsView-Bt4I-KDT.js +2207 -0
  17. package/dist/SettingsView-Bt4I-KDT.js.map +1 -0
  18. package/dist/ViewRoute-ChSPabOy.js +32 -0
  19. package/dist/ViewRoute-ChSPabOy.js.map +1 -0
  20. package/dist/WindowsLayout-CEqkRKyk.js +633 -0
  21. package/dist/WindowsLayout-CEqkRKyk.js.map +1 -0
  22. package/dist/app.d.ts +3 -0
  23. package/dist/app.d.ts.map +1 -0
  24. package/dist/components/ContentView.d.ts +10 -0
  25. package/dist/components/ContentView.d.ts.map +1 -0
  26. package/dist/components/HomeView.d.ts +2 -0
  27. package/dist/components/HomeView.d.ts.map +1 -0
  28. package/dist/components/LoadingOverlay.d.ts +2 -0
  29. package/dist/components/LoadingOverlay.d.ts.map +1 -0
  30. package/dist/components/NotFoundView.d.ts +2 -0
  31. package/dist/components/NotFoundView.d.ts.map +1 -0
  32. package/dist/components/RouteErrorBoundary.d.ts +2 -0
  33. package/dist/components/RouteErrorBoundary.d.ts.map +1 -0
  34. package/dist/components/ViewRoute.d.ts +7 -0
  35. package/dist/components/ViewRoute.d.ts.map +1 -0
  36. package/dist/components/ui/alert-dialog.d.ts +32 -0
  37. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  38. package/dist/components/ui/breadcrumb.d.ts +20 -0
  39. package/dist/components/ui/breadcrumb.d.ts.map +1 -0
  40. package/dist/components/ui/button-group.d.ts +7 -0
  41. package/dist/components/ui/button-group.d.ts.map +1 -0
  42. package/dist/components/ui/button.d.ts +12 -0
  43. package/dist/components/ui/button.d.ts.map +1 -0
  44. package/dist/components/ui/dialog.d.ts +24 -0
  45. package/dist/components/ui/dialog.d.ts.map +1 -0
  46. package/dist/components/ui/drawer.d.ts +38 -0
  47. package/dist/components/ui/drawer.d.ts.map +1 -0
  48. package/dist/components/ui/select.d.ts +5 -0
  49. package/dist/components/ui/select.d.ts.map +1 -0
  50. package/dist/components/ui/sidebar.d.ts +46 -0
  51. package/dist/components/ui/sidebar.d.ts.map +1 -0
  52. package/dist/components/ui/sonner.d.ts +6 -0
  53. package/dist/components/ui/sonner.d.ts.map +1 -0
  54. package/dist/components/ui/switch.d.ts +8 -0
  55. package/dist/components/ui/switch.d.ts.map +1 -0
  56. package/dist/constants/urls.d.ts +6 -0
  57. package/dist/constants/urls.d.ts.map +1 -0
  58. package/dist/constants/urls.js +8 -0
  59. package/dist/constants/urls.js.map +1 -0
  60. package/dist/features/alertDialog/DialogContext.d.ts +12 -0
  61. package/dist/features/alertDialog/DialogContext.d.ts.map +1 -0
  62. package/dist/features/config/ConfigProvider.d.ts +15 -0
  63. package/dist/features/config/ConfigProvider.d.ts.map +1 -0
  64. package/dist/features/config/types.d.ts +177 -0
  65. package/dist/features/config/types.d.ts.map +1 -0
  66. package/dist/features/config/useConfig.d.ts +8 -0
  67. package/dist/features/config/useConfig.d.ts.map +1 -0
  68. package/dist/features/cookieConsent/CookieConsentModal.d.ts +6 -0
  69. package/dist/features/cookieConsent/CookieConsentModal.d.ts.map +1 -0
  70. package/dist/features/cookieConsent/CookiePreferencesView.d.ts +2 -0
  71. package/dist/features/cookieConsent/CookiePreferencesView.d.ts.map +1 -0
  72. package/dist/features/cookieConsent/cookieConsent.d.ts +22 -0
  73. package/dist/features/cookieConsent/cookieConsent.d.ts.map +1 -0
  74. package/dist/features/cookieConsent/useCookieConsent.d.ts +15 -0
  75. package/dist/features/cookieConsent/useCookieConsent.d.ts.map +1 -0
  76. package/dist/features/drawer/DrawerContext.d.ts +24 -0
  77. package/dist/features/drawer/DrawerContext.d.ts.map +1 -0
  78. package/dist/features/layouts/AppLayout.d.ts +12 -0
  79. package/dist/features/layouts/AppLayout.d.ts.map +1 -0
  80. package/dist/features/layouts/DefaultLayout.d.ts +10 -0
  81. package/dist/features/layouts/DefaultLayout.d.ts.map +1 -0
  82. package/dist/features/layouts/FullscreenLayout.d.ts +9 -0
  83. package/dist/features/layouts/FullscreenLayout.d.ts.map +1 -0
  84. package/dist/features/layouts/LayoutProviders.d.ts +9 -0
  85. package/dist/features/layouts/LayoutProviders.d.ts.map +1 -0
  86. package/dist/features/layouts/OverlayShell.d.ts +10 -0
  87. package/dist/features/layouts/OverlayShell.d.ts.map +1 -0
  88. package/dist/features/layouts/WindowsLayout.d.ts +24 -0
  89. package/dist/features/layouts/WindowsLayout.d.ts.map +1 -0
  90. package/dist/features/layouts/utils.d.ts +16 -0
  91. package/dist/features/layouts/utils.d.ts.map +1 -0
  92. package/dist/features/modal/ModalContext.d.ts +20 -0
  93. package/dist/features/modal/ModalContext.d.ts.map +1 -0
  94. package/dist/features/sentry/initSentry.d.ts +14 -0
  95. package/dist/features/sentry/initSentry.d.ts.map +1 -0
  96. package/dist/features/settings/SettingsContext.d.ts +10 -0
  97. package/dist/features/settings/SettingsContext.d.ts.map +1 -0
  98. package/dist/features/settings/SettingsIcons.d.ts +22 -0
  99. package/dist/features/settings/SettingsIcons.d.ts.map +1 -0
  100. package/dist/features/settings/SettingsProvider.d.ts +5 -0
  101. package/dist/features/settings/SettingsProvider.d.ts.map +1 -0
  102. package/dist/features/settings/SettingsRoutes.d.ts +7 -0
  103. package/dist/features/settings/SettingsRoutes.d.ts.map +1 -0
  104. package/dist/features/settings/SettingsView.d.ts +2 -0
  105. package/dist/features/settings/SettingsView.d.ts.map +1 -0
  106. package/dist/features/settings/components/Advanced.d.ts +2 -0
  107. package/dist/features/settings/components/Advanced.d.ts.map +1 -0
  108. package/dist/features/settings/components/Appearance.d.ts +2 -0
  109. package/dist/features/settings/components/Appearance.d.ts.map +1 -0
  110. package/dist/features/settings/components/DataPrivacy.d.ts +2 -0
  111. package/dist/features/settings/components/DataPrivacy.d.ts.map +1 -0
  112. package/dist/features/settings/components/Develop.d.ts +2 -0
  113. package/dist/features/settings/components/Develop.d.ts.map +1 -0
  114. package/dist/features/settings/components/LanguageAndRegion.d.ts +2 -0
  115. package/dist/features/settings/components/LanguageAndRegion.d.ts.map +1 -0
  116. package/dist/features/settings/components/ServiceWorker.d.ts +2 -0
  117. package/dist/features/settings/components/ServiceWorker.d.ts.map +1 -0
  118. package/dist/features/settings/components/UpdateApp.d.ts +2 -0
  119. package/dist/features/settings/components/UpdateApp.d.ts.map +1 -0
  120. package/dist/features/settings/components/develop/DialogTestButtons.d.ts +2 -0
  121. package/dist/features/settings/components/develop/DialogTestButtons.d.ts.map +1 -0
  122. package/dist/features/settings/components/develop/DrawerTestButtons.d.ts +2 -0
  123. package/dist/features/settings/components/develop/DrawerTestButtons.d.ts.map +1 -0
  124. package/dist/features/settings/components/develop/ModalTestButtons.d.ts +2 -0
  125. package/dist/features/settings/components/develop/ModalTestButtons.d.ts.map +1 -0
  126. package/dist/features/settings/components/develop/ToastTestButtons.d.ts +2 -0
  127. package/dist/features/settings/components/develop/ToastTestButtons.d.ts.map +1 -0
  128. package/dist/features/settings/hooks/useSettings.d.ts +2 -0
  129. package/dist/features/settings/hooks/useSettings.d.ts.map +1 -0
  130. package/dist/features/sonner/SonnerContext.d.ts +29 -0
  131. package/dist/features/sonner/SonnerContext.d.ts.map +1 -0
  132. package/dist/features/theme/ThemeProvider.d.ts +11 -0
  133. package/dist/features/theme/ThemeProvider.d.ts.map +1 -0
  134. package/dist/features/theme/themes.d.ts +114 -0
  135. package/dist/features/theme/themes.d.ts.map +1 -0
  136. package/dist/features/theme/useTheme.d.ts +10 -0
  137. package/dist/features/theme/useTheme.d.ts.map +1 -0
  138. package/dist/i18n/I18nProvider.d.ts +9 -0
  139. package/dist/i18n/I18nProvider.d.ts.map +1 -0
  140. package/dist/i18n/config.d.ts +23 -0
  141. package/dist/i18n/config.d.ts.map +1 -0
  142. package/dist/i18n/translations/en/common.json.d.ts +19 -0
  143. package/dist/i18n/translations/en/cookieConsent.json.d.ts +53 -0
  144. package/dist/i18n/translations/en/settings.json.d.ts +358 -0
  145. package/dist/i18n/translations/fr/common.json.d.ts +19 -0
  146. package/dist/i18n/translations/fr/cookieConsent.json.d.ts +53 -0
  147. package/dist/i18n/translations/fr/settings.json.d.ts +358 -0
  148. package/dist/index-CfvdAI_Y.js +2168 -0
  149. package/dist/index-CfvdAI_Y.js.map +1 -0
  150. package/dist/index.d.ts +7 -0
  151. package/dist/index.d.ts.map +1 -0
  152. package/dist/index.js +12 -0
  153. package/dist/index.js.map +1 -0
  154. package/dist/lib/utils.d.ts +3 -0
  155. package/dist/lib/utils.d.ts.map +1 -0
  156. package/dist/lib/z-index.d.ts +29 -0
  157. package/dist/lib/z-index.d.ts.map +1 -0
  158. package/dist/router/router.d.ts +3 -0
  159. package/dist/router/router.d.ts.map +1 -0
  160. package/dist/router/routes.d.ts +4 -0
  161. package/dist/router/routes.d.ts.map +1 -0
  162. package/dist/sidebar-Dt-gibIZ.js +336 -0
  163. package/dist/sidebar-Dt-gibIZ.js.map +1 -0
  164. package/dist/style.css +1 -0
  165. package/dist/switch-CuKXfl3x.js +44 -0
  166. package/dist/switch-CuKXfl3x.js.map +1 -0
  167. package/dist/types.js +2 -0
  168. package/dist/types.js.map +1 -0
  169. package/package.json +16 -14
  170. package/src/features/config/ConfigProvider.ts +20 -5
  171. package/src/features/config/useConfig.ts +14 -1
  172. package/src/index.ts +2 -2
@@ -0,0 +1,633 @@
1
+ import { jsx as n, jsxs as d } from "react/jsx-runtime";
2
+ import { useMemo as Z, useState as P, useRef as M, useEffect as T, useCallback as g } from "react";
3
+ import { useTranslation as ne } from "react-i18next";
4
+ import { shellui as q } from "@shellui/sdk";
5
+ import { a as re, s as oe, b as J, Z as $, r as O, c as C } from "./index-CfvdAI_Y.js";
6
+ import { L as se, O as ie } from "./OverlayShell-kDY56DaN.js";
7
+ import { C as ae } from "./ContentView-CZG-ro_B.js";
8
+ const F = (o) => {
9
+ try {
10
+ const w = new URL(o).hostname;
11
+ return w ? `https://icons.duckduckgo.com/ip3/${w}.ico` : null;
12
+ } catch {
13
+ return null;
14
+ }
15
+ }, X = (o) => o.startsWith("/icons/"), le = () => `win-${Date.now()}-${Math.random().toString(36).slice(2)}`, Q = 280, ee = 200, ce = 720, de = 480, V = 48;
16
+ function te() {
17
+ return {
18
+ x: 0,
19
+ y: 0,
20
+ w: typeof window < "u" ? window.innerWidth : 800,
21
+ h: typeof window < "u" ? window.innerHeight - V : 600
22
+ };
23
+ }
24
+ function ue(o, L, w) {
25
+ const x = `/${L}`, u = w.length > x.length ? w.slice(x.length + 1) : "";
26
+ return u ? `${o.endsWith("/") ? o : `${o}/`}${u}` : o;
27
+ }
28
+ function he({
29
+ win: o,
30
+ navItem: L,
31
+ currentLanguage: w,
32
+ isFocused: x,
33
+ onFocus: u,
34
+ onClose: A,
35
+ onBoundsChange: m,
36
+ maxZIndex: R,
37
+ zIndex: Y
38
+ }) {
39
+ const H = O(L.label, w), [c, l] = P(o.bounds), [h, y] = P(!1), N = M(c), b = M(null), p = M(null), v = M(null), _ = M(null), z = M(null);
40
+ T(() => {
41
+ l(o.bounds);
42
+ }, [o.bounds]), T(() => {
43
+ m(c);
44
+ }, [c, m]), T(() => {
45
+ if (!h) return;
46
+ const t = () => l(te());
47
+ return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
48
+ }, [h]);
49
+ const W = g((t) => {
50
+ if (!p.current) return;
51
+ const r = p.current, a = t.clientX - r.startX, I = t.clientY - r.startY;
52
+ r.lastDx = a, r.lastDy = I;
53
+ const f = b.current;
54
+ f && (f.style.willChange = "transform", f.style.transform = `translate(${a}px, ${I}px)`);
55
+ }, []), E = g(
56
+ (t) => {
57
+ const r = b.current;
58
+ if (r && (r.removeEventListener("pointermove", W), r.removeEventListener("pointerup", E), r.releasePointerCapture(t.pointerId)), p.current) {
59
+ const a = p.current;
60
+ r && (r.style.transform = "", r.style.willChange = "");
61
+ const I = {
62
+ ...a.startBounds,
63
+ x: Math.max(0, a.startBounds.x + a.lastDx),
64
+ y: Math.max(0, a.startBounds.y + a.lastDy)
65
+ };
66
+ l(I), p.current = null;
67
+ }
68
+ },
69
+ [W]
70
+ ), j = g(
71
+ (t) => {
72
+ if (t.button !== 0 || h || t.target.closest("button")) return;
73
+ t.preventDefault(), u(), p.current = {
74
+ startX: t.clientX,
75
+ startY: t.clientY,
76
+ startBounds: { ...c },
77
+ lastDx: 0,
78
+ lastDy: 0
79
+ };
80
+ const r = b.current;
81
+ r && (r.setPointerCapture(t.pointerId), r.addEventListener("pointermove", W, { passive: !0 }), r.addEventListener("pointerup", E));
82
+ },
83
+ [c, h, u, W, E]
84
+ ), U = g(() => {
85
+ h ? (l(N.current), y(!1)) : (N.current = { ...c }, l(te()), y(!0));
86
+ }, [h, c]), B = g((t) => {
87
+ if (!v.current) return;
88
+ const { edge: r, startX: a, startY: I, startBounds: f } = v.current, G = t.clientX - a, K = t.clientY - I, D = { ...f };
89
+ if (r.includes("e") && (D.w = Math.max(Q, f.w + G)), r.includes("w")) {
90
+ const k = Math.max(Q, f.w - G);
91
+ D.x = f.x + f.w - k, D.w = k;
92
+ }
93
+ if (r.includes("s") && (D.h = Math.max(ee, f.h + K)), r.includes("n")) {
94
+ const k = Math.max(ee, f.h - K);
95
+ D.y = f.y + f.h - k, D.h = k;
96
+ }
97
+ z.current = D, _.current === null && (_.current = requestAnimationFrame(() => {
98
+ const k = z.current;
99
+ _.current = null, z.current = null, k && l(k);
100
+ }));
101
+ }, []), S = g(
102
+ (t) => {
103
+ const r = b.current;
104
+ r && (r.removeEventListener("pointermove", B), r.removeEventListener("pointerup", S), r.releasePointerCapture(t.pointerId)), v.current = null;
105
+ },
106
+ [B]
107
+ ), e = g(
108
+ (t, r) => {
109
+ if (t.button !== 0) return;
110
+ t.preventDefault(), t.stopPropagation(), u(), v.current = {
111
+ edge: r,
112
+ startX: t.clientX,
113
+ startY: t.clientY,
114
+ startBounds: { ...c }
115
+ };
116
+ const a = b.current;
117
+ a && (a.setPointerCapture(t.pointerId), a.addEventListener("pointermove", B, {
118
+ passive: !0
119
+ }), a.addEventListener("pointerup", S));
120
+ },
121
+ [c, u, B, S]
122
+ ), s = Z(
123
+ () => ue(o.baseUrl, o.path, o.pathname),
124
+ [o.baseUrl, o.path, o.pathname]
125
+ ), i = x ? R : Y;
126
+ return /* @__PURE__ */ d(
127
+ "div",
128
+ {
129
+ ref: b,
130
+ className: "absolute flex flex-col rounded-lg border border-border bg-card shadow-lg overflow-hidden",
131
+ style: {
132
+ left: c.x,
133
+ top: c.y,
134
+ width: c.w,
135
+ height: c.h,
136
+ zIndex: i
137
+ },
138
+ onClick: u,
139
+ onMouseDown: u,
140
+ children: [
141
+ /* @__PURE__ */ d(
142
+ "div",
143
+ {
144
+ className: "flex items-center gap-2 pl-2 pr-1 py-1 bg-muted/80 border-b border-border cursor-move select-none shrink-0",
145
+ onPointerDown: j,
146
+ children: [
147
+ o.icon && /* @__PURE__ */ n(
148
+ "img",
149
+ {
150
+ src: o.icon,
151
+ alt: "",
152
+ className: C(
153
+ "h-4 w-4 shrink-0 rounded-sm object-cover",
154
+ X(o.icon) && "opacity-90 dark:opacity-100 dark:invert"
155
+ )
156
+ }
157
+ ),
158
+ /* @__PURE__ */ n("span", { className: "flex-1 text-sm font-medium truncate min-w-0", children: H }),
159
+ /* @__PURE__ */ n(
160
+ "button",
161
+ {
162
+ type: "button",
163
+ onClick: (t) => {
164
+ t.stopPropagation(), U();
165
+ },
166
+ className: "p-1 rounded cursor-pointer text-muted-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
167
+ "aria-label": h ? "Restore" : "Maximize",
168
+ children: h ? /* @__PURE__ */ n(fe, { className: "h-4 w-4" }) : /* @__PURE__ */ n(pe, { className: "h-4 w-4" })
169
+ }
170
+ ),
171
+ /* @__PURE__ */ n(
172
+ "button",
173
+ {
174
+ type: "button",
175
+ onClick: (t) => {
176
+ t.stopPropagation(), A();
177
+ },
178
+ className: "p-1 rounded cursor-pointer text-muted-foreground hover:bg-destructive/20 hover:text-destructive transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
179
+ "aria-label": "Close",
180
+ children: /* @__PURE__ */ n(me, { className: "h-4 w-4" })
181
+ }
182
+ )
183
+ ]
184
+ }
185
+ ),
186
+ /* @__PURE__ */ d("div", { className: "flex-1 min-h-0 relative bg-background", children: [
187
+ !x && /* @__PURE__ */ n(
188
+ "div",
189
+ {
190
+ className: "absolute inset-0 z-10 cursor-pointer",
191
+ onClick: u,
192
+ onMouseDown: (t) => {
193
+ t.stopPropagation(), u();
194
+ },
195
+ "aria-hidden": !0
196
+ }
197
+ ),
198
+ /* @__PURE__ */ n(
199
+ ae,
200
+ {
201
+ url: s,
202
+ pathPrefix: o.path,
203
+ ignoreMessages: !0,
204
+ navItem: L
205
+ }
206
+ )
207
+ ] }),
208
+ !h && ["n", "s", "e", "w", "ne", "nw", "se", "sw"].map((t) => /* @__PURE__ */ n(
209
+ "div",
210
+ {
211
+ className: C(
212
+ "absolute bg-transparent",
213
+ t.includes("n") && "top-0 h-2 cursor-n-resize",
214
+ t.includes("s") && "bottom-0 h-2 cursor-s-resize",
215
+ t.includes("e") && "right-0 w-2 cursor-e-resize",
216
+ t.includes("w") && "left-0 w-2 cursor-w-resize",
217
+ t === "n" && "left-2 right-2",
218
+ t === "s" && "left-2 right-2",
219
+ t === "e" && "top-2 bottom-2",
220
+ t === "w" && "top-2 bottom-2",
221
+ t === "ne" && "top-0 right-0 w-2 h-2 cursor-ne-resize",
222
+ t === "nw" && "top-0 left-0 w-2 h-2 cursor-nw-resize",
223
+ t === "se" && "bottom-0 right-0 w-2 h-2 cursor-se-resize",
224
+ t === "sw" && "bottom-0 left-0 w-2 h-2 cursor-sw-resize"
225
+ ),
226
+ style: t === "n" ? { left: 8, right: 8 } : t === "s" ? { left: 8, right: 8 } : t === "e" ? { top: 8, bottom: 8 } : t === "w" ? { top: 8, bottom: 8 } : void 0,
227
+ onPointerDown: (r) => e(r, t)
228
+ },
229
+ t
230
+ ))
231
+ ]
232
+ }
233
+ );
234
+ }
235
+ function pe({ className: o }) {
236
+ return /* @__PURE__ */ d(
237
+ "svg",
238
+ {
239
+ xmlns: "http://www.w3.org/2000/svg",
240
+ width: "24",
241
+ height: "24",
242
+ viewBox: "0 0 24 24",
243
+ fill: "none",
244
+ stroke: "currentColor",
245
+ strokeWidth: "2",
246
+ strokeLinecap: "round",
247
+ strokeLinejoin: "round",
248
+ className: o,
249
+ "aria-hidden": !0,
250
+ children: [
251
+ /* @__PURE__ */ n("path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
252
+ /* @__PURE__ */ n("path", { d: "M21 8V5a2 2 0 0 0-2-2h-3" }),
253
+ /* @__PURE__ */ n("path", { d: "M3 16v3a2 2 0 0 0 2 2h3" }),
254
+ /* @__PURE__ */ n("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
255
+ ]
256
+ }
257
+ );
258
+ }
259
+ function fe({ className: o }) {
260
+ return /* @__PURE__ */ d(
261
+ "svg",
262
+ {
263
+ xmlns: "http://www.w3.org/2000/svg",
264
+ width: "24",
265
+ height: "24",
266
+ viewBox: "0 0 24 24",
267
+ fill: "none",
268
+ stroke: "currentColor",
269
+ strokeWidth: "2",
270
+ strokeLinecap: "round",
271
+ strokeLinejoin: "round",
272
+ className: o,
273
+ "aria-hidden": !0,
274
+ children: [
275
+ /* @__PURE__ */ n(
276
+ "rect",
277
+ {
278
+ x: "3",
279
+ y: "3",
280
+ width: "10",
281
+ height: "10",
282
+ rx: "1"
283
+ }
284
+ ),
285
+ /* @__PURE__ */ n(
286
+ "rect",
287
+ {
288
+ x: "11",
289
+ y: "11",
290
+ width: "10",
291
+ height: "10",
292
+ rx: "1"
293
+ }
294
+ )
295
+ ]
296
+ }
297
+ );
298
+ }
299
+ function me({ className: o }) {
300
+ return /* @__PURE__ */ d(
301
+ "svg",
302
+ {
303
+ xmlns: "http://www.w3.org/2000/svg",
304
+ width: "24",
305
+ height: "24",
306
+ viewBox: "0 0 24 24",
307
+ fill: "none",
308
+ stroke: "currentColor",
309
+ strokeWidth: "2",
310
+ strokeLinecap: "round",
311
+ strokeLinejoin: "round",
312
+ className: o,
313
+ "aria-hidden": !0,
314
+ children: [
315
+ /* @__PURE__ */ n("path", { d: "M18 6 6 18" }),
316
+ /* @__PURE__ */ n("path", { d: "m6 6 12 12" })
317
+ ]
318
+ }
319
+ );
320
+ }
321
+ function be({ className: o }) {
322
+ return /* @__PURE__ */ n(
323
+ "svg",
324
+ {
325
+ xmlns: "http://www.w3.org/2000/svg",
326
+ width: "24",
327
+ height: "24",
328
+ viewBox: "0 0 24 24",
329
+ fill: "currentColor",
330
+ className: o,
331
+ "aria-hidden": !0,
332
+ children: /* @__PURE__ */ n("path", { d: "M3 3h8v8H3V3zm10 0h8v8h-8V3zM3 13h8v8H3v-8zm10 0h8v8h-8v-8z" })
333
+ }
334
+ );
335
+ }
336
+ function ge() {
337
+ return typeof window < "u" && Intl.DateTimeFormat ? Intl.DateTimeFormat().resolvedOptions().timeZone : "UTC";
338
+ }
339
+ function ze({
340
+ title: o,
341
+ appIcon: L,
342
+ logo: w,
343
+ navigation: x
344
+ }) {
345
+ const { i18n: u } = ne(), { settings: A } = re(), m = u.language || "en", R = A.region?.timezone ?? ge(), { startNavItems: Y, endNavItems: H, navigationItems: c } = Z(() => {
346
+ const { start: e, end: s } = oe(x);
347
+ return {
348
+ startNavItems: J(e),
349
+ endNavItems: s,
350
+ navigationItems: J(x)
351
+ };
352
+ }, [x]), [l, h] = P([]), [y, N] = P(null), [b, p] = P(!1), [v, _] = P(() => /* @__PURE__ */ new Date()), z = M(null);
353
+ T(() => {
354
+ const e = setInterval(() => _(/* @__PURE__ */ new Date()), 1e3);
355
+ return () => clearInterval(e);
356
+ }, []);
357
+ const W = Z(
358
+ () => $.WINDOWS_WINDOW_BASE + Math.max(l.length, 1),
359
+ [l.length]
360
+ ), E = g(
361
+ (e) => {
362
+ const s = typeof e.label == "string" ? e.label : O(e.label, m), i = e.openIn === "external" && !e.icon ? F(e.url) : null, t = e.icon ?? i ?? null, r = le(), a = {
363
+ x: 60 + l.length * 24,
364
+ y: 60 + l.length * 24,
365
+ w: ce,
366
+ h: de
367
+ };
368
+ h((I) => [
369
+ ...I,
370
+ {
371
+ id: r,
372
+ path: e.path,
373
+ pathname: `/${e.path}`,
374
+ baseUrl: e.url,
375
+ label: s,
376
+ icon: t,
377
+ bounds: a
378
+ }
379
+ ]), N(r), p(!1);
380
+ },
381
+ [m, l.length]
382
+ ), j = g((e) => {
383
+ h((s) => s.filter((i) => i.id !== e)), N((s) => s === e ? null : s);
384
+ }, []);
385
+ T(() => {
386
+ if (l.length === 0) {
387
+ N(null);
388
+ return;
389
+ }
390
+ y !== null && l.some((s) => s.id === y) || N(l[0].id);
391
+ }, [l, y]);
392
+ const U = g((e) => {
393
+ N(e);
394
+ }, []), B = g((e, s) => {
395
+ h((i) => i.map((t) => t.id === e ? { ...t, bounds: s } : t));
396
+ }, []);
397
+ T(() => {
398
+ if (!b) return;
399
+ const e = (s) => {
400
+ z.current && !z.current.contains(s.target) && p(!1);
401
+ };
402
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
403
+ }, [b]);
404
+ const S = g(
405
+ (e) => {
406
+ if (e.openIn === "modal") {
407
+ q.openModal(e.url), p(!1);
408
+ return;
409
+ }
410
+ if (e.openIn === "drawer") {
411
+ q.openDrawer({ url: e.url, position: e.drawerPosition }), p(!1);
412
+ return;
413
+ }
414
+ if (e.openIn === "external") {
415
+ window.open(e.url, "_blank", "noopener,noreferrer"), p(!1);
416
+ return;
417
+ }
418
+ E(e);
419
+ },
420
+ [E]
421
+ );
422
+ return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ d(ie, { navigationItems: c, children: [
423
+ /* @__PURE__ */ n(
424
+ "div",
425
+ {
426
+ className: "fixed inset-0 bg-muted/30",
427
+ style: { paddingBottom: V },
428
+ children: l.map((e, s) => {
429
+ const i = c.find((a) => a.path === e.path);
430
+ if (!i) return null;
431
+ const t = e.id === y, r = $.WINDOWS_WINDOW_BASE + s;
432
+ return /* @__PURE__ */ n(
433
+ he,
434
+ {
435
+ win: e,
436
+ navItem: i,
437
+ currentLanguage: m,
438
+ isFocused: t,
439
+ onFocus: () => U(e.id),
440
+ onClose: () => j(e.id),
441
+ onBoundsChange: (a) => B(e.id, a),
442
+ maxZIndex: W,
443
+ zIndex: r
444
+ },
445
+ e.id
446
+ );
447
+ })
448
+ }
449
+ ),
450
+ /* @__PURE__ */ d(
451
+ "div",
452
+ {
453
+ className: "fixed left-0 right-0 bottom-0 flex items-center gap-1 px-2 border-t border-border bg-sidebar-background",
454
+ style: {
455
+ height: V,
456
+ zIndex: $.WINDOWS_TASKBAR,
457
+ paddingBottom: "env(safe-area-inset-bottom, 0px)"
458
+ },
459
+ children: [
460
+ /* @__PURE__ */ d(
461
+ "div",
462
+ {
463
+ className: "relative shrink-0",
464
+ ref: z,
465
+ children: [
466
+ /* @__PURE__ */ d(
467
+ "button",
468
+ {
469
+ type: "button",
470
+ onClick: () => p((e) => !e),
471
+ className: C(
472
+ "flex items-center gap-2 h-9 px-3 rounded cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
473
+ b ? "bg-sidebar-accent text-sidebar-accent-foreground" : "text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"
474
+ ),
475
+ "aria-expanded": b,
476
+ "aria-haspopup": "true",
477
+ "aria-label": "Start",
478
+ children: [
479
+ /* @__PURE__ */ n(be, { className: "h-5 w-5" }),
480
+ /* @__PURE__ */ n("span", { className: "font-semibold text-sm hidden sm:inline", children: o || "Start" })
481
+ ]
482
+ }
483
+ ),
484
+ b && /* @__PURE__ */ d(
485
+ "div",
486
+ {
487
+ className: "absolute bottom-full left-0 mb-1 w-64 max-h-[70vh] overflow-y-auto rounded-lg border border-border bg-popover shadow-lg py-2 z-[10001]",
488
+ style: { zIndex: $.MODAL_CONTENT },
489
+ children: [
490
+ /* @__PURE__ */ n("div", { className: "px-2 pb-2 border-b border-border mb-2", children: /* @__PURE__ */ n("span", { className: "text-sm font-semibold text-popover-foreground", children: o || "Applications" }) }),
491
+ /* @__PURE__ */ n("div", { className: "grid gap-0.5", children: Y.filter((e) => !e.hidden).map((e) => {
492
+ const s = typeof e.label == "string" ? e.label : O(e.label, m), i = e.icon ?? (e.openIn === "external" ? F(e.url) : null);
493
+ return /* @__PURE__ */ d(
494
+ "button",
495
+ {
496
+ type: "button",
497
+ onClick: () => S(e),
498
+ className: "flex items-center gap-3 w-full px-3 py-2 text-left text-sm cursor-pointer text-popover-foreground hover:bg-accent hover:text-accent-foreground rounded-none transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
499
+ children: [
500
+ i ? /* @__PURE__ */ n(
501
+ "img",
502
+ {
503
+ src: i,
504
+ alt: "",
505
+ className: C(
506
+ "h-5 w-5 shrink-0 rounded-sm object-cover",
507
+ X(i) && "opacity-90 dark:opacity-100 dark:invert"
508
+ )
509
+ }
510
+ ) : /* @__PURE__ */ n("span", { className: "h-5 w-5 shrink-0 rounded-sm bg-muted" }),
511
+ /* @__PURE__ */ n("span", { className: "truncate", children: s })
512
+ ]
513
+ },
514
+ e.path
515
+ );
516
+ }) })
517
+ ]
518
+ }
519
+ )
520
+ ]
521
+ }
522
+ ),
523
+ /* @__PURE__ */ n("div", { className: "flex-1 flex items-center gap-1 min-w-0 overflow-x-auto", children: l.map((e) => {
524
+ const s = c.find((r) => r.path === e.path), i = s ? O(s.label, m) : e.label, t = e.id === y;
525
+ return /* @__PURE__ */ d(
526
+ "button",
527
+ {
528
+ type: "button",
529
+ onClick: () => U(e.id),
530
+ onContextMenu: (r) => {
531
+ r.preventDefault(), j(e.id);
532
+ },
533
+ className: C(
534
+ "flex items-center gap-2 h-8 px-2 rounded min-w-0 max-w-[140px] shrink-0 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
535
+ t ? "bg-sidebar-accent text-sidebar-accent-foreground" : "text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"
536
+ ),
537
+ title: i,
538
+ children: [
539
+ e.icon ? /* @__PURE__ */ n(
540
+ "img",
541
+ {
542
+ src: e.icon,
543
+ alt: "",
544
+ className: C(
545
+ "h-4 w-4 shrink-0 rounded-sm object-cover",
546
+ X(e.icon) && "opacity-90 dark:opacity-100 dark:invert"
547
+ )
548
+ }
549
+ ) : /* @__PURE__ */ n("span", { className: "h-4 w-4 shrink-0 rounded-sm bg-muted" }),
550
+ /* @__PURE__ */ n("span", { className: "text-xs truncate", children: i })
551
+ ]
552
+ },
553
+ e.id
554
+ );
555
+ }) }),
556
+ H.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center gap-0.5 shrink-0 border-l border-sidebar-border pl-2 ml-1", children: H.map((e) => {
557
+ const s = typeof e.label == "string" ? e.label : O(e.label, m), i = e.icon ?? (e.openIn === "external" ? F(e.url) : null);
558
+ return /* @__PURE__ */ d(
559
+ "button",
560
+ {
561
+ type: "button",
562
+ onClick: () => S(e),
563
+ className: "flex items-center gap-2 h-8 px-2 rounded cursor-pointer text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
564
+ title: s,
565
+ children: [
566
+ i ? /* @__PURE__ */ n(
567
+ "img",
568
+ {
569
+ src: i,
570
+ alt: "",
571
+ className: C(
572
+ "h-4 w-4 shrink-0 rounded-sm object-cover",
573
+ X(i) && "opacity-90 dark:opacity-100 dark:invert"
574
+ )
575
+ }
576
+ ) : /* @__PURE__ */ n("span", { className: "h-4 w-4 shrink-0 rounded-sm bg-muted" }),
577
+ /* @__PURE__ */ n("span", { className: "text-xs truncate max-w-[100px]", children: s })
578
+ ]
579
+ },
580
+ e.path
581
+ );
582
+ }) }),
583
+ /* @__PURE__ */ d(
584
+ "div",
585
+ {
586
+ className: "flex flex-col items-end justify-center shrink-0 px-3 py-1 text-sidebar-foreground border-l border-sidebar-border ml-1 min-w-0",
587
+ style: { paddingRight: "max(0.75rem, env(safe-area-inset-right))" },
588
+ role: "timer",
589
+ "aria-live": "off",
590
+ "aria-label": new Intl.DateTimeFormat(m, {
591
+ timeZone: R,
592
+ dateStyle: "full",
593
+ timeStyle: "medium"
594
+ }).format(v),
595
+ children: [
596
+ /* @__PURE__ */ n(
597
+ "time",
598
+ {
599
+ dateTime: v.toISOString(),
600
+ className: "text-xs leading-tight tabular-nums whitespace-nowrap",
601
+ children: new Intl.DateTimeFormat(m, {
602
+ timeZone: R,
603
+ hour: "2-digit",
604
+ minute: "2-digit",
605
+ second: "2-digit"
606
+ }).format(v)
607
+ }
608
+ ),
609
+ /* @__PURE__ */ n(
610
+ "time",
611
+ {
612
+ dateTime: v.toISOString(),
613
+ className: "text-[10px] leading-tight whitespace-nowrap text-sidebar-foreground/90",
614
+ children: new Intl.DateTimeFormat(m, {
615
+ timeZone: R,
616
+ weekday: "short",
617
+ day: "numeric",
618
+ month: "short"
619
+ }).format(v)
620
+ }
621
+ )
622
+ ]
623
+ }
624
+ )
625
+ ]
626
+ }
627
+ )
628
+ ] }) });
629
+ }
630
+ export {
631
+ ze as WindowsLayout
632
+ };
633
+ //# sourceMappingURL=WindowsLayout-CEqkRKyk.js.map