@buoy-gg/core 7.0.59 → 7.0.60
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/floatingMenu/BuoyCodeSignIn.js +1 -1
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/floatingMenu/BuoyCodeSignIn.js +1 -1
- package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/floatingMenu/BuoyCodeSignIn.d.ts +10 -0
- package/lib/typescript/commonjs/version.d.ts +1 -1
- package/lib/typescript/module/floatingMenu/BuoyCodeSignIn.d.ts +10 -0
- package/lib/typescript/module/version.d.ts +1 -1
- package/lib/web/chunks/chunk-GLXZCY6W.mjs +1 -1
- package/lib/web/chunks/chunk-T6BXEQLL.mjs +1 -0
- package/lib/web/index.mjs +2 -2
- package/lib/web/toolkit.mjs +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.BuoySignIn=BuoySignIn;var _react=require("react");var _reactNative=require("react-native");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.BuoySignIn=BuoySignIn;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function BuoySignIn({needsPlan:s=false}){const[t,e]=(0,_react.useState)(false);const r=(0,_sharedUi.useSignInState)();return(0,_jsxRuntime.jsxs)(_reactNative.View,{pointerEvents:"box-none",style:styles.root,children:[(0,_jsxRuntime.jsx)(_sharedUi.AccountSetupButton,{expanded:t,onPress:()=>e(true)}),t?(0,_jsxRuntime.jsx)(_reactNative.Modal,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>e(false),children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overlay,accessibilityViewIsModal:true,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{style:_reactNative.StyleSheet.absoluteFill,onPress:()=>e(false),accessible:false}),s&&r==="active"?(0,_jsxRuntime.jsx)(_sharedUi.BuoyNeedsPlanCard,{onClose:()=>e(false)}):(0,_jsxRuntime.jsx)(_sharedUi.BuoySignInCard,{onClose:()=>e(false)})]})}):null]})}const styles=_reactNative.StyleSheet.create({root:{position:"absolute",bottom:30,right:16,zIndex:99999},overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.useDevToolsSettings=exports.DevToolsSettingsModal=void 0;var _react=require("react");var _reactNative=require("react-native");var _settingsBus=require("./settingsBus.js");var _useDesktopSyncStatus=require("./useDesktopSyncStatus");var _sharedUi=require("@buoy-gg/shared-ui");var _floatingToolsCore=require("@buoy-gg/floating-tools-core");var _DefaultConfigContext=require("./DefaultConfigContext.js");var _AppIcon=require("./AppIcon");var _jsxRuntime=require("react/jsx-runtime");const STORAGE_KEY="@react_buoy_dev_tools_settings";const MAX_DIAL_SLOTS=6;const enforceDialLimit=r=>{let a=MAX_DIAL_SLOTS;const n={};for(const[c,s]of Object.entries(r)){if(s&&a>0){n[c]=true;a-=1}else{n[c]=false}}return n};const sanitizeFloating=(r,a)=>{const{userStatus:n,environment:c,...s}=r;const l=a?Object.entries(s).filter(([d])=>a.includes(d)):Object.entries(s);return{...Object.fromEntries(l),environment:c??false}};const mergeWithDefaults=(r,a,n)=>{if(!a)return r;const c={...r.dialTools,...a.dialTools??{}};const s=n?.allowedDialKeys?Object.entries(c).filter(([d])=>n.allowedDialKeys?.includes(d)):Object.entries(c);const l=enforceDialLimit(Object.fromEntries(s));return{dialTools:l,floatingTools:sanitizeFloating({...r.floatingTools,...a.floatingTools??{}},n?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...a.globalSettings??{}}}};const generateDefaultSettings=(r=[],a,n)=>{const c={};const s={};const l=new Set(a??[]);const d=new Set(n??[]);const g=!n||n.length===0;for(const x of r){const{id:i,slot:S="both"}=x;if(S==="dial"||S==="both"){c[i]=g?true:d.has(i)}if(S==="row"||S==="both"){s[i]=l.has(i)}}return{dialTools:enforceDialLimit(c),floatingTools:{...s,environment:l.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}};const DevToolsSettingsModal=({visible:r,onClose:a,onSettingsChange:n,initialSettings:c,availableApps:s=[],storage:l=_sharedUi.persistentStorage,zIndex:d})=>{const{defaultFloatingTools:g,defaultDialTools:x}=(0,_DefaultConfigContext.useDefaultConfig)();const i=(0,_react.useMemo)(()=>generateDefaultSettings(s,g,x),[s,g,x]);const S=(0,_react.useMemo)(()=>Object.keys(i.dialTools),[i]);const R=(0,_react.useMemo)(()=>Object.keys(i.floatingTools).filter(e=>e!=="environment"),[i]);const[f,b]=(0,_react.useState)(c||cachedSettings||i);const[w,F]=(0,_react.useState)(cachedActiveTab??"floating");const[N,G]=(0,_react.useState)(cachedActiveTab!==null);const[C,Y]=(0,_react.useState)(new Set);const[$,I]=(0,_react.useState)(false);const[Q,X]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{const e=requestAnimationFrame(()=>X(true));return()=>cancelAnimationFrame(e)},[]);const h=(0,_useDesktopSyncStatus.useDesktopSyncStatus)();(0,_react.useEffect)(()=>{const e=async()=>{try{const t=await _sharedUi.persistentStorage.getItem(_sharedUi.devToolsStorageKeys.settings.activeTab());if(t&&["floating","settings","pro"].includes(t)){const o=t;cachedActiveTab=o;F(y=>y===o?y:o)}}catch(t){}finally{G(true)}};e()},[]);(0,_react.useEffect)(()=>{if(!N)return;_sharedUi.persistentStorage.setItem(_sharedUi.devToolsStorageKeys.settings.activeTab(),w).catch(e=>{console.warn("Failed to save settings active tab:",e)})},[w,N]);const Z=(0,_sharedUi.getUseLicense)();const m=Z?.();const j=m?.isPro??false;const z=!j&&m?.licenseKey?m.error:null;const ee=m?.errorKind==="transport";const[u,te]=(0,_react.useState)(cachedStorageBackend);const[B,O]=(0,_react.useState)(false);const[D,L]=(0,_react.useState)(false);const[T,oe]=(0,_react.useState)(false);const[E,k]=(0,_react.useState)([]);const[V,P]=(0,_react.useState)(false);const M=(0,_sharedUi.useSafeAreaInsets)();const H=_reactNative.Dimensions.get("window").height;const K=_reactNative.Dimensions.get("window").width;const ne=Math.floor(H*.33);const se=Math.min(K-32,400);const _=(0,_react.useCallback)(async()=>{try{const e=await l.getItem(STORAGE_KEY);if(e){const t=JSON.parse(e);const o=mergeWithDefaults(i,t,{allowedDialKeys:S,allowedFloatingKeys:R});cachedSettings=o;b(y=>sameSettings(y,o)?y:o);return}cachedSettings=i;b(t=>sameSettings(t,i)?t:i)}catch(e){console.error("Failed to load dev tools settings:",e);b(i)}},[i,S,R,l]);(0,_react.useEffect)(()=>{_()},[_]);(0,_react.useEffect)(()=>{(0,_sharedUi.getStorageBackendType)().then(e=>{cachedStorageBackend=e;te(t=>t===e?t:e)})},[]);(0,_react.useEffect)(()=>{if(T){P(true);_sharedUi.persistentStorage.getAllKeys().then(e=>{k(e.sort())}).catch(()=>{k([])}).finally(()=>{P(false)})}},[T]);const A=async e=>{try{const t={...e,dialTools:enforceDialLimit(e.dialTools)};await l.setItem(STORAGE_KEY,JSON.stringify(t));cachedSettings=t;b(t);n?.(t);_settingsBus.settingsBus.emit(t)}catch(t){console.error("Failed to save dev tools settings:",t)}};const ie=e=>{const t={...f,floatingTools:{...f.floatingTools,[e]:!f.floatingTools[e]}};A(t)};const re=e=>{const t={...f,globalSettings:{...f.globalSettings,[e]:!f.globalSettings?.[e]}};A(t)};const ae=async()=>{O(true);L(false);try{await _sharedUi.persistentStorage.clear();L(true);b(i);if(l!==_sharedUi.persistentStorage)await l.setItem(STORAGE_KEY,JSON.stringify(i));n?.(i);_settingsBus.settingsBus.emit(i);setTimeout(()=>L(false),2e3)}catch(e){console.error("Failed to clear storage:",e)}finally{O(false)}};const le=(0,_react.useCallback)(e=>{},[]);const ce=e=>{const t=s.find(o=>o.id===e);if(t?.description){return t.description}if(e==="environment"){return"Environment badge."}return""};const W=e=>{if(e==="environment"){return"Env Badge"}const t=s.find(o=>o.id===e);return t?.name??e.toUpperCase().replace(/_/g," ")};const de=e=>{if(!Q)return null;switch(e){case"query":return(0,_jsxRuntime.jsx)(_floatingToolsCore.QueryIcon,{size:18});case"env":return(0,_jsxRuntime.jsx)(_floatingToolsCore.EnvIcon,{size:18});case"sentry":return(0,_jsxRuntime.jsx)(_sharedUi.SentryIcon,{size:18,color:"#9945FF"});case"storage":return(0,_jsxRuntime.jsx)(_floatingToolsCore.StorageIcon,{size:18,bgColor:_sharedUi.night.color.surface});case"wifi":case"query-wifi-toggle":return(0,_jsxRuntime.jsx)(_sharedUi.WifiCircuitIcon,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return(0,_jsxRuntime.jsx)(_floatingToolsCore.RoutesIcon,{size:18,bgColor:_sharedUi.night.color.surface});case"network":return(0,_jsxRuntime.jsx)(_floatingToolsCore.NetworkIcon,{size:18});case"environment":return(0,_jsxRuntime.jsx)(_floatingToolsCore.EnvIcon,{size:18});case"debug-borders":return(0,_jsxRuntime.jsx)(_sharedUi.Layers,{size:18,color:_sharedUi.night.color.accent});case"highlight-updates":return(0,_jsxRuntime.jsx)(_sharedUi.RenderCountIcon,{size:18,color:_sharedUi.night.color.accent});case"highlight-updates-modal":return(0,_jsxRuntime.jsx)(_floatingToolsCore.HighlighterIcon,{size:18});case"redux":return(0,_jsxRuntime.jsx)(_floatingToolsCore.ReduxIcon,{size:18});case"image-overlay":return(0,_jsxRuntime.jsx)(_sharedUi.ImageOverlayIcon,{size:18});case"events":return(0,_jsxRuntime.jsx)(_floatingToolsCore.EventsIcon,{size:18});case"zustand":try{const{ZustandIcon:t}=require("@buoy-gg/zustand");return(0,_jsxRuntime.jsx)(t,{size:18})}catch{return(0,_jsxRuntime.jsx)(_sharedUi.Info,{size:18,color:_sharedUi.night.color.textSecondary})}case"jotai":try{const{JotaiIcon:t}=require("@buoy-gg/jotai");return(0,_jsxRuntime.jsx)(t,{size:18})}catch{return(0,_jsxRuntime.jsx)(_sharedUi.Info,{size:18,color:_sharedUi.night.color.textSecondary})}default:{const t=s.find(o=>o.id===e);if(t?.icon!=null){return(0,_AppIcon.renderAppIcon)(t.icon,{slot:"row",size:18,color:t.color})}return(0,_jsxRuntime.jsx)(_sharedUi.Info,{size:18,color:_sharedUi.night.color.textSecondary})}}};const ge=(e,t,o,y)=>{const v=ce(e);return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{activeOpacity:o?1:.7,onPress:()=>!o&&y(),accessibilityLabel:W(e),accessibilityRole:"button",style:[styles.toolRow,o&&styles.rowDisabled],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.toolIconSlot,children:de(e)}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.rowInfo,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.rowLabel,children:[W(e),o?" \xB7 max 6":""]}),v?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowCaption,numberOfLines:1,children:v}):null]}),(0,_jsxRuntime.jsx)(_sharedUi.NightSwitch,{value:t,disabled:o,onValueChange:()=>y()})]},e)};const q=e=>{Y(t=>{const o=new Set(t);if(o.has(e)){o.delete(e)}else{o.add(e)}return o})};const J=(e,t,o,y,v)=>{const ye=f.globalSettings?.[e]??false;const U=C.has(e);return(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{activeOpacity:.7,onPress:()=>q(e),accessibilityLabel:t,style:styles.settingRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.rowInfo,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:t}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowCaption,numberOfLines:U?0:1,children:o})]}),(0,_jsxRuntime.jsx)(_sharedUi.NightSwitch,{value:ye,onValueChange:()=>re(e)})]}),U&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingRowBody,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.settingRowBodyText,children:y}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.settingRowBodyHint,children:v})]})]},e)};const p=(e,t,o)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[(0,_jsxRuntime.jsx)(_sharedUi.NightSectionLabel,{children:e}),t,o]});const he=u==="filesystem"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"File System",tone:"accent"}):u==="asyncstorage"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Async Storage",tone:"warning"}):u==="localstorage"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Local Storage",tone:"accent"}):u==="memory"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Memory",tone:"danger"}):(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Loading\u2026",tone:"neutral"});const ue=()=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:styles.scrollContainer,children:[w==="floating"&&(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:p("Floating Tools",(0,_jsxRuntime.jsx)(_sharedUi.NightCard,{glass:true,children:(0,_jsxRuntime.jsx)(_sharedUi.NightRows,{children:Object.entries(f.floatingTools).map(([e,t])=>ge(e,t,false,()=>ie(e)))})}),(0,_jsxRuntime.jsx)(_sharedUi.NightFootnote,{children:"Tools switched on here appear in the floating bubble row."}))}),w==="settings"&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[p("Background",(0,_jsxRuntime.jsx)(_sharedUi.NightCard,{glass:true,padded:true,children:(0,_jsxRuntime.jsx)(_sharedUi.BackgroundSwitcher,{embedded:true})})),p("Storage",(0,_jsxRuntime.jsxs)(_sharedUi.NightCard,{glass:true,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{activeOpacity:.7,onPress:()=>oe(!T),accessibilityLabel:"Storage Type",style:styles.settingRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowInfo,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:"Storage Type"})}),he,T?(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:16,color:_sharedUi.night.color.textTertiary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronRightIcon,{size:16,color:_sharedUi.night.color.textTertiary})]}),T&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingRowBody,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.settingRowBodyText,children:u==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":u==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":u==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":u==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),u==="asyncstorage"&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.settingRowBodyText,styles.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),u==="memory"&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.settingRowBodyText,styles.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),(0,_jsxRuntime.jsx)(_sharedUi.NightSeparator,{}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.storageExpanded,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.storageExpandedHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.storageExpandedTitle,children:"SAVED SETTINGS"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.storageExpandedCount,children:V?"\u2026":`${E.length} keys`})]}),V?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.storageKeyEmpty,children:"Loading\u2026"}):E.length===0?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.storageKeyEmpty,children:"No settings saved yet"}):(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:E.map(e=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.storageKeyItem,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.storageKeyText,numberOfLines:1,children:e.replace("@react_buoy_","")})},e))})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.cardButtonWrap,children:(0,_jsxRuntime.jsx)(_sharedUi.NightButton,{label:D?"Cleared":B?"Clearing\u2026":"Clear All Settings",variant:D?"secondary":"destructive",size:"md",disabled:B,onPress:ae,icon:D?(0,_jsxRuntime.jsx)(_sharedUi.CheckCircle2,{size:15,color:_sharedUi.night.color.accent}):(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:15,color:B?_sharedUi.night.color.textTertiary:_sharedUi.night.color.danger})})})]})]})),h&&h.state!=="idle"&&p("Desktop Sync",(0,_jsxRuntime.jsxs)(_sharedUi.NightCard,{glass:true,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{activeOpacity:.7,onPress:()=>q("desktopSync"),accessibilityLabel:"Buoy Desktop",style:styles.settingRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowInfo,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:"Buoy Desktop"})}),h.state==="connected"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Connected",tone:"accent"}):h.state==="connecting"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Connecting\u2026",tone:"neutral"}):(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Retrying",tone:"warning"}),C.has("desktopSync")?(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:16,color:_sharedUi.night.color.textTertiary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronRightIcon,{size:16,color:_sharedUi.night.color.textTertiary})]}),C.has("desktopSync")&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingRowBody,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.settingRowBodyText,children:[h.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.footnoteMono,children:h.targetURL??"(unknown URL)"}),h.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),h.state==="retrying"&&h.lastError&&(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.settingRowBodyText,styles.bodyWarning],children:["Last error: ",h.lastError]})]})]})),p("Modal Behavior",(0,_jsxRuntime.jsx)(_sharedUi.NightCard,{glass:true,children:(0,_jsxRuntime.jsxs)(_sharedUi.NightRows,{children:[J("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),(0,_sharedUi.expandableWindowControlsSupported)(_reactNative.Platform.OS==="web")?J("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),w==="pro"&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[p("License",(0,_jsxRuntime.jsxs)(_sharedUi.NightCard,{glass:true,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowInfo,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:"License Status"})}),(0,_jsxRuntime.jsx)(_reactNative.View,{testID:"buoy-settings-license-status",accessibilityLabel:j?"License: Active":"License: Free",children:j?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Active",tone:"accent"}):(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Free",tone:"neutral"})})]}),m?.tierSource==="session"?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowInfo,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:"Signed in with Buoy"})}),(0,_jsxRuntime.jsx)(_sharedUi.NightButton,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void(0,_sharedUi.signOutOfBuoy)(),testID:"buoy-settings-signout"})]}):null]}),(0,_jsxRuntime.jsx)(_sharedUi.NightFootnote,{children:j?"You have full access to all Buoy DevTools features.":z?ee?`Couldn't reach the license server (${z}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${z}.`:"Upgrade to Pro to unlock all features and support development."})),!j&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[p("Pro Features",(0,_jsxRuntime.jsx)(_sharedUi.NightCard,{glass:true,children:(0,_jsxRuntime.jsx)(_sharedUi.NightRows,{children:["Advanced Settings","Priority Support"].map(e=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.featureRow,children:[(0,_jsxRuntime.jsx)(_sharedUi.CheckCircle2,{size:16,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:e})]},e))})})),(0,_jsxRuntime.jsx)(_sharedUi.NightButton,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>I(true)})]})]})]}),(0,_jsxRuntime.jsx)(_sharedUi.LicenseEntryModal,{visible:$,onClose:()=>I(false),onSuccess:()=>I(false)})]});return(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:r,onClose:a,zIndex:d,variant:"night",header:{showToggleButton:false,customContent:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.headerRow,children:(0,_jsxRuntime.jsx)(_sharedUi.NightSegmented,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:w,onChange:e=>F(e)})})},initialMode:"bottomSheet",onModeChange:le,persistenceKey:_sharedUi.devToolsStorageKeys.settings.root(),enablePersistence:true,maxHeight:H-M.top,initialHeight:ne,initialFloatingPosition:{x:(K-se)/2,y:M.top+20},enableGlitchEffects:true,children:ue()})};exports.DevToolsSettingsModal=DevToolsSettingsModal;const basicDefaultSettings={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}};const createDefaultsFromConfig=(r,a)=>{const n=new Set(r??[]);const c=new Set(a??[]);const s={};for(const d of c){s[d]=true}const l={environment:n.has("environment")};for(const d of n){if(d!=="environment"){l[d]=true}}return{dialTools:enforceDialLimit(s),floatingTools:l,globalSettings:{enableSharedModalDimensions:false}}};let cachedSettings=null;let cachedActiveTab=null;let cachedStorageBackend=null;const sameSettings=(r,a)=>JSON.stringify(r)===JSON.stringify(a);_settingsBus.settingsBus.addListener(r=>{if(r)cachedSettings=r});const useDevToolsSettings=()=>{const{defaultFloatingTools:r,defaultDialTools:a}=(0,_DefaultConfigContext.useDefaultConfig)();const n=(0,_react.useMemo)(()=>{if(!r&&!a){return basicDefaultSettings}return createDefaultsFromConfig(r,a)},[r,a]);const[c,s]=(0,_react.useState)(n);const l=(0,_react.useCallback)(async()=>{try{const g=await _sharedUi.persistentStorage.getItem(STORAGE_KEY);if(g){const x=JSON.parse(g);const i=mergeWithDefaults(n,x);s(i);return}s(n)}catch(g){console.error("Failed to load dev tools settings:",g);s(n)}},[n]);(0,_react.useEffect)(()=>(0,_sharedUi.onSettingsApplied)(g=>{if(g.includes(STORAGE_KEY))void l()}),[l]);(0,_react.useEffect)(()=>{l();const g=_settingsBus.settingsBus.addListener(x=>{try{if(x){s(x)}}catch(i){}});return()=>{g()}},[l]);const d=(0,_react.useCallback)(()=>{l()},[l]);return{settings:c,refreshSettings:d}};exports.useDevToolsSettings=useDevToolsSettings;const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:_sharedUi.night.gutter,paddingRight:_sharedUi.night.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:_sharedUi.night.gutter,paddingTop:8,paddingBottom:24,gap:_sharedUi.night.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:_sharedUi.night.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:_sharedUi.night.rowPadH,paddingVertical:_sharedUi.night.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:_sharedUi.night.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"500"},rowCaption:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.label},settingRowBody:{paddingHorizontal:_sharedUi.night.rowPadH,paddingBottom:_sharedUi.night.rowPadV,gap:6},settingRowBodyText:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,lineHeight:_sharedUi.night.font.caption*1.45},settingRowBodyHint:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.caption,lineHeight:_sharedUi.night.font.caption*1.45},bodyWarning:{color:_sharedUi.night.color.warning},bodyDanger:{color:_sharedUi.night.color.danger},cardButtonWrap:{paddingHorizontal:_sharedUi.night.cardPad,paddingTop:10,paddingBottom:_sharedUi.night.cardPad},storageExpanded:{paddingHorizontal:_sharedUi.night.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:_sharedUi.night.color.glassElevated,borderRadius:_sharedUi.night.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.micro,fontFamily:_sharedUi.monoFont},storageKeyEmpty:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:_sharedUi.monoFont,fontSize:_sharedUi.night.font.label,color:_sharedUi.night.color.textSecondary}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.useDevToolsSettings=exports.DevToolsSettingsModal=void 0;var _react=require("react");var _reactNative=require("react-native");var _settingsBus=require("./settingsBus.js");var _useDesktopSyncStatus=require("./useDesktopSyncStatus");var _sharedUi=require("@buoy-gg/shared-ui");var _floatingToolsCore=require("@buoy-gg/floating-tools-core");var _DefaultConfigContext=require("./DefaultConfigContext.js");var _AppIcon=require("./AppIcon");var _jsxRuntime=require("react/jsx-runtime");const STORAGE_KEY="@react_buoy_dev_tools_settings";const MAX_DIAL_SLOTS=6;const enforceDialLimit=r=>{let a=MAX_DIAL_SLOTS;const n={};for(const[c,s]of Object.entries(r)){if(s&&a>0){n[c]=true;a-=1}else{n[c]=false}}return n};const sanitizeFloating=(r,a)=>{const{userStatus:n,environment:c,...s}=r;const l=a?Object.entries(s).filter(([d])=>a.includes(d)):Object.entries(s);return{...Object.fromEntries(l),environment:c??false}};const mergeWithDefaults=(r,a,n)=>{if(!a)return r;const c={...r.dialTools,...a.dialTools??{}};const s=n?.allowedDialKeys?Object.entries(c).filter(([d])=>n.allowedDialKeys?.includes(d)):Object.entries(c);const l=enforceDialLimit(Object.fromEntries(s));return{dialTools:l,floatingTools:sanitizeFloating({...r.floatingTools,...a.floatingTools??{}},n?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...a.globalSettings??{}}}};const generateDefaultSettings=(r=[],a,n)=>{const c={};const s={};const l=new Set(a??[]);const d=new Set(n??[]);const g=!n||n.length===0;for(const x of r){const{id:i,slot:S="both"}=x;if(S==="dial"||S==="both"){c[i]=g?true:d.has(i)}if(S==="row"||S==="both"){s[i]=l.has(i)}}return{dialTools:enforceDialLimit(c),floatingTools:{...s,environment:l.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}};const DevToolsSettingsModal=({visible:r,onClose:a,onSettingsChange:n,initialSettings:c,availableApps:s=[],storage:l=_sharedUi.persistentStorage,zIndex:d})=>{const{defaultFloatingTools:g,defaultDialTools:x}=(0,_DefaultConfigContext.useDefaultConfig)();const i=(0,_react.useMemo)(()=>generateDefaultSettings(s,g,x),[s,g,x]);const S=(0,_react.useMemo)(()=>Object.keys(i.dialTools),[i]);const R=(0,_react.useMemo)(()=>Object.keys(i.floatingTools).filter(e=>e!=="environment"),[i]);const[f,b]=(0,_react.useState)(c||cachedSettings||i);const[w,E]=(0,_react.useState)(cachedActiveTab??"floating");const[F,G]=(0,_react.useState)(cachedActiveTab!==null);const[C,Y]=(0,_react.useState)(new Set);const[$,N]=(0,_react.useState)(false);const[Q,X]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{const e=requestAnimationFrame(()=>X(true));return()=>cancelAnimationFrame(e)},[]);const h=(0,_useDesktopSyncStatus.useDesktopSyncStatus)();(0,_react.useEffect)(()=>{const e=async()=>{try{const t=await _sharedUi.persistentStorage.getItem(_sharedUi.devToolsStorageKeys.settings.activeTab());if(t&&["floating","settings","pro"].includes(t)){const o=t;cachedActiveTab=o;E(y=>y===o?y:o)}}catch(t){}finally{G(true)}};e()},[]);(0,_react.useEffect)(()=>{if(!F)return;_sharedUi.persistentStorage.setItem(_sharedUi.devToolsStorageKeys.settings.activeTab(),w).catch(e=>{console.warn("Failed to save settings active tab:",e)})},[w,F]);const Z=(0,_sharedUi.getUseLicense)();const m=Z?.();const j=m?.isPro??false;const I=!j&&m?.licenseKey?m.error:null;const ee=m?.errorKind==="transport";const[u,te]=(0,_react.useState)(cachedStorageBackend);const[z,O]=(0,_react.useState)(false);const[B,D]=(0,_react.useState)(false);const[T,oe]=(0,_react.useState)(false);const[L,k]=(0,_react.useState)([]);const[V,P]=(0,_react.useState)(false);const H=(0,_sharedUi.useSafeAreaInsets)();const M=_reactNative.Dimensions.get("window").height;const K=_reactNative.Dimensions.get("window").width;const ne=Math.floor(M*.33);const se=Math.min(K-32,400);const _=(0,_react.useCallback)(async()=>{try{const e=await l.getItem(STORAGE_KEY);if(e){const t=JSON.parse(e);const o=mergeWithDefaults(i,t,{allowedDialKeys:S,allowedFloatingKeys:R});cachedSettings=o;b(y=>sameSettings(y,o)?y:o);return}cachedSettings=i;b(t=>sameSettings(t,i)?t:i)}catch(e){console.error("Failed to load dev tools settings:",e);b(i)}},[i,S,R,l]);(0,_react.useEffect)(()=>{_()},[_]);(0,_react.useEffect)(()=>{(0,_sharedUi.getStorageBackendType)().then(e=>{cachedStorageBackend=e;te(t=>t===e?t:e)})},[]);(0,_react.useEffect)(()=>{if(T){P(true);_sharedUi.persistentStorage.getAllKeys().then(e=>{k(e.sort())}).catch(()=>{k([])}).finally(()=>{P(false)})}},[T]);const A=async e=>{try{const t={...e,dialTools:enforceDialLimit(e.dialTools)};await l.setItem(STORAGE_KEY,JSON.stringify(t));cachedSettings=t;b(t);n?.(t);_settingsBus.settingsBus.emit(t)}catch(t){console.error("Failed to save dev tools settings:",t)}};const ie=e=>{const t={...f,floatingTools:{...f.floatingTools,[e]:!f.floatingTools[e]}};A(t)};const re=e=>{const t={...f,globalSettings:{...f.globalSettings,[e]:!f.globalSettings?.[e]}};A(t)};const ae=async()=>{O(true);D(false);try{await _sharedUi.persistentStorage.clear();D(true);b(i);if(l!==_sharedUi.persistentStorage)await l.setItem(STORAGE_KEY,JSON.stringify(i));n?.(i);_settingsBus.settingsBus.emit(i);setTimeout(()=>D(false),2e3)}catch(e){console.error("Failed to clear storage:",e)}finally{O(false)}};const le=(0,_react.useCallback)(e=>{},[]);const ce=e=>{const t=s.find(o=>o.id===e);if(t?.description){return t.description}if(e==="environment"){return"Environment badge."}return""};const W=e=>{if(e==="environment"){return"Env Badge"}const t=s.find(o=>o.id===e);return t?.name??e.toUpperCase().replace(/_/g," ")};const de=e=>{if(!Q)return null;switch(e){case"query":return(0,_jsxRuntime.jsx)(_floatingToolsCore.QueryIcon,{size:18});case"env":return(0,_jsxRuntime.jsx)(_floatingToolsCore.EnvIcon,{size:18});case"sentry":return(0,_jsxRuntime.jsx)(_sharedUi.SentryIcon,{size:18,color:"#9945FF"});case"storage":return(0,_jsxRuntime.jsx)(_floatingToolsCore.StorageIcon,{size:18,bgColor:_sharedUi.night.color.surface});case"wifi":case"query-wifi-toggle":return(0,_jsxRuntime.jsx)(_sharedUi.WifiCircuitIcon,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return(0,_jsxRuntime.jsx)(_floatingToolsCore.RoutesIcon,{size:18,bgColor:_sharedUi.night.color.surface});case"network":return(0,_jsxRuntime.jsx)(_floatingToolsCore.NetworkIcon,{size:18});case"environment":return(0,_jsxRuntime.jsx)(_floatingToolsCore.EnvIcon,{size:18});case"debug-borders":return(0,_jsxRuntime.jsx)(_sharedUi.Layers,{size:18,color:_sharedUi.night.color.accent});case"highlight-updates":return(0,_jsxRuntime.jsx)(_sharedUi.RenderCountIcon,{size:18,color:_sharedUi.night.color.accent});case"highlight-updates-modal":return(0,_jsxRuntime.jsx)(_floatingToolsCore.HighlighterIcon,{size:18});case"redux":return(0,_jsxRuntime.jsx)(_floatingToolsCore.ReduxIcon,{size:18});case"image-overlay":return(0,_jsxRuntime.jsx)(_sharedUi.ImageOverlayIcon,{size:18});case"events":return(0,_jsxRuntime.jsx)(_floatingToolsCore.EventsIcon,{size:18});case"zustand":try{const{ZustandIcon:t}=require("@buoy-gg/zustand");return(0,_jsxRuntime.jsx)(t,{size:18})}catch{return(0,_jsxRuntime.jsx)(_sharedUi.Info,{size:18,color:_sharedUi.night.color.textSecondary})}case"jotai":try{const{JotaiIcon:t}=require("@buoy-gg/jotai");return(0,_jsxRuntime.jsx)(t,{size:18})}catch{return(0,_jsxRuntime.jsx)(_sharedUi.Info,{size:18,color:_sharedUi.night.color.textSecondary})}default:{const t=s.find(o=>o.id===e);if(t?.icon!=null){return(0,_AppIcon.renderAppIcon)(t.icon,{slot:"row",size:18,color:t.color})}return(0,_jsxRuntime.jsx)(_sharedUi.Info,{size:18,color:_sharedUi.night.color.textSecondary})}}};const ge=(e,t,o,y)=>{const v=ce(e);return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{activeOpacity:o?1:.7,onPress:()=>!o&&y(),accessibilityLabel:W(e),accessibilityRole:"button",style:[styles.toolRow,o&&styles.rowDisabled],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.toolIconSlot,children:de(e)}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.rowInfo,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.rowLabel,children:[W(e),o?" \xB7 max 6":""]}),v?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowCaption,numberOfLines:1,children:v}):null]}),(0,_jsxRuntime.jsx)(_sharedUi.NightSwitch,{value:t,disabled:o,onValueChange:()=>y()})]},e)};const q=e=>{Y(t=>{const o=new Set(t);if(o.has(e)){o.delete(e)}else{o.add(e)}return o})};const U=(e,t,o,y,v)=>{const ye=f.globalSettings?.[e]??false;const J=C.has(e);return(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{activeOpacity:.7,onPress:()=>q(e),accessibilityLabel:t,style:styles.settingRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.rowInfo,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:t}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowCaption,numberOfLines:J?0:1,children:o})]}),(0,_jsxRuntime.jsx)(_sharedUi.NightSwitch,{value:ye,onValueChange:()=>re(e)})]}),J&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingRowBody,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.settingRowBodyText,children:y}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.settingRowBodyHint,children:v})]})]},e)};const p=(e,t,o)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[(0,_jsxRuntime.jsx)(_sharedUi.NightSectionLabel,{children:e}),t,o]});const he=u==="filesystem"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"File System",tone:"accent"}):u==="asyncstorage"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Async Storage",tone:"warning"}):u==="localstorage"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Local Storage",tone:"accent"}):u==="memory"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Memory",tone:"danger"}):(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Loading\u2026",tone:"neutral"});const ue=()=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:styles.scrollContainer,children:[w==="floating"&&(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:p("Floating Tools",(0,_jsxRuntime.jsx)(_sharedUi.NightCard,{glass:true,children:(0,_jsxRuntime.jsx)(_sharedUi.NightRows,{children:Object.entries(f.floatingTools).map(([e,t])=>ge(e,t,false,()=>ie(e)))})}),(0,_jsxRuntime.jsx)(_sharedUi.NightFootnote,{children:"Tools switched on here appear in the floating bubble row."}))}),w==="settings"&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[p("Background",(0,_jsxRuntime.jsx)(_sharedUi.NightCard,{glass:true,padded:true,children:(0,_jsxRuntime.jsx)(_sharedUi.BackgroundSwitcher,{embedded:true})})),p("Storage",(0,_jsxRuntime.jsxs)(_sharedUi.NightCard,{glass:true,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{activeOpacity:.7,onPress:()=>oe(!T),accessibilityLabel:"Storage Type",style:styles.settingRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowInfo,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:"Storage Type"})}),he,T?(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:16,color:_sharedUi.night.color.textTertiary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronRightIcon,{size:16,color:_sharedUi.night.color.textTertiary})]}),T&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingRowBody,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.settingRowBodyText,children:u==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":u==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":u==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":u==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),u==="asyncstorage"&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.settingRowBodyText,styles.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),u==="memory"&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.settingRowBodyText,styles.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),(0,_jsxRuntime.jsx)(_sharedUi.NightSeparator,{}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.storageExpanded,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.storageExpandedHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.storageExpandedTitle,children:"SAVED SETTINGS"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.storageExpandedCount,children:V?"\u2026":`${L.length} keys`})]}),V?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.storageKeyEmpty,children:"Loading\u2026"}):L.length===0?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.storageKeyEmpty,children:"No settings saved yet"}):(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:L.map(e=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.storageKeyItem,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.storageKeyText,numberOfLines:1,children:e.replace("@react_buoy_","")})},e))})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.cardButtonWrap,children:(0,_jsxRuntime.jsx)(_sharedUi.NightButton,{label:B?"Cleared":z?"Clearing\u2026":"Clear All Settings",variant:B?"secondary":"destructive",size:"md",disabled:z,onPress:ae,icon:B?(0,_jsxRuntime.jsx)(_sharedUi.CheckCircle2,{size:15,color:_sharedUi.night.color.accent}):(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:15,color:z?_sharedUi.night.color.textTertiary:_sharedUi.night.color.danger})})})]})]})),h&&h.state!=="idle"&&p("Desktop Sync",(0,_jsxRuntime.jsxs)(_sharedUi.NightCard,{glass:true,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{activeOpacity:.7,onPress:()=>q("desktopSync"),accessibilityLabel:"Buoy Desktop",style:styles.settingRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowInfo,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:"Buoy Desktop"})}),h.state==="connected"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Connected",tone:"accent"}):h.state==="connecting"?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Connecting\u2026",tone:"neutral"}):(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Retrying",tone:"warning"}),C.has("desktopSync")?(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:16,color:_sharedUi.night.color.textTertiary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronRightIcon,{size:16,color:_sharedUi.night.color.textTertiary})]}),C.has("desktopSync")&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingRowBody,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.settingRowBodyText,children:[h.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.footnoteMono,children:h.targetURL??"(unknown URL)"}),h.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),h.state==="retrying"&&h.lastError&&(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.settingRowBodyText,styles.bodyWarning],children:["Last error: ",h.lastError]})]})]})),p("Modal Behavior",(0,_jsxRuntime.jsx)(_sharedUi.NightCard,{glass:true,children:(0,_jsxRuntime.jsxs)(_sharedUi.NightRows,{children:[U("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),(0,_sharedUi.expandableWindowControlsSupported)(_reactNative.Platform.OS==="web")?U("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),w==="pro"&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[p("License",(0,_jsxRuntime.jsxs)(_sharedUi.NightCard,{glass:true,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowInfo,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:"License Status"})}),(0,_jsxRuntime.jsx)(_reactNative.View,{testID:"buoy-settings-license-status",accessibilityLabel:j?"License: Active":"License: Free",children:j?(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Active",tone:"accent"}):(0,_jsxRuntime.jsx)(_sharedUi.NightBadge,{label:"Free",tone:"neutral"})})]}),m?.tierSource==="session"?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.settingRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowInfo,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:"Signed in with Buoy"})}),(0,_jsxRuntime.jsx)(_sharedUi.NightButton,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void(0,_sharedUi.signOutOfBuoy)(),testID:"buoy-settings-signout"})]}):null]}),(0,_jsxRuntime.jsx)(_sharedUi.NightFootnote,{children:j?"You have full access to all Buoy DevTools features.":I?ee?`Couldn't reach the license server (${I}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${I}.`:"Upgrade to Pro to unlock all features and support development."})),!j&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[p("Pro Features",(0,_jsxRuntime.jsx)(_sharedUi.NightCard,{glass:true,children:(0,_jsxRuntime.jsx)(_sharedUi.NightRows,{children:["Advanced Settings","Priority Support"].map(e=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.featureRow,children:[(0,_jsxRuntime.jsx)(_sharedUi.CheckCircle2,{size:16,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:e})]},e))})})),(0,_jsxRuntime.jsx)(_sharedUi.NightButton,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>N(true)})]})]})]}),(0,_jsxRuntime.jsx)(_sharedUi.BuoyUpgradeSheet,{visible:$,onClose:()=>N(false)})]});return(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:r,onClose:a,zIndex:d,variant:"night",header:{showToggleButton:false,customContent:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.headerRow,children:(0,_jsxRuntime.jsx)(_sharedUi.NightSegmented,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:w,onChange:e=>E(e)})})},initialMode:"bottomSheet",onModeChange:le,persistenceKey:_sharedUi.devToolsStorageKeys.settings.root(),enablePersistence:true,maxHeight:M-H.top,initialHeight:ne,initialFloatingPosition:{x:(K-se)/2,y:H.top+20},enableGlitchEffects:true,children:ue()})};exports.DevToolsSettingsModal=DevToolsSettingsModal;const basicDefaultSettings={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}};const createDefaultsFromConfig=(r,a)=>{const n=new Set(r??[]);const c=new Set(a??[]);const s={};for(const d of c){s[d]=true}const l={environment:n.has("environment")};for(const d of n){if(d!=="environment"){l[d]=true}}return{dialTools:enforceDialLimit(s),floatingTools:l,globalSettings:{enableSharedModalDimensions:false}}};let cachedSettings=null;let cachedActiveTab=null;let cachedStorageBackend=null;const sameSettings=(r,a)=>JSON.stringify(r)===JSON.stringify(a);_settingsBus.settingsBus.addListener(r=>{if(r)cachedSettings=r});const useDevToolsSettings=()=>{const{defaultFloatingTools:r,defaultDialTools:a}=(0,_DefaultConfigContext.useDefaultConfig)();const n=(0,_react.useMemo)(()=>{if(!r&&!a){return basicDefaultSettings}return createDefaultsFromConfig(r,a)},[r,a]);const[c,s]=(0,_react.useState)(n);const l=(0,_react.useCallback)(async()=>{try{const g=await _sharedUi.persistentStorage.getItem(STORAGE_KEY);if(g){const x=JSON.parse(g);const i=mergeWithDefaults(n,x);s(i);return}s(n)}catch(g){console.error("Failed to load dev tools settings:",g);s(n)}},[n]);(0,_react.useEffect)(()=>(0,_sharedUi.onSettingsApplied)(g=>{if(g.includes(STORAGE_KEY))void l()}),[l]);(0,_react.useEffect)(()=>{l();const g=_settingsBus.settingsBus.addListener(x=>{try{if(x){s(x)}}catch(i){}});return()=>{g()}},[l]);const d=(0,_react.useCallback)(()=>{l()},[l]);return{settings:c,refreshSettings:d}};exports.useDevToolsSettings=useDevToolsSettings;const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:_sharedUi.night.gutter,paddingRight:_sharedUi.night.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:_sharedUi.night.gutter,paddingTop:8,paddingBottom:24,gap:_sharedUi.night.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:_sharedUi.night.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:_sharedUi.night.rowPadH,paddingVertical:_sharedUi.night.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:_sharedUi.night.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"500"},rowCaption:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.label},settingRowBody:{paddingHorizontal:_sharedUi.night.rowPadH,paddingBottom:_sharedUi.night.rowPadV,gap:6},settingRowBodyText:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,lineHeight:_sharedUi.night.font.caption*1.45},settingRowBodyHint:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.caption,lineHeight:_sharedUi.night.font.caption*1.45},bodyWarning:{color:_sharedUi.night.color.warning},bodyDanger:{color:_sharedUi.night.color.danger},cardButtonWrap:{paddingHorizontal:_sharedUi.night.cardPad,paddingTop:10,paddingBottom:_sharedUi.night.cardPad},storageExpanded:{paddingHorizontal:_sharedUi.night.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:_sharedUi.night.color.glassElevated,borderRadius:_sharedUi.night.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.micro,fontFamily:_sharedUi.monoFont},storageKeyEmpty:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:_sharedUi.monoFont,fontSize:_sharedUi.night.font.label,color:_sharedUi.night.color.textSecondary}});
|
package/lib/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.60";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{
|
|
1
|
+
"use strict";import{useState as u}from"react";import{Modal as c,Pressable as d,StyleSheet as o,View as n}from"react-native";import{AccountSetupButton as f,BuoyNeedsPlanCard as p,BuoySignInCard as y,useSignInState as m}from"@buoy-gg/shared-ui";import{jsx as t,jsxs as r}from"react/jsx-runtime";export function BuoySignIn({needsPlan:l=false}){const[s,e]=u(false);const i=m();return r(n,{pointerEvents:"box-none",style:a.root,children:[t(f,{expanded:s,onPress:()=>e(true)}),s?t(c,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>e(false),children:r(n,{style:a.overlay,accessibilityViewIsModal:true,children:[t(d,{style:o.absoluteFill,onPress:()=>e(false),accessible:false}),l&&i==="active"?t(p,{onClose:()=>e(false)}):t(y,{onClose:()=>e(false)})]})}):null]})}const a=o.create({root:{position:"absolute",bottom:30,right:16,zIndex:99999},overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useState as S,useEffect as I,useCallback as W,useMemo as A}from"react";import{View as y,Text as h,StyleSheet as Xe,ScrollView as Se,TouchableOpacity as j,Dimensions as be,Platform as Ze}from"react-native";import{settingsBus as N}from"./settingsBus.js";import{useDesktopSyncStatus as et}from"./useDesktopSyncStatus";import{SentryIcon as tt,WifiCircuitIcon as ot,ImageOverlayIcon as nt,RenderCountIcon as rt,Info as Q,Layers as st,ChevronRightIcon as we,ChevronDown as Te,getStorageBackendType as it,getUseLicense as at,signOutOfBuoy as lt,persistentStorage as D,Trash2 as ct,CheckCircle2 as ve,LicenseEntryModal as dt,BackgroundSwitcher as gt,night as o,NightCard as R,NightRows as X,NightSectionLabel as ut,NightFootnote as xe,NightSwitch as ze,NightButton as Z,NightSegmented as yt,NightBadge as v,NightSeparator as ht,monoFont as Ie}from"@buoy-gg/shared-ui";import{EnvIcon as Ce,StorageIcon as ft,RoutesIcon as pt,NetworkIcon as mt,QueryIcon as St,HighlighterIcon as bt,ReduxIcon as wt,EventsIcon as Tt}from"@buoy-gg/floating-tools-core";import{useDefaultConfig as Le}from"./DefaultConfigContext.js";import{renderAppIcon as vt}from"./AppIcon";import{JsModal as xt,devToolsStorageKeys as ee,onSettingsApplied as zt,expandableWindowControlsSupported as It}from"@buoy-gg/shared-ui";import{useSafeAreaInsets as Ct}from"@buoy-gg/shared-ui";import{jsx as e,jsxs as s,Fragment as P}from"react/jsx-runtime";const H="@react_buoy_dev_tools_settings";const Lt=6;const V=d=>{let g=Lt;const a={};for(const[f,l]of Object.entries(d)){if(l&&g>0){a[f]=true;g-=1}else{a[f]=false}}return a};const Dt=(d,g)=>{const{userStatus:a,environment:f,...l}=d;const u=g?Object.entries(l).filter(([p])=>g.includes(p)):Object.entries(l);return{...Object.fromEntries(u),environment:f??false}};const De=(d,g,a)=>{if(!g)return d;const f={...d.dialTools,...g.dialTools??{}};const l=a?.allowedDialKeys?Object.entries(f).filter(([p])=>a.allowedDialKeys?.includes(p)):Object.entries(f);const u=V(Object.fromEntries(l));return{dialTools:u,floatingTools:Dt({...d.floatingTools,...g.floatingTools??{}},a?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...g.globalSettings??{}}}};const Rt=(d=[],g,a)=>{const f={};const l={};const u=new Set(g??[]);const p=new Set(a??[]);const m=!a||a.length===0;for(const x of d){const{id:c,slot:C="both"}=x;if(C==="dial"||C==="both"){f[c]=m?true:p.has(c)}if(C==="row"||C==="both"){l[c]=u.has(c)}}return{dialTools:V(f),floatingTools:{...l,environment:u.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}};export const DevToolsSettingsModal=({visible:d,onClose:g,onSettingsChange:a,initialSettings:f,availableApps:l=[],storage:u=D,zIndex:p})=>{const{defaultFloatingTools:m,defaultDialTools:x}=Le();const c=A(()=>Rt(l,m,x),[l,m,x]);const C=A(()=>Object.keys(c.dialTools),[c]);const oe=A(()=>Object.keys(c.floatingTools).filter(t=>t!=="environment"),[c]);const[z,E]=S(f||M||c);const[B,ne]=S(te??"floating");const[re,Ee]=S(te!==null);const[_,Fe]=S(new Set);const[Oe,J]=S(false);const[ke,Pe]=S(false);I(()=>{const t=requestAnimationFrame(()=>Pe(true));return()=>cancelAnimationFrame(t)},[]);const b=et();I(()=>{const t=async()=>{try{const r=await D.getItem(ee.settings.activeTab());if(r&&["floating","settings","pro"].includes(r)){const i=r;te=i;ne(T=>T===i?T:i)}}catch(r){}finally{Ee(true)}};t()},[]);I(()=>{if(!re)return;D.setItem(ee.settings.activeTab(),B).catch(t=>{console.warn("Failed to save settings active tab:",t)})},[B,re]);const He=at();const F=He?.();const O=F?.isPro??false;const U=!O&&F?.licenseKey?F.error:null;const Me=F?.errorKind==="transport";const[w,Ke]=S(Re);const[G,se]=S(false);const[q,Y]=S(false);const[k,We]=S(false);const[$,ie]=S([]);const[ae,le]=S(false);const ce=Ct();const de=be.get("window").height;const ge=be.get("window").width;const Ae=Math.floor(de*.33);const je=Math.min(ge-32,400);const ue=W(async()=>{try{const t=await u.getItem(H);if(t){const r=JSON.parse(t);const i=De(c,r,{allowedDialKeys:C,allowedFloatingKeys:oe});M=i;E(T=>Be(T,i)?T:i);return}M=c;E(r=>Be(r,c)?r:c)}catch(t){console.error("Failed to load dev tools settings:",t);E(c)}},[c,C,oe,u]);I(()=>{ue()},[ue]);I(()=>{it().then(t=>{Re=t;Ke(r=>r===t?r:t)})},[]);I(()=>{if(k){le(true);D.getAllKeys().then(t=>{ie(t.sort())}).catch(()=>{ie([])}).finally(()=>{le(false)})}},[k]);const ye=async t=>{try{const r={...t,dialTools:V(t.dialTools)};await u.setItem(H,JSON.stringify(r));M=r;E(r);a?.(r);N.emit(r)}catch(r){console.error("Failed to save dev tools settings:",r)}};const Ne=t=>{const r={...z,floatingTools:{...z.floatingTools,[t]:!z.floatingTools[t]}};ye(r)};const Ve=t=>{const r={...z,globalSettings:{...z.globalSettings,[t]:!z.globalSettings?.[t]}};ye(r)};const _e=async()=>{se(true);Y(false);try{await D.clear();Y(true);E(c);if(u!==D)await u.setItem(H,JSON.stringify(c));a?.(c);N.emit(c);setTimeout(()=>Y(false),2e3)}catch(t){console.error("Failed to clear storage:",t)}finally{se(false)}};const Je=W(t=>{},[]);const Ue=t=>{const r=l.find(i=>i.id===t);if(r?.description){return r.description}if(t==="environment"){return"Environment badge."}return""};const he=t=>{if(t==="environment"){return"Env Badge"}const r=l.find(i=>i.id===t);return r?.name??t.toUpperCase().replace(/_/g," ")};const Ge=t=>{if(!ke)return null;switch(t){case"query":return e(St,{size:18});case"env":return e(Ce,{size:18});case"sentry":return e(tt,{size:18,color:"#9945FF"});case"storage":return e(ft,{size:18,bgColor:o.color.surface});case"wifi":case"query-wifi-toggle":return e(ot,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return e(pt,{size:18,bgColor:o.color.surface});case"network":return e(mt,{size:18});case"environment":return e(Ce,{size:18});case"debug-borders":return e(st,{size:18,color:o.color.accent});case"highlight-updates":return e(rt,{size:18,color:o.color.accent});case"highlight-updates-modal":return e(bt,{size:18});case"redux":return e(wt,{size:18});case"image-overlay":return e(nt,{size:18});case"events":return e(Tt,{size:18});case"zustand":try{const{ZustandIcon:r}=require("@buoy-gg/zustand");return e(r,{size:18})}catch{return e(Q,{size:18,color:o.color.textSecondary})}case"jotai":try{const{JotaiIcon:r}=require("@buoy-gg/jotai");return e(r,{size:18})}catch{return e(Q,{size:18,color:o.color.textSecondary})}default:{const r=l.find(i=>i.id===t);if(r?.icon!=null){return vt(r.icon,{slot:"row",size:18,color:r.color})}return e(Q,{size:18,color:o.color.textSecondary})}}};const qe=(t,r,i,T)=>{const K=Ue(t);return s(j,{activeOpacity:i?1:.7,onPress:()=>!i&&T(),accessibilityLabel:he(t),accessibilityRole:"button",style:[n.toolRow,i&&n.rowDisabled],children:[e(y,{style:n.toolIconSlot,children:Ge(t)}),s(y,{style:n.rowInfo,children:[s(h,{style:n.rowLabel,children:[he(t),i?" \xB7 max 6":""]}),K?e(h,{style:n.rowCaption,numberOfLines:1,children:K}):null]}),e(ze,{value:r,disabled:i,onValueChange:()=>T()})]},t)};const fe=t=>{Fe(r=>{const i=new Set(r);if(i.has(t)){i.delete(t)}else{i.add(t)}return i})};const pe=(t,r,i,T,K)=>{const Qe=z.globalSettings?.[t]??false;const me=_.has(t);return s(y,{children:[s(j,{activeOpacity:.7,onPress:()=>fe(t),accessibilityLabel:r,style:n.settingRow,children:[s(y,{style:n.rowInfo,children:[e(h,{style:n.rowLabel,children:r}),e(h,{style:n.rowCaption,numberOfLines:me?0:1,children:i})]}),e(ze,{value:Qe,onValueChange:()=>Ve(t)})]}),me&&s(y,{style:n.settingRowBody,children:[e(h,{style:n.settingRowBodyText,children:T}),e(h,{style:n.settingRowBodyHint,children:K})]})]},t)};const L=(t,r,i)=>s(y,{children:[e(ut,{children:t}),r,i]});const Ye=w==="filesystem"?e(v,{label:"File System",tone:"accent"}):w==="asyncstorage"?e(v,{label:"Async Storage",tone:"warning"}):w==="localstorage"?e(v,{label:"Local Storage",tone:"accent"}):w==="memory"?e(v,{label:"Memory",tone:"danger"}):e(v,{label:"Loading\u2026",tone:"neutral"});const $e=()=>s(y,{style:n.container,children:[s(Se,{style:n.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:n.scrollContainer,children:[B==="floating"&&e(P,{children:L("Floating Tools",e(R,{glass:true,children:e(X,{children:Object.entries(z.floatingTools).map(([t,r])=>qe(t,r,false,()=>Ne(t)))})}),e(xe,{children:"Tools switched on here appear in the floating bubble row."}))}),B==="settings"&&s(P,{children:[L("Background",e(R,{glass:true,padded:true,children:e(gt,{embedded:true})})),L("Storage",s(R,{glass:true,children:[s(j,{activeOpacity:.7,onPress:()=>We(!k),accessibilityLabel:"Storage Type",style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Storage Type"})}),Ye,k?e(Te,{size:16,color:o.color.textTertiary}):e(we,{size:16,color:o.color.textTertiary})]}),k&&s(P,{children:[s(y,{style:n.settingRowBody,children:[e(h,{style:n.settingRowBodyText,children:w==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":w==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":w==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":w==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),w==="asyncstorage"&&e(h,{style:[n.settingRowBodyText,n.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),w==="memory"&&e(h,{style:[n.settingRowBodyText,n.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),e(ht,{}),s(y,{style:n.storageExpanded,children:[s(y,{style:n.storageExpandedHeader,children:[e(h,{style:n.storageExpandedTitle,children:"SAVED SETTINGS"}),e(h,{style:n.storageExpandedCount,children:ae?"\u2026":`${$.length} keys`})]}),ae?e(h,{style:n.storageKeyEmpty,children:"Loading\u2026"}):$.length===0?e(h,{style:n.storageKeyEmpty,children:"No settings saved yet"}):e(Se,{style:n.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:$.map(t=>e(y,{style:n.storageKeyItem,children:e(h,{style:n.storageKeyText,numberOfLines:1,children:t.replace("@react_buoy_","")})},t))})]}),e(y,{style:n.cardButtonWrap,children:e(Z,{label:q?"Cleared":G?"Clearing\u2026":"Clear All Settings",variant:q?"secondary":"destructive",size:"md",disabled:G,onPress:_e,icon:q?e(ve,{size:15,color:o.color.accent}):e(ct,{size:15,color:G?o.color.textTertiary:o.color.danger})})})]})]})),b&&b.state!=="idle"&&L("Desktop Sync",s(R,{glass:true,children:[s(j,{activeOpacity:.7,onPress:()=>fe("desktopSync"),accessibilityLabel:"Buoy Desktop",style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Buoy Desktop"})}),b.state==="connected"?e(v,{label:"Connected",tone:"accent"}):b.state==="connecting"?e(v,{label:"Connecting\u2026",tone:"neutral"}):e(v,{label:"Retrying",tone:"warning"}),_.has("desktopSync")?e(Te,{size:16,color:o.color.textTertiary}):e(we,{size:16,color:o.color.textTertiary})]}),_.has("desktopSync")&&s(y,{style:n.settingRowBody,children:[s(h,{style:n.settingRowBodyText,children:[b.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",e(h,{style:n.footnoteMono,children:b.targetURL??"(unknown URL)"}),b.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),b.state==="retrying"&&b.lastError&&s(h,{style:[n.settingRowBodyText,n.bodyWarning],children:["Last error: ",b.lastError]})]})]})),L("Modal Behavior",e(R,{glass:true,children:s(X,{children:[pe("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),It(Ze.OS==="web")?pe("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),B==="pro"&&s(P,{children:[L("License",s(R,{glass:true,children:[s(y,{style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"License Status"})}),e(y,{testID:"buoy-settings-license-status",accessibilityLabel:O?"License: Active":"License: Free",children:O?e(v,{label:"Active",tone:"accent"}):e(v,{label:"Free",tone:"neutral"})})]}),F?.tierSource==="session"?s(y,{style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Signed in with Buoy"})}),e(Z,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void lt(),testID:"buoy-settings-signout"})]}):null]}),e(xe,{children:O?"You have full access to all Buoy DevTools features.":U?Me?`Couldn't reach the license server (${U}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${U}.`:"Upgrade to Pro to unlock all features and support development."})),!O&&s(P,{children:[L("Pro Features",e(R,{glass:true,children:e(X,{children:["Advanced Settings","Priority Support"].map(t=>s(y,{style:n.featureRow,children:[e(ve,{size:16,color:o.color.accent}),e(h,{style:n.rowLabel,children:t})]},t))})})),e(Z,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>J(true)})]})]})]}),e(dt,{visible:Oe,onClose:()=>J(false),onSuccess:()=>J(false)})]});return e(xt,{visible:d,onClose:g,zIndex:p,variant:"night",header:{showToggleButton:false,customContent:e(y,{style:n.headerRow,children:e(yt,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:B,onChange:t=>ne(t)})})},initialMode:"bottomSheet",onModeChange:Je,persistenceKey:ee.settings.root(),enablePersistence:true,maxHeight:de-ce.top,initialHeight:Ae,initialFloatingPosition:{x:(ge-je)/2,y:ce.top+20},enableGlitchEffects:true,children:$e()})};const Bt={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}};const Et=(d,g)=>{const a=new Set(d??[]);const f=new Set(g??[]);const l={};for(const p of f){l[p]=true}const u={environment:a.has("environment")};for(const p of a){if(p!=="environment"){u[p]=true}}return{dialTools:V(l),floatingTools:u,globalSettings:{enableSharedModalDimensions:false}}};let M=null;let te=null;let Re=null;const Be=(d,g)=>JSON.stringify(d)===JSON.stringify(g);N.addListener(d=>{if(d)M=d});export const useDevToolsSettings=()=>{const{defaultFloatingTools:d,defaultDialTools:g}=Le();const a=A(()=>{if(!d&&!g){return Bt}return Et(d,g)},[d,g]);const[f,l]=S(a);const u=W(async()=>{try{const m=await D.getItem(H);if(m){const x=JSON.parse(m);const c=De(a,x);l(c);return}l(a)}catch(m){console.error("Failed to load dev tools settings:",m);l(a)}},[a]);I(()=>zt(m=>{if(m.includes(H))void u()}),[u]);I(()=>{u();const m=N.addListener(x=>{try{if(x){l(x)}}catch(c){}});return()=>{m()}},[u]);const p=W(()=>{u()},[u]);return{settings:f,refreshSettings:p}};const n=Xe.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:o.gutter,paddingRight:o.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:o.gutter,paddingTop:8,paddingBottom:24,gap:o.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:o.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:o.rowPadH,paddingVertical:o.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:o.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:o.color.text,fontSize:o.font.row,fontWeight:"500"},rowCaption:{color:o.color.textTertiary,fontSize:o.font.label},settingRowBody:{paddingHorizontal:o.rowPadH,paddingBottom:o.rowPadV,gap:6},settingRowBodyText:{color:o.color.textSecondary,fontSize:o.font.caption,lineHeight:o.font.caption*1.45},settingRowBodyHint:{color:o.color.textTertiary,fontSize:o.font.caption,lineHeight:o.font.caption*1.45},bodyWarning:{color:o.color.warning},bodyDanger:{color:o.color.danger},cardButtonWrap:{paddingHorizontal:o.cardPad,paddingTop:10,paddingBottom:o.cardPad},storageExpanded:{paddingHorizontal:o.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:o.color.textSecondary,fontSize:o.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:o.color.textTertiary,fontSize:o.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:o.color.glassElevated,borderRadius:o.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:o.color.textSecondary,fontSize:o.font.micro,fontFamily:Ie},storageKeyEmpty:{color:o.color.textTertiary,fontSize:o.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:Ie,fontSize:o.font.label,color:o.color.textSecondary}});
|
|
1
|
+
"use strict";import{useState as S,useEffect as I,useCallback as W,useMemo as A}from"react";import{View as y,Text as h,StyleSheet as Xe,ScrollView as Se,TouchableOpacity as j,Dimensions as be,Platform as Ze}from"react-native";import{settingsBus as N}from"./settingsBus.js";import{useDesktopSyncStatus as et}from"./useDesktopSyncStatus";import{SentryIcon as tt,WifiCircuitIcon as ot,ImageOverlayIcon as nt,RenderCountIcon as rt,Info as $,Layers as st,ChevronRightIcon as we,ChevronDown as Te,getStorageBackendType as it,getUseLicense as at,signOutOfBuoy as lt,persistentStorage as D,Trash2 as ct,CheckCircle2 as ve,BuoyUpgradeSheet as dt,BackgroundSwitcher as gt,night as o,NightCard as R,NightRows as Q,NightSectionLabel as ut,NightFootnote as xe,NightSwitch as ze,NightButton as X,NightSegmented as yt,NightBadge as v,NightSeparator as ht,monoFont as Ie}from"@buoy-gg/shared-ui";import{EnvIcon as Ce,StorageIcon as ft,RoutesIcon as pt,NetworkIcon as mt,QueryIcon as St,HighlighterIcon as bt,ReduxIcon as wt,EventsIcon as Tt}from"@buoy-gg/floating-tools-core";import{useDefaultConfig as Le}from"./DefaultConfigContext.js";import{renderAppIcon as vt}from"./AppIcon";import{JsModal as xt,devToolsStorageKeys as Z,onSettingsApplied as zt,expandableWindowControlsSupported as It}from"@buoy-gg/shared-ui";import{useSafeAreaInsets as Ct}from"@buoy-gg/shared-ui";import{jsx as e,jsxs as s,Fragment as P}from"react/jsx-runtime";const H="@react_buoy_dev_tools_settings";const Lt=6;const V=d=>{let g=Lt;const a={};for(const[f,l]of Object.entries(d)){if(l&&g>0){a[f]=true;g-=1}else{a[f]=false}}return a};const Dt=(d,g)=>{const{userStatus:a,environment:f,...l}=d;const u=g?Object.entries(l).filter(([p])=>g.includes(p)):Object.entries(l);return{...Object.fromEntries(u),environment:f??false}};const De=(d,g,a)=>{if(!g)return d;const f={...d.dialTools,...g.dialTools??{}};const l=a?.allowedDialKeys?Object.entries(f).filter(([p])=>a.allowedDialKeys?.includes(p)):Object.entries(f);const u=V(Object.fromEntries(l));return{dialTools:u,floatingTools:Dt({...d.floatingTools,...g.floatingTools??{}},a?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...g.globalSettings??{}}}};const Rt=(d=[],g,a)=>{const f={};const l={};const u=new Set(g??[]);const p=new Set(a??[]);const m=!a||a.length===0;for(const x of d){const{id:c,slot:C="both"}=x;if(C==="dial"||C==="both"){f[c]=m?true:p.has(c)}if(C==="row"||C==="both"){l[c]=u.has(c)}}return{dialTools:V(f),floatingTools:{...l,environment:u.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}};export const DevToolsSettingsModal=({visible:d,onClose:g,onSettingsChange:a,initialSettings:f,availableApps:l=[],storage:u=D,zIndex:p})=>{const{defaultFloatingTools:m,defaultDialTools:x}=Le();const c=A(()=>Rt(l,m,x),[l,m,x]);const C=A(()=>Object.keys(c.dialTools),[c]);const te=A(()=>Object.keys(c.floatingTools).filter(t=>t!=="environment"),[c]);const[z,E]=S(f||M||c);const[B,oe]=S(ee??"floating");const[ne,Ee]=S(ee!==null);const[_,Fe]=S(new Set);const[Oe,re]=S(false);const[ke,Pe]=S(false);I(()=>{const t=requestAnimationFrame(()=>Pe(true));return()=>cancelAnimationFrame(t)},[]);const b=et();I(()=>{const t=async()=>{try{const r=await D.getItem(Z.settings.activeTab());if(r&&["floating","settings","pro"].includes(r)){const i=r;ee=i;oe(T=>T===i?T:i)}}catch(r){}finally{Ee(true)}};t()},[]);I(()=>{if(!ne)return;D.setItem(Z.settings.activeTab(),B).catch(t=>{console.warn("Failed to save settings active tab:",t)})},[B,ne]);const He=at();const F=He?.();const O=F?.isPro??false;const J=!O&&F?.licenseKey?F.error:null;const Me=F?.errorKind==="transport";const[w,Ke]=S(Re);const[U,se]=S(false);const[G,q]=S(false);const[k,We]=S(false);const[Y,ie]=S([]);const[ae,le]=S(false);const ce=Ct();const de=be.get("window").height;const ge=be.get("window").width;const Ae=Math.floor(de*.33);const je=Math.min(ge-32,400);const ue=W(async()=>{try{const t=await u.getItem(H);if(t){const r=JSON.parse(t);const i=De(c,r,{allowedDialKeys:C,allowedFloatingKeys:te});M=i;E(T=>Be(T,i)?T:i);return}M=c;E(r=>Be(r,c)?r:c)}catch(t){console.error("Failed to load dev tools settings:",t);E(c)}},[c,C,te,u]);I(()=>{ue()},[ue]);I(()=>{it().then(t=>{Re=t;Ke(r=>r===t?r:t)})},[]);I(()=>{if(k){le(true);D.getAllKeys().then(t=>{ie(t.sort())}).catch(()=>{ie([])}).finally(()=>{le(false)})}},[k]);const ye=async t=>{try{const r={...t,dialTools:V(t.dialTools)};await u.setItem(H,JSON.stringify(r));M=r;E(r);a?.(r);N.emit(r)}catch(r){console.error("Failed to save dev tools settings:",r)}};const Ne=t=>{const r={...z,floatingTools:{...z.floatingTools,[t]:!z.floatingTools[t]}};ye(r)};const Ve=t=>{const r={...z,globalSettings:{...z.globalSettings,[t]:!z.globalSettings?.[t]}};ye(r)};const _e=async()=>{se(true);q(false);try{await D.clear();q(true);E(c);if(u!==D)await u.setItem(H,JSON.stringify(c));a?.(c);N.emit(c);setTimeout(()=>q(false),2e3)}catch(t){console.error("Failed to clear storage:",t)}finally{se(false)}};const Je=W(t=>{},[]);const Ue=t=>{const r=l.find(i=>i.id===t);if(r?.description){return r.description}if(t==="environment"){return"Environment badge."}return""};const he=t=>{if(t==="environment"){return"Env Badge"}const r=l.find(i=>i.id===t);return r?.name??t.toUpperCase().replace(/_/g," ")};const Ge=t=>{if(!ke)return null;switch(t){case"query":return e(St,{size:18});case"env":return e(Ce,{size:18});case"sentry":return e(tt,{size:18,color:"#9945FF"});case"storage":return e(ft,{size:18,bgColor:o.color.surface});case"wifi":case"query-wifi-toggle":return e(ot,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return e(pt,{size:18,bgColor:o.color.surface});case"network":return e(mt,{size:18});case"environment":return e(Ce,{size:18});case"debug-borders":return e(st,{size:18,color:o.color.accent});case"highlight-updates":return e(rt,{size:18,color:o.color.accent});case"highlight-updates-modal":return e(bt,{size:18});case"redux":return e(wt,{size:18});case"image-overlay":return e(nt,{size:18});case"events":return e(Tt,{size:18});case"zustand":try{const{ZustandIcon:r}=require("@buoy-gg/zustand");return e(r,{size:18})}catch{return e($,{size:18,color:o.color.textSecondary})}case"jotai":try{const{JotaiIcon:r}=require("@buoy-gg/jotai");return e(r,{size:18})}catch{return e($,{size:18,color:o.color.textSecondary})}default:{const r=l.find(i=>i.id===t);if(r?.icon!=null){return vt(r.icon,{slot:"row",size:18,color:r.color})}return e($,{size:18,color:o.color.textSecondary})}}};const qe=(t,r,i,T)=>{const K=Ue(t);return s(j,{activeOpacity:i?1:.7,onPress:()=>!i&&T(),accessibilityLabel:he(t),accessibilityRole:"button",style:[n.toolRow,i&&n.rowDisabled],children:[e(y,{style:n.toolIconSlot,children:Ge(t)}),s(y,{style:n.rowInfo,children:[s(h,{style:n.rowLabel,children:[he(t),i?" \xB7 max 6":""]}),K?e(h,{style:n.rowCaption,numberOfLines:1,children:K}):null]}),e(ze,{value:r,disabled:i,onValueChange:()=>T()})]},t)};const fe=t=>{Fe(r=>{const i=new Set(r);if(i.has(t)){i.delete(t)}else{i.add(t)}return i})};const pe=(t,r,i,T,K)=>{const Qe=z.globalSettings?.[t]??false;const me=_.has(t);return s(y,{children:[s(j,{activeOpacity:.7,onPress:()=>fe(t),accessibilityLabel:r,style:n.settingRow,children:[s(y,{style:n.rowInfo,children:[e(h,{style:n.rowLabel,children:r}),e(h,{style:n.rowCaption,numberOfLines:me?0:1,children:i})]}),e(ze,{value:Qe,onValueChange:()=>Ve(t)})]}),me&&s(y,{style:n.settingRowBody,children:[e(h,{style:n.settingRowBodyText,children:T}),e(h,{style:n.settingRowBodyHint,children:K})]})]},t)};const L=(t,r,i)=>s(y,{children:[e(ut,{children:t}),r,i]});const Ye=w==="filesystem"?e(v,{label:"File System",tone:"accent"}):w==="asyncstorage"?e(v,{label:"Async Storage",tone:"warning"}):w==="localstorage"?e(v,{label:"Local Storage",tone:"accent"}):w==="memory"?e(v,{label:"Memory",tone:"danger"}):e(v,{label:"Loading\u2026",tone:"neutral"});const $e=()=>s(y,{style:n.container,children:[s(Se,{style:n.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:n.scrollContainer,children:[B==="floating"&&e(P,{children:L("Floating Tools",e(R,{glass:true,children:e(Q,{children:Object.entries(z.floatingTools).map(([t,r])=>qe(t,r,false,()=>Ne(t)))})}),e(xe,{children:"Tools switched on here appear in the floating bubble row."}))}),B==="settings"&&s(P,{children:[L("Background",e(R,{glass:true,padded:true,children:e(gt,{embedded:true})})),L("Storage",s(R,{glass:true,children:[s(j,{activeOpacity:.7,onPress:()=>We(!k),accessibilityLabel:"Storage Type",style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Storage Type"})}),Ye,k?e(Te,{size:16,color:o.color.textTertiary}):e(we,{size:16,color:o.color.textTertiary})]}),k&&s(P,{children:[s(y,{style:n.settingRowBody,children:[e(h,{style:n.settingRowBodyText,children:w==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":w==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":w==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":w==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),w==="asyncstorage"&&e(h,{style:[n.settingRowBodyText,n.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),w==="memory"&&e(h,{style:[n.settingRowBodyText,n.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),e(ht,{}),s(y,{style:n.storageExpanded,children:[s(y,{style:n.storageExpandedHeader,children:[e(h,{style:n.storageExpandedTitle,children:"SAVED SETTINGS"}),e(h,{style:n.storageExpandedCount,children:ae?"\u2026":`${Y.length} keys`})]}),ae?e(h,{style:n.storageKeyEmpty,children:"Loading\u2026"}):Y.length===0?e(h,{style:n.storageKeyEmpty,children:"No settings saved yet"}):e(Se,{style:n.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:Y.map(t=>e(y,{style:n.storageKeyItem,children:e(h,{style:n.storageKeyText,numberOfLines:1,children:t.replace("@react_buoy_","")})},t))})]}),e(y,{style:n.cardButtonWrap,children:e(X,{label:G?"Cleared":U?"Clearing\u2026":"Clear All Settings",variant:G?"secondary":"destructive",size:"md",disabled:U,onPress:_e,icon:G?e(ve,{size:15,color:o.color.accent}):e(ct,{size:15,color:U?o.color.textTertiary:o.color.danger})})})]})]})),b&&b.state!=="idle"&&L("Desktop Sync",s(R,{glass:true,children:[s(j,{activeOpacity:.7,onPress:()=>fe("desktopSync"),accessibilityLabel:"Buoy Desktop",style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Buoy Desktop"})}),b.state==="connected"?e(v,{label:"Connected",tone:"accent"}):b.state==="connecting"?e(v,{label:"Connecting\u2026",tone:"neutral"}):e(v,{label:"Retrying",tone:"warning"}),_.has("desktopSync")?e(Te,{size:16,color:o.color.textTertiary}):e(we,{size:16,color:o.color.textTertiary})]}),_.has("desktopSync")&&s(y,{style:n.settingRowBody,children:[s(h,{style:n.settingRowBodyText,children:[b.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",e(h,{style:n.footnoteMono,children:b.targetURL??"(unknown URL)"}),b.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),b.state==="retrying"&&b.lastError&&s(h,{style:[n.settingRowBodyText,n.bodyWarning],children:["Last error: ",b.lastError]})]})]})),L("Modal Behavior",e(R,{glass:true,children:s(Q,{children:[pe("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),It(Ze.OS==="web")?pe("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),B==="pro"&&s(P,{children:[L("License",s(R,{glass:true,children:[s(y,{style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"License Status"})}),e(y,{testID:"buoy-settings-license-status",accessibilityLabel:O?"License: Active":"License: Free",children:O?e(v,{label:"Active",tone:"accent"}):e(v,{label:"Free",tone:"neutral"})})]}),F?.tierSource==="session"?s(y,{style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Signed in with Buoy"})}),e(X,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void lt(),testID:"buoy-settings-signout"})]}):null]}),e(xe,{children:O?"You have full access to all Buoy DevTools features.":J?Me?`Couldn't reach the license server (${J}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${J}.`:"Upgrade to Pro to unlock all features and support development."})),!O&&s(P,{children:[L("Pro Features",e(R,{glass:true,children:e(Q,{children:["Advanced Settings","Priority Support"].map(t=>s(y,{style:n.featureRow,children:[e(ve,{size:16,color:o.color.accent}),e(h,{style:n.rowLabel,children:t})]},t))})})),e(X,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>re(true)})]})]})]}),e(dt,{visible:Oe,onClose:()=>re(false)})]});return e(xt,{visible:d,onClose:g,zIndex:p,variant:"night",header:{showToggleButton:false,customContent:e(y,{style:n.headerRow,children:e(yt,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:B,onChange:t=>oe(t)})})},initialMode:"bottomSheet",onModeChange:Je,persistenceKey:Z.settings.root(),enablePersistence:true,maxHeight:de-ce.top,initialHeight:Ae,initialFloatingPosition:{x:(ge-je)/2,y:ce.top+20},enableGlitchEffects:true,children:$e()})};const Bt={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}};const Et=(d,g)=>{const a=new Set(d??[]);const f=new Set(g??[]);const l={};for(const p of f){l[p]=true}const u={environment:a.has("environment")};for(const p of a){if(p!=="environment"){u[p]=true}}return{dialTools:V(l),floatingTools:u,globalSettings:{enableSharedModalDimensions:false}}};let M=null;let ee=null;let Re=null;const Be=(d,g)=>JSON.stringify(d)===JSON.stringify(g);N.addListener(d=>{if(d)M=d});export const useDevToolsSettings=()=>{const{defaultFloatingTools:d,defaultDialTools:g}=Le();const a=A(()=>{if(!d&&!g){return Bt}return Et(d,g)},[d,g]);const[f,l]=S(a);const u=W(async()=>{try{const m=await D.getItem(H);if(m){const x=JSON.parse(m);const c=De(a,x);l(c);return}l(a)}catch(m){console.error("Failed to load dev tools settings:",m);l(a)}},[a]);I(()=>zt(m=>{if(m.includes(H))void u()}),[u]);I(()=>{u();const m=N.addListener(x=>{try{if(x){l(x)}}catch(c){}});return()=>{m()}},[u]);const p=W(()=>{u()},[u]);return{settings:f,refreshSettings:p}};const n=Xe.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:o.gutter,paddingRight:o.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:o.gutter,paddingTop:8,paddingBottom:24,gap:o.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:o.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:o.rowPadH,paddingVertical:o.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:o.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:o.color.text,fontSize:o.font.row,fontWeight:"500"},rowCaption:{color:o.color.textTertiary,fontSize:o.font.label},settingRowBody:{paddingHorizontal:o.rowPadH,paddingBottom:o.rowPadV,gap:6},settingRowBodyText:{color:o.color.textSecondary,fontSize:o.font.caption,lineHeight:o.font.caption*1.45},settingRowBodyHint:{color:o.color.textTertiary,fontSize:o.font.caption,lineHeight:o.font.caption*1.45},bodyWarning:{color:o.color.warning},bodyDanger:{color:o.color.danger},cardButtonWrap:{paddingHorizontal:o.cardPad,paddingTop:10,paddingBottom:o.cardPad},storageExpanded:{paddingHorizontal:o.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:o.color.textSecondary,fontSize:o.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:o.color.textTertiary,fontSize:o.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:o.color.glassElevated,borderRadius:o.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:o.color.textSecondary,fontSize:o.font.micro,fontFamily:Ie},storageKeyEmpty:{color:o.color.textTertiary,fontSize:o.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:Ie,fontSize:o.font.label,color:o.color.textSecondary}});
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const SDK_VERSION="7.0.
|
|
1
|
+
"use strict";export const SDK_VERSION="7.0.60";
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Sign in to Buoy" on a phone (BUOY_SIGN_IN_PLAN.md Phase 5).
|
|
3
|
+
*
|
|
4
|
+
* Shown by FloatingDevTools when the app passes `signIn` and Buoy isn't open.
|
|
5
|
+
* The card shows a QR code for buoy.gg/activate and the same short code as
|
|
6
|
+
* text, for when the camera can't scan. Someone signed in to buoy.gg allows
|
|
7
|
+
* it there, and Buoy opens here. The app's own checks decide who sees this,
|
|
8
|
+
* the same as they decide who sees Buoy at all. The cards live in shared-ui,
|
|
9
|
+
* where every "Upgrade to Pro" button uses them too.
|
|
10
|
+
*/
|
|
1
11
|
export declare function BuoySignIn({ needsPlan }: {
|
|
2
12
|
needsPlan?: boolean;
|
|
3
13
|
}): import("react").JSX.Element;
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* Drift is prevented by a test that fails when this disagrees with
|
|
10
10
|
* package.json, so a version bump that forgets this file cannot ship.
|
|
11
11
|
*/
|
|
12
|
-
export declare const SDK_VERSION = "7.0.
|
|
12
|
+
export declare const SDK_VERSION = "7.0.60";
|
|
13
13
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Sign in to Buoy" on a phone (BUOY_SIGN_IN_PLAN.md Phase 5).
|
|
3
|
+
*
|
|
4
|
+
* Shown by FloatingDevTools when the app passes `signIn` and Buoy isn't open.
|
|
5
|
+
* The card shows a QR code for buoy.gg/activate and the same short code as
|
|
6
|
+
* text, for when the camera can't scan. Someone signed in to buoy.gg allows
|
|
7
|
+
* it there, and Buoy opens here. The app's own checks decide who sees this,
|
|
8
|
+
* the same as they decide who sees Buoy at all. The cards live in shared-ui,
|
|
9
|
+
* where every "Upgrade to Pro" button uses them too.
|
|
10
|
+
*/
|
|
1
11
|
export declare function BuoySignIn({ needsPlan }: {
|
|
2
12
|
needsPlan?: boolean;
|
|
3
13
|
}): import("react").JSX.Element;
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* Drift is prevented by a test that fails when this disagrees with
|
|
10
10
|
* package.json, so a version bump that forgets this file cannot ship.
|
|
11
11
|
*/
|
|
12
|
-
export declare const SDK_VERSION = "7.0.
|
|
12
|
+
export declare const SDK_VERSION = "7.0.60";
|
|
13
13
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{b as L,c as P}from"./chunk-CLXYMJTS.mjs";import{toolTheme as I}from"@buoy-gg/shared-ui/web";var v={};L(v,{AccessibilityInfo:()=>F,ActivityIndicator:()=>B,Alert:()=>
|
|
1
|
+
"use client";import{b as L,c as P}from"./chunk-CLXYMJTS.mjs";import{toolTheme as I}from"@buoy-gg/shared-ui/web";var v={};L(v,{AccessibilityInfo:()=>F,ActivityIndicator:()=>B,Alert:()=>Ma,Animated:()=>w,AppRegistry:()=>N,AppState:()=>O,Appearance:()=>z,BackHandler:()=>U,Button:()=>Aa,CheckBox:()=>ea,Clipboard:()=>W,DeviceEventEmitter:()=>ba,Dimensions:()=>S,Easing:()=>K,FlatList:()=>sa,I18nManager:()=>j,Image:()=>ta,ImageBackground:()=>oa,InteractionManager:()=>G,Keyboard:()=>$,KeyboardAvoidingView:()=>ra,LayoutAnimation:()=>q,Linking:()=>J,LogBox:()=>ga,Modal:()=>A,NativeEventEmitter:()=>X,NativeModules:()=>H,PanResponder:()=>Y,Picker:()=>ia,PixelRatio:()=>_,Platform:()=>C,Pressable:()=>E,ProgressBar:()=>na,RefreshControl:()=>la,SafeAreaView:()=>ca,ScrollView:()=>k,SectionList:()=>da,Share:()=>Z,StatusBar:()=>ua,StyleSheet:()=>x,Switch:()=>ka,Text:()=>b,TextInput:()=>Ca,Touchable:()=>ma,TouchableHighlight:()=>Ta,TouchableNativeFeedback:()=>pa,TouchableOpacity:()=>T,TouchableWithoutFeedback:()=>Ea,UIManager:()=>Q,Vibration:()=>aa,View:()=>f,VirtualizedList:()=>fa,YellowBox:()=>ha,findNodeHandle:()=>Ba,unstable_createElement:()=>R,useColorScheme:()=>xa,useLocaleContext:()=>ya,useWindowDimensions:()=>va});P(v,D);import*as D from"react-native-web";import{unstable_createElement as R,NativeModules as H,AccessibilityInfo as F,Animated as w,Appearance as z,AppRegistry as N,AppState as O,BackHandler as U,Clipboard as W,Dimensions as S,Easing as K,I18nManager as j,Keyboard as $,InteractionManager as G,LayoutAnimation as q,Linking as J,NativeEventEmitter as X,PanResponder as Y,PixelRatio as _,Platform as C,Share as Z,StyleSheet as x,UIManager as Q,Vibration as aa,CheckBox as ea,FlatList as sa,Image as ta,ImageBackground as oa,KeyboardAvoidingView as ra,Picker as ia,ProgressBar as na,RefreshControl as la,SafeAreaView as ca,SectionList as da,StatusBar as ua,Touchable as ma,TouchableNativeFeedback as pa,VirtualizedList as fa,YellowBox as ha,LogBox as ga,DeviceEventEmitter as ba,useColorScheme as xa,useLocaleContext as ya,useWindowDimensions as va}from"react-native-web";import*as i from"react-native-web";import{createElement as wa,forwardRef as Sa}from"react";function l(e){let t=Sa((r,s)=>{let{accessibilityState:c,accessibilityValue:m,...u}=r;for(let d of["busy","checked","disabled","expanded","selected"])c?.[d]!==void 0&&u[`aria-${d}`]===void 0&&(u[`aria-${d}`]=c[d]);for(let[d,n]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))m?.[d]!==void 0&&u[`aria-${n}`]===void 0&&(u[`aria-${n}`]=m[d]);return wa(e,{...u,ref:s})}),o=e.State;return o&&Object.assign(t,{State:o}),t.displayName=e.displayName??e.name??"NativeWebView",t}var f=l(i.View),b=l(i.Text),Ca=l(i.TextInput),T=l(i.TouchableOpacity),Ta=l(i.TouchableHighlight),Ea=l(i.TouchableWithoutFeedback),E=l(i.Pressable),k=l(i.ScrollView),A=l(i.Modal),ka=l(i.Switch),B=l(i.ActivityIndicator),Aa=l(i.Button),Ba=i.findNodeHandle,Ma={alert(e,t,o,r){if(typeof document>"u")return;let s=document.createElement("dialog");s.dataset.buoyRoot="",s.setAttribute("aria-label",e),s.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 c=document.createElement("h2");if(c.textContent=e,c.style.cssText="font-size:18px;margin:0 0 12px",s.appendChild(c),t){let n=document.createElement("p");n.textContent=t,n.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",s.appendChild(n)}let m=document.createElement("div");m.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let u=o?.length?o:[{text:"OK"}],d=()=>{s.close?.(),s.remove()};for(let n of u){let g=document.createElement("button");g.type="button",g.textContent=n.text??"OK",g.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${n.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,g.onclick=()=>{d(),n.onPress?.()},m.appendChild(g)}s.addEventListener("cancel",n=>{n.preventDefault(),r?.cancelable!==false&&(d(),r?.onDismiss?.())}),s.appendChild(m),document.body.appendChild(s),s.showModal?s.showModal():s.setAttribute("open","")}};import{CopyButton as Va,toolTheme as a}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as La,SplitDiffViewer as Pa}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as p,jsxs as M}from"react/jsx-runtime";var Ia={success:a.colors.success,active:a.colors.success,connected:a.colors.success,error:a.colors.error,failed:a.colors.error,warning:a.colors.warning,stale:a.colors.warning,pending:a.colors.info,loading:a.colors.info,fetching:a.colors.info,info:a.colors.info,inactive:a.colors.textMuted,idle:a.colors.textMuted};function V(e){return Ia[e.toLowerCase()]??a.colors.textMuted}var Da={GET:a.colors.info,POST:a.colors.success,PUT:a.colors.warning,PATCH:a.colors.warning,DELETE:a.colors.error};function Ra(e){return Da[e.toUpperCase()]??a.colors.textSecondary}var Ha={string:a.colors.success,number:a.colors.info,boolean:a.colors.warning,object:a.colors.accent,array:a.colors.accent,function:a.colors.error,null:a.colors.textMuted,undefined:a.colors.textMuted};function Fa(e){return Ha[e.toLowerCase()]??a.colors.textSecondary}function za({children:e,color:t=a.colors.textSecondary,icon:o,size:r="small",pill:s=false,mono:c=false,style:m}){let u=typeof e=="string"||typeof e=="number";return M(f,{style:[h.base,r==="medium"&&h.medium,s&&h.pill,{backgroundColor:t+"1A",borderColor:t+"40"},m],children:[o,u?p(b,{style:[h.text,r==="medium"&&h.textMedium,c&&h.textMono,{color:t}],numberOfLines:1,children:e}):e]})}var h=x.create({base:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",gap:4,borderWidth:1,borderRadius:a.radius.sm,paddingHorizontal:6,paddingVertical:2},medium:{paddingHorizontal:8,paddingVertical:3},pill:{borderRadius:a.radius.pill,minWidth:20,justifyContent:"center"},text:{fontSize:10,fontWeight:"600",letterSpacing:.3},textMedium:{fontSize:12},textMono:{fontFamily:a.text.mono.fontFamily}});function Na({status:e,color:t,size:o=8,style:r}){let s=t??(e?V(e):a.colors.textMuted);return p(f,{style:[{width:o,height:o,borderRadius:o/2,backgroundColor:s},r]})}function Oa({label:e,value:t,copyable:o=false,style:r}){let s=typeof t=="string"||typeof t=="number";return M(f,{style:[y.row,r],children:[p(b,{style:y.label,numberOfLines:1,children:e}),p(f,{style:y.value,children:s?p(b,{style:y.valueText,numberOfLines:2,children:String(t)}):t}),o&&t!=null&&p(Va,{value:t,size:12})]})}var y=x.create({row:{flexDirection:"row",alignItems:"center",gap:a.spacing.sm,paddingVertical:3},label:{...a.text.label,color:a.colors.textMuted,minWidth:72},value:{flex:1,flexDirection:"row",alignItems:"center"},valueText:{...a.text.mono,color:a.colors.text}});function Ua({oldValue:e,newValue:t,mode:o="tree",showUnchanged:r=true,scrollEnabled:s=false,height:c=220}){return o==="text"?p(Pa,{oldValue:e,newValue:t,height:c}):p(La,{oldValue:e,newValue:t,showUnchanged:r,scrollEnabled:s})}import{ToolButton as Wa,CopyButton as Ka,PowerToggleButton as ja}from"@buoy-gg/shared-ui/web";import{CompactRow as $a,DevToolsCard as Ga}from"@buoy-gg/shared-ui/web";import{SectionHeader as qa,CollapsibleSection as Ja,TabSelector as Xa,EmptyState as Ya,SearchBar as _a,EventStepperFooter as Za}from"@buoy-gg/shared-ui/web";import{DataViewer as Qa}from"@buoy-gg/shared-ui/web/dataViewer";import{BaseEventStore as ae}from"@buoy-gg/shared-ui/web";import{RelativeTime as ee}from"@buoy-gg/shared-ui/web";import{formatBytes as se,formatDuration as te,formatNumber as oe,truncateMiddle as re,safeStringify as ie}from"@buoy-gg/shared-ui/web";import{usePersistedState as ne,persistentStorage as le,devToolsStorageKeys as ce}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as de,copyToClipboard as ue}from"@buoy-gg/shared-ui/web";import{JsModal as me}from"@buoy-gg/shared-ui/web";import{Activity as pe,AlertTriangle as fe,Bug as he,Check as ge,CheckCircle as be,ChevronDown as xe,ChevronLeft as ye,ChevronRight as ve,ChevronUp as we,Clock as Se,Copy as Ce,Database as Te,Eye as Ee,EyeOff as ke,FileJson as Ae,FileText as Be,Filter as Me,FlaskConical as Ve,Globe as Le,Hash as Pe,Info as Ie,Key as De,Layers as Re,Lock as He,Pause as Fe,Play as ze,Plus as Ne,Power as Oe,RefreshCw as Ue,Search as We,Settings as Ke,Shield as je,Trash2 as $e,User as Ge,Wifi as qe,X as Je,Zap as Xe,AlertCircle as Ye,BarChart3 as _e,Bookmark as Ze,Cloud as Qe,Download as as,Edit3 as es,GitBranch as ss,HardDrive as ts,HelpCircle as os,Home as rs,Image as is,Link as ns,Maximize2 as ls,Minus as cs,Palette as ds,Pin as us,Route as ms,Server as ps,Smartphone as fs,Square as hs,CheckSquare as gs,Timer as bs,Unlock as xs,Upload as ys,Users as vs,XCircle as ws}from"@buoy-gg/shared-ui/web";export{f as a,b,T as c,E as d,k as e,A as f,B as g,v as h,w as i,S as j,C as k,x as l,V as m,Ra as n,Fa as o,za as p,Na as q,Oa as r,Ua as s,I as t,Wa as u,Ka as v,ja as w,$a as x,Ga as y,qa as z,Ja as A,Xa as B,Ya as C,_a as D,Za as E,Qa as F,ae as G,ee as H,se as I,te as J,oe as K,re as L,ie as M,ne as N,le as O,ce as P,de as Q,ue as R,me as S,pe as T,fe as U,he as V,ge as W,be as X,xe as Y,ye as Z,ve as _,we as $,Se as aa,Ce as ba,Te as ca,Ee as da,ke as ea,Ae as fa,Be as ga,Me as ha,Ve as ia,Le as ja,Pe as ka,Ie as la,De as ma,Re as na,He as oa,Fe as pa,ze as qa,Ne as ra,Oe as sa,Ue as ta,We as ua,Ke as va,je as wa,$e as xa,Ge as ya,qe as za,Je as Aa,Xe as Ba,Ye as Ca,_e as Da,Ze as Ea,Qe as Fa,as as Ga,es as Ha,ss as Ia,ts as Ja,os as Ka,rs as La,is as Ma,ns as Na,ls as Oa,cs as Pa,ds as Qa,us as Ra,ms as Sa,ps as Ta,fs as Ua,hs as Va,gs as Wa,bs as Xa,xs as Ya,ys as Za,vs as _a,ws as $a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{b as V,c as L}from"./chunk-CLXYMJTS.mjs";import{toolTheme as P}from"@buoy-gg/shared-ui/web";var v={};V(v,{AccessibilityInfo:()=>H,ActivityIndicator:()=>ke,Alert:()=>Me,Animated:()=>w,AppRegistry:()=>z,AppState:()=>N,Appearance:()=>F,BackHandler:()=>O,Button:()=>Ae,CheckBox:()=>ee,Clipboard:()=>U,DeviceEventEmitter:()=>ge,Dimensions:()=>S,Easing:()=>W,FlatList:()=>ae,I18nManager:()=>K,Image:()=>se,ImageBackground:()=>te,InteractionManager:()=>$,Keyboard:()=>j,KeyboardAvoidingView:()=>oe,LayoutAnimation:()=>G,Linking:()=>q,LogBox:()=>he,Modal:()=>A,NativeEventEmitter:()=>J,NativeModules:()=>R,PanResponder:()=>_,Picker:()=>re,PixelRatio:()=>X,Platform:()=>C,Pressable:()=>E,ProgressBar:()=>ie,RefreshControl:()=>ne,SafeAreaView:()=>le,ScrollView:()=>k,SectionList:()=>ce,Share:()=>Y,StatusBar:()=>de,StyleSheet:()=>b,Switch:()=>Ee,Text:()=>x,TextInput:()=>Se,Touchable:()=>ue,TouchableHighlight:()=>Ce,TouchableNativeFeedback:()=>me,TouchableOpacity:()=>T,TouchableWithoutFeedback:()=>Te,UIManager:()=>Z,Vibration:()=>Q,View:()=>f,VirtualizedList:()=>pe,YellowBox:()=>fe,findNodeHandle:()=>Be,unstable_createElement:()=>D,useColorScheme:()=>xe,useLocaleContext:()=>be,useWindowDimensions:()=>ye});L(v,I);import*as I from"react-native-web";import{unstable_createElement as D,NativeModules as R,AccessibilityInfo as H,Animated as w,Appearance as F,AppRegistry as z,AppState as N,BackHandler as O,Clipboard as U,Dimensions as S,Easing as W,I18nManager as K,Keyboard as j,InteractionManager as $,LayoutAnimation as G,Linking as q,NativeEventEmitter as J,PanResponder as _,PixelRatio as X,Platform as C,Share as Y,StyleSheet as b,UIManager as Z,Vibration as Q,CheckBox as ee,FlatList as ae,Image as se,ImageBackground as te,KeyboardAvoidingView as oe,Picker as re,ProgressBar as ie,RefreshControl as ne,SafeAreaView as le,SectionList as ce,StatusBar as de,Touchable as ue,TouchableNativeFeedback as me,VirtualizedList as pe,YellowBox as fe,LogBox as he,DeviceEventEmitter as ge,useColorScheme as xe,useLocaleContext as be,useWindowDimensions as ye}from"react-native-web";import*as i from"react-native-web";import{createElement as ve,forwardRef as we}from"react";function l(a){let t=we((r,s)=>{let{accessibilityState:c,accessibilityValue:m,...u}=r;for(let d of["busy","checked","disabled","expanded","selected"])c?.[d]!==void 0&&u[`aria-${d}`]===void 0&&(u[`aria-${d}`]=c[d]);for(let[d,n]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))m?.[d]!==void 0&&u[`aria-${n}`]===void 0&&(u[`aria-${n}`]=m[d]);return ve(a,{...u,ref:s})}),o=a.State;return o&&Object.assign(t,{State:o}),t.displayName=a.displayName??a.name??"NativeWebView",t}var f=l(i.View),x=l(i.Text),Se=l(i.TextInput),T=l(i.TouchableOpacity),Ce=l(i.TouchableHighlight),Te=l(i.TouchableWithoutFeedback),E=l(i.Pressable),k=l(i.ScrollView),A=l(i.Modal),Ee=l(i.Switch),ke=l(i.ActivityIndicator),Ae=l(i.Button),Be=i.findNodeHandle,Me={alert(a,t,o,r){if(typeof document>"u")return;let s=document.createElement("dialog");s.dataset.buoyRoot="",s.setAttribute("aria-label",a),s.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 c=document.createElement("h2");if(c.textContent=a,c.style.cssText="font-size:18px;margin:0 0 12px",s.appendChild(c),t){let n=document.createElement("p");n.textContent=t,n.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",s.appendChild(n)}let m=document.createElement("div");m.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let u=o?.length?o:[{text:"OK"}],d=()=>{s.close?.(),s.remove()};for(let n of u){let g=document.createElement("button");g.type="button",g.textContent=n.text??"OK",g.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${n.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,g.onclick=()=>{d(),n.onPress?.()},m.appendChild(g)}s.addEventListener("cancel",n=>{n.preventDefault(),r?.cancelable!==false&&(d(),r?.onDismiss?.())}),s.appendChild(m),document.body.appendChild(s),s.showModal?s.showModal():s.setAttribute("open","")}};import{CopyButton as Ve,toolTheme as e}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as Le,SplitDiffViewer as Pe}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as p,jsxs as B}from"react/jsx-runtime";var Ie={success:e.colors.success,active:e.colors.success,connected:e.colors.success,error:e.colors.error,failed:e.colors.error,warning:e.colors.warning,stale:e.colors.warning,pending:e.colors.info,loading:e.colors.info,fetching:e.colors.info,info:e.colors.info,inactive:e.colors.textMuted,idle:e.colors.textMuted};function M(a){return Ie[a.toLowerCase()]??e.colors.textMuted}var De={GET:e.colors.info,POST:e.colors.success,PUT:e.colors.warning,PATCH:e.colors.warning,DELETE:e.colors.error};function Re(a){return De[a.toUpperCase()]??e.colors.textSecondary}var He={string:e.colors.success,number:e.colors.info,boolean:e.colors.warning,object:e.colors.accent,array:e.colors.accent,function:e.colors.error,null:e.colors.textMuted,undefined:e.colors.textMuted};function Fe(a){return He[a.toLowerCase()]??e.colors.textSecondary}function ze({children:a,color:t=e.colors.textSecondary,icon:o,size:r="small",pill:s=false,mono:c=false,style:m}){let u=typeof a=="string"||typeof a=="number";return B(f,{style:[h.base,r==="medium"&&h.medium,s&&h.pill,{backgroundColor:t+"1A",borderColor:t+"40"},m],children:[o,u?p(x,{style:[h.text,r==="medium"&&h.textMedium,c&&h.textMono,{color:t}],numberOfLines:1,children:a}):a]})}var h=b.create({base:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",gap:4,borderWidth:1,borderRadius:e.radius.sm,paddingHorizontal:6,paddingVertical:2},medium:{paddingHorizontal:8,paddingVertical:3},pill:{borderRadius:e.radius.pill,minWidth:20,justifyContent:"center"},text:{fontSize:10,fontWeight:"600",letterSpacing:.3},textMedium:{fontSize:12},textMono:{fontFamily:e.text.mono.fontFamily}});function Ne({status:a,color:t,size:o=8,style:r}){let s=t??(a?M(a):e.colors.textMuted);return p(f,{style:[{width:o,height:o,borderRadius:o/2,backgroundColor:s},r]})}function Oe({label:a,value:t,copyable:o=false,style:r}){let s=typeof t=="string"||typeof t=="number";return B(f,{style:[y.row,r],children:[p(x,{style:y.label,numberOfLines:1,children:a}),p(f,{style:y.value,children:s?p(x,{style:y.valueText,numberOfLines:2,children:String(t)}):t}),o&&t!=null&&p(Ve,{value:t,size:12})]})}var y=b.create({row:{flexDirection:"row",alignItems:"center",gap:e.spacing.sm,paddingVertical:3},label:{...e.text.label,color:e.colors.textMuted,minWidth:72},value:{flex:1,flexDirection:"row",alignItems:"center"},valueText:{...e.text.mono,color:e.colors.text}});function Ue({oldValue:a,newValue:t,mode:o="tree",showUnchanged:r=true,scrollEnabled:s=false,height:c=220}){return o==="text"?p(Pe,{oldValue:a,newValue:t,height:c}):p(Le,{oldValue:a,newValue:t,showUnchanged:r,scrollEnabled:s})}import{ToolButton as We,CopyButton as Ke,PowerToggleButton as je}from"@buoy-gg/shared-ui/web";import{CompactRow as $e,DevToolsCard as Ge}from"@buoy-gg/shared-ui/web";import{SectionHeader as qe,CollapsibleSection as Je,TabSelector as _e,EmptyState as Xe,SearchBar as Ye,EventStepperFooter as Ze}from"@buoy-gg/shared-ui/web";import{DataViewer as Qe}from"@buoy-gg/shared-ui/web/dataViewer";import{BaseEventStore as ea}from"@buoy-gg/shared-ui/web";import{RelativeTime as aa}from"@buoy-gg/shared-ui/web";import{formatBytes as sa,formatDuration as ta,formatNumber as oa,truncateMiddle as ra,safeStringify as ia}from"@buoy-gg/shared-ui/web";import{usePersistedState as na,persistentStorage as la,devToolsStorageKeys as ca}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as da,copyToClipboard as ua}from"@buoy-gg/shared-ui/web";import{JsModal as ma}from"@buoy-gg/shared-ui/web";import{Activity as pa,AlertTriangle as fa,Bug as ha,Check as ga,CheckCircle as xa,ChevronDown as ba,ChevronLeft as ya,ChevronRight as va,ChevronUp as wa,Clock as Sa,Copy as Ca,Database as Ta,Eye as Ea,EyeOff as ka,FileJson as Aa,FileText as Ba,Filter as Ma,FlaskConical as Va,Globe as La,Hash as Pa,Info as Ia,Key as Da,Layers as Ra,Lock as Ha,Pause as Fa,Play as za,Plus as Na,Power as Oa,RefreshCw as Ua,Search as Wa,Settings as Ka,Shield as ja,Trash2 as $a,User as Ga,Wifi as qa,X as Ja,Zap as _a,AlertCircle as Xa,BarChart3 as Ya,Bookmark as Za,Cloud as Qa,Download as es,Edit3 as as,GitBranch as ss,HardDrive as ts,HelpCircle as os,Home as rs,Image as is,Link as ns,Maximize2 as ls,Minus as cs,Palette as ds,Pin as us,Route as ms,Server as ps,Smartphone as fs,Square as hs,CheckSquare as gs,Timer as xs,Unlock as bs,Upload as ys,Users as vs,XCircle as ws}from"@buoy-gg/shared-ui/web";export{f as a,x as b,T as c,E as d,k as e,A as f,v as g,w as h,S as i,C as j,b as k,M as l,Re as m,Fe as n,ze as o,Ne as p,Oe as q,Ue as r,P as s,We as t,Ke as u,je as v,$e as w,Ge as x,qe as y,Je as z,_e as A,Xe as B,Ye as C,Ze as D,Qe as E,ea as F,aa as G,sa as H,ta as I,oa as J,ra as K,ia as L,na as M,la as N,ca as O,da as P,ua as Q,ma as R,pa as S,fa as T,ha as U,ga as V,xa as W,ba as X,ya as Y,va as Z,wa as _,Sa as $,Ca as aa,Ta as ba,Ea as ca,ka as da,Aa as ea,Ba as fa,Ma as ga,Va as ha,La as ia,Pa as ja,Ia as ka,Da as la,Ra as ma,Ha as na,Fa as oa,za as pa,Na as qa,Oa as ra,Ua as sa,Wa as ta,Ka as ua,ja as va,$a as wa,Ga as xa,qa as ya,Ja as za,_a as Aa,Xa as Ba,Ya as Ca,Za as Da,Qa as Ea,es as Fa,as as Ga,ss as Ha,ts as Ia,os as Ja,rs as Ka,is as La,ns as Ma,ls as Na,cs as Oa,ds as Pa,us as Qa,ms as Ra,ps as Sa,fs as Ta,hs as Ua,gs as Va,xs as Wa,bs as Xa,ys as Ya,vs as Za,ws as _a};
|
package/lib/web/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{$ as
|
|
1
|
+
"use client";import{$ as Yn,A as Qn,Aa as Zn,B as ea,Ba as ta,C as oa,Ca as na,D as aa,Da as ia,E as ra,Ea as sa,F as la,Fa as ca,G as da,Ga as ua,H as pa,Ha as ma,I as ga,Ia as fa,J as ha,Ja as ya,K as ba,Ka as va,L as Sa,La as wa,M as xa,Ma as Ca,N as Ta,Na as Ia,O as ka,Oa as za,P as Ba,Pa as Ma,Q as Ra,Qa as Aa,R as Da,Ra as Ea,S as Pa,Sa as Oa,T as La,Ta as Fa,U as $a,Ua as ja,V as Ha,Va as Na,W as _a,Wa,X as Ua,Xa as Ka,Y as Va,Ya as qa,Z as Ga,Za as Ja,_ as Xa,_a as Ya,a as H,aa as Qa,b as W,ba as Za,c as lt,ca as ei,d as ti,da as oi,e as Jt,ea as ni,f as ai,fa as ii,g as pd,ga as ri,h as Ae,ha as si,i as Xt,ia as li,j as He,ja as ci,k as ct,ka as di,l as ui,la as pi,m as mi,ma as gi,n as fi,na as hi,o as yi,oa as bi,p as vi,pa as Si,q as wi,qa as xi,r as Ci,ra as Ti,s as Ii,sa as ki,t as zi,ta as Bi,u as Mi,ua as Ri,v as Ai,va as Di,w as Ei,wa as Pi,x as Oi,xa as Li,y as Fi,ya as $i,z as ji,za as Hi}from"./chunks/chunk-T6BXEQLL.mjs";import{b as Ni,c as Yt}from"./chunks/chunk-5SGL6QL4.mjs";import{a as Qt,d as Ne}from"./chunks/chunk-CLXYMJTS.mjs";import{FloatingToolHost as _i}from"@buoy-gg/shared-ui/web/floating";import*as Wi from"@buoy-gg/license/web";import{LicenseManager as Ui,useLicense as Ki,sameLicenseKey as Vi,resolveDevBuild as qi,capacitorDebug as Gi,isCapacitorNative as Ji,loadCapacitorAppHost as Xi}from"@buoy-gg/license/web";import{AccountSetup as Yi,HintsProvider as Qi,normalizeEnvironment as Zi,registerToolOpener as er,startSettingsSync as tr}from"@buoy-gg/shared-ui/web";import{useState as Mt,useMemo as ge,useCallback as _e,useEffect as ee,useRef as or}from"react";import{useSettings as nr,getToolLabel as dt,getToolDescription as ar,getToolColor as Zt}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as De,devToolsStorageKeys as ut,EnvironmentIndicator as ir,EnvironmentSelectorInline as rr}from"@buoy-gg/shared-ui/web";var sr=[];function lr(){return[]}function eo(e=[]){return[...new Map(e.map(t=>[t.id,t])).values()]}function Rt(e,t){return e.filter(o=>{let a=o.slot||"both";return a==="both"||a===t})}function cr(e,t){let o=t instanceof Set?t:new Set(t);return e.filter(a=>o.has(a.id))}import{FloatingTool as to,FloatingToolDivider as dr,FloatingToolUserStatus as oo,getBubbleAnchorPosition as ur}from"@buoy-gg/shared-ui/web/floating";import{useState as Q,useEffect as Ee,useMemo as pt,useRef as mt,useCallback as gt}from"react";var no={network:"Network",images:"Images","image-overlay":"Image Overlay",assets:"Assets",query:"React Query",storage:"Storage",env:"Env",console:"Console",events:"Events",redux:"Redux",zustand:"Zustand",jotai:"Jotai","route-events":"Routes","time-machine":"Time Machine",clock:"Clock",permissions:"Permissions","highlight-updates":"Highlight Updates","debug-borders":"Debug Borders","perf-monitor":"Bench HUD","js-top":"JS Top","js-top-modal":"JS Top",impersonate:"Impersonate","perf-monitor-modal":"Bench"};function pr(e,t){return e&&no[e]?no[e]:t}import{getDialLayout as mr,getAllIconPositions as gr,getGridLineRotations as fr,getIconStaggerInputRange as hr,MAX_DIAL_SLOTS as Ge,DIAL_ICON_SIZE as yr,dialAnimationConfig as ao,getDialCSSKeyframesString as br,getDialCSSAnimationStyles as vr,dialColors as L,dialStyles as S,withAlpha as io,floatingToolsColors as Sr}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as ro,monoFont as so,ToolBackground as wr,useToolBackground as xr}from"@buoy-gg/shared-ui/web";import{memo as Cr}from"react";import{RasterLayer as Tr,scatter as Ir,useLoop as kr,withBgAlpha as zr}from"@buoy-gg/shared-ui/web";import{Fragment as Br,jsx as Je}from"react/jsx-runtime";var Mr=.94,Rr=6,Ar=2400,ft=3,lo=16,Dr=Array.from({length:ft},(e,t)=>Ir(22343^t*40503,lo*4)),co=["#FFFFFF","#B3D9FF","#8CB3FF"],uo=Math.PI/3,po=14*Math.PI/180;function Er(e){let t=Math.min(5,Math.floor(e*6)),o=e*6-t;return t*uo+po/2+o*(uo-po)}function Pr(e){return Math.min(Rr,1/(1-e*Mr))}function Or(e){let t=.15+.85*e*e;return e<.06?t*=e/.06:e>.94&&(t*=(1-e)/.06),Math.min(.7,t)}function Lr(e){let t=e/ft,o=[],a=12;for(let d=0;d<=a;d++)o.push(d/a);let n=(1-t)%1;n>.001&&n<1-.001&&o.push(n-1e-4,n+1e-4),o.sort((d,u)=>d-u);let i=[],r=[],c=[];for(let d of o){let u=t===0&&d===1?1:(d+t)%1;i.push(d),r.push(Pr(u)),c.push(Or(u))}return{input:i,scale:r,opacity:c}}var Fr=Array.from({length:ft},(e,t)=>Lr(t)),$r=Cr(function({size:e}){let t=kr(Ar),o=e/2,a=[];for(let n=0;n<ft;n++){let i=Dr[n],r=Fr[n],c=[];for(let d=0;d<lo;d++){let u=Er(i[d*4]),m=(.15+.85*Math.sqrt(i[d*4+1]))*.5*o,I=co[Math.floor(i[d*4+3]*co.length)%3],g=o+Math.cos(u)*m,M=o+Math.sin(u)*m,w=.6,R=w*2.4;c.push(Je(H,{style:{position:"absolute",left:g-R/2,top:M-R/2,width:R,height:R,borderRadius:R/2,backgroundColor:zr(I,.3)}},`${d}-h`),Je(H,{style:{position:"absolute",left:g-w/2,top:M-w/2,width:w,height:w,borderRadius:w/2,backgroundColor:I}},d))}a.push(Je(Ae.View,{style:{position:"absolute",left:0,top:0,width:e,height:e,opacity:t.interpolate({inputRange:r.input,outputRange:r.opacity}),transform:[{scale:t.interpolate({inputRange:r.input,outputRange:r.scale})}]},pointerEvents:"none",children:Je(Tr,{style:{width:e,height:e},raster:false,children:c})},n))}return Je(Br,{children:a})});import{useEffect as jr,useState as mo}from"react";import{dialColors as We,withAlpha as go}from"@buoy-gg/floating-tools-react/web";import{ARROW_BOTTOM_OFFSET as Hr,ARROW_HEIGHT as Nr,SPACING_GAP as Ad,getScreenCenterY as Dd,calculateTooltipPosition as _r,calculateTargetPosition as Ed}from"@buoy-gg/shared-ui/web/floating";import{monoFont as fo}from"@buoy-gg/shared-ui/web";import{jsx as Ue,jsxs as ho}from"react/jsx-runtime";var yo=false;function Wr(){if(yo||typeof document>"u")return;let e=document.createElement("style");e.textContent=`
|
|
2
2
|
@keyframes buoyOnboardPulse {
|
|
3
3
|
0%, 100% { transform: scale(1); }
|
|
4
4
|
50% { transform: scale(1.02); }
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
0%, 100% { transform: translateY(0); }
|
|
8
8
|
50% { transform: translateY(-8px); }
|
|
9
9
|
}
|
|
10
|
-
`,document.head.appendChild(e),To=true}var Lt=qe.accent;function Io({title:e,message:t,onDismiss:o,showArrow:a=true}){let[n,r]=So(false),[i,s]=So(false);Vi(()=>{Xi();let u=requestAnimationFrame(()=>r(true));return()=>cancelAnimationFrame(u)},[]);let d={fontFamily:xo,textTransform:"uppercase"};return Ge("div",{style:{position:"fixed",left:"50%",bottom:Ji(),transform:`translateX(-50%) scale(${n?1:.8})`,opacity:n?1:0,transition:"transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1), opacity 300ms ease",zIndex:10002,pointerEvents:"auto"},children:Co("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ge("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),Co("div",{style:{position:"relative",maxWidth:280,backgroundColor:qe.dialBackground,borderRadius:16,border:`1px solid ${qe.dialBorder}`,padding:20,boxShadow:`0 0 20px ${wo(qe.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ge("span",{style:{...d,fontSize:16,fontWeight:900,letterSpacing:1,color:Lt,textAlign:"center"},children:e}),Ge("span",{style:{fontFamily:xo,fontSize:13,lineHeight:"20px",color:qe.centerText,textAlign:"center"},children:t}),Ge("button",{onClick:o,onPointerDown:()=>s(true),onPointerUp:()=>s(false),onPointerLeave:()=>s(false),onPointerCancel:()=>s(false),style:{...d,marginTop:8,borderRadius:8,border:"none",backgroundColor:Lt,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:i?.7:1,transform:i?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),a&&Ge("div",{style:{position:"absolute",left:"50%",bottom:qi,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${Gi}px solid ${Lt}`,filter:`drop-shadow(0 0 10px ${wo(qe.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}import{Fragment as Yi,jsx as L,jsxs as xe}from"react/jsx-runtime";var Qi={x:.5,y:.5},ko="@react_buoy_settings_tooltip_shown",zo=false;function Zi(){if(zo||typeof document>"u")return;let e=document.createElement("style");e.textContent=Ii(),document.head.appendChild(e),zo=true}var Je=e=>1-Math.pow(1-e,3),Ft=e=>e*e*e;function es({icon:e,index:t,totalIcons:o,position:a,progress:n,onPress:r}){let[i,s]=ee(false),[d,u]=ee(false),m=!e.icon&&e.id.startsWith("empty-"),I=!m&&e.unavailable===true,g=!m&&!I,{icons:D}=po,w=Ci(t,o),E=0;n<=w[1]?E=0:n<=w[2]?E=(n-w[1])/(w[2]-w[1]):E=1,E=Math.max(0,Math.min(1,E));let z=Ti,P=D.pressIn.scale,R=E*(d?P:i?1.1:1),k=0;E<=0?k=0:E<=.3?k=E:k=.3+(E-.3)*(.7/.7);let v=a.x*E,C=a.y*E;return L("button",{role:"menuitem","aria-label":m?"Empty slot":vi(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!g,tabIndex:g?0:-1,onClick:g?r:void 0,onPointerEnter:F=>g&&F.pointerType==="mouse"&&s(true),onPointerLeave:()=>{s(false),u(false)},onPointerDown:()=>g&&u(true),onPointerUp:()=>u(false),onPointerCancel:()=>u(false),style:{position:"absolute",left:"50%",top:"50%",width:z,height:z,marginLeft:-z/2,marginTop:-z/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:g?"pointer":"default",transform:`translate(${v}px, ${C}px) scale(${R})`,opacity:k,transition:i||d?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:m?L("div",{style:{width:S.emptySlot.dotSize,height:S.emptySlot.dotSize,borderRadius:S.emptySlot.dotSize/2,backgroundColor:$.emptyDotBackground,border:`${S.emptySlot.borderWidth}px solid ${$.emptyDotBorder}`}}):xe(Yi,{children:[L("div",{style:{position:"absolute",width:`${S.icon.gradientBgSizePercent}%`,height:`${S.icon.gradientBgSizePercent}%`,borderRadius:S.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:S.icon.gradientBgOpacity}}),L("div",{style:{position:"absolute",width:`${S.icon.innerGlowSizePercent}%`,height:`${S.icon.innerGlowSizePercent}%`,borderRadius:S.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:S.icon.innerGlowOpacity}}),L("div",{style:{marginBottom:S.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:i?"brightness(1.2)":"none"},children:e.icon}),L("span",{style:{fontSize:e.name.length>8?Math.max(S.icon.label.fontSize*.7,S.icon.label.fontSize*8/e.name.length):S.icon.label.fontSize,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,color:$.iconLabel,letterSpacing:S.icon.label.letterSpacing,marginTop:S.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),I&&L("span",{style:{fontSize:S.icon.label.fontSize-1,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,letterSpacing:S.icon.label.letterSpacing,color:zi.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}function Ro({side:e,color:t}){return L("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(e==="prev"?[[15,18,9,12],[9,12,15,6]]:[[9,18,15,12],[15,12,9,6]]).map(([o,a,n,r],i)=>L("line",{x1:o,y1:a,x2:n,y2:r,stroke:t,strokeWidth:2},i))})}function Mo({side:e,disabled:t,onClick:o}){let[a,n]=ee(false),r=t?$.emptyDotBorder:$.accent;return xe("button",{type:"button","aria-label":`${e==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${e}`,disabled:t,onClick:o,onPointerDown:()=>!t&&n(true),onPointerUp:()=>n(false),onPointerLeave:()=>n(false),onPointerCancel:()=>n(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${$.dialBorder}`,backgroundColor:$.dialBackground,color:t?$.iconLabelMuted:$.centerText,fontSize:12,fontWeight:900,fontFamily:fo,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${mo($.dialShadow,.4)}`,transform:a?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&L(Ro,{side:"prev",color:r}),e==="prev"?"PREV":"NEXT",e==="next"&&L(Ro,{side:"next",color:r})]})}function Bo({icons:e,onClose:t,centerLabel:o="MENU",onCenterPress:a,settingsOpen:n=false,hintsDisabled:r=false}){let{id:i}=Mi(),[s,d]=ee(0),[u,m]=ee(0),[I,g]=ee(0),[D,w]=ee(0),[E,z]=ee(0),[P,R]=ee(1),[k,v]=ee(false),[C,F]=ee(false),[T,A]=ee(false),te=yt(null),K=yt(null),J=yt(null),ne=yt(false),{entrance:q,exit:le,interaction:ae}=po,Ce=ki(),[ce,Me]=ee(()=>({width:window.innerWidth,height:window.innerHeight}));Fe(()=>{let b=()=>Me({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);let H=ht(()=>Si({screenWidth:ce.width,maxCircleSize:Math.max(120,Math.min(320,ce.height-96))}),[ce]),Ye=ht(()=>xi(),[]),Be=ht(()=>wi(Qe,H.iconRadius),[H.iconRadius]),[We,De]=ee(0),de=Math.max(1,Math.ceil(e.length/Qe)),Y=Math.min(We,de-1),Te=ht(()=>{let b=Y*Qe,x=[...e.slice(b,b+Qe)];for(;x.length<Qe;)x.push({id:`empty-${x.length}`,name:"",icon:null,onPress:()=>{}});return x},[e,Y]);Fe(()=>{Zi()},[]),Fe(()=>{let b=q.backdrop.duration,x=q.dial.rotation.duration,Q=q.centerButton.delay,V=q.icons.delay,X=q.icons.duration,G=performance.now(),re=he=>{let l=he-G;d(Math.min(1,l/b));let f=Math.min(1,l/400),O=Je(f)*1.1;f>.7&&(O-=(f-.7)*.33),f>=1&&(O=1),m(Math.max(0,Math.min(1.05,O)));let Z=Math.min(1,l/x);if(g(Je(Z)*360),l>=Q){let ke=Math.min(1,(l-Q)/300),Ne=Je(ke)*1.15;ke>.6&&(Ne-=(ke-.6)*.375),ke>=1&&(Ne=1),w(Math.max(0,Math.min(1.05,Ne)))}if(l>=V){let ke=Math.min(1,(l-V)/X);z(Je(ke))}let Ie=V+X;l<Ie?J.current=requestAnimationFrame(re):(d(1),m(1),g(360),w(1),z(1),A(true))};return J.current=requestAnimationFrame(re),()=>{J.current&&cancelAnimationFrame(J.current)}},[]);let fe=bt(()=>{if(ne.current)return;ne.current=true,F(true),J.current&&cancelAnimationFrame(J.current);let b=performance.now(),x=le.icons.duration,Q=le.centerButton.duration,V=le.dialScale.duration,X=Math.max(Q,V),G=le.backdrop.duration,re=he=>{let l=he-b;if(l<x){let Z=Ft(l/x);z(1-Z),J.current=requestAnimationFrame(re);return}let f=x;if(l<f+X){z(0);let Z=Math.min(1,(l-f)/Q),Ie=Math.min(1,(l-f)/V);w(1-Ft(Z)),m(1-Ft(Ie)),J.current=requestAnimationFrame(re);return}let O=f+X;if(l<O+G){m(0),w(0);let Z=(l-O)/G;d(1-Z),J.current=requestAnimationFrame(re);return}d(0),t()};J.current=requestAnimationFrame(re)},[le,t]);Fe(()=>{let b=document.activeElement,x=te.current;return()=>{b?.isConnected&&(document.activeElement===document.body||x?.contains(document.activeElement))&&b.focus()}},[]),Fe(()=>{if(n)return;K.current?.focus();let b=x=>{let Q=te.current;if(Q){if(x.key==="Escape")x.preventDefault(),fe();else if(x.key==="Tab"){let V=Array.from(Q.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(re=>re.getClientRects().length>0),X=V[0],G=V[V.length-1];(!Q.contains(document.activeElement)||(x.shiftKey?document.activeElement===X:document.activeElement===G))&&(x.preventDefault(),(x.shiftKey?G:X)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(x.key)){let V=Array.from(Q.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),X=V.indexOf(document.activeElement);if(X<0||!V.length)return;x.preventDefault();let G=x.key==="Home"?0:x.key==="End"?V.length-1:(X+(x.key==="ArrowRight"||x.key==="ArrowDown"?1:-1)+V.length)%V.length;V[G].focus()}}};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[fe,n]);let[Ee,_e]=ee(false);Fe(()=>{if(r)return;let b=false,x=setTimeout(async()=>{let Q=await go.getItem(ko);!b&&!Q&&_e(true)},1200);return()=>{b=true,clearTimeout(x)}},[r]);let Se=bt(()=>{_e(false),go.setItem(ko,"true")},[]);Fe(()=>{n&&Ee&&Se()},[n,Ee,Se]);let Ae=bt(b=>{if(b.id.startsWith("empty-")||ne.current)return;let[x,Q]=ae.iconSelect.pulse,V=performance.now(),X=150,G=re=>{let he=re-V;if(he<X){let l=Je(he/X);R(1-(1-x.scale)*l),requestAnimationFrame(G)}else if(he<X*2){let l=Je((he-X)/X);R(x.scale+(Q.scale-x.scale)*l),requestAnimationFrame(G)}else R(1)};requestAnimationFrame(G),setTimeout(()=>{b.onPress(),fe()},ae.iconSelect.actionDelay)},[ae.iconSelect,fe]),ge=bt(b=>{if(ne.current)return;let x=Math.max(0,Math.min(b,de-1));x!==Y&&De(x)},[de,Y]),we=H.buttonSize*S.centerButton.containerRatio,Pe=H.buttonSize*S.centerButton.borderRatio,c=H.buttonSize*S.centerButton.containerRatio/2+6,U=T&&!C;return xe("div",{ref:te,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[L("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:fe,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:$.dialBackdrop,opacity:s}}),xe("div",{style:{position:"absolute",left:"50%",marginLeft:-H.circleSize/2,bottom:80,width:H.circleSize,height:H.circleSize,borderRadius:"50%",backgroundColor:$.dialBackground,border:`${S.circle.borderWidth}px solid ${$.dialBorder}`,boxShadow:`0 0 ${S.circle.shadowRadius}px ${mo($.dialShadow,S.circle.shadowOpacity)}`,transform:`scale(${u}) rotate(${I}deg)`,opacity:u>.01?1:0,overflow:"hidden"},children:[L("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:$.dialGradient1,opacity:S.gradientLayers[0].opacity}}),L("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:$.dialGradient2,opacity:S.gradientLayers[1].opacity}}),L("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:$.dialGradient3,opacity:S.gradientLayers[2].opacity}}),Ye.map(b=>L("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:S.grid.lineHeight,transform:`rotate(${b}deg)`,transformOrigin:"center"},children:["left","right"].map(x=>L("div",{style:{position:"absolute",top:0,[x]:0,width:`calc(50% - ${c}px)`,height:S.grid.lineHeight,backgroundColor:$.dialGridLine}},x))},b)),L("div",{"data-testid":"dial-background","data-background":i,style:{position:"absolute",inset:0,pointerEvents:"none"},children:i==="hyperspace"?L(Ki,{size:H.circleSize}):L(Ri,{focus:Qi})}),Te.map((b,x)=>L(es,{icon:b,index:x,totalIcons:Te.length,position:Be[x],progress:E,onPress:()=>Ae(b)},x)),xe("div",{style:{position:"absolute",left:"50%",top:"50%",width:we,height:we,marginLeft:-we/2,marginTop:-we/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:$.hubHalo,borderRadius:H.buttonSize,overflow:"hidden",transform:`scale(${D*P})`,opacity:D>.01?1:0},children:[L("div",{style:{position:"absolute",inset:0,backgroundColor:$.dialGradient1,opacity:.5,borderRadius:H.buttonSize}}),L("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:$.dialGradient2,opacity:.3,borderRadius:H.buttonSize}}),L("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:$.dialGradient3,opacity:.2,borderRadius:H.buttonSize}}),L("div",{style:{width:Pe,height:Pe,borderRadius:H.buttonSize*S.centerButton.borderRadiusRatio,backgroundColor:$.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:L("button",{ref:K,type:"button","aria-label":n?"Close Settings":"Open Dev Tools Settings",disabled:!a,onClick:a,onPointerEnter:b=>b.pointerType==="mouse"&&v(true),onPointerLeave:()=>v(false),style:{border:0,padding:0,background:"transparent",width:H.buttonSize,height:H.buttonSize,borderRadius:H.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:a?"pointer":"default",transform:k?`scale(${ae.centerHover.scale})`:"scale(1)",transition:`transform ${ae.centerHover.duration}ms ease`,animation:U&&!k?Ce.pulse:"none"},children:n?xe("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:S.centerButton.text.fontSize-2,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:$.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[L("span",{style:{marginBottom:-2},children:"CLOSE"}),L("span",{style:{marginTop:-2},children:"SETTINGS"})]}):L("span",{style:{fontSize:S.centerButton.text.fontSize,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:$.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase"},children:o})})})]})]}),de>1&&xe("div",{style:{position:"absolute",left:"50%",marginLeft:-H.circleSize/2,top:"calc(100% - 64px)",width:H.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,u),transform:`scale(${Math.min(1,u)})`},children:[L(Mo,{side:"prev",disabled:Y<=0,onClick:()=>ge(Y-1)}),xe("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:fo,letterSpacing:2,color:$.centerText,textShadow:`0 0 6px ${$.centerTextGlow}`},children:[String(Y+1).padStart(2,"0"),xe("span",{style:{color:$.iconLabelMuted,textShadow:"none"},children:[" / ",String(de).padStart(2,"0")]})]}),L(Mo,{side:"next",disabled:Y>=de-1,onClick:()=>ge(Y+1)})]}),Ee&&!n&&L(Io,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:Se,showArrow:false})]})}import{persistentStorage as Do,devToolsStorageKeys as ts}from"@buoy-gg/shared-ui/web";import{recordUsage as os,pruneUsage as ns}from"@buoy-gg/floating-tools-core/web";var Eo=ts.dial.usage(),Xe={},Ao=false,$t=null;function Po(){return $t||($t=(async()=>{try{let e=await Do.getItem(Eo);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(Xe=t)}}catch{}finally{Ao=true}})(),$t)}Po();function as(e){return e.map((t,o)=>({id:t,index:o,lastUsed:Xe[t]?.lastUsed??0})).sort((t,o)=>o.lastUsed-t.lastUsed||t.index-o.index).map(({id:t})=>t)}async function rs(e){if(!e)return;Ao||await Po();let t=Math.max(Date.now(),...Object.values(Xe).map(o=>o.lastUsed+1));Xe=ns(os(Xe,e,t),t);try{await Do.setItem(Eo,JSON.stringify(Xe))}catch{}}import{useCallback as is,useMemo as Oo}from"react";import{persistentStorage as ss}from"@buoy-gg/shared-ui/web";import{useState as ie,useEffect as ze,useCallback as St,useMemo as wt}from"react";import{settingsEventBus as xt}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as ls}from"react";import{getRegisteredToolModule as cs}from"@buoy-gg/shared-ui/web";var ds=()=>()=>{},us=()=>null;function ps(){let e=cs("@buoy-gg/external-sync");return ls(e?.subscribeSyncStatus??ds,()=>e?.getSyncStatus?.()??null,us)}import{SentryIcon as ms,WifiCircuitIcon as gs,ImageOverlayIcon as fs,RenderCountIcon as hs,Info as jt,Layers as ys,ChevronRightIcon as Lo,ChevronDown as Fo,getStorageBackendType as bs,getUseLicense as vs,signOutOfBuoy as Ss,persistentStorage as $e,Trash2 as ws,CheckCircle2 as $o,LicenseEntryModal as xs,BackgroundSwitcher as Cs,night as h,NightCard as je,NightRows as Ht,NightSectionLabel as Ts,NightFootnote as jo,NightSwitch as Ho,NightButton as Wt,NightSegmented as Is,NightBadge as be,NightSeparator as ks,monoFont as Wo}from"@buoy-gg/shared-ui/web";import{EnvIcon as _o,StorageIcon as zs,RoutesIcon as Rs,NetworkIcon as Ms,QueryIcon as Bs,HighlighterIcon as Ds,ReduxIcon as Es,EventsIcon as As}from"@buoy-gg/floating-tools-core/web";import Ps,{createContext as Os,useContext as Ls}from"react";import{jsx as Fs}from"react/jsx-runtime";var No=Os({});function Uo({children:e,defaultFloatingTools:t,defaultDialTools:o}){let a=Ps.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:o}),[t,o]);return Fs(No.Provider,{value:a,children:e})}function Ko(){return Ls(No)}import $s from"react";import{toolTheme as js}from"@buoy-gg/shared-ui/web";import{jsx as Vo}from"react/jsx-runtime";function Hs({label:e,size:t,color:o=js.colors.text}){let a=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),n=a<=2?t:t*1.6,r=Math.max(7,Math.min(t*(a===1?.7:.62),n/(.62*a)));return Vo("span",{style:{display:"inline-flex",minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center",color:o,fontSize:r,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}function qo(e,t){return e==null?e:typeof e=="function"?$s.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?Vo(Hs,{label:String(e),size:t.size,color:t.color}):e}import{JsModal as Ws,devToolsStorageKeys as _t,onSettingsApplied as _s,expandableWindowControlsSupported as Ns}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Us}from"@buoy-gg/shared-ui/web";import{Fragment as et,jsx as p,jsxs as W}from"react/jsx-runtime";var tt="@react_buoy_dev_tools_settings",Ks=6,Ct=e=>{let t=Ks,o={};for(let[a,n]of Object.entries(e))n&&t>0?(o[a]=true,t-=1):o[a]=false;return o},Vs=(e,t)=>{let{userStatus:o,environment:a,...n}=e,r=t?Object.entries(n).filter(([i])=>t.includes(i)):Object.entries(n);return{...Object.fromEntries(r),environment:a??false}},Go=(e,t,o)=>{if(!t)return e;let a={...e.dialTools,...t.dialTools??{}},n=o?.allowedDialKeys?Object.entries(a).filter(([r])=>o.allowedDialKeys?.includes(r)):Object.entries(a);return{dialTools:Ct(Object.fromEntries(n)),floatingTools:Vs({...e.floatingTools,...t.floatingTools??{}},o?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},qs=(e=[],t,o)=>{let a={},n={},r=new Set(t??[]),i=new Set(o??[]),s=!o||o.length===0;for(let d of e){let{id:u,slot:m="both"}=d;(m==="dial"||m==="both")&&(a[u]=s?true:i.has(u)),(m==="row"||m==="both")&&(n[u]=r.has(u))}return{dialTools:Ct(a),floatingTools:{...n,environment:r.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},Gs=({visible:e,onClose:t,onSettingsChange:o,initialSettings:a,availableApps:n=[],storage:r=$e,zIndex:i})=>{let{defaultFloatingTools:s,defaultDialTools:d}=Ko(),u=wt(()=>qs(n,s,d),[n,s,d]),m=wt(()=>Object.keys(u.dialTools),[u]),I=wt(()=>Object.keys(u.floatingTools).filter(l=>l!=="environment"),[u]),[g,D]=ie(a||ot||u),[w,E]=ie(Nt??"floating"),[z,P]=ie(Nt!==null),[R,k]=ie(new Set),[v,C]=ie(false),[F,T]=ie(false);ze(()=>{let l=requestAnimationFrame(()=>T(true));return()=>cancelAnimationFrame(l)},[]);let A=ps();ze(()=>{(async()=>{try{let l=await $e.getItem(_t.settings.activeTab());if(l&&["floating","settings","pro"].includes(l)){let f=l;Nt=f,E(O=>O===f?O:f)}}catch{}finally{P(true)}})()},[]),ze(()=>{z&&$e.setItem(_t.settings.activeTab(),w).catch(l=>{console.warn("Failed to save settings active tab:",l)})},[w,z]);let te=vs()?.(),K=te?.isPro??false,J=!K&&te?.licenseKey?te.error:null,ne=te?.errorKind==="transport",[q,le]=ie(Jo),[ae,Ce]=ie(false),[ce,Me]=ie(false),[H,Ye]=ie(false),[Be,We]=ie([]),[De,de]=ie(false),Y=Us(),Te=no.get("window").height,fe=no.get("window").width,Ee=Math.floor(Te*.33),_e=Math.min(fe-32,400),Se=St(async()=>{try{let l=await r.getItem(tt);if(l){let f=JSON.parse(l),O=Go(u,f,{allowedDialKeys:m,allowedFloatingKeys:I});ot=O,D(Z=>Xo(Z,O)?Z:O);return}ot=u,D(f=>Xo(f,u)?f:u)}catch(l){console.error("Failed to load dev tools settings:",l),D(u)}},[u,m,I,r]);ze(()=>{Se()},[Se]),ze(()=>{bs().then(l=>{Jo=l,le(f=>f===l?f:l)})},[]),ze(()=>{H&&(de(true),$e.getAllKeys().then(l=>{We(l.sort())}).catch(()=>{We([])}).finally(()=>{de(false)}))},[H]);let Ae=async l=>{try{let f={...l,dialTools:Ct(l.dialTools)};await r.setItem(tt,JSON.stringify(f)),ot=f,D(f),o?.(f),xt.emit(f)}catch(f){console.error("Failed to save dev tools settings:",f)}},ge=l=>{let f={...g,floatingTools:{...g.floatingTools,[l]:!g.floatingTools[l]}};Ae(f)},we=l=>{let f={...g,globalSettings:{...g.globalSettings,[l]:!g.globalSettings?.[l]}};Ae(f)},Pe=async()=>{Ce(true),Me(false);try{await $e.clear(),Me(true),D(u),r!==$e&&await r.setItem(tt,JSON.stringify(u)),o?.(u),xt.emit(u),setTimeout(()=>Me(false),2e3)}catch(l){console.error("Failed to clear storage:",l)}finally{Ce(false)}},c=St(l=>{},[]),U=l=>{let f=n.find(O=>O.id===l);return f?.description?f.description:l==="environment"?"Environment badge.":""},b=l=>l==="environment"?"Env Badge":n.find(f=>f.id===l)?.name??l.toUpperCase().replace(/_/g," "),x=l=>{if(!F)return null;switch(l){case"query":return p(Bs,{size:18});case"env":return p(_o,{size:18});case"sentry":return p(ms,{size:18,color:"#9945FF"});case"storage":return p(zs,{size:18,bgColor:h.color.surface});case"wifi":case"query-wifi-toggle":return p(gs,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return p(Rs,{size:18,bgColor:h.color.surface});case"network":return p(Ms,{size:18});case"environment":return p(_o,{size:18});case"debug-borders":return p(ys,{size:18,color:h.color.accent});case"highlight-updates":return p(hs,{size:18,color:h.color.accent});case"highlight-updates-modal":return p(Ds,{size:18});case"redux":return p(Es,{size:18});case"image-overlay":return p(fs,{size:18});case"events":return p(As,{size:18});case"zustand":try{let{ZustandIcon:f}=ro("@buoy-gg/zustand/web");return p(f,{size:18})}catch{return p(jt,{size:18,color:h.color.textSecondary})}case"jotai":try{let{JotaiIcon:f}=ro("@buoy-gg/jotai/web");return p(f,{size:18})}catch{return p(jt,{size:18,color:h.color.textSecondary})}default:{let f=n.find(O=>O.id===l);return f?.icon!=null?qo(f.icon,{slot:"row",size:18,color:f.color}):p(jt,{size:18,color:h.color.textSecondary})}}},Q=(l,f,O,Z)=>{let Ie=U(l);return W(ut,{activeOpacity:O?1:.7,onPress:()=>!O&&Z(),accessibilityLabel:b(l),accessibilityRole:"button",style:[y.toolRow,O&&y.rowDisabled],children:[p(M,{style:y.toolIconSlot,children:x(l)}),W(M,{style:y.rowInfo,children:[W(B,{style:y.rowLabel,children:[b(l),O?" \xB7 max 6":""]}),Ie?p(B,{style:y.rowCaption,numberOfLines:1,children:Ie}):null]}),p(Ho,{value:f,disabled:O,onValueChange:()=>Z()})]},l)},V=l=>{k(f=>{let O=new Set(f);return O.has(l)?O.delete(l):O.add(l),O})},X=(l,f,O,Z,Ie)=>{let ke=g.globalSettings?.[l]??false,Ne=R.has(l);return W(M,{children:[W(ut,{activeOpacity:.7,onPress:()=>V(l),accessibilityLabel:f,style:y.settingRow,children:[W(M,{style:y.rowInfo,children:[p(B,{style:y.rowLabel,children:f}),p(B,{style:y.rowCaption,numberOfLines:Ne?0:1,children:O})]}),p(Ho,{value:ke,onValueChange:()=>we(l)})]}),Ne&&W(M,{style:y.settingRowBody,children:[p(B,{style:y.settingRowBodyText,children:Z}),p(B,{style:y.settingRowBodyHint,children:Ie})]})]},l)},G=(l,f,O)=>W(M,{children:[p(Ts,{children:l}),f,O]}),re=q==="filesystem"?p(be,{label:"File System",tone:"accent"}):q==="asyncstorage"?p(be,{label:"Async Storage",tone:"warning"}):q==="localstorage"?p(be,{label:"Local Storage",tone:"accent"}):q==="memory"?p(be,{label:"Memory",tone:"danger"}):p(be,{label:"Loading\u2026",tone:"neutral"}),he=()=>W(M,{style:y.container,children:[W(to,{style:y.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:y.scrollContainer,children:[w==="floating"&&p(et,{children:G("Floating Tools",p(je,{glass:true,children:p(Ht,{children:Object.entries(g.floatingTools).map(([l,f])=>Q(l,f,false,()=>ge(l)))})}),p(jo,{children:"Tools switched on here appear in the floating bubble row."}))}),w==="settings"&&W(et,{children:[G("Background",p(je,{glass:true,padded:true,children:p(Cs,{embedded:true})})),G("Storage",W(je,{glass:true,children:[W(ut,{activeOpacity:.7,onPress:()=>Ye(!H),accessibilityLabel:"Storage Type",style:y.settingRow,children:[p(M,{style:y.rowInfo,children:p(B,{style:y.rowLabel,children:"Storage Type"})}),re,H?p(Fo,{size:16,color:h.color.textTertiary}):p(Lo,{size:16,color:h.color.textTertiary})]}),H&&W(et,{children:[W(M,{style:y.settingRowBody,children:[p(B,{style:y.settingRowBodyText,children:q==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":q==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":q==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":q==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),q==="asyncstorage"&&p(B,{style:[y.settingRowBodyText,y.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),q==="memory"&&p(B,{style:[y.settingRowBodyText,y.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),p(ks,{}),W(M,{style:y.storageExpanded,children:[W(M,{style:y.storageExpandedHeader,children:[p(B,{style:y.storageExpandedTitle,children:"SAVED SETTINGS"}),p(B,{style:y.storageExpandedCount,children:De?"\u2026":`${Be.length} keys`})]}),De?p(B,{style:y.storageKeyEmpty,children:"Loading\u2026"}):Be.length===0?p(B,{style:y.storageKeyEmpty,children:"No settings saved yet"}):p(to,{style:y.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:Be.map(l=>p(M,{style:y.storageKeyItem,children:p(B,{style:y.storageKeyText,numberOfLines:1,children:l.replace("@react_buoy_","")})},l))})]}),p(M,{style:y.cardButtonWrap,children:p(Wt,{label:ce?"Cleared":ae?"Clearing\u2026":"Clear All Settings",variant:ce?"secondary":"destructive",size:"md",disabled:ae,onPress:Pe,icon:ce?p($o,{size:15,color:h.color.accent}):p(ws,{size:15,color:ae?h.color.textTertiary:h.color.danger})})})]})]})),A&&A.state!=="idle"&&G("Desktop Sync",W(je,{glass:true,children:[W(ut,{activeOpacity:.7,onPress:()=>V("desktopSync"),accessibilityLabel:"Buoy Desktop",style:y.settingRow,children:[p(M,{style:y.rowInfo,children:p(B,{style:y.rowLabel,children:"Buoy Desktop"})}),A.state==="connected"?p(be,{label:"Connected",tone:"accent"}):A.state==="connecting"?p(be,{label:"Connecting\u2026",tone:"neutral"}):p(be,{label:"Retrying",tone:"warning"}),R.has("desktopSync")?p(Fo,{size:16,color:h.color.textTertiary}):p(Lo,{size:16,color:h.color.textTertiary})]}),R.has("desktopSync")&&W(M,{style:y.settingRowBody,children:[W(B,{style:y.settingRowBodyText,children:[A.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",p(B,{style:y.footnoteMono,children:A.targetURL??"(unknown URL)"}),A.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),A.state==="retrying"&&A.lastError&&W(B,{style:[y.settingRowBodyText,y.bodyWarning],children:["Last error: ",A.lastError]})]})]})),G("Modal Behavior",p(je,{glass:true,children:W(Ht,{children:[X("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),Ns(Ue.OS==="web")?X("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),w==="pro"&&W(et,{children:[G("License",W(je,{glass:true,children:[W(M,{style:y.settingRow,children:[p(M,{style:y.rowInfo,children:p(B,{style:y.rowLabel,children:"License Status"})}),p(M,{testID:"buoy-settings-license-status",accessibilityLabel:K?"License: Active":"License: Free",children:K?p(be,{label:"Active",tone:"accent"}):p(be,{label:"Free",tone:"neutral"})})]}),te?.tierSource==="session"?W(M,{style:y.settingRow,children:[p(M,{style:y.rowInfo,children:p(B,{style:y.rowLabel,children:"Signed in with Buoy"})}),p(Wt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void Ss(),testID:"buoy-settings-signout"})]}):null]}),p(jo,{children:K?"You have full access to all Buoy DevTools features.":J?ne?`Couldn't reach the license server (${J}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${J}.`:"Upgrade to Pro to unlock all features and support development."})),!K&&W(et,{children:[G("Pro Features",p(je,{glass:true,children:p(Ht,{children:["Advanced Settings","Priority Support"].map(l=>W(M,{style:y.featureRow,children:[p($o,{size:16,color:h.color.accent}),p(B,{style:y.rowLabel,children:l})]},l))})})),p(Wt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>C(true)})]})]})]}),p(xs,{visible:v,onClose:()=>C(false),onSuccess:()=>C(false)})]});return p(Ws,{visible:e,onClose:t,zIndex:i,variant:"night",header:{showToggleButton:false,customContent:p(M,{style:y.headerRow,children:p(Is,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:w,onChange:l=>E(l)})})},initialMode:"bottomSheet",onModeChange:c,persistenceKey:_t.settings.root(),enablePersistence:true,maxHeight:Te-Y.top,initialHeight:Ee,initialFloatingPosition:{x:(fe-_e)/2,y:Y.top+20},enableGlitchEffects:true,children:he()})},Js={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},Xs=(e,t)=>{let o=new Set(e??[]),a=new Set(t??[]),n={};for(let i of a)n[i]=true;let r={environment:o.has("environment")};for(let i of o)i!=="environment"&&(r[i]=true);return{dialTools:Ct(n),floatingTools:r,globalSettings:{enableSharedModalDimensions:false}}},ot=null,Nt=null,Jo=null,Xo=(e,t)=>JSON.stringify(e)===JSON.stringify(t);xt.addListener(e=>{e&&(ot=e)});var Yo=()=>{let{defaultFloatingTools:e,defaultDialTools:t}=Ko(),o=wt(()=>!e&&!t?Js:Xs(e,t),[e,t]),[a,n]=ie(o),r=St(async()=>{try{let s=await $e.getItem(tt);if(s){let d=JSON.parse(s),u=Go(o,d);n(u);return}n(o)}catch(s){console.error("Failed to load dev tools settings:",s),n(o)}},[o]);ze(()=>_s(s=>{s.includes(tt)&&r()}),[r]),ze(()=>{r();let s=xt.addListener(d=>{try{d&&n(d)}catch{}});return()=>{s()}},[r]);let i=St(()=>{r()},[r]);return{settings:a,refreshSettings:i}},y=mt.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:h.gutter,paddingRight:h.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:h.gutter,paddingTop:8,paddingBottom:24,gap:h.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:h.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:h.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:h.color.text,fontSize:h.font.row,fontWeight:"500"},rowCaption:{color:h.color.textTertiary,fontSize:h.font.label},settingRowBody:{paddingHorizontal:h.rowPadH,paddingBottom:h.rowPadV,gap:6},settingRowBodyText:{color:h.color.textSecondary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},settingRowBodyHint:{color:h.color.textTertiary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},bodyWarning:{color:h.color.warning},bodyDanger:{color:h.color.danger},cardButtonWrap:{paddingHorizontal:h.cardPad,paddingTop:10,paddingBottom:h.cardPad},storageExpanded:{paddingHorizontal:h.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:h.color.textSecondary,fontSize:h.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:h.color.textTertiary,fontSize:h.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:h.color.glassElevated,borderRadius:h.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:h.color.textSecondary,fontSize:h.font.micro,fontFamily:Wo},storageKeyEmpty:{color:h.color.textTertiary,fontSize:h.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:Wo,fontSize:h.font.label,color:h.color.textSecondary}});import{jsx as Qo}from"react/jsx-runtime";var Ys=[];function Zo({visible:e,onClose:t,availableTools:o=Ys,defaultFloatingTools:a,defaultDialTools:n,storage:r=ss,onSettingsChange:i}){let s=Oo(()=>({getItem:async m=>r.getItem(m),setItem:async(m,I)=>r.setItem(m,I)}),[r]),d=Oo(()=>o.map(m=>({...m,name:m.name??m.id,icon:typeof m.icon=="function"?I=>m.icon(I.size):m.icon})),[o]),u=is(m=>{i?.(m)},[i]);return Qo(Uo,{defaultFloatingTools:a,defaultDialTools:n,children:Qo(Gs,{visible:e,onClose:t,zIndex:11e3,availableApps:d,storage:s,onSettingsChange:u})})}import{persistentStorage as en,setExpandableWindowControls as Qs}from"@buoy-gg/shared-ui/web";import{createContext as Zs,useCallback as Re,useContext as el,useEffect as Tt,useMemo as tl,useRef as nt,useState as tn}from"react";var ol=(e,t,o)=>{if(t.singleton){let n=e.find(r=>r.id===t.id);if(n){let r=n.minimized??false;return{instanceId:n.instanceId,wasMinimized:r,apps:[...e.filter(i=>i.instanceId!==n.instanceId),{...n,minimized:false}]}}}let a=o();return{instanceId:a,wasMinimized:false,apps:[...e,{...t,instanceId:a}]}};import{createContext as nl,useCallback as on,useContext as al,useEffect as It,useMemo as rl,useRef as nn,useState as kt}from"react";import{JsModal as il,ModalHeader as at,HeaderSearchButton as sl,TickProvider as ll,ToolScreenHeaderContext as cl,devToolsStorageKeys as an,buoyColors as rn,gameUIColors as Ut}from"@buoy-gg/shared-ui/web";import{jsx as ue,jsxs as zt}from"react/jsx-runtime";var rt=()=>{},dl={search:"",isSearchActive:false,clearSearch:rt,close:rt,minimize:rt,showToast:rt,setHeaderOverride:rt},sn=nl(null);function ln(){return al(sn)??dl}function ul(e,t){let{setHeaderOverride:o}=ln();It(()=>(o(e),()=>o(null)),t)}var cn=2200,pl={success:Ut.success,error:Ut.error,info:Ut.info};function ml({message:e,type:t,nonce:o}){let a=nn(new Oe.Value(0)).current;It(()=>{a.setValue(0),Oe.sequence([Oe.timing(a,{toValue:1,duration:150,useNativeDriver:true}),Oe.delay(cn-450),Oe.timing(a,{toValue:0,duration:300,useNativeDriver:true})]).start()},[o,a]);let n=pl[t];return zt(Oe.View,{pointerEvents:"none",style:[Rt.toast,{opacity:a,borderColor:n+"60"}],children:[ue(M,{style:[Rt.toastDot,{backgroundColor:n}]}),ue(B,{style:Rt.toastText,numberOfLines:2,children:e})]})}function gl({app:e,config:t,visible:o,zIndex:a,onClose:n,onMinimize:r,initialModalState:i,enableSharedModalDimensions:s,bodyProps:d}){let u=e.component,[m,I]=kt(false),[g,D]=kt(""),[w,E]=kt(null),[z,P]=kt(null),R=nn(null),k=on(()=>{I(false),D("")},[]),v=on((q,le="info")=>{R.current&&clearTimeout(R.current),P(ae=>({message:q,type:le,nonce:(ae?.nonce??0)+1})),R.current=setTimeout(()=>P(null),cn)},[]);It(()=>()=>{R.current&&clearTimeout(R.current)},[]);let C=rl(()=>({search:m?g:"",isSearchActive:m,clearSearch:k,close:n,minimize:()=>r(),showToast:v,setHeaderOverride:E,instanceId:e.instanceId}),[g,m,k,n,r,v,e.instanceId]),F=w?.title??t.title??e.title??e.id,T=w?.subtitle??t.subtitle,A=w?.onBack,te=w?.actions??t.headerActions,K=w?.searchable??t.searchable;It(()=>{!K&&m&&k()},[K,m,k]);let J=s?an.modal.root():an.custom(e.id).modal(),ne=zt(at,{children:[A&&!m&&ue(at.Navigation,{onBack:A}),m?ue(at.Search,{value:g,onChangeText:D,onCancel:k,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):ue(at.Content,{title:F,subtitle:T}),zt(at.Actions,{children:[!m&&te,K&&!m&&ue(sl,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>I(true)})]})]});return ue(sn.Provider,{value:C,children:ue(il,{visible:o,onClose:n,onBack:A,onMinimize:r,initialModalState:i,zIndex:a,persistenceKey:J,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:ne,showToggleButton:true},disableScrollWrapper:true,styles:{},children:zt(M,{style:Rt.bodyRoot,children:[ue(ll,{children:ue(cl.Provider,{value:E,children:ue(u,{...d})})}),z&&ue(ml,{message:z.message,type:z.type,nonce:z.nonce})]})})})}var Rt=mt.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:rn.card,borderWidth:1,borderRadius:8,paddingHorizontal:12,paddingVertical:8,shadowColor:"#000",shadowOpacity:.4,shadowRadius:8,shadowOffset:{width:0,height:2},elevation:6},toastDot:{width:6,height:6,borderRadius:3},toastText:{flex:1,fontSize:12,color:rn.text}});import{useEffect as fl,useRef as hl}from"react";import{capacitorPlatform as yl,capacitorPlugin as bl}from"@buoy-gg/license/web";function vl(){return globalThis.__BUOY_HOLDS_BACK__===true}var Sl=99.5;function wl(){if(typeof document>"u")return false;let e=globalThis.Ionic;if(!e&&!document.querySelector("ion-app"))return false;try{return e?.config?.get?.("hardwareBackButton",true)!==false}catch{return true}}function xl(e,t){let o=hl(t);o.current=t,fl(()=>{if(!e||yl()!=="android")return;let a=globalThis;a.__BUOY_HOLDS_BACK__=true;let n;if(wl()){let r=i=>{i.detail?.register?.(Sl,()=>{o.current()})};document.addEventListener("ionBackButton",r),n=()=>document.removeEventListener("ionBackButton",r)}else{let r=bl("App");if(!r?.addListener){a.__BUOY_HOLDS_BACK__=false;return}let i=false,s=null;Promise.resolve(r.addListener("backButton",()=>o.current())).then(d=>{i?d.remove():s=d}).catch(()=>{}),n=()=>{i=true,s&&s.remove()}}return()=>{n(),a.__BUOY_HOLDS_BACK__=false}},[e])}import{Fragment as Cl,jsx as pe}from"react/jsx-runtime";var dn=Zs(null),un="@react_buoy_open_apps",Kt=44,Tl=12,Il=100,kl=16,zl=e=>({x:window.innerWidth-Kt-kl,y:window.innerHeight-Il-Kt-e*(Kt+Tl)}),pn=({children:e})=>{let[t,o]=tn([]),[a,n]=tn(false),r=nt([]),i=nt(null),s=nt(false),d=nt(false),u=nt(false),m=Re(v=>{let C="";return o(F=>{let{apps:T,instanceId:A}=ol(F,v,()=>`${v.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return C=A,T}),C},[]),I=Re(()=>{if(s.current||!d.current||!u.current)return;s.current=true;let v=i.current;if(!v||v.length===0){n(true);return}i.current=null,v.forEach(({id:C,minimized:F})=>{let T=r.current.find(A=>A.id===C);if(T&&T.component){let A=qo(T.icon,{slot:"dial",size:20,color:T.color});m({id:T.id,title:T.name,component:T.component,props:T.props,modal:T.modal,launchMode:T.launchMode||"self-modal",singleton:T.singleton??true,icon:A,color:T.color,minimized:F})}}),n(true)},[m]);Tt(()=>{let v=false;return(async()=>{try{let C=await en.getItem(un);if(v)return;if(C){let F=JSON.parse(C),T;Array.isArray(F)&&F.length>0&&(typeof F[0]=="string"?T=F.map(A=>({id:A,minimized:false})):T=F.filter(A=>typeof A=="object"&&A!==null&&typeof A.id=="string"),T.length&&(i.current=T))}}catch{}v||(d.current=true,I())})(),()=>{v=true}},[I]),Tt(()=>{if(!a)return;let v=t.map(C=>({id:C.id,minimized:C.minimized??false}));en.setItem(un,JSON.stringify(v))},[t,a]);let g=Re(v=>{r.current=v,u.current=true,I()},[I]),D=Re(v=>{o(C=>C.length?v?C.filter(F=>F.instanceId!==v):C.slice(0,-1):C)},[]),w=Re(()=>o([]),[]),E=Re((v,C)=>{o(F=>F.map(T=>T.instanceId===v?{...T,minimized:true,restoreState:C}:T))},[]),z=Re((v,C)=>{o(F=>F.map(T=>T.instanceId===v?{...T,minimized:false,restoreState:C??T.restoreState}:T))},[]),P=Re(v=>t.find(C=>C.instanceId===v)?.minimized??false,[t]),R=t.some(v=>v.launchMode!=="toggle-only"&&!v.minimized);Tt(()=>{if(!R)return;let v=C=>{if(C.key!=="Escape"||C.defaultPrevented)return;let F=[...t].reverse().find(T=>T.launchMode!=="toggle-only"&&!T.minimized);F&&D(F.instanceId)};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[R,D,t]),xl(t.length>0,()=>D());let k=tl(()=>({openApps:t,isAnyOpen:R,open:m,close:D,closeAll:w,registerApps:g,minimize:E,restore:z,isMinimized:P}),[t,R,m,D,w,g,E,z,P]);return pe(dn.Provider,{value:k,children:e})},it=()=>{let e=el(dn);return e||{openApps:[],isAnyOpen:false,open:()=>"",close:()=>{},closeAll:()=>{},registerApps:()=>{},minimize:()=>{},restore:()=>{},isMinimized:()=>false}},Rl=9e3,Ml={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},Bl={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Dl=({app:e,zIndex:t,onClose:o,onMinimize:a,minimizeTargetPosition:n,enableSharedModalDimensions:r})=>{let i=e.component,s=!e.minimized,d={...e.props??{},...r?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?pe("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:pe(gl,{app:e,config:e.modal,visible:s,zIndex:t,onClose:o,onMinimize:a,initialModalState:e.restoreState,enableSharedModalDimensions:r,bodyProps:d})}):e.launchMode==="self-modal"?pe("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:pe(i,{...d,visible:s,onClose:o,onRequestClose:o,onMinimize:a,minimizeTargetPosition:n,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?s?pe("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:pe(i,{...d,onClose:o,onMinimize:a,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:pe("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...Ml,zIndex:t,display:s?"flex":"none"},children:pe("div",{style:Bl,children:pe(i,{...d,onClose:o,onMinimize:a,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})})})},mn=()=>{let{openApps:e,close:t,minimize:o}=it(),{settings:a}=Yo();Tt(()=>{Qs(a.globalSettings?.expandableWindowControls!==false)},[a.globalSettings?.expandableWindowControls]);let n=e.filter(s=>s.launchMode!=="toggle-only");if(n.length===0)return null;let r=n.filter(s=>s.minimized).length,i=bi()??zl(r);return pe(Cl,{children:n.map((s,d)=>pe(Dl,{app:s,zIndex:Rl+d,onClose:()=>t(s.instanceId),onMinimize:u=>o(s.instanceId,u),enableSharedModalDimensions:a.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:i},s.instanceId))})};import{useCallback as El,useEffect as Vt,useRef as Al,useState as gn,useSyncExternalStore as fn}from"react";import{persistentStorage as hn,getToolAttention as qt,subscribeToolAttention as yn}from"@buoy-gg/shared-ui/web";import{jsx as me,jsxs as Mt}from"react/jsx-runtime";function Pl(e){return fn(yn,()=>qt(e),()=>qt(e))}var bn={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},vn={needsInput:3,failed:2,done:1},Sn=new Map;function wn(e){let t=null;for(let a of e?e.split("|"):[]){let n=qt(a);n&&(!t||vn[n.kind]>vn[t.kind])&&(t=n)}let o=Sn.get(e);return o&&t&&o.kind===t.kind&&o.label===t.label?o:!o&&!t?null:(Sn.set(e,t),t)}function Ol(e){let t=e.join("|");return fn(yn,()=>wn(t),()=>wn(t))}var xn=28,Gt=32,Jt=6,Cn=8,Tn=24,In="@react_buoy_minimized_stack_expanded",Ll=80,kn=2e3,Fl=6e3,$l="#1A1A1A",st="#888888";function zn({down:e=false}){return me("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:me("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:st,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function jl({id:e,title:t,icon:o,index:a,onPress:n}){let r=Pl(e),i=Al(null);return Vt(()=>{let s=true,d,u=()=>{i.current?.animate([{transform:"translateX(0) scale(1)",opacity:1,offset:0},{transform:"translateX(3px) scale(1.05)",opacity:.4,offset:.2},{transform:"translateX(-3px) scale(1.1)",opacity:1,offset:.4},{transform:"translateX(2px) scale(1.0)",opacity:.6,offset:.6},{transform:"translateX(-1px) scale(0.95)",opacity:1,offset:.8},{transform:"translateX(0) scale(1)",opacity:1,offset:1}],{duration:Ll,easing:"linear"})},m=I=>{let g=I?500+Math.random()*1500+a*200:kn+Math.random()*(Fl-kn)+a*300;d=setTimeout(()=>{s&&(u(),m(false))},g)};return m(true),()=>{s=false,clearTimeout(d)}},[a]),Mt("button",{type:"button","aria-label":r?`${t} \u2014 ${r.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:n,style:{width:Gt,height:Gt,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[me("div",{ref:i,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:o}),r?me("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${r.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:bn[r.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:r.kind==="needsInput"?"!":""}):null]})}function Hl({containerWidth:e=32}){let{openApps:t,restore:o}=it(),a=t.filter(g=>g.minimized&&g.launchMode!=="toggle-only"),[n,r]=gn(false),[i,s]=gn(false),d=Ol(a.map(g=>g.id));Vt(()=>{let g=false;return(async()=>{let D=await hn.getItem(In);!g&&D==="true"&&r(true),g||s(true)})(),()=>{g=true}},[]),Vt(()=>{i&&hn.setItem(In,n?"true":"false")},[n,i]);let u=El(g=>{o(g)},[o]);if(a.length===0)return null;let m=Cn+a.length*Gt+(a.length-1)*Jt+Jt+Tn+4,I={backgroundColor:$l,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${st}66`,borderLeft:`1px solid ${st}66`,borderRight:`1px solid ${st}66`,borderBottom:"none",boxSizing:"border-box"};return Mt("div",{style:{height:xn,overflow:"visible",position:"relative"},children:[me("div",{style:{position:"absolute",bottom:"var(--buoy-stack-bottom, 0px)",top:"var(--buoy-stack-top, auto)",left:0,width:e,maxHeight:"var(--buoy-stack-space, calc(100vh - 48px))",visibility:n?"visible":"hidden",height:n?m:0,opacity:n?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:n?"auto":"none",...I},children:Mt("div",{style:{height:m,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:Cn,gap:Jt,boxSizing:"border-box"},children:[n&&[...a].reverse().map((g,D)=>me(jl,{id:g.id,title:g.title||g.id,icon:g.icon??me("span",{style:{color:"#fff",fontSize:13},children:(g.title||g.id).slice(0,1).toUpperCase()}),index:D,onPress:()=>u(g.instanceId)},g.instanceId)),me("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>r(false),style:{width:"100%",height:Tn,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:me(zn,{down:true})})]})}),Mt("button",{type:"button","aria-label":`Show ${a.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:n?-1:0,"aria-hidden":n,onClick:()=>r(true),style:{position:"absolute",bottom:0,left:0,width:e,height:xn,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:n?0:1,transform:n?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:n?"none":"auto",...I},children:[me(zn,{}),d?me("span",{"aria-hidden":true,"data-testid":"buoy-dock-peek-attention",style:{position:"absolute",top:2,right:2,minWidth:11,height:11,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:bn[d.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.kind==="needsInput"?"!":""}):null,a.length>1&&me("span",{style:{fontSize:9,fontWeight:600,color:st,marginLeft:1},children:a.length})]})]})}import{registerToolModules as Wl}from"@buoy-gg/shared-ui/web";import{createElement as _l}from"react";function lt(e){let t=e.icon;return{...e,icon:typeof t=="function"?o=>_l(t,{size:o,slot:e.slot??"both",color:e.color}):()=>t}}import{createContext as Nl,useContext as Ul,useState as Rn,useMemo as Mn}from"react";import{jsx as Kl}from"react/jsx-runtime";var Bn=Nl(null);function Dn({children:e}){let[t,o]=Rn(false),[a,n]=Rn(false),r=Mn(()=>t||a,[t,a]),i=Mn(()=>({isDialOpen:t,isToolOpen:a,isDevToolsActive:r,setDialOpen:o,setToolOpen:n}),[t,a,r]);return Kl(Bn.Provider,{value:i,children:e})}function Xt(){let e=Ul(Bn);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:()=>{},setToolOpen:()=>{}}}import*as Vl from"@buoy-gg/license/web";import*as ql from"@buoy-gg/shared-ui/web";import*as Gl from"@buoy-gg/shared-ui/web/dataViewer";function En(e){Wl({core:{useDevToolsVisibility:Xt},license:Vl,"shared-ui":ql,"shared-ui/dataViewer":Gl,...e});let t=new Set;return Object.values(e).flatMap(o=>Object.entries(o).flatMap(([a,n])=>!a.endsWith("Preset")||!n||typeof n.id!="string"||!n.component||t.has(n.id)?[]:(t.add(n.id),[lt(n)])))}import{useEffect as Bt,useMemo as Dt,useRef as Jl}from"react";import{LicenseManager as Xl,installCapacitorBridge as Yl,resolveDevBuild as An,useLicense as Ql}from"@buoy-gg/license/web";import{registerToolAdapters as Zl}from"@buoy-gg/shared-ui/web";function Pn(e){return typeof e=="object"&&e!==null?e:void 0}function ec({isDevelopment:e,isLicensed:t,externalSync:o,isAvailable:a}){if(o===false||!a)return false;if(e)return true;let n=Pn(o);return t&&n?.enableInRelease===true&&Ln(n.socketURL,n)===null}var On="http://localhost:42831";function tc(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}function Ln(e,t){let o=e??On;if(t?.allowInsecureNetwork===true)return null;let a;try{a=new URL(o)}catch{return`[Buoy] externalSync.socketURL "${o}" isn't a valid URL, so this release build won't connect to Buoy Desktop.`}return a.protocol==="https:"||a.protocol==="wss:"||tc(a.hostname)?null:`[Buoy] This release build won't connect to ${o}: release sync carries real user data, and plain http to another machine is readable by anyone on the same network. Use a simulator, an emulator or adb reverse (localhost), an https:// broker, or set externalSync.allowInsecureNetwork: true for a network you trust.`}var oc={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function nc(e,t,o){if(t)return e;let a=null;for(let[n,r]of Object.entries(oc)){if(o?.includes(n))continue;let i=e[n];if(!i?.actions)continue;let s={...i.actions};for(let d of r)d in s&&(s[d]=()=>{throw new Error(`${n}.${d} is off in release builds. To allow it from Buoy Desktop and the MCP, pass externalSync={{ enableInRelease: true, releaseActions: ["${n}"] }}.`)});a??(a={...e}),a[n]={...i,actions:s}}return a??e}import{useEffect as ac,useMemo as rc,useState as ic}from"react";import{devToolsStorageKeys as sc,persistentStorage as lc}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as cc}from"@buoy-gg/license/web";var dc=8;function uc(){let e="";for(;e.length<dc;)e+=(Math.random()*16|0).toString(16);return e}function pc(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function mc({appName:e,hardwareName:t,platform:o,installId:a,deviceId:n}){let r=pc(e??"buoy")||"buoy",i=e??"Buoy Device",s=t?.trim()||o;return n?{deviceId:n,deviceName:`${i} (${s})`}:{deviceId:`${r}-${o}-${a}`,deviceName:`${i} (${s} \xB7 ${a.slice(-4)})`}}function gc(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}function fc(){let e=globalThis;try{return e.localStorage??null}catch{return null}}async function hc({platform:e=Ue.OS,store:t,mint:o=uc}={}){let a=sc.sync.deviceId(),n=t===void 0?cc()?fc():e==="web"?gc():lc:t;if(!n)return o();try{let r=await n.getItem(a);if(r&&r.length>0)return r;let i=o();return await n.setItem(a,i),i}catch{return o()}}var Yt=null;function yc(){return Yt||(Yt=hc()),Yt}function bc(e,t){let o=e?.deviceId,a=e?.deviceName,n=t.loadId??yc,r=t.platform??Ue.OS,[i,s]=ic(null);return ac(()=>{if(o)return;let d=false;return n().then(u=>{d||s(u)}),()=>{d=true}},[o,n]),rc(()=>{if(!o&&!i)return null;let d=mc({appName:t.appName,hardwareName:t.hardwareName,platform:r,installId:i??"",deviceId:o});return a?{...d,deviceName:a}:d},[o,a,i,t.appName,t.hardwareName,r])}import{useEffect as vc,useState as Sc}from"react";import{capacitorPlatform as wc,capacitorPlugin as Et,isCapacitorNative as xc}from"@buoy-gg/license/web";function Cc(e,t){if(t==="ios")return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":null;let o=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(e)?.[1]?.trim();return!o||o==="K"?null:o}function Tc(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}function Fn(){return typeof navigator>"u"?"":navigator.userAgent??""}function Qt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}var $n="@react_buoy_capacitor_app_name";function Ic(e){try{let t=globalThis.localStorage;if(!t)return e;let o=t.getItem($n);if(o)return o;e&&t.setItem($n,e)}catch{}return e}function kc(){let e=wc();if(!e)return{platform:"web",appName:Qt(),hardwareName:"Browser",ready:true};let t=!!Et("App");return{platform:e,appName:t?Qt():Ic(Qt()),hardwareName:Cc(Fn(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Et("Device")}}function zc(){let[e,t]=Sc(kc);return vc(()=>{if(!xc())return;let o=false,a=Et("App"),n=Et("Device");return Promise.all([a?.getInfo?.().catch(()=>null)??null,n?.getInfo?.().catch(()=>null)??null]).then(([r,i])=>{if(o)return;let s=r?.name?.trim(),d=i?.name?.trim()||i?.model?.trim();t(u=>({...u,appName:s||u.appName,hardwareName:d||u.hardwareName,ready:true}))}),()=>{o=true}},[]),e}function jn(){if(typeof location>"u")return null;let e=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:Fn(),serverUrl:typeof e=="string"?e:null}}function Hn(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}function Rc(e,t){if(e==="ios"){let o=Hn(t.serverUrl);return o?o===Hn(t.origin):t.protocol==="capacitor:"}return Wn.has(t.hostname)}var Wn=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Mc(e,t,o,a=jn()){if(o==="web"||!a)return e;let n;try{n=new URL(e)}catch{return e}let r=Rc(o,a);return!t&&r&&n.hostname===a.hostname&&(n.hostname="localhost"),o==="android"&&Wn.has(n.hostname)&&Tc(a.userAgent)&&(n.hostname="10.0.2.2"),n.toString().replace(/\/$/,"")}function Bc(e,t,o=jn()){return t!=="android"||!o||o.protocol!=="https:"||!/^(http|ws):/i.test(e)?null:`[Buoy] Can't reach Buoy Desktop at ${e}. This Android WebView serves the app from https://${o.hostname} and blocks plain http/ws by default. For debug builds, set android.allowMixedContent: true and server.cleartext: true in capacitor.config, then run cap sync.`}import{getDevServerOrigin as Dc,resolveReloadStrategy as Ec,scheduleReloadApp as Ac}from"@buoy-gg/shared-ui/web";var _n=Date.now(),Nn=Dc(),Pc={platform:Ue.OS,isTV:Ue.isTV===true,isTVOS:Ue.isTVOS===true},Un={version:3,getSnapshot:()=>{let e=Ec("auto");return{startedAt:_n,devServerOrigin:Nn,device:Pc,reload:{available:e!==null,strategy:e}}},subscribe:e=>()=>{},actions:{ping:()=>({ok:true,startedAt:_n,devServerOrigin:Nn}),reloadApp:e=>{let t=e??{},{strategy:o,delayMs:a}=Ac({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:o,delayMs:a}}}};import{Fragment as Oc,jsx as He,jsxs as Lc}from"react/jsx-runtime";var Fc=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],$c=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function jc(e){let t=Dt(()=>Object.fromEntries(Object.entries(e.modules).map(([a,n])=>[a.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),n])),[e.modules]),o=t["react-query"];return o?.useReactQuerySyncAdapter?He(Hc,{...e,modules:t,query:o}):He(Kn,{...e,modules:t})}function Hc(e){let t=e.query.useReactQuerySyncAdapter();return He(Kn,{...e,queryAdapter:t})}function Kn({modules:e,apps:t,requiredEnvVars:o,externalSync:a,headless:n,sentryGetClient:r,queryAdapter:i}){let{isPro:s,tier:d}=Ql(),u=Dt(()=>{let z={app:Un};for(let[P,R]of Object.entries(e))for(let[k,v]of Object.entries(R))k.endsWith("SyncAdapter")&&v&&typeof v=="object"&&(z[P]=v);i&&(z.query=i),e.env?.createEnvSyncAdapter&&(z.env=e.env.createEnvSyncAdapter(o??[]));for(let P of t??[])P.sync&&(z[`custom:${P.id}`]=P.sync);return z},[e,t,o,i]),m=Jl(u);m.current=u,Bt(()=>Zl(()=>m.current),[]),Bt(()=>{let z=[],P=R=>{let k=R?.();typeof k=="function"&&z.push(k)};return P(e.network?.startNetworkCapture),P(e.storage?.startBrowserStorageCapture),P(e.assets?.startBrowserAssetCapture),An(typeof Ke<"u"?Ke:process.env.NODE_ENV!=="production")&&P(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&P(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&P(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let R of z.reverse())R()}},[e]);let I=e["external-sync"],g=An(typeof Ke<"u"?Ke:process.env.NODE_ENV!=="production"),D=ec({isDevelopment:g,isLicensed:s,externalSync:a,isAvailable:!!I}),w=Pn(a);Yl({release:!g&&!!w?.enableInRelease}),!g&&w?.enableInRelease&&qn(Ln(w.socketURL,w));let E=e.sentry?.SentryRoot;return Lc(Oc,{children:[Object.entries(e).flatMap(([z,P])=>Fc.map(R=>{let k=P[R];return k?He(k,{},`${z}:${R}`):null})),E&&He(E,{getClient:r}),Object.entries(e).flatMap(([z,P])=>$c.map(R=>{let k=P[R];return k&&(!n||R==="ScenariosOverlay"||R==="ImpersonateOverlay")?He(k,{},`${z}:${R}`):null})),D&&He(Wc,{module:I,tools:u,options:w,isPro:s,tier:d,dev:g})]})}var Vn=null;function qn(e){!e||e===Vn||(Vn=e,console.warn(e))}function Wc({module:e,tools:t,options:o,isPro:a,tier:n,dev:r}){let i=zc(),s=bc(o,{appName:i.appName,hardwareName:i.hardwareName,platform:i.platform}),d=Dt(()=>Mc(o?.socketURL??(r?e.getDefaultSocketURL():On),!!o?.socketURL,i.platform),[o?.socketURL,r,e,i.platform]),{socket:u}=e.useExternalSyncSocket({deviceName:s?.deviceName??"Buoy Browser",socketURL:d,persistentDeviceId:i.ready?s?.deviceId??null:null,platform:i.platform,extraDeviceInfo:i.extraDeviceInfo,enableLogs:o?.enableLogs});Bt(()=>{let g=Bc(d,i.platform);if(!u||!g)return;let D=()=>qn(g);return u.on("connect_error",D),()=>{u.off("connect_error",D)}},[u,d,i.platform]),Bt(()=>{if(!u)return;let g=()=>{u.connected&&Xl.hasAccountAccess()&&u.emit("device-license",{isPro:a?"1":"0",tier:n})};return g(),u.on("connect",g),()=>{u.off("connect",g)}},[u,a,n]);let m=o?.releaseActions?.join(",")??"",I=Dt(()=>nc(t,r,m?m.split(","):void 0),[t,r,m]);return e.useExternalSync({tools:I,socket:u,deviceId:i.ready?s?.deviceId??null:null,enableLogs:o?.enableLogs}),null}import{useState as Gn}from"react";import{createPortal as _c}from"react-dom";import{useBuoySession as Nc}from"@buoy-gg/license/web";import{Fragment as Jn,jsx as ct,jsxs as Xn}from"react/jsx-runtime";var Yn="#20C997";function Uc(){let{status:e,signIn:t,signOut:o}=Nc(),[a,n]=Gn(false),[r,i]=Gn(null);if(typeof document>"u")return null;let s=()=>{i(null),n(true),t().catch(u=>i(u instanceof Error?u.message:"Sign-in did not work. Try again.")).finally(()=>n(false))},d=e.state==="active";return _c(ct("div",{"data-buoy-signin":"",style:{position:"fixed",right:"max(16px, env(safe-area-inset-right))",bottom:"max(20px, env(safe-area-inset-bottom))",zIndex:99999,maxWidth:"min(320px, calc(100vw - 32px))",padding:d||r?"12px 14px":0,borderRadius:16,background:d||r?"#0f1419":"transparent",color:"#e6edf3",boxShadow:d||r?"0 10px 30px rgba(0,0,0,.35)":"none",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",fontSize:14,lineHeight:1.45},children:d?Xn(Jn,{children:[ct("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),ct("button",{type:"button",onClick:()=>void o(),style:Kc,"data-testid":"buoy-signout",children:"Sign out"})]}):Xn(Jn,{children:[r?ct("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:r}):null,ct("button",{type:"button",onClick:s,disabled:a,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:Yn,color:"#04130d",fontWeight:600,fontSize:14,cursor:a?"wait":"pointer",boxShadow:"0 8px 24px rgba(0,0,0,.3)"},children:a?"Signing in\u2026":"Sign in to Buoy"})]})}),document.body)}var Kc={marginTop:8,padding:0,border:"none",background:"none",color:Yn,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useCallback as Vc,useEffect as Qn,useRef as qc,useState as Zt}from"react";import*as Gc from"@buoy-gg/license/web";import{AccountSetupButton as Jc,QrCodeView as Xc,monoFont as Yc,night as se}from"@buoy-gg/shared-ui/web";import{Fragment as Zn,jsx as _,jsxs as ve}from"react/jsx-runtime";function At(){try{return Gc.SessionManager}catch{return}}var Qc=e=>e.replace(/^https?:\/\//,"");function Zc(){let[e,t]=Zt(()=>At()?.getStatus().state??"signed_out");return Qn(()=>{let o=At();if(!o)return;let a=()=>t(o.getStatus().state);return a(),o.subscribe(a)},[]),e}function ea({needsPlan:e=false}){let[t,o]=Zt(false),a=Zc();return ve(M,{pointerEvents:"box-none",style:N.root,children:[_(Jc,{expanded:t,onPress:()=>o(true)}),t?_(pr,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>o(false),children:ve(M,{style:N.overlay,accessibilityViewIsModal:true,children:[_(pt,{style:mt.absoluteFill,onPress:()=>o(false),accessible:false}),e&&a==="active"?_(td,{onClose:()=>o(false)}):_(ed,{onClose:()=>o(false)})]})}):null]})}function ta({onClose:e}){return ve(M,{style:N.header,children:[ve(M,{style:N.brand,children:[_(M,{style:N.brandDot}),_(B,{style:N.wordmark,children:"BUOY"})]}),_(pt,{accessibilityRole:"button",accessibilityLabel:"Close sign-in",onPress:e,style:N.close,testID:"buoy-signin-close",children:_(B,{style:N.closeText,children:"\u2715"})})]})}function ed({onClose:e}){let[t,o]=Zt({kind:"starting"}),a=qc(null),n=Vc(()=>{a.current?.abort();let r=At();if(!r?.signInWithCode){o({kind:"error",message:"This version of @buoy-gg/license can't sign in with a code. Update it."});return}let i=new AbortController;a.current=i,o({kind:"starting"}),r.signInWithCode(s=>o({kind:"waiting",prompt:s}),{signal:i.signal}).then(()=>{i.signal.aborted||e()}).catch(s=>{i.signal.aborted||o({kind:"error",message:s instanceof Error?s.message:"Sign-in did not work. Try again."})})},[e]);return Qn(()=>(n(),()=>a.current?.abort()),[n]),ve(M,{style:N.card,testID:"buoy-code-signin",children:[_(ta,{onClose:e}),_(B,{style:N.title,children:"Sign in to Buoy"}),t.kind==="starting"?_(M,{style:N.center,children:_(oo,{color:se.color.accent})}):null,t.kind==="waiting"?ve(Zn,{children:[_(B,{style:N.body,children:"Scan this with your phone's camera."}),_(M,{style:N.qr,testID:"buoy-signin-qr",children:_(Xc,{value:t.prompt.verificationUriComplete,size:196})}),ve(B,{style:N.body,children:["Or go to ",_(B,{style:N.strong,children:Qc(t.prompt.verificationUri)})," and type:"]}),_(B,{style:N.code,selectable:true,testID:"buoy-signin-code",children:t.prompt.userCode}),ve(M,{style:N.waiting,children:[_(oo,{size:"small",color:se.color.textSecondary}),_(B,{style:N.muted,children:"Waiting for you to allow it\u2026"})]})]}):null,t.kind==="error"?ve(Zn,{children:[_(B,{style:N.body,testID:"buoy-signin-error",children:t.message}),_(pt,{accessibilityRole:"button",onPress:n,style:({pressed:r})=>[N.primary,r&&N.primaryPressed],testID:"buoy-signin-retry",children:_(B,{style:N.primaryText,children:"Get a new code"})})]}):null]})}function td({onClose:e}){return ve(M,{style:N.card,testID:"buoy-signin-needs-plan",children:[_(ta,{onClose:e}),_(B,{style:N.title,children:"You're signed in"}),_(B,{style:N.body,children:"Buoy in this build needs a Pro or Business plan."}),_(pt,{accessibilityRole:"button",onPress:()=>void At()?.signOut(),style:({pressed:t})=>[N.primary,t&&N.primaryPressed],testID:"buoy-signout",children:_(B,{style:N.primaryText,children:"Sign out"})})]})}var N=mt.create({root:{position:"absolute",bottom:30,right:16,zIndex:99999},overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20},card:{width:"100%",maxWidth:368,backgroundColor:"#111315",borderColor:"#303437",borderWidth:1,borderRadius:20,paddingHorizontal:24,paddingTop:18,paddingBottom:24},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:16},brand:{flexDirection:"row",alignItems:"center",gap:8},brandDot:{width:6,height:6,borderRadius:3,backgroundColor:se.color.accent},wordmark:{color:se.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},close:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},closeText:{color:se.color.textSecondary,fontSize:14},title:{color:se.color.text,fontSize:20,fontWeight:"700",marginBottom:8},body:{color:se.color.textSecondary,fontSize:14,lineHeight:20,marginTop:8},strong:{color:se.color.text,fontWeight:"600"},muted:{color:se.color.textSecondary,fontSize:13},center:{paddingVertical:32,alignItems:"center"},qr:{alignSelf:"center",marginTop:16,marginBottom:8,borderRadius:12,overflow:"hidden"},code:{color:se.color.text,fontFamily:Yc,fontSize:30,fontWeight:"700",letterSpacing:4,textAlign:"center",marginTop:12},waiting:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,marginTop:16},primary:{marginTop:20,minHeight:44,borderRadius:12,backgroundColor:se.color.accent,alignItems:"center",justifyContent:"center"},primaryPressed:{backgroundColor:se.color.accentPressed},primaryText:{color:se.color.onAccent,fontSize:15,fontWeight:"600"}});function oa(e){if(e.length>6){let t=e.map(o=>`"${o}"`).join(", ");return e.slice(0,6)}return e}import{Fragment as eo,jsx as j,jsxs as dt}from"react/jsx-runtime";var na={},aa="@react_buoy_floating_menu_tooltip_shown",od=Le;function nd({size:e=14,color:t="#20C997"}){let o=Math.max(2,e/4),a=Math.max(1,e/16);return j("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${o}px)`,gap:a,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((n,r)=>j("div",{style:{width:o,height:o,borderRadius:o/2,backgroundColor:t}},r))})}function ad(e){let{defaultFloatingTools:t,defaultDialTools:o,disableHints:a=false,children:n}=e,r=ye(()=>o&&oa(o),[o]);return j(Uo,{defaultFloatingTools:t,defaultDialTools:r,children:j(ri,{disableHints:a,children:dt(Dn,{children:[j(pn,{children:j(dd,{...e})}),n]})})})}var rd=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function id({modules:e=na}){return j(eo,{children:Object.entries(e).flatMap(([t,o])=>rd.map(a=>{let n=o[a];return n?j(n,{},`${t}:${a}`):null}))})}function sd(){let{openApps:e,restore:t}=it();return oe(()=>si(o=>{let a=e.find(n=>n.id===o);return a?(t(a.instanceId),true):false}),[e,t]),null}function ld(){let e=ti();return ii((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}function cd(e,t,o,a){let n=u=>Object.entries(e).find(([m])=>m.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===u)?.[1],r=[],i=n("env");t?.length&&i?.createEnvTool&&i.createEnvVarConfig&&r.push(lt(i.createEnvTool({requiredEnvVars:i.createEnvVarConfig(t)})));let s=n("storage");o?.length&&s?.createStorageTool&&r.push(lt(s.createStorageTool({requiredStorageKeys:o})));let d=n("ask-buoy");return a&&d?.createAskBuoyTool&&r.push(lt(d.createAskBuoyTool(a))),r}function dd({environment:e,userRole:t="admin",availableEnvironments:o,onEnvironmentSwitch:a,apps:n,modules:r=na,externalSync:i,requiredEnvVars:s,sentryGetClient:d,disableHints:u=false,headless:m=false,hidden:I=false,defaultFloatingTools:g,defaultDialTools:D,zustandStores:w,requiredStorageKeys:E,askBuoy:z}){let P=e??ld(),R=ye(()=>D?oa(D):void 0,[D]),[k,v]=Pt(false),[C,F]=Pt(false),T=ci(false),A=it(),te=ye(()=>cd(r,s,E,z),[r,s,E,z]),K=ye(()=>so([...En(r),...n??[],...te]),[n,r,te]),J=ye(()=>Object.entries(r).find(([c])=>c.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[r]);oe(()=>{if(!w||typeof J?.watchStores!="function")return;let c=J.watchStores(w);return typeof c=="function"?c:void 0},[w,J]);let ne=Xt(),q=A.openApps.some(c=>!c.minimized);oe(()=>{ne.setDialOpen(k)},[k,ne.setDialOpen]),oe(()=>{ne.setToolOpen(q||C)},[q,C,ne.setToolOpen]);let{registerApps:le}=A;oe(()=>{le(K.map(c=>{let U=c.icon;return{...c,icon:typeof U=="function"?({size:b})=>U(b):U}}))},[le,K]);let ae=ye(()=>K.map(c=>({id:c.id,name:c.name,description:c.description,slot:c.slot})),[K]);di({availableTools:ae,storage:od}),oe(()=>{let c=false;return(async()=>{let[U,b]=await Promise.all([Le.getItem(ft.dial.isOpen()),Le.getItem(ft.settings.modalOpen())]);c||(U==="true"&&v(true),b==="true"&&(v(true),F(true)),T.current=true)})(),()=>{c=true}},[]),oe(()=>{T.current&&Le.setItem(ft.dial.isOpen(),k?"true":"false")},[k]),oe(()=>{T.current&&Le.setItem(ft.settings.modalOpen(),C?"true":"false")},[C]);let Ce=Ve(c=>{if(rs(c.id),c.launchMode==="toggle-only"){c.onPress?.();return}if(c.component){let U=typeof c.icon=="function"?c.icon(20):c.icon;A.open({id:c.id,title:c.name||gt(c.id),component:c.component,props:c.props,modal:c.modal,launchMode:c.launchMode||"self-modal",singleton:c.singleton??true,icon:U,color:c.color||io(c.id)})}else c.onPress?.()},[A]),ce=ye(()=>Ot(K,"dial").map(c=>{let U=c.color||io(c.id),b;return typeof c.icon=="string"?b=c.icon:typeof c.icon=="function"?b=c.icon(32):b=null,{id:c.id,name:c.name||gt(c.id),icon:b,unavailable:!c.component&&!c.onPress,color:U,onPress:()=>{Ce(c),v(false)}}}),[K,Ce]),Me=ye(()=>{if(!k)return ce;let c=new Map(ce.map(U=>[U.id,U]));return as(ce.map(U=>U.id)).map(U=>c.get(U)).filter(U=>!!U)},[k,ce]),{settings:H}=Yo(),Ye=ye(()=>Ot(K,"row").filter(c=>(H.floatingTools[c.id]??false)===true&&(c.component||c.onPress)),[K,H.floatingTools]),Be=ye(()=>K.map(c=>({id:c.id,name:c.name||gt(c.id),description:c.description||ui(c.id),slot:c.slot,icon:c.icon,color:c.color})),[K]),[We,De]=Pt(false),de=A.openApps.some(c=>!c.minimized);oe(()=>{if(u)return;let c=false,U=setTimeout(async()=>{let b=await Le.getItem(aa);!c&&!b&&De(true)},1e3);return()=>{c=true,clearTimeout(U)}},[u]);let Y=Ve(()=>{De(false),Le.setItem(aa,"true")},[]),Te=Ve(()=>{Y(),v(true)},[Y]),fe=Ve(()=>{v(false),F(false)},[]),Ee=Ve(()=>{F(c=>!c)},[]),_e=Ve(()=>F(false),[]),Se=!!(o?.length&&a),Ae=H.floatingTools.environment!==false,ge=We&&!k&&!de&&!I;oe(()=>{if(!ge)return;let c=b=>{(!(b.target instanceof Element)||!b.target.closest("[data-buoy-root]"))&&Y()},U=b=>{b.key==="Escape"&&Y()};return document.addEventListener("pointerdown",c,true),document.addEventListener("keydown",U),()=>{document.removeEventListener("pointerdown",c,true),document.removeEventListener("keydown",U)}},[ge,Y]);let we=A.openApps.some(c=>c.minimized&&c.launchMode!=="toggle-only"),Pe=j(jc,{modules:r,apps:n,requiredEnvVars:s,externalSync:i,headless:m,sentryGetClient:d});return m?Pe:dt("div",{"data-buoy-root":"",style:{display:"contents"},children:[Pe,j(sd,{}),ge&&j("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),j("div",{style:I?{visibility:"hidden"}:{display:"contents"},"aria-hidden":I||void 0,children:dt(lo,{enablePositionPersistence:!ge,pushToSide:k||de,suspendPointerEvents:k,centerOnboarding:ge,minimizedStack:we?j(Hl,{}):void 0,hasMinimizedStack:we,children:[P&&Ae&&!Se&&j(pi,{environment:P}),Se&&Ae&&j(mi,{currentEnvironment:P??"local",availableEnvironments:o,onSelect:a}),t?j(co,{userRole:t,onPress:Te}):j("button",{"aria-label":"Open dev tools",onClick:Te,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:j(nd,{})}),Ye.map(c=>j("button",{"aria-label":c.name||gt(c.id),title:c.description,onClick:()=>Ce(c),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof c.icon=="function"?c.icon(16):c.icon},c.id))]})}),ge&&j(Io,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:Y}),k&&!I&&j(Bo,{icons:Me,onClose:fe,centerLabel:"BUOY",onCenterPress:Ee,settingsOpen:C,hintsDisabled:u}),C&&!I&&j(Zo,{visible:true,onClose:_e,availableTools:Be,defaultFloatingTools:g,defaultDialTools:R,onSettingsChange:c=>{}}),!I&&dt(eo,{children:[j(mn,{}),j(Jr,{})]})]})}function ud(e){let t=e&&typeof e=="object"?e.appId:void 0,o=!!e;oe(()=>{if(!o)return;let a=false,n=Xr.SessionManager;if(!n)return;let r=i=>{a||!i||(n.configure({audience:`app:${i}`}),n.load().catch(()=>{}))};return t?r(t):ni().then(i=>r(i?.bundleId)).catch(()=>{}),()=>{a=true}},[o,t])}function pd(e){let{access:t,isPro:o,licenseKey:a}=Qr();oe(()=>{Yr.configure(e.licenseKey)},[e.licenseKey]);let n=e.licenseKey===void 0||Zr(e.licenseKey,a),r=ei(typeof Ke<"u"?Ke:process.env.NODE_ENV!=="production"),i=n&&t.status==="admitted";oe(()=>{i&&li()},[i]),oe(()=>{r||t.status==="initializing"||(o&&i?Gr():ao())},[r,o,i,t.status]);let s=oi();return ud(s?e.signIn:void 0),!r&&!o?!e.signIn||e.headless?null:s?j(ea,{needsPlan:true}):j(Uc,{}):i?j(ad,{...e}):dt(eo,{children:[t.status==="initializing"&&j(id,{modules:e.modules}),e.headless?null:e.signIn&&s?j(ea,{}):j(ai,{})]})}import{useSettings as md,useFloatingTools as gd,getToolLabel as fd,getToolDescription as hd,getToolColor as yd,settingsColors as bd,settingsStyles as vd,dialColors as Sd,dialStyles as wd}from"@buoy-gg/floating-tools-react/web";import{LicenseManager as xd}from"@buoy-gg/license/web";export{Ka as Activity,pa as AlertCircle,qa as AlertTriangle,pn as AppHostProvider,mn as AppOverlay,kr as Badge,ga as BarChart3,va as BaseEventStore,ha as Bookmark,Ja as Bug,Lr as Button,Ur as Card,Ya as Check,Za as CheckCircle,Qa as CheckSquare,tr as ChevronDown,nr as ChevronLeft,rr as ChevronRight,ra as ChevronUp,sr as Clock,ba as Cloud,sa as CollapsibleSection,lr as Copy,$r as CopyButton,ya as DataViewer,cr as Database,Dn as DevToolsVisibilityProvider,Bo as DialMenu,Er as DiffViewer,yi as Divider,Sa as Download,xa as Edit3,ua as EmptyState,fa as EventStepperFooter,dr as Eye,ur as EyeOff,mr as FileJson,gr as FileText,fr as Filter,hr as FlaskConical,pd as FloatingDevTools,lo as FloatingTools,Ta as GitBranch,yr as Globe,ka as HardDrive,br as Hash,Ra as HelpCircle,Ba as Home,Ea as Image,vr as Info,Br as InfoRow,Na as JsModal,wr as Key,Cr as Layers,xd as LicenseManager,Pa as Link,Ir as Lock,La as Maximize2,$a as Minus,Ha as Palette,zr as Pause,_a as Pin,Mr as Play,Dr as Plus,Ar as Power,Hr as PowerToggle,Or as RefreshCw,wa as RelativeTime,Ua as Route,_r as Row,Fr as Search,ma as SearchBar,Vr as SectionHeader,Va as Server,jr as Settings,Zo as SettingsModal,Wr as Shield,Ga as Smartphone,Xa as Square,Rr as StatusDot,ca as TabSelector,er as Timer,Nr as Trash2,or as Unlock,ar as Upload,Kr as User,co as UserStatus,ir as Users,qr as Wifi,la as X,ia as XCircle,da as Zap,Un as appSyncAdapter,fi as autoDiscoverWebPresets,so as autoDiscoverWithCustom,ao as clearReleaseOptIn,Wa as copyToClipboard,lt as createWebTool,En as createWebTools,gi as defaultToolPresets,Fa as devToolsStorageKeys,Sd as dialColors,wd as dialStyles,Ca as formatBytes,Ia as formatDuration,za as formatNumber,hi as getEnabledTools,yd as getToolColor,hd as getToolDescription,fd as getToolLabel,Ot as getToolsBySlot,vl as isBuoyHoldingBackButton,xr as methodColor,Oa as persistentStorage,Da as safeStringify,bd as settingsColors,vd as settingsStyles,Sr as statusColor,Pr as toolTheme,Ma as truncateMiddle,Tr as typeColor,it as useAppHost,Xt as useDevToolsVisibility,gd as useFloatingTools,Aa as usePersistedState,ja as useSafeAreaInsets,md as useSettings,ul as useToolHeader,ln as useToolHost};
|
|
10
|
+
`,document.head.appendChild(e),yo=true}var At=We.accent;function bo({title:e,message:t,onDismiss:o,showArrow:a=true}){let[n,i]=mo(false),[r,c]=mo(false);jr(()=>{Wr();let u=requestAnimationFrame(()=>i(true));return()=>cancelAnimationFrame(u)},[]);let d={fontFamily:fo,textTransform:"uppercase"};return Ue("div",{style:{position:"fixed",left:"50%",bottom:_r(),transform:`translateX(-50%) scale(${n?1:.8})`,opacity:n?1:0,transition:"transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1), opacity 300ms ease",zIndex:10002,pointerEvents:"auto"},children:ho("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ue("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),ho("div",{style:{position:"relative",maxWidth:280,backgroundColor:We.dialBackground,borderRadius:16,border:`1px solid ${We.dialBorder}`,padding:20,boxShadow:`0 0 20px ${go(We.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ue("span",{style:{...d,fontSize:16,fontWeight:900,letterSpacing:1,color:At,textAlign:"center"},children:e}),Ue("span",{style:{fontFamily:fo,fontSize:13,lineHeight:"20px",color:We.centerText,textAlign:"center"},children:t}),Ue("button",{onClick:o,onPointerDown:()=>c(true),onPointerUp:()=>c(false),onPointerLeave:()=>c(false),onPointerCancel:()=>c(false),style:{...d,marginTop:8,borderRadius:8,border:"none",backgroundColor:At,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:r?.7:1,transform:r?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),a&&Ue("div",{style:{position:"absolute",left:"50%",bottom:Hr,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${Nr}px solid ${At}`,filter:`drop-shadow(0 0 10px ${go(We.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}import{Fragment as Ur,jsx as P,jsxs as be}from"react/jsx-runtime";var Kr={x:.5,y:.5},vo="@react_buoy_settings_tooltip_shown",So=false;function Vr(){if(So||typeof document>"u")return;let e=document.createElement("style");e.textContent=br(),document.head.appendChild(e),So=true}var Ke=e=>1-Math.pow(1-e,3),Dt=e=>e*e*e;function qr({icon:e,index:t,totalIcons:o,position:a,progress:n,onPress:i}){let[r,c]=Q(false),[d,u]=Q(false),m=!e.icon&&e.id.startsWith("empty-"),I=!m&&e.unavailable===true,g=!m&&!I,{icons:M}=ao,w=hr(t,o),R=0;n<=w[1]?R=0:n<=w[2]?R=(n-w[1])/(w[2]-w[1]):R=1,R=Math.max(0,Math.min(1,R));let z=yr,D=M.pressIn.scale,B=R*(d?D:r?1.1:1),k=0;R<=0?k=0:R<=.3?k=R:k=.3+(R-.3)*(.7/.7);let v=a.x*R,T=a.y*R;return P("button",{role:"menuitem","aria-label":m?"Empty slot":pr(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!g,tabIndex:g?0:-1,onClick:g?i:void 0,onPointerEnter:O=>g&&O.pointerType==="mouse"&&c(true),onPointerLeave:()=>{c(false),u(false)},onPointerDown:()=>g&&u(true),onPointerUp:()=>u(false),onPointerCancel:()=>u(false),style:{position:"absolute",left:"50%",top:"50%",width:z,height:z,marginLeft:-z/2,marginTop:-z/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:g?"pointer":"default",transform:`translate(${v}px, ${T}px) scale(${B})`,opacity:k,transition:r||d?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:m?P("div",{style:{width:S.emptySlot.dotSize,height:S.emptySlot.dotSize,borderRadius:S.emptySlot.dotSize/2,backgroundColor:L.emptyDotBackground,border:`${S.emptySlot.borderWidth}px solid ${L.emptyDotBorder}`}}):be(Ur,{children:[P("div",{style:{position:"absolute",width:`${S.icon.gradientBgSizePercent}%`,height:`${S.icon.gradientBgSizePercent}%`,borderRadius:S.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:S.icon.gradientBgOpacity}}),P("div",{style:{position:"absolute",width:`${S.icon.innerGlowSizePercent}%`,height:`${S.icon.innerGlowSizePercent}%`,borderRadius:S.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:S.icon.innerGlowOpacity}}),P("div",{style:{marginBottom:S.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:r?"brightness(1.2)":"none"},children:e.icon}),P("span",{style:{fontSize:e.name.length>8?Math.max(S.icon.label.fontSize*.7,S.icon.label.fontSize*8/e.name.length):S.icon.label.fontSize,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,color:L.iconLabel,letterSpacing:S.icon.label.letterSpacing,marginTop:S.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),I&&P("span",{style:{fontSize:S.icon.label.fontSize-1,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,letterSpacing:S.icon.label.letterSpacing,color:Sr.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}function wo({side:e,color:t}){return P("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(e==="prev"?[[15,18,9,12],[9,12,15,6]]:[[9,18,15,12],[15,12,9,6]]).map(([o,a,n,i],r)=>P("line",{x1:o,y1:a,x2:n,y2:i,stroke:t,strokeWidth:2},r))})}function xo({side:e,disabled:t,onClick:o}){let[a,n]=Q(false),i=t?L.emptyDotBorder:L.accent;return be("button",{type:"button","aria-label":`${e==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${e}`,disabled:t,onClick:o,onPointerDown:()=>!t&&n(true),onPointerUp:()=>n(false),onPointerLeave:()=>n(false),onPointerCancel:()=>n(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${L.dialBorder}`,backgroundColor:L.dialBackground,color:t?L.iconLabelMuted:L.centerText,fontSize:12,fontWeight:900,fontFamily:so,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${io(L.dialShadow,.4)}`,transform:a?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&P(wo,{side:"prev",color:i}),e==="prev"?"PREV":"NEXT",e==="next"&&P(wo,{side:"next",color:i})]})}function Co({icons:e,onClose:t,centerLabel:o="MENU",onCenterPress:a,settingsOpen:n=false,hintsDisabled:i=false}){let{id:r}=xr(),[c,d]=Q(0),[u,m]=Q(0),[I,g]=Q(0),[M,w]=Q(0),[R,z]=Q(0),[D,B]=Q(1),[k,v]=Q(false),[T,O]=Q(false),[C,A]=Q(false),Z=mt(null),_=mt(null),q=mt(null),te=mt(false),{entrance:K,exit:ie,interaction:oe}=ao,ve=vr(),[re,Ie]=Q(()=>({width:window.innerWidth,height:window.innerHeight}));Ee(()=>{let b=()=>Ie({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);let $=pt(()=>mr({screenWidth:re.width,maxCircleSize:Math.max(120,Math.min(320,re.height-96))}),[re]),qe=pt(()=>fr(),[]),ke=pt(()=>gr(Ge,$.iconRadius),[$.iconRadius]),[Fe,ze]=Q(0),se=Math.max(1,Math.ceil(e.length/Ge)),J=Math.min(Fe,se-1),Se=pt(()=>{let b=J*Ge,x=[...e.slice(b,b+Ge)];for(;x.length<Ge;)x.push({id:`empty-${x.length}`,name:"",icon:null,onPress:()=>{}});return x},[e,J]);Ee(()=>{Vr()},[]),Ee(()=>{let b=K.backdrop.duration,x=K.dial.rotation.duration,X=K.centerButton.delay,U=K.icons.delay,G=K.icons.duration,V=performance.now(),ne=me=>{let s=me-V;d(Math.min(1,s/b));let f=Math.min(1,s/400),E=Ke(f)*1.1;f>.7&&(E-=(f-.7)*.33),f>=1&&(E=1),m(Math.max(0,Math.min(1.05,E)));let Y=Math.min(1,s/x);if(g(Ke(Y)*360),s>=X){let xe=Math.min(1,(s-X)/300),je=Ke(xe)*1.15;xe>.6&&(je-=(xe-.6)*.375),xe>=1&&(je=1),w(Math.max(0,Math.min(1.05,je)))}if(s>=U){let xe=Math.min(1,(s-U)/G);z(Ke(xe))}let we=U+G;s<we?q.current=requestAnimationFrame(ne):(d(1),m(1),g(360),w(1),z(1),A(true))};return q.current=requestAnimationFrame(ne),()=>{q.current&&cancelAnimationFrame(q.current)}},[]);let pe=gt(()=>{if(te.current)return;te.current=true,O(true),q.current&&cancelAnimationFrame(q.current);let b=performance.now(),x=ie.icons.duration,X=ie.centerButton.duration,U=ie.dialScale.duration,G=Math.max(X,U),V=ie.backdrop.duration,ne=me=>{let s=me-b;if(s<x){let Y=Dt(s/x);z(1-Y),q.current=requestAnimationFrame(ne);return}let f=x;if(s<f+G){z(0);let Y=Math.min(1,(s-f)/X),we=Math.min(1,(s-f)/U);w(1-Dt(Y)),m(1-Dt(we)),q.current=requestAnimationFrame(ne);return}let E=f+G;if(s<E+V){m(0),w(0);let Y=(s-E)/V;d(1-Y),q.current=requestAnimationFrame(ne);return}d(0),t()};q.current=requestAnimationFrame(ne)},[ie,t]);Ee(()=>{let b=document.activeElement,x=Z.current;return()=>{b?.isConnected&&(document.activeElement===document.body||x?.contains(document.activeElement))&&b.focus()}},[]),Ee(()=>{if(n)return;_.current?.focus();let b=x=>{let X=Z.current;if(X){if(x.key==="Escape")x.preventDefault(),pe();else if(x.key==="Tab"){let U=Array.from(X.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(ne=>ne.getClientRects().length>0),G=U[0],V=U[U.length-1];(!X.contains(document.activeElement)||(x.shiftKey?document.activeElement===G:document.activeElement===V))&&(x.preventDefault(),(x.shiftKey?V:G)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(x.key)){let U=Array.from(X.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),G=U.indexOf(document.activeElement);if(G<0||!U.length)return;x.preventDefault();let V=x.key==="Home"?0:x.key==="End"?U.length-1:(G+(x.key==="ArrowRight"||x.key==="ArrowDown"?1:-1)+U.length)%U.length;U[V].focus()}}};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[pe,n]);let[Be,$e]=Q(false);Ee(()=>{if(i)return;let b=false,x=setTimeout(async()=>{let X=await ro.getItem(vo);!b&&!X&&$e(true)},1200);return()=>{b=true,clearTimeout(x)}},[i]);let he=gt(()=>{$e(false),ro.setItem(vo,"true")},[]);Ee(()=>{n&&Be&&he()},[n,Be,he]);let Me=gt(b=>{if(b.id.startsWith("empty-")||te.current)return;let[x,X]=oe.iconSelect.pulse,U=performance.now(),G=150,V=ne=>{let me=ne-U;if(me<G){let s=Ke(me/G);B(1-(1-x.scale)*s),requestAnimationFrame(V)}else if(me<G*2){let s=Ke((me-G)/G);B(x.scale+(X.scale-x.scale)*s),requestAnimationFrame(V)}else B(1)};requestAnimationFrame(V),setTimeout(()=>{b.onPress(),pe()},oe.iconSelect.actionDelay)},[oe.iconSelect,pe]),ue=gt(b=>{if(te.current)return;let x=Math.max(0,Math.min(b,se-1));x!==J&&ze(x)},[se,J]),ye=$.buttonSize*S.centerButton.containerRatio,Re=$.buttonSize*S.centerButton.borderRatio,l=$.buttonSize*S.centerButton.containerRatio/2+6,N=C&&!T;return be("div",{ref:Z,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[P("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:pe,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:L.dialBackdrop,opacity:c}}),be("div",{style:{position:"absolute",left:"50%",marginLeft:-$.circleSize/2,bottom:80,width:$.circleSize,height:$.circleSize,borderRadius:"50%",backgroundColor:L.dialBackground,border:`${S.circle.borderWidth}px solid ${L.dialBorder}`,boxShadow:`0 0 ${S.circle.shadowRadius}px ${io(L.dialShadow,S.circle.shadowOpacity)}`,transform:`scale(${u}) rotate(${I}deg)`,opacity:u>.01?1:0,overflow:"hidden"},children:[P("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:L.dialGradient1,opacity:S.gradientLayers[0].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:L.dialGradient2,opacity:S.gradientLayers[1].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:L.dialGradient3,opacity:S.gradientLayers[2].opacity}}),qe.map(b=>P("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:S.grid.lineHeight,transform:`rotate(${b}deg)`,transformOrigin:"center"},children:["left","right"].map(x=>P("div",{style:{position:"absolute",top:0,[x]:0,width:`calc(50% - ${l}px)`,height:S.grid.lineHeight,backgroundColor:L.dialGridLine}},x))},b)),P("div",{"data-testid":"dial-background","data-background":r,style:{position:"absolute",inset:0,pointerEvents:"none"},children:r==="hyperspace"?P($r,{size:$.circleSize}):P(wr,{focus:Kr})}),Se.map((b,x)=>P(qr,{icon:b,index:x,totalIcons:Se.length,position:ke[x],progress:R,onPress:()=>Me(b)},x)),be("div",{style:{position:"absolute",left:"50%",top:"50%",width:ye,height:ye,marginLeft:-ye/2,marginTop:-ye/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:L.hubHalo,borderRadius:$.buttonSize,overflow:"hidden",transform:`scale(${M*D})`,opacity:M>.01?1:0},children:[P("div",{style:{position:"absolute",inset:0,backgroundColor:L.dialGradient1,opacity:.5,borderRadius:$.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:L.dialGradient2,opacity:.3,borderRadius:$.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:L.dialGradient3,opacity:.2,borderRadius:$.buttonSize}}),P("div",{style:{width:Re,height:Re,borderRadius:$.buttonSize*S.centerButton.borderRadiusRatio,backgroundColor:L.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:P("button",{ref:_,type:"button","aria-label":n?"Close Settings":"Open Dev Tools Settings",disabled:!a,onClick:a,onPointerEnter:b=>b.pointerType==="mouse"&&v(true),onPointerLeave:()=>v(false),style:{border:0,padding:0,background:"transparent",width:$.buttonSize,height:$.buttonSize,borderRadius:$.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:a?"pointer":"default",transform:k?`scale(${oe.centerHover.scale})`:"scale(1)",transition:`transform ${oe.centerHover.duration}ms ease`,animation:N&&!k?ve.pulse:"none"},children:n?be("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:S.centerButton.text.fontSize-2,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:L.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${L.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[P("span",{style:{marginBottom:-2},children:"CLOSE"}),P("span",{style:{marginTop:-2},children:"SETTINGS"})]}):P("span",{style:{fontSize:S.centerButton.text.fontSize,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:L.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${L.centerTextGlow}`,textTransform:"uppercase"},children:o})})})]})]}),se>1&&be("div",{style:{position:"absolute",left:"50%",marginLeft:-$.circleSize/2,top:"calc(100% - 64px)",width:$.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,u),transform:`scale(${Math.min(1,u)})`},children:[P(xo,{side:"prev",disabled:J<=0,onClick:()=>ue(J-1)}),be("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:so,letterSpacing:2,color:L.centerText,textShadow:`0 0 6px ${L.centerTextGlow}`},children:[String(J+1).padStart(2,"0"),be("span",{style:{color:L.iconLabelMuted,textShadow:"none"},children:[" / ",String(se).padStart(2,"0")]})]}),P(xo,{side:"next",disabled:J>=se-1,onClick:()=>ue(J+1)})]}),Be&&!n&&P(bo,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:he,showArrow:false})]})}import{persistentStorage as To,devToolsStorageKeys as Gr}from"@buoy-gg/shared-ui/web";import{recordUsage as Jr,pruneUsage as Xr}from"@buoy-gg/floating-tools-core/web";var Io=Gr.dial.usage(),Ve={},ko=false,Et=null;function zo(){return Et||(Et=(async()=>{try{let e=await To.getItem(Io);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(Ve=t)}}catch{}finally{ko=true}})(),Et)}zo();function Yr(e){return e.map((t,o)=>({id:t,index:o,lastUsed:Ve[t]?.lastUsed??0})).sort((t,o)=>o.lastUsed-t.lastUsed||t.index-o.index).map(({id:t})=>t)}async function Qr(e){if(!e)return;ko||await zo();let t=Math.max(Date.now(),...Object.values(Ve).map(o=>o.lastUsed+1));Ve=Xr(Jr(Ve,e,t),t);try{await To.setItem(Io,JSON.stringify(Ve))}catch{}}import{useCallback as Zr,useMemo as Bo}from"react";import{persistentStorage as es}from"@buoy-gg/shared-ui/web";import{useState as ae,useEffect as Ce,useCallback as ht,useMemo as yt}from"react";import{settingsEventBus as bt}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as ts}from"react";import{getRegisteredToolModule as os}from"@buoy-gg/shared-ui/web";var ns=()=>()=>{},as=()=>null;function is(){let e=os("@buoy-gg/external-sync");return ts(e?.subscribeSyncStatus??ns,()=>e?.getSyncStatus?.()??null,as)}import{SentryIcon as rs,WifiCircuitIcon as ss,ImageOverlayIcon as ls,RenderCountIcon as cs,Info as Pt,Layers as ds,ChevronRightIcon as Mo,ChevronDown as Ro,getStorageBackendType as us,getUseLicense as ps,signOutOfBuoy as ms,persistentStorage as Pe,Trash2 as gs,CheckCircle2 as Ao,BuoyUpgradeSheet as fs,BackgroundSwitcher as hs,night as h,NightCard as Oe,NightRows as Ot,NightSectionLabel as ys,NightFootnote as Do,NightSwitch as Eo,NightButton as Lt,NightSegmented as bs,NightBadge as fe,NightSeparator as vs,monoFont as Po}from"@buoy-gg/shared-ui/web";import{EnvIcon as Oo,StorageIcon as Ss,RoutesIcon as ws,NetworkIcon as xs,QueryIcon as Cs,HighlighterIcon as Ts,ReduxIcon as Is,EventsIcon as ks}from"@buoy-gg/floating-tools-core/web";import zs,{createContext as Bs,useContext as Ms}from"react";import{jsx as Rs}from"react/jsx-runtime";var Lo=Bs({});function Fo({children:e,defaultFloatingTools:t,defaultDialTools:o}){let a=zs.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:o}),[t,o]);return Rs(Lo.Provider,{value:a,children:e})}function $o(){return Ms(Lo)}import As from"react";import{toolTheme as Ds}from"@buoy-gg/shared-ui/web";import{jsx as jo}from"react/jsx-runtime";function Es({label:e,size:t,color:o=Ds.colors.text}){let a=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),n=a<=2?t:t*1.6,i=Math.max(7,Math.min(t*(a===1?.7:.62),n/(.62*a)));return jo("span",{style:{display:"inline-flex",minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center",color:o,fontSize:i,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}function Ho(e,t){return e==null?e:typeof e=="function"?As.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?jo(Es,{label:String(e),size:t.size,color:t.color}):e}import{JsModal as Ps,devToolsStorageKeys as Ft,onSettingsApplied as Os,expandableWindowControlsSupported as Ls}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Fs}from"@buoy-gg/shared-ui/web";import{Fragment as Xe,jsx as p,jsxs as j}from"react/jsx-runtime";var Ye="@react_buoy_dev_tools_settings",$s=6,vt=e=>{let t=$s,o={};for(let[a,n]of Object.entries(e))n&&t>0?(o[a]=true,t-=1):o[a]=false;return o},js=(e,t)=>{let{userStatus:o,environment:a,...n}=e,i=t?Object.entries(n).filter(([r])=>t.includes(r)):Object.entries(n);return{...Object.fromEntries(i),environment:a??false}},No=(e,t,o)=>{if(!t)return e;let a={...e.dialTools,...t.dialTools??{}},n=o?.allowedDialKeys?Object.entries(a).filter(([i])=>o.allowedDialKeys?.includes(i)):Object.entries(a);return{dialTools:vt(Object.fromEntries(n)),floatingTools:js({...e.floatingTools,...t.floatingTools??{}},o?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},Hs=(e=[],t,o)=>{let a={},n={},i=new Set(t??[]),r=new Set(o??[]),c=!o||o.length===0;for(let d of e){let{id:u,slot:m="both"}=d;(m==="dial"||m==="both")&&(a[u]=c?true:r.has(u)),(m==="row"||m==="both")&&(n[u]=i.has(u))}return{dialTools:vt(a),floatingTools:{...n,environment:i.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},Ns=({visible:e,onClose:t,onSettingsChange:o,initialSettings:a,availableApps:n=[],storage:i=Pe,zIndex:r})=>{let{defaultFloatingTools:c,defaultDialTools:d}=$o(),u=yt(()=>Hs(n,c,d),[n,c,d]),m=yt(()=>Object.keys(u.dialTools),[u]),I=yt(()=>Object.keys(u.floatingTools).filter(s=>s!=="environment"),[u]),[g,M]=ae(a||Qe||u),[w,R]=ae($t??"floating"),[z,D]=ae($t!==null),[B,k]=ae(new Set),[v,T]=ae(false),[O,C]=ae(false);Ce(()=>{let s=requestAnimationFrame(()=>C(true));return()=>cancelAnimationFrame(s)},[]);let A=is();Ce(()=>{(async()=>{try{let s=await Pe.getItem(Ft.settings.activeTab());if(s&&["floating","settings","pro"].includes(s)){let f=s;$t=f,R(E=>E===f?E:f)}}catch{}finally{D(true)}})()},[]),Ce(()=>{z&&Pe.setItem(Ft.settings.activeTab(),w).catch(s=>{console.warn("Failed to save settings active tab:",s)})},[w,z]);let Z=ps()?.(),_=Z?.isPro??false,q=!_&&Z?.licenseKey?Z.error:null,te=Z?.errorKind==="transport",[K,ie]=ae(_o),[oe,ve]=ae(false),[re,Ie]=ae(false),[$,qe]=ae(false),[ke,Fe]=ae([]),[ze,se]=ae(false),J=Fs(),Se=Xt.get("window").height,pe=Xt.get("window").width,Be=Math.floor(Se*.33),$e=Math.min(pe-32,400),he=ht(async()=>{try{let s=await i.getItem(Ye);if(s){let f=JSON.parse(s),E=No(u,f,{allowedDialKeys:m,allowedFloatingKeys:I});Qe=E,M(Y=>Wo(Y,E)?Y:E);return}Qe=u,M(f=>Wo(f,u)?f:u)}catch(s){console.error("Failed to load dev tools settings:",s),M(u)}},[u,m,I,i]);Ce(()=>{he()},[he]),Ce(()=>{us().then(s=>{_o=s,ie(f=>f===s?f:s)})},[]),Ce(()=>{$&&(se(true),Pe.getAllKeys().then(s=>{Fe(s.sort())}).catch(()=>{Fe([])}).finally(()=>{se(false)}))},[$]);let Me=async s=>{try{let f={...s,dialTools:vt(s.dialTools)};await i.setItem(Ye,JSON.stringify(f)),Qe=f,M(f),o?.(f),bt.emit(f)}catch(f){console.error("Failed to save dev tools settings:",f)}},ue=s=>{let f={...g,floatingTools:{...g.floatingTools,[s]:!g.floatingTools[s]}};Me(f)},ye=s=>{let f={...g,globalSettings:{...g.globalSettings,[s]:!g.globalSettings?.[s]}};Me(f)},Re=async()=>{ve(true),Ie(false);try{await Pe.clear(),Ie(true),M(u),i!==Pe&&await i.setItem(Ye,JSON.stringify(u)),o?.(u),bt.emit(u),setTimeout(()=>Ie(false),2e3)}catch(s){console.error("Failed to clear storage:",s)}finally{ve(false)}},l=ht(s=>{},[]),N=s=>{let f=n.find(E=>E.id===s);return f?.description?f.description:s==="environment"?"Environment badge.":""},b=s=>s==="environment"?"Env Badge":n.find(f=>f.id===s)?.name??s.toUpperCase().replace(/_/g," "),x=s=>{if(!O)return null;switch(s){case"query":return p(Cs,{size:18});case"env":return p(Oo,{size:18});case"sentry":return p(rs,{size:18,color:"#9945FF"});case"storage":return p(Ss,{size:18,bgColor:h.color.surface});case"wifi":case"query-wifi-toggle":return p(ss,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return p(ws,{size:18,bgColor:h.color.surface});case"network":return p(xs,{size:18});case"environment":return p(Oo,{size:18});case"debug-borders":return p(ds,{size:18,color:h.color.accent});case"highlight-updates":return p(cs,{size:18,color:h.color.accent});case"highlight-updates-modal":return p(Ts,{size:18});case"redux":return p(Is,{size:18});case"image-overlay":return p(ls,{size:18});case"events":return p(ks,{size:18});case"zustand":try{let{ZustandIcon:f}=Qt("@buoy-gg/zustand/web");return p(f,{size:18})}catch{return p(Pt,{size:18,color:h.color.textSecondary})}case"jotai":try{let{JotaiIcon:f}=Qt("@buoy-gg/jotai/web");return p(f,{size:18})}catch{return p(Pt,{size:18,color:h.color.textSecondary})}default:{let f=n.find(E=>E.id===s);return f?.icon!=null?Ho(f.icon,{slot:"row",size:18,color:f.color}):p(Pt,{size:18,color:h.color.textSecondary})}}},X=(s,f,E,Y)=>{let we=N(s);return j(lt,{activeOpacity:E?1:.7,onPress:()=>!E&&Y(),accessibilityLabel:b(s),accessibilityRole:"button",style:[y.toolRow,E&&y.rowDisabled],children:[p(H,{style:y.toolIconSlot,children:x(s)}),j(H,{style:y.rowInfo,children:[j(W,{style:y.rowLabel,children:[b(s),E?" \xB7 max 6":""]}),we?p(W,{style:y.rowCaption,numberOfLines:1,children:we}):null]}),p(Eo,{value:f,disabled:E,onValueChange:()=>Y()})]},s)},U=s=>{k(f=>{let E=new Set(f);return E.has(s)?E.delete(s):E.add(s),E})},G=(s,f,E,Y,we)=>{let xe=g.globalSettings?.[s]??false,je=B.has(s);return j(H,{children:[j(lt,{activeOpacity:.7,onPress:()=>U(s),accessibilityLabel:f,style:y.settingRow,children:[j(H,{style:y.rowInfo,children:[p(W,{style:y.rowLabel,children:f}),p(W,{style:y.rowCaption,numberOfLines:je?0:1,children:E})]}),p(Eo,{value:xe,onValueChange:()=>ye(s)})]}),je&&j(H,{style:y.settingRowBody,children:[p(W,{style:y.settingRowBodyText,children:Y}),p(W,{style:y.settingRowBodyHint,children:we})]})]},s)},V=(s,f,E)=>j(H,{children:[p(ys,{children:s}),f,E]}),ne=K==="filesystem"?p(fe,{label:"File System",tone:"accent"}):K==="asyncstorage"?p(fe,{label:"Async Storage",tone:"warning"}):K==="localstorage"?p(fe,{label:"Local Storage",tone:"accent"}):K==="memory"?p(fe,{label:"Memory",tone:"danger"}):p(fe,{label:"Loading\u2026",tone:"neutral"}),me=()=>j(H,{style:y.container,children:[j(Jt,{style:y.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:y.scrollContainer,children:[w==="floating"&&p(Xe,{children:V("Floating Tools",p(Oe,{glass:true,children:p(Ot,{children:Object.entries(g.floatingTools).map(([s,f])=>X(s,f,false,()=>ue(s)))})}),p(Do,{children:"Tools switched on here appear in the floating bubble row."}))}),w==="settings"&&j(Xe,{children:[V("Background",p(Oe,{glass:true,padded:true,children:p(hs,{embedded:true})})),V("Storage",j(Oe,{glass:true,children:[j(lt,{activeOpacity:.7,onPress:()=>qe(!$),accessibilityLabel:"Storage Type",style:y.settingRow,children:[p(H,{style:y.rowInfo,children:p(W,{style:y.rowLabel,children:"Storage Type"})}),ne,$?p(Ro,{size:16,color:h.color.textTertiary}):p(Mo,{size:16,color:h.color.textTertiary})]}),$&&j(Xe,{children:[j(H,{style:y.settingRowBody,children:[p(W,{style:y.settingRowBodyText,children:K==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":K==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":K==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":K==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),K==="asyncstorage"&&p(W,{style:[y.settingRowBodyText,y.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),K==="memory"&&p(W,{style:[y.settingRowBodyText,y.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),p(vs,{}),j(H,{style:y.storageExpanded,children:[j(H,{style:y.storageExpandedHeader,children:[p(W,{style:y.storageExpandedTitle,children:"SAVED SETTINGS"}),p(W,{style:y.storageExpandedCount,children:ze?"\u2026":`${ke.length} keys`})]}),ze?p(W,{style:y.storageKeyEmpty,children:"Loading\u2026"}):ke.length===0?p(W,{style:y.storageKeyEmpty,children:"No settings saved yet"}):p(Jt,{style:y.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:ke.map(s=>p(H,{style:y.storageKeyItem,children:p(W,{style:y.storageKeyText,numberOfLines:1,children:s.replace("@react_buoy_","")})},s))})]}),p(H,{style:y.cardButtonWrap,children:p(Lt,{label:re?"Cleared":oe?"Clearing\u2026":"Clear All Settings",variant:re?"secondary":"destructive",size:"md",disabled:oe,onPress:Re,icon:re?p(Ao,{size:15,color:h.color.accent}):p(gs,{size:15,color:oe?h.color.textTertiary:h.color.danger})})})]})]})),A&&A.state!=="idle"&&V("Desktop Sync",j(Oe,{glass:true,children:[j(lt,{activeOpacity:.7,onPress:()=>U("desktopSync"),accessibilityLabel:"Buoy Desktop",style:y.settingRow,children:[p(H,{style:y.rowInfo,children:p(W,{style:y.rowLabel,children:"Buoy Desktop"})}),A.state==="connected"?p(fe,{label:"Connected",tone:"accent"}):A.state==="connecting"?p(fe,{label:"Connecting\u2026",tone:"neutral"}):p(fe,{label:"Retrying",tone:"warning"}),B.has("desktopSync")?p(Ro,{size:16,color:h.color.textTertiary}):p(Mo,{size:16,color:h.color.textTertiary})]}),B.has("desktopSync")&&j(H,{style:y.settingRowBody,children:[j(W,{style:y.settingRowBodyText,children:[A.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",p(W,{style:y.footnoteMono,children:A.targetURL??"(unknown URL)"}),A.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),A.state==="retrying"&&A.lastError&&j(W,{style:[y.settingRowBodyText,y.bodyWarning],children:["Last error: ",A.lastError]})]})]})),V("Modal Behavior",p(Oe,{glass:true,children:j(Ot,{children:[G("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),Ls(He.OS==="web")?G("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),w==="pro"&&j(Xe,{children:[V("License",j(Oe,{glass:true,children:[j(H,{style:y.settingRow,children:[p(H,{style:y.rowInfo,children:p(W,{style:y.rowLabel,children:"License Status"})}),p(H,{testID:"buoy-settings-license-status",accessibilityLabel:_?"License: Active":"License: Free",children:_?p(fe,{label:"Active",tone:"accent"}):p(fe,{label:"Free",tone:"neutral"})})]}),Z?.tierSource==="session"?j(H,{style:y.settingRow,children:[p(H,{style:y.rowInfo,children:p(W,{style:y.rowLabel,children:"Signed in with Buoy"})}),p(Lt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void ms(),testID:"buoy-settings-signout"})]}):null]}),p(Do,{children:_?"You have full access to all Buoy DevTools features.":q?te?`Couldn't reach the license server (${q}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${q}.`:"Upgrade to Pro to unlock all features and support development."})),!_&&j(Xe,{children:[V("Pro Features",p(Oe,{glass:true,children:p(Ot,{children:["Advanced Settings","Priority Support"].map(s=>j(H,{style:y.featureRow,children:[p(Ao,{size:16,color:h.color.accent}),p(W,{style:y.rowLabel,children:s})]},s))})})),p(Lt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>T(true)})]})]})]}),p(fs,{visible:v,onClose:()=>T(false)})]});return p(Ps,{visible:e,onClose:t,zIndex:r,variant:"night",header:{showToggleButton:false,customContent:p(H,{style:y.headerRow,children:p(bs,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:w,onChange:s=>R(s)})})},initialMode:"bottomSheet",onModeChange:l,persistenceKey:Ft.settings.root(),enablePersistence:true,maxHeight:Se-J.top,initialHeight:Be,initialFloatingPosition:{x:(pe-$e)/2,y:J.top+20},enableGlitchEffects:true,children:me()})},_s={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},Ws=(e,t)=>{let o=new Set(e??[]),a=new Set(t??[]),n={};for(let r of a)n[r]=true;let i={environment:o.has("environment")};for(let r of o)r!=="environment"&&(i[r]=true);return{dialTools:vt(n),floatingTools:i,globalSettings:{enableSharedModalDimensions:false}}},Qe=null,$t=null,_o=null,Wo=(e,t)=>JSON.stringify(e)===JSON.stringify(t);bt.addListener(e=>{e&&(Qe=e)});var Uo=()=>{let{defaultFloatingTools:e,defaultDialTools:t}=$o(),o=yt(()=>!e&&!t?_s:Ws(e,t),[e,t]),[a,n]=ae(o),i=ht(async()=>{try{let c=await Pe.getItem(Ye);if(c){let d=JSON.parse(c),u=No(o,d);n(u);return}n(o)}catch(c){console.error("Failed to load dev tools settings:",c),n(o)}},[o]);Ce(()=>Os(c=>{c.includes(Ye)&&i()}),[i]),Ce(()=>{i();let c=bt.addListener(d=>{try{d&&n(d)}catch{}});return()=>{c()}},[i]);let r=ht(()=>{i()},[i]);return{settings:a,refreshSettings:r}},y=ct.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:h.gutter,paddingRight:h.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:h.gutter,paddingTop:8,paddingBottom:24,gap:h.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:h.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:h.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:h.color.text,fontSize:h.font.row,fontWeight:"500"},rowCaption:{color:h.color.textTertiary,fontSize:h.font.label},settingRowBody:{paddingHorizontal:h.rowPadH,paddingBottom:h.rowPadV,gap:6},settingRowBodyText:{color:h.color.textSecondary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},settingRowBodyHint:{color:h.color.textTertiary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},bodyWarning:{color:h.color.warning},bodyDanger:{color:h.color.danger},cardButtonWrap:{paddingHorizontal:h.cardPad,paddingTop:10,paddingBottom:h.cardPad},storageExpanded:{paddingHorizontal:h.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:h.color.textSecondary,fontSize:h.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:h.color.textTertiary,fontSize:h.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:h.color.glassElevated,borderRadius:h.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:h.color.textSecondary,fontSize:h.font.micro,fontFamily:Po},storageKeyEmpty:{color:h.color.textTertiary,fontSize:h.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:Po,fontSize:h.font.label,color:h.color.textSecondary}});import{jsx as Ko}from"react/jsx-runtime";var Us=[];function Vo({visible:e,onClose:t,availableTools:o=Us,defaultFloatingTools:a,defaultDialTools:n,storage:i=es,onSettingsChange:r}){let c=Bo(()=>({getItem:async m=>i.getItem(m),setItem:async(m,I)=>i.setItem(m,I)}),[i]),d=Bo(()=>o.map(m=>({...m,name:m.name??m.id,icon:typeof m.icon=="function"?I=>m.icon(I.size):m.icon})),[o]),u=Zr(m=>{r?.(m)},[r]);return Ko(Fo,{defaultFloatingTools:a,defaultDialTools:n,children:Ko(Ns,{visible:e,onClose:t,zIndex:11e3,availableApps:d,storage:c,onSettingsChange:u})})}import{persistentStorage as qo,setExpandableWindowControls as Ks}from"@buoy-gg/shared-ui/web";import{createContext as Vs,useCallback as Te,useContext as qs,useEffect as St,useMemo as Gs,useRef as Ze,useState as Go}from"react";var Js=(e,t,o)=>{if(t.singleton){let n=e.find(i=>i.id===t.id);if(n){let i=n.minimized??false;return{instanceId:n.instanceId,wasMinimized:i,apps:[...e.filter(r=>r.instanceId!==n.instanceId),{...n,minimized:false}]}}}let a=o();return{instanceId:a,wasMinimized:false,apps:[...e,{...t,instanceId:a}]}};import{createContext as Xs,useCallback as Jo,useContext as Ys,useEffect as wt,useMemo as Qs,useRef as Xo,useState as xt}from"react";import{JsModal as Zs,ModalHeader as et,HeaderSearchButton as el,TickProvider as tl,ToolScreenHeaderContext as ol,devToolsStorageKeys as Yo,buoyColors as Qo,gameUIColors as jt}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as Ct}from"react/jsx-runtime";var tt=()=>{},nl={search:"",isSearchActive:false,clearSearch:tt,close:tt,minimize:tt,showToast:tt,setHeaderOverride:tt},Zo=Xs(null);function en(){return Ys(Zo)??nl}function al(e,t){let{setHeaderOverride:o}=en();wt(()=>(o(e),()=>o(null)),t)}var tn=2200,il={success:jt.success,error:jt.error,info:jt.info};function rl({message:e,type:t,nonce:o}){let a=Xo(new Ae.Value(0)).current;wt(()=>{a.setValue(0),Ae.sequence([Ae.timing(a,{toValue:1,duration:150,useNativeDriver:true}),Ae.delay(tn-450),Ae.timing(a,{toValue:0,duration:300,useNativeDriver:true})]).start()},[o,a]);let n=il[t];return Ct(Ae.View,{pointerEvents:"none",style:[Tt.toast,{opacity:a,borderColor:n+"60"}],children:[le(H,{style:[Tt.toastDot,{backgroundColor:n}]}),le(W,{style:Tt.toastText,numberOfLines:2,children:e})]})}function sl({app:e,config:t,visible:o,zIndex:a,onClose:n,onMinimize:i,initialModalState:r,enableSharedModalDimensions:c,bodyProps:d}){let u=e.component,[m,I]=xt(false),[g,M]=xt(""),[w,R]=xt(null),[z,D]=xt(null),B=Xo(null),k=Jo(()=>{I(false),M("")},[]),v=Jo((K,ie="info")=>{B.current&&clearTimeout(B.current),D(oe=>({message:K,type:ie,nonce:(oe?.nonce??0)+1})),B.current=setTimeout(()=>D(null),tn)},[]);wt(()=>()=>{B.current&&clearTimeout(B.current)},[]);let T=Qs(()=>({search:m?g:"",isSearchActive:m,clearSearch:k,close:n,minimize:()=>i(),showToast:v,setHeaderOverride:R,instanceId:e.instanceId}),[g,m,k,n,i,v,e.instanceId]),O=w?.title??t.title??e.title??e.id,C=w?.subtitle??t.subtitle,A=w?.onBack,Z=w?.actions??t.headerActions,_=w?.searchable??t.searchable;wt(()=>{!_&&m&&k()},[_,m,k]);let q=c?Yo.modal.root():Yo.custom(e.id).modal(),te=Ct(et,{children:[A&&!m&&le(et.Navigation,{onBack:A}),m?le(et.Search,{value:g,onChangeText:M,onCancel:k,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):le(et.Content,{title:O,subtitle:C}),Ct(et.Actions,{children:[!m&&Z,_&&!m&&le(el,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>I(true)})]})]});return le(Zo.Provider,{value:T,children:le(Zs,{visible:o,onClose:n,onBack:A,onMinimize:i,initialModalState:r,zIndex:a,persistenceKey:q,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:te,showToggleButton:true},disableScrollWrapper:true,styles:{},children:Ct(H,{style:Tt.bodyRoot,children:[le(tl,{children:le(ol.Provider,{value:R,children:le(u,{...d})})}),z&&le(rl,{message:z.message,type:z.type,nonce:z.nonce})]})})})}var Tt=ct.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:Qo.card,borderWidth:1,borderRadius:8,paddingHorizontal:12,paddingVertical:8,shadowColor:"#000",shadowOpacity:.4,shadowRadius:8,shadowOffset:{width:0,height:2},elevation:6},toastDot:{width:6,height:6,borderRadius:3},toastText:{flex:1,fontSize:12,color:Qo.text}});import{useEffect as ll,useRef as cl}from"react";import{capacitorPlatform as dl,capacitorPlugin as ul}from"@buoy-gg/license/web";function pl(){return globalThis.__BUOY_HOLDS_BACK__===true}var ml=99.5;function gl(){if(typeof document>"u")return false;let e=globalThis.Ionic;if(!e&&!document.querySelector("ion-app"))return false;try{return e?.config?.get?.("hardwareBackButton",true)!==false}catch{return true}}function fl(e,t){let o=cl(t);o.current=t,ll(()=>{if(!e||dl()!=="android")return;let a=globalThis;a.__BUOY_HOLDS_BACK__=true;let n;if(gl()){let i=r=>{r.detail?.register?.(ml,()=>{o.current()})};document.addEventListener("ionBackButton",i),n=()=>document.removeEventListener("ionBackButton",i)}else{let i=ul("App");if(!i?.addListener){a.__BUOY_HOLDS_BACK__=false;return}let r=false,c=null;Promise.resolve(i.addListener("backButton",()=>o.current())).then(d=>{r?d.remove():c=d}).catch(()=>{}),n=()=>{r=true,c&&c.remove()}}return()=>{n(),a.__BUOY_HOLDS_BACK__=false}},[e])}import{Fragment as hl,jsx as ce}from"react/jsx-runtime";var on=Vs(null),nn="@react_buoy_open_apps",Ht=44,yl=12,bl=100,vl=16,Sl=e=>({x:window.innerWidth-Ht-vl,y:window.innerHeight-bl-Ht-e*(Ht+yl)}),an=({children:e})=>{let[t,o]=Go([]),[a,n]=Go(false),i=Ze([]),r=Ze(null),c=Ze(false),d=Ze(false),u=Ze(false),m=Te(v=>{let T="";return o(O=>{let{apps:C,instanceId:A}=Js(O,v,()=>`${v.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return T=A,C}),T},[]),I=Te(()=>{if(c.current||!d.current||!u.current)return;c.current=true;let v=r.current;if(!v||v.length===0){n(true);return}r.current=null,v.forEach(({id:T,minimized:O})=>{let C=i.current.find(A=>A.id===T);if(C&&C.component){let A=Ho(C.icon,{slot:"dial",size:20,color:C.color});m({id:C.id,title:C.name,component:C.component,props:C.props,modal:C.modal,launchMode:C.launchMode||"self-modal",singleton:C.singleton??true,icon:A,color:C.color,minimized:O})}}),n(true)},[m]);St(()=>{let v=false;return(async()=>{try{let T=await qo.getItem(nn);if(v)return;if(T){let O=JSON.parse(T),C;Array.isArray(O)&&O.length>0&&(typeof O[0]=="string"?C=O.map(A=>({id:A,minimized:false})):C=O.filter(A=>typeof A=="object"&&A!==null&&typeof A.id=="string"),C.length&&(r.current=C))}}catch{}v||(d.current=true,I())})(),()=>{v=true}},[I]),St(()=>{if(!a)return;let v=t.map(T=>({id:T.id,minimized:T.minimized??false}));qo.setItem(nn,JSON.stringify(v))},[t,a]);let g=Te(v=>{i.current=v,u.current=true,I()},[I]),M=Te(v=>{o(T=>T.length?v?T.filter(O=>O.instanceId!==v):T.slice(0,-1):T)},[]),w=Te(()=>o([]),[]),R=Te((v,T)=>{o(O=>O.map(C=>C.instanceId===v?{...C,minimized:true,restoreState:T}:C))},[]),z=Te((v,T)=>{o(O=>O.map(C=>C.instanceId===v?{...C,minimized:false,restoreState:T??C.restoreState}:C))},[]),D=Te(v=>t.find(T=>T.instanceId===v)?.minimized??false,[t]),B=t.some(v=>v.launchMode!=="toggle-only"&&!v.minimized);St(()=>{if(!B)return;let v=T=>{if(T.key!=="Escape"||T.defaultPrevented)return;let O=[...t].reverse().find(C=>C.launchMode!=="toggle-only"&&!C.minimized);O&&M(O.instanceId)};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[B,M,t]),fl(t.length>0,()=>M());let k=Gs(()=>({openApps:t,isAnyOpen:B,open:m,close:M,closeAll:w,registerApps:g,minimize:R,restore:z,isMinimized:D}),[t,B,m,M,w,g,R,z,D]);return ce(on.Provider,{value:k,children:e})},ot=()=>{let e=qs(on);return e||{openApps:[],isAnyOpen:false,open:()=>"",close:()=>{},closeAll:()=>{},registerApps:()=>{},minimize:()=>{},restore:()=>{},isMinimized:()=>false}},wl=9e3,xl={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},Cl={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Tl=({app:e,zIndex:t,onClose:o,onMinimize:a,minimizeTargetPosition:n,enableSharedModalDimensions:i})=>{let r=e.component,c=!e.minimized,d={...e.props??{},...i?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(sl,{app:e,config:e.modal,visible:c,zIndex:t,onClose:o,onMinimize:a,initialModalState:e.restoreState,enableSharedModalDimensions:i,bodyProps:d})}):e.launchMode==="self-modal"?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(r,{...d,visible:c,onClose:o,onRequestClose:o,onMinimize:a,minimizeTargetPosition:n,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?c?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(r,{...d,onClose:o,onMinimize:a,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...xl,zIndex:t,display:c?"flex":"none"},children:ce("div",{style:Cl,children:ce(r,{...d,onClose:o,onMinimize:a,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})})})},rn=()=>{let{openApps:e,close:t,minimize:o}=ot(),{settings:a}=Uo();St(()=>{Ks(a.globalSettings?.expandableWindowControls!==false)},[a.globalSettings?.expandableWindowControls]);let n=e.filter(c=>c.launchMode!=="toggle-only");if(n.length===0)return null;let i=n.filter(c=>c.minimized).length,r=ur()??Sl(i);return ce(hl,{children:n.map((c,d)=>ce(Tl,{app:c,zIndex:wl+d,onClose:()=>t(c.instanceId),onMinimize:u=>o(c.instanceId,u),enableSharedModalDimensions:a.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:r},c.instanceId))})};import{useCallback as Il,useEffect as Nt,useRef as kl,useState as sn,useSyncExternalStore as ln}from"react";import{persistentStorage as cn,getToolAttention as _t,subscribeToolAttention as dn}from"@buoy-gg/shared-ui/web";import{jsx as de,jsxs as It}from"react/jsx-runtime";function zl(e){return ln(dn,()=>_t(e),()=>_t(e))}var un={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},pn={needsInput:3,failed:2,done:1},mn=new Map;function gn(e){let t=null;for(let a of e?e.split("|"):[]){let n=_t(a);n&&(!t||pn[n.kind]>pn[t.kind])&&(t=n)}let o=mn.get(e);return o&&t&&o.kind===t.kind&&o.label===t.label?o:!o&&!t?null:(mn.set(e,t),t)}function Bl(e){let t=e.join("|");return ln(dn,()=>gn(t),()=>gn(t))}var fn=28,Wt=32,Ut=6,hn=8,yn=24,bn="@react_buoy_minimized_stack_expanded",Ml=80,vn=2e3,Rl=6e3,Al="#1A1A1A",nt="#888888";function Sn({down:e=false}){return de("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:de("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:nt,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Dl({id:e,title:t,icon:o,index:a,onPress:n}){let i=zl(e),r=kl(null);return Nt(()=>{let c=true,d,u=()=>{r.current?.animate([{transform:"translateX(0) scale(1)",opacity:1,offset:0},{transform:"translateX(3px) scale(1.05)",opacity:.4,offset:.2},{transform:"translateX(-3px) scale(1.1)",opacity:1,offset:.4},{transform:"translateX(2px) scale(1.0)",opacity:.6,offset:.6},{transform:"translateX(-1px) scale(0.95)",opacity:1,offset:.8},{transform:"translateX(0) scale(1)",opacity:1,offset:1}],{duration:Ml,easing:"linear"})},m=I=>{let g=I?500+Math.random()*1500+a*200:vn+Math.random()*(Rl-vn)+a*300;d=setTimeout(()=>{c&&(u(),m(false))},g)};return m(true),()=>{c=false,clearTimeout(d)}},[a]),It("button",{type:"button","aria-label":i?`${t} \u2014 ${i.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:n,style:{width:Wt,height:Wt,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[de("div",{ref:r,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:o}),i?de("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${i.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:un[i.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:i.kind==="needsInput"?"!":""}):null]})}function El({containerWidth:e=32}){let{openApps:t,restore:o}=ot(),a=t.filter(g=>g.minimized&&g.launchMode!=="toggle-only"),[n,i]=sn(false),[r,c]=sn(false),d=Bl(a.map(g=>g.id));Nt(()=>{let g=false;return(async()=>{let M=await cn.getItem(bn);!g&&M==="true"&&i(true),g||c(true)})(),()=>{g=true}},[]),Nt(()=>{r&&cn.setItem(bn,n?"true":"false")},[n,r]);let u=Il(g=>{o(g)},[o]);if(a.length===0)return null;let m=hn+a.length*Wt+(a.length-1)*Ut+Ut+yn+4,I={backgroundColor:Al,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${nt}66`,borderLeft:`1px solid ${nt}66`,borderRight:`1px solid ${nt}66`,borderBottom:"none",boxSizing:"border-box"};return It("div",{style:{height:fn,overflow:"visible",position:"relative"},children:[de("div",{style:{position:"absolute",bottom:"var(--buoy-stack-bottom, 0px)",top:"var(--buoy-stack-top, auto)",left:0,width:e,maxHeight:"var(--buoy-stack-space, calc(100vh - 48px))",visibility:n?"visible":"hidden",height:n?m:0,opacity:n?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:n?"auto":"none",...I},children:It("div",{style:{height:m,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:hn,gap:Ut,boxSizing:"border-box"},children:[n&&[...a].reverse().map((g,M)=>de(Dl,{id:g.id,title:g.title||g.id,icon:g.icon??de("span",{style:{color:"#fff",fontSize:13},children:(g.title||g.id).slice(0,1).toUpperCase()}),index:M,onPress:()=>u(g.instanceId)},g.instanceId)),de("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>i(false),style:{width:"100%",height:yn,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:de(Sn,{down:true})})]})}),It("button",{type:"button","aria-label":`Show ${a.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:n?-1:0,"aria-hidden":n,onClick:()=>i(true),style:{position:"absolute",bottom:0,left:0,width:e,height:fn,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:n?0:1,transform:n?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:n?"none":"auto",...I},children:[de(Sn,{}),d?de("span",{"aria-hidden":true,"data-testid":"buoy-dock-peek-attention",style:{position:"absolute",top:2,right:2,minWidth:11,height:11,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:un[d.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.kind==="needsInput"?"!":""}):null,a.length>1&&de("span",{style:{fontSize:9,fontWeight:600,color:nt,marginLeft:1},children:a.length})]})]})}import{registerToolModules as Pl}from"@buoy-gg/shared-ui/web";import{createElement as Ol}from"react";function at(e){let t=e.icon;return{...e,icon:typeof t=="function"?o=>Ol(t,{size:o,slot:e.slot??"both",color:e.color}):()=>t}}import{createContext as Ll,useContext as Fl,useState as wn,useMemo as xn}from"react";import{jsx as $l}from"react/jsx-runtime";var Cn=Ll(null);function Tn({children:e}){let[t,o]=wn(false),[a,n]=wn(false),i=xn(()=>t||a,[t,a]),r=xn(()=>({isDialOpen:t,isToolOpen:a,isDevToolsActive:i,setDialOpen:o,setToolOpen:n}),[t,a,i]);return $l(Cn.Provider,{value:r,children:e})}function Kt(){let e=Fl(Cn);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:()=>{},setToolOpen:()=>{}}}import*as jl from"@buoy-gg/license/web";import*as Hl from"@buoy-gg/shared-ui/web";import*as Nl from"@buoy-gg/shared-ui/web/dataViewer";function In(e){Pl({core:{useDevToolsVisibility:Kt},license:jl,"shared-ui":Hl,"shared-ui/dataViewer":Nl,...e});let t=new Set;return Object.values(e).flatMap(o=>Object.entries(o).flatMap(([a,n])=>!a.endsWith("Preset")||!n||typeof n.id!="string"||!n.component||t.has(n.id)?[]:(t.add(n.id),[at(n)])))}import{useEffect as kt,useMemo as zt,useRef as _l}from"react";import{LicenseManager as Wl,installCapacitorBridge as Ul,resolveDevBuild as kn,useLicense as Kl}from"@buoy-gg/license/web";import{registerToolAdapters as Vl}from"@buoy-gg/shared-ui/web";function zn(e){return typeof e=="object"&&e!==null?e:void 0}function ql({isDevelopment:e,isLicensed:t,externalSync:o,isAvailable:a}){if(o===false||!a)return false;if(e)return true;let n=zn(o);return t&&n?.enableInRelease===true&&Mn(n.socketURL,n)===null}var Bn="http://localhost:42831";function Gl(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}function Mn(e,t){let o=e??Bn;if(t?.allowInsecureNetwork===true)return null;let a;try{a=new URL(o)}catch{return`[Buoy] externalSync.socketURL "${o}" isn't a valid URL, so this release build won't connect to Buoy Desktop.`}return a.protocol==="https:"||a.protocol==="wss:"||Gl(a.hostname)?null:`[Buoy] This release build won't connect to ${o}: release sync carries real user data, and plain http to another machine is readable by anyone on the same network. Use a simulator, an emulator or adb reverse (localhost), an https:// broker, or set externalSync.allowInsecureNetwork: true for a network you trust.`}var Jl={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function Xl(e,t,o){if(t)return e;let a=null;for(let[n,i]of Object.entries(Jl)){if(o?.includes(n))continue;let r=e[n];if(!r?.actions)continue;let c={...r.actions};for(let d of i)d in c&&(c[d]=()=>{throw new Error(`${n}.${d} is off in release builds. To allow it from Buoy Desktop and the MCP, pass externalSync={{ enableInRelease: true, releaseActions: ["${n}"] }}.`)});a??(a={...e}),a[n]={...r,actions:c}}return a??e}import{useEffect as Yl,useMemo as Ql,useState as Zl}from"react";import{devToolsStorageKeys as ec,persistentStorage as tc}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as oc}from"@buoy-gg/license/web";var nc=8;function ac(){let e="";for(;e.length<nc;)e+=(Math.random()*16|0).toString(16);return e}function ic(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function rc({appName:e,hardwareName:t,platform:o,installId:a,deviceId:n}){let i=ic(e??"buoy")||"buoy",r=e??"Buoy Device",c=t?.trim()||o;return n?{deviceId:n,deviceName:`${r} (${c})`}:{deviceId:`${i}-${o}-${a}`,deviceName:`${r} (${c} \xB7 ${a.slice(-4)})`}}function sc(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}function lc(){let e=globalThis;try{return e.localStorage??null}catch{return null}}async function cc({platform:e=He.OS,store:t,mint:o=ac}={}){let a=ec.sync.deviceId(),n=t===void 0?oc()?lc():e==="web"?sc():tc:t;if(!n)return o();try{let i=await n.getItem(a);if(i&&i.length>0)return i;let r=o();return await n.setItem(a,r),r}catch{return o()}}var Vt=null;function dc(){return Vt||(Vt=cc()),Vt}function uc(e,t){let o=e?.deviceId,a=e?.deviceName,n=t.loadId??dc,i=t.platform??He.OS,[r,c]=Zl(null);return Yl(()=>{if(o)return;let d=false;return n().then(u=>{d||c(u)}),()=>{d=true}},[o,n]),Ql(()=>{if(!o&&!r)return null;let d=rc({appName:t.appName,hardwareName:t.hardwareName,platform:i,installId:r??"",deviceId:o});return a?{...d,deviceName:a}:d},[o,a,r,t.appName,t.hardwareName,i])}import{useEffect as pc,useState as mc}from"react";import{capacitorPlatform as gc,capacitorPlugin as Bt,isCapacitorNative as fc}from"@buoy-gg/license/web";function hc(e,t){if(t==="ios")return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":null;let o=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(e)?.[1]?.trim();return!o||o==="K"?null:o}function yc(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}function Rn(){return typeof navigator>"u"?"":navigator.userAgent??""}function qt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}var An="@react_buoy_capacitor_app_name";function bc(e){try{let t=globalThis.localStorage;if(!t)return e;let o=t.getItem(An);if(o)return o;e&&t.setItem(An,e)}catch{}return e}function vc(){let e=gc();if(!e)return{platform:"web",appName:qt(),hardwareName:"Browser",ready:true};let t=!!Bt("App");return{platform:e,appName:t?qt():bc(qt()),hardwareName:hc(Rn(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Bt("Device")}}function Sc(){let[e,t]=mc(vc);return pc(()=>{if(!fc())return;let o=false,a=Bt("App"),n=Bt("Device");return Promise.all([a?.getInfo?.().catch(()=>null)??null,n?.getInfo?.().catch(()=>null)??null]).then(([i,r])=>{if(o)return;let c=i?.name?.trim(),d=r?.name?.trim()||r?.model?.trim();t(u=>({...u,appName:c||u.appName,hardwareName:d||u.hardwareName,ready:true}))}),()=>{o=true}},[]),e}function Dn(){if(typeof location>"u")return null;let e=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:Rn(),serverUrl:typeof e=="string"?e:null}}function En(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}function wc(e,t){if(e==="ios"){let o=En(t.serverUrl);return o?o===En(t.origin):t.protocol==="capacitor:"}return Pn.has(t.hostname)}var Pn=new Set(["localhost","127.0.0.1","[::1]","::1"]);function xc(e,t,o,a=Dn()){if(o==="web"||!a)return e;let n;try{n=new URL(e)}catch{return e}let i=wc(o,a);return!t&&i&&n.hostname===a.hostname&&(n.hostname="localhost"),o==="android"&&Pn.has(n.hostname)&&yc(a.userAgent)&&(n.hostname="10.0.2.2"),n.toString().replace(/\/$/,"")}function Cc(e,t,o=Dn()){return t!=="android"||!o||o.protocol!=="https:"||!/^(http|ws):/i.test(e)?null:`[Buoy] Can't reach Buoy Desktop at ${e}. This Android WebView serves the app from https://${o.hostname} and blocks plain http/ws by default. For debug builds, set android.allowMixedContent: true and server.cleartext: true in capacitor.config, then run cap sync.`}import{getDevServerOrigin as Tc,resolveReloadStrategy as Ic,scheduleReloadApp as kc}from"@buoy-gg/shared-ui/web";var On=Date.now(),Ln=Tc(),zc={platform:He.OS,isTV:He.isTV===true,isTVOS:He.isTVOS===true},Fn={version:3,getSnapshot:()=>{let e=Ic("auto");return{startedAt:On,devServerOrigin:Ln,device:zc,reload:{available:e!==null,strategy:e}}},subscribe:e=>()=>{},actions:{ping:()=>({ok:true,startedAt:On,devServerOrigin:Ln}),reloadApp:e=>{let t=e??{},{strategy:o,delayMs:a}=kc({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:o,delayMs:a}}}};import{Fragment as Bc,jsx as Le,jsxs as Mc}from"react/jsx-runtime";var Rc=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],Ac=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Dc(e){let t=zt(()=>Object.fromEntries(Object.entries(e.modules).map(([a,n])=>[a.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),n])),[e.modules]),o=t["react-query"];return o?.useReactQuerySyncAdapter?Le(Ec,{...e,modules:t,query:o}):Le($n,{...e,modules:t})}function Ec(e){let t=e.query.useReactQuerySyncAdapter();return Le($n,{...e,queryAdapter:t})}function $n({modules:e,apps:t,requiredEnvVars:o,externalSync:a,headless:n,sentryGetClient:i,queryAdapter:r}){let{isPro:c,tier:d}=Kl(),u=zt(()=>{let z={app:Fn};for(let[D,B]of Object.entries(e))for(let[k,v]of Object.entries(B))k.endsWith("SyncAdapter")&&v&&typeof v=="object"&&(z[D]=v);r&&(z.query=r),e.env?.createEnvSyncAdapter&&(z.env=e.env.createEnvSyncAdapter(o??[]));for(let D of t??[])D.sync&&(z[`custom:${D.id}`]=D.sync);return z},[e,t,o,r]),m=_l(u);m.current=u,kt(()=>Vl(()=>m.current),[]),kt(()=>{let z=[],D=B=>{let k=B?.();typeof k=="function"&&z.push(k)};return D(e.network?.startNetworkCapture),D(e.storage?.startBrowserStorageCapture),D(e.assets?.startBrowserAssetCapture),kn(typeof Ne<"u"?Ne:process.env.NODE_ENV!=="production")&&D(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&D(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&D(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let B of z.reverse())B()}},[e]);let I=e["external-sync"],g=kn(typeof Ne<"u"?Ne:process.env.NODE_ENV!=="production"),M=ql({isDevelopment:g,isLicensed:c,externalSync:a,isAvailable:!!I}),w=zn(a);Ul({release:!g&&!!w?.enableInRelease}),!g&&w?.enableInRelease&&Hn(Mn(w.socketURL,w));let R=e.sentry?.SentryRoot;return Mc(Bc,{children:[Object.entries(e).flatMap(([z,D])=>Rc.map(B=>{let k=D[B];return k?Le(k,{},`${z}:${B}`):null})),R&&Le(R,{getClient:i}),Object.entries(e).flatMap(([z,D])=>Ac.map(B=>{let k=D[B];return k&&(!n||B==="ScenariosOverlay"||B==="ImpersonateOverlay")?Le(k,{},`${z}:${B}`):null})),M&&Le(Pc,{module:I,tools:u,options:w,isPro:c,tier:d,dev:g})]})}var jn=null;function Hn(e){!e||e===jn||(jn=e,console.warn(e))}function Pc({module:e,tools:t,options:o,isPro:a,tier:n,dev:i}){let r=Sc(),c=uc(o,{appName:r.appName,hardwareName:r.hardwareName,platform:r.platform}),d=zt(()=>xc(o?.socketURL??(i?e.getDefaultSocketURL():Bn),!!o?.socketURL,r.platform),[o?.socketURL,i,e,r.platform]),{socket:u}=e.useExternalSyncSocket({deviceName:c?.deviceName??"Buoy Browser",socketURL:d,persistentDeviceId:r.ready?c?.deviceId??null:null,platform:r.platform,extraDeviceInfo:r.extraDeviceInfo,enableLogs:o?.enableLogs});kt(()=>{let g=Cc(d,r.platform);if(!u||!g)return;let M=()=>Hn(g);return u.on("connect_error",M),()=>{u.off("connect_error",M)}},[u,d,r.platform]),kt(()=>{if(!u)return;let g=()=>{u.connected&&Wl.hasAccountAccess()&&u.emit("device-license",{isPro:a?"1":"0",tier:n})};return g(),u.on("connect",g),()=>{u.off("connect",g)}},[u,a,n]);let m=o?.releaseActions?.join(",")??"",I=zt(()=>Xl(t,i,m?m.split(","):void 0),[t,i,m]);return e.useExternalSync({tools:I,socket:u,deviceId:r.ready?c?.deviceId??null:null,enableLogs:o?.enableLogs}),null}import{useState as Nn}from"react";import{createPortal as Oc}from"react-dom";import{useBuoySession as Lc}from"@buoy-gg/license/web";import{Fragment as _n,jsx as it,jsxs as Wn}from"react/jsx-runtime";var Un="#20C997";function Fc(){let{status:e,signIn:t,signOut:o}=Lc(),[a,n]=Nn(false),[i,r]=Nn(null);if(typeof document>"u")return null;let c=()=>{r(null),n(true),t().catch(u=>r(u instanceof Error?u.message:"Sign-in did not work. Try again.")).finally(()=>n(false))},d=e.state==="active";return Oc(it("div",{"data-buoy-signin":"",style:{position:"fixed",right:"max(16px, env(safe-area-inset-right))",bottom:"max(20px, env(safe-area-inset-bottom))",zIndex:99999,maxWidth:"min(320px, calc(100vw - 32px))",padding:d||i?"12px 14px":0,borderRadius:16,background:d||i?"#0f1419":"transparent",color:"#e6edf3",boxShadow:d||i?"0 10px 30px rgba(0,0,0,.35)":"none",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",fontSize:14,lineHeight:1.45},children:d?Wn(_n,{children:[it("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),it("button",{type:"button",onClick:()=>void o(),style:$c,"data-testid":"buoy-signout",children:"Sign out"})]}):Wn(_n,{children:[i?it("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:i}):null,it("button",{type:"button",onClick:c,disabled:a,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:Un,color:"#04130d",fontWeight:600,fontSize:14,cursor:a?"wait":"pointer",boxShadow:"0 8px 24px rgba(0,0,0,.3)"},children:a?"Signing in\u2026":"Sign in to Buoy"})]})}),document.body)}var $c={marginTop:8,padding:0,border:"none",background:"none",color:Un,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useState as jc}from"react";import{AccountSetupButton as Hc,BuoyNeedsPlanCard as Nc,BuoySignInCard as _c,useSignInState as Wc}from"@buoy-gg/shared-ui/web";import{jsx as rt,jsxs as Kn}from"react/jsx-runtime";function Vn({needsPlan:e=false}){let[t,o]=jc(false),a=Wc();return Kn(H,{pointerEvents:"box-none",style:qn.root,children:[rt(Hc,{expanded:t,onPress:()=>o(true)}),t?rt(ai,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>o(false),children:Kn(H,{style:qn.overlay,accessibilityViewIsModal:true,children:[rt(ti,{style:ct.absoluteFill,onPress:()=>o(false),accessible:false}),e&&a==="active"?rt(Nc,{onClose:()=>o(false)}):rt(_c,{onClose:()=>o(false)})]})}):null]})}var qn=ct.create({root:{position:"absolute",bottom:30,right:16,zIndex:99999},overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20}});function Gn(e){if(e.length>6){let t=e.map(o=>`"${o}"`).join(", ");return e.slice(0,6)}return e}import{Fragment as Gt,jsx as F,jsxs as st}from"react/jsx-runtime";var Jn={},Xn="@react_buoy_floating_menu_tooltip_shown",Uc=De;function Kc({size:e=14,color:t="#20C997"}){let o=Math.max(2,e/4),a=Math.max(1,e/16);return F("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${o}px)`,gap:a,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((n,i)=>F("div",{style:{width:o,height:o,borderRadius:o/2,backgroundColor:t}},i))})}function Vc(e){let{defaultFloatingTools:t,defaultDialTools:o,disableHints:a=false,children:n}=e,i=ge(()=>o&&Gn(o),[o]);return F(Fo,{defaultFloatingTools:t,defaultDialTools:i,children:F(Qi,{disableHints:a,children:st(Tn,{children:[F(an,{children:F(Qc,{...e})}),n]})})})}var qc=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function Gc({modules:e=Jn}){return F(Gt,{children:Object.entries(e).flatMap(([t,o])=>qc.map(a=>{let n=o[a];return n?F(n,{},`${t}:${a}`):null}))})}function Jc(){let{openApps:e,restore:t}=ot();return ee(()=>er(o=>{let a=e.find(n=>n.id===o);return a?(t(a.instanceId),true):false}),[e,t]),null}function Xc(){let e=Gi();return Zi((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}function Yc(e,t,o,a){let n=u=>Object.entries(e).find(([m])=>m.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===u)?.[1],i=[],r=n("env");t?.length&&r?.createEnvTool&&r.createEnvVarConfig&&i.push(at(r.createEnvTool({requiredEnvVars:r.createEnvVarConfig(t)})));let c=n("storage");o?.length&&c?.createStorageTool&&i.push(at(c.createStorageTool({requiredStorageKeys:o})));let d=n("ask-buoy");return a&&d?.createAskBuoyTool&&i.push(at(d.createAskBuoyTool(a))),i}function Qc({environment:e,userRole:t="admin",availableEnvironments:o,onEnvironmentSwitch:a,apps:n,modules:i=Jn,externalSync:r,requiredEnvVars:c,sentryGetClient:d,disableHints:u=false,headless:m=false,hidden:I=false,defaultFloatingTools:g,defaultDialTools:M,zustandStores:w,requiredStorageKeys:R,askBuoy:z}){let D=e??Xc(),B=ge(()=>M?Gn(M):void 0,[M]),[k,v]=Mt(false),[T,O]=Mt(false),C=or(false),A=ot(),Z=ge(()=>Yc(i,c,R,z),[i,c,R,z]),_=ge(()=>eo([...In(i),...n??[],...Z]),[n,i,Z]),q=ge(()=>Object.entries(i).find(([l])=>l.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[i]);ee(()=>{if(!w||typeof q?.watchStores!="function")return;let l=q.watchStores(w);return typeof l=="function"?l:void 0},[w,q]);let te=Kt(),K=A.openApps.some(l=>!l.minimized);ee(()=>{te.setDialOpen(k)},[k,te.setDialOpen]),ee(()=>{te.setToolOpen(K||T)},[K,T,te.setToolOpen]);let{registerApps:ie}=A;ee(()=>{ie(_.map(l=>{let N=l.icon;return{...l,icon:typeof N=="function"?({size:b})=>N(b):N}}))},[ie,_]);let oe=ge(()=>_.map(l=>({id:l.id,name:l.name,description:l.description,slot:l.slot})),[_]);nr({availableTools:oe,storage:Uc}),ee(()=>{let l=false;return(async()=>{let[N,b]=await Promise.all([De.getItem(ut.dial.isOpen()),De.getItem(ut.settings.modalOpen())]);l||(N==="true"&&v(true),b==="true"&&(v(true),O(true)),C.current=true)})(),()=>{l=true}},[]),ee(()=>{C.current&&De.setItem(ut.dial.isOpen(),k?"true":"false")},[k]),ee(()=>{C.current&&De.setItem(ut.settings.modalOpen(),T?"true":"false")},[T]);let ve=_e(l=>{if(Qr(l.id),l.launchMode==="toggle-only"){l.onPress?.();return}if(l.component){let N=typeof l.icon=="function"?l.icon(20):l.icon;A.open({id:l.id,title:l.name||dt(l.id),component:l.component,props:l.props,modal:l.modal,launchMode:l.launchMode||"self-modal",singleton:l.singleton??true,icon:N,color:l.color||Zt(l.id)})}else l.onPress?.()},[A]),re=ge(()=>Rt(_,"dial").map(l=>{let N=l.color||Zt(l.id),b;return typeof l.icon=="string"?b=l.icon:typeof l.icon=="function"?b=l.icon(32):b=null,{id:l.id,name:l.name||dt(l.id),icon:b,unavailable:!l.component&&!l.onPress,color:N,onPress:()=>{ve(l),v(false)}}}),[_,ve]),Ie=ge(()=>{if(!k)return re;let l=new Map(re.map(N=>[N.id,N]));return Yr(re.map(N=>N.id)).map(N=>l.get(N)).filter(N=>!!N)},[k,re]),{settings:$}=Uo(),qe=ge(()=>Rt(_,"row").filter(l=>($.floatingTools[l.id]??false)===true&&(l.component||l.onPress)),[_,$.floatingTools]),ke=ge(()=>_.map(l=>({id:l.id,name:l.name||dt(l.id),description:l.description||ar(l.id),slot:l.slot,icon:l.icon,color:l.color})),[_]),[Fe,ze]=Mt(false),se=A.openApps.some(l=>!l.minimized);ee(()=>{if(u)return;let l=false,N=setTimeout(async()=>{let b=await De.getItem(Xn);!l&&!b&&ze(true)},1e3);return()=>{l=true,clearTimeout(N)}},[u]);let J=_e(()=>{ze(false),De.setItem(Xn,"true")},[]),Se=_e(()=>{J(),v(true)},[J]),pe=_e(()=>{v(false),O(false)},[]),Be=_e(()=>{O(l=>!l)},[]),$e=_e(()=>O(false),[]),he=!!(o?.length&&a),Me=$.floatingTools.environment!==false,ue=Fe&&!k&&!se&&!I;ee(()=>{if(!ue)return;let l=b=>{(!(b.target instanceof Element)||!b.target.closest("[data-buoy-root]"))&&J()},N=b=>{b.key==="Escape"&&J()};return document.addEventListener("pointerdown",l,true),document.addEventListener("keydown",N),()=>{document.removeEventListener("pointerdown",l,true),document.removeEventListener("keydown",N)}},[ue,J]);let ye=A.openApps.some(l=>l.minimized&&l.launchMode!=="toggle-only"),Re=F(Dc,{modules:i,apps:n,requiredEnvVars:c,externalSync:r,headless:m,sentryGetClient:d});return m?Re:st("div",{"data-buoy-root":"",style:{display:"contents"},children:[Re,F(Jc,{}),ue&&F("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),F("div",{style:I?{visibility:"hidden"}:{display:"contents"},"aria-hidden":I||void 0,children:st(to,{enablePositionPersistence:!ue,pushToSide:k||se,suspendPointerEvents:k,centerOnboarding:ue,minimizedStack:ye?F(El,{}):void 0,hasMinimizedStack:ye,children:[D&&Me&&!he&&F(ir,{environment:D}),he&&Me&&F(rr,{currentEnvironment:D??"local",availableEnvironments:o,onSelect:a}),t?F(oo,{userRole:t,onPress:Se}):F("button",{"aria-label":"Open dev tools",onClick:Se,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:F(Kc,{})}),qe.map(l=>F("button",{"aria-label":l.name||dt(l.id),title:l.description,onClick:()=>ve(l),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof l.icon=="function"?l.icon(16):l.icon},l.id))]})}),ue&&F(bo,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:J}),k&&!I&&F(Co,{icons:Ie,onClose:pe,centerLabel:"BUOY",onCenterPress:Be,settingsOpen:T,hintsDisabled:u}),T&&!I&&F(Vo,{visible:true,onClose:$e,availableTools:ke,defaultFloatingTools:g,defaultDialTools:B,onSettingsChange:l=>{}}),!I&&st(Gt,{children:[F(rn,{}),F(_i,{})]})]})}function Zc(e){let t=e&&typeof e=="object"?e.appId:void 0,o=!!e;ee(()=>{if(!o)return;let a=false,n=Wi.SessionManager;if(!n)return;let i=r=>{a||!r||(n.configure({audience:`app:${r}`}),n.load().catch(()=>{}))};return t?i(t):Xi().then(r=>i(r?.bundleId)).catch(()=>{}),()=>{a=true}},[o,t])}function ed(e){let{access:t,isPro:o,licenseKey:a}=Ki();ee(()=>{Ui.configure(e.licenseKey)},[e.licenseKey]);let n=e.licenseKey===void 0||Vi(e.licenseKey,a),i=qi(typeof Ne<"u"?Ne:process.env.NODE_ENV!=="production"),r=n&&t.status==="admitted";ee(()=>{r&&tr()},[r]),ee(()=>{i||t.status==="initializing"||(o&&r?Ni():Yt())},[i,o,r,t.status]);let c=Ji();return Zc(c?e.signIn:void 0),!i&&!o?!e.signIn||e.headless?null:c?F(Vn,{needsPlan:true}):F(Fc,{}):r?F(Vc,{...e}):st(Gt,{children:[t.status==="initializing"&&F(Gc,{modules:e.modules}),e.headless?null:e.signIn&&c?F(Vn,{}):F(Yi,{})]})}import{useSettings as td,useFloatingTools as od,getToolLabel as nd,getToolDescription as ad,getToolColor as id,settingsColors as rd,settingsStyles as sd,dialColors as ld,dialStyles as cd}from"@buoy-gg/floating-tools-react/web";import{LicenseManager as dd}from"@buoy-gg/license/web";export{Pa as Activity,ta as AlertCircle,La as AlertTriangle,an as AppHostProvider,rn as AppOverlay,yi as Badge,na as BarChart3,la as BaseEventStore,ia as Bookmark,$a as Bug,zi as Button,Oi as Card,Ha as Check,_a as CheckCircle,Na as CheckSquare,Ua as ChevronDown,Va as ChevronLeft,Ga as ChevronRight,Xa as ChevronUp,Yn as Clock,sa as Cloud,ji as CollapsibleSection,Qa as Copy,Mi as CopyButton,ra as DataViewer,Za as Database,Tn as DevToolsVisibilityProvider,Co as DialMenu,Ci as DiffViewer,dr as Divider,ca as Download,ua as Edit3,ea as EmptyState,aa as EventStepperFooter,ei as Eye,oi as EyeOff,ni as FileJson,ii as FileText,ri as Filter,si as FlaskConical,ed as FloatingDevTools,to as FloatingTools,ma as GitBranch,li as Globe,fa as HardDrive,ci as Hash,ya as HelpCircle,va as Home,wa as Image,di as Info,wi as InfoRow,Da as JsModal,pi as Key,gi as Layers,dd as LicenseManager,Ca as Link,hi as Lock,Ia as Maximize2,za as Minus,Ma as Palette,bi as Pause,Aa as Pin,Si as Play,xi as Plus,Ti as Power,Ai as PowerToggle,ki as RefreshCw,da as RelativeTime,Ea as Route,Ei as Row,Bi as Search,oa as SearchBar,Fi as SectionHeader,Oa as Server,Ri as Settings,Vo as SettingsModal,Di as Shield,Fa as Smartphone,ja as Square,vi as StatusDot,Qn as TabSelector,Wa as Timer,Pi as Trash2,Ka as Unlock,qa as Upload,Li as User,oo as UserStatus,Ja as Users,$i as Wifi,Hi as X,Ya as XCircle,Zn as Zap,Fn as appSyncAdapter,lr as autoDiscoverWebPresets,eo as autoDiscoverWithCustom,Yt as clearReleaseOptIn,Ra as copyToClipboard,at as createWebTool,In as createWebTools,sr as defaultToolPresets,ka as devToolsStorageKeys,ld as dialColors,cd as dialStyles,pa as formatBytes,ga as formatDuration,ha as formatNumber,cr as getEnabledTools,id as getToolColor,ad as getToolDescription,nd as getToolLabel,Rt as getToolsBySlot,pl as isBuoyHoldingBackButton,mi as methodColor,Ta as persistentStorage,Sa as safeStringify,rd as settingsColors,sd as settingsStyles,ui as statusColor,Ii as toolTheme,ba as truncateMiddle,fi as typeColor,ot as useAppHost,Kt as useDevToolsVisibility,od as useFloatingTools,xa as usePersistedState,Ba as useSafeAreaInsets,td as useSettings,al as useToolHeader,en as useToolHost};
|
package/lib/web/toolkit.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{$ as a
|
|
1
|
+
"use client";import{$ as a,A as s,Aa as e,B as o,Ba as t,C as r,Ca as i,D as l,Da as n,E as C,Ea as c,F as S,Fa as h,G as p,Ga as u,H as m,Ha as d,I as f,Ia as y,J as v,Ja as g,K as B,Ka as k,L as w,La as T,M as D,Ma as P,N as E,Na as b,O as F,Oa as H,P as R,Pa as A,Q as I,Qa as L,R as M,Ra as U,S as x,Sa as q,T as G,Ta as J,U as K,Ua as z,V as N,Va as O,W as V,Wa as X,X as W,Xa as Z,Y as j,Ya as Q,Z as Y,Za as _,_ as $,_a as aa,aa as sa,ba as ea,ca as oa,da as ta,ea as ra,fa as ia,ga as la,ha as na,ia as Ca,ja as ca,ka as Sa,l as ha,la as pa,m as ua,ma,n as da,na as fa,o as ya,oa as va,p as ga,pa as Ba,q as ka,qa as wa,r as Ta,ra as Da,s as Pa,sa as Ea,t as ba,ta as Fa,u as Ha,ua as Ra,v as Aa,va as Ia,w as La,wa as Ma,x as Ua,xa,y as qa,ya as Ga,z as Ja,za as Ka}from"./chunks/chunk-T6BXEQLL.mjs";import"./chunks/chunk-CLXYMJTS.mjs";export{x as Activity,t as AlertCircle,G as AlertTriangle,ya as Badge,i as BarChart3,S as BaseEventStore,n as Bookmark,K as Bug,ba as Button,Ua as Card,N as Check,V as CheckCircle,O as CheckSquare,W as ChevronDown,j as ChevronLeft,Y as ChevronRight,$ as ChevronUp,a as Clock,c as Cloud,Ja as CollapsibleSection,sa as Copy,Ha as CopyButton,C as DataViewer,ea as Database,Ta as DiffViewer,h as Download,u as Edit3,o as EmptyState,l as EventStepperFooter,oa as Eye,ta as EyeOff,ra as FileJson,ia as FileText,la as Filter,na as FlaskConical,d as GitBranch,Ca as Globe,y as HardDrive,ca as Hash,g as HelpCircle,k as Home,T as Image,Sa as Info,ka as InfoRow,M as JsModal,pa as Key,ma as Layers,P as Link,fa as Lock,b as Maximize2,H as Minus,A as Palette,va as Pause,L as Pin,Ba as Play,wa as Plus,Da as Power,Aa as PowerToggle,Ea as RefreshCw,p as RelativeTime,U as Route,La as Row,Fa as Search,r as SearchBar,qa as SectionHeader,q as Server,Ra as Settings,Ia as Shield,J as Smartphone,z as Square,ga as StatusDot,s as TabSelector,X as Timer,Ma as Trash2,Z as Unlock,Q as Upload,xa as User,_ as Users,Ga as Wifi,Ka as X,aa as XCircle,e as Zap,I as copyToClipboard,F as devToolsStorageKeys,m as formatBytes,f as formatDuration,v as formatNumber,ua as methodColor,E as persistentStorage,w as safeStringify,ha as statusColor,Pa as toolTheme,B as truncateMiddle,da as typeColor,D as usePersistedState,R as useSafeAreaInsets};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/core",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.60",
|
|
4
4
|
"description": "Floating developer menu and account setup for React Native. Add tool packages and configure Desktop or MCP connections separately.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"react-devtools-core": "6.1.5",
|
|
64
|
-
"@buoy-gg/floating-tools-
|
|
65
|
-
"@buoy-gg/
|
|
66
|
-
"@buoy-gg/
|
|
67
|
-
"@buoy-gg/
|
|
64
|
+
"@buoy-gg/floating-tools-core": "^7.0.60",
|
|
65
|
+
"@buoy-gg/floating-tools-react": "^7.0.60",
|
|
66
|
+
"@buoy-gg/shared-ui": "^7.0.60",
|
|
67
|
+
"@buoy-gg/license": "^7.0.60"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"react": "*"
|