@seedprotocol/react 0.7.4-next.793.g6dd83dd → 0.7.5-next.850.g9ab585b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,23 +1,22 @@
1
1
  import e, { createContext as t, useCallback as n, useContext as r, useEffect as i, useInsertionEffect as a, useMemo as o, useRef as s, useState as c } from "react";
2
2
  import { flushSync as l } from "react-dom";
3
- import { BaseArweaveClient as u, BaseDb as d, BaseFileManager as f, ClientManagerState as p, EAS_SEED_DATA_SYNCED_TO_DB_EVENT as m, FILES_CHANGED_EVENT as h, Item as g, ItemProperty as _, Model as v, ModelProperty as y, SEED_PROTOCOL_SCHEMA_NAME as b, Schema as x, client as S, easSyncProcesses as C, ensureImageLocal as w, eventEmitter as T, getAddressesForItemsFilter as ee, getArweaveReadBaseUrls as E, getClient as D, getPropertySchema as te, getSchemaNameFromId as ne, getVersionData as re, loadAllSchemasFromDb as ie, metadata as O, modelSchemas as ae, models as k, normalizeArweaveTxIdForEnsure as A, normalizeFeedItemFields as oe, ownedSeedsSql as j, pickLatestMetadataRowPerProperty as se, placeholderUidSql as ce, properties as le, publisherInAddressListSql as ue, resolveMediaRef as de, schemas as M, seeds as N } from "@seedprotocol/sdk";
4
- import { debounce as fe, orderBy as pe, startCase as P } from "lodash-es";
5
- import F from "debug";
6
- import { useSelector as I } from "@xstate/react";
7
- import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
8
- import { QueryClient as me, QueryClientContext as B, QueryClientProvider as he, useQuery as V, useQueryClient as H } from "@tanstack/react-query";
9
- import { and as ge, desc as _e, eq as U, gt as ve, isNotNull as W, isNull as ye, or as G } from "drizzle-orm";
10
- import { toSnakeCase as be } from "drizzle-orm/casing";
11
- import xe from "pluralize";
3
+ import { BaseArweaveClient as u, BaseDb as d, BaseFileManager as f, ClientManagerState as p, EAS_SEED_DATA_SYNCED_TO_DB_EVENT as m, FILES_CHANGED_EVENT as h, Item as g, ItemProperty as _, Model as v, ModelProperty as y, SEED_PROTOCOL_SCHEMA_NAME as b, Schema as x, client as S, easName as C, easSyncProcesses as w, ensureImageLocal as T, eventEmitter as E, getAddressesForItemsFilter as ee, getArweaveReadBaseUrls as D, getClient as O, getPropertySchema as te, getSchemaNameFromId as k, getVersionData as ne, loadAllSchemasFromDb as re, metadata as A, modelSchemas as j, models as M, normalizeArweaveTxIdForEnsure as ie, normalizeFeedItemFields as ae, ownedSeedsSql as oe, pickLatestMetadataRowPerProperty as se, placeholderUidSql as ce, properties as le, publisherInAddressListSql as ue, resolveMediaRef as N, schemas as P, seeds as F } from "@seedprotocol/sdk";
4
+ import { debounce as I, orderBy as L, startCase as de } from "lodash-es";
5
+ import R from "debug";
6
+ import { useSelector as fe } from "@xstate/react";
7
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
8
+ import { QueryClient as H, QueryClientContext as pe, QueryClientProvider as me, useQuery as U, useQueryClient as he } from "@tanstack/react-query";
9
+ import { and as ge, desc as _e, eq as W, gt as G, isNotNull as ve, isNull as ye, or as K } from "drizzle-orm";
10
+ import be from "pluralize";
12
11
  //#region src/client.ts
13
- var K = () => {
14
- let e = D().getService();
15
- return I(e, (e) => e.value === p.IDLE);
16
- }, q = "addresses.persisted", Se = "localCopies.removed", Ce = t(0);
17
- function we() {
18
- return r(Ce);
19
- }
20
- function Te({ queryClient: e, children: t }) {
12
+ var q = () => {
13
+ let e = O().getService();
14
+ return fe(e, (e) => e.value === p.IDLE);
15
+ }, J = "addresses.persisted", xe = "localCopies.removed", Se = t(0);
16
+ function Ce() {
17
+ return r(Se);
18
+ }
19
+ function we({ queryClient: e, children: t }) {
21
20
  let [r, a] = c(0), o = n(() => {
22
21
  e.invalidateQueries({
23
22
  queryKey: ["seed", "items"],
@@ -30,19 +29,19 @@ function Te({ queryClient: e, children: t }) {
30
29
  exact: !1
31
30
  }), a((e) => e + 1);
32
31
  }, [e]);
33
- return i(() => (T.on(q, o), T.on(Se, o), () => {
34
- T.off(q, o), T.off(Se, o);
35
- }), [o]), /* @__PURE__ */ R(Ce.Provider, {
32
+ return i(() => (E.on(J, o), E.on(xe, o), () => {
33
+ E.off(J, o), E.off(xe, o);
34
+ }), [o]), /* @__PURE__ */ B(Se.Provider, {
36
35
  value: r,
37
36
  children: t
38
37
  });
39
38
  }
40
39
  //#endregion
41
40
  //#region src/liveQuery.ts
42
- function J(e) {
43
- return De(e).data;
41
+ function Y(e) {
42
+ return Ee(e).data;
44
43
  }
45
- function Ee(e) {
44
+ function Te(e) {
46
45
  if (e && typeof e == "object" && typeof e.toSQL == "function") try {
47
46
  let { sql: t, params: n } = e.toSQL();
48
47
  return `sql:${t}|${JSON.stringify(n)}`;
@@ -51,11 +50,11 @@ function Ee(e) {
51
50
  }
52
51
  return e;
53
52
  }
54
- function De(e) {
53
+ function Ee(e) {
55
54
  let [t, n] = c({
56
55
  data: void 0,
57
56
  error: null
58
- }), r = K(), a = Ee(e), l = s(e);
57
+ }), r = q(), a = Te(e), l = s(e);
59
58
  l.current = e;
60
59
  let u = o(() => {
61
60
  let e = l.current;
@@ -90,16 +89,16 @@ function De(e) {
90
89
  }
91
90
  //#endregion
92
91
  //#region src/queryClient.ts
93
- var Oe = { queries: {
92
+ var De = { queries: {
94
93
  networkMode: "offlineFirst",
95
94
  gcTime: 864e5,
96
95
  staleTime: 6e4
97
96
  } };
98
- function ke() {
99
- return { ...Oe };
97
+ function Oe() {
98
+ return { ...De };
100
99
  }
101
- function Ae(e) {
102
- let t = ke();
100
+ function ke(e) {
101
+ let t = Oe();
103
102
  return e ? {
104
103
  queries: {
105
104
  ...t.queries,
@@ -111,27 +110,27 @@ function Ae(e) {
111
110
  }
112
111
  } : t;
113
112
  }
114
- function Y(e) {
115
- let t = ke(), { defaultOptions: n, ...r } = e ?? {};
116
- return new me({
113
+ function X(e) {
114
+ let t = Oe(), { defaultOptions: n, ...r } = e ?? {};
115
+ return new H({
117
116
  ...r,
118
- defaultOptions: n ? Ae(n) : t
117
+ defaultOptions: n ? ke(n) : t
119
118
  });
120
119
  }
121
- var je;
122
- function Me() {
123
- return r(B) || (je ?? (je = Y()), je);
120
+ var Ae;
121
+ function je() {
122
+ return r(pe) || (Ae ?? (Ae = X()), Ae);
124
123
  }
125
124
  //#endregion
126
125
  //#region src/item.ts
127
- var Ne = F("seedSdk:react:item"), Pe = (e) => [
126
+ var Me = R("seedSdk:react:item"), Ne = (e) => [
128
127
  "seed",
129
128
  "item",
130
129
  e ?? null
131
- ], Fe = ({ modelName: e, seedLocalId: t, seedUid: n }) => {
132
- let r = t || n, [, a] = c(0), [, l] = c(0), [u, d] = c(!1), [f, p] = c(null), h = s(!1), _ = K(), v = Me(), y = o(() => Pe(r), [r]), b = s(y);
130
+ ], Pe = ({ modelName: e, seedLocalId: t, seedUid: n }) => {
131
+ let r = t || n, [, a] = c(0), [, l] = c(0), [u, d] = c(!1), [f, p] = c(null), h = s(!1), _ = q(), v = je(), y = o(() => Ne(r), [r]), b = s(y);
133
132
  b.current = y;
134
- let x = V({
133
+ let x = U({
135
134
  queryKey: y,
136
135
  queryFn: async () => {
137
136
  let i = g.peekReady(r) ?? await g.find({
@@ -140,7 +139,7 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
140
139
  seedUid: n
141
140
  });
142
141
  if (i) return i;
143
- Ne("[useItem] no item found", e, r);
142
+ Me("[useItem] no item found", e, r);
144
143
  let a = v.getQueryData(y);
145
144
  return a && a.getService().getSnapshot().status === "active" ? a : null;
146
145
  },
@@ -155,8 +154,8 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
155
154
  let e = () => {
156
155
  a((e) => e + 1), v.invalidateQueries({ queryKey: b.current });
157
156
  };
158
- return T.on(m, e), () => {
159
- T.off(m, e);
157
+ return E.on(m, e), () => {
158
+ E.off(m, e);
160
159
  };
161
160
  }, [v]), i(() => {
162
161
  if (h.current = !1, d(!1), p(null), !S) return;
@@ -191,7 +190,7 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
191
190
  isLoading: !!r && x.isPending || u,
192
191
  error: f ?? x.error
193
192
  };
194
- }, Ie = (e, t, n, r, i, a, o) => [
193
+ }, Fe = (e, t, n, r, i, a, o) => [
195
194
  "seed",
196
195
  "items",
197
196
  e ?? null,
@@ -203,14 +202,14 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
203
202
  modelFileId: a ?? null,
204
203
  schemaName: o ?? null
205
204
  }] : []
206
- ], Le = ({ modelName: e, modelFileId: t, schemaName: n, deleted: r = !1, includeEas: a = !1, addressFilter: l }) => {
207
- let u = K(), f = we(), p = H();
205
+ ], Ie = ({ modelName: e, modelFileId: t, schemaName: n, deleted: r = !1, includeEas: a = !1, addressFilter: l }) => {
206
+ let u = q(), f = Ce(), p = he();
208
207
  i(() => {
209
208
  let e = () => {
210
209
  p.invalidateQueries({ queryKey: ["seed", "items"] });
211
210
  };
212
- return T.on(m, e), () => {
213
- T.off(m, e);
211
+ return E.on(m, e), () => {
212
+ E.off(m, e);
214
213
  };
215
214
  }, [p]);
216
215
  let h = s([]), _ = s(/* @__PURE__ */ new Set()), v = s(!1), [y, b] = c(null);
@@ -226,7 +225,7 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
226
225
  e = !0;
227
226
  };
228
227
  }, [l, f]);
229
- let x = o(() => Ie(e, r, a, l, f, t, n), [
228
+ let x = o(() => Fe(e, r, a, l, f, t, n), [
230
229
  e,
231
230
  r,
232
231
  a,
@@ -238,7 +237,7 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
238
237
  i(() => {
239
238
  v.current = !1;
240
239
  }, [x]);
241
- let { data: S = [], isLoading: C, error: w } = V({
240
+ let { data: S = [], isLoading: w, error: T } = U({
242
241
  queryKey: x,
243
242
  queryFn: async () => await g.all(e, r, {
244
243
  waitForReady: !0,
@@ -251,22 +250,22 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
251
250
  staleTime: 0
252
251
  });
253
252
  h.current = S;
254
- let E = u ? d.getAppDb() : null, D = J(o(() => {
255
- if (!E || (l === "owned" || l === "watched") && y === null) return null;
253
+ let D = u ? d.getAppDb() : null, O = Y(o(() => {
254
+ if (!D || (l === "owned" || l === "watched") && y === null) return null;
256
255
  let t = [];
257
- a || t.push(ce(N.uid)), e && t.push(U(N.type, be(e))), l === "owned" ? t.push(j(y ?? [])) : l === "watched" && t.push(ue(N.publisher, y ?? [])), r ? t.push(G(W(N._markedForDeletion), U(N._markedForDeletion, 1))) : (t.push(G(ye(N._markedForDeletion), U(N._markedForDeletion, 0))), t.push(G(ye(N.revokedAt), U(N.revokedAt, 0))));
258
- let n = re();
259
- return E.with(n).select({
260
- localId: N.localId,
261
- uid: N.uid,
262
- type: N.type,
263
- schemaUid: N.schemaUid,
264
- createdAt: N.createdAt,
265
- attestationCreatedAt: N.attestationCreatedAt,
266
- _markedForDeletion: N._markedForDeletion
267
- }).from(N).leftJoin(n, U(N.localId, n.seedLocalId)).where(ge(ve(n.versionsCount, 0), ...t)).groupBy(N.localId);
256
+ a || t.push(ce(F.uid)), e && t.push(W(F.type, C(e))), l === "owned" ? t.push(oe(y ?? [])) : l === "watched" && t.push(ue(F.publisher, y ?? [])), r ? t.push(K(ve(F._markedForDeletion), W(F._markedForDeletion, 1))) : (t.push(K(ye(F._markedForDeletion), W(F._markedForDeletion, 0))), t.push(K(ye(F.revokedAt), W(F.revokedAt, 0))));
257
+ let n = ne();
258
+ return D.with(n).select({
259
+ localId: F.localId,
260
+ uid: F.uid,
261
+ type: F.type,
262
+ schemaUid: F.schemaUid,
263
+ createdAt: F.createdAt,
264
+ attestationCreatedAt: F.attestationCreatedAt,
265
+ _markedForDeletion: F._markedForDeletion
266
+ }).from(F).leftJoin(n, W(F.localId, n.seedLocalId)).where(ge(G(n.versionsCount, 0), ...t)).groupBy(F.localId);
268
267
  }, [
269
- E,
268
+ D,
270
269
  u,
271
270
  e,
272
271
  r,
@@ -275,9 +274,9 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
275
274
  y
276
275
  ]));
277
276
  return i(() => {
278
- if (!u || !D) return;
277
+ if (!u || !O) return;
279
278
  let e = /* @__PURE__ */ new Set();
280
- for (let t of D) {
279
+ for (let t of O) {
281
280
  let n = t.localId || t.uid;
282
281
  n && e.add(n);
283
282
  }
@@ -295,19 +294,19 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
295
294
  n.size === e.size && [...n].every((t) => e.has(t)) || (t.size === e.size && [...t].every((t) => e.has(t)) ? _.current = new Set(e) : (_.current = new Set(e), p.invalidateQueries({ queryKey: x })));
296
295
  }, [
297
296
  u,
298
- D,
297
+ O,
299
298
  p,
300
299
  x
301
300
  ]), {
302
- items: o(() => pe(S, [(e) => e.lastVersionPublishedAt || e.attestationCreatedAt || e.createdAt], ["desc"]), [S]),
303
- isLoading: C || !u,
304
- error: w
301
+ items: o(() => L(S, [(e) => e.lastVersionPublishedAt || e.attestationCreatedAt || e.createdAt], ["desc"]), [S]),
302
+ isLoading: w || !u,
303
+ error: T
305
304
  };
306
- }, Re = () => {
305
+ }, Le = () => {
307
306
  let [e, t] = c(!1), [r, i] = c(null), a = s(!1), o = n(() => i(null), []);
308
307
  return {
309
308
  createItem: n(async (e, n) => {
310
- if (a.current) Ne("[useCreateItem] [createItem] already creating item, skipping");
309
+ if (a.current) Me("[useCreateItem] [createItem] already creating item, skipping");
311
310
  else {
312
311
  a.current = !0, i(null), l(() => t(!0));
313
312
  try {
@@ -317,7 +316,7 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
317
316
  ...t
318
317
  }) ?? void 0;
319
318
  } catch (e) {
320
- Ne("[useCreateItem] Error creating item:", e), i(e instanceof Error ? e : Error(String(e)));
319
+ Me("[useCreateItem] Error creating item:", e), i(e instanceof Error ? e : Error(String(e)));
321
320
  return;
322
321
  } finally {
323
322
  a.current = !1, queueMicrotask(() => t(!1));
@@ -328,7 +327,7 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
328
327
  error: r,
329
328
  resetError: o
330
329
  };
331
- }, ze = () => {
330
+ }, Re = () => {
332
331
  let [e, t] = c(null), [r, a] = c(!1), [o, l] = c(null), u = s(void 0), d = n(() => l(null), []), f = n((e, n) => {
333
332
  e && (t(e), l(null), e.publish(n).catch((e) => {
334
333
  l(e instanceof Error ? e : Error(String(e)));
@@ -352,15 +351,15 @@ var Ne = F("seedSdk:react:item"), Pe = (e) => [
352
351
  error: o,
353
352
  resetError: d
354
353
  };
355
- }, Be = F("seedSdk:react:property"), X = F("seedSdk:react:itemProperties"), Ve = (e, t, n) => [
354
+ }, ze = R("seedSdk:react:property"), Z = R("seedSdk:react:itemProperties"), Be = (e, t, n) => [
356
355
  "seed",
357
356
  "itemProperty",
358
357
  e ?? null,
359
358
  t ?? null,
360
359
  n
361
360
  ];
362
- function He(e, t) {
363
- let n = K(), r = Me(), [, a] = c(0), s = typeof e == "object" && e ? e : null, l = s?.itemId, u = s?.seedLocalId, d = s?.seedUid, f = s?.propertyName, p = typeof e == "string" ? e : l !== void 0 && l !== "" ? l : void 0, m = f ?? (typeof e == "string" ? t : void 0), h = o(() => {
361
+ function Ve(e, t) {
362
+ let n = q(), r = je(), [, a] = c(0), s = typeof e == "object" && e ? e : null, l = s?.itemId, u = s?.seedLocalId, d = s?.seedUid, f = s?.propertyName, p = typeof e == "string" ? e : l !== void 0 && l !== "" ? l : void 0, m = f ?? (typeof e == "string" ? t : void 0), h = o(() => {
364
363
  let e = p !== void 0 && p !== "" ? p : u, t = p !== void 0 && p !== "" ? void 0 : d;
365
364
  return (e || t) && m ? {
366
365
  type: "identifiers",
@@ -374,7 +373,7 @@ function He(e, t) {
374
373
  m,
375
374
  u,
376
375
  d
377
- ]), g = o(() => Ve(h?.seedLocalId, h?.seedUid, h?.propertyName ?? ""), [h]), v = V({
376
+ ]), g = o(() => Be(h?.seedLocalId, h?.seedUid, h?.propertyName ?? ""), [h]), v = U({
378
377
  queryKey: g,
379
378
  queryFn: async () => {
380
379
  if (!h) return null;
@@ -386,7 +385,7 @@ function He(e, t) {
386
385
  propertyName: h.propertyName,
387
386
  seedUid: h.itemId
388
387
  }) : void 0, n = e ?? t;
389
- return n || Be(`[useItemProperty] no property found for Item.${h.seedLocalId || h.seedUid}.${h.propertyName}`), n ?? null;
388
+ return n || ze(`[useItemProperty] no property found for Item.${h.seedLocalId || h.seedUid}.${h.propertyName}`), n ?? null;
390
389
  },
391
390
  initialData: () => h ? _.peekReady(h) : void 0,
392
391
  staleTime: 0,
@@ -414,8 +413,8 @@ function He(e, t) {
414
413
  error: v.error
415
414
  };
416
415
  }
417
- function Ue(e, t = 300) {
418
- let r = "itemId" in e ? e.itemId : void 0, a = "seedLocalId" in e ? e.seedLocalId : void 0, c = "seedUid" in e ? e.seedUid : void 0, l = e.propertyName, { property: u, isLoading: d, error: f } = He(o(() => r ? {
416
+ function He(e, t = 300) {
417
+ let r = "itemId" in e ? e.itemId : void 0, a = "seedLocalId" in e ? e.seedLocalId : void 0, c = "seedUid" in e ? e.seedUid : void 0, l = e.propertyName, { property: u, isLoading: d, error: f } = Ve(o(() => r ? {
419
418
  itemId: r,
420
419
  propertyName: l
421
420
  } : {
@@ -427,7 +426,7 @@ function Ue(e, t = 300) {
427
426
  a,
428
427
  c,
429
428
  l
430
- ])), p = s(""), m = o(() => fe((e) => {
429
+ ])), p = s(""), m = o(() => I((e) => {
431
430
  e.getService().send({
432
431
  type: "save",
433
432
  newValue: p.current
@@ -449,7 +448,7 @@ function Ue(e, t = 300) {
449
448
  error: f
450
449
  };
451
450
  }
452
- async function We(e, t) {
451
+ async function Ue(e, t) {
453
452
  if (!e && !t) return [];
454
453
  let n = d.getAppDb();
455
454
  if (!n) return [];
@@ -461,19 +460,19 @@ async function We(e, t) {
461
460
  let o;
462
461
  if (r.length > 0) {
463
462
  let e = r[0];
464
- o = e.modelName ?? e.modelType, o && typeof o == "string" && (o = P(o));
463
+ o = e.modelName ?? e.modelType, o && typeof o == "string" && (o = de(o));
465
464
  }
466
465
  let s = await n.select({
467
- type: N.type,
468
- modelFileId: N.modelFileId
469
- }).from(N).where(t ? U(N.uid, t) : U(N.localId, e)).limit(1), c = s[0]?.modelFileId ?? void 0;
470
- !o && s.length > 0 && s[0].type && (o = P(s[0].type));
466
+ type: F.type,
467
+ modelFileId: F.modelFileId
468
+ }).from(F).where(t ? W(F.uid, t) : W(F.localId, e)).limit(1), c = s[0]?.modelFileId ?? void 0;
469
+ !o && s.length > 0 && s[0].type && (o = de(s[0].type));
471
470
  let l = [];
472
471
  if (o) try {
473
472
  let { Model: e } = await import("@seedprotocol/sdk"), t = await e.resolveAsync(o, { modelFileId: c });
474
473
  if (t?.properties) for (let e of t.properties) e.name && l.push(e.name);
475
474
  } catch (e) {
476
- X(`[useItemProperties] Error getting ModelProperties for ${o}:`, e);
475
+ Z(`[useItemProperties] Error getting ModelProperties for ${o}:`, e);
477
476
  }
478
477
  if (o && l.length > 0) {
479
478
  let n = r.length > 0 ? r[0].seedLocalId ?? e : e, s = r.length > 0 ? r[0].seedUid ?? t : t;
@@ -487,11 +486,11 @@ async function We(e, t) {
487
486
  }, { waitForReady: !1 });
488
487
  t && i.push(t);
489
488
  } catch (t) {
490
- Be(`[useItemProperties] Error creating ItemProperty for missing property ${e}:`, t);
489
+ ze(`[useItemProperties] Error creating ItemProperty for missing property ${e}:`, t);
491
490
  }
492
491
  }
493
492
  if (e || t) {
494
- let a = await n.select({ createdAt: N.createdAt }).from(N).where(t ? U(N.uid, t) : U(N.localId, e)).limit(1);
493
+ let a = await n.select({ createdAt: F.createdAt }).from(F).where(t ? W(F.uid, t) : W(F.localId, e)).limit(1);
495
494
  if (a.length > 0 && a[0].createdAt) {
496
495
  let n = "createdAt";
497
496
  if (!i.some((e) => e.propertyName === n) && o) try {
@@ -504,14 +503,14 @@ async function We(e, t) {
504
503
  }, { waitForReady: !1 });
505
504
  l && i.push(l);
506
505
  } catch (e) {
507
- Be("[useItemProperties] Error creating createdAt ItemProperty:", e);
506
+ ze("[useItemProperties] Error creating createdAt ItemProperty:", e);
508
507
  }
509
508
  }
510
509
  }
511
510
  return i;
512
511
  }
513
- function Ge(e) {
514
- let t = K(), n = H(), r = s(void 0), a = o(() => typeof e == "string" ? {
512
+ function We(e) {
513
+ let t = q(), n = he(), r = s(void 0), a = o(() => typeof e == "string" ? {
515
514
  type: "itemId",
516
515
  itemId: e
517
516
  } : typeof e == "object" ? {
@@ -526,39 +525,39 @@ function Ge(e) {
526
525
  "seed",
527
526
  "itemProperties",
528
527
  u
529
- ], [u]), { data: p = [], isLoading: m, error: h } = V({
528
+ ], [u]), { data: p = [], isLoading: m, error: h } = U({
530
529
  queryKey: f,
531
- queryFn: () => We(c, l),
530
+ queryFn: () => Ue(c, l),
532
531
  enabled: t && !!u
533
- }), g = J(o(() => {
534
- if (!t || !c && !l) return X("[useItemProperties] Query: returning null (not ready or no identifiers)"), null;
532
+ }), g = Y(o(() => {
533
+ if (!t || !c && !l) return Z("[useItemProperties] Query: returning null (not ready or no identifiers)"), null;
535
534
  let e = d.getAppDb();
536
- if (!e) return X("[useItemProperties] Query: returning null (no db)"), null;
537
- X(`[useItemProperties] Query: creating query for seedLocalId=${c}, seedUid=${l}`);
535
+ if (!e) return Z("[useItemProperties] Query: returning null (no db)"), null;
536
+ Z(`[useItemProperties] Query: creating query for seedLocalId=${c}, seedUid=${l}`);
538
537
  let n = l ? e.select({
539
- propertyName: O.propertyName,
540
- propertyValue: O.propertyValue,
541
- seedLocalId: O.seedLocalId,
542
- seedUid: O.seedUid,
543
- modelType: O.modelType,
544
- schemaUid: O.schemaUid,
545
- createdAt: O.createdAt,
546
- attestationCreatedAt: O.attestationCreatedAt,
547
- localId: O.localId,
548
- revokedAt: O.revokedAt
549
- }).from(O).where(ge(U(O.seedUid, l), W(O.propertyName))) : c ? e.select({
550
- propertyName: O.propertyName,
551
- propertyValue: O.propertyValue,
552
- seedLocalId: O.seedLocalId,
553
- seedUid: O.seedUid,
554
- modelType: O.modelType,
555
- schemaUid: O.schemaUid,
556
- createdAt: O.createdAt,
557
- attestationCreatedAt: O.attestationCreatedAt,
558
- localId: O.localId,
559
- revokedAt: O.revokedAt
560
- }).from(O).where(ge(U(O.seedLocalId, c), W(O.propertyName))) : null;
561
- return X("[useItemProperties] Query: created query object", { queryType: l ? "seedUid" : "seedLocalId" }), n;
538
+ propertyName: A.propertyName,
539
+ propertyValue: A.propertyValue,
540
+ seedLocalId: A.seedLocalId,
541
+ seedUid: A.seedUid,
542
+ modelType: A.modelType,
543
+ schemaUid: A.schemaUid,
544
+ createdAt: A.createdAt,
545
+ attestationCreatedAt: A.attestationCreatedAt,
546
+ localId: A.localId,
547
+ revokedAt: A.revokedAt
548
+ }).from(A).where(ge(W(A.seedUid, l), ve(A.propertyName))) : c ? e.select({
549
+ propertyName: A.propertyName,
550
+ propertyValue: A.propertyValue,
551
+ seedLocalId: A.seedLocalId,
552
+ seedUid: A.seedUid,
553
+ modelType: A.modelType,
554
+ schemaUid: A.schemaUid,
555
+ createdAt: A.createdAt,
556
+ attestationCreatedAt: A.attestationCreatedAt,
557
+ localId: A.localId,
558
+ revokedAt: A.revokedAt
559
+ }).from(A).where(ge(W(A.seedLocalId, c), ve(A.propertyName))) : null;
560
+ return Z("[useItemProperties] Query: created query object", { queryType: l ? "seedUid" : "seedLocalId" }), n;
562
561
  }, [
563
562
  t,
564
563
  c,
@@ -589,7 +588,7 @@ function Ge(e) {
589
588
  error: h
590
589
  };
591
590
  }
592
- var Ke = () => {
591
+ var Ge = () => {
593
592
  let e = s(void 0), [t, r] = c(!1), [a, o] = c(null), l = n(() => o(null), []), u = n((t) => {
594
593
  if (!t.propertyName || !t.seedLocalId && !t.seedUid || !t.modelName) {
595
594
  o(/* @__PURE__ */ Error("seedLocalId or seedUid, propertyName, and modelName are required"));
@@ -618,7 +617,7 @@ var Ke = () => {
618
617
  error: a,
619
618
  resetError: l
620
619
  };
621
- }, qe = () => {
620
+ }, Ke = () => {
622
621
  let [e, t] = c(!1), [r, i] = c(null);
623
622
  return {
624
623
  destroy: n(async (e) => {
@@ -637,25 +636,25 @@ var Ke = () => {
637
636
  error: r,
638
637
  resetError: n(() => i(null), [])
639
638
  };
640
- }, Je = /* @__PURE__ */ new Set([
639
+ }, qe = /* @__PURE__ */ new Set([
641
640
  p.SAVE_CONFIG,
642
641
  p.PROCESS_SCHEMA_FILES,
643
642
  p.ADD_MODELS_TO_STORE,
644
643
  p.ADD_MODELS_TO_DB,
645
644
  p.IDLE
646
- ]), Ye = (e) => typeof e == "string" && Je.has(e), Xe = () => ({ dbsAreReady: I(D().getService(), (e) => Ye(e.value)) }), Ze = F("seedSdk:react:services"), Qe = [
645
+ ]), Je = (e) => typeof e == "string" && qe.has(e), Ye = () => ({ dbsAreReady: fe(O().getService(), (e) => Je(e.value)) }), Xe = R("seedSdk:react:services"), Ze = [
647
646
  "idle",
648
647
  "ready",
649
648
  "done",
650
649
  "success",
651
650
  "initialized"
652
- ], $e = (e) => {
651
+ ], Qe = (e) => {
653
652
  let t = "actor", n = e;
654
- return e && n.uniqueKey && (t = n.uniqueKey), e && !n.uniqueKey && n.logic && n.logic.config && (t = tt(e)), t;
655
- }, et = (e) => {
653
+ return e && n.uniqueKey && (t = n.uniqueKey), e && !n.uniqueKey && n.logic && n.logic.config && (t = et(e)), t;
654
+ }, $e = (e) => {
656
655
  let t;
657
- return e && e.getSnapshot() && e.getSnapshot().value && (t = e.getSnapshot().value), $e(e) === "global" && t && typeof t == "object" && Object.keys(t).length > 0 && Object.keys(t)[0] === "initialized" && (t = "ready"), t && typeof t == "object" && (t = JSON.stringify(t)), t;
658
- }, tt = (e) => {
656
+ return e && e.getSnapshot() && e.getSnapshot().value && (t = e.getSnapshot().value), Qe(e) === "global" && t && typeof t == "object" && Object.keys(t).length > 0 && Object.keys(t)[0] === "initialized" && (t = "ready"), t && typeof t == "object" && (t = JSON.stringify(t)), t;
657
+ }, et = (e) => {
659
658
  let t = e;
660
659
  if (!e || !t.logic || !t.logic.config || !t._snapshot) return;
661
660
  let n = t.logic.config;
@@ -666,21 +665,21 @@ var Ke = () => {
666
665
  try {
667
666
  i = e.getSnapshot();
668
667
  } catch (e) {
669
- return Ze("Error:", e), r;
668
+ return Xe("Error:", e), r;
670
669
  }
671
670
  if (i) {
672
671
  let e = i.context;
673
- e && e.dbName && (r = e.dbName), e && e.modelNamePlural && (r = e.modelNamePlural), e && e.modelName && (r = xe(e.modelName.toLowerCase()));
672
+ e && e.dbName && (r = e.dbName), e && e.modelNamePlural && (r = e.modelNamePlural), e && e.modelName && (r = be(e.modelName.toLowerCase()));
674
673
  }
675
674
  return r;
676
- }, nt = (e) => {
675
+ }, tt = (e) => {
677
676
  let [t, r] = c(0), a = (e) => {
678
677
  let t = 0, n = e;
679
678
  if (n.logic?.states) {
680
679
  let r = [], i = [];
681
680
  for (let [e, t] of Object.entries(n.logic.states)) t.tags?.includes("loading") && (r.push(e), i.push(t));
682
- let a = i.length, o = et(e);
683
- if (o && Qe.includes(o)) return 0;
681
+ let a = i.length, o = $e(e);
682
+ if (o && Ze.includes(o)) return 0;
684
683
  o && (t = r.indexOf(o) / a * 100);
685
684
  }
686
685
  return t;
@@ -698,16 +697,16 @@ var Ke = () => {
698
697
  let e = s();
699
698
  return () => clearInterval(e);
700
699
  }, []), {
701
- name: $e(e),
700
+ name: Qe(e),
702
701
  timeElapsed: t,
703
- value: et(e),
702
+ value: $e(e),
704
703
  percentComplete: a(e),
705
- uniqueKey: tt(e)
704
+ uniqueKey: et(e)
706
705
  };
707
- }, rt = () => {
708
- let { internalStatus: e } = ct();
706
+ }, nt = () => {
707
+ let { internalStatus: e } = st();
709
708
  return e === "ready";
710
- }, it = () => {}, at = () => !1, ot = (e) => {
709
+ }, rt = () => {}, it = () => !1, at = (e) => {
711
710
  switch (e) {
712
711
  case p.IDLE: return 100;
713
712
  case p.ADD_MODELS_TO_DB: return 90;
@@ -719,13 +718,13 @@ var Ke = () => {
719
718
  case p.PLATFORM_CLASSES_INIT: return 10;
720
719
  default: return 0;
721
720
  }
722
- }, st = () => {
723
- let [e, t] = c([]), [n, r] = c(() => ot(D().getService().getSnapshot().value));
721
+ }, ot = () => {
722
+ let [e, t] = c([]), [n, r] = c(() => at(O().getService().getSnapshot().value));
724
723
  return i(() => {
725
- let e = D().getService(), n = e;
726
- n.uniqueKey = "clientManager", t([n]), r(ot(e.getSnapshot().value));
724
+ let e = O().getService(), n = e;
725
+ n.uniqueKey = "clientManager", t([n]), r(at(e.getSnapshot().value));
727
726
  let i = e.subscribe((e) => {
728
- r(ot(e.value));
727
+ r(at(e.value));
729
728
  });
730
729
  return () => {
731
730
  i.unsubscribe();
@@ -734,17 +733,17 @@ var Ke = () => {
734
733
  services: e,
735
734
  percentComplete: n
736
735
  };
737
- }, ct = () => {
738
- let e = D().getService();
736
+ }, st = () => {
737
+ let e = O().getService();
739
738
  return {
740
- status: I(e, (e) => e.value),
741
- internalStatus: I(e, (e) => Ye(e.value) ? "ready" : e.value)
739
+ status: fe(e, (e) => e.value),
740
+ internalStatus: fe(e, (e) => Je(e.value) ? "ready" : e.value)
742
741
  };
743
- }, lt = F("seedSdk:react:schema"), ut = (e) => {
744
- let [t, r] = c(null), [a, o] = c(!!e), [u, d] = c(null), f = s(null), p = K(), m = n(async (e, t) => {
742
+ }, ct = R("seedSdk:react:schema"), lt = (e) => {
743
+ let [t, r] = c(null), [a, o] = c(!!e), [u, d] = c(null), f = s(null), p = q(), m = n(async (e, t) => {
745
744
  o(!0), d(null);
746
745
  try {
747
- if (!await dt(e)) {
746
+ if (!await ut(e)) {
748
747
  if (!t()) return;
749
748
  r(null), o(!1);
750
749
  return;
@@ -761,7 +760,7 @@ var Ke = () => {
761
760
  };
762
761
  a(i.getSnapshot()), f.current = i.subscribe(a);
763
762
  } catch (e) {
764
- if (lt("[useSchema] Error creating schema:", e), !t()) return;
763
+ if (ct("[useSchema] Error creating schema:", e), !t()) return;
765
764
  d(e), r(null), o(!1);
766
765
  }
767
766
  }, []);
@@ -784,23 +783,23 @@ var Ke = () => {
784
783
  error: u
785
784
  };
786
785
  };
787
- async function dt(e) {
786
+ async function ut(e) {
788
787
  if (e === b) return !0;
789
788
  let t = d.getAppDb();
790
- return !t || (await t.select({ id: M.id }).from(M).where(G(U(M.name, e), U(M.schemaFileId, e))).limit(1)).length > 0;
789
+ return !t || (await t.select({ id: P.id }).from(P).where(K(W(P.name, e), W(P.schemaFileId, e))).limit(1)).length > 0;
791
790
  }
792
- var ft = ["seed", "schemas"], pt = () => {
793
- let e = K(), t = H(), n = s(void 0), r = s([]), { data: a = [], isLoading: c, error: l } = V({
794
- queryKey: ft,
791
+ var dt = ["seed", "schemas"], ft = () => {
792
+ let e = q(), t = he(), n = s(void 0), r = s([]), { data: a = [], isLoading: c, error: l } = U({
793
+ queryKey: dt,
795
794
  queryFn: () => x.all({ waitForReady: !0 }),
796
795
  enabled: e
797
796
  });
798
797
  r.current = a;
799
- let u = e ? d.getAppDb() : null, f = J(o(() => u ? u.select().from(M).orderBy(M.name, _e(M.version)) : null, [u, e]));
798
+ let u = e ? d.getAppDb() : null, f = Y(o(() => u ? u.select().from(P).orderBy(P.name, _e(P.version)) : null, [u, e]));
800
799
  return i(() => {
801
800
  if (typeof BroadcastChannel > "u") return;
802
801
  let e = new BroadcastChannel("seed-schemas-invalidate"), n = () => {
803
- t.invalidateQueries({ queryKey: ft });
802
+ t.invalidateQueries({ queryKey: dt });
804
803
  };
805
804
  return e.addEventListener("message", n), () => {
806
805
  e.removeEventListener("message", n), e.close();
@@ -823,7 +822,7 @@ var ft = ["seed", "schemas"], pt = () => {
823
822
  let o = /* @__PURE__ */ new Set();
824
823
  for (let e of f) e.name !== "Seed Protocol" && (e.schemaFileId ? o.add(e.schemaFileId) : e.name != null && e.version !== void 0 && o.add(`${e.name}:${e.version}`));
825
824
  let s = a.size === o.size && [...a].every((e) => o.has(e)), c = a.size > 0 && o.size > 0 && [...o].some((e) => !a.has(e)), l = [...a].some((e) => !o.has(e));
826
- !s && (c || l) && t.invalidateQueries({ queryKey: ft });
825
+ !s && (c || l) && t.invalidateQueries({ queryKey: dt });
827
826
  }, [
828
827
  e,
829
828
  f,
@@ -833,7 +832,7 @@ var ft = ["seed", "schemas"], pt = () => {
833
832
  isLoading: c,
834
833
  error: l
835
834
  };
836
- }, mt = () => {
835
+ }, pt = () => {
837
836
  let e = s(null), [t, r] = c(!1), [a, o] = c(null), l = n(() => o(null), []), u = n((t) => {
838
837
  o(null), r(!0), e.current?.unsubscribe(), e.current = null;
839
838
  let n = x.create(t, { waitForReady: !1 }), i = n.getService().subscribe((e) => {
@@ -853,7 +852,7 @@ var ft = ["seed", "schemas"], pt = () => {
853
852
  error: a,
854
853
  resetError: l
855
854
  };
856
- }, ht = () => {
855
+ }, mt = () => {
857
856
  let [e, t] = c(!1), [r, i] = c(null);
858
857
  return {
859
858
  destroy: n(async (e) => {
@@ -872,10 +871,10 @@ var ft = ["seed", "schemas"], pt = () => {
872
871
  error: r,
873
872
  resetError: n(() => i(null), [])
874
873
  };
875
- }, gt = () => {
876
- let [e, t] = c(), r = s(/* @__PURE__ */ new Map()), a = K(), o = n(async () => {
874
+ }, ht = () => {
875
+ let [e, t] = c(), r = s(/* @__PURE__ */ new Map()), a = q(), o = n(async () => {
877
876
  if (a) try {
878
- let e = await ie(), n = /* @__PURE__ */ new Set();
877
+ let e = await re(), n = /* @__PURE__ */ new Set();
879
878
  for (let t of e) {
880
879
  let e = t.schema.metadata?.name;
881
880
  e && n.add(e);
@@ -891,7 +890,7 @@ var ft = ["seed", "schemas"], pt = () => {
891
890
  for (let [e, t] of r.current.entries()) n.has(e) || t.unload();
892
891
  r.current = i, t(Array.from(i.values()));
893
892
  } catch (e) {
894
- lt("Error fetching all schema versions from database:", e), t(null);
893
+ ct("Error fetching all schema versions from database:", e), t(null);
895
894
  }
896
895
  }, [a]);
897
896
  return i(() => {
@@ -901,12 +900,12 @@ var ft = ["seed", "schemas"], pt = () => {
901
900
  e.unload();
902
901
  }), r.current.clear();
903
902
  }, []), e;
904
- }, _t = () => ut(b), vt = (e) => [
903
+ }, gt = () => lt(b), _t = (e) => [
905
904
  "seed",
906
905
  "models",
907
906
  e
908
- ], yt, bt = (e) => {
909
- let t = K(), n = r(B) ?? yt ?? (yt = new me()), a = s(null), c = o(() => vt(e), [e]), { data: l = [], isLoading: u, error: f } = V({
907
+ ], vt, yt = (e) => {
908
+ let t = q(), n = r(pe) ?? vt ?? (vt = new H()), a = s(null), c = o(() => _t(e), [e]), { data: l = [], isLoading: u, error: f } = U({
910
909
  queryKey: c,
911
910
  queryFn: async () => {
912
911
  let t = await v.all(e, { waitForReady: !1 }), r = n.getQueryData(c), i = a.current;
@@ -932,11 +931,11 @@ var ft = ["seed", "schemas"], pt = () => {
932
931
  function _() {
933
932
  let t = d.getAppDb();
934
933
  return !t || !e ? null : t.select({
935
- modelFileId: k.schemaFileId,
936
- modelName: k.name
937
- }).from(M).innerJoin(ae, U(M.id, ae.schemaId)).innerJoin(k, U(ae.modelId, k.id)).where(G(U(M.schemaFileId, e), U(M.name, e)));
934
+ modelFileId: M.schemaFileId,
935
+ modelName: M.name
936
+ }).from(P).innerJoin(j, W(P.id, j.schemaId)).innerJoin(M, W(j.modelId, M.id)).where(K(W(P.schemaFileId, e), W(P.name, e)));
938
937
  }
939
- let y = J(o(() => {
938
+ let y = Y(o(() => {
940
939
  if (!e || !t) return null;
941
940
  let n = {
942
941
  schemaId: e,
@@ -967,8 +966,8 @@ var ft = ["seed", "schemas"], pt = () => {
967
966
  isLoading: u,
968
967
  error: f
969
968
  };
970
- }, xt = (e, t) => {
971
- let n = K(), [r, a] = c(void 0), [l, u] = c(!1), [d, f] = c(null), p = s(void 0), [, m] = c(0), h = t == null;
969
+ }, bt = (e, t) => {
970
+ let n = q(), [r, a] = c(void 0), [l, u] = c(!1), [d, f] = c(null), p = s(void 0), [, m] = c(0), h = t == null;
972
971
  o(() => n ? h ? !!e : !!(e && t) : !1, [
973
972
  n,
974
973
  h,
@@ -989,7 +988,7 @@ var ft = ["seed", "schemas"], pt = () => {
989
988
  h,
990
989
  e
991
990
  ]);
992
- let { models: g, isLoading: _, error: y } = bt(h ? null : e), b = o(() => {
991
+ let { models: g, isLoading: _, error: y } = yt(h ? null : e), b = o(() => {
993
992
  if (!h && t) return g.find((e) => (e.modelName ?? e.name) === t);
994
993
  }, [
995
994
  h,
@@ -1011,7 +1010,7 @@ var ft = ["seed", "schemas"], pt = () => {
1011
1010
  isLoading: _,
1012
1011
  error: y
1013
1012
  };
1014
- }, St = () => {
1013
+ }, xt = () => {
1015
1014
  let e = s(void 0), [t, r] = c(!1), [a, o] = c(null), l = n(() => o(null), []), u = n((t, n, i) => {
1016
1015
  o(null), r(!0), e.current?.unsubscribe(), e.current = void 0;
1017
1016
  let a = v.create(n, t, {
@@ -1030,7 +1029,7 @@ var ft = ["seed", "schemas"], pt = () => {
1030
1029
  error: a,
1031
1030
  resetError: l
1032
1031
  };
1033
- }, Ct = () => {
1032
+ }, St = () => {
1034
1033
  let [e, t] = c(!1), [r, i] = c(null);
1035
1034
  return {
1036
1035
  destroy: n(async (e) => {
@@ -1052,17 +1051,17 @@ var ft = ["seed", "schemas"], pt = () => {
1052
1051
  };
1053
1052
  //#endregion
1054
1053
  //#region src/modelProperty.ts
1055
- F("seedSdk:browser:react:modelProperty");
1056
- async function wt(e) {
1054
+ R("seedSdk:browser:react:modelProperty");
1055
+ async function Ct(e) {
1057
1056
  let t = d.getAppDb();
1058
1057
  if (t) {
1059
- let n = await t.select({ name: M.name }).from(M).where(G(U(M.name, e), U(M.schemaFileId, e))).limit(1);
1058
+ let n = await t.select({ name: P.name }).from(P).where(K(W(P.name, e), W(P.schemaFileId, e))).limit(1);
1060
1059
  if (n[0]?.name) return n[0].name;
1061
1060
  }
1062
- return ne(e) ?? e;
1061
+ return k(e) ?? e;
1063
1062
  }
1064
- var Tt = (e, t) => {
1065
- let { model: n } = xt(e, t);
1063
+ var wt = (e, t) => {
1064
+ let { model: n } = bt(e, t);
1066
1065
  o(() => {
1067
1066
  if (n) try {
1068
1067
  return n.modelName ?? n.name;
@@ -1070,20 +1069,20 @@ var Tt = (e, t) => {
1070
1069
  return;
1071
1070
  }
1072
1071
  }, [n]);
1073
- let r = K(), a = H(), c = Ot(n), l = n?.id, u = o(() => [
1072
+ let r = q(), a = he(), c = Dt(n), l = n?.id, u = o(() => [
1074
1073
  "seed",
1075
1074
  "modelProperties",
1076
1075
  l ?? ""
1077
- ], [l]), { data: f = [], isLoading: p, error: m } = V({
1076
+ ], [l]), { data: f = [], isLoading: p, error: m } = U({
1078
1077
  queryKey: u,
1079
1078
  queryFn: () => y.all(l, { waitForReady: !0 }),
1080
1079
  enabled: r && !!l
1081
- }), h = r ? d.getAppDb() : null, g = J(o(() => !h || !c ? null : h.select({
1080
+ }), h = r ? d.getAppDb() : null, g = Y(o(() => !h || !c ? null : h.select({
1082
1081
  id: le.id,
1083
1082
  name: le.name,
1084
1083
  dataType: le.dataType,
1085
1084
  schemaFileId: le.schemaFileId
1086
- }).from(le).where(U(le.modelId, c)), [
1085
+ }).from(le).where(W(le.modelId, c)), [
1087
1086
  h,
1088
1087
  r,
1089
1088
  c
@@ -1124,24 +1123,24 @@ var Tt = (e, t) => {
1124
1123
  isLoading: p && f.length === 0,
1125
1124
  error: m
1126
1125
  };
1127
- }, Et = [
1126
+ }, Tt = [
1128
1127
  400,
1129
1128
  1200,
1130
1129
  2500
1131
- ], Dt = (e) => {
1130
+ ], Et = (e) => {
1132
1131
  if (e) try {
1133
1132
  return e._getSnapshotContext()._dbId;
1134
1133
  } catch {
1135
1134
  return;
1136
1135
  }
1137
- }, Ot = (e) => {
1138
- let [t, n] = c(() => Dt(e));
1136
+ }, Dt = (e) => {
1137
+ let [t, n] = c(() => Et(e));
1139
1138
  return i(() => {
1140
- if (n(Dt(e)), !e) return;
1141
- let t = e.getService().subscribe(() => n(Dt(e)));
1139
+ if (n(Et(e)), !e) return;
1140
+ let t = e.getService().subscribe(() => n(Et(e)));
1142
1141
  return () => t.unsubscribe();
1143
1142
  }, [e]), t;
1144
- }, kt = async (e, t) => {
1143
+ }, Ot = async (e, t) => {
1145
1144
  let n = await v.createById(e);
1146
1145
  if (!n) return;
1147
1146
  let r = n.modelName ?? n.name;
@@ -1150,12 +1149,12 @@ var Tt = (e, t) => {
1150
1149
  schemaName: n.schemaName
1151
1150
  });
1152
1151
  };
1153
- function At(e, t, r) {
1152
+ function kt(e, t, r) {
1154
1153
  let a = o(() => r == null ? t == null ? !!e : !!(e && t) : !!(e && t && r), [
1155
1154
  e,
1156
1155
  t,
1157
1156
  r
1158
- ]), [u, d] = c(void 0), [f, p] = c(a), [m, h] = c(null), g = s(void 0), _ = K(), b = o(() => r == null ? t == null ? {
1157
+ ]), [u, d] = c(void 0), [f, p] = c(a), [m, h] = c(null), g = s(void 0), _ = q(), b = o(() => r == null ? t == null ? {
1159
1158
  type: "propertyFileId",
1160
1159
  propertyFileId: e
1161
1160
  } : {
@@ -1192,7 +1191,7 @@ function At(e, t, r) {
1192
1191
  d(void 0), p(!1), h(null);
1193
1192
  return;
1194
1193
  }
1195
- t = await kt(b.modelFileId, b.propertyName);
1194
+ t = await Ot(b.modelFileId, b.propertyName);
1196
1195
  let e = await v.createById(b.modelFileId);
1197
1196
  n = e?.modelName ?? e?.name;
1198
1197
  } else {
@@ -1200,7 +1199,7 @@ function At(e, t, r) {
1200
1199
  d(void 0), p(!1), h(null);
1201
1200
  return;
1202
1201
  }
1203
- let e = await wt(b.schemaId);
1202
+ let e = await Ct(b.schemaId);
1204
1203
  t = await te(b.modelName, b.propertyName, { schemaName: e }), n = b.modelName;
1205
1204
  }
1206
1205
  if (t && n) {
@@ -1230,7 +1229,7 @@ function At(e, t, r) {
1230
1229
  let C = s(!1);
1231
1230
  C.current = f || !!u || !!m, i(() => {
1232
1231
  if (!x || b.type === "propertyFileId") return;
1233
- let e = Et.map((e) => setTimeout(() => {
1232
+ let e = Tt.map((e) => setTimeout(() => {
1234
1233
  C.current || S({ quiet: !0 });
1235
1234
  }, e));
1236
1235
  return () => e.forEach((e) => clearTimeout(e));
@@ -1243,7 +1242,7 @@ function At(e, t, r) {
1243
1242
  return i(() => {
1244
1243
  if (!u || !w) return;
1245
1244
  g.current?.unsubscribe();
1246
- let e = fe(S, 100), t = u.getService().subscribe(() => {
1245
+ let e = I(S, 100), t = u.getService().subscribe(() => {
1247
1246
  e();
1248
1247
  });
1249
1248
  return g.current = t, () => {
@@ -1259,13 +1258,13 @@ function At(e, t, r) {
1259
1258
  error: m
1260
1259
  };
1261
1260
  }
1262
- var jt = () => {
1261
+ var At = () => {
1263
1262
  let e = s(void 0), [t, r] = c(!1), [a, o] = c(null), l = n(() => o(null), []), u = n((t, n, i) => {
1264
1263
  if (o(null), r(!0), e.current?.unsubscribe(), e.current = void 0, !n || !i.name || !i.dataType) {
1265
1264
  let e = /* @__PURE__ */ Error("modelName, property name and dataType are required");
1266
1265
  throw o(e), r(!1), e;
1267
1266
  }
1268
- let a = ne(t) ?? t, s = y.create({
1267
+ let a = k(t) ?? t, s = y.create({
1269
1268
  ...i,
1270
1269
  modelName: n
1271
1270
  }, {
@@ -1288,7 +1287,7 @@ var jt = () => {
1288
1287
  error: a,
1289
1288
  resetError: l
1290
1289
  };
1291
- }, Mt = () => {
1290
+ }, jt = () => {
1292
1291
  let [e, t] = c(!1), [r, i] = c(null);
1293
1292
  return {
1294
1293
  destroy: n(async (e) => {
@@ -1307,7 +1306,7 @@ var jt = () => {
1307
1306
  error: r,
1308
1307
  resetError: n(() => i(null), [])
1309
1308
  };
1310
- }, Nt = () => {
1309
+ }, Mt = () => {
1311
1310
  let [e, t] = c(!1), [r, i] = c(null);
1312
1311
  return {
1313
1312
  deleteItem: n(async (e) => {
@@ -1326,23 +1325,23 @@ var jt = () => {
1326
1325
  error: r,
1327
1326
  resetError: n(() => i(null), [])
1328
1327
  };
1329
- }, Pt = ["seed", "imageFiles"];
1330
- function Ft() {
1331
- let e = K(), t = H(), { data: n = [], isLoading: r, error: a, refetch: o } = V({
1332
- queryKey: Pt,
1328
+ }, Nt = ["seed", "imageFiles"];
1329
+ function Pt() {
1330
+ let e = q(), t = he(), { data: n = [], isLoading: r, error: a, refetch: o } = U({
1331
+ queryKey: Nt,
1333
1332
  queryFn: () => f.listImageFiles(),
1334
1333
  enabled: e
1335
1334
  });
1336
1335
  return i(() => {
1337
1336
  let e = (e) => {
1338
- e.includes("/images/") && t.invalidateQueries({ queryKey: Pt });
1337
+ e.includes("/images/") && t.invalidateQueries({ queryKey: Nt });
1339
1338
  }, n = () => {
1340
- t.invalidateQueries({ queryKey: Pt });
1339
+ t.invalidateQueries({ queryKey: Nt });
1341
1340
  }, r = (e) => {
1342
- e.some((e) => e.includes("/images/")) && t.invalidateQueries({ queryKey: Pt });
1341
+ e.some((e) => e.includes("/images/")) && t.invalidateQueries({ queryKey: Nt });
1343
1342
  };
1344
- return T.on("file-saved", e), T.on("fs.downloadAll.success", n), T.on(h, r), () => {
1345
- T.off("file-saved", e), T.off("fs.downloadAll.success", n), T.off(h, r);
1343
+ return E.on("file-saved", e), E.on("fs.downloadAll.success", n), E.on(h, r), () => {
1344
+ E.off("file-saved", e), E.off("fs.downloadAll.success", n), E.off(h, r);
1346
1345
  };
1347
1346
  }, [t]), {
1348
1347
  imageFiles: n,
@@ -1353,9 +1352,9 @@ function Ft() {
1353
1352
  }
1354
1353
  //#endregion
1355
1354
  //#region src/useFiles.ts
1356
- var It = ["seed", "files"];
1357
- function Lt(e = "files") {
1358
- let t = K(), n = H(), r = o(() => [...It, e], [e]), { data: a = [], isLoading: s, error: c, refetch: l } = V({
1355
+ var Ft = ["seed", "files"];
1356
+ function It(e = "files") {
1357
+ let t = q(), n = he(), r = o(() => [...Ft, e], [e]), { data: a = [], isLoading: s, error: c, refetch: l } = U({
1359
1358
  queryKey: r,
1360
1359
  queryFn: () => f.listFiles(e),
1361
1360
  enabled: t
@@ -1368,8 +1367,8 @@ function Lt(e = "files") {
1368
1367
  }, a = (t) => {
1369
1368
  t.some((t) => t.includes(`/${e}/`)) && n.invalidateQueries({ queryKey: r });
1370
1369
  };
1371
- return T.on("file-saved", t), T.on("fs.downloadAll.success", i), T.on(h, a), () => {
1372
- T.off("file-saved", t), T.off("fs.downloadAll.success", i), T.off(h, a);
1370
+ return E.on("file-saved", t), E.on("fs.downloadAll.success", i), E.on(h, a), () => {
1371
+ E.off("file-saved", t), E.off("fs.downloadAll.success", i), E.off(h, a);
1373
1372
  };
1374
1373
  }, [
1375
1374
  n,
@@ -1384,25 +1383,25 @@ function Lt(e = "files") {
1384
1383
  }
1385
1384
  //#endregion
1386
1385
  //#region src/useEasSyncProcesses.ts
1387
- function Rt() {
1386
+ function Lt() {
1388
1387
  let e = d.getAppDb();
1389
- return o(() => e ? e.select().from(C).orderBy(_e(C.startedAt)) : null, [e]);
1388
+ return o(() => e ? e.select().from(w).orderBy(_e(w.startedAt)) : null, [e]);
1390
1389
  }
1391
- function zt() {
1392
- let e = J(Rt());
1390
+ function Rt() {
1391
+ let e = Y(Lt());
1393
1392
  return {
1394
1393
  records: e,
1395
1394
  nonActiveCount: o(() => e === void 0 ? void 0 : e.filter((e) => e.status !== "in_progress").length, [e])
1396
1395
  };
1397
1396
  }
1398
- function Bt() {
1399
- return J(Rt());
1397
+ function zt() {
1398
+ return Y(Lt());
1400
1399
  }
1401
- function Vt() {
1402
- return zt().nonActiveCount;
1400
+ function Bt() {
1401
+ return Rt().nonActiveCount;
1403
1402
  }
1404
- function Ht(e) {
1405
- let t = d.getAppDb(), n = o(() => e != null && t ? t.select().from(C).where(U(C.id, e)).limit(1) : null, [t, e]), r = J(n), i = n != null && r === void 0;
1403
+ function Vt(e) {
1404
+ let t = d.getAppDb(), n = o(() => e != null && t ? t.select().from(w).where(W(w.id, e)).limit(1) : null, [t, e]), r = Y(n), i = n != null && r === void 0;
1406
1405
  return {
1407
1406
  record: r && r.length > 0 ? r[0] : null,
1408
1407
  isLoading: i
@@ -1410,12 +1409,12 @@ function Ht(e) {
1410
1409
  }
1411
1410
  //#endregion
1412
1411
  //#region src/SeedProvider.tsx
1413
- var Ut = null;
1414
- function Wt(e) {
1415
- let t = Ut?.(e);
1412
+ var Ht = null;
1413
+ function Ut(e) {
1414
+ let t = Ht?.(e);
1416
1415
  return typeof window < "u" && window.__SEED_INVALIDATE_ITEM_PROPERTIES__ && window.__SEED_INVALIDATE_ITEM_PROPERTIES__(e), Promise.resolve(t).then(() => {});
1417
1416
  }
1418
- function Gt({ queryClient: e }) {
1417
+ function Wt({ queryClient: e }) {
1419
1418
  return i(() => {
1420
1419
  let t = (t) => {
1421
1420
  let n = [
@@ -1425,7 +1424,7 @@ function Gt({ queryClient: e }) {
1425
1424
  ];
1426
1425
  return e.invalidateQueries({ queryKey: n }), e.refetchQueries({ queryKey: n });
1427
1426
  };
1428
- Ut = t, typeof window < "u" && (window.__SEED_INVALIDATE_ITEM_PROPERTIES__ = t);
1427
+ Ht = t, typeof window < "u" && (window.__SEED_INVALIDATE_ITEM_PROPERTIES__ = t);
1429
1428
  let n = (e) => {
1430
1429
  let n = e?.seedLocalId ?? e?.seedUid;
1431
1430
  n && t(n);
@@ -1435,13 +1434,13 @@ function Gt({ queryClient: e }) {
1435
1434
  exact: !1
1436
1435
  });
1437
1436
  };
1438
- return T.on("itemProperty.saved", n), T.on(m, r), () => {
1439
- T.off("itemProperty.saved", n), T.off(m, r), Ut = null, typeof window < "u" && (window.__SEED_INVALIDATE_ITEM_PROPERTIES__ = null);
1437
+ return E.on("itemProperty.saved", n), E.on(m, r), () => {
1438
+ E.off("itemProperty.saved", n), E.off(m, r), Ht = null, typeof window < "u" && (window.__SEED_INVALIDATE_ITEM_PROPERTIES__ = null);
1440
1439
  };
1441
1440
  }, [e]), null;
1442
1441
  }
1443
- function Kt({ children: e, queryClient: t, queryClientRef: n }) {
1444
- let r = o(() => t ?? Y(), [t]);
1442
+ function Gt({ children: e, queryClient: t, queryClientRef: n }) {
1443
+ let r = o(() => t ?? X(), [t]);
1445
1444
  if (n && (n.current = r, typeof window < "u")) {
1446
1445
  let e = window;
1447
1446
  e.__TEST_SEED_QUERY_CLIENT__ = r;
@@ -1449,18 +1448,18 @@ function Kt({ children: e, queryClient: t, queryClientRef: n }) {
1449
1448
  window.parent && window.parent !== window && (window.parent.__TEST_SEED_QUERY_CLIENT__ = r);
1450
1449
  } catch {}
1451
1450
  }
1452
- return /* @__PURE__ */ R(he, {
1451
+ return /* @__PURE__ */ B(me, {
1453
1452
  client: r,
1454
- children: /* @__PURE__ */ z(Te, {
1453
+ children: /* @__PURE__ */ V(we, {
1455
1454
  queryClient: r,
1456
- children: [/* @__PURE__ */ R(Gt, { queryClient: r }), e]
1455
+ children: [/* @__PURE__ */ B(Wt, { queryClient: r }), e]
1457
1456
  })
1458
1457
  });
1459
1458
  }
1460
1459
  //#endregion
1461
1460
  //#region src/SeedClientGate.tsx
1462
- function qt() {
1463
- return /* @__PURE__ */ R("div", {
1461
+ function Kt() {
1462
+ return /* @__PURE__ */ B("div", {
1464
1463
  style: {
1465
1464
  display: "flex",
1466
1465
  alignItems: "center",
@@ -1471,8 +1470,8 @@ function qt() {
1471
1470
  children: "Loading..."
1472
1471
  });
1473
1472
  }
1474
- function Jt({ initConfig: e, schema: t, loadingComponent: n, wrapperClassName: r, loadingClassName: a, onInitError: o, children: c }) {
1475
- let l = K(), u = s(o);
1473
+ function qt({ initConfig: e, schema: t, loadingComponent: n, wrapperClassName: r, loadingClassName: a, onInitError: o, children: c }) {
1474
+ let l = q(), u = s(o);
1476
1475
  u.current = o, i(() => {
1477
1476
  let n = t ? {
1478
1477
  ...e,
@@ -1485,7 +1484,7 @@ function Jt({ initConfig: e, schema: t, loadingComponent: n, wrapperClassName: r
1485
1484
  u.current ? u.current(e) : console.error("[SeedClientGate] client init failed", e);
1486
1485
  });
1487
1486
  }, [e, t]);
1488
- let d = n ?? /* @__PURE__ */ R(qt, {}), f = r ? void 0 : {
1487
+ let d = n ?? /* @__PURE__ */ B(Kt, {}), f = r ? void 0 : {
1489
1488
  position: "relative",
1490
1489
  display: "flex",
1491
1490
  height: "100vh",
@@ -1500,15 +1499,15 @@ function Jt({ initConfig: e, schema: t, loadingComponent: n, wrapperClassName: r
1500
1499
  justifyContent: "center"
1501
1500
  }
1502
1501
  };
1503
- return /* @__PURE__ */ z("div", {
1502
+ return /* @__PURE__ */ V("div", {
1504
1503
  className: r,
1505
1504
  style: f,
1506
- children: [/* @__PURE__ */ R("div", {
1505
+ children: [/* @__PURE__ */ B("div", {
1507
1506
  className: a,
1508
1507
  style: p,
1509
1508
  "aria-hidden": l,
1510
1509
  children: d
1511
- }), /* @__PURE__ */ R("div", {
1510
+ }), /* @__PURE__ */ B("div", {
1512
1511
  style: {
1513
1512
  flex: 1,
1514
1513
  display: l ? "flex" : "none",
@@ -1520,54 +1519,54 @@ function Jt({ initConfig: e, schema: t, loadingComponent: n, wrapperClassName: r
1520
1519
  }
1521
1520
  //#endregion
1522
1521
  //#region src/opfsPaths.ts
1523
- function Yt(e) {
1522
+ function Jt(e) {
1524
1523
  let t = e.split("/").filter(Boolean);
1525
1524
  if (t.length === 0) throw Error(`Invalid OPFS path: "${e}"`);
1526
1525
  return t;
1527
1526
  }
1528
- async function Xt(e, t) {
1527
+ async function Yt(e, t) {
1529
1528
  let n = t ?? await navigator.storage.getDirectory();
1530
1529
  for (let t of e.split("/").filter(Boolean)) n = await n.getDirectoryHandle(t);
1531
1530
  return n;
1532
1531
  }
1533
- async function Zt(e, t) {
1534
- let n = Yt(e), r = n.pop();
1532
+ async function Xt(e, t) {
1533
+ let n = Jt(e), r = n.pop();
1535
1534
  return {
1536
- dir: await Xt(n.join("/"), t),
1535
+ dir: await Yt(n.join("/"), t),
1537
1536
  name: r
1538
1537
  };
1539
1538
  }
1540
- async function Qt(e, t) {
1541
- let { dir: n, name: r } = await Zt(e, t);
1539
+ async function Zt(e, t) {
1540
+ let { dir: n, name: r } = await Xt(e, t);
1542
1541
  return n.getFileHandle(r);
1543
1542
  }
1544
- async function $t(e, t) {
1545
- return (await Qt(e, t)).getFile();
1543
+ async function Qt(e, t) {
1544
+ return (await Zt(e, t)).getFile();
1546
1545
  }
1547
- async function en(e, t) {
1548
- let { dir: n, name: r } = await Zt(e, t);
1546
+ async function $t(e, t) {
1547
+ let { dir: n, name: r } = await Xt(e, t);
1549
1548
  await n.removeEntry(r);
1550
1549
  }
1551
- async function tn(e, t) {
1550
+ async function en(e, t) {
1552
1551
  let n = await e.getDirectoryHandle(t), r = [];
1553
1552
  for await (let e of n.entries()) r.push(e);
1554
1553
  let i = !0;
1555
- for (let [e, t] of r) (t.kind === "file" || !await tn(n, e)) && (i = !1);
1554
+ for (let [e, t] of r) (t.kind === "file" || !await en(n, e)) && (i = !1);
1556
1555
  return i && await e.removeEntry(t), i;
1557
1556
  }
1558
- async function nn(e, t) {
1557
+ async function tn(e, t) {
1559
1558
  try {
1560
- let { dir: n, name: r } = await Zt(e, t);
1561
- return await tn(n, r);
1559
+ let { dir: n, name: r } = await Xt(e, t);
1560
+ return await en(n, r);
1562
1561
  } catch (e) {
1563
1562
  if (e instanceof DOMException && e.name === "NotFoundError") return !0;
1564
1563
  throw e;
1565
1564
  }
1566
1565
  }
1567
- function rn() {
1566
+ function nn() {
1568
1567
  return typeof navigator < "u" && !!navigator.storage && typeof navigator.storage.getDirectory == "function";
1569
1568
  }
1570
- var an = [
1569
+ var rn = [
1571
1570
  {
1572
1571
  type: "image/jpeg",
1573
1572
  test: (e) => e[0] === 255 && e[1] === 216 && e[2] === 255
@@ -1578,43 +1577,43 @@ var an = [
1578
1577
  },
1579
1578
  {
1580
1579
  type: "image/gif",
1581
- test: (e) => on(e, 0, 4) === "GIF8"
1580
+ test: (e) => an(e, 0, 4) === "GIF8"
1582
1581
  },
1583
1582
  {
1584
1583
  type: "image/webp",
1585
- test: (e) => on(e, 0, 4) === "RIFF" && on(e, 8, 12) === "WEBP"
1584
+ test: (e) => an(e, 0, 4) === "RIFF" && an(e, 8, 12) === "WEBP"
1586
1585
  },
1587
1586
  {
1588
1587
  type: "image/avif",
1589
- test: (e) => on(e, 4, 8) === "ftyp" && ["avif", "avis"].includes(on(e, 8, 12))
1588
+ test: (e) => an(e, 4, 8) === "ftyp" && ["avif", "avis"].includes(an(e, 8, 12))
1590
1589
  },
1591
1590
  {
1592
1591
  type: "application/vnd.sqlite3",
1593
- test: (e) => on(e, 0, 15) === "SQLite format 3"
1592
+ test: (e) => an(e, 0, 15) === "SQLite format 3"
1594
1593
  },
1595
1594
  {
1596
1595
  type: "application/pdf",
1597
- test: (e) => on(e, 0, 5) === "%PDF-"
1596
+ test: (e) => an(e, 0, 5) === "%PDF-"
1598
1597
  }
1599
1598
  ];
1600
- function on(e, t, n) {
1599
+ function an(e, t, n) {
1601
1600
  return String.fromCharCode(...e.subarray(t, n));
1602
1601
  }
1603
- function sn(e) {
1604
- return an.find((t) => t.test(e))?.type;
1602
+ function on(e) {
1603
+ return rn.find((t) => t.test(e))?.type;
1605
1604
  }
1606
- async function cn(e) {
1607
- if (e.size !== 0) return sn(new Uint8Array(await e.slice(0, 16).arrayBuffer()));
1605
+ async function sn(e) {
1606
+ if (e.size !== 0) return on(new Uint8Array(await e.slice(0, 16).arrayBuffer()));
1608
1607
  }
1609
1608
  //#endregion
1610
1609
  //#region src/useOPFSFiles.ts
1611
- async function ln(e, t = "") {
1610
+ async function cn(e, t = "") {
1612
1611
  let n = [];
1613
1612
  try {
1614
1613
  for await (let [r, i] of e.entries()) {
1615
1614
  let e = t ? `${t}/${r}` : r;
1616
1615
  if (i.kind === "file") try {
1617
- let t = await i.getFile(), a = t.type ? void 0 : await cn(t).catch(() => void 0);
1616
+ let t = await i.getFile(), a = t.type ? void 0 : await sn(t).catch(() => void 0);
1618
1617
  n.push({
1619
1618
  name: r,
1620
1619
  path: e,
@@ -1627,7 +1626,7 @@ async function ln(e, t = "") {
1627
1626
  console.warn(`Failed to read file ${e}:`, t);
1628
1627
  }
1629
1628
  else if (i.kind === "directory") {
1630
- let t = await ln(i, e);
1629
+ let t = await cn(i, e);
1631
1630
  n.push(...t);
1632
1631
  }
1633
1632
  }
@@ -1636,11 +1635,11 @@ async function ln(e, t = "") {
1636
1635
  }
1637
1636
  return n;
1638
1637
  }
1639
- function un(e = {}) {
1638
+ function ln(e = {}) {
1640
1639
  let { rootPath: t } = e, [r, a] = c([]), [o, s] = c(!0), [l, u] = c(!1), [d, f] = c(null), [p, m] = c(null), h = n(async () => {
1641
1640
  s(!0), f(null), m(null);
1642
1641
  try {
1643
- let e = await ln(await Xt(t ?? ""), t || "");
1642
+ let e = await cn(await Yt(t ?? ""), t || "");
1644
1643
  a(e.sort((e, t) => e.path.localeCompare(t.path)));
1645
1644
  } catch (e) {
1646
1645
  f("Failed to access OPFS: " + (e instanceof Error ? e.message : String(e))), m(e instanceof Error ? e.name : null), console.error("OPFS access error:", e);
@@ -1661,96 +1660,96 @@ function un(e = {}) {
1661
1660
  }
1662
1661
  //#endregion
1663
1662
  //#region src/OPFSFilesManager/format.ts
1664
- var dn = [
1663
+ var un = [
1665
1664
  "B",
1666
1665
  "KB",
1667
1666
  "MB",
1668
1667
  "GB",
1669
1668
  "TB"
1670
1669
  ];
1671
- function Z(e) {
1670
+ function Q(e) {
1672
1671
  if (!Number.isFinite(e) || e <= 0) return "0 B";
1673
- let t = Math.min(dn.length - 1, Math.floor(Math.log(e) / Math.log(1024))), n = e / 1024 ** t;
1674
- return `${t === 0 ? n : n < 10 ? Math.round(n * 10) / 10 : Math.round(n)} ${dn[t]}`;
1672
+ let t = Math.min(un.length - 1, Math.floor(Math.log(e) / Math.log(1024))), n = e / 1024 ** t;
1673
+ return `${t === 0 ? n : n < 10 ? Math.round(n * 10) / 10 : Math.round(n)} ${un[t]}`;
1675
1674
  }
1676
- var fn = 6e4, pn = 60 * fn, mn = 24 * pn;
1677
- function hn(e, t = Date.now()) {
1675
+ var dn = 6e4, fn = 60 * dn, pn = 24 * fn;
1676
+ function mn(e, t = Date.now()) {
1678
1677
  let n = t - e;
1679
- if (n < fn) return "just now";
1680
- if (n < pn) return `${Math.round(n / fn)} min ago`;
1681
- if (n < mn) return `${Math.round(n / pn)} h ago`;
1682
- let r = Math.round(n / mn);
1678
+ if (n < dn) return "just now";
1679
+ if (n < fn) return `${Math.round(n / dn)} min ago`;
1680
+ if (n < pn) return `${Math.round(n / fn)} h ago`;
1681
+ let r = Math.round(n / pn);
1683
1682
  return r === 1 ? "yesterday" : r < 30 ? `${r} days ago` : new Date(e).toLocaleDateString(void 0, { dateStyle: "medium" });
1684
1683
  }
1685
- function gn(e) {
1684
+ function hn(e) {
1686
1685
  return new Date(e).toLocaleString(void 0, {
1687
1686
  dateStyle: "medium",
1688
1687
  timeStyle: "short"
1689
1688
  });
1690
1689
  }
1691
- function _n(e, t) {
1690
+ function gn(e, t) {
1692
1691
  if (e.length <= t) return e;
1693
1692
  let n = Math.ceil((t - 1) / 2), r = Math.floor((t - 1) / 2);
1694
1693
  return `${e.slice(0, n)}…${e.slice(e.length - r)}`;
1695
1694
  }
1696
1695
  //#endregion
1697
1696
  //#region src/OPFSFilesManager/icons.tsx
1698
- var vn = {
1699
- check: /* @__PURE__ */ R("path", { d: "M20 6 9 17l-5-5" }),
1700
- chevronLeft: /* @__PURE__ */ R("path", { d: "m15 18-6-6 6-6" }),
1701
- chevronRight: /* @__PURE__ */ R("path", { d: "m9 18 6-6-6-6" }),
1702
- copy: /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("rect", {
1697
+ var _n = {
1698
+ check: /* @__PURE__ */ B("path", { d: "M20 6 9 17l-5-5" }),
1699
+ chevronLeft: /* @__PURE__ */ B("path", { d: "m15 18-6-6 6-6" }),
1700
+ chevronRight: /* @__PURE__ */ B("path", { d: "m9 18 6-6-6-6" }),
1701
+ copy: /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("rect", {
1703
1702
  width: "14",
1704
1703
  height: "14",
1705
1704
  x: "8",
1706
1705
  y: "8",
1707
1706
  rx: "2",
1708
1707
  ry: "2"
1709
- }), /* @__PURE__ */ R("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })] }),
1710
- database: /* @__PURE__ */ z(L, { children: [
1711
- /* @__PURE__ */ R("ellipse", {
1708
+ }), /* @__PURE__ */ B("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })] }),
1709
+ database: /* @__PURE__ */ V(z, { children: [
1710
+ /* @__PURE__ */ B("ellipse", {
1712
1711
  cx: "12",
1713
1712
  cy: "5",
1714
1713
  rx: "9",
1715
1714
  ry: "3"
1716
1715
  }),
1717
- /* @__PURE__ */ R("path", { d: "M3 5V19A9 3 0 0 0 21 19V5" }),
1718
- /* @__PURE__ */ R("path", { d: "M3 12A9 3 0 0 0 21 12" })
1716
+ /* @__PURE__ */ B("path", { d: "M3 5V19A9 3 0 0 0 21 19V5" }),
1717
+ /* @__PURE__ */ B("path", { d: "M3 12A9 3 0 0 0 21 12" })
1719
1718
  ] }),
1720
- download: /* @__PURE__ */ z(L, { children: [
1721
- /* @__PURE__ */ R("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1722
- /* @__PURE__ */ R("polyline", { points: "7 10 12 15 17 10" }),
1723
- /* @__PURE__ */ R("line", {
1719
+ download: /* @__PURE__ */ V(z, { children: [
1720
+ /* @__PURE__ */ B("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1721
+ /* @__PURE__ */ B("polyline", { points: "7 10 12 15 17 10" }),
1722
+ /* @__PURE__ */ B("line", {
1724
1723
  x1: "12",
1725
1724
  x2: "12",
1726
1725
  y1: "15",
1727
1726
  y2: "3"
1728
1727
  })
1729
1728
  ] }),
1730
- file: /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }), /* @__PURE__ */ R("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" })] }),
1731
- fileCode: /* @__PURE__ */ z(L, { children: [
1732
- /* @__PURE__ */ R("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
1733
- /* @__PURE__ */ R("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
1734
- /* @__PURE__ */ R("path", { d: "m10 13-2 2 2 2" }),
1735
- /* @__PURE__ */ R("path", { d: "m14 17 2-2-2-2" })
1729
+ file: /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }), /* @__PURE__ */ B("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" })] }),
1730
+ fileCode: /* @__PURE__ */ V(z, { children: [
1731
+ /* @__PURE__ */ B("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
1732
+ /* @__PURE__ */ B("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
1733
+ /* @__PURE__ */ B("path", { d: "m10 13-2 2 2 2" }),
1734
+ /* @__PURE__ */ B("path", { d: "m14 17 2-2-2-2" })
1736
1735
  ] }),
1737
- fileJson: /* @__PURE__ */ z(L, { children: [
1738
- /* @__PURE__ */ R("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
1739
- /* @__PURE__ */ R("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
1740
- /* @__PURE__ */ R("path", { d: "M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1" }),
1741
- /* @__PURE__ */ R("path", { d: "M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1" })
1736
+ fileJson: /* @__PURE__ */ V(z, { children: [
1737
+ /* @__PURE__ */ B("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
1738
+ /* @__PURE__ */ B("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
1739
+ /* @__PURE__ */ B("path", { d: "M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1" }),
1740
+ /* @__PURE__ */ B("path", { d: "M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1" })
1742
1741
  ] }),
1743
- fileText: /* @__PURE__ */ z(L, { children: [
1744
- /* @__PURE__ */ R("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
1745
- /* @__PURE__ */ R("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
1746
- /* @__PURE__ */ R("path", { d: "M10 9H8" }),
1747
- /* @__PURE__ */ R("path", { d: "M16 13H8" }),
1748
- /* @__PURE__ */ R("path", { d: "M16 17H8" })
1742
+ fileText: /* @__PURE__ */ V(z, { children: [
1743
+ /* @__PURE__ */ B("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
1744
+ /* @__PURE__ */ B("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
1745
+ /* @__PURE__ */ B("path", { d: "M10 9H8" }),
1746
+ /* @__PURE__ */ B("path", { d: "M16 13H8" }),
1747
+ /* @__PURE__ */ B("path", { d: "M16 17H8" })
1749
1748
  ] }),
1750
- folder: /* @__PURE__ */ R("path", { d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }),
1751
- folderOpen: /* @__PURE__ */ R("path", { d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" }),
1752
- image: /* @__PURE__ */ z(L, { children: [
1753
- /* @__PURE__ */ R("rect", {
1749
+ folder: /* @__PURE__ */ B("path", { d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }),
1750
+ folderOpen: /* @__PURE__ */ B("path", { d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" }),
1751
+ image: /* @__PURE__ */ V(z, { children: [
1752
+ /* @__PURE__ */ B("rect", {
1754
1753
  width: "18",
1755
1754
  height: "18",
1756
1755
  x: "3",
@@ -1758,64 +1757,64 @@ var vn = {
1758
1757
  rx: "2",
1759
1758
  ry: "2"
1760
1759
  }),
1761
- /* @__PURE__ */ R("circle", {
1760
+ /* @__PURE__ */ B("circle", {
1762
1761
  cx: "9",
1763
1762
  cy: "9",
1764
1763
  r: "2"
1765
1764
  }),
1766
- /* @__PURE__ */ R("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
1765
+ /* @__PURE__ */ B("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
1767
1766
  ] }),
1768
- imageOff: /* @__PURE__ */ z(L, { children: [
1769
- /* @__PURE__ */ R("line", {
1767
+ imageOff: /* @__PURE__ */ V(z, { children: [
1768
+ /* @__PURE__ */ B("line", {
1770
1769
  x1: "2",
1771
1770
  x2: "22",
1772
1771
  y1: "2",
1773
1772
  y2: "22"
1774
1773
  }),
1775
- /* @__PURE__ */ R("path", { d: "M10.41 10.41a2 2 0 1 1-2.83-2.83" }),
1776
- /* @__PURE__ */ R("line", {
1774
+ /* @__PURE__ */ B("path", { d: "M10.41 10.41a2 2 0 1 1-2.83-2.83" }),
1775
+ /* @__PURE__ */ B("line", {
1777
1776
  x1: "13.5",
1778
1777
  x2: "6",
1779
1778
  y1: "13.5",
1780
1779
  y2: "21"
1781
1780
  }),
1782
- /* @__PURE__ */ R("line", {
1781
+ /* @__PURE__ */ B("line", {
1783
1782
  x1: "18",
1784
1783
  x2: "21",
1785
1784
  y1: "12",
1786
1785
  y2: "15"
1787
1786
  }),
1788
- /* @__PURE__ */ R("path", { d: "M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59" }),
1789
- /* @__PURE__ */ R("path", { d: "M21 15V5a2 2 0 0 0-2-2H9" })
1787
+ /* @__PURE__ */ B("path", { d: "M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59" }),
1788
+ /* @__PURE__ */ B("path", { d: "M21 15V5a2 2 0 0 0-2-2H9" })
1790
1789
  ] }),
1791
- layers: /* @__PURE__ */ z(L, { children: [
1792
- /* @__PURE__ */ R("path", { d: "m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z" }),
1793
- /* @__PURE__ */ R("path", { d: "m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65" }),
1794
- /* @__PURE__ */ R("path", { d: "m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65" })
1790
+ layers: /* @__PURE__ */ V(z, { children: [
1791
+ /* @__PURE__ */ B("path", { d: "m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z" }),
1792
+ /* @__PURE__ */ B("path", { d: "m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65" }),
1793
+ /* @__PURE__ */ B("path", { d: "m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65" })
1795
1794
  ] }),
1796
- layoutGrid: /* @__PURE__ */ z(L, { children: [
1797
- /* @__PURE__ */ R("rect", {
1795
+ layoutGrid: /* @__PURE__ */ V(z, { children: [
1796
+ /* @__PURE__ */ B("rect", {
1798
1797
  width: "7",
1799
1798
  height: "7",
1800
1799
  x: "3",
1801
1800
  y: "3",
1802
1801
  rx: "1"
1803
1802
  }),
1804
- /* @__PURE__ */ R("rect", {
1803
+ /* @__PURE__ */ B("rect", {
1805
1804
  width: "7",
1806
1805
  height: "7",
1807
1806
  x: "14",
1808
1807
  y: "3",
1809
1808
  rx: "1"
1810
1809
  }),
1811
- /* @__PURE__ */ R("rect", {
1810
+ /* @__PURE__ */ B("rect", {
1812
1811
  width: "7",
1813
1812
  height: "7",
1814
1813
  x: "14",
1815
1814
  y: "14",
1816
1815
  rx: "1"
1817
1816
  }),
1818
- /* @__PURE__ */ R("rect", {
1817
+ /* @__PURE__ */ B("rect", {
1819
1818
  width: "7",
1820
1819
  height: "7",
1821
1820
  x: "3",
@@ -1823,51 +1822,51 @@ var vn = {
1823
1822
  rx: "1"
1824
1823
  })
1825
1824
  ] }),
1826
- list: /* @__PURE__ */ z(L, { children: [
1827
- /* @__PURE__ */ R("path", { d: "M3 12h.01" }),
1828
- /* @__PURE__ */ R("path", { d: "M3 18h.01" }),
1829
- /* @__PURE__ */ R("path", { d: "M3 6h.01" }),
1830
- /* @__PURE__ */ R("path", { d: "M8 12h13" }),
1831
- /* @__PURE__ */ R("path", { d: "M8 18h13" }),
1832
- /* @__PURE__ */ R("path", { d: "M8 6h13" })
1825
+ list: /* @__PURE__ */ V(z, { children: [
1826
+ /* @__PURE__ */ B("path", { d: "M3 12h.01" }),
1827
+ /* @__PURE__ */ B("path", { d: "M3 18h.01" }),
1828
+ /* @__PURE__ */ B("path", { d: "M3 6h.01" }),
1829
+ /* @__PURE__ */ B("path", { d: "M8 12h13" }),
1830
+ /* @__PURE__ */ B("path", { d: "M8 18h13" }),
1831
+ /* @__PURE__ */ B("path", { d: "M8 6h13" })
1833
1832
  ] }),
1834
- refresh: /* @__PURE__ */ z(L, { children: [
1835
- /* @__PURE__ */ R("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
1836
- /* @__PURE__ */ R("path", { d: "M21 3v5h-5" }),
1837
- /* @__PURE__ */ R("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
1838
- /* @__PURE__ */ R("path", { d: "M8 16H3v5" })
1833
+ refresh: /* @__PURE__ */ V(z, { children: [
1834
+ /* @__PURE__ */ B("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
1835
+ /* @__PURE__ */ B("path", { d: "M21 3v5h-5" }),
1836
+ /* @__PURE__ */ B("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
1837
+ /* @__PURE__ */ B("path", { d: "M8 16H3v5" })
1839
1838
  ] }),
1840
- search: /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("circle", {
1839
+ search: /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("circle", {
1841
1840
  cx: "11",
1842
1841
  cy: "11",
1843
1842
  r: "8"
1844
- }), /* @__PURE__ */ R("path", { d: "m21 21-4.3-4.3" })] }),
1845
- trash: /* @__PURE__ */ z(L, { children: [
1846
- /* @__PURE__ */ R("path", { d: "M3 6h18" }),
1847
- /* @__PURE__ */ R("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
1848
- /* @__PURE__ */ R("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }),
1849
- /* @__PURE__ */ R("line", {
1843
+ }), /* @__PURE__ */ B("path", { d: "m21 21-4.3-4.3" })] }),
1844
+ trash: /* @__PURE__ */ V(z, { children: [
1845
+ /* @__PURE__ */ B("path", { d: "M3 6h18" }),
1846
+ /* @__PURE__ */ B("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
1847
+ /* @__PURE__ */ B("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }),
1848
+ /* @__PURE__ */ B("line", {
1850
1849
  x1: "10",
1851
1850
  x2: "10",
1852
1851
  y1: "11",
1853
1852
  y2: "17"
1854
1853
  }),
1855
- /* @__PURE__ */ R("line", {
1854
+ /* @__PURE__ */ B("line", {
1856
1855
  x1: "14",
1857
1856
  x2: "14",
1858
1857
  y1: "11",
1859
1858
  y2: "17"
1860
1859
  })
1861
1860
  ] }),
1862
- triangleAlert: /* @__PURE__ */ z(L, { children: [
1863
- /* @__PURE__ */ R("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
1864
- /* @__PURE__ */ R("path", { d: "M12 9v4" }),
1865
- /* @__PURE__ */ R("path", { d: "M12 17h.01" })
1861
+ triangleAlert: /* @__PURE__ */ V(z, { children: [
1862
+ /* @__PURE__ */ B("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
1863
+ /* @__PURE__ */ B("path", { d: "M12 9v4" }),
1864
+ /* @__PURE__ */ B("path", { d: "M12 17h.01" })
1866
1865
  ] }),
1867
- x: /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("path", { d: "M18 6 6 18" }), /* @__PURE__ */ R("path", { d: "m6 6 12 12" })] })
1866
+ x: /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("path", { d: "M18 6 6 18" }), /* @__PURE__ */ B("path", { d: "m6 6 12 12" })] })
1868
1867
  };
1869
- function Q({ name: e, size: t = 16, strokeWidth: n = 2, className: r }) {
1870
- return /* @__PURE__ */ R("svg", {
1868
+ function $({ name: e, size: t = 16, strokeWidth: n = 2, className: r }) {
1869
+ return /* @__PURE__ */ B("svg", {
1871
1870
  xmlns: "http://www.w3.org/2000/svg",
1872
1871
  width: t,
1873
1872
  height: t,
@@ -1880,20 +1879,20 @@ function Q({ name: e, size: t = 16, strokeWidth: n = 2, className: r }) {
1880
1879
  "aria-hidden": "true",
1881
1880
  focusable: "false",
1882
1881
  className: r,
1883
- children: vn[e]
1882
+ children: _n[e]
1884
1883
  });
1885
1884
  }
1886
1885
  //#endregion
1887
1886
  //#region src/OPFSFilesManager/DeleteDialog.tsx
1888
- var yn = 6;
1889
- function bn({ className: e, onCancel: t, onSubmit: n, children: r }) {
1887
+ var vn = 6;
1888
+ function yn({ className: e, onCancel: t, onSubmit: n, children: r }) {
1890
1889
  let a = s(null);
1891
1890
  return i(() => {
1892
1891
  let e = a.current;
1893
1892
  return e && !e.open && (e.showModal(), e.querySelector("[data-initial-focus]")?.focus()), () => {
1894
1893
  e?.open && e.close();
1895
1894
  };
1896
- }, []), /* @__PURE__ */ R("dialog", {
1895
+ }, []), /* @__PURE__ */ B("dialog", {
1897
1896
  ref: a,
1898
1897
  className: ["seed-fm-dialog", e].filter(Boolean).join(" "),
1899
1898
  "aria-labelledby": "seed-fm-delete-title",
@@ -1903,7 +1902,7 @@ function bn({ className: e, onCancel: t, onSubmit: n, children: r }) {
1903
1902
  onClick: (e) => {
1904
1903
  e.target === e.currentTarget && t();
1905
1904
  },
1906
- children: /* @__PURE__ */ R("form", {
1905
+ children: /* @__PURE__ */ B("form", {
1907
1906
  method: "dialog",
1908
1907
  onSubmit: (e) => {
1909
1908
  e.preventDefault(), n();
@@ -1912,32 +1911,32 @@ function bn({ className: e, onCancel: t, onSubmit: n, children: r }) {
1912
1911
  })
1913
1912
  });
1914
1913
  }
1915
- function xn({ entries: e, rootPath: t, warning: n, deleteActionFor: r, onCancel: i, onConfirm: a, className: o }) {
1916
- let [s, l] = c(!0), u = e.flatMap((e) => e.variants), d = u.reduce((e, t) => e + t.file.size, 0), f = e.length + (s ? u.length : 0), p = t ? `${t}/` : "", m = r(s), h = m.label ? `${m.label}?` : e.length === 1 ? `Delete ${_n(e[0].file.name, 32)}?` : `Delete ${e.length} files?`;
1917
- return /* @__PURE__ */ z(bn, {
1914
+ function bn({ entries: e, rootPath: t, warning: n, deleteActionFor: r, onCancel: i, onConfirm: a, className: o }) {
1915
+ let [s, l] = c(!0), u = e.flatMap((e) => e.variants), d = u.reduce((e, t) => e + t.file.size, 0), f = e.length + (s ? u.length : 0), p = t ? `${t}/` : "", m = r(s), h = m.label ? `${m.label}?` : e.length === 1 ? `Delete ${gn(e[0].file.name, 32)}?` : `Delete ${e.length} files?`;
1916
+ return /* @__PURE__ */ V(yn, {
1918
1917
  className: o,
1919
1918
  onCancel: i,
1920
1919
  onSubmit: () => a(s),
1921
1920
  children: [
1922
- /* @__PURE__ */ R("h3", {
1921
+ /* @__PURE__ */ B("h3", {
1923
1922
  id: "seed-fm-delete-title",
1924
1923
  children: h
1925
1924
  }),
1926
- /* @__PURE__ */ z("p", { children: [
1925
+ /* @__PURE__ */ V("p", { children: [
1927
1926
  "This removes ",
1928
1927
  e.length === 1 ? "it" : "them",
1929
1928
  " from this browser’s private storage. Copies on Arweave or other devices aren’t affected. You can’t undo this."
1930
1929
  ] }),
1931
- /* @__PURE__ */ z("ul", { children: [e.slice(0, yn).map((e) => /* @__PURE__ */ z("li", { children: [/* @__PURE__ */ R("code", {
1930
+ /* @__PURE__ */ V("ul", { children: [e.slice(0, vn).map((e) => /* @__PURE__ */ V("li", { children: [/* @__PURE__ */ B("code", {
1932
1931
  title: e.file.path,
1933
1932
  children: e.file.path.startsWith(p) ? e.file.path.slice(p.length) : e.file.path
1934
- }), /* @__PURE__ */ R("span", { children: Z(e.file.size) })] }, e.file.path)), e.length > yn && /* @__PURE__ */ R("li", { children: /* @__PURE__ */ z("span", { children: [
1933
+ }), /* @__PURE__ */ B("span", { children: Q(e.file.size) })] }, e.file.path)), e.length > vn && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ V("span", { children: [
1935
1934
  "and ",
1936
- e.length - yn,
1935
+ e.length - vn,
1937
1936
  " more"
1938
1937
  ] }) })] }),
1939
- u.length > 0 && /* @__PURE__ */ z("label", { children: [
1940
- /* @__PURE__ */ R("input", {
1938
+ u.length > 0 && /* @__PURE__ */ V("label", { children: [
1939
+ /* @__PURE__ */ B("input", {
1941
1940
  type: "checkbox",
1942
1941
  className: "seed-fm-checkbox",
1943
1942
  checked: s,
@@ -1948,26 +1947,26 @@ function xn({ entries: e, rootPath: t, warning: n, deleteActionFor: r, onCancel:
1948
1947
  " resized ",
1949
1948
  u.length === 1 ? "copy" : "copies",
1950
1949
  " (",
1951
- Z(d),
1950
+ Q(d),
1952
1951
  ")"
1953
1952
  ] }),
1954
- n && /* @__PURE__ */ z("div", {
1953
+ n && /* @__PURE__ */ V("div", {
1955
1954
  className: "seed-fm-warning",
1956
1955
  role: "alert",
1957
- children: [/* @__PURE__ */ R(Q, {
1956
+ children: [/* @__PURE__ */ B($, {
1958
1957
  name: "triangleAlert",
1959
1958
  size: 16
1960
- }), /* @__PURE__ */ R("span", { children: n })]
1959
+ }), /* @__PURE__ */ B("span", { children: n })]
1961
1960
  }),
1962
- /* @__PURE__ */ z("div", {
1961
+ /* @__PURE__ */ V("div", {
1963
1962
  className: "seed-fm-dialog-actions",
1964
- children: [/* @__PURE__ */ R("button", {
1963
+ children: [/* @__PURE__ */ B("button", {
1965
1964
  type: "button",
1966
1965
  className: "seed-fm-btn",
1967
1966
  onClick: i,
1968
1967
  "data-initial-focus": !0,
1969
1968
  children: "Cancel"
1970
- }), /* @__PURE__ */ R("button", {
1969
+ }), /* @__PURE__ */ B("button", {
1971
1970
  type: "submit",
1972
1971
  className: `seed-fm-btn ${m.destructive ? "seed-fm-btn--danger" : "seed-fm-btn--primary"}`,
1973
1972
  children: m.label ?? `Delete ${f} ${f === 1 ? "file" : "files"}`
@@ -1976,43 +1975,43 @@ function xn({ entries: e, rootPath: t, warning: n, deleteActionFor: r, onCancel:
1976
1975
  ]
1977
1976
  });
1978
1977
  }
1979
- function Sn({ folder: e, files: t, hiddenCount: n, warning: r, action: i, busy: a, onDownload: o, onCancel: s, onConfirm: l, className: u }) {
1978
+ function xn({ folder: e, files: t, hiddenCount: n, warning: r, action: i, busy: a, onDownload: o, onCancel: s, onConfirm: l, className: u }) {
1980
1979
  let [d, f] = c(!1), p = t.reduce((e, t) => e + t.size, 0), m = `${e.path}/`, h = `${t.length} ${t.length === 1 ? "file" : "files"}`, g = t.length - e.fileCount;
1981
- return /* @__PURE__ */ z(bn, {
1980
+ return /* @__PURE__ */ V(yn, {
1982
1981
  className: u,
1983
1982
  onCancel: s,
1984
1983
  onSubmit: l,
1985
1984
  children: [
1986
- /* @__PURE__ */ R("h3", {
1985
+ /* @__PURE__ */ B("h3", {
1987
1986
  id: "seed-fm-delete-title",
1988
- children: i.label ? `${i.label}?` : `Delete the “${_n(e.name, 32)}” folder?`
1987
+ children: i.label ? `${i.label}?` : `Delete the “${gn(e.name, 32)}” folder?`
1989
1988
  }),
1990
- /* @__PURE__ */ z("p", { children: [
1989
+ /* @__PURE__ */ V("p", { children: [
1991
1990
  "This removes the folder and the ",
1992
1991
  h,
1993
1992
  " in it (",
1994
- Z(p),
1993
+ Q(p),
1995
1994
  g > 0 && `, including ${g} resized ${g === 1 ? "copy" : "copies"}`,
1996
1995
  ") from this browser’s private storage. Copies on Arweave or other devices aren’t affected."
1997
1996
  ] }),
1998
- /* @__PURE__ */ z("div", {
1997
+ /* @__PURE__ */ V("div", {
1999
1998
  className: "seed-fm-irreversible",
2000
- children: [/* @__PURE__ */ R(Q, {
1999
+ children: [/* @__PURE__ */ B($, {
2001
2000
  name: "triangleAlert",
2002
2001
  size: 16
2003
- }), /* @__PURE__ */ z("span", { children: [/* @__PURE__ */ R("strong", { children: "This can’t be undone." }), " Once deleted, these files can’t be recovered from this browser."] })]
2002
+ }), /* @__PURE__ */ V("span", { children: [/* @__PURE__ */ B("strong", { children: "This can’t be undone." }), " Once deleted, these files can’t be recovered from this browser."] })]
2004
2003
  }),
2005
- /* @__PURE__ */ z("ul", { children: [t.slice(0, yn).map((e) => /* @__PURE__ */ z("li", { children: [/* @__PURE__ */ R("code", {
2004
+ /* @__PURE__ */ V("ul", { children: [t.slice(0, vn).map((e) => /* @__PURE__ */ V("li", { children: [/* @__PURE__ */ B("code", {
2006
2005
  title: e.path,
2007
2006
  children: e.path.slice(m.length)
2008
- }), /* @__PURE__ */ R("span", { children: Z(e.size) })] }, e.path)), t.length > yn && /* @__PURE__ */ R("li", { children: /* @__PURE__ */ z("span", { children: [
2007
+ }), /* @__PURE__ */ B("span", { children: Q(e.size) })] }, e.path)), t.length > vn && /* @__PURE__ */ B("li", { children: /* @__PURE__ */ V("span", { children: [
2009
2008
  "and ",
2010
- t.length - yn,
2009
+ t.length - vn,
2011
2010
  " more"
2012
2011
  ] }) })] }),
2013
- /* @__PURE__ */ z("div", {
2012
+ /* @__PURE__ */ V("div", {
2014
2013
  className: "seed-fm-keepcopy",
2015
- children: [/* @__PURE__ */ R("span", { children: d ? "Saved a copy to your computer." : "Want a copy first? Save the folder to your computer." }), /* @__PURE__ */ z("button", {
2014
+ children: [/* @__PURE__ */ B("span", { children: d ? "Saved a copy to your computer." : "Want a copy first? Save the folder to your computer." }), /* @__PURE__ */ V("button", {
2016
2015
  type: "button",
2017
2016
  className: "seed-fm-btn",
2018
2017
  disabled: a,
@@ -2020,7 +2019,7 @@ function Sn({ folder: e, files: t, hiddenCount: n, warning: r, action: i, busy:
2020
2019
  await o() && f(!0);
2021
2020
  },
2022
2021
  children: [
2023
- /* @__PURE__ */ R(Q, {
2022
+ /* @__PURE__ */ B($, {
2024
2023
  name: d ? "check" : "download",
2025
2024
  size: 15
2026
2025
  }),
@@ -2029,7 +2028,7 @@ function Sn({ folder: e, files: t, hiddenCount: n, warning: r, action: i, busy:
2029
2028
  ]
2030
2029
  })]
2031
2030
  }),
2032
- n > 0 && /* @__PURE__ */ z("p", { children: [
2031
+ n > 0 && /* @__PURE__ */ V("p", { children: [
2033
2032
  n,
2034
2033
  " other ",
2035
2034
  n === 1 ? "file" : "files",
@@ -2038,23 +2037,23 @@ function Sn({ folder: e, files: t, hiddenCount: n, warning: r, action: i, busy:
2038
2037
  " ",
2039
2038
  "hidden here and won’t be deleted, so the folder itself will stay."
2040
2039
  ] }),
2041
- r && /* @__PURE__ */ z("div", {
2040
+ r && /* @__PURE__ */ V("div", {
2042
2041
  className: "seed-fm-warning",
2043
2042
  role: "alert",
2044
- children: [/* @__PURE__ */ R(Q, {
2043
+ children: [/* @__PURE__ */ B($, {
2045
2044
  name: "triangleAlert",
2046
2045
  size: 16
2047
- }), /* @__PURE__ */ R("span", { children: r })]
2046
+ }), /* @__PURE__ */ B("span", { children: r })]
2048
2047
  }),
2049
- /* @__PURE__ */ z("div", {
2048
+ /* @__PURE__ */ V("div", {
2050
2049
  className: "seed-fm-dialog-actions",
2051
- children: [/* @__PURE__ */ R("button", {
2050
+ children: [/* @__PURE__ */ B("button", {
2052
2051
  type: "button",
2053
2052
  className: "seed-fm-btn",
2054
2053
  onClick: s,
2055
2054
  "data-initial-focus": !0,
2056
2055
  children: "Cancel"
2057
- }), /* @__PURE__ */ R("button", {
2056
+ }), /* @__PURE__ */ B("button", {
2058
2057
  type: "submit",
2059
2058
  disabled: a,
2060
2059
  className: `seed-fm-btn ${i.destructive ? "seed-fm-btn--danger" : "seed-fm-btn--primary"}`,
@@ -2066,18 +2065,18 @@ function Sn({ folder: e, files: t, hiddenCount: n, warning: r, action: i, busy:
2066
2065
  }
2067
2066
  //#endregion
2068
2067
  //#region src/OPFSFilesManager/fileModel.ts
2069
- function Cn(e) {
2068
+ function Sn(e) {
2070
2069
  return e.detectedType ?? e.type;
2071
2070
  }
2072
- var wn = /\.(db|sqlite|sqlite3)(-journal|-wal|-shm)?$/i;
2073
- function $(e) {
2074
- let t = Cn(e);
2075
- return t.startsWith("image/") ? "image" : t === "application/vnd.sqlite3" || wn.test(e.name) ? "database" : t === "application/json" || /\.json$/i.test(e.name) ? "json" : t === "text/html" || /\.html?$/i.test(e.name) ? "html" : t.startsWith("text/") ? "text" : "other";
2071
+ var Cn = /\.(db|sqlite|sqlite3)(-journal|-wal|-shm)?$/i;
2072
+ function wn(e) {
2073
+ let t = Sn(e);
2074
+ return t.startsWith("image/") ? "image" : t === "application/vnd.sqlite3" || Cn.test(e.name) ? "database" : t === "application/json" || /\.json$/i.test(e.name) ? "json" : t === "text/html" || /\.html?$/i.test(e.name) ? "html" : t.startsWith("text/") ? "text" : "other";
2076
2075
  }
2077
2076
  function Tn(e) {
2078
2077
  let t = /\.([a-z0-9-]{1,12})$/i.exec(e.name)?.[1];
2079
2078
  if (t) return t.toLowerCase();
2080
- let n = Cn(e);
2079
+ let n = Sn(e);
2081
2080
  return n === "application/octet-stream" ? "bin" : n.split("/")[1]?.replace(/^vnd\./, "") ?? "bin";
2082
2081
  }
2083
2082
  var En = /^(.*\/)?images\/(\d+)\/([^/]+)\.webp$/, Dn = /^(.*\/)?images\/([^/]+)$/, On = (e) => e.replace(/\.[^/.]+$/, "");
@@ -2112,7 +2111,7 @@ function Mn(e, t) {
2112
2111
  let a = jn(t);
2113
2112
  r.push(a);
2114
2113
  let o = An(t.path);
2115
- o && $(t) === "image" && n.set(o, a);
2114
+ o && wn(t) === "image" && n.set(o, a);
2116
2115
  }
2117
2116
  for (let e of i) {
2118
2117
  let t = n.get(e.key);
@@ -2168,7 +2167,7 @@ function In(e) {
2168
2167
  text: 0,
2169
2168
  other: 0
2170
2169
  };
2171
- for (let n of e) t[$(n)] += n.size;
2170
+ for (let n of e) t[wn(n)] += n.size;
2172
2171
  return t;
2173
2172
  }
2174
2173
  function Ln(e) {
@@ -2230,7 +2229,7 @@ async function qn(e) {
2230
2229
  }
2231
2230
  async function Jn(e) {
2232
2231
  let t = e.variants[0];
2233
- return t ? $t(t.file.path) : qn(await $t(e.file.path));
2232
+ return t ? Qt(t.file.path) : qn(await Qt(e.file.path));
2234
2233
  }
2235
2234
  var Yn = /* @__PURE__ */ new WeakMap(), Xn = null;
2236
2235
  function Zn(e, t) {
@@ -2241,7 +2240,7 @@ function Zn(e, t) {
2241
2240
  });
2242
2241
  }
2243
2242
  function Qn(e) {
2244
- let t = $(e.file) === "image", [r, a] = c(null), [o, s] = c(!1), [l, u] = c(null), [d, f] = c("idle"), p = n((e) => a(e), []);
2243
+ let t = wn(e.file) === "image", [r, a] = c(null), [o, s] = c(!1), [l, u] = c(null), [d, f] = c("idle"), p = n((e) => a(e), []);
2245
2244
  i(() => {
2246
2245
  if (t && r && !o) return Zn(r, () => s(!0));
2247
2246
  }, [
@@ -2308,36 +2307,36 @@ var $n = {
2308
2307
  label: "Other",
2309
2308
  color: "var(--seed-kind-other)"
2310
2309
  }
2311
- }, er = (e) => ({ "--seed-kind": $n[e].color }), tr = (e) => /png|webp|gif|avif|svg/.test(Cn(e.file));
2310
+ }, er = (e) => ({ "--seed-kind": $n[e].color }), tr = (e) => /png|webp|gif|avif|svg/.test(Sn(e.file));
2312
2311
  function nr({ entry: e, size: t, children: n }) {
2313
- let r = $(e.file), { ref: i, url: a, status: o, markError: s } = Qn(e), c = r === "image" && o === "error", l = r === "image" && a && !c, u = [
2312
+ let r = wn(e.file), { ref: i, url: a, status: o, markError: s } = Qn(e), c = r === "image" && o === "error", l = r === "image" && a && !c, u = [
2314
2313
  t === "tile" ? "seed-fm-thumb" : "seed-fm-mini",
2315
2314
  l && tr(e) ? "seed-fm-thumb--checker" : "",
2316
2315
  r === "image" && o === "loading" ? "seed-fm-skeleton" : ""
2317
2316
  ].filter(Boolean).join(" "), d;
2318
- return d = l ? /* @__PURE__ */ R("img", {
2317
+ return d = l ? /* @__PURE__ */ B("img", {
2319
2318
  src: a,
2320
2319
  alt: "",
2321
2320
  decoding: "async",
2322
2321
  draggable: !1,
2323
2322
  onError: s
2324
- }) : t === "mini" ? /* @__PURE__ */ R(Q, {
2323
+ }) : t === "mini" ? /* @__PURE__ */ B($, {
2325
2324
  name: c ? "imageOff" : $n[r].icon,
2326
2325
  size: 16
2327
- }) : r === "image" && !c ? null : /* @__PURE__ */ z("span", {
2326
+ }) : r === "image" && !c ? null : /* @__PURE__ */ V("span", {
2328
2327
  className: "seed-fm-kind",
2329
- children: [/* @__PURE__ */ R(Q, {
2328
+ children: [/* @__PURE__ */ B($, {
2330
2329
  name: c ? "imageOff" : $n[r].icon,
2331
2330
  size: 28,
2332
2331
  strokeWidth: 1.6
2333
- }), c ? /* @__PURE__ */ R("span", {
2332
+ }), c ? /* @__PURE__ */ B("span", {
2334
2333
  className: "seed-fm-kind-error",
2335
2334
  children: "Can’t decode image"
2336
- }) : /* @__PURE__ */ R("span", {
2335
+ }) : /* @__PURE__ */ B("span", {
2337
2336
  className: "seed-fm-ext",
2338
2337
  children: Tn(e.file)
2339
2338
  })]
2340
- }), /* @__PURE__ */ z("span", {
2339
+ }), /* @__PURE__ */ V("span", {
2341
2340
  ref: i,
2342
2341
  className: u,
2343
2342
  style: er(r),
@@ -2347,14 +2346,14 @@ function nr({ entry: e, size: t, children: n }) {
2347
2346
  //#endregion
2348
2347
  //#region src/OPFSFilesManager/FileGrid.tsx
2349
2348
  function rr({ entries: e, selected: t, onActivate: n, onToggle: r, className: i, tileClassName: a }) {
2350
- return /* @__PURE__ */ R("ul", {
2349
+ return /* @__PURE__ */ B("ul", {
2351
2350
  className: ["seed-fm-grid", i].filter(Boolean).join(" "),
2352
2351
  role: "listbox",
2353
2352
  "aria-label": "Files",
2354
2353
  "aria-multiselectable": "true",
2355
2354
  children: e.map((e, i) => {
2356
2355
  let { file: o, variants: s } = e, c = t.has(o.path);
2357
- return /* @__PURE__ */ z("li", {
2356
+ return /* @__PURE__ */ V("li", {
2358
2357
  role: "option",
2359
2358
  tabIndex: 0,
2360
2359
  "aria-selected": c,
@@ -2366,10 +2365,10 @@ function rr({ entries: e, selected: t, onActivate: n, onToggle: r, className: i,
2366
2365
  onKeyDown: (t) => {
2367
2366
  t.target === t.currentTarget && (t.key === "Enter" ? (t.preventDefault(), n(e, i, t)) : t.key === " " && (t.preventDefault(), r(e, i, t.shiftKey)));
2368
2367
  },
2369
- children: [/* @__PURE__ */ z(nr, {
2368
+ children: [/* @__PURE__ */ V(nr, {
2370
2369
  entry: e,
2371
2370
  size: "tile",
2372
- children: [/* @__PURE__ */ R("button", {
2371
+ children: [/* @__PURE__ */ B("button", {
2373
2372
  type: "button",
2374
2373
  className: "seed-fm-check",
2375
2374
  tabIndex: -1,
@@ -2377,16 +2376,16 @@ function rr({ entries: e, selected: t, onActivate: n, onToggle: r, className: i,
2377
2376
  onClick: (t) => {
2378
2377
  t.stopPropagation(), r(e, i, t.shiftKey);
2379
2378
  },
2380
- children: c && /* @__PURE__ */ R(Q, {
2379
+ children: c && /* @__PURE__ */ B($, {
2381
2380
  name: "check",
2382
2381
  size: 14,
2383
2382
  strokeWidth: 3
2384
2383
  })
2385
- }), s.length > 0 && /* @__PURE__ */ z("span", {
2384
+ }), s.length > 0 && /* @__PURE__ */ V("span", {
2386
2385
  className: "seed-fm-badge",
2387
2386
  title: "Resized copies are grouped with this image",
2388
2387
  children: [
2389
- /* @__PURE__ */ R(Q, {
2388
+ /* @__PURE__ */ B($, {
2390
2389
  name: "layers",
2391
2390
  size: 11,
2392
2391
  strokeWidth: 2.2
@@ -2396,21 +2395,21 @@ function rr({ entries: e, selected: t, onActivate: n, onToggle: r, className: i,
2396
2395
  s.length === 1 ? "size" : "sizes"
2397
2396
  ]
2398
2397
  })]
2399
- }), /* @__PURE__ */ z("span", {
2398
+ }), /* @__PURE__ */ V("span", {
2400
2399
  className: "seed-fm-tile-meta",
2401
- children: [/* @__PURE__ */ R("span", {
2400
+ children: [/* @__PURE__ */ B("span", {
2402
2401
  className: "seed-fm-tile-name",
2403
- children: _n(o.name, 24)
2404
- }), /* @__PURE__ */ z("span", {
2402
+ children: gn(o.name, 24)
2403
+ }), /* @__PURE__ */ V("span", {
2405
2404
  className: "seed-fm-tile-sub",
2406
2405
  children: [
2407
- Z(o.size),
2406
+ Q(o.size),
2408
2407
  " ·",
2409
2408
  " ",
2410
- /* @__PURE__ */ R("time", {
2409
+ /* @__PURE__ */ B("time", {
2411
2410
  dateTime: new Date(o.lastModified).toISOString(),
2412
- title: gn(o.lastModified),
2413
- children: hn(o.lastModified)
2411
+ title: hn(o.lastModified),
2412
+ children: mn(o.lastModified)
2414
2413
  })
2415
2414
  ]
2416
2415
  })]
@@ -2427,14 +2426,14 @@ function ir({ entries: e, selected: t, cwd: n, onActivate: r, onToggle: a, onTog
2427
2426
  p.current && (p.current.indeterminate = m > 0 && !h);
2428
2427
  }, [m, h]);
2429
2428
  let g = n ? `${n}/` : "";
2430
- return /* @__PURE__ */ R("div", {
2429
+ return /* @__PURE__ */ B("div", {
2431
2430
  className: "seed-fm-list-wrap",
2432
- children: /* @__PURE__ */ z("table", {
2431
+ children: /* @__PURE__ */ V("table", {
2433
2432
  className: ["seed-fm-list", d].filter(Boolean).join(" "),
2434
- children: [/* @__PURE__ */ R("thead", { children: /* @__PURE__ */ z("tr", { children: [
2435
- /* @__PURE__ */ R("th", {
2433
+ children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ V("tr", { children: [
2434
+ /* @__PURE__ */ B("th", {
2436
2435
  style: { width: 28 },
2437
- children: /* @__PURE__ */ R("input", {
2436
+ children: /* @__PURE__ */ B("input", {
2438
2437
  ref: p,
2439
2438
  type: "checkbox",
2440
2439
  className: "seed-fm-checkbox",
@@ -2443,34 +2442,34 @@ function ir({ entries: e, selected: t, cwd: n, onActivate: r, onToggle: a, onTog
2443
2442
  "aria-label": "Select all"
2444
2443
  })
2445
2444
  }),
2446
- /* @__PURE__ */ R("th", { children: "Name" }),
2447
- /* @__PURE__ */ R("th", {
2445
+ /* @__PURE__ */ B("th", { children: "Name" }),
2446
+ /* @__PURE__ */ B("th", {
2448
2447
  className: "seed-fm-col-type",
2449
2448
  children: "Type"
2450
2449
  }),
2451
- /* @__PURE__ */ R("th", {
2450
+ /* @__PURE__ */ B("th", {
2452
2451
  className: "seed-fm-num seed-fm-col-size",
2453
2452
  children: "Size"
2454
2453
  }),
2455
- /* @__PURE__ */ R("th", {
2454
+ /* @__PURE__ */ B("th", {
2456
2455
  className: "seed-fm-col-modified",
2457
2456
  children: "Modified"
2458
2457
  }),
2459
- /* @__PURE__ */ R("th", { children: /* @__PURE__ */ R("span", {
2458
+ /* @__PURE__ */ B("th", { children: /* @__PURE__ */ B("span", {
2460
2459
  className: "seed-fm-visually-hidden",
2461
2460
  children: "Actions"
2462
2461
  }) })
2463
- ] }) }), /* @__PURE__ */ R("tbody", { children: e.map((e, n) => {
2462
+ ] }) }), /* @__PURE__ */ B("tbody", { children: e.map((e, n) => {
2464
2463
  let { file: i } = e, o = t.has(i.path), s = u(e);
2465
- return /* @__PURE__ */ z("tr", {
2464
+ return /* @__PURE__ */ V("tr", {
2466
2465
  "data-path": i.path,
2467
2466
  "aria-selected": o,
2468
2467
  className: ["seed-fm-row", f].filter(Boolean).join(" "),
2469
2468
  onClick: (t) => r(e, n, t),
2470
2469
  children: [
2471
- /* @__PURE__ */ R("td", {
2470
+ /* @__PURE__ */ B("td", {
2472
2471
  onClick: (e) => e.stopPropagation(),
2473
- children: /* @__PURE__ */ R("input", {
2472
+ children: /* @__PURE__ */ B("input", {
2474
2473
  type: "checkbox",
2475
2474
  className: "seed-fm-checkbox",
2476
2475
  checked: o,
@@ -2479,61 +2478,61 @@ function ir({ entries: e, selected: t, cwd: n, onActivate: r, onToggle: a, onTog
2479
2478
  "aria-label": `Select ${i.name}`
2480
2479
  })
2481
2480
  }),
2482
- /* @__PURE__ */ R("td", { children: /* @__PURE__ */ z("span", {
2481
+ /* @__PURE__ */ B("td", { children: /* @__PURE__ */ V("span", {
2483
2482
  className: "seed-fm-namecell",
2484
- children: [/* @__PURE__ */ R(nr, {
2483
+ children: [/* @__PURE__ */ B(nr, {
2485
2484
  entry: e,
2486
2485
  size: "mini"
2487
- }), /* @__PURE__ */ z("span", { children: [/* @__PURE__ */ R("button", {
2486
+ }), /* @__PURE__ */ V("span", { children: [/* @__PURE__ */ B("button", {
2488
2487
  type: "button",
2489
2488
  className: "seed-fm-row-name seed-fm-row-open",
2490
2489
  onClick: (t) => {
2491
2490
  t.stopPropagation(), r(e, n, t);
2492
2491
  },
2493
2492
  children: i.name
2494
- }), i.path.slice(g.length) !== i.name && /* @__PURE__ */ R("span", {
2493
+ }), i.path.slice(g.length) !== i.name && /* @__PURE__ */ B("span", {
2495
2494
  className: "seed-fm-row-path",
2496
2495
  children: i.path.slice(g.length)
2497
2496
  })] })]
2498
2497
  }) }),
2499
- /* @__PURE__ */ R("td", {
2498
+ /* @__PURE__ */ B("td", {
2500
2499
  className: "seed-fm-col-type",
2501
- children: /* @__PURE__ */ z("span", {
2500
+ children: /* @__PURE__ */ V("span", {
2502
2501
  className: "seed-fm-type",
2503
- style: er($(i)),
2504
- children: [Cn(i), i.detectedType && /* @__PURE__ */ R("small", { children: "detected" })]
2502
+ style: er(wn(i)),
2503
+ children: [Sn(i), i.detectedType && /* @__PURE__ */ B("small", { children: "detected" })]
2505
2504
  })
2506
2505
  }),
2507
- /* @__PURE__ */ R("td", {
2506
+ /* @__PURE__ */ B("td", {
2508
2507
  className: "seed-fm-num seed-fm-col-size",
2509
2508
  title: `${i.size.toLocaleString()} bytes`,
2510
- children: Z(e.totalSize)
2509
+ children: Q(e.totalSize)
2511
2510
  }),
2512
- /* @__PURE__ */ R("td", {
2511
+ /* @__PURE__ */ B("td", {
2513
2512
  className: "seed-fm-when seed-fm-col-modified",
2514
- title: gn(i.lastModified),
2515
- children: hn(i.lastModified)
2513
+ title: hn(i.lastModified),
2514
+ children: mn(i.lastModified)
2516
2515
  }),
2517
- /* @__PURE__ */ z("td", {
2516
+ /* @__PURE__ */ V("td", {
2518
2517
  className: "seed-fm-actions",
2519
2518
  onClick: (e) => e.stopPropagation(),
2520
- children: [/* @__PURE__ */ R("button", {
2519
+ children: [/* @__PURE__ */ B("button", {
2521
2520
  type: "button",
2522
2521
  className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
2523
2522
  "aria-label": `Download ${i.name}`,
2524
2523
  title: "Download",
2525
2524
  onClick: () => c(e),
2526
- children: /* @__PURE__ */ R(Q, {
2525
+ children: /* @__PURE__ */ B($, {
2527
2526
  name: "download",
2528
2527
  size: 15
2529
2528
  })
2530
- }), /* @__PURE__ */ R("button", {
2529
+ }), /* @__PURE__ */ B("button", {
2531
2530
  type: "button",
2532
2531
  className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
2533
2532
  "aria-label": s.label ? `${s.label}: ${i.name}` : `Delete ${i.name}`,
2534
2533
  title: s.label ?? "Delete",
2535
2534
  onClick: () => l(e),
2536
- children: /* @__PURE__ */ R(Q, {
2535
+ children: /* @__PURE__ */ B($, {
2537
2536
  name: "trash",
2538
2537
  size: 15
2539
2538
  })
@@ -2549,11 +2548,11 @@ function ir({ entries: e, selected: t, cwd: n, onActivate: r, onToggle: a, onTog
2549
2548
  //#region src/OPFSFilesManager/PreviewPanel.tsx
2550
2549
  var ar = 1048576, or = 32768;
2551
2550
  function sr(e) {
2552
- let [t, n] = c({ kind: "loading" }), { path: r, lastModified: a } = e.file, o = $(e.file), s = e.file.size;
2551
+ let [t, n] = c({ kind: "loading" }), { path: r, lastModified: a } = e.file, o = wn(e.file), s = e.file.size;
2553
2552
  return i(() => {
2554
2553
  let e = !1, t = null;
2555
2554
  return n({ kind: "loading" }), (async () => {
2556
- if (o === "image") return t = URL.createObjectURL(await $t(r)), {
2555
+ if (o === "image") return t = URL.createObjectURL(await Qt(r)), {
2557
2556
  kind: "image",
2558
2557
  url: t
2559
2558
  };
@@ -2562,7 +2561,7 @@ function sr(e) {
2562
2561
  kind: "none",
2563
2562
  message: "This file is too large to preview."
2564
2563
  };
2565
- let e = await $t(r), t = e.size > or, n = await e.slice(0, or).text();
2564
+ let e = await Qt(r), t = e.size > or, n = await e.slice(0, or).text();
2566
2565
  if (o === "json" && !t) try {
2567
2566
  n = JSON.stringify(JSON.parse(n), null, 2);
2568
2567
  } catch {}
@@ -2597,14 +2596,14 @@ function sr(e) {
2597
2596
  ]), t;
2598
2597
  }
2599
2598
  function cr({ entry: e, onClose: t, onPrevious: n, onNext: r, onDownload: a, onDelete: o, deleteAction: l, onCopyPath: u, className: d }) {
2600
- let { file: f, variants: p } = e, m = $(f), h = sr(e), [g, _] = c(null), [v, y] = c(!1), b = s(null);
2599
+ let { file: f, variants: p } = e, m = wn(f), h = sr(e), [g, _] = c(null), [v, y] = c(!1), b = s(null);
2601
2600
  i(() => {
2602
2601
  _(null), y(!1);
2603
2602
  }, [f.path]), i(() => {
2604
2603
  b.current?.focus();
2605
2604
  }, []);
2606
2605
  let x = `seed-fm-panel-${encodeURIComponent(f.path)}`, S = p.reduce((e, t) => e + t.file.size, 0), C;
2607
- if (h.kind === "image" && !v) C = /* @__PURE__ */ R("img", {
2606
+ if (h.kind === "image" && !v) C = /* @__PURE__ */ B("img", {
2608
2607
  src: h.url,
2609
2608
  alt: `Preview of ${f.name}`,
2610
2609
  onLoad: (e) => _({
@@ -2613,64 +2612,64 @@ function cr({ entry: e, onClose: t, onPrevious: n, onNext: r, onDownload: a, onD
2613
2612
  }),
2614
2613
  onError: () => y(!0)
2615
2614
  });
2616
- else if (h.kind === "text") C = /* @__PURE__ */ z("pre", { children: [h.text, h.truncated && "\n…"] });
2615
+ else if (h.kind === "text") C = /* @__PURE__ */ V("pre", { children: [h.text, h.truncated && "\n…"] });
2617
2616
  else if (h.kind === "loading") C = null;
2618
2617
  else {
2619
2618
  let e = h.kind === "none" ? h.message : "The browser can’t decode this image. The file may be corrupt or not an image.";
2620
- C = /* @__PURE__ */ z("span", {
2619
+ C = /* @__PURE__ */ V("span", {
2621
2620
  className: "seed-fm-preview-note",
2622
- children: [/* @__PURE__ */ R(Q, {
2621
+ children: [/* @__PURE__ */ B($, {
2623
2622
  name: v ? "imageOff" : $n[m].icon,
2624
2623
  size: 32,
2625
2624
  strokeWidth: 1.5
2626
2625
  }), e]
2627
2626
  });
2628
2627
  }
2629
- let w = h.kind === "image" && !v && /png|webp|gif|avif|svg/.test(Cn(f));
2630
- return /* @__PURE__ */ z("aside", {
2628
+ let w = h.kind === "image" && !v && /png|webp|gif|avif|svg/.test(Sn(f));
2629
+ return /* @__PURE__ */ V("aside", {
2631
2630
  className: ["seed-fm-panel", d].filter(Boolean).join(" "),
2632
2631
  role: "dialog",
2633
2632
  "aria-modal": "false",
2634
2633
  "aria-labelledby": x,
2635
2634
  children: [
2636
- /* @__PURE__ */ z("div", {
2635
+ /* @__PURE__ */ V("div", {
2637
2636
  className: "seed-fm-panel-head",
2638
2637
  children: [
2639
- /* @__PURE__ */ R("h3", {
2638
+ /* @__PURE__ */ B("h3", {
2640
2639
  id: x,
2641
2640
  title: f.name,
2642
2641
  children: f.name
2643
2642
  }),
2644
- /* @__PURE__ */ R("button", {
2643
+ /* @__PURE__ */ B("button", {
2645
2644
  type: "button",
2646
2645
  className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
2647
2646
  "aria-label": "Previous file",
2648
2647
  disabled: !n,
2649
2648
  onClick: n ?? void 0,
2650
- children: /* @__PURE__ */ R(Q, { name: "chevronLeft" })
2649
+ children: /* @__PURE__ */ B($, { name: "chevronLeft" })
2651
2650
  }),
2652
- /* @__PURE__ */ R("button", {
2651
+ /* @__PURE__ */ B("button", {
2653
2652
  type: "button",
2654
2653
  className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
2655
2654
  "aria-label": "Next file",
2656
2655
  disabled: !r,
2657
2656
  onClick: r ?? void 0,
2658
- children: /* @__PURE__ */ R(Q, { name: "chevronRight" })
2657
+ children: /* @__PURE__ */ B($, { name: "chevronRight" })
2659
2658
  }),
2660
- /* @__PURE__ */ R("button", {
2659
+ /* @__PURE__ */ B("button", {
2661
2660
  ref: b,
2662
2661
  type: "button",
2663
2662
  className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
2664
2663
  "aria-label": "Close details",
2665
2664
  onClick: t,
2666
- children: /* @__PURE__ */ R(Q, { name: "x" })
2665
+ children: /* @__PURE__ */ B($, { name: "x" })
2667
2666
  })
2668
2667
  ]
2669
2668
  }),
2670
- /* @__PURE__ */ z("div", {
2669
+ /* @__PURE__ */ V("div", {
2671
2670
  className: "seed-fm-panel-body",
2672
2671
  children: [
2673
- /* @__PURE__ */ R("div", {
2672
+ /* @__PURE__ */ B("div", {
2674
2673
  className: [
2675
2674
  "seed-fm-preview",
2676
2675
  w ? "seed-fm-thumb--checker" : "",
@@ -2679,78 +2678,78 @@ function cr({ entry: e, onClose: t, onPrevious: n, onNext: r, onDownload: a, onD
2679
2678
  style: er(m),
2680
2679
  children: C
2681
2680
  }),
2682
- /* @__PURE__ */ z("dl", {
2681
+ /* @__PURE__ */ V("dl", {
2683
2682
  className: "seed-fm-details",
2684
2683
  children: [
2685
- /* @__PURE__ */ R("dt", { children: "Path" }),
2686
- /* @__PURE__ */ R("dd", { children: /* @__PURE__ */ z("span", {
2684
+ /* @__PURE__ */ B("dt", { children: "Path" }),
2685
+ /* @__PURE__ */ B("dd", { children: /* @__PURE__ */ V("span", {
2687
2686
  className: "seed-fm-path",
2688
- children: [/* @__PURE__ */ R("code", { children: f.path }), /* @__PURE__ */ R("button", {
2687
+ children: [/* @__PURE__ */ B("code", { children: f.path }), /* @__PURE__ */ B("button", {
2689
2688
  type: "button",
2690
2689
  className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
2691
2690
  "aria-label": "Copy path",
2692
2691
  title: "Copy path",
2693
2692
  onClick: u,
2694
- children: /* @__PURE__ */ R(Q, {
2693
+ children: /* @__PURE__ */ B($, {
2695
2694
  name: "copy",
2696
2695
  size: 13
2697
2696
  })
2698
2697
  })]
2699
2698
  }) }),
2700
- /* @__PURE__ */ R("dt", { children: "Size" }),
2701
- /* @__PURE__ */ z("dd", { children: [
2702
- Z(f.size),
2699
+ /* @__PURE__ */ B("dt", { children: "Size" }),
2700
+ /* @__PURE__ */ V("dd", { children: [
2701
+ Q(f.size),
2703
2702
  " ",
2704
- /* @__PURE__ */ z("small", { children: [f.size.toLocaleString(), " bytes"] })
2703
+ /* @__PURE__ */ V("small", { children: [f.size.toLocaleString(), " bytes"] })
2705
2704
  ] }),
2706
- /* @__PURE__ */ R("dt", { children: "Type" }),
2707
- /* @__PURE__ */ z("dd", { children: [Cn(f), f.detectedType && /* @__PURE__ */ z("small", { children: [
2705
+ /* @__PURE__ */ B("dt", { children: "Type" }),
2706
+ /* @__PURE__ */ V("dd", { children: [Sn(f), f.detectedType && /* @__PURE__ */ V("small", { children: [
2708
2707
  " from file contents. File.type is “",
2709
2708
  f.type,
2710
2709
  "”"
2711
2710
  ] })] }),
2712
- g && /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("dt", { children: "Dimensions" }), /* @__PURE__ */ z("dd", { children: [
2711
+ g && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("dt", { children: "Dimensions" }), /* @__PURE__ */ V("dd", { children: [
2713
2712
  g.width.toLocaleString(),
2714
2713
  " × ",
2715
2714
  g.height.toLocaleString(),
2716
2715
  " px"
2717
2716
  ] })] }),
2718
- /* @__PURE__ */ R("dt", { children: "Modified" }),
2719
- /* @__PURE__ */ z("dd", { children: [
2720
- gn(f.lastModified),
2717
+ /* @__PURE__ */ B("dt", { children: "Modified" }),
2718
+ /* @__PURE__ */ V("dd", { children: [
2719
+ hn(f.lastModified),
2721
2720
  " ",
2722
- /* @__PURE__ */ R("small", { children: hn(f.lastModified) })
2721
+ /* @__PURE__ */ B("small", { children: mn(f.lastModified) })
2723
2722
  ] })
2724
2723
  ]
2725
2724
  }),
2726
- p.length > 0 && /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ z("div", {
2725
+ p.length > 0 && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ V("div", {
2727
2726
  className: "seed-fm-section-label",
2728
- children: ["Resized copies · ", Z(S)]
2729
- }), /* @__PURE__ */ R("ul", {
2727
+ children: ["Resized copies · ", Q(S)]
2728
+ }), /* @__PURE__ */ B("ul", {
2730
2729
  className: "seed-fm-variants",
2731
- children: p.map((e) => /* @__PURE__ */ z("li", {
2730
+ children: p.map((e) => /* @__PURE__ */ V("li", {
2732
2731
  title: e.file.path,
2733
- children: [/* @__PURE__ */ z("span", { children: [e.width, "w · webp"] }), /* @__PURE__ */ R("span", { children: Z(e.file.size) })]
2732
+ children: [/* @__PURE__ */ V("span", { children: [e.width, "w · webp"] }), /* @__PURE__ */ B("span", { children: Q(e.file.size) })]
2734
2733
  }, e.file.path))
2735
2734
  })] })
2736
2735
  ]
2737
2736
  }),
2738
- /* @__PURE__ */ z("div", {
2737
+ /* @__PURE__ */ V("div", {
2739
2738
  className: "seed-fm-panel-foot",
2740
- children: [/* @__PURE__ */ z("button", {
2739
+ children: [/* @__PURE__ */ V("button", {
2741
2740
  type: "button",
2742
2741
  className: "seed-fm-btn seed-fm-btn--primary",
2743
2742
  onClick: a,
2744
- children: [/* @__PURE__ */ R(Q, {
2743
+ children: [/* @__PURE__ */ B($, {
2745
2744
  name: "download",
2746
2745
  size: 15
2747
2746
  }), " Download"]
2748
- }), /* @__PURE__ */ z("button", {
2747
+ }), /* @__PURE__ */ V("button", {
2749
2748
  type: "button",
2750
2749
  className: `seed-fm-btn${l.destructive ? " seed-fm-btn--danger-text" : ""}`,
2751
2750
  onClick: o,
2752
2751
  children: [
2753
- /* @__PURE__ */ R(Q, {
2752
+ /* @__PURE__ */ B($, {
2754
2753
  name: "trash",
2755
2754
  size: 15
2756
2755
  }),
@@ -3097,51 +3096,51 @@ function jr({ files: e, estimate: t }) {
3097
3096
  size: i,
3098
3097
  color: "var(--seed-border-strong)"
3099
3098
  }] : []];
3100
- return /* @__PURE__ */ z("div", {
3099
+ return /* @__PURE__ */ V("div", {
3101
3100
  className: "seed-fm-usage",
3102
3101
  title: "From navigator.storage.estimate(). Browsers round these numbers.",
3103
- children: [/* @__PURE__ */ z("div", {
3102
+ children: [/* @__PURE__ */ V("div", {
3104
3103
  className: "seed-fm-usage-row",
3105
- children: [/* @__PURE__ */ z("span", { children: [
3106
- /* @__PURE__ */ R("strong", { children: Z(t ? t.usage : r) }),
3104
+ children: [/* @__PURE__ */ V("span", { children: [
3105
+ /* @__PURE__ */ B("strong", { children: Q(t ? t.usage : r) }),
3107
3106
  " ",
3108
3107
  t ? "used by this site" : `in ${Er(e.length, "file")}`
3109
- ] }), t && /* @__PURE__ */ z("span", { children: [Z(t.quota), " available"] })]
3110
- }), a > 0 && /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("div", {
3108
+ ] }), t && /* @__PURE__ */ V("span", { children: [Q(t.quota), " available"] })]
3109
+ }), a > 0 && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("div", {
3111
3110
  className: "seed-fm-meter",
3112
3111
  role: "img",
3113
3112
  "aria-label": "Storage used, by file type",
3114
- children: o.map((e) => /* @__PURE__ */ R("span", { style: {
3113
+ children: o.map((e) => /* @__PURE__ */ B("span", { style: {
3115
3114
  width: `${e.size / a * 100}%`,
3116
3115
  background: e.color
3117
3116
  } }, e.label))
3118
- }), /* @__PURE__ */ R("ul", {
3117
+ }), /* @__PURE__ */ B("ul", {
3119
3118
  className: "seed-fm-legend",
3120
- children: o.map((e) => /* @__PURE__ */ z("li", {
3119
+ children: o.map((e) => /* @__PURE__ */ V("li", {
3121
3120
  style: { "--seed-swatch": e.color },
3122
3121
  children: [
3123
3122
  e.label,
3124
3123
  " ",
3125
- Z(e.size)
3124
+ Q(e.size)
3126
3125
  ]
3127
3126
  }, e.label))
3128
3127
  })] })]
3129
3128
  });
3130
3129
  }
3131
3130
  function Mr({ icon: e, title: t, children: n, tone: r, action: i }) {
3132
- return /* @__PURE__ */ z("div", {
3131
+ return /* @__PURE__ */ V("div", {
3133
3132
  className: `seed-fm-state${r === "error" ? " seed-fm-state--error" : ""}`,
3134
3133
  role: r === "error" ? "alert" : void 0,
3135
3134
  children: [
3136
- /* @__PURE__ */ R("span", {
3135
+ /* @__PURE__ */ B("span", {
3137
3136
  className: "seed-fm-state-icon",
3138
- children: /* @__PURE__ */ R(Q, {
3137
+ children: /* @__PURE__ */ B($, {
3139
3138
  name: e,
3140
3139
  size: 22
3141
3140
  })
3142
3141
  }),
3143
- /* @__PURE__ */ R("h3", { children: t }),
3144
- /* @__PURE__ */ R("p", { children: n }),
3142
+ /* @__PURE__ */ B("h3", { children: t }),
3143
+ /* @__PURE__ */ B("p", { children: n }),
3145
3144
  i
3146
3145
  ]
3147
3146
  });
@@ -3150,102 +3149,102 @@ function Nr({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
3150
3149
  a(() => {
3151
3150
  p !== "none" && mr();
3152
3151
  }, [p]);
3153
- let S = Dr(e), C = S ? S.split("/").pop() : "OPFS", w = (e, t) => [t, h[e]].filter(Boolean).join(" "), { files: T, isLoading: ee, hasLoaded: E, error: D, errorName: te, refetch: ne } = un({ rootPath: e }), re = o(() => t ? T.filter(t) : T, [T, t]), ie = hr(T), [O, ae] = c(_);
3154
- i(() => ae(_), [_]);
3155
- let k = o(() => Mn(re, O), [re, O]), [A, oe] = c(S);
3156
- i(() => oe(S), [S]);
3157
- let [j, se] = c(""), [ce, le] = c("name"), [ue, de] = c(g), [M, N] = c(() => /* @__PURE__ */ new Set()), fe = s(null), [pe, P] = c(null), F = s(null), [I, me] = c(null), [B, he] = c(null), [V, H] = c(!1), { toasts: ge, showToast: _e } = kr(), U = (e, t, n) => {
3158
- x ? x(e, t, n) : _e(e, t);
3159
- }, ve = o(() => Pn(k, A, {
3160
- query: j,
3161
- sort: ce
3152
+ let S = Dr(e), C = S ? S.split("/").pop() : "OPFS", w = (e, t) => [t, h[e]].filter(Boolean).join(" "), { files: T, isLoading: E, hasLoaded: ee, error: D, errorName: O, refetch: te } = ln({ rootPath: e }), k = o(() => t ? T.filter(t) : T, [T, t]), ne = hr(T), [re, A] = c(_);
3153
+ i(() => A(_), [_]);
3154
+ let j = o(() => Mn(k, re), [k, re]), [M, ie] = c(S);
3155
+ i(() => ie(S), [S]);
3156
+ let [ae, oe] = c(""), [se, ce] = c("name"), [le, ue] = c(g), [N, P] = c(() => /* @__PURE__ */ new Set()), F = s(null), [I, L] = c(null), de = s(null), [R, fe] = c(null), [H, pe] = c(null), [me, U] = c(!1), { toasts: he, showToast: ge } = kr(), _e = (e, t, n) => {
3157
+ x ? x(e, t, n) : ge(e, t);
3158
+ }, W = o(() => Pn(j, M, {
3159
+ query: ae,
3160
+ sort: se
3162
3161
  }), [
3163
- k,
3164
- A,
3165
3162
  j,
3166
- ce
3167
- ]), W = ve.entries, ye = W.length ? W.filter((e) => $(e.file) === "image").length / W.length : 0, G = ue ?? (ye >= .5 ? "grid" : "list"), be = o(() => new Map(k.map((e) => [e.file.path, e])), [k]), xe = o(() => [...M].map((e) => be.get(e)).filter((e) => !!e), [M, be]), K = pe ? be.get(pe) ?? null : null, q = K ? W.indexOf(K) : -1;
3163
+ M,
3164
+ ae,
3165
+ se
3166
+ ]), G = W.entries, ve = G.length ? G.filter((e) => wn(e.file) === "image").length / G.length : 0, ye = le ?? (ve >= .5 ? "grid" : "list"), K = o(() => new Map(j.map((e) => [e.file.path, e])), [j]), be = o(() => [...N].map((e) => K.get(e)).filter((e) => !!e), [N, K]), q = I ? K.get(I) ?? null : null, J = q ? G.indexOf(q) : -1;
3168
3167
  i(() => {
3169
- N((e) => {
3170
- let t = new Set([...e].filter((e) => be.has(e)));
3168
+ P((e) => {
3169
+ let t = new Set([...e].filter((e) => K.has(e)));
3171
3170
  return t.size === e.size ? e : t;
3172
3171
  });
3173
- }, [be]);
3174
- let Se = (e) => {
3175
- oe(e), se(""), N(/* @__PURE__ */ new Set()), fe.current = null, P(null);
3176
- }, Ce = (e, t, n) => {
3177
- let r = fe.current;
3178
- N((i) => {
3172
+ }, [K]);
3173
+ let xe = (e) => {
3174
+ ie(e), oe(""), P(/* @__PURE__ */ new Set()), F.current = null, L(null);
3175
+ }, Se = (e, t, n) => {
3176
+ let r = F.current;
3177
+ P((i) => {
3179
3178
  let a = new Set(i);
3180
3179
  if (n && r != null) {
3181
3180
  let [e, n] = r < t ? [r, t] : [t, r];
3182
- for (let t of W.slice(e, n + 1)) a.add(t.file.path);
3181
+ for (let t of G.slice(e, n + 1)) a.add(t.file.path);
3183
3182
  } else a.has(e.file.path) ? a.delete(e.file.path) : a.add(e.file.path);
3184
3183
  return a;
3185
- }), (!n || r == null) && (fe.current = t);
3186
- }, we = (e) => {
3187
- pe || (F.current = document.activeElement), P(e);
3188
- }, Te = () => {
3189
- P(null), F.current?.focus?.(), F.current = null;
3190
- }, J = (e, t, n) => {
3184
+ }), (!n || r == null) && (F.current = t);
3185
+ }, Ce = (e) => {
3186
+ I || (de.current = document.activeElement), L(e);
3187
+ }, we = () => {
3188
+ L(null), de.current?.focus?.(), de.current = null;
3189
+ }, Y = (e, t, n) => {
3191
3190
  let r = n.shiftKey || n.metaKey || n.ctrlKey;
3192
- M.size > 0 || r ? Ce(e, t, n.shiftKey) : we(e.file.path);
3193
- }, Ee = () => {
3194
- let e = W.every((e) => M.has(e.file.path));
3195
- N((t) => {
3191
+ N.size > 0 || r ? Se(e, t, n.shiftKey) : Ce(e.file.path);
3192
+ }, Te = () => {
3193
+ let e = G.every((e) => N.has(e.file.path));
3194
+ P((t) => {
3196
3195
  let n = new Set(t);
3197
- for (let t of W) e ? n.delete(t.file.path) : n.add(t.file.path);
3196
+ for (let t of G) e ? n.delete(t.file.path) : n.add(t.file.path);
3198
3197
  return n;
3199
3198
  });
3200
- }, De = (e) => S && e.startsWith(`${S}/`) ? e.slice(S.length + 1) : e, Oe = async (e, t) => {
3199
+ }, Ee = (e) => S && e.startsWith(`${S}/`) ? e.slice(S.length + 1) : e, De = async (e, t) => {
3201
3200
  l ? await l(e, t) : Or(e.name, t);
3202
- }, ke = async (e, t) => {
3201
+ }, Oe = async (e, t) => {
3203
3202
  if (e.length === 0) return !1;
3204
- H(!0);
3203
+ U(!0);
3205
3204
  try {
3206
3205
  if (e.length === 1 && !t) {
3207
3206
  let [t] = e;
3208
- return await Oe(t, await $t(t.path)), !0;
3207
+ return await De(t, await Qt(t.path)), !0;
3209
3208
  }
3210
3209
  let n = t ? t.path.slice(0, t.path.length - t.name.length) : "", r = await Sr(await Promise.all(e.map(async (e) => ({
3211
- name: t ? e.path.slice(n.length) : De(e.path),
3212
- data: await $t(e.path),
3210
+ name: t ? e.path.slice(n.length) : Ee(e.path),
3211
+ data: await Qt(e.path),
3213
3212
  lastModified: e.lastModified
3214
3213
  })))), i = `${t ? t.name : C}-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`;
3215
- return await Oe({
3214
+ return await De({
3216
3215
  name: i,
3217
3216
  path: i,
3218
3217
  size: r.size,
3219
3218
  type: "application/zip",
3220
3219
  lastModified: Date.now()
3221
- }, r), U(`Saved ${i} with ${Er(e.length, "file")}`, "success", {
3220
+ }, r), _e(`Saved ${i} with ${Er(e.length, "file")}`, "success", {
3222
3221
  kind: "download",
3223
3222
  paths: e.map((e) => e.path),
3224
3223
  fileName: i
3225
3224
  }), !0;
3226
3225
  } catch (t) {
3227
- return U(`Couldn’t download: ${Tr(t)}`, "error", {
3226
+ return _e(`Couldn’t download: ${Tr(t)}`, "error", {
3228
3227
  kind: "download",
3229
3228
  paths: e.map((e) => e.path),
3230
3229
  error: Tr(t)
3231
3230
  }), !1;
3232
3231
  } finally {
3233
- H(!1);
3232
+ U(!1);
3234
3233
  }
3235
- }, Ae = (e) => ke(e.map((e) => e.file)), Y = (e, t) => e.flatMap((e) => [e.file, ...t ? e.variants.map((e) => e.file) : []]), je = (e) => {
3234
+ }, ke = (e) => Oe(e.map((e) => e.file)), X = (e, t) => e.flatMap((e) => [e.file, ...t ? e.variants.map((e) => e.file) : []]), Ae = (e) => {
3236
3235
  let t = b?.(e);
3237
3236
  return {
3238
3237
  label: t?.label,
3239
3238
  destructive: t?.destructive !== !1
3240
3239
  };
3241
- }, Me = (e) => je(Y(e, !0)), Ne = async (e, t) => {
3242
- H(!0);
3240
+ }, je = (e) => Ae(X(e, !0)), Me = async (e, t) => {
3241
+ U(!0);
3243
3242
  let i = [], a = [], o = [], s = !1;
3244
3243
  try {
3245
3244
  let r = await navigator.storage.getDirectory();
3246
3245
  for (let t of e) if (n && !await n(t)) o.push(t.path);
3247
3246
  else try {
3248
- await en(t.path, r), i.push(t.path);
3247
+ await $t(t.path, r), i.push(t.path);
3249
3248
  } catch (e) {
3250
3249
  a.push({
3251
3250
  path: t.path,
@@ -3253,7 +3252,7 @@ function Nr({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
3253
3252
  });
3254
3253
  }
3255
3254
  if (t) try {
3256
- s = await nn(t.path, r);
3255
+ s = await tn(t.path, r);
3257
3256
  } catch (e) {
3258
3257
  a.push({
3259
3258
  path: t.path,
@@ -3266,16 +3265,16 @@ function Nr({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
3266
3265
  error: Tr(e)
3267
3266
  });
3268
3267
  }
3269
- N((e) => {
3268
+ P((e) => {
3270
3269
  let t = new Set(e);
3271
3270
  return i.forEach((e) => t.delete(e)), t;
3272
- }), pe && i.includes(pe) && P(null), await ne(), H(!1);
3271
+ }), I && i.includes(I) && L(null), await te(), U(!1);
3273
3272
  let c = [s ? `Deleted the ${t.name} folder (${Er(i.length, "file")})` : i.length > 0 ? `Deleted ${Er(i.length, "file")}` : "Nothing deleted"];
3274
3273
  if (o.length && c.push(`${o.length} kept by onBeforeDelete`), a.length) {
3275
3274
  let e = a.map((e) => e.path ? `${e.path.split("/").pop()}: ${e.error}` : e.error);
3276
3275
  c.push(`${a.length} failed (${e.join("; ")})`);
3277
3276
  }
3278
- t && !s && !a.length && c.push(`The ${t.name} folder still has files, so it was kept`), U(c.join(". "), a.length ? "error" : "success", {
3277
+ t && !s && !a.length && c.push(`The ${t.name} folder still has files, so it was kept`), _e(c.join(". "), a.length ? "error" : "success", {
3279
3278
  kind: "delete",
3280
3279
  deleted: i,
3281
3280
  skipped: o,
@@ -3285,26 +3284,26 @@ function Nr({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
3285
3284
  folderRemoved: s
3286
3285
  }
3287
3286
  }), i.length > 0 && await r?.(i);
3288
- }, Pe = async (e) => {
3287
+ }, Ne = async (e) => {
3289
3288
  if (e.length === 0) return;
3290
3289
  if (!y) {
3291
- me(e);
3290
+ fe(e);
3292
3291
  return;
3293
3292
  }
3294
- let t = Y(e, !0);
3295
- await y(t) && await Ne(t);
3296
- }, Fe = (e) => re.filter((t) => t.path.startsWith(`${e.path}/`)), Ie = async (e) => {
3293
+ let t = X(e, !0);
3294
+ await y(t) && await Me(t);
3295
+ }, Pe = (e) => k.filter((t) => t.path.startsWith(`${e.path}/`)), Fe = async (e) => {
3297
3296
  if (!y) {
3298
- he(e);
3297
+ pe(e);
3299
3298
  return;
3300
3299
  }
3301
- let t = Fe(e);
3302
- await y(t) && await Ne(t, e);
3303
- }, Le = (e) => {
3304
- let t = () => U("Path copied", "success", {
3300
+ let t = Pe(e);
3301
+ await y(t) && await Me(t, e);
3302
+ }, Ie = (e) => {
3303
+ let t = () => _e("Path copied", "success", {
3305
3304
  kind: "copy-path",
3306
3305
  path: e
3307
- }), n = (t) => U("Couldn’t copy. Select the path text instead.", "error", {
3306
+ }), n = (t) => _e("Couldn’t copy. Select the path text instead.", "error", {
3308
3307
  kind: "copy-path",
3309
3308
  path: e,
3310
3309
  error: t === void 0 ? "Clipboard unavailable" : Tr(t)
@@ -3314,338 +3313,338 @@ function Nr({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
3314
3313
  } catch (e) {
3315
3314
  n(e);
3316
3315
  }
3317
- }, Re = (e) => {
3318
- if (I || B) return;
3316
+ }, Le = (e) => {
3317
+ if (R || H) return;
3319
3318
  let t = e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement;
3320
3319
  if (e.key === "Escape") {
3321
- if (pe) Te();
3322
- else if (M.size > 0) N(/* @__PURE__ */ new Set());
3320
+ if (I) we();
3321
+ else if (N.size > 0) P(/* @__PURE__ */ new Set());
3323
3322
  else return;
3324
3323
  e.preventDefault();
3325
- } else if (K && !t && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
3326
- let t = W[q + (e.key === "ArrowRight" ? 1 : -1)];
3327
- t && P(t.file.path), e.preventDefault();
3324
+ } else if (q && !t && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
3325
+ let t = G[J + (e.key === "ArrowRight" ? 1 : -1)];
3326
+ t && L(t.file.path), e.preventDefault();
3328
3327
  }
3329
- }, ze = o(() => re.some((e) => kn(e.path)), [re]), Be = /(^|\/)images(\/\d+)?$/.test(A), X = [{
3328
+ }, Re = o(() => k.some((e) => kn(e.path)), [k]), ze = /(^|\/)images(\/\d+)?$/.test(M), Z = [{
3330
3329
  label: C,
3331
3330
  path: S
3332
- }, ...(A.length > S.length ? A.slice(S ? S.length + 1 : 0).split("/") : []).map((e, t, n) => ({
3331
+ }, ...(M.length > S.length ? M.slice(S ? S.length + 1 : 0).split("/") : []).map((e, t, n) => ({
3333
3332
  label: e,
3334
3333
  path: [S, ...n.slice(0, t + 1)].filter(Boolean).join("/")
3335
- }))], Ve = `h${f}`, He = xe.reduce((e, t) => e + t.file.size, 0), Ue;
3336
- if (!rn()) Ue = /* @__PURE__ */ R(Mr, {
3334
+ }))], Be = `h${f}`, Ve = be.reduce((e, t) => e + t.file.size, 0), He;
3335
+ if (!nn()) He = /* @__PURE__ */ B(Mr, {
3337
3336
  icon: "triangleAlert",
3338
3337
  tone: "error",
3339
3338
  title: "This browser doesn’t support private file storage",
3340
3339
  children: "OPFS isn’t available here. Some private browsing windows and older browsers turn it off. Try a current version of Chrome, Edge, Firefox, or Safari in a normal window."
3341
3340
  });
3342
3341
  else if (D) {
3343
- let e = /* @__PURE__ */ z("button", {
3342
+ let e = /* @__PURE__ */ V("button", {
3344
3343
  type: "button",
3345
3344
  className: "seed-fm-btn",
3346
- onClick: () => ne(),
3347
- children: [/* @__PURE__ */ R(Q, {
3345
+ onClick: () => te(),
3346
+ children: [/* @__PURE__ */ B($, {
3348
3347
  name: "refresh",
3349
3348
  size: 15
3350
3349
  }), " Try again"]
3351
3350
  });
3352
- Ue = te === "NotFoundError" && S ? /* @__PURE__ */ z(Mr, {
3351
+ He = O === "NotFoundError" && S ? /* @__PURE__ */ V(Mr, {
3353
3352
  icon: "triangleAlert",
3354
3353
  tone: "error",
3355
3354
  title: `Can’t open ${S}`,
3356
3355
  action: e,
3357
3356
  children: [
3358
3357
  "The folder ",
3359
- /* @__PURE__ */ R("code", { children: S }),
3358
+ /* @__PURE__ */ B("code", { children: S }),
3360
3359
  " doesn’t exist in this browser’s private storage yet. Check the",
3361
3360
  " ",
3362
- /* @__PURE__ */ R("code", { children: "rootPath" }),
3361
+ /* @__PURE__ */ B("code", { children: "rootPath" }),
3363
3362
  " prop, or open the app once so the SDK creates it."
3364
3363
  ]
3365
- }) : /* @__PURE__ */ R(Mr, {
3364
+ }) : /* @__PURE__ */ B(Mr, {
3366
3365
  icon: "triangleAlert",
3367
3366
  tone: "error",
3368
3367
  title: "Can’t read private storage",
3369
3368
  action: e,
3370
3369
  children: D
3371
3370
  });
3372
- } else Ue = E ? k.length === 0 ? /* @__PURE__ */ R(Mr, {
3371
+ } else He = ee ? j.length === 0 ? /* @__PURE__ */ B(Mr, {
3373
3372
  icon: "folderOpen",
3374
3373
  title: `No files in ${C} yet`,
3375
3374
  children: "Files show up here when the app saves images, JSON, or HTML to this browser’s private storage, for example after you add an image to a post or sync content from Arweave."
3376
- }) : ve.folders.length === 0 && W.length === 0 ? j ? /* @__PURE__ */ z(Mr, {
3375
+ }) : W.folders.length === 0 && G.length === 0 ? ae ? /* @__PURE__ */ V(Mr, {
3377
3376
  icon: "search",
3378
- title: `No matches for “${j}”`,
3379
- action: /* @__PURE__ */ R("button", {
3377
+ title: `No matches for “${ae}”`,
3378
+ action: /* @__PURE__ */ B("button", {
3380
3379
  type: "button",
3381
3380
  className: "seed-fm-btn",
3382
- onClick: () => se(""),
3381
+ onClick: () => oe(""),
3383
3382
  children: "Clear search"
3384
3383
  }),
3385
3384
  children: [
3386
3385
  "Search covers file names and paths in ",
3387
- X[X.length - 1].label,
3386
+ Z[Z.length - 1].label,
3388
3387
  " and every folder inside it."
3389
3388
  ]
3390
- }) : /* @__PURE__ */ R(Mr, {
3389
+ }) : /* @__PURE__ */ B(Mr, {
3391
3390
  icon: "folderOpen",
3392
3391
  title: "This folder is empty",
3393
3392
  children: "Everything in it has been deleted or filtered out."
3394
- }) : /* @__PURE__ */ z(L, { children: [ve.folders.length > 0 && /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("div", {
3393
+ }) : /* @__PURE__ */ V(z, { children: [W.folders.length > 0 && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("div", {
3395
3394
  className: "seed-fm-section-label",
3396
3395
  children: "Folders"
3397
- }), /* @__PURE__ */ R("ul", {
3396
+ }), /* @__PURE__ */ B("ul", {
3398
3397
  className: "seed-fm-folders",
3399
- children: ve.folders.map((e) => /* @__PURE__ */ z("li", { children: [/* @__PURE__ */ z("button", {
3398
+ children: W.folders.map((e) => /* @__PURE__ */ V("li", { children: [/* @__PURE__ */ V("button", {
3400
3399
  type: "button",
3401
3400
  className: w("folder", "seed-fm-folder"),
3402
- onClick: () => Se(e.path),
3403
- children: [/* @__PURE__ */ R(Q, {
3401
+ onClick: () => xe(e.path),
3402
+ children: [/* @__PURE__ */ B($, {
3404
3403
  name: "folder",
3405
3404
  size: 20,
3406
3405
  strokeWidth: 1.75
3407
- }), /* @__PURE__ */ z("span", { children: [/* @__PURE__ */ R("span", {
3406
+ }), /* @__PURE__ */ V("span", { children: [/* @__PURE__ */ B("span", {
3408
3407
  className: "seed-fm-folder-name",
3409
3408
  children: e.name
3410
- }), /* @__PURE__ */ z("span", {
3409
+ }), /* @__PURE__ */ V("span", {
3411
3410
  className: "seed-fm-folder-meta",
3412
3411
  children: [
3413
3412
  Er(e.fileCount, "file"),
3414
3413
  " · ",
3415
- Z(e.size)
3414
+ Q(e.size)
3416
3415
  ]
3417
3416
  })] })]
3418
- }), /* @__PURE__ */ R("button", {
3417
+ }), /* @__PURE__ */ B("button", {
3419
3418
  type: "button",
3420
3419
  className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon seed-fm-folder-delete",
3421
3420
  "aria-label": `Delete folder ${e.name}`,
3422
3421
  title: "Delete folder",
3423
- disabled: V,
3424
- onClick: () => Ie(e),
3425
- children: /* @__PURE__ */ R(Q, {
3422
+ disabled: me,
3423
+ onClick: () => Fe(e),
3424
+ children: /* @__PURE__ */ B($, {
3426
3425
  name: "trash",
3427
3426
  size: 15
3428
3427
  })
3429
3428
  })] }, e.path))
3430
- })] }), W.length > 0 && /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("div", {
3429
+ })] }), G.length > 0 && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("div", {
3431
3430
  className: "seed-fm-section-label",
3432
- children: j ? Er(W.length, "result") : "Files"
3433
- }), G === "grid" ? /* @__PURE__ */ R(rr, {
3434
- entries: W,
3435
- selected: M,
3436
- onActivate: J,
3437
- onToggle: Ce,
3431
+ children: ae ? Er(G.length, "result") : "Files"
3432
+ }), ye === "grid" ? /* @__PURE__ */ B(rr, {
3433
+ entries: G,
3434
+ selected: N,
3435
+ onActivate: Y,
3436
+ onToggle: Se,
3438
3437
  className: h.grid,
3439
3438
  tileClassName: h.tile
3440
- }) : /* @__PURE__ */ R(ir, {
3441
- entries: W,
3442
- selected: M,
3443
- cwd: A,
3444
- onActivate: J,
3445
- onToggle: Ce,
3446
- onToggleAll: Ee,
3447
- onDownload: (e) => Ae([e]),
3448
- onDelete: (e) => Pe([e]),
3449
- deleteActionFor: (e) => Me([e]),
3439
+ }) : /* @__PURE__ */ B(ir, {
3440
+ entries: G,
3441
+ selected: N,
3442
+ cwd: M,
3443
+ onActivate: Y,
3444
+ onToggle: Se,
3445
+ onToggleAll: Te,
3446
+ onDownload: (e) => ke([e]),
3447
+ onDelete: (e) => Ne([e]),
3448
+ deleteActionFor: (e) => je([e]),
3450
3449
  className: h.list,
3451
3450
  rowClassName: h.row
3452
- })] })] }) : /* @__PURE__ */ R("ul", {
3451
+ })] })] }) : /* @__PURE__ */ B("ul", {
3453
3452
  className: w("grid", "seed-fm-grid"),
3454
3453
  "aria-busy": "true",
3455
3454
  "aria-label": "Loading files",
3456
- children: Array.from({ length: 8 }, (e, t) => /* @__PURE__ */ R("li", {
3455
+ children: Array.from({ length: 8 }, (e, t) => /* @__PURE__ */ B("li", {
3457
3456
  className: "seed-fm-tile",
3458
- children: /* @__PURE__ */ R("span", { className: "seed-fm-thumb seed-fm-skeleton" })
3457
+ children: /* @__PURE__ */ B("span", { className: "seed-fm-thumb seed-fm-skeleton" })
3459
3458
  }, t))
3460
3459
  });
3461
- let We = I ? Y(I, !0) : [], Ge = B ? Fe(B) : [], Ke = M.size > 0 ? Me(xe) : null;
3462
- return /* @__PURE__ */ z("div", {
3460
+ let Ue = R ? X(R, !0) : [], We = H ? Pe(H) : [], Ge = N.size > 0 ? je(be) : null;
3461
+ return /* @__PURE__ */ V("div", {
3463
3462
  className: [w("root", "seed-fm"), m].filter(Boolean).join(" "),
3464
3463
  "data-seed-theme": p === "none" ? void 0 : p,
3465
- "data-selecting": M.size > 0 || void 0,
3466
- onKeyDown: Re,
3464
+ "data-selecting": N.size > 0 || void 0,
3465
+ onKeyDown: Le,
3467
3466
  children: [
3468
- /* @__PURE__ */ z("div", {
3467
+ /* @__PURE__ */ V("div", {
3469
3468
  className: "seed-fm-frame",
3470
3469
  children: [
3471
- /* @__PURE__ */ z("header", {
3470
+ /* @__PURE__ */ V("header", {
3472
3471
  className: w("header", "seed-fm-header"),
3473
3472
  children: [
3474
- /* @__PURE__ */ z("div", {
3473
+ /* @__PURE__ */ V("div", {
3475
3474
  className: "seed-fm-titles",
3476
- children: [/* @__PURE__ */ R(Ve, {
3475
+ children: [/* @__PURE__ */ B(Be, {
3477
3476
  className: "seed-fm-title",
3478
3477
  children: u
3479
- }), d && /* @__PURE__ */ R("p", {
3478
+ }), d && /* @__PURE__ */ B("p", {
3480
3479
  className: "seed-fm-description",
3481
3480
  children: d
3482
3481
  })]
3483
3482
  }),
3484
- E && !D && /* @__PURE__ */ R(jr, {
3485
- files: re,
3486
- estimate: ie
3483
+ ee && !D && /* @__PURE__ */ B(jr, {
3484
+ files: k,
3485
+ estimate: ne
3487
3486
  }),
3488
- /* @__PURE__ */ R("button", {
3487
+ /* @__PURE__ */ B("button", {
3489
3488
  type: "button",
3490
3489
  className: "seed-fm-btn seed-fm-btn--icon",
3491
- onClick: () => ne(),
3490
+ onClick: () => te(),
3492
3491
  "aria-label": "Refresh",
3493
3492
  title: "Refresh",
3494
- "data-busy": ee && E,
3495
- children: /* @__PURE__ */ R(Q, {
3493
+ "data-busy": E && ee,
3494
+ children: /* @__PURE__ */ B($, {
3496
3495
  name: "refresh",
3497
3496
  size: 15
3498
3497
  })
3499
3498
  })
3500
3499
  ]
3501
3500
  }),
3502
- E && !D && k.length > 0 && /* @__PURE__ */ z("div", {
3501
+ ee && !D && j.length > 0 && /* @__PURE__ */ V("div", {
3503
3502
  className: w("toolbar", "seed-fm-toolbar"),
3504
3503
  children: [
3505
- /* @__PURE__ */ R("nav", {
3504
+ /* @__PURE__ */ B("nav", {
3506
3505
  "aria-label": "Folder",
3507
- children: /* @__PURE__ */ R("ol", {
3506
+ children: /* @__PURE__ */ B("ol", {
3508
3507
  className: "seed-fm-crumbs",
3509
- children: X.map((e, t) => /* @__PURE__ */ z("li", { children: [t > 0 && /* @__PURE__ */ R(Q, {
3508
+ children: Z.map((e, t) => /* @__PURE__ */ V("li", { children: [t > 0 && /* @__PURE__ */ B($, {
3510
3509
  name: "chevronRight",
3511
3510
  size: 14
3512
- }), /* @__PURE__ */ R("button", {
3511
+ }), /* @__PURE__ */ B("button", {
3513
3512
  type: "button",
3514
- onClick: () => Se(e.path),
3515
- "aria-current": t === X.length - 1 ? "page" : void 0,
3513
+ onClick: () => xe(e.path),
3514
+ "aria-current": t === Z.length - 1 ? "page" : void 0,
3516
3515
  children: e.label
3517
3516
  })] }, e.path || "/"))
3518
3517
  })
3519
3518
  }),
3520
- /* @__PURE__ */ z("label", {
3519
+ /* @__PURE__ */ V("label", {
3521
3520
  className: "seed-fm-search",
3522
- children: [/* @__PURE__ */ R(Q, {
3521
+ children: [/* @__PURE__ */ B($, {
3523
3522
  name: "search",
3524
3523
  size: 14
3525
- }), /* @__PURE__ */ R("input", {
3524
+ }), /* @__PURE__ */ B("input", {
3526
3525
  type: "search",
3527
- value: j,
3528
- onChange: (e) => se(e.target.value),
3526
+ value: ae,
3527
+ onChange: (e) => oe(e.target.value),
3529
3528
  placeholder: "Search names and paths",
3530
3529
  "aria-label": "Search files"
3531
3530
  })]
3532
3531
  }),
3533
- /* @__PURE__ */ z("select", {
3532
+ /* @__PURE__ */ V("select", {
3534
3533
  className: "seed-fm-select",
3535
- value: ce,
3536
- onChange: (e) => le(e.target.value),
3534
+ value: se,
3535
+ onChange: (e) => ce(e.target.value),
3537
3536
  "aria-label": "Sort by",
3538
3537
  children: [
3539
- /* @__PURE__ */ R("option", {
3538
+ /* @__PURE__ */ B("option", {
3540
3539
  value: "name",
3541
3540
  children: "Name"
3542
3541
  }),
3543
- /* @__PURE__ */ R("option", {
3542
+ /* @__PURE__ */ B("option", {
3544
3543
  value: "modified",
3545
3544
  children: "Recently modified"
3546
3545
  }),
3547
- /* @__PURE__ */ R("option", {
3546
+ /* @__PURE__ */ B("option", {
3548
3547
  value: "size",
3549
3548
  children: "Largest"
3550
3549
  })
3551
3550
  ]
3552
3551
  }),
3553
- /* @__PURE__ */ z("div", {
3552
+ /* @__PURE__ */ V("div", {
3554
3553
  className: "seed-fm-viewtoggle",
3555
3554
  role: "group",
3556
3555
  "aria-label": "View",
3557
- children: [/* @__PURE__ */ R("button", {
3556
+ children: [/* @__PURE__ */ B("button", {
3558
3557
  type: "button",
3559
- "aria-pressed": G === "grid",
3558
+ "aria-pressed": ye === "grid",
3560
3559
  "aria-label": "Grid view",
3561
- onClick: () => de("grid"),
3562
- children: /* @__PURE__ */ R(Q, {
3560
+ onClick: () => ue("grid"),
3561
+ children: /* @__PURE__ */ B($, {
3563
3562
  name: "layoutGrid",
3564
3563
  size: 15
3565
3564
  })
3566
- }), /* @__PURE__ */ R("button", {
3565
+ }), /* @__PURE__ */ B("button", {
3567
3566
  type: "button",
3568
- "aria-pressed": G === "list",
3567
+ "aria-pressed": ye === "list",
3569
3568
  "aria-label": "List view",
3570
- onClick: () => de("list"),
3571
- children: /* @__PURE__ */ R(Q, {
3569
+ onClick: () => ue("list"),
3570
+ children: /* @__PURE__ */ B($, {
3572
3571
  name: "list",
3573
3572
  size: 15
3574
3573
  })
3575
3574
  })]
3576
3575
  }),
3577
- ze && Be && /* @__PURE__ */ z("p", {
3576
+ Re && ze && /* @__PURE__ */ V("p", {
3578
3577
  className: "seed-fm-hint",
3579
3578
  children: [
3580
- /* @__PURE__ */ R(Q, {
3579
+ /* @__PURE__ */ B($, {
3581
3580
  name: "layers",
3582
3581
  size: 13
3583
3582
  }),
3584
- O ? "Resized copies are grouped with their original image." : "Resized copies are shown in their size folders.",
3585
- /* @__PURE__ */ R("button", {
3583
+ re ? "Resized copies are grouped with their original image." : "Resized copies are shown in their size folders.",
3584
+ /* @__PURE__ */ B("button", {
3586
3585
  type: "button",
3587
3586
  className: "seed-fm-linkbtn",
3588
3587
  onClick: () => {
3589
- ae(!O), N(/* @__PURE__ */ new Set());
3588
+ A(!re), P(/* @__PURE__ */ new Set());
3590
3589
  },
3591
- children: O ? "Show as folders" : "Group with originals"
3590
+ children: re ? "Show as folders" : "Group with originals"
3592
3591
  })
3593
3592
  ]
3594
3593
  })
3595
3594
  ]
3596
3595
  }),
3597
- /* @__PURE__ */ R("div", {
3596
+ /* @__PURE__ */ B("div", {
3598
3597
  className: w("body", "seed-fm-body"),
3599
- children: Ue
3598
+ children: He
3600
3599
  }),
3601
- Ke && /* @__PURE__ */ z("div", {
3600
+ Ge && /* @__PURE__ */ V("div", {
3602
3601
  className: w("batchBar", "seed-fm-batch"),
3603
3602
  role: "toolbar",
3604
3603
  "aria-label": "Selected files",
3605
3604
  children: [
3606
- /* @__PURE__ */ z("span", {
3605
+ /* @__PURE__ */ V("span", {
3607
3606
  className: "seed-fm-batch-count",
3608
3607
  "aria-live": "polite",
3609
3608
  children: [
3610
- M.size,
3609
+ N.size,
3611
3610
  " selected ",
3612
- /* @__PURE__ */ z("span", { children: ["· ", Z(He)] })
3611
+ /* @__PURE__ */ V("span", { children: ["· ", Q(Ve)] })
3613
3612
  ]
3614
3613
  }),
3615
- /* @__PURE__ */ z("button", {
3614
+ /* @__PURE__ */ V("button", {
3616
3615
  type: "button",
3617
3616
  className: "seed-fm-btn",
3618
- disabled: V,
3619
- onClick: () => Ae(xe),
3617
+ disabled: me,
3618
+ onClick: () => ke(be),
3620
3619
  children: [
3621
- /* @__PURE__ */ R(Q, {
3620
+ /* @__PURE__ */ B($, {
3622
3621
  name: "download",
3623
3622
  size: 15
3624
3623
  }),
3625
3624
  " ",
3626
- M.size > 1 ? "Download .zip" : "Download"
3625
+ N.size > 1 ? "Download .zip" : "Download"
3627
3626
  ]
3628
3627
  }),
3629
- /* @__PURE__ */ z("button", {
3628
+ /* @__PURE__ */ V("button", {
3630
3629
  type: "button",
3631
- className: `seed-fm-btn${Ke.destructive ? " seed-fm-btn--danger-text" : ""}`,
3632
- disabled: V,
3633
- onClick: () => Pe(xe),
3630
+ className: `seed-fm-btn${Ge.destructive ? " seed-fm-btn--danger-text" : ""}`,
3631
+ disabled: me,
3632
+ onClick: () => Ne(be),
3634
3633
  children: [
3635
- /* @__PURE__ */ R(Q, {
3634
+ /* @__PURE__ */ B($, {
3636
3635
  name: "trash",
3637
3636
  size: 15
3638
3637
  }),
3639
3638
  " ",
3640
- Ke.label ?? "Delete"
3639
+ Ge.label ?? "Delete"
3641
3640
  ]
3642
3641
  }),
3643
- /* @__PURE__ */ R("button", {
3642
+ /* @__PURE__ */ B("button", {
3644
3643
  type: "button",
3645
3644
  className: "seed-fm-btn seed-fm-btn--icon",
3646
3645
  "aria-label": "Clear selection",
3647
- onClick: () => N(/* @__PURE__ */ new Set()),
3648
- children: /* @__PURE__ */ R(Q, {
3646
+ onClick: () => P(/* @__PURE__ */ new Set()),
3647
+ children: /* @__PURE__ */ B($, {
3649
3648
  name: "x",
3650
3649
  size: 15
3651
3650
  })
@@ -3654,49 +3653,49 @@ function Nr({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
3654
3653
  })
3655
3654
  ]
3656
3655
  }),
3657
- K && /* @__PURE__ */ R(cr, {
3658
- entry: K,
3656
+ q && /* @__PURE__ */ B(cr, {
3657
+ entry: q,
3659
3658
  className: h.panel,
3660
- onClose: Te,
3661
- onPrevious: q > 0 ? () => P(W[q - 1].file.path) : null,
3662
- onNext: q >= 0 && q < W.length - 1 ? () => P(W[q + 1].file.path) : null,
3663
- onDownload: () => Ae([K]),
3664
- onDelete: () => Pe([K]),
3665
- deleteAction: Me([K]),
3666
- onCopyPath: () => Le(K.file.path)
3659
+ onClose: we,
3660
+ onPrevious: J > 0 ? () => L(G[J - 1].file.path) : null,
3661
+ onNext: J >= 0 && J < G.length - 1 ? () => L(G[J + 1].file.path) : null,
3662
+ onDownload: () => ke([q]),
3663
+ onDelete: () => Ne([q]),
3664
+ deleteAction: je([q]),
3665
+ onCopyPath: () => Ie(q.file.path)
3667
3666
  }, "panel"),
3668
- I && /* @__PURE__ */ R(xn, {
3669
- entries: I,
3667
+ R && /* @__PURE__ */ B(bn, {
3668
+ entries: R,
3670
3669
  rootPath: S,
3671
- warning: v(We),
3672
- deleteActionFor: (e) => je(Y(I, e)),
3670
+ warning: v(Ue),
3671
+ deleteActionFor: (e) => Ae(X(R, e)),
3673
3672
  className: h.dialog,
3674
- onCancel: () => me(null),
3673
+ onCancel: () => fe(null),
3675
3674
  onConfirm: (e) => {
3676
- let t = Y(I, e);
3677
- me(null), Ne(t);
3675
+ let t = X(R, e);
3676
+ fe(null), Me(t);
3678
3677
  }
3679
3678
  }),
3680
- B && /* @__PURE__ */ R(Sn, {
3681
- folder: B,
3682
- files: Ge,
3683
- hiddenCount: T.filter((e) => e.path.startsWith(`${B.path}/`)).length - Ge.length,
3684
- warning: v(Ge),
3685
- action: je(Ge),
3686
- busy: V,
3679
+ H && /* @__PURE__ */ B(xn, {
3680
+ folder: H,
3681
+ files: We,
3682
+ hiddenCount: T.filter((e) => e.path.startsWith(`${H.path}/`)).length - We.length,
3683
+ warning: v(We),
3684
+ action: Ae(We),
3685
+ busy: me,
3687
3686
  className: h.dialog,
3688
- onDownload: () => ke(Ge, B),
3689
- onCancel: () => he(null),
3687
+ onDownload: () => Oe(We, H),
3688
+ onCancel: () => pe(null),
3690
3689
  onConfirm: () => {
3691
- he(null), Ne(Ge, B);
3690
+ pe(null), Me(We, H);
3692
3691
  }
3693
3692
  }),
3694
- !x && /* @__PURE__ */ R("ul", {
3693
+ !x && /* @__PURE__ */ B("ul", {
3695
3694
  className: "seed-fm-toasts",
3696
3695
  "aria-live": "polite",
3697
- children: ge.map((e) => /* @__PURE__ */ z("li", {
3696
+ children: he.map((e) => /* @__PURE__ */ V("li", {
3698
3697
  className: w("toast", `seed-fm-toast${e.tone === "error" ? " seed-fm-toast--error" : ""}`),
3699
- children: [/* @__PURE__ */ R(Q, {
3698
+ children: [/* @__PURE__ */ B($, {
3700
3699
  name: e.tone === "error" ? "triangleAlert" : "check",
3701
3700
  size: 15,
3702
3701
  strokeWidth: 2.5
@@ -3716,7 +3715,7 @@ var Pr = (e) => {
3716
3715
  }
3717
3716
  };
3718
3717
  function Fr(e) {
3719
- let { imageProperty: t, filename: r, width: a, enabled: s = !0 } = e, [l, d] = c(null), [f, p] = c("idle"), m = t?.refResolvedValue, h = t?.value, g = typeof h == "string" ? h : void 0, _ = Pr(t), v = o(() => A(_) ?? A(r) ?? A(m) ?? A(g), [
3718
+ let { imageProperty: t, filename: r, width: a, enabled: s = !0 } = e, [l, d] = c(null), [f, p] = c("idle"), m = t?.refResolvedValue, h = t?.value, g = typeof h == "string" ? h : void 0, _ = Pr(t), v = o(() => ie(_) ?? ie(r) ?? ie(m) ?? ie(g), [
3720
3719
  _,
3721
3720
  r,
3722
3721
  m,
@@ -3729,7 +3728,7 @@ function Fr(e) {
3729
3728
  if (!v) return [];
3730
3729
  let e = [];
3731
3730
  try {
3732
- for (let t of E()) {
3731
+ for (let t of D()) {
3733
3732
  let n = `${t.replace(/\/$/, "")}/raw/${v}`;
3734
3733
  e.includes(n) || e.push(n);
3735
3734
  }
@@ -3743,7 +3742,7 @@ function Fr(e) {
3743
3742
  i(() => {
3744
3743
  S(0);
3745
3744
  }, [b]);
3746
- let C = b[x], T = n(() => {
3745
+ let C = b[x], w = n(() => {
3747
3746
  S((e) => e < b.length ? e + 1 : e);
3748
3747
  }, [b]);
3749
3748
  return i(() => {
@@ -3754,7 +3753,7 @@ function Fr(e) {
3754
3753
  else {
3755
3754
  e || p("loading");
3756
3755
  try {
3757
- let t = await w({
3756
+ let t = await T({
3758
3757
  transactionId: v,
3759
3758
  fileName: y,
3760
3759
  widths: a == null ? void 0 : [a]
@@ -3778,13 +3777,13 @@ function Fr(e) {
3778
3777
  status: f,
3779
3778
  gatewayHref: C,
3780
3779
  gatewayHrefs: b,
3781
- onGatewayError: T,
3780
+ onGatewayError: w,
3782
3781
  result: l
3783
3782
  };
3784
3783
  }
3785
3784
  //#endregion
3786
3785
  //#region src/SeedImage.tsx
3787
- var Ir = F("seedSdk:react:SeedImage"), Lr = /* @__PURE__ */ new Map(), Rr = (e) => {
3786
+ var Ir = R("seedSdk:react:SeedImage"), Lr = /* @__PURE__ */ new Map(), Rr = (e) => {
3788
3787
  let t = e.match(/^(.*[\/\\])?([^\/\\]+?)(\.[^.\/\\]*)?$/);
3789
3788
  return t && t[2] ? t[2] : e;
3790
3789
  };
@@ -3796,7 +3795,7 @@ function Br(e, t) {
3796
3795
  return n.test(r);
3797
3796
  }
3798
3797
  var Vr = e.memo(({ imageProperty: t, width: n, filename: r, ensure: a = !0, ...o }) => {
3799
- let [s, l] = c(), [u, d] = c(), { property: p } = He({
3798
+ let [s, l] = c(), [u, d] = c(), { property: p } = Ve({
3800
3799
  propertyName: t.propertyName,
3801
3800
  seedLocalId: t.seedLocalId,
3802
3801
  seedUid: t.seedUid
@@ -3866,17 +3865,17 @@ var Vr = e.memo(({ imageProperty: t, width: n, filename: r, ensure: a = !0, ...o
3866
3865
  h,
3867
3866
  g
3868
3867
  ]);
3869
- let T = (e) => typeof e == "string" && e.startsWith("blob:"), ee = !!s || !!u || !!S || !!b && T(b);
3870
- if (!ee && !h && !_) return null;
3871
- let E = s || u || S || (T(b) ? b : void 0) || (a && !ee ? _ : void 0) || "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", { onError: D, ...te } = o, ne = (e) => {
3872
- _ && E === _ && v(), D?.(e);
3868
+ let T = (e) => typeof e == "string" && e.startsWith("blob:"), E = !!s || !!u || !!S || !!b && T(b);
3869
+ if (!E && !h && !_) return null;
3870
+ let ee = s || u || S || (T(b) ? b : void 0) || (a && !E ? _ : void 0) || "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", { onError: D, ...O } = o, te = (e) => {
3871
+ _ && ee === _ && v(), D?.(e);
3873
3872
  };
3874
- return /* @__PURE__ */ R("img", {
3875
- src: E,
3873
+ return /* @__PURE__ */ B("img", {
3874
+ src: ee,
3876
3875
  alt: o.alt || t.propertyName || "Image",
3877
3876
  width: n,
3878
- ...te,
3879
- onError: ne
3877
+ ...O,
3878
+ onError: te
3880
3879
  });
3881
3880
  });
3882
3881
  //#endregion
@@ -3890,7 +3889,7 @@ function Hr(e) {
3890
3889
  else {
3891
3890
  e || (m("loading"), f(null));
3892
3891
  try {
3893
- let r = await de(String(t), { treatAs: a }), i = r.status === "ready" && r.source === "localBlob" ? r.href : void 0;
3892
+ let r = await N(String(t), { treatAs: a }), i = r.status === "ready" && r.source === "localBlob" ? r.href : void 0;
3894
3893
  if (e) {
3895
3894
  i && URL.revokeObjectURL(i);
3896
3895
  return;
@@ -3936,7 +3935,7 @@ function Ur({ value: e, enabled: t, treatAs: n, render: r, alt: i, ...a }) {
3936
3935
  src: o,
3937
3936
  alt: i ?? ""
3938
3937
  };
3939
- return r ? /* @__PURE__ */ R(L, { children: r(s) }) : /* @__PURE__ */ R("img", { ...s });
3938
+ return r ? /* @__PURE__ */ B(z, { children: r(s) }) : /* @__PURE__ */ B("img", { ...s });
3940
3939
  }
3941
3940
  //#endregion
3942
3941
  //#region src/SeedMediaFile.tsx
@@ -3970,7 +3969,7 @@ function Kr({ value: e, enabled: t, treatAs: n, download: r, render: i, children
3970
3969
  rel: s ?? (u && d === "_blank" ? "noopener noreferrer" : void 0),
3971
3970
  children: a ?? Wr(l)
3972
3971
  };
3973
- return i ? /* @__PURE__ */ R(L, { children: i(f) }) : /* @__PURE__ */ R("a", { ...f });
3972
+ return i ? /* @__PURE__ */ B(z, { children: i(f) }) : /* @__PURE__ */ B("a", { ...f });
3974
3973
  }
3975
3974
  //#endregion
3976
3975
  //#region src/SeedMediaAudio.tsx
@@ -3986,7 +3985,7 @@ function qr({ value: e, enabled: t, treatAs: n, render: r, controls: i = !0, ...
3986
3985
  src: o,
3987
3986
  controls: i
3988
3987
  };
3989
- return r ? /* @__PURE__ */ R(L, { children: r(s) }) : /* @__PURE__ */ R("audio", { ...s });
3988
+ return r ? /* @__PURE__ */ B(z, { children: r(s) }) : /* @__PURE__ */ B("audio", { ...s });
3990
3989
  }
3991
3990
  //#endregion
3992
3991
  //#region src/SeedMediaVideo.tsx
@@ -4002,7 +4001,7 @@ function Jr({ value: e, enabled: t, treatAs: n, render: r, controls: i = !0, ...
4002
4001
  src: o,
4003
4002
  controls: i
4004
4003
  };
4005
- return r ? /* @__PURE__ */ R(L, { children: r(s) }) : /* @__PURE__ */ R("video", { ...s });
4004
+ return r ? /* @__PURE__ */ B(z, { children: r(s) }) : /* @__PURE__ */ B("video", { ...s });
4006
4005
  }
4007
4006
  //#endregion
4008
4007
  //#region src/SeedHtml.tsx
@@ -4012,7 +4011,7 @@ function Yr(e) {
4012
4011
  function Xr({ html: e, sanitize: t, render: n, ...r }) {
4013
4012
  if (!Yr(e)) return null;
4014
4013
  let i = t(e);
4015
- return n ? /* @__PURE__ */ R(L, { children: n({ html: i }) }) : /* @__PURE__ */ R("div", {
4014
+ return n ? /* @__PURE__ */ B(z, { children: n({ html: i }) }) : /* @__PURE__ */ B("div", {
4016
4015
  ...r,
4017
4016
  dangerouslySetInnerHTML: { __html: i }
4018
4017
  });
@@ -4069,7 +4068,7 @@ function ei(e, t) {
4069
4068
  //#region src/SeedJson.tsx
4070
4069
  function ti({ value: e, format: t, formatOptions: n, render: r, ...i }) {
4071
4070
  let a = t ? t(e) : ei(e, n);
4072
- return r ? /* @__PURE__ */ R(L, { children: r({ text: a }) }) : /* @__PURE__ */ R("pre", {
4071
+ return r ? /* @__PURE__ */ B(z, { children: r({ text: a }) }) : /* @__PURE__ */ B("pre", {
4073
4072
  ...i,
4074
4073
  children: a
4075
4074
  });
@@ -4077,9 +4076,9 @@ function ti({ value: e, format: t, formatOptions: n, render: r, ...i }) {
4077
4076
  //#endregion
4078
4077
  //#region src/useNormalizedFeedItemFields.ts
4079
4078
  function ni(e, t) {
4080
- return o(() => e ? oe(e, t) : {}, [e, t]);
4079
+ return o(() => e ? ae(e, t) : {}, [e, t]);
4081
4080
  }
4082
4081
  //#endregion
4083
- export { q as ADDRESSES_PERSISTED_EVENT, It as FILES_QUERY_KEY_PREFIX, Se as LOCAL_COPIES_REMOVED_EVENT, Nr as OPFSFilesManager, pr as OPFS_FILES_MANAGER_CSS, Jt as SeedClientGate, Xr as SeedHtml, Vr as SeedImage, ti as SeedJson, qr as SeedMediaAudio, Kr as SeedMediaFile, Ur as SeedMediaImage, Jr as SeedMediaVideo, Kt as SeedProvider, Y as createSeedQueryClient, ei as formatSeedJson, Ve as getItemPropertyQueryKey, Pe as getItemQueryKey, ke as getSeedQueryDefaultOptions, $e as getServiceName, tt as getServiceUniqueKey, et as getServiceValue, Wt as invalidateItemPropertiesForItem, Ye as isDbReadyState, Ae as mergeSeedQueryDefaults, gt as useAllSchemaVersions, Re as useCreateItem, Ke as useCreateItemProperty, St as useCreateModel, jt as useCreateModelProperty, mt as useCreateSchema, Xe as useDbsAreReady, Ue as useDebouncedItemProperty, Nt as useDeleteItem, qe as useDestroyItemProperty, Ct as useDestroyModel, Mt as useDestroyModelProperty, ht as useDestroySchema, Ht as useEasSyncProcessById, Bt as useEasSyncProcesses, Vt as useEasSyncProcessesNonActiveCount, zt as useEasSyncProcessesState, Fr as useEnsureLocalImage, Lt as useFiles, ct as useGlobalServiceStatus, at as useHasSavedSnapshots, Ft as useImageFiles, K as useIsClientReady, rt as useIsDbReady, Fe as useItem, Ge as useItemProperties, He as useItemProperty, Le as useItems, J as useLiveQuery, De as useLiveQueryState, xt as useModel, Tt as useModelProperties, At as useModelProperty, bt as useModels, ni as useNormalizedFeedItemFields, un as useOPFSFiles, it as usePersistedSnapshots, ze as usePublishItem, Hr as useResolvedMediaRef, ut as useSchema, pt as useSchemas, we as useSeedAddressRevision, _t as useSeedProtocolSchema, nt as useService, st as useServices, hr as useStorageEstimate, Qn as useThumbnail };
4082
+ export { J as ADDRESSES_PERSISTED_EVENT, Ft as FILES_QUERY_KEY_PREFIX, xe as LOCAL_COPIES_REMOVED_EVENT, Nr as OPFSFilesManager, pr as OPFS_FILES_MANAGER_CSS, qt as SeedClientGate, Xr as SeedHtml, Vr as SeedImage, ti as SeedJson, qr as SeedMediaAudio, Kr as SeedMediaFile, Ur as SeedMediaImage, Jr as SeedMediaVideo, Gt as SeedProvider, X as createSeedQueryClient, ei as formatSeedJson, Be as getItemPropertyQueryKey, Ne as getItemQueryKey, Oe as getSeedQueryDefaultOptions, Qe as getServiceName, et as getServiceUniqueKey, $e as getServiceValue, Ut as invalidateItemPropertiesForItem, Je as isDbReadyState, ke as mergeSeedQueryDefaults, ht as useAllSchemaVersions, Le as useCreateItem, Ge as useCreateItemProperty, xt as useCreateModel, At as useCreateModelProperty, pt as useCreateSchema, Ye as useDbsAreReady, He as useDebouncedItemProperty, Mt as useDeleteItem, Ke as useDestroyItemProperty, St as useDestroyModel, jt as useDestroyModelProperty, mt as useDestroySchema, Vt as useEasSyncProcessById, zt as useEasSyncProcesses, Bt as useEasSyncProcessesNonActiveCount, Rt as useEasSyncProcessesState, Fr as useEnsureLocalImage, It as useFiles, st as useGlobalServiceStatus, it as useHasSavedSnapshots, Pt as useImageFiles, q as useIsClientReady, nt as useIsDbReady, Pe as useItem, We as useItemProperties, Ve as useItemProperty, Ie as useItems, Y as useLiveQuery, Ee as useLiveQueryState, bt as useModel, wt as useModelProperties, kt as useModelProperty, yt as useModels, ni as useNormalizedFeedItemFields, ln as useOPFSFiles, rt as usePersistedSnapshots, Re as usePublishItem, Hr as useResolvedMediaRef, lt as useSchema, ft as useSchemas, Ce as useSeedAddressRevision, gt as useSeedProtocolSchema, tt as useService, ot as useServices, hr as useStorageEstimate, Qn as useThumbnail };
4084
4083
 
4085
4084
  //# sourceMappingURL=index.js.map