@pretextbook/import 0.0.1 → 0.2.0

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/react.js CHANGED
@@ -1,149 +1,149 @@
1
- import ae, { useRef as re, useState as p, useMemo as J } from "react";
2
- import { q as Z, v as se, m as oe, l as le } from "./import-mode-iBDd9oQY.js";
3
- var U = { exports: {} }, z = {};
1
+ import oe, { useRef as re, useState as f, useMemo as H } from "react";
2
+ import { v as se, q as Z, m as le, l as ce } from "./import-mode-BDY8WcYJ.js";
3
+ var J = { exports: {} }, z = {};
4
4
  var Q;
5
- function ce() {
5
+ function ie() {
6
6
  if (Q) return z;
7
7
  Q = 1;
8
- var h = /* @__PURE__ */ Symbol.for("react.transitional.element"), T = /* @__PURE__ */ Symbol.for("react.fragment");
9
- function b(v, i, n) {
10
- var u = null;
11
- if (n !== void 0 && (u = "" + n), i.key !== void 0 && (u = "" + i.key), "key" in i) {
12
- n = {};
13
- for (var y in i)
14
- y !== "key" && (n[y] = i[y]);
15
- } else n = i;
16
- return i = n.ref, {
17
- $$typeof: h,
18
- type: v,
19
- key: u,
20
- ref: i !== void 0 ? i : null,
21
- props: n
8
+ var b = /* @__PURE__ */ Symbol.for("react.transitional.element"), k = /* @__PURE__ */ Symbol.for("react.fragment");
9
+ function j(g, c, a) {
10
+ var i = null;
11
+ if (a !== void 0 && (i = "" + a), c.key !== void 0 && (i = "" + c.key), "key" in c) {
12
+ a = {};
13
+ for (var p in c)
14
+ p !== "key" && (a[p] = c[p]);
15
+ } else a = c;
16
+ return c = a.ref, {
17
+ $$typeof: b,
18
+ type: g,
19
+ key: i,
20
+ ref: c !== void 0 ? c : null,
21
+ props: a
22
22
  };
23
23
  }
24
- return z.Fragment = T, z.jsx = b, z.jsxs = b, z;
24
+ return z.Fragment = k, z.jsx = j, z.jsxs = j, z;
25
25
  }
26
- var Y = {};
26
+ var M = {};
27
27
  var ee;
28
- function ie() {
28
+ function de() {
29
29
  return ee || (ee = 1, process.env.NODE_ENV !== "production" && (function() {
30
- function h(t) {
30
+ function b(t) {
31
31
  if (t == null) return null;
32
32
  if (typeof t == "function")
33
- return t.$$typeof === P ? null : t.displayName || t.name || null;
33
+ return t.$$typeof === B ? null : t.displayName || t.name || null;
34
34
  if (typeof t == "string") return t;
35
35
  switch (t) {
36
- case A:
36
+ case R:
37
37
  return "Fragment";
38
38
  case C:
39
39
  return "Profiler";
40
- case S:
40
+ case x:
41
41
  return "StrictMode";
42
- case M:
42
+ case $:
43
43
  return "Suspense";
44
- case B:
44
+ case X:
45
45
  return "SuspenseList";
46
- case f:
46
+ case U:
47
47
  return "Activity";
48
48
  }
49
49
  if (typeof t == "object")
50
50
  switch (typeof t.tag == "number" && console.error(
51
51
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
52
52
  ), t.$$typeof) {
53
- case E:
53
+ case _:
54
54
  return "Portal";
55
- case N:
55
+ case E:
56
56
  return t.displayName || "Context";
57
- case c:
57
+ case l:
58
58
  return (t._context.displayName || "Context") + ".Consumer";
59
- case F:
59
+ case O:
60
60
  var r = t.render;
61
61
  return t = t.displayName, t || (t = r.displayName || r.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
62
- case a:
63
- return r = t.displayName || null, r !== null ? r : h(t.type) || "Memo";
64
- case s:
62
+ case Y:
63
+ return r = t.displayName || null, r !== null ? r : b(t.type) || "Memo";
64
+ case F:
65
65
  r = t._payload, t = t._init;
66
66
  try {
67
- return h(t(r));
67
+ return b(t(r));
68
68
  } catch {
69
69
  }
70
70
  }
71
71
  return null;
72
72
  }
73
- function T(t) {
73
+ function k(t) {
74
74
  return "" + t;
75
75
  }
76
- function b(t) {
76
+ function j(t) {
77
77
  try {
78
- T(t);
78
+ k(t);
79
79
  var r = !1;
80
80
  } catch {
81
81
  r = !0;
82
82
  }
83
83
  if (r) {
84
84
  r = console;
85
- var l = r.error, d = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
86
- return l.call(
85
+ var o = r.error, d = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
86
+ return o.call(
87
87
  r,
88
88
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
89
89
  d
90
- ), T(t);
90
+ ), k(t);
91
91
  }
92
92
  }
93
- function v(t) {
94
- if (t === A) return "<>";
95
- if (typeof t == "object" && t !== null && t.$$typeof === s)
93
+ function g(t) {
94
+ if (t === R) return "<>";
95
+ if (typeof t == "object" && t !== null && t.$$typeof === F)
96
96
  return "<...>";
97
97
  try {
98
- var r = h(t);
98
+ var r = b(t);
99
99
  return r ? "<" + r + ">" : "<...>";
100
100
  } catch {
101
101
  return "<...>";
102
102
  }
103
103
  }
104
- function i() {
105
- var t = O.A;
104
+ function c() {
105
+ var t = D.A;
106
106
  return t === null ? null : t.getOwner();
107
107
  }
108
- function n() {
108
+ function a() {
109
109
  return Error("react-stack-top-frame");
110
110
  }
111
- function u(t) {
112
- if (L.call(t, "key")) {
111
+ function i(t) {
112
+ if (W.call(t, "key")) {
113
113
  var r = Object.getOwnPropertyDescriptor(t, "key").get;
114
114
  if (r && r.isReactWarning) return !1;
115
115
  }
116
116
  return t.key !== void 0;
117
117
  }
118
- function y(t, r) {
119
- function l() {
120
- o || (o = !0, console.error(
118
+ function p(t, r) {
119
+ function o() {
120
+ m || (m = !0, console.error(
121
121
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
122
122
  r
123
123
  ));
124
124
  }
125
- l.isReactWarning = !0, Object.defineProperty(t, "key", {
126
- get: l,
125
+ o.isReactWarning = !0, Object.defineProperty(t, "key", {
126
+ get: o,
127
127
  configurable: !0
128
128
  });
129
129
  }
130
- function g() {
131
- var t = h(this.type);
132
- return D[t] || (D[t] = !0, console.error(
130
+ function h() {
131
+ var t = b(this.type);
132
+ return y[t] || (y[t] = !0, console.error(
133
133
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
134
134
  )), t = this.props.ref, t !== void 0 ? t : null;
135
135
  }
136
- function _(t, r, l, d, X, K) {
137
- var m = l.ref;
136
+ function w(t, r, o, d, q, V) {
137
+ var u = o.ref;
138
138
  return t = {
139
- $$typeof: j,
139
+ $$typeof: T,
140
140
  type: t,
141
141
  key: r,
142
- props: l,
142
+ props: o,
143
143
  _owner: d
144
- }, (m !== void 0 ? m : null) !== null ? Object.defineProperty(t, "ref", {
144
+ }, (u !== void 0 ? u : null) !== null ? Object.defineProperty(t, "ref", {
145
145
  enumerable: !1,
146
- get: g
146
+ get: h
147
147
  }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
148
148
  configurable: !1,
149
149
  enumerable: !1,
@@ -158,33 +158,33 @@ function ie() {
158
158
  configurable: !1,
159
159
  enumerable: !1,
160
160
  writable: !0,
161
- value: X
161
+ value: q
162
162
  }), Object.defineProperty(t, "_debugTask", {
163
163
  configurable: !1,
164
164
  enumerable: !1,
165
165
  writable: !0,
166
- value: K
166
+ value: V
167
167
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
168
168
  }
169
- function k(t, r, l, d, X, K) {
170
- var m = r.children;
171
- if (m !== void 0)
169
+ function v(t, r, o, d, q, V) {
170
+ var u = r.children;
171
+ if (u !== void 0)
172
172
  if (d)
173
- if (W(m)) {
174
- for (d = 0; d < m.length; d++)
175
- R(m[d]);
176
- Object.freeze && Object.freeze(m);
173
+ if (s(u)) {
174
+ for (d = 0; d < u.length; d++)
175
+ S(u[d]);
176
+ Object.freeze && Object.freeze(u);
177
177
  } else
178
178
  console.error(
179
179
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
180
180
  );
181
- else R(m);
182
- if (L.call(r, "key")) {
183
- m = h(t);
184
- var I = Object.keys(r).filter(function(ne) {
185
- return ne !== "key";
181
+ else S(u);
182
+ if (W.call(r, "key")) {
183
+ u = b(t);
184
+ var I = Object.keys(r).filter(function(ae) {
185
+ return ae !== "key";
186
186
  });
187
- d = 0 < I.length ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}", H[m + d] || (I = 0 < I.length ? "{" + I.join(": ..., ") + ": ...}" : "{}", console.error(
187
+ d = 0 < I.length ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}", K[u + d] || (I = 0 < I.length ? "{" + I.join(": ..., ") + ": ...}" : "{}", console.error(
188
188
  `A props object containing a "key" prop is being spread into JSX:
189
189
  let props = %s;
190
190
  <%s {...props} />
@@ -192,164 +192,186 @@ React keys must be passed directly to JSX without using spread:
192
192
  let props = %s;
193
193
  <%s key={someKey} {...props} />`,
194
194
  d,
195
- m,
195
+ u,
196
196
  I,
197
- m
198
- ), H[m + d] = !0);
197
+ u
198
+ ), K[u + d] = !0);
199
199
  }
200
- if (m = null, l !== void 0 && (b(l), m = "" + l), u(r) && (b(r.key), m = "" + r.key), "key" in r) {
201
- l = {};
202
- for (var q in r)
203
- q !== "key" && (l[q] = r[q]);
204
- } else l = r;
205
- return m && y(
206
- l,
200
+ if (u = null, o !== void 0 && (j(o), u = "" + o), i(r) && (j(r.key), u = "" + r.key), "key" in r) {
201
+ o = {};
202
+ for (var G in r)
203
+ G !== "key" && (o[G] = r[G]);
204
+ } else o = r;
205
+ return u && p(
206
+ o,
207
207
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
208
- ), _(
208
+ ), w(
209
209
  t,
210
- m,
211
- l,
212
- i(),
213
- X,
214
- K
210
+ u,
211
+ o,
212
+ c(),
213
+ q,
214
+ V
215
215
  );
216
216
  }
217
- function R(t) {
218
- w(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === s && (t._payload.status === "fulfilled" ? w(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
217
+ function S(t) {
218
+ P(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === F && (t._payload.status === "fulfilled" ? P(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
219
219
  }
220
- function w(t) {
221
- return typeof t == "object" && t !== null && t.$$typeof === j;
220
+ function P(t) {
221
+ return typeof t == "object" && t !== null && t.$$typeof === T;
222
222
  }
223
- var x = ae, j = /* @__PURE__ */ Symbol.for("react.transitional.element"), E = /* @__PURE__ */ Symbol.for("react.portal"), A = /* @__PURE__ */ Symbol.for("react.fragment"), S = /* @__PURE__ */ Symbol.for("react.strict_mode"), C = /* @__PURE__ */ Symbol.for("react.profiler"), c = /* @__PURE__ */ Symbol.for("react.consumer"), N = /* @__PURE__ */ Symbol.for("react.context"), F = /* @__PURE__ */ Symbol.for("react.forward_ref"), M = /* @__PURE__ */ Symbol.for("react.suspense"), B = /* @__PURE__ */ Symbol.for("react.suspense_list"), a = /* @__PURE__ */ Symbol.for("react.memo"), s = /* @__PURE__ */ Symbol.for("react.lazy"), f = /* @__PURE__ */ Symbol.for("react.activity"), P = /* @__PURE__ */ Symbol.for("react.client.reference"), O = x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, W = Array.isArray, $ = console.createTask ? console.createTask : function() {
223
+ var N = oe, T = /* @__PURE__ */ Symbol.for("react.transitional.element"), _ = /* @__PURE__ */ Symbol.for("react.portal"), R = /* @__PURE__ */ Symbol.for("react.fragment"), x = /* @__PURE__ */ Symbol.for("react.strict_mode"), C = /* @__PURE__ */ Symbol.for("react.profiler"), l = /* @__PURE__ */ Symbol.for("react.consumer"), E = /* @__PURE__ */ Symbol.for("react.context"), O = /* @__PURE__ */ Symbol.for("react.forward_ref"), $ = /* @__PURE__ */ Symbol.for("react.suspense"), X = /* @__PURE__ */ Symbol.for("react.suspense_list"), Y = /* @__PURE__ */ Symbol.for("react.memo"), F = /* @__PURE__ */ Symbol.for("react.lazy"), U = /* @__PURE__ */ Symbol.for("react.activity"), B = /* @__PURE__ */ Symbol.for("react.client.reference"), D = N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, s = Array.isArray, n = console.createTask ? console.createTask : function() {
224
224
  return null;
225
225
  };
226
- x = {
226
+ N = {
227
227
  react_stack_bottom_frame: function(t) {
228
228
  return t();
229
229
  }
230
230
  };
231
- var o, D = {}, V = x.react_stack_bottom_frame.bind(
232
- x,
233
- n
234
- )(), G = $(v(n)), H = {};
235
- Y.Fragment = A, Y.jsx = function(t, r, l) {
236
- var d = 1e4 > O.recentlyCreatedOwnerStacks++;
237
- return k(
231
+ var m, y = {}, A = N.react_stack_bottom_frame.bind(
232
+ N,
233
+ a
234
+ )(), L = n(g(a)), K = {};
235
+ M.Fragment = R, M.jsx = function(t, r, o) {
236
+ var d = 1e4 > D.recentlyCreatedOwnerStacks++;
237
+ return v(
238
238
  t,
239
239
  r,
240
- l,
240
+ o,
241
241
  !1,
242
- d ? Error("react-stack-top-frame") : V,
243
- d ? $(v(t)) : G
242
+ d ? Error("react-stack-top-frame") : A,
243
+ d ? n(g(t)) : L
244
244
  );
245
- }, Y.jsxs = function(t, r, l) {
246
- var d = 1e4 > O.recentlyCreatedOwnerStacks++;
247
- return k(
245
+ }, M.jsxs = function(t, r, o) {
246
+ var d = 1e4 > D.recentlyCreatedOwnerStacks++;
247
+ return v(
248
248
  t,
249
249
  r,
250
- l,
250
+ o,
251
251
  !0,
252
- d ? Error("react-stack-top-frame") : V,
253
- d ? $(v(t)) : G
252
+ d ? Error("react-stack-top-frame") : A,
253
+ d ? n(g(t)) : L
254
254
  );
255
255
  };
256
- })()), Y;
256
+ })()), M;
257
257
  }
258
258
  var te;
259
259
  function ue() {
260
- return te || (te = 1, process.env.NODE_ENV === "production" ? U.exports = ce() : U.exports = ie()), U.exports;
260
+ return te || (te = 1, process.env.NODE_ENV === "production" ? J.exports = ie() : J.exports = de()), J.exports;
261
261
  }
262
262
  var e = ue();
263
- function pe({
264
- onConfirm: h,
265
- onCancel: T,
266
- importOptions: b,
267
- defaultDocumentKind: v = "auto"
263
+ const ne = [
264
+ ".tex",
265
+ ".md",
266
+ ".markdown",
267
+ ".ptx",
268
+ ".xml",
269
+ ".zip",
270
+ ".gz",
271
+ ".tar.gz",
272
+ ".tgz"
273
+ ], me = {
274
+ id: "builtin",
275
+ label: "Built-in converter",
276
+ description: "Create a new project starting with LaTeX, Markdown, or PreTeXt files.",
277
+ acceptExtensions: ne,
278
+ convertFile: se
279
+ };
280
+ function be({
281
+ onConfirm: b,
282
+ onCancel: k,
283
+ importOptions: j,
284
+ defaultDocumentKind: g = "auto",
285
+ engines: c
268
286
  }) {
269
- const i = re(null), [n, u] = p({ name: "upload" }), [y, g] = p(!1), [_, k] = p(v), [R, w] = p(!1), [x, j] = p("converted"), [E, A] = p(!1), [S, C] = p(/* @__PURE__ */ new Set()), c = async (a) => {
270
- u({ name: "processing" });
287
+ const a = c && c.length > 0 ? c : [me], i = re(null), [p, h] = f({ name: "upload" }), [w, v] = f(!1), [S, P] = f(g), [N, T] = f(!1), [_, R] = f(a[0].id), [x, C] = f("converted"), [l, E] = f(!1), [O, $] = f(/* @__PURE__ */ new Set()), X = a.find((s) => s.id === _) ?? a[0], Y = X.acceptExtensions ?? ne, F = async (s) => {
288
+ h({ name: "processing" });
271
289
  try {
272
- const f = await se(a, b ?? {
273
- documentKind: _ === "auto" ? void 0 : _,
274
- splitSections: R
275
- });
276
- "pretextError" in f ? u({ name: "error", message: f.pretextError }) : u({ name: "review", result: f });
277
- } catch (s) {
278
- u({
290
+ const n = j ?? {
291
+ documentKind: S === "auto" ? void 0 : S,
292
+ splitSections: N
293
+ }, m = await X.convertFile(s, n);
294
+ "pretextError" in m ? h({ name: "error", message: m.pretextError }) : h({ name: "review", result: m });
295
+ } catch (n) {
296
+ h({
279
297
  name: "error",
280
- message: s instanceof Error ? s.message : "An unexpected error occurred."
298
+ message: n instanceof Error ? n.message : "An unexpected error occurred."
281
299
  });
282
300
  }
283
- }, N = () => {
284
- u({ name: "upload" }), j("converted"), A(!1), C(/* @__PURE__ */ new Set());
301
+ }, U = () => {
302
+ h({ name: "upload" }), C("converted"), E(!1), $(/* @__PURE__ */ new Set());
285
303
  };
286
- function F(a, s) {
287
- return [...a].sort((f, P) => f === s ? -1 : P === s ? 1 : f.localeCompare(P));
304
+ function B(s, n) {
305
+ return [...s].sort((m, y) => m === n ? -1 : y === n ? 1 : m.localeCompare(y));
288
306
  }
289
- function M(a, s) {
290
- const f = Z(a, s), P = s === "converted" ? "source/main.ptx" : a.sourcePath, O = F(Object.keys(f), P)[0];
291
- C(O ? /* @__PURE__ */ new Set([O]) : /* @__PURE__ */ new Set());
307
+ function D(s, n) {
308
+ const m = Z(s, n), y = n === "converted" ? "source/main.ptx" : s.sourcePath, A = B(Object.keys(m), y)[0];
309
+ $(A ? /* @__PURE__ */ new Set([A]) : /* @__PURE__ */ new Set());
292
310
  }
293
- function B(a) {
294
- C((s) => {
295
- const f = new Set(s);
296
- return f.has(a) ? f.delete(a) : f.add(a), f;
311
+ function W(s) {
312
+ $((n) => {
313
+ const m = new Set(n);
314
+ return m.has(s) ? m.delete(s) : m.add(s), m;
297
315
  });
298
316
  }
299
- if (n.name === "processing")
317
+ if (p.name === "processing")
300
318
  return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center gap-3 py-16 text-slate-600", children: [
301
319
  /* @__PURE__ */ e.jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-blue-700 border-t-transparent" }),
302
320
  /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "Processing your file…" })
303
321
  ] });
304
- if (n.name === "error")
322
+ if (p.name === "error")
305
323
  return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
306
324
  /* @__PURE__ */ e.jsxs("div", { className: "rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800", children: [
307
325
  /* @__PURE__ */ e.jsx("p", { className: "font-semibold", children: "Import failed" }),
308
- /* @__PURE__ */ e.jsx("p", { className: "mt-1", children: n.message })
326
+ /* @__PURE__ */ e.jsx("p", { className: "mt-1", children: p.message })
309
327
  ] }),
310
328
  /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(
311
329
  "button",
312
330
  {
313
331
  type: "button",
314
- onClick: N,
332
+ onClick: U,
315
333
  className: "rounded bg-blue-700 px-4 py-2 text-sm font-medium text-white hover:bg-blue-600",
316
334
  children: "Try Another File"
317
335
  }
318
336
  ) })
319
337
  ] });
320
- if (n.name === "review") {
321
- let a = function(o) {
322
- j(o), E && M(s, o);
338
+ if (p.name === "review") {
339
+ let s = function(r) {
340
+ C(r), l && D(n, r);
323
341
  };
324
- const { result: s } = n, f = s.detectedSourceFormat === "latex", P = s.warnings.length, O = Object.keys(s.outputFiles).length, L = Z(s, x), W = x === "converted" ? "source/main.ptx" : s.sourcePath, $ = F(Object.keys(L), W);
342
+ const { result: n } = p, m = n.detectedSourceFormat === "latex", y = n.warnings.length, A = Object.keys(n.outputFiles).length, L = Z(n, x), K = x === "converted" ? "source/main.ptx" : n.sourcePath, t = B(
343
+ Object.keys(L),
344
+ K
345
+ );
325
346
  return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
326
347
  /* @__PURE__ */ e.jsxs("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-4", children: [
327
348
  /* @__PURE__ */ e.jsx("h3", { className: "mb-3 text-sm font-semibold text-slate-700", children: "Import Summary" }),
328
349
  /* @__PURE__ */ e.jsxs("dl", { className: "grid grid-cols-2 gap-x-6 gap-y-2 text-sm", children: [
329
350
  /* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Source" }),
330
- /* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children: s.sourceName }),
351
+ /* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children: n.sourceName }),
331
352
  /* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Detected format" }),
332
- /* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900 capitalize", children: s.detectedSourceFormat }),
353
+ /* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900 capitalize", children: n.detectedSourceFormat }),
333
354
  /* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Document kind" }),
334
- /* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900 capitalize", children: s.documentKind }),
355
+ /* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900 capitalize", children: n.documentKind }),
335
356
  /* @__PURE__ */ e.jsx("dt", { className: "text-slate-500", children: "Output files" }),
336
- /* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children: O })
357
+ /* @__PURE__ */ e.jsx("dd", { className: "font-medium text-slate-900", children: A })
337
358
  ] })
338
359
  ] }),
339
- P > 0 ? /* @__PURE__ */ e.jsxs("details", { className: "rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm", children: [
360
+ y > 0 ? /* @__PURE__ */ e.jsxs("details", { className: "rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm", children: [
340
361
  /* @__PURE__ */ e.jsxs("summary", { className: "cursor-pointer font-semibold text-amber-800", children: [
341
- P,
342
- " conversion ",
343
- P === 1 ? "warning" : "warnings"
362
+ y,
363
+ " conversion",
364
+ " ",
365
+ y === 1 ? "warning" : "warnings"
344
366
  ] }),
345
- /* @__PURE__ */ e.jsx("ul", { className: "mt-3 space-y-1.5 text-amber-700", children: s.warnings.map((o, D) => /* @__PURE__ */ e.jsxs("li", { children: [
346
- /* @__PURE__ */ e.jsx("code", { className: "rounded bg-amber-100 px-1 py-0.5 text-xs", children: o.macro }),
367
+ /* @__PURE__ */ e.jsx("ul", { className: "mt-3 space-y-1.5 text-amber-700", children: n.warnings.map((r, o) => /* @__PURE__ */ e.jsxs("li", { children: [
368
+ /* @__PURE__ */ e.jsx("code", { className: "rounded bg-amber-100 px-1 py-0.5 text-xs", children: r.macro }),
347
369
  " — ",
348
- o.action === "replace" || o.action === "rewrite" ? `replaced with \`${o.replacement}\`` : o.message ?? o.action,
349
- o.occurrences > 1 ? ` (×${o.occurrences})` : null
350
- ] }, D)) })
370
+ r.action === "replace" || r.action === "rewrite" ? `replaced with \`${r.replacement}\`` : r.message ?? r.action,
371
+ r.occurrences > 1 ? ` (×${r.occurrences})` : null
372
+ ] }, o)) })
351
373
  ] }) : /* @__PURE__ */ e.jsx("p", { className: "text-sm text-green-700", children: "No conversion warnings." }),
352
- f ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
374
+ m ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
353
375
  /* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Import mode" }),
354
376
  /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-col gap-3", children: [
355
377
  /* @__PURE__ */ e.jsxs("label", { className: "flex cursor-pointer items-start gap-3 text-sm", children: [
@@ -360,7 +382,7 @@ function pe({
360
382
  name: "import-mode",
361
383
  value: "converted",
362
384
  checked: x === "converted",
363
- onChange: () => a("converted"),
385
+ onChange: () => s("converted"),
364
386
  className: "mt-0.5"
365
387
  }
366
388
  ),
@@ -377,7 +399,7 @@ function pe({
377
399
  name: "import-mode",
378
400
  value: "native",
379
401
  checked: x === "native",
380
- onChange: () => a("native"),
402
+ onChange: () => s("native"),
381
403
  className: "mt-0.5"
382
404
  }
383
405
  ),
@@ -388,36 +410,43 @@ function pe({
388
410
  ] })
389
411
  ] })
390
412
  ] }) : null,
391
- E ? /* @__PURE__ */ e.jsx("div", { className: "overflow-hidden rounded-lg border border-slate-200 text-sm", children: $.map((o) => {
392
- const D = S.has(o);
393
- return /* @__PURE__ */ e.jsxs("div", { className: "border-b border-slate-200 last:border-b-0", children: [
394
- /* @__PURE__ */ e.jsxs(
395
- "button",
396
- {
397
- type: "button",
398
- onClick: () => B(o),
399
- className: "flex w-full items-center gap-2 bg-slate-100 px-4 py-2 text-left font-mono text-xs text-slate-700 hover:bg-slate-200",
400
- children: [
401
- /* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-slate-400", children: D ? "▾" : "▸" }),
402
- /* @__PURE__ */ e.jsx("span", { className: "flex-1 truncate", children: o }),
403
- /* @__PURE__ */ e.jsxs("span", { className: "shrink-0 text-slate-400", children: [
404
- (L[o].length / 1024).toFixed(1),
405
- " KB"
406
- ] })
407
- ]
408
- }
409
- ),
410
- D ? /* @__PURE__ */ e.jsx("pre", { className: "m-0 max-h-72 overflow-auto bg-white p-4 font-mono text-xs leading-relaxed text-slate-800", children: L[o] }) : null
411
- ] }, o);
413
+ l ? /* @__PURE__ */ e.jsx("div", { className: "overflow-hidden rounded-lg border border-slate-200 text-sm", children: t.map((r) => {
414
+ const o = O.has(r);
415
+ return /* @__PURE__ */ e.jsxs(
416
+ "div",
417
+ {
418
+ className: "border-b border-slate-200 last:border-b-0",
419
+ children: [
420
+ /* @__PURE__ */ e.jsxs(
421
+ "button",
422
+ {
423
+ type: "button",
424
+ onClick: () => W(r),
425
+ className: "flex w-full items-center gap-2 bg-slate-100 px-4 py-2 text-left font-mono text-xs text-slate-700 hover:bg-slate-200",
426
+ children: [
427
+ /* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-slate-400", children: o ? "▾" : "▸" }),
428
+ /* @__PURE__ */ e.jsx("span", { className: "flex-1 truncate", children: r }),
429
+ /* @__PURE__ */ e.jsxs("span", { className: "shrink-0 text-slate-400", children: [
430
+ (L[r].length / 1024).toFixed(1),
431
+ " KB"
432
+ ] })
433
+ ]
434
+ }
435
+ ),
436
+ o ? /* @__PURE__ */ e.jsx("pre", { className: "m-0 max-h-72 overflow-auto bg-white p-4 font-mono text-xs leading-relaxed text-slate-800", children: L[r] }) : null
437
+ ]
438
+ },
439
+ r
440
+ );
412
441
  }) }) : null,
413
442
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-3 pt-1", children: [
414
443
  /* @__PURE__ */ e.jsx(
415
444
  "button",
416
445
  {
417
446
  type: "button",
418
- onClick: T ?? N,
447
+ onClick: k ?? U,
419
448
  className: "px-4 py-2 text-sm text-slate-600 hover:text-slate-900",
420
- children: T ? "Cancel" : "Start Over"
449
+ children: k ? "Cancel" : "Start Over"
421
450
  }
422
451
  ),
423
452
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
@@ -426,17 +455,17 @@ function pe({
426
455
  {
427
456
  type: "button",
428
457
  onClick: () => {
429
- E || M(s, x), A((o) => !o);
458
+ l || D(n, x), E((r) => !r);
430
459
  },
431
460
  className: "rounded border border-slate-300 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50",
432
- children: E ? "Hide Preview" : "Preview"
461
+ children: l ? "Hide Preview" : "Preview"
433
462
  }
434
463
  ),
435
464
  /* @__PURE__ */ e.jsx(
436
465
  "button",
437
466
  {
438
467
  type: "button",
439
- onClick: () => h(s, x),
468
+ onClick: () => b(n, x),
440
469
  className: "rounded bg-blue-700 px-4 py-2 text-sm font-medium text-white hover:bg-blue-600",
441
470
  children: "Confirm Import"
442
471
  }
@@ -446,14 +475,43 @@ function pe({
446
475
  ] });
447
476
  }
448
477
  return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
449
- b ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-4 text-sm", children: [
478
+ a.length > 1 ? /* @__PURE__ */ e.jsxs("fieldset", { className: "rounded-lg border border-slate-200 p-4", children: [
479
+ /* @__PURE__ */ e.jsx("legend", { className: "px-1 text-sm font-semibold text-slate-700", children: "Converter" }),
480
+ /* @__PURE__ */ e.jsx("div", { className: "mt-2 flex flex-col gap-3", children: a.map((s) => /* @__PURE__ */ e.jsxs(
481
+ "label",
482
+ {
483
+ className: "flex cursor-pointer items-start gap-3 text-sm",
484
+ children: [
485
+ /* @__PURE__ */ e.jsx(
486
+ "input",
487
+ {
488
+ type: "radio",
489
+ name: "import-engine",
490
+ value: s.id,
491
+ checked: _ === s.id,
492
+ onChange: () => R(s.id),
493
+ className: "mt-0.5"
494
+ }
495
+ ),
496
+ /* @__PURE__ */ e.jsxs("span", { children: [
497
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium text-slate-900", children: s.label }),
498
+ s.description ? /* @__PURE__ */ e.jsx("span", { className: "block text-slate-500", children: s.description }) : null
499
+ ] })
500
+ ]
501
+ },
502
+ s.id
503
+ )) })
504
+ ] }) : null,
505
+ j ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-4 text-sm", children: [
450
506
  /* @__PURE__ */ e.jsxs("label", { className: "flex items-center gap-2 text-slate-700", children: [
451
507
  /* @__PURE__ */ e.jsx("span", { className: "text-slate-500", children: "Document kind" }),
452
508
  /* @__PURE__ */ e.jsxs(
453
509
  "select",
454
510
  {
455
- value: _,
456
- onChange: (a) => k(a.currentTarget.value),
511
+ value: S,
512
+ onChange: (s) => P(
513
+ s.currentTarget.value
514
+ ),
457
515
  className: "rounded border border-slate-300 px-2 py-1 text-sm",
458
516
  children: [
459
517
  /* @__PURE__ */ e.jsx("option", { value: "auto", children: "Auto detect" }),
@@ -468,8 +526,8 @@ function pe({
468
526
  "input",
469
527
  {
470
528
  type: "checkbox",
471
- checked: R,
472
- onChange: (a) => w(a.currentTarget.checked)
529
+ checked: N,
530
+ onChange: (s) => T(s.currentTarget.checked)
473
531
  }
474
532
  ),
475
533
  "Split sections into separate files"
@@ -480,42 +538,45 @@ function pe({
480
538
  {
481
539
  role: "button",
482
540
  tabIndex: 0,
483
- onKeyDown: (a) => a.key === "Enter" && i.current?.click(),
541
+ onKeyDown: (s) => s.key === "Enter" && i.current?.click(),
484
542
  onClick: () => i.current?.click(),
485
- onDragOver: (a) => {
486
- a.preventDefault(), g(!0);
543
+ onDragOver: (s) => {
544
+ s.preventDefault(), v(!0);
487
545
  },
488
- onDragLeave: () => g(!1),
489
- onDrop: (a) => {
490
- a.preventDefault(), g(!1);
491
- const s = a.dataTransfer.files?.[0];
492
- s && c(s);
546
+ onDragLeave: () => v(!1),
547
+ onDrop: (s) => {
548
+ s.preventDefault(), v(!1);
549
+ const n = s.dataTransfer.files?.[0];
550
+ n && F(n);
493
551
  },
494
- className: `flex cursor-pointer flex-col items-center gap-3 rounded-lg border-2 border-dashed p-10 text-center transition-colors ${y ? "border-blue-500 bg-blue-50" : "border-slate-300 bg-slate-50 hover:border-slate-400"}`,
552
+ className: `flex cursor-pointer flex-col items-center gap-3 rounded-lg border-2 border-dashed p-10 text-center transition-colors ${w ? "border-blue-500 bg-blue-50" : "border-slate-300 bg-slate-50 hover:border-slate-400"}`,
495
553
  children: [
496
554
  /* @__PURE__ */ e.jsx("p", { className: "text-slate-600", children: "Drop a file here, or click to select." }),
497
555
  /* @__PURE__ */ e.jsx(
498
556
  "button",
499
557
  {
500
558
  type: "button",
501
- onClick: (a) => {
502
- a.stopPropagation(), i.current?.click();
559
+ onClick: (s) => {
560
+ s.stopPropagation(), i.current?.click();
503
561
  },
504
562
  className: "rounded bg-blue-700 px-4 py-2 text-sm font-medium text-white hover:bg-blue-600",
505
563
  children: "Select File"
506
564
  }
507
565
  ),
508
- /* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-400", children: "Supports .tex, .md, .ptx, .xml, .zip, .tar.gz" }),
566
+ /* @__PURE__ */ e.jsxs("p", { className: "text-xs text-slate-400", children: [
567
+ "Supports ",
568
+ Y.join(", ")
569
+ ] }),
509
570
  /* @__PURE__ */ e.jsx(
510
571
  "input",
511
572
  {
512
573
  ref: i,
513
574
  type: "file",
514
575
  hidden: !0,
515
- accept: ".tex,.md,.markdown,.ptx,.xml,.zip,.gz,.tar.gz,.tgz",
516
- onChange: (a) => {
517
- const s = a.currentTarget.files?.[0];
518
- s && c(s), a.currentTarget.value = "";
576
+ accept: Y.join(","),
577
+ onChange: (s) => {
578
+ const n = s.currentTarget.files?.[0];
579
+ n && F(n), s.currentTarget.value = "";
519
580
  }
520
581
  }
521
582
  )
@@ -524,7 +585,7 @@ function pe({
524
585
  )
525
586
  ] });
526
587
  }
527
- const de = {
588
+ const xe = {
528
589
  title: "Import Source Content",
529
590
  description: "Paste LaTeX, Markdown, or PreTeXt source to convert into PreTeXt.",
530
591
  sourceLabel: "Source",
@@ -535,57 +596,59 @@ const de = {
535
596
  successPrefix: "Ready",
536
597
  errorPrefix: "Error"
537
598
  };
538
- function he({
539
- initialSource: h = "",
540
- initialSourceFormat: T,
541
- labels: b,
542
- disabled: v = !1,
543
- onImport: i
599
+ function ve({
600
+ initialSource: b = "",
601
+ initialSourceFormat: k,
602
+ labels: j,
603
+ disabled: g = !1,
604
+ onImport: c
544
605
  }) {
545
- const n = J(
546
- () => ({ ...de, ...b ?? {} }),
547
- [b]
548
- ), [u, y] = p(h), [g, _] = p(
549
- T ?? "auto"
550
- ), [k, R] = p(null), w = J(
551
- () => oe(u),
552
- [u]
553
- ), x = v || !u.trim();
606
+ const a = H(
607
+ () => ({ ...xe, ...j ?? {} }),
608
+ [j]
609
+ ), [i, p] = f(b), [h, w] = f(
610
+ k ?? "auto"
611
+ ), [v, S] = f(
612
+ null
613
+ ), P = H(
614
+ () => le(i),
615
+ [i]
616
+ ), N = g || !i.trim();
554
617
  return /* @__PURE__ */ e.jsx(
555
618
  "form",
556
619
  {
557
- onSubmit: (j) => {
558
- j.preventDefault();
559
- const E = le(
560
- u,
561
- g === "auto" ? void 0 : g
620
+ onSubmit: (T) => {
621
+ T.preventDefault();
622
+ const _ = ce(
623
+ i,
624
+ h === "auto" ? void 0 : h
562
625
  );
563
- R(E), i(E);
626
+ S(_), c(_);
564
627
  },
565
628
  "aria-label": "Import source form",
566
- children: /* @__PURE__ */ e.jsxs("fieldset", { disabled: v, children: [
567
- /* @__PURE__ */ e.jsx("legend", { children: n.title }),
568
- /* @__PURE__ */ e.jsx("p", { children: n.description }),
629
+ children: /* @__PURE__ */ e.jsxs("fieldset", { disabled: g, children: [
630
+ /* @__PURE__ */ e.jsx("legend", { children: a.title }),
631
+ /* @__PURE__ */ e.jsx("p", { children: a.description }),
569
632
  /* @__PURE__ */ e.jsxs("label", { children: [
570
- n.sourceLabel,
633
+ a.sourceLabel,
571
634
  /* @__PURE__ */ e.jsx(
572
635
  "textarea",
573
636
  {
574
- value: u,
575
- onChange: (j) => y(j.currentTarget.value),
576
- placeholder: n.sourcePlaceholder,
637
+ value: i,
638
+ onChange: (T) => p(T.currentTarget.value),
639
+ placeholder: a.sourcePlaceholder,
577
640
  rows: 12
578
641
  }
579
642
  )
580
643
  ] }),
581
644
  /* @__PURE__ */ e.jsxs("label", { children: [
582
- n.formatLabel,
645
+ a.formatLabel,
583
646
  /* @__PURE__ */ e.jsxs(
584
647
  "select",
585
648
  {
586
- value: g,
587
- onChange: (j) => _(
588
- j.currentTarget.value
649
+ value: h,
650
+ onChange: (T) => w(
651
+ T.currentTarget.value
589
652
  ),
590
653
  children: [
591
654
  /* @__PURE__ */ e.jsx("option", { value: "auto", children: "Auto detect" }),
@@ -597,26 +660,26 @@ function he({
597
660
  )
598
661
  ] }),
599
662
  /* @__PURE__ */ e.jsxs("p", { children: [
600
- n.detectedFormatPrefix,
663
+ a.detectedFormatPrefix,
601
664
  ": ",
602
- /* @__PURE__ */ e.jsx("strong", { children: w })
665
+ /* @__PURE__ */ e.jsx("strong", { children: P })
603
666
  ] }),
604
- /* @__PURE__ */ e.jsx("button", { type: "submit", disabled: x, children: n.convertButton }),
605
- k ? "pretextError" in k ? /* @__PURE__ */ e.jsxs("p", { role: "alert", children: [
606
- n.errorPrefix,
667
+ /* @__PURE__ */ e.jsx("button", { type: "submit", disabled: N, children: a.convertButton }),
668
+ v ? "pretextError" in v ? /* @__PURE__ */ e.jsxs("p", { role: "alert", children: [
669
+ a.errorPrefix,
607
670
  ": ",
608
- k.pretextError
671
+ v.pretextError
609
672
  ] }) : /* @__PURE__ */ e.jsxs("p", { children: [
610
- n.successPrefix,
673
+ a.successPrefix,
611
674
  ": ",
612
- k.pretextSource.length,
675
+ v.pretextSource.length,
613
676
  " characters of PreTeXt generated."
614
677
  ] }) : null
615
678
  ] })
616
679
  }
617
680
  );
618
681
  }
619
- const me = {
682
+ const fe = {
620
683
  title: "Upload Source File",
621
684
  hint: "Supports .tex, .md, .ptx, .xml, .zip, and .tar.gz files.",
622
685
  selectButton: "Select File",
@@ -624,43 +687,43 @@ const me = {
624
687
  documentKindLabel: "Document kind",
625
688
  splitSectionsLabel: "Split each chapter into sections"
626
689
  };
627
- function be({
628
- labels: h,
629
- disabled: T = !1,
630
- defaultDocumentKind: b = "auto",
631
- importOptions: v,
632
- onImport: i
690
+ function je({
691
+ labels: b,
692
+ disabled: k = !1,
693
+ defaultDocumentKind: j = "auto",
694
+ importOptions: g,
695
+ onImport: c
633
696
  }) {
634
- const n = J(
635
- () => ({ ...me, ...h ?? {} }),
636
- [h]
637
- ), u = re(null), [y, g] = p(!1), [_, k] = p(!1), [R, w] = p(
697
+ const a = H(
698
+ () => ({ ...fe, ...b ?? {} }),
699
+ [b]
700
+ ), i = re(null), [p, h] = f(!1), [w, v] = f(!1), [S, P] = f(
638
701
  []
639
- ), [x, j] = p(b), [E, A] = p(!1), S = T || _, C = async (c) => {
640
- k(!0);
702
+ ), [N, T] = f(j), [_, R] = f(!1), x = k || w, C = async (l) => {
703
+ v(!0);
641
704
  try {
642
- const F = await se(c, v ?? {
643
- documentKind: x === "auto" ? void 0 : x,
644
- splitSections: E
705
+ const O = await se(l, g ?? {
706
+ documentKind: N === "auto" ? void 0 : N,
707
+ splitSections: _
645
708
  });
646
- w(F.statusMessages), i(F);
709
+ P(O.statusMessages), c(O);
647
710
  } finally {
648
- k(!1);
711
+ v(!1);
649
712
  }
650
713
  };
651
714
  return /* @__PURE__ */ e.jsxs("section", { "aria-label": "Import upload panel", children: [
652
- /* @__PURE__ */ e.jsx("h3", { children: n.title }),
653
- /* @__PURE__ */ e.jsx("p", { children: n.hint }),
654
- v ? null : /* @__PURE__ */ e.jsxs("div", { className: "import-options", children: [
715
+ /* @__PURE__ */ e.jsx("h3", { children: a.title }),
716
+ /* @__PURE__ */ e.jsx("p", { children: a.hint }),
717
+ g ? null : /* @__PURE__ */ e.jsxs("div", { className: "import-options", children: [
655
718
  /* @__PURE__ */ e.jsxs("label", { children: [
656
- n.documentKindLabel,
719
+ a.documentKindLabel,
657
720
  /* @__PURE__ */ e.jsxs(
658
721
  "select",
659
722
  {
660
- value: x,
661
- disabled: S,
662
- onChange: (c) => j(
663
- c.currentTarget.value
723
+ value: N,
724
+ disabled: x,
725
+ onChange: (l) => T(
726
+ l.currentTarget.value
664
727
  ),
665
728
  children: [
666
729
  /* @__PURE__ */ e.jsx("option", { value: "auto", children: "Auto detect" }),
@@ -675,61 +738,61 @@ function be({
675
738
  "input",
676
739
  {
677
740
  type: "checkbox",
678
- checked: E,
679
- disabled: S,
680
- onChange: (c) => A(c.currentTarget.checked)
741
+ checked: _,
742
+ disabled: x,
743
+ onChange: (l) => R(l.currentTarget.checked)
681
744
  }
682
745
  ),
683
- n.splitSectionsLabel
746
+ a.splitSectionsLabel
684
747
  ] })
685
748
  ] }),
686
749
  /* @__PURE__ */ e.jsxs(
687
750
  "div",
688
751
  {
689
- onDragOver: (c) => {
690
- c.preventDefault(), S || g(!0);
752
+ onDragOver: (l) => {
753
+ l.preventDefault(), x || h(!0);
691
754
  },
692
- onDragLeave: () => g(!1),
693
- onDrop: (c) => {
694
- if (c.preventDefault(), g(!1), S)
755
+ onDragLeave: () => h(!1),
756
+ onDrop: (l) => {
757
+ if (l.preventDefault(), h(!1), x)
695
758
  return;
696
- const N = c.dataTransfer.files?.[0];
697
- N && C(N);
759
+ const E = l.dataTransfer.files?.[0];
760
+ E && C(E);
698
761
  },
699
762
  children: [
700
- /* @__PURE__ */ e.jsx("p", { children: n.dropHint }),
763
+ /* @__PURE__ */ e.jsx("p", { children: a.dropHint }),
701
764
  /* @__PURE__ */ e.jsx(
702
765
  "button",
703
766
  {
704
767
  type: "button",
705
- disabled: S,
706
- onClick: () => u.current?.click(),
707
- children: _ ? "Processing..." : n.selectButton
768
+ disabled: x,
769
+ onClick: () => i.current?.click(),
770
+ children: w ? "Processing..." : a.selectButton
708
771
  }
709
772
  ),
710
773
  /* @__PURE__ */ e.jsx(
711
774
  "input",
712
775
  {
713
- ref: u,
776
+ ref: i,
714
777
  type: "file",
715
778
  hidden: !0,
716
- disabled: S,
779
+ disabled: x,
717
780
  accept: ".tex,.md,.markdown,.ptx,.xml,.zip,.gz,.tar.gz,.tgz",
718
- onChange: (c) => {
719
- const N = c.currentTarget.files?.[0];
720
- N && C(N), c.currentTarget.value = "";
781
+ onChange: (l) => {
782
+ const E = l.currentTarget.files?.[0];
783
+ E && C(E), l.currentTarget.value = "";
721
784
  }
722
785
  }
723
786
  )
724
787
  ]
725
788
  }
726
789
  ),
727
- R.length > 0 ? /* @__PURE__ */ e.jsx("ul", { "aria-live": "polite", children: R.map((c, N) => /* @__PURE__ */ e.jsx("li", { children: c.message }, `${c.type}-${N}`)) }) : null,
728
- y && !S ? /* @__PURE__ */ e.jsx("p", { children: "Release to upload the file." }) : null
790
+ S.length > 0 ? /* @__PURE__ */ e.jsx("ul", { "aria-live": "polite", children: S.map((l, E) => /* @__PURE__ */ e.jsx("li", { children: l.message }, `${l.type}-${E}`)) }) : null,
791
+ p && !x ? /* @__PURE__ */ e.jsx("p", { children: "Release to upload the file." }) : null
729
792
  ] });
730
793
  }
731
794
  export {
732
- he as ImportSourceForm,
733
- be as ImportUploadPanel,
734
- pe as ImportWizard
795
+ ve as ImportSourceForm,
796
+ je as ImportUploadPanel,
797
+ be as ImportWizard
735
798
  };