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