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