@buoy-gg/env 7.0.78 → 7.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.EnvToolView=EnvToolView;exports.EnvVarsModal=EnvVarsModal;var _sharedUi=require("@buoy-gg/shared-ui");var _react=require("react");var _reactNative=require("react-native");var _EnvStatsOverview=require("./EnvStatsOverview");var _useDynamicEnv=require("../hooks/useDynamicEnv");var _utils=require("../utils");var _EnvVarSection=require("./EnvVarSection");var _jsxRuntime=require("react/jsx-runtime");function EnvVarsModal({visible:c,onClose:w,requiredEnvVars:u,onBack:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.EnvToolView=EnvToolView;exports.EnvVarsModal=EnvVarsModal;var _sharedUi=require("@buoy-gg/shared-ui");var _react=require("react");var _reactNative=require("react-native");var _EnvStatsOverview=require("./EnvStatsOverview");var _useDynamicEnv=require("../hooks/useDynamicEnv");var _utils=require("../utils");var _EnvVarSection=require("./EnvVarSection");var _jsxRuntime=require("react/jsx-runtime");function EnvVarsModal({visible:c,onClose:w,requiredEnvVars:u,onBack:C,onMinimize:E,enableSharedModalDimensions:V=false,inline:M=false}){const[n,j]=(0,_react.useState)("all");const[s,y]=(0,_react.useState)(false);const[a,g]=(0,_react.useState)("");const f=(0,_react.useRef)(null);const T=(0,_react.useCallback)(e=>{},[]);(0,_react.useEffect)(()=>{if(s&&f.current){f.current.focus()}},[s]);(0,_react.useEffect)(()=>{g("");y(false)},[n]);const p=(0,_useDynamicEnv.useDynamicEnv)();const d=(0,_react.useMemo)(()=>{const e={};p.forEach(({key:t,data:r})=>{if(r!==void 0&&r!==null){e[t]=typeof r==="string"?r:(0,_sharedUi.displayValue)(r)}});return e},[p]);const{requiredVars:h,optionalVars:i}=(0,_react.useMemo)(()=>{return(0,_utils.processEnvVars)(d,u)},[d,u]);const v=(0,_react.useMemo)(()=>{if(u===void 0){return{totalCount:0,requiredCount:0,optionalCount:0,presentRequiredCount:0,missingCount:0,wrongValueCount:0,wrongTypeCount:0}}return(0,_utils.calculateStats)(h,i,d)},[u,h,i,d]);const l=(0,_react.useMemo)(()=>{const e=[...h,...i];return e.sort((t,r)=>{const x={"required_missing":1,"required_wrong_type":2,"required_wrong_value":3,"required_present":4,"optional_present":5};return(x[t.status]||999)-(x[r.status]||999)})},[h,i]);const b=(0,_react.useMemo)(()=>{let e=[];switch(n){case"all":e=l;break;case"missing":e=l.filter(t=>t.status==="required_missing");break;case"issues":e=l.filter(t=>t.status==="required_wrong_type"||t.status==="required_wrong_value");break}if(a){const t=a.toLowerCase();e=e.filter(r=>r.key.toLowerCase().includes(t)||r.description?.toLowerCase().includes(t)||typeof r.value==="string"&&r.value.toLowerCase().includes(t))}return e},[l,i,n,a]);const o=v.requiredCount>0?Math.round(v.presentRequiredCount/v.requiredCount*100):null;const _=o===null?"NOTHING TO CHECK":o===100?"HEALTHY":o>=75?"WARNING":o>=50?"ERROR":"CRITICAL";const I=o===null?_sharedUi.buoyColors.textMuted:o===100?_sharedUi.buoyColors.success:o>=75?_sharedUi.buoyColors.warning:o>=50?_sharedUi.buoyColors.error:_sharedUi.buoyColors.error;if(!c)return null;const q=V?_sharedUi.devToolsStorageKeys.modal.root():_sharedUi.devToolsStorageKeys.env.modal();const S=(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[C&&(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:C}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:s?"":"Environment Variables",noMargin:s,children:s&&(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Search,{value:a,onChangeText:g,onCancel:()=>{y(false);g("")},placeholder:"Search env keys...",accessibilityLabel:"Search env keys",testID:"buoy-env-search",containerTestID:"buoy-env-search-field",clearTestID:"buoy-env-search-clear"})}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Actions,{children:!s&&(0,_jsxRuntime.jsx)(_sharedUi.HeaderSearchButton,{onPress:()=>y(true),testID:"buoy-env-search-open",accessibilityLabel:"Search env keys"})})]});const m=(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.scrollContainer,contentContainerStyle:styles.contentContainer,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"on-drag",testID:"buoy-env-scroll",children:[(0,_jsxRuntime.jsx)(_EnvStatsOverview.EnvStatsOverview,{stats:v,healthPercentage:o,healthStatus:_,healthColor:I,activeFilter:n,onFilterChange:j}),b.length>0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.varsSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,testID:"buoy-env-section-title",children:n==="all"?"ALL VARIABLES":n==="missing"?"MISSING VARIABLES":"ISSUES TO FIX"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.countBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.countText,testID:"buoy-env-section-count",children:b.length})})]}),(0,_jsxRuntime.jsx)(_EnvVarSection.EnvVarSection,{title:"",count:0,vars:b,emptyMessage:""})]}):(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-env-empty",...(0,_sharedUi.resolveListEmptyState)({subject:"variables",verb:"declared",search:a,total:l.length,waiting:{otto:"keys",title:"No variables",message:"No variables found"}})})]});if(M){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.inlineRoot,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.inlineHeader,..._sharedUi.windowDragProps,children:S}),m]})}return(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:c,onClose:w,onMinimize:E,persistenceKey:q,header:{customContent:S,showToggleButton:true},onModeChange:T,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},children:m})}function EnvToolView({requiredEnvVars:c}){return(0,_jsxRuntime.jsx)(EnvVarsModal,{inline:true,visible:true,requiredEnvVars:c,onClose:()=>{}})}const styles=_reactNative.StyleSheet.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:_sharedUi.buoyColors.border,backgroundColor:"transparent"},scrollContainer:{flex:1,backgroundColor:"transparent"},contentContainer:{padding:8,paddingBottom:24},varsSection:{marginTop:16},sectionHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8,paddingHorizontal:8},sectionTitle:{fontSize:10,fontWeight:"700",color:_sharedUi.night.color.textTertiary,letterSpacing:1.2,fontFamily:_sharedUi.monoFont},countBadge:{backgroundColor:_sharedUi.night.color.accent+"15",paddingHorizontal:8,paddingVertical:2,borderRadius:9999,borderWidth:1,borderColor:_sharedUi.night.color.accent+"40"},countText:{fontSize:10,fontWeight:"500",color:_sharedUi.night.color.accent,fontFamily:_sharedUi.monoFont}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createEnvSyncAdapter=createEnvSyncAdapter;exports.setToolRequiredEnvVars=setToolRequiredEnvVars;var _remoteEnv=require("../env/utils/remoteEnv");var _utils=require("../env/utils/utils");function collectEnv(){const e={};for(const[r,t]of Object.entries((0,_remoteEnv.getRemoteEnv)()??(typeof process==="undefined"?{}:process.env))){if(typeof t==="string"){e[r]=t}}return e}let toolRequiredEnvVars=[];function setToolRequiredEnvVars(e){toolRequiredEnvVars=e}function createEnvSyncAdapter(e=[]){return{version:1,getSnapshot:()=>{const r=collectEnv();const t=e.length>0?e:toolRequiredEnvVars;let n=[];try{n=(0,_utils.processEnvVars)(r,t).requiredVars.map(s=>({key:s.key,status:s.status}))}catch{n=[]}return{env:r,requiredEnvVars:t,checks:n}},subscribe:()=>()=>{}}}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createEnvSyncAdapter=createEnvSyncAdapter;exports.setToolRequiredEnvVars=setToolRequiredEnvVars;var _license=require("@buoy-gg/license");var _remoteEnv=require("../env/utils/remoteEnv");var _utils=require("../env/utils/utils");function collectEnv(){const e={};for(const[r,t]of Object.entries((0,_remoteEnv.getRemoteEnv)()??(typeof process==="undefined"?{}:process.env))){if(typeof t==="string"){e[r]=t}}return e}let toolRequiredEnvVars=[];function setToolRequiredEnvVars(e){toolRequiredEnvVars=e}function createEnvSyncAdapter(e=[]){return{version:1,getSnapshot:()=>{const r=collectEnv();const t=e.length>0?e:toolRequiredEnvVars;let n=[];try{n=(0,_utils.processEnvVars)(r,t).requiredVars.map(s=>({key:s.key,status:s.status}))}catch{n=[]}return{env:(0,_license.maskBuoyAccountKeys)(r),requiredEnvVars:t,checks:n}},subscribe:()=>()=>{}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{JsModal as G,devToolsStorageKeys as
|
|
1
|
+
"use strict";import{JsModal as G,devToolsStorageKeys as H,ModalHeader as h,HeaderSearchButton as K,displayValue as Q,buoyColors as l,night as S,windowDragProps as J,ToolEmptyState as U,resolveListEmptyState as X,monoFont as L}from"@buoy-gg/shared-ui";import{useCallback as Y,useState as V,useRef as Z,useEffect as q,useMemo as g}from"react";import{View as y,StyleSheet as $,ScrollView as ee,Text as A}from"react-native";import{EnvStatsOverview as te}from"./EnvStatsOverview";import{useDynamicEnv as oe}from"../hooks/useDynamicEnv";import{processEnvVars as re,calculateStats as ne}from"../utils";import{EnvVarSection as se}from"./EnvVarSection";import{jsx as e,jsxs as f}from"react/jsx-runtime";export function EnvVarsModal({visible:p,onClose:D,requiredEnvVars:m,onBack:E,onMinimize:B,enableSharedModalDimensions:F=false,inline:N=false}){const[i,P]=V("all");const[a,w]=V(false);const[c,I]=V("");const x=Z(null);const j=Y(t=>{},[]);q(()=>{if(a&&x.current){x.current.focus()}},[a]);q(()=>{I("");w(false)},[i]);const k=oe();const C=g(()=>{const t={};k.forEach(({key:o,data:r})=>{if(r!==void 0&&r!==null){t[o]=typeof r==="string"?r:Q(r)}});return t},[k]);const{requiredVars:b,optionalVars:u}=g(()=>{return re(C,m)},[C,m]);const v=g(()=>{if(m===void 0){return{totalCount:0,requiredCount:0,optionalCount:0,presentRequiredCount:0,missingCount:0,wrongValueCount:0,wrongTypeCount:0}}return ne(b,u,C)},[m,b,u,C]);const d=g(()=>{const t=[...b,...u];return t.sort((o,r)=>{const _={"required_missing":1,"required_wrong_type":2,"required_wrong_value":3,"required_present":4,"optional_present":5};return(_[o.status]||999)-(_[r.status]||999)})},[b,u]);const T=g(()=>{let t=[];switch(i){case"all":t=d;break;case"missing":t=d.filter(o=>o.status==="required_missing");break;case"issues":t=d.filter(o=>o.status==="required_wrong_type"||o.status==="required_wrong_value");break}if(c){const o=c.toLowerCase();t=t.filter(r=>r.key.toLowerCase().includes(o)||r.description?.toLowerCase().includes(o)||typeof r.value==="string"&&r.value.toLowerCase().includes(o))}return t},[d,u,i,c]);const n=v.requiredCount>0?Math.round(v.presentRequiredCount/v.requiredCount*100):null;const z=n===null?"NOTHING TO CHECK":n===100?"HEALTHY":n>=75?"WARNING":n>=50?"ERROR":"CRITICAL";const O=n===null?l.textMuted:n===100?l.success:n>=75?l.warning:n>=50?l.error:l.error;if(!p)return null;const W=F?H.modal.root():H.env.modal();const M=f(h,{children:[E&&e(h.Navigation,{onBack:E}),e(h.Content,{title:a?"":"Environment Variables",noMargin:a,children:a&&e(h.Search,{value:c,onChangeText:I,onCancel:()=>{w(false);I("")},placeholder:"Search env keys...",accessibilityLabel:"Search env keys",testID:"buoy-env-search",containerTestID:"buoy-env-search-field",clearTestID:"buoy-env-search-clear"})}),e(h.Actions,{children:!a&&e(K,{onPress:()=>w(true),testID:"buoy-env-search-open",accessibilityLabel:"Search env keys"})})]});const R=f(ee,{style:s.scrollContainer,contentContainerStyle:s.contentContainer,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"on-drag",testID:"buoy-env-scroll",children:[e(te,{stats:v,healthPercentage:n,healthStatus:z,healthColor:O,activeFilter:i,onFilterChange:P}),T.length>0?f(y,{style:s.varsSection,children:[f(y,{style:s.sectionHeader,children:[e(A,{style:s.sectionTitle,testID:"buoy-env-section-title",children:i==="all"?"ALL VARIABLES":i==="missing"?"MISSING VARIABLES":"ISSUES TO FIX"}),e(y,{style:s.countBadge,children:e(A,{style:s.countText,testID:"buoy-env-section-count",children:T.length})})]}),e(se,{title:"",count:0,vars:T,emptyMessage:""})]}):e(U,{testID:"buoy-env-empty",...X({subject:"variables",verb:"declared",search:c,total:d.length,waiting:{otto:"keys",title:"No variables",message:"No variables found"}})})]});if(N){return f(y,{style:s.inlineRoot,children:[e(y,{style:s.inlineHeader,...J,children:M}),R]})}return e(G,{visible:p,onClose:D,onMinimize:B,persistenceKey:W,header:{customContent:M,showToggleButton:true},onModeChange:j,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},children:R})}export function EnvToolView({requiredEnvVars:p}){return e(EnvVarsModal,{inline:true,visible:true,requiredEnvVars:p,onClose:()=>{}})}const s=$.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:l.border,backgroundColor:"transparent"},scrollContainer:{flex:1,backgroundColor:"transparent"},contentContainer:{padding:8,paddingBottom:24},varsSection:{marginTop:16},sectionHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8,paddingHorizontal:8},sectionTitle:{fontSize:10,fontWeight:"700",color:S.color.textTertiary,letterSpacing:1.2,fontFamily:L},countBadge:{backgroundColor:S.color.accent+"15",paddingHorizontal:8,paddingVertical:2,borderRadius:9999,borderWidth:1,borderColor:S.color.accent+"40"},countText:{fontSize:10,fontWeight:"500",color:S.color.accent,fontFamily:L}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{
|
|
1
|
+
"use strict";import{maskBuoyAccountKeys as c}from"@buoy-gg/license";import{getRemoteEnv as u}from"../env/utils/remoteEnv";import{processEnvVars as i}from"../env/utils/utils";function a(){const e={};for(const[r,t]of Object.entries(u()??(typeof process==="undefined"?{}:process.env))){if(typeof t==="string"){e[r]=t}}return e}let s=[];export function setToolRequiredEnvVars(e){s=e}export function createEnvSyncAdapter(e=[]){return{version:1,getSnapshot:()=>{const r=a();const t=e.length>0?e:s;let n=[];try{n=i(r,t).requiredVars.map(o=>({key:o.key,status:o.status}))}catch{n=[]}return{env:c(r),requiredEnvVars:t,checks:n}},subscribe:()=>()=>{}}}
|
package/lib/web/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var ue=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Be=Object.prototype.hasOwnProperty;var Oe=(e,t)=>{for(var r in t)ue(e,r,{get:t[r],enumerable:true})},pe=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ne(t))!Be.call(e,n)&&n!==r&&ue(e,n,{get:()=>t[n],enumerable:!(a=Re(t,n))||a.enumerable});return e},je=(e,t,r)=>(pe(e,t,"default"),r&&pe(r,t,"default"));var In=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import{EnvIcon as Me}from"@buoy-gg/floating-tools-core/web";import{JsModal as Pe,devToolsStorageKeys as ye,ModalHeader as M,HeaderSearchButton as $e,displayValue as Fe,buoyColors as q,night as J,windowDragProps as We,ToolEmptyState as He,resolveListEmptyState as ze,monoFont as he}from"@buoy-gg/shared-ui/web";import{useCallback as Ke,useState as Z,useRef as Ge,useEffect as be,useMemo as P}from"react";var fe={};Oe(fe,{AccessibilityInfo:()=>Xe,ActivityIndicator:()=>en,Alert:()=>rn,Animated:()=>Gt,AppRegistry:()=>Ze,AppState:()=>et,Appearance:()=>Qe,BackHandler:()=>tt,Button:()=>tn,CheckBox:()=>mt,Clipboard:()=>nt,DeviceEventEmitter:()=>_t,Dimensions:()=>rt,Easing:()=>at,FlatList:()=>gt,I18nManager:()=>ot,Image:()=>vt,ImageBackground:()=>xt,InteractionManager:()=>st,Keyboard:()=>it,KeyboardAvoidingView:()=>wt,LayoutAnimation:()=>lt,Linking:()=>ct,LogBox:()=>Dt,Modal:()=>Qt,NativeEventEmitter:()=>dt,NativeModules:()=>Ye,PanResponder:()=>ut,Picker:()=>Ct,PixelRatio:()=>pt,Platform:()=>yt,Pressable:()=>Xt,ProgressBar:()=>St,RefreshControl:()=>Et,SafeAreaView:()=>kt,ScrollView:()=>we,SectionList:()=>Tt,Share:()=>ht,StatusBar:()=>Vt,StyleSheet:()=>F,Switch:()=>Zt,Text:()=>h,TextInput:()=>Ut,Touchable:()=>Lt,TouchableHighlight:()=>Jt,TouchableNativeFeedback:()=>It,TouchableOpacity:()=>Y,TouchableWithoutFeedback:()=>Yt,UIManager:()=>bt,Vibration:()=>ft,View:()=>y,VirtualizedList:()=>At,YellowBox:()=>qt,findNodeHandle:()=>nn,unstable_createElement:()=>Je,useColorScheme:()=>Rt,useLocaleContext:()=>Nt,useWindowDimensions:()=>Bt});je(fe,Ue);import*as Ue from"react-native-web";import{unstable_createElement as Je,NativeModules as Ye,AccessibilityInfo as Xe,Appearance as Qe,AppRegistry as Ze,AppState as et,BackHandler as tt,Clipboard as nt,Dimensions as rt,Easing as at,I18nManager as ot,Keyboard as it,InteractionManager as st,LayoutAnimation as lt,Linking as ct,NativeEventEmitter as dt,PanResponder as ut,PixelRatio as pt,Platform as yt,Share as ht,UIManager as bt,Vibration as ft,CheckBox as mt,FlatList as gt,Image as vt,ImageBackground as xt,KeyboardAvoidingView as wt,Picker as Ct,ProgressBar as St,RefreshControl as Et,SafeAreaView as kt,SectionList as Tt,StatusBar as Vt,Touchable as Lt,TouchableNativeFeedback as It,VirtualizedList as At,YellowBox as qt,LogBox as Dt,DeviceEventEmitter as _t,useColorScheme as Rt,useLocaleContext as Nt,useWindowDimensions as Bt}from"react-native-web";import*as b from"react-native-web";import{createElement as ee,forwardRef as me,useCallback as Ot,useRef as jt}from"react";import{useEffect as Mt,useState as Pt}from"react";import{createPortal as $t}from"react-dom";var Ft='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as Wt}from"react/jsx-runtime";var $=Symbol.for("@buoy-gg/portal-host"),ge=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"};function ve(){let e=document;if(e[$])return e[$].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:Ft});let r=()=>{let o=document.fullscreenElement,u=o&&o.tagName!=="CANVAS"?o:document.body;t.parentElement!==u&&u.appendChild(t)},a=new Map,n=o=>{(!t.contains(o.target)||!ge(o.target))&&a.set(o.code||o.key,{key:o.key,code:o.code,location:o.location,keyCode:o.keyCode,which:o.which,altKey:o.altKey,ctrlKey:o.ctrlKey,metaKey:o.metaKey,shiftKey:o.shiftKey})},i=o=>{a.delete(o.code||o.key)},s=()=>a.clear(),l=()=>{let o=[...a.values()];a.clear();for(let u of o)document.dispatchEvent(new KeyboardEvent("keyup",{...u,bubbles:true}))},c=o=>{ge(o.target)&&o.stopPropagation()},d=o=>o.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",n,true),document.addEventListener("keyup",i,true),window.addEventListener("blur",s),t.addEventListener("focusin",l),t.addEventListener("keydown",c),t.addEventListener("keyup",c),t.addEventListener("keypress",c),t.addEventListener("wheel",d,{passive:true}),e[$]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",n,true),document.removeEventListener("keyup",i,true),window.removeEventListener("blur",s),t.remove(),delete e[$]}},t}function Ht({children:e}){let[t,r]=Pt(null);return Mt(()=>{let a=ve(),n=document[$];return n.users++,r(a),()=>{--n.users===0&&n.dispose()}},[]),t?$t(Wt("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}var D=b,zt=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],_=e=>typeof e=="number"?`${e}px`:e;function te(e){if(Array.isArray(e)){let u=e.map(te);return u.some((g,v)=>g!==e[v])?u:e}if(!e||typeof e!="object"||!zt.some(u=>e[u]!=null))return e;let{shadowColor:t,shadowOffset:r,shadowOpacity:a,shadowRadius:n,textShadowColor:i,textShadowOffset:s,textShadowRadius:l,...c}=e;if(t!=null||r!=null||a!=null||n!=null){let u=t??"black",g=a==null?u:`color-mix(in srgb, ${u} ${Math.min(a,1)*100}%, transparent)`,v=`${_(r?.width??0)} ${_(r?.height??0)} ${_(n??0)} ${g}`;c.boxShadow=typeof c.boxShadow=="string"?`${c.boxShadow}, ${v}`:c.boxShadow??v}let{width:d=0,height:o=0}=s??{};if(i&&(d||o||l)){let u=`${_(d)} ${_(o)} ${_(l??0)} ${i}`;c.textShadow=c.textShadow?`${c.textShadow}, ${u}`:u}return c}var Kt=D.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function xe(e,t){if(typeof e=="function")return a=>xe(e(a),t);let r=te(e);return t?[r,Kt[t]]:r}var F={...D.StyleSheet,create:e=>D.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,te(r)])))};function S(e){let t=me((a,n)=>{let{accessibilityState:i,accessibilityValue:s,pointerEvents:l,...c}=a;for(let o of["busy","checked","disabled","expanded","selected"])i?.[o]!==void 0&&c[`aria-${o}`]===void 0&&(c[`aria-${o}`]=i[o]);for(let[o,u]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))s?.[o]!==void 0&&c[`aria-${u}`]===void 0&&(c[`aria-${u}`]=s[o]);let d=xe(c.style,l);return d!==c.style&&(c.style=d),ee(e,{...c,ref:n})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var y=S(b.View),h=S(b.Text),Gt={...D.Animated,View:D.Animated.createAnimatedComponent(y),Text:D.Animated.createAnimatedComponent(h)},Ut=S(b.TextInput),Y=S(b.TouchableOpacity),Jt=S(b.TouchableHighlight),Yt=S(b.TouchableWithoutFeedback),Xt=S(b.Pressable),we=S(b.ScrollView),Ce=me((e,t)=>{let r=jt(null),a=Ot(n=>{if(n){let i=n;for(;i.parentElement&&i.parentElement!==document.body;)i=i.parentElement;i.parentElement===document.body&&(r.current=i,Object.assign(i.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),ve().appendChild(i))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(n):t&&(t.current=n)},[t]);return ee(Ht,null,ee(b.Modal,{...e,ref:a}))});Ce.displayName="Modal";var Qt=S(Ce),Zt=S(b.Switch),en=S(b.ActivityIndicator),tn=S(b.Button),nn=b.findNodeHandle,rn={alert(e,t,r,a){if(typeof document>"u")return;let n=document.createElement("dialog");n.dataset.buoyRoot="",n.setAttribute("aria-label",e),n.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 i=document.createElement("h2");if(i.textContent=e,i.style.cssText="font-size:18px;margin:0 0 12px",n.appendChild(i),t){let d=document.createElement("p");d.textContent=t,d.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",n.appendChild(d)}let s=document.createElement("div");s.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let l=r?.length?r:[{text:"OK"}],c=()=>{n.close?.(),n.remove()};for(let d of l){let o=document.createElement("button");o.type="button",o.textContent=d.text??"OK",o.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${d.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,o.onclick=()=>{c(),d.onPress?.()},s.appendChild(o)}n.addEventListener("cancel",d=>{d.preventDefault(),a?.cancelable!==false&&(c(),a?.onDismiss?.())}),n.appendChild(s),document.body.appendChild(n),n.showModal?n.showModal():n.setAttribute("open","")}};import{CompactRow as an,night as V,monoFont as Se}from"@buoy-gg/shared-ui/web";import{jsx as L,jsxs as R}from"react/jsx-runtime";function on({stats:e,healthPercentage:t,healthStatus:r,healthColor:a,activeFilter:n="all",onFilterChange:i}){let s=e.wrongValueCount+e.wrongTypeCount,l=t===null?"No required variables":`${t}% healthy`;return R(y,{style:p.container,children:[L(an,{statusDotColor:a,statusLabel:"System",statusSublabel:r.toLowerCase(),primaryText:"Environment Configuration",secondaryText:l,testID:"buoy-env-health",statusSublabelTestID:"buoy-env-health-status",accessibilityLabel:`Environment configuration ${r.toLowerCase()}, ${l}`,customBadge:t===null?void 0:L(y,{style:[p.percentBadge,{borderColor:a+"40",backgroundColor:a+"10"}],children:R(h,{style:[p.percentText,{color:a}],testID:"buoy-env-health-percent",children:[t,"%"]})})}),R(y,{style:p.statsGrid,children:[R(Y,{style:[p.statCard,n==="all"&&p.statCardActive],onPress:()=>i?.("all"),activeOpacity:.8,testID:"buoy-env-filter-all",accessibilityRole:"button",accessibilityLabel:"Show all variables",accessibilityState:{selected:n==="all"},children:[L(h,{style:[p.statValue,n==="all"&&p.statValueActive],testID:"buoy-env-filter-all-count",children:e.requiredCount+e.optionalCount}),L(h,{style:[p.statLabel,n==="all"&&p.statLabelActive],children:"ALL"})]}),R(Y,{style:[p.statCard,n==="missing"&&p.statCardActive],onPress:()=>i?.("missing"),activeOpacity:.8,testID:"buoy-env-filter-missing",accessibilityRole:"button",accessibilityLabel:"Show missing variables",accessibilityState:{selected:n==="missing"},children:[L(h,{style:[p.statValue,n==="missing"&&p.statValueActive],testID:"buoy-env-filter-missing-count",children:e.missingCount}),L(h,{style:[p.statLabel,n==="missing"&&p.statLabelActive],children:"MISSING"})]}),R(Y,{style:[p.statCard,n==="issues"&&p.statCardActive],onPress:()=>i?.("issues"),activeOpacity:.8,testID:"buoy-env-filter-issues",accessibilityRole:"button",accessibilityLabel:"Show variables with issues",accessibilityState:{selected:n==="issues"},children:[L(h,{style:[p.statValue,n==="issues"&&p.statValueActive],testID:"buoy-env-filter-issues-count",children:s}),L(h,{style:[p.statLabel,n==="issues"&&p.statLabelActive],children:"ISSUES"})]})]})]})}var p=F.create({container:{gap:8},statsGrid:{flexDirection:"row",gap:8,paddingHorizontal:4},statCard:{flex:1,backgroundColor:V.color.surface,borderRadius:10,borderWidth:1,borderColor:V.color.border,padding:12,alignItems:"center",justifyContent:"center",minHeight:64},statCardActive:{borderColor:V.color.accentBorderStrong,backgroundColor:V.color.accentSoft},statValue:{fontSize:22,fontWeight:"700",fontFamily:Se,lineHeight:26,color:V.color.text},statValueActive:{color:V.color.accent},statLabel:{fontSize:9,color:V.color.textTertiary,marginTop:4,textTransform:"uppercase",letterSpacing:.5,fontWeight:"600"},statLabelActive:{color:V.color.accent},percentBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:6,borderWidth:1},percentText:{fontSize:14,fontWeight:"700",fontFamily:Se}});import{useMemo as Ee}from"react";var ke=null;function sn(e){ke=e}function Te(){return ke}function ln({envFilter:e=()=>true}={}){let t=Te()??(typeof process>"u"?{}:process.env),r=Ee(()=>a=>{let n=t[a];if(n===void 0)return null;try{if(n.startsWith("{")||n.startsWith("["))return JSON.parse(n);if(n.toLowerCase()==="true")return true;if(n.toLowerCase()==="false")return false;if(/^\d+$/.test(n)){let i=parseInt(n,10);return isNaN(i)?n:i}if(/^\d*\.\d+$/.test(n)){let i=parseFloat(n);return isNaN(i)?n:i}return n}catch{return n}},[t]);return Ee(()=>Object.keys(t).filter(a=>{let n=t[a];return e(a,n)}).map(a=>({key:a,data:r(a)})),[e,r,t])}function ne(e){let t=typeof e;if(t==="boolean")return"boolean";if(t==="number")return"number";if(Array.isArray(e))return"array";if(t==="object"&&e!==null)return"object";if(t==="string"){let r=e;if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{let n=JSON.parse(r);return Array.isArray(n)?"array":"object"}catch{return"string"}let a=r.toLowerCase();return a==="true"||a==="false"||a==="enabled"||a==="disabled"||a==="yes"||a==="no"||a==="on"||a==="off"?"boolean":!isNaN(Number(r))&&r.trim()!==""?"number":r.startsWith("http://")||r.startsWith("https://")?"url":r.includes(",")?"array":"string"}return"unknown"}var cn=class{constructor(e){this.key=e}exists(){return this.key}withValue(e){return this.expectedValue=e,delete this.expectedType,this}withType(e){return this.expectedType=e,delete this.expectedValue,this}withDescription(e){return this.description=e,this}build(){return this.expectedValue!==void 0?this.description?{key:this.key,expectedValue:this.expectedValue,description:this.description}:{key:this.key,expectedValue:this.expectedValue}:this.expectedType!==void 0?this.description?{key:this.key,expectedType:this.expectedType,description:this.description}:{key:this.key,expectedType:this.expectedType}:this.key}};function dn(e){return new cn(e)}function un(e){return e}var re=(e,t)=>{let r=[],a=[],n=new Set;return t?.forEach(i=>{let s=typeof i=="string"?i:i.key,l=typeof i=="object"&&"expectedValue"in i?i.expectedValue:void 0,c=typeof i=="object"&&"expectedType"in i?i.expectedType:void 0,d=typeof i=="object"&&"description"in i?i.description:void 0;n.add(s);let o=e[s],u=o!==void 0,g;if(!u)g="required_missing";else if(l){let v=false;l==="sk_*"?v=o.startsWith("sk_"):l==="production or development"?v=o==="production"||o==="development":v=o===l,g=v?"required_present":"required_wrong_value"}else c&&ne(o).toLowerCase()!==c.toLowerCase()?g="required_wrong_type":g="required_present";r.push({key:s,value:o,expectedValue:l,expectedType:c,description:d,status:g,category:"required"})}),Object.entries(e).forEach(([i,s])=>{n.has(i)||a.push({key:i,value:s,status:"optional_present",category:"optional"})}),r.sort((i,s)=>{let l={required_missing:0,required_wrong_value:1,required_wrong_type:2,required_present:3,optional_present:4};return l[i.status]!==l[s.status]?l[i.status]-l[s.status]:i.key.localeCompare(s.key)}),a.sort((i,s)=>i.key.localeCompare(s.key)),{requiredVars:r,optionalVars:a}},Ve=(e,t,r)=>{let a=Object.keys(r).length,n=e.length,i=e.filter(o=>o.status==="required_missing").length,s=e.filter(o=>o.status==="required_wrong_value").length,l=e.filter(o=>o.status==="required_wrong_type").length,c=e.filter(o=>o.status==="required_present").length,d=t.length;return{totalCount:a,requiredCount:n,missingCount:i,wrongValueCount:s,wrongTypeCount:l,presentRequiredCount:c,optionalCount:d}};import{useCallback as pn,useState as yn}from"react";import{CompactRow as hn,TypeBadge as ae,buoyColors as N,night as oe,monoFont as ie}from"@buoy-gg/shared-ui/web";import{Fragment as bn,jsx as E,jsxs as A}from"react/jsx-runtime";var fn=(e,t)=>{switch(e){case"required_present":return{label:"Valid",color:N.success,sublabel:"Required"};case"required_missing":return{label:"Missing",color:N.error,sublabel:"Required"};case"required_wrong_value":return{label:"Wrong",color:N.warning,sublabel:"Invalid value"};case"required_wrong_type":return{label:"Type Error",color:N.info,sublabel:"Wrong type"};case"optional_present":return{label:"Set",color:N.textSecondary,sublabel:"Optional"}}};var mn=e=>e==null?"undefined":typeof e=="string"?e:String(e);function gn({envVar:e,isExpanded:t,onPress:r}){let a=fn(e.status,e.expectedType),n=e.value!==void 0&&e.value!==null,i=e.key.split("_").map(c=>c.toLowerCase()).join(" \u203A "),s=`buoy-env-row-${e.key}`,l=A(y,{style:f.expandedContainer,children:[A(y,{style:f.expandedRow,children:[E(h,{style:f.expandedLabel,children:"Value:"}),E(h,{style:f.expandedValue,numberOfLines:3,testID:`${s}-value`,children:mn(e.value)||"undefined"})]}),e.status==="required_wrong_type"&&e.expectedType&&A(bn,{children:[A(y,{style:f.expandedRow,children:[E(h,{style:f.expandedLabel,children:"Type:"}),E(ae,{type:ne(e.value),testID:`${s}-actual-type`})]}),A(y,{style:f.expandedRow,children:[E(h,{style:f.expandedLabel,children:"Expected:"}),E(ae,{type:e.expectedType,testID:`${s}-expected-type`})]})]}),e.status==="required_wrong_value"&&e.expectedValue&&A(y,{style:f.expandedRow,children:[E(h,{style:f.expandedLabel,children:"Expected:"}),E(h,{style:f.expandedExpected,testID:`${s}-expected-value`,children:String(e.expectedValue)})]}),e.description&&A(y,{style:f.expandedRow,children:[E(h,{style:f.expandedLabel,children:"Info:"}),E(h,{style:f.expandedDescription,testID:`${s}-description`,children:e.description})]})]});return E(hn,{statusDotColor:a.color,statusLabel:a.label,statusSublabel:a.sublabel,primaryText:i,secondaryText:void 0,expandedContent:l,isExpanded:t,expandedGlowColor:a.color,customBadge:e.expectedType?E(ae,{type:e.expectedType,testID:`${s}-type-badge`}):void 0,showChevron:true,onPress:r?()=>r(e):void 0,testID:s,statusTestID:`${s}-status`,statusSublabelTestID:`${s}-category`,accessibilityLabel:`${e.key}, ${a.label}, ${a.sublabel}`})}var f=F.create({expandedContainer:{gap:6},expandedRow:{flexDirection:"row",alignItems:"center",gap:8},expandedLabel:{fontSize:10,color:oe.color.textTertiary,fontWeight:"600",minWidth:60,fontFamily:ie},expandedValue:{fontSize:11,color:oe.color.textSecondary,fontFamily:ie,flex:1},expandedExpected:{fontSize:11,color:N.warning,fontFamily:ie,flex:1},expandedDescription:{fontSize:11,color:oe.color.textSecondary,flex:1}});import{SectionHeader as B,night as W,monoFont as vn}from"@buoy-gg/shared-ui/web";import{jsx as I,jsxs as X}from"react/jsx-runtime";function xn({title:e,count:t,vars:r,emptyMessage:a}){let[n,i]=yn(null),s=pn(l=>{i(c=>c===l.key?null:l.key)},[]);return r.length===0&&e==="Required Variables"?X(y,{style:H.sectionContainer,children:[X(B,{children:[I(B.Title,{children:e}),I(B.Badge,{count:0,color:W.color.accent})]}),I(y,{style:H.emptySection,children:I(h,{style:H.emptySectionText,children:a})})]}):r.length===0?null:X(y,{style:H.sectionContainer,children:[e!==""&&X(B,{children:[I(B.Title,{children:e}),I(B.Badge,{count:t,color:W.color.accent})]}),I(y,{style:H.sectionContent,children:r.map(l=>I(gn,{envVar:l,isExpanded:n===l.key,onPress:s},l.key))})]})}var H=F.create({sectionContainer:{gap:8},sectionContent:{},emptySection:{padding:20,backgroundColor:W.color.accent+"08",borderRadius:8,borderWidth:1,borderColor:W.color.accent+"20",alignItems:"center"},emptySectionText:{color:W.color.accent,fontSize:11,textAlign:"center",fontFamily:vn,opacity:.8,letterSpacing:.5}});import{jsx as m,jsxs as z}from"react/jsx-runtime";function se({visible:e,onClose:t,requiredEnvVars:r,onBack:a,onMinimize:n,enableSharedModalDimensions:i=false,inline:s=false}){let[l,c]=Z("all"),[d,o]=Z(false),[u,g]=Z(""),v=Ge(null),Ae=Ke(x=>{},[]);be(()=>{d&&v.current&&v.current.focus()},[d]),be(()=>{g(""),o(false)},[l]);let le=ln(),K=P(()=>{let x={};return le.forEach(({key:w,data:C})=>{C!=null&&(x[w]=typeof C=="string"?C:Fe(C))}),x},[le]),{requiredVars:G,optionalVars:O}=P(()=>re(K,r),[K,r]),U=P(()=>r===void 0?{totalCount:0,requiredCount:0,optionalCount:0,presentRequiredCount:0,missingCount:0,wrongValueCount:0,wrongTypeCount:0}:Ve(G,O,K),[r,G,O,K]),j=P(()=>[...G,...O].sort((x,w)=>{let C={required_missing:1,required_wrong_type:2,required_wrong_value:3,required_present:4,optional_present:5};return(C[x.status]||999)-(C[w.status]||999)}),[G,O]),Q=P(()=>{let x=[];switch(l){case"all":x=j;break;case"missing":x=j.filter(w=>w.status==="required_missing");break;case"issues":x=j.filter(w=>w.status==="required_wrong_type"||w.status==="required_wrong_value");break}if(u){let w=u.toLowerCase();x=x.filter(C=>C.key.toLowerCase().includes(w)||C.description?.toLowerCase().includes(w)||typeof C.value=="string"&&C.value.toLowerCase().includes(w))}return x},[j,O,l,u]),k=U.requiredCount>0?Math.round(U.presentRequiredCount/U.requiredCount*100):null,qe=k===null?"NOTHING TO CHECK":k===100?"HEALTHY":k>=75?"WARNING":k>=50?"ERROR":"CRITICAL",De=k===null?q.textMuted:k===100?q.success:k>=75?q.warning:k>=50?q.error:q.error;if(!e)return null;let _e=i?ye.modal.root():ye.env.modal(),ce=z(M,{children:[a&&m(M.Navigation,{onBack:a}),m(M.Content,{title:d?"":"Environment Variables",noMargin:d,children:d&&m(M.Search,{value:u,onChangeText:g,onCancel:()=>{o(false),g("")},placeholder:"Search env keys...",accessibilityLabel:"Search env keys",testID:"buoy-env-search",containerTestID:"buoy-env-search-field",clearTestID:"buoy-env-search-clear"})}),m(M.Actions,{children:!d&&m($e,{onPress:()=>o(true),testID:"buoy-env-search-open",accessibilityLabel:"Search env keys"})})]}),de=z(we,{keyboardShouldPersistTaps:"handled",style:T.scrollContainer,contentContainerStyle:T.contentContainer,showsVerticalScrollIndicator:false,testID:"buoy-env-scroll",children:[m(on,{stats:U,healthPercentage:k,healthStatus:qe,healthColor:De,activeFilter:l,onFilterChange:c}),Q.length>0?z(y,{style:T.varsSection,children:[z(y,{style:T.sectionHeader,children:[m(h,{style:T.sectionTitle,testID:"buoy-env-section-title",children:l==="all"?"ALL VARIABLES":l==="missing"?"MISSING VARIABLES":"ISSUES TO FIX"}),m(y,{style:T.countBadge,children:m(h,{style:T.countText,testID:"buoy-env-section-count",children:Q.length})})]}),m(xn,{title:"",count:0,vars:Q,emptyMessage:""})]}):m(He,{testID:"buoy-env-empty",...ze({subject:"variables",verb:"declared",search:u,total:j.length,waiting:{otto:"keys",title:"No variables",message:"No variables found"}})})]});return s?z(y,{style:T.inlineRoot,children:[m(y,{style:T.inlineHeader,...We,children:ce}),de]}):m(Pe,{visible:e,onClose:t,onMinimize:n,persistenceKey:_e,header:{customContent:ce,showToggleButton:true},onModeChange:Ae,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},children:de})}function wn({requiredEnvVars:e}){return m(se,{inline:true,visible:true,requiredEnvVars:e,onClose:()=>{}})}var T=F.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:q.border,backgroundColor:"transparent"},scrollContainer:{flex:1,backgroundColor:"transparent"},contentContainer:{padding:8,paddingBottom:24},varsSection:{marginTop:16},sectionHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8,paddingHorizontal:8},sectionTitle:{fontSize:10,fontWeight:"700",color:J.color.textTertiary,letterSpacing:1.2,fontFamily:he},countBadge:{backgroundColor:J.color.accent+"15",paddingHorizontal:8,paddingVertical:2,borderRadius:9999,borderWidth:1,borderColor:J.color.accent+"40"},countText:{fontSize:10,fontWeight:"500",color:J.color.accent,fontFamily:he}});function Cn(){let e={};for(let[t,r]of Object.entries(Te()??(typeof process>"u"?{}:process.env)))typeof r=="string"&&(e[t]=r);return e}var Le=[];function Sn(e){Le=e}function En(e=[]){return{version:1,getSnapshot:()=>{let t=Cn(),r=e.length>0?e:Le,a=[];try{a=re(t,r).requiredVars.map(n=>({key:n.key,status:n.status}))}catch{a=[]}return{env:t,requiredEnvVars:r,checks:a}},subscribe:()=>()=>{}}}import{createToolFactory as kn,defineToolPreset as Tn}from"@buoy-gg/shared-ui/web";import{jsx as Vn}from"react/jsx-runtime";var Ie=Tn({id:"env",name:"ENV",description:"Environment variables debugger",slot:"both",icon:({size:e})=>Vn(Me,{size:e}),component:se,props:{requiredEnvVars:[],enableSharedModalDimensions:true}}),Ln=kn(Ie,e=>(Sn(e.requiredEnvVars||[]),{requiredEnvVars:e.requiredEnvVars||[],enableSharedModalDimensions:e.enableSharedModalDimensions??true}));export{wn as EnvToolView,se as EnvVarsModal,Ve as calculateStats,En as createEnvSyncAdapter,Ln as createEnvTool,un as createEnvVarConfig,Ie as envToolPreset,dn as envVar,ne as getEnvVarType,re as processEnvVars,sn as setRemoteEnv};
|
|
1
|
+
"use client";var ue=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Be=Object.prototype.hasOwnProperty;var Oe=(e,t)=>{for(var r in t)ue(e,r,{get:t[r],enumerable:true})},pe=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ne(t))!Be.call(e,n)&&n!==r&&ue(e,n,{get:()=>t[n],enumerable:!(a=Re(t,n))||a.enumerable});return e},Me=(e,t,r)=>(pe(e,t,"default"),r&&pe(r,t,"default"));var An=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import{EnvIcon as $e}from"@buoy-gg/floating-tools-core/web";import{JsModal as je,devToolsStorageKeys as ye,ModalHeader as $,HeaderSearchButton as Pe,displayValue as Fe,buoyColors as D,night as J,windowDragProps as We,ToolEmptyState as He,resolveListEmptyState as ze,monoFont as he}from"@buoy-gg/shared-ui/web";import{useCallback as Ke,useState as Z,useRef as Ge,useEffect as be,useMemo as j}from"react";var me={};Oe(me,{AccessibilityInfo:()=>Xe,ActivityIndicator:()=>en,Alert:()=>rn,Animated:()=>Gt,AppRegistry:()=>Ze,AppState:()=>et,Appearance:()=>Qe,BackHandler:()=>tt,Button:()=>tn,CheckBox:()=>ft,Clipboard:()=>nt,DeviceEventEmitter:()=>_t,Dimensions:()=>rt,Easing:()=>at,FlatList:()=>gt,I18nManager:()=>ot,Image:()=>vt,ImageBackground:()=>xt,InteractionManager:()=>it,Keyboard:()=>st,KeyboardAvoidingView:()=>wt,LayoutAnimation:()=>lt,Linking:()=>ct,LogBox:()=>qt,Modal:()=>Qt,NativeEventEmitter:()=>dt,NativeModules:()=>Ye,PanResponder:()=>ut,Picker:()=>Ct,PixelRatio:()=>pt,Platform:()=>yt,Pressable:()=>Xt,ProgressBar:()=>St,RefreshControl:()=>Et,SafeAreaView:()=>kt,ScrollView:()=>we,SectionList:()=>Tt,Share:()=>ht,StatusBar:()=>Vt,StyleSheet:()=>F,Switch:()=>Zt,Text:()=>h,TextInput:()=>Ut,Touchable:()=>Lt,TouchableHighlight:()=>Jt,TouchableNativeFeedback:()=>It,TouchableOpacity:()=>Y,TouchableWithoutFeedback:()=>Yt,UIManager:()=>bt,Vibration:()=>mt,View:()=>y,VirtualizedList:()=>At,YellowBox:()=>Dt,findNodeHandle:()=>nn,unstable_createElement:()=>Je,useColorScheme:()=>Rt,useLocaleContext:()=>Nt,useWindowDimensions:()=>Bt});Me(me,Ue);import*as Ue from"react-native-web";import{unstable_createElement as Je,NativeModules as Ye,AccessibilityInfo as Xe,Appearance as Qe,AppRegistry as Ze,AppState as et,BackHandler as tt,Clipboard as nt,Dimensions as rt,Easing as at,I18nManager as ot,Keyboard as st,InteractionManager as it,LayoutAnimation as lt,Linking as ct,NativeEventEmitter as dt,PanResponder as ut,PixelRatio as pt,Platform as yt,Share as ht,UIManager as bt,Vibration as mt,CheckBox as ft,FlatList as gt,Image as vt,ImageBackground as xt,KeyboardAvoidingView as wt,Picker as Ct,ProgressBar as St,RefreshControl as Et,SafeAreaView as kt,SectionList as Tt,StatusBar as Vt,Touchable as Lt,TouchableNativeFeedback as It,VirtualizedList as At,YellowBox as Dt,LogBox as qt,DeviceEventEmitter as _t,useColorScheme as Rt,useLocaleContext as Nt,useWindowDimensions as Bt}from"react-native-web";import*as b from"react-native-web";import{createElement as ee,forwardRef as fe,useCallback as Ot,useRef as Mt}from"react";import{useEffect as $t,useState as jt}from"react";import{createPortal as Pt}from"react-dom";var Ft='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as Wt}from"react/jsx-runtime";var P=Symbol.for("@buoy-gg/portal-host"),ge=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"};function ve(){let e=document;if(e[P])return e[P].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:Ft});let r=()=>{let o=document.fullscreenElement,u=o&&o.tagName!=="CANVAS"?o:document.body;t.parentElement!==u&&u.appendChild(t)},a=new Map,n=o=>{(!t.contains(o.target)||!ge(o.target))&&a.set(o.code||o.key,{key:o.key,code:o.code,location:o.location,keyCode:o.keyCode,which:o.which,altKey:o.altKey,ctrlKey:o.ctrlKey,metaKey:o.metaKey,shiftKey:o.shiftKey})},s=o=>{a.delete(o.code||o.key)},i=()=>a.clear(),l=()=>{let o=[...a.values()];a.clear();for(let u of o)document.dispatchEvent(new KeyboardEvent("keyup",{...u,bubbles:true}))},c=o=>{ge(o.target)&&o.stopPropagation()},d=o=>o.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",n,true),document.addEventListener("keyup",s,true),window.addEventListener("blur",i),t.addEventListener("focusin",l),t.addEventListener("keydown",c),t.addEventListener("keyup",c),t.addEventListener("keypress",c),t.addEventListener("wheel",d,{passive:true}),e[P]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",n,true),document.removeEventListener("keyup",s,true),window.removeEventListener("blur",i),t.remove(),delete e[P]}},t}function Ht({children:e}){let[t,r]=jt(null);return $t(()=>{let a=ve(),n=document[P];return n.users++,r(a),()=>{--n.users===0&&n.dispose()}},[]),t?Pt(Wt("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}var q=b,zt=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],_=e=>typeof e=="number"?`${e}px`:e;function te(e){if(Array.isArray(e)){let u=e.map(te);return u.some((g,v)=>g!==e[v])?u:e}if(!e||typeof e!="object"||!zt.some(u=>e[u]!=null))return e;let{shadowColor:t,shadowOffset:r,shadowOpacity:a,shadowRadius:n,textShadowColor:s,textShadowOffset:i,textShadowRadius:l,...c}=e;if(t!=null||r!=null||a!=null||n!=null){let u=t??"black",g=a==null?u:`color-mix(in srgb, ${u} ${Math.min(a,1)*100}%, transparent)`,v=`${_(r?.width??0)} ${_(r?.height??0)} ${_(n??0)} ${g}`;c.boxShadow=typeof c.boxShadow=="string"?`${c.boxShadow}, ${v}`:c.boxShadow??v}let{width:d=0,height:o=0}=i??{};if(s&&(d||o||l)){let u=`${_(d)} ${_(o)} ${_(l??0)} ${s}`;c.textShadow=c.textShadow?`${c.textShadow}, ${u}`:u}return c}var Kt=q.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function xe(e,t){if(typeof e=="function")return a=>xe(e(a),t);let r=te(e);return t?[r,Kt[t]]:r}var F={...q.StyleSheet,create:e=>q.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,te(r)])))};function S(e){let t=fe((a,n)=>{let{accessibilityState:s,accessibilityValue:i,pointerEvents:l,...c}=a;for(let o of["busy","checked","disabled","expanded","selected"])s?.[o]!==void 0&&c[`aria-${o}`]===void 0&&(c[`aria-${o}`]=s[o]);for(let[o,u]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))i?.[o]!==void 0&&c[`aria-${u}`]===void 0&&(c[`aria-${u}`]=i[o]);let d=xe(c.style,l);return d!==c.style&&(c.style=d),ee(e,{...c,ref:n})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var y=S(b.View),h=S(b.Text),Gt={...q.Animated,View:q.Animated.createAnimatedComponent(y),Text:q.Animated.createAnimatedComponent(h)},Ut=S(b.TextInput),Y=S(b.TouchableOpacity),Jt=S(b.TouchableHighlight),Yt=S(b.TouchableWithoutFeedback),Xt=S(b.Pressable),we=S(b.ScrollView),Ce=fe((e,t)=>{let r=Mt(null),a=Ot(n=>{if(n){let s=n;for(;s.parentElement&&s.parentElement!==document.body;)s=s.parentElement;s.parentElement===document.body&&(r.current=s,Object.assign(s.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),ve().appendChild(s))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(n):t&&(t.current=n)},[t]);return ee(Ht,null,ee(b.Modal,{...e,ref:a}))});Ce.displayName="Modal";var Qt=S(Ce),Zt=S(b.Switch),en=S(b.ActivityIndicator),tn=S(b.Button),nn=b.findNodeHandle,rn={alert(e,t,r,a){if(typeof document>"u")return;let n=document.createElement("dialog");n.dataset.buoyRoot="",n.setAttribute("aria-label",e),n.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 s=document.createElement("h2");if(s.textContent=e,s.style.cssText="font-size:18px;margin:0 0 12px",n.appendChild(s),t){let d=document.createElement("p");d.textContent=t,d.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",n.appendChild(d)}let i=document.createElement("div");i.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let l=r?.length?r:[{text:"OK"}],c=()=>{n.close?.(),n.remove()};for(let d of l){let o=document.createElement("button");o.type="button",o.textContent=d.text??"OK",o.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${d.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,o.onclick=()=>{c(),d.onPress?.()},i.appendChild(o)}n.addEventListener("cancel",d=>{d.preventDefault(),a?.cancelable!==false&&(c(),a?.onDismiss?.())}),n.appendChild(i),document.body.appendChild(n),n.showModal?n.showModal():n.setAttribute("open","")}};import{CompactRow as an,night as V,monoFont as Se}from"@buoy-gg/shared-ui/web";import{jsx as L,jsxs as R}from"react/jsx-runtime";function on({stats:e,healthPercentage:t,healthStatus:r,healthColor:a,activeFilter:n="all",onFilterChange:s}){let i=e.wrongValueCount+e.wrongTypeCount,l=t===null?"No required variables":`${t}% healthy`;return R(y,{style:p.container,children:[L(an,{statusDotColor:a,statusLabel:"System",statusSublabel:r.toLowerCase(),primaryText:"Environment Configuration",secondaryText:l,testID:"buoy-env-health",statusSublabelTestID:"buoy-env-health-status",accessibilityLabel:`Environment configuration ${r.toLowerCase()}, ${l}`,customBadge:t===null?void 0:L(y,{style:[p.percentBadge,{borderColor:a+"40",backgroundColor:a+"10"}],children:R(h,{style:[p.percentText,{color:a}],testID:"buoy-env-health-percent",children:[t,"%"]})})}),R(y,{style:p.statsGrid,children:[R(Y,{style:[p.statCard,n==="all"&&p.statCardActive],onPress:()=>s?.("all"),activeOpacity:.8,testID:"buoy-env-filter-all",accessibilityRole:"button",accessibilityLabel:"Show all variables",accessibilityState:{selected:n==="all"},children:[L(h,{style:[p.statValue,n==="all"&&p.statValueActive],testID:"buoy-env-filter-all-count",children:e.requiredCount+e.optionalCount}),L(h,{style:[p.statLabel,n==="all"&&p.statLabelActive],children:"ALL"})]}),R(Y,{style:[p.statCard,n==="missing"&&p.statCardActive],onPress:()=>s?.("missing"),activeOpacity:.8,testID:"buoy-env-filter-missing",accessibilityRole:"button",accessibilityLabel:"Show missing variables",accessibilityState:{selected:n==="missing"},children:[L(h,{style:[p.statValue,n==="missing"&&p.statValueActive],testID:"buoy-env-filter-missing-count",children:e.missingCount}),L(h,{style:[p.statLabel,n==="missing"&&p.statLabelActive],children:"MISSING"})]}),R(Y,{style:[p.statCard,n==="issues"&&p.statCardActive],onPress:()=>s?.("issues"),activeOpacity:.8,testID:"buoy-env-filter-issues",accessibilityRole:"button",accessibilityLabel:"Show variables with issues",accessibilityState:{selected:n==="issues"},children:[L(h,{style:[p.statValue,n==="issues"&&p.statValueActive],testID:"buoy-env-filter-issues-count",children:i}),L(h,{style:[p.statLabel,n==="issues"&&p.statLabelActive],children:"ISSUES"})]})]})]})}var p=F.create({container:{gap:8},statsGrid:{flexDirection:"row",gap:8,paddingHorizontal:4},statCard:{flex:1,backgroundColor:V.color.surface,borderRadius:10,borderWidth:1,borderColor:V.color.border,padding:12,alignItems:"center",justifyContent:"center",minHeight:64},statCardActive:{borderColor:V.color.accentBorderStrong,backgroundColor:V.color.accentSoft},statValue:{fontSize:22,fontWeight:"700",fontFamily:Se,lineHeight:26,color:V.color.text},statValueActive:{color:V.color.accent},statLabel:{fontSize:9,color:V.color.textTertiary,marginTop:4,textTransform:"uppercase",letterSpacing:.5,fontWeight:"600"},statLabelActive:{color:V.color.accent},percentBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:6,borderWidth:1},percentText:{fontSize:14,fontWeight:"700",fontFamily:Se}});import{useMemo as Ee}from"react";var ke=null;function sn(e){ke=e}function Te(){return ke}function ln({envFilter:e=()=>true}={}){let t=Te()??(typeof process>"u"?{}:process.env),r=Ee(()=>a=>{let n=t[a];if(n===void 0)return null;try{if(n.startsWith("{")||n.startsWith("["))return JSON.parse(n);if(n.toLowerCase()==="true")return true;if(n.toLowerCase()==="false")return false;if(/^\d+$/.test(n)){let s=parseInt(n,10);return isNaN(s)?n:s}if(/^\d*\.\d+$/.test(n)){let s=parseFloat(n);return isNaN(s)?n:s}return n}catch{return n}},[t]);return Ee(()=>Object.keys(t).filter(a=>{let n=t[a];return e(a,n)}).map(a=>({key:a,data:r(a)})),[e,r,t])}function ne(e){let t=typeof e;if(t==="boolean")return"boolean";if(t==="number")return"number";if(Array.isArray(e))return"array";if(t==="object"&&e!==null)return"object";if(t==="string"){let r=e;if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{let n=JSON.parse(r);return Array.isArray(n)?"array":"object"}catch{return"string"}let a=r.toLowerCase();return a==="true"||a==="false"||a==="enabled"||a==="disabled"||a==="yes"||a==="no"||a==="on"||a==="off"?"boolean":!isNaN(Number(r))&&r.trim()!==""?"number":r.startsWith("http://")||r.startsWith("https://")?"url":r.includes(",")?"array":"string"}return"unknown"}var cn=class{constructor(e){this.key=e}exists(){return this.key}withValue(e){return this.expectedValue=e,delete this.expectedType,this}withType(e){return this.expectedType=e,delete this.expectedValue,this}withDescription(e){return this.description=e,this}build(){return this.expectedValue!==void 0?this.description?{key:this.key,expectedValue:this.expectedValue,description:this.description}:{key:this.key,expectedValue:this.expectedValue}:this.expectedType!==void 0?this.description?{key:this.key,expectedType:this.expectedType,description:this.description}:{key:this.key,expectedType:this.expectedType}:this.key}};function dn(e){return new cn(e)}function un(e){return e}var re=(e,t)=>{let r=[],a=[],n=new Set;return t?.forEach(s=>{let i=typeof s=="string"?s:s.key,l=typeof s=="object"&&"expectedValue"in s?s.expectedValue:void 0,c=typeof s=="object"&&"expectedType"in s?s.expectedType:void 0,d=typeof s=="object"&&"description"in s?s.description:void 0;n.add(i);let o=e[i],u=o!==void 0,g;if(!u)g="required_missing";else if(l){let v=false;l==="sk_*"?v=o.startsWith("sk_"):l==="production or development"?v=o==="production"||o==="development":v=o===l,g=v?"required_present":"required_wrong_value"}else c&&ne(o).toLowerCase()!==c.toLowerCase()?g="required_wrong_type":g="required_present";r.push({key:i,value:o,expectedValue:l,expectedType:c,description:d,status:g,category:"required"})}),Object.entries(e).forEach(([s,i])=>{n.has(s)||a.push({key:s,value:i,status:"optional_present",category:"optional"})}),r.sort((s,i)=>{let l={required_missing:0,required_wrong_value:1,required_wrong_type:2,required_present:3,optional_present:4};return l[s.status]!==l[i.status]?l[s.status]-l[i.status]:s.key.localeCompare(i.key)}),a.sort((s,i)=>s.key.localeCompare(i.key)),{requiredVars:r,optionalVars:a}},Ve=(e,t,r)=>{let a=Object.keys(r).length,n=e.length,s=e.filter(o=>o.status==="required_missing").length,i=e.filter(o=>o.status==="required_wrong_value").length,l=e.filter(o=>o.status==="required_wrong_type").length,c=e.filter(o=>o.status==="required_present").length,d=t.length;return{totalCount:a,requiredCount:n,missingCount:s,wrongValueCount:i,wrongTypeCount:l,presentRequiredCount:c,optionalCount:d}};import{useCallback as pn,useState as yn}from"react";import{CompactRow as hn,TypeBadge as ae,buoyColors as N,night as oe,monoFont as se}from"@buoy-gg/shared-ui/web";import{Fragment as bn,jsx as E,jsxs as A}from"react/jsx-runtime";var mn=(e,t)=>{switch(e){case"required_present":return{label:"Valid",color:N.success,sublabel:"Required"};case"required_missing":return{label:"Missing",color:N.error,sublabel:"Required"};case"required_wrong_value":return{label:"Wrong",color:N.warning,sublabel:"Invalid value"};case"required_wrong_type":return{label:"Type Error",color:N.info,sublabel:"Wrong type"};case"optional_present":return{label:"Set",color:N.textSecondary,sublabel:"Optional"}}};var fn=e=>e==null?"undefined":typeof e=="string"?e:String(e);function gn({envVar:e,isExpanded:t,onPress:r}){let a=mn(e.status,e.expectedType),n=e.value!==void 0&&e.value!==null,s=e.key.split("_").map(c=>c.toLowerCase()).join(" \u203A "),i=`buoy-env-row-${e.key}`,l=A(y,{style:m.expandedContainer,children:[A(y,{style:m.expandedRow,children:[E(h,{style:m.expandedLabel,children:"Value:"}),E(h,{style:m.expandedValue,numberOfLines:3,testID:`${i}-value`,children:fn(e.value)||"undefined"})]}),e.status==="required_wrong_type"&&e.expectedType&&A(bn,{children:[A(y,{style:m.expandedRow,children:[E(h,{style:m.expandedLabel,children:"Type:"}),E(ae,{type:ne(e.value),testID:`${i}-actual-type`})]}),A(y,{style:m.expandedRow,children:[E(h,{style:m.expandedLabel,children:"Expected:"}),E(ae,{type:e.expectedType,testID:`${i}-expected-type`})]})]}),e.status==="required_wrong_value"&&e.expectedValue&&A(y,{style:m.expandedRow,children:[E(h,{style:m.expandedLabel,children:"Expected:"}),E(h,{style:m.expandedExpected,testID:`${i}-expected-value`,children:String(e.expectedValue)})]}),e.description&&A(y,{style:m.expandedRow,children:[E(h,{style:m.expandedLabel,children:"Info:"}),E(h,{style:m.expandedDescription,testID:`${i}-description`,children:e.description})]})]});return E(hn,{statusDotColor:a.color,statusLabel:a.label,statusSublabel:a.sublabel,primaryText:s,secondaryText:void 0,expandedContent:l,isExpanded:t,expandedGlowColor:a.color,customBadge:e.expectedType?E(ae,{type:e.expectedType,testID:`${i}-type-badge`}):void 0,showChevron:true,onPress:r?()=>r(e):void 0,testID:i,statusTestID:`${i}-status`,statusSublabelTestID:`${i}-category`,accessibilityLabel:`${e.key}, ${a.label}, ${a.sublabel}`})}var m=F.create({expandedContainer:{gap:6},expandedRow:{flexDirection:"row",alignItems:"center",gap:8},expandedLabel:{fontSize:10,color:oe.color.textTertiary,fontWeight:"600",minWidth:60,fontFamily:se},expandedValue:{fontSize:11,color:oe.color.textSecondary,fontFamily:se,flex:1},expandedExpected:{fontSize:11,color:N.warning,fontFamily:se,flex:1},expandedDescription:{fontSize:11,color:oe.color.textSecondary,flex:1}});import{SectionHeader as B,night as W,monoFont as vn}from"@buoy-gg/shared-ui/web";import{jsx as I,jsxs as X}from"react/jsx-runtime";function xn({title:e,count:t,vars:r,emptyMessage:a}){let[n,s]=yn(null),i=pn(l=>{s(c=>c===l.key?null:l.key)},[]);return r.length===0&&e==="Required Variables"?X(y,{style:H.sectionContainer,children:[X(B,{children:[I(B.Title,{children:e}),I(B.Badge,{count:0,color:W.color.accent})]}),I(y,{style:H.emptySection,children:I(h,{style:H.emptySectionText,children:a})})]}):r.length===0?null:X(y,{style:H.sectionContainer,children:[e!==""&&X(B,{children:[I(B.Title,{children:e}),I(B.Badge,{count:t,color:W.color.accent})]}),I(y,{style:H.sectionContent,children:r.map(l=>I(gn,{envVar:l,isExpanded:n===l.key,onPress:i},l.key))})]})}var H=F.create({sectionContainer:{gap:8},sectionContent:{},emptySection:{padding:20,backgroundColor:W.color.accent+"08",borderRadius:8,borderWidth:1,borderColor:W.color.accent+"20",alignItems:"center"},emptySectionText:{color:W.color.accent,fontSize:11,textAlign:"center",fontFamily:vn,opacity:.8,letterSpacing:.5}});import{jsx as f,jsxs as z}from"react/jsx-runtime";function ie({visible:e,onClose:t,requiredEnvVars:r,onBack:a,onMinimize:n,enableSharedModalDimensions:s=false,inline:i=false}){let[l,c]=Z("all"),[d,o]=Z(false),[u,g]=Z(""),v=Ge(null),Ae=Ke(x=>{},[]);be(()=>{d&&v.current&&v.current.focus()},[d]),be(()=>{g(""),o(false)},[l]);let le=ln(),K=j(()=>{let x={};return le.forEach(({key:w,data:C})=>{C!=null&&(x[w]=typeof C=="string"?C:Fe(C))}),x},[le]),{requiredVars:G,optionalVars:O}=j(()=>re(K,r),[K,r]),U=j(()=>r===void 0?{totalCount:0,requiredCount:0,optionalCount:0,presentRequiredCount:0,missingCount:0,wrongValueCount:0,wrongTypeCount:0}:Ve(G,O,K),[r,G,O,K]),M=j(()=>[...G,...O].sort((x,w)=>{let C={required_missing:1,required_wrong_type:2,required_wrong_value:3,required_present:4,optional_present:5};return(C[x.status]||999)-(C[w.status]||999)}),[G,O]),Q=j(()=>{let x=[];switch(l){case"all":x=M;break;case"missing":x=M.filter(w=>w.status==="required_missing");break;case"issues":x=M.filter(w=>w.status==="required_wrong_type"||w.status==="required_wrong_value");break}if(u){let w=u.toLowerCase();x=x.filter(C=>C.key.toLowerCase().includes(w)||C.description?.toLowerCase().includes(w)||typeof C.value=="string"&&C.value.toLowerCase().includes(w))}return x},[M,O,l,u]),k=U.requiredCount>0?Math.round(U.presentRequiredCount/U.requiredCount*100):null,De=k===null?"NOTHING TO CHECK":k===100?"HEALTHY":k>=75?"WARNING":k>=50?"ERROR":"CRITICAL",qe=k===null?D.textMuted:k===100?D.success:k>=75?D.warning:k>=50?D.error:D.error;if(!e)return null;let _e=s?ye.modal.root():ye.env.modal(),ce=z($,{children:[a&&f($.Navigation,{onBack:a}),f($.Content,{title:d?"":"Environment Variables",noMargin:d,children:d&&f($.Search,{value:u,onChangeText:g,onCancel:()=>{o(false),g("")},placeholder:"Search env keys...",accessibilityLabel:"Search env keys",testID:"buoy-env-search",containerTestID:"buoy-env-search-field",clearTestID:"buoy-env-search-clear"})}),f($.Actions,{children:!d&&f(Pe,{onPress:()=>o(true),testID:"buoy-env-search-open",accessibilityLabel:"Search env keys"})})]}),de=z(we,{style:T.scrollContainer,contentContainerStyle:T.contentContainer,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"on-drag",testID:"buoy-env-scroll",children:[f(on,{stats:U,healthPercentage:k,healthStatus:De,healthColor:qe,activeFilter:l,onFilterChange:c}),Q.length>0?z(y,{style:T.varsSection,children:[z(y,{style:T.sectionHeader,children:[f(h,{style:T.sectionTitle,testID:"buoy-env-section-title",children:l==="all"?"ALL VARIABLES":l==="missing"?"MISSING VARIABLES":"ISSUES TO FIX"}),f(y,{style:T.countBadge,children:f(h,{style:T.countText,testID:"buoy-env-section-count",children:Q.length})})]}),f(xn,{title:"",count:0,vars:Q,emptyMessage:""})]}):f(He,{testID:"buoy-env-empty",...ze({subject:"variables",verb:"declared",search:u,total:M.length,waiting:{otto:"keys",title:"No variables",message:"No variables found"}})})]});return i?z(y,{style:T.inlineRoot,children:[f(y,{style:T.inlineHeader,...We,children:ce}),de]}):f(je,{visible:e,onClose:t,onMinimize:n,persistenceKey:_e,header:{customContent:ce,showToggleButton:true},onModeChange:Ae,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},children:de})}function wn({requiredEnvVars:e}){return f(ie,{inline:true,visible:true,requiredEnvVars:e,onClose:()=>{}})}var T=F.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:D.border,backgroundColor:"transparent"},scrollContainer:{flex:1,backgroundColor:"transparent"},contentContainer:{padding:8,paddingBottom:24},varsSection:{marginTop:16},sectionHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8,paddingHorizontal:8},sectionTitle:{fontSize:10,fontWeight:"700",color:J.color.textTertiary,letterSpacing:1.2,fontFamily:he},countBadge:{backgroundColor:J.color.accent+"15",paddingHorizontal:8,paddingVertical:2,borderRadius:9999,borderWidth:1,borderColor:J.color.accent+"40"},countText:{fontSize:10,fontWeight:"500",color:J.color.accent,fontFamily:he}});import{maskBuoyAccountKeys as Cn}from"@buoy-gg/license/web";function Sn(){let e={};for(let[t,r]of Object.entries(Te()??(typeof process>"u"?{}:process.env)))typeof r=="string"&&(e[t]=r);return e}var Le=[];function En(e){Le=e}function kn(e=[]){return{version:1,getSnapshot:()=>{let t=Sn(),r=e.length>0?e:Le,a=[];try{a=re(t,r).requiredVars.map(n=>({key:n.key,status:n.status}))}catch{a=[]}return{env:Cn(t),requiredEnvVars:r,checks:a}},subscribe:()=>()=>{}}}import{createToolFactory as Tn,defineToolPreset as Vn}from"@buoy-gg/shared-ui/web";import{jsx as Ln}from"react/jsx-runtime";var Ie=Vn({id:"env",name:"ENV",description:"Environment variables debugger",slot:"both",icon:({size:e})=>Ln($e,{size:e}),component:ie,props:{requiredEnvVars:[],enableSharedModalDimensions:true}}),In=Tn(Ie,e=>(En(e.requiredEnvVars||[]),{requiredEnvVars:e.requiredEnvVars||[],enableSharedModalDimensions:e.enableSharedModalDimensions??true}));export{wn as EnvToolView,ie as EnvVarsModal,Ve as calculateStats,kn as createEnvSyncAdapter,In as createEnvTool,un as createEnvVarConfig,Ie as envToolPreset,dn as envVar,ne as getEnvVarType,re as processEnvVars,sn as setRemoteEnv};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/env",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.80",
|
|
4
4
|
"description": "Environment variable inspector for React Native with runtime-visible values, required-variable checks, and type validation.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -34,8 +34,9 @@
|
|
|
34
34
|
],
|
|
35
35
|
"sideEffects": false,
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@buoy-gg/floating-tools-core": "^7.0.
|
|
38
|
-
"@buoy-gg/
|
|
37
|
+
"@buoy-gg/floating-tools-core": "^7.0.80",
|
|
38
|
+
"@buoy-gg/license": "^7.0.80",
|
|
39
|
+
"@buoy-gg/shared-ui": "^7.0.80"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
42
|
"react": "*"
|