@filens/converter-client 0.0.0-stage → 0.1.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.
@@ -0,0 +1,2724 @@
1
+ var pt = Object.defineProperty;
2
+ var lt = (e, t, r) => t in e ? pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var y = (e, t, r) => lt(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { gunzipSync as Ft } from "fflate";
5
+ function d(e) {
6
+ if (e != null && e.aborted) throw J();
7
+ }
8
+ function J() {
9
+ return Object.assign(new Error("The conversion was aborted."), { name: "AbortError" });
10
+ }
11
+ function f(e, t) {
12
+ return t ? new Promise((r, o) => {
13
+ const a = () => o(J());
14
+ e.then(
15
+ (s) => {
16
+ t.removeEventListener("abort", a), r(s);
17
+ },
18
+ (s) => {
19
+ t.removeEventListener("abort", a), o(s);
20
+ }
21
+ ), t.aborted ? a() : t.addEventListener("abort", a, { once: !0 });
22
+ }) : e;
23
+ }
24
+ function D(e) {
25
+ let t;
26
+ return () => {
27
+ if (!t) {
28
+ const r = Promise.resolve().then(e);
29
+ t = r, r.catch(() => {
30
+ t === r && (t = void 0);
31
+ });
32
+ }
33
+ return t;
34
+ };
35
+ }
36
+ function K(e) {
37
+ return /^(?:https?:|blob:|\/|\.{1,2}\/)/i.test(e);
38
+ }
39
+ function X(e) {
40
+ return e.trimStart().toLowerCase().startsWith("data:");
41
+ }
42
+ function Q(e) {
43
+ const t = atob(e), r = new Uint8Array(t.length);
44
+ for (let o = 0; o < r.length; o++) r[o] = t.charCodeAt(o);
45
+ return r;
46
+ }
47
+ function Z(e) {
48
+ var m;
49
+ const t = e.trimStart(), r = t.indexOf(",");
50
+ if (r < 0) throw new Error("Conversion data URL is missing its payload separator.");
51
+ const o = t.slice(0, r), a = t.slice(r + 1), s = (m = o.match(/^data:([^;,]+)/i)) == null ? void 0 : m[1];
52
+ if (/;base64$/i.test(o)) return { bytes: Q(a), contentType: s };
53
+ const c = new TextEncoder().encode(a);
54
+ let n = 0;
55
+ for (let i = 0; i < c.length; i++) {
56
+ if (c[i] === 37) {
57
+ const p = $(c[i + 1]), l = $(c[i + 2]);
58
+ if (p >= 0 && l >= 0) {
59
+ c[n++] = p << 4 | l, i += 2;
60
+ continue;
61
+ }
62
+ }
63
+ c[n++] = c[i];
64
+ }
65
+ return { bytes: c.subarray(0, n), contentType: s };
66
+ }
67
+ function $(e) {
68
+ if (e >= 48 && e <= 57) return e - 48;
69
+ const t = e | 32;
70
+ return t >= 97 && t <= 102 ? t - 87 : -1;
71
+ }
72
+ async function q(e, t = globalThis.fetch, r, o = 1 / 0) {
73
+ var s;
74
+ const a = (c) => {
75
+ if (c > o) throw new Error("Conversion source exceeds the preview byte limit.");
76
+ };
77
+ if (gt(e)) {
78
+ a(e.size);
79
+ const c = new Uint8Array(await f(e.arrayBuffer(), r));
80
+ return a(c.length), c;
81
+ }
82
+ if (e instanceof ArrayBuffer)
83
+ return a(e.byteLength), new Uint8Array(e);
84
+ if (ArrayBuffer.isView(e))
85
+ return a(e.byteLength), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
86
+ if (typeof e == "string") {
87
+ if (X(e)) {
88
+ a(Math.max(0, e.length - e.indexOf(",") - 1) / 3);
89
+ const n = Z(e).bytes;
90
+ return a(n.length), n;
91
+ }
92
+ if (K(e)) {
93
+ if (!t) throw new Error("A fetch implementation is required to load a conversion source URL.");
94
+ const n = await f(t(e, { signal: r }), r);
95
+ if (d(r), !n.ok)
96
+ throw new Error(`Failed to fetch conversion source: ${n.status} ${n.statusText}`.trim());
97
+ try {
98
+ if (a(Number(n.headers.get("content-length"))), !Number.isFinite(o) || !n.body) {
99
+ const i = new Uint8Array(await f(n.arrayBuffer(), r));
100
+ return a(i.length), i;
101
+ }
102
+ const m = n.body.getReader();
103
+ try {
104
+ const i = [];
105
+ let p = 0;
106
+ for (; ; ) {
107
+ const { value: h, done: j } = await f(m.read(), r);
108
+ if (j) break;
109
+ p += h.length, a(p), i.push(h);
110
+ }
111
+ const l = new Uint8Array(p);
112
+ let g = 0;
113
+ for (const h of i)
114
+ l.set(h, g), g += h.length;
115
+ return l;
116
+ } finally {
117
+ await m.cancel().catch(() => {
118
+ }), m.releaseLock();
119
+ }
120
+ } catch (m) {
121
+ throw await ((s = n.body) == null ? void 0 : s.cancel().catch(() => {
122
+ })), m;
123
+ }
124
+ }
125
+ a(e.length);
126
+ const c = new TextEncoder().encode(e);
127
+ return a(c.length), c;
128
+ }
129
+ throw new Error("Unsupported conversion source type.");
130
+ }
131
+ function gt(e) {
132
+ return typeof e == "object" && e !== null && "arrayBuffer" in e && typeof e.arrayBuffer == "function";
133
+ }
134
+ async function xt(e) {
135
+ var r;
136
+ if (((r = e.headers.get("content-type")) == null ? void 0 : r.split(";", 1)[0]) !== "application/wasm+gzip") return e;
137
+ if (typeof DecompressionStream < "u" && e.body)
138
+ return new Response(e.body.pipeThrough(new DecompressionStream("gzip")), {
139
+ headers: { "content-type": "application/wasm" }
140
+ });
141
+ const t = Ft(new Uint8Array(await e.arrayBuffer()));
142
+ return new Response(t, { headers: { "content-type": "application/wasm" } });
143
+ }
144
+ function B(e) {
145
+ const t = D(() => tt(e.wasm, e.fetch));
146
+ return async (r) => {
147
+ const o = r.signal;
148
+ d(o);
149
+ const a = new ot({
150
+ args: r.args,
151
+ files: r.files,
152
+ captureStdio: r.captureStdio
153
+ }), s = await f(t(), o);
154
+ d(o);
155
+ const c = await f(WebAssembly.instantiate(s, {
156
+ wasi_snapshot_preview1: a.imports
157
+ }), o);
158
+ d(o), a.setInstance(c);
159
+ let n = 0;
160
+ try {
161
+ c.exports._start();
162
+ } catch (m) {
163
+ if (m instanceof rt)
164
+ n = m.code;
165
+ else
166
+ throw m;
167
+ }
168
+ return {
169
+ exitCode: n,
170
+ ...r.captureStdio ? { stdout: a.readStdio(1), stderr: a.readStdio(2) } : {},
171
+ files: Object.fromEntries((r.readFiles ?? []).flatMap((m) => {
172
+ const i = a.readFileIfPresent(m);
173
+ return i ? [[m, i]] : [];
174
+ }))
175
+ };
176
+ };
177
+ }
178
+ async function tt(e, t = globalThis.fetch) {
179
+ const r = typeof e == "function" ? await e() : await e;
180
+ if (r instanceof WebAssembly.Module)
181
+ return r;
182
+ if (typeof r == "string" || ft(r)) {
183
+ if (!t)
184
+ throw new Error("A fetch implementation is required to load converter WASM from a URL.");
185
+ return W(await t(String(r)));
186
+ }
187
+ return typeof Response < "u" && r instanceof Response ? W(r) : WebAssembly.compile(r);
188
+ }
189
+ function ft(e) {
190
+ return typeof URL < "u" && e instanceof URL;
191
+ }
192
+ async function W(e) {
193
+ var r;
194
+ if (!e.ok)
195
+ throw new Error(`Failed to fetch converter WASM: ${e.status} ${e.statusText}`.trim());
196
+ const t = await xt(e);
197
+ return typeof WebAssembly.compileStreaming == "function" && ((r = t.headers.get("content-type")) == null ? void 0 : r.split(";", 1)[0]) === "application/wasm" ? WebAssembly.compileStreaming(t) : WebAssembly.compile(await t.arrayBuffer());
198
+ }
199
+ class rt extends Error {
200
+ constructor(t) {
201
+ super(`WASI exited with code ${t}`), this.code = t;
202
+ }
203
+ }
204
+ const u = 0, x = 8, ht = 20, z = 28, S = 31, C = 44, P = 54, M = 55, et = 2, N = 3, O = 4, G = 1, wt = 2, yt = 4, bt = 8, H = 1;
205
+ class ot {
206
+ constructor(t) {
207
+ y(this, "imports", {
208
+ args_get: (t, r) => this.argsGet(t, r),
209
+ args_sizes_get: (t, r) => this.argsSizesGet(t, r),
210
+ clock_time_get: (t, r, o) => this.clockTimeGet(o),
211
+ environ_get: (t, r) => u,
212
+ environ_sizes_get: (t, r) => this.environSizesGet(t, r),
213
+ fd_close: (t) => this.fdClose(t),
214
+ fd_fdstat_get: (t, r) => this.fdFdstatGet(t, r),
215
+ fd_fdstat_set_flags: (t, r) => u,
216
+ fd_filestat_get: (t, r) => this.fdFilestatGet(t, r),
217
+ fd_pread: (t, r, o, a, s) => this.fdRead(t, r, o, s, Number(a), !1),
218
+ fd_prestat_dir_name: (t, r, o) => this.fdPrestatDirName(t, r, o),
219
+ fd_prestat_get: (t, r) => this.fdPrestatGet(t, r),
220
+ fd_read: (t, r, o, a) => this.fdRead(t, r, o, a),
221
+ fd_seek: (t, r, o, a) => this.fdSeek(t, r, o, a),
222
+ fd_tell: (t, r) => this.fdTell(t, r),
223
+ fd_write: (t, r, o, a) => this.fdWrite(t, r, o, a),
224
+ path_create_directory: (t, r, o) => this.pathCreateDirectory(t, r, o),
225
+ path_filestat_get: (t, r, o, a, s) => this.pathFilestatGet(t, o, a, s),
226
+ path_open: (t, r, o, a, s, c, n, m, i) => this.pathOpen(t, o, a, s, m, i),
227
+ path_remove_directory: (t, r, o) => this.pathRemoveDirectory(t, r, o),
228
+ path_unlink_file: (t, r, o) => this.pathUnlinkFile(t, r, o),
229
+ poll_oneoff: (t, r, o, a) => this.pollOneoff(a),
230
+ proc_exit: (t) => {
231
+ throw new rt(t);
232
+ },
233
+ random_get: (t, r) => this.randomGet(t, r),
234
+ sched_yield: () => u
235
+ });
236
+ y(this, "instance");
237
+ y(this, "captureStdio");
238
+ y(this, "stdio", { 1: [], 2: [] });
239
+ y(this, "args");
240
+ y(this, "files", /* @__PURE__ */ new Map());
241
+ y(this, "dirs", /* @__PURE__ */ new Set(["/", "/work"]));
242
+ y(this, "fds", /* @__PURE__ */ new Map([
243
+ [0, { kind: "stdio", fd: 0, position: 0 }],
244
+ [1, { kind: "stdio", fd: 1, position: 0 }],
245
+ [2, { kind: "stdio", fd: 2, position: 0 }],
246
+ [3, { kind: "dir", path: "/work", position: 0 }]
247
+ ]));
248
+ y(this, "nextFd", 4);
249
+ this.args = t.args, this.captureStdio = t.captureStdio ?? !1;
250
+ for (const [r, o] of Object.entries(t.files))
251
+ this.writeInitialFile(r, o);
252
+ }
253
+ setInstance(t) {
254
+ this.instance = t;
255
+ }
256
+ readStdio(t) {
257
+ return new TextDecoder().decode(new Uint8Array(this.stdio[t]));
258
+ }
259
+ readFile(t) {
260
+ const r = this.files.get(_(t));
261
+ if (!r)
262
+ throw new Error(`WASM file was not written: ${t}`);
263
+ const o = new Uint8Array(r.byteLength);
264
+ return o.set(r), o;
265
+ }
266
+ readFileIfPresent(t) {
267
+ return this.files.has(_(t)) ? this.readFile(t) : void 0;
268
+ }
269
+ get memory() {
270
+ var r;
271
+ const t = (r = this.instance) == null ? void 0 : r.exports.memory;
272
+ if (!(t instanceof WebAssembly.Memory))
273
+ throw new Error("WASM instance did not export memory.");
274
+ return t;
275
+ }
276
+ get bytes() {
277
+ return new Uint8Array(this.memory.buffer);
278
+ }
279
+ get view() {
280
+ return new DataView(this.memory.buffer);
281
+ }
282
+ argsSizesGet(t, r) {
283
+ return this.view.setUint32(t, this.args.length, !0), this.view.setUint32(r, vt(this.args), !0), u;
284
+ }
285
+ argsGet(t, r) {
286
+ return this.writeStringList(this.args, t, r);
287
+ }
288
+ environSizesGet(t, r) {
289
+ return this.view.setUint32(t, 0, !0), this.view.setUint32(r, 0, !0), u;
290
+ }
291
+ clockTimeGet(t) {
292
+ return this.view.setBigUint64(t, BigInt(Date.now()) * 1000000n, !0), u;
293
+ }
294
+ fdClose(t) {
295
+ return t <= 3 || this.fds.delete(t) ? u : x;
296
+ }
297
+ fdFdstatGet(t, r) {
298
+ const o = this.fds.get(t);
299
+ return o ? (this.bytes.fill(0, r, r + 24), this.bytes[r] = kt(o), this.view.setBigUint64(r + 8, 0xffffffffffffffffn, !0), this.view.setBigUint64(r + 16, 0xffffffffffffffffn, !0), u) : x;
300
+ }
301
+ fdFilestatGet(t, r) {
302
+ var a;
303
+ const o = this.fds.get(t);
304
+ return o ? o.kind === "file" ? (this.writeFilestat(r, O, ((a = this.files.get(o.path)) == null ? void 0 : a.byteLength) ?? 0), u) : o.kind === "dir" ? (this.writeFilestat(r, N, 0), u) : (this.writeFilestat(r, et, 0), u) : x;
305
+ }
306
+ fdPrestatGet(t, r) {
307
+ const o = this.fds.get(t);
308
+ return !o || o.kind !== "dir" || o.path !== "/work" ? x : (this.bytes.fill(0, r, r + 8), this.view.setUint32(r + 4, o.path.length, !0), u);
309
+ }
310
+ fdPrestatDirName(t, r, o) {
311
+ const a = this.fds.get(t);
312
+ if (!a || a.kind !== "dir")
313
+ return x;
314
+ const s = new TextEncoder().encode(a.path);
315
+ return this.bytes.set(s.subarray(0, o), r), u;
316
+ }
317
+ fdRead(t, r, o, a, s, c = !0) {
318
+ const n = this.fds.get(t);
319
+ if (!n)
320
+ return x;
321
+ if (n.kind !== "file")
322
+ return this.view.setUint32(a, 0, !0), n.kind === "dir" ? S : u;
323
+ const m = this.files.get(n.path) ?? new Uint8Array();
324
+ let i = s ?? n.position, p = 0;
325
+ for (const [l, g] of this.iovs(r, o)) {
326
+ const h = m.subarray(i, i + g);
327
+ if (this.bytes.set(h, l), i += h.byteLength, p += h.byteLength, h.byteLength < g)
328
+ break;
329
+ }
330
+ return c && s === void 0 && (n.position = i), this.view.setUint32(a, p, !0), u;
331
+ }
332
+ fdSeek(t, r, o, a) {
333
+ var m;
334
+ const s = this.fds.get(t);
335
+ if (!s || s.kind !== "file")
336
+ return (s == null ? void 0 : s.kind) === "dir" ? S : x;
337
+ if (o !== 0 && o !== 1 && o !== 2) return z;
338
+ const n = (o === 0 ? 0 : o === 1 ? s.position : o === 2 ? ((m = this.files.get(s.path)) == null ? void 0 : m.byteLength) ?? 0 : -1) + Number(r);
339
+ return !Number.isSafeInteger(n) || n < 0 ? z : (s.position = n, this.view.setBigUint64(a, BigInt(n), !0), u);
340
+ }
341
+ fdTell(t, r) {
342
+ const o = this.fds.get(t);
343
+ return !o || o.kind !== "file" ? (o == null ? void 0 : o.kind) === "dir" ? S : x : (this.view.setBigUint64(r, BigInt(o.position), !0), u);
344
+ }
345
+ fdWrite(t, r, o, a) {
346
+ const s = this.fds.get(t);
347
+ if (!s)
348
+ return x;
349
+ let c = 0;
350
+ if (s.kind === "stdio") {
351
+ for (const [n, m] of this.iovs(r, o)) {
352
+ const i = this.captureStdio ? this.stdio[s.fd] : void 0;
353
+ if (i) {
354
+ const p = n + Math.min(m, Math.max(0, 1048576 - i.length)), l = this.bytes;
355
+ for (let g = n; g < p; g++) i.push(l[g]);
356
+ }
357
+ c += m;
358
+ }
359
+ return this.view.setUint32(a, c, !0), u;
360
+ }
361
+ if (s.kind !== "file")
362
+ return S;
363
+ for (const [n, m] of this.iovs(r, o)) {
364
+ const i = this.bytes.subarray(n, n + m);
365
+ this.writeFileChunk(s, i), c += m;
366
+ }
367
+ return this.view.setUint32(a, c, !0), u;
368
+ }
369
+ pathCreateDirectory(t, r, o) {
370
+ const a = this.readPath(t, r, o);
371
+ return a ? (this.ensureParentDir(a), this.files.has(a) ? P : (this.dirs.add(a), u)) : x;
372
+ }
373
+ pathFilestatGet(t, r, o, a) {
374
+ var c;
375
+ const s = this.readPath(t, r, o);
376
+ return s ? this.files.has(s) ? (this.writeFilestat(a, O, ((c = this.files.get(s)) == null ? void 0 : c.byteLength) ?? 0), u) : this.dirs.has(s) ? (this.writeFilestat(a, N, 0), u) : C : x;
377
+ }
378
+ pathOpen(t, r, o, a, s, c) {
379
+ var i;
380
+ const n = this.readPath(t, r, o);
381
+ if (!n)
382
+ return x;
383
+ if (a & G && a & yt && (this.files.has(n) || this.dirs.has(n)))
384
+ return ht;
385
+ if (!!(a & wt))
386
+ return this.dirs.has(n) ? this.openDescriptor({ kind: "dir", path: n, position: 0 }, c) : this.files.has(n) ? P : C;
387
+ if (this.files.has(n))
388
+ a & bt && this.files.set(n, new Uint8Array());
389
+ else {
390
+ if (!(a & G))
391
+ return this.dirs.has(n) ? S : C;
392
+ this.ensureParentDir(n), this.files.set(n, new Uint8Array());
393
+ }
394
+ return this.openDescriptor(
395
+ {
396
+ kind: "file",
397
+ path: n,
398
+ position: s & H ? ((i = this.files.get(n)) == null ? void 0 : i.byteLength) ?? 0 : 0,
399
+ append: !!(s & H)
400
+ },
401
+ c
402
+ );
403
+ }
404
+ pathRemoveDirectory(t, r, o) {
405
+ const a = this.readPath(t, r, o);
406
+ if (!a)
407
+ return x;
408
+ if (a === "/" || a === "/work")
409
+ return M;
410
+ for (const s of this.dirs)
411
+ if (s !== a && I(s) === a)
412
+ return M;
413
+ for (const s of this.files.keys())
414
+ if (I(s) === a)
415
+ return M;
416
+ return this.dirs.delete(a) ? u : C;
417
+ }
418
+ pathUnlinkFile(t, r, o) {
419
+ const a = this.readPath(t, r, o);
420
+ return a ? this.files.delete(a) ? u : C : x;
421
+ }
422
+ pollOneoff(t) {
423
+ return this.view.setUint32(t, 0, !0), u;
424
+ }
425
+ randomGet(t, r) {
426
+ const o = this.bytes.subarray(t, t + r), a = globalThis.crypto;
427
+ if (a != null && a.getRandomValues)
428
+ a.getRandomValues(o);
429
+ else
430
+ for (let s = 0; s < o.length; s += 1)
431
+ o[s] = Math.floor(Math.random() * 256);
432
+ return u;
433
+ }
434
+ writeStringList(t, r, o) {
435
+ let a = o;
436
+ for (let s = 0; s < t.length; s += 1) {
437
+ const c = new TextEncoder().encode(t[s]);
438
+ this.view.setUint32(r + s * 4, a, !0), this.bytes.set(c, a), this.bytes[a + c.byteLength] = 0, a += c.byteLength + 1;
439
+ }
440
+ return u;
441
+ }
442
+ iovs(t, r) {
443
+ const o = [];
444
+ for (let a = 0; a < r; a += 1) {
445
+ const s = t + a * 8;
446
+ o.push([this.view.getUint32(s, !0), this.view.getUint32(s + 4, !0)]);
447
+ }
448
+ return o;
449
+ }
450
+ readPath(t, r, o) {
451
+ const a = this.fds.get(t);
452
+ if (!a || a.kind !== "dir")
453
+ return null;
454
+ const s = new TextDecoder().decode(this.bytes.subarray(r, r + o));
455
+ return jt(a.path, s);
456
+ }
457
+ openDescriptor(t, r) {
458
+ const o = this.nextFd++;
459
+ return this.fds.set(o, t), this.view.setUint32(r, o, !0), u;
460
+ }
461
+ writeFilestat(t, r, o) {
462
+ this.bytes.fill(0, t, t + 64), this.bytes[t + 16] = r, this.view.setBigUint64(t + 24, 1n, !0), this.view.setBigUint64(t + 32, BigInt(o), !0);
463
+ }
464
+ writeInitialFile(t, r) {
465
+ const o = _(t);
466
+ this.ensureParentDir(o);
467
+ const a = new Uint8Array(r.byteLength);
468
+ a.set(r), this.files.set(o, a);
469
+ }
470
+ ensureParentDir(t) {
471
+ const r = I(t);
472
+ r === t || this.dirs.has(r) || (this.ensureParentDir(r), this.dirs.add(r));
473
+ }
474
+ writeFileChunk(t, r) {
475
+ if (!r.byteLength) return;
476
+ const o = this.files.get(t.path) ?? new Uint8Array(), a = t.append ? o.byteLength : t.position, s = Math.max(o.byteLength, a + r.byteLength);
477
+ let c;
478
+ if (s <= o.buffer.byteLength)
479
+ c = new Uint8Array(o.buffer, 0, s);
480
+ else {
481
+ const n = new Uint8Array(Math.max(s, o.buffer.byteLength * 2));
482
+ n.set(o), c = n.subarray(0, s);
483
+ }
484
+ c.set(r, a), this.files.set(t.path, c), t.position = a + r.byteLength;
485
+ }
486
+ }
487
+ function vt(e) {
488
+ return e.reduce((t, r) => t + new TextEncoder().encode(r).byteLength + 1, 0);
489
+ }
490
+ function kt(e) {
491
+ switch (e.kind) {
492
+ case "dir":
493
+ return N;
494
+ case "file":
495
+ return O;
496
+ default:
497
+ return et;
498
+ }
499
+ }
500
+ function jt(e, t) {
501
+ return t.startsWith("/") ? _(t) : _(`${e}/${t}`);
502
+ }
503
+ function _(e) {
504
+ const t = [];
505
+ for (const r of e.replace(/\\/g, "/").split("/"))
506
+ if (!(!r || r === ".")) {
507
+ if (r === "..") {
508
+ t.pop();
509
+ continue;
510
+ }
511
+ t.push(r);
512
+ }
513
+ return `/${t.join("/")}`;
514
+ }
515
+ function I(e) {
516
+ const t = _(e);
517
+ if (t === "/")
518
+ return "/";
519
+ const r = t.lastIndexOf("/");
520
+ return r <= 0 ? "/" : t.slice(0, r);
521
+ }
522
+ const at = [
523
+ {
524
+ sourceFormat: "docx",
525
+ targetFormat: "docx"
526
+ },
527
+ {
528
+ sourceFormat: "xlsx",
529
+ targetFormat: "xlsx"
530
+ },
531
+ {
532
+ sourceFormat: "pptx",
533
+ targetFormat: "pptx"
534
+ },
535
+ {
536
+ sourceFormat: "ppt",
537
+ targetFormat: "pptx"
538
+ },
539
+ {
540
+ sourceFormat: "pps",
541
+ targetFormat: "pptx"
542
+ },
543
+ {
544
+ sourceFormat: "pot",
545
+ targetFormat: "pptx"
546
+ },
547
+ {
548
+ sourceFormat: "pptm",
549
+ targetFormat: "pptx"
550
+ },
551
+ {
552
+ sourceFormat: "ppsx",
553
+ targetFormat: "pptx"
554
+ },
555
+ {
556
+ sourceFormat: "ppsm",
557
+ targetFormat: "pptx"
558
+ },
559
+ {
560
+ sourceFormat: "potx",
561
+ targetFormat: "pptx"
562
+ },
563
+ {
564
+ sourceFormat: "potm",
565
+ targetFormat: "pptx"
566
+ },
567
+ {
568
+ sourceFormat: "dps",
569
+ targetFormat: "pptx"
570
+ },
571
+ {
572
+ sourceFormat: "dpt",
573
+ targetFormat: "pptx"
574
+ },
575
+ {
576
+ sourceFormat: "odp",
577
+ targetFormat: "pptx"
578
+ },
579
+ {
580
+ sourceFormat: "otp",
581
+ targetFormat: "pptx"
582
+ },
583
+ {
584
+ sourceFormat: "fodp",
585
+ targetFormat: "pptx"
586
+ },
587
+ {
588
+ sourceFormat: "sxi",
589
+ targetFormat: "pptx"
590
+ },
591
+ {
592
+ sourceFormat: "sti",
593
+ targetFormat: "pptx"
594
+ },
595
+ {
596
+ sourceFormat: "odg",
597
+ targetFormat: "pptx"
598
+ },
599
+ {
600
+ sourceFormat: "otg",
601
+ targetFormat: "pptx"
602
+ },
603
+ {
604
+ sourceFormat: "fodg",
605
+ targetFormat: "pptx"
606
+ },
607
+ {
608
+ sourceFormat: "sxd",
609
+ targetFormat: "pptx"
610
+ },
611
+ {
612
+ sourceFormat: "std",
613
+ targetFormat: "pptx"
614
+ },
615
+ {
616
+ sourceFormat: "doc",
617
+ targetFormat: "docx"
618
+ },
619
+ {
620
+ sourceFormat: "docm",
621
+ targetFormat: "docx"
622
+ },
623
+ {
624
+ sourceFormat: "dot",
625
+ targetFormat: "docx"
626
+ },
627
+ {
628
+ sourceFormat: "dotx",
629
+ targetFormat: "docx"
630
+ },
631
+ {
632
+ sourceFormat: "dotm",
633
+ targetFormat: "docx"
634
+ },
635
+ {
636
+ sourceFormat: "wps",
637
+ targetFormat: "docx"
638
+ },
639
+ {
640
+ sourceFormat: "wpt",
641
+ targetFormat: "docx"
642
+ },
643
+ {
644
+ sourceFormat: "rtf",
645
+ targetFormat: "docx"
646
+ },
647
+ {
648
+ sourceFormat: "odt",
649
+ targetFormat: "docx"
650
+ },
651
+ {
652
+ sourceFormat: "ott",
653
+ targetFormat: "docx"
654
+ },
655
+ {
656
+ sourceFormat: "fodt",
657
+ targetFormat: "docx"
658
+ },
659
+ {
660
+ sourceFormat: "sxw",
661
+ targetFormat: "docx"
662
+ },
663
+ {
664
+ sourceFormat: "stw",
665
+ targetFormat: "docx"
666
+ },
667
+ {
668
+ sourceFormat: "txt",
669
+ targetFormat: "docx"
670
+ },
671
+ {
672
+ sourceFormat: "text",
673
+ targetFormat: "docx"
674
+ },
675
+ {
676
+ sourceFormat: "md",
677
+ targetFormat: "docx"
678
+ },
679
+ {
680
+ sourceFormat: "markdown",
681
+ targetFormat: "docx"
682
+ },
683
+ {
684
+ sourceFormat: "mkd",
685
+ targetFormat: "docx"
686
+ },
687
+ {
688
+ sourceFormat: "mkdn",
689
+ targetFormat: "docx"
690
+ },
691
+ {
692
+ sourceFormat: "mdown",
693
+ targetFormat: "docx"
694
+ },
695
+ {
696
+ sourceFormat: "html",
697
+ targetFormat: "docx"
698
+ },
699
+ {
700
+ sourceFormat: "htm",
701
+ targetFormat: "docx"
702
+ },
703
+ {
704
+ sourceFormat: "shtml",
705
+ targetFormat: "docx"
706
+ },
707
+ {
708
+ sourceFormat: "xhtml",
709
+ targetFormat: "docx"
710
+ },
711
+ {
712
+ sourceFormat: "xht",
713
+ targetFormat: "docx"
714
+ },
715
+ {
716
+ sourceFormat: "xhtm",
717
+ targetFormat: "docx"
718
+ },
719
+ {
720
+ sourceFormat: "epub",
721
+ targetFormat: "docx"
722
+ },
723
+ {
724
+ sourceFormat: "fb2",
725
+ targetFormat: "docx"
726
+ },
727
+ {
728
+ sourceFormat: "xml",
729
+ targetFormat: "docx"
730
+ },
731
+ {
732
+ sourceFormat: "rss",
733
+ targetFormat: "docx"
734
+ },
735
+ {
736
+ sourceFormat: "atom",
737
+ targetFormat: "docx"
738
+ },
739
+ {
740
+ sourceFormat: "kml",
741
+ targetFormat: "docx"
742
+ },
743
+ {
744
+ sourceFormat: "gpx",
745
+ targetFormat: "docx"
746
+ },
747
+ {
748
+ sourceFormat: "ttml",
749
+ targetFormat: "docx"
750
+ },
751
+ {
752
+ sourceFormat: "dfxp",
753
+ targetFormat: "docx"
754
+ },
755
+ {
756
+ sourceFormat: "xsd",
757
+ targetFormat: "docx"
758
+ },
759
+ {
760
+ sourceFormat: "xsl",
761
+ targetFormat: "docx"
762
+ },
763
+ {
764
+ sourceFormat: "xslt",
765
+ targetFormat: "docx"
766
+ },
767
+ {
768
+ sourceFormat: "wsdl",
769
+ targetFormat: "docx"
770
+ },
771
+ {
772
+ sourceFormat: "plist",
773
+ targetFormat: "docx"
774
+ },
775
+ {
776
+ sourceFormat: "pom",
777
+ targetFormat: "docx"
778
+ },
779
+ {
780
+ sourceFormat: "yaml",
781
+ targetFormat: "docx"
782
+ },
783
+ {
784
+ sourceFormat: "yml",
785
+ targetFormat: "docx"
786
+ },
787
+ {
788
+ sourceFormat: "toml",
789
+ targetFormat: "docx"
790
+ },
791
+ {
792
+ sourceFormat: "ini",
793
+ targetFormat: "docx"
794
+ },
795
+ {
796
+ sourceFormat: "log",
797
+ targetFormat: "docx"
798
+ },
799
+ {
800
+ sourceFormat: "rst",
801
+ targetFormat: "docx"
802
+ },
803
+ {
804
+ sourceFormat: "rest",
805
+ targetFormat: "docx"
806
+ },
807
+ {
808
+ sourceFormat: "adoc",
809
+ targetFormat: "docx"
810
+ },
811
+ {
812
+ sourceFormat: "asciidoc",
813
+ targetFormat: "docx"
814
+ },
815
+ {
816
+ sourceFormat: "asc",
817
+ targetFormat: "docx"
818
+ },
819
+ {
820
+ sourceFormat: "tex",
821
+ targetFormat: "docx"
822
+ },
823
+ {
824
+ sourceFormat: "latex",
825
+ targetFormat: "docx"
826
+ },
827
+ {
828
+ sourceFormat: "ltx",
829
+ targetFormat: "docx"
830
+ },
831
+ {
832
+ sourceFormat: "sty",
833
+ targetFormat: "docx"
834
+ },
835
+ {
836
+ sourceFormat: "cls",
837
+ targetFormat: "docx"
838
+ },
839
+ {
840
+ sourceFormat: "properties",
841
+ targetFormat: "docx"
842
+ },
843
+ {
844
+ sourceFormat: "env",
845
+ targetFormat: "docx"
846
+ },
847
+ {
848
+ sourceFormat: "conf",
849
+ targetFormat: "docx"
850
+ },
851
+ {
852
+ sourceFormat: "config",
853
+ targetFormat: "docx"
854
+ },
855
+ {
856
+ sourceFormat: "cfg",
857
+ targetFormat: "docx"
858
+ },
859
+ {
860
+ sourceFormat: "cnf",
861
+ targetFormat: "docx"
862
+ },
863
+ {
864
+ sourceFormat: "sql",
865
+ targetFormat: "docx"
866
+ },
867
+ {
868
+ sourceFormat: "js",
869
+ targetFormat: "docx"
870
+ },
871
+ {
872
+ sourceFormat: "jsx",
873
+ targetFormat: "docx"
874
+ },
875
+ {
876
+ sourceFormat: "mjs",
877
+ targetFormat: "docx"
878
+ },
879
+ {
880
+ sourceFormat: "cjs",
881
+ targetFormat: "docx"
882
+ },
883
+ {
884
+ sourceFormat: "ts",
885
+ targetFormat: "docx"
886
+ },
887
+ {
888
+ sourceFormat: "tsx",
889
+ targetFormat: "docx"
890
+ },
891
+ {
892
+ sourceFormat: "mts",
893
+ targetFormat: "docx"
894
+ },
895
+ {
896
+ sourceFormat: "cts",
897
+ targetFormat: "docx"
898
+ },
899
+ {
900
+ sourceFormat: "vue",
901
+ targetFormat: "docx"
902
+ },
903
+ {
904
+ sourceFormat: "css",
905
+ targetFormat: "docx"
906
+ },
907
+ {
908
+ sourceFormat: "scss",
909
+ targetFormat: "docx"
910
+ },
911
+ {
912
+ sourceFormat: "sass",
913
+ targetFormat: "docx"
914
+ },
915
+ {
916
+ sourceFormat: "less",
917
+ targetFormat: "docx"
918
+ },
919
+ {
920
+ sourceFormat: "c",
921
+ targetFormat: "docx"
922
+ },
923
+ {
924
+ sourceFormat: "cpp",
925
+ targetFormat: "docx"
926
+ },
927
+ {
928
+ sourceFormat: "cc",
929
+ targetFormat: "docx"
930
+ },
931
+ {
932
+ sourceFormat: "cxx",
933
+ targetFormat: "docx"
934
+ },
935
+ {
936
+ sourceFormat: "h",
937
+ targetFormat: "docx"
938
+ },
939
+ {
940
+ sourceFormat: "hpp",
941
+ targetFormat: "docx"
942
+ },
943
+ {
944
+ sourceFormat: "hh",
945
+ targetFormat: "docx"
946
+ },
947
+ {
948
+ sourceFormat: "hxx",
949
+ targetFormat: "docx"
950
+ },
951
+ {
952
+ sourceFormat: "cs",
953
+ targetFormat: "docx"
954
+ },
955
+ {
956
+ sourceFormat: "go",
957
+ targetFormat: "docx"
958
+ },
959
+ {
960
+ sourceFormat: "java",
961
+ targetFormat: "docx"
962
+ },
963
+ {
964
+ sourceFormat: "kt",
965
+ targetFormat: "docx"
966
+ },
967
+ {
968
+ sourceFormat: "kts",
969
+ targetFormat: "docx"
970
+ },
971
+ {
972
+ sourceFormat: "lua",
973
+ targetFormat: "docx"
974
+ },
975
+ {
976
+ sourceFormat: "php",
977
+ targetFormat: "docx"
978
+ },
979
+ {
980
+ sourceFormat: "py",
981
+ targetFormat: "docx"
982
+ },
983
+ {
984
+ sourceFormat: "rb",
985
+ targetFormat: "docx"
986
+ },
987
+ {
988
+ sourceFormat: "rs",
989
+ targetFormat: "docx"
990
+ },
991
+ {
992
+ sourceFormat: "sh",
993
+ targetFormat: "docx"
994
+ },
995
+ {
996
+ sourceFormat: "bash",
997
+ targetFormat: "docx"
998
+ },
999
+ {
1000
+ sourceFormat: "bat",
1001
+ targetFormat: "docx"
1002
+ },
1003
+ {
1004
+ sourceFormat: "cmd",
1005
+ targetFormat: "docx"
1006
+ },
1007
+ {
1008
+ sourceFormat: "ps1",
1009
+ targetFormat: "docx"
1010
+ },
1011
+ {
1012
+ sourceFormat: "swift",
1013
+ targetFormat: "docx"
1014
+ },
1015
+ {
1016
+ sourceFormat: "jsonc",
1017
+ targetFormat: "docx"
1018
+ },
1019
+ {
1020
+ sourceFormat: "json5",
1021
+ targetFormat: "docx"
1022
+ },
1023
+ {
1024
+ sourceFormat: "ipynb",
1025
+ targetFormat: "docx"
1026
+ },
1027
+ {
1028
+ sourceFormat: "gql",
1029
+ targetFormat: "docx"
1030
+ },
1031
+ {
1032
+ sourceFormat: "graphql",
1033
+ targetFormat: "docx"
1034
+ },
1035
+ {
1036
+ sourceFormat: "proto",
1037
+ targetFormat: "docx"
1038
+ },
1039
+ {
1040
+ sourceFormat: "diff",
1041
+ targetFormat: "docx"
1042
+ },
1043
+ {
1044
+ sourceFormat: "patch",
1045
+ targetFormat: "docx"
1046
+ },
1047
+ {
1048
+ sourceFormat: "gitignore",
1049
+ targetFormat: "docx"
1050
+ },
1051
+ {
1052
+ sourceFormat: "dockerignore",
1053
+ targetFormat: "docx"
1054
+ },
1055
+ {
1056
+ sourceFormat: "editorconfig",
1057
+ targetFormat: "docx"
1058
+ },
1059
+ {
1060
+ sourceFormat: "r",
1061
+ targetFormat: "docx"
1062
+ },
1063
+ {
1064
+ sourceFormat: "dart",
1065
+ targetFormat: "docx"
1066
+ },
1067
+ {
1068
+ sourceFormat: "scala",
1069
+ targetFormat: "docx"
1070
+ },
1071
+ {
1072
+ sourceFormat: "groovy",
1073
+ targetFormat: "docx"
1074
+ },
1075
+ {
1076
+ sourceFormat: "gradle",
1077
+ targetFormat: "docx"
1078
+ },
1079
+ {
1080
+ sourceFormat: "pl",
1081
+ targetFormat: "docx"
1082
+ },
1083
+ {
1084
+ sourceFormat: "ex",
1085
+ targetFormat: "docx"
1086
+ },
1087
+ {
1088
+ sourceFormat: "erl",
1089
+ targetFormat: "docx"
1090
+ },
1091
+ {
1092
+ sourceFormat: "fs",
1093
+ targetFormat: "docx"
1094
+ },
1095
+ {
1096
+ sourceFormat: "fsi",
1097
+ targetFormat: "docx"
1098
+ },
1099
+ {
1100
+ sourceFormat: "fsx",
1101
+ targetFormat: "docx"
1102
+ },
1103
+ {
1104
+ sourceFormat: "vb",
1105
+ targetFormat: "docx"
1106
+ },
1107
+ {
1108
+ sourceFormat: "clj",
1109
+ targetFormat: "docx"
1110
+ },
1111
+ {
1112
+ sourceFormat: "hs",
1113
+ targetFormat: "docx"
1114
+ },
1115
+ {
1116
+ sourceFormat: "jl",
1117
+ targetFormat: "docx"
1118
+ },
1119
+ {
1120
+ sourceFormat: "zig",
1121
+ targetFormat: "docx"
1122
+ },
1123
+ {
1124
+ sourceFormat: "m",
1125
+ targetFormat: "docx"
1126
+ },
1127
+ {
1128
+ sourceFormat: "matlab",
1129
+ targetFormat: "docx"
1130
+ },
1131
+ {
1132
+ sourceFormat: "svelte",
1133
+ targetFormat: "docx"
1134
+ },
1135
+ {
1136
+ sourceFormat: "astro",
1137
+ targetFormat: "docx"
1138
+ },
1139
+ {
1140
+ sourceFormat: "mdx",
1141
+ targetFormat: "docx"
1142
+ },
1143
+ {
1144
+ sourceFormat: "tf",
1145
+ targetFormat: "docx"
1146
+ },
1147
+ {
1148
+ sourceFormat: "tfvars",
1149
+ targetFormat: "docx"
1150
+ },
1151
+ {
1152
+ sourceFormat: "hcl",
1153
+ targetFormat: "docx"
1154
+ },
1155
+ {
1156
+ sourceFormat: "rego",
1157
+ targetFormat: "docx"
1158
+ },
1159
+ {
1160
+ sourceFormat: "bicep",
1161
+ targetFormat: "docx"
1162
+ },
1163
+ {
1164
+ sourceFormat: "prisma",
1165
+ targetFormat: "docx"
1166
+ },
1167
+ {
1168
+ sourceFormat: "dockerfile",
1169
+ targetFormat: "docx"
1170
+ },
1171
+ {
1172
+ sourceFormat: "cmake",
1173
+ targetFormat: "docx"
1174
+ },
1175
+ {
1176
+ sourceFormat: "make",
1177
+ targetFormat: "docx"
1178
+ },
1179
+ {
1180
+ sourceFormat: "mk",
1181
+ targetFormat: "docx"
1182
+ },
1183
+ {
1184
+ sourceFormat: "zsh",
1185
+ targetFormat: "docx"
1186
+ },
1187
+ {
1188
+ sourceFormat: "fish",
1189
+ targetFormat: "docx"
1190
+ },
1191
+ {
1192
+ sourceFormat: "csproj",
1193
+ targetFormat: "docx"
1194
+ },
1195
+ {
1196
+ sourceFormat: "vbproj",
1197
+ targetFormat: "docx"
1198
+ },
1199
+ {
1200
+ sourceFormat: "fsproj",
1201
+ targetFormat: "docx"
1202
+ },
1203
+ {
1204
+ sourceFormat: "props",
1205
+ targetFormat: "docx"
1206
+ },
1207
+ {
1208
+ sourceFormat: "targets",
1209
+ targetFormat: "docx"
1210
+ },
1211
+ {
1212
+ sourceFormat: "sln",
1213
+ targetFormat: "docx"
1214
+ },
1215
+ {
1216
+ sourceFormat: "cshtml",
1217
+ targetFormat: "docx"
1218
+ },
1219
+ {
1220
+ sourceFormat: "razor",
1221
+ targetFormat: "docx"
1222
+ },
1223
+ {
1224
+ sourceFormat: "mustache",
1225
+ targetFormat: "docx"
1226
+ },
1227
+ {
1228
+ sourceFormat: "hbs",
1229
+ targetFormat: "docx"
1230
+ },
1231
+ {
1232
+ sourceFormat: "liquid",
1233
+ targetFormat: "docx"
1234
+ },
1235
+ {
1236
+ sourceFormat: "jinja",
1237
+ targetFormat: "docx"
1238
+ },
1239
+ {
1240
+ sourceFormat: "twig",
1241
+ targetFormat: "docx"
1242
+ },
1243
+ {
1244
+ sourceFormat: "ejs",
1245
+ targetFormat: "docx"
1246
+ },
1247
+ {
1248
+ sourceFormat: "erb",
1249
+ targetFormat: "docx"
1250
+ },
1251
+ {
1252
+ sourceFormat: "haml",
1253
+ targetFormat: "docx"
1254
+ },
1255
+ {
1256
+ sourceFormat: "slim",
1257
+ targetFormat: "docx"
1258
+ },
1259
+ {
1260
+ sourceFormat: "mermaid",
1261
+ targetFormat: "docx"
1262
+ },
1263
+ {
1264
+ sourceFormat: "mmd",
1265
+ targetFormat: "docx"
1266
+ },
1267
+ {
1268
+ sourceFormat: "puml",
1269
+ targetFormat: "docx"
1270
+ },
1271
+ {
1272
+ sourceFormat: "avsc",
1273
+ targetFormat: "docx"
1274
+ },
1275
+ {
1276
+ sourceFormat: "sol",
1277
+ targetFormat: "docx"
1278
+ },
1279
+ {
1280
+ sourceFormat: "move",
1281
+ targetFormat: "docx"
1282
+ },
1283
+ {
1284
+ sourceFormat: "nim",
1285
+ targetFormat: "docx"
1286
+ },
1287
+ {
1288
+ sourceFormat: "cr",
1289
+ targetFormat: "docx"
1290
+ },
1291
+ {
1292
+ sourceFormat: "ml",
1293
+ targetFormat: "docx"
1294
+ },
1295
+ {
1296
+ sourceFormat: "mli",
1297
+ targetFormat: "docx"
1298
+ },
1299
+ {
1300
+ sourceFormat: "elm",
1301
+ targetFormat: "docx"
1302
+ },
1303
+ {
1304
+ sourceFormat: "rkt",
1305
+ targetFormat: "docx"
1306
+ },
1307
+ {
1308
+ sourceFormat: "lisp",
1309
+ targetFormat: "docx"
1310
+ },
1311
+ {
1312
+ sourceFormat: "scm",
1313
+ targetFormat: "docx"
1314
+ },
1315
+ {
1316
+ sourceFormat: "asm",
1317
+ targetFormat: "docx"
1318
+ },
1319
+ {
1320
+ sourceFormat: "s",
1321
+ targetFormat: "docx"
1322
+ },
1323
+ {
1324
+ sourceFormat: "cu",
1325
+ targetFormat: "docx"
1326
+ },
1327
+ {
1328
+ sourceFormat: "cuh",
1329
+ targetFormat: "docx"
1330
+ },
1331
+ {
1332
+ sourceFormat: "d",
1333
+ targetFormat: "docx"
1334
+ },
1335
+ {
1336
+ sourceFormat: "pas",
1337
+ targetFormat: "docx"
1338
+ },
1339
+ {
1340
+ sourceFormat: "adb",
1341
+ targetFormat: "docx"
1342
+ },
1343
+ {
1344
+ sourceFormat: "ads",
1345
+ targetFormat: "docx"
1346
+ },
1347
+ {
1348
+ sourceFormat: "cob",
1349
+ targetFormat: "docx"
1350
+ },
1351
+ {
1352
+ sourceFormat: "cbl",
1353
+ targetFormat: "docx"
1354
+ },
1355
+ {
1356
+ sourceFormat: "f90",
1357
+ targetFormat: "docx"
1358
+ },
1359
+ {
1360
+ sourceFormat: "f95",
1361
+ targetFormat: "docx"
1362
+ },
1363
+ {
1364
+ sourceFormat: "vhd",
1365
+ targetFormat: "docx"
1366
+ },
1367
+ {
1368
+ sourceFormat: "vhdl",
1369
+ targetFormat: "docx"
1370
+ },
1371
+ {
1372
+ sourceFormat: "sv",
1373
+ targetFormat: "docx"
1374
+ },
1375
+ {
1376
+ sourceFormat: "svh",
1377
+ targetFormat: "docx"
1378
+ },
1379
+ {
1380
+ sourceFormat: "ino",
1381
+ targetFormat: "docx"
1382
+ },
1383
+ {
1384
+ sourceFormat: "glsl",
1385
+ targetFormat: "docx"
1386
+ },
1387
+ {
1388
+ sourceFormat: "vert",
1389
+ targetFormat: "docx"
1390
+ },
1391
+ {
1392
+ sourceFormat: "frag",
1393
+ targetFormat: "docx"
1394
+ },
1395
+ {
1396
+ sourceFormat: "wgsl",
1397
+ targetFormat: "docx"
1398
+ },
1399
+ {
1400
+ sourceFormat: "hlsl",
1401
+ targetFormat: "docx"
1402
+ },
1403
+ {
1404
+ sourceFormat: "rmd",
1405
+ targetFormat: "docx"
1406
+ },
1407
+ {
1408
+ sourceFormat: "qmd",
1409
+ targetFormat: "docx"
1410
+ },
1411
+ {
1412
+ sourceFormat: "bib",
1413
+ targetFormat: "docx"
1414
+ },
1415
+ {
1416
+ sourceFormat: "nix",
1417
+ targetFormat: "docx"
1418
+ },
1419
+ {
1420
+ sourceFormat: "cue",
1421
+ targetFormat: "docx"
1422
+ },
1423
+ {
1424
+ sourceFormat: "dhall",
1425
+ targetFormat: "docx"
1426
+ },
1427
+ {
1428
+ sourceFormat: "org",
1429
+ targetFormat: "docx"
1430
+ },
1431
+ {
1432
+ sourceFormat: "wiki",
1433
+ targetFormat: "docx"
1434
+ },
1435
+ {
1436
+ sourceFormat: "mediawiki",
1437
+ targetFormat: "docx"
1438
+ },
1439
+ {
1440
+ sourceFormat: "textile",
1441
+ targetFormat: "docx"
1442
+ },
1443
+ {
1444
+ sourceFormat: "pod",
1445
+ targetFormat: "docx"
1446
+ },
1447
+ {
1448
+ sourceFormat: "man",
1449
+ targetFormat: "docx"
1450
+ },
1451
+ {
1452
+ sourceFormat: "roff",
1453
+ targetFormat: "docx"
1454
+ },
1455
+ {
1456
+ sourceFormat: "nfo",
1457
+ targetFormat: "docx"
1458
+ },
1459
+ {
1460
+ sourceFormat: "srt",
1461
+ targetFormat: "docx"
1462
+ },
1463
+ {
1464
+ sourceFormat: "vtt",
1465
+ targetFormat: "docx"
1466
+ },
1467
+ {
1468
+ sourceFormat: "sbv",
1469
+ targetFormat: "docx"
1470
+ },
1471
+ {
1472
+ sourceFormat: "ass",
1473
+ targetFormat: "docx"
1474
+ },
1475
+ {
1476
+ sourceFormat: "ssa",
1477
+ targetFormat: "docx"
1478
+ },
1479
+ {
1480
+ sourceFormat: "ics",
1481
+ targetFormat: "docx"
1482
+ },
1483
+ {
1484
+ sourceFormat: "vcf",
1485
+ targetFormat: "docx"
1486
+ },
1487
+ {
1488
+ sourceFormat: "eml",
1489
+ targetFormat: "docx"
1490
+ },
1491
+ {
1492
+ sourceFormat: "mbox",
1493
+ targetFormat: "docx"
1494
+ },
1495
+ {
1496
+ sourceFormat: "msg",
1497
+ targetFormat: "docx"
1498
+ },
1499
+ {
1500
+ sourceFormat: "oft",
1501
+ targetFormat: "docx"
1502
+ },
1503
+ {
1504
+ sourceFormat: "mht",
1505
+ targetFormat: "docx"
1506
+ },
1507
+ {
1508
+ sourceFormat: "mhtml",
1509
+ targetFormat: "docx"
1510
+ },
1511
+ {
1512
+ sourceFormat: "npmrc",
1513
+ targetFormat: "docx"
1514
+ },
1515
+ {
1516
+ sourceFormat: "yarnrc",
1517
+ targetFormat: "docx"
1518
+ },
1519
+ {
1520
+ sourceFormat: "gitattributes",
1521
+ targetFormat: "docx"
1522
+ },
1523
+ {
1524
+ sourceFormat: "gitmodules",
1525
+ targetFormat: "docx"
1526
+ },
1527
+ {
1528
+ sourceFormat: "xls",
1529
+ targetFormat: "xlsx"
1530
+ },
1531
+ {
1532
+ sourceFormat: "xlsm",
1533
+ targetFormat: "xlsx"
1534
+ },
1535
+ {
1536
+ sourceFormat: "xlt",
1537
+ targetFormat: "xlsx"
1538
+ },
1539
+ {
1540
+ sourceFormat: "xltx",
1541
+ targetFormat: "xlsx"
1542
+ },
1543
+ {
1544
+ sourceFormat: "xltm",
1545
+ targetFormat: "xlsx"
1546
+ },
1547
+ {
1548
+ sourceFormat: "et",
1549
+ targetFormat: "xlsx"
1550
+ },
1551
+ {
1552
+ sourceFormat: "ett",
1553
+ targetFormat: "xlsx"
1554
+ },
1555
+ {
1556
+ sourceFormat: "ods",
1557
+ targetFormat: "xlsx"
1558
+ },
1559
+ {
1560
+ sourceFormat: "ots",
1561
+ targetFormat: "xlsx"
1562
+ },
1563
+ {
1564
+ sourceFormat: "fods",
1565
+ targetFormat: "xlsx"
1566
+ },
1567
+ {
1568
+ sourceFormat: "sxc",
1569
+ targetFormat: "xlsx"
1570
+ },
1571
+ {
1572
+ sourceFormat: "stc",
1573
+ targetFormat: "xlsx"
1574
+ },
1575
+ {
1576
+ sourceFormat: "dbf",
1577
+ targetFormat: "xlsx"
1578
+ },
1579
+ {
1580
+ sourceFormat: "slk",
1581
+ targetFormat: "xlsx"
1582
+ },
1583
+ {
1584
+ sourceFormat: "dif",
1585
+ targetFormat: "xlsx"
1586
+ },
1587
+ {
1588
+ sourceFormat: "csv",
1589
+ targetFormat: "xlsx"
1590
+ },
1591
+ {
1592
+ sourceFormat: "tsv",
1593
+ targetFormat: "xlsx"
1594
+ },
1595
+ {
1596
+ sourceFormat: "tab",
1597
+ targetFormat: "xlsx"
1598
+ },
1599
+ {
1600
+ sourceFormat: "psv",
1601
+ targetFormat: "xlsx"
1602
+ },
1603
+ {
1604
+ sourceFormat: "json",
1605
+ targetFormat: "xlsx"
1606
+ },
1607
+ {
1608
+ sourceFormat: "jsonl",
1609
+ targetFormat: "xlsx"
1610
+ },
1611
+ {
1612
+ sourceFormat: "ndjson",
1613
+ targetFormat: "xlsx"
1614
+ },
1615
+ {
1616
+ sourceFormat: "jsonlines",
1617
+ targetFormat: "xlsx"
1618
+ },
1619
+ {
1620
+ sourceFormat: "ldjson",
1621
+ targetFormat: "xlsx"
1622
+ },
1623
+ {
1624
+ sourceFormat: "dng",
1625
+ targetFormat: "jpg"
1626
+ },
1627
+ {
1628
+ sourceFormat: "cr2",
1629
+ targetFormat: "jpg"
1630
+ },
1631
+ {
1632
+ sourceFormat: "cr3",
1633
+ targetFormat: "jpg"
1634
+ },
1635
+ {
1636
+ sourceFormat: "nef",
1637
+ targetFormat: "jpg"
1638
+ },
1639
+ {
1640
+ sourceFormat: "nrw",
1641
+ targetFormat: "jpg"
1642
+ },
1643
+ {
1644
+ sourceFormat: "arw",
1645
+ targetFormat: "jpg"
1646
+ },
1647
+ {
1648
+ sourceFormat: "sr2",
1649
+ targetFormat: "jpg"
1650
+ },
1651
+ {
1652
+ sourceFormat: "srf",
1653
+ targetFormat: "jpg"
1654
+ },
1655
+ {
1656
+ sourceFormat: "orf",
1657
+ targetFormat: "jpg"
1658
+ },
1659
+ {
1660
+ sourceFormat: "rw2",
1661
+ targetFormat: "jpg"
1662
+ },
1663
+ {
1664
+ sourceFormat: "rwl",
1665
+ targetFormat: "jpg"
1666
+ },
1667
+ {
1668
+ sourceFormat: "raf",
1669
+ targetFormat: "jpg"
1670
+ },
1671
+ {
1672
+ sourceFormat: "kdc",
1673
+ targetFormat: "jpg"
1674
+ },
1675
+ {
1676
+ sourceFormat: "x3f",
1677
+ targetFormat: "jpg"
1678
+ },
1679
+ {
1680
+ sourceFormat: "pef",
1681
+ targetFormat: "jpg"
1682
+ },
1683
+ {
1684
+ sourceFormat: "srw",
1685
+ targetFormat: "jpg"
1686
+ },
1687
+ {
1688
+ sourceFormat: "erf",
1689
+ targetFormat: "jpg"
1690
+ },
1691
+ {
1692
+ sourceFormat: "mef",
1693
+ targetFormat: "jpg"
1694
+ },
1695
+ {
1696
+ sourceFormat: "mos",
1697
+ targetFormat: "jpg"
1698
+ },
1699
+ {
1700
+ sourceFormat: "mrw",
1701
+ targetFormat: "jpg"
1702
+ },
1703
+ {
1704
+ sourceFormat: "3fr",
1705
+ targetFormat: "jpg"
1706
+ },
1707
+ {
1708
+ sourceFormat: "iiq",
1709
+ targetFormat: "jpg"
1710
+ },
1711
+ {
1712
+ sourceFormat: "icns",
1713
+ targetFormat: "png"
1714
+ },
1715
+ {
1716
+ sourceFormat: "apk",
1717
+ targetFormat: "png"
1718
+ },
1719
+ {
1720
+ sourceFormat: "ipa",
1721
+ targetFormat: "png"
1722
+ },
1723
+ {
1724
+ sourceFormat: "exe",
1725
+ targetFormat: "png"
1726
+ },
1727
+ {
1728
+ sourceFormat: "dll",
1729
+ targetFormat: "png"
1730
+ },
1731
+ {
1732
+ sourceFormat: "mui",
1733
+ targetFormat: "png"
1734
+ },
1735
+ {
1736
+ sourceFormat: "mun",
1737
+ targetFormat: "png"
1738
+ },
1739
+ {
1740
+ sourceFormat: "ico",
1741
+ targetFormat: "png"
1742
+ },
1743
+ {
1744
+ sourceFormat: "ppm",
1745
+ targetFormat: "png"
1746
+ }
1747
+ ], _t = [
1748
+ {
1749
+ sourceFormat: "dng",
1750
+ targetFormat: "jpg"
1751
+ },
1752
+ {
1753
+ sourceFormat: "cr2",
1754
+ targetFormat: "jpg"
1755
+ },
1756
+ {
1757
+ sourceFormat: "cr3",
1758
+ targetFormat: "jpg"
1759
+ },
1760
+ {
1761
+ sourceFormat: "nef",
1762
+ targetFormat: "jpg"
1763
+ },
1764
+ {
1765
+ sourceFormat: "nrw",
1766
+ targetFormat: "jpg"
1767
+ },
1768
+ {
1769
+ sourceFormat: "arw",
1770
+ targetFormat: "jpg"
1771
+ },
1772
+ {
1773
+ sourceFormat: "sr2",
1774
+ targetFormat: "jpg"
1775
+ },
1776
+ {
1777
+ sourceFormat: "srf",
1778
+ targetFormat: "jpg"
1779
+ },
1780
+ {
1781
+ sourceFormat: "orf",
1782
+ targetFormat: "jpg"
1783
+ },
1784
+ {
1785
+ sourceFormat: "rw2",
1786
+ targetFormat: "jpg"
1787
+ },
1788
+ {
1789
+ sourceFormat: "rwl",
1790
+ targetFormat: "jpg"
1791
+ },
1792
+ {
1793
+ sourceFormat: "raf",
1794
+ targetFormat: "jpg"
1795
+ },
1796
+ {
1797
+ sourceFormat: "kdc",
1798
+ targetFormat: "jpg"
1799
+ },
1800
+ {
1801
+ sourceFormat: "x3f",
1802
+ targetFormat: "jpg"
1803
+ },
1804
+ {
1805
+ sourceFormat: "pef",
1806
+ targetFormat: "jpg"
1807
+ },
1808
+ {
1809
+ sourceFormat: "srw",
1810
+ targetFormat: "jpg"
1811
+ },
1812
+ {
1813
+ sourceFormat: "erf",
1814
+ targetFormat: "jpg"
1815
+ },
1816
+ {
1817
+ sourceFormat: "mef",
1818
+ targetFormat: "jpg"
1819
+ },
1820
+ {
1821
+ sourceFormat: "mos",
1822
+ targetFormat: "jpg"
1823
+ },
1824
+ {
1825
+ sourceFormat: "mrw",
1826
+ targetFormat: "jpg"
1827
+ },
1828
+ {
1829
+ sourceFormat: "3fr",
1830
+ targetFormat: "jpg"
1831
+ },
1832
+ {
1833
+ sourceFormat: "iiq",
1834
+ targetFormat: "jpg"
1835
+ },
1836
+ {
1837
+ sourceFormat: "icns",
1838
+ targetFormat: "png"
1839
+ }
1840
+ ], Et = new Set(
1841
+ at.map((e) => k(e.sourceFormat))
1842
+ ), St = new Set(
1843
+ at.map(
1844
+ (e) => `${k(e.sourceFormat)}->${k(e.targetFormat)}`
1845
+ )
1846
+ ), Ct = new Set(
1847
+ _t.map(
1848
+ (e) => `${k(e.sourceFormat)}->${k(e.targetFormat)}`
1849
+ )
1850
+ );
1851
+ class T extends Error {
1852
+ constructor(t) {
1853
+ super(t.errorMessage || t.errorCode || "WASM conversion failed."), this.result = t, this.name = "WasmConversionError";
1854
+ }
1855
+ }
1856
+ function Yt(e) {
1857
+ const t = B(e), r = e.officeWasm ? B({ wasm: e.officeWasm, fetch: e.fetch }) : void 0, o = e.imageWasm ? D(() => tt(e.imageWasm, e.fetch)) : void 0, a = e.imageWasm ? B({ wasm: o, fetch: e.fetch }) : void 0, s = o ? At(o) : void 0;
1858
+ return {
1859
+ async convert(c, n) {
1860
+ d(n.signal);
1861
+ const m = k(c.sourceFormat), i = k(c.targetFormat), p = Tt(m, i), l = `/work/input.${m}`, g = `/work/output.${i}`, h = "/work/options.json", j = "/work/result.json", U = await q(c.source, e.fetch, n.signal);
1862
+ d(n.signal);
1863
+ const mt = JSON.stringify({
1864
+ ...c.password ? { password: c.password } : {},
1865
+ ...c.locale ? { locale: c.locale } : {}
1866
+ }), L = !!(a && Ct.has(p));
1867
+ if (L && i === "jpg" && s) {
1868
+ const v = await s(U, n.signal);
1869
+ if (d(n.signal), v) return v;
1870
+ }
1871
+ const ut = L ? a : t, R = (v, dt) => v({
1872
+ args: [
1873
+ L ? "converter-image" : "converter-core",
1874
+ "--input",
1875
+ l,
1876
+ "--output",
1877
+ g,
1878
+ "--source",
1879
+ m,
1880
+ "--target",
1881
+ i,
1882
+ "--options",
1883
+ h,
1884
+ "--result",
1885
+ j
1886
+ ],
1887
+ files: {
1888
+ [l]: dt,
1889
+ [h]: new TextEncoder().encode(mt)
1890
+ },
1891
+ readFiles: [j, g],
1892
+ signal: n.signal
1893
+ });
1894
+ let E = await R(ut, U), b = A(E.files[j]);
1895
+ if (!b.ok && b.errorCode === "engine_unavailable" && b.requiredModule === "office" && r) {
1896
+ const v = await R(r, U);
1897
+ V(A(v.files[j]), v.exitCode), E = await R(t, v.files[g]), b = A(E.files[j]);
1898
+ }
1899
+ return d(n.signal), V(b, E.exitCode), {
1900
+ source: E.files[g],
1901
+ format: k(b.targetFormat || i),
1902
+ contentType: b.contentType,
1903
+ warnings: b.warnings
1904
+ };
1905
+ }
1906
+ };
1907
+ }
1908
+ function V(e, t) {
1909
+ if (!e.ok) throw new T(e);
1910
+ if (t !== 0)
1911
+ throw new T({
1912
+ ...e,
1913
+ ok: !1,
1914
+ errorCode: e.errorCode || "conversion_failed",
1915
+ errorMessage: e.errorMessage || `converter WASM exited with code ${t}`
1916
+ });
1917
+ }
1918
+ function At(e) {
1919
+ const t = D(async () => {
1920
+ const r = await e(), o = new Set(WebAssembly.Module.exports(r).map((c) => c.name));
1921
+ if (!["filens_image_alloc", "filens_image_free", "filens_image_preview", "memory"].every((c) => o.has(c))) return null;
1922
+ const a = new ot({ args: ["converter-image"], files: {} }), s = await WebAssembly.instantiate(r, { wasi_snapshot_preview1: a.imports });
1923
+ return a.setInstance(s), s.exports;
1924
+ });
1925
+ return async (r, o) => {
1926
+ const a = await f(t(), o);
1927
+ if (d(o), !a || r.length === 0) return null;
1928
+ let s = 0, c = 0, n = 0;
1929
+ try {
1930
+ if (s = a.filens_image_alloc(r.length) >>> 0, !s) throw new Error("Image core could not allocate its input buffer.");
1931
+ new Uint8Array(a.memory.buffer).set(r, s);
1932
+ const m = a.filens_image_preview(s, r.length);
1933
+ if (c = Number(m & 0xffffffffn), n = Number(m >> 32n), !c || n < 4 || c + n > a.memory.buffer.byteLength) throw new Error("Image core returned an invalid preview buffer.");
1934
+ const i = new Uint8Array(a.memory.buffer, c, n), p = new DataView(i.buffer, i.byteOffset, 4).getUint32(0, !0);
1935
+ if (p > i.length - 4) throw new Error("Image core returned invalid preview metadata.");
1936
+ const l = A(i.subarray(4, 4 + p));
1937
+ if (!l.ok) throw new T(l);
1938
+ return { source: i.slice(4 + p), format: "jpg", contentType: l.contentType, warnings: l.warnings };
1939
+ } finally {
1940
+ c && n && a.filens_image_free(c, n), s && a.filens_image_free(s, r.length);
1941
+ }
1942
+ };
1943
+ }
1944
+ function Tt(e, t) {
1945
+ const r = `${e}->${t}`;
1946
+ if (St.has(r))
1947
+ return r;
1948
+ const o = Et.has(e) ? `unsupported conversion pair: ${e} -> ${t}` : `unsupported source format: ${e}`;
1949
+ throw new T({
1950
+ ok: !1,
1951
+ sourceFormat: e,
1952
+ targetFormat: t,
1953
+ warnings: [],
1954
+ errorCode: "unsupported_format",
1955
+ errorMessage: o,
1956
+ metrics: {}
1957
+ });
1958
+ }
1959
+ function A(e) {
1960
+ const t = new TextDecoder().decode(e), r = JSON.parse(t);
1961
+ return {
1962
+ ...r,
1963
+ warnings: Array.isArray(r.warnings) ? r.warnings.map(String) : []
1964
+ };
1965
+ }
1966
+ function k(e) {
1967
+ return e.trim().replace(/^\./, "").toLowerCase();
1968
+ }
1969
+ const Y = 64 * 1024 * 1024;
1970
+ function Jt() {
1971
+ return {
1972
+ async convert(e, t) {
1973
+ const r = e.sourceFormat.replace(/^\./, "").toLowerCase(), o = e.targetFormat.replace(/^\./, "").toLowerCase();
1974
+ if (!(["heic", "heif"].includes(r) && o === "png"))
1975
+ throw new Error(`Unsupported media conversion: ${r} -> ${o}.`);
1976
+ if (d(t.signal), (e.source instanceof Blob ? e.source.size : typeof e.source == "string" ? 0 : e.source.byteLength) > Y)
1977
+ throw new Error("HEIF input exceeds the 64 MiB preview limit.");
1978
+ const a = ArrayBuffer.isView(e.source) ? e.source.slice() : e.source instanceof ArrayBuffer ? e.source.slice(0) : e.source, s = await q(a, globalThis.fetch, t.signal, Y);
1979
+ d(t.signal);
1980
+ const c = await f(import("./media-runtime-C8ywl3lB.js"), t.signal);
1981
+ return d(t.signal), c.convertMedia(s, r, t.signal);
1982
+ }
1983
+ };
1984
+ }
1985
+ class st extends Error {
1986
+ constructor(t, r, o) {
1987
+ const a = `Conversion failed: ${t} ${r}`.trim(), s = (o == null ? void 0 : o.errorMessage) || (o == null ? void 0 : o.errorCode);
1988
+ super(s ? `${a}: ${s}` : a), this.status = t, this.statusText = r, this.result = o, this.name = "HttpConversionError";
1989
+ }
1990
+ }
1991
+ function Kt(e) {
1992
+ const t = e.fetch ?? globalThis.fetch;
1993
+ if (!t)
1994
+ throw new Error("A fetch implementation is required for HTTP conversion.");
1995
+ return {
1996
+ async convert(r, o) {
1997
+ const a = o.signal;
1998
+ d(a);
1999
+ const s = new FormData();
2000
+ s.set("sourceFormat", r.sourceFormat), s.set("targetFormat", r.targetFormat), r.name && s.set("name", r.name), r.password && s.set("password", r.password), r.locale && s.set("locale", r.locale), s.set("file", await Bt(r.source, r, t, a), Dt(r)), d(a);
2001
+ const c = typeof e.headers == "function" ? e.headers(r) : e.headers;
2002
+ d(a);
2003
+ const n = await f(t(e.endpoint, {
2004
+ method: "POST",
2005
+ body: s,
2006
+ signal: a,
2007
+ credentials: e.credentials,
2008
+ headers: c
2009
+ }), a);
2010
+ if (d(a), !n.ok)
2011
+ throw await f(Ut(n, r), a);
2012
+ if ((e.responseType ?? "json") === "blob")
2013
+ return f(It(n, r.targetFormat), a);
2014
+ const m = await f(n.json(), a);
2015
+ return d(a), Mt(m, r, n);
2016
+ }
2017
+ };
2018
+ }
2019
+ async function Ut(e, t) {
2020
+ return new st(e.status, e.statusText, await Lt(e, t));
2021
+ }
2022
+ function Xt(e) {
2023
+ return {
2024
+ async convert(t) {
2025
+ const r = e.find(
2026
+ (o) => F(o.sourceFormat) === F(t.sourceFormat) && F(o.targetFormat) === F(t.targetFormat)
2027
+ );
2028
+ if (!r)
2029
+ throw new Error(`No mock conversion registered for ${t.sourceFormat} -> ${t.targetFormat}.`);
2030
+ return {
2031
+ source: typeof r.source == "function" ? await r.source(t) : r.source,
2032
+ format: r.targetFormat,
2033
+ contentType: r.contentType,
2034
+ warnings: r.warnings,
2035
+ cacheKey: r.cacheKey
2036
+ };
2037
+ }
2038
+ };
2039
+ }
2040
+ async function Lt(e, t) {
2041
+ var a;
2042
+ const r = ((a = e.headers.get("content-type")) == null ? void 0 : a.toLowerCase()) ?? "";
2043
+ if (r.includes("application/json") || r.includes("+json"))
2044
+ try {
2045
+ return nt(await e.json(), t);
2046
+ } catch {
2047
+ return;
2048
+ }
2049
+ const o = Rt(e.headers, t);
2050
+ return o.errorCode || o.errorMessage ? o : void 0;
2051
+ }
2052
+ function nt(e, t) {
2053
+ if (!e || typeof e != "object")
2054
+ return;
2055
+ const r = e;
2056
+ return {
2057
+ ok: typeof r.ok == "boolean" ? r.ok : void 0,
2058
+ format: typeof r.format == "string" ? F(r.format) : void 0,
2059
+ sourceFormat: typeof r.sourceFormat == "string" ? F(r.sourceFormat) : F(t.sourceFormat),
2060
+ targetFormat: typeof r.targetFormat == "string" ? F(r.targetFormat) : F(t.targetFormat),
2061
+ backend: typeof r.backend == "string" ? r.backend : void 0,
2062
+ fidelity: typeof r.fidelity == "string" ? r.fidelity : void 0,
2063
+ contentType: typeof r.contentType == "string" ? r.contentType : void 0,
2064
+ warnings: Array.isArray(r.warnings) ? r.warnings.map(String) : [],
2065
+ errorCode: typeof r.errorCode == "string" ? r.errorCode : void 0,
2066
+ errorMessage: typeof r.errorMessage == "string" ? r.errorMessage : void 0,
2067
+ metrics: r.metrics && typeof r.metrics == "object" ? r.metrics : void 0
2068
+ };
2069
+ }
2070
+ function Rt(e, t) {
2071
+ return {
2072
+ ok: w(e, "x-preview-ok") === "true" ? !0 : w(e, "x-preview-ok") === "false" ? !1 : void 0,
2073
+ format: w(e, "x-preview-format") ?? void 0,
2074
+ sourceFormat: w(e, "x-preview-source-format") ?? F(t.sourceFormat),
2075
+ targetFormat: w(e, "x-preview-target-format") ?? F(t.targetFormat),
2076
+ backend: w(e, "x-preview-backend") ?? void 0,
2077
+ fidelity: w(e, "x-preview-fidelity") ?? void 0,
2078
+ warnings: ct(e) ?? [],
2079
+ errorCode: w(e, "x-preview-error-code") ?? void 0,
2080
+ errorMessage: w(e, "x-preview-error-message") ?? void 0
2081
+ };
2082
+ }
2083
+ async function Bt(e, t, r, o) {
2084
+ const a = zt(t.name, t.sourceFormat);
2085
+ if (e instanceof Blob)
2086
+ return e.type || a === "application/octet-stream" ? e : new Blob([e], {
2087
+ type: a
2088
+ });
2089
+ if (typeof e == "string") {
2090
+ if (X(e))
2091
+ return Ot(e, a);
2092
+ if (K(e)) {
2093
+ const s = await f(r(e, { signal: o }), o);
2094
+ if (d(o), !s.ok) throw new Error(`Failed to fetch conversion source: ${s.status} ${s.statusText}`.trim());
2095
+ const c = await f(s.blob(), o);
2096
+ return d(o), c.type ? c : new Blob([c], { type: a });
2097
+ }
2098
+ return new Blob([e], {
2099
+ type: a === "application/octet-stream" ? "text/plain" : a
2100
+ });
2101
+ }
2102
+ if (ArrayBuffer.isView(e)) {
2103
+ const s = new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
2104
+ if (s.buffer instanceof ArrayBuffer) return new Blob([s], { type: a });
2105
+ const c = new Uint8Array(s.byteLength);
2106
+ return c.set(s), new Blob([c.buffer], {
2107
+ type: a
2108
+ });
2109
+ }
2110
+ return new Blob([e], {
2111
+ type: a
2112
+ });
2113
+ }
2114
+ function Mt(e, t, r) {
2115
+ if (!e || typeof e != "object")
2116
+ throw new Error("Conversion response must be a JSON object.");
2117
+ const o = e;
2118
+ if (o.ok === !1 || typeof o.errorCode == "string" || typeof o.errorMessage == "string")
2119
+ throw new st(r.status, r.statusText, nt(o, t));
2120
+ const a = Nt(o), s = String(o.format ?? o.targetFormat ?? t.targetFormat);
2121
+ return {
2122
+ source: a,
2123
+ format: s,
2124
+ contentType: typeof o.contentType == "string" ? o.contentType : void 0,
2125
+ warnings: Array.isArray(o.warnings) ? o.warnings.map(String) : void 0,
2126
+ cacheKey: typeof o.cacheKey == "string" ? o.cacheKey : void 0
2127
+ };
2128
+ }
2129
+ async function It(e, t) {
2130
+ return {
2131
+ source: await e.blob(),
2132
+ format: w(e.headers, "x-preview-format") ?? t,
2133
+ contentType: e.headers.get("content-type") ?? void 0,
2134
+ warnings: ct(e.headers),
2135
+ cacheKey: w(e.headers, "x-preview-cache-key")
2136
+ };
2137
+ }
2138
+ function Nt(e) {
2139
+ if (typeof e.url == "string")
2140
+ return e.url;
2141
+ if (typeof e.dataUrl == "string")
2142
+ return e.dataUrl;
2143
+ if (typeof e.base64 == "string")
2144
+ return Q(e.base64);
2145
+ if (typeof e.text == "string")
2146
+ return new TextEncoder().encode(e.text);
2147
+ throw new Error("Conversion JSON response must include url, dataUrl, base64, or text.");
2148
+ }
2149
+ function Ot(e, t = "application/octet-stream") {
2150
+ const { bytes: r, contentType: o } = Z(e);
2151
+ return new Blob([r], {
2152
+ type: o ?? t
2153
+ });
2154
+ }
2155
+ function ct(e) {
2156
+ const t = w(e, "x-preview-warnings");
2157
+ if (t)
2158
+ try {
2159
+ const r = JSON.parse(t);
2160
+ return Array.isArray(r) ? r.map(String) : [String(r)];
2161
+ } catch {
2162
+ return t.split("|").map((r) => r.trim()).filter(Boolean);
2163
+ }
2164
+ }
2165
+ function w(e, t) {
2166
+ return e.get(t) ?? e.get(t.toLowerCase()) ?? void 0;
2167
+ }
2168
+ function Dt(e) {
2169
+ const t = F(e.sourceFormat), r = F(e.targetFormat), o = t || r || "bin", a = $t(e.name) || `input.${o}`;
2170
+ return it(a) ? a : `${a}.${o}`;
2171
+ }
2172
+ function $t(e) {
2173
+ var o, a;
2174
+ const r = ((a = (((o = String(e ?? "").split(/[?#]/, 1)[0]) == null ? void 0 : o.trim()) ?? "").split(/[\\/]/).pop()) == null ? void 0 : a.trim()) ?? "";
2175
+ return Wt(r);
2176
+ }
2177
+ function Wt(e) {
2178
+ const t = e.replace(/[^\w.+-]+/g, "_").replace(/^_+|_+$/g, "");
2179
+ return !t || t === "." || t === ".." ? "" : t;
2180
+ }
2181
+ function zt(e, t) {
2182
+ const r = it(e);
2183
+ switch (F(r || t || "")) {
2184
+ case "dng":
2185
+ case "cr2":
2186
+ case "cr3":
2187
+ case "nef":
2188
+ case "nrw":
2189
+ case "arw":
2190
+ case "sr2":
2191
+ case "srf":
2192
+ case "orf":
2193
+ case "rw2":
2194
+ case "rwl":
2195
+ case "raf":
2196
+ case "kdc":
2197
+ case "x3f":
2198
+ case "pef":
2199
+ case "srw":
2200
+ case "erf":
2201
+ case "mef":
2202
+ case "mos":
2203
+ case "mrw":
2204
+ case "3fr":
2205
+ case "iiq":
2206
+ return "application/octet-stream";
2207
+ case "apk":
2208
+ return "application/vnd.android.package-archive";
2209
+ case "ipa":
2210
+ return "application/x-ios-app";
2211
+ case "exe":
2212
+ case "dll":
2213
+ case "mui":
2214
+ case "mun":
2215
+ return "application/vnd.microsoft.portable-executable";
2216
+ case "ico":
2217
+ return "image/x-icon";
2218
+ case "icns":
2219
+ return "application/x-icns";
2220
+ case "ppm":
2221
+ return "image/x-portable-pixmap";
2222
+ case "doc":
2223
+ case "dot":
2224
+ return "application/msword";
2225
+ case "docm":
2226
+ return "application/vnd.ms-word.document.macroenabled.12";
2227
+ case "docx":
2228
+ return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
2229
+ case "xlsx":
2230
+ return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
2231
+ case "pptx":
2232
+ return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
2233
+ case "dotm":
2234
+ return "application/vnd.ms-word.template.macroenabled.12";
2235
+ case "dotx":
2236
+ return "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
2237
+ case "odt":
2238
+ return "application/vnd.oasis.opendocument.text";
2239
+ case "ott":
2240
+ return "application/vnd.oasis.opendocument.text-template";
2241
+ case "fodt":
2242
+ return "application/vnd.oasis.opendocument.text-flat-xml";
2243
+ case "sxw":
2244
+ return "application/vnd.sun.xml.writer";
2245
+ case "stw":
2246
+ return "application/vnd.sun.xml.writer.template";
2247
+ case "rtf":
2248
+ return "application/rtf";
2249
+ case "wps":
2250
+ return "application/vnd.ms-works";
2251
+ case "wpt":
2252
+ return "application/wps-office.wpt";
2253
+ case "xls":
2254
+ case "xlt":
2255
+ case "et":
2256
+ return "application/vnd.ms-excel";
2257
+ case "xlsm":
2258
+ return "application/vnd.ms-excel.sheet.macroenabled.12";
2259
+ case "xltm":
2260
+ return "application/vnd.ms-excel.template.macroenabled.12";
2261
+ case "ett":
2262
+ return "application/wps-office.ett";
2263
+ case "xltx":
2264
+ return "application/vnd.openxmlformats-officedocument.spreadsheetml.template";
2265
+ case "ods":
2266
+ return "application/vnd.oasis.opendocument.spreadsheet";
2267
+ case "ots":
2268
+ return "application/vnd.oasis.opendocument.spreadsheet-template";
2269
+ case "fods":
2270
+ return "application/vnd.oasis.opendocument.spreadsheet-flat-xml";
2271
+ case "sxc":
2272
+ return "application/vnd.sun.xml.calc";
2273
+ case "stc":
2274
+ return "application/vnd.sun.xml.calc.template";
2275
+ case "dbf":
2276
+ return "application/x-dbf";
2277
+ case "slk":
2278
+ return "text/spreadsheet";
2279
+ case "dif":
2280
+ return "application/x-dif";
2281
+ case "txt":
2282
+ case "text":
2283
+ case "log":
2284
+ return "text/plain";
2285
+ case "md":
2286
+ case "markdown":
2287
+ case "mkd":
2288
+ case "mkdn":
2289
+ case "mdown":
2290
+ return "text/markdown";
2291
+ case "html":
2292
+ case "htm":
2293
+ case "shtml":
2294
+ return "text/html";
2295
+ case "xhtml":
2296
+ case "xht":
2297
+ case "xhtm":
2298
+ return "application/xhtml+xml";
2299
+ case "epub":
2300
+ return "application/epub+zip";
2301
+ case "fb2":
2302
+ return "application/x-fictionbook+xml";
2303
+ case "xml":
2304
+ return "application/xml";
2305
+ case "rss":
2306
+ return "application/rss+xml";
2307
+ case "atom":
2308
+ return "application/atom+xml";
2309
+ case "kml":
2310
+ return "application/vnd.google-earth.kml+xml";
2311
+ case "gpx":
2312
+ return "application/gpx+xml";
2313
+ case "ttml":
2314
+ case "dfxp":
2315
+ return "application/ttml+xml";
2316
+ case "xsd":
2317
+ return "application/xsd+xml";
2318
+ case "xsl":
2319
+ case "xslt":
2320
+ return "application/xslt+xml";
2321
+ case "wsdl":
2322
+ return "application/wsdl+xml";
2323
+ case "plist":
2324
+ return "application/x-plist";
2325
+ case "pom":
2326
+ return "application/xml";
2327
+ case "yaml":
2328
+ case "yml":
2329
+ return "application/yaml";
2330
+ case "toml":
2331
+ return "application/toml";
2332
+ case "ini":
2333
+ return "text/x-ini";
2334
+ case "rst":
2335
+ case "rest":
2336
+ return "text/x-rst";
2337
+ case "adoc":
2338
+ case "asciidoc":
2339
+ case "asc":
2340
+ return "text/asciidoc";
2341
+ case "tex":
2342
+ case "latex":
2343
+ case "ltx":
2344
+ case "sty":
2345
+ case "cls":
2346
+ return "application/x-tex";
2347
+ case "properties":
2348
+ return "text/x-java-properties";
2349
+ case "env":
2350
+ return "application/x-env";
2351
+ case "conf":
2352
+ case "config":
2353
+ case "cfg":
2354
+ case "cnf":
2355
+ return "text/x-config";
2356
+ case "sql":
2357
+ return "application/sql";
2358
+ case "js":
2359
+ case "jsx":
2360
+ case "mjs":
2361
+ case "cjs":
2362
+ return "text/javascript";
2363
+ case "ts":
2364
+ case "tsx":
2365
+ case "mts":
2366
+ case "cts":
2367
+ return "text/typescript";
2368
+ case "vue":
2369
+ return "text/x-vue";
2370
+ case "css":
2371
+ return "text/css";
2372
+ case "scss":
2373
+ case "sass":
2374
+ return "text/x-scss";
2375
+ case "less":
2376
+ return "text/x-less";
2377
+ case "c":
2378
+ case "h":
2379
+ return "text/x-csrc";
2380
+ case "cpp":
2381
+ case "cc":
2382
+ case "cxx":
2383
+ case "hpp":
2384
+ case "hh":
2385
+ case "hxx":
2386
+ return "text/x-c++src";
2387
+ case "cs":
2388
+ return "text/x-csharp";
2389
+ case "go":
2390
+ return "text/x-go";
2391
+ case "java":
2392
+ return "text/x-java-source";
2393
+ case "kt":
2394
+ case "kts":
2395
+ return "text/x-kotlin";
2396
+ case "lua":
2397
+ return "text/x-lua";
2398
+ case "php":
2399
+ return "text/x-php";
2400
+ case "py":
2401
+ return "text/x-python";
2402
+ case "rb":
2403
+ return "text/x-ruby";
2404
+ case "rs":
2405
+ return "text/rust";
2406
+ case "sh":
2407
+ case "bash":
2408
+ return "application/x-sh";
2409
+ case "bat":
2410
+ case "cmd":
2411
+ return "application/x-msdos-program";
2412
+ case "ps1":
2413
+ return "text/x-powershell";
2414
+ case "swift":
2415
+ return "text/x-swift";
2416
+ case "jsonc":
2417
+ return "application/jsonc";
2418
+ case "json5":
2419
+ return "application/json5";
2420
+ case "ipynb":
2421
+ return "application/x-ipynb+json";
2422
+ case "gql":
2423
+ case "graphql":
2424
+ return "application/graphql";
2425
+ case "proto":
2426
+ return "application/x-protobuf";
2427
+ case "diff":
2428
+ return "text/x-diff";
2429
+ case "patch":
2430
+ return "text/x-patch";
2431
+ case "gitignore":
2432
+ return "text/x-gitignore";
2433
+ case "dockerignore":
2434
+ return "text/x-dockerignore";
2435
+ case "editorconfig":
2436
+ return "text/x-editorconfig";
2437
+ case "r":
2438
+ return "text/x-r";
2439
+ case "dart":
2440
+ return "text/x-dart";
2441
+ case "scala":
2442
+ return "text/x-scala";
2443
+ case "groovy":
2444
+ case "gradle":
2445
+ return "text/x-groovy";
2446
+ case "pl":
2447
+ return "text/x-perl";
2448
+ case "ex":
2449
+ return "text/x-elixir";
2450
+ case "erl":
2451
+ return "text/x-erlang";
2452
+ case "fs":
2453
+ case "fsi":
2454
+ case "fsx":
2455
+ return "text/x-fsharp";
2456
+ case "vb":
2457
+ return "text/x-vb";
2458
+ case "clj":
2459
+ return "text/x-clojure";
2460
+ case "hs":
2461
+ return "text/x-haskell";
2462
+ case "jl":
2463
+ return "text/x-julia";
2464
+ case "zig":
2465
+ return "text/x-zig";
2466
+ case "m":
2467
+ case "matlab":
2468
+ return "text/x-matlab";
2469
+ case "svelte":
2470
+ return "text/x-svelte";
2471
+ case "astro":
2472
+ return "text/x-astro";
2473
+ case "mdx":
2474
+ return "text/mdx";
2475
+ case "tf":
2476
+ case "tfvars":
2477
+ case "hcl":
2478
+ return "text/x-hcl";
2479
+ case "rego":
2480
+ return "text/x-rego";
2481
+ case "bicep":
2482
+ return "text/x-bicep";
2483
+ case "prisma":
2484
+ return "text/x-prisma";
2485
+ case "dockerfile":
2486
+ return "text/x-dockerfile";
2487
+ case "cmake":
2488
+ return "text/x-cmake";
2489
+ case "make":
2490
+ case "mk":
2491
+ return "text/x-makefile";
2492
+ case "zsh":
2493
+ case "fish":
2494
+ return "text/x-shellscript";
2495
+ case "csproj":
2496
+ case "vbproj":
2497
+ case "fsproj":
2498
+ case "props":
2499
+ case "targets":
2500
+ return "application/x-msbuild";
2501
+ case "sln":
2502
+ return "text/x-ms-sln";
2503
+ case "cshtml":
2504
+ case "razor":
2505
+ return "text/x-cshtml";
2506
+ case "mustache":
2507
+ case "hbs":
2508
+ return "text/x-handlebars-template";
2509
+ case "liquid":
2510
+ return "text/x-liquid";
2511
+ case "jinja":
2512
+ return "text/x-jinja";
2513
+ case "twig":
2514
+ return "text/x-twig";
2515
+ case "ejs":
2516
+ return "text/x-ejs";
2517
+ case "erb":
2518
+ return "text/x-erb";
2519
+ case "haml":
2520
+ return "text/x-haml";
2521
+ case "slim":
2522
+ return "text/x-slim";
2523
+ case "mermaid":
2524
+ case "mmd":
2525
+ return "text/vnd.mermaid";
2526
+ case "puml":
2527
+ return "text/x-plantuml";
2528
+ case "avsc":
2529
+ return "application/vnd.apache.avro+json";
2530
+ case "sol":
2531
+ return "text/x-solidity";
2532
+ case "move":
2533
+ return "text/x-move";
2534
+ case "nim":
2535
+ return "text/x-nim";
2536
+ case "cr":
2537
+ return "text/x-crystal";
2538
+ case "ml":
2539
+ case "mli":
2540
+ return "text/x-ocaml";
2541
+ case "elm":
2542
+ return "text/x-elm";
2543
+ case "rkt":
2544
+ return "text/x-racket";
2545
+ case "lisp":
2546
+ return "text/x-lisp";
2547
+ case "scm":
2548
+ return "text/x-scheme";
2549
+ case "asm":
2550
+ case "s":
2551
+ return "text/x-asm";
2552
+ case "cu":
2553
+ case "cuh":
2554
+ return "text/x-cuda";
2555
+ case "d":
2556
+ return "text/x-d";
2557
+ case "pas":
2558
+ return "text/x-pascal";
2559
+ case "adb":
2560
+ case "ads":
2561
+ return "text/x-ada";
2562
+ case "cob":
2563
+ case "cbl":
2564
+ return "text/x-cobol";
2565
+ case "f90":
2566
+ case "f95":
2567
+ return "text/x-fortran";
2568
+ case "vhd":
2569
+ case "vhdl":
2570
+ return "text/x-vhdl";
2571
+ case "sv":
2572
+ case "svh":
2573
+ return "text/x-systemverilog";
2574
+ case "ino":
2575
+ return "text/x-arduino";
2576
+ case "glsl":
2577
+ case "vert":
2578
+ case "frag":
2579
+ return "text/x-glsl";
2580
+ case "wgsl":
2581
+ return "text/wgsl";
2582
+ case "hlsl":
2583
+ return "text/x-hlsl";
2584
+ case "rmd":
2585
+ return "text/x-r-markdown";
2586
+ case "qmd":
2587
+ return "text/x-quarto";
2588
+ case "bib":
2589
+ return "application/x-bibtex";
2590
+ case "nix":
2591
+ return "text/x-nix";
2592
+ case "cue":
2593
+ return "text/x-cue";
2594
+ case "dhall":
2595
+ return "text/x-dhall";
2596
+ case "org":
2597
+ return "text/org";
2598
+ case "wiki":
2599
+ case "mediawiki":
2600
+ return "text/x-wiki";
2601
+ case "textile":
2602
+ return "text/x-textile";
2603
+ case "pod":
2604
+ return "text/x-pod";
2605
+ case "man":
2606
+ case "roff":
2607
+ return "text/troff";
2608
+ case "nfo":
2609
+ return "text/x-nfo";
2610
+ case "srt":
2611
+ return "application/x-subrip";
2612
+ case "vtt":
2613
+ return "text/vtt";
2614
+ case "sbv":
2615
+ return "text/x-sbv";
2616
+ case "ass":
2617
+ return "text/x-ass";
2618
+ case "ssa":
2619
+ return "text/x-ssa";
2620
+ case "ics":
2621
+ return "text/calendar";
2622
+ case "vcf":
2623
+ return "text/vcard";
2624
+ case "eml":
2625
+ return "message/rfc822";
2626
+ case "mbox":
2627
+ return "application/mbox";
2628
+ case "msg":
2629
+ return "application/vnd.ms-outlook";
2630
+ case "oft":
2631
+ return "application/vnd.ms-outlook";
2632
+ case "mht":
2633
+ case "mhtml":
2634
+ return "multipart/related";
2635
+ case "npmrc":
2636
+ return "text/x-npmrc";
2637
+ case "yarnrc":
2638
+ return "text/x-yarnrc";
2639
+ case "gitattributes":
2640
+ return "text/x-gitattributes";
2641
+ case "gitmodules":
2642
+ return "text/x-gitmodules";
2643
+ case "csv":
2644
+ return "text/csv";
2645
+ case "tsv":
2646
+ case "tab":
2647
+ return "text/tab-separated-values";
2648
+ case "psv":
2649
+ return "text/x-pipe-separated-values";
2650
+ case "json":
2651
+ return "application/json";
2652
+ case "jsonl":
2653
+ case "ndjson":
2654
+ case "jsonlines":
2655
+ case "ldjson":
2656
+ return "application/x-ndjson";
2657
+ case "ppt":
2658
+ case "pps":
2659
+ case "pot":
2660
+ case "dps":
2661
+ return "application/vnd.ms-powerpoint";
2662
+ case "dpt":
2663
+ return "application/wps-office.dpt";
2664
+ case "ppsx":
2665
+ return "application/vnd.openxmlformats-officedocument.presentationml.slideshow";
2666
+ case "pptm":
2667
+ return "application/vnd.ms-powerpoint.presentation.macroenabled.12";
2668
+ case "ppsm":
2669
+ return "application/vnd.ms-powerpoint.slideshow.macroenabled.12";
2670
+ case "potx":
2671
+ return "application/vnd.openxmlformats-officedocument.presentationml.template";
2672
+ case "potm":
2673
+ return "application/vnd.ms-powerpoint.template.macroenabled.12";
2674
+ case "odp":
2675
+ return "application/vnd.oasis.opendocument.presentation";
2676
+ case "otp":
2677
+ return "application/vnd.oasis.opendocument.presentation-template";
2678
+ case "fodp":
2679
+ return "application/vnd.oasis.opendocument.presentation-flat-xml";
2680
+ case "sxi":
2681
+ return "application/vnd.sun.xml.impress";
2682
+ case "sti":
2683
+ return "application/vnd.sun.xml.impress.template";
2684
+ case "odg":
2685
+ return "application/vnd.oasis.opendocument.graphics";
2686
+ case "otg":
2687
+ return "application/vnd.oasis.opendocument.graphics-template";
2688
+ case "fodg":
2689
+ return "application/vnd.oasis.opendocument.graphics-flat-xml";
2690
+ case "sxd":
2691
+ return "application/vnd.sun.xml.draw";
2692
+ case "std":
2693
+ return "application/vnd.sun.xml.draw.template";
2694
+ case "png":
2695
+ return "image/png";
2696
+ default:
2697
+ return "application/octet-stream";
2698
+ }
2699
+ }
2700
+ function it(e) {
2701
+ var s;
2702
+ const r = (((s = String(e ?? "").split(/[?#]/, 1)[0]) == null ? void 0 : s.trim()) ?? "").split(/[\\/]/).pop() ?? "", o = Pt(r);
2703
+ if (o)
2704
+ return o;
2705
+ const a = r.lastIndexOf(".");
2706
+ return a < 0 || a === r.length - 1 ? "" : a === 0 && r.indexOf(".", 1) < 0 ? F(r.slice(1)) : F(r.slice(a + 1));
2707
+ }
2708
+ function Pt(e) {
2709
+ const t = e.trim().toLowerCase();
2710
+ return t ? t === "dockerfile" || t.startsWith("dockerfile.") ? "dockerfile" : t === "makefile" || t === "gnumakefile" || t === "bsdmakefile" ? "make" : t === "cmakelists.txt" ? "cmake" : "" : "";
2711
+ }
2712
+ function F(e) {
2713
+ return e.trim().replace(/^\./, "").toLowerCase();
2714
+ }
2715
+ export {
2716
+ st as H,
2717
+ T as W,
2718
+ Jt as a,
2719
+ Xt as b,
2720
+ Kt as c,
2721
+ Yt as d,
2722
+ B as e,
2723
+ d as t
2724
+ };