@buoy-gg/core 7.0.56 → 7.0.58

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.
Files changed (58) hide show
  1. package/lib/commonjs/browserRegister.js +1 -1
  2. package/lib/commonjs/floatingMenu/AppHost.web.js +1 -1
  3. package/lib/commonjs/floatingMenu/BrowserToolRuntime.js +1 -1
  4. package/lib/commonjs/floatingMenu/BuoyCodeSignIn.js +1 -0
  5. package/lib/commonjs/floatingMenu/BuoySignIn.js +1 -1
  6. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1 -1
  7. package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -1
  8. package/lib/commonjs/floatingMenu/MinimizedToolsStack.web.js +1 -1
  9. package/lib/commonjs/floatingMenu/capacitorBackButton.js +1 -0
  10. package/lib/commonjs/floatingMenu/capacitorHostInfo.js +1 -0
  11. package/lib/commonjs/floatingMenu/deviceIdentity.js +1 -1
  12. package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +1 -1
  13. package/lib/commonjs/floatingMenu/dial/DialIcon.js +1 -1
  14. package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.web.js +1 -1
  15. package/lib/commonjs/floatingMenu/dial/dialA11y.js +1 -0
  16. package/lib/commonjs/index.web.js +1 -1
  17. package/lib/commonjs/version.js +1 -1
  18. package/lib/module/browserRegister.js +1 -1
  19. package/lib/module/floatingMenu/AppHost.web.js +1 -1
  20. package/lib/module/floatingMenu/BrowserToolRuntime.js +1 -1
  21. package/lib/module/floatingMenu/BuoyCodeSignIn.js +1 -0
  22. package/lib/module/floatingMenu/BuoySignIn.js +1 -1
  23. package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1 -1
  24. package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -1
  25. package/lib/module/floatingMenu/MinimizedToolsStack.web.js +1 -1
  26. package/lib/module/floatingMenu/capacitorBackButton.js +1 -0
  27. package/lib/module/floatingMenu/capacitorHostInfo.js +1 -0
  28. package/lib/module/floatingMenu/deviceIdentity.js +1 -1
  29. package/lib/module/floatingMenu/dial/DialDevTools.web.js +1 -1
  30. package/lib/module/floatingMenu/dial/DialIcon.js +1 -1
  31. package/lib/module/floatingMenu/dial/OnboardingTooltip.web.js +1 -1
  32. package/lib/module/floatingMenu/dial/dialA11y.js +1 -0
  33. package/lib/module/index.web.js +1 -1
  34. package/lib/module/version.js +1 -1
  35. package/lib/typescript/commonjs/floatingMenu/BuoyCodeSignIn.d.ts +4 -0
  36. package/lib/typescript/commonjs/floatingMenu/BuoySignIn.d.ts +1 -3
  37. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +27 -2
  38. package/lib/typescript/commonjs/floatingMenu/capacitorBackButton.d.ts +17 -0
  39. package/lib/typescript/commonjs/floatingMenu/capacitorHostInfo.d.ts +75 -0
  40. package/lib/typescript/commonjs/floatingMenu/dial/dialA11y.d.ts +2 -0
  41. package/lib/typescript/commonjs/index.web.d.ts +2 -0
  42. package/lib/typescript/commonjs/version.d.ts +1 -1
  43. package/lib/typescript/module/floatingMenu/BuoyCodeSignIn.d.ts +4 -0
  44. package/lib/typescript/module/floatingMenu/BuoySignIn.d.ts +1 -3
  45. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +27 -2
  46. package/lib/typescript/module/floatingMenu/capacitorBackButton.d.ts +17 -0
  47. package/lib/typescript/module/floatingMenu/capacitorHostInfo.d.ts +75 -0
  48. package/lib/typescript/module/floatingMenu/dial/dialA11y.d.ts +2 -0
  49. package/lib/typescript/module/index.web.d.ts +2 -0
  50. package/lib/typescript/module/version.d.ts +1 -1
  51. package/lib/web/chunks/chunk-CLXYMJTS.mjs +1 -0
  52. package/lib/web/chunks/{chunk-QZDVCMCT.mjs → chunk-GLXZCY6W.mjs} +1 -1
  53. package/lib/web/index.mjs +2 -2
  54. package/lib/web/register-server.mjs +1 -1
  55. package/lib/web/register.mjs +1 -1
  56. package/lib/web/toolkit.mjs +1 -1
  57. package/package.json +5 -5
  58. package/lib/web/chunks/chunk-R7RGRTY5.mjs +0 -1
package/lib/web/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- "use client";import{$ as En,A as Bn,Aa as On,B as Fn,Ba as Ln,C as Pn,Ca as $n,D as jn,Da as Hn,E as Wn,Ea as Nn,F as Vn,Fa as Un,G as Kn,Ga as _n,H as qn,Ha as Gn,I as Jn,Ia as Xn,J as Yn,Ja as Qn,K as Zn,Ka as ea,L as ta,La as oa,M as na,Ma as aa,N as ia,Na as ra,O as sa,Oa as la,P as ca,Pa as da,Q as ua,Qa as pa,R as ma,Ra as ga,S as fa,Sa as ha,T as ya,Ta as ba,U as Sa,Ua as va,V as wa,Va as xa,W as Ca,Wa as Ta,X as za,Xa as ka,Y as Ia,Ya as Ma,Z as Ra,_ as Aa,a as H,aa as Da,b as N,ba as Ea,c as tt,ca as Ba,d as Nt,da as Oa,e as nc,ea as Fa,f as Ce,fa as La,g as Vt,ga as Pa,h as Be,ha as $a,i as Ut,ia as ja,j as Ha,ja as Wa,k as Na,ka as Va,l as Ua,la as Ka,m as _a,ma as qa,n as Ga,na as Ja,o as Xa,oa as Ya,p as Qa,pa as Za,q as ei,qa as ti,r as oi,ra as ni,s as ai,sa as ii,t as ri,ta as si,u as li,ua as ci,v as di,va as ui,w as pi,wa as mi,x as gi,xa as fi,y as hi,ya as yi,z as bi,za as Si}from"./chunks/chunk-QZDVCMCT.mjs";import{b as vi,c as Kt}from"./chunks/chunk-5SGL6QL4.mjs";import{a as _t,d as ot}from"./chunks/chunk-R7RGRTY5.mjs";import{FloatingToolHost as wi}from"@buoy-gg/shared-ui/web/floating";import{LicenseManager as xi,useLicense as Ci,sameLicenseKey as Ti}from"@buoy-gg/license/web";import{AccountSetup as zi,startSettingsSync as ki}from"@buoy-gg/shared-ui/web";import{useState as wt,useMemo as Oe,useCallback as Fe,useEffect as le,useRef as Ii}from"react";import{useSettings as Mi,getToolLabel as nt,getToolDescription as Ri,getToolColor as qt}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Te,devToolsStorageKeys as at,EnvironmentIndicator as Ai,EnvironmentSelectorInline as Di}from"@buoy-gg/shared-ui/web";var Ei=[];function Bi(){return[]}function Gt(e=[]){return[...new Map(e.map(t=>[t.id,t])).values()]}function xt(e,t){return e.filter(o=>{let a=o.slot||"both";return a==="both"||a===t})}function Oi(e,t){let o=t instanceof Set?t:new Set(t);return e.filter(a=>o.has(a.id))}import{FloatingTool as Jt,FloatingToolDivider as Fi,FloatingToolUserStatus as Xt,getBubbleAnchorPosition as Li}from"@buoy-gg/shared-ui/web/floating";import{useState as Q,useEffect as ze,useMemo as it,useRef as rt,useCallback as st}from"react";import{getDialLayout as Pi,getAllIconPositions as $i,getGridLineRotations as ji,getIconStaggerInputRange as Hi,MAX_DIAL_SLOTS as We,DIAL_ICON_SIZE as Wi,dialAnimationConfig as Yt,getDialCSSKeyframesString as Ni,getDialCSSAnimationStyles as Vi,dialColors as F,dialStyles as S,withAlpha as Qt,floatingToolsColors as Ui}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Zt,monoFont as eo,ToolBackground as Ki,useToolBackground as _i}from"@buoy-gg/shared-ui/web";import{memo as qi}from"react";import{RasterLayer as Gi,scatter as Ji,useLoop as Xi,withBgAlpha as Yi}from"@buoy-gg/shared-ui/web";import{Fragment as Qi,jsx as Ne}from"react/jsx-runtime";var Zi=.94,er=6,tr=2400,lt=3,to=16,or=Array.from({length:lt},(e,t)=>Ji(22343^t*40503,to*4)),oo=["#FFFFFF","#B3D9FF","#8CB3FF"],no=Math.PI/3,ao=14*Math.PI/180;function nr(e){let t=Math.min(5,Math.floor(e*6)),o=e*6-t;return t*no+ao/2+o*(no-ao)}function ar(e){return Math.min(er,1/(1-e*Zi))}function ir(e){let t=.15+.85*e*e;return e<.06?t*=e/.06:e>.94&&(t*=(1-e)/.06),Math.min(.7,t)}function rr(e){let t=e/lt,o=[],a=12;for(let d=0;d<=a;d++)o.push(d/a);let n=(1-t)%1;n>.001&&n<1-.001&&o.push(n-1e-4,n+1e-4),o.sort((d,p)=>d-p);let i=[],l=[],u=[];for(let d of o){let p=t===0&&d===1?1:(d+t)%1;i.push(d),l.push(ar(p)),u.push(ir(p))}return{input:i,scale:l,opacity:u}}var sr=Array.from({length:lt},(e,t)=>rr(t)),lr=qi(function({size:e}){let t=Xi(tr),o=e/2,a=[];for(let n=0;n<lt;n++){let i=or[n],l=sr[n],u=[];for(let d=0;d<to;d++){let p=nr(i[d*4]),m=(.15+.85*Math.sqrt(i[d*4+1]))*.5*o,x=oo[Math.floor(i[d*4+3]*oo.length)%3],g=o+Math.cos(p)*m,R=o+Math.sin(p)*m,v=.6,I=v*2.4;u.push(Ne(H,{style:{position:"absolute",left:g-I/2,top:R-I/2,width:I,height:I,borderRadius:I/2,backgroundColor:Yi(x,.3)}},`${d}-h`),Ne(H,{style:{position:"absolute",left:g-v/2,top:R-v/2,width:v,height:v,borderRadius:v/2,backgroundColor:x}},d))}a.push(Ne(Ce.View,{style:{position:"absolute",left:0,top:0,width:e,height:e,opacity:t.interpolate({inputRange:l.input,outputRange:l.opacity}),transform:[{scale:t.interpolate({inputRange:l.input,outputRange:l.scale})}]},pointerEvents:"none",children:Ne(Gi,{style:{width:e,height:e},raster:false,children:u})},n))}return Ne(Qi,{children:a})});import{useEffect as cr,useState as io}from"react";import{dialColors as Le,withAlpha as ro}from"@buoy-gg/floating-tools-react/web";import{ARROW_BOTTOM_OFFSET as dr,ARROW_HEIGHT as ur,SPACING_GAP as xc,getScreenCenterY as Cc,calculateTooltipPosition as pr,calculateTargetPosition as Tc}from"@buoy-gg/shared-ui/web/floating";import{monoFont as so}from"@buoy-gg/shared-ui/web";import{jsx as Pe,jsxs as lo}from"react/jsx-runtime";var co=false;function mr(){if(co||typeof document>"u")return;let e=document.createElement("style");e.textContent=`
1
+ "use client";import{$ as ra,$a as ia,A as sa,Aa as la,B as ca,Ba as da,C as ua,Ca as pa,D as ma,Da as ga,E as fa,Ea as ha,F as ya,Fa as ba,G as va,Ga as Sa,H as wa,Ha as xa,I as Ca,Ia as Ta,J as Ia,Ja as ka,K as za,Ka as Ra,L as Ma,La as Ba,M as Da,Ma as Ea,N as Aa,Na as Pa,O as Oa,Oa as La,P as Fa,Pa as $a,Q as ja,Qa as Ha,R as Wa,Ra as _a,S as Na,Sa as Ua,T as Ka,Ta as Va,U as qa,Ua as Ga,V as Ja,Va as Xa,W as Ya,Wa as Qa,X as Za,Xa as er,Y as tr,Ya as or,Z as nr,Za as ar,_ as rr,_a as ir,a as M,aa as sr,b as B,ba as lr,c as ut,ca as cr,d as pt,da as dr,e as to,ea as ur,f as pr,fa as mr,g as oo,ga as gr,h as Td,ha as fr,i as Oe,ia as hr,j as no,ja as yr,k as Ue,ka as br,l as mt,la as vr,m as Sr,ma as wr,n as xr,na as Cr,o as Tr,oa as Ir,p as kr,pa as zr,q as Rr,qa as Mr,r as Br,ra as Dr,s as Er,sa as Ar,t as Pr,ta as Or,u as Lr,ua as Fr,v as $r,va as jr,w as Hr,wa as Wr,x as _r,xa as Nr,y as Ur,ya as Kr,z as Vr,za as qr}from"./chunks/chunk-GLXZCY6W.mjs";import{b as Gr,c as ao}from"./chunks/chunk-5SGL6QL4.mjs";import{a as ro,d as Ke}from"./chunks/chunk-CLXYMJTS.mjs";import{FloatingToolHost as Jr}from"@buoy-gg/shared-ui/web/floating";import*as Xr from"@buoy-gg/license/web";import{LicenseManager as Yr,useLicense as Qr,sameLicenseKey as Zr,resolveDevBuild as ei,capacitorDebug as ti,isCapacitorNative as oi,loadCapacitorAppHost as ni}from"@buoy-gg/license/web";import{AccountSetup as ai,HintsProvider as ri,normalizeEnvironment as ii,registerToolOpener as si,startSettingsSync as li}from"@buoy-gg/shared-ui/web";import{useState as Pt,useMemo as ye,useCallback as Ve,useEffect as oe,useRef as ci}from"react";import{useSettings as di,getToolLabel as gt,getToolDescription as ui,getToolColor as io}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Le,devToolsStorageKeys as ft,EnvironmentIndicator as pi,EnvironmentSelectorInline as mi}from"@buoy-gg/shared-ui/web";var gi=[];function fi(){return[]}function so(e=[]){return[...new Map(e.map(t=>[t.id,t])).values()]}function Ot(e,t){return e.filter(o=>{let a=o.slot||"both";return a==="both"||a===t})}function hi(e,t){let o=t instanceof Set?t:new Set(t);return e.filter(a=>o.has(a.id))}import{FloatingTool as lo,FloatingToolDivider as yi,FloatingToolUserStatus as co,getBubbleAnchorPosition as bi}from"@buoy-gg/shared-ui/web/floating";import{useState as ee,useEffect as Fe,useMemo as ht,useRef as yt,useCallback as bt}from"react";var uo={network:"Network",images:"Images","image-overlay":"Image Overlay",assets:"Assets",query:"React Query",storage:"Storage",env:"Env",console:"Console",events:"Events",redux:"Redux",zustand:"Zustand",jotai:"Jotai","route-events":"Routes","time-machine":"Time Machine",clock:"Clock",permissions:"Permissions","highlight-updates":"Highlight Updates","debug-borders":"Debug Borders","perf-monitor":"Bench HUD","js-top":"JS Top","js-top-modal":"JS Top",impersonate:"Impersonate","perf-monitor-modal":"Bench"};function vi(e,t){return e&&uo[e]?uo[e]:t}import{getDialLayout as Si,getAllIconPositions as wi,getGridLineRotations as xi,getIconStaggerInputRange as Ci,MAX_DIAL_SLOTS as Qe,DIAL_ICON_SIZE as Ti,dialAnimationConfig as po,getDialCSSKeyframesString as Ii,getDialCSSAnimationStyles as ki,dialColors as $,dialStyles as S,withAlpha as mo,floatingToolsColors as zi}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as go,monoFont as fo,ToolBackground as Ri,useToolBackground as Mi}from"@buoy-gg/shared-ui/web";import{memo as Bi}from"react";import{RasterLayer as Di,scatter as Ei,useLoop as Ai,withBgAlpha as Pi}from"@buoy-gg/shared-ui/web";import{Fragment as Oi,jsx as Ze}from"react/jsx-runtime";var Li=.94,Fi=6,$i=2400,vt=3,ho=16,ji=Array.from({length:vt},(e,t)=>Ei(22343^t*40503,ho*4)),yo=["#FFFFFF","#B3D9FF","#8CB3FF"],bo=Math.PI/3,vo=14*Math.PI/180;function Hi(e){let t=Math.min(5,Math.floor(e*6)),o=e*6-t;return t*bo+vo/2+o*(bo-vo)}function Wi(e){return Math.min(Fi,1/(1-e*Li))}function _i(e){let t=.15+.85*e*e;return e<.06?t*=e/.06:e>.94&&(t*=(1-e)/.06),Math.min(.7,t)}function Ni(e){let t=e/vt,o=[],a=12;for(let d=0;d<=a;d++)o.push(d/a);let n=(1-t)%1;n>.001&&n<1-.001&&o.push(n-1e-4,n+1e-4),o.sort((d,u)=>d-u);let r=[],i=[],s=[];for(let d of o){let u=t===0&&d===1?1:(d+t)%1;r.push(d),i.push(Wi(u)),s.push(_i(u))}return{input:r,scale:i,opacity:s}}var Ui=Array.from({length:vt},(e,t)=>Ni(t)),Ki=Bi(function({size:e}){let t=Ai($i),o=e/2,a=[];for(let n=0;n<vt;n++){let r=ji[n],i=Ui[n],s=[];for(let d=0;d<ho;d++){let u=Hi(r[d*4]),m=(.15+.85*Math.sqrt(r[d*4+1]))*.5*o,I=yo[Math.floor(r[d*4+3]*yo.length)%3],g=o+Math.cos(u)*m,D=o+Math.sin(u)*m,w=.6,E=w*2.4;s.push(Ze(M,{style:{position:"absolute",left:g-E/2,top:D-E/2,width:E,height:E,borderRadius:E/2,backgroundColor:Pi(I,.3)}},`${d}-h`),Ze(M,{style:{position:"absolute",left:g-w/2,top:D-w/2,width:w,height:w,borderRadius:w/2,backgroundColor:I}},d))}a.push(Ze(Oe.View,{style:{position:"absolute",left:0,top:0,width:e,height:e,opacity:t.interpolate({inputRange:i.input,outputRange:i.opacity}),transform:[{scale:t.interpolate({inputRange:i.input,outputRange:i.scale})}]},pointerEvents:"none",children:Ze(Di,{style:{width:e,height:e},raster:false,children:s})},n))}return Ze(Oi,{children:a})});import{useEffect as Vi,useState as So}from"react";import{dialColors as qe,withAlpha as wo}from"@buoy-gg/floating-tools-react/web";import{ARROW_BOTTOM_OFFSET as qi,ARROW_HEIGHT as Gi,SPACING_GAP as Nd,getScreenCenterY as Ud,calculateTooltipPosition as Ji,calculateTargetPosition as Kd}from"@buoy-gg/shared-ui/web/floating";import{monoFont as xo}from"@buoy-gg/shared-ui/web";import{jsx as Ge,jsxs as Co}from"react/jsx-runtime";var To=false;function Xi(){if(To||typeof document>"u")return;let e=document.createElement("style");e.textContent=`
2
2
  @keyframes buoyOnboardPulse {
3
3
  0%, 100% { transform: scale(1); }
4
4
  50% { transform: scale(1.02); }
@@ -7,4 +7,4 @@
7
7
  0%, 100% { transform: translateY(0); }
8
8
  50% { transform: translateY(-8px); }
9
9
  }
10
- `,document.head.appendChild(e),co=true}var Ct=Le.accent;function uo({title:e,message:t,onDismiss:o,showArrow:a=true}){let[n,i]=io(false),[l,u]=io(false);cr(()=>{mr();let p=requestAnimationFrame(()=>i(true));return()=>cancelAnimationFrame(p)},[]);let d={fontFamily:so,textTransform:"uppercase"};return Pe("div",{style:{position:"fixed",left:"50%",bottom:pr(),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:lo("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Pe("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),lo("div",{style:{position:"relative",maxWidth:280,backgroundColor:Le.dialBackground,borderRadius:16,border:`1px solid ${Le.dialBorder}`,padding:20,boxShadow:`0 0 20px ${ro(Le.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Pe("span",{style:{...d,fontSize:16,fontWeight:900,letterSpacing:1,color:Ct,textAlign:"center"},children:e}),Pe("span",{style:{fontFamily:so,fontSize:13,lineHeight:"20px",color:Le.centerText,textAlign:"center"},children:t}),Pe("button",{onClick:o,onMouseDown:()=>u(true),onMouseUp:()=>u(false),onMouseLeave:()=>u(false),style:{...d,marginTop:8,borderRadius:8,border:"none",backgroundColor:Ct,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:l?.7:1,transform:l?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),a&&Pe("div",{style:{position:"absolute",left:"50%",bottom:dr,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${ur}px solid ${Ct}`,filter:`drop-shadow(0 0 10px ${ro(Le.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}import{Fragment as gr,jsx as B,jsxs as ge}from"react/jsx-runtime";var fr={x:.5,y:.5},po="@react_buoy_settings_tooltip_shown",mo=false;function hr(){if(mo||typeof document>"u")return;let e=document.createElement("style");e.textContent=Ni(),document.head.appendChild(e),mo=true}var $e=e=>1-Math.pow(1-e,3),Tt=e=>e*e*e;function yr({icon:e,index:t,totalIcons:o,position:a,progress:n,onPress:i}){let[l,u]=Q(false),[d,p]=Q(false),m=!e.icon&&e.id.startsWith("empty-"),x=!m&&e.unavailable===true,g=!m&&!x,{icons:R}=Yt,v=Hi(t,o),I=0;n<=v[1]?I=0:n<=v[2]?I=(n-v[1])/(v[2]-v[1]):I=1,I=Math.max(0,Math.min(1,I));let T=Wi,k=R.pressIn.scale,z=I*(d?k:l?1.1:1),O=0;I<=0?O=0:I<=.3?O=I:O=.3+(I-.3)*(.7/.7);let b=a.x*I,M=a.y*I;return B("button",{role:"menuitem","aria-label":m?"Empty slot":e.name,"aria-disabled":!g,tabIndex:g?0:-1,onClick:g?i:void 0,onMouseEnter:()=>g&&u(true),onMouseLeave:()=>{u(false),p(false)},onMouseDown:()=>g&&p(true),onMouseUp:()=>p(false),style:{position:"absolute",left:"50%",top:"50%",width:T,height:T,marginLeft:-T/2,marginTop:-T/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:g?"pointer":"default",transform:`translate(${b}px, ${M}px) scale(${z})`,opacity:O,transition:l||d?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:m?B("div",{style:{width:S.emptySlot.dotSize,height:S.emptySlot.dotSize,borderRadius:S.emptySlot.dotSize/2,backgroundColor:F.emptyDotBackground,border:`${S.emptySlot.borderWidth}px solid ${F.emptyDotBorder}`}}):ge(gr,{children:[B("div",{style:{position:"absolute",width:`${S.icon.gradientBgSizePercent}%`,height:`${S.icon.gradientBgSizePercent}%`,borderRadius:S.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:S.icon.gradientBgOpacity}}),B("div",{style:{position:"absolute",width:`${S.icon.innerGlowSizePercent}%`,height:`${S.icon.innerGlowSizePercent}%`,borderRadius:S.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:S.icon.innerGlowOpacity}}),B("div",{style:{marginBottom:S.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:l?"brightness(1.2)":"none"},children:e.icon}),B("span",{style:{fontSize:e.name.length>8?Math.max(S.icon.label.fontSize*.7,S.icon.label.fontSize*8/e.name.length):S.icon.label.fontSize,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,color:F.iconLabel,letterSpacing:S.icon.label.letterSpacing,marginTop:S.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),x&&B("span",{style:{fontSize:S.icon.label.fontSize-1,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,letterSpacing:S.icon.label.letterSpacing,color:Ui.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}function go({side:e,color:t}){return B("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(e==="prev"?[[15,18,9,12],[9,12,15,6]]:[[9,18,15,12],[15,12,9,6]]).map(([o,a,n,i],l)=>B("line",{x1:o,y1:a,x2:n,y2:i,stroke:t,strokeWidth:2},l))})}function fo({side:e,disabled:t,onClick:o}){let[a,n]=Q(false),i=t?F.emptyDotBorder:F.accent;return ge("button",{type:"button","aria-label":`${e==="prev"?"Previous":"Next"} dial page`,disabled:t,onClick:o,onMouseDown:()=>!t&&n(true),onMouseUp:()=>n(false),onMouseLeave:()=>n(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${F.dialBorder}`,backgroundColor:F.dialBackground,color:t?F.iconLabelMuted:F.centerText,fontSize:12,fontWeight:900,fontFamily:eo,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${Qt(F.dialShadow,.4)}`,transform:a?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&B(go,{side:"prev",color:i}),e==="prev"?"PREV":"NEXT",e==="next"&&B(go,{side:"next",color:i})]})}function ho({icons:e,onClose:t,centerLabel:o="MENU",onCenterPress:a,settingsOpen:n=false,hintsDisabled:i=false}){let{id:l}=_i(),[u,d]=Q(0),[p,m]=Q(0),[x,g]=Q(0),[R,v]=Q(0),[I,T]=Q(0),[k,z]=Q(1),[O,b]=Q(false),[M,$]=Q(false),[C,A]=Q(false),ee=rt(null),Z=rt(null),G=rt(null),ce=rt(false),{entrance:K,exit:ne,interaction:J}=Yt,ve=Vi(),[me,we]=Q(()=>({width:window.innerWidth,height:window.innerHeight}));ze(()=>{let D=()=>we({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[]);let j=it(()=>Pi({screenWidth:me.width,maxCircleSize:Math.max(120,Math.min(320,me.height-96))}),[me]),Re=it(()=>ji(),[]),fe=it(()=>$i(We,j.iconRadius),[j.iconRadius]),[se,xe]=Q(0),ae=Math.max(1,Math.ceil(e.length/We)),r=Math.min(se,ae-1),L=it(()=>{let D=r*We,w=[...e.slice(D,D+We)];for(;w.length<We;)w.push({id:`empty-${w.length}`,name:"",icon:null,onPress:()=>{}});return w},[e,r]);ze(()=>{hr()},[]),ze(()=>{let D=K.backdrop.duration,w=K.dial.rotation.duration,X=K.centerButton.delay,V=K.icons.delay,q=K.icons.duration,_=performance.now(),te=de=>{let s=de-_;d(Math.min(1,s/D));let f=Math.min(1,s/400),E=$e(f)*1.1;f>.7&&(E-=(f-.7)*.33),f>=1&&(E=1),m(Math.max(0,Math.min(1.05,E)));let Y=Math.min(1,s/w);if(g($e(Y)*360),s>=X){let ye=Math.min(1,(s-X)/300),Ee=$e(ye)*1.15;ye>.6&&(Ee-=(ye-.6)*.375),ye>=1&&(Ee=1),v(Math.max(0,Math.min(1.05,Ee)))}if(s>=V){let ye=Math.min(1,(s-V)/q);T($e(ye))}let he=V+q;s<he?G.current=requestAnimationFrame(te):(d(1),m(1),g(360),v(1),T(1),A(true))};return G.current=requestAnimationFrame(te),()=>{G.current&&cancelAnimationFrame(G.current)}},[]);let W=st(()=>{if(ce.current)return;ce.current=true,$(true),G.current&&cancelAnimationFrame(G.current);let D=performance.now(),w=ne.icons.duration,X=ne.centerButton.duration,V=ne.dialScale.duration,q=Math.max(X,V),_=ne.backdrop.duration,te=de=>{let s=de-D;if(s<w){let Y=Tt(s/w);T(1-Y),G.current=requestAnimationFrame(te);return}let f=w;if(s<f+q){T(0);let Y=Math.min(1,(s-f)/X),he=Math.min(1,(s-f)/V);v(1-Tt(Y)),m(1-Tt(he)),G.current=requestAnimationFrame(te);return}let E=f+q;if(s<E+_){m(0),v(0);let Y=(s-E)/_;d(1-Y),G.current=requestAnimationFrame(te);return}d(0),t()};G.current=requestAnimationFrame(te)},[ne,t]);ze(()=>{let D=document.activeElement,w=ee.current;return()=>{D?.isConnected&&(document.activeElement===document.body||w?.contains(document.activeElement))&&D.focus()}},[]),ze(()=>{if(n)return;Z.current?.focus();let D=w=>{let X=ee.current;if(X){if(w.key==="Escape")w.preventDefault(),W();else if(w.key==="Tab"){let V=Array.from(X.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(te=>te.getClientRects().length>0),q=V[0],_=V[V.length-1];(!X.contains(document.activeElement)||(w.shiftKey?document.activeElement===q:document.activeElement===_))&&(w.preventDefault(),(w.shiftKey?_:q)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(w.key)){let V=Array.from(X.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),q=V.indexOf(document.activeElement);if(q<0||!V.length)return;w.preventDefault();let _=w.key==="Home"?0:w.key==="End"?V.length-1:(q+(w.key==="ArrowRight"||w.key==="ArrowDown"?1:-1)+V.length)%V.length;V[_].focus()}}};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[W,n]);let[He,Ye]=Q(false);ze(()=>{if(i)return;let D=false,w=setTimeout(async()=>{let X=await Zt.getItem(po);!D&&!X&&Ye(true)},1200);return()=>{D=true,clearTimeout(w)}},[i]);let Ae=st(()=>{Ye(false),Zt.setItem(po,"true")},[]);ze(()=>{n&&He&&Ae()},[n,He,Ae]);let Qe=st(D=>{if(D.id.startsWith("empty-")||ce.current)return;let[w,X]=J.iconSelect.pulse,V=performance.now(),q=150,_=te=>{let de=te-V;if(de<q){let s=$e(de/q);z(1-(1-w.scale)*s),requestAnimationFrame(_)}else if(de<q*2){let s=$e((de-q)/q);z(w.scale+(X.scale-w.scale)*s),requestAnimationFrame(_)}else z(1)};requestAnimationFrame(_),setTimeout(()=>{D.onPress(),W()},J.iconSelect.actionDelay)},[J.iconSelect,W]),Ze=st(D=>{if(ce.current)return;let w=Math.max(0,Math.min(D,ae-1));w!==r&&xe(w)},[ae,r]),De=j.buttonSize*S.centerButton.containerRatio,et=j.buttonSize*S.centerButton.borderRatio,St=j.buttonSize*S.centerButton.containerRatio/2+6,vt=C&&!M;return ge("div",{ref:ee,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[B("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:W,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:F.dialBackdrop,opacity:u}}),ge("div",{style:{position:"absolute",left:"50%",marginLeft:-j.circleSize/2,bottom:80,width:j.circleSize,height:j.circleSize,borderRadius:"50%",backgroundColor:F.dialBackground,border:`${S.circle.borderWidth}px solid ${F.dialBorder}`,boxShadow:`0 0 ${S.circle.shadowRadius}px ${Qt(F.dialShadow,S.circle.shadowOpacity)}`,transform:`scale(${p}) rotate(${x}deg)`,opacity:p>.01?1:0,overflow:"hidden"},children:[B("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:F.dialGradient1,opacity:S.gradientLayers[0].opacity}}),B("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:F.dialGradient2,opacity:S.gradientLayers[1].opacity}}),B("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:F.dialGradient3,opacity:S.gradientLayers[2].opacity}}),Re.map(D=>B("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:S.grid.lineHeight,transform:`rotate(${D}deg)`,transformOrigin:"center"},children:["left","right"].map(w=>B("div",{style:{position:"absolute",top:0,[w]:0,width:`calc(50% - ${St}px)`,height:S.grid.lineHeight,backgroundColor:F.dialGridLine}},w))},D)),B("div",{"data-testid":"dial-background","data-background":l,style:{position:"absolute",inset:0,pointerEvents:"none"},children:l==="hyperspace"?B(lr,{size:j.circleSize}):B(Ki,{focus:fr})}),L.map((D,w)=>B(yr,{icon:D,index:w,totalIcons:L.length,position:fe[w],progress:I,onPress:()=>Qe(D)},w)),ge("div",{style:{position:"absolute",left:"50%",top:"50%",width:De,height:De,marginLeft:-De/2,marginTop:-De/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:F.hubHalo,borderRadius:j.buttonSize,overflow:"hidden",transform:`scale(${R*k})`,opacity:R>.01?1:0},children:[B("div",{style:{position:"absolute",inset:0,backgroundColor:F.dialGradient1,opacity:.5,borderRadius:j.buttonSize}}),B("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:F.dialGradient2,opacity:.3,borderRadius:j.buttonSize}}),B("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:F.dialGradient3,opacity:.2,borderRadius:j.buttonSize}}),B("div",{style:{width:et,height:et,borderRadius:j.buttonSize*S.centerButton.borderRadiusRatio,backgroundColor:F.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:B("button",{ref:Z,type:"button","aria-label":n?"Close settings":"Open settings",disabled:!a,onClick:a,onMouseEnter:()=>b(true),onMouseLeave:()=>b(false),style:{border:0,padding:0,background:"transparent",width:j.buttonSize,height:j.buttonSize,borderRadius:j.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:a?"pointer":"default",transform:O?`scale(${J.centerHover.scale})`:"scale(1)",transition:`transform ${J.centerHover.duration}ms ease`,animation:vt&&!O?ve.pulse:"none"},children:n?ge("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:S.centerButton.text.fontSize-2,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:F.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${F.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[B("span",{style:{marginBottom:-2},children:"CLOSE"}),B("span",{style:{marginTop:-2},children:"SETTINGS"})]}):B("span",{style:{fontSize:S.centerButton.text.fontSize,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:F.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${F.centerTextGlow}`,textTransform:"uppercase"},children:o})})})]})]}),ae>1&&ge("div",{style:{position:"absolute",left:"50%",marginLeft:-j.circleSize/2,top:"calc(100% - 64px)",width:j.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,p),transform:`scale(${Math.min(1,p)})`},children:[B(fo,{side:"prev",disabled:r<=0,onClick:()=>Ze(r-1)}),ge("span",{style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:eo,letterSpacing:2,color:F.centerText,textShadow:`0 0 6px ${F.centerTextGlow}`},children:[String(r+1).padStart(2,"0"),ge("span",{style:{color:F.iconLabelMuted,textShadow:"none"},children:[" / ",String(ae).padStart(2,"0")]})]}),B(fo,{side:"next",disabled:r>=ae-1,onClick:()=>Ze(r+1)})]}),He&&!n&&B(uo,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:Ae,showArrow:false})]})}import{persistentStorage as yo,devToolsStorageKeys as br}from"@buoy-gg/shared-ui/web";import{recordUsage as Sr,pruneUsage as vr}from"@buoy-gg/floating-tools-core/web";var bo=br.dial.usage(),je={},So=false,zt=null;function vo(){return zt||(zt=(async()=>{try{let e=await yo.getItem(bo);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(je=t)}}catch{}finally{So=true}})(),zt)}vo();function wr(e){return e.map((t,o)=>({id:t,index:o,lastUsed:je[t]?.lastUsed??0})).sort((t,o)=>o.lastUsed-t.lastUsed||t.index-o.index).map(({id:t})=>t)}async function xr(e){if(!e)return;So||await vo();let t=Math.max(Date.now(),...Object.values(je).map(o=>o.lastUsed+1));je=vr(Sr(je,e,t),t);try{await yo.setItem(bo,JSON.stringify(je))}catch{}}import{useCallback as Cr,useMemo as wo}from"react";import{persistentStorage as Tr}from"@buoy-gg/shared-ui/web";import{useState as oe,useEffect as be,useCallback as ct,useMemo as dt}from"react";import{settingsEventBus as ut}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as zr}from"react";import{getRegisteredToolModule as kr}from"@buoy-gg/shared-ui/web";var Ir=()=>()=>{},Mr=()=>null;function Rr(){let e=kr("@buoy-gg/external-sync");return zr(e?.subscribeSyncStatus??Ir,()=>e?.getSyncStatus?.()??null,Mr)}import{SentryIcon as Ar,WifiCircuitIcon as Dr,ImageOverlayIcon as Er,RenderCountIcon as Br,Info as kt,Layers as Or,ChevronRightIcon as xo,ChevronDown as Co,getStorageBackendType as Fr,getUseLicense as Lr,signOutOfBuoy as Pr,persistentStorage as ke,Trash2 as $r,CheckCircle2 as To,LicenseEntryModal as jr,BackgroundSwitcher as Hr,night as h,NightCard as Ie,NightRows as It,NightSectionLabel as Wr,NightFootnote as zo,NightSwitch as ko,NightButton as Mt,NightSegmented as Nr,NightBadge as ue,NightSeparator as Vr,monoFont as Io}from"@buoy-gg/shared-ui/web";import{EnvIcon as Mo,StorageIcon as Ur,RoutesIcon as Kr,NetworkIcon as _r,QueryIcon as qr,HighlighterIcon as Gr,ReduxIcon as Jr,EventsIcon as Xr}from"@buoy-gg/floating-tools-core/web";import Yr,{createContext as Qr,useContext as Zr}from"react";import{jsx as es}from"react/jsx-runtime";var Ro=Qr({});function ts({children:e,defaultFloatingTools:t,defaultDialTools:o}){let a=Yr.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:o}),[t,o]);return es(Ro.Provider,{value:a,children:e})}function Ao(){return Zr(Ro)}import os from"react";import{toolTheme as ns}from"@buoy-gg/shared-ui/web";import{jsx as Do}from"react/jsx-runtime";function as({label:e,size:t,color:o=ns.colors.text}){let a=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),n=a<=2?t:t*1.6,i=Math.max(7,Math.min(t*(a===1?.7:.62),n/(.62*a)));return Do("span",{style:{display:"inline-flex",minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center",color:o,fontSize:i,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}function Eo(e,t){return e==null?e:typeof e=="function"?os.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?Do(as,{label:String(e),size:t.size,color:t.color}):e}import{JsModal as is,devToolsStorageKeys as Rt,onSettingsApplied as rs}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as ss}from"@buoy-gg/shared-ui/web";import{Fragment as Ve,jsx as c,jsxs as P}from"react/jsx-runtime";var Ue="@react_buoy_dev_tools_settings",ls=6,pt=e=>{let t=ls,o={};for(let[a,n]of Object.entries(e))n&&t>0?(o[a]=true,t-=1):o[a]=false;return o},cs=(e,t)=>{let{userStatus:o,environment:a,...n}=e,i=t?Object.entries(n).filter(([l])=>t.includes(l)):Object.entries(n);return{...Object.fromEntries(i),environment:a??false}},Bo=(e,t,o)=>{if(!t)return e;let a={...e.dialTools,...t.dialTools??{}},n=o?.allowedDialKeys?Object.entries(a).filter(([i])=>o.allowedDialKeys?.includes(i)):Object.entries(a);return{dialTools:pt(Object.fromEntries(n)),floatingTools:cs({...e.floatingTools,...t.floatingTools??{}},o?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},ds=(e=[],t,o)=>{let a={},n={},i=new Set(t??[]),l=new Set(o??[]),u=!o||o.length===0;for(let d of e){let{id:p,slot:m="both"}=d;(m==="dial"||m==="both")&&(a[p]=u?true:l.has(p)),(m==="row"||m==="both")&&(n[p]=i.has(p))}return{dialTools:pt(a),floatingTools:{...n,environment:i.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},us=({visible:e,onClose:t,onSettingsChange:o,initialSettings:a,availableApps:n=[],storage:i=ke,zIndex:l})=>{let{defaultFloatingTools:u,defaultDialTools:d}=Ao(),p=dt(()=>ds(n,u,d),[n,u,d]),m=dt(()=>Object.keys(p.dialTools),[p]),x=dt(()=>Object.keys(p.floatingTools).filter(s=>s!=="environment"),[p]),[g,R]=oe(a||Ke||p),[v,I]=oe(At??"floating"),[T,k]=oe(At!==null),[z,O]=oe(new Set),[b,M]=oe(false),[$,C]=oe(false);be(()=>{let s=requestAnimationFrame(()=>C(true));return()=>cancelAnimationFrame(s)},[]);let A=Rr();be(()=>{(async()=>{try{let s=await ke.getItem(Rt.settings.activeTab());if(s&&["floating","settings","pro"].includes(s)){let f=s;At=f,I(E=>E===f?E:f)}}catch{}finally{k(true)}})()},[]),be(()=>{T&&ke.setItem(Rt.settings.activeTab(),v).catch(s=>{console.warn("Failed to save settings active tab:",s)})},[v,T]);let ee=Lr()?.(),Z=ee?.isPro??false,G=!Z&&ee?.licenseKey?ee.error:null,ce=ee?.errorKind==="transport",[K,ne]=oe(Oo),[J,ve]=oe(false),[me,we]=oe(false),[j,Re]=oe(false),[fe,se]=oe([]),[xe,ae]=oe(false),r=ss(),L=Vt.get("window").height,W=Vt.get("window").width,He=Math.floor(L*.33),Ye=Math.min(W-32,400),Ae=ct(async()=>{try{let s=await i.getItem(Ue);if(s){let f=JSON.parse(s),E=Bo(p,f,{allowedDialKeys:m,allowedFloatingKeys:x});Ke=E,R(Y=>Fo(Y,E)?Y:E);return}Ke=p,R(f=>Fo(f,p)?f:p)}catch(s){console.error("Failed to load dev tools settings:",s),R(p)}},[p,m,x,i]);be(()=>{Ae()},[Ae]),be(()=>{Fr().then(s=>{Oo=s,ne(f=>f===s?f:s)})},[]),be(()=>{j&&(ae(true),ke.getAllKeys().then(s=>{se(s.sort())}).catch(()=>{se([])}).finally(()=>{ae(false)}))},[j]);let Qe=async s=>{try{let f={...s,dialTools:pt(s.dialTools)};await i.setItem(Ue,JSON.stringify(f)),Ke=f,R(f),o?.(f),ut.emit(f)}catch(f){console.error("Failed to save dev tools settings:",f)}},Ze=s=>{let f={...g,floatingTools:{...g.floatingTools,[s]:!g.floatingTools[s]}};Qe(f)},De=s=>{let f={...g,globalSettings:{...g.globalSettings,[s]:!g.globalSettings?.[s]}};Qe(f)},et=async()=>{ve(true),we(false);try{await ke.clear(),we(true),R(p),i!==ke&&await i.setItem(Ue,JSON.stringify(p)),o?.(p),ut.emit(p),setTimeout(()=>we(false),2e3)}catch(s){console.error("Failed to clear storage:",s)}finally{ve(false)}},St=ct(s=>{},[]),vt=s=>{let f=n.find(E=>E.id===s);return f?.description?f.description:s==="environment"?"Environment badge.":""},D=s=>s==="environment"?"Env Badge":n.find(f=>f.id===s)?.name??s.toUpperCase().replace(/_/g," "),w=s=>{if(!$)return null;switch(s){case"query":return c(qr,{size:18});case"env":return c(Mo,{size:18});case"sentry":return c(Ar,{size:18,color:"#9945FF"});case"storage":return c(Ur,{size:18,bgColor:h.color.surface});case"wifi":case"query-wifi-toggle":return c(Dr,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return c(Kr,{size:18,bgColor:h.color.surface});case"network":return c(_r,{size:18});case"environment":return c(Mo,{size:18});case"debug-borders":return c(Or,{size:18,color:h.color.accent});case"highlight-updates":return c(Br,{size:18,color:h.color.accent});case"highlight-updates-modal":return c(Gr,{size:18});case"redux":return c(Jr,{size:18});case"image-overlay":return c(Er,{size:18});case"events":return c(Xr,{size:18});case"zustand":try{let{ZustandIcon:f}=_t("@buoy-gg/zustand/web");return c(f,{size:18})}catch{return c(kt,{size:18,color:h.color.textSecondary})}case"jotai":try{let{JotaiIcon:f}=_t("@buoy-gg/jotai/web");return c(f,{size:18})}catch{return c(kt,{size:18,color:h.color.textSecondary})}default:{let f=n.find(E=>E.id===s);return f?.icon!=null?Eo(f.icon,{slot:"row",size:18,color:f.color}):c(kt,{size:18,color:h.color.textSecondary})}}},X=(s,f,E,Y)=>{let he=vt(s);return P(tt,{activeOpacity:E?1:.7,onPress:()=>!E&&Y(),accessibilityLabel:D(s),accessibilityRole:"button",style:[y.toolRow,E&&y.rowDisabled],children:[c(H,{style:y.toolIconSlot,children:w(s)}),P(H,{style:y.rowInfo,children:[P(N,{style:y.rowLabel,children:[D(s),E?" \xB7 max 6":""]}),he?c(N,{style:y.rowCaption,numberOfLines:1,children:he}):null]}),c(ko,{value:f,disabled:E,onValueChange:()=>Y()})]},s)},V=s=>{O(f=>{let E=new Set(f);return E.has(s)?E.delete(s):E.add(s),E})},q=(s,f,E,Y,he)=>{let ye=g.globalSettings?.[s]??false,Ee=z.has(s);return P(H,{children:[P(tt,{activeOpacity:.7,onPress:()=>V(s),accessibilityLabel:f,style:y.settingRow,children:[P(H,{style:y.rowInfo,children:[c(N,{style:y.rowLabel,children:f}),c(N,{style:y.rowCaption,numberOfLines:Ee?0:1,children:E})]}),c(ko,{value:ye,onValueChange:()=>De(s)})]}),Ee&&P(H,{style:y.settingRowBody,children:[c(N,{style:y.settingRowBodyText,children:Y}),c(N,{style:y.settingRowBodyHint,children:he})]})]},s)},_=(s,f,E)=>P(H,{children:[c(Wr,{children:s}),f,E]}),te=K==="filesystem"?c(ue,{label:"File System",tone:"accent"}):K==="asyncstorage"?c(ue,{label:"Async Storage",tone:"warning"}):K==="localstorage"?c(ue,{label:"Local Storage",tone:"accent"}):K==="memory"?c(ue,{label:"Memory",tone:"danger"}):c(ue,{label:"Loading\u2026",tone:"neutral"}),de=()=>P(H,{style:y.container,children:[P(Nt,{style:y.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:y.scrollContainer,children:[v==="floating"&&c(Ve,{children:_("Floating Tools",c(Ie,{glass:true,children:c(It,{children:Object.entries(g.floatingTools).map(([s,f])=>X(s,f,false,()=>Ze(s)))})}),c(zo,{children:"Tools switched on here appear in the floating bubble row."}))}),v==="settings"&&P(Ve,{children:[_("Background",c(Ie,{glass:true,padded:true,children:c(Hr,{embedded:true})})),_("Storage",P(Ie,{glass:true,children:[P(tt,{activeOpacity:.7,onPress:()=>Re(!j),accessibilityLabel:"Storage Type",style:y.settingRow,children:[c(H,{style:y.rowInfo,children:c(N,{style:y.rowLabel,children:"Storage Type"})}),te,j?c(Co,{size:16,color:h.color.textTertiary}):c(xo,{size:16,color:h.color.textTertiary})]}),j&&P(Ve,{children:[P(H,{style:y.settingRowBody,children:[c(N,{style:y.settingRowBodyText,children:K==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":K==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":K==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":K==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),K==="asyncstorage"&&c(N,{style:[y.settingRowBodyText,y.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),K==="memory"&&c(N,{style:[y.settingRowBodyText,y.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),c(Vr,{}),P(H,{style:y.storageExpanded,children:[P(H,{style:y.storageExpandedHeader,children:[c(N,{style:y.storageExpandedTitle,children:"SAVED SETTINGS"}),c(N,{style:y.storageExpandedCount,children:xe?"\u2026":`${fe.length} keys`})]}),xe?c(N,{style:y.storageKeyEmpty,children:"Loading\u2026"}):fe.length===0?c(N,{style:y.storageKeyEmpty,children:"No settings saved yet"}):c(Nt,{style:y.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:fe.map(s=>c(H,{style:y.storageKeyItem,children:c(N,{style:y.storageKeyText,numberOfLines:1,children:s.replace("@react_buoy_","")})},s))})]}),c(H,{style:y.cardButtonWrap,children:c(Mt,{label:me?"Cleared":J?"Clearing\u2026":"Clear All Settings",variant:me?"secondary":"destructive",size:"md",disabled:J,onPress:et,icon:me?c(To,{size:15,color:h.color.accent}):c($r,{size:15,color:J?h.color.textTertiary:h.color.danger})})})]})]})),A&&A.state!=="idle"&&_("Desktop Sync",P(Ie,{glass:true,children:[P(tt,{activeOpacity:.7,onPress:()=>V("desktopSync"),accessibilityLabel:"Buoy Desktop",style:y.settingRow,children:[c(H,{style:y.rowInfo,children:c(N,{style:y.rowLabel,children:"Buoy Desktop"})}),A.state==="connected"?c(ue,{label:"Connected",tone:"accent"}):A.state==="connecting"?c(ue,{label:"Connecting\u2026",tone:"neutral"}):c(ue,{label:"Retrying",tone:"warning"}),z.has("desktopSync")?c(Co,{size:16,color:h.color.textTertiary}):c(xo,{size:16,color:h.color.textTertiary})]}),z.has("desktopSync")&&P(H,{style:y.settingRowBody,children:[P(N,{style:y.settingRowBodyText,children:[A.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",c(N,{style:y.footnoteMono,children:A.targetURL??"(unknown URL)"}),A.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),A.state==="retrying"&&A.lastError&&P(N,{style:[y.settingRowBodyText,y.bodyWarning],children:["Last error: ",A.lastError]})]})]})),_("Modal Behavior",c(Ie,{glass:true,children:P(It,{children:[q("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."),Be.OS!=="web"?q("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]})}))]}),v==="pro"&&P(Ve,{children:[_("License",P(Ie,{glass:true,children:[P(H,{style:y.settingRow,children:[c(H,{style:y.rowInfo,children:c(N,{style:y.rowLabel,children:"License Status"})}),c(H,{testID:"buoy-settings-license-status",accessibilityLabel:Z?"License: Active":"License: Free",children:Z?c(ue,{label:"Active",tone:"accent"}):c(ue,{label:"Free",tone:"neutral"})})]}),ee?.tierSource==="session"?P(H,{style:y.settingRow,children:[c(H,{style:y.rowInfo,children:c(N,{style:y.rowLabel,children:"Signed in with Buoy"})}),c(Mt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void Pr(),testID:"buoy-settings-signout"})]}):null]}),c(zo,{children:Z?"You have full access to all Buoy DevTools features.":G?ce?`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."})),!Z&&P(Ve,{children:[_("Pro Features",c(Ie,{glass:true,children:c(It,{children:["Advanced Settings","Priority Support"].map(s=>P(H,{style:y.featureRow,children:[c(To,{size:16,color:h.color.accent}),c(N,{style:y.rowLabel,children:s})]},s))})})),c(Mt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>M(true)})]})]})]}),c(jr,{visible:b,onClose:()=>M(false),onSuccess:()=>M(false)})]});return c(is,{visible:e,onClose:t,zIndex:l,variant:"night",header:{showToggleButton:false,customContent:c(H,{style:y.headerRow,children:c(Nr,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:v,onChange:s=>I(s)})})},initialMode:"bottomSheet",onModeChange:St,persistenceKey:Rt.settings.root(),enablePersistence:true,maxHeight:L-r.top,initialHeight:He,initialFloatingPosition:{x:(W-Ye)/2,y:r.top+20},enableGlitchEffects:true,children:de()})},ps={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},ms=(e,t)=>{let o=new Set(e??[]),a=new Set(t??[]),n={};for(let l of a)n[l]=true;let i={environment:o.has("environment")};for(let l of o)l!=="environment"&&(i[l]=true);return{dialTools:pt(n),floatingTools:i,globalSettings:{enableSharedModalDimensions:false}}},Ke=null,At=null,Oo=null,Fo=(e,t)=>JSON.stringify(e)===JSON.stringify(t);ut.addListener(e=>{e&&(Ke=e)});var gs=()=>{let{defaultFloatingTools:e,defaultDialTools:t}=Ao(),o=dt(()=>!e&&!t?ps:ms(e,t),[e,t]),[a,n]=oe(o),i=ct(async()=>{try{let u=await ke.getItem(Ue);if(u){let d=JSON.parse(u),p=Bo(o,d);n(p);return}n(o)}catch(u){console.error("Failed to load dev tools settings:",u),n(o)}},[o]);be(()=>rs(u=>{u.includes(Ue)&&i()}),[i]),be(()=>{i();let u=ut.addListener(d=>{try{d&&n(d)}catch{}});return()=>{u()}},[i]);let l=ct(()=>{i()},[i]);return{settings:a,refreshSettings:l}},y=Ut.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:h.gutter,paddingRight:h.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:h.gutter,paddingTop:8,paddingBottom:24,gap:h.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:h.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:h.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:h.color.text,fontSize:h.font.row,fontWeight:"500"},rowCaption:{color:h.color.textTertiary,fontSize:h.font.label},settingRowBody:{paddingHorizontal:h.rowPadH,paddingBottom:h.rowPadV,gap:6},settingRowBodyText:{color:h.color.textSecondary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},settingRowBodyHint:{color:h.color.textTertiary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},bodyWarning:{color:h.color.warning},bodyDanger:{color:h.color.danger},cardButtonWrap:{paddingHorizontal:h.cardPad,paddingTop:10,paddingBottom:h.cardPad},storageExpanded:{paddingHorizontal:h.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:h.color.textSecondary,fontSize:h.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:h.color.textTertiary,fontSize:h.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:h.color.glassElevated,borderRadius:h.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:h.color.textSecondary,fontSize:h.font.micro,fontFamily:Io},storageKeyEmpty:{color:h.color.textTertiary,fontSize:h.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:Io,fontSize:h.font.label,color:h.color.textSecondary}});import{jsx as Lo}from"react/jsx-runtime";var fs=[];function Po({visible:e,onClose:t,availableTools:o=fs,defaultFloatingTools:a,defaultDialTools:n,storage:i=Tr,onSettingsChange:l}){let u=wo(()=>({getItem:async m=>i.getItem(m),setItem:async(m,x)=>i.setItem(m,x)}),[i]),d=wo(()=>o.map(m=>({...m,name:m.name??m.id,icon:typeof m.icon=="function"?x=>m.icon(x.size):m.icon})),[o]),p=Cr(m=>{l?.(m)},[l]);return Lo(ts,{defaultFloatingTools:a,defaultDialTools:n,children:Lo(us,{visible:e,onClose:t,zIndex:11e3,availableApps:d,storage:u,onSettingsChange:p})})}import{persistentStorage as $o}from"@buoy-gg/shared-ui/web";import{createContext as hs,useCallback as Se,useContext as ys,useEffect as Dt,useMemo as bs,useRef as _e,useState as jo}from"react";var Ss=(e,t,o)=>{if(t.singleton){let n=e.find(i=>i.id===t.id);if(n){let i=n.minimized??false;return{instanceId:n.instanceId,wasMinimized:i,apps:[...e.filter(l=>l.instanceId!==n.instanceId),{...n,minimized:false}]}}}let a=o();return{instanceId:a,wasMinimized:false,apps:[...e,{...t,instanceId:a}]}};import{createContext as vs,useCallback as Ho,useContext as ws,useEffect as mt,useMemo as xs,useRef as Wo,useState as gt}from"react";import{JsModal as Cs,ModalHeader as qe,HeaderSearchButton as Ts,TickProvider as zs,ToolScreenHeaderContext as ks,devToolsStorageKeys as No,buoyColors as Vo,gameUIColors as Et}from"@buoy-gg/shared-ui/web";import{jsx as ie,jsxs as ft}from"react/jsx-runtime";var Ge=()=>{},Is={search:"",isSearchActive:false,clearSearch:Ge,close:Ge,minimize:Ge,showToast:Ge,setHeaderOverride:Ge},Uo=vs(null);function Ko(){return ws(Uo)??Is}function Ms(e,t){let{setHeaderOverride:o}=Ko();mt(()=>(o(e),()=>o(null)),t)}var _o=2200,Rs={success:Et.success,error:Et.error,info:Et.info};function As({message:e,type:t,nonce:o}){let a=Wo(new Ce.Value(0)).current;mt(()=>{a.setValue(0),Ce.sequence([Ce.timing(a,{toValue:1,duration:150,useNativeDriver:true}),Ce.delay(_o-450),Ce.timing(a,{toValue:0,duration:300,useNativeDriver:true})]).start()},[o,a]);let n=Rs[t];return ft(Ce.View,{pointerEvents:"none",style:[ht.toast,{opacity:a,borderColor:n+"60"}],children:[ie(H,{style:[ht.toastDot,{backgroundColor:n}]}),ie(N,{style:ht.toastText,numberOfLines:2,children:e})]})}function Ds({app:e,config:t,visible:o,zIndex:a,onClose:n,onMinimize:i,initialModalState:l,enableSharedModalDimensions:u,bodyProps:d}){let p=e.component,[m,x]=gt(false),[g,R]=gt(""),[v,I]=gt(null),[T,k]=gt(null),z=Wo(null),O=Ho(()=>{x(false),R("")},[]),b=Ho((K,ne="info")=>{z.current&&clearTimeout(z.current),k(J=>({message:K,type:ne,nonce:(J?.nonce??0)+1})),z.current=setTimeout(()=>k(null),_o)},[]);mt(()=>()=>{z.current&&clearTimeout(z.current)},[]);let M=xs(()=>({search:m?g:"",isSearchActive:m,clearSearch:O,close:n,minimize:()=>i(),showToast:b,setHeaderOverride:I,instanceId:e.instanceId}),[g,m,O,n,i,b,e.instanceId]),$=v?.title??t.title??e.title??e.id,C=v?.subtitle??t.subtitle,A=v?.onBack,ee=v?.actions??t.headerActions,Z=v?.searchable??t.searchable;mt(()=>{!Z&&m&&O()},[Z,m,O]);let G=u?No.modal.root():No.custom(e.id).modal(),ce=ft(qe,{children:[A&&!m&&ie(qe.Navigation,{onBack:A}),m?ie(qe.Search,{value:g,onChangeText:R,onCancel:O,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):ie(qe.Content,{title:$,subtitle:C}),ft(qe.Actions,{children:[!m&&ee,Z&&!m&&ie(Ts,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>x(true)})]})]});return ie(Uo.Provider,{value:M,children:ie(Cs,{visible:o,onClose:n,onBack:A,onMinimize:i,initialModalState:l,zIndex:a,persistenceKey:G,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:ce,showToggleButton:true},disableScrollWrapper:true,styles:{},children:ft(H,{style:ht.bodyRoot,children:[ie(zs,{children:ie(ks.Provider,{value:I,children:ie(p,{...d})})}),T&&ie(As,{message:T.message,type:T.type,nonce:T.nonce})]})})})}var ht=Ut.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:Vo.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:Vo.text}});import{Fragment as Es,jsx as pe}from"react/jsx-runtime";var qo=hs(null),Go="@react_buoy_open_apps",Bt=44,Bs=12,Os=100,Fs=16,Ls=e=>({x:window.innerWidth-Bt-Fs,y:window.innerHeight-Os-Bt-e*(Bt+Bs)}),Jo=({children:e})=>{let[t,o]=jo([]),[a,n]=jo(false),i=_e([]),l=_e(null),u=_e(false),d=_e(false),p=_e(false),m=Se(b=>{let M="";return o($=>{let{apps:C,instanceId:A}=Ss($,b,()=>`${b.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return M=A,C}),M},[]),x=Se(()=>{if(u.current||!d.current||!p.current)return;u.current=true;let b=l.current;if(!b||b.length===0){n(true);return}l.current=null,b.forEach(({id:M,minimized:$})=>{let C=i.current.find(A=>A.id===M);if(C&&C.component){let A=Eo(C.icon,{slot:"dial",size:20,color:C.color});m({id:C.id,title:C.name,component:C.component,props:C.props,modal:C.modal,launchMode:C.launchMode||"self-modal",singleton:C.singleton??true,icon:A,color:C.color,minimized:$})}}),n(true)},[m]);Dt(()=>{let b=false;return(async()=>{try{let M=await $o.getItem(Go);if(b)return;if(M){let $=JSON.parse(M),C;Array.isArray($)&&$.length>0&&(typeof $[0]=="string"?C=$.map(A=>({id:A,minimized:false})):C=$.filter(A=>typeof A=="object"&&A!==null&&typeof A.id=="string"),C.length&&(l.current=C))}}catch{}b||(d.current=true,x())})(),()=>{b=true}},[x]),Dt(()=>{if(!a)return;let b=t.map(M=>({id:M.id,minimized:M.minimized??false}));$o.setItem(Go,JSON.stringify(b))},[t,a]);let g=Se(b=>{i.current=b,p.current=true,x()},[x]),R=Se(b=>{o(M=>M.length?b?M.filter($=>$.instanceId!==b):M.slice(0,-1):M)},[]),v=Se(()=>o([]),[]),I=Se((b,M)=>{o($=>$.map(C=>C.instanceId===b?{...C,minimized:true,restoreState:M}:C))},[]),T=Se((b,M)=>{o($=>$.map(C=>C.instanceId===b?{...C,minimized:false,restoreState:M??C.restoreState}:C))},[]),k=Se(b=>t.find(M=>M.instanceId===b)?.minimized??false,[t]),z=t.some(b=>b.launchMode!=="toggle-only"&&!b.minimized);Dt(()=>{if(!z)return;let b=M=>{if(M.key!=="Escape"||M.defaultPrevented)return;let $=[...t].reverse().find(C=>C.launchMode!=="toggle-only"&&!C.minimized);$&&R($.instanceId)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[z,R,t]);let O=bs(()=>({openApps:t,isAnyOpen:z,open:m,close:R,closeAll:v,registerApps:g,minimize:I,restore:T,isMinimized:k}),[t,z,m,R,v,g,I,T,k]);return pe(qo.Provider,{value:O,children:e})},yt=()=>{let e=ys(qo);return e||{openApps:[],isAnyOpen:false,open:()=>"",close:()=>{},closeAll:()=>{},registerApps:()=>{},minimize:()=>{},restore:()=>{},isMinimized:()=>false}},Ps=9e3,$s={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},js={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Hs=({app:e,zIndex:t,onClose:o,onMinimize:a,minimizeTargetPosition:n,enableSharedModalDimensions:i})=>{let l=e.component,u=!e.minimized,d={...e.props??{},...i?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?pe(Ds,{app:e,config:e.modal,visible:u,zIndex:t,onClose:o,onMinimize:a,initialModalState:e.restoreState,enableSharedModalDimensions:i,bodyProps:d}):e.launchMode==="self-modal"?pe(l,{...d,visible:u,onClose:o,onRequestClose:o,onMinimize:a,minimizeTargetPosition:n,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState}):e.launchMode==="inline"?u?pe("div",{style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:pe(l,{...d,onClose:o,onMinimize:a,minimizeTargetPosition:n,instanceId:e.instanceId})}):null:pe("div",{style:{...$s,zIndex:t,display:u?"flex":"none"},children:pe("div",{style:js,children:pe(l,{...d,onClose:o,onMinimize:a,minimizeTargetPosition:n,instanceId:e.instanceId})})})},Xo=()=>{let{openApps:e,close:t,minimize:o}=yt(),{settings:a}=gs(),n=e.filter(u=>u.launchMode!=="toggle-only");if(n.length===0)return null;let i=n.filter(u=>u.minimized).length,l=Li()??Ls(i);return pe(Es,{children:n.map((u,d)=>pe(Hs,{app:u,zIndex:Ps+d,onClose:()=>t(u.instanceId),onMinimize:p=>o(u.instanceId,p),enableSharedModalDimensions:a.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:l},u.instanceId))})};import{useCallback as Ws,useEffect as Ot,useRef as Ns,useState as Yo,useSyncExternalStore as Qo}from"react";import{persistentStorage as Zo,getToolAttention as Ft,subscribeToolAttention as en}from"@buoy-gg/shared-ui/web";import{jsx as re,jsxs as bt}from"react/jsx-runtime";function Vs(e){return Qo(en,()=>Ft(e),()=>Ft(e))}var tn={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},on={needsInput:3,failed:2,done:1},nn=new Map;function an(e){let t=null;for(let a of e?e.split("|"):[]){let n=Ft(a);n&&(!t||on[n.kind]>on[t.kind])&&(t=n)}let o=nn.get(e);return o&&t&&o.kind===t.kind&&o.label===t.label?o:!o&&!t?null:(nn.set(e,t),t)}function Us(e){let t=e.join("|");return Qo(en,()=>an(t),()=>an(t))}var rn=28,Lt=32,Pt=6,sn=8,ln=24,cn="@react_buoy_minimized_stack_expanded",Ks=80,dn=2e3,_s=6e3,qs="#1A1A1A",Je="#888888";function un({down:e=false}){return re("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:re("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:Je,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Gs({id:e,title:t,icon:o,index:a,onPress:n}){let i=Vs(e),l=Ns(null);return Ot(()=>{let u=true,d,p=()=>{l.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:Ks,easing:"linear"})},m=x=>{let g=x?500+Math.random()*1500+a*200:dn+Math.random()*(_s-dn)+a*300;d=setTimeout(()=>{u&&(p(),m(false))},g)};return m(true),()=>{u=false,clearTimeout(d)}},[a]),bt("button",{type:"button","aria-label":i?`${t} \u2014 ${i.label}. Restore`:`Restore ${t}`,onClick:n,style:{width:Lt,height:Lt,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[re("div",{ref:l,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:o}),i?re("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${i.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:tn[i.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:i.kind==="needsInput"?"!":""}):null]})}function Js({containerWidth:e=32}){let{openApps:t,restore:o}=yt(),a=t.filter(g=>g.minimized&&g.launchMode!=="toggle-only"),[n,i]=Yo(false),[l,u]=Yo(false),d=Us(a.map(g=>g.id));Ot(()=>{let g=false;return(async()=>{let R=await Zo.getItem(cn);!g&&R==="true"&&i(true),g||u(true)})(),()=>{g=true}},[]),Ot(()=>{l&&Zo.setItem(cn,n?"true":"false")},[n,l]);let p=Ws(g=>{o(g)},[o]);if(a.length===0)return null;let m=sn+a.length*Lt+(a.length-1)*Pt+Pt+ln+4,x={backgroundColor:qs,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${Je}66`,borderLeft:`1px solid ${Je}66`,borderRight:`1px solid ${Je}66`,borderBottom:"none",boxSizing:"border-box"};return bt("div",{style:{height:rn,overflow:"visible",position:"relative"},children:[re("div",{style:{position:"absolute",bottom:"var(--buoy-stack-bottom, 0px)",top:"var(--buoy-stack-top, auto)",left:0,width:e,maxHeight:"var(--buoy-stack-space, calc(100vh - 48px))",visibility:n?"visible":"hidden",height:n?m:0,opacity:n?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:n?"auto":"none",...x},children:bt("div",{style:{height:m,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:sn,gap:Pt,boxSizing:"border-box"},children:[[...a].reverse().map((g,R)=>re(Gs,{id:g.id,title:g.title||g.id,icon:g.icon??re("span",{style:{color:"#fff",fontSize:13},children:(g.title||g.id).slice(0,1).toUpperCase()}),index:R,onPress:()=>p(g.instanceId)},g.instanceId)),re("button",{type:"button","aria-label":"Collapse",onClick:()=>i(false),style:{width:"100%",height:ln,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:re(un,{down:true})})]})}),bt("button",{type:"button","aria-label":`Show ${a.length} minimized tools`,tabIndex:n?-1:0,"aria-hidden":n,onClick:()=>i(true),style:{position:"absolute",bottom:0,left:0,width:e,height:rn,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",...x},children:[re(un,{}),d?re("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:tn[d.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.kind==="needsInput"?"!":""}):null,a.length>1&&re("span",{style:{fontSize:9,fontWeight:600,color:Je,marginLeft:1},children:a.length})]})]})}import{registerToolModules as Xs}from"@buoy-gg/shared-ui/web";import{createElement as Ys}from"react";function pn(e){let t=e.icon;return{...e,icon:typeof t=="function"?o=>Ys(t,{size:o,slot:e.slot??"both",color:e.color}):()=>t}}import{createContext as Qs,useContext as Zs,useState as mn,useMemo as gn}from"react";import{jsx as el}from"react/jsx-runtime";var fn=Qs(null);function hn({children:e}){let[t,o]=mn(false),[a,n]=mn(false),i=gn(()=>t||a,[t,a]),l=gn(()=>({isDialOpen:t,isToolOpen:a,isDevToolsActive:i,setDialOpen:o,setToolOpen:n}),[t,a,i]);return el(fn.Provider,{value:l,children:e})}function $t(){let e=Zs(fn);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:()=>{},setToolOpen:()=>{}}}import*as tl from"@buoy-gg/license/web";import*as ol from"@buoy-gg/shared-ui/web";import*as nl from"@buoy-gg/shared-ui/web/dataViewer";function yn(e){Xs({core:{useDevToolsVisibility:$t},license:tl,"shared-ui":ol,"shared-ui/dataViewer":nl,...e});let t=new Set;return Object.values(e).flatMap(o=>Object.entries(o).flatMap(([a,n])=>!a.endsWith("Preset")||!n||typeof n.id!="string"||!n.component||t.has(n.id)?[]:(t.add(n.id),[pn(n)])))}import{useEffect as jt,useMemo as Ht,useRef as al}from"react";import{LicenseManager as il,useLicense as rl}from"@buoy-gg/license/web";import{registerToolAdapters as sl}from"@buoy-gg/shared-ui/web";function bn(e){return typeof e=="object"&&e!==null?e:void 0}function ll({isDevelopment:e,isLicensed:t,externalSync:o,isAvailable:a}){if(o===false||!a)return false;if(e)return true;let n=bn(o);return t&&n?.enableInRelease===true&&vn(n.socketURL,n)===null}var Sn="http://localhost:42831";function cl(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}function vn(e,t){let o=e??Sn;if(t?.allowInsecureNetwork===true)return null;let a;try{a=new URL(o)}catch{return`[Buoy] externalSync.socketURL "${o}" isn't a valid URL, so this release build won't connect to Buoy Desktop.`}return a.protocol==="https:"||a.protocol==="wss:"||cl(a.hostname)?null:`[Buoy] This release build won't connect to ${o}: release sync carries real user data, and plain http to another machine is readable by anyone on the same network. Use a simulator, an emulator or adb reverse (localhost), an https:// broker, or set externalSync.allowInsecureNetwork: true for a network you trust.`}var dl={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function ul(e,t,o){if(t)return e;let a=null;for(let[n,i]of Object.entries(dl)){if(o?.includes(n))continue;let l=e[n];if(!l?.actions)continue;let u={...l.actions};for(let d of i)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}"] }}.`)});a??(a={...e}),a[n]={...l,actions:u}}return a??e}import{useEffect as pl,useMemo as ml,useState as gl}from"react";import{devToolsStorageKeys as fl,persistentStorage as hl}from"@buoy-gg/shared-ui/web";var yl=8;function bl(){let e="";for(;e.length<yl;)e+=(Math.random()*16|0).toString(16);return e}function Sl(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function vl({appName:e,hardwareName:t,platform:o,installId:a,deviceId:n}){let i=Sl(e??"buoy")||"buoy",l=e??"Buoy Device",u=t?.trim()||o;return n?{deviceId:n,deviceName:`${l} (${u})`}:{deviceId:`${i}-${o}-${a}`,deviceName:`${l} (${u} \xB7 ${a.slice(-4)})`}}function wl(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}async function xl({platform:e=Be.OS,store:t,mint:o=bl}={}){let a=fl.sync.deviceId(),n=t===void 0?e==="web"?wl():hl:t;if(!n)return o();try{let i=await n.getItem(a);if(i&&i.length>0)return i;let l=o();return await n.setItem(a,l),l}catch{return o()}}var Wt=null;function Cl(){return Wt||(Wt=xl()),Wt}function Tl(e,t){let o=e?.deviceId,a=e?.deviceName,n=t.loadId??Cl,i=t.platform??Be.OS,[l,u]=gl(null);return pl(()=>{if(o)return;let d=false;return n().then(p=>{d||u(p)}),()=>{d=true}},[o,n]),ml(()=>{if(!o&&!l)return null;let d=vl({appName:t.appName,hardwareName:t.hardwareName,platform:i,installId:l??"",deviceId:o});return a?{...d,deviceName:a}:d},[o,a,l,t.appName,t.hardwareName,i])}import{getDevServerOrigin as zl,resolveReloadStrategy as kl,scheduleReloadApp as Il}from"@buoy-gg/shared-ui/web";var wn=Date.now(),xn=zl(),Ml={platform:Be.OS,isTV:Be.isTV===true,isTVOS:Be.isTVOS===true},Cn={version:3,getSnapshot:()=>{let e=kl("auto");return{startedAt:wn,devServerOrigin:xn,device:Ml,reload:{available:e!==null,strategy:e}}},subscribe:e=>()=>{},actions:{ping:()=>({ok:true,startedAt:wn,devServerOrigin:xn}),reloadApp:e=>{let t=e??{},{strategy:o,delayMs:a}=Il({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:o,delayMs:a}}}};import{Fragment as Rl,jsx as Me,jsxs as Al}from"react/jsx-runtime";var Dl=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],El=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Bl(e){let t=Ht(()=>Object.fromEntries(Object.entries(e.modules).map(([a,n])=>[a.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),n])),[e.modules]),o=t["react-query"];return o?.useReactQuerySyncAdapter?Me(Ol,{...e,modules:t,query:o}):Me(Tn,{...e,modules:t})}function Ol(e){let t=e.query.useReactQuerySyncAdapter();return Me(Tn,{...e,queryAdapter:t})}function Tn({modules:e,apps:t,requiredEnvVars:o,externalSync:a,headless:n,sentryGetClient:i,queryAdapter:l}){let{isPro:u,tier:d}=rl(),p=Ht(()=>{let T={app:Cn};for(let[k,z]of Object.entries(e))for(let[O,b]of Object.entries(z))O.endsWith("SyncAdapter")&&b&&typeof b=="object"&&(T[k]=b);l&&(T.query=l),e.env?.createEnvSyncAdapter&&(T.env=e.env.createEnvSyncAdapter(o??[]));for(let k of t??[])k.sync&&(T[`custom:${k.id}`]=k.sync);return T},[e,t,o,l]),m=al(p);m.current=p,jt(()=>sl(()=>m.current),[]),jt(()=>{let T=[],k=z=>{let O=z?.();typeof O=="function"&&T.push(O)};return k(e.network?.startNetworkCapture),k(e.storage?.startBrowserStorageCapture),k(e.assets?.startBrowserAssetCapture),e.storage?.storageSyncAdapter?.subscribe&&k(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&k(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let z of T.reverse())z()}},[e]);let x=e["external-sync"],g=typeof ot<"u"?ot:process.env.NODE_ENV!=="production",R=ll({isDevelopment:g,isLicensed:u,externalSync:a,isAvailable:!!x}),v=bn(a);!g&&v?.enableInRelease&&Fl(vn(v.socketURL,v));let I=e.sentry?.SentryRoot;return Al(Rl,{children:[Object.entries(e).flatMap(([T,k])=>Dl.map(z=>{let O=k[z];return O?Me(O,{},`${T}:${z}`):null})),I&&Me(I,{getClient:i}),Object.entries(e).flatMap(([T,k])=>El.map(z=>{let O=k[z];return O&&(!n||z==="ScenariosOverlay"||z==="ImpersonateOverlay")?Me(O,{},`${T}:${z}`):null})),R&&Me(Ll,{module:x,tools:p,options:v,isPro:u,tier:d,dev:g})]})}var zn=null;function Fl(e){!e||e===zn||(zn=e,console.warn(e))}function Ll({module:e,tools:t,options:o,isPro:a,tier:n,dev:i}){let l=Tl(o,{appName:typeof document>"u"?null:document.title||location.hostname,hardwareName:"Browser",platform:"web"}),{socket:u}=e.useExternalSyncSocket({deviceName:l?.deviceName??"Buoy Browser",socketURL:o?.socketURL??(i?e.getDefaultSocketURL():Sn),persistentDeviceId:l?.deviceId??null,platform:"web",enableLogs:o?.enableLogs});jt(()=>{if(!u)return;let m=()=>{u.connected&&il.hasAccountAccess()&&u.emit("device-license",{isPro:a?"1":"0",tier:n})};return m(),u.on("connect",m),()=>{u.off("connect",m)}},[u,a,n]);let d=o?.releaseActions?.join(",")??"",p=Ht(()=>ul(t,i,d?d.split(","):void 0),[t,i,d]);return e.useExternalSync({tools:p,socket:u,deviceId:l?.deviceId??null,enableLogs:o?.enableLogs}),null}import{useState as kn}from"react";import{createPortal as Pl}from"react-dom";import{useBuoySession as $l}from"@buoy-gg/license/web";import{Fragment as In,jsx as Xe,jsxs as Mn}from"react/jsx-runtime";var Rn="#20C997";function jl(){let{status:e,signIn:t,signOut:o}=$l(),[a,n]=kn(false),[i,l]=kn(null);if(typeof document>"u")return null;let u=()=>{l(null),n(true),t().catch(p=>l(p instanceof Error?p.message:"Sign-in did not work. Try again.")).finally(()=>n(false))},d=e.state==="active";return Pl(Xe("div",{"data-buoy-signin":"",style:{position:"fixed",right:"max(16px, env(safe-area-inset-right))",bottom:"max(20px, env(safe-area-inset-bottom))",zIndex:99999,maxWidth:"min(320px, calc(100vw - 32px))",padding:d||i?"12px 14px":0,borderRadius:16,background:d||i?"#0f1419":"transparent",color:"#e6edf3",boxShadow:d||i?"0 10px 30px rgba(0,0,0,.35)":"none",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",fontSize:14,lineHeight:1.45},children:d?Mn(In,{children:[Xe("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),Xe("button",{type:"button",onClick:()=>void o(),style:Hl,"data-testid":"buoy-signout",children:"Sign out"})]}):Mn(In,{children:[i?Xe("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:i}):null,Xe("button",{type:"button",onClick:u,disabled:a,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:Rn,color:"#04130d",fontWeight:600,fontSize:14,cursor:a?"wait":"pointer",boxShadow:"0 8px 24px rgba(0,0,0,.3)"},children:a?"Signing in\u2026":"Sign in to Buoy"})]})}),document.body)}var Hl={marginTop:8,padding:0,border:"none",background:"none",color:Rn,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{jsx as U,jsxs as An}from"react/jsx-runtime";var Wl={},Dn="@react_buoy_floating_menu_tooltip_shown",Nl=Te;function Vl({size:e=14,color:t="#20C997"}){let o=Math.max(2,e/4),a=Math.max(1,e/16);return U("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${o}px)`,gap:a,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((n,i)=>U("div",{style:{width:o,height:o,borderRadius:o/2,backgroundColor:t}},i))})}function Ul(e){return U(hn,{children:U(Jo,{children:U(Kl,{...e})})})}function Kl({environment:e,userRole:t,availableEnvironments:o,onEnvironmentSwitch:a,apps:n,modules:i=Wl,externalSync:l,requiredEnvVars:u,sentryGetClient:d,disableHints:p=false,headless:m=false}){let[x,g]=wt(false),[R,v]=wt(false),I=Ii(false),T=yt(),k=Oe(()=>Gt([...yn(i),...n??[]]),[n,i]),z=$t(),O=T.openApps.some(r=>!r.minimized);le(()=>{z.setDialOpen(x)},[x,z.setDialOpen]),le(()=>{z.setToolOpen(O||R)},[O,R,z.setToolOpen]);let{registerApps:b}=T;le(()=>{b(k.map(r=>{let L=r.icon;return{...r,icon:typeof L=="function"?({size:W})=>L(W):L}}))},[b,k]);let M=Oe(()=>k.map(r=>({id:r.id,name:r.name,description:r.description,slot:r.slot})),[k]),{settings:$}=Mi({availableTools:M,storage:Nl});le(()=>{let r=false;return(async()=>{let[L,W]=await Promise.all([Te.getItem(at.dial.isOpen()),Te.getItem(at.settings.modalOpen())]);r||(L==="true"&&g(true),W==="true"&&(g(true),v(true)),I.current=true)})(),()=>{r=true}},[]),le(()=>{I.current&&Te.setItem(at.dial.isOpen(),x?"true":"false")},[x]),le(()=>{I.current&&Te.setItem(at.settings.modalOpen(),R?"true":"false")},[R]);let C=Fe(r=>{if(xr(r.id),r.launchMode==="toggle-only"){r.onPress?.();return}if(r.component){let L=typeof r.icon=="function"?r.icon(20):r.icon;T.open({id:r.id,title:r.name||nt(r.id),component:r.component,props:r.props,modal:r.modal,launchMode:r.launchMode||"self-modal",singleton:r.singleton??true,icon:L,color:r.color||qt(r.id)})}else r.onPress?.()},[T]),A=Oe(()=>xt(k,"dial").map(r=>{let L=r.color||qt(r.id),W;return typeof r.icon=="string"?W=r.icon:typeof r.icon=="function"?W=r.icon(32):W=null,{id:r.id,name:r.name||nt(r.id),icon:W,unavailable:!r.component&&!r.onPress,color:L,onPress:()=>{C(r),g(false)}}}),[k,C]),ee=Oe(()=>{if(!x)return A;let r=new Map(A.map(L=>[L.id,L]));return wr(A.map(L=>L.id)).map(L=>r.get(L)).filter(L=>!!L)},[x,A]),Z=Oe(()=>xt(k,"row").filter(r=>$.floatingTools[r.id]===true&&(r.component||r.onPress)),[k,$.floatingTools]),G=Oe(()=>k.map(r=>({id:r.id,name:r.name||nt(r.id),description:r.description||Ri(r.id),slot:r.slot,icon:r.icon,color:r.color})),[k]),[ce,K]=wt(false),ne=T.openApps.some(r=>!r.minimized);le(()=>{if(p)return;let r=false,L=setTimeout(async()=>{let W=await Te.getItem(Dn);!r&&!W&&K(true)},1e3);return()=>{r=true,clearTimeout(L)}},[p]);let J=Fe(()=>{K(false),Te.setItem(Dn,"true")},[]),ve=Fe(()=>{J(),g(true)},[J]),me=Fe(()=>{g(false),v(false)},[]),we=Fe(()=>{v(r=>!r)},[]),j=Fe(()=>v(false),[]),Re=!!(o?.length&&a),fe=$.floatingTools.environment!==false,se=ce&&!x&&!ne;le(()=>{if(!se)return;let r=W=>{(!(W.target instanceof Element)||!W.target.closest("[data-buoy-root]"))&&J()},L=W=>{W.key==="Escape"&&J()};return document.addEventListener("pointerdown",r,true),document.addEventListener("keydown",L),()=>{document.removeEventListener("pointerdown",r,true),document.removeEventListener("keydown",L)}},[se,J]);let xe=T.openApps.some(r=>r.minimized&&r.launchMode!=="toggle-only"),ae=U(Bl,{modules:i,apps:n,requiredEnvVars:u,externalSync:l,headless:m,sentryGetClient:d});return m?ae:An("div",{"data-buoy-root":"",style:{display:"contents"},children:[ae,se&&U("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),An(Jt,{enablePositionPersistence:!se,pushToSide:x||ne,suspendPointerEvents:x,centerOnboarding:se,minimizedStack:xe?U(Js,{}):void 0,hasMinimizedStack:xe,children:[e&&fe&&!Re&&U(Ai,{environment:e}),Re&&fe&&U(Di,{currentEnvironment:e??"local",availableEnvironments:o,onSelect:a}),t?U(Xt,{userRole:t,onPress:ve}):U("button",{"aria-label":"Open dev tools",onClick:ve,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:U(Vl,{})}),Z.map(r=>U("button",{"aria-label":r.name||nt(r.id),title:r.description,onClick:()=>C(r),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof r.icon=="function"?r.icon(16):r.icon},r.id))]}),se&&U(uo,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:J}),x&&U(ho,{icons:ee,onClose:me,centerLabel:"BUOY",onCenterPress:we,settingsOpen:R,hintsDisabled:p}),U(Po,{visible:R,onClose:j,availableTools:G,onSettingsChange:r=>{}}),U(Xo,{}),U(wi,{})]})}function _l(e){let{access:t,isPro:o,licenseKey:a}=Ci();le(()=>{xi.configure(e.licenseKey)},[e.licenseKey]);let n=e.licenseKey===void 0||Ti(e.licenseKey,a),i=typeof ot<"u"?ot:process.env.NODE_ENV!=="production",l=n&&t.status==="admitted";return le(()=>{l&&ki()},[l]),le(()=>{i||t.status==="initializing"||(o&&l?vi():Kt())},[i,o,l,t.status]),!i&&!o?e.signIn&&!e.headless?U(jl,{}):null:l?U(Ul,{...e}):e.headless?null:U(zi,{})}import{useSettings as ql,useFloatingTools as Gl,getToolLabel as Jl,getToolDescription as Xl,getToolColor as Yl,settingsColors as Ql,settingsStyles as Zl,dialColors as ec,dialStyles as tc}from"@buoy-gg/floating-tools-react/web";export{ua as Activity,Si as AlertCircle,ma as AlertTriangle,Jo as AppHostProvider,Xo as AppOverlay,_a as Badge,On as BarChart3,jn as BaseEventStore,Ln as Bookmark,fa as Bug,oi as Button,di as Card,ya as Check,Sa as CheckCircle,ba as CheckSquare,wa as ChevronDown,Ca as ChevronLeft,za as ChevronRight,Ia as ChevronUp,Ra as Clock,$n as Cloud,gi as CollapsibleSection,Aa as Copy,ai as CopyButton,Pn as DataViewer,En as Database,hn as DevToolsVisibilityProvider,ho as DialMenu,Qa as DiffViewer,Fi as Divider,Hn as Download,Nn as Edit3,bi as EmptyState,Fn as EventStepperFooter,Da as Eye,Ea as EyeOff,Ba as FileJson,Oa as FileText,Fa as Filter,La as FlaskConical,_l as FloatingDevTools,Jt as FloatingTools,Un as GitBranch,Pa as Globe,_n as HardDrive,$a as Hash,Gn as HelpCircle,Xn as Home,Qn as Image,ja as Info,Xa as InfoRow,ca as JsModal,Wa as Key,Va as Layers,ea as Link,Ka as Lock,oa as Maximize2,aa as Minus,ra as Palette,qa as Pause,la as Pin,Ja as Play,Ya as Plus,Za as Power,ri as PowerToggle,ti as RefreshCw,Wn as RelativeTime,da as Route,li as Row,ni as Search,Bn as SearchBar,pi as SectionHeader,pa as Server,ii as Settings,Po as SettingsModal,si as Shield,ga as Smartphone,ha as Square,Ga as StatusDot,hi as TabSelector,va as Timer,ci as Trash2,xa as Unlock,Ta as Upload,ui as User,Xt as UserStatus,ka as Users,mi as Wifi,fi as X,Ma as XCircle,yi as Zap,Cn as appSyncAdapter,Bi as autoDiscoverWebPresets,Gt as autoDiscoverWithCustom,Kt as clearReleaseOptIn,sa as copyToClipboard,pn as createWebTool,yn as createWebTools,Ei as defaultToolPresets,na as devToolsStorageKeys,ec as dialColors,tc as dialStyles,Vn as formatBytes,Kn as formatDuration,qn as formatNumber,Oi as getEnabledTools,Yl as getToolColor,Xl as getToolDescription,Jl as getToolLabel,xt as getToolsBySlot,Na as methodColor,ta as persistentStorage,Yn as safeStringify,Ql as settingsColors,Zl as settingsStyles,Ha as statusColor,ei as toolTheme,Jn as truncateMiddle,Ua as typeColor,yt as useAppHost,$t as useDevToolsVisibility,Gl as useFloatingTools,Zn as usePersistedState,ia as useSafeAreaInsets,ql as useSettings,Ms as useToolHeader,Ko as useToolHost};
10
+ `,document.head.appendChild(e),To=true}var Lt=qe.accent;function Io({title:e,message:t,onDismiss:o,showArrow:a=true}){let[n,r]=So(false),[i,s]=So(false);Vi(()=>{Xi();let u=requestAnimationFrame(()=>r(true));return()=>cancelAnimationFrame(u)},[]);let d={fontFamily:xo,textTransform:"uppercase"};return Ge("div",{style:{position:"fixed",left:"50%",bottom:Ji(),transform:`translateX(-50%) scale(${n?1:.8})`,opacity:n?1:0,transition:"transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1), opacity 300ms ease",zIndex:10002,pointerEvents:"auto"},children:Co("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ge("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),Co("div",{style:{position:"relative",maxWidth:280,backgroundColor:qe.dialBackground,borderRadius:16,border:`1px solid ${qe.dialBorder}`,padding:20,boxShadow:`0 0 20px ${wo(qe.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ge("span",{style:{...d,fontSize:16,fontWeight:900,letterSpacing:1,color:Lt,textAlign:"center"},children:e}),Ge("span",{style:{fontFamily:xo,fontSize:13,lineHeight:"20px",color:qe.centerText,textAlign:"center"},children:t}),Ge("button",{onClick:o,onPointerDown:()=>s(true),onPointerUp:()=>s(false),onPointerLeave:()=>s(false),onPointerCancel:()=>s(false),style:{...d,marginTop:8,borderRadius:8,border:"none",backgroundColor:Lt,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:i?.7:1,transform:i?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),a&&Ge("div",{style:{position:"absolute",left:"50%",bottom:qi,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${Gi}px solid ${Lt}`,filter:`drop-shadow(0 0 10px ${wo(qe.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}import{Fragment as Yi,jsx as L,jsxs as xe}from"react/jsx-runtime";var Qi={x:.5,y:.5},ko="@react_buoy_settings_tooltip_shown",zo=false;function Zi(){if(zo||typeof document>"u")return;let e=document.createElement("style");e.textContent=Ii(),document.head.appendChild(e),zo=true}var Je=e=>1-Math.pow(1-e,3),Ft=e=>e*e*e;function es({icon:e,index:t,totalIcons:o,position:a,progress:n,onPress:r}){let[i,s]=ee(false),[d,u]=ee(false),m=!e.icon&&e.id.startsWith("empty-"),I=!m&&e.unavailable===true,g=!m&&!I,{icons:D}=po,w=Ci(t,o),E=0;n<=w[1]?E=0:n<=w[2]?E=(n-w[1])/(w[2]-w[1]):E=1,E=Math.max(0,Math.min(1,E));let z=Ti,P=D.pressIn.scale,R=E*(d?P:i?1.1:1),k=0;E<=0?k=0:E<=.3?k=E:k=.3+(E-.3)*(.7/.7);let v=a.x*E,C=a.y*E;return L("button",{role:"menuitem","aria-label":m?"Empty slot":vi(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!g,tabIndex:g?0:-1,onClick:g?r:void 0,onPointerEnter:F=>g&&F.pointerType==="mouse"&&s(true),onPointerLeave:()=>{s(false),u(false)},onPointerDown:()=>g&&u(true),onPointerUp:()=>u(false),onPointerCancel:()=>u(false),style:{position:"absolute",left:"50%",top:"50%",width:z,height:z,marginLeft:-z/2,marginTop:-z/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:g?"pointer":"default",transform:`translate(${v}px, ${C}px) scale(${R})`,opacity:k,transition:i||d?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:m?L("div",{style:{width:S.emptySlot.dotSize,height:S.emptySlot.dotSize,borderRadius:S.emptySlot.dotSize/2,backgroundColor:$.emptyDotBackground,border:`${S.emptySlot.borderWidth}px solid ${$.emptyDotBorder}`}}):xe(Yi,{children:[L("div",{style:{position:"absolute",width:`${S.icon.gradientBgSizePercent}%`,height:`${S.icon.gradientBgSizePercent}%`,borderRadius:S.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:S.icon.gradientBgOpacity}}),L("div",{style:{position:"absolute",width:`${S.icon.innerGlowSizePercent}%`,height:`${S.icon.innerGlowSizePercent}%`,borderRadius:S.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:S.icon.innerGlowOpacity}}),L("div",{style:{marginBottom:S.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:i?"brightness(1.2)":"none"},children:e.icon}),L("span",{style:{fontSize:e.name.length>8?Math.max(S.icon.label.fontSize*.7,S.icon.label.fontSize*8/e.name.length):S.icon.label.fontSize,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,color:$.iconLabel,letterSpacing:S.icon.label.letterSpacing,marginTop:S.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),I&&L("span",{style:{fontSize:S.icon.label.fontSize-1,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,letterSpacing:S.icon.label.letterSpacing,color:zi.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}function Ro({side:e,color:t}){return L("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(e==="prev"?[[15,18,9,12],[9,12,15,6]]:[[9,18,15,12],[15,12,9,6]]).map(([o,a,n,r],i)=>L("line",{x1:o,y1:a,x2:n,y2:r,stroke:t,strokeWidth:2},i))})}function Mo({side:e,disabled:t,onClick:o}){let[a,n]=ee(false),r=t?$.emptyDotBorder:$.accent;return xe("button",{type:"button","aria-label":`${e==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${e}`,disabled:t,onClick:o,onPointerDown:()=>!t&&n(true),onPointerUp:()=>n(false),onPointerLeave:()=>n(false),onPointerCancel:()=>n(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${$.dialBorder}`,backgroundColor:$.dialBackground,color:t?$.iconLabelMuted:$.centerText,fontSize:12,fontWeight:900,fontFamily:fo,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${mo($.dialShadow,.4)}`,transform:a?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&L(Ro,{side:"prev",color:r}),e==="prev"?"PREV":"NEXT",e==="next"&&L(Ro,{side:"next",color:r})]})}function Bo({icons:e,onClose:t,centerLabel:o="MENU",onCenterPress:a,settingsOpen:n=false,hintsDisabled:r=false}){let{id:i}=Mi(),[s,d]=ee(0),[u,m]=ee(0),[I,g]=ee(0),[D,w]=ee(0),[E,z]=ee(0),[P,R]=ee(1),[k,v]=ee(false),[C,F]=ee(false),[T,A]=ee(false),te=yt(null),K=yt(null),J=yt(null),ne=yt(false),{entrance:q,exit:le,interaction:ae}=po,Ce=ki(),[ce,Me]=ee(()=>({width:window.innerWidth,height:window.innerHeight}));Fe(()=>{let b=()=>Me({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);let H=ht(()=>Si({screenWidth:ce.width,maxCircleSize:Math.max(120,Math.min(320,ce.height-96))}),[ce]),Ye=ht(()=>xi(),[]),Be=ht(()=>wi(Qe,H.iconRadius),[H.iconRadius]),[We,De]=ee(0),de=Math.max(1,Math.ceil(e.length/Qe)),Y=Math.min(We,de-1),Te=ht(()=>{let b=Y*Qe,x=[...e.slice(b,b+Qe)];for(;x.length<Qe;)x.push({id:`empty-${x.length}`,name:"",icon:null,onPress:()=>{}});return x},[e,Y]);Fe(()=>{Zi()},[]),Fe(()=>{let b=q.backdrop.duration,x=q.dial.rotation.duration,Q=q.centerButton.delay,V=q.icons.delay,X=q.icons.duration,G=performance.now(),re=he=>{let l=he-G;d(Math.min(1,l/b));let f=Math.min(1,l/400),O=Je(f)*1.1;f>.7&&(O-=(f-.7)*.33),f>=1&&(O=1),m(Math.max(0,Math.min(1.05,O)));let Z=Math.min(1,l/x);if(g(Je(Z)*360),l>=Q){let ke=Math.min(1,(l-Q)/300),Ne=Je(ke)*1.15;ke>.6&&(Ne-=(ke-.6)*.375),ke>=1&&(Ne=1),w(Math.max(0,Math.min(1.05,Ne)))}if(l>=V){let ke=Math.min(1,(l-V)/X);z(Je(ke))}let Ie=V+X;l<Ie?J.current=requestAnimationFrame(re):(d(1),m(1),g(360),w(1),z(1),A(true))};return J.current=requestAnimationFrame(re),()=>{J.current&&cancelAnimationFrame(J.current)}},[]);let fe=bt(()=>{if(ne.current)return;ne.current=true,F(true),J.current&&cancelAnimationFrame(J.current);let b=performance.now(),x=le.icons.duration,Q=le.centerButton.duration,V=le.dialScale.duration,X=Math.max(Q,V),G=le.backdrop.duration,re=he=>{let l=he-b;if(l<x){let Z=Ft(l/x);z(1-Z),J.current=requestAnimationFrame(re);return}let f=x;if(l<f+X){z(0);let Z=Math.min(1,(l-f)/Q),Ie=Math.min(1,(l-f)/V);w(1-Ft(Z)),m(1-Ft(Ie)),J.current=requestAnimationFrame(re);return}let O=f+X;if(l<O+G){m(0),w(0);let Z=(l-O)/G;d(1-Z),J.current=requestAnimationFrame(re);return}d(0),t()};J.current=requestAnimationFrame(re)},[le,t]);Fe(()=>{let b=document.activeElement,x=te.current;return()=>{b?.isConnected&&(document.activeElement===document.body||x?.contains(document.activeElement))&&b.focus()}},[]),Fe(()=>{if(n)return;K.current?.focus();let b=x=>{let Q=te.current;if(Q){if(x.key==="Escape")x.preventDefault(),fe();else if(x.key==="Tab"){let V=Array.from(Q.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(re=>re.getClientRects().length>0),X=V[0],G=V[V.length-1];(!Q.contains(document.activeElement)||(x.shiftKey?document.activeElement===X:document.activeElement===G))&&(x.preventDefault(),(x.shiftKey?G:X)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(x.key)){let V=Array.from(Q.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),X=V.indexOf(document.activeElement);if(X<0||!V.length)return;x.preventDefault();let G=x.key==="Home"?0:x.key==="End"?V.length-1:(X+(x.key==="ArrowRight"||x.key==="ArrowDown"?1:-1)+V.length)%V.length;V[G].focus()}}};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[fe,n]);let[Ee,_e]=ee(false);Fe(()=>{if(r)return;let b=false,x=setTimeout(async()=>{let Q=await go.getItem(ko);!b&&!Q&&_e(true)},1200);return()=>{b=true,clearTimeout(x)}},[r]);let Se=bt(()=>{_e(false),go.setItem(ko,"true")},[]);Fe(()=>{n&&Ee&&Se()},[n,Ee,Se]);let Ae=bt(b=>{if(b.id.startsWith("empty-")||ne.current)return;let[x,Q]=ae.iconSelect.pulse,V=performance.now(),X=150,G=re=>{let he=re-V;if(he<X){let l=Je(he/X);R(1-(1-x.scale)*l),requestAnimationFrame(G)}else if(he<X*2){let l=Je((he-X)/X);R(x.scale+(Q.scale-x.scale)*l),requestAnimationFrame(G)}else R(1)};requestAnimationFrame(G),setTimeout(()=>{b.onPress(),fe()},ae.iconSelect.actionDelay)},[ae.iconSelect,fe]),ge=bt(b=>{if(ne.current)return;let x=Math.max(0,Math.min(b,de-1));x!==Y&&De(x)},[de,Y]),we=H.buttonSize*S.centerButton.containerRatio,Pe=H.buttonSize*S.centerButton.borderRatio,c=H.buttonSize*S.centerButton.containerRatio/2+6,U=T&&!C;return xe("div",{ref:te,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[L("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:fe,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:$.dialBackdrop,opacity:s}}),xe("div",{style:{position:"absolute",left:"50%",marginLeft:-H.circleSize/2,bottom:80,width:H.circleSize,height:H.circleSize,borderRadius:"50%",backgroundColor:$.dialBackground,border:`${S.circle.borderWidth}px solid ${$.dialBorder}`,boxShadow:`0 0 ${S.circle.shadowRadius}px ${mo($.dialShadow,S.circle.shadowOpacity)}`,transform:`scale(${u}) rotate(${I}deg)`,opacity:u>.01?1:0,overflow:"hidden"},children:[L("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:$.dialGradient1,opacity:S.gradientLayers[0].opacity}}),L("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:$.dialGradient2,opacity:S.gradientLayers[1].opacity}}),L("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:$.dialGradient3,opacity:S.gradientLayers[2].opacity}}),Ye.map(b=>L("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:S.grid.lineHeight,transform:`rotate(${b}deg)`,transformOrigin:"center"},children:["left","right"].map(x=>L("div",{style:{position:"absolute",top:0,[x]:0,width:`calc(50% - ${c}px)`,height:S.grid.lineHeight,backgroundColor:$.dialGridLine}},x))},b)),L("div",{"data-testid":"dial-background","data-background":i,style:{position:"absolute",inset:0,pointerEvents:"none"},children:i==="hyperspace"?L(Ki,{size:H.circleSize}):L(Ri,{focus:Qi})}),Te.map((b,x)=>L(es,{icon:b,index:x,totalIcons:Te.length,position:Be[x],progress:E,onPress:()=>Ae(b)},x)),xe("div",{style:{position:"absolute",left:"50%",top:"50%",width:we,height:we,marginLeft:-we/2,marginTop:-we/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:$.hubHalo,borderRadius:H.buttonSize,overflow:"hidden",transform:`scale(${D*P})`,opacity:D>.01?1:0},children:[L("div",{style:{position:"absolute",inset:0,backgroundColor:$.dialGradient1,opacity:.5,borderRadius:H.buttonSize}}),L("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:$.dialGradient2,opacity:.3,borderRadius:H.buttonSize}}),L("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:$.dialGradient3,opacity:.2,borderRadius:H.buttonSize}}),L("div",{style:{width:Pe,height:Pe,borderRadius:H.buttonSize*S.centerButton.borderRadiusRatio,backgroundColor:$.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:L("button",{ref:K,type:"button","aria-label":n?"Close Settings":"Open Dev Tools Settings",disabled:!a,onClick:a,onPointerEnter:b=>b.pointerType==="mouse"&&v(true),onPointerLeave:()=>v(false),style:{border:0,padding:0,background:"transparent",width:H.buttonSize,height:H.buttonSize,borderRadius:H.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:a?"pointer":"default",transform:k?`scale(${ae.centerHover.scale})`:"scale(1)",transition:`transform ${ae.centerHover.duration}ms ease`,animation:U&&!k?Ce.pulse:"none"},children:n?xe("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:S.centerButton.text.fontSize-2,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:$.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[L("span",{style:{marginBottom:-2},children:"CLOSE"}),L("span",{style:{marginTop:-2},children:"SETTINGS"})]}):L("span",{style:{fontSize:S.centerButton.text.fontSize,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:$.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase"},children:o})})})]})]}),de>1&&xe("div",{style:{position:"absolute",left:"50%",marginLeft:-H.circleSize/2,top:"calc(100% - 64px)",width:H.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,u),transform:`scale(${Math.min(1,u)})`},children:[L(Mo,{side:"prev",disabled:Y<=0,onClick:()=>ge(Y-1)}),xe("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:fo,letterSpacing:2,color:$.centerText,textShadow:`0 0 6px ${$.centerTextGlow}`},children:[String(Y+1).padStart(2,"0"),xe("span",{style:{color:$.iconLabelMuted,textShadow:"none"},children:[" / ",String(de).padStart(2,"0")]})]}),L(Mo,{side:"next",disabled:Y>=de-1,onClick:()=>ge(Y+1)})]}),Ee&&!n&&L(Io,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:Se,showArrow:false})]})}import{persistentStorage as Do,devToolsStorageKeys as ts}from"@buoy-gg/shared-ui/web";import{recordUsage as os,pruneUsage as ns}from"@buoy-gg/floating-tools-core/web";var Eo=ts.dial.usage(),Xe={},Ao=false,$t=null;function Po(){return $t||($t=(async()=>{try{let e=await Do.getItem(Eo);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(Xe=t)}}catch{}finally{Ao=true}})(),$t)}Po();function as(e){return e.map((t,o)=>({id:t,index:o,lastUsed:Xe[t]?.lastUsed??0})).sort((t,o)=>o.lastUsed-t.lastUsed||t.index-o.index).map(({id:t})=>t)}async function rs(e){if(!e)return;Ao||await Po();let t=Math.max(Date.now(),...Object.values(Xe).map(o=>o.lastUsed+1));Xe=ns(os(Xe,e,t),t);try{await Do.setItem(Eo,JSON.stringify(Xe))}catch{}}import{useCallback as is,useMemo as Oo}from"react";import{persistentStorage as ss}from"@buoy-gg/shared-ui/web";import{useState as ie,useEffect as ze,useCallback as St,useMemo as wt}from"react";import{settingsEventBus as xt}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as ls}from"react";import{getRegisteredToolModule as cs}from"@buoy-gg/shared-ui/web";var ds=()=>()=>{},us=()=>null;function ps(){let e=cs("@buoy-gg/external-sync");return ls(e?.subscribeSyncStatus??ds,()=>e?.getSyncStatus?.()??null,us)}import{SentryIcon as ms,WifiCircuitIcon as gs,ImageOverlayIcon as fs,RenderCountIcon as hs,Info as jt,Layers as ys,ChevronRightIcon as Lo,ChevronDown as Fo,getStorageBackendType as bs,getUseLicense as vs,signOutOfBuoy as Ss,persistentStorage as $e,Trash2 as ws,CheckCircle2 as $o,LicenseEntryModal as xs,BackgroundSwitcher as Cs,night as h,NightCard as je,NightRows as Ht,NightSectionLabel as Ts,NightFootnote as jo,NightSwitch as Ho,NightButton as Wt,NightSegmented as Is,NightBadge as be,NightSeparator as ks,monoFont as Wo}from"@buoy-gg/shared-ui/web";import{EnvIcon as _o,StorageIcon as zs,RoutesIcon as Rs,NetworkIcon as Ms,QueryIcon as Bs,HighlighterIcon as Ds,ReduxIcon as Es,EventsIcon as As}from"@buoy-gg/floating-tools-core/web";import Ps,{createContext as Os,useContext as Ls}from"react";import{jsx as Fs}from"react/jsx-runtime";var No=Os({});function Uo({children:e,defaultFloatingTools:t,defaultDialTools:o}){let a=Ps.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:o}),[t,o]);return Fs(No.Provider,{value:a,children:e})}function Ko(){return Ls(No)}import $s from"react";import{toolTheme as js}from"@buoy-gg/shared-ui/web";import{jsx as Vo}from"react/jsx-runtime";function Hs({label:e,size:t,color:o=js.colors.text}){let a=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),n=a<=2?t:t*1.6,r=Math.max(7,Math.min(t*(a===1?.7:.62),n/(.62*a)));return Vo("span",{style:{display:"inline-flex",minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center",color:o,fontSize:r,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}function qo(e,t){return e==null?e:typeof e=="function"?$s.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?Vo(Hs,{label:String(e),size:t.size,color:t.color}):e}import{JsModal as Ws,devToolsStorageKeys as _t,onSettingsApplied as _s,expandableWindowControlsSupported as Ns}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Us}from"@buoy-gg/shared-ui/web";import{Fragment as et,jsx as p,jsxs as W}from"react/jsx-runtime";var tt="@react_buoy_dev_tools_settings",Ks=6,Ct=e=>{let t=Ks,o={};for(let[a,n]of Object.entries(e))n&&t>0?(o[a]=true,t-=1):o[a]=false;return o},Vs=(e,t)=>{let{userStatus:o,environment:a,...n}=e,r=t?Object.entries(n).filter(([i])=>t.includes(i)):Object.entries(n);return{...Object.fromEntries(r),environment:a??false}},Go=(e,t,o)=>{if(!t)return e;let a={...e.dialTools,...t.dialTools??{}},n=o?.allowedDialKeys?Object.entries(a).filter(([r])=>o.allowedDialKeys?.includes(r)):Object.entries(a);return{dialTools:Ct(Object.fromEntries(n)),floatingTools:Vs({...e.floatingTools,...t.floatingTools??{}},o?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},qs=(e=[],t,o)=>{let a={},n={},r=new Set(t??[]),i=new Set(o??[]),s=!o||o.length===0;for(let d of e){let{id:u,slot:m="both"}=d;(m==="dial"||m==="both")&&(a[u]=s?true:i.has(u)),(m==="row"||m==="both")&&(n[u]=r.has(u))}return{dialTools:Ct(a),floatingTools:{...n,environment:r.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},Gs=({visible:e,onClose:t,onSettingsChange:o,initialSettings:a,availableApps:n=[],storage:r=$e,zIndex:i})=>{let{defaultFloatingTools:s,defaultDialTools:d}=Ko(),u=wt(()=>qs(n,s,d),[n,s,d]),m=wt(()=>Object.keys(u.dialTools),[u]),I=wt(()=>Object.keys(u.floatingTools).filter(l=>l!=="environment"),[u]),[g,D]=ie(a||ot||u),[w,E]=ie(Nt??"floating"),[z,P]=ie(Nt!==null),[R,k]=ie(new Set),[v,C]=ie(false),[F,T]=ie(false);ze(()=>{let l=requestAnimationFrame(()=>T(true));return()=>cancelAnimationFrame(l)},[]);let A=ps();ze(()=>{(async()=>{try{let l=await $e.getItem(_t.settings.activeTab());if(l&&["floating","settings","pro"].includes(l)){let f=l;Nt=f,E(O=>O===f?O:f)}}catch{}finally{P(true)}})()},[]),ze(()=>{z&&$e.setItem(_t.settings.activeTab(),w).catch(l=>{console.warn("Failed to save settings active tab:",l)})},[w,z]);let te=vs()?.(),K=te?.isPro??false,J=!K&&te?.licenseKey?te.error:null,ne=te?.errorKind==="transport",[q,le]=ie(Jo),[ae,Ce]=ie(false),[ce,Me]=ie(false),[H,Ye]=ie(false),[Be,We]=ie([]),[De,de]=ie(false),Y=Us(),Te=no.get("window").height,fe=no.get("window").width,Ee=Math.floor(Te*.33),_e=Math.min(fe-32,400),Se=St(async()=>{try{let l=await r.getItem(tt);if(l){let f=JSON.parse(l),O=Go(u,f,{allowedDialKeys:m,allowedFloatingKeys:I});ot=O,D(Z=>Xo(Z,O)?Z:O);return}ot=u,D(f=>Xo(f,u)?f:u)}catch(l){console.error("Failed to load dev tools settings:",l),D(u)}},[u,m,I,r]);ze(()=>{Se()},[Se]),ze(()=>{bs().then(l=>{Jo=l,le(f=>f===l?f:l)})},[]),ze(()=>{H&&(de(true),$e.getAllKeys().then(l=>{We(l.sort())}).catch(()=>{We([])}).finally(()=>{de(false)}))},[H]);let Ae=async l=>{try{let f={...l,dialTools:Ct(l.dialTools)};await r.setItem(tt,JSON.stringify(f)),ot=f,D(f),o?.(f),xt.emit(f)}catch(f){console.error("Failed to save dev tools settings:",f)}},ge=l=>{let f={...g,floatingTools:{...g.floatingTools,[l]:!g.floatingTools[l]}};Ae(f)},we=l=>{let f={...g,globalSettings:{...g.globalSettings,[l]:!g.globalSettings?.[l]}};Ae(f)},Pe=async()=>{Ce(true),Me(false);try{await $e.clear(),Me(true),D(u),r!==$e&&await r.setItem(tt,JSON.stringify(u)),o?.(u),xt.emit(u),setTimeout(()=>Me(false),2e3)}catch(l){console.error("Failed to clear storage:",l)}finally{Ce(false)}},c=St(l=>{},[]),U=l=>{let f=n.find(O=>O.id===l);return f?.description?f.description:l==="environment"?"Environment badge.":""},b=l=>l==="environment"?"Env Badge":n.find(f=>f.id===l)?.name??l.toUpperCase().replace(/_/g," "),x=l=>{if(!F)return null;switch(l){case"query":return p(Bs,{size:18});case"env":return p(_o,{size:18});case"sentry":return p(ms,{size:18,color:"#9945FF"});case"storage":return p(zs,{size:18,bgColor:h.color.surface});case"wifi":case"query-wifi-toggle":return p(gs,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return p(Rs,{size:18,bgColor:h.color.surface});case"network":return p(Ms,{size:18});case"environment":return p(_o,{size:18});case"debug-borders":return p(ys,{size:18,color:h.color.accent});case"highlight-updates":return p(hs,{size:18,color:h.color.accent});case"highlight-updates-modal":return p(Ds,{size:18});case"redux":return p(Es,{size:18});case"image-overlay":return p(fs,{size:18});case"events":return p(As,{size:18});case"zustand":try{let{ZustandIcon:f}=ro("@buoy-gg/zustand/web");return p(f,{size:18})}catch{return p(jt,{size:18,color:h.color.textSecondary})}case"jotai":try{let{JotaiIcon:f}=ro("@buoy-gg/jotai/web");return p(f,{size:18})}catch{return p(jt,{size:18,color:h.color.textSecondary})}default:{let f=n.find(O=>O.id===l);return f?.icon!=null?qo(f.icon,{slot:"row",size:18,color:f.color}):p(jt,{size:18,color:h.color.textSecondary})}}},Q=(l,f,O,Z)=>{let Ie=U(l);return W(ut,{activeOpacity:O?1:.7,onPress:()=>!O&&Z(),accessibilityLabel:b(l),accessibilityRole:"button",style:[y.toolRow,O&&y.rowDisabled],children:[p(M,{style:y.toolIconSlot,children:x(l)}),W(M,{style:y.rowInfo,children:[W(B,{style:y.rowLabel,children:[b(l),O?" \xB7 max 6":""]}),Ie?p(B,{style:y.rowCaption,numberOfLines:1,children:Ie}):null]}),p(Ho,{value:f,disabled:O,onValueChange:()=>Z()})]},l)},V=l=>{k(f=>{let O=new Set(f);return O.has(l)?O.delete(l):O.add(l),O})},X=(l,f,O,Z,Ie)=>{let ke=g.globalSettings?.[l]??false,Ne=R.has(l);return W(M,{children:[W(ut,{activeOpacity:.7,onPress:()=>V(l),accessibilityLabel:f,style:y.settingRow,children:[W(M,{style:y.rowInfo,children:[p(B,{style:y.rowLabel,children:f}),p(B,{style:y.rowCaption,numberOfLines:Ne?0:1,children:O})]}),p(Ho,{value:ke,onValueChange:()=>we(l)})]}),Ne&&W(M,{style:y.settingRowBody,children:[p(B,{style:y.settingRowBodyText,children:Z}),p(B,{style:y.settingRowBodyHint,children:Ie})]})]},l)},G=(l,f,O)=>W(M,{children:[p(Ts,{children:l}),f,O]}),re=q==="filesystem"?p(be,{label:"File System",tone:"accent"}):q==="asyncstorage"?p(be,{label:"Async Storage",tone:"warning"}):q==="localstorage"?p(be,{label:"Local Storage",tone:"accent"}):q==="memory"?p(be,{label:"Memory",tone:"danger"}):p(be,{label:"Loading\u2026",tone:"neutral"}),he=()=>W(M,{style:y.container,children:[W(to,{style:y.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:y.scrollContainer,children:[w==="floating"&&p(et,{children:G("Floating Tools",p(je,{glass:true,children:p(Ht,{children:Object.entries(g.floatingTools).map(([l,f])=>Q(l,f,false,()=>ge(l)))})}),p(jo,{children:"Tools switched on here appear in the floating bubble row."}))}),w==="settings"&&W(et,{children:[G("Background",p(je,{glass:true,padded:true,children:p(Cs,{embedded:true})})),G("Storage",W(je,{glass:true,children:[W(ut,{activeOpacity:.7,onPress:()=>Ye(!H),accessibilityLabel:"Storage Type",style:y.settingRow,children:[p(M,{style:y.rowInfo,children:p(B,{style:y.rowLabel,children:"Storage Type"})}),re,H?p(Fo,{size:16,color:h.color.textTertiary}):p(Lo,{size:16,color:h.color.textTertiary})]}),H&&W(et,{children:[W(M,{style:y.settingRowBody,children:[p(B,{style:y.settingRowBodyText,children:q==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":q==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":q==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":q==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),q==="asyncstorage"&&p(B,{style:[y.settingRowBodyText,y.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),q==="memory"&&p(B,{style:[y.settingRowBodyText,y.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),p(ks,{}),W(M,{style:y.storageExpanded,children:[W(M,{style:y.storageExpandedHeader,children:[p(B,{style:y.storageExpandedTitle,children:"SAVED SETTINGS"}),p(B,{style:y.storageExpandedCount,children:De?"\u2026":`${Be.length} keys`})]}),De?p(B,{style:y.storageKeyEmpty,children:"Loading\u2026"}):Be.length===0?p(B,{style:y.storageKeyEmpty,children:"No settings saved yet"}):p(to,{style:y.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:Be.map(l=>p(M,{style:y.storageKeyItem,children:p(B,{style:y.storageKeyText,numberOfLines:1,children:l.replace("@react_buoy_","")})},l))})]}),p(M,{style:y.cardButtonWrap,children:p(Wt,{label:ce?"Cleared":ae?"Clearing\u2026":"Clear All Settings",variant:ce?"secondary":"destructive",size:"md",disabled:ae,onPress:Pe,icon:ce?p($o,{size:15,color:h.color.accent}):p(ws,{size:15,color:ae?h.color.textTertiary:h.color.danger})})})]})]})),A&&A.state!=="idle"&&G("Desktop Sync",W(je,{glass:true,children:[W(ut,{activeOpacity:.7,onPress:()=>V("desktopSync"),accessibilityLabel:"Buoy Desktop",style:y.settingRow,children:[p(M,{style:y.rowInfo,children:p(B,{style:y.rowLabel,children:"Buoy Desktop"})}),A.state==="connected"?p(be,{label:"Connected",tone:"accent"}):A.state==="connecting"?p(be,{label:"Connecting\u2026",tone:"neutral"}):p(be,{label:"Retrying",tone:"warning"}),R.has("desktopSync")?p(Fo,{size:16,color:h.color.textTertiary}):p(Lo,{size:16,color:h.color.textTertiary})]}),R.has("desktopSync")&&W(M,{style:y.settingRowBody,children:[W(B,{style:y.settingRowBodyText,children:[A.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",p(B,{style:y.footnoteMono,children:A.targetURL??"(unknown URL)"}),A.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),A.state==="retrying"&&A.lastError&&W(B,{style:[y.settingRowBodyText,y.bodyWarning],children:["Last error: ",A.lastError]})]})]})),G("Modal Behavior",p(je,{glass:true,children:W(Ht,{children:[X("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),Ns(Ue.OS==="web")?X("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),w==="pro"&&W(et,{children:[G("License",W(je,{glass:true,children:[W(M,{style:y.settingRow,children:[p(M,{style:y.rowInfo,children:p(B,{style:y.rowLabel,children:"License Status"})}),p(M,{testID:"buoy-settings-license-status",accessibilityLabel:K?"License: Active":"License: Free",children:K?p(be,{label:"Active",tone:"accent"}):p(be,{label:"Free",tone:"neutral"})})]}),te?.tierSource==="session"?W(M,{style:y.settingRow,children:[p(M,{style:y.rowInfo,children:p(B,{style:y.rowLabel,children:"Signed in with Buoy"})}),p(Wt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void Ss(),testID:"buoy-settings-signout"})]}):null]}),p(jo,{children:K?"You have full access to all Buoy DevTools features.":J?ne?`Couldn't reach the license server (${J}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${J}.`:"Upgrade to Pro to unlock all features and support development."})),!K&&W(et,{children:[G("Pro Features",p(je,{glass:true,children:p(Ht,{children:["Advanced Settings","Priority Support"].map(l=>W(M,{style:y.featureRow,children:[p($o,{size:16,color:h.color.accent}),p(B,{style:y.rowLabel,children:l})]},l))})})),p(Wt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>C(true)})]})]})]}),p(xs,{visible:v,onClose:()=>C(false),onSuccess:()=>C(false)})]});return p(Ws,{visible:e,onClose:t,zIndex:i,variant:"night",header:{showToggleButton:false,customContent:p(M,{style:y.headerRow,children:p(Is,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:w,onChange:l=>E(l)})})},initialMode:"bottomSheet",onModeChange:c,persistenceKey:_t.settings.root(),enablePersistence:true,maxHeight:Te-Y.top,initialHeight:Ee,initialFloatingPosition:{x:(fe-_e)/2,y:Y.top+20},enableGlitchEffects:true,children:he()})},Js={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},Xs=(e,t)=>{let o=new Set(e??[]),a=new Set(t??[]),n={};for(let i of a)n[i]=true;let r={environment:o.has("environment")};for(let i of o)i!=="environment"&&(r[i]=true);return{dialTools:Ct(n),floatingTools:r,globalSettings:{enableSharedModalDimensions:false}}},ot=null,Nt=null,Jo=null,Xo=(e,t)=>JSON.stringify(e)===JSON.stringify(t);xt.addListener(e=>{e&&(ot=e)});var Yo=()=>{let{defaultFloatingTools:e,defaultDialTools:t}=Ko(),o=wt(()=>!e&&!t?Js:Xs(e,t),[e,t]),[a,n]=ie(o),r=St(async()=>{try{let s=await $e.getItem(tt);if(s){let d=JSON.parse(s),u=Go(o,d);n(u);return}n(o)}catch(s){console.error("Failed to load dev tools settings:",s),n(o)}},[o]);ze(()=>_s(s=>{s.includes(tt)&&r()}),[r]),ze(()=>{r();let s=xt.addListener(d=>{try{d&&n(d)}catch{}});return()=>{s()}},[r]);let i=St(()=>{r()},[r]);return{settings:a,refreshSettings:i}},y=mt.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:h.gutter,paddingRight:h.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:h.gutter,paddingTop:8,paddingBottom:24,gap:h.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:h.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:h.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:h.color.text,fontSize:h.font.row,fontWeight:"500"},rowCaption:{color:h.color.textTertiary,fontSize:h.font.label},settingRowBody:{paddingHorizontal:h.rowPadH,paddingBottom:h.rowPadV,gap:6},settingRowBodyText:{color:h.color.textSecondary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},settingRowBodyHint:{color:h.color.textTertiary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},bodyWarning:{color:h.color.warning},bodyDanger:{color:h.color.danger},cardButtonWrap:{paddingHorizontal:h.cardPad,paddingTop:10,paddingBottom:h.cardPad},storageExpanded:{paddingHorizontal:h.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:h.color.textSecondary,fontSize:h.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:h.color.textTertiary,fontSize:h.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:h.color.glassElevated,borderRadius:h.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:h.color.textSecondary,fontSize:h.font.micro,fontFamily:Wo},storageKeyEmpty:{color:h.color.textTertiary,fontSize:h.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:Wo,fontSize:h.font.label,color:h.color.textSecondary}});import{jsx as Qo}from"react/jsx-runtime";var Ys=[];function Zo({visible:e,onClose:t,availableTools:o=Ys,defaultFloatingTools:a,defaultDialTools:n,storage:r=ss,onSettingsChange:i}){let s=Oo(()=>({getItem:async m=>r.getItem(m),setItem:async(m,I)=>r.setItem(m,I)}),[r]),d=Oo(()=>o.map(m=>({...m,name:m.name??m.id,icon:typeof m.icon=="function"?I=>m.icon(I.size):m.icon})),[o]),u=is(m=>{i?.(m)},[i]);return Qo(Uo,{defaultFloatingTools:a,defaultDialTools:n,children:Qo(Gs,{visible:e,onClose:t,zIndex:11e3,availableApps:d,storage:s,onSettingsChange:u})})}import{persistentStorage as en,setExpandableWindowControls as Qs}from"@buoy-gg/shared-ui/web";import{createContext as Zs,useCallback as Re,useContext as el,useEffect as Tt,useMemo as tl,useRef as nt,useState as tn}from"react";var ol=(e,t,o)=>{if(t.singleton){let n=e.find(r=>r.id===t.id);if(n){let r=n.minimized??false;return{instanceId:n.instanceId,wasMinimized:r,apps:[...e.filter(i=>i.instanceId!==n.instanceId),{...n,minimized:false}]}}}let a=o();return{instanceId:a,wasMinimized:false,apps:[...e,{...t,instanceId:a}]}};import{createContext as nl,useCallback as on,useContext as al,useEffect as It,useMemo as rl,useRef as nn,useState as kt}from"react";import{JsModal as il,ModalHeader as at,HeaderSearchButton as sl,TickProvider as ll,ToolScreenHeaderContext as cl,devToolsStorageKeys as an,buoyColors as rn,gameUIColors as Ut}from"@buoy-gg/shared-ui/web";import{jsx as ue,jsxs as zt}from"react/jsx-runtime";var rt=()=>{},dl={search:"",isSearchActive:false,clearSearch:rt,close:rt,minimize:rt,showToast:rt,setHeaderOverride:rt},sn=nl(null);function ln(){return al(sn)??dl}function ul(e,t){let{setHeaderOverride:o}=ln();It(()=>(o(e),()=>o(null)),t)}var cn=2200,pl={success:Ut.success,error:Ut.error,info:Ut.info};function ml({message:e,type:t,nonce:o}){let a=nn(new Oe.Value(0)).current;It(()=>{a.setValue(0),Oe.sequence([Oe.timing(a,{toValue:1,duration:150,useNativeDriver:true}),Oe.delay(cn-450),Oe.timing(a,{toValue:0,duration:300,useNativeDriver:true})]).start()},[o,a]);let n=pl[t];return zt(Oe.View,{pointerEvents:"none",style:[Rt.toast,{opacity:a,borderColor:n+"60"}],children:[ue(M,{style:[Rt.toastDot,{backgroundColor:n}]}),ue(B,{style:Rt.toastText,numberOfLines:2,children:e})]})}function gl({app:e,config:t,visible:o,zIndex:a,onClose:n,onMinimize:r,initialModalState:i,enableSharedModalDimensions:s,bodyProps:d}){let u=e.component,[m,I]=kt(false),[g,D]=kt(""),[w,E]=kt(null),[z,P]=kt(null),R=nn(null),k=on(()=>{I(false),D("")},[]),v=on((q,le="info")=>{R.current&&clearTimeout(R.current),P(ae=>({message:q,type:le,nonce:(ae?.nonce??0)+1})),R.current=setTimeout(()=>P(null),cn)},[]);It(()=>()=>{R.current&&clearTimeout(R.current)},[]);let C=rl(()=>({search:m?g:"",isSearchActive:m,clearSearch:k,close:n,minimize:()=>r(),showToast:v,setHeaderOverride:E,instanceId:e.instanceId}),[g,m,k,n,r,v,e.instanceId]),F=w?.title??t.title??e.title??e.id,T=w?.subtitle??t.subtitle,A=w?.onBack,te=w?.actions??t.headerActions,K=w?.searchable??t.searchable;It(()=>{!K&&m&&k()},[K,m,k]);let J=s?an.modal.root():an.custom(e.id).modal(),ne=zt(at,{children:[A&&!m&&ue(at.Navigation,{onBack:A}),m?ue(at.Search,{value:g,onChangeText:D,onCancel:k,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):ue(at.Content,{title:F,subtitle:T}),zt(at.Actions,{children:[!m&&te,K&&!m&&ue(sl,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>I(true)})]})]});return ue(sn.Provider,{value:C,children:ue(il,{visible:o,onClose:n,onBack:A,onMinimize:r,initialModalState:i,zIndex:a,persistenceKey:J,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:ne,showToggleButton:true},disableScrollWrapper:true,styles:{},children:zt(M,{style:Rt.bodyRoot,children:[ue(ll,{children:ue(cl.Provider,{value:E,children:ue(u,{...d})})}),z&&ue(ml,{message:z.message,type:z.type,nonce:z.nonce})]})})})}var Rt=mt.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:rn.card,borderWidth:1,borderRadius:8,paddingHorizontal:12,paddingVertical:8,shadowColor:"#000",shadowOpacity:.4,shadowRadius:8,shadowOffset:{width:0,height:2},elevation:6},toastDot:{width:6,height:6,borderRadius:3},toastText:{flex:1,fontSize:12,color:rn.text}});import{useEffect as fl,useRef as hl}from"react";import{capacitorPlatform as yl,capacitorPlugin as bl}from"@buoy-gg/license/web";function vl(){return globalThis.__BUOY_HOLDS_BACK__===true}var Sl=99.5;function wl(){if(typeof document>"u")return false;let e=globalThis.Ionic;if(!e&&!document.querySelector("ion-app"))return false;try{return e?.config?.get?.("hardwareBackButton",true)!==false}catch{return true}}function xl(e,t){let o=hl(t);o.current=t,fl(()=>{if(!e||yl()!=="android")return;let a=globalThis;a.__BUOY_HOLDS_BACK__=true;let n;if(wl()){let r=i=>{i.detail?.register?.(Sl,()=>{o.current()})};document.addEventListener("ionBackButton",r),n=()=>document.removeEventListener("ionBackButton",r)}else{let r=bl("App");if(!r?.addListener){a.__BUOY_HOLDS_BACK__=false;return}let i=false,s=null;Promise.resolve(r.addListener("backButton",()=>o.current())).then(d=>{i?d.remove():s=d}).catch(()=>{}),n=()=>{i=true,s&&s.remove()}}return()=>{n(),a.__BUOY_HOLDS_BACK__=false}},[e])}import{Fragment as Cl,jsx as pe}from"react/jsx-runtime";var dn=Zs(null),un="@react_buoy_open_apps",Kt=44,Tl=12,Il=100,kl=16,zl=e=>({x:window.innerWidth-Kt-kl,y:window.innerHeight-Il-Kt-e*(Kt+Tl)}),pn=({children:e})=>{let[t,o]=tn([]),[a,n]=tn(false),r=nt([]),i=nt(null),s=nt(false),d=nt(false),u=nt(false),m=Re(v=>{let C="";return o(F=>{let{apps:T,instanceId:A}=ol(F,v,()=>`${v.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return C=A,T}),C},[]),I=Re(()=>{if(s.current||!d.current||!u.current)return;s.current=true;let v=i.current;if(!v||v.length===0){n(true);return}i.current=null,v.forEach(({id:C,minimized:F})=>{let T=r.current.find(A=>A.id===C);if(T&&T.component){let A=qo(T.icon,{slot:"dial",size:20,color:T.color});m({id:T.id,title:T.name,component:T.component,props:T.props,modal:T.modal,launchMode:T.launchMode||"self-modal",singleton:T.singleton??true,icon:A,color:T.color,minimized:F})}}),n(true)},[m]);Tt(()=>{let v=false;return(async()=>{try{let C=await en.getItem(un);if(v)return;if(C){let F=JSON.parse(C),T;Array.isArray(F)&&F.length>0&&(typeof F[0]=="string"?T=F.map(A=>({id:A,minimized:false})):T=F.filter(A=>typeof A=="object"&&A!==null&&typeof A.id=="string"),T.length&&(i.current=T))}}catch{}v||(d.current=true,I())})(),()=>{v=true}},[I]),Tt(()=>{if(!a)return;let v=t.map(C=>({id:C.id,minimized:C.minimized??false}));en.setItem(un,JSON.stringify(v))},[t,a]);let g=Re(v=>{r.current=v,u.current=true,I()},[I]),D=Re(v=>{o(C=>C.length?v?C.filter(F=>F.instanceId!==v):C.slice(0,-1):C)},[]),w=Re(()=>o([]),[]),E=Re((v,C)=>{o(F=>F.map(T=>T.instanceId===v?{...T,minimized:true,restoreState:C}:T))},[]),z=Re((v,C)=>{o(F=>F.map(T=>T.instanceId===v?{...T,minimized:false,restoreState:C??T.restoreState}:T))},[]),P=Re(v=>t.find(C=>C.instanceId===v)?.minimized??false,[t]),R=t.some(v=>v.launchMode!=="toggle-only"&&!v.minimized);Tt(()=>{if(!R)return;let v=C=>{if(C.key!=="Escape"||C.defaultPrevented)return;let F=[...t].reverse().find(T=>T.launchMode!=="toggle-only"&&!T.minimized);F&&D(F.instanceId)};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[R,D,t]),xl(t.length>0,()=>D());let k=tl(()=>({openApps:t,isAnyOpen:R,open:m,close:D,closeAll:w,registerApps:g,minimize:E,restore:z,isMinimized:P}),[t,R,m,D,w,g,E,z,P]);return pe(dn.Provider,{value:k,children:e})},it=()=>{let e=el(dn);return e||{openApps:[],isAnyOpen:false,open:()=>"",close:()=>{},closeAll:()=>{},registerApps:()=>{},minimize:()=>{},restore:()=>{},isMinimized:()=>false}},Rl=9e3,Ml={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},Bl={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Dl=({app:e,zIndex:t,onClose:o,onMinimize:a,minimizeTargetPosition:n,enableSharedModalDimensions:r})=>{let i=e.component,s=!e.minimized,d={...e.props??{},...r?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?pe("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:pe(gl,{app:e,config:e.modal,visible:s,zIndex:t,onClose:o,onMinimize:a,initialModalState:e.restoreState,enableSharedModalDimensions:r,bodyProps:d})}):e.launchMode==="self-modal"?pe("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:pe(i,{...d,visible:s,onClose:o,onRequestClose:o,onMinimize:a,minimizeTargetPosition:n,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?s?pe("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:pe(i,{...d,onClose:o,onMinimize:a,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:pe("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...Ml,zIndex:t,display:s?"flex":"none"},children:pe("div",{style:Bl,children:pe(i,{...d,onClose:o,onMinimize:a,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})})})},mn=()=>{let{openApps:e,close:t,minimize:o}=it(),{settings:a}=Yo();Tt(()=>{Qs(a.globalSettings?.expandableWindowControls!==false)},[a.globalSettings?.expandableWindowControls]);let n=e.filter(s=>s.launchMode!=="toggle-only");if(n.length===0)return null;let r=n.filter(s=>s.minimized).length,i=bi()??zl(r);return pe(Cl,{children:n.map((s,d)=>pe(Dl,{app:s,zIndex:Rl+d,onClose:()=>t(s.instanceId),onMinimize:u=>o(s.instanceId,u),enableSharedModalDimensions:a.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:i},s.instanceId))})};import{useCallback as El,useEffect as Vt,useRef as Al,useState as gn,useSyncExternalStore as fn}from"react";import{persistentStorage as hn,getToolAttention as qt,subscribeToolAttention as yn}from"@buoy-gg/shared-ui/web";import{jsx as me,jsxs as Mt}from"react/jsx-runtime";function Pl(e){return fn(yn,()=>qt(e),()=>qt(e))}var bn={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},vn={needsInput:3,failed:2,done:1},Sn=new Map;function wn(e){let t=null;for(let a of e?e.split("|"):[]){let n=qt(a);n&&(!t||vn[n.kind]>vn[t.kind])&&(t=n)}let o=Sn.get(e);return o&&t&&o.kind===t.kind&&o.label===t.label?o:!o&&!t?null:(Sn.set(e,t),t)}function Ol(e){let t=e.join("|");return fn(yn,()=>wn(t),()=>wn(t))}var xn=28,Gt=32,Jt=6,Cn=8,Tn=24,In="@react_buoy_minimized_stack_expanded",Ll=80,kn=2e3,Fl=6e3,$l="#1A1A1A",st="#888888";function zn({down:e=false}){return me("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:me("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:st,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function jl({id:e,title:t,icon:o,index:a,onPress:n}){let r=Pl(e),i=Al(null);return Vt(()=>{let s=true,d,u=()=>{i.current?.animate([{transform:"translateX(0) scale(1)",opacity:1,offset:0},{transform:"translateX(3px) scale(1.05)",opacity:.4,offset:.2},{transform:"translateX(-3px) scale(1.1)",opacity:1,offset:.4},{transform:"translateX(2px) scale(1.0)",opacity:.6,offset:.6},{transform:"translateX(-1px) scale(0.95)",opacity:1,offset:.8},{transform:"translateX(0) scale(1)",opacity:1,offset:1}],{duration:Ll,easing:"linear"})},m=I=>{let g=I?500+Math.random()*1500+a*200:kn+Math.random()*(Fl-kn)+a*300;d=setTimeout(()=>{s&&(u(),m(false))},g)};return m(true),()=>{s=false,clearTimeout(d)}},[a]),Mt("button",{type:"button","aria-label":r?`${t} \u2014 ${r.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:n,style:{width:Gt,height:Gt,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[me("div",{ref:i,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:o}),r?me("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${r.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:bn[r.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:r.kind==="needsInput"?"!":""}):null]})}function Hl({containerWidth:e=32}){let{openApps:t,restore:o}=it(),a=t.filter(g=>g.minimized&&g.launchMode!=="toggle-only"),[n,r]=gn(false),[i,s]=gn(false),d=Ol(a.map(g=>g.id));Vt(()=>{let g=false;return(async()=>{let D=await hn.getItem(In);!g&&D==="true"&&r(true),g||s(true)})(),()=>{g=true}},[]),Vt(()=>{i&&hn.setItem(In,n?"true":"false")},[n,i]);let u=El(g=>{o(g)},[o]);if(a.length===0)return null;let m=Cn+a.length*Gt+(a.length-1)*Jt+Jt+Tn+4,I={backgroundColor:$l,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${st}66`,borderLeft:`1px solid ${st}66`,borderRight:`1px solid ${st}66`,borderBottom:"none",boxSizing:"border-box"};return Mt("div",{style:{height:xn,overflow:"visible",position:"relative"},children:[me("div",{style:{position:"absolute",bottom:"var(--buoy-stack-bottom, 0px)",top:"var(--buoy-stack-top, auto)",left:0,width:e,maxHeight:"var(--buoy-stack-space, calc(100vh - 48px))",visibility:n?"visible":"hidden",height:n?m:0,opacity:n?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:n?"auto":"none",...I},children:Mt("div",{style:{height:m,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:Cn,gap:Jt,boxSizing:"border-box"},children:[n&&[...a].reverse().map((g,D)=>me(jl,{id:g.id,title:g.title||g.id,icon:g.icon??me("span",{style:{color:"#fff",fontSize:13},children:(g.title||g.id).slice(0,1).toUpperCase()}),index:D,onPress:()=>u(g.instanceId)},g.instanceId)),me("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>r(false),style:{width:"100%",height:Tn,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:me(zn,{down:true})})]})}),Mt("button",{type:"button","aria-label":`Show ${a.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:n?-1:0,"aria-hidden":n,onClick:()=>r(true),style:{position:"absolute",bottom:0,left:0,width:e,height:xn,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:n?0:1,transform:n?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:n?"none":"auto",...I},children:[me(zn,{}),d?me("span",{"aria-hidden":true,"data-testid":"buoy-dock-peek-attention",style:{position:"absolute",top:2,right:2,minWidth:11,height:11,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:bn[d.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.kind==="needsInput"?"!":""}):null,a.length>1&&me("span",{style:{fontSize:9,fontWeight:600,color:st,marginLeft:1},children:a.length})]})]})}import{registerToolModules as Wl}from"@buoy-gg/shared-ui/web";import{createElement as _l}from"react";function lt(e){let t=e.icon;return{...e,icon:typeof t=="function"?o=>_l(t,{size:o,slot:e.slot??"both",color:e.color}):()=>t}}import{createContext as Nl,useContext as Ul,useState as Rn,useMemo as Mn}from"react";import{jsx as Kl}from"react/jsx-runtime";var Bn=Nl(null);function Dn({children:e}){let[t,o]=Rn(false),[a,n]=Rn(false),r=Mn(()=>t||a,[t,a]),i=Mn(()=>({isDialOpen:t,isToolOpen:a,isDevToolsActive:r,setDialOpen:o,setToolOpen:n}),[t,a,r]);return Kl(Bn.Provider,{value:i,children:e})}function Xt(){let e=Ul(Bn);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:()=>{},setToolOpen:()=>{}}}import*as Vl from"@buoy-gg/license/web";import*as ql from"@buoy-gg/shared-ui/web";import*as Gl from"@buoy-gg/shared-ui/web/dataViewer";function En(e){Wl({core:{useDevToolsVisibility:Xt},license:Vl,"shared-ui":ql,"shared-ui/dataViewer":Gl,...e});let t=new Set;return Object.values(e).flatMap(o=>Object.entries(o).flatMap(([a,n])=>!a.endsWith("Preset")||!n||typeof n.id!="string"||!n.component||t.has(n.id)?[]:(t.add(n.id),[lt(n)])))}import{useEffect as Bt,useMemo as Dt,useRef as Jl}from"react";import{LicenseManager as Xl,installCapacitorBridge as Yl,resolveDevBuild as An,useLicense as Ql}from"@buoy-gg/license/web";import{registerToolAdapters as Zl}from"@buoy-gg/shared-ui/web";function Pn(e){return typeof e=="object"&&e!==null?e:void 0}function ec({isDevelopment:e,isLicensed:t,externalSync:o,isAvailable:a}){if(o===false||!a)return false;if(e)return true;let n=Pn(o);return t&&n?.enableInRelease===true&&Ln(n.socketURL,n)===null}var On="http://localhost:42831";function tc(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}function Ln(e,t){let o=e??On;if(t?.allowInsecureNetwork===true)return null;let a;try{a=new URL(o)}catch{return`[Buoy] externalSync.socketURL "${o}" isn't a valid URL, so this release build won't connect to Buoy Desktop.`}return a.protocol==="https:"||a.protocol==="wss:"||tc(a.hostname)?null:`[Buoy] This release build won't connect to ${o}: release sync carries real user data, and plain http to another machine is readable by anyone on the same network. Use a simulator, an emulator or adb reverse (localhost), an https:// broker, or set externalSync.allowInsecureNetwork: true for a network you trust.`}var oc={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function nc(e,t,o){if(t)return e;let a=null;for(let[n,r]of Object.entries(oc)){if(o?.includes(n))continue;let i=e[n];if(!i?.actions)continue;let s={...i.actions};for(let d of r)d in s&&(s[d]=()=>{throw new Error(`${n}.${d} is off in release builds. To allow it from Buoy Desktop and the MCP, pass externalSync={{ enableInRelease: true, releaseActions: ["${n}"] }}.`)});a??(a={...e}),a[n]={...i,actions:s}}return a??e}import{useEffect as ac,useMemo as rc,useState as ic}from"react";import{devToolsStorageKeys as sc,persistentStorage as lc}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as cc}from"@buoy-gg/license/web";var dc=8;function uc(){let e="";for(;e.length<dc;)e+=(Math.random()*16|0).toString(16);return e}function pc(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function mc({appName:e,hardwareName:t,platform:o,installId:a,deviceId:n}){let r=pc(e??"buoy")||"buoy",i=e??"Buoy Device",s=t?.trim()||o;return n?{deviceId:n,deviceName:`${i} (${s})`}:{deviceId:`${r}-${o}-${a}`,deviceName:`${i} (${s} \xB7 ${a.slice(-4)})`}}function gc(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}function fc(){let e=globalThis;try{return e.localStorage??null}catch{return null}}async function hc({platform:e=Ue.OS,store:t,mint:o=uc}={}){let a=sc.sync.deviceId(),n=t===void 0?cc()?fc():e==="web"?gc():lc:t;if(!n)return o();try{let r=await n.getItem(a);if(r&&r.length>0)return r;let i=o();return await n.setItem(a,i),i}catch{return o()}}var Yt=null;function yc(){return Yt||(Yt=hc()),Yt}function bc(e,t){let o=e?.deviceId,a=e?.deviceName,n=t.loadId??yc,r=t.platform??Ue.OS,[i,s]=ic(null);return ac(()=>{if(o)return;let d=false;return n().then(u=>{d||s(u)}),()=>{d=true}},[o,n]),rc(()=>{if(!o&&!i)return null;let d=mc({appName:t.appName,hardwareName:t.hardwareName,platform:r,installId:i??"",deviceId:o});return a?{...d,deviceName:a}:d},[o,a,i,t.appName,t.hardwareName,r])}import{useEffect as vc,useState as Sc}from"react";import{capacitorPlatform as wc,capacitorPlugin as Et,isCapacitorNative as xc}from"@buoy-gg/license/web";function Cc(e,t){if(t==="ios")return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":null;let o=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(e)?.[1]?.trim();return!o||o==="K"?null:o}function Tc(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}function Fn(){return typeof navigator>"u"?"":navigator.userAgent??""}function Qt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}var $n="@react_buoy_capacitor_app_name";function Ic(e){try{let t=globalThis.localStorage;if(!t)return e;let o=t.getItem($n);if(o)return o;e&&t.setItem($n,e)}catch{}return e}function kc(){let e=wc();if(!e)return{platform:"web",appName:Qt(),hardwareName:"Browser",ready:true};let t=!!Et("App");return{platform:e,appName:t?Qt():Ic(Qt()),hardwareName:Cc(Fn(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Et("Device")}}function zc(){let[e,t]=Sc(kc);return vc(()=>{if(!xc())return;let o=false,a=Et("App"),n=Et("Device");return Promise.all([a?.getInfo?.().catch(()=>null)??null,n?.getInfo?.().catch(()=>null)??null]).then(([r,i])=>{if(o)return;let s=r?.name?.trim(),d=i?.name?.trim()||i?.model?.trim();t(u=>({...u,appName:s||u.appName,hardwareName:d||u.hardwareName,ready:true}))}),()=>{o=true}},[]),e}function jn(){if(typeof location>"u")return null;let e=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:Fn(),serverUrl:typeof e=="string"?e:null}}function Hn(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}function Rc(e,t){if(e==="ios"){let o=Hn(t.serverUrl);return o?o===Hn(t.origin):t.protocol==="capacitor:"}return Wn.has(t.hostname)}var Wn=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Mc(e,t,o,a=jn()){if(o==="web"||!a)return e;let n;try{n=new URL(e)}catch{return e}let r=Rc(o,a);return!t&&r&&n.hostname===a.hostname&&(n.hostname="localhost"),o==="android"&&Wn.has(n.hostname)&&Tc(a.userAgent)&&(n.hostname="10.0.2.2"),n.toString().replace(/\/$/,"")}function Bc(e,t,o=jn()){return t!=="android"||!o||o.protocol!=="https:"||!/^(http|ws):/i.test(e)?null:`[Buoy] Can't reach Buoy Desktop at ${e}. This Android WebView serves the app from https://${o.hostname} and blocks plain http/ws by default. For debug builds, set android.allowMixedContent: true and server.cleartext: true in capacitor.config, then run cap sync.`}import{getDevServerOrigin as Dc,resolveReloadStrategy as Ec,scheduleReloadApp as Ac}from"@buoy-gg/shared-ui/web";var _n=Date.now(),Nn=Dc(),Pc={platform:Ue.OS,isTV:Ue.isTV===true,isTVOS:Ue.isTVOS===true},Un={version:3,getSnapshot:()=>{let e=Ec("auto");return{startedAt:_n,devServerOrigin:Nn,device:Pc,reload:{available:e!==null,strategy:e}}},subscribe:e=>()=>{},actions:{ping:()=>({ok:true,startedAt:_n,devServerOrigin:Nn}),reloadApp:e=>{let t=e??{},{strategy:o,delayMs:a}=Ac({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:o,delayMs:a}}}};import{Fragment as Oc,jsx as He,jsxs as Lc}from"react/jsx-runtime";var Fc=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],$c=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function jc(e){let t=Dt(()=>Object.fromEntries(Object.entries(e.modules).map(([a,n])=>[a.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),n])),[e.modules]),o=t["react-query"];return o?.useReactQuerySyncAdapter?He(Hc,{...e,modules:t,query:o}):He(Kn,{...e,modules:t})}function Hc(e){let t=e.query.useReactQuerySyncAdapter();return He(Kn,{...e,queryAdapter:t})}function Kn({modules:e,apps:t,requiredEnvVars:o,externalSync:a,headless:n,sentryGetClient:r,queryAdapter:i}){let{isPro:s,tier:d}=Ql(),u=Dt(()=>{let z={app:Un};for(let[P,R]of Object.entries(e))for(let[k,v]of Object.entries(R))k.endsWith("SyncAdapter")&&v&&typeof v=="object"&&(z[P]=v);i&&(z.query=i),e.env?.createEnvSyncAdapter&&(z.env=e.env.createEnvSyncAdapter(o??[]));for(let P of t??[])P.sync&&(z[`custom:${P.id}`]=P.sync);return z},[e,t,o,i]),m=Jl(u);m.current=u,Bt(()=>Zl(()=>m.current),[]),Bt(()=>{let z=[],P=R=>{let k=R?.();typeof k=="function"&&z.push(k)};return P(e.network?.startNetworkCapture),P(e.storage?.startBrowserStorageCapture),P(e.assets?.startBrowserAssetCapture),An(typeof Ke<"u"?Ke:process.env.NODE_ENV!=="production")&&P(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&P(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&P(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let R of z.reverse())R()}},[e]);let I=e["external-sync"],g=An(typeof Ke<"u"?Ke:process.env.NODE_ENV!=="production"),D=ec({isDevelopment:g,isLicensed:s,externalSync:a,isAvailable:!!I}),w=Pn(a);Yl({release:!g&&!!w?.enableInRelease}),!g&&w?.enableInRelease&&qn(Ln(w.socketURL,w));let E=e.sentry?.SentryRoot;return Lc(Oc,{children:[Object.entries(e).flatMap(([z,P])=>Fc.map(R=>{let k=P[R];return k?He(k,{},`${z}:${R}`):null})),E&&He(E,{getClient:r}),Object.entries(e).flatMap(([z,P])=>$c.map(R=>{let k=P[R];return k&&(!n||R==="ScenariosOverlay"||R==="ImpersonateOverlay")?He(k,{},`${z}:${R}`):null})),D&&He(Wc,{module:I,tools:u,options:w,isPro:s,tier:d,dev:g})]})}var Vn=null;function qn(e){!e||e===Vn||(Vn=e,console.warn(e))}function Wc({module:e,tools:t,options:o,isPro:a,tier:n,dev:r}){let i=zc(),s=bc(o,{appName:i.appName,hardwareName:i.hardwareName,platform:i.platform}),d=Dt(()=>Mc(o?.socketURL??(r?e.getDefaultSocketURL():On),!!o?.socketURL,i.platform),[o?.socketURL,r,e,i.platform]),{socket:u}=e.useExternalSyncSocket({deviceName:s?.deviceName??"Buoy Browser",socketURL:d,persistentDeviceId:i.ready?s?.deviceId??null:null,platform:i.platform,extraDeviceInfo:i.extraDeviceInfo,enableLogs:o?.enableLogs});Bt(()=>{let g=Bc(d,i.platform);if(!u||!g)return;let D=()=>qn(g);return u.on("connect_error",D),()=>{u.off("connect_error",D)}},[u,d,i.platform]),Bt(()=>{if(!u)return;let g=()=>{u.connected&&Xl.hasAccountAccess()&&u.emit("device-license",{isPro:a?"1":"0",tier:n})};return g(),u.on("connect",g),()=>{u.off("connect",g)}},[u,a,n]);let m=o?.releaseActions?.join(",")??"",I=Dt(()=>nc(t,r,m?m.split(","):void 0),[t,r,m]);return e.useExternalSync({tools:I,socket:u,deviceId:i.ready?s?.deviceId??null:null,enableLogs:o?.enableLogs}),null}import{useState as Gn}from"react";import{createPortal as _c}from"react-dom";import{useBuoySession as Nc}from"@buoy-gg/license/web";import{Fragment as Jn,jsx as ct,jsxs as Xn}from"react/jsx-runtime";var Yn="#20C997";function Uc(){let{status:e,signIn:t,signOut:o}=Nc(),[a,n]=Gn(false),[r,i]=Gn(null);if(typeof document>"u")return null;let s=()=>{i(null),n(true),t().catch(u=>i(u instanceof Error?u.message:"Sign-in did not work. Try again.")).finally(()=>n(false))},d=e.state==="active";return _c(ct("div",{"data-buoy-signin":"",style:{position:"fixed",right:"max(16px, env(safe-area-inset-right))",bottom:"max(20px, env(safe-area-inset-bottom))",zIndex:99999,maxWidth:"min(320px, calc(100vw - 32px))",padding:d||r?"12px 14px":0,borderRadius:16,background:d||r?"#0f1419":"transparent",color:"#e6edf3",boxShadow:d||r?"0 10px 30px rgba(0,0,0,.35)":"none",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",fontSize:14,lineHeight:1.45},children:d?Xn(Jn,{children:[ct("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),ct("button",{type:"button",onClick:()=>void o(),style:Kc,"data-testid":"buoy-signout",children:"Sign out"})]}):Xn(Jn,{children:[r?ct("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:r}):null,ct("button",{type:"button",onClick:s,disabled:a,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:Yn,color:"#04130d",fontWeight:600,fontSize:14,cursor:a?"wait":"pointer",boxShadow:"0 8px 24px rgba(0,0,0,.3)"},children:a?"Signing in\u2026":"Sign in to Buoy"})]})}),document.body)}var Kc={marginTop:8,padding:0,border:"none",background:"none",color:Yn,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useCallback as Vc,useEffect as Qn,useRef as qc,useState as Zt}from"react";import*as Gc from"@buoy-gg/license/web";import{AccountSetupButton as Jc,QrCodeView as Xc,monoFont as Yc,night as se}from"@buoy-gg/shared-ui/web";import{Fragment as Zn,jsx as _,jsxs as ve}from"react/jsx-runtime";function At(){try{return Gc.SessionManager}catch{return}}var Qc=e=>e.replace(/^https?:\/\//,"");function Zc(){let[e,t]=Zt(()=>At()?.getStatus().state??"signed_out");return Qn(()=>{let o=At();if(!o)return;let a=()=>t(o.getStatus().state);return a(),o.subscribe(a)},[]),e}function ea({needsPlan:e=false}){let[t,o]=Zt(false),a=Zc();return ve(M,{pointerEvents:"box-none",style:N.root,children:[_(Jc,{expanded:t,onPress:()=>o(true)}),t?_(pr,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>o(false),children:ve(M,{style:N.overlay,accessibilityViewIsModal:true,children:[_(pt,{style:mt.absoluteFill,onPress:()=>o(false),accessible:false}),e&&a==="active"?_(td,{onClose:()=>o(false)}):_(ed,{onClose:()=>o(false)})]})}):null]})}function ta({onClose:e}){return ve(M,{style:N.header,children:[ve(M,{style:N.brand,children:[_(M,{style:N.brandDot}),_(B,{style:N.wordmark,children:"BUOY"})]}),_(pt,{accessibilityRole:"button",accessibilityLabel:"Close sign-in",onPress:e,style:N.close,testID:"buoy-signin-close",children:_(B,{style:N.closeText,children:"\u2715"})})]})}function ed({onClose:e}){let[t,o]=Zt({kind:"starting"}),a=qc(null),n=Vc(()=>{a.current?.abort();let r=At();if(!r?.signInWithCode){o({kind:"error",message:"This version of @buoy-gg/license can't sign in with a code. Update it."});return}let i=new AbortController;a.current=i,o({kind:"starting"}),r.signInWithCode(s=>o({kind:"waiting",prompt:s}),{signal:i.signal}).then(()=>{i.signal.aborted||e()}).catch(s=>{i.signal.aborted||o({kind:"error",message:s instanceof Error?s.message:"Sign-in did not work. Try again."})})},[e]);return Qn(()=>(n(),()=>a.current?.abort()),[n]),ve(M,{style:N.card,testID:"buoy-code-signin",children:[_(ta,{onClose:e}),_(B,{style:N.title,children:"Sign in to Buoy"}),t.kind==="starting"?_(M,{style:N.center,children:_(oo,{color:se.color.accent})}):null,t.kind==="waiting"?ve(Zn,{children:[_(B,{style:N.body,children:"Scan this with your phone's camera."}),_(M,{style:N.qr,testID:"buoy-signin-qr",children:_(Xc,{value:t.prompt.verificationUriComplete,size:196})}),ve(B,{style:N.body,children:["Or go to ",_(B,{style:N.strong,children:Qc(t.prompt.verificationUri)})," and type:"]}),_(B,{style:N.code,selectable:true,testID:"buoy-signin-code",children:t.prompt.userCode}),ve(M,{style:N.waiting,children:[_(oo,{size:"small",color:se.color.textSecondary}),_(B,{style:N.muted,children:"Waiting for you to allow it\u2026"})]})]}):null,t.kind==="error"?ve(Zn,{children:[_(B,{style:N.body,testID:"buoy-signin-error",children:t.message}),_(pt,{accessibilityRole:"button",onPress:n,style:({pressed:r})=>[N.primary,r&&N.primaryPressed],testID:"buoy-signin-retry",children:_(B,{style:N.primaryText,children:"Get a new code"})})]}):null]})}function td({onClose:e}){return ve(M,{style:N.card,testID:"buoy-signin-needs-plan",children:[_(ta,{onClose:e}),_(B,{style:N.title,children:"You're signed in"}),_(B,{style:N.body,children:"Buoy in this build needs a Pro or Business plan."}),_(pt,{accessibilityRole:"button",onPress:()=>void At()?.signOut(),style:({pressed:t})=>[N.primary,t&&N.primaryPressed],testID:"buoy-signout",children:_(B,{style:N.primaryText,children:"Sign out"})})]})}var N=mt.create({root:{position:"absolute",bottom:30,right:16,zIndex:99999},overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20},card:{width:"100%",maxWidth:368,backgroundColor:"#111315",borderColor:"#303437",borderWidth:1,borderRadius:20,paddingHorizontal:24,paddingTop:18,paddingBottom:24},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:16},brand:{flexDirection:"row",alignItems:"center",gap:8},brandDot:{width:6,height:6,borderRadius:3,backgroundColor:se.color.accent},wordmark:{color:se.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},close:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},closeText:{color:se.color.textSecondary,fontSize:14},title:{color:se.color.text,fontSize:20,fontWeight:"700",marginBottom:8},body:{color:se.color.textSecondary,fontSize:14,lineHeight:20,marginTop:8},strong:{color:se.color.text,fontWeight:"600"},muted:{color:se.color.textSecondary,fontSize:13},center:{paddingVertical:32,alignItems:"center"},qr:{alignSelf:"center",marginTop:16,marginBottom:8,borderRadius:12,overflow:"hidden"},code:{color:se.color.text,fontFamily:Yc,fontSize:30,fontWeight:"700",letterSpacing:4,textAlign:"center",marginTop:12},waiting:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,marginTop:16},primary:{marginTop:20,minHeight:44,borderRadius:12,backgroundColor:se.color.accent,alignItems:"center",justifyContent:"center"},primaryPressed:{backgroundColor:se.color.accentPressed},primaryText:{color:se.color.onAccent,fontSize:15,fontWeight:"600"}});function oa(e){if(e.length>6){let t=e.map(o=>`"${o}"`).join(", ");return e.slice(0,6)}return e}import{Fragment as eo,jsx as j,jsxs as dt}from"react/jsx-runtime";var na={},aa="@react_buoy_floating_menu_tooltip_shown",od=Le;function nd({size:e=14,color:t="#20C997"}){let o=Math.max(2,e/4),a=Math.max(1,e/16);return j("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${o}px)`,gap:a,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((n,r)=>j("div",{style:{width:o,height:o,borderRadius:o/2,backgroundColor:t}},r))})}function ad(e){let{defaultFloatingTools:t,defaultDialTools:o,disableHints:a=false,children:n}=e,r=ye(()=>o&&oa(o),[o]);return j(Uo,{defaultFloatingTools:t,defaultDialTools:r,children:j(ri,{disableHints:a,children:dt(Dn,{children:[j(pn,{children:j(dd,{...e})}),n]})})})}var rd=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function id({modules:e=na}){return j(eo,{children:Object.entries(e).flatMap(([t,o])=>rd.map(a=>{let n=o[a];return n?j(n,{},`${t}:${a}`):null}))})}function sd(){let{openApps:e,restore:t}=it();return oe(()=>si(o=>{let a=e.find(n=>n.id===o);return a?(t(a.instanceId),true):false}),[e,t]),null}function ld(){let e=ti();return ii((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}function cd(e,t,o,a){let n=u=>Object.entries(e).find(([m])=>m.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===u)?.[1],r=[],i=n("env");t?.length&&i?.createEnvTool&&i.createEnvVarConfig&&r.push(lt(i.createEnvTool({requiredEnvVars:i.createEnvVarConfig(t)})));let s=n("storage");o?.length&&s?.createStorageTool&&r.push(lt(s.createStorageTool({requiredStorageKeys:o})));let d=n("ask-buoy");return a&&d?.createAskBuoyTool&&r.push(lt(d.createAskBuoyTool(a))),r}function dd({environment:e,userRole:t="admin",availableEnvironments:o,onEnvironmentSwitch:a,apps:n,modules:r=na,externalSync:i,requiredEnvVars:s,sentryGetClient:d,disableHints:u=false,headless:m=false,hidden:I=false,defaultFloatingTools:g,defaultDialTools:D,zustandStores:w,requiredStorageKeys:E,askBuoy:z}){let P=e??ld(),R=ye(()=>D?oa(D):void 0,[D]),[k,v]=Pt(false),[C,F]=Pt(false),T=ci(false),A=it(),te=ye(()=>cd(r,s,E,z),[r,s,E,z]),K=ye(()=>so([...En(r),...n??[],...te]),[n,r,te]),J=ye(()=>Object.entries(r).find(([c])=>c.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[r]);oe(()=>{if(!w||typeof J?.watchStores!="function")return;let c=J.watchStores(w);return typeof c=="function"?c:void 0},[w,J]);let ne=Xt(),q=A.openApps.some(c=>!c.minimized);oe(()=>{ne.setDialOpen(k)},[k,ne.setDialOpen]),oe(()=>{ne.setToolOpen(q||C)},[q,C,ne.setToolOpen]);let{registerApps:le}=A;oe(()=>{le(K.map(c=>{let U=c.icon;return{...c,icon:typeof U=="function"?({size:b})=>U(b):U}}))},[le,K]);let ae=ye(()=>K.map(c=>({id:c.id,name:c.name,description:c.description,slot:c.slot})),[K]);di({availableTools:ae,storage:od}),oe(()=>{let c=false;return(async()=>{let[U,b]=await Promise.all([Le.getItem(ft.dial.isOpen()),Le.getItem(ft.settings.modalOpen())]);c||(U==="true"&&v(true),b==="true"&&(v(true),F(true)),T.current=true)})(),()=>{c=true}},[]),oe(()=>{T.current&&Le.setItem(ft.dial.isOpen(),k?"true":"false")},[k]),oe(()=>{T.current&&Le.setItem(ft.settings.modalOpen(),C?"true":"false")},[C]);let Ce=Ve(c=>{if(rs(c.id),c.launchMode==="toggle-only"){c.onPress?.();return}if(c.component){let U=typeof c.icon=="function"?c.icon(20):c.icon;A.open({id:c.id,title:c.name||gt(c.id),component:c.component,props:c.props,modal:c.modal,launchMode:c.launchMode||"self-modal",singleton:c.singleton??true,icon:U,color:c.color||io(c.id)})}else c.onPress?.()},[A]),ce=ye(()=>Ot(K,"dial").map(c=>{let U=c.color||io(c.id),b;return typeof c.icon=="string"?b=c.icon:typeof c.icon=="function"?b=c.icon(32):b=null,{id:c.id,name:c.name||gt(c.id),icon:b,unavailable:!c.component&&!c.onPress,color:U,onPress:()=>{Ce(c),v(false)}}}),[K,Ce]),Me=ye(()=>{if(!k)return ce;let c=new Map(ce.map(U=>[U.id,U]));return as(ce.map(U=>U.id)).map(U=>c.get(U)).filter(U=>!!U)},[k,ce]),{settings:H}=Yo(),Ye=ye(()=>Ot(K,"row").filter(c=>(H.floatingTools[c.id]??false)===true&&(c.component||c.onPress)),[K,H.floatingTools]),Be=ye(()=>K.map(c=>({id:c.id,name:c.name||gt(c.id),description:c.description||ui(c.id),slot:c.slot,icon:c.icon,color:c.color})),[K]),[We,De]=Pt(false),de=A.openApps.some(c=>!c.minimized);oe(()=>{if(u)return;let c=false,U=setTimeout(async()=>{let b=await Le.getItem(aa);!c&&!b&&De(true)},1e3);return()=>{c=true,clearTimeout(U)}},[u]);let Y=Ve(()=>{De(false),Le.setItem(aa,"true")},[]),Te=Ve(()=>{Y(),v(true)},[Y]),fe=Ve(()=>{v(false),F(false)},[]),Ee=Ve(()=>{F(c=>!c)},[]),_e=Ve(()=>F(false),[]),Se=!!(o?.length&&a),Ae=H.floatingTools.environment!==false,ge=We&&!k&&!de&&!I;oe(()=>{if(!ge)return;let c=b=>{(!(b.target instanceof Element)||!b.target.closest("[data-buoy-root]"))&&Y()},U=b=>{b.key==="Escape"&&Y()};return document.addEventListener("pointerdown",c,true),document.addEventListener("keydown",U),()=>{document.removeEventListener("pointerdown",c,true),document.removeEventListener("keydown",U)}},[ge,Y]);let we=A.openApps.some(c=>c.minimized&&c.launchMode!=="toggle-only"),Pe=j(jc,{modules:r,apps:n,requiredEnvVars:s,externalSync:i,headless:m,sentryGetClient:d});return m?Pe:dt("div",{"data-buoy-root":"",style:{display:"contents"},children:[Pe,j(sd,{}),ge&&j("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),j("div",{style:I?{visibility:"hidden"}:{display:"contents"},"aria-hidden":I||void 0,children:dt(lo,{enablePositionPersistence:!ge,pushToSide:k||de,suspendPointerEvents:k,centerOnboarding:ge,minimizedStack:we?j(Hl,{}):void 0,hasMinimizedStack:we,children:[P&&Ae&&!Se&&j(pi,{environment:P}),Se&&Ae&&j(mi,{currentEnvironment:P??"local",availableEnvironments:o,onSelect:a}),t?j(co,{userRole:t,onPress:Te}):j("button",{"aria-label":"Open dev tools",onClick:Te,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:j(nd,{})}),Ye.map(c=>j("button",{"aria-label":c.name||gt(c.id),title:c.description,onClick:()=>Ce(c),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof c.icon=="function"?c.icon(16):c.icon},c.id))]})}),ge&&j(Io,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:Y}),k&&!I&&j(Bo,{icons:Me,onClose:fe,centerLabel:"BUOY",onCenterPress:Ee,settingsOpen:C,hintsDisabled:u}),C&&!I&&j(Zo,{visible:true,onClose:_e,availableTools:Be,defaultFloatingTools:g,defaultDialTools:R,onSettingsChange:c=>{}}),!I&&dt(eo,{children:[j(mn,{}),j(Jr,{})]})]})}function ud(e){let t=e&&typeof e=="object"?e.appId:void 0,o=!!e;oe(()=>{if(!o)return;let a=false,n=Xr.SessionManager;if(!n)return;let r=i=>{a||!i||(n.configure({audience:`app:${i}`}),n.load().catch(()=>{}))};return t?r(t):ni().then(i=>r(i?.bundleId)).catch(()=>{}),()=>{a=true}},[o,t])}function pd(e){let{access:t,isPro:o,licenseKey:a}=Qr();oe(()=>{Yr.configure(e.licenseKey)},[e.licenseKey]);let n=e.licenseKey===void 0||Zr(e.licenseKey,a),r=ei(typeof Ke<"u"?Ke:process.env.NODE_ENV!=="production"),i=n&&t.status==="admitted";oe(()=>{i&&li()},[i]),oe(()=>{r||t.status==="initializing"||(o&&i?Gr():ao())},[r,o,i,t.status]);let s=oi();return ud(s?e.signIn:void 0),!r&&!o?!e.signIn||e.headless?null:s?j(ea,{needsPlan:true}):j(Uc,{}):i?j(ad,{...e}):dt(eo,{children:[t.status==="initializing"&&j(id,{modules:e.modules}),e.headless?null:e.signIn&&s?j(ea,{}):j(ai,{})]})}import{useSettings as md,useFloatingTools as gd,getToolLabel as fd,getToolDescription as hd,getToolColor as yd,settingsColors as bd,settingsStyles as vd,dialColors as Sd,dialStyles as wd}from"@buoy-gg/floating-tools-react/web";import{LicenseManager as xd}from"@buoy-gg/license/web";export{Ka as Activity,pa as AlertCircle,qa as AlertTriangle,pn as AppHostProvider,mn as AppOverlay,kr as Badge,ga as BarChart3,va as BaseEventStore,ha as Bookmark,Ja as Bug,Lr as Button,Ur as Card,Ya as Check,Za as CheckCircle,Qa as CheckSquare,tr as ChevronDown,nr as ChevronLeft,rr as ChevronRight,ra as ChevronUp,sr as Clock,ba as Cloud,sa as CollapsibleSection,lr as Copy,$r as CopyButton,ya as DataViewer,cr as Database,Dn as DevToolsVisibilityProvider,Bo as DialMenu,Er as DiffViewer,yi as Divider,Sa as Download,xa as Edit3,ua as EmptyState,fa as EventStepperFooter,dr as Eye,ur as EyeOff,mr as FileJson,gr as FileText,fr as Filter,hr as FlaskConical,pd as FloatingDevTools,lo as FloatingTools,Ta as GitBranch,yr as Globe,ka as HardDrive,br as Hash,Ra as HelpCircle,Ba as Home,Ea as Image,vr as Info,Br as InfoRow,Na as JsModal,wr as Key,Cr as Layers,xd as LicenseManager,Pa as Link,Ir as Lock,La as Maximize2,$a as Minus,Ha as Palette,zr as Pause,_a as Pin,Mr as Play,Dr as Plus,Ar as Power,Hr as PowerToggle,Or as RefreshCw,wa as RelativeTime,Ua as Route,_r as Row,Fr as Search,ma as SearchBar,Vr as SectionHeader,Va as Server,jr as Settings,Zo as SettingsModal,Wr as Shield,Ga as Smartphone,Xa as Square,Rr as StatusDot,ca as TabSelector,er as Timer,Nr as Trash2,or as Unlock,ar as Upload,Kr as User,co as UserStatus,ir as Users,qr as Wifi,la as X,ia as XCircle,da as Zap,Un as appSyncAdapter,fi as autoDiscoverWebPresets,so as autoDiscoverWithCustom,ao as clearReleaseOptIn,Wa as copyToClipboard,lt as createWebTool,En as createWebTools,gi as defaultToolPresets,Fa as devToolsStorageKeys,Sd as dialColors,wd as dialStyles,Ca as formatBytes,Ia as formatDuration,za as formatNumber,hi as getEnabledTools,yd as getToolColor,hd as getToolDescription,fd as getToolLabel,Ot as getToolsBySlot,vl as isBuoyHoldingBackButton,xr as methodColor,Oa as persistentStorage,Da as safeStringify,bd as settingsColors,vd as settingsStyles,Sr as statusColor,Pr as toolTheme,Ma as truncateMiddle,Tr as typeColor,it as useAppHost,Xt as useDevToolsVisibility,gd as useFloatingTools,Aa as usePersistedState,ja as useSafeAreaInsets,md as useSettings,ul as useToolHeader,ln as useToolHost};
@@ -1 +1 @@
1
- "use client";import{a as r}from"./chunks/chunk-FROELTJH.mjs";import"./chunks/chunk-R7RGRTY5.mjs";function o(e={}){return false}export{r as earlyHookScript,o as registerBrowserDevTools};
1
+ "use client";import{a as r}from"./chunks/chunk-FROELTJH.mjs";import"./chunks/chunk-CLXYMJTS.mjs";function o(e={}){return false}export{r as earlyHookScript,o as registerBrowserDevTools};
@@ -1 +1 @@
1
- "use client";import{a as L}from"./chunks/chunk-5SGL6QL4.mjs";import{a as b}from"./chunks/chunk-FROELTJH.mjs";import{d as O}from"./chunks/chunk-R7RGRTY5.mjs";import*as y from"react-devtools-core";function m(){if(typeof window>"u")return;let h=window;if(h.__BUOY_EARLY_NETWORK__)return;let s=Date.now,n=true,u=[],c=t=>{if(u.push(t),u.length>100){let a=u.shift();a?.kind==="fetch"&&a.settled.then(e=>e.clone?.body?.cancel()).catch(()=>{})}},f=typeof window.fetch=="function"?window.fetch:void 0;if(f&&(window.fetch=function(t,a){if(!n)return f.call(window,t,a);let e;try{t instanceof Request&&t.body&&!t.bodyUsed&&a?.body===void 0&&(e=t.clone())}catch{}let d=s(),i=f.call(window,t,a),r=i.then(o=>{let l=s(),_=/event-stream|ndjson/.test(o.headers.get("content-type")??""),p;try{_||(p=o.clone())}catch{}return{response:o,clone:p,headersAt:l}},o=>({error:o,headersAt:s()}));return c({kind:"fetch",input:t,init:a,requestCopy:e,start:d,settled:r}),i}),typeof XMLHttpRequest<"u"){let t=XMLHttpRequest.prototype,{open:a,send:e,setRequestHeader:d}=t,i=new WeakMap;t.open=function(r,o,...l){return n&&i.set(this,{method:r,url:String(o),headers:{}}),a.call(this,r,o,...l)},t.setRequestHeader=function(r,o){let l=i.get(this);return l&&(l.headers[r]=o),d.call(this,r,o)},t.send=function(r){let o=i.get(this);if(n&&o){i.delete(this);let l=s(),_=this;_.addEventListener("readystatechange",()=>{_.readyState===2&&_._buoyTtfb===void 0&&(_._buoyTtfb=s()-l),_.readyState===4&&(_._buoyEarlyEnd=s())}),c({kind:"xhr",xhr:_,method:o.method,url:o.url,headers:o.headers,body:r,start:l})}return e.call(this,r)}}h.__BUOY_EARLY_NETWORK__={version:1,records:u,adopt(){return n=false,u.splice(0)}}}var w=["onScheduleFiberRoot","onCommitFiberRoot","onPostCommitFiberRoot","onCommitFiberUnmount","setStrictMode"];function E(h={}){if(typeof window>"u"||typeof document>"u"||!(typeof O<"u"?O:process.env.NODE_ENV!=="production")&&!h.enableInRelease&&!L())return false;m();let s=window,n=s.__REACT_DEVTOOLS_GLOBAL_HOOK__,u=n&&n.supportsFiber&&!n.getFiberRoots&&!n.sub&&Object.getOwnPropertyDescriptor(s,"__REACT_DEVTOOLS_GLOBAL_HOOK__")?.configurable;if(u&&delete s.__REACT_DEVTOOLS_GLOBAL_HOOK__,!s.__REACT_DEVTOOLS_GLOBAL_HOOK__&&((y.initialize??y.default?.initialize)({appendComponentStack:false,breakOnConsoleErrors:false,showInlineWarningsAndErrors:false,hideConsoleLogsInStrictMode:false}),u)){let c=s.__REACT_DEVTOOLS_GLOBAL_HOOK__,f=c.inject,t=new Map;c.inject=e=>{let d=f(e);return t.set(d,n.inject(e)),d};for(let e of w){let d=c[e];typeof d=="function"&&(c[e]=(i,...r)=>(t.has(i)&&n[e]?.(t.get(i),...r),d(i,...r)))}let a=new Map;if(n.renderers?.forEach?.((e,d)=>a.set(d,f(e))),a.size)for(let e of w){let d=n[e];n[e]=function(i,...r){let o=d?.call(this,i,...r),l=a.get(i);return l!==void 0&&c[e]?.(l,...r),o}}}return!!s.__REACT_DEVTOOLS_GLOBAL_HOOK__}E();export{b as earlyHookScript,E as registerBrowserDevTools};
1
+ "use client";import{a as L}from"./chunks/chunk-5SGL6QL4.mjs";import{a as b}from"./chunks/chunk-FROELTJH.mjs";import{d as w}from"./chunks/chunk-CLXYMJTS.mjs";import*as y from"react-devtools-core";function R(){if(typeof window>"u")return;let h=window;if(h.__BUOY_EARLY_NETWORK__)return;let l=Date.now,u=true,c=[],d=o=>{if(c.push(o),c.length>100){let n=c.shift();n?.kind==="fetch"&&n.settled.then(_=>_.clone?.body?.cancel()).catch(()=>{})}},s=typeof window.fetch=="function"?window.fetch:void 0;if(s&&(window.fetch=function(o,n){if(!u)return s.call(window,o,n);let _;try{o instanceof Request&&o.body&&!o.bodyUsed&&n?.body===void 0&&(_=o.clone())}catch{}let f=l(),a=s.call(window,o,n),t=a.then(e=>{let r=l(),i=/event-stream|ndjson/.test(e.headers.get("content-type")??""),p;try{i||(p=e.clone())}catch{}return{response:e,clone:p,headersAt:r}},e=>({error:e,headersAt:l()}));return d({kind:"fetch",input:o,init:n,requestCopy:_,start:f,settled:t}),a}),typeof XMLHttpRequest<"u"){let o=XMLHttpRequest.prototype,{open:n,send:_,setRequestHeader:f}=o,a=new WeakMap;o.open=function(t,e,...r){return u&&a.set(this,{method:t,url:String(e),headers:{}}),n.call(this,t,e,...r)},o.setRequestHeader=function(t,e){let r=a.get(this);return r&&(r.headers[t]=e),f.call(this,t,e)},o.send=function(t){let e=a.get(this);if(u&&e){a.delete(this);let r=l(),i=this;i.addEventListener("readystatechange",()=>{i.readyState===2&&i._buoyTtfb===void 0&&(i._buoyTtfb=l()-r),i.readyState===4&&(i._buoyEarlyEnd=l())}),d({kind:"xhr",xhr:i,method:e.method,url:e.url,headers:e.headers,body:t,start:r})}return _.call(this,t)}}h.__BUOY_EARLY_NETWORK__={version:1,records:c,adopt(){return u=false,c.splice(0)}}}import{installCapacitorBridge as A}from"@buoy-gg/license/web/capacitor";var E=["onScheduleFiberRoot","onCommitFiberRoot","onPostCommitFiberRoot","onCommitFiberUnmount","setStrictMode"];function m(h={}){if(typeof window>"u"||typeof document>"u")return false;let l=window.Capacitor,u=(()=>{try{return l?.isNativePlatform?.()===true}catch{return false}})(),c=u?l?.DEBUG===true:typeof w<"u"?w:process.env.NODE_ENV!=="production";if(!c&&!h.enableInRelease&&!L())return false;R(),u&&A({release:!c});let d=window,s=d.__REACT_DEVTOOLS_GLOBAL_HOOK__,o=s&&s.supportsFiber&&!s.getFiberRoots&&!s.sub&&Object.getOwnPropertyDescriptor(d,"__REACT_DEVTOOLS_GLOBAL_HOOK__")?.configurable;if(o&&delete d.__REACT_DEVTOOLS_GLOBAL_HOOK__,!d.__REACT_DEVTOOLS_GLOBAL_HOOK__&&((y.initialize??y.default?.initialize)({appendComponentStack:false,breakOnConsoleErrors:false,showInlineWarningsAndErrors:false,hideConsoleLogsInStrictMode:false}),o)){let n=d.__REACT_DEVTOOLS_GLOBAL_HOOK__,_=n.inject,f=new Map;n.inject=t=>{let e=_(t);return f.set(e,s.inject(t)),e};for(let t of E){let e=n[t];typeof e=="function"&&(n[t]=(r,...i)=>(f.has(r)&&s[t]?.(f.get(r),...i),e(r,...i)))}let a=new Map;if(s.renderers?.forEach?.((t,e)=>a.set(e,_(t))),a.size)for(let t of E){let e=s[t];s[t]=function(r,...i){let p=e?.call(this,r,...i),O=a.get(r);return O!==void 0&&n[t]?.(O,...i),p}}}return!!d.__REACT_DEVTOOLS_GLOBAL_HOOK__}m();export{b as earlyHookScript,m as registerBrowserDevTools};
@@ -1 +1 @@
1
- "use client";import{$ as a,A as s,Aa as e,B as o,Ba as t,C as r,Ca as i,D as l,Da as n,E as C,Ea as c,F as S,Fa as h,G as p,Ga as u,H as m,Ha as d,I as f,Ia as y,J as v,Ja as g,K as k,Ka as B,L as w,La as T,M as D,Ma as P,N as E,Na as b,O as F,Oa as H,P as R,Pa as A,Q as I,Qa as L,R as M,Ra as U,S as x,Sa as q,T as G,Ta as J,U as K,Ua as z,V as N,Va as O,W as V,Wa as X,X as j,Xa as W,Y as Q,Ya as Y,Z,_,aa as $,ba as aa,ca as sa,da as ea,ea as oa,fa as ta,ga as ra,ha as ia,ia as la,j as na,ja as Ca,k as ca,ka as Sa,l as ha,la as pa,m as ua,ma,n as da,na as fa,o as ya,oa as va,p as ga,pa as ka,q as Ba,qa as wa,r as Ta,ra as Da,s as Pa,sa as Ea,t as ba,ta as Fa,u as Ha,ua as Ra,v as Aa,va as Ia,w as La,wa as Ma,x as Ua,xa,y as qa,ya as Ga,z as Ja,za as Ka}from"./chunks/chunk-QZDVCMCT.mjs";import"./chunks/chunk-R7RGRTY5.mjs";export{I as Activity,Ka as AlertCircle,M as AlertTriangle,ua as Badge,e as BarChart3,l as BaseEventStore,t as Bookmark,x as Bug,Ta as Button,Aa as Card,G as Check,K as CheckCircle,J as CheckSquare,N as ChevronDown,V as ChevronLeft,j as ChevronRight,Q as ChevronUp,Z as Clock,i as Cloud,Ua as CollapsibleSection,_ as Copy,Pa as CopyButton,r as DataViewer,a as Database,ga as DiffViewer,n as Download,c as Edit3,Ja as EmptyState,o as EventStepperFooter,$ as Eye,aa as EyeOff,sa as FileJson,ea as FileText,oa as Filter,ta as FlaskConical,h as GitBranch,ra as Globe,u as HardDrive,ia as Hash,d as HelpCircle,y as Home,g as Image,la as Info,ya as InfoRow,R as JsModal,Ca as Key,Sa as Layers,B as Link,pa as Lock,T as Maximize2,P as Minus,b as Palette,ma as Pause,H as Pin,fa as Play,va as Plus,ka as Power,ba as PowerToggle,wa as RefreshCw,C as RelativeTime,A as Route,Ha as Row,Da as Search,s as SearchBar,La as SectionHeader,L as Server,Ea as Settings,Fa as Shield,U as Smartphone,q as Square,da as StatusDot,qa as TabSelector,z as Timer,Ra as Trash2,O as Unlock,X as Upload,Ia as User,W as Users,Ma as Wifi,xa as X,Y as XCircle,Ga as Zap,F as copyToClipboard,D as devToolsStorageKeys,S as formatBytes,p as formatDuration,m as formatNumber,ca as methodColor,w as persistentStorage,v as safeStringify,na as statusColor,Ba as toolTheme,f as truncateMiddle,ha as typeColor,k as usePersistedState,E as useSafeAreaInsets};
1
+ "use client";import{$ as a,$a as s,A as e,Aa as o,B as t,Ba as r,C as i,Ca as l,D as n,Da as C,E as c,Ea as S,F as h,Fa as p,G as u,Ga as m,H as d,Ha as f,I as y,Ia as v,J as g,Ja as B,K as k,Ka as w,L as T,La as D,M as P,Ma as E,N as b,Na as F,O as H,Oa as R,P as A,Pa as I,Q as L,Qa as M,R as U,Ra as x,S as q,Sa as G,T as J,Ta as K,U as z,Ua as N,V as O,Va as V,W as X,Wa as W,X as Z,Xa as j,Y as Q,Ya as Y,Z as _,Za as $,_ as aa,_a as sa,aa as ea,ba as oa,ca as ta,da as ra,ea as ia,fa as la,ga as na,ha as Ca,ia as ca,ja as Sa,ka as ha,la as pa,m as ua,ma,n as da,na as fa,o as ya,oa as va,p as ga,pa as Ba,q as ka,qa as wa,r as Ta,ra as Da,s as Pa,sa as Ea,t as ba,ta as Fa,u as Ha,ua as Ra,v as Aa,va as Ia,w as La,wa as Ma,x as Ua,xa,y as qa,ya as Ga,z as Ja,za as Ka}from"./chunks/chunk-GLXZCY6W.mjs";import"./chunks/chunk-CLXYMJTS.mjs";export{J as Activity,l as AlertCircle,z as AlertTriangle,ga as Badge,C as BarChart3,u as BaseEventStore,S as Bookmark,O as Bug,Ha as Button,qa as Card,X as Check,Z as CheckCircle,W as CheckSquare,Q as ChevronDown,_ as ChevronLeft,aa as ChevronRight,a as ChevronUp,ea as Clock,p as Cloud,e as CollapsibleSection,oa as Copy,Aa as CopyButton,h as DataViewer,ta as Database,Pa as DiffViewer,m as Download,f as Edit3,i as EmptyState,c as EventStepperFooter,ra as Eye,ia as EyeOff,la as FileJson,na as FileText,Ca as Filter,ca as FlaskConical,v as GitBranch,Sa as Globe,B as HardDrive,ha as Hash,w as HelpCircle,D as Home,E as Image,pa as Info,Ta as InfoRow,q as JsModal,ma as Key,fa as Layers,F as Link,va as Lock,R as Maximize2,I as Minus,M as Palette,Ba as Pause,x as Pin,wa as Play,Da as Plus,Ea as Power,La as PowerToggle,Fa as RefreshCw,d as RelativeTime,G as Route,Ua as Row,Ra as Search,n as SearchBar,Ja as SectionHeader,K as Server,Ia as Settings,Ma as Shield,N as Smartphone,V as Square,ka as StatusDot,t as TabSelector,j as Timer,xa as Trash2,Y as Unlock,$ as Upload,Ga as User,sa as Users,Ka as Wifi,o as X,s as XCircle,r as Zap,U as copyToClipboard,A as devToolsStorageKeys,y as formatBytes,g as formatDuration,k as formatNumber,da as methodColor,H as persistentStorage,P as safeStringify,ua as statusColor,ba as toolTheme,T as truncateMiddle,ya as typeColor,b as usePersistedState,L as useSafeAreaInsets};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/core",
3
- "version": "7.0.56",
3
+ "version": "7.0.58",
4
4
  "description": "Floating developer menu and account setup for React Native. Add tool packages and configure Desktop or MCP connections separately.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -61,10 +61,10 @@
61
61
  ],
62
62
  "dependencies": {
63
63
  "react-devtools-core": "6.1.5",
64
- "@buoy-gg/floating-tools-core": "^7.0.56",
65
- "@buoy-gg/floating-tools-react": "^7.0.56",
66
- "@buoy-gg/license": "^7.0.56",
67
- "@buoy-gg/shared-ui": "^7.0.56"
64
+ "@buoy-gg/floating-tools-react": "^7.0.58",
65
+ "@buoy-gg/shared-ui": "^7.0.58",
66
+ "@buoy-gg/license": "^7.0.58",
67
+ "@buoy-gg/floating-tools-core": "^7.0.58"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react": "*"
@@ -1 +0,0 @@
1
- "use client";var u=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var s=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var l=(r,e)=>{for(var t in e)u(r,t,{get:e[t],enumerable:true})},i=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of n(e))!f.call(r,o)&&o!==t&&u(r,o,{get:()=>e[o],enumerable:!(a=p(e,o))||a.enumerable});return r},y=(r,e,t)=>(i(r,e,"default"),t&&i(t,e,"default"));var b=process.env.NODE_ENV!=="production";typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);export{s as a,l as b,y as c,b as d};