@fde-desktop/fde-core 0.4.13 → 0.4.19

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 (132) hide show
  1. package/dist/{AppEmptyState-Boej96TB.js → AppEmptyState-BVfKZU-h.js} +1 -1
  2. package/dist/AppEmptyState-Z8_Cviti.cjs +1 -0
  3. package/dist/AppIcon-Czrtau6A.cjs +1 -0
  4. package/dist/{AppIcon-mtEoyzOb.js → AppIcon-aFNw89J2.js} +1 -1
  5. package/dist/AppMenuBar-38QtFTPk.cjs +1 -0
  6. package/dist/AppTempMemory-DAC62jiS.cjs +1 -0
  7. package/dist/AppTempMemory-DgUW6GaF.js +23 -0
  8. package/dist/CalendarApp-BYTyu089.js +9 -0
  9. package/dist/CalendarApp-DPOK4mqg.cjs +1 -0
  10. package/dist/{ColorPicker-WCeD3Wjf.js → ColorPicker-B76rCS2H.js} +1 -1
  11. package/dist/ColorPicker-BZqsPh3X.cjs +1 -0
  12. package/dist/CreateItemApp-B0IHL16b.cjs +1 -0
  13. package/dist/CreateItemApp-UUP2HAu2.js +149 -0
  14. package/dist/DeviceInfoApp-BPQyeVSd.js +162 -0
  15. package/dist/DeviceInfoApp-D2mS2OT-.cjs +1 -0
  16. package/dist/DownloadProgress-CpJguS8g.cjs +1 -0
  17. package/dist/FilePickerApp-ClmPw6lk.cjs +1 -0
  18. package/dist/{FilePickerApp-ClHuhm6Z.js → FilePickerApp-D7fERKbp.js} +1 -1
  19. package/dist/FilesApp-DhJbO8wg.js +191 -0
  20. package/dist/FilesApp-LbwRRR1i.cjs +1 -0
  21. package/dist/IconColorPicker-7rWNAiNQ.cjs +1 -0
  22. package/dist/IconColorPicker-DUIXSb5E.js +58 -0
  23. package/dist/ImageViewerApp-9T-V8uP5.cjs +1 -0
  24. package/dist/ImageViewerApp-ihqIwJ-L.js +68 -0
  25. package/dist/ImageViewerMenuBar-DmvZoZ03.cjs +1 -0
  26. package/dist/{ImageViewerMenuBar-BIsUokxV.js → ImageViewerMenuBar-ZeIKHdA-.js} +18 -19
  27. package/dist/MenuEditApp-DRKfmSIZ.js +361 -0
  28. package/dist/MenuEditApp-U7EqB5Rl.cjs +1 -0
  29. package/dist/MenuEditMenuBar-BE_cXaoG.cjs +1 -0
  30. package/dist/MenuEditMenuBar-Df1je7F6.js +59 -0
  31. package/dist/NotesApp-DZfNQ8mN.cjs +1 -0
  32. package/dist/NotesApp-rwAeXyJy.js +344 -0
  33. package/dist/{NotesMenuBar-DILZTjnT.js → NotesMenuBar-C503t5pu.js} +12 -13
  34. package/dist/NotesMenuBar-CwgZ9dHy.cjs +1 -0
  35. package/dist/PdfApp-DNZaSXbF.cjs +1 -0
  36. package/dist/PdfApp-K1Z612o3.js +38 -0
  37. package/dist/PdfMenuBar-BPzP_JUO.cjs +1 -0
  38. package/dist/PdfMenuBar-DEUKgKTE.js +38 -0
  39. package/dist/SettingsApp-DdWqiYFE.cjs +1 -0
  40. package/dist/SettingsApp-ghc3RaMv.js +875 -0
  41. package/dist/SettingsMenuBar-C4KAPoBs.js +41 -0
  42. package/dist/SettingsMenuBar-CgmaF9_B.cjs +1 -0
  43. package/dist/{UploaderApp-Bboc4KZ1.js → UploaderApp-D9vfOR0S.js} +28 -40
  44. package/dist/UploaderApp-omSY-NSn.cjs +1 -0
  45. package/dist/VscIcon-CeELixwP.cjs +1 -0
  46. package/dist/buildBreadcrumbs-C2c2a4R3.cjs +1 -0
  47. package/dist/desktopStore-LSQweOqZ.cjs +1 -0
  48. package/dist/{desktopStore-8cSZlj7s.js → desktopStore-xnNbYaYm.js} +263 -263
  49. package/dist/formatBytes-Bv1bQPKQ.cjs +1 -0
  50. package/dist/formatBytes-CaP80WnM.js +14 -0
  51. package/dist/i18nConstants-DgbKSBIK.cjs +1 -0
  52. package/dist/i18nConstants-Nzpf2IFp.js +611 -0
  53. package/dist/imageViewerStore-CYt4R4e4.cjs +1 -0
  54. package/dist/index.cjs +1 -1
  55. package/dist/index.css +1 -1
  56. package/dist/index.d.ts +50 -29
  57. package/dist/index.js +698 -650
  58. package/dist/menuEditStore-sU6qaF2j.cjs +1 -0
  59. package/dist/notesStore-BnMXBRaV.cjs +1 -0
  60. package/dist/settingsAppStore-CQ4JHd7Q.cjs +1 -0
  61. package/dist/useAdaptiveDimensions-BDZxP4E3.cjs +1 -0
  62. package/dist/{useAdaptiveDimensions-DxNLJ7R5.js → useAdaptiveDimensions-sv9lwqF_.js} +1 -1
  63. package/dist/useCloseInterceptor-AzfjUZgz.cjs +1 -0
  64. package/dist/{useCloseInterceptor-CIxhOZx1.js → useCloseInterceptor-Bwm4I0O8.js} +1 -1
  65. package/dist/useDeviceDetection-B9jjlate.js +37 -0
  66. package/dist/useDeviceDetection-CnxnQWIq.cjs +1 -0
  67. package/dist/useDragDrop-Bdwzk6VO.cjs +1 -0
  68. package/dist/useDragDrop-D2LtOEYC.js +139 -0
  69. package/dist/useDynamicIcon-Cg3B_Aeq.cjs +1 -0
  70. package/dist/useNotifications-CR9JLjtC.js +26 -0
  71. package/dist/useNotifications-rwLmJ7fI.cjs +1 -0
  72. package/dist/useOpenApp-BBZ_B7Pr.cjs +1 -0
  73. package/dist/{useOpenApp-uguTLkyl.js → useOpenApp-DdEbOVby.js} +3 -3
  74. package/dist/useResolvedUrl-CgqjNxzw.js +389 -0
  75. package/dist/useResolvedUrl-Dz2AhrDV.cjs +1 -0
  76. package/package.json +1 -1
  77. package/dist/AppEmptyState-CLc00OOG.cjs +0 -1
  78. package/dist/AppIcon-C8vHUVcb.cjs +0 -1
  79. package/dist/AppMenuBar-CAlkNHjj.cjs +0 -1
  80. package/dist/CalendarApp-DOmjWbpl.js +0 -10
  81. package/dist/CalendarApp-Z0bCCYsK.cjs +0 -1
  82. package/dist/ColorPicker-CQRRwY-y.cjs +0 -1
  83. package/dist/CreateItemApp-BkFFFdX1.cjs +0 -1
  84. package/dist/CreateItemApp-DR8Y4bwo.js +0 -202
  85. package/dist/DeviceInfoApp-BXQ9uOwF.cjs +0 -1
  86. package/dist/DeviceInfoApp-I63mJRWy.js +0 -195
  87. package/dist/DownloadProgress-CkTGTf0z.cjs +0 -1
  88. package/dist/FilePickerApp-By6-vbag.cjs +0 -1
  89. package/dist/FilesApp-BRK2OqkQ.cjs +0 -1
  90. package/dist/FilesApp-BuoFP_KA.js +0 -212
  91. package/dist/ImageViewerApp-B1niWF75.cjs +0 -1
  92. package/dist/ImageViewerApp-iojtyFEf.js +0 -69
  93. package/dist/ImageViewerMenuBar-BgzgSF3v.cjs +0 -1
  94. package/dist/MenuEditApp-BHptoJbz.cjs +0 -1
  95. package/dist/MenuEditApp-CJUbJaqh.js +0 -492
  96. package/dist/MenuEditMenuBar-CCOSPAUe.cjs +0 -1
  97. package/dist/MenuEditMenuBar-DnCL-kaZ.js +0 -60
  98. package/dist/NotesApp-BmQIBtJ2.cjs +0 -1
  99. package/dist/NotesApp-DJ2dGt4-.js +0 -364
  100. package/dist/NotesMenuBar-BzojwMtH.cjs +0 -1
  101. package/dist/PdfApp-IjY_GtnW.js +0 -39
  102. package/dist/PdfApp-krW8UI97.cjs +0 -1
  103. package/dist/PdfMenuBar-Bd5MTZcZ.js +0 -39
  104. package/dist/PdfMenuBar-DWD0Qa3F.cjs +0 -1
  105. package/dist/SettingsApp-BE22l5UP.cjs +0 -1
  106. package/dist/SettingsApp-BTFtTFY_.js +0 -1228
  107. package/dist/SettingsMenuBar-CZE2evG2.cjs +0 -1
  108. package/dist/SettingsMenuBar-ktC0viTd.js +0 -42
  109. package/dist/UploaderApp-Dr1mF7oj.cjs +0 -1
  110. package/dist/VscIcon-BYb_Soyy.cjs +0 -1
  111. package/dist/buildBreadcrumbs-Ccd8i11b.cjs +0 -1
  112. package/dist/desktopStore-C1jR6Fdb.cjs +0 -1
  113. package/dist/imageViewerStore-Dfylg59V.cjs +0 -1
  114. package/dist/menuEditStore-CYwtfD6H.cjs +0 -1
  115. package/dist/notesStore-CrWTO6oB.cjs +0 -1
  116. package/dist/rolldown-runtime-CAFD8bLK.js +0 -11
  117. package/dist/settingsAppStore-DuYZNeFf.cjs +0 -1
  118. package/dist/useAdaptiveDimensions-3Lz4X0Tc.cjs +0 -1
  119. package/dist/useCloseInterceptor-CdX-09Ib.cjs +0 -1
  120. package/dist/useDynamicIcon-CK6SjEv5.cjs +0 -1
  121. package/dist/useOpenApp-ChDhsL9h.cjs +0 -1
  122. package/dist/useResolvedUrl-B6x4xy0x.js +0 -29
  123. package/dist/useResolvedUrl-Bb39DpVy.cjs +0 -1
  124. /package/dist/{Colors-CuABn2W4.js → Colors-BIj4g0eH.js} +0 -0
  125. /package/dist/{Colors-CNJbU7oq.cjs → Colors-PNt4eyR6.cjs} +0 -0
  126. /package/dist/{DownloadProgress-DnVASsv5.js → DownloadProgress-DBFA58C5.js} +0 -0
  127. /package/dist/{imageViewerStore-COrD02Zu.js → imageViewerStore-C6UgceP-.js} +0 -0
  128. /package/dist/{menuEditStore-CxsgLiQu.js → menuEditStore-DPqViGva.js} +0 -0
  129. /package/dist/{notesStore-Dgah46U5.js → notesStore-KZDXN6zx.js} +0 -0
  130. /package/dist/{settingsAppStore-DHZhi6Rl.js → settingsAppStore-Y7x3r6pV.js} +0 -0
  131. /package/dist/{useMenuBarUtils-DAap0ukp.cjs → useMenuBarUtils-BOnQYtKU.cjs} +0 -0
  132. /package/dist/{useMenuBarUtils-ChAfI7OA.js → useMenuBarUtils-DTPFK0IN.js} +0 -0
@@ -7,140 +7,140 @@ var a = {
7
7
  defaultHeight: 600,
8
8
  minWidth: 640,
9
9
  minHeight: 480
10
- }, o = [
11
- {
12
- id: "files",
13
- name: "FilesApp",
14
- icon: "📁",
15
- fcIcon: "FcOpenedFolder",
16
- hasContextMenu: !0,
17
- ...a
18
- },
19
- {
20
- id: "settings",
21
- name: "Settings",
22
- icon: "⚙️",
23
- fcIcon: "FcSettings",
24
- singleWindow: !0,
25
- ...a
26
- },
27
- {
28
- id: "notepad",
29
- name: "Notepad",
30
- icon: "📝",
31
- fcIcon: "FcEditImage",
32
- ...a
33
- },
34
- {
35
- id: "image-viewer",
36
- name: "Image Viewer",
37
- icon: "🖼️",
38
- fcIcon: "FcPicture",
39
- defaultWidth: 700,
40
- defaultHeight: 520,
41
- minWidth: 640,
42
- minHeight: 480
43
- },
44
- {
45
- id: "pdf",
46
- name: "PDF Viewer",
47
- icon: "📄",
48
- fcIcon: "FcDocument",
49
- defaultWidth: 780,
50
- defaultHeight: 580,
51
- minWidth: 640,
52
- minHeight: 480
53
- },
54
- {
55
- id: "uploader",
56
- name: "Uploader",
57
- icon: "📤",
58
- fcIcon: "FcUpload",
59
- ...a
60
- },
61
- {
62
- id: "menuedit",
63
- name: "MenuEdit",
64
- icon: "📁",
65
- fcIcon: "FcFolder",
66
- singleWindow: !0,
67
- ...a
68
- },
69
- {
70
- id: "device-info",
71
- name: "Device Info",
72
- icon: "📊",
73
- fcIcon: "FcBarChart",
74
- defaultWidth: 300,
75
- defaultHeight: 400,
76
- minWidth: 280,
77
- minHeight: 350,
78
- canMaximize: !1,
79
- alwaysOnTop: !0,
80
- singleWindow: !0
81
- },
82
- {
83
- id: "calendar",
84
- name: "Calendar",
85
- icon: "📅",
86
- fcIcon: "FcCalendar",
87
- defaultWidth: 320,
88
- defaultHeight: 370,
89
- minWidth: !1,
90
- minHeight: !1,
91
- canMaximize: !1,
92
- singleWindow: !0
93
- }
94
- ], s = o.map((e) => e.id), c = [...o], l = [
10
+ }, o = {
11
+ id: "files",
12
+ name: "FilesApp",
13
+ icon: "📁",
14
+ fcIcon: "FcOpenedFolder",
15
+ hasContextMenu: !0,
16
+ ...a
17
+ }, s = {
18
+ id: "settings",
19
+ name: "Settings",
20
+ icon: "⚙️",
21
+ fcIcon: "FcSettings",
22
+ singleWindow: !0,
23
+ ...a
24
+ }, c = {
25
+ id: "notepad",
26
+ name: "Notepad",
27
+ icon: "📝",
28
+ fcIcon: "FcEditImage",
29
+ ...a
30
+ }, l = {
31
+ id: "image-viewer",
32
+ name: "Image Viewer",
33
+ icon: "🖼️",
34
+ fcIcon: "FcPicture",
35
+ defaultWidth: 700,
36
+ defaultHeight: 520,
37
+ minWidth: 640,
38
+ minHeight: 480
39
+ }, u = {
40
+ id: "pdf",
41
+ name: "PDF Viewer",
42
+ icon: "📄",
43
+ fcIcon: "FcDocument",
44
+ defaultWidth: 780,
45
+ defaultHeight: 580,
46
+ minWidth: 640,
47
+ minHeight: 480
48
+ }, d = {
49
+ id: "uploader",
50
+ name: "Uploader",
51
+ icon: "📤",
52
+ fcIcon: "FcUpload",
53
+ ...a
54
+ }, ee = {
55
+ id: "menuedit",
56
+ name: "MenuEdit",
57
+ icon: "📁",
58
+ fcIcon: "FcFolder",
59
+ singleWindow: !0,
60
+ ...a
61
+ }, te = {
62
+ id: "device-info",
63
+ name: "Device Info",
64
+ icon: "📊",
65
+ fcIcon: "FcBarChart",
66
+ defaultWidth: 300,
67
+ defaultHeight: 400,
68
+ minWidth: 280,
69
+ minHeight: 350,
70
+ canMaximize: !1,
71
+ alwaysOnTop: !0,
72
+ singleWindow: !0
73
+ }, ne = {
74
+ id: "calendar",
75
+ name: "Calendar",
76
+ icon: "📅",
77
+ fcIcon: "FcCalendar",
78
+ defaultWidth: 320,
79
+ defaultHeight: 370,
80
+ minWidth: !1,
81
+ minHeight: !1,
82
+ canMaximize: !1,
83
+ singleWindow: !0
84
+ }, f = [
85
+ o,
86
+ s,
87
+ c,
88
+ l,
89
+ u,
90
+ d,
91
+ ee,
92
+ te,
93
+ ne
94
+ ], re = f.map((e) => e.id), p = [...f], m = [
95
95
  "uploader",
96
96
  "settings",
97
97
  "notepad",
98
98
  "files"
99
99
  ];
100
- function u(e) {
101
- for (let t of e) c.find((e) => e.id === t.id) || c.push(t);
100
+ function ie(e) {
101
+ for (let t of e) p.find((e) => e.id === t.id) || p.push(t);
102
102
  }
103
- function d(e) {
104
- for (let t of e) l.includes(t) || l.push(t);
103
+ function ae(e) {
104
+ for (let t of e) m.includes(t) || m.push(t);
105
105
  }
106
106
  //#endregion
107
107
  //#region src/utils/uuid.ts
108
- function f() {
108
+ function h() {
109
109
  return r();
110
110
  }
111
111
  //#endregion
112
112
  //#region src/domain/entities/Window.ts
113
- var p = (e) => ({
113
+ var g = (e) => ({
114
114
  alwaysOnTop: !1,
115
115
  ...e,
116
- id: f(),
116
+ id: h(),
117
117
  isOpen: !0,
118
118
  state: "normal",
119
119
  zIndex: 0
120
- }), m = (e) => ({
120
+ }), _ = (e) => ({
121
121
  ...e,
122
- id: f()
123
- }), h = (e) => ({
124
- id: f(),
122
+ id: h()
123
+ }), oe = (e) => ({
124
+ id: h(),
125
125
  name: e.name,
126
126
  fcIcon: e.fcIcon,
127
127
  appIds: e.appIds ?? [],
128
128
  isExpanded: e.isExpanded ?? !1,
129
129
  isPredefined: e.isPredefined ?? !1,
130
130
  order: e.order ?? 0
131
- }), ee = (e) => ({
132
- id: f(),
131
+ }), se = (e) => ({
132
+ id: h(),
133
133
  name: e.name,
134
134
  fcIcon: e.fcIcon,
135
135
  appIds: e.appIds ?? [],
136
136
  isExpanded: e.isExpanded ?? !1,
137
137
  isPredefined: !0,
138
138
  order: e.order ?? 0
139
- }), g = (e, t) => ({
139
+ }), ce = (e, t) => ({
140
140
  ...e,
141
141
  ...t
142
- }), _ = (e, t = null, n = {}) => ({
143
- id: f(),
142
+ }), v = (e, t = null, n = {}) => ({
143
+ id: h(),
144
144
  name: e,
145
145
  type: "folder",
146
146
  parentId: t,
@@ -148,8 +148,8 @@ var p = (e) => ({
148
148
  createdAt: /* @__PURE__ */ new Date(),
149
149
  updatedAt: /* @__PURE__ */ new Date(),
150
150
  ...n
151
- }), v = (e, t, n = null, r, i) => ({
152
- id: f(),
151
+ }), y = (e, t, n = null, r, i) => ({
152
+ id: h(),
153
153
  name: e,
154
154
  type: "file",
155
155
  content: t,
@@ -158,12 +158,12 @@ var p = (e) => ({
158
158
  createdAt: /* @__PURE__ */ new Date(),
159
159
  updatedAt: /* @__PURE__ */ new Date(),
160
160
  ...i === void 0 ? {} : { url: i }
161
- }), y = 1e4, te = class {
161
+ }), le = 1e4, b = class {
162
162
  windows = /* @__PURE__ */ new Map();
163
163
  nextZIndex = 1;
164
164
  assignZIndex(e) {
165
165
  let t = this.nextZIndex++;
166
- return e ? y + t : t;
166
+ return e ? le + t : t;
167
167
  }
168
168
  reset() {
169
169
  this.windows.clear(), this.nextZIndex = 1;
@@ -173,7 +173,7 @@ var p = (e) => ({
173
173
  let t = 0;
174
174
  for (let n of e) {
175
175
  this.windows.set(n.id, n);
176
- let e = n.alwaysOnTop ?? !1 ? n.zIndex - y : n.zIndex;
176
+ let e = n.alwaysOnTop ?? !1 ? n.zIndex - le : n.zIndex;
177
177
  e > t && (t = e);
178
178
  }
179
179
  this.nextZIndex = t + 1;
@@ -185,7 +185,7 @@ var p = (e) => ({
185
185
  return this.windows.get(e);
186
186
  }
187
187
  open(e) {
188
- let t = p(e);
188
+ let t = g(e);
189
189
  return t.zIndex = this.assignZIndex(t.alwaysOnTop ?? !1), this.windows.set(t.id, t), t;
190
190
  }
191
191
  close(e) {
@@ -225,7 +225,7 @@ var p = (e) => ({
225
225
  ...t
226
226
  });
227
227
  }
228
- }, ne = {
228
+ }, ue = {
229
229
  ".txt": "text/plain",
230
230
  ".md": "text/markdown",
231
231
  ".markdown": "text/markdown",
@@ -246,28 +246,28 @@ var p = (e) => ({
246
246
  ".jsdos": "application/jsdos",
247
247
  ".zip": "application/zip"
248
248
  };
249
- function b(e) {
249
+ function x(e) {
250
250
  let t = e.lastIndexOf(".");
251
- if (!(t === -1 || t === e.length - 1)) return ne[e.slice(t).toLowerCase()];
251
+ if (!(t === -1 || t === e.length - 1)) return ue[e.slice(t).toLowerCase()];
252
252
  }
253
253
  //#endregion
254
254
  //#region src/utils/hashBlob.ts
255
- function re(e) {
255
+ function de(e) {
256
256
  let t = 5381;
257
257
  for (let n = 0; n < e.length; n++) t = (t << 5) + t ^ e[n], t >>>= 0;
258
258
  return t.toString(16).padStart(8, "0") + e.length.toString(16).padStart(8, "0");
259
259
  }
260
- async function x(e) {
260
+ async function S(e) {
261
261
  let t = await e.arrayBuffer(), n = new Uint8Array(t);
262
262
  if (crypto?.subtle) {
263
263
  let e = await crypto.subtle.digest("SHA-256", n);
264
264
  return Array.from(new Uint8Array(e)).map((e) => e.toString(16).padStart(2, "0")).join("");
265
265
  }
266
- return console.warn("[hashBlob] crypto.subtle unavailable (non-secure context), using fallback hash"), re(n);
266
+ return console.warn("[hashBlob] crypto.subtle unavailable (non-secure context), using fallback hash"), de(n);
267
267
  }
268
268
  //#endregion
269
269
  //#region src/infrastructure/adapters/IndexedDBFileSystem.ts
270
- var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T = class {
270
+ var fe = "fde-desktop-fs", C = "nodes", w = "blobs", T = "metadata", pe = 2, me = class {
271
271
  db = null;
272
272
  nodes = /* @__PURE__ */ new Map();
273
273
  ready = !1;
@@ -282,20 +282,20 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
282
282
  }
283
283
  openDatabase() {
284
284
  return new Promise((e, t) => {
285
- let n = indexedDB.open(ie, ae);
285
+ let n = indexedDB.open(fe, pe);
286
286
  n.onerror = () => t(n.error), n.onsuccess = () => {
287
287
  this.db = n.result, e();
288
288
  }, n.onupgradeneeded = () => {
289
289
  let e = n.result;
290
- e.objectStoreNames.contains(S) || e.createObjectStore(S), e.objectStoreNames.contains(C) || e.createObjectStore(C), e.objectStoreNames.contains(w) || e.createObjectStore(w);
290
+ e.objectStoreNames.contains(C) || e.createObjectStore(C), e.objectStoreNames.contains(w) || e.createObjectStore(w), e.objectStoreNames.contains(T) || e.createObjectStore(T);
291
291
  };
292
292
  });
293
293
  }
294
294
  async loadNodes() {
295
295
  if (this.db) return new Promise((e, t) => {
296
- let n = this.db.transaction(S, "readonly"), r = n.objectStore(S).getAll();
296
+ let n = this.db.transaction(C, "readonly"), r = n.objectStore(C).getAll();
297
297
  r.onsuccess = () => {
298
- let i = n.objectStore(S).getAllKeys();
298
+ let i = n.objectStore(C).getAllKeys();
299
299
  i.onsuccess = () => {
300
300
  let t = r.result, n = i.result;
301
301
  for (let e = 0; e < t.length; e++) {
@@ -323,7 +323,7 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
323
323
  }
324
324
  persistAllNodes() {
325
325
  return this.db ? new Promise((e, t) => {
326
- let n = this.db.transaction(S, "readwrite"), r = n.objectStore(S);
326
+ let n = this.db.transaction(C, "readwrite"), r = n.objectStore(C);
327
327
  for (let [e, t] of this.nodes.entries()) r.put(t, e);
328
328
  n.oncomplete = () => e(), n.onerror = () => t(n.error);
329
329
  }) : Promise.resolve();
@@ -337,7 +337,7 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
337
337
  if (!this.db || this.persistQueue.length === 0) return;
338
338
  let e = [...this.persistQueue];
339
339
  this.persistQueue = [];
340
- let t = this.db.transaction(S, "readwrite"), n = t.objectStore(S);
340
+ let t = this.db.transaction(C, "readwrite"), n = t.objectStore(C);
341
341
  t.onerror = () => {
342
342
  console.error("IndexedDB write failed", t.error);
343
343
  };
@@ -358,9 +358,9 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
358
358
  }
359
359
  async saveBlob(e) {
360
360
  this.db || await this.initialize();
361
- let t = await x(e);
361
+ let t = await S(e);
362
362
  return await this.getBlob(`idb://${t}`) ? `idb://${t}` : new Promise((n, r) => {
363
- let i = this.db.transaction(C, "readwrite").objectStore(C).put(e, t);
363
+ let i = this.db.transaction(w, "readwrite").objectStore(w).put(e, t);
364
364
  i.onsuccess = () => n(`idb://${t}`), i.onerror = () => r(i.error);
365
365
  });
366
366
  }
@@ -368,7 +368,7 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
368
368
  this.db || await this.initialize();
369
369
  let t = e.startsWith("idb://") ? e.slice(6) : e;
370
370
  return new Promise((e, n) => {
371
- let r = this.db.transaction(C, "readonly").objectStore(C).get(t);
371
+ let r = this.db.transaction(w, "readonly").objectStore(w).get(t);
372
372
  r.onsuccess = () => e(r.result ?? null), r.onerror = () => n(r.error);
373
373
  });
374
374
  }
@@ -379,7 +379,7 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
379
379
  }
380
380
  async clearBlobs() {
381
381
  if (this.db) return new Promise((e, t) => {
382
- let n = this.db.transaction(C, "readwrite").objectStore(C).clear();
382
+ let n = this.db.transaction(w, "readwrite").objectStore(w).clear();
383
383
  n.onsuccess = () => e(), n.onerror = () => t(n.error);
384
384
  });
385
385
  }
@@ -404,11 +404,11 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
404
404
  return this.nodes.size === 0;
405
405
  }
406
406
  async createFile(e, t, n, r) {
407
- let i = v(e, t, n, b(e), r);
407
+ let i = y(e, t, n, x(e), r);
408
408
  return this.nodes.set(i.id, i), n && this.addChildToFolder(n, i.id), this.persistNode(i.id, i), i;
409
409
  }
410
410
  async createFolder(e, t, n, r) {
411
- let i = _(e, t, {
411
+ let i = v(e, t, {
412
412
  iconName: n,
413
413
  iconColor: r
414
414
  });
@@ -448,22 +448,18 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
448
448
  }
449
449
  async getManifestSha() {
450
450
  return this.db || await this.initialize(), new Promise((e, t) => {
451
- let n = this.db.transaction(w, "readonly").objectStore(w).get("manifestSha");
451
+ let n = this.db.transaction(T, "readonly").objectStore(T).get("manifestSha");
452
452
  n.onsuccess = () => e(n.result ?? null), n.onerror = () => t(n.error);
453
453
  });
454
454
  }
455
455
  async saveManifestSha(e) {
456
456
  return this.db || await this.initialize(), new Promise((t, n) => {
457
- let r = this.db.transaction(w, "readwrite").objectStore(w).put(e, "manifestSha");
457
+ let r = this.db.transaction(T, "readwrite").objectStore(T).put(e, "manifestSha");
458
458
  r.onsuccess = () => t(), r.onerror = () => n(r.error);
459
459
  });
460
460
  }
461
461
  async clearAll() {
462
462
  this.nodes.clear(), this.ready = !1, this.initPromise = null, this.db &&= (await Promise.all([
463
- new Promise((e, t) => {
464
- let n = this.db.transaction(S, "readwrite");
465
- n.objectStore(S).clear(), n.oncomplete = () => e(), n.onerror = () => t(n.error);
466
- }),
467
463
  new Promise((e, t) => {
468
464
  let n = this.db.transaction(C, "readwrite");
469
465
  n.objectStore(C).clear(), n.oncomplete = () => e(), n.onerror = () => t(n.error);
@@ -471,13 +467,17 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
471
467
  new Promise((e, t) => {
472
468
  let n = this.db.transaction(w, "readwrite");
473
469
  n.objectStore(w).clear(), n.oncomplete = () => e(), n.onerror = () => t(n.error);
470
+ }),
471
+ new Promise((e, t) => {
472
+ let n = this.db.transaction(T, "readwrite");
473
+ n.objectStore(T).clear(), n.oncomplete = () => e(), n.onerror = () => t(n.error);
474
474
  })
475
475
  ]), this.db.close(), null);
476
476
  }
477
477
  async seed(e) {
478
478
  let t = this.buildFolderMapFromManifest(e);
479
479
  for (let n of e.files) {
480
- let e = t.get(n.folder), r = v(n.name, "", e?.id ?? null, n.mimeType, n.url);
480
+ let e = t.get(n.folder), r = y(n.name, "", e?.id ?? null, n.mimeType, n.url);
481
481
  if (this.nodes.set(r.id, r), e) {
482
482
  let i = {
483
483
  ...e,
@@ -504,7 +504,7 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
504
504
  }
505
505
  continue;
506
506
  }
507
- let i = v(n.name, "", e.id, n.mimeType, n.url);
507
+ let i = y(n.name, "", e.id, n.mimeType, n.url);
508
508
  this.nodes.set(i.id, i);
509
509
  let a = {
510
510
  ...e,
@@ -525,7 +525,7 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
525
525
  continue;
526
526
  }
527
527
  }
528
- let c = _(i, s);
528
+ let c = v(i, s);
529
529
  if (this.nodes.set(c.id, c), n.set(e, c), o) {
530
530
  let e = {
531
531
  ...o,
@@ -561,8 +561,8 @@ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T =
561
561
  e && (e.type === "folder" && this.deleteRecursive(e), this.nodes.delete(t), this.deleteNodeFromPersist(t));
562
562
  }
563
563
  }
564
- }, oe = "/api/fs", se = 6e4;
565
- async function ce(e, t = {}, n = se) {
564
+ }, he = "/api/fs", ge = 6e4;
565
+ async function _e(e, t = {}, n = ge) {
566
566
  let r = new AbortController(), i = setTimeout(() => r.abort(), n);
567
567
  try {
568
568
  return await fetch(e, {
@@ -573,18 +573,18 @@ async function ce(e, t = {}, n = se) {
573
573
  clearTimeout(i);
574
574
  }
575
575
  }
576
- var E = oe;
577
- function le(e) {
576
+ var E = he;
577
+ function ve(e) {
578
578
  E = e;
579
579
  }
580
- var ue = class {
580
+ var ye = class {
581
581
  nodes = /* @__PURE__ */ new Map();
582
582
  pathToId = /* @__PURE__ */ new Map();
583
583
  ready = !1;
584
584
  rootFolderId;
585
585
  initPromise = null;
586
586
  constructor() {
587
- this.rootFolderId = f(), this.pathToId.set("/", this.rootFolderId);
587
+ this.rootFolderId = h(), this.pathToId.set("/", this.rootFolderId);
588
588
  }
589
589
  async initialize() {
590
590
  return this.initPromise ||= this.doInitialize(), this.initPromise;
@@ -602,7 +602,7 @@ var ue = class {
602
602
  this.ready = !0;
603
603
  }
604
604
  async reinitialize() {
605
- this.ready = !1, this.nodes.clear(), this.pathToId.clear(), this.rootFolderId = f(), this.pathToId.set("/", this.rootFolderId), this.initPromise = null, await this.initialize();
605
+ this.ready = !1, this.nodes.clear(), this.pathToId.clear(), this.rootFolderId = h(), this.pathToId.set("/", this.rootFolderId), this.initPromise = null, await this.initialize();
606
606
  }
607
607
  isReady() {
608
608
  return this.ready;
@@ -625,8 +625,8 @@ var ue = class {
625
625
  return Array.from(this.nodes.values());
626
626
  }
627
627
  async createFile(e, t, n, r) {
628
- let i = f(), a = n ? this.getPathFromId(n) : "/", o = a ? `${a}/${e}`.replace("//", "/") : `/${e}`, s = r ?? `/api/fs?action=file&path=${encodeURIComponent(o)}`, c = {
629
- ...v(e, t, n, this.getMimeType(e), s),
628
+ let i = h(), a = n ? this.getPathFromId(n) : "/", o = a ? `${a}/${e}`.replace("//", "/") : `/${e}`, s = r ?? `/api/fs?action=file&path=${encodeURIComponent(o)}`, c = {
629
+ ...y(e, t, n, this.getMimeType(e), s),
630
630
  id: i
631
631
  };
632
632
  this.nodes.set(i, c), this.pathToId.set(o, i);
@@ -638,10 +638,10 @@ var ue = class {
638
638
  return c;
639
639
  }
640
640
  async createFolder(e, t, n, r) {
641
- let i = f(), a = t ? this.getPathFromId(t) : "/", o = a ? `${a}/${e}`.replace("//", "/") : `/${e}`, s = {};
641
+ let i = h(), a = t ? this.getPathFromId(t) : "/", o = a ? `${a}/${e}`.replace("//", "/") : `/${e}`, s = {};
642
642
  n && (s.iconName = n), r && (s.iconColor = r);
643
643
  let c = {
644
- ..._(e, t, s),
644
+ ...v(e, t, s),
645
645
  id: i
646
646
  };
647
647
  this.nodes.set(i, c), this.pathToId.set(o, i);
@@ -678,7 +678,7 @@ var ue = class {
678
678
  let r = this.getPathFromId(e), i = t ? this.getPathFromId(t) : "/", a = i ? `${i}/${n.name}`.replace("//", "/") : `/${n.name}`;
679
679
  if (!r) throw Error(`Cannot determine path for node ${e}`);
680
680
  if (!i && t !== null) throw Error(`Cannot determine parent path for ${t}`);
681
- let o = await ce(`${E}?action=move&oldPath=${encodeURIComponent(r)}&newPath=${encodeURIComponent(a)}`);
681
+ let o = await _e(`${E}?action=move&oldPath=${encodeURIComponent(r)}&newPath=${encodeURIComponent(a)}`);
682
682
  if (!o.ok) {
683
683
  let e = await o.json().catch(() => ({}));
684
684
  throw Error(e.error || `HTTP ${o.status}`);
@@ -710,7 +710,7 @@ var ue = class {
710
710
  await this.writeFileToServer(e, t);
711
711
  }
712
712
  async saveBlob(e) {
713
- let t = `/.blobs/${await x(e)}.${e.type.split("/")[1] || "bin"}`;
713
+ let t = `/.blobs/${await S(e)}.${e.type.split("/")[1] || "bin"}`;
714
714
  try {
715
715
  await fetch(`${E}?action=writeBinary&path=${encodeURIComponent(t)}`, {
716
716
  method: "POST",
@@ -752,10 +752,10 @@ var ue = class {
752
752
  return Promise.resolve();
753
753
  }
754
754
  async clearAll() {
755
- this.nodes.clear(), this.pathToId.clear(), this.ready = !1, this.initPromise = null, this.rootFolderId = f(), this.pathToId.set("/", this.rootFolderId);
755
+ this.nodes.clear(), this.pathToId.clear(), this.ready = !1, this.initPromise = null, this.rootFolderId = h(), this.pathToId.set("/", this.rootFolderId);
756
756
  }
757
757
  getMimeType(e) {
758
- return b(e) || "application/octet-stream";
758
+ return x(e) || "application/octet-stream";
759
759
  }
760
760
  getPathFromId(e) {
761
761
  if (!e) return null;
@@ -773,9 +773,9 @@ var ue = class {
773
773
  }
774
774
  async syncFromEntries(e, t) {
775
775
  for (let n of e) {
776
- let e = f();
776
+ let e = h();
777
777
  if (n.type === "directory") {
778
- let r = _(n.name, t);
778
+ let r = v(n.name, t);
779
779
  this.nodes.set(e, {
780
780
  ...r,
781
781
  id: e
@@ -783,7 +783,7 @@ var ue = class {
783
783
  let i = await this.fetchReaddir(n.path);
784
784
  await this.syncFromEntries(i, e);
785
785
  } else {
786
- let r = `/api/fs?action=file&path=${encodeURIComponent(n.path)}`, i = v(n.name, "", t, this.getMimeType(n.name), r);
786
+ let r = `/api/fs?action=file&path=${encodeURIComponent(n.path)}`, i = y(n.name, "", t, this.getMimeType(n.name), r);
787
787
  this.nodes.set(e, {
788
788
  ...i,
789
789
  id: e
@@ -835,21 +835,21 @@ var ue = class {
835
835
  function D() {
836
836
  return typeof window > "u" ? "browser" : window.__FDE_IN_DOCKER__ === !0 ? "docker" : typeof navigator < "u" && /Electron/i.test(navigator.userAgent) ? "electron" : "browser";
837
837
  }
838
- function de() {
838
+ function be() {
839
839
  return D() === "docker";
840
840
  }
841
- function fe() {
841
+ function xe() {
842
842
  return D() === "electron";
843
843
  }
844
844
  function O() {
845
845
  return D() === "browser";
846
846
  }
847
- function pe() {
847
+ function Se() {
848
848
  return typeof window > "u" ? !1 : window.__IS_DEV__ === !0 ? !0 : window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
849
849
  }
850
850
  //#endregion
851
851
  //#region src/constants/launcherFolders.ts
852
- var me = "launcher-folder-custom-apps", he = [
852
+ var k = "launcher-folder-custom-apps", A = [
853
853
  {
854
854
  id: "launcher-folder-social-links",
855
855
  name: "Social Links",
@@ -896,7 +896,7 @@ var me = "launcher-folder-custom-apps", he = [
896
896
  order: 3
897
897
  },
898
898
  {
899
- id: me,
899
+ id: k,
900
900
  name: "Custom Apps",
901
901
  fcIcon: "VscExtensions",
902
902
  appIds: [],
@@ -904,59 +904,59 @@ var me = "launcher-folder-custom-apps", he = [
904
904
  isPredefined: !0,
905
905
  order: 4
906
906
  }
907
- ], k = [...he], A = null, j = null, M = 0, ge = 5e3, N = "/dist-apps/apps-manifest.json";
908
- async function P(e = !1) {
907
+ ], j = [...A], M = null, N = null, P = 0, Ce = 5e3, F = "/dist-apps/apps-manifest.json";
908
+ async function I(e = !1) {
909
909
  let t = Date.now();
910
- if (!e && A && t - M < ge) return A;
911
- if (j) return j;
912
- let n = `${N}?t=${t}`;
913
- return j = fetch(n).then(async (e) => {
910
+ if (!e && M && t - P < Ce) return M;
911
+ if (N) return N;
912
+ let n = `${F}?t=${t}`;
913
+ return N = fetch(n).then(async (e) => {
914
914
  if (!e.ok) {
915
- if (e.status === 404) return console.warn("[CustomApps] No apps manifest found at", N), null;
915
+ if (e.status === 404) return console.warn("[CustomApps] No apps manifest found at", F), null;
916
916
  throw Error(`Failed to fetch manifest: ${e.status}`);
917
917
  }
918
918
  return e.json();
919
- }).then((e) => (A = e, M = Date.now(), j = null, console.log(`[CustomApps] Loaded manifest with ${e.apps.length} apps`), e)).catch((e) => (console.error("[CustomApps] Error fetching manifest:", e), j = null, null)), j;
919
+ }).then((e) => (M = e, P = Date.now(), N = null, console.log(`[CustomApps] Loaded manifest with ${e.apps.length} apps`), e)).catch((e) => (console.error("[CustomApps] Error fetching manifest:", e), N = null, null)), N;
920
920
  }
921
- function _e() {
922
- return A;
921
+ function we() {
922
+ return M;
923
923
  }
924
- function F() {
925
- A = null, M = 0;
924
+ function L() {
925
+ M = null, P = 0;
926
926
  }
927
- function ve(e) {
928
- if (!A) {
929
- A = {
927
+ function Te(e) {
928
+ if (!M) {
929
+ M = {
930
930
  version: "1.0.0",
931
931
  generated: (/* @__PURE__ */ new Date()).toISOString(),
932
932
  apps: [e]
933
933
  };
934
934
  return;
935
935
  }
936
- A = A.apps.some((t) => t.id === e.id) ? {
937
- ...A,
938
- apps: A.apps.map((t) => t.id === e.id ? e : t)
936
+ M = M.apps.some((t) => t.id === e.id) ? {
937
+ ...M,
938
+ apps: M.apps.map((t) => t.id === e.id ? e : t)
939
939
  } : {
940
- ...A,
941
- apps: [...A.apps, e]
940
+ ...M,
941
+ apps: [...M.apps, e]
942
942
  };
943
943
  }
944
- function ye(e) {
945
- A &&= {
946
- ...A,
947
- apps: A.apps.filter((t) => t.id !== e)
944
+ function Ee(e) {
945
+ M &&= {
946
+ ...M,
947
+ apps: M.apps.filter((t) => t.id !== e)
948
948
  };
949
949
  }
950
- async function I() {
951
- return (await P())?.apps ?? [];
950
+ async function De() {
951
+ return (await I())?.apps ?? [];
952
952
  }
953
- async function be(e) {
954
- return (await I()).find((t) => t.id === e);
953
+ async function Oe(e) {
954
+ return (await De()).find((t) => t.id === e);
955
955
  }
956
- function xe(e) {
957
- return A ? A.apps.some((t) => t.id === e) : !1;
956
+ function ke(e) {
957
+ return M ? M.apps.some((t) => t.id === e) : !1;
958
958
  }
959
- function Se(e) {
959
+ function Ae(e) {
960
960
  return {
961
961
  id: e.id,
962
962
  name: e.name,
@@ -970,7 +970,7 @@ function Se(e) {
970
970
  alwaysOnTop: e.window.alwaysOnTop
971
971
  };
972
972
  }
973
- function Ce(e, t) {
973
+ function je(e, t) {
974
974
  let n = new Set(t.map((e) => e.id)), r = e.filter((e) => !n.has(e.id)), i = t.map((e) => {
975
975
  let t = {
976
976
  id: e.id,
@@ -987,9 +987,9 @@ function Ce(e, t) {
987
987
  });
988
988
  return [...r, ...i];
989
989
  }
990
- async function we(e) {
991
- F();
992
- let t = await P(!0);
990
+ async function Me(e) {
991
+ L();
992
+ let t = await I(!0);
993
993
  if (!t) return {
994
994
  added: [],
995
995
  removed: [],
@@ -1004,26 +1004,26 @@ async function we(e) {
1004
1004
  }
1005
1005
  //#endregion
1006
1006
  //#region src/utils/sortNodes.ts
1007
- var L = (e) => {
1007
+ var R = (e) => {
1008
1008
  let t = e.filter((e) => e.type === "folder"), n = e.filter((e) => e.type === "file"), r = (e, t) => e.name.localeCompare(t.name);
1009
1009
  return [...t.sort(r), ...n.sort(r)];
1010
- }, Te = {
1010
+ }, Ne = {
1011
1011
  BY_TYPE: "byType",
1012
1012
  BY_NAME: "byName",
1013
1013
  BY_DATE: "byDate"
1014
1014
  };
1015
- function R(e) {
1015
+ function z(e) {
1016
1016
  return e.nodeId ? e.appId === "files" ? "folder" : "file" : "app";
1017
1017
  }
1018
- var z = {
1018
+ var B = {
1019
1019
  app: 0,
1020
1020
  folder: 1,
1021
1021
  file: 2
1022
1022
  };
1023
- function B(e, t) {
1023
+ function V(e, t) {
1024
1024
  return [...e].sort((e, n) => {
1025
- let r = R(e), i = R(n);
1026
- if (r !== i) return z[r] - z[i];
1025
+ let r = z(e), i = z(n);
1026
+ if (r !== i) return B[r] - B[i];
1027
1027
  if (r === "app") {
1028
1028
  if (!t) return e.name.localeCompare(n.name);
1029
1029
  let r = t.indexOf(e.appId), i = t.indexOf(n.appId);
@@ -1032,35 +1032,35 @@ function B(e, t) {
1032
1032
  return e.name.localeCompare(n.name);
1033
1033
  });
1034
1034
  }
1035
- var V = (e, t) => {
1035
+ var Pe = (e, t) => {
1036
1036
  switch (t) {
1037
- case "default": return B(e);
1037
+ case "default": return V(e);
1038
1038
  case "name-asc": return [...e].sort((e, t) => e.name.localeCompare(t.name));
1039
1039
  case "name-desc": return [...e].sort((e, t) => t.name.localeCompare(e.name));
1040
1040
  case "type": return [...e].sort((e, t) => {
1041
- let n = R(e), r = R(t);
1042
- return n === r ? e.name.localeCompare(t.name) : z[n] - z[r];
1041
+ let n = z(e), r = z(t);
1042
+ return n === r ? e.name.localeCompare(t.name) : B[n] - B[r];
1043
1043
  });
1044
- default: return B(e);
1044
+ default: return V(e);
1045
1045
  }
1046
- }, Ee = (e, t) => {
1046
+ }, Fe = (e, t) => {
1047
1047
  switch (t) {
1048
1048
  case "default":
1049
- case "type": return L(e);
1049
+ case "type": return R(e);
1050
1050
  case "name-asc": return [...e].sort((e, t) => e.name.localeCompare(t.name));
1051
1051
  case "name-desc": return [...e].sort((e, t) => t.name.localeCompare(e.name));
1052
- default: return L(e);
1052
+ default: return R(e);
1053
1053
  }
1054
- }, De = [], H = (e) => {
1055
- De.push(e);
1056
- }, Oe = new Set([
1054
+ }, Ie = [], H = (e) => {
1055
+ Ie.push(e);
1056
+ }, Le = new Set([
1057
1057
  "image/jpeg",
1058
1058
  "image/png",
1059
1059
  "image/gif",
1060
1060
  "image/svg+xml",
1061
1061
  "image/webp",
1062
1062
  "image/bmp"
1063
- ]), ke = new Set([
1063
+ ]), Re = new Set([
1064
1064
  "text/plain",
1065
1065
  "text/markdown",
1066
1066
  "text/x-markdown",
@@ -1072,11 +1072,11 @@ H({
1072
1072
  transformContentData: (e) => ({ src: e.url ?? e.name })
1073
1073
  }), H({
1074
1074
  appId: "image-viewer",
1075
- mimeTypes: (e) => Oe.has(e) || e.startsWith("image/"),
1075
+ mimeTypes: (e) => Le.has(e) || e.startsWith("image/"),
1076
1076
  transformContentData: (e) => ({ src: e.url ?? e.name })
1077
1077
  }), H({
1078
1078
  appId: "notepad",
1079
- mimeTypes: (e) => ke.has(e) || e.startsWith("text/"),
1079
+ mimeTypes: (e) => Re.has(e) || e.startsWith("text/"),
1080
1080
  transformContentData: (e) => ({
1081
1081
  url: e.url,
1082
1082
  initialName: e.name,
@@ -1094,14 +1094,14 @@ H({
1094
1094
  name: e.name
1095
1095
  } })
1096
1096
  });
1097
- function Ae(e) {
1097
+ function ze(e) {
1098
1098
  if (!e) return null;
1099
- for (let t of De) if (typeof t.mimeTypes == "function" ? t.mimeTypes(e) : t.mimeTypes.includes(e)) return t;
1099
+ for (let t of Ie) if (typeof t.mimeTypes == "function" ? t.mimeTypes(e) : t.mimeTypes.includes(e)) return t;
1100
1100
  return null;
1101
1101
  }
1102
1102
  function U(e) {
1103
- if (typeof e == "string" || e === void 0) return Ae(e)?.appId ?? "files";
1104
- let t = Ae(e.mimeType);
1103
+ if (typeof e == "string" || e === void 0) return ze(e)?.appId ?? "files";
1104
+ let t = ze(e.mimeType);
1105
1105
  return t ? {
1106
1106
  appId: t.appId,
1107
1107
  contentData: t.transformContentData(e)
@@ -1183,11 +1183,11 @@ var W = {
1183
1183
  setDevServerOffline: (t) => e({ devServerOffline: t }),
1184
1184
  incrementHmrRetry: () => e((e) => ({ hmrRetryCount: e.hmrRetryCount + 1 })),
1185
1185
  resetHmrRetry: () => e({ hmrRetryCount: 0 })
1186
- })), je = "/", K = null, q = null;
1187
- function Me(e) {
1186
+ })), Be = "/", K = null, q = null;
1187
+ function Ve(e) {
1188
1188
  q = e, K = null;
1189
1189
  }
1190
- function Ne() {
1190
+ function He() {
1191
1191
  if (K !== null) return K;
1192
1192
  if (q !== null) return K = q, K;
1193
1193
  let e = document.querySelector("base[href]");
@@ -1195,36 +1195,36 @@ function Ne() {
1195
1195
  let t = e.getAttribute("href");
1196
1196
  if (t) return K = t, t;
1197
1197
  }
1198
- return K = je, K;
1198
+ return K = Be, K;
1199
1199
  }
1200
- function Pe() {
1200
+ function Ue() {
1201
1201
  K = null;
1202
1202
  }
1203
- function Fe(e) {
1203
+ function We(e) {
1204
1204
  if (!e || e.startsWith("http://") || e.startsWith("https://") || e.startsWith("idb://") || e.startsWith("blob:") || e.startsWith("/")) return e;
1205
- let t = Ne();
1205
+ let t = He();
1206
1206
  return (t.endsWith("/") ? t : `${t}/`) + e;
1207
1207
  }
1208
1208
  //#endregion
1209
1209
  //#region src/constants/breakpoints.ts
1210
- var Ie = {
1210
+ var Ge = {
1211
1211
  MOBILE: 768,
1212
1212
  TABLET: 1024,
1213
1213
  DESKTOP: 1280
1214
- }, Le = {
1214
+ }, Ke = {
1215
1215
  WIDTH: 1280,
1216
1216
  HEIGHT: 800
1217
- }, Re = 48, ze = 80, Be = 80, Ve = 20, He = Le.WIDTH, J = Le.HEIGHT, Ue = async () => {
1218
- let e = await fetch(Fe("fs-manifest.json")), t = e.headers.get("content-type")?.includes("application/json");
1217
+ }, qe = 48, Je = 80, Ye = 80, Xe = 20, Ze = Ke.WIDTH, Qe = Ke.HEIGHT, J = async () => {
1218
+ let e = await fetch(We("fs-manifest.json")), t = e.headers.get("content-type")?.includes("application/json");
1219
1219
  return e.ok && t ? await e.json() : null;
1220
- }, Y = new te();
1221
- function We() {
1222
- return de() ? (console.log("[FileSystem] Using DockerFileSystemAdapter"), new ue()) : (console.log("[FileSystem] Using IndexedDBFileSystem"), new T());
1220
+ }, Y = new b();
1221
+ function $e() {
1222
+ return be() ? (console.log("[FileSystem] Using DockerFileSystemAdapter"), new ye()) : (console.log("[FileSystem] Using IndexedDBFileSystem"), new me());
1223
1223
  }
1224
- var X = We(), Ge = () => {
1224
+ var X = $e(), et = () => {
1225
1225
  X.clearAll().catch(() => {});
1226
- }, Ke = () => Y.reset();
1227
- async function qe(e, t) {
1226
+ }, tt = () => Y.reset();
1227
+ async function nt(e, t) {
1228
1228
  if (e.startsWith("idb://")) {
1229
1229
  let t = await X.getBlob(e);
1230
1230
  return t ? t.text() : "";
@@ -1232,7 +1232,7 @@ async function qe(e, t) {
1232
1232
  let n = e.startsWith("http") || e.startsWith("/") ? e : `/${e}`, r = await fetch(n, { signal: t });
1233
1233
  return r.ok ? r.text() : "";
1234
1234
  }
1235
- var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "Desktop")?.id ?? null, Je = (e, t) => {
1235
+ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "Desktop")?.id ?? null, rt = (e, t) => {
1236
1236
  let n = new Set(e.map((e) => `${e.x},${e.y}`)), r = Math.max(1, Math.floor((t - 20) / 80));
1237
1237
  for (let e = 0;; e++) {
1238
1238
  let t = 20 + e * 80;
@@ -1244,19 +1244,19 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1244
1244
  };
1245
1245
  }
1246
1246
  }
1247
- }, Ye = (e, t) => {
1247
+ }, it = (e, t) => {
1248
1248
  let n = Math.max(1, Math.floor((t - 20) / 80)), r = Math.floor(e / n), i = e % n;
1249
1249
  return {
1250
1250
  x: 20 + r * 80,
1251
1251
  y: 20 + i * 80
1252
1252
  };
1253
1253
  }, Q = (e, t, n) => {
1254
- let r = Je(e, n);
1255
- return [...e, m({
1254
+ let r = rt(e, n);
1255
+ return [...e, _({
1256
1256
  ...t,
1257
1257
  ...r
1258
1258
  })];
1259
- }, Xe = () => {
1259
+ }, at = () => {
1260
1260
  let e = Z();
1261
1261
  if (!e || !X.isReady()) return;
1262
1262
  let t = X.getChildren(e), n = new Set(t.map((e) => e.id)), r = new Set(t.map((e) => e.name)), { icons: i, viewportHeight: a } = $.getState(), o = i.filter((e) => !e.nodeId || n.has(e.nodeId) || r.has(e.name));
@@ -1278,10 +1278,10 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1278
1278
  }, a);
1279
1279
  }
1280
1280
  }
1281
- let s = B(o);
1281
+ let s = V(o);
1282
1282
  $.setState({ icons: s.map((e, t) => ({
1283
1283
  ...e,
1284
- ...Ye(t, a)
1284
+ ...it(t, a)
1285
1285
  })) });
1286
1286
  }, $ = e()(n((e, t) => ({
1287
1287
  windows: [],
@@ -1331,7 +1331,7 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1331
1331
  },
1332
1332
  icons: [],
1333
1333
  addIcon: (t) => {
1334
- let n = m(t);
1334
+ let n = _(t);
1335
1335
  e((e) => ({ icons: [...e.icons, n] }));
1336
1336
  },
1337
1337
  removeIcon: (t) => {
@@ -1343,7 +1343,7 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1343
1343
  initFs: async () => {
1344
1344
  try {
1345
1345
  X.isReady() && X.reinitialize ? await X.reinitialize() : X.isReady() || await X.initialize();
1346
- let n = await Ue();
1346
+ let n = await J();
1347
1347
  if (n) {
1348
1348
  let e = n.sha ?? null, t = await X.getManifestSha();
1349
1349
  X.isEmpty() ? (await X.seed(n), e && await X.saveManifestSha(e)) : t !== e && e !== null && (await X.mergeSeed(n), await X.saveManifestSha(e));
@@ -1355,11 +1355,11 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1355
1355
  }), !O()) {
1356
1356
  let n = null;
1357
1357
  try {
1358
- if (n = await P(), n?.apps?.length) {
1358
+ if (n = await I(), n?.apps?.length) {
1359
1359
  e({ customApps: n.apps });
1360
1360
  for (let e of n.apps) G.getState().registerApp(e);
1361
1361
  }
1362
- let r = new Set(n?.apps?.map((e) => e.id) ?? []), i = t().icons.filter((e) => e.appId && !c.find((t) => t.id === e.appId) && !r.has(e.appId)).map((e) => e.appId);
1362
+ let r = new Set(n?.apps?.map((e) => e.id) ?? []), i = t().icons.filter((e) => e.appId && !p.find((t) => t.id === e.appId) && !r.has(e.appId)).map((e) => e.appId);
1363
1363
  i.length > 0 && e((e) => ({
1364
1364
  icons: e.icons.filter((e) => !i.includes(e.appId)),
1365
1365
  customApps: e.customApps.filter((e) => !i.includes(e.id))
@@ -1368,8 +1368,8 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1368
1368
  console.warn("[DesktopStore] Failed to load custom apps manifest:", e);
1369
1369
  }
1370
1370
  }
1371
- for (let n of l) {
1372
- let r = c.find((e) => e.id === n);
1371
+ for (let n of m) {
1372
+ let r = p.find((e) => e.id === n);
1373
1373
  r && (t().icons.some((e) => e.appId === n) || e({ icons: Q(t().icons, {
1374
1374
  name: r.name,
1375
1375
  icon: r.icon,
@@ -1398,7 +1398,7 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1398
1398
  appId: U(n.mimeType),
1399
1399
  nodeId: n.id
1400
1400
  }, t().viewportHeight) });
1401
- }), Xe();
1401
+ }), at();
1402
1402
  } catch (t) {
1403
1403
  console.error("Failed to initialize filesystem:", t), e({ isFsReady: !0 });
1404
1404
  }
@@ -1446,7 +1446,7 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1446
1446
  e({ fsNodes: t });
1447
1447
  },
1448
1448
  syncIcons: () => {
1449
- Xe();
1449
+ at();
1450
1450
  },
1451
1451
  clipboard: {
1452
1452
  content: [],
@@ -1503,7 +1503,7 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1503
1503
  },
1504
1504
  mergeDesktopApps: (n) => {
1505
1505
  for (let r of n) {
1506
- let n = c.find((e) => e.id === r);
1506
+ let n = p.find((e) => e.id === r);
1507
1507
  n && (t().icons.some((e) => e.appId === r) || e({ icons: Q(t().icons, {
1508
1508
  name: n.name,
1509
1509
  icon: n.icon,
@@ -1545,8 +1545,8 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1545
1545
  removeNotification: (t) => {
1546
1546
  e((e) => ({ notifications: e.notifications.filter((e) => e.id !== t) }));
1547
1547
  },
1548
- viewportWidth: He,
1549
- viewportHeight: J,
1548
+ viewportWidth: Ze,
1549
+ viewportHeight: Qe,
1550
1550
  isViewportInitialized: !1,
1551
1551
  setViewportSize: (n, r) => {
1552
1552
  let i = t().viewportWidth, a = t().viewportHeight, o = t().isViewportInitialized;
@@ -1596,25 +1596,25 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1596
1596
  filesSortMode: "default",
1597
1597
  setDesktopSortMode: (n) => {
1598
1598
  e({ desktopSortMode: n });
1599
- let r = t().icons, i = V(r, n), a = t().viewportHeight;
1599
+ let r = t().icons, i = Pe(r, n), a = t().viewportHeight;
1600
1600
  e({ icons: i.map((e, t) => ({
1601
1601
  ...e,
1602
- ...Ye(t, a)
1602
+ ...it(t, a)
1603
1603
  })) });
1604
1604
  },
1605
1605
  setFilesSortMode: (t) => {
1606
1606
  e({ filesSortMode: t });
1607
1607
  },
1608
- launcherFolders: k,
1608
+ launcherFolders: j,
1609
1609
  setLauncherFolders: (t) => {
1610
1610
  e({ launcherFolders: t });
1611
1611
  },
1612
1612
  createLauncherFolder: (t) => {
1613
- let n = h(t);
1613
+ let n = oe(t);
1614
1614
  return e((e) => ({ launcherFolders: [...e.launcherFolders, n].sort((e, t) => e.order - t.order) })), n;
1615
1615
  },
1616
1616
  updateLauncherFolder: (t, n) => {
1617
- e((e) => ({ launcherFolders: e.launcherFolders.map((e) => e.id === t ? g(e, n) : e) }));
1617
+ e((e) => ({ launcherFolders: e.launcherFolders.map((e) => e.id === t ? ce(e, n) : e) }));
1618
1618
  },
1619
1619
  deleteLauncherFolder: (t) => {
1620
1620
  e((e) => ({ launcherFolders: e.launcherFolders.filter((e) => e.id !== t || e.isPredefined) }));
@@ -1666,7 +1666,7 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1666
1666
  }),
1667
1667
  merge: (e, t) => {
1668
1668
  let n = e, r = ["createItem"], i = (n.windows ?? []).filter((e) => !r.includes(e.content)).map((e) => {
1669
- let r = c.find((t) => t.id === e.content), i = (n.customApps ?? t.customApps)?.find((t) => t.id === e.content);
1669
+ let r = p.find((t) => t.id === e.content), i = (n.customApps ?? t.customApps)?.find((t) => t.id === e.content);
1670
1670
  return {
1671
1671
  ...e,
1672
1672
  icon: e.icon ?? r?.icon ?? i?.icon,
@@ -1679,15 +1679,15 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1679
1679
  };
1680
1680
  });
1681
1681
  Y.loadWindows(i);
1682
- let o = new Set(k.map((e) => e.id)), s = (n.launcherFolders ?? []).filter((e) => !o.has(e.id)), l = [...k, ...s].sort((e, t) => e.order - t.order), u = n.viewportWidth != null && n.viewportHeight != null;
1682
+ let o = new Set(j.map((e) => e.id)), s = (n.launcherFolders ?? []).filter((e) => !o.has(e.id)), c = [...j, ...s].sort((e, t) => e.order - t.order), l = n.viewportWidth != null && n.viewportHeight != null;
1683
1683
  return {
1684
1684
  ...t,
1685
1685
  ...n,
1686
1686
  windows: i,
1687
- launcherFolders: l,
1687
+ launcherFolders: c,
1688
1688
  viewportWidth: n.viewportWidth ?? t.viewportWidth,
1689
1689
  viewportHeight: n.viewportHeight ?? t.viewportHeight,
1690
- isViewportInitialized: u ? !0 : t.isViewportInitialized
1690
+ isViewportInitialized: l ? !0 : t.isViewportInitialized
1691
1691
  };
1692
1692
  }
1693
1693
  }));
@@ -1695,4 +1695,4 @@ typeof window < "u" && (window.__DESKTOP_STATE__ = $.getState(), $.subscribe((e)
1695
1695
  window.__DESKTOP_STATE__ = e;
1696
1696
  }));
1697
1697
  //#endregion
1698
- export { v as $, P as A, k as B, Te as C, Ee as D, L as E, Ce as F, de as G, D as H, ye as I, le as J, fe as K, we as L, be as M, I as N, F as O, xe as P, te as Q, ve as R, H as S, V as T, O as U, he as V, pe as W, x as X, T as Y, b as Z, Me as _, qe as a, p as at, ke as b, He as c, c as ct, Be as d, d as dt, _ as et, Re as f, o as ft, Fe as g, Pe as h, Ke as i, m as it, _e as j, Se as k, ze as l, l as lt, Ne as m, a as mt, X as n, ee as nt, $ as o, f as ot, Ie as p, s as pt, ue as q, Ge as r, g as rt, J as s, i as st, Ue as t, h as tt, Ve as u, u as ut, G as v, B as w, U as x, Oe as y, me as z };
1698
+ export { y as $, I as A, j as B, Ne as C, Fe as D, R as E, je as F, be as G, D as H, Ee as I, ve as J, xe as K, Me as L, Oe as M, De as N, L as O, ke as P, b as Q, Te as R, H as S, Pe as T, O as U, A as V, Se as W, S as X, me as Y, x as Z, Ve as _, nt as a, g as at, Re as b, Ze as c, p as ct, Ye as d, ae as dt, v as et, qe as f, f as ft, We as g, Ue as h, a as ht, tt as i, _ as it, we as j, Ae as k, Je as l, m as lt, He as m, ne as mt, X as n, se as nt, $ as o, h as ot, Ge as p, re as pt, ye as q, et as r, ce as rt, Qe as s, i as st, J as t, oe as tt, Xe as u, ie as ut, G as v, V as w, U as x, Le as y, k as z };