@buoy-gg/core 7.0.61 → 7.0.63
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/README.md +3 -0
- package/bundlers/vite.d.ts +36 -0
- package/bundlers/vite.mjs +6 -0
- package/lib/commonjs/auto.web.js +1 -0
- package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -1
- package/lib/commonjs/installedTools.js +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/auto.web.js +1 -0
- package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -1
- package/lib/module/installedTools.js +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/auto.web.d.ts +21 -0
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +11 -4
- package/lib/typescript/commonjs/installedTools.d.ts +14 -0
- package/lib/typescript/commonjs/version.d.ts +1 -1
- package/lib/typescript/module/auto.web.d.ts +21 -0
- package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +11 -4
- package/lib/typescript/module/installedTools.d.ts +14 -0
- package/lib/typescript/module/version.d.ts +1 -1
- package/lib/web/auto.mjs +1 -0
- package/lib/web/chunks/FloatingDevTools.web-M3ASH5EV.mjs +1 -0
- package/lib/web/chunks/chunk-3YORPV22.mjs +10 -0
- package/lib/web/chunks/chunk-7G3P7Z7K.mjs +1 -0
- package/lib/web/chunks/chunk-ZD6O2YPD.mjs +1 -0
- package/lib/web/index.mjs +1 -10
- package/lib/web/installed-tools.mjs +1 -0
- package/lib/web/register.mjs +1 -1
- package/lib/web/toolkit.mjs +1 -1
- package/package.json +19 -6
- package/lib/web/chunks/chunk-T6BXEQLL.mjs +0 -1
package/README.md
CHANGED
|
@@ -12,6 +12,9 @@ The floating developer-tools menu for your React Native app. Add the tool packag
|
|
|
12
12
|
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
|
+
Capacitor / Ionic (Beta) uses this package through `/web`.
|
|
16
|
+
See the [setup guide](https://buoy.gg/buoy/latest/docs/capacitor) for steps and limits.
|
|
17
|
+
|
|
15
18
|
## Install
|
|
16
19
|
|
|
17
20
|
```bash
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface BuoyVitePluginOptions {
|
|
2
|
+
/** Installed tools to leave out, by package name, such as `['tv-remote']`. */
|
|
3
|
+
exclude?: string[];
|
|
4
|
+
/**
|
|
5
|
+
* Add `import '@buoy-gg/core/web/register'` ahead of index.html's first
|
|
6
|
+
* module script. Defaults to true. Turn it off if you import it yourself in
|
|
7
|
+
* a page with no index.html.
|
|
8
|
+
*/
|
|
9
|
+
register?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Buoy for Vite: loads every installed tool into FloatingDevTools and
|
|
14
|
+
* BuoyDevTools when they get no `modules`, and adds the early hook to
|
|
15
|
+
* index.html. Vite accepts it without a runtime dependency on Vite.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buoy(options?: BuoyVitePluginOptions): {
|
|
18
|
+
name: string;
|
|
19
|
+
enforce: 'pre';
|
|
20
|
+
config(config: any): any;
|
|
21
|
+
configResolved(config: any): void;
|
|
22
|
+
configureServer(server: any): void;
|
|
23
|
+
closeBundle(): void;
|
|
24
|
+
resolveId(source: string): string | undefined;
|
|
25
|
+
load(id: string): string | undefined;
|
|
26
|
+
transformIndexHtml: { order: 'pre'; handler(html: string): string };
|
|
27
|
+
};
|
|
28
|
+
export default buoy;
|
|
29
|
+
|
|
30
|
+
export declare function findInstalledTools(root: string, options?: { exclude?: string[] }): {
|
|
31
|
+
found: { id: string; key: string }[];
|
|
32
|
+
missingWeb: string[];
|
|
33
|
+
};
|
|
34
|
+
export declare function installedToolsModule(found: { id: string; key: string }[], options?: { assetList?: string }): string;
|
|
35
|
+
export declare function injectRegister(html: string): string | undefined;
|
|
36
|
+
export declare function assetListUrl(base: string, filename: string, command: 'serve' | 'build'): string | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{existsSync as h,readFileSync as m}from"node:fs";import l from"node:path";const $=[["network","network"],["storage","storage"],["events","events"],["console","console"],["env","env"],["redux","redux"],["zustand","zustand"],["jotai","jotai"],["react-query","react-query"],["route-events","route-events"],["time-machine","time-machine"],["clock","clock"],["lifecycle","lifecycle"],["location","location"],["permissions","permissions"],["notifications","push-notifications"],["scenarios","scenarios"],["sentry","sentry"],["ask-buoy","ask-buoy"],["impersonate","impersonate"],["perf-monitor","perf-monitor"],["js-top","js-top"],["highlight-updates","highlight-updates"],["debug-borders","debug-borders"],["images","images"],["assets","assets"],["image-overlay","image-overlay"],["tv-remote","tv-remote"],["focus-inspector","focus-inspector"],["external-sync","external-sync"]];const w="@buoy-gg/core/web/installed-tools";const g="@buoy-gg/core/web/register";const v="\0buoy:installed-tools";function y(t){for(let s=t;;s=l.dirname(s)){const e=l.join(s,"package.json");if(h(e))return e;if(l.dirname(s)===s)return void 0}}function x(t,s){for(let e=t;;e=l.dirname(e)){const o=l.join(e,"node_modules",s,"package.json");if(h(o)){try{return JSON.parse(m(o,"utf8"))}catch{return void 0}}if(l.dirname(e)===e)return void 0}}export function findInstalledTools(t,{exclude:s=[]}={}){const e=y(t);let o;try{const r=e?JSON.parse(m(e,"utf8")):{};const n={...r.dependencies,...r.devDependencies,...r.optionalDependencies,...r.peerDependencies};if(n["@buoy-gg/core"])o=new Set(Object.keys(n))}catch{}const i=new Set(s.map(r=>r.replace(/^@buoy-gg\//,"")));const d=[];const c=[];for(const[r,n]of $){const a=`@buoy-gg/${r}`;if(i.has(r)||i.has(n)||o&&!o.has(a))continue;const u=x(t,a);if(!u)continue;if(u.exports&&typeof u.exports==="object"&&u.exports["./web"])d.push({id:a,key:n});else c.push(a)}return{found:d,missingWeb:c}}export function installedToolsModule(t,{assetList:s}={}){const e=t.map(({id:c},r)=>`import * as t${r} from ${JSON.stringify(`${c}/web`)};`);const o=t.map(({key:c},r)=>`${JSON.stringify(c)}: t${r}`);const i=t.findIndex(({key:c})=>c==="assets");const d=s&&i!==-1?`t${i}.loadBrowserAssetManifest?.(${JSON.stringify(s)})?.catch?.(() => {});
|
|
2
|
+
`:"";return`${e.join("\n")}
|
|
3
|
+
${d}export const installedTools = { ${o.join(", ")} };
|
|
4
|
+
export const installedToolsFound = true;
|
|
5
|
+
`}function j(t){return t.replace(/<!--[\s\S]*?(?:-->|$)/g,s=>" ".repeat(s.length))}export function injectRegister(t){const s=`<script type="module">import ${JSON.stringify(g)};<\/script>`;const e=j(t).search(/<script\b[^>]*\btype\s*=\s*["']?module["']?[^>]*>/i);return e===-1?void 0:`${t.slice(0,e)}${s}
|
|
6
|
+
${t.slice(e)}`}function S(t,s){const e=y(t);const o=new Set(s.map(i=>i.replace(/^@buoy-gg\//,"")));try{const i=e?JSON.parse(m(e,"utf8")):{};const d={...i.dependencies,...i.devDependencies,...i.optionalDependencies,...i.peerDependencies};return $.filter(([c,r])=>d[`@buoy-gg/${c}`]&&!o.has(c)&&!o.has(r)).map(([c])=>`@buoy-gg/${c}`).join()}catch{return""}}export function assetListUrl(t,s,e){const o=e==="serve"&&!/^(?:\/|[a-z]+:)/i.test(t)?"/":t;return/^(?:\/|[a-z]+:)/i.test(o)?`${o.endsWith("/")?o:`${o}/`}${s}`:void 0}export function buoy({exclude:t=[],register:s=true}={}){let e={found:[],missingWeb:[]};let o=process.cwd();let i;let d;let c;const r=()=>{clearInterval(c);c=void 0};return{name:"buoy",enforce:"pre",config(n){o=l.resolve(n.root??process.cwd());e=findInstalledTools(o,{exclude:t});const a=e.found.map(({id:u})=>`${u}/web`);if(s)a.unshift(g);return{optimizeDeps:{exclude:[w],include:a}}},configResolved(n){i=n.logger;const a=n.plugins.find(f=>f.name==="buoy-asset-manifest");d=a?assetListUrl(n.base,a.api?.filename??"buoy-assets.json",n.command):void 0;if(a&&!d)i.warn(`[buoy] base '${n.base}' is relative, so load the asset list yourself with loadBrowserAssetManifest().`);if(n.command!=="serve")return;const u=e.found.map(({key:f})=>f).join(", ")||"none";i.info(`[buoy] tools: ${u}`);if(e.missingWeb.length)i.warn(`[buoy] these have no browser build; update them to the same release as @buoy-gg/core: ${e.missingWeb.join(", ")}`)},configureServer(n){const a=y(o);if(!a)return;const u=p=>p.map(({id:k})=>k).join();const f=()=>{if(u(findInstalledTools(o,{exclude:t}).found)===u(e.found))return false;r();void n.restart();return true};const b=()=>{r();if(S(o,t)===u(e.found))return;let p=0;c=setInterval(()=>{if(!f()&&++p>=120)r()},1e3)};n.watcher.add(a);n.watcher.on("change",p=>{if(l.resolve(p)===l.resolve(a)&&!f())b()});b()},closeBundle(){r()},resolveId(n){if(n===w)return v;return void 0},load(n){if(n===v)return installedToolsModule(e.found,{assetList:d});return void 0},transformIndexHtml:{order:"pre",handler(n){if(!s)return n;const a=injectRegister(n);if(a===void 0)i?.warn(`[buoy] index.html has no module script, so the early hook wasn't added. Import '${g}' first in your entry file.`);return a??n}}}}export default buoy;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.BuoyDevTools=BuoyDevTools;exports.shouldShowBuoy=shouldShowBuoy;var _react=require("react");function _interopRequireWildcard(t,o){if("function"==typeof WeakMap)var i=new WeakMap,l=new WeakMap;return(_interopRequireWildcard=function(e,f){if(!f&&e&&e.__esModule)return e;var r,a,u={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return u;if(r=f?l:i){if(r.has(e))return r.get(e);r.set(e,u)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(u,n,a):u[n]=e[n]);return u})(t,o)}function shouldShowBuoy(){if(typeof window==="undefined")return false;const t=window.Capacitor;let o=false;try{o=t?.isNativePlatform?.()===true}catch{o=false}if(o)return t?.DEBUG===true;return typeof __DEV__!=="undefined"?Boolean(__DEV__):process.env.NODE_ENV!=="production"}let host;function loadHost(){host??=(0,_react.lazy)(()=>Promise.resolve().then(()=>_interopRequireWildcard(require("./floatingMenu/FloatingDevTools.web"))).then(t=>({default:t.FloatingDevTools})));return host}function BuoyDevTools({enabled:t,...o}){const[i,l]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{l(t??shouldShowBuoy())},[t]);if(!i)return null;return(0,_react.createElement)(_react.Suspense,{fallback:null},(0,_react.createElement)(loadHost(),o))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FloatingDevTools=FloatingDevTools;var _floating=require("@buoy-gg/shared-ui/floating");var _license=_interopRequireWildcard(require("@buoy-gg/license"));var licenseModule=_license;var _sharedUi=require("@buoy-gg/shared-ui");var _react=require("react");var _floatingToolsReact=require("@buoy-gg/floating-tools-react");var _autoDiscoverPresetsWeb=require("../utils/autoDiscoverPresets.web.js");var _floatingToolsWeb=require("./floatingTools.web.js");var _DialDevToolsWeb=require("./dial/DialDevTools.web.js");var _dialUsageStore=require("./dial/dialUsageStore.js");var _OnboardingTooltipWeb=require("./dial/OnboardingTooltip.web.js");var _DevToolsSettingsModalWeb=require("./DevToolsSettingsModal.web.js");var _AppHostWeb=require("./AppHost.web.js");var _MinimizedToolsStackWeb=require("./MinimizedToolsStack.web.js");var _createWebTools=require("../utils/createWebTools.js");var _BrowserToolRuntime=require("./BrowserToolRuntime.js");var _releaseOptIn=require("../releaseOptIn.js");var _BuoySignInWeb=require("./BuoySignIn.web.js");var _BuoyCodeSignIn=require("./BuoyCodeSignIn.js");var _DevToolsVisibilityContext=require("./DevToolsVisibilityContext.js");var _createWebTool=require("../utils/createWebTool.js");var _DefaultConfigContext=require("./DefaultConfigContext.js");var _DevToolsSettingsModalShared=require("./DevToolsSettingsModal.shared.js");var _defaultConfig=require("./defaultConfig.js");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(n,i){if("function"==typeof WeakMap)var s=new WeakMap,l=new WeakMap;return(_interopRequireWildcard=function(t,r){if(!r&&t&&t.__esModule)return t;var a,c,f={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return f;if(a=r?l:s){if(a.has(t))return a.get(t);a.set(t,f)}for(const u in t)"default"!==u&&{}.hasOwnProperty.call(t,u)&&((c=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,u))&&(c.get||c.set)?a(f,u,c):f[u]=t[u]);return f})(n,i)}const EMPTY_MODULES={};const MENU_TOOLTIP_KEY="@react_buoy_floating_menu_tooltip_shown";const webSettingsStorage=_sharedUi.persistentStorage;function MenuLauncherIcon({size:n=14,color:i="#20C997"}){const s=Math.max(2,n/4);const l=Math.max(1,n/16);return(0,_jsxRuntime.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${s}px)`,gap:l,width:n,height:n,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((t,r)=>(0,_jsxRuntime.jsx)("div",{style:{width:s,height:s,borderRadius:s/2,backgroundColor:i}},r))})}function AdmittedFloatingDevTools(n){const{defaultFloatingTools:i,defaultDialTools:s,disableHints:l=false,children:t}=n;const r=(0,_react.useMemo)(()=>s?(0,_defaultConfig.validateDialConfig)(s):s,[s]);return(0,_jsxRuntime.jsx)(_DefaultConfigContext.DefaultConfigProvider,{defaultFloatingTools:i,defaultDialTools:r,children:(0,_jsxRuntime.jsx)(_sharedUi.HintsProvider,{disableHints:l,children:(0,_jsxRuntime.jsxs)(_DevToolsVisibilityContext.DevToolsVisibilityProvider,{children:[(0,_jsxRuntime.jsx)(_AppHostWeb.AppHostProvider,{children:(0,_jsxRuntime.jsx)(FloatingDevToolsInner,{...n})}),t]})})})}const STARTUP_ROOTS=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function StartupCapture({modules:n=EMPTY_MODULES}){return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:Object.entries(n).flatMap(([i,s])=>STARTUP_ROOTS.map(l=>{const t=s[l];return t?(0,_jsxRuntime.jsx)(t,{},`${i}:${l}`):null}))})}function WebToolOpenerBridge(){const{openApps:n,restore:i}=(0,_AppHostWeb.useAppHost)();(0,_react.useEffect)(()=>(0,_sharedUi.registerToolOpener)(s=>{const l=n.find(t=>t.id===s);if(!l)return false;i(l.instanceId);return true}),[n,i]);return null}function defaultEnvironment(){const n=(0,_license.capacitorDebug)();const i=n===null?process.env.NODE_ENV:n?"development":"production";return(0,_sharedUi.normalizeEnvironment)(i??"dev")}function configOverrides(n,i,s,l){const t=u=>Object.entries(n).find(([S])=>S.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===u)?.[1];const r=[];const a=t("env");if(i?.length&&a?.createEnvTool&&a.createEnvVarConfig){r.push((0,_createWebTool.createWebTool)(a.createEnvTool({requiredEnvVars:a.createEnvVarConfig(i)})))}const c=t("storage");if(s?.length&&c?.createStorageTool){r.push((0,_createWebTool.createWebTool)(c.createStorageTool({requiredStorageKeys:s})))}const f=t("ask-buoy");if(l&&f?.createAskBuoyTool)r.push((0,_createWebTool.createWebTool)(f.createAskBuoyTool(l)));return r}function FloatingDevToolsInner({environment:n,userRole:i="admin",availableEnvironments:s,onEnvironmentSwitch:l,apps:t,modules:r=EMPTY_MODULES,externalSync:a,requiredEnvVars:c,sentryGetClient:f,disableHints:u=false,headless:S=false,hidden:v=false,defaultFloatingTools:U,defaultDialTools:C,zustandStores:O,requiredStorageKeys:P,askBuoy:W}){const E=n??defaultEnvironment();const N=(0,_react.useMemo)(()=>C?(0,_defaultConfig.validateDialConfig)(C):void 0,[C]);const[g,h]=(0,_react.useState)(false);const[m,x]=(0,_react.useState)(false);const M=(0,_react.useRef)(false);const b=(0,_AppHostWeb.useAppHost)();const q=(0,_react.useMemo)(()=>configOverrides(r,c,P,W),[r,c,P,W]);const p=(0,_react.useMemo)(()=>(0,_autoDiscoverPresetsWeb.autoDiscoverWithCustom)([...(0,_createWebTools.createWebTools)(r),...t??[],...q]),[t,r,q]);const w=(0,_react.useMemo)(()=>Object.entries(r).find(([e])=>e.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[r]);(0,_react.useEffect)(()=>{if(!O||typeof w?.watchStores!=="function")return;const e=w.watchStores(O);return typeof e==="function"?e:void 0},[O,w]);const _=(0,_DevToolsVisibilityContext.useDevToolsVisibility)();const A=b.openApps.some(e=>!e.minimized);(0,_react.useEffect)(()=>{_.setDialOpen(g)},[g,_.setDialOpen]);(0,_react.useEffect)(()=>{_.setToolOpen(A||m)},[A,m,_.setToolOpen]);const{registerApps:R}=b;(0,_react.useEffect)(()=>{R(p.map(e=>{const o=e.icon;return{...e,icon:typeof o==="function"?({size:d})=>o(d):o}}))},[R,p]);const $=(0,_react.useMemo)(()=>p.map(e=>({id:e.id,name:e.name,description:e.description,slot:e.slot})),[p]);(0,_floatingToolsReact.useSettings)({availableTools:$,storage:webSettingsStorage});(0,_react.useEffect)(()=>{let e=false;const o=async()=>{const[d,j]=await Promise.all([_sharedUi.persistentStorage.getItem(_sharedUi.devToolsStorageKeys.dial.isOpen()),_sharedUi.persistentStorage.getItem(_sharedUi.devToolsStorageKeys.settings.modalOpen())]);if(e)return;if(d==="true")h(true);if(j==="true"){h(true);x(true)}M.current=true};void o();return()=>{e=true}},[]);(0,_react.useEffect)(()=>{if(!M.current)return;void _sharedUi.persistentStorage.setItem(_sharedUi.devToolsStorageKeys.dial.isOpen(),g?"true":"false")},[g]);(0,_react.useEffect)(()=>{if(!M.current)return;void _sharedUi.persistentStorage.setItem(_sharedUi.devToolsStorageKeys.settings.modalOpen(),m?"true":"false")},[m]);const I=(0,_react.useCallback)(e=>{void(0,_dialUsageStore.recordToolUsage)(e.id);if(e.launchMode==="toggle-only"){e.onPress?.();return}if(e.component){const o=typeof e.icon==="function"?e.icon(20):e.icon;b.open({id:e.id,title:e.name||(0,_floatingToolsReact.getToolLabel)(e.id),component:e.component,props:e.props,modal:e.modal,launchMode:e.launchMode||"self-modal",singleton:e.singleton??true,icon:o,color:e.color||(0,_floatingToolsReact.getToolColor)(e.id)})}else{e.onPress?.()}},[b]);const D=(0,_react.useMemo)(()=>{const e=(0,_autoDiscoverPresetsWeb.getToolsBySlot)(p,"dial");return e.map(o=>{const d=o.color||(0,_floatingToolsReact.getToolColor)(o.id);let j;if(typeof o.icon==="string"){j=o.icon}else if(typeof o.icon==="function"){j=o.icon(32)}else{j=null}return{id:o.id,name:o.name||(0,_floatingToolsReact.getToolLabel)(o.id),icon:j,unavailable:!o.component&&!o.onPress,color:d,onPress:()=>{I(o);h(false)}}})},[p,I]);const Y=(0,_react.useMemo)(()=>{if(!g)return D;const e=new Map(D.map(o=>[o.id,o]));return(0,_dialUsageStore.getRankedToolIds)(D.map(o=>o.id)).map(o=>e.get(o)).filter(o=>Boolean(o))},[g,D]);const{settings:k}=(0,_DevToolsSettingsModalShared.useDevToolsSettings)();const G=(0,_react.useMemo)(()=>(0,_autoDiscoverPresetsWeb.getToolsBySlot)(p,"row").filter(e=>(k.floatingTools[e.id]??false)===true&&(e.component||e.onPress)),[p,k.floatingTools]);const Q=(0,_react.useMemo)(()=>p.map(e=>({id:e.id,name:e.name||(0,_floatingToolsReact.getToolLabel)(e.id),description:e.description||(0,_floatingToolsReact.getToolDescription)(e.id),slot:e.slot,icon:e.icon,color:e.color})),[p]);const[J,B]=(0,_react.useState)(false);const L=b.openApps.some(e=>!e.minimized);(0,_react.useEffect)(()=>{if(u)return;let e=false;const o=setTimeout(async()=>{const d=await _sharedUi.persistentStorage.getItem(MENU_TOOLTIP_KEY);if(!e&&!d)B(true)},1e3);return()=>{e=true;clearTimeout(o)}},[u]);const T=(0,_react.useCallback)(()=>{B(false);void _sharedUi.persistentStorage.setItem(MENU_TOOLTIP_KEY,"true")},[]);const F=(0,_react.useCallback)(()=>{T();h(true)},[T]);const X=(0,_react.useCallback)(()=>{h(false);x(false)},[]);const Z=(0,_react.useCallback)(()=>{x(e=>!e)},[]);const ee=(0,_react.useCallback)(()=>x(false),[]);const z=Boolean(s?.length&&l);const K=k.floatingTools.environment!==false;const y=J&&!g&&!L&&!v;(0,_react.useEffect)(()=>{if(!y)return;const e=d=>{if(!(d.target instanceof Element)||!d.target.closest("[data-buoy-root]"))T()};const o=d=>{if(d.key==="Escape")T()};document.addEventListener("pointerdown",e,true);document.addEventListener("keydown",o);return()=>{document.removeEventListener("pointerdown",e,true);document.removeEventListener("keydown",o)}},[y,T]);const V=b.openApps.some(e=>e.minimized&&e.launchMode!=="toggle-only");const H=(0,_jsxRuntime.jsx)(_BrowserToolRuntime.BrowserToolRuntime,{modules:r,apps:t,requiredEnvVars:c,externalSync:a,headless:S,sentryGetClient:f});if(S)return H;return(0,_jsxRuntime.jsxs)("div",{"data-buoy-root":"",style:{display:"contents"},children:[H,(0,_jsxRuntime.jsx)(WebToolOpenerBridge,{}),y&&(0,_jsxRuntime.jsx)("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),(0,_jsxRuntime.jsx)("div",{style:v?{visibility:"hidden"}:{display:"contents"},"aria-hidden":v||void 0,children:(0,_jsxRuntime.jsxs)(_floatingToolsWeb.FloatingTools,{enablePositionPersistence:!y,pushToSide:g||L,suspendPointerEvents:g,centerOnboarding:y,minimizedStack:V?(0,_jsxRuntime.jsx)(_MinimizedToolsStackWeb.MinimizedToolsStack,{}):void 0,hasMinimizedStack:V,children:[E&&K&&!z&&(0,_jsxRuntime.jsx)(_sharedUi.EnvironmentIndicator,{environment:E}),z&&K&&(0,_jsxRuntime.jsx)(_sharedUi.EnvironmentSelectorInline,{currentEnvironment:E??"local",availableEnvironments:s,onSelect:l}),i?(0,_jsxRuntime.jsx)(_floatingToolsWeb.UserStatus,{userRole:i,onPress:F}):(0,_jsxRuntime.jsx)("button",{"aria-label":"Open dev tools",onClick:F,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:(0,_jsxRuntime.jsx)(MenuLauncherIcon,{})}),G.map(e=>(0,_jsxRuntime.jsx)("button",{"aria-label":e.name||(0,_floatingToolsReact.getToolLabel)(e.id),title:e.description,onClick:()=>I(e),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof e.icon==="function"?e.icon(16):e.icon},e.id))]})}),y&&(0,_jsxRuntime.jsx)(_OnboardingTooltipWeb.OnboardingTooltip,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:T}),g&&!v&&(0,_jsxRuntime.jsx)(_DialDevToolsWeb.DialMenu,{icons:Y,onClose:X,centerLabel:"BUOY",onCenterPress:Z,settingsOpen:m,hintsDisabled:u}),m&&!v&&(0,_jsxRuntime.jsx)(_DevToolsSettingsModalWeb.SettingsModal,{visible:true,onClose:ee,availableTools:Q,defaultFloatingTools:U,defaultDialTools:N,onSettingsChange:e=>{}}),!v&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_AppHostWeb.AppOverlay,{}),(0,_jsxRuntime.jsx)(_floating.FloatingToolHost,{})]})]})}function useCapacitorSignInAudience(n){const i=n&&typeof n==="object"?n.appId:void 0;const s=!!n;(0,_react.useEffect)(()=>{if(!s)return;let l=false;const t=licenseModule.SessionManager;if(!t)return;const r=a=>{if(l||!a)return;t.configure({audience:`app:${a}`});void t.load().catch(()=>{})};if(i)r(i);else void(0,_license.loadCapacitorAppHost)().then(a=>r(a?.bundleId)).catch(()=>{});return()=>{l=true}},[s,i])}function FloatingDevTools(n){const{access:i,isPro:s,licenseKey:l}=(0,_license.useLicense)();(0,_react.useEffect)(()=>{void _license.LicenseManager.configure(n.licenseKey)},[n.licenseKey]);const t=n.licenseKey===void 0||(0,_license.sameLicenseKey)(n.licenseKey,l);const r=(0,_license.resolveDevBuild)(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production");const a=t&&i.status==="admitted";(0,_react.useEffect)(()=>{if(a)(0,_sharedUi.startSettingsSync)()},[a]);(0,_react.useEffect)(()=>{if(r||i.status==="initializing")return;if(s&&a)(0,_releaseOptIn.markReleaseOptIn)();else(0,_releaseOptIn.clearReleaseOptIn)()},[r,s,a,i.status]);const c=(0,_license.isCapacitorNative)();useCapacitorSignInAudience(c?n.signIn:void 0);if(!r&&!s){if(!n.signIn||n.headless)return null;return c?(0,_jsxRuntime.jsx)(_BuoyCodeSignIn.BuoySignIn,{needsPlan:true}):(0,_jsxRuntime.jsx)(_BuoySignInWeb.BuoySignIn,{})}if(!a){return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[i.status==="initializing"&&(0,_jsxRuntime.jsx)(StartupCapture,{modules:n.modules}),n.headless?null:n.signIn&&c?(0,_jsxRuntime.jsx)(_BuoyCodeSignIn.BuoySignIn,{}):(0,_jsxRuntime.jsx)(_sharedUi.AccountSetup,{})]})}return(0,_jsxRuntime.jsx)(AdmittedFloatingDevTools,{...n})}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FloatingDevTools=FloatingDevTools;var _floating=require("@buoy-gg/shared-ui/floating");var _license=_interopRequireWildcard(require("@buoy-gg/license"));var licenseModule=_license;var _sharedUi=require("@buoy-gg/shared-ui");var _react=require("react");var _floatingToolsReact=require("@buoy-gg/floating-tools-react");var _autoDiscoverPresetsWeb=require("../utils/autoDiscoverPresets.web.js");var _floatingToolsWeb=require("./floatingTools.web.js");var _DialDevToolsWeb=require("./dial/DialDevTools.web.js");var _dialUsageStore=require("./dial/dialUsageStore.js");var _OnboardingTooltipWeb=require("./dial/OnboardingTooltip.web.js");var _DevToolsSettingsModalWeb=require("./DevToolsSettingsModal.web.js");var _AppHostWeb=require("./AppHost.web.js");var _MinimizedToolsStackWeb=require("./MinimizedToolsStack.web.js");var _createWebTools=require("../utils/createWebTools.js");var _BrowserToolRuntime=require("./BrowserToolRuntime.js");var _releaseOptIn=require("../releaseOptIn.js");var _BuoySignInWeb=require("./BuoySignIn.web.js");var _BuoyCodeSignIn=require("./BuoyCodeSignIn.js");var _DevToolsVisibilityContext=require("./DevToolsVisibilityContext.js");var _createWebTool=require("../utils/createWebTool.js");var _DefaultConfigContext=require("./DefaultConfigContext.js");var _DevToolsSettingsModalShared=require("./DevToolsSettingsModal.shared.js");var _defaultConfig=require("./defaultConfig.js");var _installedTools=require("../installedTools.js");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(s,t){if("function"==typeof WeakMap)var i=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(n,a){if(!a&&n&&n.__esModule)return n;var l,c,u={__proto__:null,default:n};if(null===n||"object"!=typeof n&&"function"!=typeof n)return u;if(l=a?r:i){if(l.has(n))return l.get(n);l.set(n,u)}for(const d in n)"default"!==d&&{}.hasOwnProperty.call(n,d)&&((c=(l=Object.defineProperty)&&Object.getOwnPropertyDescriptor(n,d))&&(c.get||c.set)?l(u,d,c):u[d]=n[d]);return u})(s,t)}const EMPTY_MODULES={};const MENU_TOOLTIP_KEY="@react_buoy_floating_menu_tooltip_shown";const webSettingsStorage=_sharedUi.persistentStorage;function MenuLauncherIcon({size:s=14,color:t="#20C997"}){const i=Math.max(2,s/4);const r=Math.max(1,s/16);return(0,_jsxRuntime.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${i}px)`,gap:r,width:s,height:s,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((n,a)=>(0,_jsxRuntime.jsx)("div",{style:{width:i,height:i,borderRadius:i/2,backgroundColor:t}},a))})}function AdmittedFloatingDevTools(s){const{defaultFloatingTools:t,defaultDialTools:i,disableHints:r=false,children:n}=s;const a=(0,_react.useMemo)(()=>i?(0,_defaultConfig.validateDialConfig)(i):i,[i]);return(0,_jsxRuntime.jsx)(_DefaultConfigContext.DefaultConfigProvider,{defaultFloatingTools:t,defaultDialTools:a,children:(0,_jsxRuntime.jsx)(_sharedUi.HintsProvider,{disableHints:r,children:(0,_jsxRuntime.jsxs)(_DevToolsVisibilityContext.DevToolsVisibilityProvider,{children:[(0,_jsxRuntime.jsx)(_AppHostWeb.AppHostProvider,{children:(0,_jsxRuntime.jsx)(FloatingDevToolsInner,{...s})}),n]})})})}const STARTUP_ROOTS=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function StartupCapture({modules:s=EMPTY_MODULES}){return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:Object.entries(s).flatMap(([t,i])=>STARTUP_ROOTS.map(r=>{const n=i[r];return n?(0,_jsxRuntime.jsx)(n,{},`${t}:${r}`):null}))})}function WebToolOpenerBridge(){const{openApps:s,restore:t}=(0,_AppHostWeb.useAppHost)();(0,_react.useEffect)(()=>(0,_sharedUi.registerToolOpener)(i=>{const r=s.find(n=>n.id===i);if(!r)return false;t(r.instanceId);return true}),[s,t]);return null}function defaultEnvironment(){const s=(0,_license.capacitorDebug)();const t=s===null?process.env.NODE_ENV:s?"development":"production";return(0,_sharedUi.normalizeEnvironment)(t??"dev")}function configOverrides(s,t,i,r){const n=S=>Object.entries(s).find(([m])=>m.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===S)?.[1];const a=[];const l=n("env");if(t?.length&&l?.createEnvTool&&l.createEnvVarConfig){a.push((0,_createWebTool.createWebTool)(l.createEnvTool({requiredEnvVars:l.createEnvVarConfig(t)})))}const c=n("storage");if(i?.length&&c?.createStorageTool){a.push((0,_createWebTool.createWebTool)(c.createStorageTool({requiredStorageKeys:i})))}const u=n("ask-buoy");const d=r==="hosted"?u?.hostedAskBuoy?.():r;if(d&&u?.createAskBuoyTool)a.push((0,_createWebTool.createWebTool)(u.createAskBuoyTool(d)));return a}function FloatingDevToolsInner({environment:s,userRole:t="admin",availableEnvironments:i,onEnvironmentSwitch:r,apps:n,modules:a=EMPTY_MODULES,externalSync:l,requiredEnvVars:c,sentryGetClient:u,disableHints:d=false,headless:S=false,hidden:m=false,defaultFloatingTools:U,defaultDialTools:C,zustandStores:O,requiredStorageKeys:P,askBuoy:W}){const w=s??defaultEnvironment();const N=(0,_react.useMemo)(()=>C?(0,_defaultConfig.validateDialConfig)(C):void 0,[C]);const[p,h]=(0,_react.useState)(false);const[v,x]=(0,_react.useState)(false);const E=(0,_react.useRef)(false);const T=(0,_AppHostWeb.useAppHost)();const A=(0,_react.useMemo)(()=>configOverrides(a,c,P,W),[a,c,P,W]);const g=(0,_react.useMemo)(()=>(0,_autoDiscoverPresetsWeb.autoDiscoverWithCustom)([...(0,_createWebTools.createWebTools)(a),...n??[],...A]),[n,a,A]);const M=(0,_react.useMemo)(()=>Object.entries(a).find(([e])=>e.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[a]);(0,_react.useEffect)(()=>{if(!O||typeof M?.watchStores!=="function")return;const e=M.watchStores(O);return typeof e==="function"?e:void 0},[O,M]);const _=(0,_DevToolsVisibilityContext.useDevToolsVisibility)();const q=T.openApps.some(e=>!e.minimized);(0,_react.useEffect)(()=>{_.setDialOpen(p)},[p,_.setDialOpen]);(0,_react.useEffect)(()=>{_.setToolOpen(q||v)},[q,v,_.setToolOpen]);const{registerApps:R}=T;(0,_react.useEffect)(()=>{R(g.map(e=>{const o=e.icon;return{...e,icon:typeof o==="function"?({size:f})=>o(f):o}}))},[R,g]);const $=(0,_react.useMemo)(()=>g.map(e=>({id:e.id,name:e.name,description:e.description,slot:e.slot})),[g]);(0,_floatingToolsReact.useSettings)({availableTools:$,storage:webSettingsStorage});(0,_react.useEffect)(()=>{let e=false;const o=async()=>{const[f,j]=await Promise.all([_sharedUi.persistentStorage.getItem(_sharedUi.devToolsStorageKeys.dial.isOpen()),_sharedUi.persistentStorage.getItem(_sharedUi.devToolsStorageKeys.settings.modalOpen())]);if(e)return;if(f==="true")h(true);if(j==="true"){h(true);x(true)}E.current=true};void o();return()=>{e=true}},[]);(0,_react.useEffect)(()=>{if(!E.current)return;void _sharedUi.persistentStorage.setItem(_sharedUi.devToolsStorageKeys.dial.isOpen(),p?"true":"false")},[p]);(0,_react.useEffect)(()=>{if(!E.current)return;void _sharedUi.persistentStorage.setItem(_sharedUi.devToolsStorageKeys.settings.modalOpen(),v?"true":"false")},[v]);const I=(0,_react.useCallback)(e=>{void(0,_dialUsageStore.recordToolUsage)(e.id);if(e.launchMode==="toggle-only"){e.onPress?.();return}if(e.component){const o=typeof e.icon==="function"?e.icon(20):e.icon;T.open({id:e.id,title:e.name||(0,_floatingToolsReact.getToolLabel)(e.id),component:e.component,props:e.props,modal:e.modal,launchMode:e.launchMode||"self-modal",singleton:e.singleton??true,icon:o,color:e.color||(0,_floatingToolsReact.getToolColor)(e.id)})}else{e.onPress?.()}},[T]);const D=(0,_react.useMemo)(()=>{const e=(0,_autoDiscoverPresetsWeb.getToolsBySlot)(g,"dial");return e.map(o=>{const f=o.color||(0,_floatingToolsReact.getToolColor)(o.id);let j;if(typeof o.icon==="string"){j=o.icon}else if(typeof o.icon==="function"){j=o.icon(32)}else{j=null}return{id:o.id,name:o.name||(0,_floatingToolsReact.getToolLabel)(o.id),icon:j,unavailable:!o.component&&!o.onPress,color:f,onPress:()=>{I(o);h(false)}}})},[g,I]);const Y=(0,_react.useMemo)(()=>{if(!p)return D;const e=new Map(D.map(o=>[o.id,o]));return(0,_dialUsageStore.getRankedToolIds)(D.map(o=>o.id)).map(o=>e.get(o)).filter(o=>Boolean(o))},[p,D]);const{settings:k}=(0,_DevToolsSettingsModalShared.useDevToolsSettings)();const G=(0,_react.useMemo)(()=>(0,_autoDiscoverPresetsWeb.getToolsBySlot)(g,"row").filter(e=>(k.floatingTools[e.id]??false)===true&&(e.component||e.onPress)),[g,k.floatingTools]);const Q=(0,_react.useMemo)(()=>g.map(e=>({id:e.id,name:e.name||(0,_floatingToolsReact.getToolLabel)(e.id),description:e.description||(0,_floatingToolsReact.getToolDescription)(e.id),slot:e.slot,icon:e.icon,color:e.color})),[g]);const[J,B]=(0,_react.useState)(false);const L=T.openApps.some(e=>!e.minimized);(0,_react.useEffect)(()=>{if(d)return;let e=false;const o=setTimeout(async()=>{const f=await _sharedUi.persistentStorage.getItem(MENU_TOOLTIP_KEY);if(!e&&!f)B(true)},1e3);return()=>{e=true;clearTimeout(o)}},[d]);const b=(0,_react.useCallback)(()=>{B(false);void _sharedUi.persistentStorage.setItem(MENU_TOOLTIP_KEY,"true")},[]);const F=(0,_react.useCallback)(()=>{b();h(true)},[b]);const X=(0,_react.useCallback)(()=>{h(false);x(false)},[]);const Z=(0,_react.useCallback)(()=>{x(e=>!e)},[]);const ee=(0,_react.useCallback)(()=>x(false),[]);const V=Boolean(i?.length&&r);const z=k.floatingTools.environment!==false;const y=J&&!p&&!L&&!m;(0,_react.useEffect)(()=>{if(!y)return;const e=f=>{if(!(f.target instanceof Element)||!f.target.closest("[data-buoy-root]"))b()};const o=f=>{if(f.key==="Escape")b()};document.addEventListener("pointerdown",e,true);document.addEventListener("keydown",o);return()=>{document.removeEventListener("pointerdown",e,true);document.removeEventListener("keydown",o)}},[y,b]);const K=T.openApps.some(e=>e.minimized&&e.launchMode!=="toggle-only");const H=(0,_jsxRuntime.jsx)(_BrowserToolRuntime.BrowserToolRuntime,{modules:a,apps:n,requiredEnvVars:c,externalSync:l,headless:S,sentryGetClient:u});if(S)return H;return(0,_jsxRuntime.jsxs)("div",{"data-buoy-root":"",style:{display:"contents"},children:[H,(0,_jsxRuntime.jsx)(WebToolOpenerBridge,{}),y&&(0,_jsxRuntime.jsx)("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),(0,_jsxRuntime.jsx)("div",{style:m?{visibility:"hidden"}:{display:"contents"},"aria-hidden":m||void 0,children:(0,_jsxRuntime.jsxs)(_floatingToolsWeb.FloatingTools,{enablePositionPersistence:!y,pushToSide:p||L,suspendPointerEvents:p,centerOnboarding:y,minimizedStack:K?(0,_jsxRuntime.jsx)(_MinimizedToolsStackWeb.MinimizedToolsStack,{}):void 0,hasMinimizedStack:K,children:[w&&z&&!V&&(0,_jsxRuntime.jsx)(_sharedUi.EnvironmentIndicator,{environment:w}),V&&z&&(0,_jsxRuntime.jsx)(_sharedUi.EnvironmentSelectorInline,{currentEnvironment:w??"local",availableEnvironments:i,onSelect:r}),t?(0,_jsxRuntime.jsx)(_floatingToolsWeb.UserStatus,{userRole:t,onPress:F}):(0,_jsxRuntime.jsx)("button",{"aria-label":"Open dev tools",onClick:F,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:(0,_jsxRuntime.jsx)(MenuLauncherIcon,{})}),G.map(e=>(0,_jsxRuntime.jsx)("button",{"aria-label":e.name||(0,_floatingToolsReact.getToolLabel)(e.id),title:e.description,onClick:()=>I(e),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof e.icon==="function"?e.icon(16):e.icon},e.id))]})}),y&&(0,_jsxRuntime.jsx)(_OnboardingTooltipWeb.OnboardingTooltip,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:b}),p&&!m&&(0,_jsxRuntime.jsx)(_DialDevToolsWeb.DialMenu,{icons:Y,onClose:X,centerLabel:"BUOY",onCenterPress:Z,settingsOpen:v,hintsDisabled:d}),v&&!m&&(0,_jsxRuntime.jsx)(_DevToolsSettingsModalWeb.SettingsModal,{visible:true,onClose:ee,availableTools:Q,defaultFloatingTools:U,defaultDialTools:N,onSettingsChange:e=>{}}),!m&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_AppHostWeb.AppOverlay,{}),(0,_jsxRuntime.jsx)(_floating.FloatingToolHost,{})]})]})}function useCapacitorSignInAudience(s){const t=s&&typeof s==="object"?s.appId:void 0;const i=!!s;(0,_react.useEffect)(()=>{if(!i)return;let r=false;const n=licenseModule.SessionManager;if(!n)return;const a=l=>{if(r||!l)return;n.configure({audience:`app:${l}`});void n.load().catch(()=>{})};if(t)a(t);else void(0,_license.loadCapacitorAppHost)().then(l=>a(l?.bundleId)).catch(()=>{});return()=>{r=true}},[i,t])}let warnedNoTools=false;function withInstalledTools(s){if(s.modules)return s;if(!_installedTools.installedToolsFound&&!warnedNoTools&&typeof console!=="undefined"){warnedNoTools=true;console.info("[Buoy] No tools loaded. Add buoy() from '@buoy-gg/core/vite' to your Vite plugins, or pass modules to FloatingDevTools.")}return{...s,modules:_installedTools.installedTools}}function FloatingDevTools(s){const t=withInstalledTools(s);const{access:i,isPro:r,licenseKey:n}=(0,_license.useLicense)();(0,_react.useEffect)(()=>{void _license.LicenseManager.configure(t.licenseKey)},[t.licenseKey]);const a=t.licenseKey===void 0||(0,_license.sameLicenseKey)(t.licenseKey,n);const l=(0,_license.resolveDevBuild)(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production");const c=a&&i.status==="admitted";(0,_react.useEffect)(()=>{if(c)(0,_sharedUi.startSettingsSync)()},[c]);(0,_react.useEffect)(()=>{if(l||i.status==="initializing")return;if(r&&c)(0,_releaseOptIn.markReleaseOptIn)();else(0,_releaseOptIn.clearReleaseOptIn)()},[l,r,c,i.status]);const u=(0,_license.isCapacitorNative)();useCapacitorSignInAudience(u?t.signIn:void 0);if(!l&&!r){if(!t.signIn||t.headless)return null;return u?(0,_jsxRuntime.jsx)(_BuoyCodeSignIn.BuoySignIn,{needsPlan:true}):(0,_jsxRuntime.jsx)(_BuoySignInWeb.BuoySignIn,{})}if(!c){return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[i.status==="initializing"&&(0,_jsxRuntime.jsx)(StartupCapture,{modules:t.modules}),t.headless?null:t.signIn&&u?(0,_jsxRuntime.jsx)(_BuoyCodeSignIn.BuoySignIn,{}):(0,_jsxRuntime.jsx)(_sharedUi.AccountSetup,{})]})}return(0,_jsxRuntime.jsx)(AdmittedFloatingDevTools,{...t})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.installedToolsFound=exports.installedTools=void 0;const installedTools=exports.installedTools={};const installedToolsFound=exports.installedToolsFound=false;
|
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.63";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{createElement as o,lazy as s,Suspense as l,useEffect as a,useState as f}from"react";export function shouldShowBuoy(){if(typeof window==="undefined")return false;const t=window.Capacitor;let e=false;try{e=t?.isNativePlatform?.()===true}catch{e=false}if(e)return t?.DEBUG===true;return typeof __DEV__!=="undefined"?Boolean(__DEV__):process.env.NODE_ENV!=="production"}let n;function i(){n??=s(()=>import("./floatingMenu/FloatingDevTools.web").then(t=>({default:t.FloatingDevTools})));return n}export function BuoyDevTools({enabled:t,...e}){const[r,u]=f(false);a(()=>{u(t??shouldShowBuoy())},[t]);if(!r)return null;return o(l,{fallback:null},o(i(),e))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{FloatingToolHost as he}from"@buoy-gg/shared-ui/floating";import*as be from"@buoy-gg/license";import{LicenseManager as Oe,useLicense as Se,sameLicenseKey as Ce,resolveDevBuild as De,capacitorDebug as Ie,isCapacitorNative as Ee,loadCapacitorAppHost as we}from"@buoy-gg/license";import{AccountSetup as _e,HintsProvider as Me,normalizeEnvironment as Pe,registerToolOpener as ke,startSettingsSync as Ae}from"@buoy-gg/shared-ui";import{useState as W,useMemo as g,useCallback as C,useEffect as d,useRef as xe}from"react";import{useSettings as Re,getToolLabel as A,getToolDescription as Le,getToolColor as te}from"@buoy-gg/floating-tools-react";import{persistentStorage as v,devToolsStorageKeys as x,EnvironmentIndicator as je,EnvironmentSelectorInline as Be}from"@buoy-gg/shared-ui";import{autoDiscoverWithCustom as Fe,getToolsBySlot as oe}from"../utils/autoDiscoverPresets.web.js";import{FloatingTools as ze,UserStatus as Ve}from"./floatingTools.web.js";import{DialMenu as We}from"./dial/DialDevTools.web.js";import{getRankedToolIds as Ke,recordToolUsage as He}from"./dial/dialUsageStore.js";import{OnboardingTooltip as Ne}from"./dial/OnboardingTooltip.web.js";import{SettingsModal as Ue}from"./DevToolsSettingsModal.web.js";import{AppHostProvider as $e,AppOverlay as Ye,useAppHost as ie}from"./AppHost.web.js";import{MinimizedToolsStack as Ge}from"./MinimizedToolsStack.web.js";import{createWebTools as Qe}from"../utils/createWebTools.js";import{BrowserToolRuntime as Je}from"./BrowserToolRuntime.js";import{clearReleaseOptIn as Xe,markReleaseOptIn as Ze}from"../releaseOptIn.js";import{BuoySignIn as qe}from"./BuoySignIn.web.js";import{BuoySignIn as se}from"./BuoyCodeSignIn.js";import{DevToolsVisibilityProvider as en,useDevToolsVisibility as nn}from"./DevToolsVisibilityContext.js";import{createWebTool as K}from"../utils/createWebTool.js";import{DefaultConfigProvider as tn}from"./DefaultConfigContext.js";import{useDevToolsSettings as on}from"./DevToolsSettingsModal.shared.js";import{validateDialConfig as re}from"./defaultConfig.js";import{jsx as o,jsxs as E,Fragment as H}from"react/jsx-runtime";const ae={};const ce="@react_buoy_floating_menu_tooltip_shown";const sn=v;function rn({size:n=14,color:s="#20C997"}){const i=Math.max(2,n/4);const c=Math.max(1,n/16);return o("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${i}px)`,gap:c,width:n,height:n,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((a,r)=>o("div",{style:{width:i,height:i,borderRadius:i/2,backgroundColor:s}},r))})}function an(n){const{defaultFloatingTools:s,defaultDialTools:i,disableHints:c=false,children:a}=n;const r=g(()=>i?re(i):i,[i]);return o(tn,{defaultFloatingTools:s,defaultDialTools:r,children:o(Me,{disableHints:c,children:E(en,{children:[o($e,{children:o(mn,{...n})}),a]})})})}const cn=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function ln({modules:n=ae}){return o(H,{children:Object.entries(n).flatMap(([s,i])=>cn.map(c=>{const a=i[c];return a?o(a,{},`${s}:${c}`):null}))})}function dn(){const{openApps:n,restore:s}=ie();d(()=>ke(i=>{const c=n.find(a=>a.id===i);if(!c)return false;s(c.instanceId);return true}),[n,s]);return null}function un(){const n=Ie();const s=n===null?process.env.NODE_ENV:n?"development":"production";return Pe(s??"dev")}function fn(n,s,i,c){const a=D=>Object.entries(n).find(([_])=>_.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===D)?.[1];const r=[];const l=a("env");if(s?.length&&l?.createEnvTool&&l.createEnvVarConfig){r.push(K(l.createEnvTool({requiredEnvVars:l.createEnvVarConfig(s)})))}const f=a("storage");if(i?.length&&f?.createStorageTool){r.push(K(f.createStorageTool({requiredStorageKeys:i})))}const w=a("ask-buoy");if(c&&w?.createAskBuoyTool)r.push(K(w.createAskBuoyTool(c)));return r}function mn({environment:n,userRole:s="admin",availableEnvironments:i,onEnvironmentSwitch:c,apps:a,modules:r=ae,externalSync:l,requiredEnvVars:f,sentryGetClient:w,disableHints:D=false,headless:_=false,hidden:y=false,defaultFloatingTools:le,defaultDialTools:R,zustandStores:L,requiredStorageKeys:N,askBuoy:U}){const j=n??un();const de=g(()=>R?re(R):void 0,[R]);const[m,I]=W(false);const[T,M]=W(false);const B=xe(false);const h=ie();const $=g(()=>fn(r,f,N,U),[r,f,N,U]);const p=g(()=>Fe([...Qe(r),...a??[],...$]),[a,r,$]);const F=g(()=>Object.entries(r).find(([e])=>e.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[r]);d(()=>{if(!L||typeof F?.watchStores!=="function")return;const e=F.watchStores(L);return typeof e==="function"?e:void 0},[L,F]);const P=nn();const Y=h.openApps.some(e=>!e.minimized);d(()=>{P.setDialOpen(m)},[m,P.setDialOpen]);d(()=>{P.setToolOpen(Y||T)},[Y,T,P.setToolOpen]);const{registerApps:G}=h;d(()=>{G(p.map(e=>{const t=e.icon;return{...e,icon:typeof t==="function"?({size:u})=>t(u):t}}))},[G,p]);const ue=g(()=>p.map(e=>({id:e.id,name:e.name,description:e.description,slot:e.slot})),[p]);Re({availableTools:ue,storage:sn});d(()=>{let e=false;const t=async()=>{const[u,S]=await Promise.all([v.getItem(x.dial.isOpen()),v.getItem(x.settings.modalOpen())]);if(e)return;if(u==="true")I(true);if(S==="true"){I(true);M(true)}B.current=true};void t();return()=>{e=true}},[]);d(()=>{if(!B.current)return;void v.setItem(x.dial.isOpen(),m?"true":"false")},[m]);d(()=>{if(!B.current)return;void v.setItem(x.settings.modalOpen(),T?"true":"false")},[T]);const z=C(e=>{void He(e.id);if(e.launchMode==="toggle-only"){e.onPress?.();return}if(e.component){const t=typeof e.icon==="function"?e.icon(20):e.icon;h.open({id:e.id,title:e.name||A(e.id),component:e.component,props:e.props,modal:e.modal,launchMode:e.launchMode||"self-modal",singleton:e.singleton??true,icon:t,color:e.color||te(e.id)})}else{e.onPress?.()}},[h]);const k=g(()=>{const e=oe(p,"dial");return e.map(t=>{const u=t.color||te(t.id);let S;if(typeof t.icon==="string"){S=t.icon}else if(typeof t.icon==="function"){S=t.icon(32)}else{S=null}return{id:t.id,name:t.name||A(t.id),icon:S,unavailable:!t.component&&!t.onPress,color:u,onPress:()=>{z(t);I(false)}}})},[p,z]);const fe=g(()=>{if(!m)return k;const e=new Map(k.map(t=>[t.id,t]));return Ke(k.map(t=>t.id)).map(t=>e.get(t)).filter(t=>Boolean(t))},[m,k]);const{settings:V}=on();const me=g(()=>oe(p,"row").filter(e=>(V.floatingTools[e.id]??false)===true&&(e.component||e.onPress)),[p,V.floatingTools]);const pe=g(()=>p.map(e=>({id:e.id,name:e.name||A(e.id),description:e.description||Le(e.id),slot:e.slot,icon:e.icon,color:e.color})),[p]);const[ge,Q]=W(false);const J=h.openApps.some(e=>!e.minimized);d(()=>{if(D)return;let e=false;const t=setTimeout(async()=>{const u=await v.getItem(ce);if(!e&&!u)Q(true)},1e3);return()=>{e=true;clearTimeout(t)}},[D]);const b=C(()=>{Q(false);void v.setItem(ce,"true")},[]);const X=C(()=>{b();I(true)},[b]);const ve=C(()=>{I(false);M(false)},[]);const ye=C(()=>{M(e=>!e)},[]);const Te=C(()=>M(false),[]);const Z=Boolean(i?.length&&c);const q=V.floatingTools.environment!==false;const O=ge&&!m&&!J&&!y;d(()=>{if(!O)return;const e=u=>{if(!(u.target instanceof Element)||!u.target.closest("[data-buoy-root]"))b()};const t=u=>{if(u.key==="Escape")b()};document.addEventListener("pointerdown",e,true);document.addEventListener("keydown",t);return()=>{document.removeEventListener("pointerdown",e,true);document.removeEventListener("keydown",t)}},[O,b]);const ee=h.openApps.some(e=>e.minimized&&e.launchMode!=="toggle-only");const ne=o(Je,{modules:r,apps:a,requiredEnvVars:f,externalSync:l,headless:_,sentryGetClient:w});if(_)return ne;return E("div",{"data-buoy-root":"",style:{display:"contents"},children:[ne,o(dn,{}),O&&o("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),o("div",{style:y?{visibility:"hidden"}:{display:"contents"},"aria-hidden":y||void 0,children:E(ze,{enablePositionPersistence:!O,pushToSide:m||J,suspendPointerEvents:m,centerOnboarding:O,minimizedStack:ee?o(Ge,{}):void 0,hasMinimizedStack:ee,children:[j&&q&&!Z&&o(je,{environment:j}),Z&&q&&o(Be,{currentEnvironment:j??"local",availableEnvironments:i,onSelect:c}),s?o(Ve,{userRole:s,onPress:X}):o("button",{"aria-label":"Open dev tools",onClick:X,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:o(rn,{})}),me.map(e=>o("button",{"aria-label":e.name||A(e.id),title:e.description,onClick:()=>z(e),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof e.icon==="function"?e.icon(16):e.icon},e.id))]})}),O&&o(Ne,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:b}),m&&!y&&o(We,{icons:fe,onClose:ve,centerLabel:"BUOY",onCenterPress:ye,settingsOpen:T,hintsDisabled:D}),T&&!y&&o(Ue,{visible:true,onClose:Te,availableTools:pe,defaultFloatingTools:le,defaultDialTools:de,onSettingsChange:e=>{}}),!y&&E(H,{children:[o(Ye,{}),o(he,{})]})]})}function pn(n){const s=n&&typeof n==="object"?n.appId:void 0;const i=!!n;d(()=>{if(!i)return;let c=false;const a=be.SessionManager;if(!a)return;const r=l=>{if(c||!l)return;a.configure({audience:`app:${l}`});void a.load().catch(()=>{})};if(s)r(s);else void we().then(l=>r(l?.bundleId)).catch(()=>{});return()=>{c=true}},[i,s])}export function FloatingDevTools(n){const{access:s,isPro:i,licenseKey:c}=Se();d(()=>{void Oe.configure(n.licenseKey)},[n.licenseKey]);const a=n.licenseKey===void 0||Ce(n.licenseKey,c);const r=De(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production");const l=a&&s.status==="admitted";d(()=>{if(l)Ae()},[l]);d(()=>{if(r||s.status==="initializing")return;if(i&&l)Ze();else Xe()},[r,i,l,s.status]);const f=Ee();pn(f?n.signIn:void 0);if(!r&&!i){if(!n.signIn||n.headless)return null;return f?o(se,{needsPlan:true}):o(qe,{})}if(!l){return E(H,{children:[s.status==="initializing"&&o(ln,{modules:n.modules}),n.headless?null:n.signIn&&f?o(se,{}):o(_e,{})]})}return o(an,{...n})}
|
|
1
|
+
"use strict";import{FloatingToolHost as be}from"@buoy-gg/shared-ui/floating";import*as Oe from"@buoy-gg/license";import{LicenseManager as Se,useLicense as Ce,sameLicenseKey as De,resolveDevBuild as Ie,capacitorDebug as Ee,isCapacitorNative as we,loadCapacitorAppHost as _e}from"@buoy-gg/license";import{AccountSetup as ke,HintsProvider as Me,normalizeEnvironment as Pe,registerToolOpener as Ae,startSettingsSync as xe}from"@buoy-gg/shared-ui";import{useState as N,useMemo as g,useCallback as I,useEffect as d,useRef as Re}from"react";import{useSettings as Be,getToolLabel as A,getToolDescription as Fe,getToolColor as te}from"@buoy-gg/floating-tools-react";import{persistentStorage as T,devToolsStorageKeys as x,EnvironmentIndicator as Le,EnvironmentSelectorInline as je}from"@buoy-gg/shared-ui";import{autoDiscoverWithCustom as Ve,getToolsBySlot as oe}from"../utils/autoDiscoverPresets.web.js";import{FloatingTools as ze,UserStatus as Ne}from"./floatingTools.web.js";import{DialMenu as We}from"./dial/DialDevTools.web.js";import{getRankedToolIds as Ke,recordToolUsage as He}from"./dial/dialUsageStore.js";import{OnboardingTooltip as Ue}from"./dial/OnboardingTooltip.web.js";import{SettingsModal as $e}from"./DevToolsSettingsModal.web.js";import{AppHostProvider as Ye,AppOverlay as Ge,useAppHost as ie}from"./AppHost.web.js";import{MinimizedToolsStack as Qe}from"./MinimizedToolsStack.web.js";import{createWebTools as Je}from"../utils/createWebTools.js";import{BrowserToolRuntime as Xe}from"./BrowserToolRuntime.js";import{clearReleaseOptIn as Ze,markReleaseOptIn as qe}from"../releaseOptIn.js";import{BuoySignIn as en}from"./BuoySignIn.web.js";import{BuoySignIn as se}from"./BuoyCodeSignIn.js";import{DevToolsVisibilityProvider as nn,useDevToolsVisibility as tn}from"./DevToolsVisibilityContext.js";import{createWebTool as W}from"../utils/createWebTool.js";import{DefaultConfigProvider as on}from"./DefaultConfigContext.js";import{useDevToolsSettings as sn}from"./DevToolsSettingsModal.shared.js";import{validateDialConfig as re}from"./defaultConfig.js";import{installedTools as rn,installedToolsFound as an}from"../installedTools.js";import{jsx as i,jsxs as w,Fragment as K}from"react/jsx-runtime";const ae={};const le="@react_buoy_floating_menu_tooltip_shown";const ln=T;function cn({size:o=14,color:t="#20C997"}){const s=Math.max(2,o/4);const r=Math.max(1,o/16);return i("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${s}px)`,gap:r,width:o,height:o,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((a,l)=>i("div",{style:{width:s,height:s,borderRadius:s/2,backgroundColor:t}},l))})}function dn(o){const{defaultFloatingTools:t,defaultDialTools:s,disableHints:r=false,children:a}=o;const l=g(()=>s?re(s):s,[s]);return i(on,{defaultFloatingTools:t,defaultDialTools:l,children:i(Me,{disableHints:r,children:w(nn,{children:[i(Ye,{children:i(vn,{...o})}),a]})})})}const un=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function pn({modules:o=ae}){return i(K,{children:Object.entries(o).flatMap(([t,s])=>un.map(r=>{const a=s[r];return a?i(a,{},`${t}:${r}`):null}))})}function fn(){const{openApps:o,restore:t}=ie();d(()=>Ae(s=>{const r=o.find(a=>a.id===s);if(!r)return false;t(r.instanceId);return true}),[o,t]);return null}function mn(){const o=Ee();const t=o===null?process.env.NODE_ENV:o?"development":"production";return Pe(t??"dev")}function gn(o,t,s,r){const a=_=>Object.entries(o).find(([y])=>y.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===_)?.[1];const l=[];const c=a("env");if(t?.length&&c?.createEnvTool&&c.createEnvVarConfig){l.push(W(c.createEnvTool({requiredEnvVars:c.createEnvVarConfig(t)})))}const u=a("storage");if(s?.length&&u?.createStorageTool){l.push(W(u.createStorageTool({requiredStorageKeys:s})))}const v=a("ask-buoy");const h=r==="hosted"?v?.hostedAskBuoy?.():r;if(h&&v?.createAskBuoyTool)l.push(W(v.createAskBuoyTool(h)));return l}function vn({environment:o,userRole:t="admin",availableEnvironments:s,onEnvironmentSwitch:r,apps:a,modules:l=ae,externalSync:c,requiredEnvVars:u,sentryGetClient:v,disableHints:h=false,headless:_=false,hidden:y=false,defaultFloatingTools:de,defaultDialTools:R,zustandStores:B,requiredStorageKeys:H,askBuoy:U}){const F=o??mn();const ue=g(()=>R?re(R):void 0,[R]);const[f,E]=N(false);const[b,k]=N(false);const L=Re(false);const O=ie();const $=g(()=>gn(l,u,H,U),[l,u,H,U]);const m=g(()=>Ve([...Je(l),...a??[],...$]),[a,l,$]);const j=g(()=>Object.entries(l).find(([e])=>e.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[l]);d(()=>{if(!B||typeof j?.watchStores!=="function")return;const e=j.watchStores(B);return typeof e==="function"?e:void 0},[B,j]);const M=tn();const Y=O.openApps.some(e=>!e.minimized);d(()=>{M.setDialOpen(f)},[f,M.setDialOpen]);d(()=>{M.setToolOpen(Y||b)},[Y,b,M.setToolOpen]);const{registerApps:G}=O;d(()=>{G(m.map(e=>{const n=e.icon;return{...e,icon:typeof n==="function"?({size:p})=>n(p):n}}))},[G,m]);const pe=g(()=>m.map(e=>({id:e.id,name:e.name,description:e.description,slot:e.slot})),[m]);Be({availableTools:pe,storage:ln});d(()=>{let e=false;const n=async()=>{const[p,D]=await Promise.all([T.getItem(x.dial.isOpen()),T.getItem(x.settings.modalOpen())]);if(e)return;if(p==="true")E(true);if(D==="true"){E(true);k(true)}L.current=true};void n();return()=>{e=true}},[]);d(()=>{if(!L.current)return;void T.setItem(x.dial.isOpen(),f?"true":"false")},[f]);d(()=>{if(!L.current)return;void T.setItem(x.settings.modalOpen(),b?"true":"false")},[b]);const V=I(e=>{void He(e.id);if(e.launchMode==="toggle-only"){e.onPress?.();return}if(e.component){const n=typeof e.icon==="function"?e.icon(20):e.icon;O.open({id:e.id,title:e.name||A(e.id),component:e.component,props:e.props,modal:e.modal,launchMode:e.launchMode||"self-modal",singleton:e.singleton??true,icon:n,color:e.color||te(e.id)})}else{e.onPress?.()}},[O]);const P=g(()=>{const e=oe(m,"dial");return e.map(n=>{const p=n.color||te(n.id);let D;if(typeof n.icon==="string"){D=n.icon}else if(typeof n.icon==="function"){D=n.icon(32)}else{D=null}return{id:n.id,name:n.name||A(n.id),icon:D,unavailable:!n.component&&!n.onPress,color:p,onPress:()=>{V(n);E(false)}}})},[m,V]);const fe=g(()=>{if(!f)return P;const e=new Map(P.map(n=>[n.id,n]));return Ke(P.map(n=>n.id)).map(n=>e.get(n)).filter(n=>Boolean(n))},[f,P]);const{settings:z}=sn();const me=g(()=>oe(m,"row").filter(e=>(z.floatingTools[e.id]??false)===true&&(e.component||e.onPress)),[m,z.floatingTools]);const ge=g(()=>m.map(e=>({id:e.id,name:e.name||A(e.id),description:e.description||Fe(e.id),slot:e.slot,icon:e.icon,color:e.color})),[m]);const[ve,Q]=N(false);const J=O.openApps.some(e=>!e.minimized);d(()=>{if(h)return;let e=false;const n=setTimeout(async()=>{const p=await T.getItem(le);if(!e&&!p)Q(true)},1e3);return()=>{e=true;clearTimeout(n)}},[h]);const S=I(()=>{Q(false);void T.setItem(le,"true")},[]);const X=I(()=>{S();E(true)},[S]);const ye=I(()=>{E(false);k(false)},[]);const Te=I(()=>{k(e=>!e)},[]);const he=I(()=>k(false),[]);const Z=Boolean(s?.length&&r);const q=z.floatingTools.environment!==false;const C=ve&&!f&&!J&&!y;d(()=>{if(!C)return;const e=p=>{if(!(p.target instanceof Element)||!p.target.closest("[data-buoy-root]"))S()};const n=p=>{if(p.key==="Escape")S()};document.addEventListener("pointerdown",e,true);document.addEventListener("keydown",n);return()=>{document.removeEventListener("pointerdown",e,true);document.removeEventListener("keydown",n)}},[C,S]);const ee=O.openApps.some(e=>e.minimized&&e.launchMode!=="toggle-only");const ne=i(Xe,{modules:l,apps:a,requiredEnvVars:u,externalSync:c,headless:_,sentryGetClient:v});if(_)return ne;return w("div",{"data-buoy-root":"",style:{display:"contents"},children:[ne,i(fn,{}),C&&i("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),i("div",{style:y?{visibility:"hidden"}:{display:"contents"},"aria-hidden":y||void 0,children:w(ze,{enablePositionPersistence:!C,pushToSide:f||J,suspendPointerEvents:f,centerOnboarding:C,minimizedStack:ee?i(Qe,{}):void 0,hasMinimizedStack:ee,children:[F&&q&&!Z&&i(Le,{environment:F}),Z&&q&&i(je,{currentEnvironment:F??"local",availableEnvironments:s,onSelect:r}),t?i(Ne,{userRole:t,onPress:X}):i("button",{"aria-label":"Open dev tools",onClick:X,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:i(cn,{})}),me.map(e=>i("button",{"aria-label":e.name||A(e.id),title:e.description,onClick:()=>V(e),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof e.icon==="function"?e.icon(16):e.icon},e.id))]})}),C&&i(Ue,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:S}),f&&!y&&i(We,{icons:fe,onClose:ye,centerLabel:"BUOY",onCenterPress:Te,settingsOpen:b,hintsDisabled:h}),b&&!y&&i($e,{visible:true,onClose:he,availableTools:ge,defaultFloatingTools:de,defaultDialTools:ue,onSettingsChange:e=>{}}),!y&&w(K,{children:[i(Ge,{}),i(be,{})]})]})}function yn(o){const t=o&&typeof o==="object"?o.appId:void 0;const s=!!o;d(()=>{if(!s)return;let r=false;const a=Oe.SessionManager;if(!a)return;const l=c=>{if(r||!c)return;a.configure({audience:`app:${c}`});void a.load().catch(()=>{})};if(t)l(t);else void _e().then(c=>l(c?.bundleId)).catch(()=>{});return()=>{r=true}},[s,t])}let ce=false;function Tn(o){if(o.modules)return o;if(!an&&!ce&&typeof console!=="undefined"){ce=true;console.info("[Buoy] No tools loaded. Add buoy() from '@buoy-gg/core/vite' to your Vite plugins, or pass modules to FloatingDevTools.")}return{...o,modules:rn}}export function FloatingDevTools(o){const t=Tn(o);const{access:s,isPro:r,licenseKey:a}=Ce();d(()=>{void Se.configure(t.licenseKey)},[t.licenseKey]);const l=t.licenseKey===void 0||De(t.licenseKey,a);const c=Ie(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production");const u=l&&s.status==="admitted";d(()=>{if(u)xe()},[u]);d(()=>{if(c||s.status==="initializing")return;if(r&&u)qe();else Ze()},[c,r,u,s.status]);const v=we();yn(v?t.signIn:void 0);if(!c&&!r){if(!t.signIn||t.headless)return null;return v?i(se,{needsPlan:true}):i(en,{})}if(!u){return w(K,{children:[s.status==="initializing"&&i(pn,{modules:t.modules}),t.headless?null:t.signIn&&v?i(se,{}):i(ke,{})]})}return i(dn,{...t})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const installedTools={};export const installedToolsFound=false;
|
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.63";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FloatingDevToolsProps } from './floatingMenu/FloatingDevTools.web';
|
|
2
|
+
export interface BuoyDevToolsProps extends FloatingDevToolsProps {
|
|
3
|
+
/**
|
|
4
|
+
* Show Buoy. Defaults to `shouldShowBuoy()`: the phone app's debug flag in a
|
|
5
|
+
* Capacitor shell, otherwise a development build.
|
|
6
|
+
*/
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Whether Buoy shows by default. In a Capacitor shell this is the phone app's
|
|
11
|
+
* debug flag, because phone debug runs often use a production web bundle. In a
|
|
12
|
+
* browser it's a development build.
|
|
13
|
+
*/
|
|
14
|
+
export declare function shouldShowBuoy(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Buoy with no setup: shows in debug and development builds, loads every
|
|
17
|
+
* installed tool (with the `buoy()` plugin from `@buoy-gg/core/vite`), and
|
|
18
|
+
* stays out of other builds. Takes every `FloatingDevTools` prop.
|
|
19
|
+
*/
|
|
20
|
+
export declare function BuoyDevTools({ enabled, ...props }: BuoyDevToolsProps): import("react").FunctionComponentElement<import("react").SuspenseProps> | null;
|
|
21
|
+
//# sourceMappingURL=auto.web.d.ts.map
|
|
@@ -16,7 +16,11 @@ export interface FloatingDevToolsProps {
|
|
|
16
16
|
onEnvironmentSwitch?: (env: Environment) => void;
|
|
17
17
|
/** Custom tools to add to the registered packages. */
|
|
18
18
|
apps?: BrowserToolConfig[];
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Imported tool packages, keyed by package name. Leave it out to use every
|
|
21
|
+
* installed tool (needs the `buoy()` plugin from `@buoy-gg/core/vite`).
|
|
22
|
+
* Pass `{}` for no tools.
|
|
23
|
+
*/
|
|
20
24
|
modules?: BrowserToolModules;
|
|
21
25
|
externalSync?: boolean | ExternalSyncOptions;
|
|
22
26
|
requiredEnvVars?: EnvVarConfig[];
|
|
@@ -38,8 +42,11 @@ export interface FloatingDevToolsProps {
|
|
|
38
42
|
zustandStores?: Record<string, any>;
|
|
39
43
|
/** Storage keys the Storage tool should check (needs the storage module). */
|
|
40
44
|
requiredStorageKeys?: StorageKeyConfig[];
|
|
41
|
-
/**
|
|
42
|
-
|
|
45
|
+
/**
|
|
46
|
+
* One-prop Ask Buoy setup (needs the ask-buoy module). `'hosted'` uses
|
|
47
|
+
* Buoy's hosted AI, the same as passing `hostedAskBuoy()`.
|
|
48
|
+
*/
|
|
49
|
+
askBuoy?: FloatingAskBuoyConfig | 'hosted';
|
|
43
50
|
/** Keep capture and desktop sync running without the floating menu. */
|
|
44
51
|
headless?: boolean;
|
|
45
52
|
licenseKey?: string;
|
|
@@ -60,5 +67,5 @@ export interface FloatingDevToolsProps {
|
|
|
60
67
|
requireLicense?: boolean;
|
|
61
68
|
}
|
|
62
69
|
export type { WebToolConfig, Environment, UserRole };
|
|
63
|
-
export declare function FloatingDevTools(
|
|
70
|
+
export declare function FloatingDevTools(input: FloatingDevToolsProps): import("react").JSX.Element | null;
|
|
64
71
|
//# sourceMappingURL=FloatingDevTools.web.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BrowserToolModules } from './utils/createWebTools';
|
|
2
|
+
/**
|
|
3
|
+
* The Buoy tools the app has installed, for a host given no `modules`.
|
|
4
|
+
*
|
|
5
|
+
* This file is the stand-in: an empty map. The `buoy()` bundler plugin
|
|
6
|
+
* (`@buoy-gg/core/vite`) replaces `@buoy-gg/core/web/installed-tools` with a
|
|
7
|
+
* generated module that imports every installed tool's `/web` entry and exports
|
|
8
|
+
* the same two names. The browser build keeps the import of this file as that
|
|
9
|
+
* bare specifier so the plugin can swap it (scripts/build-web.mjs).
|
|
10
|
+
*/
|
|
11
|
+
export declare const installedTools: BrowserToolModules;
|
|
12
|
+
/** False here; true in the plugin's generated module, even when it found no tools. */
|
|
13
|
+
export declare const installedToolsFound: boolean;
|
|
14
|
+
//# sourceMappingURL=installedTools.d.ts.map
|
|
@@ -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.63";
|
|
13
13
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FloatingDevToolsProps } from './floatingMenu/FloatingDevTools.web';
|
|
2
|
+
export interface BuoyDevToolsProps extends FloatingDevToolsProps {
|
|
3
|
+
/**
|
|
4
|
+
* Show Buoy. Defaults to `shouldShowBuoy()`: the phone app's debug flag in a
|
|
5
|
+
* Capacitor shell, otherwise a development build.
|
|
6
|
+
*/
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Whether Buoy shows by default. In a Capacitor shell this is the phone app's
|
|
11
|
+
* debug flag, because phone debug runs often use a production web bundle. In a
|
|
12
|
+
* browser it's a development build.
|
|
13
|
+
*/
|
|
14
|
+
export declare function shouldShowBuoy(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Buoy with no setup: shows in debug and development builds, loads every
|
|
17
|
+
* installed tool (with the `buoy()` plugin from `@buoy-gg/core/vite`), and
|
|
18
|
+
* stays out of other builds. Takes every `FloatingDevTools` prop.
|
|
19
|
+
*/
|
|
20
|
+
export declare function BuoyDevTools({ enabled, ...props }: BuoyDevToolsProps): import("react").FunctionComponentElement<import("react").SuspenseProps> | null;
|
|
21
|
+
//# sourceMappingURL=auto.web.d.ts.map
|
|
@@ -16,7 +16,11 @@ export interface FloatingDevToolsProps {
|
|
|
16
16
|
onEnvironmentSwitch?: (env: Environment) => void;
|
|
17
17
|
/** Custom tools to add to the registered packages. */
|
|
18
18
|
apps?: BrowserToolConfig[];
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Imported tool packages, keyed by package name. Leave it out to use every
|
|
21
|
+
* installed tool (needs the `buoy()` plugin from `@buoy-gg/core/vite`).
|
|
22
|
+
* Pass `{}` for no tools.
|
|
23
|
+
*/
|
|
20
24
|
modules?: BrowserToolModules;
|
|
21
25
|
externalSync?: boolean | ExternalSyncOptions;
|
|
22
26
|
requiredEnvVars?: EnvVarConfig[];
|
|
@@ -38,8 +42,11 @@ export interface FloatingDevToolsProps {
|
|
|
38
42
|
zustandStores?: Record<string, any>;
|
|
39
43
|
/** Storage keys the Storage tool should check (needs the storage module). */
|
|
40
44
|
requiredStorageKeys?: StorageKeyConfig[];
|
|
41
|
-
/**
|
|
42
|
-
|
|
45
|
+
/**
|
|
46
|
+
* One-prop Ask Buoy setup (needs the ask-buoy module). `'hosted'` uses
|
|
47
|
+
* Buoy's hosted AI, the same as passing `hostedAskBuoy()`.
|
|
48
|
+
*/
|
|
49
|
+
askBuoy?: FloatingAskBuoyConfig | 'hosted';
|
|
43
50
|
/** Keep capture and desktop sync running without the floating menu. */
|
|
44
51
|
headless?: boolean;
|
|
45
52
|
licenseKey?: string;
|
|
@@ -60,5 +67,5 @@ export interface FloatingDevToolsProps {
|
|
|
60
67
|
requireLicense?: boolean;
|
|
61
68
|
}
|
|
62
69
|
export type { WebToolConfig, Environment, UserRole };
|
|
63
|
-
export declare function FloatingDevTools(
|
|
70
|
+
export declare function FloatingDevTools(input: FloatingDevToolsProps): import("react").JSX.Element | null;
|
|
64
71
|
//# sourceMappingURL=FloatingDevTools.web.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BrowserToolModules } from './utils/createWebTools';
|
|
2
|
+
/**
|
|
3
|
+
* The Buoy tools the app has installed, for a host given no `modules`.
|
|
4
|
+
*
|
|
5
|
+
* This file is the stand-in: an empty map. The `buoy()` bundler plugin
|
|
6
|
+
* (`@buoy-gg/core/vite`) replaces `@buoy-gg/core/web/installed-tools` with a
|
|
7
|
+
* generated module that imports every installed tool's `/web` entry and exports
|
|
8
|
+
* the same two names. The browser build keeps the import of this file as that
|
|
9
|
+
* bare specifier so the plugin can swap it (scripts/build-web.mjs).
|
|
10
|
+
*/
|
|
11
|
+
export declare const installedTools: BrowserToolModules;
|
|
12
|
+
/** False here; true in the plugin's generated module, even when it found no tools. */
|
|
13
|
+
export declare const installedToolsFound: boolean;
|
|
14
|
+
//# sourceMappingURL=installedTools.d.ts.map
|
|
@@ -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.63";
|
|
13
13
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/web/auto.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{d as a}from"./chunks/chunk-CLXYMJTS.mjs";import{createElement as n,lazy as l,Suspense as i,useEffect as f,useState as c}from"react";function r(){if(typeof window>"u")return false;let e=window.Capacitor,t=false;try{t=e?.isNativePlatform?.()===true}catch{t=false}return t?e?.DEBUG===true:typeof a<"u"?!!a:process.env.NODE_ENV!=="production"}var o;function p(){return o??(o=l(()=>import("./chunks/FloatingDevTools.web-M3ASH5EV.mjs").then(e=>({default:e.FloatingDevTools})))),o}function d({enabled:e,...t}){let[u,s]=c(false);return f(()=>{s(e??r())},[e]),u?n(i,{fallback:null},n(p(),t)):null}export{d as BuoyDevTools,r as shouldShowBuoy};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{v as o}from"./chunk-3YORPV22.mjs";import"./chunk-7G3P7Z7K.mjs";import"./chunk-5SGL6QL4.mjs";import"./chunk-CLXYMJTS.mjs";export{o as FloatingDevTools};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";import{a as N,b as H,c as lt,d as Xo,e as Jt,f as Qo,g as bl,h as Ee,i as Yt,j as Ne,k as ct}from"./chunk-7G3P7Z7K.mjs";import{b as Zo,c as ei}from"./chunk-5SGL6QL4.mjs";import{a as Xt,d as _e}from"./chunk-CLXYMJTS.mjs";import{FloatingToolHost as ti}from"@buoy-gg/shared-ui/web/floating";import*as ni from"@buoy-gg/license/web";import{LicenseManager as oi,useLicense as ii,sameLicenseKey as ri,resolveDevBuild as ai,capacitorDebug as si,isCapacitorNative as li,loadCapacitorAppHost as ci}from"@buoy-gg/license/web";import{AccountSetup as di,HintsProvider as ui,normalizeEnvironment as pi,registerToolOpener as mi,startSettingsSync as gi}from"@buoy-gg/shared-ui/web";import{useState as Bt,useMemo as ge,useCallback as We,useEffect as ee,useRef as fi}from"react";import{useSettings as hi,getToolLabel as dt,getToolDescription as yi,getToolColor as Qt}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Ae,devToolsStorageKeys as ut,EnvironmentIndicator as bi,EnvironmentSelectorInline as vi}from"@buoy-gg/shared-ui/web";var Si=[];function wi(){return[]}function Zt(e=[]){return[...new Map(e.map(t=>[t.id,t])).values()]}function Rt(e,t){return e.filter(n=>{let i=n.slot||"both";return i==="both"||i===t})}function xi(e,t){let n=t instanceof Set?t:new Set(t);return e.filter(i=>n.has(i.id))}import{FloatingTool as en,FloatingToolDivider as Ci,FloatingToolUserStatus as tn,getBubbleAnchorPosition as Ii}from"@buoy-gg/shared-ui/web/floating";import{useState as Q,useEffect as Oe,useMemo as pt,useRef as mt,useCallback as gt}from"react";var nn={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 Ti(e,t){return e&&nn[e]?nn[e]:t}import{getDialLayout as ki,getAllIconPositions as zi,getGridLineRotations as Mi,getIconStaggerInputRange as Bi,MAX_DIAL_SLOTS as Ge,DIAL_ICON_SIZE as Ri,dialAnimationConfig as on,getDialCSSKeyframesString as Ei,getDialCSSAnimationStyles as Ai,dialColors as L,dialStyles as S,withAlpha as rn,floatingToolsColors as Oi}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as an,monoFont as sn,ToolBackground as Di,useToolBackground as Pi}from"@buoy-gg/shared-ui/web";import{memo as Li}from"react";import{RasterLayer as Fi,scatter as $i,useLoop as ji,withBgAlpha as Ni}from"@buoy-gg/shared-ui/web";import{Fragment as _i,jsx as Je}from"react/jsx-runtime";var Wi=.94,Hi=6,Ui=2400,ft=3,ln=16,Ki=Array.from({length:ft},(e,t)=>$i(22343^t*40503,ln*4)),cn=["#FFFFFF","#B3D9FF","#8CB3FF"],dn=Math.PI/3,un=14*Math.PI/180;function Vi(e){let t=Math.min(5,Math.floor(e*6)),n=e*6-t;return t*dn+un/2+n*(dn-un)}function qi(e){return Math.min(Hi,1/(1-e*Wi))}function Gi(e){let t=.15+.85*e*e;return e<.06?t*=e/.06:e>.94&&(t*=(1-e)/.06),Math.min(.7,t)}function Ji(e){let t=e/ft,n=[],i=12;for(let s=0;s<=i;s++)n.push(s/i);let o=(1-t)%1;o>.001&&o<1-.001&&n.push(o-1e-4,o+1e-4),n.sort((s,u)=>s-u);let r=[],a=[],l=[];for(let s of n){let u=t===0&&s===1?1:(s+t)%1;r.push(s),a.push(qi(u)),l.push(Gi(u))}return{input:r,scale:a,opacity:l}}var Yi=Array.from({length:ft},(e,t)=>Ji(t)),Xi=Li(function({size:e}){let t=ji(Ui),n=e/2,i=[];for(let o=0;o<ft;o++){let r=Ki[o],a=Yi[o],l=[];for(let s=0;s<ln;s++){let u=Vi(r[s*4]),m=(.15+.85*Math.sqrt(r[s*4+1]))*.5*n,C=cn[Math.floor(r[s*4+3]*cn.length)%3],g=n+Math.cos(u)*m,B=n+Math.sin(u)*m,w=.6,R=w*2.4;l.push(Je(N,{style:{position:"absolute",left:g-R/2,top:B-R/2,width:R,height:R,borderRadius:R/2,backgroundColor:Ni(C,.3)}},`${s}-h`),Je(N,{style:{position:"absolute",left:g-w/2,top:B-w/2,width:w,height:w,borderRadius:w/2,backgroundColor:C}},s))}i.push(Je(Ee.View,{style:{position:"absolute",left:0,top:0,width:e,height:e,opacity:t.interpolate({inputRange:a.input,outputRange:a.opacity}),transform:[{scale:t.interpolate({inputRange:a.input,outputRange:a.scale})}]},pointerEvents:"none",children:Je(Fi,{style:{width:e,height:e},raster:false,children:l})},o))}return Je(_i,{children:i})});import{useEffect as Qi,useState as pn}from"react";import{dialColors as He,withAlpha as mn}from"@buoy-gg/floating-tools-react/web";import{ARROW_BOTTOM_OFFSET as Zi,ARROW_HEIGHT as er,SPACING_GAP as Fl,getScreenCenterY as $l,calculateTooltipPosition as tr,calculateTargetPosition as jl}from"@buoy-gg/shared-ui/web/floating";import{monoFont as gn}from"@buoy-gg/shared-ui/web";import{jsx as Ue,jsxs as fn}from"react/jsx-runtime";var hn=false;function nr(){if(hn||typeof document>"u")return;let e=document.createElement("style");e.textContent=`
|
|
2
|
+
@keyframes buoyOnboardPulse {
|
|
3
|
+
0%, 100% { transform: scale(1); }
|
|
4
|
+
50% { transform: scale(1.02); }
|
|
5
|
+
}
|
|
6
|
+
@keyframes buoyOnboardArrowBounce {
|
|
7
|
+
0%, 100% { transform: translateY(0); }
|
|
8
|
+
50% { transform: translateY(-8px); }
|
|
9
|
+
}
|
|
10
|
+
`,document.head.appendChild(e),hn=true}var Et=He.accent;function yn({title:e,message:t,onDismiss:n,showArrow:i=true}){let[o,r]=pn(false),[a,l]=pn(false);Qi(()=>{nr();let u=requestAnimationFrame(()=>r(true));return()=>cancelAnimationFrame(u)},[]);let s={fontFamily:gn,textTransform:"uppercase"};return Ue("div",{style:{position:"fixed",left:"50%",bottom:tr(),transform:`translateX(-50%) scale(${o?1:.8})`,opacity:o?1:0,transition:"transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1), opacity 300ms ease",zIndex:10002,pointerEvents:"auto"},children:fn("div",{style:{position:"relative",animation:o?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ue("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),fn("div",{style:{position:"relative",maxWidth:280,backgroundColor:He.dialBackground,borderRadius:16,border:`1px solid ${He.dialBorder}`,padding:20,boxShadow:`0 0 20px ${mn(He.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ue("span",{style:{...s,fontSize:16,fontWeight:900,letterSpacing:1,color:Et,textAlign:"center"},children:e}),Ue("span",{style:{fontFamily:gn,fontSize:13,lineHeight:"20px",color:He.centerText,textAlign:"center"},children:t}),Ue("button",{onClick:n,onPointerDown:()=>l(true),onPointerUp:()=>l(false),onPointerLeave:()=>l(false),onPointerCancel:()=>l(false),style:{...s,marginTop:8,borderRadius:8,border:"none",backgroundColor:Et,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:a?.7:1,transform:a?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),i&&Ue("div",{style:{position:"absolute",left:"50%",bottom:Zi,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${er}px solid ${Et}`,filter:`drop-shadow(0 0 10px ${mn(He.dialShadow,.5)})`,animation:o?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}import{Fragment as or,jsx as D,jsxs as be}from"react/jsx-runtime";var ir={x:.5,y:.5},bn="@react_buoy_settings_tooltip_shown",vn=false;function rr(){if(vn||typeof document>"u")return;let e=document.createElement("style");e.textContent=Ei(),document.head.appendChild(e),vn=true}var Ke=e=>1-Math.pow(1-e,3),At=e=>e*e*e;function ar({icon:e,index:t,totalIcons:n,position:i,progress:o,onPress:r}){let[a,l]=Q(false),[s,u]=Q(false),m=!e.icon&&e.id.startsWith("empty-"),C=!m&&e.unavailable===true,g=!m&&!C,{icons:B}=on,w=Bi(t,n),R=0;o<=w[1]?R=0:o<=w[2]?R=(o-w[1])/(w[2]-w[1]):R=1,R=Math.max(0,Math.min(1,R));let z=Ri,A=B.pressIn.scale,M=R*(s?A:a?1.1:1),k=0;R<=0?k=0:R<=.3?k=R:k=.3+(R-.3)*(.7/.7);let v=i.x*R,T=i.y*R;return D("button",{role:"menuitem","aria-label":m?"Empty slot":Ti(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:P=>g&&P.pointerType==="mouse"&&l(true),onPointerLeave:()=>{l(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(${M})`,opacity:k,transition:a||s?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:m?D("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(or,{children:[D("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}}),D("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}}),D("div",{style:{marginBottom:S.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:a?"brightness(1.2)":"none"},children:e.icon}),D("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}),C&&D("span",{style:{fontSize:S.icon.label.fontSize-1,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,letterSpacing:S.icon.label.letterSpacing,color:Oi.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}function Sn({side:e,color:t}){return D("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(([n,i,o,r],a)=>D("line",{x1:n,y1:i,x2:o,y2:r,stroke:t,strokeWidth:2},a))})}function wn({side:e,disabled:t,onClick:n}){let[i,o]=Q(false),r=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:n,onPointerDown:()=>!t&&o(true),onPointerUp:()=>o(false),onPointerLeave:()=>o(false),onPointerCancel:()=>o(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:sn,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${rn(L.dialShadow,.4)}`,transform:i?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&D(Sn,{side:"prev",color:r}),e==="prev"?"PREV":"NEXT",e==="next"&&D(Sn,{side:"next",color:r})]})}function xn({icons:e,onClose:t,centerLabel:n="MENU",onCenterPress:i,settingsOpen:o=false,hintsDisabled:r=false}){let{id:a}=Pi(),[l,s]=Q(0),[u,m]=Q(0),[C,g]=Q(0),[B,w]=Q(0),[R,z]=Q(0),[A,M]=Q(1),[k,v]=Q(false),[T,P]=Q(false),[I,E]=Q(false),Z=mt(null),W=mt(null),q=mt(null),te=mt(false),{entrance:K,exit:re,interaction:ne}=on,ve=Ai(),[ae,Te]=Q(()=>({width:window.innerWidth,height:window.innerHeight}));Oe(()=>{let b=()=>Te({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);let $=pt(()=>ki({screenWidth:ae.width,maxCircleSize:Math.max(120,Math.min(320,ae.height-96))}),[ae]),qe=pt(()=>Mi(),[]),ke=pt(()=>zi(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]);Oe(()=>{rr()},[]),Oe(()=>{let b=K.backdrop.duration,x=K.dial.rotation.duration,Y=K.centerButton.delay,U=K.icons.delay,G=K.icons.duration,V=performance.now(),oe=me=>{let c=me-V;s(Math.min(1,c/b));let f=Math.min(1,c/400),O=Ke(f)*1.1;f>.7&&(O-=(f-.7)*.33),f>=1&&(O=1),m(Math.max(0,Math.min(1.05,O)));let X=Math.min(1,c/x);if(g(Ke(X)*360),c>=Y){let xe=Math.min(1,(c-Y)/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(c>=U){let xe=Math.min(1,(c-U)/G);z(Ke(xe))}let we=U+G;c<we?q.current=requestAnimationFrame(oe):(s(1),m(1),g(360),w(1),z(1),E(true))};return q.current=requestAnimationFrame(oe),()=>{q.current&&cancelAnimationFrame(q.current)}},[]);let pe=gt(()=>{if(te.current)return;te.current=true,P(true),q.current&&cancelAnimationFrame(q.current);let b=performance.now(),x=re.icons.duration,Y=re.centerButton.duration,U=re.dialScale.duration,G=Math.max(Y,U),V=re.backdrop.duration,oe=me=>{let c=me-b;if(c<x){let X=At(c/x);z(1-X),q.current=requestAnimationFrame(oe);return}let f=x;if(c<f+G){z(0);let X=Math.min(1,(c-f)/Y),we=Math.min(1,(c-f)/U);w(1-At(X)),m(1-At(we)),q.current=requestAnimationFrame(oe);return}let O=f+G;if(c<O+V){m(0),w(0);let X=(c-O)/V;s(1-X),q.current=requestAnimationFrame(oe);return}s(0),t()};q.current=requestAnimationFrame(oe)},[re,t]);Oe(()=>{let b=document.activeElement,x=Z.current;return()=>{b?.isConnected&&(document.activeElement===document.body||x?.contains(document.activeElement))&&b.focus()}},[]),Oe(()=>{if(o)return;W.current?.focus();let b=x=>{let Y=Z.current;if(Y){if(x.key==="Escape")x.preventDefault(),pe();else if(x.key==="Tab"){let U=Array.from(Y.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(oe=>oe.getClientRects().length>0),G=U[0],V=U[U.length-1];(!Y.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(Y.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,o]);let[Me,$e]=Q(false);Oe(()=>{if(r)return;let b=false,x=setTimeout(async()=>{let Y=await an.getItem(bn);!b&&!Y&&$e(true)},1200);return()=>{b=true,clearTimeout(x)}},[r]);let he=gt(()=>{$e(false),an.setItem(bn,"true")},[]);Oe(()=>{o&&Me&&he()},[o,Me,he]);let Be=gt(b=>{if(b.id.startsWith("empty-")||te.current)return;let[x,Y]=ne.iconSelect.pulse,U=performance.now(),G=150,V=oe=>{let me=oe-U;if(me<G){let c=Ke(me/G);M(1-(1-x.scale)*c),requestAnimationFrame(V)}else if(me<G*2){let c=Ke((me-G)/G);M(x.scale+(Y.scale-x.scale)*c),requestAnimationFrame(V)}else M(1)};requestAnimationFrame(V),setTimeout(()=>{b.onPress(),pe()},ne.iconSelect.actionDelay)},[ne.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,d=$.buttonSize*S.centerButton.containerRatio/2+6,_=I&&!T;return be("div",{ref:Z,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[D("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:l}}),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 ${rn(L.dialShadow,S.circle.shadowOpacity)}`,transform:`scale(${u}) rotate(${C}deg)`,opacity:u>.01?1:0,overflow:"hidden"},children:[D("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:L.dialGradient1,opacity:S.gradientLayers[0].opacity}}),D("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:L.dialGradient2,opacity:S.gradientLayers[1].opacity}}),D("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:L.dialGradient3,opacity:S.gradientLayers[2].opacity}}),qe.map(b=>D("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=>D("div",{style:{position:"absolute",top:0,[x]:0,width:`calc(50% - ${d}px)`,height:S.grid.lineHeight,backgroundColor:L.dialGridLine}},x))},b)),D("div",{"data-testid":"dial-background","data-background":a,style:{position:"absolute",inset:0,pointerEvents:"none"},children:a==="hyperspace"?D(Xi,{size:$.circleSize}):D(Di,{focus:ir})}),Se.map((b,x)=>D(ar,{icon:b,index:x,totalIcons:Se.length,position:ke[x],progress:R,onPress:()=>Be(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(${B*A})`,opacity:B>.01?1:0},children:[D("div",{style:{position:"absolute",inset:0,backgroundColor:L.dialGradient1,opacity:.5,borderRadius:$.buttonSize}}),D("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:L.dialGradient2,opacity:.3,borderRadius:$.buttonSize}}),D("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:L.dialGradient3,opacity:.2,borderRadius:$.buttonSize}}),D("div",{style:{width:Re,height:Re,borderRadius:$.buttonSize*S.centerButton.borderRadiusRatio,backgroundColor:L.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:D("button",{ref:W,type:"button","aria-label":o?"Close Settings":"Open Dev Tools Settings",disabled:!i,onClick:i,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:i?"pointer":"default",transform:k?`scale(${ne.centerHover.scale})`:"scale(1)",transition:`transform ${ne.centerHover.duration}ms ease`,animation:_&&!k?ve.pulse:"none"},children:o?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:[D("span",{style:{marginBottom:-2},children:"CLOSE"}),D("span",{style:{marginTop:-2},children:"SETTINGS"})]}):D("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:n})})})]})]}),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:[D(wn,{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:sn,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")]})]}),D(wn,{side:"next",disabled:J>=se-1,onClick:()=>ue(J+1)})]}),Me&&!o&&D(yn,{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 Cn,devToolsStorageKeys as sr}from"@buoy-gg/shared-ui/web";import{recordUsage as lr,pruneUsage as cr}from"@buoy-gg/floating-tools-core/web";var In=sr.dial.usage(),Ve={},Tn=false,Ot=null;function kn(){return Ot||(Ot=(async()=>{try{let e=await Cn.getItem(In);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(Ve=t)}}catch{}finally{Tn=true}})(),Ot)}kn();function dr(e){return e.map((t,n)=>({id:t,index:n,lastUsed:Ve[t]?.lastUsed??0})).sort((t,n)=>n.lastUsed-t.lastUsed||t.index-n.index).map(({id:t})=>t)}async function ur(e){if(!e)return;Tn||await kn();let t=Math.max(Date.now(),...Object.values(Ve).map(n=>n.lastUsed+1));Ve=cr(lr(Ve,e,t),t);try{await Cn.setItem(In,JSON.stringify(Ve))}catch{}}import{useCallback as pr,useMemo as zn}from"react";import{persistentStorage as mr}from"@buoy-gg/shared-ui/web";import{useState as ie,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 gr}from"react";import{getRegisteredToolModule as fr}from"@buoy-gg/shared-ui/web";var hr=()=>()=>{},yr=()=>null;function br(){let e=fr("@buoy-gg/external-sync");return gr(e?.subscribeSyncStatus??hr,()=>e?.getSyncStatus?.()??null,yr)}import{SentryIcon as vr,WifiCircuitIcon as Sr,ImageOverlayIcon as wr,RenderCountIcon as xr,Info as Dt,Layers as Cr,ChevronRightIcon as Mn,ChevronDown as Bn,getStorageBackendType as Ir,getUseLicense as Tr,signOutOfBuoy as kr,persistentStorage as De,Trash2 as zr,CheckCircle2 as Rn,BuoyUpgradeSheet as Mr,BackgroundSwitcher as Br,night as h,NightCard as Pe,NightRows as Pt,NightSectionLabel as Rr,NightFootnote as En,NightSwitch as An,NightButton as Lt,NightSegmented as Er,NightBadge as fe,NightSeparator as Ar,monoFont as On}from"@buoy-gg/shared-ui/web";import{EnvIcon as Dn,StorageIcon as Or,RoutesIcon as Dr,NetworkIcon as Pr,QueryIcon as Lr,HighlighterIcon as Fr,ReduxIcon as $r,EventsIcon as jr}from"@buoy-gg/floating-tools-core/web";import Nr,{createContext as _r,useContext as Wr}from"react";import{jsx as Hr}from"react/jsx-runtime";var Pn=_r({});function Ln({children:e,defaultFloatingTools:t,defaultDialTools:n}){let i=Nr.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:n}),[t,n]);return Hr(Pn.Provider,{value:i,children:e})}function Fn(){return Wr(Pn)}import Ur from"react";import{toolTheme as Kr}from"@buoy-gg/shared-ui/web";import{jsx as $n}from"react/jsx-runtime";function Vr({label:e,size:t,color:n=Kr.colors.text}){let i=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),o=i<=2?t:t*1.6,r=Math.max(7,Math.min(t*(i===1?.7:.62),o/(.62*i)));return $n("span",{style:{display:"inline-flex",minWidth:t,maxWidth:o,height:t,alignItems:"center",justifyContent:"center",color:n,fontSize:r,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}function jn(e,t){return e==null?e:typeof e=="function"?Ur.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?$n(Vr,{label:String(e),size:t.size,color:t.color}):e}import{JsModal as qr,devToolsStorageKeys as Ft,onSettingsApplied as Gr,expandableWindowControlsSupported as Jr}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Yr}from"@buoy-gg/shared-ui/web";import{Fragment as Ye,jsx as p,jsxs as j}from"react/jsx-runtime";var Xe="@react_buoy_dev_tools_settings",Xr=6,vt=e=>{let t=Xr,n={};for(let[i,o]of Object.entries(e))o&&t>0?(n[i]=true,t-=1):n[i]=false;return n},Qr=(e,t)=>{let{userStatus:n,environment:i,...o}=e,r=t?Object.entries(o).filter(([a])=>t.includes(a)):Object.entries(o);return{...Object.fromEntries(r),environment:i??false}},Nn=(e,t,n)=>{if(!t)return e;let i={...e.dialTools,...t.dialTools??{}},o=n?.allowedDialKeys?Object.entries(i).filter(([r])=>n.allowedDialKeys?.includes(r)):Object.entries(i);return{dialTools:vt(Object.fromEntries(o)),floatingTools:Qr({...e.floatingTools,...t.floatingTools??{}},n?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},Zr=(e=[],t,n)=>{let i={},o={},r=new Set(t??[]),a=new Set(n??[]),l=!n||n.length===0;for(let s of e){let{id:u,slot:m="both"}=s;(m==="dial"||m==="both")&&(i[u]=l?true:a.has(u)),(m==="row"||m==="both")&&(o[u]=r.has(u))}return{dialTools:vt(i),floatingTools:{...o,environment:r.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},ea=({visible:e,onClose:t,onSettingsChange:n,initialSettings:i,availableApps:o=[],storage:r=De,zIndex:a})=>{let{defaultFloatingTools:l,defaultDialTools:s}=Fn(),u=yt(()=>Zr(o,l,s),[o,l,s]),m=yt(()=>Object.keys(u.dialTools),[u]),C=yt(()=>Object.keys(u.floatingTools).filter(c=>c!=="environment"),[u]),[g,B]=ie(i||Qe||u),[w,R]=ie($t??"floating"),[z,A]=ie($t!==null),[M,k]=ie(new Set),[v,T]=ie(false),[P,I]=ie(false);Ce(()=>{let c=requestAnimationFrame(()=>I(true));return()=>cancelAnimationFrame(c)},[]);let E=br();Ce(()=>{(async()=>{try{let c=await De.getItem(Ft.settings.activeTab());if(c&&["floating","settings","pro"].includes(c)){let f=c;$t=f,R(O=>O===f?O:f)}}catch{}finally{A(true)}})()},[]),Ce(()=>{z&&De.setItem(Ft.settings.activeTab(),w).catch(c=>{console.warn("Failed to save settings active tab:",c)})},[w,z]);let Z=Tr()?.(),W=Z?.isPro??false,q=!W&&Z?.licenseKey?Z.error:null,te=Z?.errorKind==="transport",[K,re]=ie(_n),[ne,ve]=ie(false),[ae,Te]=ie(false),[$,qe]=ie(false),[ke,Fe]=ie([]),[ze,se]=ie(false),J=Yr(),Se=Yt.get("window").height,pe=Yt.get("window").width,Me=Math.floor(Se*.33),$e=Math.min(pe-32,400),he=ht(async()=>{try{let c=await r.getItem(Xe);if(c){let f=JSON.parse(c),O=Nn(u,f,{allowedDialKeys:m,allowedFloatingKeys:C});Qe=O,B(X=>Wn(X,O)?X:O);return}Qe=u,B(f=>Wn(f,u)?f:u)}catch(c){console.error("Failed to load dev tools settings:",c),B(u)}},[u,m,C,r]);Ce(()=>{he()},[he]),Ce(()=>{Ir().then(c=>{_n=c,re(f=>f===c?f:c)})},[]),Ce(()=>{$&&(se(true),De.getAllKeys().then(c=>{Fe(c.sort())}).catch(()=>{Fe([])}).finally(()=>{se(false)}))},[$]);let Be=async c=>{try{let f={...c,dialTools:vt(c.dialTools)};await r.setItem(Xe,JSON.stringify(f)),Qe=f,B(f),n?.(f),bt.emit(f)}catch(f){console.error("Failed to save dev tools settings:",f)}},ue=c=>{let f={...g,floatingTools:{...g.floatingTools,[c]:!g.floatingTools[c]}};Be(f)},ye=c=>{let f={...g,globalSettings:{...g.globalSettings,[c]:!g.globalSettings?.[c]}};Be(f)},Re=async()=>{ve(true),Te(false);try{await De.clear(),Te(true),B(u),r!==De&&await r.setItem(Xe,JSON.stringify(u)),n?.(u),bt.emit(u),setTimeout(()=>Te(false),2e3)}catch(c){console.error("Failed to clear storage:",c)}finally{ve(false)}},d=ht(c=>{},[]),_=c=>{let f=o.find(O=>O.id===c);return f?.description?f.description:c==="environment"?"Environment badge.":""},b=c=>c==="environment"?"Env Badge":o.find(f=>f.id===c)?.name??c.toUpperCase().replace(/_/g," "),x=c=>{if(!P)return null;switch(c){case"query":return p(Lr,{size:18});case"env":return p(Dn,{size:18});case"sentry":return p(vr,{size:18,color:"#9945FF"});case"storage":return p(Or,{size:18,bgColor:h.color.surface});case"wifi":case"query-wifi-toggle":return p(Sr,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return p(Dr,{size:18,bgColor:h.color.surface});case"network":return p(Pr,{size:18});case"environment":return p(Dn,{size:18});case"debug-borders":return p(Cr,{size:18,color:h.color.accent});case"highlight-updates":return p(xr,{size:18,color:h.color.accent});case"highlight-updates-modal":return p(Fr,{size:18});case"redux":return p($r,{size:18});case"image-overlay":return p(wr,{size:18});case"events":return p(jr,{size:18});case"zustand":try{let{ZustandIcon:f}=Xt("@buoy-gg/zustand/web");return p(f,{size:18})}catch{return p(Dt,{size:18,color:h.color.textSecondary})}case"jotai":try{let{JotaiIcon:f}=Xt("@buoy-gg/jotai/web");return p(f,{size:18})}catch{return p(Dt,{size:18,color:h.color.textSecondary})}default:{let f=o.find(O=>O.id===c);return f?.icon!=null?jn(f.icon,{slot:"row",size:18,color:f.color}):p(Dt,{size:18,color:h.color.textSecondary})}}},Y=(c,f,O,X)=>{let we=_(c);return j(lt,{activeOpacity:O?1:.7,onPress:()=>!O&&X(),accessibilityLabel:b(c),accessibilityRole:"button",style:[y.toolRow,O&&y.rowDisabled],children:[p(N,{style:y.toolIconSlot,children:x(c)}),j(N,{style:y.rowInfo,children:[j(H,{style:y.rowLabel,children:[b(c),O?" \xB7 max 6":""]}),we?p(H,{style:y.rowCaption,numberOfLines:1,children:we}):null]}),p(An,{value:f,disabled:O,onValueChange:()=>X()})]},c)},U=c=>{k(f=>{let O=new Set(f);return O.has(c)?O.delete(c):O.add(c),O})},G=(c,f,O,X,we)=>{let xe=g.globalSettings?.[c]??false,je=M.has(c);return j(N,{children:[j(lt,{activeOpacity:.7,onPress:()=>U(c),accessibilityLabel:f,style:y.settingRow,children:[j(N,{style:y.rowInfo,children:[p(H,{style:y.rowLabel,children:f}),p(H,{style:y.rowCaption,numberOfLines:je?0:1,children:O})]}),p(An,{value:xe,onValueChange:()=>ye(c)})]}),je&&j(N,{style:y.settingRowBody,children:[p(H,{style:y.settingRowBodyText,children:X}),p(H,{style:y.settingRowBodyHint,children:we})]})]},c)},V=(c,f,O)=>j(N,{children:[p(Rr,{children:c}),f,O]}),oe=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(N,{style:y.container,children:[j(Jt,{style:y.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:y.scrollContainer,children:[w==="floating"&&p(Ye,{children:V("Floating Tools",p(Pe,{glass:true,children:p(Pt,{children:Object.entries(g.floatingTools).map(([c,f])=>Y(c,f,false,()=>ue(c)))})}),p(En,{children:"Tools switched on here appear in the floating bubble row."}))}),w==="settings"&&j(Ye,{children:[V("Background",p(Pe,{glass:true,padded:true,children:p(Br,{embedded:true})})),V("Storage",j(Pe,{glass:true,children:[j(lt,{activeOpacity:.7,onPress:()=>qe(!$),accessibilityLabel:"Storage Type",style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Storage Type"})}),oe,$?p(Bn,{size:16,color:h.color.textTertiary}):p(Mn,{size:16,color:h.color.textTertiary})]}),$&&j(Ye,{children:[j(N,{style:y.settingRowBody,children:[p(H,{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(H,{style:[y.settingRowBodyText,y.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),K==="memory"&&p(H,{style:[y.settingRowBodyText,y.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),p(Ar,{}),j(N,{style:y.storageExpanded,children:[j(N,{style:y.storageExpandedHeader,children:[p(H,{style:y.storageExpandedTitle,children:"SAVED SETTINGS"}),p(H,{style:y.storageExpandedCount,children:ze?"\u2026":`${ke.length} keys`})]}),ze?p(H,{style:y.storageKeyEmpty,children:"Loading\u2026"}):ke.length===0?p(H,{style:y.storageKeyEmpty,children:"No settings saved yet"}):p(Jt,{style:y.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:ke.map(c=>p(N,{style:y.storageKeyItem,children:p(H,{style:y.storageKeyText,numberOfLines:1,children:c.replace("@react_buoy_","")})},c))})]}),p(N,{style:y.cardButtonWrap,children:p(Lt,{label:ae?"Cleared":ne?"Clearing\u2026":"Clear All Settings",variant:ae?"secondary":"destructive",size:"md",disabled:ne,onPress:Re,icon:ae?p(Rn,{size:15,color:h.color.accent}):p(zr,{size:15,color:ne?h.color.textTertiary:h.color.danger})})})]})]})),E&&E.state!=="idle"&&V("Desktop Sync",j(Pe,{glass:true,children:[j(lt,{activeOpacity:.7,onPress:()=>U("desktopSync"),accessibilityLabel:"Buoy Desktop",style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Buoy Desktop"})}),E.state==="connected"?p(fe,{label:"Connected",tone:"accent"}):E.state==="connecting"?p(fe,{label:"Connecting\u2026",tone:"neutral"}):p(fe,{label:"Retrying",tone:"warning"}),M.has("desktopSync")?p(Bn,{size:16,color:h.color.textTertiary}):p(Mn,{size:16,color:h.color.textTertiary})]}),M.has("desktopSync")&&j(N,{style:y.settingRowBody,children:[j(H,{style:y.settingRowBodyText,children:[E.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",p(H,{style:y.footnoteMono,children:E.targetURL??"(unknown URL)"}),E.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),E.state==="retrying"&&E.lastError&&j(H,{style:[y.settingRowBodyText,y.bodyWarning],children:["Last error: ",E.lastError]})]})]})),V("Modal Behavior",p(Pe,{glass:true,children:j(Pt,{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."),Jr(Ne.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(Ye,{children:[V("License",j(Pe,{glass:true,children:[j(N,{style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"License Status"})}),p(N,{testID:"buoy-settings-license-status",accessibilityLabel:W?"License: Active":"License: Free",children:W?p(fe,{label:"Active",tone:"accent"}):p(fe,{label:"Free",tone:"neutral"})})]}),Z?.tierSource==="session"?j(N,{style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Signed in with Buoy"})}),p(Lt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void kr(),testID:"buoy-settings-signout"})]}):null]}),p(En,{children:W?"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."})),!W&&j(Ye,{children:[V("Pro Features",p(Pe,{glass:true,children:p(Pt,{children:["Advanced Settings","Priority Support"].map(c=>j(N,{style:y.featureRow,children:[p(Rn,{size:16,color:h.color.accent}),p(H,{style:y.rowLabel,children:c})]},c))})})),p(Lt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>T(true)})]})]})]}),p(Mr,{visible:v,onClose:()=>T(false)})]});return p(qr,{visible:e,onClose:t,zIndex:a,variant:"night",header:{showToggleButton:false,customContent:p(N,{style:y.headerRow,children:p(Er,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:w,onChange:c=>R(c)})})},initialMode:"bottomSheet",onModeChange:d,persistenceKey:Ft.settings.root(),enablePersistence:true,maxHeight:Se-J.top,initialHeight:Me,initialFloatingPosition:{x:(pe-$e)/2,y:J.top+20},enableGlitchEffects:true,children:me()})},ta={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},na=(e,t)=>{let n=new Set(e??[]),i=new Set(t??[]),o={};for(let a of i)o[a]=true;let r={environment:n.has("environment")};for(let a of n)a!=="environment"&&(r[a]=true);return{dialTools:vt(o),floatingTools:r,globalSettings:{enableSharedModalDimensions:false}}},Qe=null,$t=null,_n=null,Wn=(e,t)=>JSON.stringify(e)===JSON.stringify(t);bt.addListener(e=>{e&&(Qe=e)});var Hn=()=>{let{defaultFloatingTools:e,defaultDialTools:t}=Fn(),n=yt(()=>!e&&!t?ta:na(e,t),[e,t]),[i,o]=ie(n),r=ht(async()=>{try{let l=await De.getItem(Xe);if(l){let s=JSON.parse(l),u=Nn(n,s);o(u);return}o(n)}catch(l){console.error("Failed to load dev tools settings:",l),o(n)}},[n]);Ce(()=>Gr(l=>{l.includes(Xe)&&r()}),[r]),Ce(()=>{r();let l=bt.addListener(s=>{try{s&&o(s)}catch{}});return()=>{l()}},[r]);let a=ht(()=>{r()},[r]);return{settings:i,refreshSettings:a}},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:On},storageKeyEmpty:{color:h.color.textTertiary,fontSize:h.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:On,fontSize:h.font.label,color:h.color.textSecondary}});import{jsx as Un}from"react/jsx-runtime";var oa=[];function Kn({visible:e,onClose:t,availableTools:n=oa,defaultFloatingTools:i,defaultDialTools:o,storage:r=mr,onSettingsChange:a}){let l=zn(()=>({getItem:async m=>r.getItem(m),setItem:async(m,C)=>r.setItem(m,C)}),[r]),s=zn(()=>n.map(m=>({...m,name:m.name??m.id,icon:typeof m.icon=="function"?C=>m.icon(C.size):m.icon})),[n]),u=pr(m=>{a?.(m)},[a]);return Un(Ln,{defaultFloatingTools:i,defaultDialTools:o,children:Un(ea,{visible:e,onClose:t,zIndex:11e3,availableApps:s,storage:l,onSettingsChange:u})})}import{persistentStorage as Vn,setExpandableWindowControls as ia}from"@buoy-gg/shared-ui/web";import{createContext as ra,useCallback as Ie,useContext as aa,useEffect as St,useMemo as sa,useRef as Ze,useState as qn}from"react";var la=(e,t,n)=>{if(t.singleton){let o=e.find(r=>r.id===t.id);if(o){let r=o.minimized??false;return{instanceId:o.instanceId,wasMinimized:r,apps:[...e.filter(a=>a.instanceId!==o.instanceId),{...o,minimized:false}]}}}let i=n();return{instanceId:i,wasMinimized:false,apps:[...e,{...t,instanceId:i}]}};import{createContext as ca,useCallback as Gn,useContext as da,useEffect as wt,useMemo as ua,useRef as Jn,useState as xt}from"react";import{JsModal as pa,ModalHeader as et,HeaderSearchButton as ma,TickProvider as ga,ToolScreenHeaderContext as fa,devToolsStorageKeys as Yn,buoyColors as Xn,gameUIColors as jt}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as Ct}from"react/jsx-runtime";var tt=()=>{},ha={search:"",isSearchActive:false,clearSearch:tt,close:tt,minimize:tt,showToast:tt,setHeaderOverride:tt},Qn=ca(null);function Zn(){return da(Qn)??ha}function ya(e,t){let{setHeaderOverride:n}=Zn();wt(()=>(n(e),()=>n(null)),t)}var eo=2200,ba={success:jt.success,error:jt.error,info:jt.info};function va({message:e,type:t,nonce:n}){let i=Jn(new Ee.Value(0)).current;wt(()=>{i.setValue(0),Ee.sequence([Ee.timing(i,{toValue:1,duration:150,useNativeDriver:true}),Ee.delay(eo-450),Ee.timing(i,{toValue:0,duration:300,useNativeDriver:true})]).start()},[n,i]);let o=ba[t];return Ct(Ee.View,{pointerEvents:"none",style:[It.toast,{opacity:i,borderColor:o+"60"}],children:[le(N,{style:[It.toastDot,{backgroundColor:o}]}),le(H,{style:It.toastText,numberOfLines:2,children:e})]})}function Sa({app:e,config:t,visible:n,zIndex:i,onClose:o,onMinimize:r,initialModalState:a,enableSharedModalDimensions:l,bodyProps:s}){let u=e.component,[m,C]=xt(false),[g,B]=xt(""),[w,R]=xt(null),[z,A]=xt(null),M=Jn(null),k=Gn(()=>{C(false),B("")},[]),v=Gn((K,re="info")=>{M.current&&clearTimeout(M.current),A(ne=>({message:K,type:re,nonce:(ne?.nonce??0)+1})),M.current=setTimeout(()=>A(null),eo)},[]);wt(()=>()=>{M.current&&clearTimeout(M.current)},[]);let T=ua(()=>({search:m?g:"",isSearchActive:m,clearSearch:k,close:o,minimize:()=>r(),showToast:v,setHeaderOverride:R,instanceId:e.instanceId}),[g,m,k,o,r,v,e.instanceId]),P=w?.title??t.title??e.title??e.id,I=w?.subtitle??t.subtitle,E=w?.onBack,Z=w?.actions??t.headerActions,W=w?.searchable??t.searchable;wt(()=>{!W&&m&&k()},[W,m,k]);let q=l?Yn.modal.root():Yn.custom(e.id).modal(),te=Ct(et,{children:[E&&!m&&le(et.Navigation,{onBack:E}),m?le(et.Search,{value:g,onChangeText:B,onCancel:k,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):le(et.Content,{title:P,subtitle:I}),Ct(et.Actions,{children:[!m&&Z,W&&!m&&le(ma,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>C(true)})]})]});return le(Qn.Provider,{value:T,children:le(pa,{visible:n,onClose:o,onBack:E,onMinimize:r,initialModalState:a,zIndex:i,persistenceKey:q,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:te,showToggleButton:true},disableScrollWrapper:true,styles:{},children:Ct(N,{style:It.bodyRoot,children:[le(ga,{children:le(fa.Provider,{value:R,children:le(u,{...s})})}),z&&le(va,{message:z.message,type:z.type,nonce:z.nonce})]})})})}var It=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:Xn.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:Xn.text}});import{useEffect as wa,useRef as xa}from"react";import{capacitorPlatform as Ca,capacitorPlugin as Ia}from"@buoy-gg/license/web";function Ta(){return globalThis.__BUOY_HOLDS_BACK__===true}var ka=99.5;function za(){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 Ma(e,t){let n=xa(t);n.current=t,wa(()=>{if(!e||Ca()!=="android")return;let i=globalThis;i.__BUOY_HOLDS_BACK__=true;let o;if(za()){let r=a=>{a.detail?.register?.(ka,()=>{n.current()})};document.addEventListener("ionBackButton",r),o=()=>document.removeEventListener("ionBackButton",r)}else{let r=Ia("App");if(!r?.addListener){i.__BUOY_HOLDS_BACK__=false;return}let a=false,l=null;Promise.resolve(r.addListener("backButton",()=>n.current())).then(s=>{a?s.remove():l=s}).catch(()=>{}),o=()=>{a=true,l&&l.remove()}}return()=>{o(),i.__BUOY_HOLDS_BACK__=false}},[e])}import{Fragment as Ba,jsx as ce}from"react/jsx-runtime";var to=ra(null),no="@react_buoy_open_apps",Nt=44,Ra=12,Ea=100,Aa=16,Oa=e=>({x:window.innerWidth-Nt-Aa,y:window.innerHeight-Ea-Nt-e*(Nt+Ra)}),oo=({children:e})=>{let[t,n]=qn([]),[i,o]=qn(false),r=Ze([]),a=Ze(null),l=Ze(false),s=Ze(false),u=Ze(false),m=Ie(v=>{let T="";return n(P=>{let{apps:I,instanceId:E}=la(P,v,()=>`${v.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return T=E,I}),T},[]),C=Ie(()=>{if(l.current||!s.current||!u.current)return;l.current=true;let v=a.current;if(!v||v.length===0){o(true);return}a.current=null,v.forEach(({id:T,minimized:P})=>{let I=r.current.find(E=>E.id===T);if(I&&I.component){let E=jn(I.icon,{slot:"dial",size:20,color:I.color});m({id:I.id,title:I.name,component:I.component,props:I.props,modal:I.modal,launchMode:I.launchMode||"self-modal",singleton:I.singleton??true,icon:E,color:I.color,minimized:P})}}),o(true)},[m]);St(()=>{let v=false;return(async()=>{try{let T=await Vn.getItem(no);if(v)return;if(T){let P=JSON.parse(T),I;Array.isArray(P)&&P.length>0&&(typeof P[0]=="string"?I=P.map(E=>({id:E,minimized:false})):I=P.filter(E=>typeof E=="object"&&E!==null&&typeof E.id=="string"),I.length&&(a.current=I))}}catch{}v||(s.current=true,C())})(),()=>{v=true}},[C]),St(()=>{if(!i)return;let v=t.map(T=>({id:T.id,minimized:T.minimized??false}));Vn.setItem(no,JSON.stringify(v))},[t,i]);let g=Ie(v=>{r.current=v,u.current=true,C()},[C]),B=Ie(v=>{n(T=>T.length?v?T.filter(P=>P.instanceId!==v):T.slice(0,-1):T)},[]),w=Ie(()=>n([]),[]),R=Ie((v,T)=>{n(P=>P.map(I=>I.instanceId===v?{...I,minimized:true,restoreState:T}:I))},[]),z=Ie((v,T)=>{n(P=>P.map(I=>I.instanceId===v?{...I,minimized:false,restoreState:T??I.restoreState}:I))},[]),A=Ie(v=>t.find(T=>T.instanceId===v)?.minimized??false,[t]),M=t.some(v=>v.launchMode!=="toggle-only"&&!v.minimized);St(()=>{if(!M)return;let v=T=>{if(T.key!=="Escape"||T.defaultPrevented)return;let P=[...t].reverse().find(I=>I.launchMode!=="toggle-only"&&!I.minimized);P&&B(P.instanceId)};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[M,B,t]),Ma(t.length>0,()=>B());let k=sa(()=>({openApps:t,isAnyOpen:M,open:m,close:B,closeAll:w,registerApps:g,minimize:R,restore:z,isMinimized:A}),[t,M,m,B,w,g,R,z,A]);return ce(to.Provider,{value:k,children:e})},nt=()=>{let e=aa(to);return e||{openApps:[],isAnyOpen:false,open:()=>"",close:()=>{},closeAll:()=>{},registerApps:()=>{},minimize:()=>{},restore:()=>{},isMinimized:()=>false}},Da=9e3,Pa={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},La={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Fa=({app:e,zIndex:t,onClose:n,onMinimize:i,minimizeTargetPosition:o,enableSharedModalDimensions:r})=>{let a=e.component,l=!e.minimized,s={...e.props??{},...r?{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(Sa,{app:e,config:e.modal,visible:l,zIndex:t,onClose:n,onMinimize:i,initialModalState:e.restoreState,enableSharedModalDimensions:r,bodyProps:s})}):e.launchMode==="self-modal"?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(a,{...s,visible:l,onClose:n,onRequestClose:n,onMinimize:i,minimizeTargetPosition:o,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?l?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(a,{...s,onClose:n,onMinimize:i,minimizeTargetPosition:o,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...Pa,zIndex:t,display:l?"flex":"none"},children:ce("div",{style:La,children:ce(a,{...s,onClose:n,onMinimize:i,minimizeTargetPosition:o,initialModalState:e.restoreState,instanceId:e.instanceId})})})},io=()=>{let{openApps:e,close:t,minimize:n}=nt(),{settings:i}=Hn();St(()=>{ia(i.globalSettings?.expandableWindowControls!==false)},[i.globalSettings?.expandableWindowControls]);let o=e.filter(l=>l.launchMode!=="toggle-only");if(o.length===0)return null;let r=o.filter(l=>l.minimized).length,a=Ii()??Oa(r);return ce(Ba,{children:o.map((l,s)=>ce(Fa,{app:l,zIndex:Da+s,onClose:()=>t(l.instanceId),onMinimize:u=>n(l.instanceId,u),enableSharedModalDimensions:i.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:a},l.instanceId))})};import{useCallback as $a,useEffect as _t,useRef as ja,useState as ro,useSyncExternalStore as ao}from"react";import{persistentStorage as so,getToolAttention as Wt,subscribeToolAttention as lo}from"@buoy-gg/shared-ui/web";import{jsx as de,jsxs as Tt}from"react/jsx-runtime";function Na(e){return ao(lo,()=>Wt(e),()=>Wt(e))}var co={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},uo={needsInput:3,failed:2,done:1},po=new Map;function mo(e){let t=null;for(let i of e?e.split("|"):[]){let o=Wt(i);o&&(!t||uo[o.kind]>uo[t.kind])&&(t=o)}let n=po.get(e);return n&&t&&n.kind===t.kind&&n.label===t.label?n:!n&&!t?null:(po.set(e,t),t)}function _a(e){let t=e.join("|");return ao(lo,()=>mo(t),()=>mo(t))}var go=28,Ht=32,Ut=6,fo=8,ho=24,yo="@react_buoy_minimized_stack_expanded",Wa=80,bo=2e3,Ha=6e3,Ua="#1A1A1A",ot="#888888";function vo({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:ot,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ka({id:e,title:t,icon:n,index:i,onPress:o}){let r=Na(e),a=ja(null);return _t(()=>{let l=true,s,u=()=>{a.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:Wa,easing:"linear"})},m=C=>{let g=C?500+Math.random()*1500+i*200:bo+Math.random()*(Ha-bo)+i*300;s=setTimeout(()=>{l&&(u(),m(false))},g)};return m(true),()=>{l=false,clearTimeout(s)}},[i]),Tt("button",{type:"button","aria-label":r?`${t} \u2014 ${r.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:o,style:{width:Ht,height:Ht,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[de("div",{ref:a,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:n}),r?de("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:co[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 Va({containerWidth:e=32}){let{openApps:t,restore:n}=nt(),i=t.filter(g=>g.minimized&&g.launchMode!=="toggle-only"),[o,r]=ro(false),[a,l]=ro(false),s=_a(i.map(g=>g.id));_t(()=>{let g=false;return(async()=>{let B=await so.getItem(yo);!g&&B==="true"&&r(true),g||l(true)})(),()=>{g=true}},[]),_t(()=>{a&&so.setItem(yo,o?"true":"false")},[o,a]);let u=$a(g=>{n(g)},[n]);if(i.length===0)return null;let m=fo+i.length*Ht+(i.length-1)*Ut+Ut+ho+4,C={backgroundColor:Ua,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${ot}66`,borderLeft:`1px solid ${ot}66`,borderRight:`1px solid ${ot}66`,borderBottom:"none",boxSizing:"border-box"};return Tt("div",{style:{height:go,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:o?"visible":"hidden",height:o?m:0,opacity:o?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:o?"auto":"none",...C},children:Tt("div",{style:{height:m,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:fo,gap:Ut,boxSizing:"border-box"},children:[o&&[...i].reverse().map((g,B)=>de(Ka,{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:B,onPress:()=>u(g.instanceId)},g.instanceId)),de("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>r(false),style:{width:"100%",height:ho,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:de(vo,{down:true})})]})}),Tt("button",{type:"button","aria-label":`Show ${i.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:o?-1:0,"aria-hidden":o,onClick:()=>r(true),style:{position:"absolute",bottom:0,left:0,width:e,height:go,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:o?0:1,transform:o?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:o?"none":"auto",...C},children:[de(vo,{}),s?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:co[s.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:s.kind==="needsInput"?"!":""}):null,i.length>1&&de("span",{style:{fontSize:9,fontWeight:600,color:ot,marginLeft:1},children:i.length})]})]})}import{registerToolModules as qa}from"@buoy-gg/shared-ui/web";import{createElement as Ga}from"react";function it(e){let t=e.icon;return{...e,icon:typeof t=="function"?n=>Ga(t,{size:n,slot:e.slot??"both",color:e.color}):()=>t}}import{createContext as Ja,useContext as Ya,useState as So,useMemo as wo}from"react";import{jsx as Xa}from"react/jsx-runtime";var xo=Ja(null);function Co({children:e}){let[t,n]=So(false),[i,o]=So(false),r=wo(()=>t||i,[t,i]),a=wo(()=>({isDialOpen:t,isToolOpen:i,isDevToolsActive:r,setDialOpen:n,setToolOpen:o}),[t,i,r]);return Xa(xo.Provider,{value:a,children:e})}function Kt(){let e=Ya(xo);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:()=>{},setToolOpen:()=>{}}}import*as Qa from"@buoy-gg/license/web";import*as Za from"@buoy-gg/shared-ui/web";import*as es from"@buoy-gg/shared-ui/web/dataViewer";function Io(e){qa({core:{useDevToolsVisibility:Kt},license:Qa,"shared-ui":Za,"shared-ui/dataViewer":es,...e});let t=new Set;return Object.values(e).flatMap(n=>Object.entries(n).flatMap(([i,o])=>!i.endsWith("Preset")||!o||typeof o.id!="string"||!o.component||t.has(o.id)?[]:(t.add(o.id),[it(o)])))}import{useEffect as kt,useMemo as zt,useRef as ts}from"react";import{LicenseManager as ns,installCapacitorBridge as os,resolveDevBuild as To,useLicense as is}from"@buoy-gg/license/web";import{registerToolAdapters as rs}from"@buoy-gg/shared-ui/web";function ko(e){return typeof e=="object"&&e!==null?e:void 0}function as({isDevelopment:e,isLicensed:t,externalSync:n,isAvailable:i}){if(n===false||!i)return false;if(e)return true;let o=ko(n);return t&&o?.enableInRelease===true&&Mo(o.socketURL,o)===null}var zo="http://localhost:42831";function ss(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}function Mo(e,t){let n=e??zo;if(t?.allowInsecureNetwork===true)return null;let i;try{i=new URL(n)}catch{return`[Buoy] externalSync.socketURL "${n}" isn't a valid URL, so this release build won't connect to Buoy Desktop.`}return i.protocol==="https:"||i.protocol==="wss:"||ss(i.hostname)?null:`[Buoy] This release build won't connect to ${n}: 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 ls={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function cs(e,t,n){if(t)return e;let i=null;for(let[o,r]of Object.entries(ls)){if(n?.includes(o))continue;let a=e[o];if(!a?.actions)continue;let l={...a.actions};for(let s of r)s in l&&(l[s]=()=>{throw new Error(`${o}.${s} is off in release builds. To allow it from Buoy Desktop and the MCP, pass externalSync={{ enableInRelease: true, releaseActions: ["${o}"] }}.`)});i??(i={...e}),i[o]={...a,actions:l}}return i??e}import{useEffect as ds,useMemo as us,useState as ps}from"react";import{devToolsStorageKeys as ms,persistentStorage as gs}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as fs}from"@buoy-gg/license/web";var hs=8;function ys(){let e="";for(;e.length<hs;)e+=(Math.random()*16|0).toString(16);return e}function bs(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function vs({appName:e,hardwareName:t,platform:n,installId:i,deviceId:o}){let r=bs(e??"buoy")||"buoy",a=e??"Buoy Device",l=t?.trim()||n;return o?{deviceId:o,deviceName:`${a} (${l})`}:{deviceId:`${r}-${n}-${i}`,deviceName:`${a} (${l} \xB7 ${i.slice(-4)})`}}function Ss(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}function ws(){let e=globalThis;try{return e.localStorage??null}catch{return null}}async function xs({platform:e=Ne.OS,store:t,mint:n=ys}={}){let i=ms.sync.deviceId(),o=t===void 0?fs()?ws():e==="web"?Ss():gs:t;if(!o)return n();try{let r=await o.getItem(i);if(r&&r.length>0)return r;let a=n();return await o.setItem(i,a),a}catch{return n()}}var Vt=null;function Cs(){return Vt||(Vt=xs()),Vt}function Is(e,t){let n=e?.deviceId,i=e?.deviceName,o=t.loadId??Cs,r=t.platform??Ne.OS,[a,l]=ps(null);return ds(()=>{if(n)return;let s=false;return o().then(u=>{s||l(u)}),()=>{s=true}},[n,o]),us(()=>{if(!n&&!a)return null;let s=vs({appName:t.appName,hardwareName:t.hardwareName,platform:r,installId:a??"",deviceId:n});return i?{...s,deviceName:i}:s},[n,i,a,t.appName,t.hardwareName,r])}import{useEffect as Ts,useState as ks}from"react";import{capacitorPlatform as zs,capacitorPlugin as Mt,isCapacitorNative as Ms}from"@buoy-gg/license/web";function Bs(e,t){if(t==="ios")return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":null;let n=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(e)?.[1]?.trim();return!n||n==="K"?null:n}function Rs(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}function Bo(){return typeof navigator>"u"?"":navigator.userAgent??""}function qt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}var Ro="@react_buoy_capacitor_app_name";function Es(e){try{let t=globalThis.localStorage;if(!t)return e;let n=t.getItem(Ro);if(n)return n;e&&t.setItem(Ro,e)}catch{}return e}function As(){let e=zs();if(!e)return{platform:"web",appName:qt(),hardwareName:"Browser",ready:true};let t=!!Mt("App");return{platform:e,appName:t?qt():Es(qt()),hardwareName:Bs(Bo(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Mt("Device")}}function Os(){let[e,t]=ks(As);return Ts(()=>{if(!Ms())return;let n=false,i=Mt("App"),o=Mt("Device");return Promise.all([i?.getInfo?.().catch(()=>null)??null,o?.getInfo?.().catch(()=>null)??null]).then(([r,a])=>{if(n)return;let l=r?.name?.trim(),s=a?.name?.trim()||a?.model?.trim();t(u=>({...u,appName:l||u.appName,hardwareName:s||u.hardwareName,ready:true}))}),()=>{n=true}},[]),e}function Eo(){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:Bo(),serverUrl:typeof e=="string"?e:null}}function Ao(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}function Ds(e,t){if(e==="ios"){let n=Ao(t.serverUrl);return n?n===Ao(t.origin):t.protocol==="capacitor:"}return Oo.has(t.hostname)}var Oo=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Ps(e,t,n,i=Eo()){if(n==="web"||!i)return e;let o;try{o=new URL(e)}catch{return e}let r=Ds(n,i);return!t&&r&&o.hostname===i.hostname&&(o.hostname="localhost"),n==="android"&&Oo.has(o.hostname)&&Rs(i.userAgent)&&(o.hostname="10.0.2.2"),o.toString().replace(/\/$/,"")}function Ls(e,t,n=Eo()){return t!=="android"||!n||n.protocol!=="https:"||!/^(http|ws):/i.test(e)?null:`[Buoy] Can't reach Buoy Desktop at ${e}. This Android WebView serves the app from https://${n.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 Fs,resolveReloadStrategy as $s,scheduleReloadApp as js}from"@buoy-gg/shared-ui/web";var Do=Date.now(),Po=Fs(),Ns={platform:Ne.OS,isTV:Ne.isTV===true,isTVOS:Ne.isTVOS===true},Lo={version:3,getSnapshot:()=>{let e=$s("auto");return{startedAt:Do,devServerOrigin:Po,device:Ns,reload:{available:e!==null,strategy:e}}},subscribe:e=>()=>{},actions:{ping:()=>({ok:true,startedAt:Do,devServerOrigin:Po}),reloadApp:e=>{let t=e??{},{strategy:n,delayMs:i}=js({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:n,delayMs:i}}}};import{Fragment as _s,jsx as Le,jsxs as Ws}from"react/jsx-runtime";var Hs=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],Us=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Ks(e){let t=zt(()=>Object.fromEntries(Object.entries(e.modules).map(([i,o])=>[i.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),o])),[e.modules]),n=t["react-query"];return n?.useReactQuerySyncAdapter?Le(Vs,{...e,modules:t,query:n}):Le(Fo,{...e,modules:t})}function Vs(e){let t=e.query.useReactQuerySyncAdapter();return Le(Fo,{...e,queryAdapter:t})}function Fo({modules:e,apps:t,requiredEnvVars:n,externalSync:i,headless:o,sentryGetClient:r,queryAdapter:a}){let{isPro:l,tier:s}=is(),u=zt(()=>{let z={app:Lo};for(let[A,M]of Object.entries(e))for(let[k,v]of Object.entries(M))k.endsWith("SyncAdapter")&&v&&typeof v=="object"&&(z[A]=v);a&&(z.query=a),e.env?.createEnvSyncAdapter&&(z.env=e.env.createEnvSyncAdapter(n??[]));for(let A of t??[])A.sync&&(z[`custom:${A.id}`]=A.sync);return z},[e,t,n,a]),m=ts(u);m.current=u,kt(()=>rs(()=>m.current),[]),kt(()=>{let z=[],A=M=>{let k=M?.();typeof k=="function"&&z.push(k)};return A(e.network?.startNetworkCapture),A(e.storage?.startBrowserStorageCapture),A(e.assets?.startBrowserAssetCapture),To(typeof _e<"u"?_e:process.env.NODE_ENV!=="production")&&A(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&A(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&A(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let M of z.reverse())M()}},[e]);let C=e["external-sync"],g=To(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),B=as({isDevelopment:g,isLicensed:l,externalSync:i,isAvailable:!!C}),w=ko(i);os({release:!g&&!!w?.enableInRelease}),!g&&w?.enableInRelease&&jo(Mo(w.socketURL,w));let R=e.sentry?.SentryRoot;return Ws(_s,{children:[Object.entries(e).flatMap(([z,A])=>Hs.map(M=>{let k=A[M];return k?Le(k,{},`${z}:${M}`):null})),R&&Le(R,{getClient:r}),Object.entries(e).flatMap(([z,A])=>Us.map(M=>{let k=A[M];return k&&(!o||M==="ScenariosOverlay"||M==="ImpersonateOverlay")?Le(k,{},`${z}:${M}`):null})),B&&Le(qs,{module:C,tools:u,options:w,isPro:l,tier:s,dev:g})]})}var $o=null;function jo(e){!e||e===$o||($o=e,console.warn(e))}function qs({module:e,tools:t,options:n,isPro:i,tier:o,dev:r}){let a=Os(),l=Is(n,{appName:a.appName,hardwareName:a.hardwareName,platform:a.platform}),s=zt(()=>Ps(n?.socketURL??(r?e.getDefaultSocketURL():zo),!!n?.socketURL,a.platform),[n?.socketURL,r,e,a.platform]),{socket:u}=e.useExternalSyncSocket({deviceName:l?.deviceName??"Buoy Browser",socketURL:s,persistentDeviceId:a.ready?l?.deviceId??null:null,platform:a.platform,extraDeviceInfo:a.extraDeviceInfo,enableLogs:n?.enableLogs});kt(()=>{let g=Ls(s,a.platform);if(!u||!g)return;let B=()=>jo(g);return u.on("connect_error",B),()=>{u.off("connect_error",B)}},[u,s,a.platform]),kt(()=>{if(!u)return;let g=()=>{u.connected&&ns.hasAccountAccess()&&u.emit("device-license",{isPro:i?"1":"0",tier:o})};return g(),u.on("connect",g),()=>{u.off("connect",g)}},[u,i,o]);let m=n?.releaseActions?.join(",")??"",C=zt(()=>cs(t,r,m?m.split(","):void 0),[t,r,m]);return e.useExternalSync({tools:C,socket:u,deviceId:a.ready?l?.deviceId??null:null,enableLogs:n?.enableLogs}),null}import{useState as No}from"react";import{createPortal as Gs}from"react-dom";import{useBuoySession as Js}from"@buoy-gg/license/web";import{Fragment as _o,jsx as rt,jsxs as Wo}from"react/jsx-runtime";var Ho="#20C997";function Ys(){let{status:e,signIn:t,signOut:n}=Js(),[i,o]=No(false),[r,a]=No(null);if(typeof document>"u")return null;let l=()=>{a(null),o(true),t().catch(u=>a(u instanceof Error?u.message:"Sign-in did not work. Try again.")).finally(()=>o(false))},s=e.state==="active";return Gs(rt("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:s||r?"12px 14px":0,borderRadius:16,background:s||r?"#0f1419":"transparent",color:"#e6edf3",boxShadow:s||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:s?Wo(_o,{children:[rt("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),rt("button",{type:"button",onClick:()=>void n(),style:Xs,"data-testid":"buoy-signout",children:"Sign out"})]}):Wo(_o,{children:[r?rt("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:r}):null,rt("button",{type:"button",onClick:l,disabled:i,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:Ho,color:"#04130d",fontWeight:600,fontSize:14,cursor:i?"wait":"pointer",boxShadow:"0 8px 24px rgba(0,0,0,.3)"},children:i?"Signing in\u2026":"Sign in to Buoy"})]})}),document.body)}var Xs={marginTop:8,padding:0,border:"none",background:"none",color:Ho,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useState as Qs}from"react";import{AccountSetupButton as Zs,BuoyNeedsPlanCard as el,BuoySignInCard as tl,useSignInState as nl}from"@buoy-gg/shared-ui/web";import{jsx as at,jsxs as Uo}from"react/jsx-runtime";function Ko({needsPlan:e=false}){let[t,n]=Qs(false),i=nl();return Uo(N,{pointerEvents:"box-none",style:Vo.root,children:[at(Zs,{expanded:t,onPress:()=>n(true)}),t?at(Qo,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>n(false),children:Uo(N,{style:Vo.overlay,accessibilityViewIsModal:true,children:[at(Xo,{style:ct.absoluteFill,onPress:()=>n(false),accessible:false}),e&&i==="active"?at(el,{onClose:()=>n(false)}):at(tl,{onClose:()=>n(false)})]})}):null]})}var Vo=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 qo(e){if(e.length>6){let t=e.map(n=>`"${n}"`).join(", ");return e.slice(0,6)}return e}import{installedTools as ol,installedToolsFound as il}from"@buoy-gg/core/web/installed-tools";import{Fragment as Gt,jsx as F,jsxs as st}from"react/jsx-runtime";var Go={},Jo="@react_buoy_floating_menu_tooltip_shown",rl=Ae;function al({size:e=14,color:t="#20C997"}){let n=Math.max(2,e/4),i=Math.max(1,e/16);return F("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${n}px)`,gap:i,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((o,r)=>F("div",{style:{width:n,height:n,borderRadius:n/2,backgroundColor:t}},r))})}function sl(e){let{defaultFloatingTools:t,defaultDialTools:n,disableHints:i=false,children:o}=e,r=ge(()=>n&&qo(n),[n]);return F(Ln,{defaultFloatingTools:t,defaultDialTools:r,children:F(ui,{disableHints:i,children:st(Co,{children:[F(oo,{children:F(ml,{...e})}),o]})})})}var ll=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function cl({modules:e=Go}){return F(Gt,{children:Object.entries(e).flatMap(([t,n])=>ll.map(i=>{let o=n[i];return o?F(o,{},`${t}:${i}`):null}))})}function dl(){let{openApps:e,restore:t}=nt();return ee(()=>mi(n=>{let i=e.find(o=>o.id===n);return i?(t(i.instanceId),true):false}),[e,t]),null}function ul(){let e=si();return pi((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}function pl(e,t,n,i){let o=m=>Object.entries(e).find(([C])=>C.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===m)?.[1],r=[],a=o("env");t?.length&&a?.createEnvTool&&a.createEnvVarConfig&&r.push(it(a.createEnvTool({requiredEnvVars:a.createEnvVarConfig(t)})));let l=o("storage");n?.length&&l?.createStorageTool&&r.push(it(l.createStorageTool({requiredStorageKeys:n})));let s=o("ask-buoy"),u=i==="hosted"?s?.hostedAskBuoy?.():i;return u&&s?.createAskBuoyTool&&r.push(it(s.createAskBuoyTool(u))),r}function ml({environment:e,userRole:t="admin",availableEnvironments:n,onEnvironmentSwitch:i,apps:o,modules:r=Go,externalSync:a,requiredEnvVars:l,sentryGetClient:s,disableHints:u=false,headless:m=false,hidden:C=false,defaultFloatingTools:g,defaultDialTools:B,zustandStores:w,requiredStorageKeys:R,askBuoy:z}){let A=e??ul(),M=ge(()=>B?qo(B):void 0,[B]),[k,v]=Bt(false),[T,P]=Bt(false),I=fi(false),E=nt(),Z=ge(()=>pl(r,l,R,z),[r,l,R,z]),W=ge(()=>Zt([...Io(r),...o??[],...Z]),[o,r,Z]),q=ge(()=>Object.entries(r).find(([d])=>d.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[r]);ee(()=>{if(!w||typeof q?.watchStores!="function")return;let d=q.watchStores(w);return typeof d=="function"?d:void 0},[w,q]);let te=Kt(),K=E.openApps.some(d=>!d.minimized);ee(()=>{te.setDialOpen(k)},[k,te.setDialOpen]),ee(()=>{te.setToolOpen(K||T)},[K,T,te.setToolOpen]);let{registerApps:re}=E;ee(()=>{re(W.map(d=>{let _=d.icon;return{...d,icon:typeof _=="function"?({size:b})=>_(b):_}}))},[re,W]);let ne=ge(()=>W.map(d=>({id:d.id,name:d.name,description:d.description,slot:d.slot})),[W]);hi({availableTools:ne,storage:rl}),ee(()=>{let d=false;return(async()=>{let[_,b]=await Promise.all([Ae.getItem(ut.dial.isOpen()),Ae.getItem(ut.settings.modalOpen())]);d||(_==="true"&&v(true),b==="true"&&(v(true),P(true)),I.current=true)})(),()=>{d=true}},[]),ee(()=>{I.current&&Ae.setItem(ut.dial.isOpen(),k?"true":"false")},[k]),ee(()=>{I.current&&Ae.setItem(ut.settings.modalOpen(),T?"true":"false")},[T]);let ve=We(d=>{if(ur(d.id),d.launchMode==="toggle-only"){d.onPress?.();return}if(d.component){let _=typeof d.icon=="function"?d.icon(20):d.icon;E.open({id:d.id,title:d.name||dt(d.id),component:d.component,props:d.props,modal:d.modal,launchMode:d.launchMode||"self-modal",singleton:d.singleton??true,icon:_,color:d.color||Qt(d.id)})}else d.onPress?.()},[E]),ae=ge(()=>Rt(W,"dial").map(d=>{let _=d.color||Qt(d.id),b;return typeof d.icon=="string"?b=d.icon:typeof d.icon=="function"?b=d.icon(32):b=null,{id:d.id,name:d.name||dt(d.id),icon:b,unavailable:!d.component&&!d.onPress,color:_,onPress:()=>{ve(d),v(false)}}}),[W,ve]),Te=ge(()=>{if(!k)return ae;let d=new Map(ae.map(_=>[_.id,_]));return dr(ae.map(_=>_.id)).map(_=>d.get(_)).filter(_=>!!_)},[k,ae]),{settings:$}=Hn(),qe=ge(()=>Rt(W,"row").filter(d=>($.floatingTools[d.id]??false)===true&&(d.component||d.onPress)),[W,$.floatingTools]),ke=ge(()=>W.map(d=>({id:d.id,name:d.name||dt(d.id),description:d.description||yi(d.id),slot:d.slot,icon:d.icon,color:d.color})),[W]),[Fe,ze]=Bt(false),se=E.openApps.some(d=>!d.minimized);ee(()=>{if(u)return;let d=false,_=setTimeout(async()=>{let b=await Ae.getItem(Jo);!d&&!b&&ze(true)},1e3);return()=>{d=true,clearTimeout(_)}},[u]);let J=We(()=>{ze(false),Ae.setItem(Jo,"true")},[]),Se=We(()=>{J(),v(true)},[J]),pe=We(()=>{v(false),P(false)},[]),Me=We(()=>{P(d=>!d)},[]),$e=We(()=>P(false),[]),he=!!(n?.length&&i),Be=$.floatingTools.environment!==false,ue=Fe&&!k&&!se&&!C;ee(()=>{if(!ue)return;let d=b=>{(!(b.target instanceof Element)||!b.target.closest("[data-buoy-root]"))&&J()},_=b=>{b.key==="Escape"&&J()};return document.addEventListener("pointerdown",d,true),document.addEventListener("keydown",_),()=>{document.removeEventListener("pointerdown",d,true),document.removeEventListener("keydown",_)}},[ue,J]);let ye=E.openApps.some(d=>d.minimized&&d.launchMode!=="toggle-only"),Re=F(Ks,{modules:r,apps:o,requiredEnvVars:l,externalSync:a,headless:m,sentryGetClient:s});return m?Re:st("div",{"data-buoy-root":"",style:{display:"contents"},children:[Re,F(dl,{}),ue&&F("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),F("div",{style:C?{visibility:"hidden"}:{display:"contents"},"aria-hidden":C||void 0,children:st(en,{enablePositionPersistence:!ue,pushToSide:k||se,suspendPointerEvents:k,centerOnboarding:ue,minimizedStack:ye?F(Va,{}):void 0,hasMinimizedStack:ye,children:[A&&Be&&!he&&F(bi,{environment:A}),he&&Be&&F(vi,{currentEnvironment:A??"local",availableEnvironments:n,onSelect:i}),t?F(tn,{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(al,{})}),qe.map(d=>F("button",{"aria-label":d.name||dt(d.id),title:d.description,onClick:()=>ve(d),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof d.icon=="function"?d.icon(16):d.icon},d.id))]})}),ue&&F(yn,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:J}),k&&!C&&F(xn,{icons:Te,onClose:pe,centerLabel:"BUOY",onCenterPress:Me,settingsOpen:T,hintsDisabled:u}),T&&!C&&F(Kn,{visible:true,onClose:$e,availableTools:ke,defaultFloatingTools:g,defaultDialTools:M,onSettingsChange:d=>{}}),!C&&st(Gt,{children:[F(io,{}),F(ti,{})]})]})}function gl(e){let t=e&&typeof e=="object"?e.appId:void 0,n=!!e;ee(()=>{if(!n)return;let i=false,o=ni.SessionManager;if(!o)return;let r=a=>{i||!a||(o.configure({audience:`app:${a}`}),o.load().catch(()=>{}))};return t?r(t):ci().then(a=>r(a?.bundleId)).catch(()=>{}),()=>{i=true}},[n,t])}var Yo=false;function fl(e){return e.modules?e:(!il&&!Yo&&typeof console<"u"&&(Yo=true,console.info("[Buoy] No tools loaded. Add buoy() from '@buoy-gg/core/vite' to your Vite plugins, or pass modules to FloatingDevTools.")),{...e,modules:ol})}function hl(e){let t=fl(e),{access:n,isPro:i,licenseKey:o}=ii();ee(()=>{oi.configure(t.licenseKey)},[t.licenseKey]);let r=t.licenseKey===void 0||ri(t.licenseKey,o),a=ai(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),l=r&&n.status==="admitted";ee(()=>{l&&gi()},[l]),ee(()=>{a||n.status==="initializing"||(i&&l?Zo():ei())},[a,i,l,n.status]);let s=li();return gl(s?t.signIn:void 0),!a&&!i?!t.signIn||t.headless?null:s?F(Ko,{needsPlan:true}):F(Ys,{}):l?F(sl,{...t}):st(Gt,{children:[n.status==="initializing"&&F(cl,{modules:t.modules}),t.headless?null:t.signIn&&s?F(Ko,{}):F(di,{})]})}export{Si as a,wi as b,Zt as c,Rt as d,xi as e,en as f,Ci as g,tn as h,xn as i,Kn as j,Zn as k,ya as l,Ta as m,oo as n,nt as o,io as p,it as q,Co as r,Kt as s,Io as t,Lo as u,hl as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{b as k,c as E}from"./chunk-CLXYMJTS.mjs";var m={};k(m,{AccessibilityInfo:()=>I,ActivityIndicator:()=>ye,Alert:()=>Se,Animated:()=>b,AppRegistry:()=>V,AppState:()=>P,Appearance:()=>L,BackHandler:()=>M,Button:()=>ve,CheckBox:()=>_,Clipboard:()=>N,DeviceEventEmitter:()=>ce,Dimensions:()=>x,Easing:()=>R,FlatList:()=>q,I18nManager:()=>D,Image:()=>G,ImageBackground:()=>J,InteractionManager:()=>H,Keyboard:()=>F,KeyboardAvoidingView:()=>Q,LayoutAnimation:()=>K,Linking:()=>O,LogBox:()=>le,Modal:()=>A,NativeEventEmitter:()=>W,NativeModules:()=>B,PanResponder:()=>$,Picker:()=>X,PixelRatio:()=>j,Platform:()=>h,Pressable:()=>w,ProgressBar:()=>Z,RefreshControl:()=>ee,SafeAreaView:()=>ae,ScrollView:()=>S,SectionList:()=>te,Share:()=>z,StatusBar:()=>ie,StyleSheet:()=>f,Switch:()=>ge,Text:()=>y,TextInput:()=>xe,Touchable:()=>oe,TouchableHighlight:()=>he,TouchableNativeFeedback:()=>se,TouchableOpacity:()=>v,TouchableWithoutFeedback:()=>fe,UIManager:()=>U,Vibration:()=>Y,View:()=>g,VirtualizedList:()=>ne,YellowBox:()=>re,findNodeHandle:()=>we,unstable_createElement:()=>C,useColorScheme:()=>de,useLocaleContext:()=>pe,useWindowDimensions:()=>ue});E(m,T);import*as T from"react-native-web";import{unstable_createElement as C,NativeModules as B,AccessibilityInfo as I,Animated as b,Appearance as L,AppRegistry as V,AppState as P,BackHandler as M,Clipboard as N,Dimensions as x,Easing as R,I18nManager as D,Keyboard as F,InteractionManager as H,LayoutAnimation as K,Linking as O,NativeEventEmitter as W,PanResponder as $,PixelRatio as j,Platform as h,Share as z,StyleSheet as f,UIManager as U,Vibration as Y,CheckBox as _,FlatList as q,Image as G,ImageBackground as J,KeyboardAvoidingView as Q,Picker as X,ProgressBar as Z,RefreshControl as ee,SafeAreaView as ae,SectionList as te,StatusBar as ie,Touchable as oe,TouchableNativeFeedback as se,VirtualizedList as ne,YellowBox as re,LogBox as le,DeviceEventEmitter as ce,useColorScheme as de,useLocaleContext as pe,useWindowDimensions as ue}from"react-native-web";import*as a from"react-native-web";import{createElement as me,forwardRef as be}from"react";function i(s){let r=be((u,e)=>{let{accessibilityState:l,accessibilityValue:c,...n}=u;for(let o of["busy","checked","disabled","expanded","selected"])l?.[o]!==void 0&&n[`aria-${o}`]===void 0&&(n[`aria-${o}`]=l[o]);for(let[o,t]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))c?.[o]!==void 0&&n[`aria-${t}`]===void 0&&(n[`aria-${t}`]=c[o]);return me(s,{...n,ref:e})}),d=s.State;return d&&Object.assign(r,{State:d}),r.displayName=s.displayName??s.name??"NativeWebView",r}var g=i(a.View),y=i(a.Text),xe=i(a.TextInput),v=i(a.TouchableOpacity),he=i(a.TouchableHighlight),fe=i(a.TouchableWithoutFeedback),w=i(a.Pressable),S=i(a.ScrollView),A=i(a.Modal),ge=i(a.Switch),ye=i(a.ActivityIndicator),ve=i(a.Button),we=a.findNodeHandle,Se={alert(s,r,d,u){if(typeof document>"u")return;let e=document.createElement("dialog");e.dataset.buoyRoot="",e.setAttribute("aria-label",s),e.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 l=document.createElement("h2");if(l.textContent=s,l.style.cssText="font-size:18px;margin:0 0 12px",e.appendChild(l),r){let t=document.createElement("p");t.textContent=r,t.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",e.appendChild(t)}let c=document.createElement("div");c.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let n=d?.length?d:[{text:"OK"}],o=()=>{e.close?.(),e.remove()};for(let t of n){let p=document.createElement("button");p.type="button",p.textContent=t.text??"OK",p.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${t.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,p.onclick=()=>{o(),t.onPress?.()},c.appendChild(p)}e.addEventListener("cancel",t=>{t.preventDefault(),u?.cancelable!==false&&(o(),u?.onDismiss?.())}),e.appendChild(c),document.body.appendChild(e),e.showModal?e.showModal():e.setAttribute("open","")}};export{g as a,y as b,v as c,w as d,S as e,A as f,m as g,b as h,x as i,h as j,f as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as n,b as d,g as de,k as m}from"./chunk-7G3P7Z7K.mjs";import{toolTheme as y}from"@buoy-gg/shared-ui/web";import{CopyButton as x,toolTheme as a}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as b,SplitDiffViewer as C}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as t,jsxs as f}from"react/jsx-runtime";var S={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 p(e){return S[e.toLowerCase()]??a.colors.textMuted}var w={GET:a.colors.info,POST:a.colors.success,PUT:a.colors.warning,PATCH:a.colors.warning,DELETE:a.colors.error};function v(e){return w[e.toUpperCase()]??a.colors.textSecondary}var T={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 M(e){return T[e.toLowerCase()]??a.colors.textSecondary}function D({children:e,color:s=a.colors.textSecondary,icon:o,size:r="small",pill:l=false,mono:u=false,style:g}){let h=typeof e=="string"||typeof e=="number";return f(n,{style:[i.base,r==="medium"&&i.medium,l&&i.pill,{backgroundColor:s+"1A",borderColor:s+"40"},g],children:[o,h?t(d,{style:[i.text,r==="medium"&&i.textMedium,u&&i.textMono,{color:s}],numberOfLines:1,children:e}):e]})}var i=m.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 k({status:e,color:s,size:o=8,style:r}){let l=s??(e?p(e):a.colors.textMuted);return t(n,{style:[{width:o,height:o,borderRadius:o/2,backgroundColor:l},r]})}function B({label:e,value:s,copyable:o=false,style:r}){let l=typeof s=="string"||typeof s=="number";return f(n,{style:[c.row,r],children:[t(d,{style:c.label,numberOfLines:1,children:e}),t(n,{style:c.value,children:l?t(d,{style:c.valueText,numberOfLines:2,children:String(s)}):s}),o&&s!=null&&t(x,{value:s,size:12})]})}var c=m.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 E({oldValue:e,newValue:s,mode:o="tree",showUnchanged:r=true,scrollEnabled:l=false,height:u=220}){return o==="text"?t(C,{oldValue:e,newValue:s,height:u}):t(b,{oldValue:e,newValue:s,showUnchanged:r,scrollEnabled:l})}import{ToolButton as P,CopyButton as V,PowerToggleButton as L}from"@buoy-gg/shared-ui/web";import{CompactRow as z,DevToolsCard as H}from"@buoy-gg/shared-ui/web";import{SectionHeader as R,CollapsibleSection as U,TabSelector as F,EmptyState as I,SearchBar as A,EventStepperFooter as O}from"@buoy-gg/shared-ui/web";import{DataViewer as j}from"@buoy-gg/shared-ui/web/dataViewer";import{BaseEventStore as G}from"@buoy-gg/shared-ui/web";import{RelativeTime as W}from"@buoy-gg/shared-ui/web";import{formatBytes as J,formatDuration as K,formatNumber as q,truncateMiddle as X,safeStringify as N}from"@buoy-gg/shared-ui/web";import{usePersistedState as Z,persistentStorage as Q,devToolsStorageKeys as _}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as $,copyToClipboard as Y}from"@buoy-gg/shared-ui/web";import{JsModal as aa}from"@buoy-gg/shared-ui/web";import{Activity as ea,AlertTriangle as sa,Bug as oa,Check as ra,CheckCircle as ta,ChevronDown as la,ChevronLeft as ia,ChevronRight as na,ChevronUp as ca,Clock as ua,Copy as da,Database as ma,Eye as fa,EyeOff as pa,FileJson as ga,FileText as ha,Filter as ya,FlaskConical as xa,Globe as ba,Hash as Ca,Info as Sa,Key as wa,Layers as va,Lock as Ta,Pause as Ma,Play as Da,Plus as ka,Power as Ba,RefreshCw as Ea,Search as Pa,Settings as Va,Shield as La,Trash2 as za,User as Ha,Wifi as Ra,X as Ua,Zap as Fa,AlertCircle as Ia,BarChart3 as Aa,Bookmark as Oa,Cloud as ja,Download as Ga,Edit3 as Wa,GitBranch as Ja,HardDrive as Ka,HelpCircle as qa,Home as Xa,Image as Na,Link as Za,Maximize2 as Qa,Minus as _a,Palette as $a,Pin as Ya,Route as ae,Server as ee,Smartphone as se,Square as oe,CheckSquare as re,Timer as te,Unlock as le,Upload as ie,Users as ne,XCircle as ce}from"@buoy-gg/shared-ui/web";export{p as a,v as b,M as c,D as d,k as e,B as f,E as g,y as h,P as i,V as j,L as k,z as l,H as m,R as n,U as o,F as p,I as q,A as r,O as s,j as t,G as u,W as v,J as w,K as x,q as y,X as z,N as A,Z as B,Q as C,_ as D,$ as E,Y as F,aa as G,ea as H,sa as I,oa as J,ra as K,ta as L,la as M,ia as N,na as O,ca as P,ua as Q,da as R,ma as S,fa as T,pa as U,ga as V,ha as W,ya as X,xa as Y,ba as Z,Ca as _,Sa as $,wa as aa,va as ba,Ta as ca,Ma as da,Da as ea,ka as fa,Ba as ga,Ea as ha,Pa as ia,Va as ja,La as ka,za as la,Ha as ma,Ra as na,Ua as oa,Fa as pa,Ia as qa,Aa as ra,Oa as sa,ja as ta,Ga as ua,Wa as va,Ja as wa,Ka as xa,qa as ya,Xa as za,Na as Aa,Za as Ba,Qa as Ca,_a as Da,$a as Ea,Ya as Fa,ae as Ga,ee as Ha,se as Ia,oe as Ja,re as Ka,te as La,le as Ma,ie as Na,ne as Oa,ce as Pa};
|
package/lib/web/index.mjs
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
"use client";import{$ as
|
|
2
|
-
@keyframes buoyOnboardPulse {
|
|
3
|
-
0%, 100% { transform: scale(1); }
|
|
4
|
-
50% { transform: scale(1.02); }
|
|
5
|
-
}
|
|
6
|
-
@keyframes buoyOnboardArrowBounce {
|
|
7
|
-
0%, 100% { transform: translateY(0); }
|
|
8
|
-
50% { transform: translateY(-8px); }
|
|
9
|
-
}
|
|
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};
|
|
1
|
+
"use client";import{$ as a,A as s,Aa as o,B as e,Ba as t,C as r,Ca as l,D as i,Da as n,E as p,Ea as g,F as u,Fa as c,G as C,Ga as d,H as S,Ha as m,I as T,Ia as y,J as f,Ja as h,K as v,Ka as D,L as b,La as B,M as k,Ma as P,N as H,Na as w,O as F,Oa as A,P as L,Pa as M,Q as E,R,S as I,T as U,U as W,V as O,W as V,X as q,Y as x,Z as G,_ as J,a as K,aa as j,b as z,ba as N,c as X,ca as Z,d as Q,da as Y,e as _,ea as $,f as aa,fa as sa,g as oa,ga as ea,h as ta,ha as ra,i as la,ia,j as na,ja as pa,k as ga,ka as ua,l as ca,la as Ca,m as da,ma as Sa,n as ma,na as Ta,o as ya,oa as fa,p as ha,pa as va,q as Da,qa as ba,r as Ba,ra as ka,s as Pa,sa as Ha,t as wa,ta as Fa,u as Aa,ua as La,v as Ma,va as Ea,w as Ra,wa as Ia,x as Ua,xa as Wa,y as Oa,ya as Va,z as qa,za as xa}from"./chunks/chunk-ZD6O2YPD.mjs";import{a as Ga,b as Ja,c as Ka,d as ja,e as za,f as Na,g as Xa,h as Za,i as Qa,j as Ya,k as _a,l as $a,m as as,n as ss,o as os,p as es,q as ts,r as rs,s as ls,t as is,u as ns,v as ps}from"./chunks/chunk-3YORPV22.mjs";import"./chunks/chunk-7G3P7Z7K.mjs";import{c as gs}from"./chunks/chunk-5SGL6QL4.mjs";import"./chunks/chunk-CLXYMJTS.mjs";import{useSettings as us,useFloatingTools as cs,getToolLabel as Cs,getToolDescription as ds,getToolColor as Ss,settingsColors as ms,settingsStyles as Ts,dialColors as ys,dialStyles as fs}from"@buoy-gg/floating-tools-react/web";import{LicenseManager as hs}from"@buoy-gg/license/web";export{S as Activity,ba as AlertCircle,T as AlertTriangle,ss as AppHostProvider,es as AppOverlay,Q as Badge,ka as BarChart3,Aa as BaseEventStore,Ha as Bookmark,f as Bug,la as Button,da as Card,v as Check,b as CheckCircle,D as CheckSquare,k as ChevronDown,H as ChevronLeft,F as ChevronRight,L as ChevronUp,E as Clock,Fa as Cloud,ya as CollapsibleSection,R as Copy,na as CopyButton,wa as DataViewer,I as Database,rs as DevToolsVisibilityProvider,Qa as DialMenu,oa as DiffViewer,Xa as Divider,La as Download,Ea as Edit3,Da as EmptyState,Pa as EventStepperFooter,U as Eye,W as EyeOff,O as FileJson,V as FileText,q as Filter,x as FlaskConical,ps as FloatingDevTools,Na as FloatingTools,Ia as GitBranch,G as Globe,Wa as HardDrive,J as Hash,Va as HelpCircle,xa as Home,o as Image,a as Info,aa as InfoRow,C as JsModal,j as Key,N as Layers,hs as LicenseManager,t as Link,Z as Lock,l as Maximize2,n as Minus,g as Palette,Y as Pause,c as Pin,$ as Play,sa as Plus,ea as Power,ga as PowerToggle,ra as RefreshCw,Ma as RelativeTime,d as Route,ca as Row,ia as Search,Ba as SearchBar,ma as SectionHeader,m as Server,pa as Settings,Ya as SettingsModal,ua as Shield,y as Smartphone,h as Square,_ as StatusDot,ha as TabSelector,B as Timer,Ca as Trash2,P as Unlock,w as Upload,Sa as User,Za as UserStatus,A as Users,Ta as Wifi,fa as X,M as XCircle,va as Zap,ns as appSyncAdapter,Ja as autoDiscoverWebPresets,Ka as autoDiscoverWithCustom,gs as clearReleaseOptIn,u as copyToClipboard,ts as createWebTool,is as createWebTools,Ga as defaultToolPresets,i as devToolsStorageKeys,ys as dialColors,fs as dialStyles,Ra as formatBytes,Ua as formatDuration,Oa as formatNumber,za as getEnabledTools,Ss as getToolColor,ds as getToolDescription,Cs as getToolLabel,ja as getToolsBySlot,as as isBuoyHoldingBackButton,z as methodColor,r as persistentStorage,s as safeStringify,ms as settingsColors,Ts as settingsStyles,K as statusColor,ta as toolTheme,qa as truncateMiddle,X as typeColor,os as useAppHost,ls as useDevToolsVisibility,cs as useFloatingTools,e as usePersistedState,p as useSafeAreaInsets,us as useSettings,$a as useToolHeader,_a as useToolHost};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import"./chunks/chunk-CLXYMJTS.mjs";var l={},o=false;export{l as installedTools,o as installedToolsFound};
|
package/lib/web/register.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as L}from"./chunks/chunk-
|
|
1
|
+
"use client";import{a as L}from"./chunks/chunk-FROELTJH.mjs";import{a as b}from"./chunks/chunk-5SGL6QL4.mjs";import{d as w}from"./chunks/chunk-CLXYMJTS.mjs";import*as y from"react-devtools-core";function R(){if(typeof window>"u")return;let h=window;if(h.__BUOY_EARLY_NETWORK__)return;let l=Date.now,u=true,c=[],d=o=>{if(c.push(o),c.length>100){let n=c.shift();n?.kind==="fetch"&&n.settled.then(_=>_.clone?.body?.cancel()).catch(()=>{})}},s=typeof window.fetch=="function"?window.fetch:void 0;if(s&&(window.fetch=function(o,n){if(!u)return s.call(window,o,n);let _;try{o instanceof Request&&o.body&&!o.bodyUsed&&n?.body===void 0&&(_=o.clone())}catch{}let f=l(),a=s.call(window,o,n),t=a.then(e=>{let r=l(),i=/event-stream|ndjson/.test(e.headers.get("content-type")??""),p;try{i||(p=e.clone())}catch{}return{response:e,clone:p,headersAt:r}},e=>({error:e,headersAt:l()}));return d({kind:"fetch",input:o,init:n,requestCopy:_,start:f,settled:t}),a}),typeof XMLHttpRequest<"u"){let o=XMLHttpRequest.prototype,{open:n,send:_,setRequestHeader:f}=o,a=new WeakMap;o.open=function(t,e,...r){return u&&a.set(this,{method:t,url:String(e),headers:{}}),n.call(this,t,e,...r)},o.setRequestHeader=function(t,e){let r=a.get(this);return r&&(r.headers[t]=e),f.call(this,t,e)},o.send=function(t){let e=a.get(this);if(u&&e){a.delete(this);let r=l(),i=this;i.addEventListener("readystatechange",()=>{i.readyState===2&&i._buoyTtfb===void 0&&(i._buoyTtfb=l()-r),i.readyState===4&&(i._buoyEarlyEnd=l())}),d({kind:"xhr",xhr:i,method:e.method,url:e.url,headers:e.headers,body:t,start:r})}return _.call(this,t)}}h.__BUOY_EARLY_NETWORK__={version:1,records:c,adopt(){return u=false,c.splice(0)}}}import{installCapacitorBridge as A}from"@buoy-gg/license/web/capacitor";var E=["onScheduleFiberRoot","onCommitFiberRoot","onPostCommitFiberRoot","onCommitFiberUnmount","setStrictMode"];function m(h={}){if(typeof window>"u"||typeof document>"u")return false;let l=window.Capacitor,u=(()=>{try{return l?.isNativePlatform?.()===true}catch{return false}})(),c=u?l?.DEBUG===true:typeof w<"u"?w:process.env.NODE_ENV!=="production";if(!c&&!h.enableInRelease&&!b())return false;R(),u&&A({release:!c});let d=window,s=d.__REACT_DEVTOOLS_GLOBAL_HOOK__,o=s&&s.supportsFiber&&!s.getFiberRoots&&!s.sub&&Object.getOwnPropertyDescriptor(d,"__REACT_DEVTOOLS_GLOBAL_HOOK__")?.configurable;if(o&&delete d.__REACT_DEVTOOLS_GLOBAL_HOOK__,!d.__REACT_DEVTOOLS_GLOBAL_HOOK__&&((y.initialize??y.default?.initialize)({appendComponentStack:false,breakOnConsoleErrors:false,showInlineWarningsAndErrors:false,hideConsoleLogsInStrictMode:false}),o)){let n=d.__REACT_DEVTOOLS_GLOBAL_HOOK__,_=n.inject,f=new Map;n.inject=t=>{let e=_(t);return f.set(e,s.inject(t)),e};for(let t of E){let e=n[t];typeof e=="function"&&(n[t]=(r,...i)=>(f.has(r)&&s[t]?.(f.get(r),...i),e(r,...i)))}let a=new Map;if(s.renderers?.forEach?.((t,e)=>a.set(e,_(t))),a.size)for(let t of E){let e=s[t];s[t]=function(r,...i){let p=e?.call(this,r,...i),O=a.get(r);return O!==void 0&&n[t]?.(O,...i),p}}}return!!d.__REACT_DEVTOOLS_GLOBAL_HOOK__}m();export{L as earlyHookScript,m as registerBrowserDevTools};
|
package/lib/web/toolkit.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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 h,Fa as p,G as S,Ga as m,H as u,Ha as d,I as f,Ia as y,J as g,Ja as v,K as k,Ka as B,L as w,La as T,M as D,Ma as P,N as b,Na as E,O as F,Oa as H,P as R,Pa as A,Q as I,R as L,S as M,T as U,U as x,V as q,W as G,X as J,Y as K,Z as z,_ as N,a as O,aa as V,b as X,ba as j,c as W,ca as Z,d as Q,da as Y,e as _,ea as $,f as aa,fa as sa,g as ea,ga as oa,h as ta,ha as ra,i as ia,ia as la,j as na,ja as Ca,k as ca,ka as ha,l as pa,la as Sa,m as ma,ma as ua,n as da,na as fa,o as ya,oa as ga,p as va,pa as ka,q as Ba,qa as wa,r as Ta,ra as Da,s as Pa,sa as ba,t as Ea,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-ZD6O2YPD.mjs";import"./chunks/chunk-7G3P7Z7K.mjs";import"./chunks/chunk-CLXYMJTS.mjs";export{u as Activity,wa as AlertCircle,f as AlertTriangle,Q as Badge,Da as BarChart3,Ha as BaseEventStore,ba as Bookmark,g as Bug,ia as Button,ma as Card,k as Check,w as CheckCircle,B as CheckSquare,D as ChevronDown,b as ChevronLeft,F as ChevronRight,R as ChevronUp,I as Clock,Fa as Cloud,ya as CollapsibleSection,L as Copy,na as CopyButton,Ea as DataViewer,M as Database,ea as DiffViewer,Ra as Download,Ia as Edit3,Ba as EmptyState,Pa as EventStepperFooter,U as Eye,x as EyeOff,q as FileJson,G as FileText,J as Filter,K as FlaskConical,Ma as GitBranch,z as Globe,xa as HardDrive,N as Hash,Ga as HelpCircle,Ka as Home,e as Image,a as Info,aa as InfoRow,S as JsModal,V as Key,j as Layers,t as Link,Z as Lock,i as Maximize2,n as Minus,c as Palette,Y as Pause,p as Pin,$ as Play,sa as Plus,oa as Power,ca as PowerToggle,ra as RefreshCw,Aa as RelativeTime,m as Route,pa as Row,la as Search,Ta as SearchBar,da as SectionHeader,d as Server,Ca as Settings,ha as Shield,y as Smartphone,v as Square,_ as StatusDot,va as TabSelector,T as Timer,Sa as Trash2,P as Unlock,E as Upload,ua as User,H as Users,fa as Wifi,ga as X,A as XCircle,ka as Zap,h as copyToClipboard,l as devToolsStorageKeys,La as formatBytes,Ua as formatDuration,qa as formatNumber,X as methodColor,r as persistentStorage,s as safeStringify,O as statusColor,ta as toolTheme,Ja as truncateMiddle,W as typeColor,o as usePersistedState,C 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.63",
|
|
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",
|
|
@@ -43,6 +43,18 @@
|
|
|
43
43
|
"types": "./lib/typescript/module/browserRegister.d.ts",
|
|
44
44
|
"browser": "./lib/web/register.mjs",
|
|
45
45
|
"default": "./lib/web/register-server.mjs"
|
|
46
|
+
},
|
|
47
|
+
"./web/auto": {
|
|
48
|
+
"types": "./lib/typescript/module/auto.web.d.ts",
|
|
49
|
+
"default": "./lib/web/auto.mjs"
|
|
50
|
+
},
|
|
51
|
+
"./web/installed-tools": {
|
|
52
|
+
"types": "./lib/typescript/module/installedTools.d.ts",
|
|
53
|
+
"default": "./lib/web/installed-tools.mjs"
|
|
54
|
+
},
|
|
55
|
+
"./vite": {
|
|
56
|
+
"types": "./bundlers/vite.d.ts",
|
|
57
|
+
"default": "./bundlers/vite.mjs"
|
|
46
58
|
}
|
|
47
59
|
},
|
|
48
60
|
"typesVersions": {
|
|
@@ -54,17 +66,18 @@
|
|
|
54
66
|
},
|
|
55
67
|
"files": [
|
|
56
68
|
"bin",
|
|
57
|
-
"lib"
|
|
69
|
+
"lib",
|
|
70
|
+
"bundlers"
|
|
58
71
|
],
|
|
59
72
|
"sideEffects": [
|
|
60
73
|
"./lib/web/register.mjs"
|
|
61
74
|
],
|
|
62
75
|
"dependencies": {
|
|
63
76
|
"react-devtools-core": "6.1.5",
|
|
64
|
-
"@buoy-gg/floating-tools-
|
|
65
|
-
"@buoy-gg/
|
|
66
|
-
"@buoy-gg/
|
|
67
|
-
"@buoy-gg/
|
|
77
|
+
"@buoy-gg/floating-tools-core": "^7.0.63",
|
|
78
|
+
"@buoy-gg/shared-ui": "^7.0.63",
|
|
79
|
+
"@buoy-gg/floating-tools-react": "^7.0.63",
|
|
80
|
+
"@buoy-gg/license": "^7.0.63"
|
|
68
81
|
},
|
|
69
82
|
"peerDependencies": {
|
|
70
83
|
"react": "*"
|
|
@@ -1 +0,0 @@
|
|
|
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};
|