@buoy-gg/time-machine 7.0.41 → 7.0.42
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/lib/commonjs/components/HeaderActions.js +1 -91
- package/lib/commonjs/components/HeaderReloadButton.js +1 -58
- package/lib/commonjs/components/TimeMachineBody.js +1 -282
- package/lib/commonjs/components/TimeMachineModal.js +1 -74
- package/lib/commonjs/components/confirm.js +2 -38
- package/lib/commonjs/components/floating/NamePromptModal.js +1 -193
- package/lib/commonjs/components/floating/TimeMachineFloatingTool.js +1 -715
- package/lib/commonjs/components/floating/armedPoint.js +1 -92
- package/lib/commonjs/components/floating/barSettings.js +1 -66
- package/lib/commonjs/components/format.js +1 -24
- package/lib/commonjs/components/list/CaptureBar.js +1 -97
- package/lib/commonjs/components/list/RestoreOutcomeCard.js +1 -175
- package/lib/commonjs/components/list/SnapshotRow.js +1 -170
- package/lib/commonjs/components/list/SourcesStrip.js +1 -172
- package/lib/commonjs/components/list/UndoDeleteBar.js +1 -85
- package/lib/commonjs/components/list/WipeAllRow.js +1 -46
- package/lib/commonjs/components/preview/ItemDiffPanel.js +1 -79
- package/lib/commonjs/components/preview/PreviewFlow.js +1 -51
- package/lib/commonjs/components/preview/RestorePointNameRow.js +1 -83
- package/lib/commonjs/components/preview/RestorePreviewScreen.js +1 -1010
- package/lib/commonjs/components/preview/verdictMeta.js +1 -58
- package/lib/commonjs/components/sources.js +1 -83
- package/lib/commonjs/hooks/useTimeMachine.js +1 -24
- package/lib/commonjs/index.js +1 -161
- package/lib/commonjs/preset.js +1 -56
- package/lib/commonjs/store/routeRestore.js +1 -188
- package/lib/commonjs/store/snapshotVault.js +1 -186
- package/lib/commonjs/store/sourceIds.js +1 -9
- package/lib/commonjs/store/sourceSettings.js +1 -79
- package/lib/commonjs/store/timeMachineStore.js +1 -848
- package/lib/commonjs/sync/timeMachineSyncAdapter.js +1 -258
- package/lib/commonjs/ui/SwipeActionsRow.js +1 -178
- package/lib/commonjs/ui/primitives.js +1 -172
- package/lib/commonjs/ui/tmTheme.js +1 -118
- package/lib/module/components/HeaderActions.js +1 -85
- package/lib/module/components/HeaderReloadButton.js +1 -53
- package/lib/module/components/TimeMachineBody.js +1 -277
- package/lib/module/components/TimeMachineModal.js +1 -68
- package/lib/module/components/confirm.js +2 -33
- package/lib/module/components/floating/NamePromptModal.js +1 -188
- package/lib/module/components/floating/TimeMachineFloatingTool.js +1 -708
- package/lib/module/components/floating/armedPoint.js +1 -82
- package/lib/module/components/floating/barSettings.js +1 -57
- package/lib/module/components/format.js +1 -19
- package/lib/module/components/list/CaptureBar.js +1 -92
- package/lib/module/components/list/RestoreOutcomeCard.js +1 -169
- package/lib/module/components/list/SnapshotRow.js +1 -167
- package/lib/module/components/list/SourcesStrip.js +1 -169
- package/lib/module/components/list/UndoDeleteBar.js +1 -82
- package/lib/module/components/list/WipeAllRow.js +1 -41
- package/lib/module/components/preview/ItemDiffPanel.js +1 -74
- package/lib/module/components/preview/PreviewFlow.js +1 -46
- package/lib/module/components/preview/RestorePointNameRow.js +1 -78
- package/lib/module/components/preview/RestorePreviewScreen.js +1 -1005
- package/lib/module/components/preview/verdictMeta.js +1 -54
- package/lib/module/components/sources.js +1 -73
- package/lib/module/hooks/useTimeMachine.js +1 -19
- package/lib/module/index.js +1 -46
- package/lib/module/preset.js +1 -51
- package/lib/module/store/routeRestore.js +1 -176
- package/lib/module/store/snapshotVault.js +1 -170
- package/lib/module/store/sourceIds.js +1 -5
- package/lib/module/store/sourceSettings.js +1 -69
- package/lib/module/store/timeMachineStore.js +1 -839
- package/lib/module/sync/timeMachineSyncAdapter.js +1 -253
- package/lib/module/ui/SwipeActionsRow.js +1 -173
- package/lib/module/ui/primitives.js +1 -164
- package/lib/module/ui/tmTheme.js +1 -114
- package/lib/web/index.mjs +2 -3
- package/package.json +7 -7
- package/lib/commonjs/components/HeaderActions.js.map +0 -1
- package/lib/commonjs/components/HeaderReloadButton.js.map +0 -1
- package/lib/commonjs/components/TimeMachineBody.js.map +0 -1
- package/lib/commonjs/components/TimeMachineModal.js.map +0 -1
- package/lib/commonjs/components/confirm.js.map +0 -1
- package/lib/commonjs/components/floating/NamePromptModal.js.map +0 -1
- package/lib/commonjs/components/floating/TimeMachineFloatingTool.js.map +0 -1
- package/lib/commonjs/components/floating/armedPoint.js.map +0 -1
- package/lib/commonjs/components/floating/barSettings.js.map +0 -1
- package/lib/commonjs/components/format.js.map +0 -1
- package/lib/commonjs/components/list/CaptureBar.js.map +0 -1
- package/lib/commonjs/components/list/RestoreOutcomeCard.js.map +0 -1
- package/lib/commonjs/components/list/SnapshotRow.js.map +0 -1
- package/lib/commonjs/components/list/SourcesStrip.js.map +0 -1
- package/lib/commonjs/components/list/UndoDeleteBar.js.map +0 -1
- package/lib/commonjs/components/list/WipeAllRow.js.map +0 -1
- package/lib/commonjs/components/preview/ItemDiffPanel.js.map +0 -1
- package/lib/commonjs/components/preview/PreviewFlow.js.map +0 -1
- package/lib/commonjs/components/preview/RestorePointNameRow.js.map +0 -1
- package/lib/commonjs/components/preview/RestorePreviewScreen.js.map +0 -1
- package/lib/commonjs/components/preview/verdictMeta.js.map +0 -1
- package/lib/commonjs/components/sources.js.map +0 -1
- package/lib/commonjs/hooks/useTimeMachine.js.map +0 -1
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/preset.js.map +0 -1
- package/lib/commonjs/store/routeRestore.js.map +0 -1
- package/lib/commonjs/store/snapshotVault.js.map +0 -1
- package/lib/commonjs/store/sourceIds.js.map +0 -1
- package/lib/commonjs/store/sourceSettings.js.map +0 -1
- package/lib/commonjs/store/timeMachineStore.js.map +0 -1
- package/lib/commonjs/sync/timeMachineSyncAdapter.js.map +0 -1
- package/lib/commonjs/ui/SwipeActionsRow.js.map +0 -1
- package/lib/commonjs/ui/primitives.js.map +0 -1
- package/lib/commonjs/ui/tmTheme.js.map +0 -1
- package/lib/module/components/HeaderActions.js.map +0 -1
- package/lib/module/components/HeaderReloadButton.js.map +0 -1
- package/lib/module/components/TimeMachineBody.js.map +0 -1
- package/lib/module/components/TimeMachineModal.js.map +0 -1
- package/lib/module/components/confirm.js.map +0 -1
- package/lib/module/components/floating/NamePromptModal.js.map +0 -1
- package/lib/module/components/floating/TimeMachineFloatingTool.js.map +0 -1
- package/lib/module/components/floating/armedPoint.js.map +0 -1
- package/lib/module/components/floating/barSettings.js.map +0 -1
- package/lib/module/components/format.js.map +0 -1
- package/lib/module/components/list/CaptureBar.js.map +0 -1
- package/lib/module/components/list/RestoreOutcomeCard.js.map +0 -1
- package/lib/module/components/list/SnapshotRow.js.map +0 -1
- package/lib/module/components/list/SourcesStrip.js.map +0 -1
- package/lib/module/components/list/UndoDeleteBar.js.map +0 -1
- package/lib/module/components/list/WipeAllRow.js.map +0 -1
- package/lib/module/components/preview/ItemDiffPanel.js.map +0 -1
- package/lib/module/components/preview/PreviewFlow.js.map +0 -1
- package/lib/module/components/preview/RestorePointNameRow.js.map +0 -1
- package/lib/module/components/preview/RestorePreviewScreen.js.map +0 -1
- package/lib/module/components/preview/verdictMeta.js.map +0 -1
- package/lib/module/components/sources.js.map +0 -1
- package/lib/module/hooks/useTimeMachine.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/preset.js.map +0 -1
- package/lib/module/store/routeRestore.js.map +0 -1
- package/lib/module/store/snapshotVault.js.map +0 -1
- package/lib/module/store/sourceIds.js.map +0 -1
- package/lib/module/store/sourceSettings.js.map +0 -1
- package/lib/module/store/timeMachineStore.js.map +0 -1
- package/lib/module/sync/timeMachineSyncAdapter.js.map +0 -1
- package/lib/module/ui/SwipeActionsRow.js.map +0 -1
- package/lib/module/ui/primitives.js.map +0 -1
- package/lib/module/ui/tmTheme.js.map +0 -1
- package/lib/typescript/components/HeaderActions.d.ts.map +0 -1
- package/lib/typescript/components/HeaderReloadButton.d.ts.map +0 -1
- package/lib/typescript/components/TimeMachineBody.d.ts.map +0 -1
- package/lib/typescript/components/TimeMachineModal.d.ts.map +0 -1
- package/lib/typescript/components/confirm.d.ts.map +0 -1
- package/lib/typescript/components/floating/NamePromptModal.d.ts.map +0 -1
- package/lib/typescript/components/floating/TimeMachineFloatingTool.d.ts.map +0 -1
- package/lib/typescript/components/floating/armedPoint.d.ts.map +0 -1
- package/lib/typescript/components/floating/barSettings.d.ts.map +0 -1
- package/lib/typescript/components/format.d.ts.map +0 -1
- package/lib/typescript/components/list/CaptureBar.d.ts.map +0 -1
- package/lib/typescript/components/list/RestoreOutcomeCard.d.ts.map +0 -1
- package/lib/typescript/components/list/SnapshotRow.d.ts.map +0 -1
- package/lib/typescript/components/list/SourcesStrip.d.ts.map +0 -1
- package/lib/typescript/components/list/UndoDeleteBar.d.ts.map +0 -1
- package/lib/typescript/components/list/WipeAllRow.d.ts.map +0 -1
- package/lib/typescript/components/preview/ItemDiffPanel.d.ts.map +0 -1
- package/lib/typescript/components/preview/PreviewFlow.d.ts.map +0 -1
- package/lib/typescript/components/preview/RestorePointNameRow.d.ts.map +0 -1
- package/lib/typescript/components/preview/RestorePreviewScreen.d.ts.map +0 -1
- package/lib/typescript/components/preview/verdictMeta.d.ts.map +0 -1
- package/lib/typescript/components/sources.d.ts.map +0 -1
- package/lib/typescript/hooks/useTimeMachine.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/store/routeRestore.d.ts.map +0 -1
- package/lib/typescript/store/snapshotVault.d.ts.map +0 -1
- package/lib/typescript/store/sourceIds.d.ts.map +0 -1
- package/lib/typescript/store/sourceSettings.d.ts.map +0 -1
- package/lib/typescript/store/timeMachineStore.d.ts.map +0 -1
- package/lib/typescript/sync/timeMachineSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/ui/SwipeActionsRow.d.ts.map +0 -1
- package/lib/typescript/ui/primitives.d.ts.map +0 -1
- package/lib/typescript/ui/tmTheme.d.ts.map +0 -1
package/lib/module/ui/tmTheme.js
CHANGED
|
@@ -1,114 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Time Machine design tokens — the "modern" surface language.
|
|
5
|
-
*
|
|
6
|
-
* A grouped-inset list system (iOS Settings shape): one dark sheet, rounded
|
|
7
|
-
* glass cards holding hairline-separated rows, uppercase section labels
|
|
8
|
-
* outside the cards, and explanatory footnotes under them.
|
|
9
|
-
*
|
|
10
|
-
* COLOR COMES FROM the shared `night` palette (ui/night/nightTheme.ts) — not
|
|
11
|
-
* from a private set — so the tool reads as part of the same product as every
|
|
12
|
-
* other one. Change a value in nightTheme.ts and it lands here.
|
|
13
|
-
*
|
|
14
|
-
* Only shape, spacing and type live as literals below — those ARE the design
|
|
15
|
-
* language and have no palette equivalent.
|
|
16
|
-
*
|
|
17
|
-
* SCOPE: this is Time Machine's pilot of the new look. If it lands, promote
|
|
18
|
-
* this file (and ./primitives) into @buoy-gg/shared-ui and let the other
|
|
19
|
-
* tools import it — nothing in here is Time-Machine-specific.
|
|
20
|
-
*
|
|
21
|
-
* Note: like every StyleSheet in the repo, these values are read once at
|
|
22
|
-
* module load, so the desktop dashboard's in-place re-tint needs a reload to
|
|
23
|
-
* reach them.
|
|
24
|
-
*/
|
|
25
|
-
import { night } from "@buoy-gg/shared-ui";
|
|
26
|
-
import { monoFont } from "@buoy-gg/shared-ui";
|
|
27
|
-
/** Hex opacity suffixes, so tinted fills stay tied to the palette color. */
|
|
28
|
-
const A18 = "2E";
|
|
29
|
-
const A30 = "4D";
|
|
30
|
-
export const tm = {
|
|
31
|
-
color: {
|
|
32
|
-
/**
|
|
33
|
-
* Backing for the sticky footer (its only consumer) — night glass, same
|
|
34
|
-
* treatment as the shared stepper footer, so the star field hints through
|
|
35
|
-
* without the list reading through the CTA.
|
|
36
|
-
*/
|
|
37
|
-
sheet: "rgba(5, 5, 5, 0.92)",
|
|
38
|
-
/**
|
|
39
|
-
* A grouped card: night glass, so the star field behind the sheet shows
|
|
40
|
-
* through every card the way it does through the header chips. Cards
|
|
41
|
-
* take `groupBorder` as a hairline, or the glass reads as a smudge.
|
|
42
|
-
*/
|
|
43
|
-
group: night.color.glass,
|
|
44
|
-
groupBorder: night.color.glassBorder,
|
|
45
|
-
/** Row press / hover wash on top of a group. */
|
|
46
|
-
rowPressed: night.color.glassElevated,
|
|
47
|
-
/** Hairline between rows, inset from the left like iOS. */
|
|
48
|
-
separator: night.color.separator,
|
|
49
|
-
/** Neutral control fill (icon discs, chips, round buttons). */
|
|
50
|
-
fill: night.color.glassElevated,
|
|
51
|
-
fillStrong: night.color.fillTertiary,
|
|
52
|
-
/** Opaque ring around a badge on a glass card (the sheet's own color). */
|
|
53
|
-
ring: night.color.bg,
|
|
54
|
-
/**
|
|
55
|
-
* Opaque disc behind a Buoy icon. The icons paint their knock-outs in
|
|
56
|
-
* the color they are handed, so a translucent fill turns a floppy disk
|
|
57
|
-
* into a yellow square. Stays solid on purpose.
|
|
58
|
-
*/
|
|
59
|
-
disc: night.color.surfaceElevated,
|
|
60
|
-
label: night.color.text,
|
|
61
|
-
labelSecondary: night.color.textSecondary,
|
|
62
|
-
labelTertiary: night.color.textTertiary,
|
|
63
|
-
/** Primary action + "this is healthy" (the night brand green). */
|
|
64
|
-
accent: night.color.accent,
|
|
65
|
-
accentSoft: `${night.color.accent}${A18}`,
|
|
66
|
-
accentSoftStrong: `${night.color.accent}${A30}`,
|
|
67
|
-
/** Text/icons ON an accent fill — the brand green wants dark ink. */
|
|
68
|
-
onAccent: "#0A0A0A",
|
|
69
|
-
warning: night.color.warning,
|
|
70
|
-
warningSoft: `${night.color.warning}${A18}`,
|
|
71
|
-
danger: night.color.danger,
|
|
72
|
-
dangerSoft: `${night.color.danger}${A18}`,
|
|
73
|
-
/** Text/icons ON a danger fill. */
|
|
74
|
-
onDanger: "#FFFFFF",
|
|
75
|
-
info: night.color.info
|
|
76
|
-
},
|
|
77
|
-
radius: {
|
|
78
|
-
/** Grouped card + the capture field that visually matches one. */
|
|
79
|
-
group: 14,
|
|
80
|
-
/** Fully rounded pills and status circles. */
|
|
81
|
-
pill: 99
|
|
82
|
-
},
|
|
83
|
-
/** Horizontal inset of the grouped cards from the sheet edge. */
|
|
84
|
-
gutter: 14,
|
|
85
|
-
/** Extra inset for labels/footnotes, measured from the card edge. */
|
|
86
|
-
textInset: 16,
|
|
87
|
-
/** Left inset of a row separator, measured from the card edge. */
|
|
88
|
-
separatorInset: 16,
|
|
89
|
-
font: {
|
|
90
|
-
/** Row titles and primary values. */
|
|
91
|
-
row: 17,
|
|
92
|
-
/** Buttons and pill labels. */
|
|
93
|
-
control: 15,
|
|
94
|
-
/** Section labels, row captions, footnotes. */
|
|
95
|
-
footnote: 13,
|
|
96
|
-
/** Route paths and other monospace detail. */
|
|
97
|
-
mono: 12
|
|
98
|
-
},
|
|
99
|
-
/** iOS tracks display text slightly tighter than the default. */
|
|
100
|
-
tracking: {
|
|
101
|
-
row: -0.43,
|
|
102
|
-
control: -0.2
|
|
103
|
-
},
|
|
104
|
-
/** Standard grouped-row height before content forces it taller. */
|
|
105
|
-
rowMinHeight: 52
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Monospace family. RN native resolves a single family name only (no CSS
|
|
110
|
-
* stack), and "monospace" is the one token both platforms honor — it is what
|
|
111
|
-
* the rest of the design system uses.
|
|
112
|
-
*/
|
|
113
|
-
export const TM_MONO = monoFont;
|
|
114
|
-
//# sourceMappingURL=tmTheme.js.map
|
|
1
|
+
"use strict";import{night as o}from"@buoy-gg/shared-ui";import{monoFont as t}from"@buoy-gg/shared-ui";const r="2E";const e="4D";export const tm={color:{sheet:"rgba(5, 5, 5, 0.92)",group:o.color.glass,groupBorder:o.color.glassBorder,rowPressed:o.color.glassElevated,separator:o.color.separator,fill:o.color.glassElevated,fillStrong:o.color.fillTertiary,ring:o.color.bg,disc:o.color.surfaceElevated,label:o.color.text,labelSecondary:o.color.textSecondary,labelTertiary:o.color.textTertiary,accent:o.color.accent,accentSoft:`${o.color.accent}${r}`,accentSoftStrong:`${o.color.accent}${e}`,onAccent:"#0A0A0A",warning:o.color.warning,warningSoft:`${o.color.warning}${r}`,danger:o.color.danger,dangerSoft:`${o.color.danger}${r}`,onDanger:"#FFFFFF",info:o.color.info},radius:{group:14,pill:99},gutter:14,textInset:16,separatorInset:16,font:{row:17,control:15,footnote:13,mono:12},tracking:{row:-.43,control:-.2},rowMinHeight:52};export const TM_MONO=t;
|
package/lib/web/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var No=Object.defineProperty;var ln=Object.getOwnPropertyDescriptor;var cn=Object.getOwnPropertyNames;var dn=Object.prototype.hasOwnProperty;var un=(e,t)=>{for(var o in t)No(e,o,{get:t[o],enumerable:!0})},Ho=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cn(t))!dn.call(e,i)&&i!==o&&No(e,i,{get:()=>t[i],enumerable:!(n=ln(t,i))||n.enumerable});return e},B=(e,t,o)=>(Ho(e,t,"default"),o&&Ho(o,t,"default"));var C=process.env.NODE_ENV!=="production";typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import{getSafeCurrentRoute as pn,getSafeRouter as Bo,persistentStorage as Ft}from"@buoy-gg/shared-ui/web";var Ut="@react_buoy_time_machine:pending-route",mn=6e4,fn=8e3,hn=250;function gn(e){return{pathname:e.pathname,href:e.href}}function Be(){let e=pn();return e?gn(e):null}function _o(){return Be()}function De(){return Bo()!=null}function wt(e){let t={pathname:e.pathname,href:e.href},o=Bo();if(!o?.navigate)return{...t,status:"unavailable",error:"expo-router is not available on this device"};try{return o.navigate(e.href),{...t,status:"navigated"}}catch(n){return{...t,status:"failed",error:String(n)}}}async function Fo(e,t){let o={...e,savedAt:Date.now(),...t?{snapshotName:t}:{}};await Ft.setItem(Ut,JSON.stringify(o))}async function bn(){try{await Ft.removeItem(Ut)}catch{}}async function yn(){try{let e=await Ft.getItem(Ut);if(!e)return null;let t=JSON.parse(e);return typeof t?.href!="string"||!t.href||typeof t.savedAt!="number"?null:{pathname:typeof t.pathname=="string"?t.pathname:t.href,href:t.href,savedAt:t.savedAt,snapshotName:typeof t.snapshotName=="string"?t.snapshotName:void 0}}catch{return null}}var Wo=!1;function Kt(){Wo||(Wo=!0,(async()=>{let e=await yn();if(!e||(await bn(),Date.now()-e.savedAt>mn))return;let t=Date.now()+fn;for(;!De()&&Date.now()<t;)await new Promise(o=>setTimeout(o,100));De()&&(await new Promise(o=>setTimeout(o,hn)),wt({pathname:e.pathname,href:e.href}))})())}var w={};un(w,{AccessibilityInfo:()=>Dn,ActivityIndicator:()=>_e,Alert:()=>Gt,Animated:()=>Fe,AppRegistry:()=>Mn,AppState:()=>On,Appearance:()=>Cn,BackHandler:()=>An,Button:()=>Tn,CheckBox:()=>Jn,Clipboard:()=>Ln,DeviceEventEmitter:()=>si,Dimensions:()=>zn,Easing:()=>En,FlatList:()=>qt,I18nManager:()=>Vn,Image:()=>Gn,ImageBackground:()=>jn,InteractionManager:()=>Hn,Keyboard:()=>$n,KeyboardAvoidingView:()=>Yt,LayoutAnimation:()=>Nn,Linking:()=>Wn,LogBox:()=>ii,Modal:()=>Jt,NativeEventEmitter:()=>Bn,NativeModules:()=>kn,PanResponder:()=>jt,Picker:()=>qn,PixelRatio:()=>_n,Platform:()=>Me,Pressable:()=>xt,ProgressBar:()=>Yn,RefreshControl:()=>Xn,SafeAreaView:()=>Qn,ScrollView:()=>tt,SectionList:()=>Zn,Share:()=>Fn,StatusBar:()=>ei,StyleSheet:()=>T,Switch:()=>vn,Text:()=>l,TextInput:()=>Ce,Touchable:()=>ti,TouchableHighlight:()=>xn,TouchableNativeFeedback:()=>oi,TouchableOpacity:()=>v,TouchableWithoutFeedback:()=>Rn,UIManager:()=>Un,Vibration:()=>Kn,View:()=>u,VirtualizedList:()=>ri,YellowBox:()=>ni,findNodeHandle:()=>In,unstable_createElement:()=>Pn,useColorScheme:()=>ai,useLocaleContext:()=>li,useWindowDimensions:()=>Xt});B(w,ha);import*as ha from"react-native-web";import{unstable_createElement as Pn,NativeModules as kn,AccessibilityInfo as Dn,Animated as Fe,Appearance as Cn,AppRegistry as Mn,AppState as On,BackHandler as An,Clipboard as Ln,Dimensions as zn,Easing as En,I18nManager as Vn,Keyboard as $n,InteractionManager as Hn,LayoutAnimation as Nn,Linking as Wn,NativeEventEmitter as Bn,PanResponder as jt,PixelRatio as _n,Platform as Me,Share as Fn,StyleSheet as T,UIManager as Un,Vibration as Kn,CheckBox as Jn,FlatList as qt,Image as Gn,ImageBackground as jn,KeyboardAvoidingView as Yt,Picker as qn,ProgressBar as Yn,RefreshControl as Xn,SafeAreaView as Qn,SectionList as Zn,StatusBar as ei,Touchable as ti,TouchableNativeFeedback as oi,VirtualizedList as ri,YellowBox as ni,LogBox as ii,DeviceEventEmitter as si,useColorScheme as ai,useLocaleContext as li,useWindowDimensions as Xt}from"react-native-web";import*as E from"react-native-web";import{createElement as Sn,forwardRef as wn}from"react";function re(e){let t=wn((n,i)=>{let{accessibilityState:s,accessibilityValue:a,...d}=n;for(let p of["busy","checked","disabled","expanded","selected"])s?.[p]!==void 0&&d[`aria-${p}`]===void 0&&(d[`aria-${p}`]=s[p]);for(let[p,y]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))a?.[p]!==void 0&&d[`aria-${y}`]===void 0&&(d[`aria-${y}`]=a[p]);return Sn(e,{...d,ref:i})}),o=e.State;return o&&Object.assign(t,{State:o}),t.displayName=e.displayName??e.name??"NativeWebView",t}var u=re(E.View),l=re(E.Text),Ce=re(E.TextInput),v=re(E.TouchableOpacity),xn=re(E.TouchableHighlight),Rn=re(E.TouchableWithoutFeedback),xt=re(E.Pressable),tt=re(E.ScrollView),Jt=re(E.Modal),vn=re(E.Switch),_e=re(E.ActivityIndicator),Tn=re(E.Button),In=E.findNodeHandle,Gt={alert(e,t,o,n){if(typeof document>"u")return;let i=document.createElement("dialog");i.dataset.buoyRoot="",i.setAttribute("aria-label",e),i.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let s=document.createElement("h2");if(s.textContent=e,s.style.cssText="font-size:18px;margin:0 0 12px",i.appendChild(s),t){let y=document.createElement("p");y.textContent=t,y.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",i.appendChild(y)}let a=document.createElement("div");a.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let d=o?.length?o:[{text:"OK"}],p=()=>{i.close?.(),i.remove()};for(let y of d){let L=document.createElement("button");L.type="button",L.textContent=y.text??"OK",L.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${y.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,L.onclick=()=>{p(),y.onPress?.()},a.appendChild(L)}i.addEventListener("cancel",y=>{y.preventDefault(),n?.cancelable!==!1&&(p(),n?.onDismiss?.())}),i.appendChild(a),document.body.appendChild(i),i.showModal?i.showModal():i.setAttribute("open","")}};import{TimeMachineIcon as qs,TIME_MACHINE_ICON_COLOR as Ys}from"@buoy-gg/shared-ui/web";import{useRef as Bs,useState as rn,useSyncExternalStore as tn}from"react";import{useSafeAreaInsets as _s,useLimit as Fs,ToolEmptyState as Us,getFloatingTools as Ks,subscribeFloatingTools as Js}from"@buoy-gg/shared-ui/web";import{useToolHost as Gs}from"@buoy-gg/core/web";import{useEffect as yi,useState as Si,useSyncExternalStore as wi}from"react";import{getStateSnapshotProviders as uo,subscribeToStateSnapshotProviders as xi}from"@buoy-gg/shared-ui/web";import{getStateSnapshotProvider as tr,getStateSnapshotProviders as vt,scheduleReloadApp as ui,superJsonDeserialize as ao,superJsonSerialize as pi}from"@buoy-gg/shared-ui/web";import{objectDiff as mi}from"@buoy-gg/shared-ui/web/dataViewer";import{persistentStorage as ye}from"@buoy-gg/shared-ui/web";var Qt="@react_buoy_time_machine:index",ot="@react_buoy_time_machine:snap:";async function Uo(){try{let e=await ye.getItem(Qt);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}async function Zt(e){await ye.setItem(Qt,JSON.stringify(e))}async function rt(e,t){let o=JSON.stringify(e);e.meta.sizeBytes=o.length,await ye.setItem(ot+e.meta.id,JSON.stringify(e));let n=[e.meta,...t.filter(i=>i.id!==e.meta.id)];return await Zt(n),n}async function ue(e){try{let t=await ye.getItem(ot+e);return t?JSON.parse(t):null}catch{return null}}async function eo(e,t){await ye.removeItem(ot+e);let o=t.filter(n=>n.id!==e);return await Zt(o),o}async function Rt(e,t,o){let n=a=>a.id===e?t(a):a,i=o.map(n);await ye.setItem(Qt,JSON.stringify(i));let s=await ue(e);return s&&(s.meta=n(s.meta),await ye.setItem(ot+e,JSON.stringify(s))),i}function Ko(e,t,o){return Rt(e,n=>{let i={...n};return t&&t.length>0?i.scope=t:delete i.scope,i},o)}function Jo(e,t,o){return Rt(e,n=>{let i={...n};return delete i.scope,t&&t.length>0?i.excludedKeys=t:delete i.excludedKeys,i},o)}function Go(e,t,o){return Rt(e,n=>({...n,restoreRoute:t}),o)}function to(e,t,o){return Rt(e,n=>({...n,lastRestoredAt:t}),o)}async function jo(e,t,o){let n=await ue(e);if(!n)return null;let i={meta:{...n.meta,id:`${n.meta.id}_copy_${Date.now().toString(36)}`,name:t,createdAt:Date.now(),lastRestoredAt:void 0},data:n.data};return delete i.meta.lastRestoredAt,{metas:await rt(i,o),meta:i.meta}}async function qo(e){return ue(e)}async function Yo(e,t){return rt(e,t)}async function Xo(e,t,o){let n=o.map(s=>s.id===e?{...s,name:t}:s);await Zt(n);let i=await ue(e);return i&&(i.meta.name=t,await ye.setItem(ot+e,JSON.stringify(i))),n}import{definePersistedSetting as ci,devToolsStorageKeys as di}from"@buoy-gg/shared-ui/web";var Zo=ci(di.timeMachine.disabledSources(),[],{sanitize:e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}),Oe=new Set,Qo=!1,oo=null,ro=new Set,er=()=>ro.forEach(e=>e());function ae(){return Qo?Promise.resolve():(oo||(oo=Zo.load().then(e=>{Oe.size===0&&(Oe=new Set(e),er())}).finally(()=>{Qo=!0})),oo)}function no(e){return ro.add(e),()=>{ro.delete(e)}}function io(){return Oe}function Z(e){return!Oe.has(e)}function so(e,t){if(t===!Oe.has(e))return;let o=new Set(Oe);t?o.delete(e):o.add(e),Oe=o,er(),Zo.save([...o])}var Se="route";var it=["storage","redux","zustand","jotai","query"];function fi(e){let t=new Date,o=`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`,n=e?e.pathname==="/"?"Home":e.pathname:null;return n?`${n} \xB7 ${o}`:`Snapshot \xB7 ${o}`}function hi(e,t){let o=new Set(t.map(n=>n.name));if(!o.has(e))return e;for(let n=2;n<1e3;n++){let i=`${e} (${n})`;if(!o.has(i))return i}return e}function Ue(e){return!!e.route&&(e.restoreRoute??!0)}var lo="Before last restore",$=null;function nt(e){return{ok:!1,applied:0,skipped:[{id:"*",reason:e}],warnings:[]}}var or=0;function rr(){return or+=1,`snap_${Date.now().toString(36)}_${or.toString(36)}`}var co=class{constructor(){this.state={snapshots:[],hasLoaded:!1,busy:null,lastOutcome:null,preview:null,remoteProviders:null,remoteRoute:null,recentlyDeleted:null};this.previewRunId=0;this.listeners=new Set;this.loadPromise=null;this.subscribe=t=>(this.listeners.add(t),this.ensureLoaded(),()=>{this.listeners.delete(t)})}getState(){return this.state}setState(t){this.state={...this.state,...t},this.listeners.forEach(o=>{try{o()}catch{}})}ensureLoaded(){return $?Promise.resolve():(this.loadPromise||(this.loadPromise=Uo().then(t=>{$||this.setState({snapshots:t,hasLoaded:!0})})),this.loadPromise)}replaceFromSnapshot(t){this.setState({snapshots:t.snapshots??[],busy:t.busy??null,lastOutcome:t.lastOutcome??null,remoteProviders:t.providers??[],remoteRoute:t.route??{available:!1},hasLoaded:!0})}async capture(t,o,n){if($)return(await $("capture",{name:t,sourceIds:o})).snapshot;await this.ensureLoaded(),await ae(),this.setState({busy:"capture"});try{let i=vt().filter(h=>h.status().canCapture&&Z(h.id)&&(!o||o.includes(h.id))),s={},a={};for(let h of i)try{let P=await h.capture();s[h.id]=pi(P.data),a[h.id]={warnings:P.warnings}}catch(P){a[h.id]={warnings:[`capture failed: ${String(P)}`]}}let d=Z(Se)?Be():null,p=this.state.snapshots;if(n?.safety)for(let h of p.filter(P=>P.safety))p=await eo(h.id,p);let y={meta:{id:rr(),name:n?.safety?lo:hi(t.trim()||fi(d),p),createdAt:Date.now(),sizeBytes:0,...d?{route:d}:{},...n?.safety?{safety:!0}:{},sources:a},data:s},L=await rt(y,p);return this.setState({snapshots:L}),y.meta}finally{this.setState({busy:null})}}async captureBaseline(){if($)return(await $("captureBaseline",{})).snapshot;await this.ensureLoaded(),await ae();let t={meta:{id:rr(),name:"Fresh install",createdAt:Date.now(),sizeBytes:0,baseline:!0,sources:{}},data:{}},o=await rt(t,this.state.snapshots);return this.setState({snapshots:o}),t.meta}async restore(t,o,n,i){if($){let a=await $("restore",{id:t,mode:o,excludeKeys:n,restoreRoute:i?.restoreRoute});return this.setState({lastOutcome:a}),a}await this.ensureLoaded(),await ae();let s;i?.safetyCapture&&!this.state.snapshots.find(a=>a.id===t)?.safety&&(s=(await this.capture(lo,void 0,{safety:!0})).id),this.setState({busy:"restore"});try{let a=await ue(t);if(!a)throw new Error(`No snapshot with id "${t}"`);let d={snapshotId:t,snapshotName:a.meta.name,mode:o,at:Date.now(),willReload:!1,results:{},...s?{safetySnapshotId:s}:{}};if(a.meta.baseline){for(let x of vt())if(x.clear)try{d.results[x.id]=await x.clear()}catch(N){d.results[x.id]=nt(String(N))}return d.willReload=this.scheduleReload("buoy time-machine baseline"),this.setState({lastOutcome:d}),d}let p=[...it.filter(x=>x in a.data),...Object.keys(a.data).filter(x=>!it.includes(x))],y=x=>{let N=new Map;for(let W of x){let S=W.indexOf("::");if(S<=0)continue;let Q=W.slice(0,S),ce=W.slice(S+2),q=N.get(Q)??[];q.push(ce),N.set(Q,q)}return N},L=n??a.meta.excludedKeys??[],h=y(L),P=!n&&a.meta.scope?.length?y(a.meta.scope):null,H=Z(Se)&&(i?.restoreRoute??Ue(a.meta));if(o==="reload"){if(a.data.storage&&Z("storage")&&(!P||P.has("storage"))&&(d.results.storage=await this.restoreSource("storage",a.data.storage,h.get("storage"),P?.get("storage"))),H){let x=a.meta.route;try{await Fo(x,a.meta.name),d.route={...x,status:"deferred"}}catch(N){d.route={...x,status:"failed",error:String(N)}}}return d.willReload=this.scheduleReload("buoy time-machine restore"),this.setState({lastOutcome:d,snapshots:await to(t,d.at,this.state.snapshots)}),d}for(let x of p)if(!(P&&!P.has(x))){if(!Z(x)){d.results[x]={ok:!0,applied:0,skipped:[],warnings:["Switched off in Sources; left as it is"]};continue}d.results[x]=await this.restoreSource(x,a.data[x],h.get(x),P?.get(x))}return H&&(d.route=wt(a.meta.route)),this.setState({lastOutcome:d,snapshots:await to(t,d.at,this.state.snapshots)}),d}finally{this.setState({busy:null})}}async restoreSource(t,o,n,i){let s=tr(t);if(!s)return nt("provider not available (package missing or not initialized)");let a=s.status();if(!a.canRestore)return nt(a.detail??"restore unavailable");try{let d=n?.length||i?.length?{...n?.length?{excludeKeys:n}:{},...i?.length?{includeKeys:i}:{}}:void 0;return await s.restore(ao(o),d)}catch(d){return nt(String(d))}}scheduleReload(t){try{return ui({reason:t}),!0}catch{return!1}}async delete(t){if($){await $("delete",{id:t});return}await this.ensureLoaded(),await ae();let o=await qo(t),n=await eo(t,this.state.snapshots);this.setState({snapshots:n,recentlyDeleted:o?{stored:o,at:Date.now()}:null})}async undoDelete(){let t=this.state.recentlyDeleted;if(!t)return;let o=await Yo(t.stored,this.state.snapshots);this.setState({snapshots:o,recentlyDeleted:null})}clearRecentlyDeleted(){this.state.recentlyDeleted&&this.setState({recentlyDeleted:null})}async setRestoreRoute(t,o){if($){await $("setRestoreRoute",{id:t,restoreRoute:o});return}await this.ensureLoaded(),await ae();let n=await Go(t,o,this.state.snapshots);this.setState({snapshots:n})}async duplicate(t){if($)return(await $("duplicate",{id:t}))?.snapshot??null;await this.ensureLoaded(),await ae();let o=this.state.snapshots.find(i=>i.id===t);if(!o)return null;let n=await jo(t,`${o.name} copy`,this.state.snapshots);return n?(this.setState({snapshots:n.metas}),n.meta):null}async rename(t,o){if($){await $("rename",{id:t,name:o});return}await this.ensureLoaded(),await ae();let n=await Xo(t,o,this.state.snapshots);this.setState({snapshots:n})}async setScope(t,o){if($){await $("setScope",{id:t,scope:o});return}await this.ensureLoaded(),await ae();let n=await Ko(t,o,this.state.snapshots);this.setState({snapshots:n})}async setExclusions(t,o){if($){await $("setExclusions",{id:t,excludedKeys:o});return}await this.ensureLoaded(),await ae();let n=await Jo(t,o,this.state.snapshots);this.setState({snapshots:n})}clearLastOutcome(){this.setState({lastOutcome:null})}async wipeAll(){if($){let t=await $("wipeAll",{});return this.setState({lastOutcome:t}),t}this.setState({busy:"restore"});try{let t={snapshotId:"wipe-all",snapshotName:"Wipe all",mode:"reload",at:Date.now(),willReload:!1,results:{}};for(let o of vt())if(o.clear)try{t.results[o.id]=await o.clear()}catch(n){t.results[o.id]=nt(String(n))}return t.willReload=this.scheduleReload("buoy time-machine wipe all"),this.setState({lastOutcome:t}),t}finally{this.setState({busy:null})}}clearPreview(){this.previewRunId+=1,this.setState({preview:null})}async buildPreview(t,o="current"){if($){let s=++this.previewRunId;this.setState({preview:{left:o,right:t,building:!0,builtAt:Date.now(),sources:[]}});try{let a=await $("preview",{id:t==="current"?void 0:t.snapshotId,compareTo:o==="current"?void 0:o.snapshotId});if(s!==this.previewRunId)return;this.setState({preview:{left:o,right:t,building:!1,builtAt:Date.now(),sources:a.sources??[]}})}catch(a){if(s!==this.previewRunId)return;this.setState({preview:{left:o,right:t,building:!1,builtAt:Date.now(),sources:[{id:"error",label:"Preview",items:[],notes:[],error:String(a)}]}})}return}await this.ensureLoaded(),await ae();let n=++this.previewRunId;this.setState({preview:{left:o,right:t,building:!0,builtAt:Date.now(),sources:[]}});let i=async s=>{if(s==="current")return null;let a=await ue(s.snapshotId);if(!a)throw new Error(`No snapshot with id "${s.snapshotId}"`);return a.data};try{if(t==="current")throw new Error("preview target must be a snapshot");let[s,a]=await Promise.all([i(o),ue(t.snapshotId)]);if(n!==this.previewRunId)return;if(!a)throw new Error(`No snapshot with id "${t.snapshotId}"`);let d=a.data,p=a.meta.baseline===!0,y=p?vt().filter(h=>h.clear).map(h=>h.id):[...it.filter(h=>h in d),...Object.keys(d).filter(h=>!it.includes(h))],L=[];for(let h of y){if(!Z(h))continue;if(await new Promise(x=>setTimeout(x,0)),n!==this.previewRunId)return;let P=tr(h),H=P?.label??h;try{let x=p?void 0:ao(d[h]),N=s===null?void 0:h in s?ao(s[h]):void 0,W;if(!P)W={items:[{key:h,label:H,verdict:"wont-apply",reason:"tool not installed \u2014 restore skips this source"}],notes:[]};else if(P.previewItems)W=await P.previewItems(x,N);else{let S=mi(N,x);W={items:[{key:h,label:H,verdict:S.equal?"unchanged":"changed",oldValue:N,newValue:x}],notes:S.truncated?["diff truncated (large value)"]:[]}}if(n!==this.previewRunId)return;L.push({id:h,label:H,...W})}catch(x){L.push({id:h,label:H,items:[],notes:[],error:String(x)})}this.setState({preview:{left:o,right:t,building:!0,builtAt:Date.now(),sources:[...L]}})}if(n!==this.previewRunId)return;this.setState({preview:{left:o,right:t,building:!1,builtAt:Date.now(),sources:L}})}catch(s){if(n!==this.previewRunId)return;this.setState({preview:{left:o,right:t,building:!1,builtAt:Date.now(),sources:[{id:"error",label:"Preview",items:[],notes:[],error:String(s)}]}})}}},g=new co;function gi(e){$=e,e||g.replaceFromSnapshot({})}function bi(e){g.replaceFromSnapshot(e)}function Ae(){return wi(g.subscribe,()=>g.getState())}function Tt(){let[e,t]=Si(uo);return yi(()=>(t(uo()),xi(()=>t(uo()))),[]),e}import{Children as Ti}from"react";import{ChevronRight as Ii}from"@buoy-gg/shared-ui/web";import{night as U}from"@buoy-gg/shared-ui/web";import{monoFont as Ri}from"@buoy-gg/shared-ui/web";var po="2E",vi="4D",r={color:{sheet:"rgba(5, 5, 5, 0.92)",group:U.color.glass,groupBorder:U.color.glassBorder,rowPressed:U.color.glassElevated,separator:U.color.separator,fill:U.color.glassElevated,fillStrong:U.color.fillTertiary,ring:U.color.bg,disc:U.color.surfaceElevated,label:U.color.text,labelSecondary:U.color.textSecondary,labelTertiary:U.color.textTertiary,accent:U.color.accent,accentSoft:`${U.color.accent}${po}`,accentSoftStrong:`${U.color.accent}${vi}`,onAccent:"#0A0A0A",warning:U.color.warning,warningSoft:`${U.color.warning}${po}`,danger:U.color.danger,dangerSoft:`${U.color.danger}${po}`,onDanger:"#FFFFFF",info:U.color.info},radius:{group:14,pill:99},gutter:14,textInset:16,separatorInset:16,font:{row:17,control:15,footnote:13,mono:12},tracking:{row:-.43,control:-.2},rowMinHeight:52},Ke=Ri;import{jsx as Le,jsxs as Pi}from"react/jsx-runtime";function Je({children:e,testID:t}){return Le(l,{style:we.sectionLabel,testID:t,children:e})}function Ge({children:e,centered:t,tone:o="secondary",testID:n}){return Le(l,{style:[we.footnote,t?we.footnoteCentered:null,o==="warning"?we.footnoteWarning:null],testID:n,children:e})}function ze({children:e,style:t}){let o=Ti.toArray(e);return Le(u,{style:[we.group,t],children:o.map((n,i)=>Pi(u,{children:[i>0?Le(u,{style:we.separator}):null,n]},n.key??i))})}function mo(){return Le(Ii,{size:16,color:r.color.labelTertiary})}function nr({label:e,color:t,background:o,testID:n}){return Le(u,{style:[we.pill,{backgroundColor:o}],children:Le(l,{style:[we.pillText,{color:t}],testID:n,children:e})})}var we=T.create({sectionLabel:{color:r.color.labelSecondary,fontSize:r.font.footnote,fontWeight:"500",textTransform:"uppercase",letterSpacing:.4,paddingHorizontal:r.gutter+r.textInset,paddingTop:22,paddingBottom:7},footnote:{color:r.color.labelSecondary,fontSize:r.font.footnote,lineHeight:r.font.footnote*1.35,paddingHorizontal:r.gutter+r.textInset,paddingTop:7},footnoteCentered:{textAlign:"center"},footnoteWarning:{color:r.color.warning},group:{marginHorizontal:r.gutter,backgroundColor:r.color.group,borderRadius:r.radius.group,borderWidth:1,borderColor:r.color.groupBorder,overflow:"hidden"},separator:{height:T.hairlineWidth,marginLeft:r.separatorInset,backgroundColor:r.color.separator},pill:{height:32,paddingHorizontal:15,borderRadius:r.radius.pill,alignItems:"center",justifyContent:"center"},pillText:{fontSize:r.font.control,fontWeight:"600",letterSpacing:r.tracking.control}});import{JotaiIcon as ki,QueryIcon as Di,ReduxIcon as Ci,RoutesIcon as Mi,StorageIcon as Oi,TimeMachineIcon as Ai,ZustandIcon as Li}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as zi}from"react";var Ei={storage:Oi,redux:Ci,zustand:Li,jotai:ki,query:Di,route:Mi};function ir(e){return Ei[e]??Ai}function sr(){let{remoteProviders:e,remoteRoute:t}=Ae(),o=Tt(),n=zi(no,io,io),i=e?e.map(a=>({...a,enabled:a.enabled!==!1})):o.map(a=>({id:a.id,label:a.label,...a.status(),enabled:!n.has(a.id)})),s=e?t?.available===!0:De();return[...i,{id:Se,label:"Route",canCapture:s,canRestore:s,enabled:e?t?.enabled!==!1:!n.has(Se),detail:s?"Recorded with every snapshot \u2014 a restore can take you back":"No Expo Router detected \u2014 snapshots record no route"}]}function Vi(e){let t=globalThis.confirm;return t?t(e):!0}function st(e,t,o,n){if(Me.OS==="web"){Vi(`${e}
|
|
1
|
+
"use client";var pr=Object.defineProperty;var To=Object.getOwnPropertyDescriptor;var Co=Object.getOwnPropertyNames;var $o=Object.prototype.hasOwnProperty;var zo=(e,t)=>{for(var r in t)pr(e,r,{get:t[r],enumerable:true})},mr=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Co(t))!$o.call(e,n)&&n!==r&&pr(e,n,{get:()=>t[n],enumerable:!(i=To(t,n))||i.enumerable});return e},Lo=(e,t,r)=>(mr(e,t,"default"),r&&mr(r,t,"default"));var fr=process.env.NODE_ENV!=="production";typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import{getSafeCurrentRoute as Po,getSafeRouter as gr,persistentStorage as kt}from"@buoy-gg/shared-ui/web";var Tt="@react_buoy_time_machine:pending-route",Ao=6e4,Oo=8e3,Ho=250;function Eo(e){return{pathname:e.pathname,href:e.href}}function ot(){let e=Po();return e?Eo(e):null}function Bo(){return ot()}function He(){return gr()!=null}function Ct(e){let t={pathname:e.pathname,href:e.href},r=gr();if(!r?.navigate)return{...t,status:"unavailable",error:"expo-router is not available on this device"};try{return r.navigate(e.href),{...t,status:"navigated"}}catch(i){return{...t,status:"failed",error:String(i)}}}async function Wo(e,t){let r={...e,savedAt:Date.now(),...t?{snapshotName:t}:{}};await kt.setItem(Tt,JSON.stringify(r))}async function jo(){try{await kt.removeItem(Tt)}catch{}}async function No(){try{let e=await kt.getItem(Tt);if(!e)return null;let t=JSON.parse(e);return typeof t?.href!="string"||!t.href||typeof t.savedAt!="number"?null:{pathname:typeof t.pathname=="string"?t.pathname:t.href,href:t.href,savedAt:t.savedAt,snapshotName:typeof t.snapshotName=="string"?t.snapshotName:void 0}}catch{return null}}var br=false;function yr(){br||(br=true,(async()=>{let e=await No();if(!e||(await jo(),Date.now()-e.savedAt>Ao))return;let t=Date.now()+Oo;for(;!He()&&Date.now()<t;)await new Promise(r=>setTimeout(r,100));He()&&(await new Promise(r=>setTimeout(r,Ho)),Ct({pathname:e.pathname,href:e.href}))})())}var wr={};zo(wr,{AccessibilityInfo:()=>_o,ActivityIndicator:()=>at,Alert:()=>Dr,Animated:()=>Ee,AppRegistry:()=>qo,AppState:()=>Jo,Appearance:()=>Ko,BackHandler:()=>Uo,Button:()=>Ln,CheckBox:()=>cn,Clipboard:()=>Yo,DeviceEventEmitter:()=>In,Dimensions:()=>Xo,Easing:()=>Go,FlatList:()=>vr,I18nManager:()=>Qo,Image:()=>dn,ImageBackground:()=>un,InteractionManager:()=>en,Keyboard:()=>Zo,KeyboardAvoidingView:()=>xr,LayoutAnimation:()=>tn,Linking:()=>rn,LogBox:()=>xn,Modal:()=>Rr,NativeEventEmitter:()=>on,NativeModules:()=>Fo,PanResponder:()=>Sr,Picker:()=>hn,PixelRatio:()=>nn,Platform:()=>nt,Pressable:()=>$t,ProgressBar:()=>pn,RefreshControl:()=>mn,SafeAreaView:()=>fn,ScrollView:()=>zt,SectionList:()=>gn,Share:()=>an,StatusBar:()=>bn,StyleSheet:()=>O,Switch:()=>zn,Text:()=>c,TextInput:()=>it,Touchable:()=>yn,TouchableHighlight:()=>Cn,TouchableNativeFeedback:()=>wn,TouchableOpacity:()=>P,TouchableWithoutFeedback:()=>$n,UIManager:()=>sn,Vibration:()=>ln,View:()=>u,VirtualizedList:()=>Sn,YellowBox:()=>vn,findNodeHandle:()=>Pn,unstable_createElement:()=>Vo,useColorScheme:()=>Rn,useLocaleContext:()=>Dn,useWindowDimensions:()=>Ir});Lo(wr,Mo);import*as Mo from"react-native-web";import{unstable_createElement as Vo,NativeModules as Fo,AccessibilityInfo as _o,Animated as Ee,Appearance as Ko,AppRegistry as qo,AppState as Jo,BackHandler as Uo,Clipboard as Yo,Dimensions as Xo,Easing as Go,I18nManager as Qo,Keyboard as Zo,InteractionManager as en,LayoutAnimation as tn,Linking as rn,NativeEventEmitter as on,PanResponder as Sr,PixelRatio as nn,Platform as nt,Share as an,StyleSheet as O,UIManager as sn,Vibration as ln,CheckBox as cn,FlatList as vr,Image as dn,ImageBackground as un,KeyboardAvoidingView as xr,Picker as hn,ProgressBar as pn,RefreshControl as mn,SafeAreaView as fn,SectionList as gn,StatusBar as bn,Touchable as yn,TouchableNativeFeedback as wn,VirtualizedList as Sn,YellowBox as vn,LogBox as xn,DeviceEventEmitter as In,useColorScheme as Rn,useLocaleContext as Dn,useWindowDimensions as Ir}from"react-native-web";import*as J from"react-native-web";import{createElement as kn,forwardRef as Tn}from"react";function Q(e){let t=Tn((i,n)=>{let{accessibilityState:a,accessibilityValue:s,...h}=i;for(let m of["busy","checked","disabled","expanded","selected"])a?.[m]!==void 0&&h[`aria-${m}`]===void 0&&(h[`aria-${m}`]=a[m]);for(let[m,y]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))s?.[m]!==void 0&&h[`aria-${y}`]===void 0&&(h[`aria-${y}`]=s[m]);return kn(e,{...h,ref:n})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var u=Q(J.View),c=Q(J.Text),it=Q(J.TextInput),P=Q(J.TouchableOpacity),Cn=Q(J.TouchableHighlight),$n=Q(J.TouchableWithoutFeedback),$t=Q(J.Pressable),zt=Q(J.ScrollView),Rr=Q(J.Modal),zn=Q(J.Switch),at=Q(J.ActivityIndicator),Ln=Q(J.Button),Pn=J.findNodeHandle,Dr={alert(e,t,r,i){if(typeof document>"u")return;let n=document.createElement("dialog");n.dataset.buoyRoot="",n.setAttribute("aria-label",e),n.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let a=document.createElement("h2");if(a.textContent=e,a.style.cssText="font-size:18px;margin:0 0 12px",n.appendChild(a),t){let y=document.createElement("p");y.textContent=t,y.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",n.appendChild(y)}let s=document.createElement("div");s.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let h=r?.length?r:[{text:"OK"}],m=()=>{n.close?.(),n.remove()};for(let y of h){let d=document.createElement("button");d.type="button",d.textContent=y.text??"OK",d.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${y.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,d.onclick=()=>{m(),y.onPress?.()},s.appendChild(d)}n.addEventListener("cancel",y=>{y.preventDefault(),i?.cancelable!==false&&(m(),i?.onDismiss?.())}),n.appendChild(s),document.body.appendChild(n),n.showModal?n.showModal():n.setAttribute("open","")}};import{TimeMachineIcon as An,TIME_MACHINE_ICON_COLOR as On}from"@buoy-gg/shared-ui/web";import{useRef as Hn,useState as kr,useSyncExternalStore as Tr}from"react";import{useSafeAreaInsets as En,useLimit as Bn,ToolEmptyState as Wn,getFloatingTools as jn,subscribeFloatingTools as Nn}from"@buoy-gg/shared-ui/web";import{useToolHost as Mn}from"@buoy-gg/core/web";import{useEffect as Vn,useState as Fn,useSyncExternalStore as _n}from"react";import{getStateSnapshotProviders as Lt,subscribeToStateSnapshotProviders as Kn}from"@buoy-gg/shared-ui/web";import{getStateSnapshotProvider as Cr,getStateSnapshotProviders as st,scheduleReloadApp as qn,superJsonDeserialize as Pt,superJsonSerialize as Jn}from"@buoy-gg/shared-ui/web";import{objectDiff as Un}from"@buoy-gg/shared-ui/web/dataViewer";import{persistentStorage as me}from"@buoy-gg/shared-ui/web";var At="@react_buoy_time_machine:index",Be="@react_buoy_time_machine:snap:";async function Yn(){try{let e=await me.getItem(At);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}async function Ot(e){await me.setItem(At,JSON.stringify(e))}async function lt(e,t){let r=JSON.stringify(e);e.meta.sizeBytes=r.length,await me.setItem(Be+e.meta.id,JSON.stringify(e));let i=[e.meta,...t.filter(n=>n.id!==e.meta.id)];return await Ot(i),i}async function fe(e){try{let t=await me.getItem(Be+e);return t?JSON.parse(t):null}catch{return null}}async function $r(e,t){await me.removeItem(Be+e);let r=t.filter(i=>i.id!==e);return await Ot(r),r}async function ct(e,t,r){let i=s=>s.id===e?t(s):s,n=r.map(i);await me.setItem(At,JSON.stringify(n));let a=await fe(e);return a&&(a.meta=i(a.meta),await me.setItem(Be+e,JSON.stringify(a))),n}function Xn(e,t,r){return ct(e,i=>{let n={...i};return t&&t.length>0?n.scope=t:delete n.scope,n},r)}function Gn(e,t,r){return ct(e,i=>{let n={...i};return delete n.scope,t&&t.length>0?n.excludedKeys=t:delete n.excludedKeys,n},r)}function Qn(e,t,r){return ct(e,i=>({...i,restoreRoute:t}),r)}function zr(e,t,r){return ct(e,i=>({...i,lastRestoredAt:t}),r)}async function Zn(e,t,r){let i=await fe(e);if(!i)return null;let n={meta:{...i.meta,id:`${i.meta.id}_copy_${Date.now().toString(36)}`,name:t,createdAt:Date.now(),lastRestoredAt:void 0},data:i.data};return delete n.meta.lastRestoredAt,{metas:await lt(n,r),meta:n.meta}}async function ei(e){return fe(e)}async function ti(e,t){return lt(e,t)}async function ri(e,t,r){let i=r.map(a=>a.id===e?{...a,name:t}:a);await Ot(i);let n=await fe(e);return n&&(n.meta.name=t,await me.setItem(Be+e,JSON.stringify(n))),i}import{definePersistedSetting as oi,devToolsStorageKeys as ni}from"@buoy-gg/shared-ui/web";var Lr=oi(ni.timeMachine.disabledSources(),[],{sanitize:e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}),xe=new Set,Pr=false,Ht=null,Et=new Set,Ar=()=>Et.forEach(e=>e());function ae(){return Pr?Promise.resolve():(Ht||(Ht=Lr.load().then(e=>{xe.size===0&&(xe=new Set(e),Ar())}).finally(()=>{Pr=true})),Ht)}function Or(e){return Et.add(e),()=>{Et.delete(e)}}function Hr(){return xe}function se(e){return!xe.has(e)}function Er(e,t){if(t===!xe.has(e))return;let r=new Set(xe);t?r.delete(e):r.add(e),xe=r,Ar(),Lr.save([...r])}var We="route";var je=["storage","redux","zustand","jotai","query"];function ii(e){let t=new Date,r=`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`,i=e?e.pathname==="/"?"Home":e.pathname:null;return i?`${i} \xB7 ${r}`:`Snapshot \xB7 ${r}`}function ai(e,t){let r=new Set(t.map(i=>i.name));if(!r.has(e))return e;for(let i=2;i<1e3;i++){let n=`${e} (${i})`;if(!r.has(n))return n}return e}function dt(e){return!!e.route&&(e.restoreRoute??true)}var Bt="Before last restore",A=null;function Ne(e){return{ok:false,applied:0,skipped:[{id:"*",reason:e}],warnings:[]}}var Br=0;function Wr(){return Br+=1,`snap_${Date.now().toString(36)}_${Br.toString(36)}`}var si=class{constructor(){this.state={snapshots:[],hasLoaded:false,busy:null,lastOutcome:null,preview:null,remoteProviders:null,remoteRoute:null,recentlyDeleted:null};this.previewRunId=0;this.listeners=new Set;this.loadPromise=null;this.subscribe=e=>(this.listeners.add(e),this.ensureLoaded(),()=>{this.listeners.delete(e)})}getState(){return this.state}setState(e){this.state={...this.state,...e},this.listeners.forEach(t=>{try{t()}catch{}})}ensureLoaded(){return A?Promise.resolve():(this.loadPromise||(this.loadPromise=Yn().then(e=>{A||this.setState({snapshots:e,hasLoaded:true})})),this.loadPromise)}replaceFromSnapshot(e){this.setState({snapshots:e.snapshots??[],busy:e.busy??null,lastOutcome:e.lastOutcome??null,remoteProviders:e.providers??[],remoteRoute:e.route??{available:false},hasLoaded:true})}async capture(e,t,r){if(A)return(await A("capture",{name:e,sourceIds:t})).snapshot;await this.ensureLoaded(),await ae(),this.setState({busy:"capture"});try{let i=st().filter(d=>d.status().canCapture&&se(d.id)&&(!t||t.includes(d.id))),n={},a={};for(let d of i)try{let k=await d.capture();n[d.id]=Jn(k.data),a[d.id]={warnings:k.warnings}}catch(k){a[d.id]={warnings:[`capture failed: ${String(k)}`]}}let s=se(We)?ot():null,h=this.state.snapshots;if(r?.safety)for(let d of h.filter(k=>k.safety))h=await $r(d.id,h);let m={meta:{id:Wr(),name:r?.safety?Bt:ai(e.trim()||ii(s),h),createdAt:Date.now(),sizeBytes:0,...s?{route:s}:{},...r?.safety?{safety:true}:{},sources:a},data:n},y=await lt(m,h);return this.setState({snapshots:y}),m.meta}finally{this.setState({busy:null})}}async captureBaseline(){if(A)return(await A("captureBaseline",{})).snapshot;await this.ensureLoaded(),await ae();let e={meta:{id:Wr(),name:"Fresh install",createdAt:Date.now(),sizeBytes:0,baseline:true,sources:{}},data:{}},t=await lt(e,this.state.snapshots);return this.setState({snapshots:t}),e.meta}async restore(e,t,r,i){if(A){let a=await A("restore",{id:e,mode:t,excludeKeys:r,restoreRoute:i?.restoreRoute});return this.setState({lastOutcome:a}),a}await this.ensureLoaded(),await ae();let n;i?.safetyCapture&&!this.state.snapshots.find(a=>a.id===e)?.safety&&(n=(await this.capture(Bt,void 0,{safety:true})).id),this.setState({busy:"restore"});try{let a=await fe(e);if(!a)throw new Error(`No snapshot with id "${e}"`);let s={snapshotId:e,snapshotName:a.meta.name,mode:t,at:Date.now(),willReload:false,results:{},...n?{safetySnapshotId:n}:{}};if(a.meta.baseline){for(let b of st())if(b.clear)try{s.results[b.id]=await b.clear()}catch(H){s.results[b.id]=Ne(String(H))}return s.willReload=this.scheduleReload("buoy time-machine baseline"),this.setState({lastOutcome:s}),s}let h=[...je.filter(b=>b in a.data),...Object.keys(a.data).filter(b=>!je.includes(b))],m=b=>{let H=new Map;for(let W of b){let j=W.indexOf("::");if(j<=0)continue;let w=W.slice(0,j),U=W.slice(j+2),ee=H.get(w)??[];ee.push(U),H.set(w,ee)}return H},y=r??a.meta.excludedKeys??[],d=m(y),k=!r&&a.meta.scope?.length?m(a.meta.scope):null,L=se(We)&&(i?.restoreRoute??dt(a.meta));if(t==="reload"){if(a.data.storage&&se("storage")&&(!k||k.has("storage"))&&(s.results.storage=await this.restoreSource("storage",a.data.storage,d.get("storage"),k?.get("storage"))),L){let b=a.meta.route;try{await Wo(b,a.meta.name),s.route={...b,status:"deferred"}}catch(H){s.route={...b,status:"failed",error:String(H)}}}return s.willReload=this.scheduleReload("buoy time-machine restore"),this.setState({lastOutcome:s,snapshots:await zr(e,s.at,this.state.snapshots)}),s}for(let b of h)if(!(k&&!k.has(b))){if(!se(b)){s.results[b]={ok:true,applied:0,skipped:[],warnings:["Switched off in Sources; left as it is"]};continue}s.results[b]=await this.restoreSource(b,a.data[b],d.get(b),k?.get(b))}return L&&(s.route=Ct(a.meta.route)),this.setState({lastOutcome:s,snapshots:await zr(e,s.at,this.state.snapshots)}),s}finally{this.setState({busy:null})}}async restoreSource(e,t,r,i){let n=Cr(e);if(!n)return Ne("provider not available (package missing or not initialized)");let a=n.status();if(!a.canRestore)return Ne(a.detail??"restore unavailable");try{let s=r?.length||i?.length?{...r?.length?{excludeKeys:r}:{},...i?.length?{includeKeys:i}:{}}:void 0;return await n.restore(Pt(t),s)}catch(s){return Ne(String(s))}}scheduleReload(e){try{return qn({reason:e}),true}catch{return false}}async delete(e){if(A){await A("delete",{id:e});return}await this.ensureLoaded(),await ae();let t=await ei(e),r=await $r(e,this.state.snapshots);this.setState({snapshots:r,recentlyDeleted:t?{stored:t,at:Date.now()}:null})}async undoDelete(){let e=this.state.recentlyDeleted;if(!e)return;let t=await ti(e.stored,this.state.snapshots);this.setState({snapshots:t,recentlyDeleted:null})}clearRecentlyDeleted(){this.state.recentlyDeleted&&this.setState({recentlyDeleted:null})}async setRestoreRoute(e,t){if(A){await A("setRestoreRoute",{id:e,restoreRoute:t});return}await this.ensureLoaded(),await ae();let r=await Qn(e,t,this.state.snapshots);this.setState({snapshots:r})}async duplicate(e){if(A)return(await A("duplicate",{id:e}))?.snapshot??null;await this.ensureLoaded(),await ae();let t=this.state.snapshots.find(i=>i.id===e);if(!t)return null;let r=await Zn(e,`${t.name} copy`,this.state.snapshots);return r?(this.setState({snapshots:r.metas}),r.meta):null}async rename(e,t){if(A){await A("rename",{id:e,name:t});return}await this.ensureLoaded(),await ae();let r=await ri(e,t,this.state.snapshots);this.setState({snapshots:r})}async setScope(e,t){if(A){await A("setScope",{id:e,scope:t});return}await this.ensureLoaded(),await ae();let r=await Xn(e,t,this.state.snapshots);this.setState({snapshots:r})}async setExclusions(e,t){if(A){await A("setExclusions",{id:e,excludedKeys:t});return}await this.ensureLoaded(),await ae();let r=await Gn(e,t,this.state.snapshots);this.setState({snapshots:r})}clearLastOutcome(){this.setState({lastOutcome:null})}async wipeAll(){if(A){let e=await A("wipeAll",{});return this.setState({lastOutcome:e}),e}this.setState({busy:"restore"});try{let e={snapshotId:"wipe-all",snapshotName:"Wipe all",mode:"reload",at:Date.now(),willReload:false,results:{}};for(let t of st())if(t.clear)try{e.results[t.id]=await t.clear()}catch(r){e.results[t.id]=Ne(String(r))}return e.willReload=this.scheduleReload("buoy time-machine wipe all"),this.setState({lastOutcome:e}),e}finally{this.setState({busy:null})}}clearPreview(){this.previewRunId+=1,this.setState({preview:null})}async buildPreview(e,t="current"){if(A){let n=++this.previewRunId;this.setState({preview:{left:t,right:e,building:true,builtAt:Date.now(),sources:[]}});try{let a=await A("preview",{id:e==="current"?void 0:e.snapshotId,compareTo:t==="current"?void 0:t.snapshotId});if(n!==this.previewRunId)return;this.setState({preview:{left:t,right:e,building:false,builtAt:Date.now(),sources:a.sources??[]}})}catch(a){if(n!==this.previewRunId)return;this.setState({preview:{left:t,right:e,building:false,builtAt:Date.now(),sources:[{id:"error",label:"Preview",items:[],notes:[],error:String(a)}]}})}return}await this.ensureLoaded(),await ae();let r=++this.previewRunId;this.setState({preview:{left:t,right:e,building:true,builtAt:Date.now(),sources:[]}});let i=async n=>{if(n==="current")return null;let a=await fe(n.snapshotId);if(!a)throw new Error(`No snapshot with id "${n.snapshotId}"`);return a.data};try{if(e==="current")throw new Error("preview target must be a snapshot");let[n,a]=await Promise.all([i(t),fe(e.snapshotId)]);if(r!==this.previewRunId)return;if(!a)throw new Error(`No snapshot with id "${e.snapshotId}"`);let s=a.data,h=a.meta.baseline===true,m=h?st().filter(d=>d.clear).map(d=>d.id):[...je.filter(d=>d in s),...Object.keys(s).filter(d=>!je.includes(d))],y=[];for(let d of m){if(!se(d))continue;if(await new Promise(b=>setTimeout(b,0)),r!==this.previewRunId)return;let k=Cr(d),L=k?.label??d;try{let b=h?void 0:Pt(s[d]),H=n===null?void 0:d in n?Pt(n[d]):void 0,W;if(!k)W={items:[{key:d,label:L,verdict:"wont-apply",reason:"tool not installed \u2014 restore skips this source"}],notes:[]};else if(k.previewItems)W=await k.previewItems(b,H);else{let j=Un(H,b);W={items:[{key:d,label:L,verdict:j.equal?"unchanged":"changed",oldValue:H,newValue:b}],notes:j.truncated?["diff truncated (large value)"]:[]}}if(r!==this.previewRunId)return;y.push({id:d,label:L,...W})}catch(b){y.push({id:d,label:L,items:[],notes:[],error:String(b)})}this.setState({preview:{left:t,right:e,building:true,builtAt:Date.now(),sources:[...y]}})}if(r!==this.previewRunId)return;this.setState({preview:{left:t,right:e,building:false,builtAt:Date.now(),sources:y}})}catch(n){if(r!==this.previewRunId)return;this.setState({preview:{left:t,right:e,building:false,builtAt:Date.now(),sources:[{id:"error",label:"Preview",items:[],notes:[],error:String(n)}]}})}}},v=new si;function li(e){A=e,e||v.replaceFromSnapshot({})}function ci(e){v.replaceFromSnapshot(e)}function ut(){return _n(v.subscribe,()=>v.getState())}function jr(){let[e,t]=Fn(Lt);return Vn(()=>(t(Lt()),Kn(()=>t(Lt()))),[]),e}import{Children as di}from"react";import{ChevronRight as ui}from"@buoy-gg/shared-ui/web";import{night as N}from"@buoy-gg/shared-ui/web";import{monoFont as hi}from"@buoy-gg/shared-ui/web";var Wt="2E",pi="4D",o={color:{sheet:"rgba(5, 5, 5, 0.92)",group:N.color.glass,groupBorder:N.color.glassBorder,rowPressed:N.color.glassElevated,separator:N.color.separator,fill:N.color.glassElevated,fillStrong:N.color.fillTertiary,ring:N.color.bg,disc:N.color.surfaceElevated,label:N.color.text,labelSecondary:N.color.textSecondary,labelTertiary:N.color.textTertiary,accent:N.color.accent,accentSoft:`${N.color.accent}${Wt}`,accentSoftStrong:`${N.color.accent}${pi}`,onAccent:"#0A0A0A",warning:N.color.warning,warningSoft:`${N.color.warning}${Wt}`,danger:N.color.danger,dangerSoft:`${N.color.danger}${Wt}`,onDanger:"#FFFFFF",info:N.color.info},radius:{group:14,pill:99},gutter:14,textInset:16,separatorInset:16,font:{row:17,control:15,footnote:13,mono:12},tracking:{row:-.43,control:-.2},rowMinHeight:52},ht=hi;import{jsx as Ie,jsxs as mi}from"react/jsx-runtime";function pt({children:e,testID:t}){return Ie(c,{style:ge.sectionLabel,testID:t,children:e})}function Me({children:e,centered:t,tone:r="secondary",testID:i}){return Ie(c,{style:[ge.footnote,t?ge.footnoteCentered:null,r==="warning"?ge.footnoteWarning:null],testID:i,children:e})}function mt({children:e,style:t}){let r=di.toArray(e);return Ie(u,{style:[ge.group,t],children:r.map((i,n)=>mi(u,{children:[n>0?Ie(u,{style:ge.separator}):null,i]},i.key??n))})}function Nr(){return Ie(ui,{size:16,color:o.color.labelTertiary})}function fi({label:e,color:t,background:r,testID:i}){return Ie(u,{style:[ge.pill,{backgroundColor:r}],children:Ie(c,{style:[ge.pillText,{color:t}],testID:i,children:e})})}var ge=O.create({sectionLabel:{color:o.color.labelSecondary,fontSize:o.font.footnote,fontWeight:"500",textTransform:"uppercase",letterSpacing:.4,paddingHorizontal:o.gutter+o.textInset,paddingTop:22,paddingBottom:7},footnote:{color:o.color.labelSecondary,fontSize:o.font.footnote,lineHeight:o.font.footnote*1.35,paddingHorizontal:o.gutter+o.textInset,paddingTop:7},footnoteCentered:{textAlign:"center"},footnoteWarning:{color:o.color.warning},group:{marginHorizontal:o.gutter,backgroundColor:o.color.group,borderRadius:o.radius.group,borderWidth:1,borderColor:o.color.groupBorder,overflow:"hidden"},separator:{height:O.hairlineWidth,marginLeft:o.separatorInset,backgroundColor:o.color.separator},pill:{height:32,paddingHorizontal:15,borderRadius:o.radius.pill,alignItems:"center",justifyContent:"center"},pillText:{fontSize:o.font.control,fontWeight:"600",letterSpacing:o.tracking.control}});import{JotaiIcon as gi,QueryIcon as bi,ReduxIcon as yi,RoutesIcon as wi,StorageIcon as Si,TimeMachineIcon as vi,ZustandIcon as xi}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as Ii}from"react";var Ri={storage:Si,redux:yi,zustand:xi,jotai:gi,query:bi,route:wi};function Di(e){return Ri[e]??vi}function ki(){let{remoteProviders:e,remoteRoute:t}=ut(),r=jr(),i=Ii(Or,Hr,Hr),n=e?e.map(s=>({...s,enabled:s.enabled!==false})):r.map(s=>({id:s.id,label:s.label,...s.status(),enabled:!i.has(s.id)})),a=e?t?.available===true:He();return[...n,{id:We,label:"Route",canCapture:a,canRestore:a,enabled:e?t?.enabled!==false:!i.has(We),detail:a?"Recorded with every snapshot \u2014 a restore can take you back":"No Expo Router detected \u2014 snapshots record no route"}]}function Ti(e){let t=globalThis.confirm;return t?t(e):true}function jt(e,t,r,i){if(nt.OS==="web"){Ti(`${e}
|
|
3
2
|
|
|
4
|
-
${t}`)&&n();return}Gt.alert(e,t,[{text:"Cancel",style:"cancel"},{text:o,style:"destructive",onPress:n}])}import{useState as $i}from"react";import{jsx as fo,jsxs as Hi}from"react/jsx-runtime";function ar({disabled:e,busy:t,onCapture:o}){let[n,i]=$i(""),s=()=>{e||(o(n),i(""))};return Hi(u,{style:at.bar,children:[fo(Ce,{style:at.input,value:n,onChangeText:i,placeholder:"Name this restore point\u2026",placeholderTextColor:r.color.labelTertiary,editable:!e,onSubmitEditing:s,returnKeyType:"done",testID:"time-machine-name-input"}),fo(v,{style:[at.button,e?at.buttonDisabled:null],onPress:s,disabled:e,accessibilityRole:"button",accessibilityLabel:"Capture restore point",testID:"time-machine-capture",children:fo(l,{style:at.buttonText,children:t?"Capturing\u2026":"Capture"})})]})}var at=T.create({bar:{flexDirection:"row",alignItems:"center",gap:8,marginHorizontal:r.gutter,backgroundColor:r.color.group,borderRadius:r.radius.group,borderWidth:1,borderColor:r.color.groupBorder,paddingLeft:r.textInset,padding:6},input:{flex:1,minWidth:0,color:r.color.label,fontSize:r.font.row,letterSpacing:r.tracking.row,padding:0,backgroundColor:"transparent"},button:{height:34,paddingHorizontal:16,borderRadius:r.radius.pill,backgroundColor:r.color.accent,alignItems:"center",justifyContent:"center"},buttonDisabled:{opacity:.4},buttonText:{color:r.color.onAccent,fontSize:r.font.control,fontWeight:"600",letterSpacing:r.tracking.control}});import{X as Ni}from"@buoy-gg/shared-ui/web";import{jsx as ve,jsxs as Re}from"react/jsx-runtime";var Wi={top:10,bottom:10,left:10,right:10};function Pt(e){if(Object.values(e.results).some(o=>!o.ok||o.skipped.length>0))return!0;let t=e.route;return t?.status==="failed"||t?.status==="unavailable"}function It({glyph:e,text:t,ok:o,testID:n}){return Re(l,{style:[xe.line,{color:o?r.color.accent:r.color.warning}],numberOfLines:2,testID:n,children:[Re(l,{style:xe.glyph,children:[e," "]}),t]})}var ho="time-machine-outcome-route";function Bi({route:e}){return e.status==="navigated"?ve(It,{glyph:"\u2713",ok:!0,text:`route \u2014 ${e.href}`,testID:ho}):e.status==="deferred"?ve(It,{glyph:"\u21BB",ok:!0,text:`route \u2014 ${e.href} after reload`,testID:ho}):ve(It,{glyph:"\u2715",ok:!1,text:`route \u2014 ${e.error??e.status}`,testID:ho})}function lr({outcome:e}){let t=Object.entries(e.results),o=e.mode==="reload"||e.willReload;return Re(u,{style:xe.card,testID:"time-machine-outcome",children:[Re(u,{style:xe.headerRow,children:[Re(l,{style:xe.title,numberOfLines:1,testID:"time-machine-outcome-title",children:["Restored \u201C",e.snapshotName,"\u201D",o?" \xB7 reloading":""]}),ve(v,{onPress:()=>g.clearLastOutcome(),hitSlop:Wi,accessibilityRole:"button",accessibilityLabel:"Dismiss restore result",testID:"time-machine-outcome-dismiss",children:ve(Ni,{size:13,color:r.color.labelSecondary})})]}),t.length===0&&!e.route?ve(l,{style:xe.empty,testID:"time-machine-outcome-empty",children:"No sources restored."}):null,e.route?ve(Bi,{route:e.route}):null,t.map(([n,i])=>Re(u,{children:[ve(It,{testID:`time-machine-outcome-${n}`,glyph:i.ok?"\u2713":"\u2715",ok:i.ok,text:`${n} \u2014 applied ${i.applied}${i.skipped.length>0?`, skipped ${i.skipped.length}`:""}`}),i.skipped.slice(0,3).map(s=>Re(l,{style:xe.detail,numberOfLines:2,children:[s.id,": ",s.reason]},s.id)),i.warnings.slice(0,3).map(s=>Re(l,{style:xe.detail,numberOfLines:2,children:["\u26A0 ",s]},s))]},n))]})}var xe=T.create({card:{marginHorizontal:r.gutter,marginTop:12,backgroundColor:r.color.group,borderRadius:r.radius.group,borderWidth:1,borderColor:r.color.groupBorder,padding:14,gap:4},headerRow:{flexDirection:"row",alignItems:"center",gap:10,marginBottom:2},title:{flex:1,color:r.color.label,fontSize:15,fontWeight:"600",letterSpacing:r.tracking.control},line:{fontSize:r.font.footnote,lineHeight:r.font.footnote*1.4},glyph:{fontWeight:"700"},detail:{color:r.color.labelTertiary,fontSize:r.font.mono,lineHeight:r.font.mono*1.4,paddingLeft:14},empty:{color:r.color.labelSecondary,fontSize:r.font.footnote}});import{useEffect as _i,useRef as cr}from"react";import{jsx as kt,jsxs as Ui}from"react/jsx-runtime";var ur=84,dr=8,Te=null;function Fi(e,t){let o=!1,n=a=>{o=a,a?(Te&&Te!==i&&Te(),Te=i):Te===i&&(Te=null),Fe.spring(e,{toValue:a?-t:0,useNativeDriver:!0,bounciness:0,speed:18}).start()},i=()=>n(!1);return{pan:jt.create({onMoveShouldSetPanResponder:(a,d)=>Math.abs(d.dx)>Math.abs(d.dy)*1.5?d.dx<-dr||o&&d.dx>dr:!1,onPanResponderMove:(a,d)=>{let p=o?-t:0;e.setValue(Math.min(0,Math.max(-t,p+d.dx)))},onPanResponderRelease:(a,d)=>{let p=(o?-t:0)+d.dx;n(d.vx<-.5?!0:d.vx>.5?!1:p<-t/2)},onPanResponderTerminate:()=>n(o)}),close:i}}function pr({children:e,actions:t,testID:o}){let n=ur*t.length,i=cr(new Fe.Value(0)).current,s=cr(null);s.current===null&&(s.current=Fi(i,n));let{pan:a,close:d}=s.current;_i(()=>()=>{Te===d&&(Te=null)},[d]);let p=i.interpolate({inputRange:[-24,0],outputRange:[1,0],extrapolate:"clamp"});return Ui(u,{style:lt.clip,children:[kt(Fe.View,{style:[lt.actionLayer,{width:n,opacity:p}],children:t.map(y=>kt(v,{style:[lt.action,y.background?{backgroundColor:y.background}:null],onPress:()=>{d(),y.onPress()},accessibilityLabel:y.label,testID:y.testID??(o?`${o}-${y.label.toLowerCase()}`:void 0),children:kt(l,{style:[lt.actionText,y.color?{color:y.color}:null],numberOfLines:1,children:y.label})},y.label))}),kt(Fe.View,{style:[lt.content,{transform:[{translateX:i}]}],...a.panHandlers,children:e})]})}var lt=T.create({clip:{overflow:"hidden"},actionLayer:{position:"absolute",top:0,bottom:0,right:0,flexDirection:"row"},action:{width:ur,height:"100%",backgroundColor:r.color.fillStrong,alignItems:"center",justifyContent:"center",paddingHorizontal:6},actionText:{color:r.color.label,fontSize:r.font.footnote,fontWeight:"600",letterSpacing:r.tracking.control},content:{backgroundColor:r.color.group}});function Ee(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;let o=Math.round(t/60);if(o<60)return`${o}m ago`;let n=Math.round(o/60);return n<24?`${n}h ago`:`${Math.round(n/24)}d ago`}function mr(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}import{jsx as Ve,jsxs as go}from"react/jsx-runtime";function fr(e){if(e.baseline)return"Wipes to fresh install";let t=[Ee(e.createdAt),mr(e.sizeBytes),`${Object.keys(e.sources).length} sources`];return e.excludedKeys?.length?t.push(`skips ${e.excludedKeys.length}`):e.scope?.length&&t.push(`scoped (${e.scope.length})`),e.safety&&t.unshift("safety copy"),t.join(" \xB7 ")}function hr({meta:e,busy:t,armed:o=!1,onOpen:n,onRestore:i,onDelete:s,onDuplicate:a,onArm:d}){let p=`time-machine-snap-${e.id}`;return Ve(pr,{testID:p,actions:[{label:"Bar",onPress:d},{label:"Dup",onPress:a},{label:"Delete",onPress:s,background:r.color.danger,color:r.color.onDanger}],children:go(u,{style:me.row,children:[go(v,{style:me.text,onPress:n,activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:`${e.name}. ${fr(e)}. Open restore preview`,testID:p,children:[Ve(l,{style:me.name,numberOfLines:1,testID:`${p}-name`,children:e.name}),o?Ve(l,{style:me.armed,numberOfLines:1,testID:`${p}-armed`,children:"On the action bar"}):null,Ve(l,{style:me.meta,numberOfLines:1,testID:`${p}-meta`,children:fr(e)}),e.lastRestoredAt?go(l,{style:me.restored,numberOfLines:1,testID:`${p}-restored`,children:["Restored ",Ee(e.lastRestoredAt)]}):null,e.route?Ve(l,{style:me.route,numberOfLines:1,testID:`${p}-route`,children:e.route.href}):null]}),Ve(v,{onPress:i,disabled:t,style:[me.restore,t?me.actionDisabled:null],accessibilityRole:"button",accessibilityLabel:e.baseline?"Wipe and reload":"Restore",testID:`${p}-restore`,children:Ve(nr,{testID:`${p}-restore-label`,label:e.baseline?"Wipe":"Restore",color:e.baseline?r.color.danger:r.color.accent,background:e.baseline?r.color.dangerSoft:r.color.accentSoft})})]})})}var me=T.create({row:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:r.textInset},text:{flex:1,minWidth:0,paddingVertical:11},restore:{justifyContent:"center"},name:{color:r.color.label,fontSize:r.font.row,fontWeight:"600",letterSpacing:r.tracking.row},meta:{color:r.color.labelSecondary,fontSize:r.font.footnote,marginTop:2,fontVariant:["tabular-nums"]},restored:{color:r.color.accent,fontSize:r.font.footnote,marginTop:2},armed:{color:r.color.accent,fontSize:r.font.footnote,marginTop:2},route:{color:r.color.labelTertiary,fontFamily:Ke,fontSize:r.font.mono,marginTop:4},actionDisabled:{opacity:.4}});import{useEffect as Ki}from"react";import{jsx as br,jsxs as gr}from"react/jsx-runtime";var Ji=8e3;function yr({name:e,at:t,onUndo:o,onExpire:n}){return Ki(()=>{let i=setTimeout(n,Ji);return()=>clearTimeout(i)},[t]),gr(u,{style:bo.bar,testID:"time-machine-undo-bar",children:[gr(l,{style:bo.text,numberOfLines:1,testID:"time-machine-undo-text",children:["Deleted \u201C",e,"\u201D"]}),br(v,{onPress:o,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",testID:"time-machine-undo-delete",children:br(l,{style:bo.undo,children:"Undo"})})]})}var bo=T.create({bar:{flexDirection:"row",alignItems:"center",gap:12,marginHorizontal:r.gutter,marginTop:12,minHeight:46,paddingHorizontal:r.textInset,backgroundColor:r.color.group,borderRadius:r.radius.group,borderWidth:1,borderColor:r.color.groupBorder},text:{flex:1,color:r.color.labelSecondary,fontSize:r.font.control,letterSpacing:r.tracking.control},undo:{color:r.color.accent,fontSize:r.font.control,fontWeight:"600",letterSpacing:r.tracking.control}});import{NightSwitch as Gi}from"@buoy-gg/shared-ui/web";import{jsx as pe,jsxs as yo}from"react/jsx-runtime";var ji={storage:"Settings, sign-in and other things saved on the device",redux:"Data the whole app shares between screens",zustand:"Data the whole app shares between screens",jotai:"Small pieces of data screens share",query:"Data the app loaded from the server",route:"Which screen you were on"};function qi(e){return ji[e.id]??"App data"}function Yi(e){return e.enabled?e.canRestore?null:{text:"Can be saved but not put back",tone:"warn"}:{text:"Off \xB7 left as it is",tone:"off"}}function Xi({source:e,onToggle:t}){let o=ir(e.id),n=qi(e),i=Yi(e);return yo(u,{style:fe.row,testID:`time-machine-source-${e.id}`,accessibilityLabel:`${e.label}: ${n}${i?`. ${i.text}`:""}`,children:[pe(u,{style:fe.disc,children:pe(o,{size:22,bgColor:r.color.disc})}),yo(u,{style:fe.text,children:[pe(l,{style:fe.label,numberOfLines:1,testID:`time-machine-source-${e.id}-label`,children:e.label}),pe(l,{style:fe.description,numberOfLines:2,testID:`time-machine-source-${e.id}-description`,children:n}),i?pe(l,{style:[fe.state,fe[`state_${i.tone}`]],numberOfLines:1,testID:i.tone==="off"?`time-machine-source-${e.id}-off`:`time-machine-source-${e.id}-detail`,children:i.text}):null]}),pe(u,{testID:`time-machine-source-${e.id}-switch`,children:pe(Gi,{value:e.enabled,disabled:!t,onValueChange:s=>t?.(e.id,s)})})]})}function Sr({sources:e,onToggle:t}){let o=e.filter(n=>n.canCapture);return yo(ze,{children:[o.map(n=>pe(Xi,{source:n,onToggle:t},n.id)),o.length===0?pe(u,{style:fe.row,testID:"time-machine-sources-empty",children:pe(l,{style:fe.description,children:"No state tools are set up in this app."})}):null]})}var fe=T.create({row:{flexDirection:"row",alignItems:"center",gap:12,minHeight:r.rowMinHeight,paddingHorizontal:r.textInset,paddingVertical:10},disc:{width:36,height:36,borderRadius:r.radius.pill,backgroundColor:r.color.disc,alignItems:"center",justifyContent:"center"},text:{flex:1,minWidth:0,gap:2},label:{color:r.color.label,fontSize:r.font.row,fontWeight:"500",letterSpacing:r.tracking.row},description:{fontSize:r.font.footnote,lineHeight:r.font.footnote*1.3,color:r.color.labelSecondary},state:{fontSize:r.font.mono,lineHeight:r.font.mono*1.3,fontWeight:"600",marginTop:1},state_off:{color:r.color.labelTertiary},state_warn:{color:r.color.warning}});import{jsx as wr}from"react/jsx-runtime";function xr({disabled:e,onWipe:t}){return wr(v,{style:[So.row,e?So.disabled:null],onPress:t,disabled:e,accessibilityRole:"button",testID:"time-machine-wipe-all",children:wr(l,{style:So.label,children:"Wipe All App State\u2026"})})}var So=T.create({row:{minHeight:r.rowMinHeight,alignItems:"center",justifyContent:"center"},disabled:{opacity:.4},label:{color:r.color.danger,fontSize:r.font.row,letterSpacing:r.tracking.row}});import{memo as Cs,useCallback as $e,useEffect as Yr,useMemo as Ht,useRef as Oo,useState as Ao}from"react";import{ChevronUp as Qr,AlertTriangle as Ms,RefreshCw as Os,useSafeAreaInsets as As}from"@buoy-gg/shared-ui/web";import{useToolHeader as Ls,useToolHost as zs}from"@buoy-gg/core/web";import{night as zt}from"@buoy-gg/shared-ui/web";import{useToolHost as Ss}from"@buoy-gg/core/web";import{night as wo,scheduleReloadApp as Qi}from"@buoy-gg/shared-ui/web";import{jsx as vr}from"react/jsx-runtime";function Tr(){let e=()=>{try{Qi({reason:"buoy time-machine reload app"})}catch{}};return vr(v,{style:Rr.chip,onPress:e,accessibilityLabel:"Reload app",accessibilityHint:"Reloads the JavaScript bundle without restoring anything",accessibilityRole:"button",testID:"time-machine-reload-app",children:vr(l,{style:Rr.label,children:"Reload app"})})}var Rr=T.create({chip:{height:32,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:wo.color.border,backgroundColor:wo.color.buttonSurface,alignItems:"center",justifyContent:"center"},label:{fontSize:11,fontWeight:"700",color:wo.color.textSecondary}});import{useEffect as At,useRef as rs,useState as Ie,useSyncExternalStore as $r}from"react";import{Check as Hr,ChevronDown as ns,ChevronUp as is,FloatingTool as ss,NightSwitch as as,Plus as ls,TimeMachineIcon as cs,X as ds,night as A,openFloatingTool as us,persistentStorage as ps,registerPersistentFloatingTool as ms,useLimit as fs}from"@buoy-gg/shared-ui/web";import{devToolsStorageKeys as Zi,persistentStorage as Ro}from"@buoy-gg/shared-ui/web";var vo=Zi.timeMachine.armedPoint(),ct=null,Ir=!1,xo=null,To=new Set,Pr=()=>To.forEach(e=>e());function je(){return ct}function Dt(e){return To.add(e),()=>{To.delete(e)}}function kr(){return Ir?Promise.resolve():(xo||(xo=Ro.getItem(vo).then(e=>{ct===null&&e&&(ct=e,Pr())}).catch(()=>{}).finally(()=>{Ir=!0})),xo)}function Ct(e){ct!==e&&(ct=e,Pr(),(e===null?Ro.removeItem(vo):Ro.setItem(vo,e)).catch(()=>{}))}function Mt(e,t){let o=e.filter(i=>!i.baseline&&!i.safety);if(o.length===0)return null;if(t){let i=o.find(s=>s.id===t);if(i)return i}let n=null;for(let i of o)i.lastRestoredAt!==void 0&&(!n||i.lastRestoredAt>(n.lastRestoredAt??0))&&(n=i);return n||o.reduce((i,s)=>s.createdAt>i.createdAt?s:i)}import{useEffect as es,useState as ts}from"react";import{night as _}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as Dr}from"react/jsx-runtime";function Cr({visible:e,summary:t,onCapture:o,onCancel:n}){let[i,s]=ts("");es(()=>{e&&s("")},[e]);let a=()=>o(i.trim());return le(Jt,{visible:e,transparent:!0,animationType:"fade",onRequestClose:n,statusBarTranslucent:!0,children:le(Yt,{behavior:Me.OS==="ios"?"padding":void 0,style:ne.fill,children:le(xt,{style:ne.backdrop,onPress:n,accessibilityLabel:"Cancel",testID:"time-machine-bar-name-backdrop",children:Dr(xt,{style:ne.card,onPress:d=>d.stopPropagation(),testID:"time-machine-bar-name-panel",accessible:!1,children:[le(l,{style:ne.title,children:"Name this restore point"}),t?le(l,{style:ne.summary,testID:"time-machine-bar-name-summary",children:t}):null,le(Ce,{testID:"time-machine-bar-name-input",accessibilityLabel:"Restore point name",value:i,onChangeText:s,onSubmitEditing:a,placeholder:"Screen and time, if left empty",placeholderTextColor:_.color.placeholder,autoFocus:!0,autoCorrect:!1,autoCapitalize:"none",returnKeyType:"done",style:ne.input}),le(l,{style:ne.hint,children:"Captures the state the app is in right now and arms it on the bar."}),Dr(u,{style:ne.actions,children:[le(v,{testID:"time-machine-bar-name-cancel",accessibilityRole:"button",onPress:n,style:ne.secondary,children:le(l,{style:ne.secondaryText,children:"Cancel"})}),le(v,{testID:"time-machine-bar-name-capture",accessibilityRole:"button",accessibilityLabel:"Capture and arm this restore point",onPress:a,style:ne.primary,children:le(l,{style:ne.primaryText,children:"Capture"})})]})]})})})})}var ne=T.create({fill:{flex:1},backdrop:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.55)",alignItems:"center",justifyContent:"center",padding:24},card:{width:"100%",maxWidth:360,borderRadius:_.radius.sheet,borderWidth:1,borderColor:_.color.separator,backgroundColor:_.color.surface,padding:18,gap:12,shadowColor:"#000",shadowOffset:{width:0,height:12},shadowOpacity:.4,shadowRadius:24,elevation:12},title:{color:_.color.text,fontSize:_.font.title,fontWeight:"600"},input:{minHeight:44,borderRadius:_.radius.input,borderWidth:1,borderColor:_.color.accentBorder,backgroundColor:_.color.surfaceElevated,color:_.color.text,fontSize:_.font.row,paddingHorizontal:12},summary:{color:_.color.textTertiary,fontSize:_.font.caption,marginTop:-6},hint:{color:_.color.textSecondary,fontSize:_.font.caption,lineHeight:18},actions:{flexDirection:"row",justifyContent:"flex-end",gap:10,marginTop:4},secondary:{minHeight:40,paddingHorizontal:14,borderRadius:_.radius.input,alignItems:"center",justifyContent:"center"},secondaryText:{color:_.color.textSecondary,fontSize:14,fontWeight:"600"},primary:{minHeight:40,paddingHorizontal:18,borderRadius:_.radius.input,backgroundColor:_.color.accent,alignItems:"center",justifyContent:"center"},primaryText:{color:_.color.onAccent,fontSize:14,fontWeight:"700"}});import{devToolsStorageKeys as os,persistentStorage as Or}from"@buoy-gg/shared-ui/web";var Ar=os.timeMachine.barReloadMode(),dt=!1,Mr=!1,Io=null,Po=new Set,Lr=()=>Po.forEach(e=>e());function ko(){return dt}function zr(e){return Po.add(e),()=>{Po.delete(e)}}function Er(){return Mr?Promise.resolve():(Io||(Io=Or.getItem(Ar).then(e=>{!dt&&e==="1"&&(dt=!0,Lr())}).catch(()=>{}).finally(()=>{Mr=!0})),Io)}function Vr(e){e!==dt&&(dt=e,Lr(),Or.setItem(Ar,e?"1":"0").catch(()=>{}))}import{Fragment as ys,jsx as D,jsxs as G}from"react/jsx-runtime";var Lt="time-machine-restore",Ot=1e4,Nr=900,Co=6,Br={id:Lt,render:e=>D(bs,{...e})};typeof C<"u"&&C&&typeof navigator<"u"&&navigator.product==="ReactNative"&&ms(Br,ps);function ut(e){e&&Ct(e),us(Br)}function hs(e){let t=Object.values(e.results),o=t.filter(a=>!a.ok||a.skipped.length>0).length,n=t.length,i=e.route,s=i?.status==="failed"||i?.status==="unavailable";return o===0&&s?"Route did not restore":`${o} of ${n} source${n===1?"":"s"} failed`}function gs(e){let t=[];for(let[n,i]of Object.entries(e.results)){if(i.ok&&i.skipped.length===0)continue;let s=i.skipped[0]?.reason??i.warnings[0]??"did not apply";t.push(`${n}: ${s}`)}let o=e.route;return(o?.status==="failed"||o?.status==="unavailable")&&t.push(`route: ${o.status}`),t}function Wr(e){let[t,o]=Ie(0);return At(()=>{if(!t)return;let n=setTimeout(()=>o(0),e);return()=>clearTimeout(n)},[t,e]),[t>0,()=>o(n=>n+1)]}function bs({id:e,revealToken:t,dismiss:o}){let{snapshots:n,hasLoaded:i,busy:s}=Ae(),a=Tt(),d=$r(Dt,je,je),p=fs("timeMachine.snapshots"),y=$r(zr,ko,ko),{width:L}=Xt(),[h,P]=Ie(null),[H,x]=Ie(null),[N,W]=Ie(),[S,Q]=Ie(!1),[ce,q]=Wr(Nr),[Xe,ie]=Wr(Nr),[j,z]=Ie(null),[de,ge]=Ie(null),[,Qe]=Ie(0),ee=rs(!0);At(()=>(ee.current=!0,kr(),Er(),g.ensureLoaded(),()=>{ee.current=!1}),[]);let M=Mt(n,d),gt=M?.id,Ze=M?.lastRestoredAt,bt=M?.createdAt;At(()=>{if(Ze===void 0&&bt===void 0&&!j&&de===null)return;let b=setInterval(()=>Qe(J=>J+1),2500);return()=>clearInterval(b)},[Ze,bt,j,de]),At(()=>{H&&H.snapshotId!==gt&&(x(null),P(b=>b==="outcome"?null:b))},[gt,H]);let He=Date.now(),yt=j!==null&&He-j.at<Ot&&n.some(b=>b.id===j.id),c=n.filter(b=>!b.safety).length>=p,R=!M||s!==null,O=s!==null,k=async(b,J)=>{if(!s){P(null),W(void 0);try{let oe=await g.restore(b,y&&J.safetyCapture?"reload":"live",void 0,J);if(!ee.current)return;Pt(oe)?(x(oe),P("outcome")):(x(null),q()),z(oe.safetySnapshotId?{id:oe.safetySnapshotId,at:Date.now()}:null),oe.safetySnapshotId&&ge(null)}catch(oe){if(!ee.current)return;W(oe instanceof Error?oe.message:String(oe)),P("error")}}},Y=(b=!1)=>{M&&k(M.id,{safetyCapture:!0,...b?{restoreRoute:!1}:{}})},se=()=>{j&&k(j.id,{safetyCapture:!1,restoreRoute:!1}).then(()=>{ee.current&&ge(Date.now())})},te=()=>{if(!s){if(W(void 0),c){P("cap");return}P(null),Q(!0)}},Ne=async b=>{if(Q(!1),!s)try{let J=await g.capture(b);if(!ee.current)return;Ct(J.id),z(null),ie()}catch(J){if(!ee.current)return;W(J instanceof Error?J.message:String(J)),P("error")}},_t=b=>{Ct(b.id),P(null)},St=M?.name??(i?"No restore points":"Loading\u2026"),X,et="normal",Pe=!1;if(s==="restore")X="Restoring\u2026";else if(s==="capture")X="Capturing\u2026";else if(N)X=N,et="danger";else if(H&&M&&H.snapshotId===M.id)X=hs(H),et="danger";else if(!M)X=i?"Capture one with +":"";else{Pe=!0;let b=M.lastRestoredAt===void 0?null:He-M.lastRestoredAt,J=He-M.createdAt;de!==null&&He-de<Ot?X="undone, state only":b!==null&&b<Ot?X="restored just now":J<Ot&&b===null?X="captured just now":M.lastRestoredAt!==void 0?X=`restored ${Ee(M.lastRestoredAt)}`:X=`${Object.keys(M.sources).length} sources`,y&&(X+=" \xB7 reloads")}let We=Pe&&!yt&&M&&M.route&&Ue(M)?M.route.pathname:null,ke=n.filter(b=>!b.baseline&&!b.safety),V=(()=>{let b=a.filter($o=>$o.status().canCapture&&Z($o.id)).length,J=Be(),oe=[`${b} source${b===1?"":"s"}`];return J&&oe.push(J.pathname),oe.join(" \xB7 ")})(),be;return h==="picker"?be=G(u,{style:I.menu,testID:"time-machine-bar-picker",children:[G(tt,{style:I.pickerList,bounces:!1,children:[ke.map(b=>{let J=b.id===M?.id;return G(v,{testID:`time-machine-bar-pick-${b.id}`,accessibilityRole:"button",accessibilityState:{selected:J},accessibilityLabel:`Arm ${b.name}`,onPress:()=>_t(b),style:I.pickRow,children:[G(u,{style:I.pickText,children:[D(l,{numberOfLines:1,style:I.pickName,children:b.name}),G(l,{numberOfLines:1,style:I.pickDetail,children:[Ee(b.createdAt),b.route?` \xB7 ${b.route.pathname}`:"",b.lastRestoredAt!==void 0?D(l,{style:I.pickRestored,children:` \xB7 restored ${Ee(b.lastRestoredAt)}`}):null]})]}),J?D(Hr,{size:14,color:A.color.accent}):null]},b.id)}),ke.length===0?D(l,{style:I.menuText,children:"No restore points yet."}):null]}),ke.length>Co?G(l,{style:I.pickerMore,children:["Scroll for ",ke.length-Co," more"]}):null,G(u,{style:I.settingRow,testID:"time-machine-bar-reload-mode",children:[G(u,{style:I.settingText,children:[D(l,{style:I.settingLabel,children:"Reload the app after restoring"}),D(l,{style:I.settingHint,children:"For screens that read their state from storage only when they open, like a cart kept in a React context."})]}),D(as,{value:y,onValueChange:Vr})]})]}):h==="outcome"&&H?be=G(u,{style:I.menu,testID:"time-machine-bar-outcome",children:[gs(H).map(b=>D(l,{style:I.menuDanger,children:b},b)),D(l,{style:I.menuText,children:"The full report is on Time Machine's outcome card."}),D(Do,{onPress:()=>P(null)})]}):h==="cap"?be=G(u,{style:I.menu,testID:"time-machine-bar-cap",children:[G(l,{style:I.menuText,children:["Free plan keeps ",p," restore point",p===1?"":"s",". Delete one in Time Machine, or upgrade to Pro for unlimited snapshots."]}),D(Do,{onPress:()=>P(null)})]}):h==="error"&&N&&(be=G(u,{style:I.menu,testID:"time-machine-bar-error",children:[D(l,{accessibilityRole:"alert",style:I.menuDanger,children:N}),D(Do,{onPress:()=>{P(null),W(void 0)}})]})),G(ys,{children:[D(Cr,{visible:S,summary:V,onCapture:b=>void Ne(b),onCancel:()=>Q(!1)}),D(ss,{id:e,revealToken:t,variant:"strip",dragFromSurface:!0,defaultPlacement:"bottom",accessibilityLabel:`Move or hide the action bar. ${M?`${M.name} armed`:"Nothing armed"}`,accessory:be,handleAdornment:D(cs,{size:12,color:A.color.accent}),children:G(u,{style:[I.row,{width:Math.max(260,Math.min(320,L-64))}],children:[D(v,{testID:"time-machine-bar-restore",accessibilityRole:"button",accessibilityLabel:M?`Restore ${M.name}`:"Restore, nothing armed",accessibilityHint:We?`Also returns to ${We}. Long press to restore state only.`:void 0,accessibilityState:{disabled:R},disabled:R,onPress:()=>Y(!1),onLongPress:()=>Y(!0),style:[I.restoreButton,R&&I.disabled],children:s==="restore"?D(_e,{size:"small",color:A.color.accent}):ce?D(l,{style:I.restoreText,testID:"time-machine-bar-restored",children:"Restored"}):D(l,{style:I.restoreText,children:"Restore"})}),G(u,{style:I.identity,children:[D(l,{testID:"time-machine-bar-name",accessibilityLabel:`Armed restore point: ${St}`,numberOfLines:1,ellipsizeMode:"middle",style:I.name,children:St}),G(u,{style:I.statusRow,children:[G(l,{testID:"time-machine-bar-status",numberOfLines:1,accessibilityLiveRegion:"polite",style:[I.status,et==="danger"&&I.danger],children:[X,We?D(l,{style:I.destination,children:` \xB7 \u2192 ${We}`}):null]}),yt&&!s?D(v,{testID:"time-machine-bar-undo",accessibilityRole:"button",accessibilityLabel:"Undo the last restore",onPress:se,hitSlop:{top:8,bottom:8,left:6,right:6},children:D(l,{style:I.undo,children:"Undo"})}):null]})]}),D(v,{testID:"time-machine-bar-pick",accessibilityRole:"button",accessibilityLabel:"Choose another restore point",accessibilityState:{expanded:h==="picker"},onPress:()=>P(b=>b==="picker"?null:"picker"),style:I.smallButton,children:h==="picker"?D(is,{size:14,color:A.color.textSecondary}):D(ns,{size:14,color:A.color.textSecondary})}),D(v,{testID:"time-machine-bar-capture",accessibilityRole:"button",accessibilityLabel:"Capture a new restore point here and arm it",accessibilityState:{disabled:O},disabled:O,onPress:te,style:[I.smallButton,O&&I.disabled],children:s==="capture"?D(_e,{size:"small",color:A.color.accent}):Xe?D(u,{testID:"time-machine-bar-captured",children:D(Hr,{size:18,color:A.color.accent})}):D(ls,{size:18,color:c?A.color.textTertiary:A.color.text})}),D(u,{style:I.separator}),D(v,{testID:"time-machine-bar-close",accessibilityRole:"button",accessibilityLabel:"Close the action bar",onPress:o,style:I.closeButton,children:D(ds,{size:16,color:A.color.textSecondary})})]})})]})}function Do({onPress:e,label:t="Dismiss"}){return D(v,{testID:"time-machine-bar-dismiss",accessibilityRole:"button",onPress:e,style:I.dismiss,children:D(l,{style:I.dismissText,children:t})})}var I=T.create({row:{flexDirection:"row",alignItems:"center",gap:4,paddingVertical:4,minHeight:48},restoreButton:{height:32,minWidth:72,paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:A.color.accentBorderStrong,backgroundColor:A.color.accentSoft,alignItems:"center",justifyContent:"center",marginLeft:2},restoreText:{color:A.color.accent,fontSize:12,fontWeight:"700"},smallButton:{width:32,minHeight:44,alignItems:"center",justifyContent:"center"},closeButton:{width:28,minHeight:44,alignItems:"center",justifyContent:"center"},identity:{flex:1,minHeight:44,justifyContent:"center",gap:1},name:{color:A.color.text,fontSize:13,fontWeight:"500"},statusRow:{flexDirection:"row",alignItems:"center",gap:8},status:{color:A.color.textSecondary,fontSize:10,lineHeight:14,flexShrink:1},destination:{color:A.color.textTertiary},danger:{color:A.color.danger},undo:{color:A.color.accent,fontSize:10,lineHeight:14,fontWeight:"700"},separator:{height:20,width:1,backgroundColor:A.color.separator,marginHorizontal:2},disabled:{opacity:.4},menu:{marginVertical:8,padding:6,borderRadius:A.radius.card,borderWidth:1,borderColor:A.color.separator,backgroundColor:A.color.surface,shadowColor:"#000",shadowOffset:{width:0,height:6},shadowOpacity:.25,shadowRadius:16,elevation:8},menuText:{color:A.color.textSecondary,fontSize:12,lineHeight:18,padding:10},menuDanger:{color:A.color.danger,fontSize:12,lineHeight:18,paddingHorizontal:10,paddingTop:6},pickerList:{maxHeight:Co*44},pickerMore:{color:A.color.textTertiary,fontSize:10,lineHeight:14,textAlign:"center",paddingVertical:4},pickRow:{flexDirection:"row",alignItems:"center",gap:8,minHeight:44,paddingHorizontal:10,borderRadius:A.radius.row},pickText:{flex:1},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:10,paddingVertical:8,borderTopWidth:T.hairlineWidth,borderTopColor:A.color.separator,marginTop:4},settingText:{flex:1,gap:2},settingLabel:{color:A.color.text,fontSize:12,fontWeight:"500"},settingHint:{color:A.color.textTertiary,fontSize:10,lineHeight:13},pickName:{color:A.color.text,fontSize:13,fontWeight:"500"},pickDetail:{color:A.color.textSecondary,fontSize:10,lineHeight:14},pickRestored:{color:A.color.accent},dismiss:{alignSelf:"flex-end",paddingHorizontal:10,paddingVertical:8},dismissText:{color:A.color.accent,fontSize:12,fontWeight:"600"}});import{jsx as Vt,jsxs as _r}from"react/jsx-runtime";function ws({armId:e}){let t=Ss(),o=()=>{ut(e),t.minimize()};return _r(v,{style:Et.labeledChip,onPress:o,accessibilityLabel:"Open the floating action bar over the app",accessibilityRole:"button",testID:"time-machine-header-bar",children:[Vt(u,{style:Et.glyph}),Vt(l,{style:Et.label,children:"Action bar"})]})}function $t({armId:e}){return _r(u,{style:Et.row,children:[Vt(ws,{armId:e}),Vt(Tr,{})]})}var Et=T.create({row:{flexDirection:"row",alignItems:"center",gap:8},labeledChip:{height:32,flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:zt.color.border,backgroundColor:zt.color.buttonSurface},glyph:{width:14,height:8,borderRadius:3,borderWidth:1.5,borderColor:zt.color.accent},label:{fontSize:11,fontWeight:"700",color:zt.color.accent}});import{useMemo as xs}from"react";import{ABSENT_VALUE as Fr,ThemedSplitView as Rs,devToolsDefaultTheme as vs,toDiffable as Ur}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as Is,jsxs as Jr}from"react/jsx-runtime";var Ts=[];function Gr({item:e,testID:t}){let{oldValue:o,newValue:n}=xs(()=>({oldValue:e.verdict==="added"?Fr:Ur(e.oldValue),newValue:e.verdict==="removed"?Fr:Ur(e.newValue)}),[e]);return Jr(u,{style:Kr.panel,testID:t,children:[e.reason?Jr(l,{style:Kr.reason,children:["\u26A0 ",e.reason]}):null,Is(Rs,{oldValue:o,newValue:n,differences:Ts,theme:vs,scrollEnabled:!1})]})}var Kr=T.create({panel:{paddingLeft:16,paddingRight:12,paddingTop:10,paddingBottom:14,gap:10,backgroundColor:r.color.group},reason:{color:r.color.warning,fontSize:r.font.footnote}});import{useEffect as Ps,useState as ks}from"react";import{jsx as jr,jsxs as Ds}from"react/jsx-runtime";function qr({name:e,onRename:t}){let[o,n]=ks(e);Ps(()=>n(e),[e]);let i=()=>{let s=o.trim();if(!s){n(e);return}s!==e&&t(s)};return Ds(u,{style:Mo.row,children:[jr(l,{style:Mo.label,children:"Name"}),jr(Ce,{style:Mo.input,value:o,onChangeText:n,onSubmitEditing:i,onBlur:i,returnKeyType:"done",selectTextOnFocus:!0,accessibilityLabel:"Restore point name",testID:"tm-preview-name"})]})}var Mo=T.create({row:{flexDirection:"row",alignItems:"center",gap:14,minHeight:r.rowMinHeight,paddingHorizontal:r.textInset},label:{color:r.color.labelSecondary,fontSize:r.font.row,letterSpacing:r.tracking.row},input:{flex:1,minWidth:0,color:r.color.label,fontSize:r.font.row,fontWeight:"600",letterSpacing:r.tracking.row,textAlign:"right",padding:0,backgroundColor:"transparent"}});var qe={added:{glyph:"+",color:r.color.accent,label:"added",applies:!0},removed:{glyph:"\u2212",color:r.color.danger,label:"removed",applies:!0},changed:{glyph:"\u2248",color:r.color.info,label:"changed",applies:!0},"too-large":{glyph:"\u2248",color:r.color.warning,label:"changed (large)",applies:!0},unchanged:{glyph:"=",color:r.color.labelTertiary,label:"unchanged",applies:!1},"wont-apply":{glyph:"\u2298",color:r.color.warning,label:"won't apply",applies:!1},recomputes:{glyph:"\u21BB",color:r.color.labelTertiary,label:"recomputes",applies:!1}};import{Fragment as Hs,jsx as m,jsxs as F}from"react/jsx-runtime";var Xr={storage:"keys",redux:"slices",zustand:"stores",jotai:"atoms",query:"queries"},Lo=new Set;function Es(e,t){if(e.size!==t.size)return!1;for(let o of e)if(!t.has(o))return!1;return!0}function he(e,t){return`${e}::${t}`}function Nt(e){if(e===void 0)return"\u2205";try{let t=typeof e=="string"?`"${e}"`:JSON.stringify(e);return t?t.length>46?`${t.slice(0,43)}\u2026`:t:String(e)}catch{return"[complex]"}}function pt({position:e,children:t}){return F(u,{style:[f.cardRow,e.first?f.cardRowFirst:null,e.last?f.cardRowLast:null],children:[e.first?null:m(u,{style:f.cardSeparator}),t]})}function zo({glyph:e,count:t,color:o,testID:n}){return m(u,{style:[f.countPill,{backgroundColor:`${o}26`}],children:F(l,{style:[f.countPillText,{color:o}],testID:n,children:[e,t]})})}function Eo({state:e}){return m(u,{style:[f.checkbox,e!=="none"&&f.checkboxChecked],children:e==="none"?null:m(l,{style:f.checkboxGlyph,children:e==="all"?"\u2713":"\u2212"})})}var Vs=Cs(function({row:t,expanded:o,onOpen:n,onToggle:i}){let s=qe[t.item.verdict],a=!s.applies||t.excluded,d=t.item.verdict==="changed"||t.item.verdict==="added"||t.item.verdict==="removed",p=`tm-preview-item-${t.sourceId}-${t.item.key}`;return m(pt,{position:t,children:F(u,{style:[f.itemRow,a&&f.dimmed],children:[m(v,{onPress:i,disabled:!s.applies,hitSlop:{top:10,bottom:10,left:8,right:8},testID:`tm-preview-toggle-${t.sourceId}-${t.item.key}`,accessibilityRole:"checkbox",accessibilityState:{checked:!(!s.applies||t.excluded)},accessibilityLabel:`Include ${t.item.label}`,children:m(Eo,{state:!s.applies||t.excluded?"none":"all"})}),F(v,{style:f.itemBodyTouch,onPress:()=>d&&n(),disabled:!d,testID:p,children:[m(l,{style:[f.itemGlyph,{color:s.color}],children:s.glyph}),F(u,{style:f.itemBody,children:[m(l,{style:f.itemLabel,numberOfLines:1,testID:`${p}-label`,children:t.item.label}),t.item.verdict==="changed"&&F(l,{style:f.itemPreview,numberOfLines:1,testID:`${p}-values`,children:[Nt(t.item.oldValue)," \u2192"," ",Nt(t.item.newValue)]}),t.item.verdict==="added"&&m(l,{style:f.itemPreview,numberOfLines:1,testID:`${p}-values`,children:Nt(t.item.newValue)}),t.item.verdict==="removed"&&m(l,{style:[f.itemPreview,f.itemPreviewRemoved],numberOfLines:1,testID:`${p}-values`,children:Nt(t.item.oldValue)}),t.excluded?m(l,{style:f.itemExcluded,testID:`${p}-excluded`,children:"excluded \u2014 restore leaves this untouched"}):t.item.reason&&m(l,{style:f.itemReason,numberOfLines:2,testID:`${p}-reason`,children:t.item.reason})]}),d?o?m(Qr,{size:16,color:r.color.labelTertiary}):m(mo,{}):null]})]})})});function Zr({preview:e,snapshots:t,busy:o,onBack:n,onRestore:i}){let s=zs(),a=s.instanceId!==void 0,d=As({minBottom:16}),[p,y]=Ao({}),[L,h]=Ao(new Set),P=Oo(!1),[H,x]=Ao(Lo),N=$e(c=>{x(R=>{let O=new Set(R);return O.has(c)?O.delete(c):O.add(c),O})},[]),W=s.search,S=e.right==="current"?void 0:t.find(c=>c.id===e.right.snapshotId),Q=Oo(S);Q.current=S;let ce=$e(()=>{if(!Q.current)return;let c=Q.current;g.setRestoreRoute(c.id,!Ue(c))},[]),q=S?.baseline===!0,Xe=e.left==="current",ie=Ht(()=>S?S.excludedKeys?.length?new Set(S.excludedKeys):Lo:null,[S]),j=!!S?.scope?.length&&!S?.excludedKeys?.length,z=Ht(()=>{if(!j||!S?.scope)return Lo;let c=new Set(S.scope),R=new Set;for(let O of e.sources)for(let k of O.items){let Y=he(O.id,k.key);qe[k.verdict].applies&&!c.has(Y)&&R.add(Y)}return R},[j,S,e.sources]),de=Oo(null);Yr(()=>{if(!S||e.building||!ie||de.current===S.id)return;de.current=S.id,P.current=!1;let c=ie.size>0?ie:z;c.size>0&&h(new Set(c)),j&&c.size>0&&g.setExclusions(S.id,Array.from(c))},[S,e.building,ie,z,j]),Yr(()=>{if(!S||!ie||!P.current||Es(L,ie))return;let c=Array.from(L);g.setExclusions(S.id,c.length?c:null)},[L,S,ie]);let ge=$e(c=>{P.current=!0,h(R=>{let O=new Set(R);return O.has(c)?O.delete(c):O.add(c),O})},[]),Qe=$e((c,R)=>{P.current=!0,h(O=>{let k=new Set(O);for(let Y of c.items){if(!qe[Y.verdict].applies)continue;let se=he(c.id,Y.key);R==="all"?k.add(se):k.delete(se)}return k})},[]),ee=$e((c,R)=>{y(O=>({...O,[c]:!R}))},[]),M=Ht(()=>{let c=0,R=0,O=0,k=[];for(let Y of e.sources){let se=0;for(let te of Y.items)qe[te.verdict].applies?L.has(he(Y.id,te.key))?R+=1:(c+=1,se+=1):te.verdict==="wont-apply"&&(O+=1);se>0&&k.push(`${se} ${Y.label.toLowerCase()}`)}return{applies:c,excludedCount:R,wontApply:O,perSource:k}},[e.sources,L]);Ls(a?{title:"Restore Preview",subtitle:S?.name??"preview",onBack:n,actions:m($t,{armId:S?.id})}:null,[a,S?.name,S?.id]);let{rows:gt,blockedSources:Ze}=Ht(()=>{let c=W.trim().toLowerCase(),R=[],O=[];for(let k of e.sources){let Y=k.items.some(V=>V.verdict!=="unchanged");if(!Y&&!k.error)continue;let se=Y||k.notes.length>0||!!k.error,te=k.items.filter(V=>qe[V.verdict].applies),Ne=k.items.filter(V=>V.verdict==="wont-apply").length;Ne>0&&O.push(k.label);let _t=k.items.length===1?(Xr[k.id]??"items").replace(/ies$/,"y").replace(/s$/,""):Xr[k.id]??"items",St=`${k.items.length} ${_t} \xB7 `+(te.length>0?`${te.length} changed`:Ne>0?`${Ne} won't apply`:"no changes"),X=te.filter(V=>L.has(he(k.id,V.key))).length,et=te.length===0||X===0?"all":X===te.length?"none":"some",Pe={added:0,removed:0,changed:0};for(let V of k.items)L.has(he(k.id,V.key))||(V.verdict==="added"?Pe.added+=1:V.verdict==="removed"?Pe.removed+=1:(V.verdict==="changed"||V.verdict==="too-large")&&(Pe.changed+=1));let We=k.items.filter(V=>!(V.verdict==="unchanged"||c&&!V.label.toLowerCase().includes(c))),ke=se?p[k.id]??!0:!0;if(R.push({kind:"source",source:k,collapsed:ke,includeState:et,applicableCount:te.length,counts:Pe,expandable:se,summary:St,first:!1,last:!1}),!ke){for(let V of k.notes)R.push({kind:"note",id:`${k.id}:${V}`,text:V,first:!1,last:!1});k.error&&R.push({kind:"note",id:`${k.id}:err`,text:`\u26A0 ${k.error}`,first:!1,last:!1});for(let V of We){let be=he(k.id,V.key);R.push({kind:"item",sourceId:k.id,item:V,excluded:L.has(be),first:!1,last:!1}),H.has(be)&&R.push({kind:"diff",sourceId:k.id,item:V,first:!1,last:!1})}}}return S?.route&&R.push({kind:"route",href:S.route.href,on:Ue(S),first:!1,last:!1}),R.length>0&&(R[0].first=!0,R[R.length-1].last=!0),{rows:R,blockedSources:O}},[e.sources,W,p,L,H,S]),bt=$e(({item:c})=>{if(c.kind==="source"){let R=c.source,{counts:O}=c;return m(pt,{position:c,children:F(u,{style:f.sourceCard,children:[m(v,{onPress:()=>Qe(R,c.includeState),disabled:c.applicableCount===0,hitSlop:{top:10,bottom:10,left:8,right:8},testID:`tm-preview-source-toggle-${R.id}`,children:m(Eo,{state:c.applicableCount===0?"none":c.includeState})}),F(v,{style:f.sourceCardTouch,onPress:()=>c.expandable&&ee(R.id,c.collapsed),disabled:!c.expandable,testID:`tm-preview-source-${R.id}`,children:[F(u,{style:f.sourceNameBlock,children:[m(l,{style:f.sourceName,numberOfLines:1,testID:`tm-preview-source-${R.id}-name`,children:R.label}),m(l,{style:f.sourceSummary,numberOfLines:1,testID:`tm-preview-source-${R.id}-summary`,children:c.includeState==="none"&&c.applicableCount>0?`${c.summary} \xB7 excluded`:c.summary})]}),F(u,{style:f.sourceBadges,children:[O.removed>0?m(zo,{glyph:"\u2212",count:O.removed,color:r.color.danger,testID:`tm-preview-source-${R.id}-removed`}):null,O.added>0?m(zo,{glyph:"+",count:O.added,color:r.color.accent,testID:`tm-preview-source-${R.id}-added`}):null,O.changed>0?m(zo,{glyph:"\u2248",count:O.changed,color:r.color.info,testID:`tm-preview-source-${R.id}-changed`}):null]}),c.expandable?c.collapsed?m(mo,{}):m(Qr,{size:16,color:r.color.labelTertiary}):null]})]})})}return c.kind==="note"?m(pt,{position:c,children:m(l,{style:f.noteRow,testID:`tm-preview-note-${c.id}`,children:c.text})}):c.kind==="route"?m(pt,{position:c,children:F(v,{style:f.routeRow,onPress:ce,accessibilityRole:"switch",accessibilityState:{checked:c.on},accessibilityLabel:`Also return to ${c.href}`,testID:"tm-preview-route",children:[m(Eo,{state:c.on?"all":"none"}),F(u,{style:f.routeText,children:[m(l,{style:f.routeTitle,children:"Return to this screen"}),m(l,{style:f.routeHref,numberOfLines:1,testID:"tm-preview-route-href",children:c.href})]})]})}):c.kind==="diff"?m(pt,{position:c,children:m(Gr,{item:c.item,testID:`tm-preview-diff-${c.sourceId}-${c.item.key}`})}):m(Vs,{row:c,expanded:H.has(he(c.sourceId,c.item.key)),onOpen:()=>N(he(c.sourceId,c.item.key)),onToggle:()=>ge(he(c.sourceId,c.item.key))})},[H,N,ee,ge,Qe,ce]),He=$e(c=>c.kind==="source"?`s:${c.source.id}`:c.kind==="note"?`n:${c.id}`:c.kind==="route"?"route":c.kind==="diff"?`d:${c.sourceId}:${c.item.key}`:`i:${c.sourceId}:${c.item.key}`,[]),yt=F(u,{children:[!a&&F(u,{style:f.fallbackHeader,children:[m(v,{onPress:n,hitSlop:$s,testID:"tm-preview-back",children:m(l,{style:f.backText,children:"\u2039 Back"})}),m(l,{style:f.screenTitle,numberOfLines:1,children:"Restore Preview"})]}),S?F(Hs,{children:[m(Je,{children:"Restore Point"}),m(ze,{children:m(qr,{name:S.name,onRename:c=>void g.rename(S.id,c)})})]}):null,m(Je,{children:"Changes to Restore"})]}),Bt=o||e.building||M.applies===0;return F(u,{style:f.container,children:[m(qt,{testID:"tm-preview-list",data:gt,renderItem:bt,keyExtractor:He,ListHeaderComponent:yt,ListEmptyComponent:e.building?m(_e,{style:f.buildingSpinner,size:"small",color:r.color.accent}):m(l,{style:f.emptyText,testID:"tm-preview-empty",children:W?"Nothing matches this filter.":"No changes \u2014 restoring would change nothing."}),ListFooterComponent:m(u,{children:M.wontApply>0?F(u,{style:f.warnNote,children:[m(Ms,{size:12,color:r.color.warning}),F(l,{style:f.warnNoteText,testID:"tm-preview-wont-apply",children:[M.wontApply," item",M.wontApply===1?"":"s"," ","won't apply \u2014 expand"," ",Ze.length>0?Ze.join(" and "):"the source"," ","to see the reason."]})]}):null}),keyboardShouldPersistTaps:"handled",removeClippedSubviews:!0,initialNumToRender:20,windowSize:7,contentContainerStyle:f.listContent}),Xe&&S&&F(u,{style:[f.footer,{paddingBottom:d.bottom}],children:[F(v,{style:[f.cta,q&&f.ctaDanger,Bt&&f.ctaDisabled],onPress:()=>i(q?"reload":"live",Array.from(L)),disabled:q?o||e.building:Bt,testID:"tm-preview-restore",children:[m(Os,{size:16,color:q?r.color.onDanger:r.color.onAccent}),m(l,{style:[f.ctaText,q?f.ctaTextDanger:null],children:q?"Wipe & Reload":"Restore State"})]}),m(l,{style:f.ctaCaption,testID:"tm-preview-cta-caption",children:q?"This wipes all app storage and reloads the app.":M.excludedCount>0?`Restores ${M.applies} of ${M.applies+M.excludedCount} change${M.applies+M.excludedCount===1?"":"s"} \u2014 everything else stays as it is.`:"This will replace the current state with the snapshot."})]})]})}var $s={top:10,bottom:10,left:10,right:10},f=T.create({container:{flex:1,backgroundColor:"transparent"},fallbackHeader:{flexDirection:"row",alignItems:"center",paddingHorizontal:r.gutter,paddingVertical:10,gap:10},backText:{color:r.color.accent,fontSize:r.font.control},screenTitle:{color:r.color.label,fontSize:20,fontWeight:"700",letterSpacing:r.tracking.row,flex:1},dimmed:{opacity:.5},listContent:{paddingTop:14,paddingBottom:12},cardRow:{marginHorizontal:r.gutter,backgroundColor:r.color.group},cardRowFirst:{borderTopLeftRadius:r.radius.group,borderTopRightRadius:r.radius.group},cardRowLast:{borderBottomLeftRadius:r.radius.group,borderBottomRightRadius:r.radius.group,marginBottom:10},cardSeparator:{height:T.hairlineWidth,marginLeft:51,backgroundColor:r.color.separator},warnNote:{flexDirection:"row",alignItems:"flex-start",gap:6,paddingHorizontal:r.gutter+r.textInset,paddingTop:8},warnNoteText:{flex:1,color:r.color.labelSecondary,fontSize:r.font.footnote,lineHeight:r.font.footnote*1.35},countPill:{borderRadius:r.radius.pill,paddingHorizontal:9,paddingVertical:3},countPillText:{fontFamily:Ke,fontSize:r.font.footnote,fontWeight:"600"},checkbox:{width:23,height:23,borderRadius:r.radius.pill,borderWidth:1.7,borderColor:r.color.labelTertiary,alignItems:"center",justifyContent:"center"},checkboxChecked:{borderColor:r.color.accent,backgroundColor:r.color.accent},checkboxGlyph:{color:r.color.onAccent,fontSize:13,fontWeight:"700",lineHeight:15},routeRow:{flexDirection:"row",alignItems:"center",minHeight:58,paddingHorizontal:r.textInset,paddingVertical:9,gap:12},routeText:{flex:1,minWidth:0,gap:2},routeTitle:{color:r.color.label,fontSize:r.font.row,fontWeight:"600",letterSpacing:r.tracking.row},routeHref:{color:r.color.labelSecondary,fontFamily:Ke,fontSize:r.font.mono},sourceCard:{flexDirection:"row",alignItems:"center",minHeight:58,paddingHorizontal:r.textInset,paddingVertical:9,gap:12},sourceCardTouch:{flex:1,flexDirection:"row",alignItems:"center",gap:12,minWidth:0},sourceNameBlock:{flex:1,minWidth:0,gap:2},sourceName:{color:r.color.label,fontSize:r.font.row,fontWeight:"600",letterSpacing:r.tracking.row},sourceSummary:{color:r.color.labelSecondary,fontSize:r.font.footnote,fontVariant:["tabular-nums"]},sourceBadges:{flexDirection:"row",gap:6},noteRow:{color:r.color.labelTertiary,fontSize:r.font.footnote,lineHeight:r.font.footnote*1.35,paddingHorizontal:r.textInset,paddingVertical:9},itemRow:{flexDirection:"row",alignItems:"center",paddingLeft:r.textInset,paddingRight:r.textInset,paddingVertical:10,gap:12},itemBodyTouch:{flex:1,flexDirection:"row",alignItems:"center",gap:10,minWidth:0},itemGlyph:{fontSize:14,fontWeight:"700",width:14,textAlign:"center"},itemBody:{flex:1,minWidth:0},itemLabel:{color:r.color.label,fontSize:r.font.control,letterSpacing:r.tracking.control},itemPreview:{color:r.color.labelSecondary,fontFamily:Ke,fontSize:r.font.mono,marginTop:3},itemPreviewRemoved:{textDecorationLine:"line-through"},itemReason:{color:r.color.warning,fontSize:r.font.mono,marginTop:3},itemExcluded:{color:r.color.labelTertiary,fontSize:r.font.mono,marginTop:3,fontStyle:"italic"},buildingSpinner:{marginTop:28},emptyText:{color:r.color.labelSecondary,fontSize:r.font.footnote,textAlign:"center",marginTop:28},footer:{paddingHorizontal:r.gutter,paddingTop:10,gap:8,borderTopColor:r.color.separator,borderTopWidth:T.hairlineWidth,backgroundColor:r.color.sheet},cta:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,height:50,backgroundColor:r.color.accent,borderRadius:r.radius.group},ctaDanger:{backgroundColor:r.color.danger},ctaTextDanger:{color:r.color.onDanger},ctaDisabled:{opacity:.4},ctaText:{color:r.color.onAccent,fontSize:r.font.row,fontWeight:"600",letterSpacing:r.tracking.row},ctaCaption:{color:r.color.labelSecondary,fontSize:r.font.footnote,lineHeight:r.font.footnote*1.35,textAlign:"center"}});import{jsx as Ws}from"react/jsx-runtime";function Ns(e,t){return e==="current"?void 0:t.find(o=>o.id===e.snapshotId)}function en({preview:e,snapshots:t,busy:o,onClose:n}){let i=Ns(e.right,t);return Ws(Zr,{preview:e,snapshots:t,busy:o,onBack:n,onRestore:(a,d)=>{if(!(!i||o)){if(i.baseline){st("Restore fresh install?","This wipes all app storage and reloads the app.","Wipe & reload",()=>void g.restore(i.id,"reload"));return}g.restore(i.id,a,d).then(n)}}})}import{jsx as K,jsxs as ft}from"react/jsx-runtime";var on=()=>Ks().some(e=>e.id===Lt);function ht(){let[e,t]=rn({kind:"list"}),{snapshots:o,busy:n,preview:i}=Ae(),s=sr(),a=()=>{g.clearPreview(),t({kind:"list"})};return e.kind==="preview"&&i?K(en,{preview:i,snapshots:o,busy:n!==null,onClose:a}):K(js,{sources:s,onOpenPreview:d=>{g.buildPreview({snapshotId:d.id}),t({kind:"preview"})}})}function js({sources:e,onOpenPreview:t}){let{snapshots:o,hasLoaded:n,busy:i,lastOutcome:s,recentlyDeleted:a,remoteProviders:d}=Ae(),p=Fs("timeMachine.snapshots"),y=Gs(),L=_s({minBottom:16}),h=tn(Js,on,on),P=tn(Dt,je,je),H=h?Mt(o,P)?.id:void 0,x=Bs({}),[N,W]=rn(null),S=z=>{W(null),ut(z),y.minimize()},Q=y.search.trim().toLowerCase(),ce=Q?o.filter(z=>z.name.toLowerCase().includes(Q)):o,q=o.filter(z=>!z.safety).length>=p,Xe=i!==null||q,ie=z=>{if(i)return;if(z.baseline){st("Restore fresh install?","This wipes all app storage and reloads the app.","Wipe & reload",()=>void g.restore(z.id,"reload"));return}let de=(x.current[z.id]??0)+1;x.current[z.id]=de,de>=2&&!h&&W(z.id),g.restore(z.id,"live").then(ge=>{!Object.values(ge.results).every(ee=>ee.ok)||ge.willReload||y.minimize()})},j=N&&!h?o.find(z=>z.id===N)??null:null;return ft(tt,{style:mt.fill,contentContainerStyle:[mt.content,{paddingBottom:L.bottom}],testID:"time-machine-scroll",keyboardShouldPersistTaps:"handled",children:[s&&Pt(s)?K(lr,{outcome:s}):null,a?K(yr,{name:a.stored.meta.name,at:a.at,onUndo:()=>void g.undoDelete(),onExpire:()=>g.clearRecentlyDeleted()}):null,K(u,{children:K(ar,{disabled:Xe,busy:i==="capture",onCapture:z=>void g.capture(z)})}),q?ft(Ge,{tone:"warning",testID:"time-machine-limit",children:["Free plan keeps ",p," restore point",p===1?"":"s",". Upgrade to Pro for unlimited snapshots."]}):null,K(Je,{children:"Sources"}),K(Sr,{sources:e,onToggle:d?void 0:so}),d?null:K(Ge,{testID:"time-machine-sources-hint",children:"Switch a source off to leave it out of every capture and restore."}),K(Je,{children:"Restore Points"}),j?ft(u,{style:mt.barHint,testID:"time-machine-bar-hint",children:[ft(Ge,{children:['Restoring "',j.name,'" a lot? Put it on the floating action bar and restore it with one tap.']}),K(v,{onPress:()=>S(j.id),accessibilityRole:"button",testID:"time-machine-bar-hint-pin",hitSlop:{top:6,bottom:6,left:6,right:6},children:K(l,{style:mt.barHintAction,children:"Open the action bar"})})]}):null,ft(ze,{children:[ce.map(z=>K(hr,{meta:z,busy:i!==null,armed:z.id===H,onOpen:()=>t(z),onRestore:()=>ie(z),onDelete:()=>void g.delete(z.id),onDuplicate:()=>void g.duplicate(z.id),onArm:()=>S(z.id)},z.id)),ce.length===0?K(Us,{testID:"time-machine-empty",...n?o.length>0?{otto:"sad",title:"No restore point matches that name.",message:`Clear the search to see all ${o.length}.`}:{otto:"rewind",title:"No restore points yet",message:"Set up the state you want to come back to, then capture it."}:{otto:"loading",title:"Loading restore points\u2026",message:"Reading the vault off disk."}}):null]}),ce.length>0?K(Ge,{testID:"time-machine-swipe-hint",children:"Swipe a restore point to copy or delete it."}):null,K(u,{style:mt.spacer}),K(ze,{children:K(xr,{disabled:i!==null,onWipe:()=>st("Wipe all app state?","This deletes all app storage and reloads the app \u2014 like a fresh install.","Wipe & reload",()=>void g.wipeAll())})}),K(Ge,{centered:!0,children:"Deletes all app storage and reloads \u2014 like a fresh install."})]})}var mt=T.create({barHint:{marginHorizontal:r.gutter,marginBottom:8},barHintAction:{color:r.color.accent,fontSize:r.font.footnote,fontWeight:"600",paddingHorizontal:r.textInset,paddingTop:2},fill:{flex:1,backgroundColor:"transparent"},content:{paddingTop:14},empty:{color:r.color.labelSecondary,fontSize:r.font.footnote,lineHeight:r.font.footnote*1.4,paddingHorizontal:r.textInset,paddingVertical:16},spacer:{height:24}});import{jsx as nn}from"react/jsx-runtime";var Wt={id:"time-machine",name:"TIME MACHINE",description:"Snapshot & restore app state (storage, stores, query cache)",slot:"both",icon:({size:e,color:t,slot:o})=>nn(qs,{size:o==="dial"&&Me.OS!=="web"?e*1.5:e,color:t||Ys}),component:ht,modal:{subtitle:"snapshot & restore app state",searchable:!0,searchPlaceholder:"Filter\u2026",headerActions:nn($t,{})}};function Xs(e={}){return{...Wt,name:e.name??Wt.name,description:e.description??Wt.description}}import{JsModal as Qs}from"@buoy-gg/shared-ui/web";import{jsx as Ye,jsxs as oa}from"react/jsx-runtime";function Zs(){return oa(u,{style:Vo.header,children:[Ye(l,{style:Vo.headerTitle,children:"Time Machine"}),Ye(l,{style:Vo.headerSubtitle,children:"Snapshot & restore app state"})]})}function ea({visible:e,onClose:t,onBack:o,onMinimize:n,persistenceKey:i}){return Ye(Qs,{visible:e,onClose:t,onMinimize:n,persistenceKey:i,header:{showToggleButton:!0,customContent:Ye(Zs,{})},enablePersistence:!0,initialMode:"bottomSheet",disableScrollWrapper:!0,children:Ye(ht,{})})}function ta(){return Ye(ht,{})}var Vo=T.create({header:{paddingHorizontal:4,gap:2},headerTitle:{color:r.color.label,fontSize:22,fontWeight:"700",letterSpacing:.3},headerSubtitle:{color:r.color.labelSecondary,fontSize:r.font.footnote}});import{getStateSnapshotProviders as ra,subscribeToStateSnapshotProviders as na,superJsonDeserialize as ia}from"@buoy-gg/shared-ui/web";import{jsonLikelyLargerThan as sn}from"@buoy-gg/shared-ui/web/dataViewer";function sa(){return ra().map(e=>{let t=e.status();return{id:e.id,label:e.label,canCapture:t.canCapture,canRestore:t.canRestore,detail:t.detail,enabled:Z(e.id)}})}function an(){let{snapshots:e,busy:t,lastOutcome:o}=g.getState(),n=_o();return{snapshots:e,busy:t,lastOutcome:o,providers:sa(),route:{available:De(),enabled:Z(Se),...n?{current:n.href}:{}}}}var aa={version:2,getSnapshot:()=>an(),subscribe:e=>{let t=g.subscribe(e),o=na(e);return()=>{t(),o()}},actions:{list:()=>an(),capture:async e=>{let{name:t="",sourceIds:o}=e??{};return{captured:!0,snapshot:await g.capture(t,o)}},captureBaseline:async()=>({captured:!0,snapshot:await g.captureBaseline()}),wipeAll:async()=>await g.wipeAll(),restore:async e=>{let{id:t,mode:o="live",excludeKeys:n,restoreRoute:i}=e??{};if(!t)throw new Error("restore requires a snapshot `id`");return await g.restore(t,o,n,{restoreRoute:i})},delete:async e=>{let{id:t}=e??{};if(!t)throw new Error("delete requires a snapshot `id`");return await g.delete(t),{deleted:!0,id:t}},rename:async e=>{let{id:t,name:o}=e??{};if(!t||!o)throw new Error("rename requires `id` and `name`");return await g.rename(t,o),{renamed:!0,id:t,name:o}},setExclusions:async e=>{let{id:t,excludedKeys:o}=e??{};if(!t)throw new Error("setExclusions requires `id`");return await g.setExclusions(t,o??null),{id:t,excluded:o?.length??0}},setRestoreRoute:async e=>{let{id:t,restoreRoute:o}=e??{};if(!t)throw new Error("setRestoreRoute requires `id`");return await g.setRestoreRoute(t,o!==!1),{id:t,restoreRoute:o!==!1}},duplicate:async e=>{let{id:t}=e??{};if(!t)throw new Error("duplicate requires `id`");let o=await g.duplicate(t);if(!o)throw new Error(`No snapshot with id "${t}"`);return{snapshot:o}},setScope:async e=>{let{id:t,scope:o}=e??{};if(!t)throw new Error("setScope requires a snapshot `id`");return await g.setScope(t,o??null),{scoped:!0,id:t,count:o?.length??0}},preview:async e=>{let{id:t,compareTo:o}=e??{};if(!t)throw new Error("preview requires a snapshot `id`");let n={snapshotId:t},i=o?{snapshotId:o}:"current";await g.buildPreview(n,i);let s=g.getState().preview;if(!s)throw new Error("preview build produced no result");let a=4*1024;return{left:i,right:n,builtAt:s.builtAt,sources:s.sources.map(d=>({...d,items:d.items.map(p=>{let y=p.oldValue!==void 0&&sn(p.oldValue,a),L=p.newValue!==void 0&&sn(p.newValue,a);return{...p,oldValue:y?void 0:p.oldValue,newValue:L?void 0:p.newValue,...y||L?{valueOmitted:!0}:{}}})}))}},inspect:async e=>{let{id:t,sourceId:o}=e??{};if(!t||!o)throw new Error("inspect requires `id` and `sourceId`");let n=await ue(t);if(!n)throw new Error(`No snapshot with id "${t}"`);let i=n.data[o];if(!i)throw new Error(`Snapshot "${t}" has no "${o}" source`);return{id:t,sourceId:o,warnings:n.meta.sources[o]?.warnings??[],data:ia(i)}}}};Kt();export{it as RESTORE_ORDER,lo as SAFETY_SNAPSHOT_NAME,Lt as TIME_MACHINE_FLOATING_TOOL_ID,ea as TimeMachineModal,ta as TimeMachineToolView,Kt as armPendingRouteRestore,De as canRestoreRoute,Be as captureCurrentRoute,Xs as createTimeMachineTool,Z as isSourceEnabled,wt as navigateToRoute,ut as openTimeMachineFloatingTool,bi as replaceTimeMachineFromSnapshot,gi as setRemoteTimeMachineHandler,so as setSourceEnabled,no as subscribeSourceSettings,g as timeMachineStore,aa as timeMachineSyncAdapter,Wt as timeMachineToolPreset};
|
|
3
|
+
${t}`)&&i();return}Dr.alert(e,t,[{text:"Cancel",style:"cancel"},{text:r,style:"destructive",onPress:i}])}import{useState as Ci}from"react";import{jsx as Nt,jsxs as $i}from"react/jsx-runtime";function zi({disabled:e,busy:t,onCapture:r}){let[i,n]=Ci(""),a=()=>{e||(r(i),n(""))};return $i(u,{style:Ve.bar,children:[Nt(it,{style:Ve.input,value:i,onChangeText:n,placeholder:"Name this restore point\u2026",placeholderTextColor:o.color.labelTertiary,editable:!e,onSubmitEditing:a,returnKeyType:"done",testID:"time-machine-name-input"}),Nt(P,{style:[Ve.button,e?Ve.buttonDisabled:null],onPress:a,disabled:e,accessibilityRole:"button",accessibilityLabel:"Capture restore point",testID:"time-machine-capture",children:Nt(c,{style:Ve.buttonText,children:t?"Capturing\u2026":"Capture"})})]})}var Ve=O.create({bar:{flexDirection:"row",alignItems:"center",gap:8,marginHorizontal:o.gutter,backgroundColor:o.color.group,borderRadius:o.radius.group,borderWidth:1,borderColor:o.color.groupBorder,paddingLeft:o.textInset,padding:6},input:{flex:1,minWidth:0,color:o.color.label,fontSize:o.font.row,letterSpacing:o.tracking.row,padding:0,backgroundColor:"transparent"},button:{height:34,paddingHorizontal:16,borderRadius:o.radius.pill,backgroundColor:o.color.accent,alignItems:"center",justifyContent:"center"},buttonDisabled:{opacity:.4},buttonText:{color:o.color.onAccent,fontSize:o.font.control,fontWeight:"600",letterSpacing:o.tracking.control}});import{X as Li}from"@buoy-gg/shared-ui/web";import{jsx as be,jsxs as ye}from"react/jsx-runtime";var Pi={top:10,bottom:10,left:10,right:10};function Mr(e){if(Object.values(e.results).some(r=>!r.ok||r.skipped.length>0))return true;let t=e.route;return t?.status==="failed"||t?.status==="unavailable"}function ft({glyph:e,text:t,ok:r,testID:i}){return ye(c,{style:[we.line,{color:r?o.color.accent:o.color.warning}],numberOfLines:2,testID:i,children:[ye(c,{style:we.glyph,children:[e," "]}),t]})}var Mt="time-machine-outcome-route";function Ai({route:e}){return e.status==="navigated"?be(ft,{glyph:"\u2713",ok:true,text:`route \u2014 ${e.href}`,testID:Mt}):e.status==="deferred"?be(ft,{glyph:"\u21BB",ok:true,text:`route \u2014 ${e.href} after reload`,testID:Mt}):be(ft,{glyph:"\u2715",ok:false,text:`route \u2014 ${e.error??e.status}`,testID:Mt})}function Oi({outcome:e}){let t=Object.entries(e.results),r=e.mode==="reload"||e.willReload;return ye(u,{style:we.card,testID:"time-machine-outcome",children:[ye(u,{style:we.headerRow,children:[ye(c,{style:we.title,numberOfLines:1,testID:"time-machine-outcome-title",children:["Restored \u201C",e.snapshotName,"\u201D",r?" \xB7 reloading":""]}),be(P,{onPress:()=>v.clearLastOutcome(),hitSlop:Pi,accessibilityRole:"button",accessibilityLabel:"Dismiss restore result",testID:"time-machine-outcome-dismiss",children:be(Li,{size:13,color:o.color.labelSecondary})})]}),t.length===0&&!e.route?be(c,{style:we.empty,testID:"time-machine-outcome-empty",children:"No sources restored."}):null,e.route?be(Ai,{route:e.route}):null,t.map(([i,n])=>ye(u,{children:[be(ft,{testID:`time-machine-outcome-${i}`,glyph:n.ok?"\u2713":"\u2715",ok:n.ok,text:`${i} \u2014 applied ${n.applied}${n.skipped.length>0?`, skipped ${n.skipped.length}`:""}`}),n.skipped.slice(0,3).map(a=>ye(c,{style:we.detail,numberOfLines:2,children:[a.id,": ",a.reason]},a.id)),n.warnings.slice(0,3).map(a=>ye(c,{style:we.detail,numberOfLines:2,children:["\u26A0 ",a]},a))]},i))]})}var we=O.create({card:{marginHorizontal:o.gutter,marginTop:12,backgroundColor:o.color.group,borderRadius:o.radius.group,borderWidth:1,borderColor:o.color.groupBorder,padding:14,gap:4},headerRow:{flexDirection:"row",alignItems:"center",gap:10,marginBottom:2},title:{flex:1,color:o.color.label,fontSize:15,fontWeight:"600",letterSpacing:o.tracking.control},line:{fontSize:o.font.footnote,lineHeight:o.font.footnote*1.4},glyph:{fontWeight:"700"},detail:{color:o.color.labelTertiary,fontSize:o.font.mono,lineHeight:o.font.mono*1.4,paddingLeft:14},empty:{color:o.color.labelSecondary,fontSize:o.font.footnote}});import{useEffect as Hi,useRef as Vr}from"react";import{jsx as gt,jsxs as Ei}from"react/jsx-runtime";var Fr=84,_r=8,Se=null;function Bi(e,t){let r=false,i=a=>{r=a,a?(Se&&Se!==n&&Se(),Se=n):Se===n&&(Se=null),Ee.spring(e,{toValue:a?-t:0,useNativeDriver:true,bounciness:0,speed:18}).start()},n=()=>i(false);return{pan:Sr.create({onMoveShouldSetPanResponder:(a,s)=>Math.abs(s.dx)>Math.abs(s.dy)*1.5?s.dx<-_r||r&&s.dx>_r:false,onPanResponderMove:(a,s)=>{let h=r?-t:0;e.setValue(Math.min(0,Math.max(-t,h+s.dx)))},onPanResponderRelease:(a,s)=>{let h=(r?-t:0)+s.dx;i(s.vx<-.5?true:s.vx>.5?false:h<-t/2)},onPanResponderTerminate:()=>i(r)}),close:n}}function Wi({children:e,actions:t,testID:r}){let i=Fr*t.length,n=Vr(new Ee.Value(0)).current,a=Vr(null);a.current===null&&(a.current=Bi(n,i));let{pan:s,close:h}=a.current;Hi(()=>()=>{Se===h&&(Se=null)},[h]);let m=n.interpolate({inputRange:[-24,0],outputRange:[1,0],extrapolate:"clamp"});return Ei(u,{style:Fe.clip,children:[gt(Ee.View,{style:[Fe.actionLayer,{width:i,opacity:m}],children:t.map(y=>gt(P,{style:[Fe.action,y.background?{backgroundColor:y.background}:null],onPress:()=>{h(),y.onPress()},accessibilityLabel:y.label,testID:y.testID??(r?`${r}-${y.label.toLowerCase()}`:void 0),children:gt(c,{style:[Fe.actionText,y.color?{color:y.color}:null],numberOfLines:1,children:y.label})},y.label))}),gt(Ee.View,{style:[Fe.content,{transform:[{translateX:n}]}],...s.panHandlers,children:e})]})}var Fe=O.create({clip:{overflow:"hidden"},actionLayer:{position:"absolute",top:0,bottom:0,right:0,flexDirection:"row"},action:{width:Fr,height:"100%",backgroundColor:o.color.fillStrong,alignItems:"center",justifyContent:"center",paddingHorizontal:6},actionText:{color:o.color.label,fontSize:o.font.footnote,fontWeight:"600",letterSpacing:o.tracking.control},content:{backgroundColor:o.color.group}});function _e(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;let r=Math.round(t/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function ji(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}import{jsx as Re,jsxs as Vt}from"react/jsx-runtime";function Kr(e){if(e.baseline)return"Wipes to fresh install";let t=[_e(e.createdAt),ji(e.sizeBytes),`${Object.keys(e.sources).length} sources`];return e.excludedKeys?.length?t.push(`skips ${e.excludedKeys.length}`):e.scope?.length&&t.push(`scoped (${e.scope.length})`),e.safety&&t.unshift("safety copy"),t.join(" \xB7 ")}function Ni({meta:e,busy:t,armed:r=false,onOpen:i,onRestore:n,onDelete:a,onDuplicate:s,onArm:h}){let m=`time-machine-snap-${e.id}`;return Re(Wi,{testID:m,actions:[{label:"Bar",onPress:h},{label:"Dup",onPress:s},{label:"Delete",onPress:a,background:o.color.danger,color:o.color.onDanger}],children:Vt(u,{style:de.row,children:[Vt(P,{style:de.text,onPress:i,activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:`${e.name}. ${Kr(e)}. Open restore preview`,testID:m,children:[Re(c,{style:de.name,numberOfLines:1,testID:`${m}-name`,children:e.name}),r?Re(c,{style:de.armed,numberOfLines:1,testID:`${m}-armed`,children:"On the action bar"}):null,Re(c,{style:de.meta,numberOfLines:1,testID:`${m}-meta`,children:Kr(e)}),e.lastRestoredAt?Vt(c,{style:de.restored,numberOfLines:1,testID:`${m}-restored`,children:["Restored ",_e(e.lastRestoredAt)]}):null,e.route?Re(c,{style:de.route,numberOfLines:1,testID:`${m}-route`,children:e.route.href}):null]}),Re(P,{onPress:n,disabled:t,style:[de.restore,t?de.actionDisabled:null],accessibilityRole:"button",accessibilityLabel:e.baseline?"Wipe and reload":"Restore",testID:`${m}-restore`,children:Re(fi,{testID:`${m}-restore-label`,label:e.baseline?"Wipe":"Restore",color:e.baseline?o.color.danger:o.color.accent,background:e.baseline?o.color.dangerSoft:o.color.accentSoft})})]})})}var de=O.create({row:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:o.textInset},text:{flex:1,minWidth:0,paddingVertical:11},restore:{justifyContent:"center"},name:{color:o.color.label,fontSize:o.font.row,fontWeight:"600",letterSpacing:o.tracking.row},meta:{color:o.color.labelSecondary,fontSize:o.font.footnote,marginTop:2,fontVariant:["tabular-nums"]},restored:{color:o.color.accent,fontSize:o.font.footnote,marginTop:2},armed:{color:o.color.accent,fontSize:o.font.footnote,marginTop:2},route:{color:o.color.labelTertiary,fontFamily:ht,fontSize:o.font.mono,marginTop:4},actionDisabled:{opacity:.4}});import{useEffect as Mi}from"react";import{jsx as qr,jsxs as Jr}from"react/jsx-runtime";var Vi=8e3;function Fi({name:e,at:t,onUndo:r,onExpire:i}){return Mi(()=>{let n=setTimeout(i,Vi);return()=>clearTimeout(n)},[t]),Jr(u,{style:Ft.bar,testID:"time-machine-undo-bar",children:[Jr(c,{style:Ft.text,numberOfLines:1,testID:"time-machine-undo-text",children:["Deleted \u201C",e,"\u201D"]}),qr(P,{onPress:r,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",testID:"time-machine-undo-delete",children:qr(c,{style:Ft.undo,children:"Undo"})})]})}var Ft=O.create({bar:{flexDirection:"row",alignItems:"center",gap:12,marginHorizontal:o.gutter,marginTop:12,minHeight:46,paddingHorizontal:o.textInset,backgroundColor:o.color.group,borderRadius:o.radius.group,borderWidth:1,borderColor:o.color.groupBorder},text:{flex:1,color:o.color.labelSecondary,fontSize:o.font.control,letterSpacing:o.tracking.control},undo:{color:o.color.accent,fontSize:o.font.control,fontWeight:"600",letterSpacing:o.tracking.control}});import{NightSwitch as _i}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as _t}from"react/jsx-runtime";var Ki={storage:"Settings, sign-in and other things saved on the device",redux:"Data the whole app shares between screens",zustand:"Data the whole app shares between screens",jotai:"Small pieces of data screens share",query:"Data the app loaded from the server",route:"Which screen you were on"};function qi(e){return Ki[e.id]??"App data"}function Ji(e){return e.enabled?e.canRestore?null:{text:"Can be saved but not put back",tone:"warn"}:{text:"Off \xB7 left as it is",tone:"off"}}function Ui({source:e,onToggle:t}){let r=Di(e.id),i=qi(e),n=Ji(e);return _t(u,{style:ue.row,testID:`time-machine-source-${e.id}`,accessibilityLabel:`${e.label}: ${i}${n?`. ${n.text}`:""}`,children:[le(u,{style:ue.disc,children:le(r,{size:22,bgColor:o.color.disc})}),_t(u,{style:ue.text,children:[le(c,{style:ue.label,numberOfLines:1,testID:`time-machine-source-${e.id}-label`,children:e.label}),le(c,{style:ue.description,numberOfLines:2,testID:`time-machine-source-${e.id}-description`,children:i}),n?le(c,{style:[ue.state,ue[`state_${n.tone}`]],numberOfLines:1,testID:n.tone==="off"?`time-machine-source-${e.id}-off`:`time-machine-source-${e.id}-detail`,children:n.text}):null]}),le(u,{testID:`time-machine-source-${e.id}-switch`,children:le(_i,{value:e.enabled,disabled:!t,onValueChange:a=>t?.(e.id,a)})})]})}function Yi({sources:e,onToggle:t}){let r=e.filter(i=>i.canCapture);return _t(mt,{children:[r.map(i=>le(Ui,{source:i,onToggle:t},i.id)),r.length===0?le(u,{style:ue.row,testID:"time-machine-sources-empty",children:le(c,{style:ue.description,children:"No state tools are set up in this app."})}):null]})}var ue=O.create({row:{flexDirection:"row",alignItems:"center",gap:12,minHeight:o.rowMinHeight,paddingHorizontal:o.textInset,paddingVertical:10},disc:{width:36,height:36,borderRadius:o.radius.pill,backgroundColor:o.color.disc,alignItems:"center",justifyContent:"center"},text:{flex:1,minWidth:0,gap:2},label:{color:o.color.label,fontSize:o.font.row,fontWeight:"500",letterSpacing:o.tracking.row},description:{fontSize:o.font.footnote,lineHeight:o.font.footnote*1.3,color:o.color.labelSecondary},state:{fontSize:o.font.mono,lineHeight:o.font.mono*1.3,fontWeight:"600",marginTop:1},state_off:{color:o.color.labelTertiary},state_warn:{color:o.color.warning}});import{jsx as Ur}from"react/jsx-runtime";function Xi({disabled:e,onWipe:t}){return Ur(P,{style:[Kt.row,e?Kt.disabled:null],onPress:t,disabled:e,accessibilityRole:"button",testID:"time-machine-wipe-all",children:Ur(c,{style:Kt.label,children:"Wipe All App State\u2026"})})}var Kt=O.create({row:{minHeight:o.rowMinHeight,alignItems:"center",justifyContent:"center"},disabled:{opacity:.4},label:{color:o.color.danger,fontSize:o.font.row,letterSpacing:o.tracking.row}});import{memo as Gi,useCallback as De,useEffect as Yr,useMemo as bt,useRef as qt,useState as Jt}from"react";import{ChevronUp as Xr,AlertTriangle as Qi,RefreshCw as Zi,useSafeAreaInsets as ea}from"@buoy-gg/shared-ui/web";import{useToolHeader as ta,useToolHost as ra}from"@buoy-gg/core/web";import{night as yt}from"@buoy-gg/shared-ui/web";import{useToolHost as oa}from"@buoy-gg/core/web";import{night as Ut,scheduleReloadApp as na}from"@buoy-gg/shared-ui/web";import{jsx as Gr}from"react/jsx-runtime";function ia(){let e=()=>{try{na({reason:"buoy time-machine reload app"})}catch{}};return Gr(P,{style:Qr.chip,onPress:e,accessibilityLabel:"Reload app",accessibilityHint:"Reloads the JavaScript bundle without restoring anything",accessibilityRole:"button",testID:"time-machine-reload-app",children:Gr(c,{style:Qr.label,children:"Reload app"})})}var Qr=O.create({chip:{height:32,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:Ut.color.border,backgroundColor:Ut.color.buttonSurface,alignItems:"center",justifyContent:"center"},label:{fontSize:11,fontWeight:"700",color:Ut.color.textSecondary}});import{useEffect as wt,useRef as aa,useState as ve,useSyncExternalStore as Zr}from"react";import{Check as eo,ChevronDown as sa,ChevronUp as la,FloatingTool as ca,NightSwitch as da,Plus as ua,TimeMachineIcon as ha,X as pa,night as T,openFloatingTool as ma,persistentStorage as fa,registerPersistentFloatingTool as ga,useLimit as ba}from"@buoy-gg/shared-ui/web";import{devToolsStorageKeys as ya,persistentStorage as Yt}from"@buoy-gg/shared-ui/web";var Xt=ya.timeMachine.armedPoint(),Ke=null,to=false,Gt=null,Qt=new Set,ro=()=>Qt.forEach(e=>e());function St(){return Ke}function oo(e){return Qt.add(e),()=>{Qt.delete(e)}}function wa(){return to?Promise.resolve():(Gt||(Gt=Yt.getItem(Xt).then(e=>{Ke===null&&e&&(Ke=e,ro())}).catch(()=>{}).finally(()=>{to=true})),Gt)}function Zt(e){Ke!==e&&(Ke=e,ro(),(e===null?Yt.removeItem(Xt):Yt.setItem(Xt,e)).catch(()=>{}))}function no(e,t){let r=e.filter(n=>!n.baseline&&!n.safety);if(r.length===0)return null;if(t){let n=r.find(a=>a.id===t);if(n)return n}let i=null;for(let n of r)n.lastRestoredAt!==void 0&&(!i||n.lastRestoredAt>(i.lastRestoredAt??0))&&(i=n);return i||r.reduce((n,a)=>a.createdAt>n.createdAt?a:n)}import{useEffect as Sa,useState as va}from"react";import{night as E}from"@buoy-gg/shared-ui/web";import{jsx as oe,jsxs as io}from"react/jsx-runtime";function xa({visible:e,summary:t,onCapture:r,onCancel:i}){let[n,a]=va("");Sa(()=>{e&&a("")},[e]);let s=()=>r(n.trim());return oe(Rr,{visible:e,transparent:true,animationType:"fade",onRequestClose:i,statusBarTranslucent:true,children:oe(xr,{behavior:nt.OS==="ios"?"padding":void 0,style:Z.fill,children:oe($t,{style:Z.backdrop,onPress:i,accessibilityLabel:"Cancel",testID:"time-machine-bar-name-backdrop",children:io($t,{style:Z.card,onPress:h=>h.stopPropagation(),testID:"time-machine-bar-name-panel",accessible:false,children:[oe(c,{style:Z.title,children:"Name this restore point"}),t?oe(c,{style:Z.summary,testID:"time-machine-bar-name-summary",children:t}):null,oe(it,{testID:"time-machine-bar-name-input",accessibilityLabel:"Restore point name",value:n,onChangeText:a,onSubmitEditing:s,placeholder:"Screen and time, if left empty",placeholderTextColor:E.color.placeholder,autoFocus:true,autoCorrect:false,autoCapitalize:"none",returnKeyType:"done",style:Z.input}),oe(c,{style:Z.hint,children:"Captures the state the app is in right now and arms it on the bar."}),io(u,{style:Z.actions,children:[oe(P,{testID:"time-machine-bar-name-cancel",accessibilityRole:"button",onPress:i,style:Z.secondary,children:oe(c,{style:Z.secondaryText,children:"Cancel"})}),oe(P,{testID:"time-machine-bar-name-capture",accessibilityRole:"button",accessibilityLabel:"Capture and arm this restore point",onPress:s,style:Z.primary,children:oe(c,{style:Z.primaryText,children:"Capture"})})]})]})})})})}var Z=O.create({fill:{flex:1},backdrop:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.55)",alignItems:"center",justifyContent:"center",padding:24},card:{width:"100%",maxWidth:360,borderRadius:E.radius.sheet,borderWidth:1,borderColor:E.color.separator,backgroundColor:E.color.surface,padding:18,gap:12,shadowColor:"#000",shadowOffset:{width:0,height:12},shadowOpacity:.4,shadowRadius:24,elevation:12},title:{color:E.color.text,fontSize:E.font.title,fontWeight:"600"},input:{minHeight:44,borderRadius:E.radius.input,borderWidth:1,borderColor:E.color.accentBorder,backgroundColor:E.color.surfaceElevated,color:E.color.text,fontSize:E.font.row,paddingHorizontal:12},summary:{color:E.color.textTertiary,fontSize:E.font.caption,marginTop:-6},hint:{color:E.color.textSecondary,fontSize:E.font.caption,lineHeight:18},actions:{flexDirection:"row",justifyContent:"flex-end",gap:10,marginTop:4},secondary:{minHeight:40,paddingHorizontal:14,borderRadius:E.radius.input,alignItems:"center",justifyContent:"center"},secondaryText:{color:E.color.textSecondary,fontSize:14,fontWeight:"600"},primary:{minHeight:40,paddingHorizontal:18,borderRadius:E.radius.input,backgroundColor:E.color.accent,alignItems:"center",justifyContent:"center"},primaryText:{color:E.color.onAccent,fontSize:14,fontWeight:"700"}});import{devToolsStorageKeys as Ia,persistentStorage as ao}from"@buoy-gg/shared-ui/web";var so=Ia.timeMachine.barReloadMode(),qe=false,lo=false,er=null,tr=new Set,co=()=>tr.forEach(e=>e());function uo(){return qe}function Ra(e){return tr.add(e),()=>{tr.delete(e)}}function Da(){return lo?Promise.resolve():(er||(er=ao.getItem(so).then(e=>{!qe&&e==="1"&&(qe=true,co())}).catch(()=>{}).finally(()=>{lo=true})),er)}function ka(e){e!==qe&&(qe=e,co(),ao.setItem(so,e?"1":"0").catch(()=>{}))}import{Fragment as Ta,jsx as R,jsxs as F}from"react/jsx-runtime";var rr="time-machine-restore",vt=1e4,ho=900,or=6,po={id:rr,render:e=>R(za,{...e})};typeof fr<"u"&&fr&&typeof navigator<"u"&&navigator.product==="ReactNative"&&ga(po,fa);function nr(e){e&&Zt(e),ma(po)}function Ca(e){let t=Object.values(e.results),r=t.filter(s=>!s.ok||s.skipped.length>0).length,i=t.length,n=e.route,a=n?.status==="failed"||n?.status==="unavailable";return r===0&&a?"Route did not restore":`${r} of ${i} source${i===1?"":"s"} failed`}function $a(e){let t=[];for(let[i,n]of Object.entries(e.results)){if(n.ok&&n.skipped.length===0)continue;let a=n.skipped[0]?.reason??n.warnings[0]??"did not apply";t.push(`${i}: ${a}`)}let r=e.route;return(r?.status==="failed"||r?.status==="unavailable")&&t.push(`route: ${r.status}`),t}function mo(e){let[t,r]=ve(0);return wt(()=>{if(!t)return;let i=setTimeout(()=>r(0),e);return()=>clearTimeout(i)},[t,e]),[t>0,()=>r(i=>i+1)]}function za({id:e,revealToken:t,dismiss:r}){let{snapshots:i,hasLoaded:n,busy:a}=ut(),s=jr(),h=Zr(oo,St,St),m=ba("timeMachine.snapshots"),y=Zr(Ra,uo,uo),{width:d}=Ir(),[k,L]=ve(null),[b,H]=ve(null),[W,j]=ve(),[w,U]=ve(false),[ee,Y]=mo(ho),[Le,te]=mo(ho),[_,$]=ve(null),[ne,pe]=ve(null),[,ke]=ve(0),ie=aa(true);wt(()=>(ie.current=true,wa(),Da(),v.ensureLoaded(),()=>{ie.current=false}),[]);let D=no(i,h),Ge=D?.id,Pe=D?.lastRestoredAt,Qe=D?.createdAt;wt(()=>{if(Pe===void 0&&Qe===void 0&&!_&&ne===null)return;let f=setInterval(()=>ke(V=>V+1),2500);return()=>clearInterval(f)},[Pe,Qe,_,ne]),wt(()=>{b&&b.snapshotId!==Ge&&(H(null),L(f=>f==="outcome"?null:f))},[Ge,b]);let Te=Date.now(),Ze=_!==null&&Te-_.at<vt&&i.some(f=>f.id===_.id),Ae=i.filter(f=>!f.safety).length>=m,l=!D||a!==null,S=a!==null,C=async(f,V)=>{if(!a){L(null),j(void 0);try{let G=await v.restore(f,y&&V.safetyCapture?"reload":"live",void 0,V);if(!ie.current)return;Mr(G)?(H(G),L("outcome")):(H(null),Y()),$(G.safetySnapshotId?{id:G.safetySnapshotId,at:Date.now()}:null),G.safetySnapshotId&&pe(null)}catch(G){if(!ie.current)return;j(G instanceof Error?G.message:String(G)),L("error")}}},I=(f=false)=>{D&&C(D.id,{safetyCapture:true,...f?{restoreRoute:false}:{}})},K=()=>{_&&C(_.id,{safetyCapture:false,restoreRoute:false}).then(()=>{ie.current&&pe(Date.now())})},re=()=>{if(!a){if(j(void 0),Ae){L("cap");return}L(null),U(true)}},X=async f=>{if(U(false),!a)try{let V=await v.capture(f);if(!ie.current)return;Zt(V.id),$(null),te()}catch(V){if(!ie.current)return;j(V instanceof Error?V.message:String(V)),L("error")}},Oe=f=>{Zt(f.id),L(null)},et=D?.name??(n?"No restore points":"Loading\u2026"),q,Ce="normal",tt=false;if(a==="restore")q="Restoring\u2026";else if(a==="capture")q="Capturing\u2026";else if(W)q=W,Ce="danger";else if(b&&D&&b.snapshotId===D.id)q=Ca(b),Ce="danger";else if(!D)q=n?"Capture one with +":"";else{tt=true;let f=D.lastRestoredAt===void 0?null:Te-D.lastRestoredAt,V=Te-D.createdAt;ne!==null&&Te-ne<vt?q="undone, state only":f!==null&&f<vt?q="restored just now":V<vt&&f===null?q="captured just now":D.lastRestoredAt!==void 0?q=`restored ${_e(D.lastRestoredAt)}`:q=`${Object.keys(D.sources).length} sources`,y&&(q+=" \xB7 reloads")}let ce=tt&&!Ze&&D&&D.route&&dt(D)?D.route.pathname:null,$e=i.filter(f=>!f.baseline&&!f.safety),rt=(()=>{let f=s.filter(hr=>hr.status().canCapture&&se(hr.id)).length,V=ot(),G=[`${f} source${f===1?"":"s"}`];return V&&G.push(V.pathname),G.join(" \xB7 ")})(),z;return k==="picker"?z=F(u,{style:x.menu,testID:"time-machine-bar-picker",children:[F(zt,{style:x.pickerList,bounces:false,children:[$e.map(f=>{let V=f.id===D?.id;return F(P,{testID:`time-machine-bar-pick-${f.id}`,accessibilityRole:"button",accessibilityState:{selected:V},accessibilityLabel:`Arm ${f.name}`,onPress:()=>Oe(f),style:x.pickRow,children:[F(u,{style:x.pickText,children:[R(c,{numberOfLines:1,style:x.pickName,children:f.name}),F(c,{numberOfLines:1,style:x.pickDetail,children:[_e(f.createdAt),f.route?` \xB7 ${f.route.pathname}`:"",f.lastRestoredAt!==void 0?R(c,{style:x.pickRestored,children:` \xB7 restored ${_e(f.lastRestoredAt)}`}):null]})]}),V?R(eo,{size:14,color:T.color.accent}):null]},f.id)}),$e.length===0?R(c,{style:x.menuText,children:"No restore points yet."}):null]}),$e.length>or?F(c,{style:x.pickerMore,children:["Scroll for ",$e.length-or," more"]}):null,F(u,{style:x.settingRow,testID:"time-machine-bar-reload-mode",children:[F(u,{style:x.settingText,children:[R(c,{style:x.settingLabel,children:"Reload the app after restoring"}),R(c,{style:x.settingHint,children:"For screens that read their state from storage only when they open, like a cart kept in a React context."})]}),R(da,{value:y,onValueChange:ka})]})]}):k==="outcome"&&b?z=F(u,{style:x.menu,testID:"time-machine-bar-outcome",children:[$a(b).map(f=>R(c,{style:x.menuDanger,children:f},f)),R(c,{style:x.menuText,children:"The full report is on Time Machine's outcome card."}),R(ir,{onPress:()=>L(null)})]}):k==="cap"?z=F(u,{style:x.menu,testID:"time-machine-bar-cap",children:[F(c,{style:x.menuText,children:["Free plan keeps ",m," restore point",m===1?"":"s",". Delete one in Time Machine, or upgrade to Pro for unlimited snapshots."]}),R(ir,{onPress:()=>L(null)})]}):k==="error"&&W&&(z=F(u,{style:x.menu,testID:"time-machine-bar-error",children:[R(c,{accessibilityRole:"alert",style:x.menuDanger,children:W}),R(ir,{onPress:()=>{L(null),j(void 0)}})]})),F(Ta,{children:[R(xa,{visible:w,summary:rt,onCapture:f=>void X(f),onCancel:()=>U(false)}),R(ca,{id:e,revealToken:t,variant:"strip",dragFromSurface:true,defaultPlacement:"bottom",accessibilityLabel:`Move or hide the action bar. ${D?`${D.name} armed`:"Nothing armed"}`,accessory:z,handleAdornment:R(ha,{size:12,color:T.color.accent}),children:F(u,{style:[x.row,{width:Math.max(260,Math.min(320,d-64))}],children:[R(P,{testID:"time-machine-bar-restore",accessibilityRole:"button",accessibilityLabel:D?`Restore ${D.name}`:"Restore, nothing armed",accessibilityHint:ce?`Also returns to ${ce}. Long press to restore state only.`:void 0,accessibilityState:{disabled:l},disabled:l,onPress:()=>I(false),onLongPress:()=>I(true),style:[x.restoreButton,l&&x.disabled],children:a==="restore"?R(at,{size:"small",color:T.color.accent}):ee?R(c,{style:x.restoreText,testID:"time-machine-bar-restored",children:"Restored"}):R(c,{style:x.restoreText,children:"Restore"})}),F(u,{style:x.identity,children:[R(c,{testID:"time-machine-bar-name",accessibilityLabel:`Armed restore point: ${et}`,numberOfLines:1,ellipsizeMode:"middle",style:x.name,children:et}),F(u,{style:x.statusRow,children:[F(c,{testID:"time-machine-bar-status",numberOfLines:1,accessibilityLiveRegion:"polite",style:[x.status,Ce==="danger"&&x.danger],children:[q,ce?R(c,{style:x.destination,children:` \xB7 \u2192 ${ce}`}):null]}),Ze&&!a?R(P,{testID:"time-machine-bar-undo",accessibilityRole:"button",accessibilityLabel:"Undo the last restore",onPress:K,hitSlop:{top:8,bottom:8,left:6,right:6},children:R(c,{style:x.undo,children:"Undo"})}):null]})]}),R(P,{testID:"time-machine-bar-pick",accessibilityRole:"button",accessibilityLabel:"Choose another restore point",accessibilityState:{expanded:k==="picker"},onPress:()=>L(f=>f==="picker"?null:"picker"),style:x.smallButton,children:k==="picker"?R(la,{size:14,color:T.color.textSecondary}):R(sa,{size:14,color:T.color.textSecondary})}),R(P,{testID:"time-machine-bar-capture",accessibilityRole:"button",accessibilityLabel:"Capture a new restore point here and arm it",accessibilityState:{disabled:S},disabled:S,onPress:re,style:[x.smallButton,S&&x.disabled],children:a==="capture"?R(at,{size:"small",color:T.color.accent}):Le?R(u,{testID:"time-machine-bar-captured",children:R(eo,{size:18,color:T.color.accent})}):R(ua,{size:18,color:Ae?T.color.textTertiary:T.color.text})}),R(u,{style:x.separator}),R(P,{testID:"time-machine-bar-close",accessibilityRole:"button",accessibilityLabel:"Close the action bar",onPress:r,style:x.closeButton,children:R(pa,{size:16,color:T.color.textSecondary})})]})})]})}function ir({onPress:e,label:t="Dismiss"}){return R(P,{testID:"time-machine-bar-dismiss",accessibilityRole:"button",onPress:e,style:x.dismiss,children:R(c,{style:x.dismissText,children:t})})}var x=O.create({row:{flexDirection:"row",alignItems:"center",gap:4,paddingVertical:4,minHeight:48},restoreButton:{height:32,minWidth:72,paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:T.color.accentBorderStrong,backgroundColor:T.color.accentSoft,alignItems:"center",justifyContent:"center",marginLeft:2},restoreText:{color:T.color.accent,fontSize:12,fontWeight:"700"},smallButton:{width:32,minHeight:44,alignItems:"center",justifyContent:"center"},closeButton:{width:28,minHeight:44,alignItems:"center",justifyContent:"center"},identity:{flex:1,minHeight:44,justifyContent:"center",gap:1},name:{color:T.color.text,fontSize:13,fontWeight:"500"},statusRow:{flexDirection:"row",alignItems:"center",gap:8},status:{color:T.color.textSecondary,fontSize:10,lineHeight:14,flexShrink:1},destination:{color:T.color.textTertiary},danger:{color:T.color.danger},undo:{color:T.color.accent,fontSize:10,lineHeight:14,fontWeight:"700"},separator:{height:20,width:1,backgroundColor:T.color.separator,marginHorizontal:2},disabled:{opacity:.4},menu:{marginVertical:8,padding:6,borderRadius:T.radius.card,borderWidth:1,borderColor:T.color.separator,backgroundColor:T.color.surface,shadowColor:"#000",shadowOffset:{width:0,height:6},shadowOpacity:.25,shadowRadius:16,elevation:8},menuText:{color:T.color.textSecondary,fontSize:12,lineHeight:18,padding:10},menuDanger:{color:T.color.danger,fontSize:12,lineHeight:18,paddingHorizontal:10,paddingTop:6},pickerList:{maxHeight:or*44},pickerMore:{color:T.color.textTertiary,fontSize:10,lineHeight:14,textAlign:"center",paddingVertical:4},pickRow:{flexDirection:"row",alignItems:"center",gap:8,minHeight:44,paddingHorizontal:10,borderRadius:T.radius.row},pickText:{flex:1},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:10,paddingVertical:8,borderTopWidth:O.hairlineWidth,borderTopColor:T.color.separator,marginTop:4},settingText:{flex:1,gap:2},settingLabel:{color:T.color.text,fontSize:12,fontWeight:"500"},settingHint:{color:T.color.textTertiary,fontSize:10,lineHeight:13},pickName:{color:T.color.text,fontSize:13,fontWeight:"500"},pickDetail:{color:T.color.textSecondary,fontSize:10,lineHeight:14},pickRestored:{color:T.color.accent},dismiss:{alignSelf:"flex-end",paddingHorizontal:10,paddingVertical:8},dismissText:{color:T.color.accent,fontSize:12,fontWeight:"600"}});import{jsx as xt,jsxs as fo}from"react/jsx-runtime";function La({armId:e}){let t=oa(),r=()=>{nr(e),t.minimize()};return fo(P,{style:It.labeledChip,onPress:r,accessibilityLabel:"Open the floating action bar over the app",accessibilityRole:"button",testID:"time-machine-header-bar",children:[xt(u,{style:It.glyph}),xt(c,{style:It.label,children:"Action bar"})]})}function go({armId:e}){return fo(u,{style:It.row,children:[xt(La,{armId:e}),xt(ia,{})]})}var It=O.create({row:{flexDirection:"row",alignItems:"center",gap:8},labeledChip:{height:32,flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:yt.color.border,backgroundColor:yt.color.buttonSurface},glyph:{width:14,height:8,borderRadius:3,borderWidth:1.5,borderColor:yt.color.accent},label:{fontSize:11,fontWeight:"700",color:yt.color.accent}});import{useMemo as Pa}from"react";import{ABSENT_VALUE as bo,ThemedSplitView as Aa,devToolsDefaultTheme as Oa,toDiffable as yo}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as Ha,jsxs as wo}from"react/jsx-runtime";var Ea=[];function Ba({item:e,testID:t}){let{oldValue:r,newValue:i}=Pa(()=>({oldValue:e.verdict==="added"?bo:yo(e.oldValue),newValue:e.verdict==="removed"?bo:yo(e.newValue)}),[e]);return wo(u,{style:So.panel,testID:t,children:[e.reason?wo(c,{style:So.reason,children:["\u26A0 ",e.reason]}):null,Ha(Aa,{oldValue:r,newValue:i,differences:Ea,theme:Oa,scrollEnabled:false})]})}var So=O.create({panel:{paddingLeft:16,paddingRight:12,paddingTop:10,paddingBottom:14,gap:10,backgroundColor:o.color.group},reason:{color:o.color.warning,fontSize:o.font.footnote}});import{useEffect as Wa,useState as ja}from"react";import{jsx as vo,jsxs as Na}from"react/jsx-runtime";function Ma({name:e,onRename:t}){let[r,i]=ja(e);Wa(()=>i(e),[e]);let n=()=>{let a=r.trim();if(!a){i(e);return}a!==e&&t(a)};return Na(u,{style:ar.row,children:[vo(c,{style:ar.label,children:"Name"}),vo(it,{style:ar.input,value:r,onChangeText:i,onSubmitEditing:n,onBlur:n,returnKeyType:"done",selectTextOnFocus:true,accessibilityLabel:"Restore point name",testID:"tm-preview-name"})]})}var ar=O.create({row:{flexDirection:"row",alignItems:"center",gap:14,minHeight:o.rowMinHeight,paddingHorizontal:o.textInset},label:{color:o.color.labelSecondary,fontSize:o.font.row,letterSpacing:o.tracking.row},input:{flex:1,minWidth:0,color:o.color.label,fontSize:o.font.row,fontWeight:"600",letterSpacing:o.tracking.row,textAlign:"right",padding:0,backgroundColor:"transparent"}});var Je={added:{glyph:"+",color:o.color.accent,label:"added",applies:true},removed:{glyph:"\u2212",color:o.color.danger,label:"removed",applies:true},changed:{glyph:"\u2248",color:o.color.info,label:"changed",applies:true},"too-large":{glyph:"\u2248",color:o.color.warning,label:"changed (large)",applies:true},unchanged:{glyph:"=",color:o.color.labelTertiary,label:"unchanged",applies:false},"wont-apply":{glyph:"\u2298",color:o.color.warning,label:"won't apply",applies:false},recomputes:{glyph:"\u21BB",color:o.color.labelTertiary,label:"recomputes",applies:false}};import{Fragment as Va,jsx as p,jsxs as B}from"react/jsx-runtime";var xo={storage:"keys",redux:"slices",zustand:"stores",jotai:"atoms",query:"queries"},sr=new Set;function Fa(e,t){if(e.size!==t.size)return false;for(let r of e)if(!t.has(r))return false;return true}function he(e,t){return`${e}::${t}`}function Rt(e){if(e===void 0)return"\u2205";try{let t=typeof e=="string"?`"${e}"`:JSON.stringify(e);return t?t.length>46?`${t.slice(0,43)}\u2026`:t:String(e)}catch{return"[complex]"}}function Ue({position:e,children:t}){return B(u,{style:[g.cardRow,e.first?g.cardRowFirst:null,e.last?g.cardRowLast:null],children:[e.first?null:p(u,{style:g.cardSeparator}),t]})}function lr({glyph:e,count:t,color:r,testID:i}){return p(u,{style:[g.countPill,{backgroundColor:`${r}26`}],children:B(c,{style:[g.countPillText,{color:r}],testID:i,children:[e,t]})})}function cr({state:e}){return p(u,{style:[g.checkbox,e!=="none"&&g.checkboxChecked],children:e==="none"?null:p(c,{style:g.checkboxGlyph,children:e==="all"?"\u2713":"\u2212"})})}var _a=Gi(function({row:e,expanded:t,onOpen:r,onToggle:i}){let n=Je[e.item.verdict],a=!n.applies||e.excluded,s=e.item.verdict==="changed"||e.item.verdict==="added"||e.item.verdict==="removed",h=`tm-preview-item-${e.sourceId}-${e.item.key}`;return p(Ue,{position:e,children:B(u,{style:[g.itemRow,a&&g.dimmed],children:[p(P,{onPress:i,disabled:!n.applies,hitSlop:{top:10,bottom:10,left:8,right:8},testID:`tm-preview-toggle-${e.sourceId}-${e.item.key}`,accessibilityRole:"checkbox",accessibilityState:{checked:!(!n.applies||e.excluded)},accessibilityLabel:`Include ${e.item.label}`,children:p(cr,{state:!n.applies||e.excluded?"none":"all"})}),B(P,{style:g.itemBodyTouch,onPress:()=>s&&r(),disabled:!s,testID:h,children:[p(c,{style:[g.itemGlyph,{color:n.color}],children:n.glyph}),B(u,{style:g.itemBody,children:[p(c,{style:g.itemLabel,numberOfLines:1,testID:`${h}-label`,children:e.item.label}),e.item.verdict==="changed"&&B(c,{style:g.itemPreview,numberOfLines:1,testID:`${h}-values`,children:[Rt(e.item.oldValue)," \u2192"," ",Rt(e.item.newValue)]}),e.item.verdict==="added"&&p(c,{style:g.itemPreview,numberOfLines:1,testID:`${h}-values`,children:Rt(e.item.newValue)}),e.item.verdict==="removed"&&p(c,{style:[g.itemPreview,g.itemPreviewRemoved],numberOfLines:1,testID:`${h}-values`,children:Rt(e.item.oldValue)}),e.excluded?p(c,{style:g.itemExcluded,testID:`${h}-excluded`,children:"excluded \u2014 restore leaves this untouched"}):e.item.reason&&p(c,{style:g.itemReason,numberOfLines:2,testID:`${h}-reason`,children:e.item.reason})]}),s?t?p(Xr,{size:16,color:o.color.labelTertiary}):p(Nr,{}):null]})]})})});function Ka({preview:e,snapshots:t,busy:r,onBack:i,onRestore:n}){let a=ra(),s=a.instanceId!==void 0,h=ea({minBottom:16}),[m,y]=Jt({}),[d,k]=Jt(new Set),L=qt(false),[b,H]=Jt(sr),W=De(l=>{H(S=>{let C=new Set(S);return C.has(l)?C.delete(l):C.add(l),C})},[]),j=a.search,w=e.right==="current"?void 0:t.find(l=>l.id===e.right.snapshotId),U=qt(w);U.current=w;let ee=De(()=>{if(!U.current)return;let l=U.current;v.setRestoreRoute(l.id,!dt(l))},[]),Y=w?.baseline===true,Le=e.left==="current",te=bt(()=>w?w.excludedKeys?.length?new Set(w.excludedKeys):sr:null,[w]),_=!!w?.scope?.length&&!w?.excludedKeys?.length,$=bt(()=>{if(!_||!w?.scope)return sr;let l=new Set(w.scope),S=new Set;for(let C of e.sources)for(let I of C.items){let K=he(C.id,I.key);Je[I.verdict].applies&&!l.has(K)&&S.add(K)}return S},[_,w,e.sources]),ne=qt(null);Yr(()=>{if(!w||e.building||!te||ne.current===w.id)return;ne.current=w.id,L.current=false;let l=te.size>0?te:$;l.size>0&&k(new Set(l)),_&&l.size>0&&v.setExclusions(w.id,Array.from(l))},[w,e.building,te,$,_]),Yr(()=>{if(!w||!te||!L.current||Fa(d,te))return;let l=Array.from(d);v.setExclusions(w.id,l.length?l:null)},[d,w,te]);let pe=De(l=>{L.current=true,k(S=>{let C=new Set(S);return C.has(l)?C.delete(l):C.add(l),C})},[]),ke=De((l,S)=>{L.current=true,k(C=>{let I=new Set(C);for(let K of l.items){if(!Je[K.verdict].applies)continue;let re=he(l.id,K.key);S==="all"?I.add(re):I.delete(re)}return I})},[]),ie=De((l,S)=>{y(C=>({...C,[l]:!S}))},[]),D=bt(()=>{let l=0,S=0,C=0,I=[];for(let K of e.sources){let re=0;for(let X of K.items)Je[X.verdict].applies?d.has(he(K.id,X.key))?S+=1:(l+=1,re+=1):X.verdict==="wont-apply"&&(C+=1);re>0&&I.push(`${re} ${K.label.toLowerCase()}`)}return{applies:l,excludedCount:S,wontApply:C,perSource:I}},[e.sources,d]);ta(s?{title:"Restore Preview",subtitle:w?.name??"preview",onBack:i,actions:p(go,{armId:w?.id})}:null,[s,w?.name,w?.id]);let{rows:Ge,blockedSources:Pe}=bt(()=>{let l=j.trim().toLowerCase(),S=[],C=[];for(let I of e.sources){let K=I.items.some(z=>z.verdict!=="unchanged");if(!K&&!I.error)continue;let re=K||I.notes.length>0||!!I.error,X=I.items.filter(z=>Je[z.verdict].applies),Oe=I.items.filter(z=>z.verdict==="wont-apply").length;Oe>0&&C.push(I.label);let et=I.items.length===1?(xo[I.id]??"items").replace(/ies$/,"y").replace(/s$/,""):xo[I.id]??"items",q=`${I.items.length} ${et} \xB7 `+(X.length>0?`${X.length} changed`:Oe>0?`${Oe} won't apply`:"no changes"),Ce=X.filter(z=>d.has(he(I.id,z.key))).length,tt=X.length===0||Ce===0?"all":Ce===X.length?"none":"some",ce={added:0,removed:0,changed:0};for(let z of I.items)d.has(he(I.id,z.key))||(z.verdict==="added"?ce.added+=1:z.verdict==="removed"?ce.removed+=1:(z.verdict==="changed"||z.verdict==="too-large")&&(ce.changed+=1));let $e=I.items.filter(z=>!(z.verdict==="unchanged"||l&&!z.label.toLowerCase().includes(l))),rt=re?m[I.id]??true:true;if(S.push({kind:"source",source:I,collapsed:rt,includeState:tt,applicableCount:X.length,counts:ce,expandable:re,summary:q,first:false,last:false}),!rt){for(let z of I.notes)S.push({kind:"note",id:`${I.id}:${z}`,text:z,first:false,last:false});I.error&&S.push({kind:"note",id:`${I.id}:err`,text:`\u26A0 ${I.error}`,first:false,last:false});for(let z of $e){let f=he(I.id,z.key);S.push({kind:"item",sourceId:I.id,item:z,excluded:d.has(f),first:false,last:false}),b.has(f)&&S.push({kind:"diff",sourceId:I.id,item:z,first:false,last:false})}}}return w?.route&&S.push({kind:"route",href:w.route.href,on:dt(w),first:false,last:false}),S.length>0&&(S[0].first=true,S[S.length-1].last=true),{rows:S,blockedSources:C}},[e.sources,j,m,d,b,w]),Qe=De(({item:l})=>{if(l.kind==="source"){let S=l.source,{counts:C}=l;return p(Ue,{position:l,children:B(u,{style:g.sourceCard,children:[p(P,{onPress:()=>ke(S,l.includeState),disabled:l.applicableCount===0,hitSlop:{top:10,bottom:10,left:8,right:8},testID:`tm-preview-source-toggle-${S.id}`,children:p(cr,{state:l.applicableCount===0?"none":l.includeState})}),B(P,{style:g.sourceCardTouch,onPress:()=>l.expandable&&ie(S.id,l.collapsed),disabled:!l.expandable,testID:`tm-preview-source-${S.id}`,children:[B(u,{style:g.sourceNameBlock,children:[p(c,{style:g.sourceName,numberOfLines:1,testID:`tm-preview-source-${S.id}-name`,children:S.label}),p(c,{style:g.sourceSummary,numberOfLines:1,testID:`tm-preview-source-${S.id}-summary`,children:l.includeState==="none"&&l.applicableCount>0?`${l.summary} \xB7 excluded`:l.summary})]}),B(u,{style:g.sourceBadges,children:[C.removed>0?p(lr,{glyph:"\u2212",count:C.removed,color:o.color.danger,testID:`tm-preview-source-${S.id}-removed`}):null,C.added>0?p(lr,{glyph:"+",count:C.added,color:o.color.accent,testID:`tm-preview-source-${S.id}-added`}):null,C.changed>0?p(lr,{glyph:"\u2248",count:C.changed,color:o.color.info,testID:`tm-preview-source-${S.id}-changed`}):null]}),l.expandable?l.collapsed?p(Nr,{}):p(Xr,{size:16,color:o.color.labelTertiary}):null]})]})})}return l.kind==="note"?p(Ue,{position:l,children:p(c,{style:g.noteRow,testID:`tm-preview-note-${l.id}`,children:l.text})}):l.kind==="route"?p(Ue,{position:l,children:B(P,{style:g.routeRow,onPress:ee,accessibilityRole:"switch",accessibilityState:{checked:l.on},accessibilityLabel:`Also return to ${l.href}`,testID:"tm-preview-route",children:[p(cr,{state:l.on?"all":"none"}),B(u,{style:g.routeText,children:[p(c,{style:g.routeTitle,children:"Return to this screen"}),p(c,{style:g.routeHref,numberOfLines:1,testID:"tm-preview-route-href",children:l.href})]})]})}):l.kind==="diff"?p(Ue,{position:l,children:p(Ba,{item:l.item,testID:`tm-preview-diff-${l.sourceId}-${l.item.key}`})}):p(_a,{row:l,expanded:b.has(he(l.sourceId,l.item.key)),onOpen:()=>W(he(l.sourceId,l.item.key)),onToggle:()=>pe(he(l.sourceId,l.item.key))})},[b,W,ie,pe,ke,ee]),Te=De(l=>l.kind==="source"?`s:${l.source.id}`:l.kind==="note"?`n:${l.id}`:l.kind==="route"?"route":l.kind==="diff"?`d:${l.sourceId}:${l.item.key}`:`i:${l.sourceId}:${l.item.key}`,[]),Ze=B(u,{children:[!s&&B(u,{style:g.fallbackHeader,children:[p(P,{onPress:i,hitSlop:qa,testID:"tm-preview-back",children:p(c,{style:g.backText,children:"\u2039 Back"})}),p(c,{style:g.screenTitle,numberOfLines:1,children:"Restore Preview"})]}),w?B(Va,{children:[p(pt,{children:"Restore Point"}),p(mt,{children:p(Ma,{name:w.name,onRename:l=>void v.rename(w.id,l)})})]}):null,p(pt,{children:"Changes to Restore"})]}),Ae=r||e.building||D.applies===0;return B(u,{style:g.container,children:[p(vr,{testID:"tm-preview-list",data:Ge,renderItem:Qe,keyExtractor:Te,ListHeaderComponent:Ze,ListEmptyComponent:e.building?p(at,{style:g.buildingSpinner,size:"small",color:o.color.accent}):p(c,{style:g.emptyText,testID:"tm-preview-empty",children:j?"Nothing matches this filter.":"No changes \u2014 restoring would change nothing."}),ListFooterComponent:p(u,{children:D.wontApply>0?B(u,{style:g.warnNote,children:[p(Qi,{size:12,color:o.color.warning}),B(c,{style:g.warnNoteText,testID:"tm-preview-wont-apply",children:[D.wontApply," item",D.wontApply===1?"":"s"," ","won't apply \u2014 expand"," ",Pe.length>0?Pe.join(" and "):"the source"," ","to see the reason."]})]}):null}),keyboardShouldPersistTaps:"handled",removeClippedSubviews:true,initialNumToRender:20,windowSize:7,contentContainerStyle:g.listContent}),Le&&w&&B(u,{style:[g.footer,{paddingBottom:h.bottom}],children:[B(P,{style:[g.cta,Y&&g.ctaDanger,Ae&&g.ctaDisabled],onPress:()=>n(Y?"reload":"live",Array.from(d)),disabled:Y?r||e.building:Ae,testID:"tm-preview-restore",children:[p(Zi,{size:16,color:Y?o.color.onDanger:o.color.onAccent}),p(c,{style:[g.ctaText,Y?g.ctaTextDanger:null],children:Y?"Wipe & Reload":"Restore State"})]}),p(c,{style:g.ctaCaption,testID:"tm-preview-cta-caption",children:Y?"This wipes all app storage and reloads the app.":D.excludedCount>0?`Restores ${D.applies} of ${D.applies+D.excludedCount} change${D.applies+D.excludedCount===1?"":"s"} \u2014 everything else stays as it is.`:"This will replace the current state with the snapshot."})]})]})}var qa={top:10,bottom:10,left:10,right:10},g=O.create({container:{flex:1,backgroundColor:"transparent"},fallbackHeader:{flexDirection:"row",alignItems:"center",paddingHorizontal:o.gutter,paddingVertical:10,gap:10},backText:{color:o.color.accent,fontSize:o.font.control},screenTitle:{color:o.color.label,fontSize:20,fontWeight:"700",letterSpacing:o.tracking.row,flex:1},dimmed:{opacity:.5},listContent:{paddingTop:14,paddingBottom:12},cardRow:{marginHorizontal:o.gutter,backgroundColor:o.color.group},cardRowFirst:{borderTopLeftRadius:o.radius.group,borderTopRightRadius:o.radius.group},cardRowLast:{borderBottomLeftRadius:o.radius.group,borderBottomRightRadius:o.radius.group,marginBottom:10},cardSeparator:{height:O.hairlineWidth,marginLeft:51,backgroundColor:o.color.separator},warnNote:{flexDirection:"row",alignItems:"flex-start",gap:6,paddingHorizontal:o.gutter+o.textInset,paddingTop:8},warnNoteText:{flex:1,color:o.color.labelSecondary,fontSize:o.font.footnote,lineHeight:o.font.footnote*1.35},countPill:{borderRadius:o.radius.pill,paddingHorizontal:9,paddingVertical:3},countPillText:{fontFamily:ht,fontSize:o.font.footnote,fontWeight:"600"},checkbox:{width:23,height:23,borderRadius:o.radius.pill,borderWidth:1.7,borderColor:o.color.labelTertiary,alignItems:"center",justifyContent:"center"},checkboxChecked:{borderColor:o.color.accent,backgroundColor:o.color.accent},checkboxGlyph:{color:o.color.onAccent,fontSize:13,fontWeight:"700",lineHeight:15},routeRow:{flexDirection:"row",alignItems:"center",minHeight:58,paddingHorizontal:o.textInset,paddingVertical:9,gap:12},routeText:{flex:1,minWidth:0,gap:2},routeTitle:{color:o.color.label,fontSize:o.font.row,fontWeight:"600",letterSpacing:o.tracking.row},routeHref:{color:o.color.labelSecondary,fontFamily:ht,fontSize:o.font.mono},sourceCard:{flexDirection:"row",alignItems:"center",minHeight:58,paddingHorizontal:o.textInset,paddingVertical:9,gap:12},sourceCardTouch:{flex:1,flexDirection:"row",alignItems:"center",gap:12,minWidth:0},sourceNameBlock:{flex:1,minWidth:0,gap:2},sourceName:{color:o.color.label,fontSize:o.font.row,fontWeight:"600",letterSpacing:o.tracking.row},sourceSummary:{color:o.color.labelSecondary,fontSize:o.font.footnote,fontVariant:["tabular-nums"]},sourceBadges:{flexDirection:"row",gap:6},noteRow:{color:o.color.labelTertiary,fontSize:o.font.footnote,lineHeight:o.font.footnote*1.35,paddingHorizontal:o.textInset,paddingVertical:9},itemRow:{flexDirection:"row",alignItems:"center",paddingLeft:o.textInset,paddingRight:o.textInset,paddingVertical:10,gap:12},itemBodyTouch:{flex:1,flexDirection:"row",alignItems:"center",gap:10,minWidth:0},itemGlyph:{fontSize:14,fontWeight:"700",width:14,textAlign:"center"},itemBody:{flex:1,minWidth:0},itemLabel:{color:o.color.label,fontSize:o.font.control,letterSpacing:o.tracking.control},itemPreview:{color:o.color.labelSecondary,fontFamily:ht,fontSize:o.font.mono,marginTop:3},itemPreviewRemoved:{textDecorationLine:"line-through"},itemReason:{color:o.color.warning,fontSize:o.font.mono,marginTop:3},itemExcluded:{color:o.color.labelTertiary,fontSize:o.font.mono,marginTop:3,fontStyle:"italic"},buildingSpinner:{marginTop:28},emptyText:{color:o.color.labelSecondary,fontSize:o.font.footnote,textAlign:"center",marginTop:28},footer:{paddingHorizontal:o.gutter,paddingTop:10,gap:8,borderTopColor:o.color.separator,borderTopWidth:O.hairlineWidth,backgroundColor:o.color.sheet},cta:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,height:50,backgroundColor:o.color.accent,borderRadius:o.radius.group},ctaDanger:{backgroundColor:o.color.danger},ctaTextDanger:{color:o.color.onDanger},ctaDisabled:{opacity:.4},ctaText:{color:o.color.onAccent,fontSize:o.font.row,fontWeight:"600",letterSpacing:o.tracking.row},ctaCaption:{color:o.color.labelSecondary,fontSize:o.font.footnote,lineHeight:o.font.footnote*1.35,textAlign:"center"}});import{jsx as Ja}from"react/jsx-runtime";function Ua(e,t){return e==="current"?void 0:t.find(r=>r.id===e.snapshotId)}function Ya({preview:e,snapshots:t,busy:r,onClose:i}){let n=Ua(e.right,t);return Ja(Ka,{preview:e,snapshots:t,busy:r,onBack:i,onRestore:(a,s)=>{if(!(!n||r)){if(n.baseline){jt("Restore fresh install?","This wipes all app storage and reloads the app.","Wipe & reload",()=>void v.restore(n.id,"reload"));return}v.restore(n.id,a,s).then(i)}}})}import{jsx as M,jsxs as Ye}from"react/jsx-runtime";var Io=()=>jn().some(e=>e.id===rr);function dr(){let[e,t]=kr({kind:"list"}),{snapshots:r,busy:i,preview:n}=ut(),a=ki(),s=()=>{v.clearPreview(),t({kind:"list"})};return e.kind==="preview"&&n?M(Ya,{preview:n,snapshots:r,busy:i!==null,onClose:s}):M(Xa,{sources:a,onOpenPreview:h=>{v.buildPreview({snapshotId:h.id}),t({kind:"preview"})}})}function Xa({sources:e,onOpenPreview:t}){let{snapshots:r,hasLoaded:i,busy:n,lastOutcome:a,recentlyDeleted:s,remoteProviders:h}=ut(),m=Bn("timeMachine.snapshots"),y=Mn(),d=En({minBottom:16}),k=Tr(Nn,Io,Io),L=Tr(oo,St,St),b=k?no(r,L)?.id:void 0,H=Hn({}),[W,j]=kr(null),w=$=>{j(null),nr($),y.minimize()},U=y.search.trim().toLowerCase(),ee=U?r.filter($=>$.name.toLowerCase().includes(U)):r,Y=r.filter($=>!$.safety).length>=m,Le=n!==null||Y,te=$=>{if(n)return;if($.baseline){jt("Restore fresh install?","This wipes all app storage and reloads the app.","Wipe & reload",()=>void v.restore($.id,"reload"));return}let ne=(H.current[$.id]??0)+1;H.current[$.id]=ne,ne>=2&&!k&&j($.id),v.restore($.id,"live").then(pe=>{!Object.values(pe.results).every(ke=>ke.ok)||pe.willReload||y.minimize()})},_=W&&!k?r.find($=>$.id===W)??null:null;return Ye(zt,{style:Xe.fill,contentContainerStyle:[Xe.content,{paddingBottom:d.bottom}],testID:"time-machine-scroll",keyboardShouldPersistTaps:"handled",children:[a&&Mr(a)?M(Oi,{outcome:a}):null,s?M(Fi,{name:s.stored.meta.name,at:s.at,onUndo:()=>void v.undoDelete(),onExpire:()=>v.clearRecentlyDeleted()}):null,M(u,{children:M(zi,{disabled:Le,busy:n==="capture",onCapture:$=>void v.capture($)})}),Y?Ye(Me,{tone:"warning",testID:"time-machine-limit",children:["Free plan keeps ",m," restore point",m===1?"":"s",". Upgrade to Pro for unlimited snapshots."]}):null,M(pt,{children:"Sources"}),M(Yi,{sources:e,onToggle:h?void 0:Er}),h?null:M(Me,{testID:"time-machine-sources-hint",children:"Switch a source off to leave it out of every capture and restore."}),M(pt,{children:"Restore Points"}),_?Ye(u,{style:Xe.barHint,testID:"time-machine-bar-hint",children:[Ye(Me,{children:['Restoring "',_.name,'" a lot? Put it on the floating action bar and restore it with one tap.']}),M(P,{onPress:()=>w(_.id),accessibilityRole:"button",testID:"time-machine-bar-hint-pin",hitSlop:{top:6,bottom:6,left:6,right:6},children:M(c,{style:Xe.barHintAction,children:"Open the action bar"})})]}):null,Ye(mt,{children:[ee.map($=>M(Ni,{meta:$,busy:n!==null,armed:$.id===b,onOpen:()=>t($),onRestore:()=>te($),onDelete:()=>void v.delete($.id),onDuplicate:()=>void v.duplicate($.id),onArm:()=>w($.id)},$.id)),ee.length===0?M(Wn,{testID:"time-machine-empty",...i?r.length>0?{otto:"sad",title:"No restore point matches that name.",message:`Clear the search to see all ${r.length}.`}:{otto:"rewind",title:"No restore points yet",message:"Set up the state you want to come back to, then capture it."}:{otto:"loading",title:"Loading restore points\u2026",message:"Reading the vault off disk."}}):null]}),ee.length>0?M(Me,{testID:"time-machine-swipe-hint",children:"Swipe a restore point to copy or delete it."}):null,M(u,{style:Xe.spacer}),M(mt,{children:M(Xi,{disabled:n!==null,onWipe:()=>jt("Wipe all app state?","This deletes all app storage and reloads the app \u2014 like a fresh install.","Wipe & reload",()=>void v.wipeAll())})}),M(Me,{centered:true,children:"Deletes all app storage and reloads \u2014 like a fresh install."})]})}var Xe=O.create({barHint:{marginHorizontal:o.gutter,marginBottom:8},barHintAction:{color:o.color.accent,fontSize:o.font.footnote,fontWeight:"600",paddingHorizontal:o.textInset,paddingTop:2},fill:{flex:1,backgroundColor:"transparent"},content:{paddingTop:14},empty:{color:o.color.labelSecondary,fontSize:o.font.footnote,lineHeight:o.font.footnote*1.4,paddingHorizontal:o.textInset,paddingVertical:16},spacer:{height:24}});import{jsx as Ro}from"react/jsx-runtime";var Dt={id:"time-machine",name:"TIME MACHINE",description:"Snapshot & restore app state (storage, stores, query cache)",slot:"both",icon:({size:e,color:t,slot:r})=>Ro(An,{size:r==="dial"&&nt.OS!=="web"?e*1.5:e,color:t||On}),component:dr,modal:{subtitle:"snapshot & restore app state",searchable:true,searchPlaceholder:"Filter\u2026",headerActions:Ro(go,{})}};function Ga(e={}){return{...Dt,name:e.name??Dt.name,description:e.description??Dt.description}}import{JsModal as Qa}from"@buoy-gg/shared-ui/web";import{jsx as ze,jsxs as Za}from"react/jsx-runtime";function es(){return Za(u,{style:ur.header,children:[ze(c,{style:ur.headerTitle,children:"Time Machine"}),ze(c,{style:ur.headerSubtitle,children:"Snapshot & restore app state"})]})}function ts({visible:e,onClose:t,onBack:r,onMinimize:i,persistenceKey:n}){return ze(Qa,{visible:e,onClose:t,onMinimize:i,persistenceKey:n,header:{showToggleButton:true,customContent:ze(es,{})},enablePersistence:true,initialMode:"bottomSheet",disableScrollWrapper:true,children:ze(dr,{})})}function rs(){return ze(dr,{})}var ur=O.create({header:{paddingHorizontal:4,gap:2},headerTitle:{color:o.color.label,fontSize:22,fontWeight:"700",letterSpacing:.3},headerSubtitle:{color:o.color.labelSecondary,fontSize:o.font.footnote}});import{getStateSnapshotProviders as os,subscribeToStateSnapshotProviders as ns,superJsonDeserialize as is}from"@buoy-gg/shared-ui/web";import{jsonLikelyLargerThan as Do}from"@buoy-gg/shared-ui/web/dataViewer";function as(){return os().map(e=>{let t=e.status();return{id:e.id,label:e.label,canCapture:t.canCapture,canRestore:t.canRestore,detail:t.detail,enabled:se(e.id)}})}function ko(){let{snapshots:e,busy:t,lastOutcome:r}=v.getState(),i=Bo();return{snapshots:e,busy:t,lastOutcome:r,providers:as(),route:{available:He(),enabled:se(We),...i?{current:i.href}:{}}}}var ss={version:2,getSnapshot:()=>ko(),subscribe:e=>{let t=v.subscribe(e),r=ns(e);return()=>{t(),r()}},actions:{list:()=>ko(),capture:async e=>{let{name:t="",sourceIds:r}=e??{};return{captured:true,snapshot:await v.capture(t,r)}},captureBaseline:async()=>({captured:true,snapshot:await v.captureBaseline()}),wipeAll:async()=>await v.wipeAll(),restore:async e=>{let{id:t,mode:r="live",excludeKeys:i,restoreRoute:n}=e??{};if(!t)throw new Error("restore requires a snapshot `id`");return await v.restore(t,r,i,{restoreRoute:n})},delete:async e=>{let{id:t}=e??{};if(!t)throw new Error("delete requires a snapshot `id`");return await v.delete(t),{deleted:true,id:t}},rename:async e=>{let{id:t,name:r}=e??{};if(!t||!r)throw new Error("rename requires `id` and `name`");return await v.rename(t,r),{renamed:true,id:t,name:r}},setExclusions:async e=>{let{id:t,excludedKeys:r}=e??{};if(!t)throw new Error("setExclusions requires `id`");return await v.setExclusions(t,r??null),{id:t,excluded:r?.length??0}},setRestoreRoute:async e=>{let{id:t,restoreRoute:r}=e??{};if(!t)throw new Error("setRestoreRoute requires `id`");return await v.setRestoreRoute(t,r!==false),{id:t,restoreRoute:r!==false}},duplicate:async e=>{let{id:t}=e??{};if(!t)throw new Error("duplicate requires `id`");let r=await v.duplicate(t);if(!r)throw new Error(`No snapshot with id "${t}"`);return{snapshot:r}},setScope:async e=>{let{id:t,scope:r}=e??{};if(!t)throw new Error("setScope requires a snapshot `id`");return await v.setScope(t,r??null),{scoped:true,id:t,count:r?.length??0}},preview:async e=>{let{id:t,compareTo:r}=e??{};if(!t)throw new Error("preview requires a snapshot `id`");let i={snapshotId:t},n=r?{snapshotId:r}:"current";await v.buildPreview(i,n);let a=v.getState().preview;if(!a)throw new Error("preview build produced no result");let s=4*1024;return{left:n,right:i,builtAt:a.builtAt,sources:a.sources.map(h=>({...h,items:h.items.map(m=>{let y=m.oldValue!==void 0&&Do(m.oldValue,s),d=m.newValue!==void 0&&Do(m.newValue,s);return{...m,oldValue:y?void 0:m.oldValue,newValue:d?void 0:m.newValue,...y||d?{valueOmitted:true}:{}}})}))}},inspect:async e=>{let{id:t,sourceId:r}=e??{};if(!t||!r)throw new Error("inspect requires `id` and `sourceId`");let i=await fe(t);if(!i)throw new Error(`No snapshot with id "${t}"`);let n=i.data[r];if(!n)throw new Error(`Snapshot "${t}" has no "${r}" source`);return{id:t,sourceId:r,warnings:i.meta.sources[r]?.warnings??[],data:is(n)}}}};yr();export{je as RESTORE_ORDER,Bt as SAFETY_SNAPSHOT_NAME,rr as TIME_MACHINE_FLOATING_TOOL_ID,ts as TimeMachineModal,rs as TimeMachineToolView,yr as armPendingRouteRestore,He as canRestoreRoute,ot as captureCurrentRoute,Ga as createTimeMachineTool,se as isSourceEnabled,Ct as navigateToRoute,nr as openTimeMachineFloatingTool,ci as replaceTimeMachineFromSnapshot,li as setRemoteTimeMachineHandler,Er as setSourceEnabled,Or as subscribeSourceSettings,v as timeMachineStore,ss as timeMachineSyncAdapter,Dt as timeMachineToolPreset};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/time-machine",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.42",
|
|
4
4
|
"description": "Time Machine - snapshot & restore app state (storage, redux, zustand, jotai, react-query) for React Native DevTools",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -20,23 +20,23 @@
|
|
|
20
20
|
"./lib/web/**/*.mjs"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@buoy-gg/
|
|
24
|
-
"@buoy-gg/
|
|
23
|
+
"@buoy-gg/floating-tools-core": "^7.0.42",
|
|
24
|
+
"@buoy-gg/shared-ui": "^7.0.42"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@buoy-gg/license": "7.0.
|
|
27
|
+
"@buoy-gg/license": "7.0.42",
|
|
28
28
|
"react": "*",
|
|
29
29
|
"react-native": "*",
|
|
30
30
|
"react-native-web": "^0.21.0",
|
|
31
31
|
"react-dom": ">=18",
|
|
32
|
-
"@buoy-gg/core": "^7.0.
|
|
32
|
+
"@buoy-gg/core": "^7.0.42"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/react": "^19.1.0",
|
|
36
36
|
"@types/react-native": "^0.73.0",
|
|
37
37
|
"typescript": "~5.8.3",
|
|
38
|
-
"@buoy-gg/
|
|
39
|
-
"@buoy-gg/
|
|
38
|
+
"@buoy-gg/core": "^7.0.42",
|
|
39
|
+
"@buoy-gg/license": "^7.0.42"
|
|
40
40
|
},
|
|
41
41
|
"react-native-builder-bob": {
|
|
42
42
|
"source": "src",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_sharedUi","_core","_HeaderReloadButton","_TimeMachineFloatingTool","_jsxRuntime","HeaderBarButton","armId","host","useToolHost","onPress","openTimeMachineFloatingTool","minimize","jsxs","TouchableOpacity","style","styles","labeledChip","accessibilityLabel","accessibilityRole","testID","children","jsx","View","glyph","Text","label","TimeMachineHeaderActions","row","HeaderReloadButton","StyleSheet","create","flexDirection","alignItems","gap","height","paddingHorizontal","borderRadius","borderWidth","borderColor","night","color","border","backgroundColor","buttonSurface","width","accent","fontSize","fontWeight"],"sourceRoot":"../../../src","sources":["components/HeaderActions.tsx"],"mappings":";;;;;;;AAWA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,wBAAA,GAAAJ,OAAA;AAAiF,IAAAK,WAAA,GAAAL,OAAA;AAfjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOO,SAASM,eAAeA,CAAC;EAAEC;AAA0B,CAAC,EAAE;EAC7D,MAAMC,IAAI,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC1B,MAAMC,OAAO,GAAGA,CAAA,KAAM;IACpB,IAAAC,oDAA2B,EAACJ,KAAK,CAAC;IAClC;IACA;IACAC,IAAI,CAACI,QAAQ,CAAC,CAAC;EACjB,CAAC;EACD,oBACE,IAAAP,WAAA,CAAAQ,IAAA,EAACd,YAAA,CAAAe,gBAAgB;IACfC,KAAK,EAAEC,MAAM,CAACC,WAAY;IAC1BP,OAAO,EAAEA,OAAQ;IACjBQ,kBAAkB,EAAC,2CAA2C;IAC9DC,iBAAiB,EAAC,QAAQ;IAC1BC,MAAM,EAAC,yBAAyB;IAAAC,QAAA,gBAEhC,IAAAhB,WAAA,CAAAiB,GAAA,EAACvB,YAAA,CAAAwB,IAAI;MAACR,KAAK,EAAEC,MAAM,CAACQ;IAAM,CAAE,CAAC,eAC7B,IAAAnB,WAAA,CAAAiB,GAAA,EAACvB,YAAA,CAAA0B,IAAI;MAACV,KAAK,EAAEC,MAAM,CAACU,KAAM;MAAAL,QAAA,EAAC;IAAU,CAAM,CAAC;EAAA,CAC5B,CAAC;AAEvB;AAEO,SAASM,wBAAwBA,CAAC;EAAEpB;AAA0B,CAAC,EAAE;EACtE,oBACE,IAAAF,WAAA,CAAAQ,IAAA,EAACd,YAAA,CAAAwB,IAAI;IAACR,KAAK,EAAEC,MAAM,CAACY,GAAI;IAAAP,QAAA,gBACtB,IAAAhB,WAAA,CAAAiB,GAAA,EAAChB,eAAe;MAACC,KAAK,EAAEA;IAAM,CAAE,CAAC,eACjC,IAAAF,WAAA,CAAAiB,GAAA,EAACnB,mBAAA,CAAA0B,kBAAkB,IAAE,CAAC;EAAA,CAClB,CAAC;AAEX;AAEA,MAAMb,MAAM,GAAGc,uBAAU,CAACC,MAAM,CAAC;EAC/BH,GAAG,EAAE;IAAEI,aAAa,EAAE,KAAK;IAAEC,UAAU,EAAE,QAAQ;IAAEC,GAAG,EAAE;EAAE,CAAC;EAC3DjB,WAAW,EAAE;IACXkB,MAAM,EAAE,EAAE;IACVH,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE,CAAC;IACNE,iBAAiB,EAAE,EAAE;IACrBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEC,eAAK,CAACC,KAAK,CAACC,MAAM;IAC/BC,eAAe,EAAEH,eAAK,CAACC,KAAK,CAACG;EAC/B,CAAC;EACD;EACApB,KAAK,EAAE;IACLqB,KAAK,EAAE,EAAE;IACTV,MAAM,EAAE,CAAC;IACTE,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,GAAG;IAChBC,WAAW,EAAEC,eAAK,CAACC,KAAK,CAACK;EAC3B,CAAC;EACDpB,KAAK,EAAE;IACLqB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBP,KAAK,EAAED,eAAK,CAACC,KAAK,CAACK;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_sharedUi","_jsxRuntime","HeaderReloadButton","onPress","scheduleReloadApp","reason","jsx","TouchableOpacity","style","styles","chip","accessibilityLabel","accessibilityHint","accessibilityRole","testID","children","Text","label","StyleSheet","create","height","paddingHorizontal","borderRadius","borderWidth","borderColor","night","color","border","backgroundColor","buttonSurface","alignItems","justifyContent","fontSize","fontWeight","textSecondary"],"sourceRoot":"../../../src","sources":["components/HeaderReloadButton.tsx"],"mappings":";;;;;;AAOA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAA8D,IAAAE,WAAA,GAAAF,OAAA;AAR9D;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,SAASG,kBAAkBA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAGA,CAAA,KAAM;IACpB,IAAI;MACF,IAAAC,2BAAiB,EAAC;QAAEC,MAAM,EAAE;MAA+B,CAAC,CAAC;IAC/D,CAAC,CAAC,MAAM;MACN;IAAA;EAEJ,CAAC;EACD,oBACE,IAAAJ,WAAA,CAAAK,GAAA,EAACR,YAAA,CAAAS,gBAAgB;IACfC,KAAK,EAAEC,MAAM,CAACC,IAAK;IACnBP,OAAO,EAAEA,OAAQ;IACjBQ,kBAAkB,EAAC,YAAY;IAC/BC,iBAAiB,EAAC,0DAA0D;IAC5EC,iBAAiB,EAAC,QAAQ;IAC1BC,MAAM,EAAC,yBAAyB;IAAAC,QAAA,eAEhC,IAAAd,WAAA,CAAAK,GAAA,EAACR,YAAA,CAAAkB,IAAI;MAACR,KAAK,EAAEC,MAAM,CAACQ,KAAM;MAAAF,QAAA,EAAC;IAAU,CAAM;EAAC,CAC5B,CAAC;AAEvB;AAEA,MAAMN,MAAM,GAAGS,uBAAU,CAACC,MAAM,CAAC;EAC/BT,IAAI,EAAE;IACJU,MAAM,EAAE,EAAE;IACVC,iBAAiB,EAAE,EAAE;IACrBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEC,eAAK,CAACC,KAAK,CAACC,MAAM;IAC/BC,eAAe,EAAEH,eAAK,CAACC,KAAK,CAACG,aAAa;IAC1CC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDd,KAAK,EAAE;IACLe,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBP,KAAK,EAAED,eAAK,CAACC,KAAK,CAACQ;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_sharedUi","_core","_useTimeMachine","_timeMachineStore","_primitives","_tmTheme","_sources","_confirm","_CaptureBar","_RestoreOutcomeCard","_SnapshotRow","_UndoDeleteBar","_SourcesStrip","_WipeAllRow","_PreviewFlow","_TimeMachineFloatingTool","_armedPoint","_sourceSettings","_jsxRuntime","isBarOpen","getFloatingTools","some","tool","id","TIME_MACHINE_FLOATING_TOOL_ID","TimeMachineBody","screen","setScreen","useState","kind","snapshots","busy","preview","useTimeMachineState","sources","useSourceStatuses","backToList","timeMachineStore","clearPreview","jsx","PreviewScreen","onClose","RestorePointList","onOpenPreview","meta","buildPreview","snapshotId","hasLoaded","lastOutcome","recentlyDeleted","remoteProviders","snapshotLimit","useLimit","host","useToolHost","insets","useSafeAreaInsets","minBottom","barOpen","useSyncExternalStore","subscribeFloatingTools","pickedId","subscribePickedPoint","getPickedPointId","armedId","resolveArmedPoint","undefined","listRestores","useRef","barHintFor","setBarHintFor","putOnBar","openTimeMachineFloatingTool","minimize","query","search","trim","toLowerCase","visible","filter","s","name","includes","atCaptureLimit","safety","length","captureDisabled","restore","baseline","confirmDestructive","count","current","then","outcome","clean","Object","values","results","every","r","ok","willReload","barHint","find","jsxs","ScrollView","style","styles","fill","contentContainerStyle","content","paddingBottom","bottom","testID","keyboardShouldPersistTaps","children","restoreNeedsAttention","RestoreOutcomeCard","UndoDeleteBar","stored","at","onUndo","undoDelete","onExpire","clearRecentlyDeleted","View","CaptureBar","disabled","onCapture","capture","Footnote","tone","SectionLabel","SourcesStrip","onToggle","setSourceEnabled","TouchableOpacity","onPress","accessibilityRole","hitSlop","top","left","right","Text","barHintAction","Group","map","SnapshotRow","armed","onOpen","onRestore","onDelete","delete","onDuplicate","duplicate","onArm","ToolEmptyState","otto","title","message","spacer","WipeAllRow","onWipe","wipeAll","centered","StyleSheet","create","marginHorizontal","tm","gutter","marginBottom","color","accent","fontSize","font","footnote","fontWeight","paddingHorizontal","textInset","paddingTop","flex","backgroundColor","empty","labelSecondary","lineHeight","paddingVertical","height"],"sourceRoot":"../../../src","sources":["components/TimeMachineBody.tsx"],"mappings":"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","ignoreList":[]}
|