@buoy-gg/core 7.0.72 → 7.0.74

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.CAPACITOR_APP_NAME_KEY=void 0;exports.capacitorBrokerURL=capacitorBrokerURL;exports.capacitorTransportProblem=capacitorTransportProblem;exports.hardwareFromUserAgent=hardwareFromUserAgent;exports.initialHostInfo=initialHostInfo;exports.isAndroidEmulatorUserAgent=isAndroidEmulatorUserAgent;exports.isBundledPage=isBundledPage;exports.persistedAppName=persistedAppName;exports.useHostInfo=useHostInfo;var _react=require("react");var _license=require("@buoy-gg/license");function hardwareFromUserAgent(e,t){if(t==="ios"){if(/iPad/.test(e))return"iPad";if(/iPhone/.test(e))return"iPhone";return null}const r=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(e);const n=r?.[1]?.trim();if(!n||n==="K")return null;return n}function isAndroidEmulatorUserAgent(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}function userAgent(){return typeof navigator==="undefined"?"":navigator.userAgent??""}function firstPageTitle(){if(typeof document==="undefined")return null;return document.title||(typeof location==="undefined"?null:location.hostname)||null}const CAPACITOR_APP_NAME_KEY=exports.CAPACITOR_APP_NAME_KEY="@react_buoy_capacitor_app_name";function persistedAppName(e){try{const t=globalThis.localStorage;if(!t)return e;const r=t.getItem(CAPACITOR_APP_NAME_KEY);if(r)return r;if(e)t.setItem(CAPACITOR_APP_NAME_KEY,e)}catch{}return e}function initialHostInfo(){const e=(0,_license.capacitorPlatform)();if(!e){return{platform:"web",appName:firstPageTitle(),hardwareName:"Browser",ready:true}}const t=Boolean((0,_license.capacitorPlugin)("App"));return{platform:e,appName:t?firstPageTitle():persistedAppName(firstPageTitle()),hardwareName:hardwareFromUserAgent(userAgent(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!(0,_license.capacitorPlugin)("Device")}}function useHostInfo(){const[e,t]=(0,_react.useState)(initialHostInfo);(0,_react.useEffect)(()=>{if(!(0,_license.isCapacitorNative)())return;let r=false;const n=(0,_license.capacitorPlugin)("App");const o=(0,_license.capacitorPlugin)("Device");void Promise.all([n?.getInfo?.().catch(()=>null)??null,o?.getInfo?.().catch(()=>null)??null]).then(([a,s])=>{if(r)return;const c=a?.name?.trim();const u=s?.name?.trim()||s?.model?.trim();t(i=>({...i,appName:c||i.appName,hardwareName:u||i.hardwareName,ready:true}))});return()=>{r=true}},[]);return e}function pageInfo(){if(typeof location==="undefined")return null;const e=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:userAgent(),serverUrl:typeof e==="string"?e:null}}function schemeHost(e){if(!e)return null;try{const t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}function isBundledPage(e,t){if(e==="ios"){const r=schemeHost(t.serverUrl);return r?r===schemeHost(t.origin):t.protocol==="capacitor:"}return LOOPBACK.has(t.hostname)}const LOOPBACK=new Set(["localhost","127.0.0.1","[::1]","::1"]);function capacitorBrokerURL(e,t,r,n=pageInfo()){if(r==="web"||!n)return e;let o;try{o=new URL(e)}catch{return e}const a=isBundledPage(r,n);if(!t&&a&&o.hostname===n.hostname)o.hostname="localhost";if(r==="android"&&LOOPBACK.has(o.hostname)&&isAndroidEmulatorUserAgent(n.userAgent)){o.hostname="10.0.2.2"}return o.toString().replace(/\/$/,"")}function capacitorTransportProblem(e,t,r=pageInfo()){if(t!=="android"||!r||r.protocol!=="https:")return null;if(!/^(http|ws):/i.test(e))return null;return`[Buoy] Can't reach Buoy Desktop at ${e}. This Android WebView serves the app from https://${r.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.`}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.CAPACITOR_APP_NAME_KEY=void 0;exports.capacitorBrokerURL=capacitorBrokerURL;exports.capacitorTransportProblem=capacitorTransportProblem;exports.hardwareFromUserAgent=hardwareFromUserAgent;exports.initialHostInfo=initialHostInfo;exports.isAndroidEmulatorUserAgent=isAndroidEmulatorUserAgent;exports.isBundledPage=isBundledPage;exports.persistedAppName=persistedAppName;exports.useHostInfo=useHostInfo;var _react=require("react");var _license=require("@buoy-gg/license");function hardwareFromUserAgent(e,t){if(t==="ios"){if(/iPad/.test(e))return"iPad";if(/iPhone/.test(e))return"iPhone";return null}const r=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(e);const n=r?.[1]?.trim();if(!n||n==="K")return null;return n}function isAndroidEmulatorUserAgent(e){return/sdk_gphone|Android SDK built for|Android ATD built for|google_sdk|Emulator|generic_/i.test(e)}function userAgent(){return typeof navigator==="undefined"?"":navigator.userAgent??""}function firstPageTitle(){if(typeof document==="undefined")return null;return document.title||(typeof location==="undefined"?null:location.hostname)||null}const CAPACITOR_APP_NAME_KEY=exports.CAPACITOR_APP_NAME_KEY="@react_buoy_capacitor_app_name";function persistedAppName(e){try{const t=globalThis.localStorage;if(!t)return e;const r=t.getItem(CAPACITOR_APP_NAME_KEY);if(r)return r;if(e)t.setItem(CAPACITOR_APP_NAME_KEY,e)}catch{}return e}function initialHostInfo(){const e=(0,_license.capacitorPlatform)();if(!e){return{platform:"web",appName:firstPageTitle(),hardwareName:"Browser",ready:true}}const t=Boolean((0,_license.capacitorPlugin)("App"));return{platform:e,appName:t?firstPageTitle():persistedAppName(firstPageTitle()),hardwareName:hardwareFromUserAgent(userAgent(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!(0,_license.capacitorPlugin)("Device")}}function useHostInfo(){const[e,t]=(0,_react.useState)(initialHostInfo);(0,_react.useEffect)(()=>{if(!(0,_license.isCapacitorNative)())return;let r=false;const n=(0,_license.capacitorPlugin)("App");const o=(0,_license.capacitorPlugin)("Device");void Promise.all([n?.getInfo?.().catch(()=>null)??null,o?.getInfo?.().catch(()=>null)??null]).then(([a,s])=>{if(r)return;const c=a?.name?.trim();const u=s?.name?.trim()||s?.model?.trim();t(i=>({...i,appName:c||i.appName,hardwareName:u||i.hardwareName,ready:true}))});return()=>{r=true}},[]);return e}function pageInfo(){if(typeof location==="undefined")return null;const e=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:userAgent(),serverUrl:typeof e==="string"?e:null}}function schemeHost(e){if(!e)return null;try{const t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}function isBundledPage(e,t){if(e==="ios"){const r=schemeHost(t.serverUrl);return r?r===schemeHost(t.origin):t.protocol==="capacitor:"}return LOOPBACK.has(t.hostname)}const LOOPBACK=new Set(["localhost","127.0.0.1","[::1]","::1"]);function capacitorBrokerURL(e,t,r,n=pageInfo()){if(r==="web"||!n)return e;let o;try{o=new URL(e)}catch{return e}const a=isBundledPage(r,n);if(!t&&a&&o.hostname===n.hostname)o.hostname="localhost";if(r==="android"&&LOOPBACK.has(o.hostname)&&isAndroidEmulatorUserAgent(n.userAgent)){o.hostname="10.0.2.2"}return o.toString().replace(/\/$/,"")}function capacitorTransportProblem(e,t,r=pageInfo()){if(t!=="android"||!r||r.protocol!=="https:")return null;if(!/^(http|ws):/i.test(e))return null;return`[Buoy] Can't reach Buoy Desktop at ${e}. This Android WebView serves the app from https://${r.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.`}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.72";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.74";
@@ -1 +1 @@
1
- "use strict";import{useEffect as g,useState as A}from"react";import{capacitorPlatform as y,capacitorPlugin as a,isCapacitorNative as w}from"@buoy-gg/license";export function hardwareFromUserAgent(t,e){if(e==="ios"){if(/iPad/.test(t))return"iPad";if(/iPhone/.test(t))return"iPhone";return null}const n=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(t);const r=n?.[1]?.trim();if(!r||r==="K")return null;return r}export function isAndroidEmulatorUserAgent(t){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(t)}function l(){return typeof navigator==="undefined"?"":navigator.userAgent??""}function c(){if(typeof document==="undefined")return null;return document.title||(typeof location==="undefined"?null:location.hostname)||null}export const CAPACITOR_APP_NAME_KEY="@react_buoy_capacitor_app_name";export function persistedAppName(t){try{const e=globalThis.localStorage;if(!e)return t;const n=e.getItem(CAPACITOR_APP_NAME_KEY);if(n)return n;if(t)e.setItem(CAPACITOR_APP_NAME_KEY,t)}catch{}return t}export function initialHostInfo(){const t=y();if(!t){return{platform:"web",appName:c(),hardwareName:"Browser",ready:true}}const e=Boolean(a("App"));return{platform:t,appName:e?c():persistedAppName(c()),hardwareName:hardwareFromUserAgent(l(),t)??t,extraDeviceInfo:{runtime:"capacitor"},ready:!e&&!a("Device")}}export function useHostInfo(){const[t,e]=A(initialHostInfo);g(()=>{if(!w())return;let n=false;const r=a("App");const o=a("Device");void Promise.all([r?.getInfo?.().catch(()=>null)??null,o?.getInfo?.().catch(()=>null)??null]).then(([i,u])=>{if(n)return;const m=i?.name?.trim();const h=u?.name?.trim()||u?.model?.trim();e(s=>({...s,appName:m||s.appName,hardwareName:h||s.hardwareName,ready:true}))});return()=>{n=true}},[]);return t}function d(){if(typeof location==="undefined")return null;const t=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:l(),serverUrl:typeof t==="string"?t:null}}function f(t){if(!t)return null;try{const e=new URL(t);return`${e.protocol}//${e.host}`}catch{return null}}export function isBundledPage(t,e){if(t==="ios"){const n=f(e.serverUrl);return n?n===f(e.origin):e.protocol==="capacitor:"}return p.has(e.hostname)}const p=new Set(["localhost","127.0.0.1","[::1]","::1"]);export function capacitorBrokerURL(t,e,n,r=d()){if(n==="web"||!r)return t;let o;try{o=new URL(t)}catch{return t}const i=isBundledPage(n,r);if(!e&&i&&o.hostname===r.hostname)o.hostname="localhost";if(n==="android"&&p.has(o.hostname)&&isAndroidEmulatorUserAgent(r.userAgent)){o.hostname="10.0.2.2"}return o.toString().replace(/\/$/,"")}export function capacitorTransportProblem(t,e,n=d()){if(e!=="android"||!n||n.protocol!=="https:")return null;if(!/^(http|ws):/i.test(t))return null;return`[Buoy] Can't reach Buoy Desktop at ${t}. 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.`}
1
+ "use strict";import{useEffect as g,useState as A}from"react";import{capacitorPlatform as y,capacitorPlugin as a,isCapacitorNative as b}from"@buoy-gg/license";export function hardwareFromUserAgent(t,e){if(e==="ios"){if(/iPad/.test(t))return"iPad";if(/iPhone/.test(t))return"iPhone";return null}const n=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(t);const r=n?.[1]?.trim();if(!r||r==="K")return null;return r}export function isAndroidEmulatorUserAgent(t){return/sdk_gphone|Android SDK built for|Android ATD built for|google_sdk|Emulator|generic_/i.test(t)}function l(){return typeof navigator==="undefined"?"":navigator.userAgent??""}function c(){if(typeof document==="undefined")return null;return document.title||(typeof location==="undefined"?null:location.hostname)||null}export const CAPACITOR_APP_NAME_KEY="@react_buoy_capacitor_app_name";export function persistedAppName(t){try{const e=globalThis.localStorage;if(!e)return t;const n=e.getItem(CAPACITOR_APP_NAME_KEY);if(n)return n;if(t)e.setItem(CAPACITOR_APP_NAME_KEY,t)}catch{}return t}export function initialHostInfo(){const t=y();if(!t){return{platform:"web",appName:c(),hardwareName:"Browser",ready:true}}const e=Boolean(a("App"));return{platform:t,appName:e?c():persistedAppName(c()),hardwareName:hardwareFromUserAgent(l(),t)??t,extraDeviceInfo:{runtime:"capacitor"},ready:!e&&!a("Device")}}export function useHostInfo(){const[t,e]=A(initialHostInfo);g(()=>{if(!b())return;let n=false;const r=a("App");const o=a("Device");void Promise.all([r?.getInfo?.().catch(()=>null)??null,o?.getInfo?.().catch(()=>null)??null]).then(([i,u])=>{if(n)return;const m=i?.name?.trim();const h=u?.name?.trim()||u?.model?.trim();e(s=>({...s,appName:m||s.appName,hardwareName:h||s.hardwareName,ready:true}))});return()=>{n=true}},[]);return t}function d(){if(typeof location==="undefined")return null;const t=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:l(),serverUrl:typeof t==="string"?t:null}}function f(t){if(!t)return null;try{const e=new URL(t);return`${e.protocol}//${e.host}`}catch{return null}}export function isBundledPage(t,e){if(t==="ios"){const n=f(e.serverUrl);return n?n===f(e.origin):e.protocol==="capacitor:"}return p.has(e.hostname)}const p=new Set(["localhost","127.0.0.1","[::1]","::1"]);export function capacitorBrokerURL(t,e,n,r=d()){if(n==="web"||!r)return t;let o;try{o=new URL(t)}catch{return t}const i=isBundledPage(n,r);if(!e&&i&&o.hostname===r.hostname)o.hostname="localhost";if(n==="android"&&p.has(o.hostname)&&isAndroidEmulatorUserAgent(r.userAgent)){o.hostname="10.0.2.2"}return o.toString().replace(/\/$/,"")}export function capacitorTransportProblem(t,e,n=d()){if(e!=="android"||!n||n.protocol!=="https:")return null;if(!/^(http|ws):/i.test(t))return null;return`[Buoy] Can't reach Buoy Desktop at ${t}. 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.`}
@@ -1 +1 @@
1
- "use strict";export const SDK_VERSION="7.0.72";
1
+ "use strict";export const SDK_VERSION="7.0.74";
@@ -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.72";
12
+ export declare const SDK_VERSION = "7.0.74";
13
13
  //# sourceMappingURL=version.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.72";
12
+ export declare const SDK_VERSION = "7.0.74";
13
13
  //# sourceMappingURL=version.d.ts.map
package/lib/web/auto.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{a as t,e as u}from"./chunks/chunk-LOPXJLVB.mjs";import{createElement as n,lazy as c,Suspense as p,useEffect as d,useState as y}from"react";function a(){if(typeof window>"u")return false;let o=window.Capacitor,e=false;try{e=o?.isNativePlatform?.()===true}catch{e=false}return e?o?.DEBUG===true:typeof u<"u"?!!u:process.env.NODE_ENV!=="production"}t(a,"shouldShowBuoy");var s;function l(){return s??(s=c(()=>import("./chunks/FloatingDevTools.web-MBL65LZS.mjs").then(o=>({default:o.FloatingDevTools})))),s}t(l,"loadHost");function r({enabled:o,...e}){let[i,f]=y(false);return d(()=>{f(o??a())},[o]),i?n(p,{fallback:null},n(l(),e)):null}t(r,"BuoyDevTools");export{r as BuoyDevTools,a as shouldShowBuoy};
1
+ "use client";import{a as t,e as u}from"./chunks/chunk-LOPXJLVB.mjs";import{createElement as n,lazy as c,Suspense as p,useEffect as d,useState as y}from"react";function a(){if(typeof window>"u")return false;let o=window.Capacitor,e=false;try{e=o?.isNativePlatform?.()===true}catch{e=false}return e?o?.DEBUG===true:typeof u<"u"?!!u:process.env.NODE_ENV!=="production"}t(a,"shouldShowBuoy");var s;function l(){return s??(s=c(()=>import("./chunks/FloatingDevTools.web-FENSHQGD.mjs").then(o=>({default:o.FloatingDevTools})))),s}t(l,"loadHost");function r({enabled:o,...e}){let[i,f]=y(false);return d(()=>{f(o??a())},[o]),i?n(p,{fallback:null},n(l(),e)):null}t(r,"BuoyDevTools");export{r as BuoyDevTools,a as shouldShowBuoy};
@@ -1 +1 @@
1
- "use client";import{v as o}from"./chunk-XA3PD6QG.mjs";import"./chunk-Z6I7ZD34.mjs";import"./chunk-D2FYORGY.mjs";import"./chunk-LOPXJLVB.mjs";export{o as FloatingDevTools};
1
+ "use client";import{v as o}from"./chunk-LU4GPZ5L.mjs";import"./chunk-Z6I7ZD34.mjs";import"./chunk-D2FYORGY.mjs";import"./chunk-LOPXJLVB.mjs";export{o as FloatingDevTools};
@@ -7,4 +7,4 @@
7
7
  0%, 100% { transform: translateY(0); }
8
8
  50% { transform: translateY(-8px); }
9
9
  }
10
- `,document.head.appendChild(e),Jo=true}r(Yo,"injectOnboardingKeyframes");var Pt=Ke.accent;function Lt({title:e,message:t,onDismiss:o,showArrow:i=true}){let[n,a]=Ko(false),[s,u]=Ko(false);Zr(()=>{Yo();let p=requestAnimationFrame(()=>a(true));return()=>cancelAnimationFrame(p)},[]);let d={fontFamily:qo,textTransform:"uppercase"};return Ve("div",{style:{position:"fixed",left:"50%",bottom:ta(),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:Go("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ve("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),Go("div",{style:{position:"relative",maxWidth:280,backgroundColor:Ke.dialBackground,borderRadius:16,border:`1px solid ${Ke.dialBorder}`,padding:20,boxShadow:`0 0 20px ${Vo(Ke.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ve("span",{style:{...d,fontSize:16,fontWeight:900,letterSpacing:1,color:Pt,textAlign:"center"},children:e}),Ve("span",{style:{fontFamily:qo,fontSize:13,lineHeight:"20px",color:Ke.centerText,textAlign:"center"},children:t}),Ve("button",{onClick:o,onPointerDown:()=>u(true),onPointerUp:()=>u(false),onPointerLeave:()=>u(false),onPointerCancel:()=>u(false),style:{...d,marginTop:8,borderRadius:8,border:"none",backgroundColor:Pt,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:s?.7:1,transform:s?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),i&&Ve("div",{style:{position:"absolute",left:"50%",bottom:Qr,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${ea}px solid ${Pt}`,filter:`drop-shadow(0 0 10px ${Vo(Ke.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}r(Lt,"OnboardingTooltip");import{Fragment as oa,jsx as P,jsxs as ve}from"react/jsx-runtime";var na={x:.5,y:.5},Xo="@react_buoy_settings_tooltip_shown",Zo=false;function Qo(){if(Zo||typeof document>"u")return;let e=document.createElement("style");e.textContent=Pr(),document.head.appendChild(e),Zo=true}r(Qo,"injectKeyframes");var qe=r(e=>1-Math.pow(1-e,3),"easeOutCubic"),Ft=r(e=>e*e*e,"easeInCubic");function en({icon:e,index:t,totalIcons:o,position:i,progress:n,onPress:a}){let[s,u]=Q(false),[d,p]=Q(false),g=!e.icon&&e.id.startsWith("empty-"),I=!g&&e.unavailable===true,f=!g&&!I,{icons:z}=Eo,T=Er(t,o),M=0;n<=T[1]?M=0:n<=T[2]?M=(n-T[1])/(T[2]-T[1]):M=1,M=Math.max(0,Math.min(1,M));let D=Or,E=z.pressIn.scale,R=M*(d?E:s?1.1:1),k=0;M<=0?k=0:M<=.3?k=M:k=.3+(M-.3)*(.7/.7);let w=i.x*M,C=i.y*M;return P("button",{role:"menuitem","aria-label":g?"Empty slot":Mo(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!f,tabIndex:f?0:-1,onClick:f?a:void 0,onPointerEnter:F=>f&&F.pointerType==="mouse"&&u(true),onPointerLeave:()=>{u(false),p(false)},onPointerDown:()=>f&&p(true),onPointerUp:()=>p(false),onPointerCancel:()=>p(false),style:{position:"absolute",left:"50%",top:"50%",width:D,height:D,marginLeft:-D/2,marginTop:-D/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:f?"pointer":"default",transform:`translate(${w}px, ${C}px) scale(${R})`,opacity:k,transition:s||d?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:g?P("div",{style:{width:x.emptySlot.dotSize,height:x.emptySlot.dotSize,borderRadius:x.emptySlot.dotSize/2,backgroundColor:$.emptyDotBackground,border:`${x.emptySlot.borderWidth}px solid ${$.emptyDotBorder}`}}):ve(oa,{children:[P("div",{style:{position:"absolute",width:`${x.icon.gradientBgSizePercent}%`,height:`${x.icon.gradientBgSizePercent}%`,borderRadius:x.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:x.icon.gradientBgOpacity}}),P("div",{style:{position:"absolute",width:`${x.icon.innerGlowSizePercent}%`,height:`${x.icon.innerGlowSizePercent}%`,borderRadius:x.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:x.icon.innerGlowOpacity}}),P("div",{style:{marginBottom:x.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:s?"brightness(1.2)":"none"},children:e.icon}),P("span",{style:{fontSize:e.name.length>8?Math.max(x.icon.label.fontSize*.7,x.icon.label.fontSize*8/e.name.length):x.icon.label.fontSize,fontWeight:x.icon.label.fontWeight,fontFamily:x.icon.label.fontFamily,color:$.iconLabel,letterSpacing:x.icon.label.letterSpacing,marginTop:x.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),I&&P("span",{style:{fontSize:x.icon.label.fontSize-1,fontWeight:x.icon.label.fontWeight,fontFamily:x.icon.label.fontFamily,letterSpacing:x.icon.label.letterSpacing,color:Fr.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}r(en,"DialIconItem");function $t({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,i,n,a],s)=>P("line",{x1:o,y1:i,x2:n,y2:a,stroke:t,strokeWidth:2},s))})}r($t,"PagerChevron");function jt({side:e,disabled:t,onClick:o}){let[i,n]=Q(false),a=t?$.emptyDotBorder:$.accent;return ve("button",{type:"button","aria-label":`${e==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${e}`,disabled:t,onClick:o,onPointerDown:()=>!t&&n(true),onPointerUp:()=>n(false),onPointerLeave:()=>n(false),onPointerCancel:()=>n(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${$.dialBorder}`,backgroundColor:$.dialBackground,color:t?$.iconLabelMuted:$.centerText,fontSize:12,fontWeight:900,fontFamily:Lo,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${Oo($.dialShadow,.4)}`,transform:i?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&P($t,{side:"prev",color:a}),e==="prev"?"PREV":"NEXT",e==="next"&&P($t,{side:"next",color:a})]})}r(jt,"PagerButton");function Ht({icons:e,onClose:t,centerLabel:o="MENU",onCenterPress:i,settingsOpen:n=false,hintsDisabled:a=false}){let{id:s}=jr(),[u,d]=Q(0),[p,g]=Q(0),[I,f]=Q(0),[z,T]=Q(0),[M,D]=Q(0),[E,R]=Q(1),[k,w]=Q(false),[C,F]=Q(false),[A,B]=Q(false),ee=ft(null),_=ft(null),G=ft(null),te=ft(false),{entrance:V,exit:ae,interaction:oe}=Eo,me=Lr(),[ge,fe]=Q(()=>({width:window.innerWidth,height:window.innerHeight}));Ee(()=>{let y=r(()=>fe({width:window.innerWidth,height:window.innerHeight}),"resize");return window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);let N=gt(()=>Dr({screenWidth:ge.width,maxCircleSize:Math.max(120,Math.min(320,ge.height-96))}),[ge]),Ce=gt(()=>Mr(),[]),ke=gt(()=>Rr(Xe,N.iconRadius),[N.iconRadius]),[Fe,$e]=Q(0),se=Math.max(1,Math.ceil(e.length/Xe)),Y=Math.min(Fe,se-1),le=gt(()=>{let y=Y*Xe,h=[...e.slice(y,y+Xe)];for(;h.length<Xe;)h.push({id:`empty-${h.length}`,name:"",icon:null,onPress:r(()=>{},"onPress")});return h},[e,Y]);Ee(()=>{Qo()},[]),Ee(()=>{let y=V.backdrop.duration,h=V.dial.rotation.duration,J=V.centerButton.delay,W=V.icons.delay,U=V.icons.duration,q=performance.now(),ie=r(he=>{let c=he-q;d(Math.min(1,c/y));let b=Math.min(1,c/400),O=qe(b)*1.1;b>.7&&(O-=(b-.7)*.33),b>=1&&(O=1),g(Math.max(0,Math.min(1.05,O)));let X=Math.min(1,c/h);if(f(qe(X)*360),c>=J){let xe=Math.min(1,(c-J)/300),Ne=qe(xe)*1.15;xe>.6&&(Ne-=(xe-.6)*.375),xe>=1&&(Ne=1),T(Math.max(0,Math.min(1.05,Ne)))}if(c>=W){let xe=Math.min(1,(c-W)/U);D(qe(xe))}let we=W+U;c<we?G.current=requestAnimationFrame(ie):(d(1),g(1),f(360),T(1),D(1),B(true))},"animate");return G.current=requestAnimationFrame(ie),()=>{G.current&&cancelAnimationFrame(G.current)}},[]);let pe=ht(()=>{if(te.current)return;te.current=true,F(true),G.current&&cancelAnimationFrame(G.current);let y=performance.now(),h=ae.icons.duration,J=ae.centerButton.duration,W=ae.dialScale.duration,U=Math.max(J,W),q=ae.backdrop.duration,ie=r(he=>{let c=he-y;if(c<h){let X=Ft(c/h);D(1-X),G.current=requestAnimationFrame(ie);return}let b=h;if(c<b+U){D(0);let X=Math.min(1,(c-b)/J),we=Math.min(1,(c-b)/W);T(1-Ft(X)),g(1-Ft(we)),G.current=requestAnimationFrame(ie);return}let O=b+U;if(c<O+q){g(0),T(0);let X=(c-O)/q;d(1-X),G.current=requestAnimationFrame(ie);return}d(0),t()},"animate");G.current=requestAnimationFrame(ie)},[ae,t]);Ee(()=>{let y=document.activeElement,h=ee.current;return()=>{y?.isConnected&&(document.activeElement===document.body||h?.contains(document.activeElement))&&y.focus()}},[]),Ee(()=>{if(n)return;_.current?.focus();let y=r(h=>{let J=ee.current;if(J){if(h.key==="Escape")h.preventDefault(),pe();else if(h.key==="Tab"){let W=Array.from(J.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(ie=>ie.getClientRects().length>0),U=W[0],q=W[W.length-1];(!J.contains(document.activeElement)||(h.shiftKey?document.activeElement===U:document.activeElement===q))&&(h.preventDefault(),(h.shiftKey?q:U)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(h.key)){let W=Array.from(J.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),U=W.indexOf(document.activeElement);if(U<0||!W.length)return;h.preventDefault();let q=h.key==="Home"?0:h.key==="End"?W.length-1:(U+(h.key==="ArrowRight"||h.key==="ArrowDown"?1:-1)+W.length)%W.length;W[q].focus()}}},"handleKeyDown");return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[pe,n]);let[ze,je]=Q(false);Ee(()=>{if(a)return;let y=false,h=setTimeout(async()=>{let J=await Po.getItem(Xo);!y&&!J&&je(true)},1200);return()=>{y=true,clearTimeout(h)}},[a]);let Se=ht(()=>{je(false),Po.setItem(Xo,"true")},[]);Ee(()=>{n&&ze&&Se()},[n,ze,Se]);let Ae=ht(y=>{if(y.id.startsWith("empty-")||te.current)return;let[h,J]=oe.iconSelect.pulse,W=performance.now(),U=150,q=r(ie=>{let he=ie-W;if(he<U){let c=qe(he/U);R(1-(1-h.scale)*c),requestAnimationFrame(q)}else if(he<U*2){let c=qe((he-U)/U);R(h.scale+(J.scale-h.scale)*c),requestAnimationFrame(q)}else R(1)},"animatePulse");requestAnimationFrame(q),setTimeout(()=>{y.onPress(),pe()},oe.iconSelect.actionDelay)},[oe.iconSelect,pe]),Be=ht(y=>{if(te.current)return;let h=Math.max(0,Math.min(y,se-1));h!==Y&&$e(h)},[se,Y]),ne=N.buttonSize*x.centerButton.containerRatio,De=N.buttonSize*x.centerButton.borderRatio,He=N.buttonSize*x.centerButton.containerRatio/2+6,l=A&&!C;return ve("div",{ref:ee,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:$.dialBackdrop,opacity:u}}),ve("div",{style:{position:"absolute",left:"50%",marginLeft:-N.circleSize/2,bottom:80,width:N.circleSize,height:N.circleSize,borderRadius:"50%",backgroundColor:$.dialBackground,border:`${x.circle.borderWidth}px solid ${$.dialBorder}`,boxShadow:`0 0 ${x.circle.shadowRadius}px ${Oo($.dialShadow,x.circle.shadowOpacity)}`,transform:`scale(${p}) rotate(${I}deg)`,opacity:p>.01?1:0,overflow:"hidden"},children:[P("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:$.dialGradient1,opacity:x.gradientLayers[0].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:$.dialGradient2,opacity:x.gradientLayers[1].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:$.dialGradient3,opacity:x.gradientLayers[2].opacity}}),Ce.map(y=>P("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:x.grid.lineHeight,transform:`rotate(${y}deg)`,transformOrigin:"center"},children:["left","right"].map(h=>P("div",{style:{position:"absolute",top:0,[h]:0,width:`calc(50% - ${He}px)`,height:x.grid.lineHeight,backgroundColor:$.dialGridLine}},h))},y)),P("div",{"data-testid":"dial-background","data-background":s,style:{position:"absolute",inset:0,pointerEvents:"none"},children:s==="hyperspace"?P(Xr,{size:N.circleSize}):P($r,{focus:na})}),le.map((y,h)=>P(en,{icon:y,index:h,totalIcons:le.length,position:ke[h],progress:M,onPress:()=>Ae(y)},h)),ve("div",{style:{position:"absolute",left:"50%",top:"50%",width:ne,height:ne,marginLeft:-ne/2,marginTop:-ne/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:$.hubHalo,borderRadius:N.buttonSize,overflow:"hidden",transform:`scale(${z*E})`,opacity:z>.01?1:0},children:[P("div",{style:{position:"absolute",inset:0,backgroundColor:$.dialGradient1,opacity:.5,borderRadius:N.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:$.dialGradient2,opacity:.3,borderRadius:N.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:$.dialGradient3,opacity:.2,borderRadius:N.buttonSize}}),P("div",{style:{width:De,height:De,borderRadius:N.buttonSize*x.centerButton.borderRadiusRatio,backgroundColor:$.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:P("button",{ref:_,type:"button","aria-label":n?"Close Settings":"Open Dev Tools Settings",disabled:!i,onClick:i,onPointerEnter:y=>y.pointerType==="mouse"&&w(true),onPointerLeave:()=>w(false),style:{border:0,padding:0,background:"transparent",width:N.buttonSize,height:N.buttonSize,borderRadius:N.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:i?"pointer":"default",transform:k?`scale(${oe.centerHover.scale})`:"scale(1)",transition:`transform ${oe.centerHover.duration}ms ease`,animation:l&&!k?me.pulse:"none"},children:n?ve("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:x.centerButton.text.fontSize-2,fontWeight:x.centerButton.text.fontWeight,fontFamily:x.centerButton.text.fontFamily,color:$.centerText,letterSpacing:x.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.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:x.centerButton.text.fontSize,fontWeight:x.centerButton.text.fontWeight,fontFamily:x.centerButton.text.fontFamily,color:$.centerText,letterSpacing:x.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase"},children:o})})})]})]}),se>1&&ve("div",{style:{position:"absolute",left:"50%",marginLeft:-N.circleSize/2,top:"calc(100% - 64px)",width:N.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,p),transform:`scale(${Math.min(1,p)})`},children:[P(jt,{side:"prev",disabled:Y<=0,onClick:()=>Be(Y-1)}),ve("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:Lo,letterSpacing:2,color:$.centerText,textShadow:`0 0 6px ${$.centerTextGlow}`},children:[String(Y+1).padStart(2,"0"),ve("span",{style:{color:$.iconLabelMuted,textShadow:"none"},children:[" / ",String(se).padStart(2,"0")]})]}),P(jt,{side:"next",disabled:Y>=se-1,onClick:()=>Be(Y+1)})]}),ze&&!n&&P(Lt,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:Se,showArrow:false})]})}r(Ht,"DialMenu");import{persistentStorage as tn,devToolsStorageKeys as ia}from"@buoy-gg/shared-ui/web";import{recordUsage as ra,pruneUsage as aa}from"@buoy-gg/floating-tools-core/web";var on=ia.dial.usage(),Ge={},nn=false,Nt=null;function Wt(){return Nt||(Nt=(async()=>{try{let e=await tn.getItem(on);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(Ge=t)}}catch{}finally{nn=true}})(),Nt)}r(Wt,"loadDialUsage");Wt();function rn(e){return e.map((t,o)=>({id:t,index:o,lastUsed:Ge[t]?.lastUsed??0})).sort((t,o)=>o.lastUsed-t.lastUsed||t.index-o.index).map(({id:t})=>t)}r(rn,"getRankedToolIds");async function an(e){if(!e)return;nn||await Wt();let t=Math.max(Date.now(),...Object.values(Ge).map(o=>o.lastUsed+1));Ge=aa(ra(Ge,e,t),t);try{await tn.setItem(on,JSON.stringify(Ge))}catch{}}r(an,"recordToolUsage");import{useCallback as sa,useMemo as sn}from"react";import{persistentStorage as la}from"@buoy-gg/shared-ui/web";import{useState as re,useEffect as Te,useCallback as bt,useMemo as vt}from"react";import{settingsEventBus as St}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as ca}from"react";import{getRegisteredToolModule as da}from"@buoy-gg/shared-ui/web";var ua=r(()=>()=>{},"noopSubscribe"),pa=r(()=>null,"serverSnapshot");function ln(){let e=da("@buoy-gg/external-sync");return ca(e?.subscribeSyncStatus??ua,()=>e?.getSyncStatus?.()??null,pa)}r(ln,"useDesktopSyncStatus");import{SentryIcon as ma,WifiCircuitIcon as ga,ImageOverlayIcon as fa,RenderCountIcon as ha,Info as _t,Layers as ya,ChevronRightIcon as cn,ChevronDown as dn,getStorageBackendType as ba,getUseLicense as va,signOutOfBuoy as Sa,persistentStorage as Oe,Trash2 as wa,CheckCircle2 as un,BuoyUpgradeSheet as xa,BackgroundSwitcher as Ta,night as v,NightCard as Pe,NightRows as Ut,NightSectionLabel as Ia,NightFootnote as pn,NightSwitch as mn,NightButton as Kt,NightSegmented as Ca,NightBadge as be,NightSeparator as ka,monoFont as gn}from"@buoy-gg/shared-ui/web";import{EnvIcon as fn,StorageIcon as za,RoutesIcon as Aa,NetworkIcon as Ba,QueryIcon as Da,HighlighterIcon as Ra,ReduxIcon as Ma,EventsIcon as Ea}from"@buoy-gg/floating-tools-core/web";import Oa,{createContext as Pa,useContext as La}from"react";import{jsx as Fa}from"react/jsx-runtime";var hn=Pa({});function Vt({children:e,defaultFloatingTools:t,defaultDialTools:o}){let i=Oa.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:o}),[t,o]);return Fa(hn.Provider,{value:i,children:e})}r(Vt,"DefaultConfigProvider");function qt(){return La(hn)}r(qt,"useDefaultConfig");import $a from"react";import{toolTheme as ja}from"@buoy-gg/shared-ui/web";import{jsx as yn}from"react/jsx-runtime";function bn({label:e,size:t,color:o=ja.colors.text}){let i=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),n=i<=2?t:t*1.6,a=Math.max(7,Math.min(t*(i===1?.7:.62),n/(.62*i)));return yn("span",{style:{display:"inline-flex",minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center",color:o,fontSize:a,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}r(bn,"AppTextIcon");function Gt(e,t){return e==null?e:typeof e=="function"?$a.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?yn(bn,{label:String(e),size:t.size,color:t.color}):e}r(Gt,"renderAppIcon");import{JsModal as Ha,devToolsStorageKeys as Jt,onSettingsApplied as Na,expandableWindowControlsSupported as Wa}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as _a}from"@buoy-gg/shared-ui/web";import{Fragment as Qe,jsx as m,jsxs as j}from"react/jsx-runtime";var et="@react_buoy_dev_tools_settings",Ua=6,wt=r(e=>{let t=Ua,o={};for(let[i,n]of Object.entries(e))n&&t>0?(o[i]=true,t-=1):o[i]=false;return o},"enforceDialLimit"),Ka=r((e,t)=>{let{userStatus:o,environment:i,...n}=e,a=t?Object.entries(n).filter(([s])=>t.includes(s)):Object.entries(n);return{...Object.fromEntries(a),environment:i??false}},"sanitizeFloating"),vn=r((e,t,o)=>{if(!t)return e;let i={...e.dialTools,...t.dialTools??{}},n=o?.allowedDialKeys?Object.entries(i).filter(([a])=>o.allowedDialKeys?.includes(a)):Object.entries(i);return{dialTools:wt(Object.fromEntries(n)),floatingTools:Ka({...e.floatingTools,...t.floatingTools??{}},o?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},"mergeWithDefaults"),Va=r((e=[],t,o)=>{let i={},n={},a=new Set(t??[]),s=new Set(o??[]),u=!o||o.length===0;for(let d of e){let{id:p,slot:g="both"}=d;(g==="dial"||g==="both")&&(i[p]=u?true:s.has(p)),(g==="row"||g==="both")&&(n[p]=a.has(p))}return{dialTools:wt(i),floatingTools:{...n,environment:a.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},"generateDefaultSettings"),qa=r(({visible:e,onClose:t,onSettingsChange:o,initialSettings:i,availableApps:n=[],storage:a=Oe,zIndex:s})=>{let{defaultFloatingTools:u,defaultDialTools:d}=qt(),p=vt(()=>Va(n,u,d),[n,u,d]),g=vt(()=>Object.keys(p.dialTools),[p]),I=vt(()=>Object.keys(p.floatingTools).filter(c=>c!=="environment"),[p]),[f,z]=re(i||tt||p),[T,M]=re(Yt??"floating"),[D,E]=re(Yt!==null),[R,k]=re(new Set),[w,C]=re(false),[F,A]=re(false);Te(()=>{let c=requestAnimationFrame(()=>A(true));return()=>cancelAnimationFrame(c)},[]);let B=ln();Te(()=>{r(async()=>{try{let c=await Oe.getItem(Jt.settings.activeTab());if(c&&["floating","settings","pro"].includes(c)){let b=c;Yt=b,M(O=>O===b?O:b)}}catch{}finally{E(true)}},"loadActiveTab")()},[]),Te(()=>{D&&Oe.setItem(Jt.settings.activeTab(),T).catch(c=>{console.warn("[Buoy]","Failed to save settings active tab:",c)})},[T,D]);let ee=va()?.(),_=ee?.isPro??false,G=!_&&ee?.licenseKey?ee.error:null,te=ee?.errorKind==="transport",[V,ae]=re(Sn),[oe,me]=re(false),[ge,fe]=re(false),[N,Ce]=re(false),[ke,Fe]=re([]),[$e,se]=re(false),Y=_a(),le=xo.get("window").height,pe=xo.get("window").width,ze=Math.floor(le*.33),je=Math.min(pe-32,400),Se=bt(async()=>{try{let c=await a.getItem(et);if(c){let b=JSON.parse(c),O=vn(p,b,{allowedDialKeys:g,allowedFloatingKeys:I});tt=O,z(X=>wn(X,O)?X:O);return}tt=p,z(b=>wn(b,p)?b:p)}catch(c){console.error("[Buoy]","Failed to load dev tools settings:",c),z(p)}},[p,g,I,a]);Te(()=>{Se()},[Se]),Te(()=>{ba().then(c=>{Sn=c,ae(b=>b===c?b:c)})},[]),Te(()=>{N&&(se(true),Oe.getAllKeys().then(c=>{Fe(c.sort())}).catch(()=>{Fe([])}).finally(()=>{se(false)}))},[N]);let Ae=r(async c=>{try{let b={...c,dialTools:wt(c.dialTools)};await a.setItem(et,JSON.stringify(b)),tt=b,z(b),o?.(b),St.emit(b)}catch(b){console.error("[Buoy]","Failed to save dev tools settings:",b)}},"saveSettings"),Be=r(c=>{let b={...f,floatingTools:{...f.floatingTools,[c]:!f.floatingTools[c]}};Ae(b)},"toggleFloatingTool"),ne=r(c=>{let b={...f,globalSettings:{...f.globalSettings,[c]:!f.globalSettings?.[c]}};Ae(b)},"toggleGlobalSetting"),De=r(async()=>{me(true),fe(false);try{await Oe.clear(),fe(true),z(p),a!==Oe&&await a.setItem(et,JSON.stringify(p)),o?.(p),St.emit(p),setTimeout(()=>fe(false),2e3)}catch(c){console.error("[Buoy]","Failed to clear storage:",c)}finally{me(false)}},"handleClearStorage"),He=bt(c=>{},[]),l=r(c=>{let b=n.find(O=>O.id===c);return b?.description?b.description:c==="environment"?"Environment badge.":""},"getToolDescription"),y=r(c=>c==="environment"?"Env Badge":n.find(b=>b.id===c)?.name??c.toUpperCase().replace(/_/g," "),"getToolLabel"),h=r(c=>{if(!F)return null;switch(c){case"query":return m(Da,{size:18});case"env":return m(fn,{size:18});case"sentry":return m(ma,{size:18,color:"#9945FF"});case"storage":return m(za,{size:18,bgColor:v.color.surface});case"wifi":case"query-wifi-toggle":return m(ga,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return m(Aa,{size:18,bgColor:v.color.surface});case"network":return m(Ba,{size:18});case"environment":return m(fn,{size:18});case"debug-borders":return m(ya,{size:18,color:v.color.accent});case"highlight-updates":return m(ha,{size:18,color:v.color.accent});case"highlight-updates-modal":return m(Ra,{size:18});case"redux":return m(Ma,{size:18});case"image-overlay":return m(fa,{size:18});case"events":return m(Ea,{size:18});case"zustand":try{let{ZustandIcon:b}=To("@buoy-gg/zustand/web");return m(b,{size:18})}catch{return m(_t,{size:18,color:v.color.textSecondary})}case"jotai":try{let{JotaiIcon:b}=To("@buoy-gg/jotai/web");return m(b,{size:18})}catch{return m(_t,{size:18,color:v.color.textSecondary})}default:{let b=n.find(O=>O.id===c);return b?.icon!=null?Gt(b.icon,{slot:"row",size:18,color:b.color}):m(_t,{size:18,color:v.color.textSecondary})}}},"getToolIcon"),J=r((c,b,O,X)=>{let we=l(c);return j(ct,{activeOpacity:O?1:.7,onPress:()=>!O&&X(),accessibilityLabel:y(c),accessibilityRole:"button",style:[S.toolRow,O&&S.rowDisabled],children:[m(H,{style:S.toolIconSlot,children:h(c)}),j(H,{style:S.rowInfo,children:[j(K,{style:S.rowLabel,children:[y(c),O?" \xB7 max 6":""]}),we?m(K,{style:S.rowCaption,numberOfLines:1,children:we}):null]}),m(mn,{value:b,disabled:O,onValueChange:()=>X()})]},c)},"renderToolRow"),W=r(c=>{k(b=>{let O=new Set(b);return O.has(c)?O.delete(c):O.add(c),O})},"toggleSettingExpanded"),U=r((c,b,O,X,we)=>{let xe=f.globalSettings?.[c]??false,Ne=R.has(c);return j(H,{children:[j(ct,{activeOpacity:.7,onPress:()=>W(c),accessibilityLabel:b,style:S.settingRow,children:[j(H,{style:S.rowInfo,children:[m(K,{style:S.rowLabel,children:b}),m(K,{style:S.rowCaption,numberOfLines:Ne?0:1,children:O})]}),m(mn,{value:xe,onValueChange:()=>ne(c)})]}),Ne&&j(H,{style:S.settingRowBody,children:[m(K,{style:S.settingRowBodyText,children:X}),m(K,{style:S.settingRowBodyHint,children:we})]})]},c)},"renderGlobalSettingRow"),q=r((c,b,O)=>j(H,{children:[m(Ia,{children:c}),b,O]}),"renderSection"),ie=V==="filesystem"?m(be,{label:"File System",tone:"accent"}):V==="asyncstorage"?m(be,{label:"Async Storage",tone:"warning"}):V==="localstorage"?m(be,{label:"Local Storage",tone:"accent"}):V==="memory"?m(be,{label:"Memory",tone:"danger"}):m(be,{label:"Loading\u2026",tone:"neutral"}),he=r(()=>j(H,{style:S.container,children:[j(wo,{style:S.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:S.scrollContainer,children:[T==="floating"&&m(Qe,{children:q("Floating Tools",m(Pe,{glass:true,children:m(Ut,{children:Object.entries(f.floatingTools).map(([c,b])=>J(c,b,false,()=>Be(c)))})}),m(pn,{children:"Tools switched on here appear in the floating bubble row."}))}),T==="settings"&&j(Qe,{children:[q("Background",m(Pe,{glass:true,padded:true,children:m(Ta,{embedded:true})})),q("Storage",j(Pe,{glass:true,children:[j(ct,{activeOpacity:.7,onPress:()=>Ce(!N),accessibilityLabel:"Storage Type",style:S.settingRow,children:[m(H,{style:S.rowInfo,children:m(K,{style:S.rowLabel,children:"Storage Type"})}),ie,N?m(dn,{size:16,color:v.color.textTertiary}):m(cn,{size:16,color:v.color.textTertiary})]}),N&&j(Qe,{children:[j(H,{style:S.settingRowBody,children:[m(K,{style:S.settingRowBodyText,children:V==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":V==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":V==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":V==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),V==="asyncstorage"&&m(K,{style:[S.settingRowBodyText,S.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),V==="memory"&&m(K,{style:[S.settingRowBodyText,S.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),m(ka,{}),j(H,{style:S.storageExpanded,children:[j(H,{style:S.storageExpandedHeader,children:[m(K,{style:S.storageExpandedTitle,children:"SAVED SETTINGS"}),m(K,{style:S.storageExpandedCount,children:$e?"\u2026":`${ke.length} keys`})]}),$e?m(K,{style:S.storageKeyEmpty,children:"Loading\u2026"}):ke.length===0?m(K,{style:S.storageKeyEmpty,children:"No settings saved yet"}):m(wo,{style:S.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:ke.map(c=>m(H,{style:S.storageKeyItem,children:m(K,{style:S.storageKeyText,numberOfLines:1,children:c.replace("@react_buoy_","")})},c))})]}),m(H,{style:S.cardButtonWrap,children:m(Kt,{label:ge?"Cleared":oe?"Clearing\u2026":"Clear All Settings",variant:ge?"secondary":"destructive",size:"md",disabled:oe,onPress:De,icon:ge?m(un,{size:15,color:v.color.accent}):m(wa,{size:15,color:oe?v.color.textTertiary:v.color.danger})})})]})]})),B&&B.state!=="idle"&&q("Desktop Sync",j(Pe,{glass:true,children:[j(ct,{activeOpacity:.7,onPress:()=>W("desktopSync"),accessibilityLabel:"Buoy Desktop",style:S.settingRow,children:[m(H,{style:S.rowInfo,children:m(K,{style:S.rowLabel,children:"Buoy Desktop"})}),B.state==="connected"?m(be,{label:"Connected",tone:"accent"}):B.state==="connecting"?m(be,{label:"Connecting\u2026",tone:"neutral"}):m(be,{label:"Retrying",tone:"warning"}),R.has("desktopSync")?m(dn,{size:16,color:v.color.textTertiary}):m(cn,{size:16,color:v.color.textTertiary})]}),R.has("desktopSync")&&j(H,{style:S.settingRowBody,children:[j(K,{style:S.settingRowBodyText,children:[B.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",m(K,{style:S.footnoteMono,children:B.targetURL??"(unknown URL)"}),B.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),B.state==="retrying"&&B.lastError&&j(K,{style:[S.settingRowBodyText,S.bodyWarning],children:["Last error: ",B.lastError]})]})]})),q("Modal Behavior",m(Pe,{glass:true,children:j(Ut,{children:[U("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),Wa(We.OS==="web")?U("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),T==="pro"&&j(Qe,{children:[q("License",j(Pe,{glass:true,children:[j(H,{style:S.settingRow,children:[m(H,{style:S.rowInfo,children:m(K,{style:S.rowLabel,children:"License Status"})}),m(H,{testID:"buoy-settings-license-status",accessibilityLabel:_?"License: Active":"License: Free",children:_?m(be,{label:"Active",tone:"accent"}):m(be,{label:"Free",tone:"neutral"})})]}),ee?.tierSource==="session"?j(H,{style:S.settingRow,children:[m(H,{style:S.rowInfo,children:m(K,{style:S.rowLabel,children:"Signed in with Buoy"})}),m(Kt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void Sa(),testID:"buoy-settings-signout"})]}):null]}),m(pn,{children:_?"You have full access to all Buoy DevTools features.":G?te?`Couldn't reach the license server (${G}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${G}.`:"Upgrade to Pro to unlock all features and support development."})),!_&&j(Qe,{children:[q("Pro Features",m(Pe,{glass:true,children:m(Ut,{children:["Advanced Settings","Priority Support"].map(c=>j(H,{style:S.featureRow,children:[m(un,{size:16,color:v.color.accent}),m(K,{style:S.rowLabel,children:c})]},c))})})),m(Kt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>C(true)})]})]})]}),m(xa,{visible:w,onClose:()=>C(false)})]}),"renderContent");return m(Ha,{visible:e,onClose:t,zIndex:s,variant:"night",header:{showToggleButton:false,customContent:m(H,{style:S.headerRow,children:m(Ca,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:T,onChange:c=>M(c)})})},initialMode:"bottomSheet",onModeChange:He,persistenceKey:Jt.settings.root(),enablePersistence:true,maxHeight:le-Y.top,initialHeight:ze,initialFloatingPosition:{x:(pe-je)/2,y:Y.top+20},enableGlitchEffects:true,children:he()})},"DevToolsSettingsModal"),Ga={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},Ja=r((e,t)=>{let o=new Set(e??[]),i=new Set(t??[]),n={};for(let s of i)n[s]=true;let a={environment:o.has("environment")};for(let s of o)s!=="environment"&&(a[s]=true);return{dialTools:wt(n),floatingTools:a,globalSettings:{enableSharedModalDimensions:false}}},"createDefaultsFromConfig"),tt=null,Yt=null,Sn=null,wn=r((e,t)=>JSON.stringify(e)===JSON.stringify(t),"sameSettings");St.addListener(e=>{e&&(tt=e)});var xn=r(()=>{let{defaultFloatingTools:e,defaultDialTools:t}=qt(),o=vt(()=>!e&&!t?Ga:Ja(e,t),[e,t]),[i,n]=re(o),a=bt(async()=>{try{let u=await Oe.getItem(et);if(u){let d=JSON.parse(u),p=vn(o,d);n(p);return}n(o)}catch(u){console.error("[Buoy]","Failed to load dev tools settings:",u),n(o)}},[o]);Te(()=>Na(u=>{u.includes(et)&&a()}),[a]),Te(()=>{a();let u=St.addListener(d=>{try{d&&n(d)}catch{}});return()=>{u()}},[a]);let s=bt(()=>{a()},[a]);return{settings:i,refreshSettings:s}},"useDevToolsSettings"),S=dt.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:v.gutter,paddingRight:v.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:v.gutter,paddingTop:8,paddingBottom:24,gap:v.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:v.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:v.rowPadH,paddingVertical:v.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:v.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:v.color.text,fontSize:v.font.row,fontWeight:"500"},rowCaption:{color:v.color.textTertiary,fontSize:v.font.label},settingRowBody:{paddingHorizontal:v.rowPadH,paddingBottom:v.rowPadV,gap:6},settingRowBodyText:{color:v.color.textSecondary,fontSize:v.font.caption,lineHeight:v.font.caption*1.45},settingRowBodyHint:{color:v.color.textTertiary,fontSize:v.font.caption,lineHeight:v.font.caption*1.45},bodyWarning:{color:v.color.warning},bodyDanger:{color:v.color.danger},cardButtonWrap:{paddingHorizontal:v.cardPad,paddingTop:10,paddingBottom:v.cardPad},storageExpanded:{paddingHorizontal:v.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:v.color.textSecondary,fontSize:v.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:v.color.textTertiary,fontSize:v.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:v.color.glassElevated,borderRadius:v.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:v.color.textSecondary,fontSize:v.font.micro,fontFamily:gn},storageKeyEmpty:{color:v.color.textTertiary,fontSize:v.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:gn,fontSize:v.font.label,color:v.color.textSecondary}});import{jsx as Tn}from"react/jsx-runtime";var Ya=[];function Xt({visible:e,onClose:t,availableTools:o=Ya,defaultFloatingTools:i,defaultDialTools:n,storage:a=la,onSettingsChange:s}){let u=sn(()=>({getItem:r(async g=>a.getItem(g),"getItem"),setItem:r(async(g,I)=>a.setItem(g,I),"setItem")}),[a]),d=sn(()=>o.map(g=>({...g,name:g.name??g.id,icon:typeof g.icon=="function"?I=>g.icon(I.size):g.icon})),[o]),p=sa(g=>{s?.(g)},[s]);return Tn(Vt,{defaultFloatingTools:i,defaultDialTools:n,children:Tn(qa,{visible:e,onClose:t,zIndex:11e3,availableApps:d,storage:u,onSettingsChange:p})})}r(Xt,"SettingsModal");import{listenBuoyKeydown as Xa}from"@buoy-gg/shared-ui/web/floating";import{persistentStorage as In,setExpandableWindowControls as Za}from"@buoy-gg/shared-ui/web";import{createContext as Qa,useCallback as Ie,useContext as es,useEffect as xt,useMemo as ts,useRef as ot,useState as Cn}from"react";var os=r((e,t,o)=>{if(t.singleton){let n=e.find(a=>a.id===t.id);if(n){let a=n.minimized??false;return{instanceId:n.instanceId,wasMinimized:a,apps:[...e.filter(s=>s.instanceId!==n.instanceId),{...n,minimized:false}]}}}let i=o();return{instanceId:i,wasMinimized:false,apps:[...e,{...t,instanceId:i}]}},"resolveOpenAppsState");import{createContext as ns,useCallback as kn,useContext as is,useEffect as Tt,useMemo as rs,useRef as zn,useState as It}from"react";import{JsModal as as,ModalHeader as nt,HeaderSearchButton as ss,TickProvider as ls,ToolScreenHeaderContext as cs,devToolsStorageKeys as An,buoyColors as Bn,gameUIColors as Zt}from"@buoy-gg/shared-ui/web";import{jsx as ce,jsxs as Ct}from"react/jsx-runtime";var it=r(()=>{},"noop"),ds={search:"",isSearchActive:false,clearSearch:it,close:it,minimize:it,showToast:it,setHeaderOverride:it},Dn=ns(null);function Qt(){return is(Dn)??ds}r(Qt,"useToolHost");function Rn(e,t){let{setHeaderOverride:o}=Qt();Tt(()=>(o(e),()=>o(null)),t)}r(Rn,"useToolHeader");var Mn=2200,us={success:Zt.success,error:Zt.error,info:Zt.info};function En({message:e,type:t,nonce:o}){let i=zn(new Re.Value(0)).current;Tt(()=>{i.setValue(0),Re.sequence([Re.timing(i,{toValue:1,duration:150,useNativeDriver:true}),Re.delay(Mn-450),Re.timing(i,{toValue:0,duration:300,useNativeDriver:true})]).start()},[o,i]);let n=us[t];return Ct(Re.View,{pointerEvents:"none",style:[kt.toast,{opacity:i,borderColor:n+"60"}],children:[ce(H,{style:[kt.toastDot,{backgroundColor:n}]}),ce(K,{style:kt.toastText,numberOfLines:2,children:e})]})}r(En,"ToastView");function On({app:e,config:t,visible:o,zIndex:i,onClose:n,onMinimize:a,initialModalState:s,enableSharedModalDimensions:u,bodyProps:d}){let p=e.component,[g,I]=It(false),[f,z]=It(""),[T,M]=It(null),[D,E]=It(null),R=zn(null),k=kn(()=>{I(false),z("")},[]),w=kn((V,ae="info")=>{R.current&&clearTimeout(R.current),E(oe=>({message:V,type:ae,nonce:(oe?.nonce??0)+1})),R.current=setTimeout(()=>E(null),Mn)},[]);Tt(()=>()=>{R.current&&clearTimeout(R.current)},[]);let C=rs(()=>({search:g?f:"",isSearchActive:g,clearSearch:k,close:n,minimize:r(()=>a(),"minimize"),showToast:w,setHeaderOverride:M,instanceId:e.instanceId}),[f,g,k,n,a,w,e.instanceId]),F=T?.title??t.title??e.title??e.id,A=T?.subtitle??t.subtitle,B=T?.onBack,ee=T?.actions??t.headerActions,_=T?.searchable??t.searchable;Tt(()=>{!_&&g&&k()},[_,g,k]);let G=u?An.modal.root():An.custom(e.id).modal(),te=Ct(nt,{children:[B&&!g&&ce(nt.Navigation,{onBack:B}),g?ce(nt.Search,{value:f,onChangeText:z,onCancel:k,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):ce(nt.Content,{title:F,subtitle:A}),Ct(nt.Actions,{children:[!g&&ee,_&&!g&&ce(ss,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>I(true)})]})]});return ce(Dn.Provider,{value:C,children:ce(as,{visible:o,onClose:n,onBack:B,onMinimize:a,initialModalState:s,zIndex:i,persistenceKey:G,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:te,showToggleButton:true},disableScrollWrapper:true,styles:{},children:Ct(H,{style:kt.bodyRoot,children:[ce(ls,{children:ce(cs.Provider,{value:M,children:ce(p,{...d})})}),D&&ce(En,{message:D.message,type:D.type,nonce:D.nonce})]})})})}r(On,"ToolModalShell");var kt=dt.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:Bn.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:Bn.text}});import{useEffect as ps,useRef as ms}from"react";import{capacitorPlatform as gs,capacitorPlugin as fs}from"@buoy-gg/license/web";function Pn(){return globalThis.__BUOY_HOLDS_BACK__===true}r(Pn,"isBuoyHoldingBackButton");var hs=99.5;function Ln(){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}}r(Ln,"ionicHandlesBack");function Fn(e,t){let o=ms(t);o.current=t,ps(()=>{if(!e||gs()!=="android")return;let i=globalThis;i.__BUOY_HOLDS_BACK__=true;let n;if(Ln()){let a=r(s=>{s.detail?.register?.(hs,()=>{o.current()})},"listener");document.addEventListener("ionBackButton",a),n=r(()=>document.removeEventListener("ionBackButton",a),"cleanup")}else{let a=fs("App");if(!a?.addListener){i.__BUOY_HOLDS_BACK__=false;return}let s=false,u=null;Promise.resolve(a.addListener("backButton",()=>o.current())).then(d=>{s?d.remove():u=d}).catch(()=>{}),n=r(()=>{s=true,u&&u.remove()},"cleanup")}return()=>{n(),i.__BUOY_HOLDS_BACK__=false}},[e])}r(Fn,"useCapacitorBackButton");import{Fragment as ys,jsx as de}from"react/jsx-runtime";var $n=Qa(null),jn="@react_buoy_open_apps",eo=44,bs=12,vs=100,Ss=16,ws=r(e=>({x:window.innerWidth-eo-Ss,y:window.innerHeight-vs-eo-e*(eo+bs)}),"dockIconPosition"),Hn=r(({children:e})=>{let[t,o]=Cn([]),[i,n]=Cn(false),a=ot([]),s=ot(null),u=ot(false),d=ot(false),p=ot(false),g=Ie(w=>{let C="";return o(F=>{let{apps:A,instanceId:B}=os(F,w,()=>`${w.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return C=B,A}),C},[]),I=Ie(()=>{if(u.current||!d.current||!p.current)return;u.current=true;let w=s.current;if(!w||w.length===0){n(true);return}s.current=null,w.forEach(({id:C,minimized:F})=>{let A=a.current.find(B=>B.id===C);if(A&&A.component){let B=Gt(A.icon,{slot:"dial",size:20,color:A.color});g({id:A.id,title:A.name,component:A.component,props:A.props,modal:A.modal,launchMode:A.launchMode||"self-modal",singleton:A.singleton??true,icon:B,color:A.color,minimized:F})}}),n(true)},[g]);xt(()=>{let w=false;return r(async()=>{try{let C=await In.getItem(jn);if(w)return;if(C){let F=JSON.parse(C),A;Array.isArray(F)&&F.length>0&&(typeof F[0]=="string"?A=F.map(B=>({id:B,minimized:false})):A=F.filter(B=>typeof B=="object"&&B!==null&&typeof B.id=="string"),A.length&&(s.current=A))}}catch{}w||(d.current=true,I())},"restoreOpenApps")(),()=>{w=true}},[I]),xt(()=>{if(!i)return;let w=t.map(C=>({id:C.id,minimized:C.minimized??false}));In.setItem(jn,JSON.stringify(w))},[t,i]);let f=Ie(w=>{a.current=w,p.current=true,I()},[I]),z=Ie(w=>{o(C=>C.length?w?C.filter(F=>F.instanceId!==w):C.slice(0,-1):C)},[]),T=Ie(()=>o([]),[]),M=Ie((w,C)=>{o(F=>F.map(A=>A.instanceId===w?{...A,minimized:true,restoreState:C}:A))},[]),D=Ie((w,C)=>{o(F=>F.map(A=>A.instanceId===w?{...A,minimized:false,restoreState:C??A.restoreState}:A))},[]),E=Ie(w=>t.find(C=>C.instanceId===w)?.minimized??false,[t]),R=t.some(w=>w.launchMode!=="toggle-only"&&!w.minimized);xt(()=>R?Xa(r(w=>{if(w.key!=="Escape"||w.defaultPrevented)return;let C=[...t].reverse().find(F=>F.launchMode!=="toggle-only"&&!F.minimized);C&&z(C.instanceId)},"handler")):void 0,[R,z,t]),Fn(t.length>0,()=>z());let k=ts(()=>({openApps:t,isAnyOpen:R,open:g,close:z,closeAll:T,registerApps:f,minimize:M,restore:D,isMinimized:E}),[t,R,g,z,T,f,M,D,E]);return de($n.Provider,{value:k,children:e})},"AppHostProvider"),rt=r(()=>{let e=es($n);return e||{openApps:[],isAnyOpen:false,open:r(()=>"","open"),close:r(()=>{},"close"),closeAll:r(()=>{},"closeAll"),registerApps:r(()=>{},"registerApps"),minimize:r(()=>{},"minimize"),restore:r(()=>{},"restore"),isMinimized:r(()=>false,"isMinimized")}},"useAppHost"),xs=9e3,Ts={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},Is={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Cs=r(({app:e,zIndex:t,onClose:o,onMinimize:i,minimizeTargetPosition:n,enableSharedModalDimensions:a})=>{let s=e.component,u=!e.minimized,d={...e.props??{},...a?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(On,{app:e,config:e.modal,visible:u,zIndex:t,onClose:o,onMinimize:i,initialModalState:e.restoreState,enableSharedModalDimensions:a,bodyProps:d})}):e.launchMode==="self-modal"?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(s,{...d,visible:u,onClose:o,onRequestClose:o,onMinimize:i,minimizeTargetPosition:n,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?u?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(s,{...d,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...Ts,zIndex:t,display:u?"flex":"none"},children:de("div",{style:Is,children:de(s,{...d,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})})})},"AppRenderer"),Nn=r(()=>{let{openApps:e,close:t,minimize:o}=rt(),{settings:i}=xn();xt(()=>{Za(i.globalSettings?.expandableWindowControls!==false)},[i.globalSettings?.expandableWindowControls]);let n=e.filter(u=>u.launchMode!=="toggle-only");if(n.length===0)return null;let a=n.filter(u=>u.minimized).length,s=Br()??ws(a);return de(ys,{children:n.map((u,d)=>de(Cs,{app:u,zIndex:xs+d,onClose:()=>t(u.instanceId),onMinimize:p=>o(u.instanceId,p),enableSharedModalDimensions:i.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:s},u.instanceId))})},"AppOverlay");import{useCallback as ks,useEffect as to,useRef as zs,useState as Wn,useSyncExternalStore as _n}from"react";import{persistentStorage as Un,getToolAttention as oo,subscribeToolAttention as Kn}from"@buoy-gg/shared-ui/web";import{jsx as ue,jsxs as zt}from"react/jsx-runtime";function Vn(e){return _n(Kn,()=>oo(e),()=>oo(e))}r(Vn,"useToolAttention");var qn={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},Gn={needsInput:3,failed:2,done:1},Jn=new Map;function no(e){let t=null;for(let i of e?e.split("|"):[]){let n=oo(i);n&&(!t||Gn[n.kind]>Gn[t.kind])&&(t=n)}let o=Jn.get(e);return o&&t&&o.kind===t.kind&&o.label===t.label?o:!o&&!t?null:(Jn.set(e,t),t)}r(no,"strongest");function Yn(e){let t=e.join("|");return _n(Kn,()=>no(t),()=>no(t))}r(Yn,"useStrongestAttention");var Xn=28,io=32,ro=6,Zn=8,Qn=24,ei="@react_buoy_minimized_stack_expanded",As=80,ti=2e3,Bs=6e3,Ds="#1A1A1A",at="#888888";function ao({down:e=false}){return ue("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:ue("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:at,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}r(ao,"ChevronGlyph");function oi({id:e,title:t,icon:o,index:i,onPress:n}){let a=Vn(e),s=zs(null);return to(()=>{let u=true,d,p=r(()=>{s.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:As,easing:"linear"})},"runGlitch"),g=r(I=>{let f=I?500+Math.random()*1500+i*200:ti+Math.random()*(Bs-ti)+i*300;d=setTimeout(()=>{u&&(p(),g(false))},f)},"schedule");return g(true),()=>{u=false,clearTimeout(d)}},[i]),zt("button",{type:"button","aria-label":a?`${t} \u2014 ${a.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:n,style:{width:io,height:io,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[ue("div",{ref:s,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:o}),a?ue("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${a.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:qn[a.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:a.kind==="needsInput"?"!":""}):null]})}r(oi,"GlitchToolButton");function ni({containerWidth:e=32}){let{openApps:t,restore:o}=rt(),i=t.filter(f=>f.minimized&&f.launchMode!=="toggle-only"),[n,a]=Wn(false),[s,u]=Wn(false),d=Yn(i.map(f=>f.id));to(()=>{let f=false;return r(async()=>{let z=await Un.getItem(ei);!f&&z==="true"&&a(true),f||u(true)},"load")(),()=>{f=true}},[]),to(()=>{s&&Un.setItem(ei,n?"true":"false")},[n,s]);let p=ks(f=>{o(f)},[o]);if(i.length===0)return null;let g=Zn+i.length*io+(i.length-1)*ro+ro+Qn+4,I={backgroundColor:Ds,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${at}66`,borderLeft:`1px solid ${at}66`,borderRight:`1px solid ${at}66`,borderBottom:"none",boxSizing:"border-box"};return zt("div",{style:{height:Xn,overflow:"visible",position:"relative"},children:[ue("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?g:0,opacity:n?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:n?"auto":"none",...I},children:zt("div",{style:{height:g,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:Zn,gap:ro,boxSizing:"border-box"},children:[n&&[...i].reverse().map((f,z)=>ue(oi,{id:f.id,title:f.title||f.id,icon:f.icon??ue("span",{style:{color:"#fff",fontSize:13},children:(f.title||f.id).slice(0,1).toUpperCase()}),index:z,onPress:()=>p(f.instanceId)},f.instanceId)),ue("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>a(false),style:{width:"100%",height:Qn,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:ue(ao,{down:true})})]})}),zt("button",{type:"button","aria-label":`Show ${i.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:n?-1:0,"aria-hidden":n,onClick:()=>a(true),style:{position:"absolute",bottom:0,left:0,width:e,height:Xn,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:n?0:1,transform:n?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:n?"none":"auto",...I},children:[ue(ao,{}),d?ue("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:qn[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,i.length>1&&ue("span",{style:{fontSize:9,fontWeight:600,color:at,marginLeft:1},children:i.length})]})]})}r(ni,"MinimizedToolsStack");import{registerToolModules as Rs}from"@buoy-gg/shared-ui/web";import{createElement as Ms}from"react";function Je(e){let t=e.icon;return{...e,icon:typeof t=="function"?o=>Ms(t,{size:o,slot:e.slot??"both",color:e.color}):()=>t}}r(Je,"createWebTool");import{createContext as Es,useContext as Os,useState as ii,useMemo as ri}from"react";import{jsx as Ps}from"react/jsx-runtime";var ai=Es(null);function so({children:e}){let[t,o]=ii(false),[i,n]=ii(false),a=ri(()=>t||i,[t,i]),s=ri(()=>({isDialOpen:t,isToolOpen:i,isDevToolsActive:a,setDialOpen:o,setToolOpen:n}),[t,i,a]);return Ps(ai.Provider,{value:s,children:e})}r(so,"DevToolsVisibilityProvider");function At(){let e=Os(ai);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:r(()=>{},"setDialOpen"),setToolOpen:r(()=>{},"setToolOpen")}}r(At,"useDevToolsVisibility");import*as Ls from"@buoy-gg/license/web";import*as Fs from"@buoy-gg/shared-ui/web";import*as $s from"@buoy-gg/shared-ui/web/dataViewer";function lo(e){Rs({core:{useDevToolsVisibility:At},license:Ls,"shared-ui":Fs,"shared-ui/dataViewer":$s,...e});let t=new Set;return Object.values(e).flatMap(o=>Object.entries(o).flatMap(([i,n])=>!i.endsWith("Preset")||!n||typeof n.id!="string"||!n.component||t.has(n.id)?[]:(t.add(n.id),[Je(n)])))}r(lo,"createWebTools");import{useEffect as Bt,useMemo as Dt,useRef as js}from"react";import{LicenseManager as si,installCapacitorBridge as Hs,resolveDevBuild as li,useLicense as Ns}from"@buoy-gg/license/web";import{registerToolAdapters as Ws}from"@buoy-gg/shared-ui/web";function co(e){return typeof e=="object"&&e!==null?e:void 0}r(co,"externalSyncOptions");function ci({isDevelopment:e,isLicensed:t,externalSync:o,isAvailable:i}){if(o===false||!i)return false;if(e)return true;let n=co(o);return t&&n?.enableInRelease===true&&uo(n.socketURL,n)===null}r(ci,"shouldMountExternalSync");var di="http://localhost:42831";function ui(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}r(ui,"isLoopbackHost");function uo(e,t){let o=e??di;if(t?.allowInsecureNetwork===true)return null;let i;try{i=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 i.protocol==="https:"||i.protocol==="wss:"||ui(i.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.`}r(uo,"releaseTransportProblem");var _s={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function pi(e,t,o){if(t)return e;let i=null;for(let[n,a]of Object.entries(_s)){if(o?.includes(n))continue;let s=e[n];if(!s?.actions)continue;let u={...s.actions};for(let d of a)d in u&&(u[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}"] }}.`)});i??(i={...e}),i[n]={...s,actions:u}}return i??e}r(pi,"applyReleaseActionPolicy");import{useEffect as Us,useMemo as Ks,useState as Vs}from"react";import{devToolsStorageKeys as qs,persistentStorage as Gs}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as Js}from"@buoy-gg/license/web";var Ys=8;function mi(){let e="";for(;e.length<Ys;)e+=(Math.random()*16|0).toString(16);return e}r(mi,"generateInstallId");function gi(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}r(gi,"slugify");function fi({appName:e,hardwareName:t,platform:o,installId:i,deviceId:n}){let a=gi(e??"buoy")||"buoy",s=e??"Buoy Device",u=t?.trim()||o;return n?{deviceId:n,deviceName:`${s} (${u})`}:{deviceId:`${a}-${o}-${i}`,deviceName:`${s} (${u} \xB7 ${i.slice(-4)})`}}r(fi,"buildDeviceIdentity");function hi(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}r(hi,"sessionStore");function yi(){let e=globalThis;try{return e.localStorage??null}catch{return null}}r(yi,"localStore");async function bi({platform:e=We.OS,store:t,mint:o=mi}={}){let i=qs.sync.deviceId(),n=t===void 0?Js()?yi():e==="web"?hi():Gs:t;if(!n)return o();try{let a=await n.getItem(i);if(a&&a.length>0)return a;let s=o();return await n.setItem(i,s),s}catch{return o()}}r(bi,"loadInstallId");var po=null;function vi(){return po||(po=bi()),po}r(vi,"getInstallId");function Si(e,t){let o=e?.deviceId,i=e?.deviceName,n=t.loadId??vi,a=t.platform??We.OS,[s,u]=Vs(null);return Us(()=>{if(o)return;let d=false;return n().then(p=>{d||u(p)}),()=>{d=true}},[o,n]),Ks(()=>{if(!o&&!s)return null;let d=fi({appName:t.appName,hardwareName:t.hardwareName,platform:a,installId:s??"",deviceId:o});return i?{...d,deviceName:i}:d},[o,i,s,t.appName,t.hardwareName,a])}r(Si,"useDeviceIdentity");import{useEffect as Xs,useState as Zs}from"react";import{capacitorPlatform as Qs,capacitorPlugin as Rt,isCapacitorNative as el}from"@buoy-gg/license/web";function wi(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}r(wi,"hardwareFromUserAgent");function xi(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}r(xi,"isAndroidEmulatorUserAgent");function mo(){return typeof navigator>"u"?"":navigator.userAgent??""}r(mo,"userAgent");function Mt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}r(Mt,"firstPageTitle");var Ti="@react_buoy_capacitor_app_name";function Ii(e){try{let t=globalThis.localStorage;if(!t)return e;let o=t.getItem(Ti);if(o)return o;e&&t.setItem(Ti,e)}catch{}return e}r(Ii,"persistedAppName");function Ci(){let e=Qs();if(!e)return{platform:"web",appName:Mt(),hardwareName:"Browser",ready:true};let t=!!Rt("App");return{platform:e,appName:t?Mt():Ii(Mt()),hardwareName:wi(mo(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Rt("Device")}}r(Ci,"initialHostInfo");function ki(){let[e,t]=Zs(Ci);return Xs(()=>{if(!el())return;let o=false,i=Rt("App"),n=Rt("Device");return Promise.all([i?.getInfo?.().catch(()=>null)??null,n?.getInfo?.().catch(()=>null)??null]).then(([a,s])=>{if(o)return;let u=a?.name?.trim(),d=s?.name?.trim()||s?.model?.trim();t(p=>({...p,appName:u||p.appName,hardwareName:d||p.hardwareName,ready:true}))}),()=>{o=true}},[]),e}r(ki,"useHostInfo");function go(){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:mo(),serverUrl:typeof e=="string"?e:null}}r(go,"pageInfo");function fo(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}r(fo,"schemeHost");function zi(e,t){if(e==="ios"){let o=fo(t.serverUrl);return o?o===fo(t.origin):t.protocol==="capacitor:"}return Ai.has(t.hostname)}r(zi,"isBundledPage");var Ai=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Bi(e,t,o,i=go()){if(o==="web"||!i)return e;let n;try{n=new URL(e)}catch{return e}let a=zi(o,i);return!t&&a&&n.hostname===i.hostname&&(n.hostname="localhost"),o==="android"&&Ai.has(n.hostname)&&xi(i.userAgent)&&(n.hostname="10.0.2.2"),n.toString().replace(/\/$/,"")}r(Bi,"capacitorBrokerURL");function Di(e,t,o=go()){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.`}r(Di,"capacitorTransportProblem");import{getDevServerOrigin as tl,resolveReloadStrategy as ol,scheduleReloadApp as nl}from"@buoy-gg/shared-ui/web";var Ri=Date.now(),Mi=tl(),il={platform:We.OS,isTV:We.isTV===true,isTVOS:We.isTVOS===true},Ei={version:3,getSnapshot:r(()=>{let e=ol("auto");return{startedAt:Ri,devServerOrigin:Mi,device:il,reload:{available:e!==null,strategy:e}}},"getSnapshot"),subscribe:r(e=>()=>{},"subscribe"),actions:{ping:r(()=>({ok:true,startedAt:Ri,devServerOrigin:Mi}),"ping"),reloadApp:r(e=>{let t=e??{},{strategy:o,delayMs:i}=nl({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:o,delayMs:i}},"reloadApp")}};import{Fragment as rl,jsx as Le,jsxs as al}from"react/jsx-runtime";var sl=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],ll=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Oi(e){let t=Dt(()=>Object.fromEntries(Object.entries(e.modules).map(([i,n])=>[i.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),n])),[e.modules]),o=t["react-query"];return o?.useReactQuerySyncAdapter?Le(Pi,{...e,modules:t,query:o}):Le(ho,{...e,modules:t})}r(Oi,"BrowserToolRuntime");function Pi(e){let t=e.query.useReactQuerySyncAdapter();return Le(ho,{...e,queryAdapter:t})}r(Pi,"QueryRuntime");function ho({modules:e,apps:t,requiredEnvVars:o,externalSync:i,headless:n,sentryGetClient:a,queryAdapter:s}){let{isPro:u,tier:d}=Ns(),p=Dt(()=>{let D={app:Ei};for(let[E,R]of Object.entries(e))for(let[k,w]of Object.entries(R))k.endsWith("SyncAdapter")&&w&&typeof w=="object"&&(D[E]=w);s&&(D.query=s),e.env?.createEnvSyncAdapter&&(D.env=e.env.createEnvSyncAdapter(o??[]));for(let E of t??[])E.sync&&(D[`custom:${E.id}`]=E.sync);return D},[e,t,o,s]),g=js(p);g.current=p,Bt(()=>Ws(()=>g.current),[]),Bt(()=>{let D=[],E=r(R=>{let k=R?.();typeof k=="function"&&D.push(k)},"start");return E(e.network?.startNetworkCapture),E(e.storage?.startBrowserStorageCapture),E(e.assets?.startBrowserAssetCapture),E(e.three?.startThreeCapture),li(typeof _e<"u"?_e:process.env.NODE_ENV!=="production")&&E(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&E(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&E(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let R of D.reverse())R()}},[e]);let I=e["external-sync"],f=li(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),z=ci({isDevelopment:f,isLicensed:u,externalSync:i,isAvailable:!!I}),T=co(i);Hs({release:!f&&!!T?.enableInRelease}),!f&&T?.enableInRelease&&yo(uo(T.socketURL,T));let M=e.sentry?.SentryRoot;return al(rl,{children:[Object.entries(e).flatMap(([D,E])=>sl.map(R=>{let k=E[R];return k?Le(k,{},`${D}:${R}`):null})),M&&Le(M,{getClient:a}),Object.entries(e).flatMap(([D,E])=>ll.map(R=>{let k=E[R];return k&&(!n||R==="ScenariosOverlay"||R==="ImpersonateOverlay")?Le(k,{},`${D}:${R}`):null})),z&&Le(Fi,{module:I,tools:p,options:T,isPro:u,tier:d,dev:f})]})}r(ho,"ToolRuntime");var Li=null;function yo(e){!e||e===Li||(Li=e,console.warn("[Buoy]",e))}r(yo,"warnOnce");function Fi({module:e,tools:t,options:o,isPro:i,tier:n,dev:a}){let s=ki(),u=Si(o,{appName:s.appName,hardwareName:s.hardwareName,platform:s.platform}),d=Dt(()=>Bi(o?.socketURL??(a?e.getDefaultSocketURL():di),!!o?.socketURL,s.platform),[o?.socketURL,a,e,s.platform]),{socket:p}=e.useExternalSyncSocket({deviceName:u?.deviceName??"Buoy Browser",socketURL:d,persistentDeviceId:s.ready?u?.deviceId??null:null,platform:s.platform,extraDeviceInfo:s.extraDeviceInfo,enableLogs:o?.enableLogs});Bt(()=>{let f=Di(d,s.platform);if(!p||!f)return;let z=r(()=>yo(f),"onError");return p.on("connect_error",z),()=>{p.off("connect_error",z)}},[p,d,s.platform]),Bt(()=>{if(!p)return;let f=r(()=>{if(!p.connected||!si.hasAccountAccess())return;let z=si.getState();!i&&(z.isInitialized===false||z.isValidating===true)||p.emit("device-license",{isPro:i?"1":"0",tier:n})},"emit");return f(),p.on("connect",f),()=>{p.off("connect",f)}},[p,i,n]);let g=o?.releaseActions?.join(",")??"",I=Dt(()=>pi(t,a,g?g.split(","):void 0),[t,a,g]);return e.useExternalSync({tools:I,socket:p,deviceId:s.ready?u?.deviceId??null:null,enableLogs:o?.enableLogs}),null}r(Fi,"BrowserExternalSync");import{useState as $i}from"react";import{BuoyPortal as cl}from"@buoy-gg/shared-ui/web/floating";import{useBuoySession as dl}from"@buoy-gg/license/web";import{Fragment as ji,jsx as Ye,jsxs as Hi}from"react/jsx-runtime";var Ni="#20C997";function Wi(){let{status:e,signIn:t,signOut:o}=dl(),[i,n]=$i(false),[a,s]=$i(null);if(typeof document>"u")return null;let u=r(()=>{s(null),n(true),t().catch(p=>s(p instanceof Error?p.message:"Sign-in did not work. Try again.")).finally(()=>n(false))},"start"),d=e.state==="active";return Ye(cl,{children:Ye("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||a?"12px 14px":0,borderRadius:16,background:d||a?"#0f1419":"transparent",color:"#e6edf3",boxShadow:d||a?"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?Hi(ji,{children:[Ye("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),Ye("button",{type:"button",onClick:()=>void o(),style:ul,"data-testid":"buoy-signout",children:"Sign out"})]}):Hi(ji,{children:[a?Ye("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:a}):null,Ye("button",{type:"button",onClick:u,disabled:i,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:Ni,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"})]})})})}r(Wi,"BuoySignIn");var ul={marginTop:8,padding:0,border:"none",background:"none",color:Ni,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useState as pl}from"react";import{AccountSetupButton as ml,BuoyNeedsPlanCard as gl,BuoySignInCard as fl,useSignInState as hl}from"@buoy-gg/shared-ui/web";import{jsx as st,jsxs as _i}from"react/jsx-runtime";function bo({needsPlan:e=false}){let[t,o]=pl(false),i=hl();return _i(H,{pointerEvents:"box-none",style:Ui.root,children:[st(ml,{expanded:t,onPress:()=>o(true)}),t?st(ar,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>o(false),children:_i(H,{style:Ui.overlay,accessibilityViewIsModal:true,children:[st(rr,{style:dt.absoluteFill,onPress:()=>o(false),accessible:false}),e&&i==="active"?st(gl,{onClose:()=>o(false)}):st(fl,{onClose:()=>o(false)})]})}):null]})}r(bo,"BuoySignIn");var Ui=dt.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 vo(e){if(e.length>6){let t=e.map(o=>`"${o}"`).join(", ");return e.slice(0,6)}return e}r(vo,"validateDialConfig");import{installedTools as yl,installedToolsFound as bl}from"@buoy-gg/core/web/installed-tools";import{Fragment as So,jsx as L,jsxs as lt}from"react/jsx-runtime";var Ki={},Vi="@react_buoy_floating_menu_tooltip_shown",vl=Me;function qi({size:e=14,color:t="#20C997"}){let o=Math.max(2,e/4),i=Math.max(1,e/16);return L("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${o}px)`,gap:i,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((n,a)=>L("div",{style:{width:o,height:o,borderRadius:o/2,backgroundColor:t}},a))})}r(qi,"MenuLauncherIcon");function Gi(e){let{defaultFloatingTools:t,defaultDialTools:o,disableHints:i=false,children:n}=e,a=ye(()=>o&&vo(o),[o]);return L(Vt,{defaultFloatingTools:t,defaultDialTools:a,children:L(Sr,{disableHints:i,children:lt(so,{children:[L(Hn,{children:L(Qi,{...e})}),n]})})})}r(Gi,"AdmittedFloatingDevTools");var Sl=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function Ji({modules:e=Ki}){return L(So,{children:Object.entries(e).flatMap(([t,o])=>Sl.map(i=>{let n=o[i];return n?L(n,{},`${t}:${i}`):null}))})}r(Ji,"StartupCapture");function Yi(){let{openApps:e,restore:t}=rt();return Z(()=>Io(o=>{let i=e.find(n=>n.id===o);return i?(t(i.instanceId),true):false}),[e,t]),null}r(Yi,"WebToolOpenerBridge");function Xi(){let e=hr();return wr((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}r(Xi,"defaultEnvironment");function Zi(e,t,o,i){let n=r(g=>Object.entries(e).find(([I])=>I.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===g)?.[1],"find"),a=[],s=n("env");t?.length&&s?.createEnvTool&&s.createEnvVarConfig&&a.push(Je(s.createEnvTool({requiredEnvVars:s.createEnvVarConfig(t)})));let u=n("storage");o?.length&&u?.createStorageTool&&a.push(Je(u.createStorageTool({requiredStorageKeys:o})));let d=n("ask-buoy"),p=i==="hosted"?d?.hostedAskBuoy?.():i;return p&&d?.createAskBuoyTool&&a.push(Je(d.createAskBuoyTool(p))),a}r(Zi,"configOverrides");function Qi({environment:e,userRole:t="admin",availableEnvironments:o,onEnvironmentSwitch:i,apps:n,modules:a=Ki,externalSync:s,requiredEnvVars:u,sentryGetClient:d,disableHints:p=false,headless:g=false,hidden:I=false,defaultFloatingTools:f,defaultDialTools:z,zustandStores:T,requiredStorageKeys:M,askBuoy:D}){let E=e??Xi(),R=ye(()=>z?vo(z):void 0,[z]),[k,w]=Et(false),[C,F]=Et(false),A=Co(false),B=rt(),ee=ye(()=>Zi(a,u,M,D),[a,u,M,D]),_=ye(()=>Ot([...lo(a),...n??[],...ee]),[n,a,ee]),G=ye(()=>Object.entries(a).find(([l])=>l.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[a]);Z(()=>{if(!T||typeof G?.watchStores!="function")return;let l=G.watchStores(T);return typeof l=="function"?l:void 0},[T,G]);let te=At(),V=B.openApps.some(l=>!l.minimized);Z(()=>{te.setDialOpen(k)},[k,te.setDialOpen]),Z(()=>{te.setToolOpen(V||C)},[V,C,te.setToolOpen]);let{registerApps:ae}=B;Z(()=>{ae(_.map(l=>{let y=l.icon;return{...l,icon:typeof y=="function"?({size:h})=>y(h):y}}))},[ae,_]);let oe=ye(()=>_.map(l=>({id:l.id,name:l.name,description:l.description,slot:l.slot})),[_]);Tr({availableTools:oe,storage:vl}),Z(()=>{let l=false;return r(async()=>{let[y,h]=await Promise.all([Me.getItem(pt.dial.isOpen()),Me.getItem(pt.settings.modalOpen())]);l||(y==="true"&&w(true),h==="true"&&(w(true),F(true)),A.current=true)},"restore")(),()=>{l=true}},[]),Z(()=>{A.current&&Me.setItem(pt.dial.isOpen(),k?"true":"false")},[k]),Z(()=>{A.current&&Me.setItem(pt.settings.modalOpen(),C?"true":"false")},[C]);let me=Ue(l=>{if(an(l.id),l.launchMode==="toggle-only"){l.onPress?.();return}if(l.component){let y=typeof l.icon=="function"?l.icon(20):l.icon;B.open({id:l.id,title:l.name||ut(l.id),component:l.component,props:l.props,modal:l.modal,launchMode:l.launchMode||"self-modal",singleton:l.singleton??true,icon:y,color:l.color||ko(l.id)})}else l.onPress?.()},[B]),ge=Co({tools:_,openApps:B.openApps,openTool:me});ge.current={tools:_,openApps:B.openApps,openTool:me},Z(()=>Io(l=>{let{tools:y,openApps:h,openTool:J}=ge.current;if(h.some(U=>U.id===l))return false;let W=y.find(U=>U.id===l);return!W||W.launchMode==="toggle-only"?false:(J(W),true)}),[]);let fe=ye(()=>mt(_,"dial").map(l=>{let y=l.color||ko(l.id),h;return typeof l.icon=="string"?h=l.icon:typeof l.icon=="function"?h=l.icon(32):h=null,{id:l.id,name:l.name||ut(l.id),icon:h,unavailable:!l.component&&!l.onPress,color:y,onPress:r(()=>{me(l),w(false)},"onPress")}}),[_,me]),N=ye(()=>{if(!k)return fe;let l=new Map(fe.map(y=>[y.id,y]));return rn(fe.map(y=>y.id)).map(y=>l.get(y)).filter(y=>!!y)},[k,fe]),{settings:Ce}=xn(),ke=ye(()=>mt(_,"row").filter(l=>(Ce.floatingTools[l.id]??false)===true&&(l.component||l.onPress)),[_,Ce.floatingTools]),Fe=ye(()=>_.map(l=>({id:l.id,name:l.name||ut(l.id),description:l.description||Ir(l.id),slot:l.slot,icon:l.icon,color:l.color})),[_]),[$e,se]=Et(false),Y=B.openApps.some(l=>!l.minimized);Z(()=>{if(p)return;let l=false,y=setTimeout(async()=>{let h=await Me.getItem(Vi);!l&&!h&&se(true)},1e3);return()=>{l=true,clearTimeout(y)}},[p]);let le=Ue(()=>{se(false),Me.setItem(Vi,"true")},[]),pe=Ue(()=>{le(),w(true)},[le]),ze=Ue(()=>{w(false),F(false)},[]),je=Ue(()=>{F(l=>!l)},[]),Se=Ue(()=>F(false),[]),Ae=!!(o?.length&&i),Be=Ce.floatingTools.environment!==false,ne=$e&&!k&&!Y&&!I;Z(()=>{if(!ne)return;let l=r(h=>{(!(h.target instanceof Element)||!h.target.closest("[data-buoy-root]"))&&le()},"onPointerDown"),y=r(h=>{h.key==="Escape"&&le()},"onKeyDown");return document.addEventListener("pointerdown",l,true),document.addEventListener("keydown",y),()=>{document.removeEventListener("pointerdown",l,true),document.removeEventListener("keydown",y)}},[ne,le]);let De=B.openApps.some(l=>l.minimized&&l.launchMode!=="toggle-only"),He=L(Oi,{modules:a,apps:n,requiredEnvVars:u,externalSync:s,headless:g,sentryGetClient:d});return g?He:lt("div",{"data-buoy-root":"",style:{display:"contents"},children:[He,L(Yi,{}),ne&&L("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),L("div",{style:I?{visibility:"hidden"}:{display:"contents"},"aria-hidden":I||void 0,children:lt(Bo,{enablePositionPersistence:!ne,pushToSide:k||Y,suspendPointerEvents:k,centerOnboarding:ne,minimizedStack:De?L(ni,{}):void 0,hasMinimizedStack:De,children:[E&&Be&&!Ae&&L(Cr,{environment:E}),Ae&&Be&&L(kr,{currentEnvironment:E??"local",availableEnvironments:o,onSelect:i}),t?L(Do,{userRole:t,onPress:pe}):L("button",{"aria-label":"Open dev tools",onClick:pe,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:L(qi,{})}),ke.map(l=>L("button",{"aria-label":l.name||ut(l.id),title:l.description,onClick:()=>me(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))]})}),ne&&L(Lt,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:le}),k&&!I&&L(Ht,{icons:N,onClose:ze,centerLabel:"BUOY",onCenterPress:je,settingsOpen:C,hintsDisabled:p}),C&&!I&&L(Xt,{visible:true,onClose:Se,availableTools:Fe,defaultFloatingTools:f,defaultDialTools:R,onSettingsChange:l=>{}}),!I&&lt(So,{children:[L(Nn,{}),L(dr,{})]})]})}r(Qi,"FloatingDevToolsInner");function er(e){let t=e&&typeof e=="object"?e.appId:void 0,o=!!e;Z(()=>{if(!o)return;let i=false,n=ur.SessionManager;if(!n)return;let a=r(s=>{i||!s||(n.configure({audience:`app:${s}`}),n.load().catch(()=>{}))},"apply");return t?a(t):br().then(s=>a(s?.bundleId)).catch(()=>{}),()=>{i=true}},[o,t])}r(er,"useCapacitorSignInAudience");var tr=false;function or(e){return e.modules?e:(!bl&&!tr&&typeof console<"u"&&(tr=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:yl})}r(or,"withInstalledTools");function nr(e){return L(cr,{children:L(ir,{...or(e)})})}r(nr,"FloatingDevTools");function ir(e){let{access:t,isPro:o,licenseKey:i}=mr();Z(()=>{pr.configure(e.licenseKey)},[e.licenseKey]);let n=e.licenseKey===void 0||gr(e.licenseKey,i),a=fr(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),s=n&&t.status==="admitted";Z(()=>{s&&xr()},[s]),Z(()=>{a||t.status==="initializing"||(o&&s?sr():lr())},[a,o,s,t.status]);let u=yr();return er(u?e.signIn:void 0),!a&&!o?!e.signIn||e.headless?null:u?L(bo,{needsPlan:true}):L(Wi,{}):s?L(Gi,{...e}):lt(So,{children:[t.status==="initializing"&&L(Ji,{modules:e.modules}),e.headless?null:e.signIn&&u?L(bo,{}):L(vr,{})]})}r(ir,"FloatingDevToolsContent");export{zr as a,zo as b,Ot as c,mt as d,Ao as e,Bo as f,Ar as g,Do as h,Ht as i,Xt as j,Qt as k,Rn as l,Pn as m,Hn as n,rt as o,Nn as p,Je as q,so as r,At as s,lo as t,Ei as u,nr as v};
10
+ `,document.head.appendChild(e),Jo=true}r(Yo,"injectOnboardingKeyframes");var Pt=Ke.accent;function Lt({title:e,message:t,onDismiss:o,showArrow:i=true}){let[n,a]=Ko(false),[s,u]=Ko(false);Zr(()=>{Yo();let p=requestAnimationFrame(()=>a(true));return()=>cancelAnimationFrame(p)},[]);let d={fontFamily:qo,textTransform:"uppercase"};return Ve("div",{style:{position:"fixed",left:"50%",bottom:ta(),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:Go("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ve("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),Go("div",{style:{position:"relative",maxWidth:280,backgroundColor:Ke.dialBackground,borderRadius:16,border:`1px solid ${Ke.dialBorder}`,padding:20,boxShadow:`0 0 20px ${Vo(Ke.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ve("span",{style:{...d,fontSize:16,fontWeight:900,letterSpacing:1,color:Pt,textAlign:"center"},children:e}),Ve("span",{style:{fontFamily:qo,fontSize:13,lineHeight:"20px",color:Ke.centerText,textAlign:"center"},children:t}),Ve("button",{onClick:o,onPointerDown:()=>u(true),onPointerUp:()=>u(false),onPointerLeave:()=>u(false),onPointerCancel:()=>u(false),style:{...d,marginTop:8,borderRadius:8,border:"none",backgroundColor:Pt,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:s?.7:1,transform:s?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),i&&Ve("div",{style:{position:"absolute",left:"50%",bottom:Qr,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${ea}px solid ${Pt}`,filter:`drop-shadow(0 0 10px ${Vo(Ke.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}r(Lt,"OnboardingTooltip");import{Fragment as oa,jsx as P,jsxs as ve}from"react/jsx-runtime";var na={x:.5,y:.5},Xo="@react_buoy_settings_tooltip_shown",Zo=false;function Qo(){if(Zo||typeof document>"u")return;let e=document.createElement("style");e.textContent=Pr(),document.head.appendChild(e),Zo=true}r(Qo,"injectKeyframes");var qe=r(e=>1-Math.pow(1-e,3),"easeOutCubic"),Ft=r(e=>e*e*e,"easeInCubic");function en({icon:e,index:t,totalIcons:o,position:i,progress:n,onPress:a}){let[s,u]=Q(false),[d,p]=Q(false),g=!e.icon&&e.id.startsWith("empty-"),I=!g&&e.unavailable===true,f=!g&&!I,{icons:z}=Eo,T=Er(t,o),M=0;n<=T[1]?M=0:n<=T[2]?M=(n-T[1])/(T[2]-T[1]):M=1,M=Math.max(0,Math.min(1,M));let D=Or,E=z.pressIn.scale,R=M*(d?E:s?1.1:1),k=0;M<=0?k=0:M<=.3?k=M:k=.3+(M-.3)*(.7/.7);let w=i.x*M,C=i.y*M;return P("button",{role:"menuitem","aria-label":g?"Empty slot":Mo(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!f,tabIndex:f?0:-1,onClick:f?a:void 0,onPointerEnter:F=>f&&F.pointerType==="mouse"&&u(true),onPointerLeave:()=>{u(false),p(false)},onPointerDown:()=>f&&p(true),onPointerUp:()=>p(false),onPointerCancel:()=>p(false),style:{position:"absolute",left:"50%",top:"50%",width:D,height:D,marginLeft:-D/2,marginTop:-D/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:f?"pointer":"default",transform:`translate(${w}px, ${C}px) scale(${R})`,opacity:k,transition:s||d?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:g?P("div",{style:{width:x.emptySlot.dotSize,height:x.emptySlot.dotSize,borderRadius:x.emptySlot.dotSize/2,backgroundColor:$.emptyDotBackground,border:`${x.emptySlot.borderWidth}px solid ${$.emptyDotBorder}`}}):ve(oa,{children:[P("div",{style:{position:"absolute",width:`${x.icon.gradientBgSizePercent}%`,height:`${x.icon.gradientBgSizePercent}%`,borderRadius:x.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:x.icon.gradientBgOpacity}}),P("div",{style:{position:"absolute",width:`${x.icon.innerGlowSizePercent}%`,height:`${x.icon.innerGlowSizePercent}%`,borderRadius:x.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:x.icon.innerGlowOpacity}}),P("div",{style:{marginBottom:x.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:s?"brightness(1.2)":"none"},children:e.icon}),P("span",{style:{fontSize:e.name.length>8?Math.max(x.icon.label.fontSize*.7,x.icon.label.fontSize*8/e.name.length):x.icon.label.fontSize,fontWeight:x.icon.label.fontWeight,fontFamily:x.icon.label.fontFamily,color:$.iconLabel,letterSpacing:x.icon.label.letterSpacing,marginTop:x.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),I&&P("span",{style:{fontSize:x.icon.label.fontSize-1,fontWeight:x.icon.label.fontWeight,fontFamily:x.icon.label.fontFamily,letterSpacing:x.icon.label.letterSpacing,color:Fr.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}r(en,"DialIconItem");function $t({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,i,n,a],s)=>P("line",{x1:o,y1:i,x2:n,y2:a,stroke:t,strokeWidth:2},s))})}r($t,"PagerChevron");function jt({side:e,disabled:t,onClick:o}){let[i,n]=Q(false),a=t?$.emptyDotBorder:$.accent;return ve("button",{type:"button","aria-label":`${e==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${e}`,disabled:t,onClick:o,onPointerDown:()=>!t&&n(true),onPointerUp:()=>n(false),onPointerLeave:()=>n(false),onPointerCancel:()=>n(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${$.dialBorder}`,backgroundColor:$.dialBackground,color:t?$.iconLabelMuted:$.centerText,fontSize:12,fontWeight:900,fontFamily:Lo,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${Oo($.dialShadow,.4)}`,transform:i?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&P($t,{side:"prev",color:a}),e==="prev"?"PREV":"NEXT",e==="next"&&P($t,{side:"next",color:a})]})}r(jt,"PagerButton");function Ht({icons:e,onClose:t,centerLabel:o="MENU",onCenterPress:i,settingsOpen:n=false,hintsDisabled:a=false}){let{id:s}=jr(),[u,d]=Q(0),[p,g]=Q(0),[I,f]=Q(0),[z,T]=Q(0),[M,D]=Q(0),[E,R]=Q(1),[k,w]=Q(false),[C,F]=Q(false),[A,B]=Q(false),ee=ft(null),_=ft(null),G=ft(null),te=ft(false),{entrance:V,exit:ae,interaction:oe}=Eo,me=Lr(),[ge,fe]=Q(()=>({width:window.innerWidth,height:window.innerHeight}));Ee(()=>{let y=r(()=>fe({width:window.innerWidth,height:window.innerHeight}),"resize");return window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);let N=gt(()=>Dr({screenWidth:ge.width,maxCircleSize:Math.max(120,Math.min(320,ge.height-96))}),[ge]),Ce=gt(()=>Mr(),[]),ke=gt(()=>Rr(Xe,N.iconRadius),[N.iconRadius]),[Fe,$e]=Q(0),se=Math.max(1,Math.ceil(e.length/Xe)),Y=Math.min(Fe,se-1),le=gt(()=>{let y=Y*Xe,h=[...e.slice(y,y+Xe)];for(;h.length<Xe;)h.push({id:`empty-${h.length}`,name:"",icon:null,onPress:r(()=>{},"onPress")});return h},[e,Y]);Ee(()=>{Qo()},[]),Ee(()=>{let y=V.backdrop.duration,h=V.dial.rotation.duration,J=V.centerButton.delay,W=V.icons.delay,U=V.icons.duration,q=performance.now(),ie=r(he=>{let c=he-q;d(Math.min(1,c/y));let b=Math.min(1,c/400),O=qe(b)*1.1;b>.7&&(O-=(b-.7)*.33),b>=1&&(O=1),g(Math.max(0,Math.min(1.05,O)));let X=Math.min(1,c/h);if(f(qe(X)*360),c>=J){let xe=Math.min(1,(c-J)/300),Ne=qe(xe)*1.15;xe>.6&&(Ne-=(xe-.6)*.375),xe>=1&&(Ne=1),T(Math.max(0,Math.min(1.05,Ne)))}if(c>=W){let xe=Math.min(1,(c-W)/U);D(qe(xe))}let we=W+U;c<we?G.current=requestAnimationFrame(ie):(d(1),g(1),f(360),T(1),D(1),B(true))},"animate");return G.current=requestAnimationFrame(ie),()=>{G.current&&cancelAnimationFrame(G.current)}},[]);let pe=ht(()=>{if(te.current)return;te.current=true,F(true),G.current&&cancelAnimationFrame(G.current);let y=performance.now(),h=ae.icons.duration,J=ae.centerButton.duration,W=ae.dialScale.duration,U=Math.max(J,W),q=ae.backdrop.duration,ie=r(he=>{let c=he-y;if(c<h){let X=Ft(c/h);D(1-X),G.current=requestAnimationFrame(ie);return}let b=h;if(c<b+U){D(0);let X=Math.min(1,(c-b)/J),we=Math.min(1,(c-b)/W);T(1-Ft(X)),g(1-Ft(we)),G.current=requestAnimationFrame(ie);return}let O=b+U;if(c<O+q){g(0),T(0);let X=(c-O)/q;d(1-X),G.current=requestAnimationFrame(ie);return}d(0),t()},"animate");G.current=requestAnimationFrame(ie)},[ae,t]);Ee(()=>{let y=document.activeElement,h=ee.current;return()=>{y?.isConnected&&(document.activeElement===document.body||h?.contains(document.activeElement))&&y.focus()}},[]),Ee(()=>{if(n)return;_.current?.focus();let y=r(h=>{let J=ee.current;if(J){if(h.key==="Escape")h.preventDefault(),pe();else if(h.key==="Tab"){let W=Array.from(J.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(ie=>ie.getClientRects().length>0),U=W[0],q=W[W.length-1];(!J.contains(document.activeElement)||(h.shiftKey?document.activeElement===U:document.activeElement===q))&&(h.preventDefault(),(h.shiftKey?q:U)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(h.key)){let W=Array.from(J.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),U=W.indexOf(document.activeElement);if(U<0||!W.length)return;h.preventDefault();let q=h.key==="Home"?0:h.key==="End"?W.length-1:(U+(h.key==="ArrowRight"||h.key==="ArrowDown"?1:-1)+W.length)%W.length;W[q].focus()}}},"handleKeyDown");return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[pe,n]);let[ze,je]=Q(false);Ee(()=>{if(a)return;let y=false,h=setTimeout(async()=>{let J=await Po.getItem(Xo);!y&&!J&&je(true)},1200);return()=>{y=true,clearTimeout(h)}},[a]);let Se=ht(()=>{je(false),Po.setItem(Xo,"true")},[]);Ee(()=>{n&&ze&&Se()},[n,ze,Se]);let Ae=ht(y=>{if(y.id.startsWith("empty-")||te.current)return;let[h,J]=oe.iconSelect.pulse,W=performance.now(),U=150,q=r(ie=>{let he=ie-W;if(he<U){let c=qe(he/U);R(1-(1-h.scale)*c),requestAnimationFrame(q)}else if(he<U*2){let c=qe((he-U)/U);R(h.scale+(J.scale-h.scale)*c),requestAnimationFrame(q)}else R(1)},"animatePulse");requestAnimationFrame(q),setTimeout(()=>{y.onPress(),pe()},oe.iconSelect.actionDelay)},[oe.iconSelect,pe]),Be=ht(y=>{if(te.current)return;let h=Math.max(0,Math.min(y,se-1));h!==Y&&$e(h)},[se,Y]),ne=N.buttonSize*x.centerButton.containerRatio,De=N.buttonSize*x.centerButton.borderRatio,He=N.buttonSize*x.centerButton.containerRatio/2+6,l=A&&!C;return ve("div",{ref:ee,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:$.dialBackdrop,opacity:u}}),ve("div",{style:{position:"absolute",left:"50%",marginLeft:-N.circleSize/2,bottom:80,width:N.circleSize,height:N.circleSize,borderRadius:"50%",backgroundColor:$.dialBackground,border:`${x.circle.borderWidth}px solid ${$.dialBorder}`,boxShadow:`0 0 ${x.circle.shadowRadius}px ${Oo($.dialShadow,x.circle.shadowOpacity)}`,transform:`scale(${p}) rotate(${I}deg)`,opacity:p>.01?1:0,overflow:"hidden"},children:[P("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:$.dialGradient1,opacity:x.gradientLayers[0].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:$.dialGradient2,opacity:x.gradientLayers[1].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:$.dialGradient3,opacity:x.gradientLayers[2].opacity}}),Ce.map(y=>P("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:x.grid.lineHeight,transform:`rotate(${y}deg)`,transformOrigin:"center"},children:["left","right"].map(h=>P("div",{style:{position:"absolute",top:0,[h]:0,width:`calc(50% - ${He}px)`,height:x.grid.lineHeight,backgroundColor:$.dialGridLine}},h))},y)),P("div",{"data-testid":"dial-background","data-background":s,style:{position:"absolute",inset:0,pointerEvents:"none"},children:s==="hyperspace"?P(Xr,{size:N.circleSize}):P($r,{focus:na})}),le.map((y,h)=>P(en,{icon:y,index:h,totalIcons:le.length,position:ke[h],progress:M,onPress:()=>Ae(y)},h)),ve("div",{style:{position:"absolute",left:"50%",top:"50%",width:ne,height:ne,marginLeft:-ne/2,marginTop:-ne/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:$.hubHalo,borderRadius:N.buttonSize,overflow:"hidden",transform:`scale(${z*E})`,opacity:z>.01?1:0},children:[P("div",{style:{position:"absolute",inset:0,backgroundColor:$.dialGradient1,opacity:.5,borderRadius:N.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:$.dialGradient2,opacity:.3,borderRadius:N.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:$.dialGradient3,opacity:.2,borderRadius:N.buttonSize}}),P("div",{style:{width:De,height:De,borderRadius:N.buttonSize*x.centerButton.borderRadiusRatio,backgroundColor:$.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:P("button",{ref:_,type:"button","aria-label":n?"Close Settings":"Open Dev Tools Settings",disabled:!i,onClick:i,onPointerEnter:y=>y.pointerType==="mouse"&&w(true),onPointerLeave:()=>w(false),style:{border:0,padding:0,background:"transparent",width:N.buttonSize,height:N.buttonSize,borderRadius:N.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:i?"pointer":"default",transform:k?`scale(${oe.centerHover.scale})`:"scale(1)",transition:`transform ${oe.centerHover.duration}ms ease`,animation:l&&!k?me.pulse:"none"},children:n?ve("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:x.centerButton.text.fontSize-2,fontWeight:x.centerButton.text.fontWeight,fontFamily:x.centerButton.text.fontFamily,color:$.centerText,letterSpacing:x.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.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:x.centerButton.text.fontSize,fontWeight:x.centerButton.text.fontWeight,fontFamily:x.centerButton.text.fontFamily,color:$.centerText,letterSpacing:x.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase"},children:o})})})]})]}),se>1&&ve("div",{style:{position:"absolute",left:"50%",marginLeft:-N.circleSize/2,top:"calc(100% - 64px)",width:N.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,p),transform:`scale(${Math.min(1,p)})`},children:[P(jt,{side:"prev",disabled:Y<=0,onClick:()=>Be(Y-1)}),ve("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:Lo,letterSpacing:2,color:$.centerText,textShadow:`0 0 6px ${$.centerTextGlow}`},children:[String(Y+1).padStart(2,"0"),ve("span",{style:{color:$.iconLabelMuted,textShadow:"none"},children:[" / ",String(se).padStart(2,"0")]})]}),P(jt,{side:"next",disabled:Y>=se-1,onClick:()=>Be(Y+1)})]}),ze&&!n&&P(Lt,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:Se,showArrow:false})]})}r(Ht,"DialMenu");import{persistentStorage as tn,devToolsStorageKeys as ia}from"@buoy-gg/shared-ui/web";import{recordUsage as ra,pruneUsage as aa}from"@buoy-gg/floating-tools-core/web";var on=ia.dial.usage(),Ge={},nn=false,Nt=null;function Wt(){return Nt||(Nt=(async()=>{try{let e=await tn.getItem(on);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(Ge=t)}}catch{}finally{nn=true}})(),Nt)}r(Wt,"loadDialUsage");Wt();function rn(e){return e.map((t,o)=>({id:t,index:o,lastUsed:Ge[t]?.lastUsed??0})).sort((t,o)=>o.lastUsed-t.lastUsed||t.index-o.index).map(({id:t})=>t)}r(rn,"getRankedToolIds");async function an(e){if(!e)return;nn||await Wt();let t=Math.max(Date.now(),...Object.values(Ge).map(o=>o.lastUsed+1));Ge=aa(ra(Ge,e,t),t);try{await tn.setItem(on,JSON.stringify(Ge))}catch{}}r(an,"recordToolUsage");import{useCallback as sa,useMemo as sn}from"react";import{persistentStorage as la}from"@buoy-gg/shared-ui/web";import{useState as re,useEffect as Te,useCallback as bt,useMemo as vt}from"react";import{settingsEventBus as St}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as ca}from"react";import{getRegisteredToolModule as da}from"@buoy-gg/shared-ui/web";var ua=r(()=>()=>{},"noopSubscribe"),pa=r(()=>null,"serverSnapshot");function ln(){let e=da("@buoy-gg/external-sync");return ca(e?.subscribeSyncStatus??ua,()=>e?.getSyncStatus?.()??null,pa)}r(ln,"useDesktopSyncStatus");import{SentryIcon as ma,WifiCircuitIcon as ga,ImageOverlayIcon as fa,RenderCountIcon as ha,Info as _t,Layers as ya,ChevronRightIcon as cn,ChevronDown as dn,getStorageBackendType as ba,getUseLicense as va,signOutOfBuoy as Sa,persistentStorage as Oe,Trash2 as wa,CheckCircle2 as un,BuoyUpgradeSheet as xa,BackgroundSwitcher as Ta,night as v,NightCard as Pe,NightRows as Ut,NightSectionLabel as Ia,NightFootnote as pn,NightSwitch as mn,NightButton as Kt,NightSegmented as Ca,NightBadge as be,NightSeparator as ka,monoFont as gn}from"@buoy-gg/shared-ui/web";import{EnvIcon as fn,StorageIcon as za,RoutesIcon as Aa,NetworkIcon as Ba,QueryIcon as Da,HighlighterIcon as Ra,ReduxIcon as Ma,EventsIcon as Ea}from"@buoy-gg/floating-tools-core/web";import Oa,{createContext as Pa,useContext as La}from"react";import{jsx as Fa}from"react/jsx-runtime";var hn=Pa({});function Vt({children:e,defaultFloatingTools:t,defaultDialTools:o}){let i=Oa.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:o}),[t,o]);return Fa(hn.Provider,{value:i,children:e})}r(Vt,"DefaultConfigProvider");function qt(){return La(hn)}r(qt,"useDefaultConfig");import $a from"react";import{toolTheme as ja}from"@buoy-gg/shared-ui/web";import{jsx as yn}from"react/jsx-runtime";function bn({label:e,size:t,color:o=ja.colors.text}){let i=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),n=i<=2?t:t*1.6,a=Math.max(7,Math.min(t*(i===1?.7:.62),n/(.62*i)));return yn("span",{style:{display:"inline-flex",minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center",color:o,fontSize:a,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}r(bn,"AppTextIcon");function Gt(e,t){return e==null?e:typeof e=="function"?$a.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?yn(bn,{label:String(e),size:t.size,color:t.color}):e}r(Gt,"renderAppIcon");import{JsModal as Ha,devToolsStorageKeys as Jt,onSettingsApplied as Na,expandableWindowControlsSupported as Wa}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as _a}from"@buoy-gg/shared-ui/web";import{Fragment as Qe,jsx as m,jsxs as j}from"react/jsx-runtime";var et="@react_buoy_dev_tools_settings",Ua=6,wt=r(e=>{let t=Ua,o={};for(let[i,n]of Object.entries(e))n&&t>0?(o[i]=true,t-=1):o[i]=false;return o},"enforceDialLimit"),Ka=r((e,t)=>{let{userStatus:o,environment:i,...n}=e,a=t?Object.entries(n).filter(([s])=>t.includes(s)):Object.entries(n);return{...Object.fromEntries(a),environment:i??false}},"sanitizeFloating"),vn=r((e,t,o)=>{if(!t)return e;let i={...e.dialTools,...t.dialTools??{}},n=o?.allowedDialKeys?Object.entries(i).filter(([a])=>o.allowedDialKeys?.includes(a)):Object.entries(i);return{dialTools:wt(Object.fromEntries(n)),floatingTools:Ka({...e.floatingTools,...t.floatingTools??{}},o?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},"mergeWithDefaults"),Va=r((e=[],t,o)=>{let i={},n={},a=new Set(t??[]),s=new Set(o??[]),u=!o||o.length===0;for(let d of e){let{id:p,slot:g="both"}=d;(g==="dial"||g==="both")&&(i[p]=u?true:s.has(p)),(g==="row"||g==="both")&&(n[p]=a.has(p))}return{dialTools:wt(i),floatingTools:{...n,environment:a.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},"generateDefaultSettings"),qa=r(({visible:e,onClose:t,onSettingsChange:o,initialSettings:i,availableApps:n=[],storage:a=Oe,zIndex:s})=>{let{defaultFloatingTools:u,defaultDialTools:d}=qt(),p=vt(()=>Va(n,u,d),[n,u,d]),g=vt(()=>Object.keys(p.dialTools),[p]),I=vt(()=>Object.keys(p.floatingTools).filter(c=>c!=="environment"),[p]),[f,z]=re(i||tt||p),[T,M]=re(Yt??"floating"),[D,E]=re(Yt!==null),[R,k]=re(new Set),[w,C]=re(false),[F,A]=re(false);Te(()=>{let c=requestAnimationFrame(()=>A(true));return()=>cancelAnimationFrame(c)},[]);let B=ln();Te(()=>{r(async()=>{try{let c=await Oe.getItem(Jt.settings.activeTab());if(c&&["floating","settings","pro"].includes(c)){let b=c;Yt=b,M(O=>O===b?O:b)}}catch{}finally{E(true)}},"loadActiveTab")()},[]),Te(()=>{D&&Oe.setItem(Jt.settings.activeTab(),T).catch(c=>{console.warn("[Buoy]","Failed to save settings active tab:",c)})},[T,D]);let ee=va()?.(),_=ee?.isPro??false,G=!_&&ee?.licenseKey?ee.error:null,te=ee?.errorKind==="transport",[V,ae]=re(Sn),[oe,me]=re(false),[ge,fe]=re(false),[N,Ce]=re(false),[ke,Fe]=re([]),[$e,se]=re(false),Y=_a(),le=xo.get("window").height,pe=xo.get("window").width,ze=Math.floor(le*.33),je=Math.min(pe-32,400),Se=bt(async()=>{try{let c=await a.getItem(et);if(c){let b=JSON.parse(c),O=vn(p,b,{allowedDialKeys:g,allowedFloatingKeys:I});tt=O,z(X=>wn(X,O)?X:O);return}tt=p,z(b=>wn(b,p)?b:p)}catch(c){console.error("[Buoy]","Failed to load dev tools settings:",c),z(p)}},[p,g,I,a]);Te(()=>{Se()},[Se]),Te(()=>{ba().then(c=>{Sn=c,ae(b=>b===c?b:c)})},[]),Te(()=>{N&&(se(true),Oe.getAllKeys().then(c=>{Fe(c.sort())}).catch(()=>{Fe([])}).finally(()=>{se(false)}))},[N]);let Ae=r(async c=>{try{let b={...c,dialTools:wt(c.dialTools)};await a.setItem(et,JSON.stringify(b)),tt=b,z(b),o?.(b),St.emit(b)}catch(b){console.error("[Buoy]","Failed to save dev tools settings:",b)}},"saveSettings"),Be=r(c=>{let b={...f,floatingTools:{...f.floatingTools,[c]:!f.floatingTools[c]}};Ae(b)},"toggleFloatingTool"),ne=r(c=>{let b={...f,globalSettings:{...f.globalSettings,[c]:!f.globalSettings?.[c]}};Ae(b)},"toggleGlobalSetting"),De=r(async()=>{me(true),fe(false);try{await Oe.clear(),fe(true),z(p),a!==Oe&&await a.setItem(et,JSON.stringify(p)),o?.(p),St.emit(p),setTimeout(()=>fe(false),2e3)}catch(c){console.error("[Buoy]","Failed to clear storage:",c)}finally{me(false)}},"handleClearStorage"),He=bt(c=>{},[]),l=r(c=>{let b=n.find(O=>O.id===c);return b?.description?b.description:c==="environment"?"Environment badge.":""},"getToolDescription"),y=r(c=>c==="environment"?"Env Badge":n.find(b=>b.id===c)?.name??c.toUpperCase().replace(/_/g," "),"getToolLabel"),h=r(c=>{if(!F)return null;switch(c){case"query":return m(Da,{size:18});case"env":return m(fn,{size:18});case"sentry":return m(ma,{size:18,color:"#9945FF"});case"storage":return m(za,{size:18,bgColor:v.color.surface});case"wifi":case"query-wifi-toggle":return m(ga,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return m(Aa,{size:18,bgColor:v.color.surface});case"network":return m(Ba,{size:18});case"environment":return m(fn,{size:18});case"debug-borders":return m(ya,{size:18,color:v.color.accent});case"highlight-updates":return m(ha,{size:18,color:v.color.accent});case"highlight-updates-modal":return m(Ra,{size:18});case"redux":return m(Ma,{size:18});case"image-overlay":return m(fa,{size:18});case"events":return m(Ea,{size:18});case"zustand":try{let{ZustandIcon:b}=To("@buoy-gg/zustand/web");return m(b,{size:18})}catch{return m(_t,{size:18,color:v.color.textSecondary})}case"jotai":try{let{JotaiIcon:b}=To("@buoy-gg/jotai/web");return m(b,{size:18})}catch{return m(_t,{size:18,color:v.color.textSecondary})}default:{let b=n.find(O=>O.id===c);return b?.icon!=null?Gt(b.icon,{slot:"row",size:18,color:b.color}):m(_t,{size:18,color:v.color.textSecondary})}}},"getToolIcon"),J=r((c,b,O,X)=>{let we=l(c);return j(ct,{activeOpacity:O?1:.7,onPress:()=>!O&&X(),accessibilityLabel:y(c),accessibilityRole:"button",style:[S.toolRow,O&&S.rowDisabled],children:[m(H,{style:S.toolIconSlot,children:h(c)}),j(H,{style:S.rowInfo,children:[j(K,{style:S.rowLabel,children:[y(c),O?" \xB7 max 6":""]}),we?m(K,{style:S.rowCaption,numberOfLines:1,children:we}):null]}),m(mn,{value:b,disabled:O,onValueChange:()=>X()})]},c)},"renderToolRow"),W=r(c=>{k(b=>{let O=new Set(b);return O.has(c)?O.delete(c):O.add(c),O})},"toggleSettingExpanded"),U=r((c,b,O,X,we)=>{let xe=f.globalSettings?.[c]??false,Ne=R.has(c);return j(H,{children:[j(ct,{activeOpacity:.7,onPress:()=>W(c),accessibilityLabel:b,style:S.settingRow,children:[j(H,{style:S.rowInfo,children:[m(K,{style:S.rowLabel,children:b}),m(K,{style:S.rowCaption,numberOfLines:Ne?0:1,children:O})]}),m(mn,{value:xe,onValueChange:()=>ne(c)})]}),Ne&&j(H,{style:S.settingRowBody,children:[m(K,{style:S.settingRowBodyText,children:X}),m(K,{style:S.settingRowBodyHint,children:we})]})]},c)},"renderGlobalSettingRow"),q=r((c,b,O)=>j(H,{children:[m(Ia,{children:c}),b,O]}),"renderSection"),ie=V==="filesystem"?m(be,{label:"File System",tone:"accent"}):V==="asyncstorage"?m(be,{label:"Async Storage",tone:"warning"}):V==="localstorage"?m(be,{label:"Local Storage",tone:"accent"}):V==="memory"?m(be,{label:"Memory",tone:"danger"}):m(be,{label:"Loading\u2026",tone:"neutral"}),he=r(()=>j(H,{style:S.container,children:[j(wo,{style:S.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:S.scrollContainer,children:[T==="floating"&&m(Qe,{children:q("Floating Tools",m(Pe,{glass:true,children:m(Ut,{children:Object.entries(f.floatingTools).map(([c,b])=>J(c,b,false,()=>Be(c)))})}),m(pn,{children:"Tools switched on here appear in the floating bubble row."}))}),T==="settings"&&j(Qe,{children:[q("Background",m(Pe,{glass:true,padded:true,children:m(Ta,{embedded:true})})),q("Storage",j(Pe,{glass:true,children:[j(ct,{activeOpacity:.7,onPress:()=>Ce(!N),accessibilityLabel:"Storage Type",style:S.settingRow,children:[m(H,{style:S.rowInfo,children:m(K,{style:S.rowLabel,children:"Storage Type"})}),ie,N?m(dn,{size:16,color:v.color.textTertiary}):m(cn,{size:16,color:v.color.textTertiary})]}),N&&j(Qe,{children:[j(H,{style:S.settingRowBody,children:[m(K,{style:S.settingRowBodyText,children:V==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":V==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":V==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":V==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),V==="asyncstorage"&&m(K,{style:[S.settingRowBodyText,S.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),V==="memory"&&m(K,{style:[S.settingRowBodyText,S.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),m(ka,{}),j(H,{style:S.storageExpanded,children:[j(H,{style:S.storageExpandedHeader,children:[m(K,{style:S.storageExpandedTitle,children:"SAVED SETTINGS"}),m(K,{style:S.storageExpandedCount,children:$e?"\u2026":`${ke.length} keys`})]}),$e?m(K,{style:S.storageKeyEmpty,children:"Loading\u2026"}):ke.length===0?m(K,{style:S.storageKeyEmpty,children:"No settings saved yet"}):m(wo,{style:S.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:ke.map(c=>m(H,{style:S.storageKeyItem,children:m(K,{style:S.storageKeyText,numberOfLines:1,children:c.replace("@react_buoy_","")})},c))})]}),m(H,{style:S.cardButtonWrap,children:m(Kt,{label:ge?"Cleared":oe?"Clearing\u2026":"Clear All Settings",variant:ge?"secondary":"destructive",size:"md",disabled:oe,onPress:De,icon:ge?m(un,{size:15,color:v.color.accent}):m(wa,{size:15,color:oe?v.color.textTertiary:v.color.danger})})})]})]})),B&&B.state!=="idle"&&q("Desktop Sync",j(Pe,{glass:true,children:[j(ct,{activeOpacity:.7,onPress:()=>W("desktopSync"),accessibilityLabel:"Buoy Desktop",style:S.settingRow,children:[m(H,{style:S.rowInfo,children:m(K,{style:S.rowLabel,children:"Buoy Desktop"})}),B.state==="connected"?m(be,{label:"Connected",tone:"accent"}):B.state==="connecting"?m(be,{label:"Connecting\u2026",tone:"neutral"}):m(be,{label:"Retrying",tone:"warning"}),R.has("desktopSync")?m(dn,{size:16,color:v.color.textTertiary}):m(cn,{size:16,color:v.color.textTertiary})]}),R.has("desktopSync")&&j(H,{style:S.settingRowBody,children:[j(K,{style:S.settingRowBodyText,children:[B.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",m(K,{style:S.footnoteMono,children:B.targetURL??"(unknown URL)"}),B.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),B.state==="retrying"&&B.lastError&&j(K,{style:[S.settingRowBodyText,S.bodyWarning],children:["Last error: ",B.lastError]})]})]})),q("Modal Behavior",m(Pe,{glass:true,children:j(Ut,{children:[U("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),Wa(We.OS==="web")?U("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),T==="pro"&&j(Qe,{children:[q("License",j(Pe,{glass:true,children:[j(H,{style:S.settingRow,children:[m(H,{style:S.rowInfo,children:m(K,{style:S.rowLabel,children:"License Status"})}),m(H,{testID:"buoy-settings-license-status",accessibilityLabel:_?"License: Active":"License: Free",children:_?m(be,{label:"Active",tone:"accent"}):m(be,{label:"Free",tone:"neutral"})})]}),ee?.tierSource==="session"?j(H,{style:S.settingRow,children:[m(H,{style:S.rowInfo,children:m(K,{style:S.rowLabel,children:"Signed in with Buoy"})}),m(Kt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void Sa(),testID:"buoy-settings-signout"})]}):null]}),m(pn,{children:_?"You have full access to all Buoy DevTools features.":G?te?`Couldn't reach the license server (${G}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${G}.`:"Upgrade to Pro to unlock all features and support development."})),!_&&j(Qe,{children:[q("Pro Features",m(Pe,{glass:true,children:m(Ut,{children:["Advanced Settings","Priority Support"].map(c=>j(H,{style:S.featureRow,children:[m(un,{size:16,color:v.color.accent}),m(K,{style:S.rowLabel,children:c})]},c))})})),m(Kt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>C(true)})]})]})]}),m(xa,{visible:w,onClose:()=>C(false)})]}),"renderContent");return m(Ha,{visible:e,onClose:t,zIndex:s,variant:"night",header:{showToggleButton:false,customContent:m(H,{style:S.headerRow,children:m(Ca,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:T,onChange:c=>M(c)})})},initialMode:"bottomSheet",onModeChange:He,persistenceKey:Jt.settings.root(),enablePersistence:true,maxHeight:le-Y.top,initialHeight:ze,initialFloatingPosition:{x:(pe-je)/2,y:Y.top+20},enableGlitchEffects:true,children:he()})},"DevToolsSettingsModal"),Ga={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},Ja=r((e,t)=>{let o=new Set(e??[]),i=new Set(t??[]),n={};for(let s of i)n[s]=true;let a={environment:o.has("environment")};for(let s of o)s!=="environment"&&(a[s]=true);return{dialTools:wt(n),floatingTools:a,globalSettings:{enableSharedModalDimensions:false}}},"createDefaultsFromConfig"),tt=null,Yt=null,Sn=null,wn=r((e,t)=>JSON.stringify(e)===JSON.stringify(t),"sameSettings");St.addListener(e=>{e&&(tt=e)});var xn=r(()=>{let{defaultFloatingTools:e,defaultDialTools:t}=qt(),o=vt(()=>!e&&!t?Ga:Ja(e,t),[e,t]),[i,n]=re(o),a=bt(async()=>{try{let u=await Oe.getItem(et);if(u){let d=JSON.parse(u),p=vn(o,d);n(p);return}n(o)}catch(u){console.error("[Buoy]","Failed to load dev tools settings:",u),n(o)}},[o]);Te(()=>Na(u=>{u.includes(et)&&a()}),[a]),Te(()=>{a();let u=St.addListener(d=>{try{d&&n(d)}catch{}});return()=>{u()}},[a]);let s=bt(()=>{a()},[a]);return{settings:i,refreshSettings:s}},"useDevToolsSettings"),S=dt.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:v.gutter,paddingRight:v.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:v.gutter,paddingTop:8,paddingBottom:24,gap:v.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:v.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:v.rowPadH,paddingVertical:v.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:v.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:v.color.text,fontSize:v.font.row,fontWeight:"500"},rowCaption:{color:v.color.textTertiary,fontSize:v.font.label},settingRowBody:{paddingHorizontal:v.rowPadH,paddingBottom:v.rowPadV,gap:6},settingRowBodyText:{color:v.color.textSecondary,fontSize:v.font.caption,lineHeight:v.font.caption*1.45},settingRowBodyHint:{color:v.color.textTertiary,fontSize:v.font.caption,lineHeight:v.font.caption*1.45},bodyWarning:{color:v.color.warning},bodyDanger:{color:v.color.danger},cardButtonWrap:{paddingHorizontal:v.cardPad,paddingTop:10,paddingBottom:v.cardPad},storageExpanded:{paddingHorizontal:v.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:v.color.textSecondary,fontSize:v.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:v.color.textTertiary,fontSize:v.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:v.color.glassElevated,borderRadius:v.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:v.color.textSecondary,fontSize:v.font.micro,fontFamily:gn},storageKeyEmpty:{color:v.color.textTertiary,fontSize:v.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:gn,fontSize:v.font.label,color:v.color.textSecondary}});import{jsx as Tn}from"react/jsx-runtime";var Ya=[];function Xt({visible:e,onClose:t,availableTools:o=Ya,defaultFloatingTools:i,defaultDialTools:n,storage:a=la,onSettingsChange:s}){let u=sn(()=>({getItem:r(async g=>a.getItem(g),"getItem"),setItem:r(async(g,I)=>a.setItem(g,I),"setItem")}),[a]),d=sn(()=>o.map(g=>({...g,name:g.name??g.id,icon:typeof g.icon=="function"?I=>g.icon(I.size):g.icon})),[o]),p=sa(g=>{s?.(g)},[s]);return Tn(Vt,{defaultFloatingTools:i,defaultDialTools:n,children:Tn(qa,{visible:e,onClose:t,zIndex:11e3,availableApps:d,storage:u,onSettingsChange:p})})}r(Xt,"SettingsModal");import{listenBuoyKeydown as Xa}from"@buoy-gg/shared-ui/web/floating";import{persistentStorage as In,setExpandableWindowControls as Za}from"@buoy-gg/shared-ui/web";import{createContext as Qa,useCallback as Ie,useContext as es,useEffect as xt,useMemo as ts,useRef as ot,useState as Cn}from"react";var os=r((e,t,o)=>{if(t.singleton){let n=e.find(a=>a.id===t.id);if(n){let a=n.minimized??false;return{instanceId:n.instanceId,wasMinimized:a,apps:[...e.filter(s=>s.instanceId!==n.instanceId),{...n,minimized:false}]}}}let i=o();return{instanceId:i,wasMinimized:false,apps:[...e,{...t,instanceId:i}]}},"resolveOpenAppsState");import{createContext as ns,useCallback as kn,useContext as is,useEffect as Tt,useMemo as rs,useRef as zn,useState as It}from"react";import{JsModal as as,ModalHeader as nt,HeaderSearchButton as ss,TickProvider as ls,ToolScreenHeaderContext as cs,devToolsStorageKeys as An,buoyColors as Bn,gameUIColors as Zt}from"@buoy-gg/shared-ui/web";import{jsx as ce,jsxs as Ct}from"react/jsx-runtime";var it=r(()=>{},"noop"),ds={search:"",isSearchActive:false,clearSearch:it,close:it,minimize:it,showToast:it,setHeaderOverride:it},Dn=ns(null);function Qt(){return is(Dn)??ds}r(Qt,"useToolHost");function Rn(e,t){let{setHeaderOverride:o}=Qt();Tt(()=>(o(e),()=>o(null)),t)}r(Rn,"useToolHeader");var Mn=2200,us={success:Zt.success,error:Zt.error,info:Zt.info};function En({message:e,type:t,nonce:o}){let i=zn(new Re.Value(0)).current;Tt(()=>{i.setValue(0),Re.sequence([Re.timing(i,{toValue:1,duration:150,useNativeDriver:true}),Re.delay(Mn-450),Re.timing(i,{toValue:0,duration:300,useNativeDriver:true})]).start()},[o,i]);let n=us[t];return Ct(Re.View,{pointerEvents:"none",style:[kt.toast,{opacity:i,borderColor:n+"60"}],children:[ce(H,{style:[kt.toastDot,{backgroundColor:n}]}),ce(K,{style:kt.toastText,numberOfLines:2,children:e})]})}r(En,"ToastView");function On({app:e,config:t,visible:o,zIndex:i,onClose:n,onMinimize:a,initialModalState:s,enableSharedModalDimensions:u,bodyProps:d}){let p=e.component,[g,I]=It(false),[f,z]=It(""),[T,M]=It(null),[D,E]=It(null),R=zn(null),k=kn(()=>{I(false),z("")},[]),w=kn((V,ae="info")=>{R.current&&clearTimeout(R.current),E(oe=>({message:V,type:ae,nonce:(oe?.nonce??0)+1})),R.current=setTimeout(()=>E(null),Mn)},[]);Tt(()=>()=>{R.current&&clearTimeout(R.current)},[]);let C=rs(()=>({search:g?f:"",isSearchActive:g,clearSearch:k,close:n,minimize:r(()=>a(),"minimize"),showToast:w,setHeaderOverride:M,instanceId:e.instanceId}),[f,g,k,n,a,w,e.instanceId]),F=T?.title??t.title??e.title??e.id,A=T?.subtitle??t.subtitle,B=T?.onBack,ee=T?.actions??t.headerActions,_=T?.searchable??t.searchable;Tt(()=>{!_&&g&&k()},[_,g,k]);let G=u?An.modal.root():An.custom(e.id).modal(),te=Ct(nt,{children:[B&&!g&&ce(nt.Navigation,{onBack:B}),g?ce(nt.Search,{value:f,onChangeText:z,onCancel:k,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):ce(nt.Content,{title:F,subtitle:A}),Ct(nt.Actions,{children:[!g&&ee,_&&!g&&ce(ss,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>I(true)})]})]});return ce(Dn.Provider,{value:C,children:ce(as,{visible:o,onClose:n,onBack:B,onMinimize:a,initialModalState:s,zIndex:i,persistenceKey:G,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:te,showToggleButton:true},disableScrollWrapper:true,styles:{},children:Ct(H,{style:kt.bodyRoot,children:[ce(ls,{children:ce(cs.Provider,{value:M,children:ce(p,{...d})})}),D&&ce(En,{message:D.message,type:D.type,nonce:D.nonce})]})})})}r(On,"ToolModalShell");var kt=dt.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:Bn.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:Bn.text}});import{useEffect as ps,useRef as ms}from"react";import{capacitorPlatform as gs,capacitorPlugin as fs}from"@buoy-gg/license/web";function Pn(){return globalThis.__BUOY_HOLDS_BACK__===true}r(Pn,"isBuoyHoldingBackButton");var hs=99.5;function Ln(){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}}r(Ln,"ionicHandlesBack");function Fn(e,t){let o=ms(t);o.current=t,ps(()=>{if(!e||gs()!=="android")return;let i=globalThis;i.__BUOY_HOLDS_BACK__=true;let n;if(Ln()){let a=r(s=>{s.detail?.register?.(hs,()=>{o.current()})},"listener");document.addEventListener("ionBackButton",a),n=r(()=>document.removeEventListener("ionBackButton",a),"cleanup")}else{let a=fs("App");if(!a?.addListener){i.__BUOY_HOLDS_BACK__=false;return}let s=false,u=null;Promise.resolve(a.addListener("backButton",()=>o.current())).then(d=>{s?d.remove():u=d}).catch(()=>{}),n=r(()=>{s=true,u&&u.remove()},"cleanup")}return()=>{n(),i.__BUOY_HOLDS_BACK__=false}},[e])}r(Fn,"useCapacitorBackButton");import{Fragment as ys,jsx as de}from"react/jsx-runtime";var $n=Qa(null),jn="@react_buoy_open_apps",eo=44,bs=12,vs=100,Ss=16,ws=r(e=>({x:window.innerWidth-eo-Ss,y:window.innerHeight-vs-eo-e*(eo+bs)}),"dockIconPosition"),Hn=r(({children:e})=>{let[t,o]=Cn([]),[i,n]=Cn(false),a=ot([]),s=ot(null),u=ot(false),d=ot(false),p=ot(false),g=Ie(w=>{let C="";return o(F=>{let{apps:A,instanceId:B}=os(F,w,()=>`${w.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return C=B,A}),C},[]),I=Ie(()=>{if(u.current||!d.current||!p.current)return;u.current=true;let w=s.current;if(!w||w.length===0){n(true);return}s.current=null,w.forEach(({id:C,minimized:F})=>{let A=a.current.find(B=>B.id===C);if(A&&A.component){let B=Gt(A.icon,{slot:"dial",size:20,color:A.color});g({id:A.id,title:A.name,component:A.component,props:A.props,modal:A.modal,launchMode:A.launchMode||"self-modal",singleton:A.singleton??true,icon:B,color:A.color,minimized:F})}}),n(true)},[g]);xt(()=>{let w=false;return r(async()=>{try{let C=await In.getItem(jn);if(w)return;if(C){let F=JSON.parse(C),A;Array.isArray(F)&&F.length>0&&(typeof F[0]=="string"?A=F.map(B=>({id:B,minimized:false})):A=F.filter(B=>typeof B=="object"&&B!==null&&typeof B.id=="string"),A.length&&(s.current=A))}}catch{}w||(d.current=true,I())},"restoreOpenApps")(),()=>{w=true}},[I]),xt(()=>{if(!i)return;let w=t.map(C=>({id:C.id,minimized:C.minimized??false}));In.setItem(jn,JSON.stringify(w))},[t,i]);let f=Ie(w=>{a.current=w,p.current=true,I()},[I]),z=Ie(w=>{o(C=>C.length?w?C.filter(F=>F.instanceId!==w):C.slice(0,-1):C)},[]),T=Ie(()=>o([]),[]),M=Ie((w,C)=>{o(F=>F.map(A=>A.instanceId===w?{...A,minimized:true,restoreState:C}:A))},[]),D=Ie((w,C)=>{o(F=>F.map(A=>A.instanceId===w?{...A,minimized:false,restoreState:C??A.restoreState}:A))},[]),E=Ie(w=>t.find(C=>C.instanceId===w)?.minimized??false,[t]),R=t.some(w=>w.launchMode!=="toggle-only"&&!w.minimized);xt(()=>R?Xa(r(w=>{if(w.key!=="Escape"||w.defaultPrevented)return;let C=[...t].reverse().find(F=>F.launchMode!=="toggle-only"&&!F.minimized);C&&z(C.instanceId)},"handler")):void 0,[R,z,t]),Fn(t.length>0,()=>z());let k=ts(()=>({openApps:t,isAnyOpen:R,open:g,close:z,closeAll:T,registerApps:f,minimize:M,restore:D,isMinimized:E}),[t,R,g,z,T,f,M,D,E]);return de($n.Provider,{value:k,children:e})},"AppHostProvider"),rt=r(()=>{let e=es($n);return e||{openApps:[],isAnyOpen:false,open:r(()=>"","open"),close:r(()=>{},"close"),closeAll:r(()=>{},"closeAll"),registerApps:r(()=>{},"registerApps"),minimize:r(()=>{},"minimize"),restore:r(()=>{},"restore"),isMinimized:r(()=>false,"isMinimized")}},"useAppHost"),xs=9e3,Ts={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},Is={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Cs=r(({app:e,zIndex:t,onClose:o,onMinimize:i,minimizeTargetPosition:n,enableSharedModalDimensions:a})=>{let s=e.component,u=!e.minimized,d={...e.props??{},...a?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(On,{app:e,config:e.modal,visible:u,zIndex:t,onClose:o,onMinimize:i,initialModalState:e.restoreState,enableSharedModalDimensions:a,bodyProps:d})}):e.launchMode==="self-modal"?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(s,{...d,visible:u,onClose:o,onRequestClose:o,onMinimize:i,minimizeTargetPosition:n,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?u?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(s,{...d,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...Ts,zIndex:t,display:u?"flex":"none"},children:de("div",{style:Is,children:de(s,{...d,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})})})},"AppRenderer"),Nn=r(()=>{let{openApps:e,close:t,minimize:o}=rt(),{settings:i}=xn();xt(()=>{Za(i.globalSettings?.expandableWindowControls!==false)},[i.globalSettings?.expandableWindowControls]);let n=e.filter(u=>u.launchMode!=="toggle-only");if(n.length===0)return null;let a=n.filter(u=>u.minimized).length,s=Br()??ws(a);return de(ys,{children:n.map((u,d)=>de(Cs,{app:u,zIndex:xs+d,onClose:()=>t(u.instanceId),onMinimize:p=>o(u.instanceId,p),enableSharedModalDimensions:i.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:s},u.instanceId))})},"AppOverlay");import{useCallback as ks,useEffect as to,useRef as zs,useState as Wn,useSyncExternalStore as _n}from"react";import{persistentStorage as Un,getToolAttention as oo,subscribeToolAttention as Kn}from"@buoy-gg/shared-ui/web";import{jsx as ue,jsxs as zt}from"react/jsx-runtime";function Vn(e){return _n(Kn,()=>oo(e),()=>oo(e))}r(Vn,"useToolAttention");var qn={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},Gn={needsInput:3,failed:2,done:1},Jn=new Map;function no(e){let t=null;for(let i of e?e.split("|"):[]){let n=oo(i);n&&(!t||Gn[n.kind]>Gn[t.kind])&&(t=n)}let o=Jn.get(e);return o&&t&&o.kind===t.kind&&o.label===t.label?o:!o&&!t?null:(Jn.set(e,t),t)}r(no,"strongest");function Yn(e){let t=e.join("|");return _n(Kn,()=>no(t),()=>no(t))}r(Yn,"useStrongestAttention");var Xn=28,io=32,ro=6,Zn=8,Qn=24,ei="@react_buoy_minimized_stack_expanded",As=80,ti=2e3,Bs=6e3,Ds="#1A1A1A",at="#888888";function ao({down:e=false}){return ue("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:ue("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:at,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}r(ao,"ChevronGlyph");function oi({id:e,title:t,icon:o,index:i,onPress:n}){let a=Vn(e),s=zs(null);return to(()=>{let u=true,d,p=r(()=>{s.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:As,easing:"linear"})},"runGlitch"),g=r(I=>{let f=I?500+Math.random()*1500+i*200:ti+Math.random()*(Bs-ti)+i*300;d=setTimeout(()=>{u&&(p(),g(false))},f)},"schedule");return g(true),()=>{u=false,clearTimeout(d)}},[i]),zt("button",{type:"button","aria-label":a?`${t} \u2014 ${a.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:n,style:{width:io,height:io,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[ue("div",{ref:s,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:o}),a?ue("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${a.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:qn[a.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:a.kind==="needsInput"?"!":""}):null]})}r(oi,"GlitchToolButton");function ni({containerWidth:e=32}){let{openApps:t,restore:o}=rt(),i=t.filter(f=>f.minimized&&f.launchMode!=="toggle-only"),[n,a]=Wn(false),[s,u]=Wn(false),d=Yn(i.map(f=>f.id));to(()=>{let f=false;return r(async()=>{let z=await Un.getItem(ei);!f&&z==="true"&&a(true),f||u(true)},"load")(),()=>{f=true}},[]),to(()=>{s&&Un.setItem(ei,n?"true":"false")},[n,s]);let p=ks(f=>{o(f)},[o]);if(i.length===0)return null;let g=Zn+i.length*io+(i.length-1)*ro+ro+Qn+4,I={backgroundColor:Ds,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${at}66`,borderLeft:`1px solid ${at}66`,borderRight:`1px solid ${at}66`,borderBottom:"none",boxSizing:"border-box"};return zt("div",{style:{height:Xn,overflow:"visible",position:"relative"},children:[ue("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?g:0,opacity:n?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:n?"auto":"none",...I},children:zt("div",{style:{height:g,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:Zn,gap:ro,boxSizing:"border-box"},children:[n&&[...i].reverse().map((f,z)=>ue(oi,{id:f.id,title:f.title||f.id,icon:f.icon??ue("span",{style:{color:"#fff",fontSize:13},children:(f.title||f.id).slice(0,1).toUpperCase()}),index:z,onPress:()=>p(f.instanceId)},f.instanceId)),ue("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>a(false),style:{width:"100%",height:Qn,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:ue(ao,{down:true})})]})}),zt("button",{type:"button","aria-label":`Show ${i.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:n?-1:0,"aria-hidden":n,onClick:()=>a(true),style:{position:"absolute",bottom:0,left:0,width:e,height:Xn,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:n?0:1,transform:n?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:n?"none":"auto",...I},children:[ue(ao,{}),d?ue("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:qn[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,i.length>1&&ue("span",{style:{fontSize:9,fontWeight:600,color:at,marginLeft:1},children:i.length})]})]})}r(ni,"MinimizedToolsStack");import{registerToolModules as Rs}from"@buoy-gg/shared-ui/web";import{createElement as Ms}from"react";function Je(e){let t=e.icon;return{...e,icon:typeof t=="function"?o=>Ms(t,{size:o,slot:e.slot??"both",color:e.color}):()=>t}}r(Je,"createWebTool");import{createContext as Es,useContext as Os,useState as ii,useMemo as ri}from"react";import{jsx as Ps}from"react/jsx-runtime";var ai=Es(null);function so({children:e}){let[t,o]=ii(false),[i,n]=ii(false),a=ri(()=>t||i,[t,i]),s=ri(()=>({isDialOpen:t,isToolOpen:i,isDevToolsActive:a,setDialOpen:o,setToolOpen:n}),[t,i,a]);return Ps(ai.Provider,{value:s,children:e})}r(so,"DevToolsVisibilityProvider");function At(){let e=Os(ai);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:r(()=>{},"setDialOpen"),setToolOpen:r(()=>{},"setToolOpen")}}r(At,"useDevToolsVisibility");import*as Ls from"@buoy-gg/license/web";import*as Fs from"@buoy-gg/shared-ui/web";import*as $s from"@buoy-gg/shared-ui/web/dataViewer";function lo(e){Rs({core:{useDevToolsVisibility:At},license:Ls,"shared-ui":Fs,"shared-ui/dataViewer":$s,...e});let t=new Set;return Object.values(e).flatMap(o=>Object.entries(o).flatMap(([i,n])=>!i.endsWith("Preset")||!n||typeof n.id!="string"||!n.component||t.has(n.id)?[]:(t.add(n.id),[Je(n)])))}r(lo,"createWebTools");import{useEffect as Bt,useMemo as Dt,useRef as js}from"react";import{LicenseManager as si,installCapacitorBridge as Hs,resolveDevBuild as li,useLicense as Ns}from"@buoy-gg/license/web";import{registerToolAdapters as Ws}from"@buoy-gg/shared-ui/web";function co(e){return typeof e=="object"&&e!==null?e:void 0}r(co,"externalSyncOptions");function ci({isDevelopment:e,isLicensed:t,externalSync:o,isAvailable:i}){if(o===false||!i)return false;if(e)return true;let n=co(o);return t&&n?.enableInRelease===true&&uo(n.socketURL,n)===null}r(ci,"shouldMountExternalSync");var di="http://localhost:42831";function ui(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}r(ui,"isLoopbackHost");function uo(e,t){let o=e??di;if(t?.allowInsecureNetwork===true)return null;let i;try{i=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 i.protocol==="https:"||i.protocol==="wss:"||ui(i.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.`}r(uo,"releaseTransportProblem");var _s={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function pi(e,t,o){if(t)return e;let i=null;for(let[n,a]of Object.entries(_s)){if(o?.includes(n))continue;let s=e[n];if(!s?.actions)continue;let u={...s.actions};for(let d of a)d in u&&(u[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}"] }}.`)});i??(i={...e}),i[n]={...s,actions:u}}return i??e}r(pi,"applyReleaseActionPolicy");import{useEffect as Us,useMemo as Ks,useState as Vs}from"react";import{devToolsStorageKeys as qs,persistentStorage as Gs}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as Js}from"@buoy-gg/license/web";var Ys=8;function mi(){let e="";for(;e.length<Ys;)e+=(Math.random()*16|0).toString(16);return e}r(mi,"generateInstallId");function gi(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}r(gi,"slugify");function fi({appName:e,hardwareName:t,platform:o,installId:i,deviceId:n}){let a=gi(e??"buoy")||"buoy",s=e??"Buoy Device",u=t?.trim()||o;return n?{deviceId:n,deviceName:`${s} (${u})`}:{deviceId:`${a}-${o}-${i}`,deviceName:`${s} (${u} \xB7 ${i.slice(-4)})`}}r(fi,"buildDeviceIdentity");function hi(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}r(hi,"sessionStore");function yi(){let e=globalThis;try{return e.localStorage??null}catch{return null}}r(yi,"localStore");async function bi({platform:e=We.OS,store:t,mint:o=mi}={}){let i=qs.sync.deviceId(),n=t===void 0?Js()?yi():e==="web"?hi():Gs:t;if(!n)return o();try{let a=await n.getItem(i);if(a&&a.length>0)return a;let s=o();return await n.setItem(i,s),s}catch{return o()}}r(bi,"loadInstallId");var po=null;function vi(){return po||(po=bi()),po}r(vi,"getInstallId");function Si(e,t){let o=e?.deviceId,i=e?.deviceName,n=t.loadId??vi,a=t.platform??We.OS,[s,u]=Vs(null);return Us(()=>{if(o)return;let d=false;return n().then(p=>{d||u(p)}),()=>{d=true}},[o,n]),Ks(()=>{if(!o&&!s)return null;let d=fi({appName:t.appName,hardwareName:t.hardwareName,platform:a,installId:s??"",deviceId:o});return i?{...d,deviceName:i}:d},[o,i,s,t.appName,t.hardwareName,a])}r(Si,"useDeviceIdentity");import{useEffect as Xs,useState as Zs}from"react";import{capacitorPlatform as Qs,capacitorPlugin as Rt,isCapacitorNative as el}from"@buoy-gg/license/web";function wi(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}r(wi,"hardwareFromUserAgent");function xi(e){return/sdk_gphone|Android SDK built for|Android ATD built for|google_sdk|Emulator|generic_/i.test(e)}r(xi,"isAndroidEmulatorUserAgent");function mo(){return typeof navigator>"u"?"":navigator.userAgent??""}r(mo,"userAgent");function Mt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}r(Mt,"firstPageTitle");var Ti="@react_buoy_capacitor_app_name";function Ii(e){try{let t=globalThis.localStorage;if(!t)return e;let o=t.getItem(Ti);if(o)return o;e&&t.setItem(Ti,e)}catch{}return e}r(Ii,"persistedAppName");function Ci(){let e=Qs();if(!e)return{platform:"web",appName:Mt(),hardwareName:"Browser",ready:true};let t=!!Rt("App");return{platform:e,appName:t?Mt():Ii(Mt()),hardwareName:wi(mo(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Rt("Device")}}r(Ci,"initialHostInfo");function ki(){let[e,t]=Zs(Ci);return Xs(()=>{if(!el())return;let o=false,i=Rt("App"),n=Rt("Device");return Promise.all([i?.getInfo?.().catch(()=>null)??null,n?.getInfo?.().catch(()=>null)??null]).then(([a,s])=>{if(o)return;let u=a?.name?.trim(),d=s?.name?.trim()||s?.model?.trim();t(p=>({...p,appName:u||p.appName,hardwareName:d||p.hardwareName,ready:true}))}),()=>{o=true}},[]),e}r(ki,"useHostInfo");function go(){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:mo(),serverUrl:typeof e=="string"?e:null}}r(go,"pageInfo");function fo(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}r(fo,"schemeHost");function zi(e,t){if(e==="ios"){let o=fo(t.serverUrl);return o?o===fo(t.origin):t.protocol==="capacitor:"}return Ai.has(t.hostname)}r(zi,"isBundledPage");var Ai=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Bi(e,t,o,i=go()){if(o==="web"||!i)return e;let n;try{n=new URL(e)}catch{return e}let a=zi(o,i);return!t&&a&&n.hostname===i.hostname&&(n.hostname="localhost"),o==="android"&&Ai.has(n.hostname)&&xi(i.userAgent)&&(n.hostname="10.0.2.2"),n.toString().replace(/\/$/,"")}r(Bi,"capacitorBrokerURL");function Di(e,t,o=go()){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.`}r(Di,"capacitorTransportProblem");import{getDevServerOrigin as tl,resolveReloadStrategy as ol,scheduleReloadApp as nl}from"@buoy-gg/shared-ui/web";var Ri=Date.now(),Mi=tl(),il={platform:We.OS,isTV:We.isTV===true,isTVOS:We.isTVOS===true},Ei={version:3,getSnapshot:r(()=>{let e=ol("auto");return{startedAt:Ri,devServerOrigin:Mi,device:il,reload:{available:e!==null,strategy:e}}},"getSnapshot"),subscribe:r(e=>()=>{},"subscribe"),actions:{ping:r(()=>({ok:true,startedAt:Ri,devServerOrigin:Mi}),"ping"),reloadApp:r(e=>{let t=e??{},{strategy:o,delayMs:i}=nl({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:o,delayMs:i}},"reloadApp")}};import{Fragment as rl,jsx as Le,jsxs as al}from"react/jsx-runtime";var sl=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],ll=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Oi(e){let t=Dt(()=>Object.fromEntries(Object.entries(e.modules).map(([i,n])=>[i.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),n])),[e.modules]),o=t["react-query"];return o?.useReactQuerySyncAdapter?Le(Pi,{...e,modules:t,query:o}):Le(ho,{...e,modules:t})}r(Oi,"BrowserToolRuntime");function Pi(e){let t=e.query.useReactQuerySyncAdapter();return Le(ho,{...e,queryAdapter:t})}r(Pi,"QueryRuntime");function ho({modules:e,apps:t,requiredEnvVars:o,externalSync:i,headless:n,sentryGetClient:a,queryAdapter:s}){let{isPro:u,tier:d}=Ns(),p=Dt(()=>{let D={app:Ei};for(let[E,R]of Object.entries(e))for(let[k,w]of Object.entries(R))k.endsWith("SyncAdapter")&&w&&typeof w=="object"&&(D[E]=w);s&&(D.query=s),e.env?.createEnvSyncAdapter&&(D.env=e.env.createEnvSyncAdapter(o??[]));for(let E of t??[])E.sync&&(D[`custom:${E.id}`]=E.sync);return D},[e,t,o,s]),g=js(p);g.current=p,Bt(()=>Ws(()=>g.current),[]),Bt(()=>{let D=[],E=r(R=>{let k=R?.();typeof k=="function"&&D.push(k)},"start");return E(e.network?.startNetworkCapture),E(e.storage?.startBrowserStorageCapture),E(e.assets?.startBrowserAssetCapture),E(e.three?.startThreeCapture),li(typeof _e<"u"?_e:process.env.NODE_ENV!=="production")&&E(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&E(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&E(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let R of D.reverse())R()}},[e]);let I=e["external-sync"],f=li(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),z=ci({isDevelopment:f,isLicensed:u,externalSync:i,isAvailable:!!I}),T=co(i);Hs({release:!f&&!!T?.enableInRelease}),!f&&T?.enableInRelease&&yo(uo(T.socketURL,T));let M=e.sentry?.SentryRoot;return al(rl,{children:[Object.entries(e).flatMap(([D,E])=>sl.map(R=>{let k=E[R];return k?Le(k,{},`${D}:${R}`):null})),M&&Le(M,{getClient:a}),Object.entries(e).flatMap(([D,E])=>ll.map(R=>{let k=E[R];return k&&(!n||R==="ScenariosOverlay"||R==="ImpersonateOverlay")?Le(k,{},`${D}:${R}`):null})),z&&Le(Fi,{module:I,tools:p,options:T,isPro:u,tier:d,dev:f})]})}r(ho,"ToolRuntime");var Li=null;function yo(e){!e||e===Li||(Li=e,console.warn("[Buoy]",e))}r(yo,"warnOnce");function Fi({module:e,tools:t,options:o,isPro:i,tier:n,dev:a}){let s=ki(),u=Si(o,{appName:s.appName,hardwareName:s.hardwareName,platform:s.platform}),d=Dt(()=>Bi(o?.socketURL??(a?e.getDefaultSocketURL():di),!!o?.socketURL,s.platform),[o?.socketURL,a,e,s.platform]),{socket:p}=e.useExternalSyncSocket({deviceName:u?.deviceName??"Buoy Browser",socketURL:d,persistentDeviceId:s.ready?u?.deviceId??null:null,platform:s.platform,extraDeviceInfo:s.extraDeviceInfo,enableLogs:o?.enableLogs});Bt(()=>{let f=Di(d,s.platform);if(!p||!f)return;let z=r(()=>yo(f),"onError");return p.on("connect_error",z),()=>{p.off("connect_error",z)}},[p,d,s.platform]),Bt(()=>{if(!p)return;let f=r(()=>{if(!p.connected||!si.hasAccountAccess())return;let z=si.getState();!i&&(z.isInitialized===false||z.isValidating===true)||p.emit("device-license",{isPro:i?"1":"0",tier:n})},"emit");return f(),p.on("connect",f),()=>{p.off("connect",f)}},[p,i,n]);let g=o?.releaseActions?.join(",")??"",I=Dt(()=>pi(t,a,g?g.split(","):void 0),[t,a,g]);return e.useExternalSync({tools:I,socket:p,deviceId:s.ready?u?.deviceId??null:null,enableLogs:o?.enableLogs}),null}r(Fi,"BrowserExternalSync");import{useState as $i}from"react";import{BuoyPortal as cl}from"@buoy-gg/shared-ui/web/floating";import{useBuoySession as dl}from"@buoy-gg/license/web";import{Fragment as ji,jsx as Ye,jsxs as Hi}from"react/jsx-runtime";var Ni="#20C997";function Wi(){let{status:e,signIn:t,signOut:o}=dl(),[i,n]=$i(false),[a,s]=$i(null);if(typeof document>"u")return null;let u=r(()=>{s(null),n(true),t().catch(p=>s(p instanceof Error?p.message:"Sign-in did not work. Try again.")).finally(()=>n(false))},"start"),d=e.state==="active";return Ye(cl,{children:Ye("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||a?"12px 14px":0,borderRadius:16,background:d||a?"#0f1419":"transparent",color:"#e6edf3",boxShadow:d||a?"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?Hi(ji,{children:[Ye("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),Ye("button",{type:"button",onClick:()=>void o(),style:ul,"data-testid":"buoy-signout",children:"Sign out"})]}):Hi(ji,{children:[a?Ye("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:a}):null,Ye("button",{type:"button",onClick:u,disabled:i,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:Ni,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"})]})})})}r(Wi,"BuoySignIn");var ul={marginTop:8,padding:0,border:"none",background:"none",color:Ni,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useState as pl}from"react";import{AccountSetupButton as ml,BuoyNeedsPlanCard as gl,BuoySignInCard as fl,useSignInState as hl}from"@buoy-gg/shared-ui/web";import{jsx as st,jsxs as _i}from"react/jsx-runtime";function bo({needsPlan:e=false}){let[t,o]=pl(false),i=hl();return _i(H,{pointerEvents:"box-none",style:Ui.root,children:[st(ml,{expanded:t,onPress:()=>o(true)}),t?st(ar,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>o(false),children:_i(H,{style:Ui.overlay,accessibilityViewIsModal:true,children:[st(rr,{style:dt.absoluteFill,onPress:()=>o(false),accessible:false}),e&&i==="active"?st(gl,{onClose:()=>o(false)}):st(fl,{onClose:()=>o(false)})]})}):null]})}r(bo,"BuoySignIn");var Ui=dt.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 vo(e){if(e.length>6){let t=e.map(o=>`"${o}"`).join(", ");return e.slice(0,6)}return e}r(vo,"validateDialConfig");import{installedTools as yl,installedToolsFound as bl}from"@buoy-gg/core/web/installed-tools";import{Fragment as So,jsx as L,jsxs as lt}from"react/jsx-runtime";var Ki={},Vi="@react_buoy_floating_menu_tooltip_shown",vl=Me;function qi({size:e=14,color:t="#20C997"}){let o=Math.max(2,e/4),i=Math.max(1,e/16);return L("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${o}px)`,gap:i,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((n,a)=>L("div",{style:{width:o,height:o,borderRadius:o/2,backgroundColor:t}},a))})}r(qi,"MenuLauncherIcon");function Gi(e){let{defaultFloatingTools:t,defaultDialTools:o,disableHints:i=false,children:n}=e,a=ye(()=>o&&vo(o),[o]);return L(Vt,{defaultFloatingTools:t,defaultDialTools:a,children:L(Sr,{disableHints:i,children:lt(so,{children:[L(Hn,{children:L(Qi,{...e})}),n]})})})}r(Gi,"AdmittedFloatingDevTools");var Sl=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function Ji({modules:e=Ki}){return L(So,{children:Object.entries(e).flatMap(([t,o])=>Sl.map(i=>{let n=o[i];return n?L(n,{},`${t}:${i}`):null}))})}r(Ji,"StartupCapture");function Yi(){let{openApps:e,restore:t}=rt();return Z(()=>Io(o=>{let i=e.find(n=>n.id===o);return i?(t(i.instanceId),true):false}),[e,t]),null}r(Yi,"WebToolOpenerBridge");function Xi(){let e=hr();return wr((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}r(Xi,"defaultEnvironment");function Zi(e,t,o,i){let n=r(g=>Object.entries(e).find(([I])=>I.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===g)?.[1],"find"),a=[],s=n("env");t?.length&&s?.createEnvTool&&s.createEnvVarConfig&&a.push(Je(s.createEnvTool({requiredEnvVars:s.createEnvVarConfig(t)})));let u=n("storage");o?.length&&u?.createStorageTool&&a.push(Je(u.createStorageTool({requiredStorageKeys:o})));let d=n("ask-buoy"),p=i==="hosted"?d?.hostedAskBuoy?.():i;return p&&d?.createAskBuoyTool&&a.push(Je(d.createAskBuoyTool(p))),a}r(Zi,"configOverrides");function Qi({environment:e,userRole:t="admin",availableEnvironments:o,onEnvironmentSwitch:i,apps:n,modules:a=Ki,externalSync:s,requiredEnvVars:u,sentryGetClient:d,disableHints:p=false,headless:g=false,hidden:I=false,defaultFloatingTools:f,defaultDialTools:z,zustandStores:T,requiredStorageKeys:M,askBuoy:D}){let E=e??Xi(),R=ye(()=>z?vo(z):void 0,[z]),[k,w]=Et(false),[C,F]=Et(false),A=Co(false),B=rt(),ee=ye(()=>Zi(a,u,M,D),[a,u,M,D]),_=ye(()=>Ot([...lo(a),...n??[],...ee]),[n,a,ee]),G=ye(()=>Object.entries(a).find(([l])=>l.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[a]);Z(()=>{if(!T||typeof G?.watchStores!="function")return;let l=G.watchStores(T);return typeof l=="function"?l:void 0},[T,G]);let te=At(),V=B.openApps.some(l=>!l.minimized);Z(()=>{te.setDialOpen(k)},[k,te.setDialOpen]),Z(()=>{te.setToolOpen(V||C)},[V,C,te.setToolOpen]);let{registerApps:ae}=B;Z(()=>{ae(_.map(l=>{let y=l.icon;return{...l,icon:typeof y=="function"?({size:h})=>y(h):y}}))},[ae,_]);let oe=ye(()=>_.map(l=>({id:l.id,name:l.name,description:l.description,slot:l.slot})),[_]);Tr({availableTools:oe,storage:vl}),Z(()=>{let l=false;return r(async()=>{let[y,h]=await Promise.all([Me.getItem(pt.dial.isOpen()),Me.getItem(pt.settings.modalOpen())]);l||(y==="true"&&w(true),h==="true"&&(w(true),F(true)),A.current=true)},"restore")(),()=>{l=true}},[]),Z(()=>{A.current&&Me.setItem(pt.dial.isOpen(),k?"true":"false")},[k]),Z(()=>{A.current&&Me.setItem(pt.settings.modalOpen(),C?"true":"false")},[C]);let me=Ue(l=>{if(an(l.id),l.launchMode==="toggle-only"){l.onPress?.();return}if(l.component){let y=typeof l.icon=="function"?l.icon(20):l.icon;B.open({id:l.id,title:l.name||ut(l.id),component:l.component,props:l.props,modal:l.modal,launchMode:l.launchMode||"self-modal",singleton:l.singleton??true,icon:y,color:l.color||ko(l.id)})}else l.onPress?.()},[B]),ge=Co({tools:_,openApps:B.openApps,openTool:me});ge.current={tools:_,openApps:B.openApps,openTool:me},Z(()=>Io(l=>{let{tools:y,openApps:h,openTool:J}=ge.current;if(h.some(U=>U.id===l))return false;let W=y.find(U=>U.id===l);return!W||W.launchMode==="toggle-only"?false:(J(W),true)}),[]);let fe=ye(()=>mt(_,"dial").map(l=>{let y=l.color||ko(l.id),h;return typeof l.icon=="string"?h=l.icon:typeof l.icon=="function"?h=l.icon(32):h=null,{id:l.id,name:l.name||ut(l.id),icon:h,unavailable:!l.component&&!l.onPress,color:y,onPress:r(()=>{me(l),w(false)},"onPress")}}),[_,me]),N=ye(()=>{if(!k)return fe;let l=new Map(fe.map(y=>[y.id,y]));return rn(fe.map(y=>y.id)).map(y=>l.get(y)).filter(y=>!!y)},[k,fe]),{settings:Ce}=xn(),ke=ye(()=>mt(_,"row").filter(l=>(Ce.floatingTools[l.id]??false)===true&&(l.component||l.onPress)),[_,Ce.floatingTools]),Fe=ye(()=>_.map(l=>({id:l.id,name:l.name||ut(l.id),description:l.description||Ir(l.id),slot:l.slot,icon:l.icon,color:l.color})),[_]),[$e,se]=Et(false),Y=B.openApps.some(l=>!l.minimized);Z(()=>{if(p)return;let l=false,y=setTimeout(async()=>{let h=await Me.getItem(Vi);!l&&!h&&se(true)},1e3);return()=>{l=true,clearTimeout(y)}},[p]);let le=Ue(()=>{se(false),Me.setItem(Vi,"true")},[]),pe=Ue(()=>{le(),w(true)},[le]),ze=Ue(()=>{w(false),F(false)},[]),je=Ue(()=>{F(l=>!l)},[]),Se=Ue(()=>F(false),[]),Ae=!!(o?.length&&i),Be=Ce.floatingTools.environment!==false,ne=$e&&!k&&!Y&&!I;Z(()=>{if(!ne)return;let l=r(h=>{(!(h.target instanceof Element)||!h.target.closest("[data-buoy-root]"))&&le()},"onPointerDown"),y=r(h=>{h.key==="Escape"&&le()},"onKeyDown");return document.addEventListener("pointerdown",l,true),document.addEventListener("keydown",y),()=>{document.removeEventListener("pointerdown",l,true),document.removeEventListener("keydown",y)}},[ne,le]);let De=B.openApps.some(l=>l.minimized&&l.launchMode!=="toggle-only"),He=L(Oi,{modules:a,apps:n,requiredEnvVars:u,externalSync:s,headless:g,sentryGetClient:d});return g?He:lt("div",{"data-buoy-root":"",style:{display:"contents"},children:[He,L(Yi,{}),ne&&L("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),L("div",{style:I?{visibility:"hidden"}:{display:"contents"},"aria-hidden":I||void 0,children:lt(Bo,{enablePositionPersistence:!ne,pushToSide:k||Y,suspendPointerEvents:k,centerOnboarding:ne,minimizedStack:De?L(ni,{}):void 0,hasMinimizedStack:De,children:[E&&Be&&!Ae&&L(Cr,{environment:E}),Ae&&Be&&L(kr,{currentEnvironment:E??"local",availableEnvironments:o,onSelect:i}),t?L(Do,{userRole:t,onPress:pe}):L("button",{"aria-label":"Open dev tools",onClick:pe,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:L(qi,{})}),ke.map(l=>L("button",{"aria-label":l.name||ut(l.id),title:l.description,onClick:()=>me(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))]})}),ne&&L(Lt,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:le}),k&&!I&&L(Ht,{icons:N,onClose:ze,centerLabel:"BUOY",onCenterPress:je,settingsOpen:C,hintsDisabled:p}),C&&!I&&L(Xt,{visible:true,onClose:Se,availableTools:Fe,defaultFloatingTools:f,defaultDialTools:R,onSettingsChange:l=>{}}),!I&&lt(So,{children:[L(Nn,{}),L(dr,{})]})]})}r(Qi,"FloatingDevToolsInner");function er(e){let t=e&&typeof e=="object"?e.appId:void 0,o=!!e;Z(()=>{if(!o)return;let i=false,n=ur.SessionManager;if(!n)return;let a=r(s=>{i||!s||(n.configure({audience:`app:${s}`}),n.load().catch(()=>{}))},"apply");return t?a(t):br().then(s=>a(s?.bundleId)).catch(()=>{}),()=>{i=true}},[o,t])}r(er,"useCapacitorSignInAudience");var tr=false;function or(e){return e.modules?e:(!bl&&!tr&&typeof console<"u"&&(tr=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:yl})}r(or,"withInstalledTools");function nr(e){return L(cr,{children:L(ir,{...or(e)})})}r(nr,"FloatingDevTools");function ir(e){let{access:t,isPro:o,licenseKey:i}=mr();Z(()=>{pr.configure(e.licenseKey)},[e.licenseKey]);let n=e.licenseKey===void 0||gr(e.licenseKey,i),a=fr(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),s=n&&t.status==="admitted";Z(()=>{s&&xr()},[s]),Z(()=>{a||t.status==="initializing"||(o&&s?sr():lr())},[a,o,s,t.status]);let u=yr();return er(u?e.signIn:void 0),!a&&!o?!e.signIn||e.headless?null:u?L(bo,{needsPlan:true}):L(Wi,{}):s?L(Gi,{...e}):lt(So,{children:[t.status==="initializing"&&L(Ji,{modules:e.modules}),e.headless?null:e.signIn&&u?L(bo,{}):L(vr,{})]})}r(ir,"FloatingDevToolsContent");export{zr as a,zo as b,Ot as c,mt as d,Ao as e,Bo as f,Ar as g,Do as h,Ht as i,Xt as j,Qt as k,Rn as l,Pn as m,Hn as n,rt as o,Nn as p,Je as q,so as r,At as s,lo as t,Ei as u,nr as v};
package/lib/web/index.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{a as m,b as d,c,d as p,e as C,f as g,g as y,h as f,i as S,j as T,k as v,l as h,m as b,n as D,o as B,p as P,q as k,r as w,s as E,t as H,u as M,v as i}from"./chunks/chunk-XA3PD6QG.mjs";import{$ as A,A as F,Aa as L,B as R,Ba as q,C as x,Ca as I,D as U,Da as W,E as j,Ea as J,F as K,Fa as O,G as V,Ga as G,H as X,Ha as z,I as N,Ia as Q,J as Z,Ja as Y,K as _,Ka as $,L as aa,La as sa,M as ea,Ma as oa,N as ta,Na as ra,O as la,Oa as ia,P as na,Pa as ua,Q as ma,R as da,S as ca,T as pa,U as Ca,V as ga,W as ya,X as fa,Y as Sa,Z as Ta,_ as va,a as ha,aa as ba,b as Da,ba as Ba,c as Pa,ca as ka,d as wa,da as Ea,e as Ha,ea as Ma,f as Aa,fa as Fa,g as La,ga as Ra,h as qa,ha as xa,i as Ia,ia as Ua,j as Wa,ja,k as Ja,ka as Ka,l as Oa,la as Va,m as Ga,ma as Xa,n as za,na as Na,o as Qa,oa as Za,p as Ya,pa as _a,q as $a,qa as as,r as ss,ra as es,s as os,sa as ts,t as rs,ta as ls,u as is,ua as ns,v as us,va as ms,w as ds,wa as cs,x as ps,xa as Cs,y as gs,ya as ys,z as fs,za as Ss}from"./chunks/chunk-RBPDZUHO.mjs";import"./chunks/chunk-Z6I7ZD34.mjs";import{c as Ts}from"./chunks/chunk-D2FYORGY.mjs";import{a as vs}from"./chunks/chunk-LOPXJLVB.mjs";import{useSettings as hs,useFloatingTools as bs,getToolLabel as Ds,getToolDescription as Bs,getToolColor as Ps,settingsColors as ks,settingsStyles as ws,dialColors as Es,dialStyles as Hs}from"@buoy-gg/floating-tools-react/web";import{LicenseManager as Ms}from"@buoy-gg/license/web";import{createRoot as As}from"react-dom/client";import{createElement as Fs}from"react";import{installedTools as Ls}from"@buoy-gg/core/web/installed-tools";import{jsx as Rs}from"react/jsx-runtime";function n({queryClient:s,...e}={}){let o=Object.values(e.modules??Ls).find(u=>u.QueryClientProvider)?.QueryClientProvider;if(s&&!o)throw new Error("Add the react-query tool to modules to use queryClient.");let a=document.createElement("div");a.dataset.buoyMount="",document.body.appendChild(a);let t=As(a),r=Rs(i,{...e});t.render(s?Fs(o,{client:s},r):r);let l=true;return()=>{l&&(l=false,t.unmount(),a.remove())}}vs(n,"mountBuoy");export{X as Activity,as as AlertCircle,N as AlertTriangle,D as AppHostProvider,P as AppOverlay,wa as Badge,es as BarChart3,is as BaseEventStore,ts as Bookmark,Z as Bug,Ia as Button,Ga as Card,_ as Check,aa as CheckCircle,$ as CheckSquare,ea as ChevronDown,ta as ChevronLeft,la as ChevronRight,na as ChevronUp,ma as Clock,ls as Cloud,Qa as CollapsibleSection,da as Copy,Wa as CopyButton,rs as DataViewer,ca as Database,w as DevToolsVisibilityProvider,S as DialMenu,La as DiffViewer,y as Divider,ns as Download,ms as Edit3,$a as EmptyState,os as EventStepperFooter,pa as Eye,Ca as EyeOff,ga as FileJson,ya as FileText,fa as Filter,Sa as FlaskConical,i as FloatingDevTools,g as FloatingTools,cs as GitBranch,Ta as Globe,Cs as HardDrive,va as Hash,ys as HelpCircle,Ss as Home,L as Image,A as Info,Aa as InfoRow,V as JsModal,ba as Key,Ba as Layers,Ms as LicenseManager,q as Link,ka as Lock,I as Maximize2,W as Minus,J as Palette,Ea as Pause,O as Pin,Ma as Play,Fa as Plus,Ra as Power,Ja as PowerToggle,xa as RefreshCw,us as RelativeTime,G as Route,Oa as Row,Ua as Search,ss as SearchBar,za as SectionHeader,z as Server,ja as Settings,T as SettingsModal,Ka as Shield,Q as Smartphone,Y as Square,Ha as StatusDot,Ya as TabSelector,sa as Timer,Va as Trash2,oa as Unlock,ra as Upload,Xa as User,f as UserStatus,ia as Users,Na as Wifi,Za as X,ua as XCircle,_a as Zap,M as appSyncAdapter,d as autoDiscoverWebPresets,c as autoDiscoverWithCustom,Ts as clearReleaseOptIn,K as copyToClipboard,k as createWebTool,H as createWebTools,m as defaultToolPresets,U as devToolsStorageKeys,Es as dialColors,Hs as dialStyles,ds as formatBytes,ps as formatDuration,gs as formatNumber,C as getEnabledTools,Ps as getToolColor,Bs as getToolDescription,Ds as getToolLabel,p as getToolsBySlot,b as isBuoyHoldingBackButton,Da as methodColor,n as mountBuoy,x as persistentStorage,F as safeStringify,ks as settingsColors,ws as settingsStyles,ha as statusColor,qa as toolTheme,fs as truncateMiddle,Pa as typeColor,B as useAppHost,E as useDevToolsVisibility,bs as useFloatingTools,R as usePersistedState,j as useSafeAreaInsets,hs as useSettings,h as useToolHeader,v as useToolHost};
1
+ "use client";import{a as m,b as d,c,d as p,e as C,f as g,g as y,h as f,i as S,j as T,k as v,l as h,m as b,n as D,o as B,p as P,q as k,r as w,s as E,t as H,u as M,v as i}from"./chunks/chunk-LU4GPZ5L.mjs";import{$ as A,A as F,Aa as L,B as R,Ba as q,C as x,Ca as I,D as U,Da as W,E as j,Ea as J,F as K,Fa as O,G as V,Ga as G,H as X,Ha as z,I as N,Ia as Q,J as Z,Ja as Y,K as _,Ka as $,L as aa,La as sa,M as ea,Ma as oa,N as ta,Na as ra,O as la,Oa as ia,P as na,Pa as ua,Q as ma,R as da,S as ca,T as pa,U as Ca,V as ga,W as ya,X as fa,Y as Sa,Z as Ta,_ as va,a as ha,aa as ba,b as Da,ba as Ba,c as Pa,ca as ka,d as wa,da as Ea,e as Ha,ea as Ma,f as Aa,fa as Fa,g as La,ga as Ra,h as qa,ha as xa,i as Ia,ia as Ua,j as Wa,ja,k as Ja,ka as Ka,l as Oa,la as Va,m as Ga,ma as Xa,n as za,na as Na,o as Qa,oa as Za,p as Ya,pa as _a,q as $a,qa as as,r as ss,ra as es,s as os,sa as ts,t as rs,ta as ls,u as is,ua as ns,v as us,va as ms,w as ds,wa as cs,x as ps,xa as Cs,y as gs,ya as ys,z as fs,za as Ss}from"./chunks/chunk-RBPDZUHO.mjs";import"./chunks/chunk-Z6I7ZD34.mjs";import{c as Ts}from"./chunks/chunk-D2FYORGY.mjs";import{a as vs}from"./chunks/chunk-LOPXJLVB.mjs";import{useSettings as hs,useFloatingTools as bs,getToolLabel as Ds,getToolDescription as Bs,getToolColor as Ps,settingsColors as ks,settingsStyles as ws,dialColors as Es,dialStyles as Hs}from"@buoy-gg/floating-tools-react/web";import{LicenseManager as Ms}from"@buoy-gg/license/web";import{createRoot as As}from"react-dom/client";import{createElement as Fs}from"react";import{installedTools as Ls}from"@buoy-gg/core/web/installed-tools";import{jsx as Rs}from"react/jsx-runtime";function n({queryClient:s,...e}={}){let o=Object.values(e.modules??Ls).find(u=>u.QueryClientProvider)?.QueryClientProvider;if(s&&!o)throw new Error("Add the react-query tool to modules to use queryClient.");let a=document.createElement("div");a.dataset.buoyMount="",document.body.appendChild(a);let t=As(a),r=Rs(i,{...e});t.render(s?Fs(o,{client:s},r):r);let l=true;return()=>{l&&(l=false,t.unmount(),a.remove())}}vs(n,"mountBuoy");export{X as Activity,as as AlertCircle,N as AlertTriangle,D as AppHostProvider,P as AppOverlay,wa as Badge,es as BarChart3,is as BaseEventStore,ts as Bookmark,Z as Bug,Ia as Button,Ga as Card,_ as Check,aa as CheckCircle,$ as CheckSquare,ea as ChevronDown,ta as ChevronLeft,la as ChevronRight,na as ChevronUp,ma as Clock,ls as Cloud,Qa as CollapsibleSection,da as Copy,Wa as CopyButton,rs as DataViewer,ca as Database,w as DevToolsVisibilityProvider,S as DialMenu,La as DiffViewer,y as Divider,ns as Download,ms as Edit3,$a as EmptyState,os as EventStepperFooter,pa as Eye,Ca as EyeOff,ga as FileJson,ya as FileText,fa as Filter,Sa as FlaskConical,i as FloatingDevTools,g as FloatingTools,cs as GitBranch,Ta as Globe,Cs as HardDrive,va as Hash,ys as HelpCircle,Ss as Home,L as Image,A as Info,Aa as InfoRow,V as JsModal,ba as Key,Ba as Layers,Ms as LicenseManager,q as Link,ka as Lock,I as Maximize2,W as Minus,J as Palette,Ea as Pause,O as Pin,Ma as Play,Fa as Plus,Ra as Power,Ja as PowerToggle,xa as RefreshCw,us as RelativeTime,G as Route,Oa as Row,Ua as Search,ss as SearchBar,za as SectionHeader,z as Server,ja as Settings,T as SettingsModal,Ka as Shield,Q as Smartphone,Y as Square,Ha as StatusDot,Ya as TabSelector,sa as Timer,Va as Trash2,oa as Unlock,ra as Upload,Xa as User,f as UserStatus,ia as Users,Na as Wifi,Za as X,ua as XCircle,_a as Zap,M as appSyncAdapter,d as autoDiscoverWebPresets,c as autoDiscoverWithCustom,Ts as clearReleaseOptIn,K as copyToClipboard,k as createWebTool,H as createWebTools,m as defaultToolPresets,U as devToolsStorageKeys,Es as dialColors,Hs as dialStyles,ds as formatBytes,ps as formatDuration,gs as formatNumber,C as getEnabledTools,Ps as getToolColor,Bs as getToolDescription,Ds as getToolLabel,p as getToolsBySlot,b as isBuoyHoldingBackButton,Da as methodColor,n as mountBuoy,x as persistentStorage,F as safeStringify,ks as settingsColors,ws as settingsStyles,ha as statusColor,qa as toolTheme,fs as truncateMiddle,Pa as typeColor,B as useAppHost,E as useDevToolsVisibility,bs as useFloatingTools,R as usePersistedState,j as useSafeAreaInsets,hs as useSettings,h as useToolHeader,v as useToolHost};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/core",
3
- "version": "7.0.72",
3
+ "version": "7.0.74",
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",
@@ -89,10 +89,10 @@
89
89
  ],
90
90
  "dependencies": {
91
91
  "react-devtools-core": "6.1.5",
92
- "@buoy-gg/floating-tools-core": "^7.0.72",
93
- "@buoy-gg/floating-tools-react": "^7.0.72",
94
- "@buoy-gg/license": "^7.0.72",
95
- "@buoy-gg/shared-ui": "^7.0.72"
92
+ "@buoy-gg/floating-tools-core": "^7.0.74",
93
+ "@buoy-gg/floating-tools-react": "^7.0.74",
94
+ "@buoy-gg/license": "^7.0.74",
95
+ "@buoy-gg/shared-ui": "^7.0.74"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "react": "*"