@meacore/tauri-easy-updater 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.
package/dist/index.mjs ADDED
@@ -0,0 +1,735 @@
1
+ // src/utils/platform.ts
2
+ async function getCurrentPlatform() {
3
+ if (typeof window === "undefined") {
4
+ return "";
5
+ }
6
+ try {
7
+ const os = await import("@tauri-apps/api/os");
8
+ const type = await os.type();
9
+ const arch = await os.arch();
10
+ const normalizedOs = normalizeOs(type);
11
+ const normalizedArch = normalizeArch(arch);
12
+ if (!normalizedOs || !normalizedArch) {
13
+ return "";
14
+ }
15
+ return `${normalizedOs}-${normalizedArch}`;
16
+ } catch {
17
+ return "";
18
+ }
19
+ }
20
+ function normalizeOs(os) {
21
+ const lower = os.toLowerCase();
22
+ if (lower.startsWith("win")) return "windows";
23
+ if (lower.startsWith("mac")) return "darwin";
24
+ if (lower.startsWith("linux")) return "linux";
25
+ return "";
26
+ }
27
+ function normalizeArch(arch) {
28
+ const lower = arch.toLowerCase();
29
+ if (lower === "x86_64" || lower === "x64" || lower === "amd64") {
30
+ return "x86_64";
31
+ }
32
+ if (lower === "aarch64" || lower === "arm64") {
33
+ return "aarch64";
34
+ }
35
+ return "";
36
+ }
37
+
38
+ // src/utils/semver.ts
39
+ function parseVersion(input) {
40
+ let v = input.trim();
41
+ if (v.startsWith("v") || v.startsWith("V")) {
42
+ v = v.slice(1);
43
+ }
44
+ const [core, prerelease] = v.split("-", 2);
45
+ const parts = core.split(".");
46
+ if (parts.length < 2 || parts.length > 3) {
47
+ return null;
48
+ }
49
+ const [majStr, minStr, patchStr = "0"] = parts;
50
+ const major = Number(majStr);
51
+ const minor = Number(minStr);
52
+ const patch = Number(patchStr);
53
+ if (!Number.isFinite(major) || !Number.isFinite(minor) || !Number.isFinite(patch)) {
54
+ return null;
55
+ }
56
+ return {
57
+ major,
58
+ minor,
59
+ patch,
60
+ prerelease: prerelease ?? null
61
+ };
62
+ }
63
+ function comparePrerelease(a, b) {
64
+ if (a === b) return 0;
65
+ if (a === null) return 1;
66
+ if (b === null) return -1;
67
+ const aParts = a.split(".");
68
+ const bParts = b.split(".");
69
+ const len = Math.max(aParts.length, bParts.length);
70
+ for (let i = 0; i < len; i += 1) {
71
+ const ai = aParts[i];
72
+ const bi = bParts[i];
73
+ if (ai === void 0) return -1;
74
+ if (bi === void 0) return 1;
75
+ const aNum = Number(ai);
76
+ const bNum = Number(bi);
77
+ const aIsNum = Number.isFinite(aNum);
78
+ const bIsNum = Number.isFinite(bNum);
79
+ if (aIsNum && bIsNum) {
80
+ if (aNum > bNum) return 1;
81
+ if (aNum < bNum) return -1;
82
+ } else if (aIsNum && !bIsNum) {
83
+ return -1;
84
+ } else if (!aIsNum && bIsNum) {
85
+ return 1;
86
+ } else {
87
+ if (ai > bi) return 1;
88
+ if (ai < bi) return -1;
89
+ }
90
+ }
91
+ return 0;
92
+ }
93
+ function isNewerVersion(latest, current) {
94
+ const a = parseVersion(latest);
95
+ const b = parseVersion(current);
96
+ if (!a || !b) return false;
97
+ if (a.major !== b.major) return a.major > b.major;
98
+ if (a.minor !== b.minor) return a.minor > b.minor;
99
+ if (a.patch !== b.patch) return a.patch > b.patch;
100
+ return comparePrerelease(a.prerelease, b.prerelease) > 0;
101
+ }
102
+
103
+ // src/providers/github.ts
104
+ function createGitHubProvider(config) {
105
+ const {
106
+ owner,
107
+ repo,
108
+ manifestAssetName = "update-manifest.json",
109
+ fallbackToReleaseApi = true
110
+ } = config;
111
+ const manifestUrl = `https://github.com/${owner}/${repo}/releases/latest/download/${manifestAssetName}`;
112
+ const apiUrl = `https://api.github.com/repos/${owner}/${repo}/releases/latest`;
113
+ const provider = {
114
+ type: "github",
115
+ async fetchManifest() {
116
+ try {
117
+ const res = await fetch(manifestUrl);
118
+ if (res.ok) {
119
+ const data = await res.json();
120
+ return data;
121
+ }
122
+ if (!fallbackToReleaseApi || res.status !== 404) {
123
+ throw new Error(`GitHub manifest request failed with status ${res.status}`);
124
+ }
125
+ } catch (err) {
126
+ if (!fallbackToReleaseApi) {
127
+ throw err instanceof Error ? err : new Error("Failed to fetch GitHub manifest");
128
+ }
129
+ }
130
+ try {
131
+ const res = await fetch(apiUrl, {
132
+ headers: {
133
+ Accept: "application/vnd.github+json"
134
+ }
135
+ });
136
+ if (!res.ok) {
137
+ throw new Error(`GitHub releases API failed with status ${res.status}`);
138
+ }
139
+ const release = await res.json();
140
+ const platform = await getCurrentPlatform();
141
+ let url = "";
142
+ if (platform) {
143
+ const asset = selectAssetForPlatform(release.assets, platform);
144
+ if (asset) {
145
+ url = asset.browser_download_url;
146
+ }
147
+ }
148
+ const manifest = {
149
+ version: release.tag_name,
150
+ pub_date: release.published_at,
151
+ notes: release.body ?? "",
152
+ platforms: url ? {
153
+ [platform]: {
154
+ url
155
+ }
156
+ } : {}
157
+ };
158
+ return manifest;
159
+ } catch (error) {
160
+ throw error instanceof Error ? error : new Error("Failed to fetch GitHub release");
161
+ }
162
+ }
163
+ };
164
+ provider.__tauriParams = {
165
+ github_owner: owner,
166
+ github_repo: repo,
167
+ manifest_url: manifestUrl
168
+ };
169
+ return provider;
170
+ }
171
+ function selectAssetForPlatform(assets, platform) {
172
+ if (!platform) return void 0;
173
+ const lowerPlatform = platform.toLowerCase();
174
+ return assets.find((asset) => {
175
+ const name = asset.name.toLowerCase();
176
+ if (lowerPlatform === "windows-x86_64") {
177
+ return name.endsWith(".exe") || name.endsWith(".msi");
178
+ }
179
+ if (lowerPlatform === "darwin-x86_64") {
180
+ return name.endsWith(".dmg") && !name.includes("arm64") && !name.includes("aarch64");
181
+ }
182
+ if (lowerPlatform === "darwin-aarch64") {
183
+ return name.endsWith(".dmg") && (name.includes("arm64") || name.includes("aarch64"));
184
+ }
185
+ if (lowerPlatform === "linux-x86_64") {
186
+ return name.endsWith(".appimage") || name.endsWith(".AppImage") || name.endsWith(".deb") || name.endsWith(".rpm");
187
+ }
188
+ return false;
189
+ });
190
+ }
191
+
192
+ // src/providers/http.ts
193
+ function createHttpProvider(config) {
194
+ const { manifestUrl, headers } = config;
195
+ const provider = {
196
+ type: "http",
197
+ async fetchManifest() {
198
+ const init = {
199
+ method: "GET",
200
+ headers
201
+ };
202
+ try {
203
+ const res = await fetch(manifestUrl, init);
204
+ if (!res.ok) {
205
+ throw new Error(`HTTP ${res.status}`);
206
+ }
207
+ const data = await res.json();
208
+ return data;
209
+ } catch (error) {
210
+ throw error instanceof Error ? error : new Error("Failed to fetch update manifest");
211
+ }
212
+ }
213
+ };
214
+ provider.__tauriParams = { manifest_url: manifestUrl };
215
+ return provider;
216
+ }
217
+
218
+ // src/providers/s3.ts
219
+ function createS3Provider(config) {
220
+ const { bucketUrl, manifestPath = "latest/update-manifest.json" } = config;
221
+ const manifestUrl = `${bucketUrl.replace(/\/+$/, "")}/${manifestPath.replace(/^\/+/, "")}`;
222
+ const httpProvider = createHttpProvider({ manifestUrl });
223
+ const provider = {
224
+ type: "s3",
225
+ async fetchManifest() {
226
+ return httpProvider.fetchManifest();
227
+ }
228
+ };
229
+ provider.__tauriParams = { manifest_url: manifestUrl };
230
+ return provider;
231
+ }
232
+
233
+ // src/hooks/useUpdateChecker.ts
234
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
235
+ var SESSION_DISMISS_KEY = "tauri-easy-updater:dismissed-version";
236
+ function getDismissedVersion() {
237
+ if (typeof window === "undefined") return null;
238
+ try {
239
+ return window.sessionStorage.getItem(SESSION_DISMISS_KEY);
240
+ } catch {
241
+ return null;
242
+ }
243
+ }
244
+ function setDismissedVersion(version) {
245
+ if (typeof window === "undefined") return;
246
+ try {
247
+ window.sessionStorage.setItem(SESSION_DISMISS_KEY, version);
248
+ } catch {
249
+ }
250
+ }
251
+ function buildParamsFromProvider(provider, currentVersion) {
252
+ const anyProvider = provider;
253
+ const base = {
254
+ current_version: currentVersion,
255
+ manifest_url: ""
256
+ };
257
+ if (!anyProvider.__tauriParams) {
258
+ return null;
259
+ }
260
+ const { manifest_url, github_owner, github_repo } = anyProvider.__tauriParams;
261
+ if (github_owner && github_repo) {
262
+ return {
263
+ ...base,
264
+ manifest_url: manifest_url ?? "",
265
+ github_owner,
266
+ github_repo
267
+ };
268
+ }
269
+ if (manifest_url) {
270
+ return {
271
+ ...base,
272
+ manifest_url,
273
+ github_owner: null,
274
+ github_repo: null
275
+ };
276
+ }
277
+ return null;
278
+ }
279
+ function useUpdateChecker(config) {
280
+ const {
281
+ currentVersion,
282
+ provider,
283
+ checkOnStartup = true,
284
+ checkIntervalMs = 0,
285
+ silent = false
286
+ } = config;
287
+ const [updateInfo, setUpdateInfo] = useState(null);
288
+ const [isChecking, setIsChecking] = useState(false);
289
+ const [error, setError] = useState(null);
290
+ const [isDismissed, setIsDismissed] = useState(false);
291
+ const intervalRef = useRef(null);
292
+ const mountedRef = useRef(true);
293
+ useEffect(() => {
294
+ mountedRef.current = true;
295
+ const dismissed = getDismissedVersion();
296
+ if (dismissed) {
297
+ setIsDismissed(true);
298
+ }
299
+ return () => {
300
+ mountedRef.current = false;
301
+ if (intervalRef.current !== null && typeof window !== "undefined") {
302
+ window.clearInterval(intervalRef.current);
303
+ }
304
+ };
305
+ }, []);
306
+ const canUseTauri = typeof window !== "undefined";
307
+ const checkNow = useCallback(async () => {
308
+ if (!canUseTauri) {
309
+ return;
310
+ }
311
+ const params = buildParamsFromProvider(provider, currentVersion);
312
+ if (!params) {
313
+ try {
314
+ setIsChecking(true);
315
+ setError(null);
316
+ const manifest = await provider.fetchManifest();
317
+ const platformInfo = Object.values(manifest.platforms)[0];
318
+ if (!platformInfo) {
319
+ if (!silent) {
320
+ setError(new Error("No platform information in manifest"));
321
+ }
322
+ setUpdateInfo(null);
323
+ return;
324
+ }
325
+ const info = {
326
+ hasUpdate: true,
327
+ currentVersion,
328
+ latestVersion: manifest.version,
329
+ downloadUrl: platformInfo.url,
330
+ releaseNotes: manifest.notes,
331
+ pubDate: manifest.pub_date
332
+ };
333
+ if (!mountedRef.current) return;
334
+ setUpdateInfo(info);
335
+ } catch (e) {
336
+ if (!mountedRef.current) return;
337
+ if (!silent) {
338
+ setError(e instanceof Error ? e : new Error("Failed to check for updates"));
339
+ }
340
+ } finally {
341
+ if (mountedRef.current) {
342
+ setIsChecking(false);
343
+ }
344
+ }
345
+ return;
346
+ }
347
+ try {
348
+ setIsChecking(true);
349
+ setError(null);
350
+ const { invoke } = await import("@tauri-apps/api/tauri");
351
+ const result = await invoke("plugin:easy-updater|check_update", {
352
+ params
353
+ });
354
+ if (!mountedRef.current) return;
355
+ const dismissed = getDismissedVersion();
356
+ if (dismissed && dismissed === result.latestVersion) {
357
+ setIsDismissed(true);
358
+ setUpdateInfo(result);
359
+ return;
360
+ }
361
+ setUpdateInfo(result);
362
+ } catch (e) {
363
+ if (!mountedRef.current) return;
364
+ if (!silent) {
365
+ setError(e instanceof Error ? e : new Error("Failed to check for updates"));
366
+ }
367
+ } finally {
368
+ if (mountedRef.current) {
369
+ setIsChecking(false);
370
+ }
371
+ }
372
+ }, [canUseTauri, provider, currentVersion, silent]);
373
+ useEffect(() => {
374
+ if (!checkOnStartup) {
375
+ return;
376
+ }
377
+ void checkNow();
378
+ }, [checkOnStartup, checkNow]);
379
+ useEffect(() => {
380
+ if (checkIntervalMs <= 0 || typeof window === "undefined") {
381
+ return;
382
+ }
383
+ const id = window.setInterval(() => {
384
+ void checkNow();
385
+ }, checkIntervalMs);
386
+ intervalRef.current = id;
387
+ return () => {
388
+ window.clearInterval(id);
389
+ };
390
+ }, [checkIntervalMs, checkNow]);
391
+ const dismiss = useCallback(() => {
392
+ if (updateInfo) {
393
+ setDismissedVersion(updateInfo.latestVersion);
394
+ }
395
+ setIsDismissed(true);
396
+ }, [updateInfo]);
397
+ const value = useMemo(
398
+ () => ({
399
+ updateInfo,
400
+ isChecking,
401
+ error,
402
+ checkNow,
403
+ dismiss,
404
+ isDismissed
405
+ }),
406
+ [updateInfo, isChecking, error, checkNow, dismiss, isDismissed]
407
+ );
408
+ return value;
409
+ }
410
+
411
+ // src/components/UpdateBanner.tsx
412
+ import { jsx, jsxs } from "react/jsx-runtime";
413
+ function resolveTheme(theme = "auto") {
414
+ if (theme === "auto" && typeof window !== "undefined" && "matchMedia" in window) {
415
+ try {
416
+ if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
417
+ return "dark";
418
+ }
419
+ } catch {
420
+ }
421
+ }
422
+ return theme === "auto" ? "light" : theme;
423
+ }
424
+ async function openUrl(url) {
425
+ if (typeof window === "undefined") return;
426
+ try {
427
+ const { invoke } = await import("@tauri-apps/api/tauri");
428
+ await invoke("plugin:easy-updater|open_url", { url });
429
+ } catch {
430
+ try {
431
+ window.open(url, "_blank", "noopener,noreferrer");
432
+ } catch {
433
+ }
434
+ }
435
+ }
436
+ function UpdateBanner(props) {
437
+ const { updateInfo, onDismiss, position = "bottom", theme = "auto", className } = props;
438
+ const resolvedTheme = resolveTheme(theme);
439
+ const base = {
440
+ position: "fixed",
441
+ left: 0,
442
+ right: 0,
443
+ display: "flex",
444
+ alignItems: "center",
445
+ justifyContent: "space-between",
446
+ padding: "0.75rem 1rem",
447
+ fontSize: "0.875rem",
448
+ zIndex: 50
449
+ };
450
+ const positionStyle = position === "top" ? {
451
+ top: 0
452
+ } : {
453
+ bottom: 0
454
+ };
455
+ const themeStyle = resolvedTheme === "dark" ? {
456
+ backgroundColor: "rgba(15,23,42,0.95)",
457
+ color: "white",
458
+ borderTop: position === "bottom" ? "1px solid rgba(148,163,184,0.5)" : void 0,
459
+ borderBottom: position === "top" ? "1px solid rgba(148,163,184,0.5)" : void 0
460
+ } : {
461
+ backgroundColor: "rgba(248,250,252,0.98)",
462
+ color: "#020617",
463
+ borderTop: position === "bottom" ? "1px solid #e2e8f0" : void 0,
464
+ borderBottom: position === "top" ? "1px solid #e2e8f0" : void 0
465
+ };
466
+ const buttonStyle = resolvedTheme === "dark" ? {
467
+ backgroundColor: "#22c55e",
468
+ color: "#022c22"
469
+ } : {
470
+ backgroundColor: "#16a34a",
471
+ color: "white"
472
+ };
473
+ const secondaryButtonStyle = resolvedTheme === "dark" ? {
474
+ color: "#e5e7eb"
475
+ } : {
476
+ color: "#4b5563"
477
+ };
478
+ return /* @__PURE__ */ jsxs("div", { style: { ...base, ...positionStyle, ...themeStyle }, className, children: [
479
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "0.125rem" }, children: [
480
+ /* @__PURE__ */ jsxs("span", { style: { fontWeight: 500 }, children: [
481
+ "Nueva versi\xF3n ",
482
+ updateInfo.latestVersion,
483
+ " disponible"
484
+ ] }),
485
+ /* @__PURE__ */ jsxs("span", { style: { opacity: 0.8 }, children: [
486
+ "Est\xE1s usando la versi\xF3n ",
487
+ updateInfo.currentVersion,
488
+ ". Descarga la \xFAltima actualizaci\xF3n."
489
+ ] })
490
+ ] }),
491
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" }, children: [
492
+ /* @__PURE__ */ jsx(
493
+ "button",
494
+ {
495
+ type: "button",
496
+ style: {
497
+ ...buttonStyle,
498
+ borderRadius: "9999px",
499
+ padding: "0.4rem 0.9rem",
500
+ border: "none",
501
+ cursor: "pointer",
502
+ fontSize: "0.875rem",
503
+ fontWeight: 500
504
+ },
505
+ onClick: () => {
506
+ void openUrl(updateInfo.downloadUrl);
507
+ },
508
+ children: "Actualizar ahora"
509
+ }
510
+ ),
511
+ /* @__PURE__ */ jsx(
512
+ "button",
513
+ {
514
+ type: "button",
515
+ "aria-label": "Cerrar",
516
+ style: {
517
+ ...secondaryButtonStyle,
518
+ background: "transparent",
519
+ border: "none",
520
+ cursor: "pointer",
521
+ fontSize: "1rem",
522
+ lineHeight: 1
523
+ },
524
+ onClick: onDismiss,
525
+ children: "\xD7"
526
+ }
527
+ )
528
+ ] })
529
+ ] });
530
+ }
531
+
532
+ // src/components/UpdateModal.tsx
533
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
534
+ function resolveTheme2(theme = "auto") {
535
+ if (theme === "auto" && typeof window !== "undefined" && "matchMedia" in window) {
536
+ try {
537
+ if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
538
+ return "dark";
539
+ }
540
+ } catch {
541
+ }
542
+ }
543
+ return theme === "auto" ? "light" : theme;
544
+ }
545
+ async function openUrl2(url) {
546
+ if (typeof window === "undefined") return;
547
+ try {
548
+ const { invoke } = await import("@tauri-apps/api/tauri");
549
+ await invoke("plugin:easy-updater|open_url", { url });
550
+ } catch {
551
+ try {
552
+ window.open(url, "_blank", "noopener,noreferrer");
553
+ } catch {
554
+ }
555
+ }
556
+ }
557
+ function UpdateModal(props) {
558
+ const { updateInfo, onDismiss, appName, theme = "auto", className } = props;
559
+ const resolvedTheme = resolveTheme2(theme);
560
+ const overlayStyle = {
561
+ position: "fixed",
562
+ inset: 0,
563
+ backgroundColor: "rgba(15,23,42,0.6)",
564
+ display: "flex",
565
+ alignItems: "center",
566
+ justifyContent: "center",
567
+ zIndex: 60
568
+ };
569
+ const modalStyle = resolvedTheme === "dark" ? {
570
+ backgroundColor: "#020617",
571
+ color: "#e5e7eb",
572
+ borderRadius: "0.75rem",
573
+ padding: "1.5rem",
574
+ maxWidth: "28rem",
575
+ width: "100%",
576
+ boxShadow: "0 20px 25px -5px rgba(15,23,42,0.8)"
577
+ } : {
578
+ backgroundColor: "white",
579
+ color: "#0f172a",
580
+ borderRadius: "0.75rem",
581
+ padding: "1.5rem",
582
+ maxWidth: "28rem",
583
+ width: "100%",
584
+ boxShadow: "0 20px 25px -5px rgba(15,23,42,0.2)"
585
+ };
586
+ const primaryButtonStyle = resolvedTheme === "dark" ? {
587
+ backgroundColor: "#22c55e",
588
+ color: "#022c22"
589
+ } : {
590
+ backgroundColor: "#16a34a",
591
+ color: "white"
592
+ };
593
+ const secondaryButtonStyle = resolvedTheme === "dark" ? {
594
+ borderColor: "#4b5563",
595
+ color: "#e5e7eb"
596
+ } : {
597
+ borderColor: "#cbd5f5",
598
+ color: "#1f2937"
599
+ };
600
+ const textMuted = {
601
+ opacity: 0.8,
602
+ fontSize: "0.875rem"
603
+ };
604
+ const title = appName ? `${appName} tiene una nueva versi\xF3n` : "Nueva actualizaci\xF3n disponible";
605
+ return /* @__PURE__ */ jsx2("div", { style: overlayStyle, children: /* @__PURE__ */ jsxs2("div", { style: modalStyle, className, children: [
606
+ /* @__PURE__ */ jsxs2(
607
+ "div",
608
+ {
609
+ style: {
610
+ display: "flex",
611
+ justifyContent: "space-between",
612
+ alignItems: "flex-start",
613
+ marginBottom: "0.75rem"
614
+ },
615
+ children: [
616
+ /* @__PURE__ */ jsxs2("div", { children: [
617
+ /* @__PURE__ */ jsx2(
618
+ "h2",
619
+ {
620
+ style: {
621
+ fontSize: "1.125rem",
622
+ fontWeight: 600,
623
+ margin: 0,
624
+ marginBottom: "0.25rem"
625
+ },
626
+ children: title
627
+ }
628
+ ),
629
+ /* @__PURE__ */ jsxs2("p", { style: textMuted, children: [
630
+ "Versi\xF3n actual ",
631
+ updateInfo.currentVersion,
632
+ " \xB7 Nueva versi\xF3n ",
633
+ updateInfo.latestVersion
634
+ ] })
635
+ ] }),
636
+ /* @__PURE__ */ jsx2(
637
+ "button",
638
+ {
639
+ type: "button",
640
+ "aria-label": "Cerrar",
641
+ onClick: onDismiss,
642
+ style: {
643
+ background: "transparent",
644
+ border: "none",
645
+ cursor: "pointer",
646
+ fontSize: "1rem",
647
+ lineHeight: 1,
648
+ marginLeft: "0.5rem"
649
+ },
650
+ children: "\xD7"
651
+ }
652
+ )
653
+ ]
654
+ }
655
+ ),
656
+ /* @__PURE__ */ jsx2(
657
+ "div",
658
+ {
659
+ style: {
660
+ marginTop: "0.75rem",
661
+ marginBottom: "1rem",
662
+ maxHeight: "12rem",
663
+ overflowY: "auto",
664
+ padding: "0.5rem",
665
+ borderRadius: "0.5rem",
666
+ backgroundColor: resolvedTheme === "dark" ? "#020617" : "#f1f5f9",
667
+ fontSize: "0.875rem",
668
+ whiteSpace: "pre-wrap"
669
+ },
670
+ children: updateInfo.releaseNotes || "Esta actualizaci\xF3n incluye mejoras y correcciones de errores."
671
+ }
672
+ ),
673
+ /* @__PURE__ */ jsxs2(
674
+ "div",
675
+ {
676
+ style: {
677
+ display: "flex",
678
+ justifyContent: "flex-end",
679
+ gap: "0.5rem",
680
+ marginTop: "0.5rem"
681
+ },
682
+ children: [
683
+ /* @__PURE__ */ jsx2(
684
+ "button",
685
+ {
686
+ type: "button",
687
+ onClick: onDismiss,
688
+ style: {
689
+ ...secondaryButtonStyle,
690
+ background: "transparent",
691
+ padding: "0.45rem 0.9rem",
692
+ borderRadius: "9999px",
693
+ borderWidth: 1,
694
+ borderStyle: "solid",
695
+ cursor: "pointer",
696
+ fontSize: "0.875rem"
697
+ },
698
+ children: "Recordarme despu\xE9s"
699
+ }
700
+ ),
701
+ /* @__PURE__ */ jsx2(
702
+ "button",
703
+ {
704
+ type: "button",
705
+ onClick: () => {
706
+ void openUrl2(updateInfo.downloadUrl);
707
+ },
708
+ style: {
709
+ ...primaryButtonStyle,
710
+ padding: "0.45rem 0.9rem",
711
+ borderRadius: "9999px",
712
+ border: "none",
713
+ cursor: "pointer",
714
+ fontSize: "0.875rem",
715
+ fontWeight: 500
716
+ },
717
+ children: "Descargar ahora"
718
+ }
719
+ )
720
+ ]
721
+ }
722
+ )
723
+ ] }) });
724
+ }
725
+ export {
726
+ UpdateBanner,
727
+ UpdateModal,
728
+ createGitHubProvider,
729
+ createHttpProvider,
730
+ createS3Provider,
731
+ getCurrentPlatform,
732
+ isNewerVersion,
733
+ useUpdateChecker
734
+ };
735
+ //# sourceMappingURL=index.mjs.map